deskssh 0.1.0 → 0.1.1
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.
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
function S1(e,t){for(var i=0;i<t.length;i++){const s=t[i];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in e)){const n=Object.getOwnPropertyDescriptor(s,r);n&&Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function i(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(r){if(r.ep)return;r.ep=!0;const n=i(r);fetch(r.href,n)}})();function b1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bp={exports:{}},Jl={};/**
|
|
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 w1=Symbol.for("react.transitional.element"),C1=Symbol.for("react.fragment");function wp(e,t,i){var s=null;if(i!==void 0&&(s=""+i),t.key!==void 0&&(s=""+t.key),"key"in t){i={};for(var r in t)r!=="key"&&(i[r]=t[r])}else i=t;return t=i.ref,{$$typeof:w1,type:e,key:s,ref:t!==void 0?t:null,props:i}}Jl.Fragment=C1;Jl.jsx=wp;Jl.jsxs=wp;bp.exports=Jl;var b=bp.exports,Cp={exports:{}},V={};/**
|
|
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 kd=Symbol.for("react.transitional.element"),x1=Symbol.for("react.portal"),E1=Symbol.for("react.fragment"),A1=Symbol.for("react.strict_mode"),k1=Symbol.for("react.profiler"),D1=Symbol.for("react.consumer"),R1=Symbol.for("react.context"),M1=Symbol.for("react.forward_ref"),T1=Symbol.for("react.suspense"),O1=Symbol.for("react.memo"),xp=Symbol.for("react.lazy"),N1=Symbol.for("react.activity"),c_=Symbol.iterator;function B1(e){return e===null||typeof e!="object"?null:(e=c_&&e[c_]||e["@@iterator"],typeof e=="function"?e:null)}var Ep={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ap=Object.assign,kp={};function kn(e,t,i){this.props=e,this.context=t,this.refs=kp,this.updater=i||Ep}kn.prototype.isReactComponent={};kn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};kn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Dp(){}Dp.prototype=kn.prototype;function Dd(e,t,i){this.props=e,this.context=t,this.refs=kp,this.updater=i||Ep}var Rd=Dd.prototype=new Dp;Rd.constructor=Dd;Ap(Rd,kn.prototype);Rd.isPureReactComponent=!0;var u_=Array.isArray;function ju(){}var Se={H:null,A:null,T:null,S:null},Rp=Object.prototype.hasOwnProperty;function Md(e,t,i){var s=i.ref;return{$$typeof:kd,type:e,key:t,ref:s!==void 0?s:null,props:i}}function z1(e,t){return Md(e.type,t,e.props)}function Td(e){return typeof e=="object"&&e!==null&&e.$$typeof===kd}function L1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(i){return t[i]})}var h_=/\/+/g;function Oc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?L1(""+e.key):t.toString(36)}function H1(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(ju,ju):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Pr(e,t,i,s,r){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(n){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case kd:case x1:a=!0;break;case xp:return a=e._init,Pr(a(e._payload),t,i,s,r)}}if(a)return r=r(e),a=s===""?"."+Oc(e,0):s,u_(r)?(i="",a!=null&&(i=a.replace(h_,"$&/")+"/"),Pr(r,t,i,"",function(l){return l})):r!=null&&(Td(r)&&(r=z1(r,i+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(h_,"$&/")+"/")+a)),t.push(r)),1;a=0;var o=s===""?".":s+":";if(u_(e))for(var c=0;c<e.length;c++)s=e[c],n=o+Oc(s,c),a+=Pr(s,t,i,n,r);else if(c=B1(e),typeof c=="function")for(e=c.call(e),c=0;!(s=e.next()).done;)s=s.value,n=o+Oc(s,c++),a+=Pr(s,t,i,n,r);else if(n==="object"){if(typeof e.then=="function")return Pr(H1(e),t,i,s,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function co(e,t,i){if(e==null)return e;var s=[],r=0;return Pr(e,s,"","",function(n){return t.call(i,n,r++)}),s}function P1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(i){(e._status===0||e._status===-1)&&(e._status=1,e._result=i)},function(i){(e._status===0||e._status===-1)&&(e._status=2,e._result=i)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var d_=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)},U1={map:co,forEach:function(e,t,i){co(e,function(){t.apply(this,arguments)},i)},count:function(e){var t=0;return co(e,function(){t++}),t},toArray:function(e){return co(e,function(t){return t})||[]},only:function(e){if(!Td(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};V.Activity=N1;V.Children=U1;V.Component=kn;V.Fragment=E1;V.Profiler=k1;V.PureComponent=Dd;V.StrictMode=A1;V.Suspense=T1;V.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Se;V.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Se.H.useMemoCache(e)}};V.cache=function(e){return function(){return e.apply(null,arguments)}};V.cacheSignal=function(){return null};V.cloneElement=function(e,t,i){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=Ap({},e.props),r=e.key;if(t!=null)for(n in t.key!==void 0&&(r=""+t.key),t)!Rp.call(t,n)||n==="key"||n==="__self"||n==="__source"||n==="ref"&&t.ref===void 0||(s[n]=t[n]);var n=arguments.length-2;if(n===1)s.children=i;else if(1<n){for(var a=Array(n),o=0;o<n;o++)a[o]=arguments[o+2];s.children=a}return Md(e.type,r,s)};V.createContext=function(e){return e={$$typeof:R1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:D1,_context:e},e};V.createElement=function(e,t,i){var s,r={},n=null;if(t!=null)for(s in t.key!==void 0&&(n=""+t.key),t)Rp.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);var a=arguments.length-2;if(a===1)r.children=i;else if(1<a){for(var o=Array(a),c=0;c<a;c++)o[c]=arguments[c+2];r.children=o}if(e&&e.defaultProps)for(s in a=e.defaultProps,a)r[s]===void 0&&(r[s]=a[s]);return Md(e,n,r)};V.createRef=function(){return{current:null}};V.forwardRef=function(e){return{$$typeof:M1,render:e}};V.isValidElement=Td;V.lazy=function(e){return{$$typeof:xp,_payload:{_status:-1,_result:e},_init:P1}};V.memo=function(e,t){return{$$typeof:O1,type:e,compare:t===void 0?null:t}};V.startTransition=function(e){var t=Se.T,i={};Se.T=i;try{var s=e(),r=Se.S;r!==null&&r(i,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(ju,d_)}catch(n){d_(n)}finally{t!==null&&i.types!==null&&(t.types=i.types),Se.T=t}};V.unstable_useCacheRefresh=function(){return Se.H.useCacheRefresh()};V.use=function(e){return Se.H.use(e)};V.useActionState=function(e,t,i){return Se.H.useActionState(e,t,i)};V.useCallback=function(e,t){return Se.H.useCallback(e,t)};V.useContext=function(e){return Se.H.useContext(e)};V.useDebugValue=function(){};V.useDeferredValue=function(e,t){return Se.H.useDeferredValue(e,t)};V.useEffect=function(e,t){return Se.H.useEffect(e,t)};V.useEffectEvent=function(e){return Se.H.useEffectEvent(e)};V.useId=function(){return Se.H.useId()};V.useImperativeHandle=function(e,t,i){return Se.H.useImperativeHandle(e,t,i)};V.useInsertionEffect=function(e,t){return Se.H.useInsertionEffect(e,t)};V.useLayoutEffect=function(e,t){return Se.H.useLayoutEffect(e,t)};V.useMemo=function(e,t){return Se.H.useMemo(e,t)};V.useOptimistic=function(e,t){return Se.H.useOptimistic(e,t)};V.useReducer=function(e,t,i){return Se.H.useReducer(e,t,i)};V.useRef=function(e){return Se.H.useRef(e)};V.useState=function(e){return Se.H.useState(e)};V.useSyncExternalStore=function(e,t,i){return Se.H.useSyncExternalStore(e,t,i)};V.useTransition=function(){return Se.H.useTransition()};V.version="19.2.7";Cp.exports=V;var S=Cp.exports;const j1=b1(S),Od=S1({__proto__:null,default:j1},[S]);var Mp={exports:{}},ec={},Tp={exports:{}},Op={};/**
|
|
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
|
+
*/(function(e){function t(x,O){var A=x.length;x.push(O);e:for(;0<A;){var W=A-1>>>1,z=x[W];if(0<r(z,O))x[W]=O,x[A]=z,A=W;else break e}}function i(x){return x.length===0?null:x[0]}function s(x){if(x.length===0)return null;var O=x[0],A=x.pop();if(A!==O){x[0]=A;e:for(var W=0,z=x.length,Oe=z>>>1;W<Oe;){var Ne=2*(W+1)-1,Be=x[Ne],ue=Ne+1,se=x[ue];if(0>r(Be,A))ue<z&&0>r(se,Be)?(x[W]=se,x[ue]=A,W=ue):(x[W]=Be,x[Ne]=A,W=Ne);else if(ue<z&&0>r(se,A))x[W]=se,x[ue]=A,W=ue;else break e}}return O}function r(x,O){var A=x.sortIndex-O.sortIndex;return A!==0?A:x.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var n=performance;e.unstable_now=function(){return n.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var c=[],l=[],h=1,u=null,d=3,f=!1,_=!1,m=!1,w=!1,g=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function y(x){for(var O=i(l);O!==null;){if(O.callback===null)s(l);else if(O.startTime<=x)s(l),O.sortIndex=O.expirationTime,t(c,O);else break;O=i(l)}}function C(x){if(m=!1,y(x),!_)if(i(c)!==null)_=!0,k||(k=!0,B());else{var O=i(l);O!==null&&L(C,O.startTime-x)}}var k=!1,D=-1,E=5,N=-1;function U(){return w?!0:!(e.unstable_now()-N<E)}function I(){if(w=!1,k){var x=e.unstable_now();N=x;var O=!0;try{e:{_=!1,m&&(m=!1,p(D),D=-1),f=!0;var A=d;try{t:{for(y(x),u=i(c);u!==null&&!(u.expirationTime>x&&U());){var W=u.callback;if(typeof W=="function"){u.callback=null,d=u.priorityLevel;var z=W(u.expirationTime<=x);if(x=e.unstable_now(),typeof z=="function"){u.callback=z,y(x),O=!0;break t}u===i(c)&&s(c),y(x)}else s(c);u=i(c)}if(u!==null)O=!0;else{var Oe=i(l);Oe!==null&&L(C,Oe.startTime-x),O=!1}}break e}finally{u=null,d=A,f=!1}O=void 0}}finally{O?B():k=!1}}}var B;if(typeof v=="function")B=function(){v(I)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,H=R.port2;R.port1.onmessage=I,B=function(){H.postMessage(null)}}else B=function(){g(I,0)};function L(x,O){D=g(function(){x(e.unstable_now())},O)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(x){x.callback=null},e.unstable_forceFrameRate=function(x){0>x||125<x?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<x?Math.floor(1e3/x):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_next=function(x){switch(d){case 1:case 2:case 3:var O=3;break;default:O=d}var A=d;d=O;try{return x()}finally{d=A}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(x,O){switch(x){case 1:case 2:case 3:case 4:case 5:break;default:x=3}var A=d;d=x;try{return O()}finally{d=A}},e.unstable_scheduleCallback=function(x,O,A){var W=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?W+A:W):A=W,x){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=A+z,x={id:h++,callback:O,priorityLevel:x,startTime:A,expirationTime:z,sortIndex:-1},A>W?(x.sortIndex=A,t(l,x),i(c)===null&&x===i(l)&&(m?(p(D),D=-1):m=!0,L(C,A-W))):(x.sortIndex=z,t(c,x),_||f||(_=!0,k||(k=!0,B()))),x},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(x){var O=d;return function(){var A=d;d=O;try{return x.apply(this,arguments)}finally{d=A}}}})(Op);Tp.exports=Op;var W1=Tp.exports,Np={exports:{}},vt={};/**
|
|
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 I1=S;function Bp(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 ls(){}var pt={d:{f:ls,r:function(){throw Error(Bp(522))},D:ls,C:ls,L:ls,m:ls,X:ls,S:ls,M:ls},p:0,findDOMNode:null},q1=Symbol.for("react.portal");function F1(e,t,i){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:q1,key:s==null?null:""+s,children:e,containerInfo:t,implementation:i}}var ua=I1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function tc(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}vt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=pt;vt.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Bp(299));return F1(e,t,null,i)};vt.flushSync=function(e){var t=ua.T,i=pt.p;try{if(ua.T=null,pt.p=2,e)return e()}finally{ua.T=t,pt.p=i,pt.d.f()}};vt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,pt.d.C(e,t))};vt.prefetchDNS=function(e){typeof e=="string"&&pt.d.D(e)};vt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var i=t.as,s=tc(i,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,n=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;i==="style"?pt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:n}):i==="script"&&pt.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:n,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};vt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var i=tc(t.as,t.crossOrigin);pt.d.M(e,{crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&pt.d.M(e)};vt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var i=t.as,s=tc(i,t.crossOrigin);pt.d.L(e,i,{crossOrigin:s,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};vt.preloadModule=function(e,t){if(typeof e=="string")if(t){var i=tc(t.as,t.crossOrigin);pt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else pt.d.m(e)};vt.requestFormReset=function(e){pt.d.r(e)};vt.unstable_batchedUpdates=function(e,t){return e(t)};vt.useFormState=function(e,t,i){return ua.H.useFormState(e,t,i)};vt.useFormStatus=function(){return ua.H.useHostTransitionStatus()};vt.version="19.2.7";function zp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(zp)}catch(e){console.error(e)}}zp(),Np.exports=vt;var ic=Np.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 Ge=W1,Lp=S,K1=ic;function M(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 Hp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function qa(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function Pp(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 Up(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 f_(e){if(qa(e)!==e)throw Error(M(188))}function Y1(e){var t=e.alternate;if(!t){if(t=qa(e),t===null)throw Error(M(188));return t!==e?null:e}for(var i=e,s=t;;){var r=i.return;if(r===null)break;var n=r.alternate;if(n===null){if(s=r.return,s!==null){i=s;continue}break}if(r.child===n.child){for(n=r.child;n;){if(n===i)return f_(r),e;if(n===s)return f_(r),t;n=n.sibling}throw Error(M(188))}if(i.return!==s.return)i=r,s=n;else{for(var a=!1,o=r.child;o;){if(o===i){a=!0,i=r,s=n;break}if(o===s){a=!0,s=r,i=n;break}o=o.sibling}if(!a){for(o=n.child;o;){if(o===i){a=!0,i=n,s=r;break}if(o===s){a=!0,s=n,i=r;break}o=o.sibling}if(!a)throw Error(M(189))}}if(i.alternate!==s)throw Error(M(190))}if(i.tag!==3)throw Error(M(188));return i.stateNode.current===i?e:t}function jp(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=jp(e),t!==null)return t;e=e.sibling}return null}var be=Object.assign,V1=Symbol.for("react.element"),uo=Symbol.for("react.transitional.element"),ea=Symbol.for("react.portal"),Wr=Symbol.for("react.fragment"),Wp=Symbol.for("react.strict_mode"),Wu=Symbol.for("react.profiler"),Ip=Symbol.for("react.consumer"),Ii=Symbol.for("react.context"),Nd=Symbol.for("react.forward_ref"),Iu=Symbol.for("react.suspense"),qu=Symbol.for("react.suspense_list"),Bd=Symbol.for("react.memo"),_s=Symbol.for("react.lazy"),Fu=Symbol.for("react.activity"),G1=Symbol.for("react.memo_cache_sentinel"),__=Symbol.iterator;function jn(e){return e===null||typeof e!="object"?null:(e=__&&e[__]||e["@@iterator"],typeof e=="function"?e:null)}var $1=Symbol.for("react.client.reference");function Ku(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===$1?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Wr:return"Fragment";case Wu:return"Profiler";case Wp:return"StrictMode";case Iu:return"Suspense";case qu:return"SuspenseList";case Fu:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case ea:return"Portal";case Ii:return e.displayName||"Context";case Ip:return(e._context.displayName||"Context")+".Consumer";case Nd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Bd:return t=e.displayName||null,t!==null?t:Ku(e.type)||"Memo";case _s:t=e._payload,e=e._init;try{return Ku(e(t))}catch{}}return null}var ta=Array.isArray,K=Lp.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=K1.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,rr={pending:!1,data:null,method:null,action:null},Yu=[],Ir=-1;function Ri(e){return{current:e}}function st(e){0>Ir||(e.current=Yu[Ir],Yu[Ir]=null,Ir--)}function ge(e,t){Ir++,Yu[Ir]=e.current,e.current=t}var Ei=Ri(null),Ea=Ri(null),ks=Ri(null),dl=Ri(null);function fl(e,t){switch(ge(ks,t),ge(Ea,e),ge(Ei,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Sm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Sm(t),e=l0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}st(Ei),ge(Ei,e)}function hn(){st(Ei),st(Ea),st(ks)}function Vu(e){e.memoizedState!==null&&ge(dl,e);var t=Ei.current,i=l0(t,e.type);t!==i&&(ge(Ea,e),ge(Ei,i))}function _l(e){Ea.current===e&&(st(Ei),st(Ea)),dl.current===e&&(st(dl),La._currentValue=rr)}var Nc,m_;function Zs(e){if(Nc===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Nc=t&&t[1]||"",m_=-1<i.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Nc+e+m_}var Bc=!1;function zc(e,t){if(!e||Bc)return"";Bc=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(f){var d=f}Reflect.construct(e,[],u)}else{try{u.call()}catch(f){d=f}e.call(u.prototype)}}else{try{throw Error()}catch(f){d=f}(u=e())&&typeof u.catch=="function"&&u.catch(function(){})}}catch(f){if(f&&d&&typeof f.stack=="string")return[f.stack,d.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=s.DetermineComponentFrameRoot(),a=n[0],o=n[1];if(a&&o){var c=a.split(`
|
|
44
|
+
`),l=o.split(`
|
|
45
|
+
`);for(r=s=0;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;for(;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;if(s===c.length||r===l.length)for(s=c.length-1,r=l.length-1;1<=s&&0<=r&&c[s]!==l[r];)r--;for(;1<=s&&0<=r;s--,r--)if(c[s]!==l[r]){if(s!==1||r!==1)do if(s--,r--,0>r||c[s]!==l[r]){var h=`
|
|
46
|
+
`+c[s].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),h}while(1<=s&&0<=r);break}}}finally{Bc=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Zs(i):""}function X1(e,t){switch(e.tag){case 26:case 27:case 5:return Zs(e.type);case 16:return Zs("Lazy");case 13:return e.child!==t&&t!==null?Zs("Suspense Fallback"):Zs("Suspense");case 19:return Zs("SuspenseList");case 0:case 15:return zc(e.type,!1);case 11:return zc(e.type.render,!1);case 1:return zc(e.type,!0);case 31:return Zs("Activity");default:return""}}function g_(e){try{var t="",i=null;do t+=X1(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
|
|
47
|
+
Error generating stack: `+s.message+`
|
|
48
|
+
`+s.stack}}var Gu=Object.prototype.hasOwnProperty,zd=Ge.unstable_scheduleCallback,Lc=Ge.unstable_cancelCallback,Z1=Ge.unstable_shouldYield,Q1=Ge.unstable_requestPaint,Ut=Ge.unstable_now,J1=Ge.unstable_getCurrentPriorityLevel,qp=Ge.unstable_ImmediatePriority,Fp=Ge.unstable_UserBlockingPriority,ml=Ge.unstable_NormalPriority,ew=Ge.unstable_LowPriority,Kp=Ge.unstable_IdlePriority,tw=Ge.log,iw=Ge.unstable_setDisableYieldValue,Fa=null,jt=null;function bs(e){if(typeof tw=="function"&&iw(e),jt&&typeof jt.setStrictMode=="function")try{jt.setStrictMode(Fa,e)}catch{}}var Wt=Math.clz32?Math.clz32:nw,sw=Math.log,rw=Math.LN2;function nw(e){return e>>>=0,e===0?32:31-(sw(e)/rw|0)|0}var ho=256,fo=262144,_o=4194304;function Qs(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 sc(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var r=0,n=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var o=s&134217727;return o!==0?(s=o&~n,s!==0?r=Qs(s):(a&=o,a!==0?r=Qs(a):i||(i=o&~e,i!==0&&(r=Qs(i))))):(o=s&~n,o!==0?r=Qs(o):a!==0?r=Qs(a):i||(i=s&~e,i!==0&&(r=Qs(i)))),r===0?0:t!==0&&t!==r&&!(t&n)&&(n=r&-r,i=t&-t,n>=i||n===32&&(i&4194048)!==0)?t:r}function Ka(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function aw(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 Yp(){var e=_o;return _o<<=1,!(_o&62914560)&&(_o=4194304),e}function Hc(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ya(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ow(e,t,i,s,r,n){var a=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var o=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(i=a&~i;0<i;){var h=31-Wt(i),u=1<<h;o[h]=0,c[h]=-1;var d=l[h];if(d!==null)for(l[h]=null,h=0;h<d.length;h++){var f=d[h];f!==null&&(f.lane&=-536870913)}i&=~u}s!==0&&Vp(e,s,0),n!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=n&~(a&~t))}function Vp(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Wt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function Gp(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-Wt(i),r=1<<s;r&t|e[s]&t&&(e[s]|=t),i&=~r}}function $p(e,t){var i=t&-t;return i=i&42?1:Ld(i),i&(e.suspendedLanes|t)?0:i}function Ld(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 Hd(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Xp(){var e=ne.p;return e!==0?e:(e=window.event,e===void 0?32:y0(e.type))}function p_(e,t){var i=ne.p;try{return ne.p=e,t()}finally{ne.p=i}}var qs=Math.random().toString(36).slice(2),ot="__reactFiber$"+qs,Rt="__reactProps$"+qs,Dn="__reactContainer$"+qs,$u="__reactEvents$"+qs,lw="__reactListeners$"+qs,cw="__reactHandles$"+qs,v_="__reactResources$"+qs,Va="__reactMarker$"+qs;function Pd(e){delete e[ot],delete e[Rt],delete e[$u],delete e[lw],delete e[cw]}function qr(e){var t=e[ot];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Dn]||i[ot]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Em(e);e!==null;){if(i=e[ot])return i;e=Em(e)}return t}e=i,i=e.parentNode}return null}function Rn(e){if(e=e[ot]||e[Dn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ia(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(M(33))}function en(e){var t=e[v_];return t||(t=e[v_]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function it(e){e[Va]=!0}var Zp=new Set,Qp={};function Sr(e,t){dn(e,t),dn(e+"Capture",t)}function dn(e,t){for(Qp[e]=t,e=0;e<t.length;e++)Zp.add(t[e])}var uw=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]*$"),y_={},S_={};function hw(e){return Gu.call(S_,e)?!0:Gu.call(y_,e)?!1:uw.test(e)?S_[e]=!0:(y_[e]=!0,!1)}function Io(e,t,i){if(hw(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function mo(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 Ni(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function Xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dw(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,n=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(a){i=""+a,n.call(this,a)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(a){i=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xu(e){if(!e._valueTracker){var t=Jp(e)?"checked":"value";e._valueTracker=dw(e,t,""+e[t])}}function ev(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=Jp(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function gl(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 fw=/[\n"\\]/g;function Jt(e){return e.replace(fw,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Zu(e,t,i,s,r,n,a,o){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Xt(t)):e.value!==""+Xt(t)&&(e.value=""+Xt(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?Qu(e,a,Xt(t)):i!=null?Qu(e,a,Xt(i)):s!=null&&e.removeAttribute("value"),r==null&&n!=null&&(e.defaultChecked=!!n),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Xt(o):e.removeAttribute("name")}function tv(e,t,i,s,r,n,a,o){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||i!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){Xu(e);return}i=i!=null?""+Xt(i):"",t=t!=null?""+Xt(t):i,o||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=o?e.checked:!!s,e.defaultChecked=!!s,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),Xu(e)}function Qu(e,t,i){t==="number"&&gl(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function tn(e,t,i,s){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&s&&(e[i].defaultSelected=!0)}else{for(i=""+Xt(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function iv(e,t,i){if(t!=null&&(t=""+Xt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Xt(i):""}function sv(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(M(92));if(ta(s)){if(1<s.length)throw Error(M(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=Xt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),Xu(e)}function fn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var _w=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 b_(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||_w.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function rv(e,t,i){if(t!=null&&typeof t!="object")throw Error(M(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var r in t)s=t[r],t.hasOwnProperty(r)&&i[r]!==s&&b_(e,r,s)}else for(var n in t)t.hasOwnProperty(n)&&b_(e,n,t[n])}function Ud(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 mw=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"]]),gw=/^[\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 qo(e){return gw.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function qi(){}var Ju=null;function jd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fr=null,sn=null;function w_(e){var t=Rn(e);if(t&&(e=t.stateNode)){var i=e[Rt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Zu(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="'+Jt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var r=s[Rt]||null;if(!r)throw Error(M(90));Zu(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&ev(s)}break e;case"textarea":iv(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&tn(e,!!i.multiple,t,!1)}}}var Pc=!1;function nv(e,t,i){if(Pc)return e(t,i);Pc=!0;try{var s=e(t);return s}finally{if(Pc=!1,(Fr!==null||sn!==null)&&(mc(),Fr&&(t=Fr,e=sn,sn=Fr=null,w_(t),e)))for(t=0;t<e.length;t++)w_(e[t])}}function Aa(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Rt]||null;if(s===null)return null;i=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(M(231,t,typeof i));return i}var Xi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),eh=!1;if(Xi)try{var Wn={};Object.defineProperty(Wn,"passive",{get:function(){eh=!0}}),window.addEventListener("test",Wn,Wn),window.removeEventListener("test",Wn,Wn)}catch{eh=!1}var ws=null,Wd=null,Fo=null;function av(){if(Fo)return Fo;var e,t=Wd,i=t.length,s,r="value"in ws?ws.value:ws.textContent,n=r.length;for(e=0;e<i&&t[e]===r[e];e++);var a=i-e;for(s=1;s<=a&&t[i-s]===r[n-s];s++);return Fo=r.slice(e,1<s?1-s:void 0)}function Ko(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 go(){return!0}function C_(){return!1}function Mt(e){function t(i,s,r,n,a){this._reactName=i,this._targetInst=r,this.type=s,this.nativeEvent=n,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(i=e[o],this[o]=i?i(n):n[o]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?go:C_,this.isPropagationStopped=C_,this}return be(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=go)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=go)},persist:function(){},isPersistent:go}),t}var br={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rc=Mt(br),Ga=be({},br,{view:0,detail:0}),pw=Mt(Ga),Uc,jc,In,nc=be({},Ga,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Id,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!==In&&(In&&e.type==="mousemove"?(Uc=e.screenX-In.screenX,jc=e.screenY-In.screenY):jc=Uc=0,In=e),Uc)},movementY:function(e){return"movementY"in e?e.movementY:jc}}),x_=Mt(nc),vw=be({},nc,{dataTransfer:0}),yw=Mt(vw),Sw=be({},Ga,{relatedTarget:0}),Wc=Mt(Sw),bw=be({},br,{animationName:0,elapsedTime:0,pseudoElement:0}),ww=Mt(bw),Cw=be({},br,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xw=Mt(Cw),Ew=be({},br,{data:0}),E_=Mt(Ew),Aw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kw={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"},Dw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dw[e])?!!t[e]:!1}function Id(){return Rw}var Mw=be({},Ga,{key:function(e){if(e.key){var t=Aw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ko(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?kw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Id,charCode:function(e){return e.type==="keypress"?Ko(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ko(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Tw=Mt(Mw),Ow=be({},nc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),A_=Mt(Ow),Nw=be({},Ga,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Id}),Bw=Mt(Nw),zw=be({},br,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lw=Mt(zw),Hw=be({},nc,{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}),Pw=Mt(Hw),Uw=be({},br,{newState:0,oldState:0}),jw=Mt(Uw),Ww=[9,13,27,32],qd=Xi&&"CompositionEvent"in window,ha=null;Xi&&"documentMode"in document&&(ha=document.documentMode);var Iw=Xi&&"TextEvent"in window&&!ha,ov=Xi&&(!qd||ha&&8<ha&&11>=ha),k_=" ",D_=!1;function lv(e,t){switch(e){case"keyup":return Ww.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kr=!1;function qw(e,t){switch(e){case"compositionend":return cv(t);case"keypress":return t.which!==32?null:(D_=!0,k_);case"textInput":return e=t.data,e===k_&&D_?null:e;default:return null}}function Fw(e,t){if(Kr)return e==="compositionend"||!qd&&lv(e,t)?(e=av(),Fo=Wd=ws=null,Kr=!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 ov&&t.locale!=="ko"?null:t.data;default:return null}}var Kw={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 R_(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Kw[e.type]:t==="textarea"}function uv(e,t,i,s){Fr?sn?sn.push(s):sn=[s]:Fr=s,t=Bl(t,"onChange"),0<t.length&&(i=new rc("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var da=null,ka=null;function Yw(e){n0(e,0)}function ac(e){var t=ia(e);if(ev(t))return e}function M_(e,t){if(e==="change")return t}var hv=!1;if(Xi){var Ic;if(Xi){var qc="oninput"in document;if(!qc){var T_=document.createElement("div");T_.setAttribute("oninput","return;"),qc=typeof T_.oninput=="function"}Ic=qc}else Ic=!1;hv=Ic&&(!document.documentMode||9<document.documentMode)}function O_(){da&&(da.detachEvent("onpropertychange",dv),ka=da=null)}function dv(e){if(e.propertyName==="value"&&ac(ka)){var t=[];uv(t,ka,e,jd(e)),nv(Yw,t)}}function Vw(e,t,i){e==="focusin"?(O_(),da=t,ka=i,da.attachEvent("onpropertychange",dv)):e==="focusout"&&O_()}function Gw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ac(ka)}function $w(e,t){if(e==="click")return ac(t)}function Xw(e,t){if(e==="input"||e==="change")return ac(t)}function Zw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ft=typeof Object.is=="function"?Object.is:Zw;function Da(e,t){if(Ft(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var r=i[s];if(!Gu.call(t,r)||!Ft(e[r],t[r]))return!1}return!0}function N_(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function B_(e,t){var i=N_(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=N_(i)}}function fv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _v(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=gl(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=gl(e.document)}return t}function Fd(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 Qw=Xi&&"documentMode"in document&&11>=document.documentMode,Yr=null,th=null,fa=null,ih=!1;function z_(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ih||Yr==null||Yr!==gl(s)||(s=Yr,"selectionStart"in s&&Fd(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),fa&&Da(fa,s)||(fa=s,s=Bl(th,"onSelect"),0<s.length&&(t=new rc("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Yr)))}function Vs(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Vr={animationend:Vs("Animation","AnimationEnd"),animationiteration:Vs("Animation","AnimationIteration"),animationstart:Vs("Animation","AnimationStart"),transitionrun:Vs("Transition","TransitionRun"),transitionstart:Vs("Transition","TransitionStart"),transitioncancel:Vs("Transition","TransitionCancel"),transitionend:Vs("Transition","TransitionEnd")},Fc={},mv={};Xi&&(mv=document.createElement("div").style,"AnimationEvent"in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),"TransitionEvent"in window||delete Vr.transitionend.transition);function wr(e){if(Fc[e])return Fc[e];if(!Vr[e])return e;var t=Vr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in mv)return Fc[e]=t[i];return e}var gv=wr("animationend"),pv=wr("animationiteration"),vv=wr("animationstart"),Jw=wr("transitionrun"),eC=wr("transitionstart"),tC=wr("transitioncancel"),yv=wr("transitionend"),Sv=new Map,sh="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(" ");sh.push("scrollEnd");function hi(e,t){Sv.set(e,t),Sr(t,[e])}var pl=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)},Gt=[],Gr=0,Kd=0;function oc(){for(var e=Gr,t=Kd=Gr=0;t<e;){var i=Gt[t];Gt[t++]=null;var s=Gt[t];Gt[t++]=null;var r=Gt[t];Gt[t++]=null;var n=Gt[t];if(Gt[t++]=null,s!==null&&r!==null){var a=s.pending;a===null?r.next=r:(r.next=a.next,a.next=r),s.pending=r}n!==0&&bv(i,r,n)}}function lc(e,t,i,s){Gt[Gr++]=e,Gt[Gr++]=t,Gt[Gr++]=i,Gt[Gr++]=s,Kd|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Yd(e,t,i,s){return lc(e,t,i,s),vl(e)}function Cr(e,t){return lc(e,null,null,t),vl(e)}function bv(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var r=!1,n=e.return;n!==null;)n.childLanes|=i,s=n.alternate,s!==null&&(s.childLanes|=i),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(r=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,r&&t!==null&&(r=31-Wt(i),e=n.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=i|536870912),n):null}function vl(e){if(50<wa)throw wa=0,xh=null,Error(M(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $r={};function iC(e,t,i,s){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(e,t,i,s){return new iC(e,t,i,s)}function Vd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yi(e,t){var i=e.alternate;return i===null?(i=Ht(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function wv(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 Yo(e,t,i,s,r,n){var a=0;if(s=e,typeof e=="function")Vd(e)&&(a=1);else if(typeof e=="string")a=ox(e,i,Ei.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Fu:return e=Ht(31,i,t,r),e.elementType=Fu,e.lanes=n,e;case Wr:return nr(i.children,r,n,t);case Wp:a=8,r|=24;break;case Wu:return e=Ht(12,i,t,r|2),e.elementType=Wu,e.lanes=n,e;case Iu:return e=Ht(13,i,t,r),e.elementType=Iu,e.lanes=n,e;case qu:return e=Ht(19,i,t,r),e.elementType=qu,e.lanes=n,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ii:a=10;break e;case Ip:a=9;break e;case Nd:a=11;break e;case Bd:a=14;break e;case _s:a=16,s=null;break e}a=29,i=Error(M(130,e===null?"null":typeof e,"")),s=null}return t=Ht(a,i,t,r),t.elementType=e,t.type=s,t.lanes=n,t}function nr(e,t,i,s){return e=Ht(7,e,s,t),e.lanes=i,e}function Kc(e,t,i){return e=Ht(6,e,null,t),e.lanes=i,e}function Cv(e){var t=Ht(18,null,null,0);return t.stateNode=e,t}function Yc(e,t,i){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var L_=new WeakMap;function ei(e,t){if(typeof e=="object"&&e!==null){var i=L_.get(e);return i!==void 0?i:(t={value:e,source:t,stack:g_(t)},L_.set(e,t),t)}return{value:e,source:t,stack:g_(t)}}var Xr=[],Zr=0,yl=null,Ra=0,Zt=[],Qt=0,Hs=null,Si=1,bi="";function ji(e,t){Xr[Zr++]=Ra,Xr[Zr++]=yl,yl=e,Ra=t}function xv(e,t,i){Zt[Qt++]=Si,Zt[Qt++]=bi,Zt[Qt++]=Hs,Hs=e;var s=Si;e=bi;var r=32-Wt(s)-1;s&=~(1<<r),i+=1;var n=32-Wt(t)+r;if(30<n){var a=r-r%5;n=(s&(1<<a)-1).toString(32),s>>=a,r-=a,Si=1<<32-Wt(t)+r|i<<r|s,bi=n+e}else Si=1<<n|i<<r|s,bi=e}function Gd(e){e.return!==null&&(ji(e,1),xv(e,1,0))}function $d(e){for(;e===yl;)yl=Xr[--Zr],Xr[Zr]=null,Ra=Xr[--Zr],Xr[Zr]=null;for(;e===Hs;)Hs=Zt[--Qt],Zt[Qt]=null,bi=Zt[--Qt],Zt[Qt]=null,Si=Zt[--Qt],Zt[Qt]=null}function Ev(e,t){Zt[Qt++]=Si,Zt[Qt++]=bi,Zt[Qt++]=Hs,Si=t.id,bi=t.overflow,Hs=e}var lt=null,ye=null,ie=!1,Ds=null,ti=!1,rh=Error(M(519));function Ps(e){var t=Error(M(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ma(ei(t,e)),rh}function H_(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[ot]=e,t[Rt]=s,i){case"dialog":Q("cancel",t),Q("close",t);break;case"iframe":case"object":case"embed":Q("load",t);break;case"video":case"audio":for(i=0;i<Ba.length;i++)Q(Ba[i],t);break;case"source":Q("error",t);break;case"img":case"image":case"link":Q("error",t),Q("load",t);break;case"details":Q("toggle",t);break;case"input":Q("invalid",t),tv(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Q("invalid",t);break;case"textarea":Q("invalid",t),sv(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||o0(t.textContent,i)?(s.popover!=null&&(Q("beforetoggle",t),Q("toggle",t)),s.onScroll!=null&&Q("scroll",t),s.onScrollEnd!=null&&Q("scrollend",t),s.onClick!=null&&(t.onclick=qi),t=!0):t=!1,t||Ps(e,!0)}function P_(e){for(lt=e.return;lt;)switch(lt.tag){case 5:case 31:case 13:ti=!1;return;case 27:case 3:ti=!0;return;default:lt=lt.return}}function Rr(e){if(e!==lt)return!1;if(!ie)return P_(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")||Rh(e.type,e.memoizedProps)),i=!i),i&&ye&&Ps(e),P_(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));ye=xm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));ye=xm(e)}else t===27?(t=ye,Fs(e.type)?(e=Nh,Nh=null,ye=e):ye=t):ye=lt?si(e.stateNode.nextSibling):null;return!0}function ur(){ye=lt=null,ie=!1}function Vc(){var e=Ds;return e!==null&&(kt===null?kt=e:kt.push.apply(kt,e),Ds=null),e}function Ma(e){Ds===null?Ds=[e]:Ds.push(e)}var nh=Ri(null),xr=null,Fi=null;function ps(e,t,i){ge(nh,t._currentValue),t._currentValue=i}function Vi(e){e._currentValue=nh.current,st(nh)}function ah(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function oh(e,t,i,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var n=r.dependencies;if(n!==null){var a=r.child;n=n.firstContext;e:for(;n!==null;){var o=n;n=r;for(var c=0;c<t.length;c++)if(o.context===t[c]){n.lanes|=i,o=n.alternate,o!==null&&(o.lanes|=i),ah(n.return,i,e),s||(a=null);break e}n=o.next}}else if(r.tag===18){if(a=r.return,a===null)throw Error(M(341));a.lanes|=i,n=a.alternate,n!==null&&(n.lanes|=i),ah(a,i,e),a=null}else a=r.child;if(a!==null)a.return=r;else for(a=r;a!==null;){if(a===e){a=null;break}if(r=a.sibling,r!==null){r.return=a.return,a=r;break}a=a.return}r=a}}function Mn(e,t,i,s){e=null;for(var r=t,n=!1;r!==null;){if(!n){if(r.flags&524288)n=!0;else if(r.flags&262144)break}if(r.tag===10){var a=r.alternate;if(a===null)throw Error(M(387));if(a=a.memoizedProps,a!==null){var o=r.type;Ft(r.pendingProps.value,a.value)||(e!==null?e.push(o):e=[o])}}else if(r===dl.current){if(a=r.alternate,a===null)throw Error(M(387));a.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(La):e=[La])}r=r.return}e!==null&&oh(t,e,i,s),t.flags|=262144}function Sl(e){for(e=e.firstContext;e!==null;){if(!Ft(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function hr(e){xr=e,Fi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ut(e){return Av(xr,e)}function po(e,t){return xr===null&&hr(e),Av(e,t)}function Av(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Fi===null){if(e===null)throw Error(M(308));Fi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fi=Fi.next=t;return i}var sC=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},rC=Ge.unstable_scheduleCallback,nC=Ge.unstable_NormalPriority,We={$$typeof:Ii,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xd(){return{controller:new sC,data:new Map,refCount:0}}function $a(e){e.refCount--,e.refCount===0&&rC(nC,function(){e.controller.abort()})}var _a=null,lh=0,_n=0,rn=null;function aC(e,t){if(_a===null){var i=_a=[];lh=0,_n=wf(),rn={status:"pending",value:void 0,then:function(s){i.push(s)}}}return lh++,t.then(U_,U_),t}function U_(){if(--lh===0&&_a!==null){rn!==null&&(rn.status="fulfilled");var e=_a;_a=null,_n=0,rn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function oC(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(r){i.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<i.length;r++)(0,i[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<i.length;r++)(0,i[r])(void 0)}),s}var j_=K.S;K.S=function(e,t){jy=Ut(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&aC(e,t),j_!==null&&j_(e,t)};var ar=Ri(null);function Zd(){var e=ar.current;return e!==null?e:_e.pooledCache}function Vo(e,t){t===null?ge(ar,ar.current):ge(ar,t.pool)}function kv(){var e=Zd();return e===null?null:{parent:We._currentValue,pool:e}}var Tn=Error(M(460)),Qd=Error(M(474)),cc=Error(M(542)),bl={then:function(){}};function W_(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Dv(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(qi,qi),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,q_(e),e;default:if(typeof t.status=="string")t.then(qi,qi);else{if(e=_e,e!==null&&100<e.shellSuspendCounter)throw Error(M(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,q_(e),e}throw or=t,Tn}}function Js(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(or=i,Tn):i}}var or=null;function I_(){if(or===null)throw Error(M(459));var e=or;return or=null,e}function q_(e){if(e===Tn||e===cc)throw Error(M(483))}var nn=null,Ta=0;function vo(e){var t=Ta;return Ta+=1,nn===null&&(nn=[]),Dv(nn,e,t)}function qn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function yo(e,t){throw t.$$typeof===V1?Error(M(525)):(e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Rv(e){function t(g,p){if(e){var v=g.deletions;v===null?(g.deletions=[p],g.flags|=16):v.push(p)}}function i(g,p){if(!e)return null;for(;p!==null;)t(g,p),p=p.sibling;return null}function s(g){for(var p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function r(g,p){return g=Yi(g,p),g.index=0,g.sibling=null,g}function n(g,p,v){return g.index=v,e?(v=g.alternate,v!==null?(v=v.index,v<p?(g.flags|=67108866,p):v):(g.flags|=67108866,p)):(g.flags|=1048576,p)}function a(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function o(g,p,v,y){return p===null||p.tag!==6?(p=Kc(v,g.mode,y),p.return=g,p):(p=r(p,v),p.return=g,p)}function c(g,p,v,y){var C=v.type;return C===Wr?h(g,p,v.props.children,y,v.key):p!==null&&(p.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===_s&&Js(C)===p.type)?(p=r(p,v.props),qn(p,v),p.return=g,p):(p=Yo(v.type,v.key,v.props,null,g.mode,y),qn(p,v),p.return=g,p)}function l(g,p,v,y){return p===null||p.tag!==4||p.stateNode.containerInfo!==v.containerInfo||p.stateNode.implementation!==v.implementation?(p=Yc(v,g.mode,y),p.return=g,p):(p=r(p,v.children||[]),p.return=g,p)}function h(g,p,v,y,C){return p===null||p.tag!==7?(p=nr(v,g.mode,y,C),p.return=g,p):(p=r(p,v),p.return=g,p)}function u(g,p,v){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=Kc(""+p,g.mode,v),p.return=g,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case uo:return v=Yo(p.type,p.key,p.props,null,g.mode,v),qn(v,p),v.return=g,v;case ea:return p=Yc(p,g.mode,v),p.return=g,p;case _s:return p=Js(p),u(g,p,v)}if(ta(p)||jn(p))return p=nr(p,g.mode,v,null),p.return=g,p;if(typeof p.then=="function")return u(g,vo(p),v);if(p.$$typeof===Ii)return u(g,po(g,p),v);yo(g,p)}return null}function d(g,p,v,y){var C=p!==null?p.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return C!==null?null:o(g,p,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case uo:return v.key===C?c(g,p,v,y):null;case ea:return v.key===C?l(g,p,v,y):null;case _s:return v=Js(v),d(g,p,v,y)}if(ta(v)||jn(v))return C!==null?null:h(g,p,v,y,null);if(typeof v.then=="function")return d(g,p,vo(v),y);if(v.$$typeof===Ii)return d(g,p,po(g,v),y);yo(g,v)}return null}function f(g,p,v,y,C){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return g=g.get(v)||null,o(p,g,""+y,C);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case uo:return g=g.get(y.key===null?v:y.key)||null,c(p,g,y,C);case ea:return g=g.get(y.key===null?v:y.key)||null,l(p,g,y,C);case _s:return y=Js(y),f(g,p,v,y,C)}if(ta(y)||jn(y))return g=g.get(v)||null,h(p,g,y,C,null);if(typeof y.then=="function")return f(g,p,v,vo(y),C);if(y.$$typeof===Ii)return f(g,p,v,po(p,y),C);yo(p,y)}return null}function _(g,p,v,y){for(var C=null,k=null,D=p,E=p=0,N=null;D!==null&&E<v.length;E++){D.index>E?(N=D,D=null):N=D.sibling;var U=d(g,D,v[E],y);if(U===null){D===null&&(D=N);break}e&&D&&U.alternate===null&&t(g,D),p=n(U,p,E),k===null?C=U:k.sibling=U,k=U,D=N}if(E===v.length)return i(g,D),ie&&ji(g,E),C;if(D===null){for(;E<v.length;E++)D=u(g,v[E],y),D!==null&&(p=n(D,p,E),k===null?C=D:k.sibling=D,k=D);return ie&&ji(g,E),C}for(D=s(D);E<v.length;E++)N=f(D,g,E,v[E],y),N!==null&&(e&&N.alternate!==null&&D.delete(N.key===null?E:N.key),p=n(N,p,E),k===null?C=N:k.sibling=N,k=N);return e&&D.forEach(function(I){return t(g,I)}),ie&&ji(g,E),C}function m(g,p,v,y){if(v==null)throw Error(M(151));for(var C=null,k=null,D=p,E=p=0,N=null,U=v.next();D!==null&&!U.done;E++,U=v.next()){D.index>E?(N=D,D=null):N=D.sibling;var I=d(g,D,U.value,y);if(I===null){D===null&&(D=N);break}e&&D&&I.alternate===null&&t(g,D),p=n(I,p,E),k===null?C=I:k.sibling=I,k=I,D=N}if(U.done)return i(g,D),ie&&ji(g,E),C;if(D===null){for(;!U.done;E++,U=v.next())U=u(g,U.value,y),U!==null&&(p=n(U,p,E),k===null?C=U:k.sibling=U,k=U);return ie&&ji(g,E),C}for(D=s(D);!U.done;E++,U=v.next())U=f(D,g,E,U.value,y),U!==null&&(e&&U.alternate!==null&&D.delete(U.key===null?E:U.key),p=n(U,p,E),k===null?C=U:k.sibling=U,k=U);return e&&D.forEach(function(B){return t(g,B)}),ie&&ji(g,E),C}function w(g,p,v,y){if(typeof v=="object"&&v!==null&&v.type===Wr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case uo:e:{for(var C=v.key;p!==null;){if(p.key===C){if(C=v.type,C===Wr){if(p.tag===7){i(g,p.sibling),y=r(p,v.props.children),y.return=g,g=y;break e}}else if(p.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===_s&&Js(C)===p.type){i(g,p.sibling),y=r(p,v.props),qn(y,v),y.return=g,g=y;break e}i(g,p);break}else t(g,p);p=p.sibling}v.type===Wr?(y=nr(v.props.children,g.mode,y,v.key),y.return=g,g=y):(y=Yo(v.type,v.key,v.props,null,g.mode,y),qn(y,v),y.return=g,g=y)}return a(g);case ea:e:{for(C=v.key;p!==null;){if(p.key===C)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){i(g,p.sibling),y=r(p,v.children||[]),y.return=g,g=y;break e}else{i(g,p);break}else t(g,p);p=p.sibling}y=Yc(v,g.mode,y),y.return=g,g=y}return a(g);case _s:return v=Js(v),w(g,p,v,y)}if(ta(v))return _(g,p,v,y);if(jn(v)){if(C=jn(v),typeof C!="function")throw Error(M(150));return v=C.call(v),m(g,p,v,y)}if(typeof v.then=="function")return w(g,p,vo(v),y);if(v.$$typeof===Ii)return w(g,p,po(g,v),y);yo(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,p!==null&&p.tag===6?(i(g,p.sibling),y=r(p,v),y.return=g,g=y):(i(g,p),y=Kc(v,g.mode,y),y.return=g,g=y),a(g)):i(g,p)}return function(g,p,v,y){try{Ta=0;var C=w(g,p,v,y);return nn=null,C}catch(D){if(D===Tn||D===cc)throw D;var k=Ht(29,D,null,g.mode);return k.lanes=y,k.return=g,k}finally{}}}var dr=Rv(!0),Mv=Rv(!1),ms=!1;function Jd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ch(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 Rs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ms(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,re&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=vl(e),bv(e,null,i),t}return lc(e,s,t,i),vl(e)}function ma(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Gp(e,i)}}function Gc(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var r=null,n=null;if(i=i.firstBaseUpdate,i!==null){do{var a={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};n===null?r=n=a:n=n.next=a,i=i.next}while(i!==null);n===null?r=n=t:n=n.next=t}else r=n=t;i={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:n,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var uh=!1;function ga(){if(uh){var e=rn;if(e!==null)throw e}}function pa(e,t,i,s){uh=!1;var r=e.updateQueue;ms=!1;var n=r.firstBaseUpdate,a=r.lastBaseUpdate,o=r.shared.pending;if(o!==null){r.shared.pending=null;var c=o,l=c.next;c.next=null,a===null?n=l:a.next=l,a=c;var h=e.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==a&&(o===null?h.firstBaseUpdate=l:o.next=l,h.lastBaseUpdate=c))}if(n!==null){var u=r.baseState;a=0,h=l=c=null,o=n;do{var d=o.lane&-536870913,f=d!==o.lane;if(f?(te&d)===d:(s&d)===d){d!==0&&d===_n&&(uh=!0),h!==null&&(h=h.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var _=e,m=o;d=t;var w=i;switch(m.tag){case 1:if(_=m.payload,typeof _=="function"){u=_.call(w,u,d);break e}u=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=m.payload,d=typeof _=="function"?_.call(w,u,d):_,d==null)break e;u=be({},u,d);break e;case 2:ms=!0}}d=o.callback,d!==null&&(e.flags|=64,f&&(e.flags|=8192),f=r.callbacks,f===null?r.callbacks=[d]:f.push(d))}else f={lane:d,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(l=h=f,c=u):h=h.next=f,a|=d;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;f=o,o=f.next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}while(!0);h===null&&(c=u),r.baseState=c,r.firstBaseUpdate=l,r.lastBaseUpdate=h,n===null&&(r.shared.lanes=0),js|=a,e.lanes=a,e.memoizedState=u}}function Tv(e,t){if(typeof e!="function")throw Error(M(191,e));e.call(t)}function Ov(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Tv(i[e],t)}var mn=Ri(null),wl=Ri(0);function F_(e,t){e=es,ge(wl,e),ge(mn,t),es=e|t.baseLanes}function hh(){ge(wl,es),ge(mn,mn.current)}function ef(){es=wl.current,st(mn),st(wl)}var Kt=Ri(null),ii=null;function vs(e){var t=e.alternate;ge(Le,Le.current&1),ge(Kt,e),ii===null&&(t===null||mn.current!==null||t.memoizedState!==null)&&(ii=e)}function dh(e){ge(Le,Le.current),ge(Kt,e),ii===null&&(ii=e)}function Nv(e){e.tag===22?(ge(Le,Le.current),ge(Kt,e),ii===null&&(ii=e)):ys()}function ys(){ge(Le,Le.current),ge(Kt,Kt.current)}function zt(e){st(Kt),ii===e&&(ii=null),st(Le)}var Le=Ri(0);function Cl(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Th(i)||Oh(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)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 Zi=0,G=null,fe=null,Ue=null,xl=!1,an=!1,fr=!1,El=0,Oa=0,on=null,lC=0;function ke(){throw Error(M(321))}function tf(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Ft(e[i],t[i]))return!1;return!0}function sf(e,t,i,s,r,n){return Zi=n,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,K.H=e===null||e.memoizedState===null?uy:_f,fr=!1,n=i(s,r),fr=!1,an&&(n=zv(t,i,s,r)),Bv(e),n}function Bv(e){K.H=Na;var t=fe!==null&&fe.next!==null;if(Zi=0,Ue=fe=G=null,xl=!1,Oa=0,on=null,t)throw Error(M(300));e===null||qe||(e=e.dependencies,e!==null&&Sl(e)&&(qe=!0))}function zv(e,t,i,s){G=e;var r=0;do{if(an&&(on=null),Oa=0,an=!1,25<=r)throw Error(M(301));if(r+=1,Ue=fe=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}K.H=hy,n=t(i,s)}while(an);return n}function cC(){var e=K.H,t=e.useState()[0];return t=typeof t.then=="function"?Xa(t):t,e=e.useState()[0],(fe!==null?fe.memoizedState:null)!==e&&(G.flags|=1024),t}function rf(){var e=El!==0;return El=0,e}function nf(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function af(e){if(xl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xl=!1}Zi=0,Ue=fe=G=null,an=!1,Oa=El=0,on=null}function gt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ue===null?G.memoizedState=Ue=e:Ue=Ue.next=e,Ue}function He(){if(fe===null){var e=G.alternate;e=e!==null?e.memoizedState:null}else e=fe.next;var t=Ue===null?G.memoizedState:Ue.next;if(t!==null)Ue=t,fe=e;else{if(e===null)throw G.alternate===null?Error(M(467)):Error(M(310));fe=e,e={memoizedState:fe.memoizedState,baseState:fe.baseState,baseQueue:fe.baseQueue,queue:fe.queue,next:null},Ue===null?G.memoizedState=Ue=e:Ue=Ue.next=e}return Ue}function uc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xa(e){var t=Oa;return Oa+=1,on===null&&(on=[]),e=Dv(on,e,t),t=G,(Ue===null?t.memoizedState:Ue.next)===null&&(t=t.alternate,K.H=t===null||t.memoizedState===null?uy:_f),e}function hc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Xa(e);if(e.$$typeof===Ii)return ut(e)}throw Error(M(438,String(e)))}function of(e){var t=null,i=G.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=G.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=uc(),G.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=G1;return t.index++,i}function Qi(e,t){return typeof t=="function"?t(e):t}function Go(e){var t=He();return lf(t,fe,e)}function lf(e,t,i){var s=e.queue;if(s===null)throw Error(M(311));s.lastRenderedReducer=i;var r=e.baseQueue,n=s.pending;if(n!==null){if(r!==null){var a=r.next;r.next=n.next,n.next=a}t.baseQueue=r=n,s.pending=null}if(n=e.baseState,r===null)e.memoizedState=n;else{t=r.next;var o=a=null,c=null,l=t,h=!1;do{var u=l.lane&-536870913;if(u!==l.lane?(te&u)===u:(Zi&u)===u){var d=l.revertLane;if(d===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),u===_n&&(h=!0);else if((Zi&d)===d){l=l.next,d===_n&&(h=!0);continue}else u={lane:0,revertLane:l.revertLane,gesture:null,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null},c===null?(o=c=u,a=n):c=c.next=u,G.lanes|=d,js|=d;u=l.action,fr&&i(n,u),n=l.hasEagerState?l.eagerState:i(n,u)}else d={lane:u,revertLane:l.revertLane,gesture:l.gesture,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null},c===null?(o=c=d,a=n):c=c.next=d,G.lanes|=u,js|=u;l=l.next}while(l!==null&&l!==t);if(c===null?a=n:c.next=o,!Ft(n,e.memoizedState)&&(qe=!0,h&&(i=rn,i!==null)))throw i;e.memoizedState=n,e.baseState=a,e.baseQueue=c,s.lastRenderedState=n}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function $c(e){var t=He(),i=t.queue;if(i===null)throw Error(M(311));i.lastRenderedReducer=e;var s=i.dispatch,r=i.pending,n=t.memoizedState;if(r!==null){i.pending=null;var a=r=r.next;do n=e(n,a.action),a=a.next;while(a!==r);Ft(n,t.memoizedState)||(qe=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),i.lastRenderedState=n}return[n,s]}function Lv(e,t,i){var s=G,r=He(),n=ie;if(n){if(i===void 0)throw Error(M(407));i=i()}else i=t();var a=!Ft((fe||r).memoizedState,i);if(a&&(r.memoizedState=i,qe=!0),r=r.queue,cf(Uv.bind(null,s,r,e),[e]),r.getSnapshot!==t||a||Ue!==null&&Ue.memoizedState.tag&1){if(s.flags|=2048,gn(9,{destroy:void 0},Pv.bind(null,s,r,i,t),null),_e===null)throw Error(M(349));n||Zi&127||Hv(s,t,i)}return i}function Hv(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=G.updateQueue,t===null?(t=uc(),G.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Pv(e,t,i,s){t.value=i,t.getSnapshot=s,jv(t)&&Wv(e)}function Uv(e,t,i){return i(function(){jv(t)&&Wv(e)})}function jv(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Ft(e,i)}catch{return!0}}function Wv(e){var t=Cr(e,2);t!==null&&Dt(t,e,2)}function fh(e){var t=gt();if(typeof e=="function"){var i=e;if(e=i(),fr){bs(!0);try{i()}finally{bs(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:e},t}function Iv(e,t,i,s){return e.baseState=i,lf(e,fe,typeof s=="function"?s:Qi)}function uC(e,t,i,s,r){if(fc(e))throw Error(M(485));if(e=t.action,e!==null){var n={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){n.listeners.push(a)}};K.T!==null?i(!0):n.isTransition=!1,s(n),i=t.pending,i===null?(n.next=t.pending=n,qv(t,n)):(n.next=i.next,t.pending=i.next=n)}}function qv(e,t){var i=t.action,s=t.payload,r=e.state;if(t.isTransition){var n=K.T,a={};K.T=a;try{var o=i(r,s),c=K.S;c!==null&&c(a,o),K_(e,t,o)}catch(l){_h(e,t,l)}finally{n!==null&&a.types!==null&&(n.types=a.types),K.T=n}}else try{n=i(r,s),K_(e,t,n)}catch(l){_h(e,t,l)}}function K_(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){Y_(e,t,s)},function(s){return _h(e,t,s)}):Y_(e,t,i)}function Y_(e,t,i){t.status="fulfilled",t.value=i,Fv(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,qv(e,i)))}function _h(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,Fv(t),t=t.next;while(t!==s)}e.action=null}function Fv(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Kv(e,t){return t}function V_(e,t){if(ie){var i=_e.formState;if(i!==null){e:{var s=G;if(ie){if(ye){t:{for(var r=ye,n=ti;r.nodeType!==8;){if(!n){r=null;break t}if(r=si(r.nextSibling),r===null){r=null;break t}}n=r.data,r=n==="F!"||n==="F"?r:null}if(r){ye=si(r.nextSibling),s=r.data==="F!";break e}}Ps(s)}s=!1}s&&(t=i[0])}}return i=gt(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kv,lastRenderedState:t},i.queue=s,i=oy.bind(null,G,s),s.dispatch=i,s=fh(!1),n=ff.bind(null,G,!1,s.queue),s=gt(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,i=uC.bind(null,G,r,n,i),r.dispatch=i,s.memoizedState=e,[t,i,!1]}function G_(e){var t=He();return Yv(t,fe,e)}function Yv(e,t,i){if(t=lf(e,t,Kv)[0],e=Go(Qi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Xa(t)}catch(a){throw a===Tn?cc:a}else s=t;t=He();var r=t.queue,n=r.dispatch;return i!==t.memoizedState&&(G.flags|=2048,gn(9,{destroy:void 0},hC.bind(null,r,i),null)),[s,n,e]}function hC(e,t){e.action=t}function $_(e){var t=He(),i=fe;if(i!==null)return Yv(t,i,e);He(),t=t.memoizedState,i=He();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function gn(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=G.updateQueue,t===null&&(t=uc(),G.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function Vv(){return He().memoizedState}function $o(e,t,i,s){var r=gt();G.flags|=e,r.memoizedState=gn(1|t,{destroy:void 0},i,s===void 0?null:s)}function dc(e,t,i,s){var r=He();s=s===void 0?null:s;var n=r.memoizedState.inst;fe!==null&&s!==null&&tf(s,fe.memoizedState.deps)?r.memoizedState=gn(t,n,i,s):(G.flags|=e,r.memoizedState=gn(1|t,n,i,s))}function X_(e,t){$o(8390656,8,e,t)}function cf(e,t){dc(2048,8,e,t)}function dC(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=uc(),G.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Gv(e){var t=He().memoizedState;return dC({ref:t,nextImpl:e}),function(){if(re&2)throw Error(M(440));return t.impl.apply(void 0,arguments)}}function $v(e,t){return dc(4,2,e,t)}function Xv(e,t){return dc(4,4,e,t)}function Zv(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 Qv(e,t,i){i=i!=null?i.concat([e]):null,dc(4,4,Zv.bind(null,t,e),i)}function uf(){}function Jv(e,t){var i=He();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&tf(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function ey(e,t){var i=He();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&tf(t,s[1]))return s[0];if(s=e(),fr){bs(!0);try{e()}finally{bs(!1)}}return i.memoizedState=[s,t],s}function hf(e,t,i){return i===void 0||Zi&1073741824&&!(te&261930)?e.memoizedState=t:(e.memoizedState=i,e=Iy(),G.lanes|=e,js|=e,i)}function ty(e,t,i,s){return Ft(i,t)?i:mn.current!==null?(e=hf(e,i,s),Ft(e,t)||(qe=!0),e):!(Zi&42)||Zi&1073741824&&!(te&261930)?(qe=!0,e.memoizedState=i):(e=Iy(),G.lanes|=e,js|=e,t)}function iy(e,t,i,s,r){var n=ne.p;ne.p=n!==0&&8>n?n:8;var a=K.T,o={};K.T=o,ff(e,!1,t,i);try{var c=r(),l=K.S;if(l!==null&&l(o,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var h=oC(c,s);va(e,t,h,It(e))}else va(e,t,s,It(e))}catch(u){va(e,t,{then:function(){},status:"rejected",reason:u},It())}finally{ne.p=n,a!==null&&o.types!==null&&(a.types=o.types),K.T=a}}function fC(){}function mh(e,t,i,s){if(e.tag!==5)throw Error(M(476));var r=sy(e).queue;iy(e,r,t,rr,i===null?fC:function(){return ry(e),i(s)})}function sy(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:rr,baseState:rr,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:rr},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ry(e){var t=sy(e);t.next===null&&(t=e.alternate.memoizedState),va(e,t.next.queue,{},It())}function df(){return ut(La)}function ny(){return He().memoizedState}function ay(){return He().memoizedState}function _C(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=It();e=Rs(i);var s=Ms(t,e,i);s!==null&&(Dt(s,t,i),ma(s,t,i)),t={cache:Xd()},e.payload=t;return}t=t.return}}function mC(e,t,i){var s=It();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},fc(e)?ly(t,i):(i=Yd(e,t,i,s),i!==null&&(Dt(i,e,s),cy(i,t,s)))}function oy(e,t,i){var s=It();va(e,t,i,s)}function va(e,t,i,s){var r={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(fc(e))ly(t,r);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var a=t.lastRenderedState,o=n(a,i);if(r.hasEagerState=!0,r.eagerState=o,Ft(o,a))return lc(e,t,r,0),_e===null&&oc(),!1}catch{}finally{}if(i=Yd(e,t,r,s),i!==null)return Dt(i,e,s),cy(i,t,s),!0}return!1}function ff(e,t,i,s){if(s={lane:2,revertLane:wf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(M(479))}else t=Yd(e,i,s,2),t!==null&&Dt(t,e,2)}function fc(e){var t=e.alternate;return e===G||t!==null&&t===G}function ly(e,t){an=xl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function cy(e,t,i){if(i&4194048){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Gp(e,i)}}var Na={readContext:ut,use:hc,useCallback:ke,useContext:ke,useEffect:ke,useImperativeHandle:ke,useLayoutEffect:ke,useInsertionEffect:ke,useMemo:ke,useReducer:ke,useRef:ke,useState:ke,useDebugValue:ke,useDeferredValue:ke,useTransition:ke,useSyncExternalStore:ke,useId:ke,useHostTransitionStatus:ke,useFormState:ke,useActionState:ke,useOptimistic:ke,useMemoCache:ke,useCacheRefresh:ke};Na.useEffectEvent=ke;var uy={readContext:ut,use:hc,useCallback:function(e,t){return gt().memoizedState=[e,t===void 0?null:t],e},useContext:ut,useEffect:X_,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,$o(4194308,4,Zv.bind(null,t,e),i)},useLayoutEffect:function(e,t){return $o(4194308,4,e,t)},useInsertionEffect:function(e,t){$o(4,2,e,t)},useMemo:function(e,t){var i=gt();t=t===void 0?null:t;var s=e();if(fr){bs(!0);try{e()}finally{bs(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=gt();if(i!==void 0){var r=i(t);if(fr){bs(!0);try{i(t)}finally{bs(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=mC.bind(null,G,e),[s.memoizedState,e]},useRef:function(e){var t=gt();return e={current:e},t.memoizedState=e},useState:function(e){e=fh(e);var t=e.queue,i=oy.bind(null,G,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:uf,useDeferredValue:function(e,t){var i=gt();return hf(i,e,t)},useTransition:function(){var e=fh(!1);return e=iy.bind(null,G,e.queue,!0,!1),gt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=G,r=gt();if(ie){if(i===void 0)throw Error(M(407));i=i()}else{if(i=t(),_e===null)throw Error(M(349));te&127||Hv(s,t,i)}r.memoizedState=i;var n={value:i,getSnapshot:t};return r.queue=n,X_(Uv.bind(null,s,n,e),[e]),s.flags|=2048,gn(9,{destroy:void 0},Pv.bind(null,s,n,i,t),null),i},useId:function(){var e=gt(),t=_e.identifierPrefix;if(ie){var i=bi,s=Si;i=(s&~(1<<32-Wt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=El++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=lC++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:df,useFormState:V_,useActionState:V_,useOptimistic:function(e){var t=gt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=ff.bind(null,G,!0,i),i.dispatch=t,[e,t]},useMemoCache:of,useCacheRefresh:function(){return gt().memoizedState=_C.bind(null,G)},useEffectEvent:function(e){var t=gt(),i={impl:e};return t.memoizedState=i,function(){if(re&2)throw Error(M(440));return i.impl.apply(void 0,arguments)}}},_f={readContext:ut,use:hc,useCallback:Jv,useContext:ut,useEffect:cf,useImperativeHandle:Qv,useInsertionEffect:$v,useLayoutEffect:Xv,useMemo:ey,useReducer:Go,useRef:Vv,useState:function(){return Go(Qi)},useDebugValue:uf,useDeferredValue:function(e,t){var i=He();return ty(i,fe.memoizedState,e,t)},useTransition:function(){var e=Go(Qi)[0],t=He().memoizedState;return[typeof e=="boolean"?e:Xa(e),t]},useSyncExternalStore:Lv,useId:ny,useHostTransitionStatus:df,useFormState:G_,useActionState:G_,useOptimistic:function(e,t){var i=He();return Iv(i,fe,e,t)},useMemoCache:of,useCacheRefresh:ay};_f.useEffectEvent=Gv;var hy={readContext:ut,use:hc,useCallback:Jv,useContext:ut,useEffect:cf,useImperativeHandle:Qv,useInsertionEffect:$v,useLayoutEffect:Xv,useMemo:ey,useReducer:$c,useRef:Vv,useState:function(){return $c(Qi)},useDebugValue:uf,useDeferredValue:function(e,t){var i=He();return fe===null?hf(i,e,t):ty(i,fe.memoizedState,e,t)},useTransition:function(){var e=$c(Qi)[0],t=He().memoizedState;return[typeof e=="boolean"?e:Xa(e),t]},useSyncExternalStore:Lv,useId:ny,useHostTransitionStatus:df,useFormState:$_,useActionState:$_,useOptimistic:function(e,t){var i=He();return fe!==null?Iv(i,fe,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:of,useCacheRefresh:ay};hy.useEffectEvent=Gv;function Xc(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:be({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var gh={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=It(),r=Rs(s);r.payload=t,i!=null&&(r.callback=i),t=Ms(e,r,s),t!==null&&(Dt(t,e,s),ma(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=It(),r=Rs(s);r.tag=1,r.payload=t,i!=null&&(r.callback=i),t=Ms(e,r,s),t!==null&&(Dt(t,e,s),ma(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=It(),s=Rs(i);s.tag=2,t!=null&&(s.callback=t),t=Ms(e,s,i),t!==null&&(Dt(t,e,i),ma(t,e,i))}};function Z_(e,t,i,s,r,n,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,n,a):t.prototype&&t.prototype.isPureReactComponent?!Da(i,s)||!Da(r,n):!0}function Q_(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&gh.enqueueReplaceState(t,t.state,null)}function _r(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=be({},i));for(var r in e)i[r]===void 0&&(i[r]=e[r])}return i}function dy(e){pl(e)}function fy(e){console.error(e)}function _y(e){pl(e)}function Al(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function J_(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function ph(e,t,i){return i=Rs(i),i.tag=3,i.payload={element:null},i.callback=function(){Al(e,t)},i}function my(e){return e=Rs(e),e.tag=3,e}function gy(e,t,i,s){var r=i.type.getDerivedStateFromError;if(typeof r=="function"){var n=s.value;e.payload=function(){return r(n)},e.callback=function(){J_(t,i,s)}}var a=i.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(e.callback=function(){J_(t,i,s),typeof r!="function"&&(Ts===null?Ts=new Set([this]):Ts.add(this));var o=s.stack;this.componentDidCatch(s.value,{componentStack:o!==null?o:""})})}function gC(e,t,i,s,r){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Mn(t,i,r,!0),i=Kt.current,i!==null){switch(i.tag){case 31:case 13:return ii===null?Tl():i.alternate===null&&Re===0&&(Re=3),i.flags&=-257,i.flags|=65536,i.lanes=r,s===bl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),ou(e,s,r)),!1;case 22:return i.flags|=65536,s===bl?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),ou(e,s,r)),!1}throw Error(M(435,i.tag))}return ou(e,s,r),Tl(),!1}if(ie)return t=Kt.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==rh&&(e=Error(M(422),{cause:s}),Ma(ei(e,i)))):(s!==rh&&(t=Error(M(423),{cause:s}),Ma(ei(t,i))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=ei(s,i),r=ph(e.stateNode,s,r),Gc(e,r),Re!==4&&(Re=2)),!1;var n=Error(M(520),{cause:s});if(n=ei(n,i),ba===null?ba=[n]:ba.push(n),Re!==4&&(Re=2),t===null)return!0;s=ei(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=r&-r,i.lanes|=e,e=ph(i.stateNode,s,e),Gc(i,e),!1;case 1:if(t=i.type,n=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Ts===null||!Ts.has(n))))return i.flags|=65536,r&=-r,i.lanes|=r,r=my(r),gy(r,e,i,s),Gc(i,r),!1}i=i.return}while(i!==null);return!1}var mf=Error(M(461)),qe=!1;function nt(e,t,i,s){t.child=e===null?Mv(t,null,i,s):dr(t,e.child,i,s)}function em(e,t,i,s,r){i=i.render;var n=t.ref;if("ref"in s){var a={};for(var o in s)o!=="ref"&&(a[o]=s[o])}else a=s;return hr(t),s=sf(e,t,i,a,n,r),o=rf(),e!==null&&!qe?(nf(e,t,r),Ji(e,t,r)):(ie&&o&&Gd(t),t.flags|=1,nt(e,t,s,r),t.child)}function tm(e,t,i,s,r){if(e===null){var n=i.type;return typeof n=="function"&&!Vd(n)&&n.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=n,py(e,t,n,s,r)):(e=Yo(i.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!gf(e,r)){var a=n.memoizedProps;if(i=i.compare,i=i!==null?i:Da,i(a,s)&&e.ref===t.ref)return Ji(e,t,r)}return t.flags|=1,e=Yi(n,s),e.ref=t.ref,e.return=t,t.child=e}function py(e,t,i,s,r){if(e!==null){var n=e.memoizedProps;if(Da(n,s)&&e.ref===t.ref)if(qe=!1,t.pendingProps=s=n,gf(e,r))e.flags&131072&&(qe=!0);else return t.lanes=e.lanes,Ji(e,t,r)}return vh(e,t,i,s,r)}function vy(e,t,i,s){var r=s.children,n=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if(t.flags&128){if(n=n!==null?n.baseLanes|i:i,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~n}else s=0,t.child=null;return im(e,t,n,i,s)}if(i&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Vo(t,n!==null?n.cachePool:null),n!==null?F_(t,n):hh(),Nv(t);else return s=t.lanes=536870912,im(e,t,n!==null?n.baseLanes|i:i,i,s)}else n!==null?(Vo(t,n.cachePool),F_(t,n),ys(),t.memoizedState=null):(e!==null&&Vo(t,null),hh(),ys());return nt(e,t,r,i),t.child}function sa(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function im(e,t,i,s,r){var n=Zd();return n=n===null?null:{parent:We._currentValue,pool:n},t.memoizedState={baseLanes:i,cachePool:n},e!==null&&Vo(t,null),hh(),Nv(t),e!==null&&Mn(e,t,s,!0),t.childLanes=r,null}function Xo(e,t){return t=kl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sm(e,t,i){return dr(t,e.child,null,i),e=Xo(t,t.pendingProps),e.flags|=2,zt(t),t.memoizedState=null,e}function pC(e,t,i){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ie){if(s.mode==="hidden")return e=Xo(t,s),t.lanes=536870912,sa(null,e);if(dh(t),(e=ye)?(e=u0(e,ti),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hs!==null?{id:Si,overflow:bi}:null,retryLane:536870912,hydrationErrors:null},i=Cv(e),i.return=t,t.child=i,lt=t,ye=null)):e=null,e===null)throw Ps(t);return t.lanes=536870912,null}return Xo(t,s)}var n=e.memoizedState;if(n!==null){var a=n.dehydrated;if(dh(t),r)if(t.flags&256)t.flags&=-257,t=sm(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(M(558));else if(qe||Mn(e,t,i,!1),r=(i&e.childLanes)!==0,qe||r){if(s=_e,s!==null&&(a=$p(s,i),a!==0&&a!==n.retryLane))throw n.retryLane=a,Cr(e,a),Dt(s,e,a),mf;Tl(),t=sm(e,t,i)}else e=n.treeContext,ye=si(a.nextSibling),lt=t,ie=!0,Ds=null,ti=!1,e!==null&&Ev(t,e),t=Xo(t,s),t.flags|=4096;return t}return e=Yi(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Zo(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(M(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function vh(e,t,i,s,r){return hr(t),i=sf(e,t,i,s,void 0,r),s=rf(),e!==null&&!qe?(nf(e,t,r),Ji(e,t,r)):(ie&&s&&Gd(t),t.flags|=1,nt(e,t,i,r),t.child)}function rm(e,t,i,s,r,n){return hr(t),t.updateQueue=null,i=zv(t,s,i,r),Bv(e),s=rf(),e!==null&&!qe?(nf(e,t,n),Ji(e,t,n)):(ie&&s&&Gd(t),t.flags|=1,nt(e,t,i,n),t.child)}function nm(e,t,i,s,r){if(hr(t),t.stateNode===null){var n=$r,a=i.contextType;typeof a=="object"&&a!==null&&(n=ut(a)),n=new i(s,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=gh,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=s,n.state=t.memoizedState,n.refs={},Jd(t),a=i.contextType,n.context=typeof a=="object"&&a!==null?ut(a):$r,n.state=t.memoizedState,a=i.getDerivedStateFromProps,typeof a=="function"&&(Xc(t,i,a,s),n.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(a=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),a!==n.state&&gh.enqueueReplaceState(n,n.state,null),pa(t,s,n,r),ga(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){n=t.stateNode;var o=t.memoizedProps,c=_r(i,o);n.props=c;var l=n.context,h=i.contextType;a=$r,typeof h=="object"&&h!==null&&(a=ut(h));var u=i.getDerivedStateFromProps;h=typeof u=="function"||typeof n.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,h||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(o||l!==a)&&Q_(t,n,s,a),ms=!1;var d=t.memoizedState;n.state=d,pa(t,s,n,r),ga(),l=t.memoizedState,o||d!==l||ms?(typeof u=="function"&&(Xc(t,i,u,s),l=t.memoizedState),(c=ms||Z_(t,i,c,s,d,l,a))?(h||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=l),n.props=s,n.state=l,n.context=a,s=c):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{n=t.stateNode,ch(e,t),a=t.memoizedProps,h=_r(i,a),n.props=h,u=t.pendingProps,d=n.context,l=i.contextType,c=$r,typeof l=="object"&&l!==null&&(c=ut(l)),o=i.getDerivedStateFromProps,(l=typeof o=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(a!==u||d!==c)&&Q_(t,n,s,c),ms=!1,d=t.memoizedState,n.state=d,pa(t,s,n,r),ga();var f=t.memoizedState;a!==u||d!==f||ms||e!==null&&e.dependencies!==null&&Sl(e.dependencies)?(typeof o=="function"&&(Xc(t,i,o,s),f=t.memoizedState),(h=ms||Z_(t,i,h,s,d,f,c)||e!==null&&e.dependencies!==null&&Sl(e.dependencies))?(l||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(s,f,c),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(s,f,c)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=f),n.props=s,n.state=f,n.context=c,s=h):(typeof n.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),s=!1)}return n=s,Zo(e,t),s=(t.flags&128)!==0,n||s?(n=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&s?(t.child=dr(t,e.child,null,r),t.child=dr(t,null,i,r)):nt(e,t,i,r),t.memoizedState=n.state,e=t.child):e=Ji(e,t,r),e}function am(e,t,i,s){return ur(),t.flags|=256,nt(e,t,i,s),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:kv()}}function Jc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Pt),e}function yy(e,t,i){var s=t.pendingProps,r=!1,n=(t.flags&128)!==0,a;if((a=n)||(a=e!==null&&e.memoizedState===null?!1:(Le.current&2)!==0),a&&(r=!0,t.flags&=-129),a=(t.flags&32)!==0,t.flags&=-33,e===null){if(ie){if(r?vs(t):ys(),(e=ye)?(e=u0(e,ti),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hs!==null?{id:Si,overflow:bi}:null,retryLane:536870912,hydrationErrors:null},i=Cv(e),i.return=t,t.child=i,lt=t,ye=null)):e=null,e===null)throw Ps(t);return Oh(e)?t.lanes=32:t.lanes=536870912,null}var o=s.children;return s=s.fallback,r?(ys(),r=t.mode,o=kl({mode:"hidden",children:o},r),s=nr(s,r,i,null),o.return=t,s.return=t,o.sibling=s,t.child=o,s=t.child,s.memoizedState=Qc(i),s.childLanes=Jc(e,a,i),t.memoizedState=Zc,sa(null,s)):(vs(t),yh(t,o))}var c=e.memoizedState;if(c!==null&&(o=c.dehydrated,o!==null)){if(n)t.flags&256?(vs(t),t.flags&=-257,t=eu(e,t,i)):t.memoizedState!==null?(ys(),t.child=e.child,t.flags|=128,t=null):(ys(),o=s.fallback,r=t.mode,s=kl({mode:"visible",children:s.children},r),o=nr(o,r,i,null),o.flags|=2,s.return=t,o.return=t,s.sibling=o,t.child=s,dr(t,e.child,null,i),s=t.child,s.memoizedState=Qc(i),s.childLanes=Jc(e,a,i),t.memoizedState=Zc,t=sa(null,s));else if(vs(t),Oh(o)){if(a=o.nextSibling&&o.nextSibling.dataset,a)var l=a.dgst;a=l,s=Error(M(419)),s.stack="",s.digest=a,Ma({value:s,source:null,stack:null}),t=eu(e,t,i)}else if(qe||Mn(e,t,i,!1),a=(i&e.childLanes)!==0,qe||a){if(a=_e,a!==null&&(s=$p(a,i),s!==0&&s!==c.retryLane))throw c.retryLane=s,Cr(e,s),Dt(a,e,s),mf;Th(o)||Tl(),t=eu(e,t,i)}else Th(o)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,ye=si(o.nextSibling),lt=t,ie=!0,Ds=null,ti=!1,e!==null&&Ev(t,e),t=yh(t,s.children),t.flags|=4096);return t}return r?(ys(),o=s.fallback,r=t.mode,c=e.child,l=c.sibling,s=Yi(c,{mode:"hidden",children:s.children}),s.subtreeFlags=c.subtreeFlags&65011712,l!==null?o=Yi(l,o):(o=nr(o,r,i,null),o.flags|=2),o.return=t,s.return=t,s.sibling=o,t.child=s,sa(null,s),s=t.child,o=e.child.memoizedState,o===null?o=Qc(i):(r=o.cachePool,r!==null?(c=We._currentValue,r=r.parent!==c?{parent:c,pool:c}:r):r=kv(),o={baseLanes:o.baseLanes|i,cachePool:r}),s.memoizedState=o,s.childLanes=Jc(e,a,i),t.memoizedState=Zc,sa(e.child,s)):(vs(t),i=e.child,e=i.sibling,i=Yi(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=i,t.memoizedState=null,i)}function yh(e,t){return t=kl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function kl(e,t){return e=Ht(22,e,null,t),e.lanes=0,e}function eu(e,t,i){return dr(t,e.child,null,i),e=yh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function om(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),ah(e.return,t,i)}function tu(e,t,i,s,r,n){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:r,treeForkCount:n}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=i,a.tailMode=r,a.treeForkCount=n)}function Sy(e,t,i){var s=t.pendingProps,r=s.revealOrder,n=s.tail;s=s.children;var a=Le.current,o=(a&2)!==0;if(o?(a=a&1|2,t.flags|=128):a&=1,ge(Le,a),nt(e,t,s,i),s=ie?Ra:0,!o&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&om(e,i,t);else if(e.tag===19)om(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(r){case"forwards":for(i=t.child,r=null;i!==null;)e=i.alternate,e!==null&&Cl(e)===null&&(r=i),i=i.sibling;i=r,i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),tu(t,!1,r,i,n,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Cl(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}tu(t,!0,i,null,n,s);break;case"together":tu(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Ji(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),js|=t.lanes,!(i&t.childLanes))if(e!==null){if(Mn(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,i=Yi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Yi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function gf(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Sl(e)))}function vC(e,t,i){switch(t.tag){case 3:fl(t,t.stateNode.containerInfo),ps(t,We,e.memoizedState.cache),ur();break;case 27:case 5:Vu(t);break;case 4:fl(t,t.stateNode.containerInfo);break;case 10:ps(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,dh(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(vs(t),t.flags|=128,null):i&t.child.childLanes?yy(e,t,i):(vs(t),e=Ji(e,t,i),e!==null?e.sibling:null);vs(t);break;case 19:var r=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Mn(e,t,i,!1),s=(i&t.childLanes)!==0),r){if(s)return Sy(e,t,i);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ge(Le,Le.current),s)break;return null;case 22:return t.lanes=0,vy(e,t,i,t.pendingProps);case 24:ps(t,We,e.memoizedState.cache)}return Ji(e,t,i)}function by(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)qe=!0;else{if(!gf(e,i)&&!(t.flags&128))return qe=!1,vC(e,t,i);qe=!!(e.flags&131072)}else qe=!1,ie&&t.flags&1048576&&xv(t,Ra,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Js(t.elementType),t.type=e,typeof e=="function")Vd(e)?(s=_r(e,s),t.tag=1,t=nm(null,t,e,s,i)):(t.tag=0,t=vh(null,t,e,s,i));else{if(e!=null){var r=e.$$typeof;if(r===Nd){t.tag=11,t=em(null,t,e,s,i);break e}else if(r===Bd){t.tag=14,t=tm(null,t,e,s,i);break e}}throw t=Ku(e)||e,Error(M(306,t,""))}}return t;case 0:return vh(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,r=_r(s,t.pendingProps),nm(e,t,s,r,i);case 3:e:{if(fl(t,t.stateNode.containerInfo),e===null)throw Error(M(387));s=t.pendingProps;var n=t.memoizedState;r=n.element,ch(e,t),pa(t,s,null,i);var a=t.memoizedState;if(s=a.cache,ps(t,We,s),s!==n.cache&&oh(t,[We],i,!0),ga(),s=a.element,n.isDehydrated)if(n={element:s,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=am(e,t,s,i);break e}else if(s!==r){r=ei(Error(M(424)),t),Ma(r),t=am(e,t,s,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ye=si(e.firstChild),lt=t,ie=!0,Ds=null,ti=!0,i=Mv(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(ur(),s===r){t=Ji(e,t,i);break e}nt(e,t,s,i)}t=t.child}return t;case 26:return Zo(e,t),e===null?(i=km(t.type,null,t.pendingProps,null))?t.memoizedState=i:ie||(i=t.type,e=t.pendingProps,s=zl(ks.current).createElement(i),s[ot]=t,s[Rt]=e,ht(s,i,e),it(s),t.stateNode=s):t.memoizedState=km(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Vu(t),e===null&&ie&&(s=t.stateNode=h0(t.type,t.pendingProps,ks.current),lt=t,ti=!0,r=ye,Fs(t.type)?(Nh=r,ye=si(s.firstChild)):ye=r),nt(e,t,t.pendingProps.children,i),Zo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ie&&((r=s=ye)&&(s=GC(s,t.type,t.pendingProps,ti),s!==null?(t.stateNode=s,lt=t,ye=si(s.firstChild),ti=!1,r=!0):r=!1),r||Ps(t)),Vu(t),r=t.type,n=t.pendingProps,a=e!==null?e.memoizedProps:null,s=n.children,Rh(r,n)?s=null:a!==null&&Rh(r,a)&&(t.flags|=32),t.memoizedState!==null&&(r=sf(e,t,cC,null,null,i),La._currentValue=r),Zo(e,t),nt(e,t,s,i),t.child;case 6:return e===null&&ie&&((e=i=ye)&&(i=$C(i,t.pendingProps,ti),i!==null?(t.stateNode=i,lt=t,ye=null,e=!0):e=!1),e||Ps(t)),null;case 13:return yy(e,t,i);case 4:return fl(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=dr(t,null,s,i):nt(e,t,s,i),t.child;case 11:return em(e,t,t.type,t.pendingProps,i);case 7:return nt(e,t,t.pendingProps,i),t.child;case 8:return nt(e,t,t.pendingProps.children,i),t.child;case 12:return nt(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,ps(t,t.type,s.value),nt(e,t,s.children,i),t.child;case 9:return r=t.type._context,s=t.pendingProps.children,hr(t),r=ut(r),s=s(r),t.flags|=1,nt(e,t,s,i),t.child;case 14:return tm(e,t,t.type,t.pendingProps,i);case 15:return py(e,t,t.type,t.pendingProps,i);case 19:return Sy(e,t,i);case 31:return pC(e,t,i);case 22:return vy(e,t,i,t.pendingProps);case 24:return hr(t),s=ut(We),e===null?(r=Zd(),r===null&&(r=_e,n=Xd(),r.pooledCache=n,n.refCount++,n!==null&&(r.pooledCacheLanes|=i),r=n),t.memoizedState={parent:s,cache:r},Jd(t),ps(t,We,r)):(e.lanes&i&&(ch(e,t),pa(t,null,null,i),ga()),r=e.memoizedState,n=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),ps(t,We,s)):(s=n.cache,ps(t,We,s),s!==r.cache&&oh(t,[We],i,!0))),nt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(M(156,t.tag))}function Bi(e){e.flags|=4}function iu(e,t,i,s,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Ky())e.flags|=8192;else throw or=bl,Qd}else e.flags&=-16777217}function lm(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!_0(t))if(Ky())e.flags|=8192;else throw or=bl,Qd}function So(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Yp():536870912,e.lanes|=t,pn|=t)}function Fn(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 s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags&65011712,s|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function yC(e,t,i){var s=t.pendingProps;switch($d(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pe(t),null;case 1:return pe(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Vi(We),hn(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Rr(t)?Bi(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vc())),pe(t),null;case 26:var r=t.type,n=t.memoizedState;return e===null?(Bi(t),n!==null?(pe(t),lm(t,n)):(pe(t),iu(t,r,null,s,i))):n?n!==e.memoizedState?(Bi(t),pe(t),lm(t,n)):(pe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Bi(t),pe(t),iu(t,r,e,s,i)),null;case 27:if(_l(t),i=ks.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Bi(t);else{if(!s){if(t.stateNode===null)throw Error(M(166));return pe(t),null}e=Ei.current,Rr(t)?H_(t):(e=h0(r,s,i),t.stateNode=e,Bi(t))}return pe(t),null;case 5:if(_l(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Bi(t);else{if(!s){if(t.stateNode===null)throw Error(M(166));return pe(t),null}if(n=Ei.current,Rr(t))H_(t);else{var a=zl(ks.current);switch(n){case 1:n=a.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:n=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":n=a.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":n=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":n=a.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof s.is=="string"?a.createElement("select",{is:s.is}):a.createElement("select"),s.multiple?n.multiple=!0:s.size&&(n.size=s.size);break;default:n=typeof s.is=="string"?a.createElement(r,{is:s.is}):a.createElement(r)}}n[ot]=t,n[Rt]=s;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)n.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=n;e:switch(ht(n,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Bi(t)}}return pe(t),iu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Bi(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(M(166));if(e=ks.current,Rr(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,r=lt,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[ot]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||o0(e.nodeValue,i)),e||Ps(t,!0)}else e=zl(e).createTextNode(s),e[ot]=t,t.stateNode=e}return pe(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Rr(t),i!==null){if(e===null){if(!s)throw Error(M(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(557));e[ot]=t}else ur(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pe(t),e=!1}else i=Vc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(zt(t),t):(zt(t),null);if(t.flags&128)throw Error(M(558))}return pe(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Rr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(M(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(M(317));r[ot]=t}else ur(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pe(t),r=!1}else r=Vc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(zt(t),t):(zt(t),null)}return zt(t),t.flags&128?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==r&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),So(t,t.updateQueue),pe(t),null);case 4:return hn(),e===null&&Cf(t.stateNode.containerInfo),pe(t),null;case 10:return Vi(t.type),pe(t),null;case 19:if(st(Le),s=t.memoizedState,s===null)return pe(t),null;if(r=(t.flags&128)!==0,n=s.rendering,n===null)if(r)Fn(s,!1);else{if(Re!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(n=Cl(e),n!==null){for(t.flags|=128,Fn(s,!1),e=n.updateQueue,t.updateQueue=e,So(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)wv(i,e),i=i.sibling;return ge(Le,Le.current&1|2),ie&&ji(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Ut()>Rl&&(t.flags|=128,r=!0,Fn(s,!1),t.lanes=4194304)}else{if(!r)if(e=Cl(n),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,So(t,e),Fn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!n.alternate&&!ie)return pe(t),null}else 2*Ut()-s.renderingStartTime>Rl&&i!==536870912&&(t.flags|=128,r=!0,Fn(s,!1),t.lanes=4194304);s.isBackwards?(n.sibling=t.child,t.child=n):(e=s.last,e!==null?e.sibling=n:t.child=n,s.last=n)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ut(),e.sibling=null,i=Le.current,ge(Le,r?i&1|2:i&1),ie&&ji(t,s.treeForkCount),e):(pe(t),null);case 22:case 23:return zt(t),ef(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?i&536870912&&!(t.flags&128)&&(pe(t),t.subtreeFlags&6&&(t.flags|=8192)):pe(t),i=t.updateQueue,i!==null&&So(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&st(ar),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Vi(We),pe(t),null;case 25:return null;case 30:return null}throw Error(M(156,t.tag))}function SC(e,t){switch($d(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vi(We),hn(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _l(t),null;case 31:if(t.memoizedState!==null){if(zt(t),t.alternate===null)throw Error(M(340));ur()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(zt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));ur()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return st(Le),null;case 4:return hn(),null;case 10:return Vi(t.type),null;case 22:case 23:return zt(t),ef(),e!==null&&st(ar),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vi(We),null;case 25:return null;default:return null}}function wy(e,t){switch($d(t),t.tag){case 3:Vi(We),hn();break;case 26:case 27:case 5:_l(t);break;case 4:hn();break;case 31:t.memoizedState!==null&&zt(t);break;case 13:zt(t);break;case 19:st(Le);break;case 10:Vi(t.type);break;case 22:case 23:zt(t),ef(),e!==null&&st(ar);break;case 24:Vi(We)}}function Za(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var r=s.next;i=r;do{if((i.tag&e)===e){s=void 0;var n=i.create,a=i.inst;s=n(),a.destroy=s}i=i.next}while(i!==r)}}catch(o){ce(t,t.return,o)}}function Us(e,t,i){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var n=r.next;s=n;do{if((s.tag&e)===e){var a=s.inst,o=a.destroy;if(o!==void 0){a.destroy=void 0,r=t;var c=i,l=o;try{l()}catch(h){ce(r,c,h)}}}s=s.next}while(s!==n)}}catch(h){ce(t,t.return,h)}}function Cy(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Ov(t,i)}catch(s){ce(e,e.return,s)}}}function xy(e,t,i){i.props=_r(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){ce(e,t,s)}}function ya(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(r){ce(e,t,r)}}function wi(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(r){ce(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(r){ce(e,t,r)}else i.current=null}function Ey(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(r){ce(e,e.return,r)}}function su(e,t,i){try{var s=e.stateNode;IC(s,e.type,i,t),s[Rt]=t}catch(r){ce(e,e.return,r)}}function Ay(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Fs(e.type)||e.tag===4}function ru(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ay(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&&Fs(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 Sh(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=qi));else if(s!==4&&(s===27&&Fs(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Sh(e,t,i),e=e.sibling;e!==null;)Sh(e,t,i),e=e.sibling}function Dl(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&Fs(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Dl(e,t,i),e=e.sibling;e!==null;)Dl(e,t,i),e=e.sibling}function ky(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);ht(t,s,i),t[ot]=e,t[Rt]=i}catch(n){ce(e,e.return,n)}}var Wi=!1,je=!1,nu=!1,cm=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function bC(e,t){if(e=e.containerInfo,kh=Ul,e=_v(e),Fd(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var r=s.anchorOffset,n=s.focusNode;s=s.focusOffset;try{i.nodeType,n.nodeType}catch{i=null;break e}var a=0,o=-1,c=-1,l=0,h=0,u=e,d=null;t:for(;;){for(var f;u!==i||r!==0&&u.nodeType!==3||(o=a+r),u!==n||s!==0&&u.nodeType!==3||(c=a+s),u.nodeType===3&&(a+=u.nodeValue.length),(f=u.firstChild)!==null;)d=u,u=f;for(;;){if(u===e)break t;if(d===i&&++l===r&&(o=a),d===n&&++h===s&&(c=a),(f=u.nextSibling)!==null)break;u=d,d=u.parentNode}u=f}i=o===-1||c===-1?null:{start:o,end:c}}else i=null}i=i||{start:0,end:0}}else i=null;for(Dh={focusedElem:e,selectionRange:i},Ul=!1,Qe=t;Qe!==null;)if(t=Qe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Qe=e;else for(;Qe!==null;){switch(t=Qe,n=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)r=e[i],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&n!==null){e=void 0,i=t,r=n.memoizedProps,n=n.memoizedState,s=i.stateNode;try{var _=_r(i.type,r);e=s.getSnapshotBeforeUpdate(_,n),s.__reactInternalSnapshotBeforeUpdate=e}catch(m){ce(i,i.return,m)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Mh(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Mh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(M(163))}if(e=t.sibling,e!==null){e.return=t.return,Qe=e;break}Qe=t.return}}function Dy(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Li(e,i),s&4&&Za(5,i);break;case 1:if(Li(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(a){ce(i,i.return,a)}else{var r=_r(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(a){ce(i,i.return,a)}}s&64&&Cy(i),s&512&&ya(i,i.return);break;case 3:if(Li(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Ov(e,t)}catch(a){ce(i,i.return,a)}}break;case 27:t===null&&s&4&&ky(i);case 26:case 5:Li(e,i),t===null&&s&4&&Ey(i),s&512&&ya(i,i.return);break;case 12:Li(e,i);break;case 31:Li(e,i),s&4&&Ty(e,i);break;case 13:Li(e,i),s&4&&Oy(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=MC.bind(null,i),XC(e,i))));break;case 22:if(s=i.memoizedState!==null||Wi,!s){t=t!==null&&t.memoizedState!==null||je,r=Wi;var n=je;Wi=s,(je=t)&&!n?Ui(e,i,(i.subtreeFlags&8772)!==0):Li(e,i),Wi=r,je=n}break;case 30:break;default:Li(e,i)}}function Ry(e){var t=e.alternate;t!==null&&(e.alternate=null,Ry(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pd(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 we=null,At=!1;function zi(e,t,i){for(i=i.child;i!==null;)My(e,t,i),i=i.sibling}function My(e,t,i){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(Fa,i)}catch{}switch(i.tag){case 26:je||wi(i,t),zi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:je||wi(i,t);var s=we,r=At;Fs(i.type)&&(we=i.stateNode,At=!1),zi(e,t,i),Ca(i.stateNode),we=s,At=r;break;case 5:je||wi(i,t);case 6:if(s=we,r=At,we=null,zi(e,t,i),we=s,At=r,we!==null)if(At)try{(we.nodeType===9?we.body:we.nodeName==="HTML"?we.ownerDocument.body:we).removeChild(i.stateNode)}catch(n){ce(i,t,n)}else try{we.removeChild(i.stateNode)}catch(n){ce(i,t,n)}break;case 18:we!==null&&(At?(e=we,wm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),bn(e)):wm(we,i.stateNode));break;case 4:s=we,r=At,we=i.stateNode.containerInfo,At=!0,zi(e,t,i),we=s,At=r;break;case 0:case 11:case 14:case 15:Us(2,i,t),je||Us(4,i,t),zi(e,t,i);break;case 1:je||(wi(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&xy(i,t,s)),zi(e,t,i);break;case 21:zi(e,t,i);break;case 22:je=(s=je)||i.memoizedState!==null,zi(e,t,i),je=s;break;default:zi(e,t,i)}}function Ty(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{bn(e)}catch(i){ce(t,t.return,i)}}}function Oy(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{bn(e)}catch(i){ce(t,t.return,i)}}function wC(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cm),t;default:throw Error(M(435,e.tag))}}function bo(e,t){var i=wC(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var r=TC.bind(null,e,s);s.then(r,r)}})}function Ct(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s],n=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 27:if(Fs(o.type)){we=o.stateNode,At=!1;break e}break;case 5:we=o.stateNode,At=!1;break e;case 3:case 4:we=o.stateNode.containerInfo,At=!0;break e}o=o.return}if(we===null)throw Error(M(160));My(n,a,r),we=null,At=!1,n=r.alternate,n!==null&&(n.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ny(t,e),t=t.sibling}var li=null;function Ny(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ct(t,e),xt(e),s&4&&(Us(3,e,e.return),Za(3,e),Us(5,e,e.return));break;case 1:Ct(t,e),xt(e),s&512&&(je||i===null||wi(i,i.return)),s&64&&Wi&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var r=li;if(Ct(t,e),xt(e),s&512&&(je||i===null||wi(i,i.return)),s&4){var n=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,r=r.ownerDocument||r;t:switch(s){case"title":n=r.getElementsByTagName("title")[0],(!n||n[Va]||n[ot]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=r.createElement(s),r.head.insertBefore(n,r.querySelector("head > title"))),ht(n,s,i),n[ot]=e,it(n),s=n;break e;case"link":var a=Rm("link","href",r).get(s+(i.href||""));if(a){for(var o=0;o<a.length;o++)if(n=a[o],n.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&n.getAttribute("rel")===(i.rel==null?null:i.rel)&&n.getAttribute("title")===(i.title==null?null:i.title)&&n.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){a.splice(o,1);break t}}n=r.createElement(s),ht(n,s,i),r.head.appendChild(n);break;case"meta":if(a=Rm("meta","content",r).get(s+(i.content||""))){for(o=0;o<a.length;o++)if(n=a[o],n.getAttribute("content")===(i.content==null?null:""+i.content)&&n.getAttribute("name")===(i.name==null?null:i.name)&&n.getAttribute("property")===(i.property==null?null:i.property)&&n.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&n.getAttribute("charset")===(i.charSet==null?null:i.charSet)){a.splice(o,1);break t}}n=r.createElement(s),ht(n,s,i),r.head.appendChild(n);break;default:throw Error(M(468,s))}n[ot]=e,it(n),s=n}e.stateNode=s}else Mm(r,e.type,e.stateNode);else e.stateNode=Dm(r,s,e.memoizedProps);else n!==s?(n===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):n.count--,s===null?Mm(r,e.type,e.stateNode):Dm(r,s,e.memoizedProps)):s===null&&e.stateNode!==null&&su(e,e.memoizedProps,i.memoizedProps)}break;case 27:Ct(t,e),xt(e),s&512&&(je||i===null||wi(i,i.return)),i!==null&&s&4&&su(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Ct(t,e),xt(e),s&512&&(je||i===null||wi(i,i.return)),e.flags&32){r=e.stateNode;try{fn(r,"")}catch(_){ce(e,e.return,_)}}s&4&&e.stateNode!=null&&(r=e.memoizedProps,su(e,r,i!==null?i.memoizedProps:r)),s&1024&&(nu=!0);break;case 6:if(Ct(t,e),xt(e),s&4){if(e.stateNode===null)throw Error(M(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(_){ce(e,e.return,_)}}break;case 3:if(el=null,r=li,li=Ll(t.containerInfo),Ct(t,e),li=r,xt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{bn(t.containerInfo)}catch(_){ce(e,e.return,_)}nu&&(nu=!1,By(e));break;case 4:s=li,li=Ll(e.stateNode.containerInfo),Ct(t,e),xt(e),li=s;break;case 12:Ct(t,e),xt(e);break;case 31:Ct(t,e),xt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,bo(e,s)));break;case 13:Ct(t,e),xt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(_c=Ut()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,bo(e,s)));break;case 22:r=e.memoizedState!==null;var c=i!==null&&i.memoizedState!==null,l=Wi,h=je;if(Wi=l||r,je=h||c,Ct(t,e),je=h,Wi=l,xt(e),s&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(i===null||c||Wi||je||er(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){c=i=t;try{if(n=c.stateNode,r)a=n.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{o=c.stateNode;var u=c.memoizedProps.style,d=u!=null&&u.hasOwnProperty("display")?u.display:null;o.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(_){ce(c,c.return,_)}}}else if(t.tag===6){if(i===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(_){ce(c,c.return,_)}}}else if(t.tag===18){if(i===null){c=t;try{var f=c.stateNode;r?Cm(f,!0):Cm(c.stateNode,!1)}catch(_){ce(c,c.return,_)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,bo(e,i))));break;case 19:Ct(t,e),xt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,bo(e,s)));break;case 30:break;case 21:break;default:Ct(t,e),xt(e)}}function xt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(Ay(s)){i=s;break}s=s.return}if(i==null)throw Error(M(160));switch(i.tag){case 27:var r=i.stateNode,n=ru(e);Dl(e,n,r);break;case 5:var a=i.stateNode;i.flags&32&&(fn(a,""),i.flags&=-33);var o=ru(e);Dl(e,o,a);break;case 3:case 4:var c=i.stateNode.containerInfo,l=ru(e);Sh(e,l,c);break;default:throw Error(M(161))}}catch(h){ce(e,e.return,h)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function By(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;By(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Li(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Dy(e,t.alternate,t),t=t.sibling}function er(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Us(4,t,t.return),er(t);break;case 1:wi(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&xy(t,t.return,i),er(t);break;case 27:Ca(t.stateNode);case 26:case 5:wi(t,t.return),er(t);break;case 22:t.memoizedState===null&&er(t);break;case 30:er(t);break;default:er(t)}e=e.sibling}}function Ui(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,r=e,n=t,a=n.flags;switch(n.tag){case 0:case 11:case 15:Ui(r,n,i),Za(4,n);break;case 1:if(Ui(r,n,i),s=n,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(l){ce(s,s.return,l)}if(s=n,r=s.updateQueue,r!==null){var o=s.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)Tv(c[r],o)}catch(l){ce(s,s.return,l)}}i&&a&64&&Cy(n),ya(n,n.return);break;case 27:ky(n);case 26:case 5:Ui(r,n,i),i&&s===null&&a&4&&Ey(n),ya(n,n.return);break;case 12:Ui(r,n,i);break;case 31:Ui(r,n,i),i&&a&4&&Ty(r,n);break;case 13:Ui(r,n,i),i&&a&4&&Oy(r,n);break;case 22:n.memoizedState===null&&Ui(r,n,i),ya(n,n.return);break;case 30:break;default:Ui(r,n,i)}t=t.sibling}}function pf(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&&$a(i))}function vf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$a(e))}function ai(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)zy(e,t,i,s),t=t.sibling}function zy(e,t,i,s){var r=t.flags;switch(t.tag){case 0:case 11:case 15:ai(e,t,i,s),r&2048&&Za(9,t);break;case 1:ai(e,t,i,s);break;case 3:ai(e,t,i,s),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$a(e)));break;case 12:if(r&2048){ai(e,t,i,s),e=t.stateNode;try{var n=t.memoizedProps,a=n.id,o=n.onPostCommit;typeof o=="function"&&o(a,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){ce(t,t.return,c)}}else ai(e,t,i,s);break;case 31:ai(e,t,i,s);break;case 13:ai(e,t,i,s);break;case 23:break;case 22:n=t.stateNode,a=t.alternate,t.memoizedState!==null?n._visibility&2?ai(e,t,i,s):Sa(e,t):n._visibility&2?ai(e,t,i,s):(n._visibility|=2,Ur(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),r&2048&&pf(a,t);break;case 24:ai(e,t,i,s),r&2048&&vf(t.alternate,t);break;default:ai(e,t,i,s)}}function Ur(e,t,i,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,a=t,o=i,c=s,l=a.flags;switch(a.tag){case 0:case 11:case 15:Ur(n,a,o,c,r),Za(8,a);break;case 23:break;case 22:var h=a.stateNode;a.memoizedState!==null?h._visibility&2?Ur(n,a,o,c,r):Sa(n,a):(h._visibility|=2,Ur(n,a,o,c,r)),r&&l&2048&&pf(a.alternate,a);break;case 24:Ur(n,a,o,c,r),r&&l&2048&&vf(a.alternate,a);break;default:Ur(n,a,o,c,r)}t=t.sibling}}function Sa(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,r=s.flags;switch(s.tag){case 22:Sa(i,s),r&2048&&pf(s.alternate,s);break;case 24:Sa(i,s),r&2048&&vf(s.alternate,s);break;default:Sa(i,s)}t=t.sibling}}var ra=8192;function Mr(e,t,i){if(e.subtreeFlags&ra)for(e=e.child;e!==null;)Ly(e,t,i),e=e.sibling}function Ly(e,t,i){switch(e.tag){case 26:Mr(e,t,i),e.flags&ra&&e.memoizedState!==null&&lx(i,li,e.memoizedState,e.memoizedProps);break;case 5:Mr(e,t,i);break;case 3:case 4:var s=li;li=Ll(e.stateNode.containerInfo),Mr(e,t,i),li=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=ra,ra=16777216,Mr(e,t,i),ra=s):Mr(e,t,i));break;default:Mr(e,t,i)}}function Hy(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 Kn(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];Qe=s,Uy(s,e)}Hy(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Py(e),e=e.sibling}function Py(e){switch(e.tag){case 0:case 11:case 15:Kn(e),e.flags&2048&&Us(9,e,e.return);break;case 3:Kn(e);break;case 12:Kn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qo(e)):Kn(e);break;default:Kn(e)}}function Qo(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];Qe=s,Uy(s,e)}Hy(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Us(8,t,t.return),Qo(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Qo(t));break;default:Qo(t)}e=e.sibling}}function Uy(e,t){for(;Qe!==null;){var i=Qe;switch(i.tag){case 0:case 11:case 15:Us(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:$a(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,Qe=s;else e:for(i=e;Qe!==null;){s=Qe;var r=s.sibling,n=s.return;if(Ry(s),s===i){Qe=null;break e}if(r!==null){r.return=n,Qe=r;break e}Qe=n}}}var CC={getCacheForType:function(e){var t=ut(We),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return ut(We).controller.signal}},xC=typeof WeakMap=="function"?WeakMap:Map,re=0,_e=null,J=null,te=0,le=0,Bt=null,Cs=!1,On=!1,yf=!1,es=0,Re=0,js=0,lr=0,Sf=0,Pt=0,pn=0,ba=null,kt=null,bh=!1,_c=0,jy=0,Rl=1/0,Ml=null,Ts=null,Ve=0,Os=null,vn=null,Gi=0,wh=0,Ch=null,Wy=null,wa=0,xh=null;function It(){return re&2&&te!==0?te&-te:K.T!==null?wf():Xp()}function Iy(){if(Pt===0)if(!(te&536870912)||ie){var e=fo;fo<<=1,!(fo&3932160)&&(fo=262144),Pt=e}else Pt=536870912;return e=Kt.current,e!==null&&(e.flags|=32),Pt}function Dt(e,t,i){(e===_e&&(le===2||le===9)||e.cancelPendingCommit!==null)&&(yn(e,0),xs(e,te,Pt,!1)),Ya(e,i),(!(re&2)||e!==_e)&&(e===_e&&(!(re&2)&&(lr|=i),Re===4&&xs(e,te,Pt,!1)),Mi(e))}function qy(e,t,i){if(re&6)throw Error(M(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Ka(e,t),r=s?kC(e,t):au(e,t,!0),n=s;do{if(r===0){On&&!s&&xs(e,t,0,!1);break}else{if(i=e.current.alternate,n&&!EC(i)){r=au(e,t,!1),n=!1;continue}if(r===2){if(n=t,e.errorRecoveryDisabledLanes&n)var a=0;else a=e.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){t=a;e:{var o=e;r=ba;var c=o.current.memoizedState.isDehydrated;if(c&&(yn(o,a).flags|=256),a=au(o,a,!1),a!==2){if(yf&&!c){o.errorRecoveryDisabledLanes|=n,lr|=n,r=4;break e}n=kt,kt=r,n!==null&&(kt===null?kt=n:kt.push.apply(kt,n))}r=a}if(n=!1,r!==2)continue}}if(r===1){yn(e,0),xs(e,t,0,!0);break}e:{switch(s=e,n=r,n){case 0:case 1:throw Error(M(345));case 4:if((t&4194048)!==t)break;case 6:xs(s,t,Pt,!Cs);break e;case 2:kt=null;break;case 3:case 5:break;default:throw Error(M(329))}if((t&62914560)===t&&(r=_c+300-Ut(),10<r)){if(xs(s,t,Pt,!Cs),sc(s,0,!0)!==0)break e;Gi=t,s.timeoutHandle=c0(um.bind(null,s,i,kt,Ml,bh,t,Pt,lr,pn,Cs,n,"Throttled",-0,0),r);break e}um(s,i,kt,Ml,bh,t,Pt,lr,pn,Cs,n,null,-0,0)}}break}while(!0);Mi(e)}function um(e,t,i,s,r,n,a,o,c,l,h,u,d,f){if(e.timeoutHandle=-1,u=t.subtreeFlags,u&8192||(u&16785408)===16785408){u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qi},Ly(t,n,u);var _=(n&62914560)===n?_c-Ut():(n&4194048)===n?jy-Ut():0;if(_=cx(u,_),_!==null){Gi=n,e.cancelPendingCommit=_(dm.bind(null,e,t,n,i,s,r,a,o,c,h,u,null,d,f)),xs(e,n,a,!l);return}}dm(e,t,n,i,s,r,a,o,c)}function EC(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var r=i[s],n=r.getSnapshot;r=r.value;try{if(!Ft(n(),r))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 xs(e,t,i,s){t&=~Sf,t&=~lr,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var n=31-Wt(r),a=1<<n;s[n]=-1,r&=~a}i!==0&&Vp(e,i,t)}function mc(){return re&6?!0:(Qa(0),!1)}function bf(){if(J!==null){if(le===0)var e=J.return;else e=J,Fi=xr=null,af(e),nn=null,Ta=0,e=J;for(;e!==null;)wy(e.alternate,e),e=e.return;J=null}}function yn(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,KC(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Gi=0,bf(),_e=e,J=i=Yi(e.current,null),te=t,le=0,Bt=null,Cs=!1,On=Ka(e,t),yf=!1,pn=Pt=Sf=lr=js=Re=0,kt=ba=null,bh=!1,t&8&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var r=31-Wt(s),n=1<<r;t|=e[r],s&=~n}return es=t,oc(),i}function Fy(e,t){G=null,K.H=Na,t===Tn||t===cc?(t=I_(),le=3):t===Qd?(t=I_(),le=4):le=t===mf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Bt=t,J===null&&(Re=1,Al(e,ei(t,e.current)))}function Ky(){var e=Kt.current;return e===null?!0:(te&4194048)===te?ii===null:(te&62914560)===te||te&536870912?e===ii:!1}function Yy(){var e=K.H;return K.H=Na,e===null?Na:e}function Vy(){var e=K.A;return K.A=CC,e}function Tl(){Re=4,Cs||(te&4194048)!==te&&Kt.current!==null||(On=!0),!(js&134217727)&&!(lr&134217727)||_e===null||xs(_e,te,Pt,!1)}function au(e,t,i){var s=re;re|=2;var r=Yy(),n=Vy();(_e!==e||te!==t)&&(Ml=null,yn(e,t)),t=!1;var a=Re;e:do try{if(le!==0&&J!==null){var o=J,c=Bt;switch(le){case 8:bf(),a=6;break e;case 3:case 2:case 9:case 6:Kt.current===null&&(t=!0);var l=le;if(le=0,Bt=null,Qr(e,o,c,l),i&&On){a=0;break e}break;default:l=le,le=0,Bt=null,Qr(e,o,c,l)}}AC(),a=Re;break}catch(h){Fy(e,h)}while(!0);return t&&e.shellSuspendCounter++,Fi=xr=null,re=s,K.H=r,K.A=n,J===null&&(_e=null,te=0,oc()),a}function AC(){for(;J!==null;)Gy(J)}function kC(e,t){var i=re;re|=2;var s=Yy(),r=Vy();_e!==e||te!==t?(Ml=null,Rl=Ut()+500,yn(e,t)):On=Ka(e,t);e:do try{if(le!==0&&J!==null){t=J;var n=Bt;t:switch(le){case 1:le=0,Bt=null,Qr(e,t,n,1);break;case 2:case 9:if(W_(n)){le=0,Bt=null,hm(t);break}t=function(){le!==2&&le!==9||_e!==e||(le=7),Mi(e)},n.then(t,t);break e;case 3:le=7;break e;case 4:le=5;break e;case 7:W_(n)?(le=0,Bt=null,hm(t)):(le=0,Bt=null,Qr(e,t,n,7));break;case 5:var a=null;switch(J.tag){case 26:a=J.memoizedState;case 5:case 27:var o=J;if(a?_0(a):o.stateNode.complete){le=0,Bt=null;var c=o.sibling;if(c!==null)J=c;else{var l=o.return;l!==null?(J=l,gc(l)):J=null}break t}}le=0,Bt=null,Qr(e,t,n,5);break;case 6:le=0,Bt=null,Qr(e,t,n,6);break;case 8:bf(),Re=6;break e;default:throw Error(M(462))}}DC();break}catch(h){Fy(e,h)}while(!0);return Fi=xr=null,K.H=s,K.A=r,re=i,J!==null?0:(_e=null,te=0,oc(),Re)}function DC(){for(;J!==null&&!Z1();)Gy(J)}function Gy(e){var t=by(e.alternate,e,es);e.memoizedProps=e.pendingProps,t===null?gc(e):J=t}function hm(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=rm(i,t,t.pendingProps,t.type,void 0,te);break;case 11:t=rm(i,t,t.pendingProps,t.type.render,t.ref,te);break;case 5:af(t);default:wy(i,t),t=J=wv(t,es),t=by(i,t,es)}e.memoizedProps=e.pendingProps,t===null?gc(e):J=t}function Qr(e,t,i,s){Fi=xr=null,af(t),nn=null,Ta=0;var r=t.return;try{if(gC(e,r,t,i,te)){Re=1,Al(e,ei(i,e.current)),J=null;return}}catch(n){if(r!==null)throw J=r,n;Re=1,Al(e,ei(i,e.current)),J=null;return}t.flags&32768?(ie||s===1?e=!0:On||te&536870912?e=!1:(Cs=e=!0,(s===2||s===9||s===3||s===6)&&(s=Kt.current,s!==null&&s.tag===13&&(s.flags|=16384))),$y(t,e)):gc(t)}function gc(e){var t=e;do{if(t.flags&32768){$y(t,Cs);return}e=t.return;var i=yC(t.alternate,t,es);if(i!==null){J=i;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Re===0&&(Re=5)}function $y(e,t){do{var i=SC(e.alternate,e);if(i!==null){i.flags&=32767,J=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=i}while(e!==null);Re=6,J=null}function dm(e,t,i,s,r,n,a,o,c){e.cancelPendingCommit=null;do pc();while(Ve!==0);if(re&6)throw Error(M(327));if(t!==null){if(t===e.current)throw Error(M(177));if(n=t.lanes|t.childLanes,n|=Kd,ow(e,i,n,a,o,c),e===_e&&(J=_e=null,te=0),vn=t,Os=e,Gi=i,wh=n,Ch=r,Wy=s,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,OC(ml,function(){return e0(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,t.subtreeFlags&13878||s){s=K.T,K.T=null,r=ne.p,ne.p=2,a=re,re|=4;try{bC(e,t,i)}finally{re=a,ne.p=r,K.T=s}}Ve=1,Xy(),Zy(),Qy()}}function Xy(){if(Ve===1){Ve=0;var e=Os,t=vn,i=(t.flags&13878)!==0;if(t.subtreeFlags&13878||i){i=K.T,K.T=null;var s=ne.p;ne.p=2;var r=re;re|=4;try{Ny(t,e);var n=Dh,a=_v(e.containerInfo),o=n.focusedElem,c=n.selectionRange;if(a!==o&&o&&o.ownerDocument&&fv(o.ownerDocument.documentElement,o)){if(c!==null&&Fd(o)){var l=c.start,h=c.end;if(h===void 0&&(h=l),"selectionStart"in o)o.selectionStart=l,o.selectionEnd=Math.min(h,o.value.length);else{var u=o.ownerDocument||document,d=u&&u.defaultView||window;if(d.getSelection){var f=d.getSelection(),_=o.textContent.length,m=Math.min(c.start,_),w=c.end===void 0?m:Math.min(c.end,_);!f.extend&&m>w&&(a=w,w=m,m=a);var g=B_(o,m),p=B_(o,w);if(g&&p&&(f.rangeCount!==1||f.anchorNode!==g.node||f.anchorOffset!==g.offset||f.focusNode!==p.node||f.focusOffset!==p.offset)){var v=u.createRange();v.setStart(g.node,g.offset),f.removeAllRanges(),m>w?(f.addRange(v),f.extend(p.node,p.offset)):(v.setEnd(p.node,p.offset),f.addRange(v))}}}}for(u=[],f=o;f=f.parentNode;)f.nodeType===1&&u.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<u.length;o++){var y=u[o];y.element.scrollLeft=y.left,y.element.scrollTop=y.top}}Ul=!!kh,Dh=kh=null}finally{re=r,ne.p=s,K.T=i}}e.current=t,Ve=2}}function Zy(){if(Ve===2){Ve=0;var e=Os,t=vn,i=(t.flags&8772)!==0;if(t.subtreeFlags&8772||i){i=K.T,K.T=null;var s=ne.p;ne.p=2;var r=re;re|=4;try{Dy(e,t.alternate,t)}finally{re=r,ne.p=s,K.T=i}}Ve=3}}function Qy(){if(Ve===4||Ve===3){Ve=0,Q1();var e=Os,t=vn,i=Gi,s=Wy;t.subtreeFlags&10256||t.flags&10256?Ve=5:(Ve=0,vn=Os=null,Jy(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Ts=null),Hd(i),t=t.stateNode,jt&&typeof jt.onCommitFiberRoot=="function")try{jt.onCommitFiberRoot(Fa,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=K.T,r=ne.p,ne.p=2,K.T=null;try{for(var n=e.onRecoverableError,a=0;a<s.length;a++){var o=s[a];n(o.value,{componentStack:o.stack})}}finally{K.T=t,ne.p=r}}Gi&3&&pc(),Mi(e),r=e.pendingLanes,i&261930&&r&42?e===xh?wa++:(wa=0,xh=e):wa=0,Qa(0)}}function Jy(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$a(t)))}function pc(){return Xy(),Zy(),Qy(),e0()}function e0(){if(Ve!==5)return!1;var e=Os,t=wh;wh=0;var i=Hd(Gi),s=K.T,r=ne.p;try{ne.p=32>i?32:i,K.T=null,i=Ch,Ch=null;var n=Os,a=Gi;if(Ve=0,vn=Os=null,Gi=0,re&6)throw Error(M(331));var o=re;if(re|=4,Py(n.current),zy(n,n.current,a,i),re=o,Qa(0,!1),jt&&typeof jt.onPostCommitFiberRoot=="function")try{jt.onPostCommitFiberRoot(Fa,n)}catch{}return!0}finally{ne.p=r,K.T=s,Jy(e,t)}}function fm(e,t,i){t=ei(i,t),t=ph(e.stateNode,t,2),e=Ms(e,t,2),e!==null&&(Ya(e,2),Mi(e))}function ce(e,t,i){if(e.tag===3)fm(e,e,i);else for(;t!==null;){if(t.tag===3){fm(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ts===null||!Ts.has(s))){e=ei(i,e),i=my(2),s=Ms(t,i,2),s!==null&&(gy(i,s,t,e),Ya(s,2),Mi(s));break}}t=t.return}}function ou(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new xC;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(i)||(yf=!0,r.add(i),e=RC.bind(null,e,t,i),t.then(e,e))}function RC(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,_e===e&&(te&i)===i&&(Re===4||Re===3&&(te&62914560)===te&&300>Ut()-_c?!(re&2)&&yn(e,0):Sf|=i,pn===te&&(pn=0)),Mi(e)}function t0(e,t){t===0&&(t=Yp()),e=Cr(e,t),e!==null&&(Ya(e,t),Mi(e))}function MC(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),t0(e,i)}function TC(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(i=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(M(314))}s!==null&&s.delete(t),t0(e,i)}function OC(e,t){return zd(e,t)}var Ol=null,jr=null,Eh=!1,Nl=!1,lu=!1,Es=0;function Mi(e){e!==jr&&e.next===null&&(jr===null?Ol=jr=e:jr=jr.next=e),Nl=!0,Eh||(Eh=!0,BC())}function Qa(e,t){if(!lu&&Nl){lu=!0;do for(var i=!1,s=Ol;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var n=0;else{var a=s.suspendedLanes,o=s.pingedLanes;n=(1<<31-Wt(42|e)+1)-1,n&=r&~(a&~o),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(i=!0,_m(s,n))}else n=te,n=sc(s,s===_e?n:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(n&3)||Ka(s,n)||(i=!0,_m(s,n));s=s.next}while(i);lu=!1}}function NC(){i0()}function i0(){Nl=Eh=!1;var e=0;Es!==0&&FC()&&(e=Es);for(var t=Ut(),i=null,s=Ol;s!==null;){var r=s.next,n=s0(s,t);n===0?(s.next=null,i===null?Ol=r:i.next=r,r===null&&(jr=i)):(i=s,(e!==0||n&3)&&(Nl=!0)),s=r}Ve!==0&&Ve!==5||Qa(e),Es!==0&&(Es=0)}function s0(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var a=31-Wt(n),o=1<<a,c=r[a];c===-1?(!(o&i)||o&s)&&(r[a]=aw(o,t)):c<=t&&(e.expiredLanes|=o),n&=~o}if(t=_e,i=te,i=sc(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(le===2||le===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Lc(s),e.callbackNode=null,e.callbackPriority=0;if(!(i&3)||Ka(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&Lc(s),Hd(i)){case 2:case 8:i=Fp;break;case 32:i=ml;break;case 268435456:i=Kp;break;default:i=ml}return s=r0.bind(null,e),i=zd(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&Lc(s),e.callbackPriority=2,e.callbackNode=null,2}function r0(e,t){if(Ve!==0&&Ve!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(pc()&&e.callbackNode!==i)return null;var s=te;return s=sc(e,e===_e?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(qy(e,s,t),s0(e,Ut()),e.callbackNode!=null&&e.callbackNode===i?r0.bind(null,e):null)}function _m(e,t){if(pc())return null;qy(e,t,!0)}function BC(){YC(function(){re&6?zd(qp,NC):i0()})}function wf(){if(Es===0){var e=_n;e===0&&(e=ho,ho<<=1,!(ho&261888)&&(ho=256)),Es=e}return Es}function mm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:qo(""+e)}function gm(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 zC(e,t,i,s,r){if(t==="submit"&&i&&i.stateNode===r){var n=mm((r[Rt]||null).action),a=s.submitter;a&&(t=(t=a[Rt]||null)?mm(t.formAction):a.getAttribute("formAction"),t!==null&&(n=t,a=null));var o=new rc("action","action",null,s,r);e.push({event:o,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Es!==0){var c=a?gm(r,a):new FormData(r);mh(i,{pending:!0,data:c,method:r.method,action:n},null,c)}}else typeof n=="function"&&(o.preventDefault(),c=a?gm(r,a):new FormData(r),mh(i,{pending:!0,data:c,method:r.method,action:n},n,c))},currentTarget:r}]})}}for(var cu=0;cu<sh.length;cu++){var uu=sh[cu],LC=uu.toLowerCase(),HC=uu[0].toUpperCase()+uu.slice(1);hi(LC,"on"+HC)}hi(gv,"onAnimationEnd");hi(pv,"onAnimationIteration");hi(vv,"onAnimationStart");hi("dblclick","onDoubleClick");hi("focusin","onFocus");hi("focusout","onBlur");hi(Jw,"onTransitionRun");hi(eC,"onTransitionStart");hi(tC,"onTransitionCancel");hi(yv,"onTransitionEnd");dn("onMouseEnter",["mouseout","mouseover"]);dn("onMouseLeave",["mouseout","mouseover"]);dn("onPointerEnter",["pointerout","pointerover"]);dn("onPointerLeave",["pointerout","pointerover"]);Sr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Sr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Sr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Sr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Sr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Sr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ba="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(" "),PC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ba));function n0(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],r=s.event;s=s.listeners;e:{var n=void 0;if(t)for(var a=s.length-1;0<=a;a--){var o=s[a],c=o.instance,l=o.currentTarget;if(o=o.listener,c!==n&&r.isPropagationStopped())break e;n=o,r.currentTarget=l;try{n(r)}catch(h){pl(h)}r.currentTarget=null,n=c}else for(a=0;a<s.length;a++){if(o=s[a],c=o.instance,l=o.currentTarget,o=o.listener,c!==n&&r.isPropagationStopped())break e;n=o,r.currentTarget=l;try{n(r)}catch(h){pl(h)}r.currentTarget=null,n=c}}}}function Q(e,t){var i=t[$u];i===void 0&&(i=t[$u]=new Set);var s=e+"__bubble";i.has(s)||(a0(t,e,2,!1),i.add(s))}function hu(e,t,i){var s=0;t&&(s|=4),a0(i,e,s,t)}var wo="_reactListening"+Math.random().toString(36).slice(2);function Cf(e){if(!e[wo]){e[wo]=!0,Zp.forEach(function(i){i!=="selectionchange"&&(PC.has(i)||hu(i,!1,e),hu(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wo]||(t[wo]=!0,hu("selectionchange",!1,t))}}function a0(e,t,i,s){switch(y0(t)){case 2:var r=dx;break;case 8:r=fx;break;default:r=kf}i=r.bind(null,t,i,e),r=void 0,!eh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,i,{capture:!0,passive:r}):e.addEventListener(t,i,!0):r!==void 0?e.addEventListener(t,i,{passive:r}):e.addEventListener(t,i,!1)}function du(e,t,i,s,r){var n=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var a=s.tag;if(a===3||a===4){var o=s.stateNode.containerInfo;if(o===r)break;if(a===4)for(a=s.return;a!==null;){var c=a.tag;if((c===3||c===4)&&a.stateNode.containerInfo===r)return;a=a.return}for(;o!==null;){if(a=qr(o),a===null)return;if(c=a.tag,c===5||c===6||c===26||c===27){s=n=a;continue e}o=o.parentNode}}s=s.return}nv(function(){var l=n,h=jd(i),u=[];e:{var d=Sv.get(e);if(d!==void 0){var f=rc,_=e;switch(e){case"keypress":if(Ko(i)===0)break e;case"keydown":case"keyup":f=Tw;break;case"focusin":_="focus",f=Wc;break;case"focusout":_="blur",f=Wc;break;case"beforeblur":case"afterblur":f=Wc;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":f=x_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=yw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=Bw;break;case gv:case pv:case vv:f=ww;break;case yv:f=Lw;break;case"scroll":case"scrollend":f=pw;break;case"wheel":f=Pw;break;case"copy":case"cut":case"paste":f=xw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=A_;break;case"toggle":case"beforetoggle":f=jw}var m=(t&4)!==0,w=!m&&(e==="scroll"||e==="scrollend"),g=m?d!==null?d+"Capture":null:d;m=[];for(var p=l,v;p!==null;){var y=p;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||g===null||(y=Aa(p,g),y!=null&&m.push(za(p,y,v))),w)break;p=p.return}0<m.length&&(d=new f(d,_,null,i,h),u.push({event:d,listeners:m}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",f=e==="mouseout"||e==="pointerout",d&&i!==Ju&&(_=i.relatedTarget||i.fromElement)&&(qr(_)||_[Dn]))break e;if((f||d)&&(d=h.window===h?h:(d=h.ownerDocument)?d.defaultView||d.parentWindow:window,f?(_=i.relatedTarget||i.toElement,f=l,_=_?qr(_):null,_!==null&&(w=qa(_),m=_.tag,_!==w||m!==5&&m!==27&&m!==6)&&(_=null)):(f=null,_=l),f!==_)){if(m=x_,y="onMouseLeave",g="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(m=A_,y="onPointerLeave",g="onPointerEnter",p="pointer"),w=f==null?d:ia(f),v=_==null?d:ia(_),d=new m(y,p+"leave",f,i,h),d.target=w,d.relatedTarget=v,y=null,qr(h)===l&&(m=new m(g,p+"enter",_,i,h),m.target=v,m.relatedTarget=w,y=m),w=y,f&&_)t:{for(m=UC,g=f,p=_,v=0,y=g;y;y=m(y))v++;y=0;for(var C=p;C;C=m(C))y++;for(;0<v-y;)g=m(g),v--;for(;0<y-v;)p=m(p),y--;for(;v--;){if(g===p||p!==null&&g===p.alternate){m=g;break t}g=m(g),p=m(p)}m=null}else m=null;f!==null&&pm(u,d,f,m,!1),_!==null&&w!==null&&pm(u,w,_,m,!0)}}e:{if(d=l?ia(l):window,f=d.nodeName&&d.nodeName.toLowerCase(),f==="select"||f==="input"&&d.type==="file")var k=M_;else if(R_(d))if(hv)k=Xw;else{k=Gw;var D=Vw}else f=d.nodeName,!f||f.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?l&&Ud(l.elementType)&&(k=M_):k=$w;if(k&&(k=k(e,l))){uv(u,k,i,h);break e}D&&D(e,d,l),e==="focusout"&&l&&d.type==="number"&&l.memoizedProps.value!=null&&Qu(d,"number",d.value)}switch(D=l?ia(l):window,e){case"focusin":(R_(D)||D.contentEditable==="true")&&(Yr=D,th=l,fa=null);break;case"focusout":fa=th=Yr=null;break;case"mousedown":ih=!0;break;case"contextmenu":case"mouseup":case"dragend":ih=!1,z_(u,i,h);break;case"selectionchange":if(Qw)break;case"keydown":case"keyup":z_(u,i,h)}var E;if(qd)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Kr?lv(e,i)&&(N="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(N="onCompositionStart");N&&(ov&&i.locale!=="ko"&&(Kr||N!=="onCompositionStart"?N==="onCompositionEnd"&&Kr&&(E=av()):(ws=h,Wd="value"in ws?ws.value:ws.textContent,Kr=!0)),D=Bl(l,N),0<D.length&&(N=new E_(N,e,null,i,h),u.push({event:N,listeners:D}),E?N.data=E:(E=cv(i),E!==null&&(N.data=E)))),(E=Iw?qw(e,i):Fw(e,i))&&(N=Bl(l,"onBeforeInput"),0<N.length&&(D=new E_("onBeforeInput","beforeinput",null,i,h),u.push({event:D,listeners:N}),D.data=E)),zC(u,e,l,i,h)}n0(u,t)})}function za(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Bl(e,t){for(var i=t+"Capture",s=[];e!==null;){var r=e,n=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||n===null||(r=Aa(e,i),r!=null&&s.unshift(za(e,r,n)),r=Aa(e,t),r!=null&&s.push(za(e,r,n))),e.tag===3)return s;e=e.return}return[]}function UC(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pm(e,t,i,s,r){for(var n=t._reactName,a=[];i!==null&&i!==s;){var o=i,c=o.alternate,l=o.stateNode;if(o=o.tag,c!==null&&c===s)break;o!==5&&o!==26&&o!==27||l===null||(c=l,r?(l=Aa(i,n),l!=null&&a.unshift(za(i,l,c))):r||(l=Aa(i,n),l!=null&&a.push(za(i,l,c)))),i=i.return}a.length!==0&&e.push({event:t,listeners:a})}var jC=/\r\n?/g,WC=/\u0000|\uFFFD/g;function vm(e){return(typeof e=="string"?e:""+e).replace(jC,`
|
|
49
|
+
`).replace(WC,"")}function o0(e,t){return t=vm(t),vm(e)===t}function de(e,t,i,s,r,n){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||fn(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&fn(e,""+s);break;case"className":mo(e,"class",s);break;case"tabIndex":mo(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":mo(e,i,s);break;case"style":rv(e,s,n);break;case"data":if(t!=="object"){mo(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=qo(""+s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof n=="function"&&(i==="formAction"?(t!=="input"&&de(e,t,"name",r.name,r,null),de(e,t,"formEncType",r.formEncType,r,null),de(e,t,"formMethod",r.formMethod,r,null),de(e,t,"formTarget",r.formTarget,r,null)):(de(e,t,"encType",r.encType,r,null),de(e,t,"method",r.method,r,null),de(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=qo(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=qi);break;case"onScroll":s!=null&&Q("scroll",e);break;case"onScrollEnd":s!=null&&Q("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(M(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(M(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=qo(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""+s):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":Q("beforetoggle",e),Q("toggle",e),Io(e,"popover",s);break;case"xlinkActuate":Ni(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Ni(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Ni(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Ni(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Ni(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Ni(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Ni(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Ni(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Ni(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Io(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=mw.get(i)||i,Io(e,i,s))}}function Ah(e,t,i,s,r,n){switch(i){case"style":rv(e,s,n);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(M(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(M(60));e.innerHTML=i}}break;case"children":typeof s=="string"?fn(e,s):(typeof s=="number"||typeof s=="bigint")&&fn(e,""+s);break;case"onScroll":s!=null&&Q("scroll",e);break;case"onScrollEnd":s!=null&&Q("scrollend",e);break;case"onClick":s!=null&&(e.onclick=qi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qp.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(r=i.endsWith("Capture"),t=i.slice(2,r?i.length-7:void 0),n=e[Rt]||null,n=n!=null?n[i]:null,typeof n=="function"&&e.removeEventListener(t,n,r),typeof s=="function")){typeof n!="function"&&n!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,r);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):Io(e,i,s)}}}function ht(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Q("error",e),Q("load",e);var s=!1,r=!1,n;for(n in i)if(i.hasOwnProperty(n)){var a=i[n];if(a!=null)switch(n){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(M(137,t));default:de(e,t,n,a,i,null)}}r&&de(e,t,"srcSet",i.srcSet,i,null),s&&de(e,t,"src",i.src,i,null);return;case"input":Q("invalid",e);var o=n=a=r=null,c=null,l=null;for(s in i)if(i.hasOwnProperty(s)){var h=i[s];if(h!=null)switch(s){case"name":r=h;break;case"type":a=h;break;case"checked":c=h;break;case"defaultChecked":l=h;break;case"value":n=h;break;case"defaultValue":o=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(M(137,t));break;default:de(e,t,s,h,i,null)}}tv(e,n,o,c,l,a,r,!1);return;case"select":Q("invalid",e),s=a=n=null;for(r in i)if(i.hasOwnProperty(r)&&(o=i[r],o!=null))switch(r){case"value":n=o;break;case"defaultValue":a=o;break;case"multiple":s=o;default:de(e,t,r,o,i,null)}t=n,i=a,e.multiple=!!s,t!=null?tn(e,!!s,t,!1):i!=null&&tn(e,!!s,i,!0);return;case"textarea":Q("invalid",e),n=r=s=null;for(a in i)if(i.hasOwnProperty(a)&&(o=i[a],o!=null))switch(a){case"value":s=o;break;case"defaultValue":r=o;break;case"children":n=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(M(91));break;default:de(e,t,a,o,i,null)}sv(e,s,r,n);return;case"option":for(c in i)if(i.hasOwnProperty(c)&&(s=i[c],s!=null))switch(c){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:de(e,t,c,s,i,null)}return;case"dialog":Q("beforetoggle",e),Q("toggle",e),Q("cancel",e),Q("close",e);break;case"iframe":case"object":Q("load",e);break;case"video":case"audio":for(s=0;s<Ba.length;s++)Q(Ba[s],e);break;case"image":Q("error",e),Q("load",e);break;case"details":Q("toggle",e);break;case"embed":case"source":case"link":Q("error",e),Q("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(l in i)if(i.hasOwnProperty(l)&&(s=i[l],s!=null))switch(l){case"children":case"dangerouslySetInnerHTML":throw Error(M(137,t));default:de(e,t,l,s,i,null)}return;default:if(Ud(t)){for(h in i)i.hasOwnProperty(h)&&(s=i[h],s!==void 0&&Ah(e,t,h,s,i,void 0));return}}for(o in i)i.hasOwnProperty(o)&&(s=i[o],s!=null&&de(e,t,o,s,i,null))}function IC(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,n=null,a=null,o=null,c=null,l=null,h=null;for(f in i){var u=i[f];if(i.hasOwnProperty(f)&&u!=null)switch(f){case"checked":break;case"value":break;case"defaultValue":c=u;default:s.hasOwnProperty(f)||de(e,t,f,null,s,u)}}for(var d in s){var f=s[d];if(u=i[d],s.hasOwnProperty(d)&&(f!=null||u!=null))switch(d){case"type":n=f;break;case"name":r=f;break;case"checked":l=f;break;case"defaultChecked":h=f;break;case"value":a=f;break;case"defaultValue":o=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(M(137,t));break;default:f!==u&&de(e,t,d,f,s,u)}}Zu(e,a,o,c,l,h,n,r);return;case"select":f=a=o=d=null;for(n in i)if(c=i[n],i.hasOwnProperty(n)&&c!=null)switch(n){case"value":break;case"multiple":f=c;default:s.hasOwnProperty(n)||de(e,t,n,null,s,c)}for(r in s)if(n=s[r],c=i[r],s.hasOwnProperty(r)&&(n!=null||c!=null))switch(r){case"value":d=n;break;case"defaultValue":o=n;break;case"multiple":a=n;default:n!==c&&de(e,t,r,n,s,c)}t=o,i=a,s=f,d!=null?tn(e,!!i,d,!1):!!s!=!!i&&(t!=null?tn(e,!!i,t,!0):tn(e,!!i,i?[]:"",!1));return;case"textarea":f=d=null;for(o in i)if(r=i[o],i.hasOwnProperty(o)&&r!=null&&!s.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:de(e,t,o,null,s,r)}for(a in s)if(r=s[a],n=i[a],s.hasOwnProperty(a)&&(r!=null||n!=null))switch(a){case"value":d=r;break;case"defaultValue":f=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(M(91));break;default:r!==n&&de(e,t,a,r,s,n)}iv(e,d,f);return;case"option":for(var _ in i)if(d=i[_],i.hasOwnProperty(_)&&d!=null&&!s.hasOwnProperty(_))switch(_){case"selected":e.selected=!1;break;default:de(e,t,_,null,s,d)}for(c in s)if(d=s[c],f=i[c],s.hasOwnProperty(c)&&d!==f&&(d!=null||f!=null))switch(c){case"selected":e.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:de(e,t,c,d,s,f)}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 m in i)d=i[m],i.hasOwnProperty(m)&&d!=null&&!s.hasOwnProperty(m)&&de(e,t,m,null,s,d);for(l in s)if(d=s[l],f=i[l],s.hasOwnProperty(l)&&d!==f&&(d!=null||f!=null))switch(l){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(M(137,t));break;default:de(e,t,l,d,s,f)}return;default:if(Ud(t)){for(var w in i)d=i[w],i.hasOwnProperty(w)&&d!==void 0&&!s.hasOwnProperty(w)&&Ah(e,t,w,void 0,s,d);for(h in s)d=s[h],f=i[h],!s.hasOwnProperty(h)||d===f||d===void 0&&f===void 0||Ah(e,t,h,d,s,f);return}}for(var g in i)d=i[g],i.hasOwnProperty(g)&&d!=null&&!s.hasOwnProperty(g)&&de(e,t,g,null,s,d);for(u in s)d=s[u],f=i[u],!s.hasOwnProperty(u)||d===f||d==null&&f==null||de(e,t,u,d,s,f)}function ym(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function qC(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var r=i[s],n=r.transferSize,a=r.initiatorType,o=r.duration;if(n&&o&&ym(a)){for(a=0,o=r.responseEnd,s+=1;s<i.length;s++){var c=i[s],l=c.startTime;if(l>o)break;var h=c.transferSize,u=c.initiatorType;h&&ym(u)&&(c=c.responseEnd,a+=h*(c<o?1:(o-l)/(c-l)))}if(--s,t+=8*(n+a)/(r.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 kh=null,Dh=null;function zl(e){return e.nodeType===9?e:e.ownerDocument}function Sm(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 l0(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 Rh(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 fu=null;function FC(){var e=window.event;return e&&e.type==="popstate"?e===fu?!1:(fu=e,!0):(fu=null,!1)}var c0=typeof setTimeout=="function"?setTimeout:void 0,KC=typeof clearTimeout=="function"?clearTimeout:void 0,bm=typeof Promise=="function"?Promise:void 0,YC=typeof queueMicrotask=="function"?queueMicrotask:typeof bm<"u"?function(e){return bm.resolve(null).then(e).catch(VC)}:c0;function VC(e){setTimeout(function(){throw e})}function Fs(e){return e==="head"}function wm(e,t){var i=t,s=0;do{var r=i.nextSibling;if(e.removeChild(i),r&&r.nodeType===8)if(i=r.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(r),bn(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")Ca(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Ca(i);for(var n=i.firstChild;n;){var a=n.nextSibling,o=n.nodeName;n[Va]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&n.rel.toLowerCase()==="stylesheet"||i.removeChild(n),n=a}}else i==="body"&&Ca(e.ownerDocument.body);i=r}while(i);bn(t)}function Cm(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function Mh(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":Mh(i),Pd(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function GC(e,t,i,s){for(;e.nodeType===1;){var r=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Va])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=si(e.nextSibling),e===null)break}return null}function $C(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=si(e.nextSibling),e===null))return null;return e}function u0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=si(e.nextSibling),e===null))return null;return e}function Th(e){return e.data==="$?"||e.data==="$~"}function Oh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function XC(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function si(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 Nh=null;function xm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return si(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function Em(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 h0(e,t,i){switch(t=zl(i),e){case"html":if(e=t.documentElement,!e)throw Error(M(452));return e;case"head":if(e=t.head,!e)throw Error(M(453));return e;case"body":if(e=t.body,!e)throw Error(M(454));return e;default:throw Error(M(451))}}function Ca(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pd(e)}var ni=new Map,Am=new Set;function Ll(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ss=ne.d;ne.d={f:ZC,r:QC,D:JC,C:ex,L:tx,m:ix,X:rx,S:sx,M:nx};function ZC(){var e=ss.f(),t=mc();return e||t}function QC(e){var t=Rn(e);t!==null&&t.tag===5&&t.type==="form"?ry(t):ss.r(e)}var Nn=typeof document>"u"?null:document;function d0(e,t,i){var s=Nn;if(s&&typeof t=="string"&&t){var r=Jt(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof i=="string"&&(r+='[crossorigin="'+i+'"]'),Am.has(r)||(Am.add(r),e={rel:e,crossOrigin:i,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),ht(t,"link",e),it(t),s.head.appendChild(t)))}}function JC(e){ss.D(e),d0("dns-prefetch",e,null)}function ex(e,t){ss.C(e,t),d0("preconnect",e,t)}function tx(e,t,i){ss.L(e,t,i);var s=Nn;if(s&&e&&t){var r='link[rel="preload"][as="'+Jt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(r+='[imagesrcset="'+Jt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(r+='[imagesizes="'+Jt(i.imageSizes)+'"]')):r+='[href="'+Jt(e)+'"]';var n=r;switch(t){case"style":n=Sn(e);break;case"script":n=Bn(e)}ni.has(n)||(e=be({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),ni.set(n,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(Ja(n))||t==="script"&&s.querySelector(eo(n))||(t=s.createElement("link"),ht(t,"link",e),it(t),s.head.appendChild(t)))}}function ix(e,t){ss.m(e,t);var i=Nn;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Jt(s)+'"][href="'+Jt(e)+'"]',n=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Bn(e)}if(!ni.has(n)&&(e=be({rel:"modulepreload",href:e},t),ni.set(n,e),i.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(eo(n)))return}s=i.createElement("link"),ht(s,"link",e),it(s),i.head.appendChild(s)}}}function sx(e,t,i){ss.S(e,t,i);var s=Nn;if(s&&e){var r=en(s).hoistableStyles,n=Sn(e);t=t||"default";var a=r.get(n);if(!a){var o={loading:0,preload:null};if(a=s.querySelector(Ja(n)))o.loading=5;else{e=be({rel:"stylesheet",href:e,"data-precedence":t},i),(i=ni.get(n))&&xf(e,i);var c=a=s.createElement("link");it(c),ht(c,"link",e),c._p=new Promise(function(l,h){c.onload=l,c.onerror=h}),c.addEventListener("load",function(){o.loading|=1}),c.addEventListener("error",function(){o.loading|=2}),o.loading|=4,Jo(a,t,s)}a={type:"stylesheet",instance:a,count:1,state:o},r.set(n,a)}}}function rx(e,t){ss.X(e,t);var i=Nn;if(i&&e){var s=en(i).hoistableScripts,r=Bn(e),n=s.get(r);n||(n=i.querySelector(eo(r)),n||(e=be({src:e,async:!0},t),(t=ni.get(r))&&Ef(e,t),n=i.createElement("script"),it(n),ht(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function nx(e,t){ss.M(e,t);var i=Nn;if(i&&e){var s=en(i).hoistableScripts,r=Bn(e),n=s.get(r);n||(n=i.querySelector(eo(r)),n||(e=be({src:e,async:!0,type:"module"},t),(t=ni.get(r))&&Ef(e,t),n=i.createElement("script"),it(n),ht(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function km(e,t,i,s){var r=(r=ks.current)?Ll(r):null;if(!r)throw Error(M(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Sn(i.href),i=en(r).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Sn(i.href);var n=en(r).hoistableStyles,a=n.get(e);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,a),(n=r.querySelector(Ja(e)))&&!n._p&&(a.instance=n,a.state.loading=5),ni.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},ni.set(e,i),n||ax(r,e,i,a.state))),t&&s===null)throw Error(M(528,""));return a}if(t&&s!==null)throw Error(M(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Bn(i),i=en(r).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(M(444,e))}}function Sn(e){return'href="'+Jt(e)+'"'}function Ja(e){return'link[rel="stylesheet"]['+e+"]"}function f0(e){return be({},e,{"data-precedence":e.precedence,precedence:null})}function ax(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),ht(t,"link",i),it(t),e.head.appendChild(t))}function Bn(e){return'[src="'+Jt(e)+'"]'}function eo(e){return"script[async]"+e}function Dm(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Jt(i.href)+'"]');if(s)return t.instance=s,it(s),s;var r=be({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),it(s),ht(s,"style",r),Jo(s,i.precedence,e),t.instance=s;case"stylesheet":r=Sn(i.href);var n=e.querySelector(Ja(r));if(n)return t.state.loading|=4,t.instance=n,it(n),n;s=f0(i),(r=ni.get(r))&&xf(s,r),n=(e.ownerDocument||e).createElement("link"),it(n);var a=n;return a._p=new Promise(function(o,c){a.onload=o,a.onerror=c}),ht(n,"link",s),t.state.loading|=4,Jo(n,i.precedence,e),t.instance=n;case"script":return n=Bn(i.src),(r=e.querySelector(eo(n)))?(t.instance=r,it(r),r):(s=i,(r=ni.get(n))&&(s=be({},i),Ef(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),it(r),ht(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(M(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,Jo(s,i.precedence,e));return t.instance}function Jo(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,n=r,a=0;a<s.length;a++){var o=s[a];if(o.dataset.precedence===t)n=o;else if(n!==r)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function xf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ef(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var el=null;function Rm(e,t,i){if(el===null){var s=new Map,r=el=new Map;r.set(i,s)}else r=el,s=r.get(i),s||(s=new Map,r.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),r=0;r<i.length;r++){var n=i[r];if(!(n[Va]||n[ot]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var a=n.getAttribute(t)||"";a=e+a;var o=s.get(a);o?o.push(n):s.set(a,[n])}}return s}function Mm(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function ox(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 _0(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function lx(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&!(i.state.loading&4)){if(i.instance===null){var r=Sn(s.href),n=t.querySelector(Ja(r));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Hl.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=n,it(n);return}n=t.ownerDocument||t,s=f0(s),(r=ni.get(r))&&xf(s,r),n=n.createElement("link"),it(n);var a=n;a._p=new Promise(function(o,c){a.onload=o,a.onerror=c}),ht(n,"link",s),i.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&!(i.state.loading&3)&&(e.count++,i=Hl.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var _u=0;function cx(e,t){return e.stylesheets&&e.count===0&&tl(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&tl(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&_u===0&&(_u=62500*qC());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tl(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>_u?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function Hl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Pl=null;function tl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Pl=new Map,t.forEach(ux,e),Pl=null,Hl.call(e))}function ux(e,t){if(!(t.state.loading&4)){var i=Pl.get(e);if(i)var s=i.get(null);else{i=new Map,Pl.set(e,i);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<r.length;n++){var a=r[n];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(i.set(a.dataset.precedence,a),s=a)}s&&i.set(null,s)}r=t.instance,a=r.getAttribute("data-precedence"),n=i.get(a)||s,n===s&&i.set(null,r),i.set(a,r),this.count++,s=Hl.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),n?n.parentNode.insertBefore(r,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var La={$$typeof:Ii,Provider:null,Consumer:null,_currentValue:rr,_currentValue2:rr,_threadCount:0};function hx(e,t,i,s,r,n,a,o,c){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=Hc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hc(0),this.hiddenUpdates=Hc(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=n,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function m0(e,t,i,s,r,n,a,o,c,l,h,u){return e=new hx(e,t,i,a,c,l,h,u,o),t=1,n===!0&&(t|=24),n=Ht(3,null,null,t),e.current=n,n.stateNode=e,t=Xd(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:s,isDehydrated:i,cache:t},Jd(n),e}function g0(e){return e?(e=$r,e):$r}function p0(e,t,i,s,r,n){r=g0(r),s.context===null?s.context=r:s.pendingContext=r,s=Rs(t),s.payload={element:i},n=n===void 0?null:n,n!==null&&(s.callback=n),i=Ms(e,s,t),i!==null&&(Dt(i,e,t),ma(i,e,t))}function Tm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Af(e,t){Tm(e,t),(e=e.alternate)&&Tm(e,t)}function v0(e){if(e.tag===13||e.tag===31){var t=Cr(e,67108864);t!==null&&Dt(t,e,67108864),Af(e,67108864)}}function Om(e){if(e.tag===13||e.tag===31){var t=It();t=Ld(t);var i=Cr(e,t);i!==null&&Dt(i,e,t),Af(e,t)}}var Ul=!0;function dx(e,t,i,s){var r=K.T;K.T=null;var n=ne.p;try{ne.p=2,kf(e,t,i,s)}finally{ne.p=n,K.T=r}}function fx(e,t,i,s){var r=K.T;K.T=null;var n=ne.p;try{ne.p=8,kf(e,t,i,s)}finally{ne.p=n,K.T=r}}function kf(e,t,i,s){if(Ul){var r=Bh(s);if(r===null)du(e,t,s,jl,i),Nm(e,s);else if(mx(r,e,t,i,s))s.stopPropagation();else if(Nm(e,s),t&4&&-1<_x.indexOf(e)){for(;r!==null;){var n=Rn(r);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var a=Qs(n.pendingLanes);if(a!==0){var o=n;for(o.pendingLanes|=2,o.entangledLanes|=2;a;){var c=1<<31-Wt(a);o.entanglements[1]|=c,a&=~c}Mi(n),!(re&6)&&(Rl=Ut()+500,Qa(0))}}break;case 31:case 13:o=Cr(n,2),o!==null&&Dt(o,n,2),mc(),Af(n,2)}if(n=Bh(s),n===null&&du(e,t,s,jl,i),n===r)break;r=n}r!==null&&s.stopPropagation()}else du(e,t,s,null,i)}}function Bh(e){return e=jd(e),Df(e)}var jl=null;function Df(e){if(jl=null,e=qr(e),e!==null){var t=qa(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=Pp(t),e!==null)return e;e=null}else if(i===31){if(e=Up(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 jl=e,null}function y0(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(J1()){case qp:return 2;case Fp:return 8;case ml:case ew:return 32;case Kp:return 268435456;default:return 32}default:return 32}}var zh=!1,Ns=null,Bs=null,zs=null,Ha=new Map,Pa=new Map,Ss=[],_x="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 Nm(e,t){switch(e){case"focusin":case"focusout":Ns=null;break;case"dragenter":case"dragleave":Bs=null;break;case"mouseover":case"mouseout":zs=null;break;case"pointerover":case"pointerout":Ha.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pa.delete(t.pointerId)}}function Yn(e,t,i,s,r,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:n,targetContainers:[r]},t!==null&&(t=Rn(t),t!==null&&v0(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function mx(e,t,i,s,r){switch(t){case"focusin":return Ns=Yn(Ns,e,t,i,s,r),!0;case"dragenter":return Bs=Yn(Bs,e,t,i,s,r),!0;case"mouseover":return zs=Yn(zs,e,t,i,s,r),!0;case"pointerover":var n=r.pointerId;return Ha.set(n,Yn(Ha.get(n)||null,e,t,i,s,r)),!0;case"gotpointercapture":return n=r.pointerId,Pa.set(n,Yn(Pa.get(n)||null,e,t,i,s,r)),!0}return!1}function S0(e){var t=qr(e.target);if(t!==null){var i=qa(t);if(i!==null){if(t=i.tag,t===13){if(t=Pp(i),t!==null){e.blockedOn=t,p_(e.priority,function(){Om(i)});return}}else if(t===31){if(t=Up(i),t!==null){e.blockedOn=t,p_(e.priority,function(){Om(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 il(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Bh(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);Ju=s,i.target.dispatchEvent(s),Ju=null}else return t=Rn(i),t!==null&&v0(t),e.blockedOn=i,!1;t.shift()}return!0}function Bm(e,t,i){il(e)&&i.delete(t)}function gx(){zh=!1,Ns!==null&&il(Ns)&&(Ns=null),Bs!==null&&il(Bs)&&(Bs=null),zs!==null&&il(zs)&&(zs=null),Ha.forEach(Bm),Pa.forEach(Bm)}function Co(e,t){e.blockedOn===t&&(e.blockedOn=null,zh||(zh=!0,Ge.unstable_scheduleCallback(Ge.unstable_NormalPriority,gx)))}var xo=null;function zm(e){xo!==e&&(xo=e,Ge.unstable_scheduleCallback(Ge.unstable_NormalPriority,function(){xo===e&&(xo=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(Df(s||i)===null)continue;break}var n=Rn(i);n!==null&&(e.splice(t,3),t-=3,mh(n,{pending:!0,data:r,method:i.method,action:s},s,r))}}))}function bn(e){function t(c){return Co(c,e)}Ns!==null&&Co(Ns,e),Bs!==null&&Co(Bs,e),zs!==null&&Co(zs,e),Ha.forEach(t),Pa.forEach(t);for(var i=0;i<Ss.length;i++){var s=Ss[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Ss.length&&(i=Ss[0],i.blockedOn===null);)S0(i),i.blockedOn===null&&Ss.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var r=i[s],n=i[s+1],a=r[Rt]||null;if(typeof n=="function")a||zm(i);else if(a){var o=null;if(n&&n.hasAttribute("formAction")){if(r=n,a=n[Rt]||null)o=a.formAction;else if(Df(r)!==null)continue}else o=a.action;typeof o=="function"?i[s+1]=o:(i.splice(s,3),s-=3),zm(i)}}}function b0(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(a){return r=a})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Rf(e){this._internalRoot=e}vc.prototype.render=Rf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));var i=t.current,s=It();p0(i,s,e,t,null,null)};vc.prototype.unmount=Rf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;p0(e.current,2,null,e,null,null),mc(),t[Dn]=null}};function vc(e){this._internalRoot=e}vc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xp();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ss.length&&t!==0&&t<Ss[i].priority;i++);Ss.splice(i,0,e),i===0&&S0(e)}};var Lm=Lp.version;if(Lm!=="19.2.7")throw Error(M(527,Lm,"19.2.7"));ne.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(M(188)):(e=Object.keys(e).join(","),Error(M(268,e)));return e=Y1(t),e=e!==null?jp(e):null,e=e===null?null:e.stateNode,e};var px={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eo.isDisabled&&Eo.supportsFiber)try{Fa=Eo.inject(px),jt=Eo}catch{}}ec.createRoot=function(e,t){if(!Hp(e))throw Error(M(299));var i=!1,s="",r=dy,n=fy,a=_y;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=m0(e,1,!1,null,null,i,s,null,r,n,a,b0),e[Dn]=t.current,Cf(e),new Rf(t)};ec.hydrateRoot=function(e,t,i){if(!Hp(e))throw Error(M(299));var s=!1,r="",n=dy,a=fy,o=_y,c=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(n=i.onUncaughtError),i.onCaughtError!==void 0&&(a=i.onCaughtError),i.onRecoverableError!==void 0&&(o=i.onRecoverableError),i.formState!==void 0&&(c=i.formState)),t=m0(e,1,!0,t,i??null,s,r,c,n,a,o,b0),t.context=g0(null),i=t.current,s=It(),s=Ld(s),r=Rs(s),r.callback=null,Ms(i,r,s),i=s,t.current.lanes=i,Ya(t,i),Mi(t),e[Dn]=t.current,Cf(e),new vc(t)};ec.version="19.2.7";function w0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(w0)}catch(e){console.error(e)}}w0(),Mp.exports=ec;var vx=Mp.exports;const C0={"app.tagline":"A graphical desktop over plain SSH","login.title":"Connect to a server","login.host":"Host / IP","login.port":"Port","login.username":"Username","login.authMethod":"Authentication","login.auth.password":"Password","login.auth.key":"Private key (PEM)","login.password":"Password","login.keyFile":"Key file","login.keyHint":"Paste your private key or choose a file","login.passphrase":"Passphrase (optional)","login.submit":"Connect","login.connecting":"Connecting…","login.error":"Could not connect","hostkey.title":"Verify host authenticity","hostkey.body":"The server's identity is not yet known. Make sure this fingerprint matches the server you trust before continuing.","hostkey.fingerprint":"Fingerprint","hostkey.cancel":"Cancel","hostkey.confirm":"Trust and connect","connected.title":"Connected","connected.os":"Operating system","connected.home":"Home","connected.listing":"Home directory","connected.transparency":"Commands run (transparency)","connected.disconnect":"Disconnect","connected.empty":"Empty directory","desktop.start":"Apps","desktop.disconnect":"Disconnect","desktop.comingSoon":"Coming soon","apps.files":"Files","apps.system":"System info","apps.terminal":"Terminal","apps.monitor":"System monitor","apps.editor":"Stallman","system.os":"Operating system","system.host":"Host","system.home":"Home","system.transparency":"Commands run (transparency)","monitor.uptime":"Uptime","monitor.load":"Load average (1 / 5 / 15 min)","monitor.memory":"Memory","monitor.memoryUsage":"{used} of {total} ({pct}%)","monitor.unavailable":"Metrics unavailable","files.up":"Up","files.empty":"Empty directory","files.error":"Could not list directory","editor.untitled":"No file open","editor.save":"Save","editor.saved":"Saved","editor.saving":"Saving…","editor.unsaved":"Unsaved changes","editor.loadError":"Could not open file","editor.saveError":"Could not save","editor.binary":"This file does not look like text and was not opened."},yx={"app.tagline":"Un escritorio gráfico sobre SSH puro","login.title":"Conectar a un servidor","login.host":"Host / IP","login.port":"Puerto","login.username":"Usuario","login.authMethod":"Autenticación","login.auth.password":"Contraseña","login.auth.key":"Clave privada (PEM)","login.password":"Contraseña","login.keyFile":"Archivo de clave","login.keyHint":"Pega tu clave privada o elige un archivo","login.passphrase":"Frase de paso (opcional)","login.submit":"Conectar","login.connecting":"Conectando…","login.error":"No se pudo conectar","hostkey.title":"Verificar la autenticidad del servidor","hostkey.body":"La identidad del servidor aún no se conoce. Asegúrate de que esta huella coincide con el servidor en el que confías antes de continuar.","hostkey.fingerprint":"Huella","hostkey.cancel":"Cancelar","hostkey.confirm":"Confiar y conectar","connected.title":"Conectado","connected.os":"Sistema operativo","connected.home":"Inicio","connected.listing":"Directorio de inicio","connected.transparency":"Comandos ejecutados (transparencia)","connected.disconnect":"Desconectar","connected.empty":"Directorio vacío","desktop.start":"Apps","desktop.disconnect":"Desconectar","desktop.comingSoon":"Próximamente","apps.files":"Archivos","apps.system":"Información del sistema","apps.terminal":"Terminal","apps.monitor":"Monitor del sistema","apps.editor":"Stallman","system.os":"Sistema operativo","system.host":"Host","system.home":"Inicio","system.transparency":"Comandos ejecutados (transparencia)","monitor.uptime":"Tiempo encendido","monitor.load":"Carga media (1 / 5 / 15 min)","monitor.memory":"Memoria","monitor.memoryUsage":"{used} de {total} ({pct}%)","monitor.unavailable":"Métricas no disponibles","files.up":"Subir","files.empty":"Directorio vacío","files.error":"No se pudo listar el directorio","editor.untitled":"Ningún archivo abierto","editor.save":"Guardar","editor.saved":"Guardado","editor.saving":"Guardando…","editor.unsaved":"Cambios sin guardar","editor.loadError":"No se pudo abrir el archivo","editor.saveError":"No se pudo guardar","editor.binary":"Este archivo no parece de texto y no se abrió."},Sx={en:C0,es:yx},bx=["en","es"],wx="en";function Cx(e=typeof navigator<"u"?navigator.languages:[]){for(const t of e){const i=t.toLowerCase().split("-")[0];if(i&&bx.includes(i))return i}return wx}function xx(e,t,i){const s=Sx[e][t]??C0[t];return i?s.replace(/\{(\w+)\}/g,(r,n)=>n in i?String(i[n]):`{${n}}`):s}function Ex(e){return(t,i)=>xx(e,t,i)}async function zn(e,t){const i=await fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),s=await i.json().catch(()=>({}));if(!i.ok){const r=typeof s=="object"&&s!==null&&"error"in s?String(s.error):`Request failed (${i.status})`;throw new Error(r)}return s}function Ax(e){return zn("/api/connect",e)}function x0(e,t){return zn("/api/listdir",{sessionId:e,path:t})}function kx(e){return zn("/api/disconnect",{sessionId:e})}function Dx(e){return zn("/api/metrics",{sessionId:e})}function Rx(e,t){return zn("/api/readfile",{sessionId:e,path:t})}function Mx(e,t,i){return zn("/api/writefile",{sessionId:e,path:t,base64:i})}/**
|
|
50
|
+
* @license lucide-react v1.21.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const E0=(...e)=>e.filter((t,i,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===i).join(" ").trim();/**
|
|
55
|
+
* @license lucide-react v1.21.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/const Tx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
60
|
+
* @license lucide-react v1.21.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/const Ox=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,i,s)=>s?s.toUpperCase():i.toLowerCase());/**
|
|
65
|
+
* @license lucide-react v1.21.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const Hm=e=>{const t=Ox(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
70
|
+
* @license lucide-react v1.21.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/var mu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
75
|
+
* @license lucide-react v1.21.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/const Nx=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Bx=S.createContext({}),zx=()=>S.useContext(Bx),Lx=S.forwardRef(({color:e,size:t,strokeWidth:i,absoluteStrokeWidth:s,className:r="",children:n,iconNode:a,...o},c)=>{const{size:l=24,strokeWidth:h=2,absoluteStrokeWidth:u=!1,color:d="currentColor",className:f=""}=zx()??{},_=s??u?Number(i??h)*24/Number(t??l):i??h;return S.createElement("svg",{ref:c,...mu,width:t??l??mu.width,height:t??l??mu.height,stroke:e??d,strokeWidth:_,className:E0("lucide",f,r),...!n&&!Nx(o)&&{"aria-hidden":"true"},...o},[...a.map(([m,w])=>S.createElement(m,w)),...Array.isArray(n)?n:[n]])});/**
|
|
80
|
+
* @license lucide-react v1.21.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/const Xe=(e,t)=>{const i=S.forwardRef(({className:s,...r},n)=>S.createElement(Lx,{ref:n,iconNode:t,className:E0(`lucide-${Tx(Hm(e))}`,`lucide-${e}`,s),...r}));return i.displayName=Hm(e),i};/**
|
|
85
|
+
* @license lucide-react v1.21.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/const Hx=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Px=Xe("activity",Hx);/**
|
|
90
|
+
* @license lucide-react v1.21.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/const Ux=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],jx=Xe("chevron-up",Ux);/**
|
|
95
|
+
* @license lucide-react v1.21.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/const Wx=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ix=Xe("circle",Wx);/**
|
|
100
|
+
* @license lucide-react v1.21.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const qx=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Fx=Xe("file-text",qx);/**
|
|
105
|
+
* @license lucide-react v1.21.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const Kx=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Yx=Xe("file",Kx);/**
|
|
110
|
+
* @license lucide-react v1.21.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const Vx=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],A0=Xe("folder",Vx);/**
|
|
115
|
+
* @license lucide-react v1.21.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const Gx=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],$x=Xe("info",Gx);/**
|
|
120
|
+
* @license lucide-react v1.21.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const Xx=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Zx=Xe("key-round",Xx);/**
|
|
125
|
+
* @license lucide-react v1.21.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const Qx=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Jx=Xe("layout-grid",Qx);/**
|
|
130
|
+
* @license lucide-react v1.21.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const e2=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],t2=Xe("link-2",e2);/**
|
|
135
|
+
* @license lucide-react v1.21.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const i2=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],s2=Xe("lock",i2);/**
|
|
140
|
+
* @license lucide-react v1.21.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const r2=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],n2=Xe("log-out",r2);/**
|
|
145
|
+
* @license lucide-react v1.21.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const a2=[["path",{d:"M5 12h14",key:"1ays0h"}]],o2=Xe("minus",a2);/**
|
|
150
|
+
* @license lucide-react v1.21.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const l2=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],c2=Xe("save",l2);/**
|
|
155
|
+
* @license lucide-react v1.21.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const u2=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],k0=Xe("server",u2);/**
|
|
160
|
+
* @license lucide-react v1.21.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const h2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]],d2=Xe("shield-question-mark",h2);/**
|
|
165
|
+
* @license lucide-react v1.21.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const f2=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],_2=Xe("square-terminal",f2);/**
|
|
170
|
+
* @license lucide-react v1.21.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const m2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],g2=Xe("square",m2);/**
|
|
175
|
+
* @license lucide-react v1.21.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const p2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],v2=Xe("x",p2);function D0(e){var t,i,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(i=D0(e[t]))&&(s&&(s+=" "),s+=i)}else for(i in e)e[i]&&(s&&(s+=" "),s+=i);return s}function R0(){for(var e,t,i=0,s="",r=arguments.length;i<r;i++)(e=arguments[i])&&(t=D0(e))&&(s&&(s+=" "),s+=t);return s}const Pm=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Um=R0,Mf=(e,t)=>i=>{var s;if((t==null?void 0:t.variants)==null)return Um(e,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:r,defaultVariants:n}=t,a=Object.keys(r).map(l=>{const h=i==null?void 0:i[l],u=n==null?void 0:n[l];if(h===null)return null;const d=Pm(h)||Pm(u);return r[l][d]}),o=i&&Object.entries(i).reduce((l,h)=>{let[u,d]=h;return d===void 0||(l[u]=d),l},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((l,h)=>{let{class:u,className:d,...f}=h;return Object.entries(f).every(_=>{let[m,w]=_;return Array.isArray(w)?w.includes({...n,...o}[m]):{...n,...o}[m]===w})?[...l,u,d]:l},[]);return Um(e,a,c,i==null?void 0:i.class,i==null?void 0:i.className)};function jm(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function y2(...e){return t=>{let i=!1;const s=e.map(r=>{const n=jm(r,t);return!i&&typeof n=="function"&&(i=!0),n});if(i)return()=>{for(let r=0;r<s.length;r++){const n=s[r];typeof n=="function"?n():jm(e[r],null)}}}}function _t(...e){return S.useCallback(y2(...e),e)}function wn(e){const t=S.forwardRef((i,s)=>{let{children:r,...n}=i,a=null,o=!1;const c=[];Wm(r)&&typeof Ao=="function"&&(r=Ao(r._payload)),S.Children.forEach(r,d=>{var f;if(E2(d)){o=!0;const _=d;let m="child"in _.props?_.props.child:_.props.children;Wm(m)&&typeof Ao=="function"&&(m=Ao(m._payload)),a=w2(_,m),c.push((f=a==null?void 0:a.props)==null?void 0:f.children)}else c.push(d)}),a?a=S.cloneElement(a,void 0,c):!o&&S.Children.count(r)===1&&S.isValidElement(r)&&(a=r);const l=a?x2(a):void 0,h=_t(s,l);if(!a){if(r||r===0)throw new Error(o?R2(e):D2(e));return r}const u=C2(n,a.props??{});return a.type!==S.Fragment&&(u.ref=s?h:l),S.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var S2=wn("Slot"),b2=Symbol.for("radix.slottable"),w2=(e,t)=>{if("child"in e.props){const i=e.props.child;return S.isValidElement(i)?S.cloneElement(i,void 0,e.props.children(i.props.children)):null}return S.isValidElement(t)?t:null};function C2(e,t){const i={...t};for(const s in t){const r=e[s],n=t[s];/^on[A-Z]/.test(s)?r&&n?i[s]=(...o)=>{const c=n(...o);return r(...o),c}:r&&(i[s]=r):s==="style"?i[s]={...r,...n}:s==="className"&&(i[s]=[r,n].filter(Boolean).join(" "))}return{...e,...i}}function x2(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,i=t&&"isReactWarning"in t&&t.isReactWarning;return i?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,i=t&&"isReactWarning"in t&&t.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}function E2(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===b2}var A2=Symbol.for("react.lazy");function Wm(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===A2&&"_payload"in e&&k2(e._payload)}function k2(e){return typeof e=="object"&&e!==null&&"then"in e}var D2=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,R2=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Ao=Od[" use ".trim().toString()],M2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Me=M2.reduce((e,t)=>{const i=wn(`Primitive.${t}`),s=S.forwardRef((r,n)=>{const{asChild:a,...o}=r,c=a?i:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(c,{...o,ref:n})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function T2(e,t){e&&ic.flushSync(()=>e.dispatchEvent(t))}function Er(e,t=[]){let i=[];function s(n,a){const o=S.createContext(a);o.displayName=n+"Context";const c=i.length;i=[...i,a];const l=u=>{var g;const{scope:d,children:f,..._}=u,m=((g=d==null?void 0:d[e])==null?void 0:g[c])||o,w=S.useMemo(()=>_,Object.values(_));return b.jsx(m.Provider,{value:w,children:f})};l.displayName=n+"Provider";function h(u,d){var m;const f=((m=d==null?void 0:d[e])==null?void 0:m[c])||o,_=S.useContext(f);if(_)return _;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${n}\``)}return[l,h]}const r=()=>{const n=i.map(a=>S.createContext(a));return function(o){const c=(o==null?void 0:o[e])||n;return S.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return r.scopeName=e,[s,O2(r,...t)]}function O2(...e){const t=e[0];if(e.length===1)return t;const i=()=>{const s=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(n){const a=s.reduce((o,{useScope:c,scopeName:l})=>{const u=c(n)[`__scope${l}`];return{...o,...u}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return i.scopeName=t.scopeName,i}function N2(e){const t=e+"CollectionProvider",[i,s]=Er(t),[r,n]=i(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:w,children:g}=m,p=S.useRef(null),v=S.useRef(new Map).current;return b.jsx(r,{scope:w,itemMap:v,collectionRef:p,children:g})};a.displayName=t;const o=e+"CollectionSlot",c=wn(o),l=S.forwardRef((m,w)=>{const{scope:g,children:p}=m,v=n(o,g),y=_t(w,v.collectionRef);return b.jsx(c,{ref:y,children:p})});l.displayName=o;const h=e+"CollectionItemSlot",u="data-radix-collection-item",d=wn(h),f=S.forwardRef((m,w)=>{const{scope:g,children:p,...v}=m,y=S.useRef(null),C=_t(w,y),k=n(h,g);return S.useEffect(()=>(k.itemMap.set(y,{ref:y,...v}),()=>void k.itemMap.delete(y))),b.jsx(d,{[u]:"",ref:C,children:p})});f.displayName=h;function _(m){const w=n(e+"CollectionConsumer",m);return S.useCallback(()=>{const p=w.collectionRef.current;if(!p)return[];const v=Array.from(p.querySelectorAll(`[${u}]`));return Array.from(w.itemMap.values()).sort((k,D)=>v.indexOf(k.ref.current)-v.indexOf(D.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:a,Slot:l,ItemSlot:f},_,s]}function Ae(e,t,{checkForDefaultPrevented:i=!0}={}){return function(r){if(e==null||e(r),i===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}var $i=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},B2=Od[" useInsertionEffect ".trim().toString()]||$i;function yc({prop:e,defaultProp:t,onChange:i=()=>{},caller:s}){const[r,n,a]=z2({defaultProp:t,onChange:i}),o=e!==void 0,c=o?e:r;{const h=S.useRef(e!==void 0);S.useEffect(()=>{const u=h.current;u!==o&&console.warn(`${s} is changing from ${u?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=o},[o,s])}const l=S.useCallback(h=>{var u;if(o){const d=L2(h)?h(e):h;d!==e&&((u=a.current)==null||u.call(a,d))}else n(h)},[o,e,n,a]);return[c,l]}function z2({defaultProp:e,onChange:t}){const[i,s]=S.useState(e),r=S.useRef(i),n=S.useRef(t);return B2(()=>{n.current=t},[t]),S.useEffect(()=>{var a;r.current!==i&&((a=n.current)==null||a.call(n,i),r.current=i)},[i,r]),[i,s,n]}function L2(e){return typeof e=="function"}function H2(e,t){return S.useReducer((i,s)=>t[i][s]??i,e)}var Ar=e=>{const{present:t,children:i}=e,s=P2(t),r=typeof i=="function"?i({present:s.isPresent}):S.Children.only(i),n=U2(s.ref,j2(r));return typeof i=="function"||s.isPresent?S.cloneElement(r,{ref:n}):null};Ar.displayName="Presence";function P2(e){const[t,i]=S.useState(),s=S.useRef(null),r=S.useRef(e),n=S.useRef("none"),a=e?"mounted":"unmounted",[o,c]=H2(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const l=ko(s.current);n.current=o==="mounted"?l:"none"},[o]),$i(()=>{const l=s.current,h=r.current;if(h!==e){const d=n.current,f=ko(l);e?c("MOUNT"):f==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(h&&d!==f?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),$i(()=>{if(t){let l;const h=t.ownerDocument.defaultView??window,u=f=>{const m=ko(s.current).includes(CSS.escape(f.animationName));if(f.target===t&&m&&(c("ANIMATION_END"),!r.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",l=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},d=f=>{f.target===t&&(n.current=ko(s.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{h.clearTimeout(l),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:S.useCallback(l=>{s.current=l?getComputedStyle(l):null,i(l)},[])}}function Im(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function U2(...e){const t=S.useRef(e);return t.current=e,S.useCallback(i=>{const s=t.current;let r=!1;const n=s.map(a=>{const o=Im(a,i);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let a=0;a<n.length;a++){const o=n[a];typeof o=="function"?o():Im(s[a],null)}}},[])}function ko(e){return(e==null?void 0:e.animationName)||"none"}function j2(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,i=t&&"isReactWarning"in t&&t.isReactWarning;return i?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,i=t&&"isReactWarning"in t&&t.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var W2=Od[" useId ".trim().toString()]||(()=>{}),I2=0;function ln(e){const[t,i]=S.useState(W2());return $i(()=>{i(s=>s??String(I2++))},[e]),e||(t?`radix-${t}`:"")}var q2=S.createContext(void 0);function M0(e){const t=S.useContext(q2);return e||t||"ltr"}function mr(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...i)=>{var s;return(s=t.current)==null?void 0:s.call(t,...i)},[])}function F2(e,t=globalThis==null?void 0:globalThis.document){const i=mr(e);S.useEffect(()=>{const s=r=>{r.key==="Escape"&&i(r)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[i,t])}var K2="DismissableLayer",Lh="dismissableLayer.update",Y2="dismissableLayer.pointerDownOutside",V2="dismissableLayer.focusOutside",qm,Tf=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Of=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:r,onPointerDownOutside:n,onFocusOutside:a,onInteractOutside:o,onDismiss:c,...l}=e,h=S.useContext(Tf),[u,d]=S.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=S.useState({}),m=_t(t,N=>d(N)),w=Array.from(h.layers),[g]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),p=w.indexOf(g),v=u?w.indexOf(u):-1,y=h.layersWithOutsidePointerEventsDisabled.size>0,C=v>=p,k=S.useRef(!1),D=Z2(N=>{const U=N.target;if(!(U instanceof Node))return;const I=[...h.branches].some(B=>B.contains(U));!C||I||(n==null||n(N),o==null||o(N),N.defaultPrevented||c==null||c())},{ownerDocument:f,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:k,dismissableSurfaces:h.dismissableSurfaces}),E=Q2(N=>{if(s&&k.current)return;const U=N.target;[...h.branches].some(B=>B.contains(U))||(a==null||a(N),o==null||o(N),N.defaultPrevented||c==null||c())},f);return F2(N=>{v===h.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&c&&(N.preventDefault(),c()))},f),S.useEffect(()=>{if(u)return i&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(qm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(u)),h.layers.add(u),Fm(),()=>{i&&(h.layersWithOutsidePointerEventsDisabled.delete(u),h.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=qm))}},[u,f,i,h]),S.useEffect(()=>()=>{u&&(h.layers.delete(u),h.layersWithOutsidePointerEventsDisabled.delete(u),Fm())},[u,h]),S.useEffect(()=>{const N=()=>_({});return document.addEventListener(Lh,N),()=>document.removeEventListener(Lh,N)},[]),b.jsx(Me.div,{...l,ref:m,style:{pointerEvents:y?C?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,D.onPointerDownCapture)})});Of.displayName=K2;var G2="DismissableLayerBranch",$2=S.forwardRef((e,t)=>{const i=S.useContext(Tf),s=S.useRef(null),r=_t(t,s);return S.useEffect(()=>{const n=s.current;if(n)return i.branches.add(n),()=>{i.branches.delete(n)}},[i.branches]),b.jsx(Me.div,{...e,ref:r})});$2.displayName=G2;function X2(){const e=S.useContext(Tf),[t,i]=S.useState(null);return S.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),i}function Z2(e,t){const{ownerDocument:i=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:s=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:n}=t,a=mr(e),o=S.useRef(!1),c=S.useRef(!1),l=S.useRef(new Map),h=S.useRef(()=>{});return S.useEffect(()=>{function u(){c.current=!1,r.current=!1,l.current.clear()}function d(){return Array.from(l.current.values()).some(Boolean)}function f(p){if(!c.current)return;const v=p.target;v instanceof Node&&[...n].some(C=>C.contains(v))||l.current.set(p.type,!0),p.type==="click"&&window.setTimeout(()=>{c.current&&h.current()},0)}function _(p){c.current&&l.current.set(p.type,!1)}const m=p=>{if(p.target&&!o.current){let v=function(){i.removeEventListener("click",h.current);const C=d();u(),C||T0(Y2,a,y,{discrete:!0})};const y={originalEvent:p};c.current=!0,r.current=s&&p.button===0,l.current.clear(),!s||p.button!==0?v():(i.removeEventListener("click",h.current),h.current=v,i.addEventListener("click",h.current,{once:!0}))}else i.removeEventListener("click",h.current),u();o.current=!1},w=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const p of w)i.addEventListener(p,f,!0),i.addEventListener(p,_);const g=window.setTimeout(()=>{i.addEventListener("pointerdown",m)},0);return()=>{window.clearTimeout(g),i.removeEventListener("pointerdown",m),i.removeEventListener("click",h.current);for(const p of w)i.removeEventListener(p,f,!0),i.removeEventListener(p,_)}},[i,a,s,r,n]),{onPointerDownCapture:()=>o.current=!0}}function Q2(e,t=globalThis==null?void 0:globalThis.document){const i=mr(e),s=S.useRef(!1);return S.useEffect(()=>{const r=n=>{n.target&&!s.current&&T0(V2,i,{originalEvent:n},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,i]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Fm(){const e=new CustomEvent(Lh);document.dispatchEvent(e)}function T0(e,t,i,{discrete:s}){const r=i.originalEvent.target,n=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:i});t&&r.addEventListener(e,t,{once:!0}),s?T2(r,n):r.dispatchEvent(n)}var gu="focusScope.autoFocusOnMount",pu="focusScope.autoFocusOnUnmount",Km={bubbles:!1,cancelable:!0},J2="FocusScope",Nf=S.forwardRef((e,t)=>{const{loop:i=!1,trapped:s=!1,onMountAutoFocus:r,onUnmountAutoFocus:n,...a}=e,[o,c]=S.useState(null),l=mr(r),h=mr(n),u=S.useRef(null),d=_t(t,m=>c(m)),f=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(s){let m=function(v){if(f.paused||!o)return;const y=v.target;o.contains(y)?u.current=y:fs(u.current,{select:!0})},w=function(v){if(f.paused||!o)return;const y=v.relatedTarget;y!==null&&(o.contains(y)||fs(u.current,{select:!0}))},g=function(v){if(document.activeElement===document.body)for(const C of v)C.removedNodes.length>0&&fs(o)};document.addEventListener("focusin",m),document.addEventListener("focusout",w);const p=new MutationObserver(g);return o&&p.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",w),p.disconnect()}}},[s,o,f.paused]),S.useEffect(()=>{if(o){Vm.add(f);const m=document.activeElement;if(!o.contains(m)){const g=new CustomEvent(gu,Km);o.addEventListener(gu,l),o.dispatchEvent(g),g.defaultPrevented||(eE(nE(O0(o)),{select:!0}),document.activeElement===m&&fs(o))}return()=>{o.removeEventListener(gu,l),setTimeout(()=>{const g=new CustomEvent(pu,Km);o.addEventListener(pu,h),o.dispatchEvent(g),g.defaultPrevented||fs(m??document.body,{select:!0}),o.removeEventListener(pu,h),Vm.remove(f)},0)}}},[o,l,h,f]);const _=S.useCallback(m=>{if(!i&&!s||f.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(w&&g){const p=m.currentTarget,[v,y]=tE(p);v&&y?!m.shiftKey&&g===y?(m.preventDefault(),i&&fs(v,{select:!0})):m.shiftKey&&g===v&&(m.preventDefault(),i&&fs(y,{select:!0})):g===p&&m.preventDefault()}},[i,s,f.paused]);return b.jsx(Me.div,{tabIndex:-1,...a,ref:d,onKeyDown:_})});Nf.displayName=J2;function eE(e,{select:t=!1}={}){const i=document.activeElement;for(const s of e)if(fs(s,{select:t}),document.activeElement!==i)return}function tE(e){const t=O0(e),i=Ym(t,e),s=Ym(t.reverse(),e);return[i,s]}function O0(e){const t=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)t.push(i.currentNode);return t}function Ym(e,t){for(const i of e)if(!iE(i,{upTo:t}))return i}function iE(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function sE(e){return e instanceof HTMLInputElement&&"select"in e}function fs(e,{select:t=!1}={}){if(e&&e.focus){const i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&sE(e)&&t&&e.select()}}var Vm=rE();function rE(){let e=[];return{add(t){const i=e[0];t!==i&&(i==null||i.pause()),e=Gm(e,t),e.unshift(t)},remove(t){var i;e=Gm(e,t),(i=e[0])==null||i.resume()}}}function Gm(e,t){const i=[...e],s=i.indexOf(t);return s!==-1&&i.splice(s,1),i}function nE(e){return e.filter(t=>t.tagName!=="A")}var aE="Portal",Bf=S.forwardRef((e,t)=>{var o;const{container:i,...s}=e,[r,n]=S.useState(!1);$i(()=>n(!0),[]);const a=i||r&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?ic.createPortal(b.jsx(Me.div,{...s,ref:t}),a):null});Bf.displayName=aE;var Do=0,_i=null;function N0(){S.useEffect(()=>{_i||(_i={start:$m(),end:$m()});const{start:e,end:t}=_i;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Do++,()=>{Do===1&&(_i==null||_i.start.remove(),_i==null||_i.end.remove(),_i=null),Do=Math.max(0,Do-1)}},[])}function $m(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var yi=function(){return yi=Object.assign||function(t){for(var i,s=1,r=arguments.length;s<r;s++){i=arguments[s];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},yi.apply(this,arguments)};function B0(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(i[s[r]]=e[s[r]]);return i}function oE(e,t,i){if(i||arguments.length===2)for(var s=0,r=t.length,n;s<r;s++)(n||!(s in t))&&(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))}var sl="right-scroll-bar-position",rl="width-before-scroll-bar",lE="with-scroll-bars-hidden",cE="--removed-body-scroll-bar-size";function vu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function uE(e,t){var i=S.useState(function(){return{value:e,callback:t,facade:{get current(){return i.value},set current(s){var r=i.value;r!==s&&(i.value=s,i.callback(s,r))}}}})[0];return i.callback=t,i.facade}var hE=typeof window<"u"?S.useLayoutEffect:S.useEffect,Xm=new WeakMap;function dE(e,t){var i=uE(null,function(s){return e.forEach(function(r){return vu(r,s)})});return hE(function(){var s=Xm.get(i);if(s){var r=new Set(s),n=new Set(e),a=i.current;r.forEach(function(o){n.has(o)||vu(o,null)}),n.forEach(function(o){r.has(o)||vu(o,a)})}Xm.set(i,e)},[e]),i}function fE(e){return e}function _E(e,t){t===void 0&&(t=fE);var i=[],s=!1,r={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:e},useMedium:function(n){var a=t(n,s);return i.push(a),function(){i=i.filter(function(o){return o!==a})}},assignSyncMedium:function(n){for(s=!0;i.length;){var a=i;i=[],a.forEach(n)}i={push:function(o){return n(o)},filter:function(){return i}}},assignMedium:function(n){s=!0;var a=[];if(i.length){var o=i;i=[],o.forEach(n),a=i}var c=function(){var h=a;a=[],h.forEach(n)},l=function(){return Promise.resolve().then(c)};l(),i={push:function(h){a.push(h),l()},filter:function(h){return a=a.filter(h),i}}}};return r}function mE(e){e===void 0&&(e={});var t=_E(null);return t.options=yi({async:!0,ssr:!1},e),t}var z0=function(e){var t=e.sideCar,i=B0(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return S.createElement(s,yi({},i))};z0.isSideCarExport=!0;function gE(e,t){return e.useMedium(t),z0}var L0=mE(),yu=function(){},Sc=S.forwardRef(function(e,t){var i=S.useRef(null),s=S.useState({onScrollCapture:yu,onWheelCapture:yu,onTouchMoveCapture:yu}),r=s[0],n=s[1],a=e.forwardProps,o=e.children,c=e.className,l=e.removeScrollBar,h=e.enabled,u=e.shards,d=e.sideCar,f=e.noRelative,_=e.noIsolation,m=e.inert,w=e.allowPinchZoom,g=e.as,p=g===void 0?"div":g,v=e.gapMode,y=B0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=d,k=dE([i,t]),D=yi(yi({},y),r);return S.createElement(S.Fragment,null,h&&S.createElement(C,{sideCar:L0,removeScrollBar:l,shards:u,noRelative:f,noIsolation:_,inert:m,setCallbacks:n,allowPinchZoom:!!w,lockRef:i,gapMode:v}),a?S.cloneElement(S.Children.only(o),yi(yi({},D),{ref:k})):S.createElement(p,yi({},D,{className:c,ref:k}),o))});Sc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Sc.classNames={fullWidth:rl,zeroRight:sl};var pE=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function vE(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pE();return t&&e.setAttribute("nonce",t),e}function yE(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function SE(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var bE=function(){var e=0,t=null;return{add:function(i){e==0&&(t=vE())&&(yE(t,i),SE(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},wE=function(){var e=bE();return function(t,i){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&i])}},H0=function(){var e=wE(),t=function(i){var s=i.styles,r=i.dynamic;return e(s,r),null};return t},CE={left:0,top:0,right:0,gap:0},Su=function(e){return parseInt(e||"",10)||0},xE=function(e){var t=window.getComputedStyle(document.body),i=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Su(i),Su(s),Su(r)]},EE=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return CE;var t=xE(e),i=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-i+t[2]-t[0])}},AE=H0(),cn="data-scroll-locked",kE=function(e,t,i,s){var r=e.left,n=e.top,a=e.right,o=e.gap;return i===void 0&&(i="margin"),`
|
|
180
|
+
.`.concat(lE,` {
|
|
181
|
+
overflow: hidden `).concat(s,`;
|
|
182
|
+
padding-right: `).concat(o,"px ").concat(s,`;
|
|
183
|
+
}
|
|
184
|
+
body[`).concat(cn,`] {
|
|
185
|
+
overflow: hidden `).concat(s,`;
|
|
186
|
+
overscroll-behavior: contain;
|
|
187
|
+
`).concat([t&&"position: relative ".concat(s,";"),i==="margin"&&`
|
|
188
|
+
padding-left: `.concat(r,`px;
|
|
189
|
+
padding-top: `).concat(n,`px;
|
|
190
|
+
padding-right: `).concat(a,`px;
|
|
191
|
+
margin-left:0;
|
|
192
|
+
margin-top:0;
|
|
193
|
+
margin-right: `).concat(o,"px ").concat(s,`;
|
|
194
|
+
`),i==="padding"&&"padding-right: ".concat(o,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.`).concat(sl,` {
|
|
198
|
+
right: `).concat(o,"px ").concat(s,`;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.`).concat(rl,` {
|
|
202
|
+
margin-right: `).concat(o,"px ").concat(s,`;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.`).concat(sl," .").concat(sl,` {
|
|
206
|
+
right: 0 `).concat(s,`;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.`).concat(rl," .").concat(rl,` {
|
|
210
|
+
margin-right: 0 `).concat(s,`;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
body[`).concat(cn,`] {
|
|
214
|
+
`).concat(cE,": ").concat(o,`px;
|
|
215
|
+
}
|
|
216
|
+
`)},Zm=function(){var e=parseInt(document.body.getAttribute(cn)||"0",10);return isFinite(e)?e:0},DE=function(){S.useEffect(function(){return document.body.setAttribute(cn,(Zm()+1).toString()),function(){var e=Zm()-1;e<=0?document.body.removeAttribute(cn):document.body.setAttribute(cn,e.toString())}},[])},RE=function(e){var t=e.noRelative,i=e.noImportant,s=e.gapMode,r=s===void 0?"margin":s;DE();var n=S.useMemo(function(){return EE(r)},[r]);return S.createElement(AE,{styles:kE(n,!t,r,i?"":"!important")})},Hh=!1;if(typeof window<"u")try{var Ro=Object.defineProperty({},"passive",{get:function(){return Hh=!0,!0}});window.addEventListener("test",Ro,Ro),window.removeEventListener("test",Ro,Ro)}catch{Hh=!1}var Tr=Hh?{passive:!1}:!1,ME=function(e){return e.tagName==="TEXTAREA"},P0=function(e,t){if(!(e instanceof Element))return!1;var i=window.getComputedStyle(e);return i[t]!=="hidden"&&!(i.overflowY===i.overflowX&&!ME(e)&&i[t]==="visible")},TE=function(e){return P0(e,"overflowY")},OE=function(e){return P0(e,"overflowX")},Qm=function(e,t){var i=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var r=U0(e,s);if(r){var n=j0(e,s),a=n[1],o=n[2];if(a>o)return!0}s=s.parentNode}while(s&&s!==i.body);return!1},NE=function(e){var t=e.scrollTop,i=e.scrollHeight,s=e.clientHeight;return[t,i,s]},BE=function(e){var t=e.scrollLeft,i=e.scrollWidth,s=e.clientWidth;return[t,i,s]},U0=function(e,t){return e==="v"?TE(t):OE(t)},j0=function(e,t){return e==="v"?NE(t):BE(t)},zE=function(e,t){return e==="h"&&t==="rtl"?-1:1},LE=function(e,t,i,s,r){var n=zE(e,window.getComputedStyle(t).direction),a=n*s,o=i.target,c=t.contains(o),l=!1,h=a>0,u=0,d=0;do{if(!o)break;var f=j0(e,o),_=f[0],m=f[1],w=f[2],g=m-w-n*_;(_||g)&&U0(e,o)&&(u+=g,d+=_);var p=o.parentNode;o=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!c&&o!==document.body||c&&(t.contains(o)||t===o));return(h&&Math.abs(u)<1||!h&&Math.abs(d)<1)&&(l=!0),l},Mo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Jm=function(e){return[e.deltaX,e.deltaY]},eg=function(e){return e&&"current"in e?e.current:e},HE=function(e,t){return e[0]===t[0]&&e[1]===t[1]},PE=function(e){return`
|
|
217
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
218
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
219
|
+
`)},UE=0,Or=[];function jE(e){var t=S.useRef([]),i=S.useRef([0,0]),s=S.useRef(),r=S.useState(UE++)[0],n=S.useState(H0)[0],a=S.useRef(e);S.useEffect(function(){a.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=oE([e.lockRef.current],(e.shards||[]).map(eg),!0).filter(Boolean);return m.forEach(function(w){return w.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var o=S.useCallback(function(m,w){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var g=Mo(m),p=i.current,v="deltaX"in m?m.deltaX:p[0]-g[0],y="deltaY"in m?m.deltaY:p[1]-g[1],C,k=m.target,D=Math.abs(v)>Math.abs(y)?"h":"v";if("touches"in m&&D==="h"&&k.type==="range")return!1;var E=window.getSelection(),N=E&&E.anchorNode,U=N?N===k||N.contains(k):!1;if(U)return!1;var I=Qm(D,k);if(!I)return!0;if(I?C=D:(C=D==="v"?"h":"v",I=Qm(D,k)),!I)return!1;if(!s.current&&"changedTouches"in m&&(v||y)&&(s.current=C),!C)return!0;var B=s.current||C;return LE(B,w,m,B==="h"?v:y)},[]),c=S.useCallback(function(m){var w=m;if(!(!Or.length||Or[Or.length-1]!==n)){var g="deltaY"in w?Jm(w):Mo(w),p=t.current.filter(function(C){return C.name===w.type&&(C.target===w.target||w.target===C.shadowParent)&&HE(C.delta,g)})[0];if(p&&p.should){w.cancelable&&w.preventDefault();return}if(!p){var v=(a.current.shards||[]).map(eg).filter(Boolean).filter(function(C){return C.contains(w.target)}),y=v.length>0?o(w,v[0]):!a.current.noIsolation;y&&w.cancelable&&w.preventDefault()}}},[]),l=S.useCallback(function(m,w,g,p){var v={name:m,delta:w,target:g,should:p,shadowParent:WE(g)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(y){return y!==v})},1)},[]),h=S.useCallback(function(m){i.current=Mo(m),s.current=void 0},[]),u=S.useCallback(function(m){l(m.type,Jm(m),m.target,o(m,e.lockRef.current))},[]),d=S.useCallback(function(m){l(m.type,Mo(m),m.target,o(m,e.lockRef.current))},[]);S.useEffect(function(){return Or.push(n),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:d}),document.addEventListener("wheel",c,Tr),document.addEventListener("touchmove",c,Tr),document.addEventListener("touchstart",h,Tr),function(){Or=Or.filter(function(m){return m!==n}),document.removeEventListener("wheel",c,Tr),document.removeEventListener("touchmove",c,Tr),document.removeEventListener("touchstart",h,Tr)}},[]);var f=e.removeScrollBar,_=e.inert;return S.createElement(S.Fragment,null,_?S.createElement(n,{styles:PE(r)}):null,f?S.createElement(RE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function WE(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const IE=gE(L0,jE);var zf=S.forwardRef(function(e,t){return S.createElement(Sc,yi({},e,{ref:t,sideCar:IE}))});zf.classNames=Sc.classNames;var qE=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Nr=new WeakMap,To=new WeakMap,Oo={},bu=0,W0=function(e){return e&&(e.host||W0(e.parentNode))},FE=function(e,t){return t.map(function(i){if(e.contains(i))return i;var s=W0(i);return s&&e.contains(s)?s:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},KE=function(e,t,i,s){var r=FE(t,Array.isArray(e)?e:[e]);Oo[i]||(Oo[i]=new WeakMap);var n=Oo[i],a=[],o=new Set,c=new Set(r),l=function(u){!u||o.has(u)||(o.add(u),l(u.parentNode))};r.forEach(l);var h=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(d){if(o.has(d))h(d);else try{var f=d.getAttribute(s),_=f!==null&&f!=="false",m=(Nr.get(d)||0)+1,w=(n.get(d)||0)+1;Nr.set(d,m),n.set(d,w),a.push(d),m===1&&_&&To.set(d,!0),w===1&&d.setAttribute(i,"true"),_||d.setAttribute(s,"true")}catch(g){console.error("aria-hidden: cannot operate on ",d,g)}})};return h(t),o.clear(),bu++,function(){a.forEach(function(u){var d=Nr.get(u)-1,f=n.get(u)-1;Nr.set(u,d),n.set(u,f),d||(To.has(u)||u.removeAttribute(s),To.delete(u)),f||u.removeAttribute(i)}),bu--,bu||(Nr=new WeakMap,Nr=new WeakMap,To=new WeakMap,Oo={})}},I0=function(e,t,i){i===void 0&&(i="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),r=qE(e);return r?(s.push.apply(s,Array.from(r.querySelectorAll("[aria-live], script"))),KE(s,r,i,"aria-hidden")):function(){return null}},bc="Dialog",[q0,F0]=Er(bc),[YE,di]=q0(bc),K0=e=>{const{__scopeDialog:t,children:i,open:s,defaultOpen:r,onOpenChange:n,modal:a=!0}=e,o=S.useRef(null),c=S.useRef(null),[l,h]=yc({prop:s,defaultProp:r??!1,onChange:n,caller:bc});return b.jsx(YE,{scope:t,triggerRef:o,contentRef:c,contentId:ln(),titleId:ln(),descriptionId:ln(),open:l,onOpenChange:h,onOpenToggle:S.useCallback(()=>h(u=>!u),[h]),modal:a,children:i})};K0.displayName=bc;var Y0="DialogTrigger",V0=S.forwardRef((e,t)=>{const{__scopeDialog:i,...s}=e,r=di(Y0,i),n=_t(t,r.triggerRef);return b.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":Pf(r.open),...s,ref:n,onClick:Ae(e.onClick,r.onOpenToggle)})});V0.displayName=Y0;var Lf="DialogPortal",[VE,G0]=q0(Lf,{forceMount:void 0}),$0=e=>{const{__scopeDialog:t,forceMount:i,children:s,container:r}=e,n=di(Lf,t);return b.jsx(VE,{scope:t,forceMount:i,children:S.Children.map(s,a=>b.jsx(Ar,{present:i||n.open,children:b.jsx(Bf,{asChild:!0,container:r,children:a})}))})};$0.displayName=Lf;var Wl="DialogOverlay",X0=S.forwardRef((e,t)=>{const i=G0(Wl,e.__scopeDialog),{forceMount:s=i.forceMount,...r}=e,n=di(Wl,e.__scopeDialog);return n.modal?b.jsx(Ar,{present:s||n.open,children:b.jsx($E,{...r,ref:t})}):null});X0.displayName=Wl;var GE=wn("DialogOverlay.RemoveScroll"),$E=S.forwardRef((e,t)=>{const{__scopeDialog:i,...s}=e,r=di(Wl,i),n=X2(),a=_t(t,n);return b.jsx(zf,{as:GE,allowPinchZoom:!0,shards:[r.contentRef],children:b.jsx(Me.div,{"data-state":Pf(r.open),...s,ref:a,style:{pointerEvents:"auto",...s.style}})})}),Cn="DialogContent",Z0=S.forwardRef((e,t)=>{const i=G0(Cn,e.__scopeDialog),{forceMount:s=i.forceMount,...r}=e,n=di(Cn,e.__scopeDialog);return b.jsx(Ar,{present:s||n.open,children:n.modal?b.jsx(XE,{...r,ref:t}):b.jsx(ZE,{...r,ref:t})})});Z0.displayName=Cn;var XE=S.forwardRef((e,t)=>{const i=di(Cn,e.__scopeDialog),s=S.useRef(null),r=_t(t,i.contentRef,s);return S.useEffect(()=>{const n=s.current;if(n)return I0(n)},[]),b.jsx(Q0,{...e,ref:r,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:Ae(e.onCloseAutoFocus,n=>{var a;n.preventDefault(),(a=i.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,n=>{const a=n.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&n.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,n=>n.preventDefault())})}),ZE=S.forwardRef((e,t)=>{const i=di(Cn,e.__scopeDialog),s=S.useRef(!1),r=S.useRef(!1);return b.jsx(Q0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var a,o;(a=e.onCloseAutoFocus)==null||a.call(e,n),n.defaultPrevented||(s.current||(o=i.triggerRef.current)==null||o.focus(),n.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:n=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,n),n.defaultPrevented||(s.current=!0,n.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=n.target;((l=i.triggerRef.current)==null?void 0:l.contains(a))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&r.current&&n.preventDefault()}})}),Q0=S.forwardRef((e,t)=>{const{__scopeDialog:i,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:n,...a}=e,o=di(Cn,i);return N0(),b.jsx(b.Fragment,{children:b.jsx(Nf,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:n,children:b.jsx(Of,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":Pf(o.open),...a,ref:t,deferPointerDownOutside:!0,onDismiss:()=>o.onOpenChange(!1)})})})}),J0="DialogTitle",eS=S.forwardRef((e,t)=>{const{__scopeDialog:i,...s}=e,r=di(J0,i);return b.jsx(Me.h2,{id:r.titleId,...s,ref:t})});eS.displayName=J0;var tS="DialogDescription",iS=S.forwardRef((e,t)=>{const{__scopeDialog:i,...s}=e,r=di(tS,i);return b.jsx(Me.p,{id:r.descriptionId,...s,ref:t})});iS.displayName=tS;var sS="DialogClose",Hf=S.forwardRef((e,t)=>{const{__scopeDialog:i,...s}=e,r=di(sS,i);return b.jsx(Me.button,{type:"button",...s,ref:t,onClick:Ae(e.onClick,()=>r.onOpenChange(!1))})});Hf.displayName=sS;function Pf(e){return e?"open":"closed"}var rS="AlertDialog",[QE]=Er(rS,[F0]),rs=F0(),nS=e=>{const{__scopeAlertDialog:t,...i}=e,s=rs(t);return b.jsx(K0,{...s,...i,modal:!0})};nS.displayName=rS;var JE="AlertDialogTrigger",eA=S.forwardRef((e,t)=>{const{__scopeAlertDialog:i,...s}=e,r=rs(i);return b.jsx(V0,{...r,...s,ref:t})});eA.displayName=JE;var tA="AlertDialogPortal",aS=e=>{const{__scopeAlertDialog:t,...i}=e,s=rs(t);return b.jsx($0,{...s,...i})};aS.displayName=tA;var iA="AlertDialogOverlay",oS=S.forwardRef((e,t)=>{const{__scopeAlertDialog:i,...s}=e,r=rs(i);return b.jsx(X0,{...r,...s,ref:t})});oS.displayName=iA;var lS="AlertDialogContent",[sA,rA]=QE(lS),cS=S.forwardRef((e,t)=>{const{__scopeAlertDialog:i,children:s,...r}=e,n=rs(i),a=S.useRef(null),o=_t(t,a),c=S.useRef(null);return b.jsx(sA,{scope:i,cancelRef:c,children:b.jsx(Z0,{role:"alertdialog",...n,...r,ref:o,onOpenAutoFocus:Ae(r.onOpenAutoFocus,l=>{var h;l.preventDefault(),(h=c.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:l=>l.preventDefault(),onInteractOutside:l=>l.preventDefault(),children:s})})});cS.displayName=lS;var nA="AlertDialogTitle",uS=S.forwardRef((e,t)=>{const{__scopeAlertDialog:i,...s}=e,r=rs(i);return b.jsx(eS,{...r,...s,ref:t})});uS.displayName=nA;var aA="AlertDialogDescription",hS=S.forwardRef((e,t)=>{const{__scopeAlertDialog:i,...s}=e,r=rs(i);return b.jsx(iS,{...r,...s,ref:t})});hS.displayName=aA;var oA="AlertDialogAction",dS=S.forwardRef((e,t)=>{const{__scopeAlertDialog:i,...s}=e,r=rs(i);return b.jsx(Hf,{...r,...s,ref:t})});dS.displayName=oA;var fS="AlertDialogCancel",_S=S.forwardRef((e,t)=>{const{__scopeAlertDialog:i,...s}=e,{cancelRef:r}=rA(fS,i),n=rs(i),a=_t(t,r);return b.jsx(Hf,{...n,...s,ref:a})});_S.displayName=fS;var lA=nS,cA=aS,uA=oS,hA=cS,dA=dS,fA=_S,_A=uS,mA=hS;function gA(e){const[t,i]=S.useState(void 0);return $i(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const n=r[0];let a,o;if("borderBoxSize"in n){const c=n.borderBoxSize,l=Array.isArray(c)?c[0]:c;a=l.inlineSize,o=l.blockSize}else a=e.offsetWidth,o=e.offsetHeight;i({width:a,height:o})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else i(void 0)},[e]),t}const pA=["top","right","bottom","left"],Ws=Math.min,Lt=Math.max,Il=Math.round,No=Math.floor,Ai=e=>({x:e,y:e}),vA={left:"right",right:"left",bottom:"top",top:"bottom"};function Ph(e,t,i){return Lt(e,Ws(t,i))}function ts(e,t){return typeof e=="function"?e(t):e}function is(e){return e.split("-")[0]}function Ln(e){return e.split("-")[1]}function Uf(e){return e==="x"?"y":"x"}function jf(e){return e==="y"?"height":"width"}function Ci(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Wf(e){return Uf(Ci(e))}function yA(e,t,i){i===void 0&&(i=!1);const s=Ln(e),r=Wf(e),n=jf(r);let a=r==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(a=ql(a)),[a,ql(a)]}function SA(e){const t=ql(e);return[Uh(e),t,Uh(t)]}function Uh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const tg=["left","right"],ig=["right","left"],bA=["top","bottom"],wA=["bottom","top"];function CA(e,t,i){switch(e){case"top":case"bottom":return i?t?ig:tg:t?tg:ig;case"left":case"right":return t?bA:wA;default:return[]}}function xA(e,t,i,s){const r=Ln(e);let n=CA(is(e),i==="start",s);return r&&(n=n.map(a=>a+"-"+r),t&&(n=n.concat(n.map(Uh)))),n}function ql(e){const t=is(e);return vA[t]+e.slice(t.length)}function EA(e){return{top:0,right:0,bottom:0,left:0,...e}}function mS(e){return typeof e!="number"?EA(e):{top:e,right:e,bottom:e,left:e}}function Fl(e){const{x:t,y:i,width:s,height:r}=e;return{width:s,height:r,top:i,left:t,right:t+s,bottom:i+r,x:t,y:i}}function sg(e,t,i){let{reference:s,floating:r}=e;const n=Ci(t),a=Wf(t),o=jf(a),c=is(t),l=n==="y",h=s.x+s.width/2-r.width/2,u=s.y+s.height/2-r.height/2,d=s[o]/2-r[o]/2;let f;switch(c){case"top":f={x:h,y:s.y-r.height};break;case"bottom":f={x:h,y:s.y+s.height};break;case"right":f={x:s.x+s.width,y:u};break;case"left":f={x:s.x-r.width,y:u};break;default:f={x:s.x,y:s.y}}switch(Ln(t)){case"start":f[a]-=d*(i&&l?-1:1);break;case"end":f[a]+=d*(i&&l?-1:1);break}return f}async function AA(e,t){var i;t===void 0&&(t={});const{x:s,y:r,platform:n,rects:a,elements:o,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=!1,padding:f=0}=ts(t,e),_=mS(f),w=o[d?u==="floating"?"reference":"floating":u],g=Fl(await n.getClippingRect({element:(i=await(n.isElement==null?void 0:n.isElement(w)))==null||i?w:w.contextElement||await(n.getDocumentElement==null?void 0:n.getDocumentElement(o.floating)),boundary:l,rootBoundary:h,strategy:c})),p=u==="floating"?{x:s,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(n.getOffsetParent==null?void 0:n.getOffsetParent(o.floating)),y=await(n.isElement==null?void 0:n.isElement(v))?await(n.getScale==null?void 0:n.getScale(v))||{x:1,y:1}:{x:1,y:1},C=Fl(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:p,offsetParent:v,strategy:c}):p);return{top:(g.top-C.top+_.top)/y.y,bottom:(C.bottom-g.bottom+_.bottom)/y.y,left:(g.left-C.left+_.left)/y.x,right:(C.right-g.right+_.right)/y.x}}const kA=50,DA=async(e,t,i)=>{const{placement:s="bottom",strategy:r="absolute",middleware:n=[],platform:a}=i,o=a.detectOverflow?a:{...a,detectOverflow:AA},c=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:u}=sg(l,s,c),d=s,f=0;const _={};for(let m=0;m<n.length;m++){const w=n[m];if(!w)continue;const{name:g,fn:p}=w,{x:v,y,data:C,reset:k}=await p({x:h,y:u,initialPlacement:s,placement:d,strategy:r,middlewareData:_,rects:l,platform:o,elements:{reference:e,floating:t}});h=v??h,u=y??u,_[g]={..._[g],...C},k&&f<kA&&(f++,typeof k=="object"&&(k.placement&&(d=k.placement),k.rects&&(l=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):k.rects),{x:h,y:u}=sg(l,d,c)),m=-1)}return{x:h,y:u,placement:d,strategy:r,middlewareData:_}},RA=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:s,placement:r,rects:n,platform:a,elements:o,middlewareData:c}=t,{element:l,padding:h=0}=ts(e,t)||{};if(l==null)return{};const u=mS(h),d={x:i,y:s},f=Wf(r),_=jf(f),m=await a.getDimensions(l),w=f==="y",g=w?"top":"left",p=w?"bottom":"right",v=w?"clientHeight":"clientWidth",y=n.reference[_]+n.reference[f]-d[f]-n.floating[_],C=d[f]-n.reference[f],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let D=k?k[v]:0;(!D||!await(a.isElement==null?void 0:a.isElement(k)))&&(D=o.floating[v]||n.floating[_]);const E=y/2-C/2,N=D/2-m[_]/2-1,U=Ws(u[g],N),I=Ws(u[p],N),B=U,R=D-m[_]-I,H=D/2-m[_]/2+E,L=Ph(B,H,R),x=!c.arrow&&Ln(r)!=null&&H!==L&&n.reference[_]/2-(H<B?U:I)-m[_]/2<0,O=x?H<B?H-B:H-R:0;return{[f]:d[f]+O,data:{[f]:L,centerOffset:H-L-O,...x&&{alignmentOffset:O}},reset:x}}}),MA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,s;const{placement:r,middlewareData:n,rects:a,initialPlacement:o,platform:c,elements:l}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:m=!0,...w}=ts(e,t);if((i=n.arrow)!=null&&i.alignmentOffset)return{};const g=is(r),p=Ci(o),v=is(o)===o,y=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=d||(v||!m?[ql(o)]:SA(o)),k=_!=="none";!d&&k&&C.push(...xA(o,m,_,y));const D=[o,...C],E=await c.detectOverflow(t,w),N=[];let U=((s=n.flip)==null?void 0:s.overflows)||[];if(h&&N.push(E[g]),u){const H=yA(r,a,y);N.push(E[H[0]],E[H[1]])}if(U=[...U,{placement:r,overflows:N}],!N.every(H=>H<=0)){var I,B;const H=(((I=n.flip)==null?void 0:I.index)||0)+1,L=D[H];if(L&&(!(u==="alignment"?p!==Ci(L):!1)||U.every(A=>Ci(A.placement)===p?A.overflows[0]>0:!0)))return{data:{index:H,overflows:U},reset:{placement:L}};let x=(B=U.filter(O=>O.overflows[0]<=0).sort((O,A)=>O.overflows[1]-A.overflows[1])[0])==null?void 0:B.placement;if(!x)switch(f){case"bestFit":{var R;const O=(R=U.filter(A=>{if(k){const W=Ci(A.placement);return W===p||W==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(W=>W>0).reduce((W,z)=>W+z,0)]).sort((A,W)=>A[1]-W[1])[0])==null?void 0:R[0];O&&(x=O);break}case"initialPlacement":x=o;break}if(r!==x)return{reset:{placement:x}}}return{}}}};function rg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ng(e){return pA.some(t=>e[t]>=0)}const TA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i,platform:s}=t,{strategy:r="referenceHidden",...n}=ts(e,t);switch(r){case"referenceHidden":{const a=await s.detectOverflow(t,{...n,elementContext:"reference"}),o=rg(a,i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:ng(o)}}}case"escaped":{const a=await s.detectOverflow(t,{...n,altBoundary:!0}),o=rg(a,i.floating);return{data:{escapedOffsets:o,escaped:ng(o)}}}default:return{}}}}},gS=new Set(["left","top"]);async function OA(e,t){const{placement:i,platform:s,elements:r}=e,n=await(s.isRTL==null?void 0:s.isRTL(r.floating)),a=is(i),o=Ln(i),c=Ci(i)==="y",l=gS.has(a)?-1:1,h=n&&c?-1:1,u=ts(t,e);let{mainAxis:d,crossAxis:f,alignmentAxis:_}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return o&&typeof _=="number"&&(f=o==="end"?_*-1:_),c?{x:f*h,y:d*l}:{x:d*l,y:f*h}}const NA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,s;const{x:r,y:n,placement:a,middlewareData:o}=t,c=await OA(t,e);return a===((i=o.offset)==null?void 0:i.placement)&&(s=o.arrow)!=null&&s.alignmentOffset?{}:{x:r+c.x,y:n+c.y,data:{...c,placement:a}}}}},BA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:s,placement:r,platform:n}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:c={fn:g=>{let{x:p,y:v}=g;return{x:p,y:v}}},...l}=ts(e,t),h={x:i,y:s},u=await n.detectOverflow(t,l),d=Ci(is(r)),f=Uf(d);let _=h[f],m=h[d];if(a){const g=f==="y"?"top":"left",p=f==="y"?"bottom":"right",v=_+u[g],y=_-u[p];_=Ph(v,_,y)}if(o){const g=d==="y"?"top":"left",p=d==="y"?"bottom":"right",v=m+u[g],y=m-u[p];m=Ph(v,m,y)}const w=c.fn({...t,[f]:_,[d]:m});return{...w,data:{x:w.x-i,y:w.y-s,enabled:{[f]:a,[d]:o}}}}}},zA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:i,y:s,placement:r,rects:n,middlewareData:a}=t,{offset:o=0,mainAxis:c=!0,crossAxis:l=!0}=ts(e,t),h={x:i,y:s},u=Ci(r),d=Uf(u);let f=h[d],_=h[u];const m=ts(o,t),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const v=d==="y"?"height":"width",y=n.reference[d]-n.floating[v]+w.mainAxis,C=n.reference[d]+n.reference[v]-w.mainAxis;f<y?f=y:f>C&&(f=C)}if(l){var g,p;const v=d==="y"?"width":"height",y=gS.has(is(r)),C=n.reference[u]-n.floating[v]+(y&&((g=a.offset)==null?void 0:g[u])||0)+(y?0:w.crossAxis),k=n.reference[u]+n.reference[v]+(y?0:((p=a.offset)==null?void 0:p[u])||0)-(y?w.crossAxis:0);_<C?_=C:_>k&&(_=k)}return{[d]:f,[u]:_}}}},LA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var i,s;const{placement:r,rects:n,platform:a,elements:o}=t,{apply:c=()=>{},...l}=ts(e,t),h=await a.detectOverflow(t,l),u=is(r),d=Ln(r),f=Ci(r)==="y",{width:_,height:m}=n.floating;let w,g;u==="top"||u==="bottom"?(w=u,g=d===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(g=u,w=d==="end"?"top":"bottom");const p=m-h.top-h.bottom,v=_-h.left-h.right,y=Ws(m-h[w],p),C=Ws(_-h[g],v),k=!t.middlewareData.shift;let D=y,E=C;if((i=t.middlewareData.shift)!=null&&i.enabled.x&&(E=v),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(D=p),k&&!d){const U=Lt(h.left,0),I=Lt(h.right,0),B=Lt(h.top,0),R=Lt(h.bottom,0);f?E=_-2*(U!==0||I!==0?U+I:Lt(h.left,h.right)):D=m-2*(B!==0||R!==0?B+R:Lt(h.top,h.bottom))}await c({...t,availableWidth:E,availableHeight:D});const N=await a.getDimensions(o.floating);return _!==N.width||m!==N.height?{reset:{rects:!0}}:{}}}};function wc(){return typeof window<"u"}function Hn(e){return pS(e)?(e.nodeName||"").toLowerCase():"#document"}function qt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ti(e){var t;return(t=(pS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pS(e){return wc()?e instanceof Node||e instanceof qt(e).Node:!1}function ci(e){return wc()?e instanceof Element||e instanceof qt(e).Element:!1}function ns(e){return wc()?e instanceof HTMLElement||e instanceof qt(e).HTMLElement:!1}function ag(e){return!wc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qt(e).ShadowRoot}function to(e){const{overflow:t,overflowX:i,overflowY:s,display:r}=ui(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+i)&&r!=="inline"&&r!=="contents"}function HA(e){return/^(table|td|th)$/.test(Hn(e))}function Cc(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const PA=/transform|translate|scale|rotate|perspective|filter/,UA=/paint|layout|strict|content/,Gs=e=>!!e&&e!=="none";let wu;function If(e){const t=ci(e)?ui(e):e;return Gs(t.transform)||Gs(t.translate)||Gs(t.scale)||Gs(t.rotate)||Gs(t.perspective)||!qf()&&(Gs(t.backdropFilter)||Gs(t.filter))||PA.test(t.willChange||"")||UA.test(t.contain||"")}function jA(e){let t=Is(e);for(;ns(t)&&!xn(t);){if(If(t))return t;if(Cc(t))return null;t=Is(t)}return null}function qf(){return wu==null&&(wu=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wu}function xn(e){return/^(html|body|#document)$/.test(Hn(e))}function ui(e){return qt(e).getComputedStyle(e)}function xc(e){return ci(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Is(e){if(Hn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ag(e)&&e.host||Ti(e);return ag(t)?t.host:t}function vS(e){const t=Is(e);return xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:ns(t)&&to(t)?t:vS(t)}function Ua(e,t,i){var s;t===void 0&&(t=[]),i===void 0&&(i=!0);const r=vS(e),n=r===((s=e.ownerDocument)==null?void 0:s.body),a=qt(r);if(n){const o=jh(a);return t.concat(a,a.visualViewport||[],to(r)?r:[],o&&i?Ua(o):[])}else return t.concat(r,Ua(r,[],i))}function jh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yS(e){const t=ui(e);let i=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=ns(e),n=r?e.offsetWidth:i,a=r?e.offsetHeight:s,o=Il(i)!==n||Il(s)!==a;return o&&(i=n,s=a),{width:i,height:s,$:o}}function Ff(e){return ci(e)?e:e.contextElement}function un(e){const t=Ff(e);if(!ns(t))return Ai(1);const i=t.getBoundingClientRect(),{width:s,height:r,$:n}=yS(t);let a=(n?Il(i.width):i.width)/s,o=(n?Il(i.height):i.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const WA=Ai(0);function SS(e){const t=qt(e);return!qf()||!t.visualViewport?WA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function IA(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==qt(e)?!1:t}function gr(e,t,i,s){t===void 0&&(t=!1),i===void 0&&(i=!1);const r=e.getBoundingClientRect(),n=Ff(e);let a=Ai(1);t&&(s?ci(s)&&(a=un(s)):a=un(e));const o=IA(n,i,s)?SS(n):Ai(0);let c=(r.left+o.x)/a.x,l=(r.top+o.y)/a.y,h=r.width/a.x,u=r.height/a.y;if(n){const d=qt(n),f=s&&ci(s)?qt(s):s;let _=d,m=jh(_);for(;m&&s&&f!==_;){const w=un(m),g=m.getBoundingClientRect(),p=ui(m),v=g.left+(m.clientLeft+parseFloat(p.paddingLeft))*w.x,y=g.top+(m.clientTop+parseFloat(p.paddingTop))*w.y;c*=w.x,l*=w.y,h*=w.x,u*=w.y,c+=v,l+=y,_=qt(m),m=jh(_)}}return Fl({width:h,height:u,x:c,y:l})}function Ec(e,t){const i=xc(e).scrollLeft;return t?t.left+i:gr(Ti(e)).left+i}function bS(e,t){const i=e.getBoundingClientRect(),s=i.left+t.scrollLeft-Ec(e,i),r=i.top+t.scrollTop;return{x:s,y:r}}function qA(e){let{elements:t,rect:i,offsetParent:s,strategy:r}=e;const n=r==="fixed",a=Ti(s),o=t?Cc(t.floating):!1;if(s===a||o&&n)return i;let c={scrollLeft:0,scrollTop:0},l=Ai(1);const h=Ai(0),u=ns(s);if((u||!u&&!n)&&((Hn(s)!=="body"||to(a))&&(c=xc(s)),u)){const f=gr(s);l=un(s),h.x=f.x+s.clientLeft,h.y=f.y+s.clientTop}const d=a&&!u&&!n?bS(a,c):Ai(0);return{width:i.width*l.x,height:i.height*l.y,x:i.x*l.x-c.scrollLeft*l.x+h.x+d.x,y:i.y*l.y-c.scrollTop*l.y+h.y+d.y}}function FA(e){return Array.from(e.getClientRects())}function KA(e){const t=Ti(e),i=xc(e),s=e.ownerDocument.body,r=Lt(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),n=Lt(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let a=-i.scrollLeft+Ec(e);const o=-i.scrollTop;return ui(s).direction==="rtl"&&(a+=Lt(t.clientWidth,s.clientWidth)-r),{width:r,height:n,x:a,y:o}}const og=25;function YA(e,t){const i=qt(e),s=Ti(e),r=i.visualViewport;let n=s.clientWidth,a=s.clientHeight,o=0,c=0;if(r){n=r.width,a=r.height;const h=qf();(!h||h&&t==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}const l=Ec(s);if(l<=0){const h=s.ownerDocument,u=h.body,d=getComputedStyle(u),f=h.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,_=Math.abs(s.clientWidth-u.clientWidth-f);_<=og&&(n-=_)}else l<=og&&(n+=l);return{width:n,height:a,x:o,y:c}}function VA(e,t){const i=gr(e,!0,t==="fixed"),s=i.top+e.clientTop,r=i.left+e.clientLeft,n=ns(e)?un(e):Ai(1),a=e.clientWidth*n.x,o=e.clientHeight*n.y,c=r*n.x,l=s*n.y;return{width:a,height:o,x:c,y:l}}function lg(e,t,i){let s;if(t==="viewport")s=YA(e,i);else if(t==="document")s=KA(Ti(e));else if(ci(t))s=VA(t,i);else{const r=SS(e);s={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Fl(s)}function wS(e,t){const i=Is(e);return i===t||!ci(i)||xn(i)?!1:ui(i).position==="fixed"||wS(i,t)}function GA(e,t){const i=t.get(e);if(i)return i;let s=Ua(e,[],!1).filter(o=>ci(o)&&Hn(o)!=="body"),r=null;const n=ui(e).position==="fixed";let a=n?Is(e):e;for(;ci(a)&&!xn(a);){const o=ui(a),c=If(a);!c&&o.position==="fixed"&&(r=null),(n?!c&&!r:!c&&o.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||to(a)&&!c&&wS(e,a))?s=s.filter(h=>h!==a):r=o,a=Is(a)}return t.set(e,s),s}function $A(e){let{element:t,boundary:i,rootBoundary:s,strategy:r}=e;const a=[...i==="clippingAncestors"?Cc(t)?[]:GA(t,this._c):[].concat(i),s],o=lg(t,a[0],r);let c=o.top,l=o.right,h=o.bottom,u=o.left;for(let d=1;d<a.length;d++){const f=lg(t,a[d],r);c=Lt(f.top,c),l=Ws(f.right,l),h=Ws(f.bottom,h),u=Lt(f.left,u)}return{width:l-u,height:h-c,x:u,y:c}}function XA(e){const{width:t,height:i}=yS(e);return{width:t,height:i}}function ZA(e,t,i){const s=ns(t),r=Ti(t),n=i==="fixed",a=gr(e,!0,n,t);let o={scrollLeft:0,scrollTop:0};const c=Ai(0);function l(){c.x=Ec(r)}if(s||!s&&!n)if((Hn(t)!=="body"||to(r))&&(o=xc(t)),s){const f=gr(t,!0,n,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else r&&l();n&&!s&&r&&l();const h=r&&!s&&!n?bS(r,o):Ai(0),u=a.left+o.scrollLeft-c.x-h.x,d=a.top+o.scrollTop-c.y-h.y;return{x:u,y:d,width:a.width,height:a.height}}function Cu(e){return ui(e).position==="static"}function cg(e,t){if(!ns(e)||ui(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return Ti(e)===i&&(i=i.ownerDocument.body),i}function CS(e,t){const i=qt(e);if(Cc(e))return i;if(!ns(e)){let r=Is(e);for(;r&&!xn(r);){if(ci(r)&&!Cu(r))return r;r=Is(r)}return i}let s=cg(e,t);for(;s&&HA(s)&&Cu(s);)s=cg(s,t);return s&&xn(s)&&Cu(s)&&!If(s)?i:s||jA(e)||i}const QA=async function(e){const t=this.getOffsetParent||CS,i=this.getDimensions,s=await i(e.floating);return{reference:ZA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function JA(e){return ui(e).direction==="rtl"}const ek={convertOffsetParentRelativeRectToViewportRelativeRect:qA,getDocumentElement:Ti,getClippingRect:$A,getOffsetParent:CS,getElementRects:QA,getClientRects:FA,getDimensions:XA,getScale:un,isElement:ci,isRTL:JA};function xS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tk(e,t){let i=null,s;const r=Ti(e);function n(){var o;clearTimeout(s),(o=i)==null||o.disconnect(),i=null}function a(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),n();const l=e.getBoundingClientRect(),{left:h,top:u,width:d,height:f}=l;if(o||t(),!d||!f)return;const _=No(u),m=No(r.clientWidth-(h+d)),w=No(r.clientHeight-(u+f)),g=No(h),v={rootMargin:-_+"px "+-m+"px "+-w+"px "+-g+"px",threshold:Lt(0,Ws(1,c))||1};let y=!0;function C(k){const D=k[0].intersectionRatio;if(D!==c){if(!y)return a();D?a(!1,D):s=setTimeout(()=>{a(!1,1e-7)},1e3)}D===1&&!xS(l,e.getBoundingClientRect())&&a(),y=!1}try{i=new IntersectionObserver(C,{...v,root:r.ownerDocument})}catch{i=new IntersectionObserver(C,v)}i.observe(e)}return a(!0),n}function ik(e,t,i,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:n=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,l=Ff(e),h=r||n?[...l?Ua(l):[],...t?Ua(t):[]]:[];h.forEach(g=>{r&&g.addEventListener("scroll",i,{passive:!0}),n&&g.addEventListener("resize",i)});const u=l&&o?tk(l,i):null;let d=-1,f=null;a&&(f=new ResizeObserver(g=>{let[p]=g;p&&p.target===l&&f&&t&&(f.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(t)})),i()}),l&&!c&&f.observe(l),t&&f.observe(t));let _,m=c?gr(e):null;c&&w();function w(){const g=gr(e);m&&!xS(m,g)&&i(),m=g,_=requestAnimationFrame(w)}return i(),()=>{var g;h.forEach(p=>{r&&p.removeEventListener("scroll",i),n&&p.removeEventListener("resize",i)}),u==null||u(),(g=f)==null||g.disconnect(),f=null,c&&cancelAnimationFrame(_)}}const sk=NA,rk=BA,nk=MA,ak=LA,ok=TA,ug=RA,lk=zA,ck=(e,t,i)=>{const s=new Map,r={platform:ek,...i},n={...r.platform,_c:s};return DA(e,t,{...r,platform:n})};var uk=typeof document<"u",hk=function(){},nl=uk?S.useLayoutEffect:hk;function Kl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let i,s,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(i=e.length,i!==t.length)return!1;for(s=i;s--!==0;)if(!Kl(e[s],t[s]))return!1;return!0}if(r=Object.keys(e),i=r.length,i!==Object.keys(t).length)return!1;for(s=i;s--!==0;)if(!{}.hasOwnProperty.call(t,r[s]))return!1;for(s=i;s--!==0;){const n=r[s];if(!(n==="_owner"&&e.$$typeof)&&!Kl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ES(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function hg(e,t){const i=ES(e);return Math.round(t*i)/i}function xu(e){const t=S.useRef(e);return nl(()=>{t.current=e}),t}function dk(e){e===void 0&&(e={});const{placement:t="bottom",strategy:i="absolute",middleware:s=[],platform:r,elements:{reference:n,floating:a}={},transform:o=!0,whileElementsMounted:c,open:l}=e,[h,u]=S.useState({x:0,y:0,strategy:i,placement:t,middlewareData:{},isPositioned:!1}),[d,f]=S.useState(s);Kl(d,s)||f(s);const[_,m]=S.useState(null),[w,g]=S.useState(null),p=S.useCallback(A=>{A!==k.current&&(k.current=A,m(A))},[]),v=S.useCallback(A=>{A!==D.current&&(D.current=A,g(A))},[]),y=n||_,C=a||w,k=S.useRef(null),D=S.useRef(null),E=S.useRef(h),N=c!=null,U=xu(c),I=xu(r),B=xu(l),R=S.useCallback(()=>{if(!k.current||!D.current)return;const A={placement:t,strategy:i,middleware:d};I.current&&(A.platform=I.current),ck(k.current,D.current,A).then(W=>{const z={...W,isPositioned:B.current!==!1};H.current&&!Kl(E.current,z)&&(E.current=z,ic.flushSync(()=>{u(z)}))})},[d,t,i,I,B]);nl(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,u(A=>({...A,isPositioned:!1})))},[l]);const H=S.useRef(!1);nl(()=>(H.current=!0,()=>{H.current=!1}),[]),nl(()=>{if(y&&(k.current=y),C&&(D.current=C),y&&C){if(U.current)return U.current(y,C,R);R()}},[y,C,R,U,N]);const L=S.useMemo(()=>({reference:k,floating:D,setReference:p,setFloating:v}),[p,v]),x=S.useMemo(()=>({reference:y,floating:C}),[y,C]),O=S.useMemo(()=>{const A={position:i,left:0,top:0};if(!x.floating)return A;const W=hg(x.floating,h.x),z=hg(x.floating,h.y);return o?{...A,transform:"translate("+W+"px, "+z+"px)",...ES(x.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:W,top:z}},[i,o,x.floating,h.x,h.y]);return S.useMemo(()=>({...h,update:R,refs:L,elements:x,floatingStyles:O}),[h,R,L,x,O])}const fk=e=>{function t(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){const{element:s,padding:r}=typeof e=="function"?e(i):e;return s&&t(s)?s.current!=null?ug({element:s.current,padding:r}).fn(i):{}:s?ug({element:s,padding:r}).fn(i):{}}}},_k=(e,t)=>{const i=sk(e);return{name:i.name,fn:i.fn,options:[e,t]}},mk=(e,t)=>{const i=rk(e);return{name:i.name,fn:i.fn,options:[e,t]}},gk=(e,t)=>({fn:lk(e).fn,options:[e,t]}),pk=(e,t)=>{const i=nk(e);return{name:i.name,fn:i.fn,options:[e,t]}},vk=(e,t)=>{const i=ak(e);return{name:i.name,fn:i.fn,options:[e,t]}},yk=(e,t)=>{const i=ok(e);return{name:i.name,fn:i.fn,options:[e,t]}},Sk=(e,t)=>{const i=fk(e);return{name:i.name,fn:i.fn,options:[e,t]}};var bk="Arrow",AS=S.forwardRef((e,t)=>{const{children:i,width:s=10,height:r=5,...n}=e;return b.jsx(Me.svg,{...n,ref:t,width:s,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?i:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});AS.displayName=bk;var wk=AS,Kf="Popper",[kS,DS]=Er(Kf),[Ck,RS]=kS(Kf),MS=e=>{const{__scopePopper:t,children:i}=e,[s,r]=S.useState(null),[n,a]=S.useState(void 0);return b.jsx(Ck,{scope:t,anchor:s,onAnchorChange:r,placementState:n,setPlacementState:a,children:i})};MS.displayName=Kf;var TS="PopperAnchor",OS=S.forwardRef((e,t)=>{const{__scopePopper:i,virtualRef:s,...r}=e,n=RS(TS,i),a=S.useRef(null),o=n.onAnchorChange,c=S.useCallback(_=>{a.current=_,_&&o(_)},[o]),l=_t(t,c),h=S.useRef(null);S.useEffect(()=>{if(!s)return;const _=h.current;h.current=s.current,_!==h.current&&o(h.current)});const u=n.placementState&&Vf(n.placementState),d=u==null?void 0:u[0],f=u==null?void 0:u[1];return s?null:b.jsx(Me.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...r,ref:l})});OS.displayName=TS;var Yf="PopperContent",[xk,Ek]=kS(Yf),NS=S.forwardRef((e,t)=>{var Oi,oe,fi,Tt,dt,ee;const{__scopePopper:i,side:s="bottom",sideOffset:r=0,align:n="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:h=0,sticky:u="partial",hideWhenDetached:d=!1,updatePositionStrategy:f="optimized",onPlaced:_,...m}=e,w=RS(Yf,i),[g,p]=S.useState(null),v=_t(t,wt=>p(wt)),[y,C]=S.useState(null),k=gA(y),D=(k==null?void 0:k.width)??0,E=(k==null?void 0:k.height)??0,N=s+(n!=="center"?"-"+n:""),U=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},I=Array.isArray(l)?l:[l],B=I.length>0,R={padding:U,boundary:I.filter(kk),altBoundary:B},{refs:H,floatingStyles:L,placement:x,isPositioned:O,middlewareData:A}=dk({strategy:"fixed",placement:N,whileElementsMounted:(...wt)=>ik(...wt,{animationFrame:f==="always"}),elements:{reference:w.anchor},middleware:[_k({mainAxis:r+E,alignmentAxis:a}),c&&mk({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?gk():void 0,...R}),c&&pk({...R}),vk({...R,apply:({elements:wt,rects:l_,availableWidth:g1,availableHeight:p1})=>{const{width:v1,height:y1}=l_.reference,lo=wt.floating.style;lo.setProperty("--radix-popper-available-width",`${g1}px`),lo.setProperty("--radix-popper-available-height",`${p1}px`),lo.setProperty("--radix-popper-anchor-width",`${v1}px`),lo.setProperty("--radix-popper-anchor-height",`${y1}px`)}}),y&&Sk({element:y,padding:o}),Dk({arrowWidth:D,arrowHeight:E}),d&&yk({strategy:"referenceHidden",...R,boundary:B?R.boundary:void 0})]}),W=w.setPlacementState;$i(()=>(W(x),()=>{W(void 0)}),[x,W]);const[z,Oe]=Vf(x),Ne=mr(_);$i(()=>{O&&(Ne==null||Ne())},[O,Ne]);const Be=(Oi=A.arrow)==null?void 0:Oi.x,ue=(oe=A.arrow)==null?void 0:oe.y,se=((fi=A.arrow)==null?void 0:fi.centerOffset)!==0,[ae,bt]=S.useState();return $i(()=>{g&&bt(window.getComputedStyle(g).zIndex)},[g]),b.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:O?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(Tt=A.transformOrigin)==null?void 0:Tt.x,(dt=A.transformOrigin)==null?void 0:dt.y].join(" "),...((ee=A.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(xk,{scope:i,placedSide:z,placedAlign:Oe,onArrowChange:C,arrowX:Be,arrowY:ue,shouldHideArrow:se,children:b.jsx(Me.div,{"data-side":z,"data-align":Oe,...m,ref:v,style:{...m.style,animation:O?void 0:"none"}})})})});NS.displayName=Yf;var BS="PopperArrow",Ak={top:"bottom",right:"left",bottom:"top",left:"right"},zS=S.forwardRef(function(t,i){const{__scopePopper:s,...r}=t,n=Ek(BS,s),a=Ak[n.placedSide];return b.jsx("span",{ref:n.onArrowChange,style:{position:"absolute",left:n.arrowX,top:n.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[n.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[n.placedSide],visibility:n.shouldHideArrow?"hidden":void 0},children:b.jsx(wk,{...r,ref:i,style:{...r.style,display:"block"}})})});zS.displayName=BS;function kk(e){return e!==null}var Dk=e=>({name:"transformOrigin",options:e,fn(t){var w,g,p;const{placement:i,rects:s,middlewareData:r}=t,a=((w=r.arrow)==null?void 0:w.centerOffset)!==0,o=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[l,h]=Vf(i),u={start:"0%",center:"50%",end:"100%"}[h],d=(((g=r.arrow)==null?void 0:g.x)??0)+o/2,f=(((p=r.arrow)==null?void 0:p.y)??0)+c/2;let _="",m="";return l==="bottom"?(_=a?u:`${d}px`,m=`${-c}px`):l==="top"?(_=a?u:`${d}px`,m=`${s.floating.height+c}px`):l==="right"?(_=`${-c}px`,m=a?u:`${f}px`):l==="left"&&(_=`${s.floating.width+c}px`,m=a?u:`${f}px`),{data:{x:_,y:m}}}});function Vf(e){const[t,i="center"]=e.split("-");return[t,i]}var Rk=MS,LS=OS,Mk=NS,Tk=zS,Eu="rovingFocusGroup.onEntryFocus",Ok={bubbles:!1,cancelable:!0},io="RovingFocusGroup",[Wh,HS,Nk]=N2(io),[Bk,PS]=Er(io,[Nk]),[zk,Lk]=Bk(io),US=S.forwardRef((e,t)=>b.jsx(Wh.Provider,{scope:e.__scopeRovingFocusGroup,children:b.jsx(Wh.Slot,{scope:e.__scopeRovingFocusGroup,children:b.jsx(Hk,{...e,ref:t})})}));US.displayName=io;var Hk=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:i,orientation:s,loop:r=!1,dir:n,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:h=!1,...u}=e,d=S.useRef(null),f=_t(t,d),_=M0(n),[m,w]=yc({prop:a,defaultProp:o??null,onChange:c,caller:io}),[g,p]=S.useState(!1),v=mr(l),y=HS(i),C=S.useRef(!1),[k,D]=S.useState(0);return S.useEffect(()=>{const E=d.current;if(E)return E.addEventListener(Eu,v),()=>E.removeEventListener(Eu,v)},[v]),b.jsx(zk,{scope:i,orientation:s,dir:_,loop:r,currentTabStopId:m,onItemFocus:S.useCallback(E=>w(E),[w]),onItemShiftTab:S.useCallback(()=>p(!0),[]),onFocusableItemAdd:S.useCallback(()=>D(E=>E+1),[]),onFocusableItemRemove:S.useCallback(()=>D(E=>E-1),[]),children:b.jsx(Me.div,{tabIndex:g||k===0?-1:0,"data-orientation":s,...u,ref:f,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{C.current=!0}),onFocus:Ae(e.onFocus,E=>{const N=!C.current;if(E.target===E.currentTarget&&N&&!g){const U=new CustomEvent(Eu,Ok);if(E.currentTarget.dispatchEvent(U),!U.defaultPrevented){const I=y().filter(x=>x.focusable),B=I.find(x=>x.active),R=I.find(x=>x.id===m),L=[B,R,...I].filter(Boolean).map(x=>x.ref.current);IS(L,h)}}C.current=!1}),onBlur:Ae(e.onBlur,()=>p(!1))})})}),jS="RovingFocusGroupItem",WS=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:i,focusable:s=!0,active:r=!1,tabStopId:n,children:a,...o}=e,c=ln(),l=n||c,h=Lk(jS,i),u=h.currentTabStopId===l,d=HS(i),{onFocusableItemAdd:f,onFocusableItemRemove:_,currentTabStopId:m}=h;return S.useEffect(()=>{if(s)return f(),()=>_()},[s,f,_]),b.jsx(Wh.ItemSlot,{scope:i,id:l,focusable:s,active:r,children:b.jsx(Me.span,{tabIndex:u?0:-1,"data-orientation":h.orientation,...o,ref:t,onMouseDown:Ae(e.onMouseDown,w=>{s?h.onItemFocus(l):w.preventDefault()}),onFocus:Ae(e.onFocus,()=>h.onItemFocus(l)),onKeyDown:Ae(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){h.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const g=jk(w,h.orientation,h.dir);if(g!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let v=d().filter(y=>y.focusable).map(y=>y.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const y=v.indexOf(w.currentTarget);v=h.loop?Wk(v,y+1):v.slice(y+1)}setTimeout(()=>IS(v))}}),children:typeof a=="function"?a({isCurrentTabStop:u,hasTabStop:m!=null}):a})})});WS.displayName=jS;var Pk={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Uk(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function jk(e,t,i){const s=Uk(e.key,i);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return Pk[s]}function IS(e,t=!1){const i=document.activeElement;for(const s of e)if(s===i||(s.focus({preventScroll:t}),document.activeElement!==i))return}function Wk(e,t){return e.map((i,s)=>e[(t+s)%e.length])}var Ik=US,qk=WS,Fk="Label",qS=S.forwardRef((e,t)=>b.jsx(Me.label,{...e,ref:t,onMouseDown:i=>{var r;i.target.closest("button, input, select, textarea")||((r=e.onMouseDown)==null||r.call(e,i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}}));qS.displayName=Fk;var Kk=qS,Ac="Popover",[FS]=Er(Ac,[DS]),so=DS(),[Yk,Ks]=FS(Ac),KS=e=>{const{__scopePopover:t,children:i,open:s,defaultOpen:r,onOpenChange:n,modal:a=!1}=e,o=so(t),c=S.useRef(null),[l,h]=S.useState(!1),[u,d]=yc({prop:s,defaultProp:r??!1,onChange:n,caller:Ac});return b.jsx(Rk,{...o,children:b.jsx(Yk,{scope:t,contentId:ln(),triggerRef:c,open:u,onOpenChange:d,onOpenToggle:S.useCallback(()=>d(f=>!f),[d]),hasCustomAnchor:l,onCustomAnchorAdd:S.useCallback(()=>h(!0),[]),onCustomAnchorRemove:S.useCallback(()=>h(!1),[]),modal:a,children:i})})};KS.displayName=Ac;var YS="PopoverAnchor",Vk=S.forwardRef((e,t)=>{const{__scopePopover:i,...s}=e,r=Ks(YS,i),n=so(i),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=r;return S.useEffect(()=>(a(),()=>o()),[a,o]),b.jsx(LS,{...n,...s,ref:t})});Vk.displayName=YS;var VS="PopoverTrigger",GS=S.forwardRef((e,t)=>{const{__scopePopover:i,...s}=e,r=Ks(VS,i),n=so(i),a=_t(t,r.triggerRef),o=b.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":JS(r.open),...s,ref:a,onClick:Ae(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?o:b.jsx(LS,{asChild:!0,...n,children:o})});GS.displayName=VS;var Gf="PopoverPortal",[Gk,$k]=FS(Gf,{forceMount:void 0}),$S=e=>{const{__scopePopover:t,forceMount:i,children:s,container:r}=e,n=Ks(Gf,t);return b.jsx(Gk,{scope:t,forceMount:i,children:b.jsx(Ar,{present:i||n.open,children:b.jsx(Bf,{asChild:!0,container:r,children:s})})})};$S.displayName=Gf;var En="PopoverContent",XS=S.forwardRef((e,t)=>{const i=$k(En,e.__scopePopover),{forceMount:s=i.forceMount,...r}=e,n=Ks(En,e.__scopePopover);return b.jsx(Ar,{present:s||n.open,children:n.modal?b.jsx(Zk,{...r,ref:t}):b.jsx(Qk,{...r,ref:t})})});XS.displayName=En;var Xk=wn("PopoverContent.RemoveScroll"),Zk=S.forwardRef((e,t)=>{const i=Ks(En,e.__scopePopover),s=S.useRef(null),r=_t(t,s),n=S.useRef(!1);return S.useEffect(()=>{const a=s.current;if(a)return I0(a)},[]),b.jsx(zf,{as:Xk,allowPinchZoom:!0,children:b.jsx(ZS,{...e,ref:r,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),n.current||(o=i.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,l=o.button===2||c;n.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:Ae(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Qk=S.forwardRef((e,t)=>{const i=Ks(En,e.__scopePopover),s=S.useRef(!1),r=S.useRef(!1);return b.jsx(ZS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var a,o;(a=e.onCloseAutoFocus)==null||a.call(e,n),n.defaultPrevented||(s.current||(o=i.triggerRef.current)==null||o.focus(),n.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:n=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,n),n.defaultPrevented||(s.current=!0,n.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=n.target;((l=i.triggerRef.current)==null?void 0:l.contains(a))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&r.current&&n.preventDefault()}})}),ZS=S.forwardRef((e,t)=>{const{__scopePopover:i,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:n,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:h,...u}=e,d=Ks(En,i),f=so(i);return N0(),b.jsx(Nf,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:n,children:b.jsx(Of,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>d.onOpenChange(!1),deferPointerDownOutside:!0,children:b.jsx(Mk,{"data-state":JS(d.open),role:"dialog",id:d.contentId,...f,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),QS="PopoverClose",Jk=S.forwardRef((e,t)=>{const{__scopePopover:i,...s}=e,r=Ks(QS,i);return b.jsx(Me.button,{type:"button",...s,ref:t,onClick:Ae(e.onClick,()=>r.onOpenChange(!1))})});Jk.displayName=QS;var eD="PopoverArrow",tD=S.forwardRef((e,t)=>{const{__scopePopover:i,...s}=e,r=so(i);return b.jsx(Tk,{...r,...s,ref:t})});tD.displayName=eD;function JS(e){return e?"open":"closed"}var iD=KS,sD=GS,rD=$S,nD=XS,aD="Separator",dg="horizontal",oD=["horizontal","vertical"],eb=S.forwardRef((e,t)=>{const{decorative:i,orientation:s=dg,...r}=e,n=lD(s)?s:dg,o=i?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return b.jsx(Me.div,{"data-orientation":n,...o,...r,ref:t})});eb.displayName=aD;function lD(e){return oD.includes(e)}var cD=eb,kc="Tabs",[uD]=Er(kc,[PS]),tb=PS(),[hD,$f]=uD(kc),ib=S.forwardRef((e,t)=>{const{__scopeTabs:i,value:s,onValueChange:r,defaultValue:n,orientation:a="horizontal",dir:o,activationMode:c="automatic",...l}=e,h=M0(o),[u,d]=yc({prop:s,onChange:r,defaultProp:n??"",caller:kc});return b.jsx(hD,{scope:i,baseId:ln(),value:u,onValueChange:d,orientation:a,dir:h,activationMode:c,children:b.jsx(Me.div,{dir:h,"data-orientation":a,...l,ref:t})})});ib.displayName=kc;var sb="TabsList",rb=S.forwardRef((e,t)=>{const{__scopeTabs:i,loop:s=!0,...r}=e,n=$f(sb,i),a=tb(i);return b.jsx(Ik,{asChild:!0,...a,orientation:n.orientation,dir:n.dir,loop:s,children:b.jsx(Me.div,{role:"tablist","aria-orientation":n.orientation,...r,ref:t})})});rb.displayName=sb;var nb="TabsTrigger",ab=S.forwardRef((e,t)=>{const{__scopeTabs:i,value:s,disabled:r=!1,...n}=e,a=$f(nb,i),o=tb(i),c=cb(a.baseId,s),l=ub(a.baseId,s),h=s===a.value;return b.jsx(qk,{asChild:!0,...o,focusable:!r,active:h,children:b.jsx(Me.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":l,"data-state":h?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...n,ref:t,onMouseDown:Ae(e.onMouseDown,u=>{!r&&u.button===0&&u.ctrlKey===!1?a.onValueChange(s):u.preventDefault()}),onKeyDown:Ae(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&a.onValueChange(s)}),onFocus:Ae(e.onFocus,()=>{const u=a.activationMode!=="manual";!h&&!r&&u&&a.onValueChange(s)})})})});ab.displayName=nb;var ob="TabsContent",lb=S.forwardRef((e,t)=>{const{__scopeTabs:i,value:s,forceMount:r,children:n,...a}=e,o=$f(ob,i),c=cb(o.baseId,s),l=ub(o.baseId,s),h=s===o.value,u=S.useRef(h);return S.useEffect(()=>{const d=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(d)},[]),b.jsx(Ar,{present:r||h,children:({present:d})=>b.jsx(Me.div,{"data-state":h?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:l,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:d&&n})})});lb.displayName=ob;function cb(e,t){return`${e}-trigger-${t}`}function ub(e,t){return`${e}-content-${t}`}var dD=ib,fD=rb,_D=ab,mD=lb;const gD=(e,t)=>{const i=new Array(e.length+t.length);for(let s=0;s<e.length;s++)i[s]=e[s];for(let s=0;s<t.length;s++)i[e.length+s]=t[s];return i},pD=(e,t)=>({classGroupId:e,validator:t}),hb=(e=new Map,t=null,i)=>({nextPart:e,validators:t,classGroupId:i}),Yl="-",fg=[],vD="arbitrary..",yD=e=>{const t=bD(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return SD(a);const o=a.split(Yl),c=o[0]===""&&o.length>1?1:0;return db(o,c,t)},getConflictingClassGroupIds:(a,o)=>{if(o){const c=s[a],l=i[a];return c?l?gD(l,c):c:l||fg}return i[a]||fg}}},db=(e,t,i)=>{if(e.length-t===0)return i.classGroupId;const r=e[t],n=i.nextPart.get(r);if(n){const l=db(e,t+1,n);if(l)return l}const a=i.validators;if(a===null)return;const o=t===0?e.join(Yl):e.slice(t).join(Yl),c=a.length;for(let l=0;l<c;l++){const h=a[l];if(h.validator(o))return h.classGroupId}},SD=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),i=t.indexOf(":"),s=t.slice(0,i);return s?vD+s:void 0})(),bD=e=>{const{theme:t,classGroups:i}=e;return wD(i,t)},wD=(e,t)=>{const i=hb();for(const s in e){const r=e[s];Xf(r,i,s,t)}return i},Xf=(e,t,i,s)=>{const r=e.length;for(let n=0;n<r;n++){const a=e[n];CD(a,t,i,s)}},CD=(e,t,i,s)=>{if(typeof e=="string"){xD(e,t,i);return}if(typeof e=="function"){ED(e,t,i,s);return}AD(e,t,i,s)},xD=(e,t,i)=>{const s=e===""?t:fb(t,e);s.classGroupId=i},ED=(e,t,i,s)=>{if(kD(e)){Xf(e(s),t,i,s);return}t.validators===null&&(t.validators=[]),t.validators.push(pD(i,e))},AD=(e,t,i,s)=>{const r=Object.entries(e),n=r.length;for(let a=0;a<n;a++){const[o,c]=r[a];Xf(c,fb(t,o),i,s)}},fb=(e,t)=>{let i=e;const s=t.split(Yl),r=s.length;for(let n=0;n<r;n++){const a=s[n];let o=i.nextPart.get(a);o||(o=hb(),i.nextPart.set(a,o)),i=o}return i},kD=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,DD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,i=Object.create(null),s=Object.create(null);const r=(n,a)=>{i[n]=a,t++,t>e&&(t=0,s=i,i=Object.create(null))};return{get(n){let a=i[n];if(a!==void 0)return a;if((a=s[n])!==void 0)return r(n,a),a},set(n,a){n in i?i[n]=a:r(n,a)}}},Ih="!",_g=":",RD=[],mg=(e,t,i,s,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:i,maybePostfixModifierPosition:s,isExternal:r}),MD=e=>{const{prefix:t,experimentalParseClassName:i}=e;let s=r=>{const n=[];let a=0,o=0,c=0,l;const h=r.length;for(let m=0;m<h;m++){const w=r[m];if(a===0&&o===0){if(w===_g){n.push(r.slice(c,m)),c=m+1;continue}if(w==="/"){l=m;continue}}w==="["?a++:w==="]"?a--:w==="("?o++:w===")"&&o--}const u=n.length===0?r:r.slice(c);let d=u,f=!1;u.endsWith(Ih)?(d=u.slice(0,-1),f=!0):u.startsWith(Ih)&&(d=u.slice(1),f=!0);const _=l&&l>c?l-c:void 0;return mg(n,f,d,_)};if(t){const r=t+_g,n=s;s=a=>a.startsWith(r)?n(a.slice(r.length)):mg(RD,!1,a,void 0,!0)}if(i){const r=s;s=n=>i({className:n,parseClassName:r})}return s},TD=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((i,s)=>{t.set(i,1e6+s)}),i=>{const s=[];let r=[];for(let n=0;n<i.length;n++){const a=i[n],o=a[0]==="[",c=t.has(a);o||c?(r.length>0&&(r.sort(),s.push(...r),r=[]),s.push(a)):r.push(a)}return r.length>0&&(r.sort(),s.push(...r)),s}},OD=e=>({cache:DD(e.cacheSize),parseClassName:MD(e),sortModifiers:TD(e),postfixLookupClassGroupIds:ND(e),...yD(e)}),ND=e=>{const t=Object.create(null),i=e.postfixLookupClassGroups;if(i)for(let s=0;s<i.length;s++)t[i[s]]=!0;return t},BD=/\s+/,zD=(e,t)=>{const{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:r,sortModifiers:n,postfixLookupClassGroupIds:a}=t,o=[],c=e.trim().split(BD);let l="";for(let h=c.length-1;h>=0;h-=1){const u=c[h],{isExternal:d,modifiers:f,hasImportantModifier:_,baseClassName:m,maybePostfixModifierPosition:w}=i(u);if(d){l=u+(l.length>0?" "+l:l);continue}let g=!!w,p;if(g){const D=m.substring(0,w);p=s(D);const E=p&&a[p]?s(m):void 0;E&&E!==p&&(p=E,g=!1)}else p=s(m);if(!p){if(!g){l=u+(l.length>0?" "+l:l);continue}if(p=s(m),!p){l=u+(l.length>0?" "+l:l);continue}g=!1}const v=f.length===0?"":f.length===1?f[0]:n(f).join(":"),y=_?v+Ih:v,C=y+p;if(o.indexOf(C)>-1)continue;o.push(C);const k=r(p,g);for(let D=0;D<k.length;++D){const E=k[D];o.push(y+E)}l=u+(l.length>0?" "+l:l)}return l},LD=(...e)=>{let t=0,i,s,r="";for(;t<e.length;)(i=e[t++])&&(s=_b(i))&&(r&&(r+=" "),r+=s);return r},_b=e=>{if(typeof e=="string")return e;let t,i="";for(let s=0;s<e.length;s++)e[s]&&(t=_b(e[s]))&&(i&&(i+=" "),i+=t);return i},HD=(e,...t)=>{let i,s,r,n;const a=c=>{const l=t.reduce((h,u)=>u(h),e());return i=OD(l),s=i.cache.get,r=i.cache.set,n=o,o(c)},o=c=>{const l=s(c);if(l)return l;const h=zD(c,i);return r(c,h),h};return n=a,(...c)=>n(LD(...c))},PD=[],Fe=e=>{const t=i=>i[e]||PD;return t.isThemeGetter=!0,t},mb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gb=/^\((?:(\w[\w-]*):)?(.+)\)$/i,UD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ID=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cs=e=>UD.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),mi=e=>!!e&&Number.isInteger(Number(e)),Au=e=>e.endsWith("%")&&X(e.slice(0,-1)),Hi=e=>jD.test(e),pb=()=>!0,KD=e=>WD.test(e)&&!ID.test(e),Zf=()=>!1,YD=e=>qD.test(e),VD=e=>FD.test(e),GD=e=>!q(e)&&!F(e),$D=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),XD=e=>Ys(e,Sb,Zf),q=e=>mb.test(e),$s=e=>Ys(e,bb,KD),gg=e=>Ys(e,rR,X),ZD=e=>Ys(e,Cb,pb),QD=e=>Ys(e,wb,Zf),pg=e=>Ys(e,vb,Zf),JD=e=>Ys(e,yb,VD),Bo=e=>Ys(e,xb,YD),F=e=>gb.test(e),Vn=e=>kr(e,bb),eR=e=>kr(e,wb),vg=e=>kr(e,vb),tR=e=>kr(e,Sb),iR=e=>kr(e,yb),zo=e=>kr(e,xb,!0),sR=e=>kr(e,Cb,!0),Ys=(e,t,i)=>{const s=mb.exec(e);return s?s[1]?t(s[1]):i(s[2]):!1},kr=(e,t,i=!1)=>{const s=gb.exec(e);return s?s[1]?t(s[1]):i:!1},vb=e=>e==="position"||e==="percentage",yb=e=>e==="image"||e==="url",Sb=e=>e==="length"||e==="size"||e==="bg-size",bb=e=>e==="length",rR=e=>e==="number",wb=e=>e==="family-name",Cb=e=>e==="number"||e==="weight",xb=e=>e==="shadow",nR=()=>{const e=Fe("color"),t=Fe("font"),i=Fe("text"),s=Fe("font-weight"),r=Fe("tracking"),n=Fe("leading"),a=Fe("breakpoint"),o=Fe("container"),c=Fe("spacing"),l=Fe("radius"),h=Fe("shadow"),u=Fe("inset-shadow"),d=Fe("text-shadow"),f=Fe("drop-shadow"),_=Fe("blur"),m=Fe("perspective"),w=Fe("aspect"),g=Fe("ease"),p=Fe("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...y(),F,q],k=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],E=()=>[F,q,c],N=()=>[cs,"full","auto",...E()],U=()=>[mi,"none","subgrid",F,q],I=()=>["auto",{span:["full",mi,F,q]},mi,F,q],B=()=>[mi,"auto",F,q],R=()=>["auto","min","max","fr",F,q],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],L=()=>["start","end","center","stretch","center-safe","end-safe"],x=()=>["auto",...E()],O=()=>[cs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],A=()=>[cs,"screen","full","dvw","lvw","svw","min","max","fit",...E()],W=()=>[cs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...E()],z=()=>[e,F,q],Oe=()=>[...y(),vg,pg,{position:[F,q]}],Ne=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Be=()=>["auto","cover","contain",tR,XD,{size:[F,q]}],ue=()=>[Au,Vn,$s],se=()=>["","none","full",l,F,q],ae=()=>["",X,Vn,$s],bt=()=>["solid","dashed","dotted","double"],Oi=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[X,Au,vg,pg],fi=()=>["","none",_,F,q],Tt=()=>["none",X,F,q],dt=()=>["none",X,F,q],ee=()=>[X,F,q],wt=()=>[cs,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hi],breakpoint:[Hi],color:[pb],container:[Hi],"drop-shadow":[Hi],ease:["in","out","in-out"],font:[GD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hi],shadow:[Hi],spacing:["px",X],text:[Hi],"text-shadow":[Hi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cs,q,F,w]}],container:["container"],"container-type":[{"@container":["","normal","size",F,q]}],"container-named":[$D],columns:[{columns:[X,q,F,o]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[mi,"auto",F,q]}],basis:[{basis:[cs,"full","auto",o,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[X,cs,"auto","initial","none",q]}],grow:[{grow:["",X,F,q]}],shrink:[{shrink:["",X,F,q]}],order:[{order:[mi,"first","last","none",F,q]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...L(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...L(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pbs:[{pbs:E()}],pbe:[{pbe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:x()}],mx:[{mx:x()}],my:[{my:x()}],ms:[{ms:x()}],me:[{me:x()}],mbs:[{mbs:x()}],mbe:[{mbe:x()}],mt:[{mt:x()}],mr:[{mr:x()}],mb:[{mb:x()}],ml:[{ml:x()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],"inline-size":[{inline:["auto",...A()]}],"min-inline-size":[{"min-inline":["auto",...A()]}],"max-inline-size":[{"max-inline":["none",...A()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[o,"screen",...O()]}],"min-w":[{"min-w":[o,"screen","none",...O()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",i,Vn,$s]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,sR,ZD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Au,q]}],"font-family":[{font:[eR,QD,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,F,q]}],"line-clamp":[{"line-clamp":[X,"none",F,gg]}],leading:[{leading:[n,...E()]}],"list-image":[{"list-image":["none",F,q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",F,q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...bt(),"wavy"]}],"text-decoration-thickness":[{decoration:[X,"from-font","auto",F,$s]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[X,"auto",F,q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"tab-size":[{tab:[mi,F,q]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",F,q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",F,q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Oe()}],"bg-repeat":[{bg:Ne()}],"bg-size":[{bg:Be()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mi,F,q],radial:["",F,q],conic:[mi,F,q]},iR,JD]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...bt(),"hidden","none"]}],"divide-style":[{divide:[...bt(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...bt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[X,F,q]}],"outline-w":[{outline:["",X,Vn,$s]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",h,zo,Bo]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",u,zo,Bo]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[X,$s]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",d,zo,Bo]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[X,F,q]}],"mix-blend":[{"mix-blend":[...Oi(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Oi()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[X]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[F,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[X]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Oe()}],"mask-repeat":[{mask:Ne()}],"mask-size":[{mask:Be()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",F,q]}],filter:[{filter:["","none",F,q]}],blur:[{blur:fi()}],brightness:[{brightness:[X,F,q]}],contrast:[{contrast:[X,F,q]}],"drop-shadow":[{"drop-shadow":["","none",f,zo,Bo]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",X,F,q]}],"hue-rotate":[{"hue-rotate":[X,F,q]}],invert:[{invert:["",X,F,q]}],saturate:[{saturate:[X,F,q]}],sepia:[{sepia:["",X,F,q]}],"backdrop-filter":[{"backdrop-filter":["","none",F,q]}],"backdrop-blur":[{"backdrop-blur":fi()}],"backdrop-brightness":[{"backdrop-brightness":[X,F,q]}],"backdrop-contrast":[{"backdrop-contrast":[X,F,q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",X,F,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[X,F,q]}],"backdrop-invert":[{"backdrop-invert":["",X,F,q]}],"backdrop-opacity":[{"backdrop-opacity":[X,F,q]}],"backdrop-saturate":[{"backdrop-saturate":[X,F,q]}],"backdrop-sepia":[{"backdrop-sepia":["",X,F,q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",F,q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[X,"initial",F,q]}],ease:[{ease:["linear","initial",g,F,q]}],delay:[{delay:[X,F,q]}],animate:[{animate:["none",p,F,q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,F,q]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:Tt()}],"rotate-x":[{"rotate-x":Tt()}],"rotate-y":[{"rotate-y":Tt()}],"rotate-z":[{"rotate-z":Tt()}],scale:[{scale:dt()}],"scale-x":[{"scale-x":dt()}],"scale-y":[{"scale-y":dt()}],"scale-z":[{"scale-z":dt()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[F,q,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:wt()}],"translate-x":[{"translate-x":wt()}],"translate-y":[{"translate-y":wt()}],"translate-z":[{"translate-z":wt()}],"translate-none":["translate-none"],zoom:[{zoom:[mi,F,q]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",F,q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mbs":[{"scroll-mbs":E()}],"scroll-mbe":[{"scroll-mbe":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pbs":[{"scroll-pbs":E()}],"scroll-pbe":[{"scroll-pbe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",F,q]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[X,Vn,$s,gg]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},aR=HD(nR);function me(...e){return aR(R0(e))}const oR=Mf("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function pr({className:e,variant:t="default",size:i="default",asChild:s=!1,...r}){const n=s?S2:"button";return b.jsx(n,{"data-slot":"button","data-variant":t,"data-size":i,className:me(oR({variant:t,size:i,className:e})),...r})}function Br({className:e,type:t,...i}){return b.jsx("input",{type:t,"data-slot":"input",className:me("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...i})}function zr({className:e,...t}){return b.jsx(Kk,{"data-slot":"label",className:me("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function lR({className:e,...t}){return b.jsx("textarea",{"data-slot":"textarea",className:me("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...t})}function cR({className:e,orientation:t="horizontal",...i}){return b.jsx(dD,{"data-slot":"tabs","data-orientation":t,orientation:t,className:me("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...i})}const uR=Mf("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function hR({className:e,variant:t="default",...i}){return b.jsx(fD,{"data-slot":"tabs-list","data-variant":t,className:me(uR({variant:t}),e),...i})}function yg({className:e,...t}){return b.jsx(_D,{"data-slot":"tabs-trigger",className:me("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Sg({className:e,...t}){return b.jsx(mD,{"data-slot":"tabs-content",className:me("flex-1 outline-none",e),...t})}const dR=Mf("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function fR({className:e,variant:t,...i}){return b.jsx("div",{"data-slot":"alert",role:"alert",className:me(dR({variant:t}),e),...i})}function _R({className:e,...t}){return b.jsx("div",{"data-slot":"alert-description",className:me("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function mR({className:e,...t}){return b.jsx("div",{"data-slot":"card",className:me("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}function gR({className:e,...t}){return b.jsx("div",{"data-slot":"card-header",className:me("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function pR({className:e,...t}){return b.jsx("div",{"data-slot":"card-title",className:me("leading-none font-semibold",e),...t})}function vR({className:e,...t}){return b.jsx("div",{"data-slot":"card-description",className:me("text-sm text-muted-foreground",e),...t})}function yR({className:e,...t}){return b.jsx("div",{"data-slot":"card-content",className:me("px-6",e),...t})}function SR({t:e,busy:t,error:i,onSubmit:s}){const[r,n]=S.useState(""),[a,o]=S.useState("22"),[c,l]=S.useState(""),[h,u]=S.useState("password"),[d,f]=S.useState(""),[_,m]=S.useState(""),[w,g]=S.useState("");async function p(y){y&&m(await y.text())}function v(y){y.preventDefault();const C=h==="password"?{kind:"password",password:d}:{kind:"privateKey",privateKey:_,...w?{passphrase:w}:{}};s({host:r.trim(),port:Number(a)||22,username:c.trim(),auth:C})}return b.jsxs(mR,{className:"w-full max-w-md",children:[b.jsxs(gR,{children:[b.jsxs(pR,{className:"flex items-center gap-2",children:[b.jsx(k0,{className:"size-5","aria-hidden":!0})," ",e("login.title")]}),b.jsx(vR,{children:e("app.tagline")})]}),b.jsx(yR,{children:b.jsxs("form",{className:"flex flex-col gap-4",onSubmit:v,children:[b.jsxs("div",{className:"flex gap-3",children:[b.jsxs("div",{className:"flex flex-1 flex-col gap-2",children:[b.jsx(zr,{htmlFor:"host",children:e("login.host")}),b.jsx(Br,{id:"host",value:r,onChange:y=>n(y.target.value),placeholder:"192.168.1.10",autoComplete:"off",required:!0})]}),b.jsxs("div",{className:"flex w-24 flex-col gap-2",children:[b.jsx(zr,{htmlFor:"port",children:e("login.port")}),b.jsx(Br,{id:"port",value:a,onChange:y=>o(y.target.value),inputMode:"numeric",required:!0})]})]}),b.jsxs("div",{className:"flex flex-col gap-2",children:[b.jsx(zr,{htmlFor:"username",children:e("login.username")}),b.jsx(Br,{id:"username",value:c,onChange:y=>l(y.target.value),autoComplete:"off",required:!0})]}),b.jsxs(cR,{value:h,onValueChange:y=>u(y),children:[b.jsxs(hR,{className:"w-full",children:[b.jsxs(yg,{value:"password",className:"flex-1",children:[b.jsx(s2,{className:"size-4","aria-hidden":!0})," ",e("login.auth.password")]}),b.jsxs(yg,{value:"key",className:"flex-1",children:[b.jsx(Zx,{className:"size-4","aria-hidden":!0})," ",e("login.auth.key")]})]}),b.jsxs(Sg,{value:"password",className:"mt-4 flex flex-col gap-2",children:[b.jsx(zr,{htmlFor:"password",children:e("login.password")}),b.jsx(Br,{id:"password",type:"password",value:d,onChange:y=>f(y.target.value),autoComplete:"off",required:h==="password"})]}),b.jsxs(Sg,{value:"key",className:"mt-4 flex flex-col gap-3",children:[b.jsxs("div",{className:"flex flex-col gap-2",children:[b.jsx(zr,{htmlFor:"keyfile",children:e("login.keyFile")}),b.jsx(Br,{id:"keyfile",type:"file",onChange:y=>{var C;return void p((C=y.target.files)==null?void 0:C[0])}})]}),b.jsx(lR,{value:_,onChange:y=>m(y.target.value),placeholder:e("login.keyHint"),rows:4,spellCheck:!1,className:"font-mono text-xs",required:h==="key"}),b.jsxs("div",{className:"flex flex-col gap-2",children:[b.jsx(zr,{htmlFor:"passphrase",children:e("login.passphrase")}),b.jsx(Br,{id:"passphrase",type:"password",value:w,onChange:y=>g(y.target.value),autoComplete:"off"})]})]})]}),i&&b.jsx(fR,{variant:"destructive",children:b.jsx(_R,{children:`${e("login.error")}: ${i}`})}),b.jsx(pr,{type:"submit",disabled:t,className:"w-full",children:e(t?"login.connecting":"login.submit")})]})})]})}function bR({...e}){return b.jsx(lA,{"data-slot":"alert-dialog",...e})}function wR({...e}){return b.jsx(cA,{"data-slot":"alert-dialog-portal",...e})}function CR({className:e,...t}){return b.jsx(uA,{"data-slot":"alert-dialog-overlay",className:me("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function xR({className:e,size:t="default",...i}){return b.jsxs(wR,{children:[b.jsx(CR,{}),b.jsx(hA,{"data-slot":"alert-dialog-content","data-size":t,className:me("group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",e),...i})]})}function ER({className:e,...t}){return b.jsx("div",{"data-slot":"alert-dialog-header",className:me("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function AR({className:e,...t}){return b.jsx("div",{"data-slot":"alert-dialog-footer",className:me("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function kR({className:e,...t}){return b.jsx(_A,{"data-slot":"alert-dialog-title",className:me("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function DR({className:e,...t}){return b.jsx(mA,{"data-slot":"alert-dialog-description",className:me("text-sm text-muted-foreground",e),...t})}function RR({className:e,variant:t="default",size:i="default",...s}){return b.jsx(pr,{variant:t,size:i,asChild:!0,children:b.jsx(dA,{"data-slot":"alert-dialog-action",className:me(e),...s})})}function MR({className:e,variant:t="outline",size:i="default",...s}){return b.jsx(pr,{variant:t,size:i,asChild:!0,children:b.jsx(fA,{"data-slot":"alert-dialog-cancel",className:me(e),...s})})}function TR({t:e,prompt:t,onConfirm:i,onCancel:s}){return b.jsx(bR,{open:t!==null,children:b.jsxs(xR,{children:[b.jsxs(ER,{children:[b.jsxs(kR,{className:"flex items-center gap-2",children:[b.jsx(d2,{className:"size-5","aria-hidden":!0})," ",e("hostkey.title")]}),b.jsx(DR,{children:e("hostkey.body")})]}),t&&b.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[b.jsxs("div",{className:"text-xs text-muted-foreground",children:[e("hostkey.fingerprint")," · ",t.algorithm]}),b.jsx("code",{className:"font-mono break-all",children:t.fingerprint})]}),b.jsxs(AR,{children:[b.jsx(MR,{onClick:s,children:e("hostkey.cancel")}),b.jsx(RR,{onClick:i,children:e("hostkey.confirm")})]})]})})}let bg=0;function OR(){const[e,t]=S.useState([]),[i,s]=S.useState(1),r=S.useCallback(u=>{s(d=>{const f=d+1;return t(_=>_.map(m=>m.id===u?{...m,z:f,minimized:!1}:m)),f})},[]),n=S.useCallback(u=>{t(d=>{var v,y;const f=d.find(C=>C.appId===u.id);if(f){const C=i+1;return s(C),d.map(k=>k.id===f.id?{...k,minimized:!1,z:C}:k)}const _=i+1;s(_);const m=((v=u.defaultSize)==null?void 0:v.w)??560,w=((y=u.defaultSize)==null?void 0:y.h)??420,g=bg++%6*28,p={id:`win-${bg}`,appId:u.id,title:u.title,icon:u.icon,x:80+g,y:64+g,w:m,h:w,z:_,minimized:!1,maximized:!1};return[...d,p]})},[i]),a=S.useCallback(u=>{t(d=>d.filter(f=>f.id!==u))},[]),o=S.useCallback(u=>{t(d=>d.map(f=>f.id===u?{...f,minimized:!0}:f))},[]),c=S.useCallback(u=>{t(d=>d.map(f=>f.id===u?{...f,maximized:!f.maximized}:f))},[]),l=S.useCallback((u,d,f)=>{t(_=>_.map(m=>m.id===u?{...m,x:d,y:f}:m))},[]),h=S.useCallback((u,d,f)=>{t(_=>_.map(m=>m.id===u?{...m,w:d,h:f}:m))},[]);return{windows:e,openApp:n,close:a,focus:r,minimize:o,toggleMaximize:c,move:l,resize:h}}const NR=320,BR=200;function zR({win:e,active:t,children:i,onFocus:s,onClose:r,onMinimize:n,onToggleMaximize:a,onMove:o,onResize:c}){const l=S.useRef(null),h=S.useRef(null);function u(v){e.maximized||(s(),l.current={px:v.clientX,py:v.clientY,ox:e.x,oy:e.y},v.currentTarget.setPointerCapture(v.pointerId))}function d(v){l.current&&o(Math.max(0,l.current.ox+(v.clientX-l.current.px)),Math.max(0,l.current.oy+(v.clientY-l.current.py)))}function f(v){l.current=null,v.currentTarget.releasePointerCapture(v.pointerId)}function _(v){v.stopPropagation(),s(),h.current={px:v.clientX,py:v.clientY,ow:e.w,oh:e.h},v.currentTarget.setPointerCapture(v.pointerId)}function m(v){h.current&&c(Math.max(NR,h.current.ow+(v.clientX-h.current.px)),Math.max(BR,h.current.oh+(v.clientY-h.current.py)))}function w(v){h.current=null,v.currentTarget.releasePointerCapture(v.pointerId)}const g=e.icon,p=e.maximized?{inset:"0 0 0 0",zIndex:e.z}:{left:e.x,top:e.y,width:e.w,height:e.h,zIndex:e.z};return b.jsxs("section",{className:me("absolute flex flex-col overflow-hidden rounded-lg border bg-card shadow-2xl",t?"border-ring/60":"border-border"),style:p,onPointerDown:s,"aria-label":e.title,children:[b.jsxs("header",{className:"flex h-9 shrink-0 cursor-grab items-center gap-2 border-b bg-muted/40 px-2 select-none active:cursor-grabbing",onPointerDown:u,onPointerMove:d,onPointerUp:f,onDoubleClick:a,children:[b.jsx(g,{className:"size-4 text-muted-foreground","aria-hidden":!0}),b.jsx("span",{className:"flex-1 truncate text-sm font-medium",children:e.title}),b.jsx("button",{className:"grid size-6 place-items-center rounded hover:bg-accent",onClick:n,"aria-label":"Minimize",children:b.jsx(o2,{className:"size-3.5","aria-hidden":!0})}),b.jsx("button",{className:"grid size-6 place-items-center rounded hover:bg-accent",onClick:a,"aria-label":"Maximize",children:b.jsx(g2,{className:"size-3","aria-hidden":!0})}),b.jsx("button",{className:"grid size-6 place-items-center rounded hover:bg-destructive hover:text-white",onClick:r,"aria-label":"Close",children:b.jsx(v2,{className:"size-3.5","aria-hidden":!0})})]}),b.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:i}),!e.maximized&&b.jsx("div",{className:"absolute right-0 bottom-0 size-4 cursor-se-resize",onPointerDown:_,onPointerMove:m,onPointerUp:w})]})}function LR({...e}){return b.jsx(iD,{"data-slot":"popover",...e})}function HR({...e}){return b.jsx(sD,{"data-slot":"popover-trigger",...e})}function PR({className:e,align:t="center",sideOffset:i=4,...s}){return b.jsx(rD,{children:b.jsx(nD,{"data-slot":"popover-content",align:t,sideOffset:i,className:me("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...s})})}function wg({className:e,orientation:t="horizontal",decorative:i=!0,...s}){return b.jsx(cD,{"data-slot":"separator",decorative:i,orientation:t,className:me("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...s})}function UR(){const[e,t]=S.useState(()=>new Date);return S.useEffect(()=>{const i=setInterval(()=>t(new Date),1e4);return()=>clearInterval(i)},[]),b.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})}function jR({t:e,apps:t,windows:i,activeId:s,host:r,onLaunch:n,onSelectWindow:a,onDisconnect:o}){const[c,l]=S.useState(!1);return b.jsxs("footer",{className:"flex h-12 shrink-0 items-center gap-2 border-t bg-card/80 px-2 backdrop-blur",children:[b.jsxs(LR,{open:c,onOpenChange:l,children:[b.jsx(HR,{asChild:!0,children:b.jsxs(pr,{variant:"ghost",size:"sm",className:"gap-2",children:[b.jsx(Jx,{className:"size-4","aria-hidden":!0})," ",e("desktop.start")]})}),b.jsx(PR,{align:"start",side:"top",className:"w-56 p-2",children:b.jsx("div",{className:"grid grid-cols-2 gap-1",children:t.map(h=>{const u=h.icon;return b.jsxs("button",{className:"flex flex-col items-center gap-2 rounded-md p-3 text-center text-xs hover:bg-accent",onClick:()=>{n(h),l(!1)},children:[b.jsx(u,{className:"size-6 text-muted-foreground","aria-hidden":!0}),h.title]},h.id)})})})]}),b.jsx(wg,{orientation:"vertical",className:"h-6"}),b.jsx("div",{className:"flex flex-1 items-center gap-1 overflow-x-auto",children:i.map(h=>{const u=h.icon;return b.jsxs("button",{onClick:()=>a(h.id),className:me("flex items-center gap-2 rounded-md px-3 py-1.5 text-xs",h.id===s&&!h.minimized?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/60"),children:[b.jsx(u,{className:"size-4","aria-hidden":!0}),b.jsx("span",{className:"max-w-32 truncate",children:h.title})]},h.id)})}),b.jsx(wg,{orientation:"vertical",className:"h-6"}),b.jsxs("span",{className:"hidden items-center gap-1.5 text-xs text-muted-foreground sm:flex",children:[b.jsx(k0,{className:"size-3.5","aria-hidden":!0})," ",r]}),b.jsx(UR,{}),b.jsxs(pr,{variant:"ghost",size:"sm",className:"gap-2",onClick:o,children:[b.jsx(n2,{className:"size-4","aria-hidden":!0})," ",e("desktop.disconnect")]})]})}function Cg(e,t){return e==="/"?`/${t}`:`${e.replace(/\/+$/,"")}/${t}`}function WR(e){const t=e.replace(/\/+$/,""),i=t.lastIndexOf("/");return i<=0?"/":t.slice(0,i)}function qh(e){if(e<1024)return`${e} B`;const t=["KB","MB","GB","TB"];let i=e/1024,s=0;for(;i>=1024&&s<t.length-1;)i/=1024,s+=1;return`${i.toFixed(1)} ${t[s]}`}function IR(e){const t=Math.floor(e/86400),i=Math.floor(e%86400/3600),s=Math.floor(e%3600/60),r=[];return t&&r.push(`${t}d`),i&&r.push(`${i}h`),r.push(`${s}m`),r.join(" ")}function qR(e){const t=atob(e),i=Uint8Array.from(t,s=>s.charCodeAt(0));return new TextDecoder().decode(i)}function FR(e){const t=new TextEncoder().encode(e);let i="";for(const s of t)i+=String.fromCharCode(s);return btoa(i)}function KR(e){return!atob(e).slice(0,4096).includes("\0")}function YR({type:e}){const t="size-4 shrink-0 text-muted-foreground";return e==="directory"?b.jsx(A0,{className:t,"aria-hidden":!0}):e==="symlink"?b.jsx(t2,{className:t,"aria-hidden":!0}):b.jsx(Yx,{className:t,"aria-hidden":!0})}function VR({t:e,session:t,openEditor:i}){const[s,r]=S.useState(t.home),[n,a]=S.useState([]),[o,c]=S.useState(null);S.useEffect(()=>{let u=!0;return c(null),x0(t.sessionId,s).then(d=>{u&&(d.result.kind==="ok"?a(d.result.value):c(e("files.error")))}).catch(d=>u&&c(d instanceof Error?d.message:String(d))),()=>{u=!1}},[t.sessionId,s,e]);function l(u){u.type==="directory"?r(Cg(s,u.name)):u.type==="file"&&i(Cg(s,u.name))}const h=[...n].sort((u,d)=>u.type==="directory"&&d.type!=="directory"?-1:u.type!=="directory"&&d.type==="directory"?1:u.name.localeCompare(d.name));return b.jsxs("div",{className:"flex h-full flex-col",children:[b.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/30 px-2 py-1.5",children:[b.jsx(pr,{variant:"ghost",size:"icon",className:"size-7",disabled:s==="/",onClick:()=>r(WR(s)),"aria-label":e("files.up"),children:b.jsx(jx,{className:"size-4","aria-hidden":!0})}),b.jsx("code",{className:"truncate font-mono text-xs text-muted-foreground",children:s})]}),b.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[o&&b.jsx("p",{className:"p-3 text-sm text-destructive",children:o}),!o&&h.length===0&&b.jsx("p",{className:"p-3 text-sm text-muted-foreground",children:e("files.empty")}),b.jsx("ul",{children:h.map(u=>b.jsx("li",{children:b.jsxs("button",{className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm hover:bg-accent",onDoubleClick:()=>l(u),onClick:d=>d.detail===0&&l(u),children:[b.jsx(YR,{type:u.type}),b.jsx("span",{className:"flex-1 truncate",children:u.name}),b.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:u.type==="file"?qh(u.size):""})]})},u.name))})]})]})}function GR({t:e,session:t}){const[i,s]=S.useState(null),[r,n]=S.useState(!1);if(S.useEffect(()=>{let o=!0;async function c(){const{result:h}=await Dx(t.sessionId).catch(()=>({result:null}));o&&((h==null?void 0:h.kind)==="ok"?(s(h.value),n(!1)):n(!0))}c();const l=setInterval(()=>void c(),2e3);return()=>{o=!1,clearInterval(l)}},[t.sessionId]),r&&!i)return b.jsx("div",{className:"grid h-full place-items-center p-6 text-sm text-muted-foreground",children:e("monitor.unavailable")});if(!i)return b.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"…"});const a=i.memory.totalBytes?Math.round(i.memory.usedBytes/i.memory.totalBytes*100):0;return b.jsxs("div",{className:"flex flex-col gap-4 p-4 text-sm",children:[b.jsxs("div",{className:"flex flex-col gap-1",children:[b.jsx("span",{className:"text-xs text-muted-foreground",children:e("monitor.uptime")}),b.jsx("span",{className:"text-lg font-medium tabular-nums",children:IR(i.uptimeSeconds)})]}),b.jsxs("div",{className:"flex flex-col gap-1",children:[b.jsx("span",{className:"text-xs text-muted-foreground",children:e("monitor.load")}),b.jsx("span",{className:"font-mono tabular-nums",children:i.loadAverage.join(" · ")})]}),b.jsxs("div",{className:"flex flex-col gap-1.5",children:[b.jsx("span",{className:"text-xs text-muted-foreground",children:e("monitor.memory")}),b.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-muted",children:b.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${a}%`}})}),b.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:e("monitor.memoryUsage",{used:qh(i.memory.usedBytes),total:qh(i.memory.totalBytes),pct:a})})]})]})}function $R({t:e,session:t}){const[i,s]=S.useState(null);return S.useEffect(()=>{let r=!0;return x0(t.sessionId).then(n=>r&&s(n)).catch(()=>{}),()=>{r=!1}},[t.sessionId]),b.jsxs("div",{className:"flex flex-col gap-4 p-4 text-sm",children:[b.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1",children:[b.jsx("dt",{className:"text-muted-foreground",children:e("system.os")}),b.jsx("dd",{children:t.os.prettyName??t.os.family}),b.jsx("dt",{className:"text-muted-foreground",children:e("system.host")}),b.jsx("dd",{children:t.host}),b.jsx("dt",{className:"text-muted-foreground",children:e("system.home")}),b.jsx("dd",{className:"font-mono text-xs",children:t.home})]}),b.jsxs("div",{children:[b.jsx("h3",{className:"mb-1 text-xs font-medium text-muted-foreground",children:e("system.transparency")}),b.jsx("ul",{className:"divide-y divide-border overflow-hidden rounded-md border font-mono text-xs",children:((i==null?void 0:i.transparency)??[]).map(r=>b.jsxs("li",{className:"flex items-center gap-2 px-3 py-1.5",children:[b.jsxs("span",{className:"text-primary",children:["[",r.exitCode??"ERR","]"]}),b.jsx("code",{className:"break-all",children:r.command})]},r.id))})]})]})}function XR({t:e,session:t,editorTarget:i}){const[s,r]=S.useState(null),[n,a]=S.useState(""),[o,c]=S.useState(!1),[l,h]=S.useState("idle"),[u,d]=S.useState(null);S.useEffect(()=>{if(!i||i===s)return;let _=!0;return h("loading"),d(null),Rx(t.sessionId,i).then(({result:m})=>{if(_){if(m.kind!=="ok"){h("error"),d(e("editor.loadError"));return}if(!KR(m.base64)){h("error"),d(e("editor.binary"));return}r(i),a(qR(m.base64)),c(!1),h("idle")}}).catch(()=>{_&&(h("error"),d(e("editor.loadError")))}),()=>{_=!1}},[i,s,t.sessionId,e]);function f(){s&&(h("saving"),Mx(t.sessionId,s,FR(n)).then(({result:_})=>{_.kind==="ok"?(c(!1),h("saved"),d(null)):(h("error"),d(e("editor.saveError")))}).catch(()=>{h("error"),d(e("editor.saveError"))}))}return b.jsxs("div",{className:"flex h-full flex-col",children:[b.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/30 px-2 py-1.5",children:[o&&b.jsx(Ix,{className:"size-2 fill-primary text-primary","aria-hidden":!0}),b.jsx("code",{className:"flex-1 truncate font-mono text-xs text-muted-foreground",children:s??e("editor.untitled")}),b.jsx("span",{className:"text-xs text-muted-foreground",children:l==="saving"?e("editor.saving"):l==="saved"?e("editor.saved"):o?e("editor.unsaved"):""}),b.jsxs(pr,{size:"sm",variant:"outline",className:"h-7 gap-1.5",disabled:!s||!o||l==="saving",onClick:f,children:[b.jsx(c2,{className:"size-3.5","aria-hidden":!0})," ",e("editor.save")]})]}),u&&b.jsx("p",{className:"px-3 py-2 text-sm text-destructive",children:u}),b.jsx("textarea",{className:"min-h-0 flex-1 resize-none bg-transparent p-3 font-mono text-xs outline-none",value:n,spellCheck:!1,disabled:!s,onChange:_=>{a(_.target.value),c(!0),l==="saved"&&h("idle")},onKeyDown:_=>{(_.ctrlKey||_.metaKey)&&_.key==="s"&&(_.preventDefault(),f())}})]})}/**
|
|
220
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
221
|
+
* @license MIT
|
|
222
|
+
*
|
|
223
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
224
|
+
* @license MIT
|
|
225
|
+
*
|
|
226
|
+
* Originally forked from (with the author's permission):
|
|
227
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
228
|
+
* http://bellard.org/jslinux/
|
|
229
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
230
|
+
*/var Eb=Object.defineProperty,ZR=Object.getOwnPropertyDescriptor,QR=(e,t)=>{for(var i in t)Eb(e,i,{get:t[i],enumerable:!0})},Te=(e,t,i,s)=>{for(var r=s>1?void 0:s?ZR(t,i):t,n=e.length-1,a;n>=0;n--)(a=e[n])&&(r=(s?a(t,i,r):a(r))||r);return s&&r&&Eb(t,i,r),r},j=(e,t)=>(i,s)=>t(i,s,e),xg="Terminal input",Fh={get:()=>xg,set:e=>xg=e},Eg="Too much output to announce, navigate to rows manually to read",Kh={get:()=>Eg,set:e=>Eg=e};function JR(e){return e.replace(/\r?\n/g,"\r")}function eM(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function tM(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function iM(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let r=e.clipboardData.getData("text/plain");Ab(r,t,i,s)}}function Ab(e,t,i,s){e=JR(e),e=eM(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function kb(e,t,i){let s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function Ag(e,t,i,s,r){kb(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function gs(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Dc(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let n=e[r];n>65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var sM=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){let n=e.charCodeAt(r++);56320<=n&&n<=57343?t[s++]=(this._interim-55296)*1024+n-56320+65536:(t[s++]=this._interim,t[s++]=n),this._interim=0}for(let n=r;n<i;++n){let a=e.charCodeAt(n);if(55296<=a&&a<=56319){if(++n>=i)return this._interim=a,s;let o=e.charCodeAt(n);56320<=o&&o<=57343?t[s++]=(a-55296)*1024+o-56320+65536:(t[s++]=a,t[s++]=o);continue}a!==65279&&(t[s++]=a)}return s}},rM=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r,n,a,o,c=0,l=0;if(this.interim[0]){let d=!1,f=this.interim[0];f&=(f&224)===192?31:(f&240)===224?15:7;let _=0,m;for(;(m=this.interim[++_]&63)&&_<4;)f<<=6,f|=m;let w=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,g=w-_;for(;l<g;){if(l>=i)return 0;if(m=e[l++],(m&192)!==128){l--,d=!0;break}else this.interim[_++]=m,f<<=6,f|=m&63}d||(w===2?f<128?l--:t[s++]=f:w===3?f<2048||f>=55296&&f<=57343||f===65279||(t[s++]=f):f<65536||f>1114111||(t[s++]=f)),this.interim.fill(0)}let h=i-4,u=l;for(;u<i;){for(;u<h&&!((r=e[u])&128)&&!((n=e[u+1])&128)&&!((a=e[u+2])&128)&&!((o=e[u+3])&128);)t[s++]=r,t[s++]=n,t[s++]=a,t[s++]=o,u+=4;if(r=e[u++],r<128)t[s++]=r;else if((r&224)===192){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(c=(r&31)<<6|n&63,c<128){u--;continue}t[s++]=c}else if((r&240)===224){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,s;if(a=e[u++],(a&192)!==128){u--;continue}if(c=(r&15)<<12|(n&63)<<6|a&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[s++]=c}else if((r&248)===240){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,s;if(a=e[u++],(a&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=a,s;if(o=e[u++],(o&192)!==128){u--;continue}if(c=(r&7)<<18|(n&63)<<12|(a&63)<<6|o&63,c<65536||c>1114111)continue;t[s++]=c}}return s}},Db="",As=" ",ro=class Rb{constructor(){this.fg=0,this.bg=0,this.extended=new Vl}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new Rb;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Vl=class Mb{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Mb(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},ri=class Tb extends ro{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Vl,this.combinedData=""}static fromCharData(t){let i=new Tb;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?gs(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},kg="di$target",Yh="di$dependencies",ku=new Map;function nM(e){return e[Yh]||[]}function rt(e){if(ku.has(e))return ku.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");aM(t,i,r)};return t._id=e,ku.set(e,t),t}function aM(e,t,i){t[kg]===t?t[Yh].push({id:e,index:i}):(t[Yh]=[{id:e,index:i}],t[kg]=t)}var yt=rt("BufferService"),Ob=rt("CoreMouseService"),Dr=rt("CoreService"),oM=rt("CharsetService"),Qf=rt("InstantiationService"),Nb=rt("LogService"),St=rt("OptionsService"),Bb=rt("OscLinkService"),lM=rt("UnicodeService"),no=rt("DecorationService"),Vh=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){var h;let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,n=new ri,a=i.getTrimmedLength(),o=-1,c=-1,l=!1;for(let u=0;u<a;u++)if(!(c===-1&&!i.hasContent(u))){if(i.loadCell(u,n),n.hasExtendedAttrs()&&n.extended.urlId)if(c===-1){c=u,o=n.extended.urlId;continue}else l=n.extended.urlId!==o;else c!==-1&&(l=!0);if(l||c!==-1&&u===a-1){let d=(h=this._oscLinkService.getLinkData(o))==null?void 0:h.uri;if(d){let f={start:{x:c+1,y:e},end:{x:u+(!l&&u===a-1?1:0),y:e}},_=!1;if(!(r!=null&&r.allowNonHttpProtocols))try{let m=new URL(d);["http:","https:"].includes(m.protocol)||(_=!0)}catch{_=!0}_||s.push({text:d,range:f,activate:(m,w)=>r?r.activate(m,w,f):cM(m,w),hover:(m,w)=>{var g;return(g=r==null?void 0:r.hover)==null?void 0:g.call(r,m,w,f)},leave:(m,w)=>{var g;return(g=r==null?void 0:r.leave)==null?void 0:g.call(r,m,w,f)}})}l=!1,n.hasExtendedAttrs()&&n.extended.urlId?(c=u,o=n.extended.urlId):(c=-1,o=-1)}}t(s)}};Vh=Te([j(0,yt),j(1,St),j(2,Bb)],Vh);function cM(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
231
|
+
|
|
232
|
+
WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Rc=rt("CharSizeService"),as=rt("CoreBrowserService"),Jf=rt("MouseService"),os=rt("RenderService"),uM=rt("SelectionService"),zb=rt("CharacterJoinerService"),Pn=rt("ThemeService"),Lb=rt("LinkProviderService"),hM=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Dg.isErrorNoTelemetry(e)?new Dg(e.message+`
|
|
233
|
+
|
|
234
|
+
`+e.stack):new Error(e.message+`
|
|
235
|
+
|
|
236
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},dM=new hM;function al(e){fM(e)||dM.onUnexpectedError(e)}var Gh="Canceled";function fM(e){return e instanceof _M?!0:e instanceof Error&&e.name===Gh&&e.message===Gh}var _M=class extends Error{constructor(){super(Gh),this.name=this.message}};function mM(e){return new Error(`Illegal argument: ${e}`)}var Dg=class $h extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof $h)return t;let i=new $h;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Xh=class Hb extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Hb.prototype)}};function Ot(e,t=0){return e[e.length-(1+t)]}var gM;(e=>{function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function s(n){return n>0}e.isGreaterThan=s;function r(n){return n===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(gM||(gM={}));function pM(e,t){let i=this,s=!1,r;return function(){return s||(s=!0,t||(r=e.apply(i,arguments))),r}}var Pb;(e=>{function t(y){return y&&typeof y=="object"&&typeof y[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*r(y){yield y}e.single=r;function n(y){return t(y)?y:r(y)}e.wrap=n;function a(y){return y||i}e.from=a;function*o(y){for(let C=y.length-1;C>=0;C--)yield y[C]}e.reverse=o;function c(y){return!y||y[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(y){return y[Symbol.iterator]().next().value}e.first=l;function h(y,C){let k=0;for(let D of y)if(C(D,k++))return!0;return!1}e.some=h;function u(y,C){for(let k of y)if(C(k))return k}e.find=u;function*d(y,C){for(let k of y)C(k)&&(yield k)}e.filter=d;function*f(y,C){let k=0;for(let D of y)yield C(D,k++)}e.map=f;function*_(y,C){let k=0;for(let D of y)yield*C(D,k++)}e.flatMap=_;function*m(...y){for(let C of y)yield*C}e.concat=m;function w(y,C,k){let D=k;for(let E of y)D=C(D,E);return D}e.reduce=w;function*g(y,C,k=y.length){for(C<0&&(C+=y.length),k<0?k+=y.length:k>y.length&&(k=y.length);C<k;C++)yield y[C]}e.slice=g;function p(y,C=Number.POSITIVE_INFINITY){let k=[];if(C===0)return[k,y];let D=y[Symbol.iterator]();for(let E=0;E<C;E++){let N=D.next();if(N.done)return[k,e.empty()];k.push(N.value)}return[k,{[Symbol.iterator](){return D}}]}e.consume=p;async function v(y){let C=[];for await(let k of y)C.push(k);return Promise.resolve(C)}e.asyncToArray=v})(Pb||(Pb={}));function vr(e){if(Pb.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function vM(...e){return Ce(()=>vr(e))}function Ce(e){return{dispose:pM(()=>{e()})}}var Ub=class jb{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{vr(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?jb.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};Ub.DISABLE_DISPOSED_WARNING=!1;var Ls=Ub,Z=class{constructor(){this._store=new Ls,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Z.None=Object.freeze({dispose(){}});var An=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Ki=typeof window=="object"?window:globalThis,Zh=class Qh{constructor(t){this.element=t,this.next=Qh.Undefined,this.prev=Qh.Undefined}};Zh.Undefined=new Zh(void 0);var xe=Zh,Rg=class{constructor(){this._first=xe.Undefined,this._last=xe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===xe.Undefined}clear(){let e=this._first;for(;e!==xe.Undefined;){let t=e.next;e.prev=xe.Undefined,e.next=xe.Undefined,e=t}this._first=xe.Undefined,this._last=xe.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new xe(e);if(this._first===xe.Undefined)this._first=i,this._last=i;else if(t){let r=this._last;this._last=i,i.prev=r,r.next=i}else{let r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==xe.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==xe.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==xe.Undefined&&e.next!==xe.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===xe.Undefined&&e.next===xe.Undefined?(this._first=xe.Undefined,this._last=xe.Undefined):e.next===xe.Undefined?(this._last=this._last.prev,this._last.next=xe.Undefined):e.prev===xe.Undefined&&(this._first=this._first.next,this._first.prev=xe.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==xe.Undefined;)yield e.element,e=e.next}},yM=globalThis.performance&&typeof globalThis.performance.now=="function",SM=class Wb{static create(t){return new Wb(t)}constructor(t){this._now=yM&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},ct;(e=>{e.None=()=>Z.None;function t(B,R){return u(B,()=>{},0,void 0,!0,void 0,R)}e.defer=t;function i(B){return(R,H=null,L)=>{let x=!1,O;return O=B(A=>{if(!x)return O?O.dispose():x=!0,R.call(H,A)},null,L),x&&O.dispose(),O}}e.once=i;function s(B,R,H){return l((L,x=null,O)=>B(A=>L.call(x,R(A)),null,O),H)}e.map=s;function r(B,R,H){return l((L,x=null,O)=>B(A=>{R(A),L.call(x,A)},null,O),H)}e.forEach=r;function n(B,R,H){return l((L,x=null,O)=>B(A=>R(A)&&L.call(x,A),null,O),H)}e.filter=n;function a(B){return B}e.signal=a;function o(...B){return(R,H=null,L)=>{let x=vM(...B.map(O=>O(A=>R.call(H,A))));return h(x,L)}}e.any=o;function c(B,R,H,L){let x=H;return s(B,O=>(x=R(x,O),x),L)}e.reduce=c;function l(B,R){let H,L={onWillAddFirstListener(){H=B(x.fire,x)},onDidRemoveLastListener(){H==null||H.dispose()}},x=new P(L);return R==null||R.add(x),x.event}function h(B,R){return R instanceof Array?R.push(B):R&&R.add(B),B}function u(B,R,H=100,L=!1,x=!1,O,A){let W,z,Oe,Ne=0,Be,ue={leakWarningThreshold:O,onWillAddFirstListener(){W=B(ae=>{Ne++,z=R(z,ae),L&&!Oe&&(se.fire(z),z=void 0),Be=()=>{let bt=z;z=void 0,Oe=void 0,(!L||Ne>1)&&se.fire(bt),Ne=0},typeof H=="number"?(clearTimeout(Oe),Oe=setTimeout(Be,H)):Oe===void 0&&(Oe=0,queueMicrotask(Be))})},onWillRemoveListener(){x&&Ne>0&&(Be==null||Be())},onDidRemoveLastListener(){Be=void 0,W.dispose()}},se=new P(ue);return A==null||A.add(se),se.event}e.debounce=u;function d(B,R=0,H){return e.debounce(B,(L,x)=>L?(L.push(x),L):[x],R,void 0,!0,void 0,H)}e.accumulate=d;function f(B,R=(L,x)=>L===x,H){let L=!0,x;return n(B,O=>{let A=L||!R(O,x);return L=!1,x=O,A},H)}e.latch=f;function _(B,R,H){return[e.filter(B,R,H),e.filter(B,L=>!R(L),H)]}e.split=_;function m(B,R=!1,H=[],L){let x=H.slice(),O=B(z=>{x?x.push(z):W.fire(z)});L&&L.add(O);let A=()=>{x==null||x.forEach(z=>W.fire(z)),x=null},W=new P({onWillAddFirstListener(){O||(O=B(z=>W.fire(z)),L&&L.add(O))},onDidAddFirstListener(){x&&(R?setTimeout(A):A())},onDidRemoveLastListener(){O&&O.dispose(),O=null}});return L&&L.add(W),W.event}e.buffer=m;function w(B,R){return(H,L,x)=>{let O=R(new p);return B(function(A){let W=O.evaluate(A);W!==g&&H.call(L,W)},void 0,x)}}e.chain=w;let g=Symbol("HaltChainable");class p{constructor(){this.steps=[]}map(R){return this.steps.push(R),this}forEach(R){return this.steps.push(H=>(R(H),H)),this}filter(R){return this.steps.push(H=>R(H)?H:g),this}reduce(R,H){let L=H;return this.steps.push(x=>(L=R(L,x),L)),this}latch(R=(H,L)=>H===L){let H=!0,L;return this.steps.push(x=>{let O=H||!R(x,L);return H=!1,L=x,O?x:g}),this}evaluate(R){for(let H of this.steps)if(R=H(R),R===g)break;return R}}function v(B,R,H=L=>L){let L=(...W)=>A.fire(H(...W)),x=()=>B.on(R,L),O=()=>B.removeListener(R,L),A=new P({onWillAddFirstListener:x,onDidRemoveLastListener:O});return A.event}e.fromNodeEventEmitter=v;function y(B,R,H=L=>L){let L=(...W)=>A.fire(H(...W)),x=()=>B.addEventListener(R,L),O=()=>B.removeEventListener(R,L),A=new P({onWillAddFirstListener:x,onDidRemoveLastListener:O});return A.event}e.fromDOMEventEmitter=y;function C(B){return new Promise(R=>i(B)(R))}e.toPromise=C;function k(B){let R=new P;return B.then(H=>{R.fire(H)},()=>{R.fire(void 0)}).finally(()=>{R.dispose()}),R.event}e.fromPromise=k;function D(B,R){return B(H=>R.fire(H))}e.forward=D;function E(B,R,H){return R(H),B(L=>R(L))}e.runAndSubscribe=E;class N{constructor(R,H){this._observable=R,this._counter=0,this._hasChanged=!1;let L={onWillAddFirstListener:()=>{R.addObserver(this)},onDidRemoveLastListener:()=>{R.removeObserver(this)}};this.emitter=new P(L),H&&H.add(this.emitter)}beginUpdate(R){this._counter++}handlePossibleChange(R){}handleChange(R,H){this._hasChanged=!0}endUpdate(R){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function U(B,R){return new N(B,R).emitter.event}e.fromObservable=U;function I(B){return(R,H,L)=>{let x=0,O=!1,A={beginUpdate(){x++},endUpdate(){x--,x===0&&(B.reportChanges(),O&&(O=!1,R.call(H)))},handlePossibleChange(){},handleChange(){O=!0}};B.addObserver(A),B.reportChanges();let W={dispose(){B.removeObserver(A)}};return L instanceof Ls?L.add(W):Array.isArray(L)&&L.push(W),W}}e.fromObservableLight=I})(ct||(ct={}));var Jh=class ed{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${ed._idPool++}`,ed.all.add(this)}start(t){this._stopWatch=new SM,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Jh.all=new Set,Jh._idPool=0;var bM=Jh,wM=-1,Ib=class qb{constructor(t,i,s=(qb._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[n,a]=this.getMostFrequentStack(),o=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${a}):`;console.warn(o),console.warn(n);let c=new EM(o,n);this._errorHandler(c)}return()=>{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,r]of this._stacks)(!t||i<r)&&(t=[s,r],i=r);return t}};Ib._idPool=1;var CM=Ib,xM=class Fb{constructor(t){this.value=t}static create(){let t=new Error;return new Fb(t.stack??"")}print(){console.warn(this.value.split(`
|
|
237
|
+
`).slice(2).join(`
|
|
238
|
+
`))}},EM=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},AM=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},kM=0,Du=class{constructor(e){this.value=e,this.id=kM++}},DM=2,RM,P=class{constructor(e){var t,i,s,r;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new CM((e==null?void 0:e.onListenerError)??al,((i=this._options)==null?void 0:i.leakWarningThreshold)??wM):void 0,this._perfMon=(s=this._options)!=null&&s._profName?new bM(this._options._profName):void 0,this._deliveryQueue=(r=this._options)==null?void 0:r.deliveryQueue}dispose(){var e,t,i,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||i.call(t),(s=this._leakageMon)==null||s.dispose())}get event(){return this._event??(this._event=(e,t,i)=>{var a,o,c,l,h;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new AM(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(((a=this._options)==null?void 0:a.onListenerError)||al)(f),Z.None}if(this._disposed)return Z.None;t&&(e=e.bind(t));let s=new Du(e),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=xM.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof Du?(this._deliveryQueue??(this._deliveryQueue=new MM),this._listeners=[this._listeners,s]):this._listeners.push(s):((c=(o=this._options)==null?void 0:o.onWillAddFirstListener)==null||c.call(o,this),this._listeners=s,(h=(l=this._options)==null?void 0:l.onDidAddFirstListener)==null||h.call(l,this)),this._size++;let n=Ce(()=>{r==null||r(),this._removeListener(s)});return i instanceof Ls?i.add(n):Array.isArray(i)&&i.push(n),n}),this._event}_removeListener(e){var r,n,a,o;if((n=(r=this._options)==null?void 0:r.onWillRemoveListener)==null||n.call(r,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||o.call(a,this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*DM<=t.length){let c=0;for(let l=0;l<t.length;l++)t[l]?t[c++]=t[l]:s&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=c}}_deliver(e,t){var s;if(!e)return;let i=((s=this._options)==null?void 0:s.onListenerError)||al;if(!i){e.value(t);return}try{e.value(t)}catch(r){i(r)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,i,s,r;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(i=this._perfMon)==null||i.stop()),(s=this._perfMon)==null||s.start(this._size),this._listeners)if(this._listeners instanceof Du)this._deliver(this._listeners,e);else{let n=this._deliveryQueue;n.enqueue(this,e,this._listeners.length),this._deliverQueue(n)}(r=this._perfMon)==null||r.stop()}hasListeners(){return this._size>0}},MM=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},td=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new P,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new P,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};td.INSTANCE=new td;var e_=td;function TM(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}e_.INSTANCE.onDidChangeZoomLevel;function OM(e){return e_.INSTANCE.getZoomFactor(e)}e_.INSTANCE.onDidChangeFullscreen;var Un=typeof navigator=="object"?navigator.userAgent:"",id=Un.indexOf("Firefox")>=0,NM=Un.indexOf("AppleWebKit")>=0,t_=Un.indexOf("Chrome")>=0,BM=!t_&&Un.indexOf("Safari")>=0;Un.indexOf("Electron/")>=0;Un.indexOf("Android")>=0;var Ru=!1;if(typeof Ki.matchMedia=="function"){let e=Ki.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Ki.matchMedia("(display-mode: fullscreen)");Ru=e.matches,TM(Ki,e,({matches:i})=>{Ru&&t.matches||(Ru=i)})}var Jr="en",sd=!1,rd=!1,ol=!1,Kb=!1,Lo,ll=Jr,Mg=Jr,zM,oi,cr=globalThis,at,vp;typeof cr.vscode<"u"&&typeof cr.vscode.process<"u"?at=cr.vscode.process:typeof process<"u"&&typeof((vp=process==null?void 0:process.versions)==null?void 0:vp.node)=="string"&&(at=process);var yp,LM=typeof((yp=at==null?void 0:at.versions)==null?void 0:yp.electron)=="string",HM=LM&&(at==null?void 0:at.type)==="renderer",Sp;if(typeof at=="object"){sd=at.platform==="win32",rd=at.platform==="darwin",ol=at.platform==="linux",ol&&at.env.SNAP&&at.env.SNAP_REVISION,at.env.CI||at.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Lo=Jr,ll=Jr;let e=at.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Lo=t.userLocale,Mg=t.osLocale,ll=t.resolvedLanguage||Jr,zM=(Sp=t.languagePack)==null?void 0:Sp.translationsConfigFile}catch{}Kb=!0}else typeof navigator=="object"&&!HM?(oi=navigator.userAgent,sd=oi.indexOf("Windows")>=0,rd=oi.indexOf("Macintosh")>=0,(oi.indexOf("Macintosh")>=0||oi.indexOf("iPad")>=0||oi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ol=oi.indexOf("Linux")>=0,(oi==null?void 0:oi.indexOf("Mobi"))>=0,ll=globalThis._VSCODE_NLS_LANGUAGE||Jr,Lo=navigator.language.toLowerCase(),Mg=Lo):console.error("Unable to resolve platform.");var Yb=sd,ki=rd,PM=ol,Tg=Kb,Di=oi,us=ll,UM;(e=>{function t(){return us}e.value=t;function i(){return us.length===2?us==="en":us.length>=3?us[0]==="e"&&us[1]==="n"&&us[2]==="-":!1}e.isDefaultVariant=i;function s(){return us==="en"}e.isDefault=s})(UM||(UM={}));var jM=typeof cr.postMessage=="function"&&!cr.importScripts;(()=>{if(jM){let e=[];cr.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),n.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),cr.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var WM=!!(Di&&Di.indexOf("Chrome")>=0);Di&&Di.indexOf("Firefox")>=0;!WM&&Di&&Di.indexOf("Safari")>=0;Di&&Di.indexOf("Edg/")>=0;Di&&Di.indexOf("Android")>=0;var Lr=typeof navigator=="object"?navigator:{};Tg||document.queryCommandSupported&&document.queryCommandSupported("copy")||Lr&&Lr.clipboard&&Lr.clipboard.writeText,Tg||Lr&&Lr.clipboard&&Lr.clipboard.readText;var i_=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Mu=new i_,Og=new i_,Ng=new i_,IM=new Array(230),Vb;(e=>{function t(o){return Mu.keyCodeToStr(o)}e.toString=t;function i(o){return Mu.strToKeyCode(o)}e.fromString=i;function s(o){return Og.keyCodeToStr(o)}e.toUserSettingsUS=s;function r(o){return Ng.keyCodeToStr(o)}e.toUserSettingsGeneral=r;function n(o){return Og.strToKeyCode(o)||Ng.strToKeyCode(o)}e.fromUserSettings=n;function a(o){if(o>=98&&o<=113)return null;switch(o){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Mu.keyCodeToStr(o)}e.toElectronAccelerator=a})(Vb||(Vb={}));var qM=class Gb{constructor(t,i,s,r,n){this.ctrlKey=t,this.shiftKey=i,this.altKey=s,this.metaKey=r,this.keyCode=n}equals(t){return t instanceof Gb&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",s=this.altKey?"1":"0",r=this.metaKey?"1":"0";return`K${t}${i}${s}${r}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new FM([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},FM=class{constructor(e){if(e.length===0)throw mM("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function KM(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return Vb.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(id)switch(t){case 59:return 85;case 60:if(PM)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(ki)return 57;break}else if(NM&&(ki&&t===93||!ki&&t===92))return 57;return IM[t]||0}var YM=ki?256:2048,VM=512,GM=1024,$M=ki?2048:256,Bg=class{constructor(e){var i;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(i=t.getModifierState)==null?void 0:i.call(t,"AltGraph"),this.keyCode=KM(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=YM),this.altKey&&(t|=VM),this.shiftKey&&(t|=GM),this.metaKey&&(t|=$M),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new qM(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},zg=new WeakMap;function XM(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if(t.origin!=="null"&&i.origin!=="null"&&t.origin!==i.origin)return null}catch{return null}return e.parent}var ZM=class{static getSameOriginWindowChain(e){let t=zg.get(e);if(!t){t=[],zg.set(e,t);let i=e,s;do s=XM(i),s?t.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):t.push({window:new WeakRef(i),iframeElement:null}),i=s;while(i)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0,r=this.getSameOriginWindowChain(e);for(let n of r){let a=n.window.deref();if(i+=(a==null?void 0:a.scrollY)??0,s+=(a==null?void 0:a.scrollX)??0,a===t||!n.iframeElement)break;let o=n.iframeElement.getBoundingClientRect();i+=o.top,s+=o.left}return{top:i,left:s}}},Ho=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let i=ZM.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Lg=class{constructor(e,t=0,i=0){var r;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let s=!1;if(t_){let n=navigator.userAgent.match(/Chrome\/(\d+)/);s=(n?parseInt(n[1]):123)<=122}if(e){let n=e,a=e,o=((r=e.view)==null?void 0:r.devicePixelRatio)||1;if(typeof n.wheelDeltaY<"u")s?this.deltaY=n.wheelDeltaY/(120*o):this.deltaY=n.wheelDeltaY/120;else if(typeof a.VERTICAL_AXIS<"u"&&a.axis===a.VERTICAL_AXIS)this.deltaY=-a.detail/3;else if(e.type==="wheel"){let c=e;c.deltaMode===c.DOM_DELTA_LINE?id&&!ki?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof n.wheelDeltaX<"u")BM&&Yb?this.deltaX=-(n.wheelDeltaX/120):s?this.deltaX=n.wheelDeltaX/(120*o):this.deltaX=n.wheelDeltaX/120;else if(typeof a.HORIZONTAL_AXIS<"u"&&a.axis===a.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let c=e;c.deltaMode===c.DOM_DELTA_LINE?id&&!ki?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*o):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},$b=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),QM;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof JM?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ct.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:$b})})(QM||(QM={}));var JM=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?$b:(this._emitter||(this._emitter=new P),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},s_=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Xh("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Xh("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},eT=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new Xh("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=i.setInterval(()=>{e()},t);this.disposable=Ce(()=>{i.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},tT;(e=>{async function t(s){let r,n=await Promise.all(s.map(a=>a.then(o=>o,o=>{r||(r=o)})));if(typeof r<"u")throw r;return n}e.settled=t;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(a){n(a)}})}e.withAsyncBody=i})(tT||(tT={}));var Hg=class Vt{static fromArray(t){return new Vt(i=>{i.emitMany(t)})}static fromPromise(t){return new Vt(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Vt(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new Vt(async i=>{await Promise.all(t.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new P,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await ct.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var i;return(i=this._onReturn)==null||i.call(this),{done:!0,value:void 0}}}}static map(t,i){return new Vt(async s=>{for await(let r of t)s.emitOne(i(r))})}map(t){return Vt.map(this,t)}static filter(t,i){return new Vt(async s=>{for await(let r of t)i(r)&&s.emitOne(r)})}filter(t){return Vt.filter(this,t)}static coalesce(t){return Vt.filter(t,i=>!!i)}coalesce(){return Vt.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return Vt.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Hg.EMPTY=Hg.fromArray([]);var{getWindow:xi,getWindowId:iT,onDidRegisterWindow:sT}=function(){let e=new Map,t={window:Ki,disposables:new Ls};e.set(Ki.vscodeWindowId,t);let i=new P,s=new P,r=new P;function n(a,o){return(typeof a=="number"?e.get(a):void 0)??(o?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(a){if(e.has(a.vscodeWindowId))return Z.None;let o=new Ls,c={window:a,disposables:o.add(new Ls)};return e.set(a.vscodeWindowId,c),o.add(Ce(()=>{e.delete(a.vscodeWindowId),s.fire(a)})),o.add(Y(a,Ze.BEFORE_UNLOAD,()=>{r.fire(a)})),i.fire(c),o},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(a){return a.vscodeWindowId},hasWindow(a){return e.has(a)},getWindowById:n,getWindow(a){var l;let o=a;if((l=o==null?void 0:o.ownerDocument)!=null&&l.defaultView)return o.ownerDocument.defaultView.window;let c=a;return c!=null&&c.view?c.view.window:Ki},getDocument(a){return xi(a).document}}}(),rT=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Y(e,t,i,s){return new rT(e,t,i,s)}var Pg=function(e,t,i,s){return Y(e,t,i,s)},r_,nT=class extends eT{constructor(e){super(),this.defaultTarget=e&&xi(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},Ug=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){al(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let a=e.get(n)??[];for(t.set(n,a),e.set(n,[]),s.set(n,!0);a.length>0;)a.sort(Ug.sort),a.shift().execute();s.set(n,!1)};r_=(n,a,o=0)=>{let c=iT(n),l=new Ug(a,o),h=e.get(c);return h||(h=[],e.set(c,h)),h.push(l),i.get(c)||(i.set(c,!0),n.requestAnimationFrame(()=>r(c))),l}})();function aT(e){let t=e.getBoundingClientRect(),i=xi(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}var Ze={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},oT=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Et(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Et(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Et(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Et(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Et(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Et(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Et(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Et(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Et(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Et(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Et(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Et(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Et(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Et(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Et(e){return typeof e=="number"?`${e}px`:e}function xa(e){return new oT(e)}var Xb=class{constructor(){this._hooks=new Ls,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=r;let n=e;try{e.setPointerCapture(t),this._hooks.add(Ce(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{n=xi(e)}this._hooks.add(Y(n,Ze.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(Y(n,Ze.POINTER_UP,a=>this.stopMonitoring(!0)))}};function lT(e,t,i){let s=null,r=null;if(typeof i.value=="function"?(s="value",r=i.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(s="get",r=i.get),!r)throw new Error("not supported");let n=`$memoize$${t}`;i[s]=function(...a){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,a)}),this[n]}}var vi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(vi||(vi={}));var na=class ft extends Z{constructor(){super(),this.dispatched=!1,this.targets=new Rg,this.ignoreTargets=new Rg,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ct.runAndSubscribe(sT,({window:t,disposables:i})=>{i.add(Y(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(Y(t.document,"touchend",s=>this.onTouchEnd(t,s))),i.add(Y(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:Ki,disposables:this._store}))}static addTarget(t){if(!ft.isTouchDevice())return Z.None;ft.INSTANCE||(ft.INSTANCE=new ft);let i=ft.INSTANCE.targets.push(t);return Ce(i)}static ignoreTarget(t){if(!ft.isTouchDevice())return Z.None;ft.INSTANCE||(ft.INSTANCE=new ft);let i=ft.INSTANCE.ignoreTargets.push(t);return Ce(i)}static isTouchDevice(){return"ontouchstart"in Ki||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let s=0,r=t.targetTouches.length;s<r;s++){let n=t.targetTouches.item(s);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:i,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[i],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};let a=this.newGestureEvent(vi.Start,n.target);a.pageX=n.pageX,a.pageY=n.pageY,this.dispatchEvent(a)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,i){let s=Date.now(),r=Object.keys(this.activeTouches).length;for(let n=0,a=i.changedTouches.length;n<a;n++){let o=i.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("move of an UNKNOWN touch",o);continue}let c=this.activeTouches[o.identifier],l=Date.now()-c.initialTimeStamp;if(l<ft.HOLD_DELAY&&Math.abs(c.initialPageX-Ot(c.rollingPageX))<30&&Math.abs(c.initialPageY-Ot(c.rollingPageY))<30){let h=this.newGestureEvent(vi.Tap,c.initialTarget);h.pageX=Ot(c.rollingPageX),h.pageY=Ot(c.rollingPageY),this.dispatchEvent(h)}else if(l>=ft.HOLD_DELAY&&Math.abs(c.initialPageX-Ot(c.rollingPageX))<30&&Math.abs(c.initialPageY-Ot(c.rollingPageY))<30){let h=this.newGestureEvent(vi.Contextmenu,c.initialTarget);h.pageX=Ot(c.rollingPageX),h.pageY=Ot(c.rollingPageY),this.dispatchEvent(h)}else if(r===1){let h=Ot(c.rollingPageX),u=Ot(c.rollingPageY),d=Ot(c.rollingTimestamps)-c.rollingTimestamps[0],f=h-c.rollingPageX[0],_=u-c.rollingPageY[0],m=[...this.targets].filter(w=>c.initialTarget instanceof Node&&w.contains(c.initialTarget));this.inertia(t,m,s,Math.abs(f)/d,f>0?1:-1,h,Math.abs(_)/d,_>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(vi.End,c.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let s=document.createEvent("CustomEvent");return s.initEvent(t,!1,!0),s.initialTarget=i,s.tapCount=0,s}dispatchEvent(t){if(t.type===vi.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>ft.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,t.tapCount=s}else(t.type===vi.Change||t.type===vi.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(t.initialTarget))return;let i=[];for(let s of this.targets)if(s.contains(t.initialTarget)){let r=0,n=t.initialTarget;for(;n&&n!==s;)r++,n=n.parentElement;i.push([r,s])}i.sort((s,r)=>s[0]-r[0]);for(let[s,r]of i)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,s,r,n,a,o,c,l){this.handle=r_(t,()=>{let h=Date.now(),u=h-s,d=0,f=0,_=!0;r+=ft.SCROLL_FRICTION*u,o+=ft.SCROLL_FRICTION*u,r>0&&(_=!1,d=n*r*u),o>0&&(_=!1,f=c*o*u);let m=this.newGestureEvent(vi.Change);m.translationX=d,m.translationY=f,i.forEach(w=>w.dispatchEvent(m)),_||this.inertia(t,i,h,r,n,a+d,o,c,l+f)})}onTouchMove(t){let i=Date.now();for(let s=0,r=t.changedTouches.length;s<r;s++){let n=t.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}let a=this.activeTouches[n.identifier],o=this.newGestureEvent(vi.Change,a.initialTarget);o.translationX=n.pageX-Ot(a.rollingPageX),o.translationY=n.pageY-Ot(a.rollingPageY),o.pageX=n.pageX,o.pageY=n.pageY,this.dispatchEvent(o),a.rollingPageX.length>3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(n.pageX),a.rollingPageY.push(n.pageY),a.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};na.SCROLL_FRICTION=-.005,na.HOLD_DELAY=700,na.CLEAR_TAP_COUNT_TIME=400,Te([lT],na,"isTouchDevice",1);var cT=na,n_=class extends Z{onclick(e,t){this._register(Y(e,Ze.CLICK,i=>t(new Ho(xi(e),i))))}onmousedown(e,t){this._register(Y(e,Ze.MOUSE_DOWN,i=>t(new Ho(xi(e),i))))}onmouseover(e,t){this._register(Y(e,Ze.MOUSE_OVER,i=>t(new Ho(xi(e),i))))}onmouseleave(e,t){this._register(Y(e,Ze.MOUSE_LEAVE,i=>t(new Ho(xi(e),i))))}onkeydown(e,t){this._register(Y(e,Ze.KEY_DOWN,i=>t(new Bg(i))))}onkeyup(e,t){this._register(Y(e,Ze.KEY_UP,i=>t(new Bg(i))))}oninput(e,t){this._register(Y(e,Ze.INPUT,t))}onblur(e,t){this._register(Y(e,Ze.BLUR,t))}onfocus(e,t){this._register(Y(e,Ze.FOCUS,t))}onchange(e,t){this._register(Y(e,Ze.CHANGE,t))}ignoreGesture(e){return cT.ignoreTarget(e)}},jg=11,uT=class extends n_{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=jg+"px",this.domNode.style.height=jg+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Xb),this._register(Pg(this.bgDomNode,Ze.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Pg(this.domNode,Ze.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new nT),this._pointerdownScheduleRepeatTimer=this._register(new s_)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,xi(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},hT=class nd{constructor(t,i,s,r,n,a,o){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,r=r|0,n=n|0,a=a|0,o=o|0),this.rawScrollLeft=r,this.rawScrollTop=o,i<0&&(i=0),r+i>s&&(r=s-i),r<0&&(r=0),n<0&&(n=0),o+n>a&&(o=a-n),o<0&&(o=0),this.width=i,this.scrollWidth=s,this.scrollLeft=r,this.height=n,this.scrollHeight=a,this.scrollTop=o}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,i){return new nd(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new nd(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,i){let s=this.width!==t.width,r=this.scrollWidth!==t.scrollWidth,n=this.scrollLeft!==t.scrollLeft,a=this.height!==t.height,o=this.scrollHeight!==t.scrollHeight,c=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:i,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:s,scrollWidthChanged:r,scrollLeftChanged:n,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:c}}},dT=class extends Z{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new P),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new hT(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var s;let i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),(s=this._smoothScrolling)==null||s.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new Ig(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=Ig.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},Wg=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function Tu(e,t){let i=t-e;return function(s){return e+i*mT(s)}}function fT(e,t,i){return function(s){return s<i?e(s/i):t((s-i)/(1-i))}}var Ig=class ad{constructor(t,i,s,r){this.from=t,this.to=i,this.duration=r,this.startTime=s,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,i,s){if(Math.abs(t-i)>2.5*s){let r,n;return t<i?(r=t+.75*s,n=i-.75*s):(r=t-.75*s,n=i+.75*s),fT(Tu(t,r),Tu(n,i),.33)}return Tu(t,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let i=(t-this.startTime)/this.duration;if(i<1){let s=this.scrollLeft(i),r=this.scrollTop(i);return new Wg(s,r,!1)}return new Wg(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,s){return ad.start(t,i,s)}static start(t,i,s){s=s+10;let r=Date.now()-10;return new ad(t,i,r,s)}};function _T(e){return Math.pow(e,3)}function mT(e){return 1-_T(1-e)}var gT=class extends Z{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new s_)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},pT=140,Zb=class extends n_{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new gT(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Xb),this._shouldRender=!0,this.domNode=xa(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Y(this.domNode.domNode,Ze.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new uT(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=xa(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Y(this.slider.domNode,Ze.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let r=aT(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}let s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{let n=this._sliderOrthogonalPointerPosition(r),a=Math.abs(n-i);if(Yb&&a>pT){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let o=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Qb=class od{constructor(t,i,s,r,n,a){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(t),this._visibleSize=r,this._scrollSize=n,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new od(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,s,r,n){let a=Math.max(0,s-t),o=Math.max(0,a-2*i),c=r>0&&r>s;if(!c)return{computedAvailableSize:Math.round(a),computedIsNeeded:c,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let l=Math.round(Math.max(20,Math.floor(s*o/r))),h=(o-l)/(r-s),u=n*h;return{computedAvailableSize:Math.round(a),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:h,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=od._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,s=this._scrollPosition;return i<this._computedSliderPosition?s-=this._visibleSize:s+=this._visibleSize,s}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+t;return Math.round(i/this._computedSliderRatio)}},vT=class extends Zb{constructor(e,t,i){let s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Qb(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,s.width,s.scrollWidth,r.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},yT=class extends Zb{constructor(e,t,i){let s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Qb(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},ST=500,qg=50,bT=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},ld=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,i=0,s=1,r=this._rear;do{let n=r===this._front?t:Math.pow(2,-s);if(t-=n,i+=this._memory[r].score*n,r===this._front)break;r=(this._capacity+r-1)%this._capacity,s++}while(!0);return i<=.5}acceptStandardWheelEvent(t){if(t_){let i=xi(t.browserEvent),s=OM(i);this.accept(Date.now(),t.deltaX*s,t.deltaY*s)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,i,s){let r=null,n=new bT(t,i,s);this._front===-1&&this._rear===-1?(this._memory[0]=n,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n),n.score=this._computeScore(n,r)}_computeScore(t,i){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(s+=.25),i){let r=Math.abs(t.deltaX),n=Math.abs(t.deltaY),a=Math.abs(i.deltaX),o=Math.abs(i.deltaY),c=Math.max(Math.min(r,a),1),l=Math.max(Math.min(n,o),1),h=Math.max(r,a),u=Math.max(n,o);h%c===0&&u%l===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};ld.INSTANCE=new ld;var wT=ld,CT=class extends n_{constructor(e,t,i){super(),this._onScroll=this._register(new P),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new P),this.onWillScroll=this._onWillScroll.event,this._options=ET(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));let s={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new yT(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new vT(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=xa(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=xa(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=xa(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new s_),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=vr(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ki&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Lg(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=vr(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new Lg(i))};this._mouseWheelToDispose.push(Y(this._listenOnDomNode,Ze.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var r;if((r=e.browserEvent)!=null&&r.defaultPrevented)return;let t=wT.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let n=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+n===0?a=n=0:Math.abs(n)>=Math.abs(a)?a=0:n=0),this._options.flipAxes&&([n,a]=[a,n]);let o=!ki&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||o)&&!a&&(a=n,n=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,n=n*this._options.fastScrollSensitivity);let c=this._scrollable.getFutureScrollPosition(),l={};if(n){let h=qg*n,u=c.scrollTop-(h<0?Math.floor(h):Math.ceil(h));this._verticalScrollbar.writeScrollPosition(l,u)}if(a){let h=qg*a,u=c.scrollLeft-(h<0?Math.floor(h):Math.ceil(h));this._horizontalScrollbar.writeScrollPosition(l,u)}l=this._scrollable.validateScrollPosition(l),(c.scrollLeft!==l.scrollLeft||c.scrollTop!==l.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",r=t?" top":"",n=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${n}${r}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),ST)}},xT=class extends CT{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function ET(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,ki&&(t.className+=" mac"),t}var cd=class extends Z{constructor(e,t,i,s,r,n,a,o){super(),this._bufferService=i,this._optionsService=a,this._renderService=o,this._onRequestScrollLines=this._register(new P),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new dT({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:l=>r_(s.window,l)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new xT(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(r.onProtocolChange(l=>{this._scrollableElement.updateOptions({handleMouseWheel:!(l&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(ct.runAndSubscribe(n.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=n.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Ce(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Ce(()=>this._styleElement.remove())),this._register(ct.runAndSubscribe(n.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${n.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${n.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${n.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
239
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(l=>this._handleScroll(l)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};cd=Te([j(2,yt),j(3,as),j(4,Ob),j(5,Pn),j(6,St),j(7,os)],cd);var ud=class extends Z{constructor(e,t,i,s,r){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,this._renderService=r,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(n=>this._removeDecoration(n))),this._register(Ce(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var s;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((s=e==null?void 0:e.options)==null?void 0:s.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};ud=Te([j(1,yt),j(2,as),j(3,no),j(4,os)],ud);var AT=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(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},gi={full:0,left:0,center:0,right:0},hs={full:0,left:0,center:0,right:0},Gn={full:0,left:0,center:0,right:0},Gl=class extends Z{constructor(e,t,i,s,r,n,a,o){var l;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=r,this._optionsService=n,this._themeService=a,this._coreBrowserService=o,this._colorZoneStore=new AT,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(),(l=this._viewportElement.parentElement)==null||l.insertBefore(this._canvas,this._viewportElement),this._register(Ce(()=>{var h;return(h=this._canvas)==null?void 0:h.remove()}));let c=this._canvas.getContext("2d");if(c)this._ctx=c;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);hs.full=this._canvas.width,hs.left=e,hs.center=t,hs.right=e,this._refreshDrawHeightConstants(),Gn.full=1,Gn.left=1,Gn.center=1+hs.left,Gn.right=1+hs.left+hs.center}_refreshDrawHeightConstants(){gi.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);gi.left=t,gi.center=t,gi.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gi.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gi.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gi.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gi.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(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Gn[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-gi[e.position||"full"]/2),hs[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+gi[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Gl=Te([j(2,yt),j(3,no),j(4,os),j(5,St),j(6,Pn),j(7,as)],Gl);var T;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
240
|
+
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(T||(T={}));var cl;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(cl||(cl={}));var Jb;(e=>e.ST=`${T.ESC}\\`)(Jb||(Jb={}));var hd=class{constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${T.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let n=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(n.width,1)+"px",this._textarea.style.height=Math.max(n.height,1)+"px",this._textarea.style.lineHeight=n.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};hd=Te([j(2,yt),j(3,St),j(4,Dr),j(5,os)],hd);var Je=0,et=0,tt=0,De=0,Fg={css:"#00000000",rgba:0},Ie;(e=>{function t(r,n,a,o){return o!==void 0?`#${Xs(r)}${Xs(n)}${Xs(a)}${Xs(o)}`:`#${Xs(r)}${Xs(n)}${Xs(a)}`}e.toCss=t;function i(r,n,a,o=255){return(r<<24|n<<16|a<<8|o)>>>0}e.toRgba=i;function s(r,n,a,o){return{css:e.toCss(r,n,a,o),rgba:e.toRgba(r,n,a,o)}}e.toColor=s})(Ie||(Ie={}));var ve;(e=>{function t(c,l){if(De=(l.rgba&255)/255,De===1)return{css:l.css,rgba:l.rgba};let h=l.rgba>>24&255,u=l.rgba>>16&255,d=l.rgba>>8&255,f=c.rgba>>24&255,_=c.rgba>>16&255,m=c.rgba>>8&255;Je=f+Math.round((h-f)*De),et=_+Math.round((u-_)*De),tt=m+Math.round((d-m)*De);let w=Ie.toCss(Je,et,tt),g=Ie.toRgba(Je,et,tt);return{css:w,rgba:g}}e.blend=t;function i(c){return(c.rgba&255)===255}e.isOpaque=i;function s(c,l,h){let u=ul.ensureContrastRatio(c.rgba,l.rgba,h);if(u)return Ie.toColor(u>>24&255,u>>16&255,u>>8&255)}e.ensureContrastRatio=s;function r(c){let l=(c.rgba|255)>>>0;return[Je,et,tt]=ul.toChannels(l),{css:Ie.toCss(Je,et,tt),rgba:l}}e.opaque=r;function n(c,l){return De=Math.round(l*255),[Je,et,tt]=ul.toChannels(c.rgba),{css:Ie.toCss(Je,et,tt,De),rgba:Ie.toRgba(Je,et,tt,De)}}e.opacity=n;function a(c,l){return De=c.rgba&255,n(c,De*l/255)}e.multiplyOpacity=a;function o(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}e.toColorRGB=o})(ve||(ve={}));var Ee;(e=>{let t,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return Je=parseInt(r.slice(1,2).repeat(2),16),et=parseInt(r.slice(2,3).repeat(2),16),tt=parseInt(r.slice(3,4).repeat(2),16),Ie.toColor(Je,et,tt);case 5:return Je=parseInt(r.slice(1,2).repeat(2),16),et=parseInt(r.slice(2,3).repeat(2),16),tt=parseInt(r.slice(3,4).repeat(2),16),De=parseInt(r.slice(4,5).repeat(2),16),Ie.toColor(Je,et,tt,De);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return Je=parseInt(n[1]),et=parseInt(n[2]),tt=parseInt(n[3]),De=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Ie.toColor(Je,et,tt,De);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=r,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Je,et,tt,De]=t.getImageData(0,0,1,1).data,De!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ie.toRgba(Je,et,tt,De),css:r}}e.toColor=s})(Ee||(Ee={}));var mt;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,r,n){let a=s/255,o=r/255,c=n/255,l=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),h=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),u=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return l*.2126+h*.7152+u*.0722}e.relativeLuminance2=i})(mt||(mt={}));var ul;(e=>{function t(a,o){if(De=(o&255)/255,De===1)return o;let c=o>>24&255,l=o>>16&255,h=o>>8&255,u=a>>24&255,d=a>>16&255,f=a>>8&255;return Je=u+Math.round((c-u)*De),et=d+Math.round((l-d)*De),tt=f+Math.round((h-f)*De),Ie.toRgba(Je,et,tt)}e.blend=t;function i(a,o,c){let l=mt.relativeLuminance(a>>8),h=mt.relativeLuminance(o>>8);if(Pi(l,h)<c){if(h<l){let f=s(a,o,c),_=Pi(l,mt.relativeLuminance(f>>8));if(_<c){let m=r(a,o,c),w=Pi(l,mt.relativeLuminance(m>>8));return _>w?f:m}return f}let u=r(a,o,c),d=Pi(l,mt.relativeLuminance(u>>8));if(d<c){let f=s(a,o,c),_=Pi(l,mt.relativeLuminance(f>>8));return d>_?u:f}return u}}e.ensureContrastRatio=i;function s(a,o,c){let l=a>>24&255,h=a>>16&255,u=a>>8&255,d=o>>24&255,f=o>>16&255,_=o>>8&255,m=Pi(mt.relativeLuminance2(d,f,_),mt.relativeLuminance2(l,h,u));for(;m<c&&(d>0||f>0||_>0);)d-=Math.max(0,Math.ceil(d*.1)),f-=Math.max(0,Math.ceil(f*.1)),_-=Math.max(0,Math.ceil(_*.1)),m=Pi(mt.relativeLuminance2(d,f,_),mt.relativeLuminance2(l,h,u));return(d<<24|f<<16|_<<8|255)>>>0}e.reduceLuminance=s;function r(a,o,c){let l=a>>24&255,h=a>>16&255,u=a>>8&255,d=o>>24&255,f=o>>16&255,_=o>>8&255,m=Pi(mt.relativeLuminance2(d,f,_),mt.relativeLuminance2(l,h,u));for(;m<c&&(d<255||f<255||_<255);)d=Math.min(255,d+Math.ceil((255-d)*.1)),f=Math.min(255,f+Math.ceil((255-f)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),m=Pi(mt.relativeLuminance2(d,f,_),mt.relativeLuminance2(l,h,u));return(d<<24|f<<16|_<<8|255)>>>0}e.increaseLuminance=r;function n(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}e.toChannels=n})(ul||(ul={}));function Xs(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Pi(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var kT=class extends ro{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},$l=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new ri}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let i=[],s=t.translateToString(!0),r=0,n=0,a=0,o=t.getFg(0),c=t.getBg(0);for(let l=0;l<t.getTrimmedLength();l++)if(t.loadCell(l,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==o||this._workCell.bg!==c){if(l-r>1){let h=this._getJoinedRanges(s,a,n,t,r);for(let u=0;u<h.length;u++)i.push(h[u])}r=l,a=n,o=this._workCell.fg,c=this._workCell.bg}n+=this._workCell.getChars().length||As.length}if(this._bufferService.cols-r>1){let l=this._getJoinedRanges(s,a,n,t,r);for(let h=0;h<l.length;h++)i.push(l[h])}return i}_getJoinedRanges(e,t,i,s,r){let n=e.substring(t,i),a=[];try{a=this._characterJoiners[0].handler(n)}catch(o){console.error(o)}for(let o=1;o<this._characterJoiners.length;o++)try{let c=this._characterJoiners[o].handler(n);for(let l=0;l<c.length;l++)$l._mergeRanges(a,c[l])}catch(c){console.error(c)}return this._stringRangesToCellRanges(a,s,r),a}_stringRangesToCellRanges(e,t,i){let s=0,r=!1,n=0,a=e[s];if(a){for(let o=i;o<this._bufferService.cols;o++){let c=t.getWidth(o),l=t.getString(o).length||As.length;if(c!==0){if(!r&&a[0]<=n&&(a[0]=o,r=!0),a[1]<=n){if(a[1]=o,a=e[++s],!a)break;a[0]<=n?(a[0]=o,r=!0):r=!1}n+=l}}a&&(a[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let s=0;s<e.length;s++){let r=e[s];if(i){if(t[1]<=r[0])return e[s-1][1]=t[1],e;if(t[1]<=r[1])return e[s-1][1]=Math.max(t[1],r[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=r[0])return e.splice(s,0,t),e;if(t[1]<=r[1])return r[0]=Math.min(t[0],r[0]),e;t[0]<r[1]&&(r[0]=Math.min(t[0],r[0]),i=!0);continue}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};$l=Te([j(0,yt)],$l);function DT(e){return 57508<=e&&e<=57558}function RT(e){return 9472<=e&&e<=9631}function MT(e){return DT(e)||RT(e)}function TT(){return{css:{canvas:Po(),cell:Po()},device:{canvas:Po(),cell:Po(),char:{width:0,height:0,left:0,top:0}}}}function Po(){return{width:0,height:0}}var dd=class{constructor(e,t,i,s,r,n,a){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._themeService=a,this._workCell=new ri,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,s,r,n,a,o,c,l,h){let u=[],d=this._characterJoinerService.getJoinedCharacters(t),f=this._themeService.colors,_=e.getNoBgTrimmedLength();i&&_<n+1&&(_=n+1);let m,w=0,g="",p=0,v=0,y=0,C=0,k=!1,D=0,E=!1,N=0,U=0,I=[],B=l!==-1&&h!==-1;for(let R=0;R<_;R++){e.loadCell(R,this._workCell);let H=this._workCell.getWidth();if(H===0)continue;let L=!1,x=R>=U,O=R,A=this._workCell;if(d.length>0&&R===d[0][0]&&x){let ee=d.shift(),wt=this._isCellInSelection(ee[0],t);for(p=ee[0]+1;p<ee[1];p++)x&&(x=wt===this._isCellInSelection(p,t));x&&(x=!i||n<ee[0]||n>=ee[1]),x?(L=!0,A=new kT(this._workCell,e.translateToString(!0,ee[0],ee[1]),ee[1]-ee[0]),O=ee[1]-1,H=A.getWidth()):U=ee[1]}let W=this._isCellInSelection(R,t),z=i&&R===n,Oe=B&&R>=l&&R<=h,Ne=!1;this._decorationService.forEachDecorationAtCell(R,t,void 0,ee=>{Ne=!0});let Be=A.getChars()||As;if(Be===" "&&(A.isUnderline()||A.isOverline())&&(Be=" "),N=H*o-c.get(Be,A.isBold(),A.isItalic()),!m)m=this._document.createElement("span");else if(w&&(W&&E||!W&&!E&&A.bg===v)&&(W&&E&&f.selectionForeground||A.fg===y)&&A.extended.ext===C&&Oe===k&&N===D&&!z&&!L&&!Ne&&x){A.isInvisible()?g+=As:g+=Be,w++;continue}else w&&(m.textContent=g),m=this._document.createElement("span"),w=0,g="";if(v=A.bg,y=A.fg,C=A.extended.ext,k=Oe,D=N,E=W,L&&n>=R&&n<=O&&(n=R),!this._coreService.isCursorHidden&&z&&this._coreService.isCursorInitialized){if(I.push("xterm-cursor"),this._coreBrowserService.isFocused)a&&I.push("xterm-cursor-blink"),I.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(r)switch(r){case"outline":I.push("xterm-cursor-outline");break;case"block":I.push("xterm-cursor-block");break;case"bar":I.push("xterm-cursor-bar");break;case"underline":I.push("xterm-cursor-underline");break}}if(A.isBold()&&I.push("xterm-bold"),A.isItalic()&&I.push("xterm-italic"),A.isDim()&&I.push("xterm-dim"),A.isInvisible()?g=As:g=A.getChars()||As,A.isUnderline()&&(I.push(`xterm-underline-${A.extended.underlineStyle}`),g===" "&&(g=" "),!A.isUnderlineColorDefault()))if(A.isUnderlineColorRGB())m.style.textDecorationColor=`rgb(${ro.toColorRGB(A.getUnderlineColor()).join(",")})`;else{let ee=A.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&A.isBold()&&ee<8&&(ee+=8),m.style.textDecorationColor=f.ansi[ee].css}A.isOverline()&&(I.push("xterm-overline"),g===" "&&(g=" ")),A.isStrikethrough()&&I.push("xterm-strikethrough"),Oe&&(m.style.textDecoration="underline");let ue=A.getFgColor(),se=A.getFgColorMode(),ae=A.getBgColor(),bt=A.getBgColorMode(),Oi=!!A.isInverse();if(Oi){let ee=ue;ue=ae,ae=ee;let wt=se;se=bt,bt=wt}let oe,fi,Tt=!1;this._decorationService.forEachDecorationAtCell(R,t,void 0,ee=>{ee.options.layer!=="top"&&Tt||(ee.backgroundColorRGB&&(bt=50331648,ae=ee.backgroundColorRGB.rgba>>8&16777215,oe=ee.backgroundColorRGB),ee.foregroundColorRGB&&(se=50331648,ue=ee.foregroundColorRGB.rgba>>8&16777215,fi=ee.foregroundColorRGB),Tt=ee.options.layer==="top")}),!Tt&&W&&(oe=this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque,ae=oe.rgba>>8&16777215,bt=50331648,Tt=!0,f.selectionForeground&&(se=50331648,ue=f.selectionForeground.rgba>>8&16777215,fi=f.selectionForeground)),Tt&&I.push("xterm-decoration-top");let dt;switch(bt){case 16777216:case 33554432:dt=f.ansi[ae],I.push(`xterm-bg-${ae}`);break;case 50331648:dt=Ie.toColor(ae>>16,ae>>8&255,ae&255),this._addStyle(m,`background-color:#${Kg((ae>>>0).toString(16),"0",6)}`);break;case 0:default:Oi?(dt=f.foreground,I.push("xterm-bg-257")):dt=f.background}switch(oe||A.isDim()&&(oe=ve.multiplyOpacity(dt,.5)),se){case 16777216:case 33554432:A.isBold()&&ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ue+=8),this._applyMinimumContrast(m,dt,f.ansi[ue],A,oe,void 0)||I.push(`xterm-fg-${ue}`);break;case 50331648:let ee=Ie.toColor(ue>>16&255,ue>>8&255,ue&255);this._applyMinimumContrast(m,dt,ee,A,oe,fi)||this._addStyle(m,`color:#${Kg(ue.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(m,dt,f.foreground,A,oe,fi)||Oi&&I.push("xterm-fg-257")}I.length&&(m.className=I.join(" "),I.length=0),!z&&!L&&!Ne&&x?w++:m.textContent=g,N!==this.defaultSpacing&&(m.style.letterSpacing=`${N}px`),u.push(m),R=O}return m&&w&&(m.textContent=g),u}_applyMinimumContrast(e,t,i,s,r,n){if(this._optionsService.rawOptions.minimumContrastRatio===1||MT(s.getCode()))return!1;let a=this._getContrastCache(s),o;if(!r&&!n&&(o=a.getColor(t.rgba,i.rgba)),o===void 0){let c=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);o=ve.ensureContrastRatio(r||t,n||i,c),a.setColor((r||t).rgba,(n||i).rgba,o??null)}return o?(this._addStyle(e,`color:${o.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let i=this._selectionStart,s=this._selectionEnd;return!i||!s?!1:this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e<s[0]&&t<=s[1]:e<i[0]&&t>=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t<s[1]||i[1]===s[1]&&t===i[1]&&e>=i[0]&&e<s[0]||i[1]<s[1]&&t===s[1]&&e<s[0]||i[1]<s[1]&&t===i[1]&&e>=i[0]}};dd=Te([j(1,zb),j(2,St),j(3,as),j(4,Dr),j(5,no),j(6,Pn)],dd);function Kg(e,t,i){for(;e.length<i;)e=t+e;return e}var OT=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.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";let i=e.createElement("span");i.classList.add("xterm-char-measure-element");let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontStyle="italic";let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold",n.style.fontStyle="italic",this._measureElements=[i,s,r,n],this._container.appendChild(i),this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(n),t.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(e,t,i,s){e===this._font&&t===this._fontSize&&i===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,i){let s=0;if(!t&&!i&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let a=this._measure(e,0);return a>0&&(this._flat[s]=a),a}let r=e;t&&(r+="B"),i&&(r+="I");let n=this._holey.get(r);if(n===void 0){let a=0;t&&(a|=1),i&&(a|=2),n=this._measure(e,a),n>0&&this._holey.set(r,n)}return n}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},NT=class{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(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let r=e.buffers.active.ydisp,n=t[1]-r,a=i[1]-r,o=Math.max(n,0),c=Math.min(a,e.rows-1);if(o>=e.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,this.viewportEndRow=a,this.viewportCappedStartRow=o,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};function BT(){return new NT}var Ou="xterm-dom-renderer-owner-",Yt="xterm-rows",Uo="xterm-fg-",Yg="xterm-bg-",$n="xterm-focus",jo="xterm-selection",zT=1,fd=class extends Z{constructor(e,t,i,s,r,n,a,o,c,l,h,u,d,f){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=s,this._viewportElement=r,this._helperContainer=n,this._linkifier2=a,this._charSizeService=c,this._optionsService=l,this._bufferService=h,this._coreService=u,this._coreBrowserService=d,this._themeService=f,this._terminalClass=zT++,this._rowElements=[],this._selectionRenderModel=BT(),this.onRequestRedraw=this._register(new P).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Yt),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(jo),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=TT(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(_=>this._injectCss(_))),this._injectCss(this._themeService.colors),this._rowFactory=o.createInstance(dd,document),this._element.classList.add(Ou+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(_=>this._handleLinkHover(_))),this._register(this._linkifier2.onHideLinkUnderline(_=>this._handleLinkLeave(_))),this._register(Ce(()=>{this._element.classList.remove(Ou+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new OT(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Yt} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Yt} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Yt} .xterm-dim { color: ${ve.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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;}`;let i=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,r=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${r} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Yt}.${$n} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Yt}.${$n} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Yt}.${$n} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Yt} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Yt} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Yt} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Yt} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Yt} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${jo} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${jo} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${jo} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,a]of e.ansi.entries())t+=`${this._terminalSelector} .${Uo}${n} { color: ${a.css}; }${this._terminalSelector} .${Uo}${n}.xterm-dim { color: ${ve.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${Yg}${n} { background-color: ${a.css}; }`;t+=`${this._terminalSelector} .${Uo}257 { color: ${ve.opaque(e.background).css}; }${this._terminalSelector} .${Uo}257.xterm-dim { color: ${ve.multiplyOpacity(ve.opaque(e.background),.5).css}; }${this._terminalSelector} .${Yg}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let i=this._rowElements.length;i<=t;i++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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($n),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add($n),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,r=this._selectionRenderModel.viewportEndRow,n=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,o=this._document.createDocumentFragment();if(i){let c=e[0]>t[0];o.appendChild(this._createSelectionElement(n,c?t[0]:e[0],c?e[0]:t[0],a-n+1))}else{let c=s===n?e[0]:0,l=n===r?t[0]:this._bufferService.cols;o.appendChild(this._createSelectionElement(n,c,l));let h=a-n-1;if(o.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,h)),n!==a){let u=r===a?t[0]:this._bufferService.cols;o.appendChild(this._createSelectionElement(a,0,u))}}this._selectionContainer.appendChild(o)}_createSelectionElement(e,t,i,s=1){let r=this._document.createElement("div"),n=t*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(i-t);return n+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-n),r.style.height=`${s*this.dimensions.css.cell.height}px`,r.style.top=`${e*this.dimensions.css.cell.height}px`,r.style.left=`${n}px`,r.style.width=`${a}px`,r}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let i=this._bufferService.buffer,s=i.ybase+i.y,r=Math.min(i.x,this._bufferService.cols-1),n=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,o=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let l=c+i.ydisp,h=this._rowElements[c],u=i.lines.get(l);if(!h||!u)break;h.replaceChildren(...this._rowFactory.createRow(u,l,l===s,a,o,r,n,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Ou}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,s,r,n){i<0&&(e=0),s<0&&(t=0);let a=this._bufferService.rows-1;i=Math.max(Math.min(i,a),0),s=Math.max(Math.min(s,a),0),r=Math.min(r,this._bufferService.cols);let o=this._bufferService.buffer,c=o.ybase+o.y,l=Math.min(o.x,r-1),h=this._optionsService.rawOptions.cursorBlink,u=this._optionsService.rawOptions.cursorStyle,d=this._optionsService.rawOptions.cursorInactiveStyle;for(let f=i;f<=s;++f){let _=f+o.ydisp,m=this._rowElements[f],w=o.lines.get(_);if(!m||!w)break;m.replaceChildren(...this._rowFactory.createRow(w,_,_===c,u,d,l,h,this.dimensions.css.cell.width,this._widthCache,n?f===i?e:0:-1,n?(f===s?t:r)-1:-1))}}};fd=Te([j(7,Qf),j(8,Rc),j(9,St),j(10,yt),j(11,Dr),j(12,as),j(13,Pn)],fd);var _d=class extends Z{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new P),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new HT(this._optionsService))}catch{this._measureStrategy=this._register(new LT(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};_d=Te([j(2,St)],_d);var e1=class extends Z{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},LT=class extends e1{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,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}},HT=class extends e1{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},PT=class extends Z{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new UT(this._window)),this._onDprChange=this._register(new P),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new P),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(ct.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Y(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Y(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,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}},UT=class extends Z{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new An),this._onDprChange=this._register(new P),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Ce(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Y(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.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)}},jT=class extends Z{constructor(){super(),this.linkProviders=[],this._register(Ce(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function a_(e,t,i){let s=i.getBoundingClientRect(),r=e.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),a=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-s.left-n,t.clientY-s.top-a]}function WT(e,t,i,s,r,n,a,o,c){if(!n)return;let l=a_(e,t,i);if(l)return l[0]=Math.ceil((l[0]+(c?a/2:0))/a),l[1]=Math.ceil(l[1]/o),l[0]=Math.min(Math.max(l[0],1),s+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),r),l}var md=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,r){return WT(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,t){let i=a_(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};md=Te([j(0,os),j(1,Rc)],md);var IT=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},t1={};QR(t1,{getSafariVersion:()=>FT,isChromeOS:()=>n1,isFirefox:()=>i1,isIpad:()=>KT,isIphone:()=>YT,isLegacyEdge:()=>qT,isLinux:()=>o_,isMac:()=>Xl,isNode:()=>Mc,isSafari:()=>s1,isWindows:()=>r1});var Mc=typeof process<"u"&&"title"in process,ao=Mc?"node":navigator.userAgent,oo=Mc?"node":navigator.platform,i1=ao.includes("Firefox"),qT=ao.includes("Edge"),s1=/^((?!chrome|android).)*safari/i.test(ao);function FT(){if(!s1)return 0;let e=ao.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Xl=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(oo),KT=oo==="iPad",YT=oo==="iPhone",r1=["Windows","Win16","Win32","WinCE"].includes(oo),o_=oo.indexOf("Linux")>=0,n1=/\bCrOS\b/.test(ao),a1=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),r=e.timeRemaining(),i*1.5>r){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=r}this.clear()}},VT=class extends a1{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},GT=class extends a1{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Zl=!Mc&&"requestIdleCallback"in window?GT:VT,$T=class{constructor(){this._queue=new Zl}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},gd=class extends Z{constructor(e,t,i,s,r,n,a,o,c){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=s,this._coreService=r,this._coreBrowserService=o,this._renderer=this._register(new An),this._pausedResizeTask=new $T,this._observerDisposable=this._register(new An),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 P),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new P),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new P),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new P),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new IT((l,h)=>this._renderRows(l,h),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new XT(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Ce(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.buffers.onBufferActivate(()=>{var l;return(l=this._renderer.value)==null?void 0:l.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(n.onDecorationRegistered(()=>this._fullRefresh())),this._register(n.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(l=>this._registerIntersectionObserver(l,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let i=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=Ce(()=>i.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.end)),i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var i;return(i=this._renderer.value)==null?void 0:i.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,i){var s;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,(s=this._renderer.value)==null||s.handleSelectionChanged(e,t,i)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};gd=Te([j(2,St),j(3,Rc),j(4,Dr),j(5,no),j(6,yt),j(7,as),j(8,Pn)],gd);var XT=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function ZT(e,t,i,s){let r=i.buffer.x,n=i.buffer.y;if(!i.buffer.hasScrollback)return e3(r,n,e,t,i,s)+Tc(n,t,i,s)+t3(r,n,e,t,i,s);let a;if(n===t)return a=r>e?"D":"C",Wa(Math.abs(r-e),ja(a,s));a=n>t?"D":"C";let o=Math.abs(n-t),c=JT(n>t?e:r,i)+(o-1)*i.cols+1+QT(n>t?r:e);return Wa(c,ja(a,s))}function QT(e,t){return e-1}function JT(e,t){return t.cols-e}function e3(e,t,i,s,r,n){return Tc(t,s,r,n).length===0?"":Wa(l1(e,t,e,t-yr(t,r),!1,r).length,ja("D",n))}function Tc(e,t,i,s){let r=e-yr(e,i),n=t-yr(t,i),a=Math.abs(r-n)-i3(e,t,i);return Wa(a,ja(o1(e,t),s))}function t3(e,t,i,s,r,n){let a;Tc(t,s,r,n).length>0?a=s-yr(s,r):a=t;let o=s,c=s3(e,t,i,s,r,n);return Wa(l1(e,a,i,o,c==="C",r).length,ja(c,n))}function i3(e,t,i){var a;let s=0,r=e-yr(e,i),n=t-yr(t,i);for(let o=0;o<Math.abs(r-n);o++){let c=o1(e,t)==="A"?-1:1;(a=i.buffer.lines.get(r+c*o))!=null&&a.isWrapped&&s++}return s}function yr(e,t){let i=0,s=t.buffer.lines.get(e),r=s==null?void 0:s.isWrapped;for(;r&&e>=0&&e<t.rows;)i++,s=t.buffer.lines.get(--e),r=s==null?void 0:s.isWrapped;return i}function s3(e,t,i,s,r,n){let a;return Tc(i,s,r,n).length>0?a=s-yr(s,r):a=t,e<i&&a<=s||e>=i&&a<s?"C":"D"}function o1(e,t){return e>t?"A":"B"}function l1(e,t,i,s,r,n){let a=e,o=t,c="";for(;(a!==i||o!==s)&&o>=0&&o<n.buffer.lines.length;)a+=r?1:-1,r&&a>n.cols-1?(c+=n.buffer.translateBufferLineToString(o,!1,e,a),a=0,e=0,o++):!r&&a<0&&(c+=n.buffer.translateBufferLineToString(o,!1,0,e+1),a=n.cols-1,e=a,o--);return c+n.buffer.translateBufferLineToString(o,!1,e,a)}function ja(e,t){let i=t?"O":"[";return T.ESC+i+e}function Wa(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}var r3=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function Vg(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Nu=50,n3=15,a3=50,o3=500,l3=" ",c3=new RegExp(l3,"g"),pd=class extends Z{constructor(e,t,i,s,r,n,a,o,c){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=r,this._mouseService=n,this._optionsService=a,this._renderService=o,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new ri,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new P),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new P),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new P),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new P),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=l=>this._handleMouseMove(l),this._mouseUpListener=l=>this._handleMouseUp(l),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(l=>this._handleTrim(l)),this._register(this._bufferService.buffers.onBufferActivate(l=>this._handleBufferActivate(l))),this.enable(),this._model=new r3(this._bufferService),this._activeSelectionMode=0,this._register(Ce(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(l=>{l.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let i=this._bufferService.buffer,s=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let r=e[0]<t[0]?e[0]:t[0],n=e[0]<t[0]?t[0]:e[0];for(let a=e[1];a<=t[1];a++){let o=i.translateBufferLineToString(a,!0,r,n);s.push(o)}}else{let r=e[1]===t[1]?t[0]:void 0;s.push(i.translateBufferLineToString(e[1],!0,e[0],r));for(let n=e[1]+1;n<=t[1]-1;n++){let a=i.lines.get(n),o=i.translateBufferLineToString(n,!0);a!=null&&a.isWrapped?s[s.length-1]+=o:s.push(o)}if(e[1]!==t[1]){let n=i.lines.get(t[1]),a=i.translateBufferLineToString(t[1],!0,0,t[0]);n&&n.isWrapped?s[s.length-1]+=a:s.push(a)}}return s.map(r=>r.replace(c3," ")).join(r1?`\r
|
|
241
|
+
`:`
|
|
242
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),o_&&e&&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(e){let t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s||!t?!1:this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s?!1:this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var r,n;let i=(n=(r=this._linkifier.currentLink)==null?void 0:r.link)==null?void 0:n.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=Vg(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=a_(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-Nu),Nu),t/=Nu,t/Math.abs(t)+Math.round(t*(n3-1)))}shouldForceSelection(e){return Xl?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),a3)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Xl&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let s=i.lines.get(this._model.selectionEnd[1]);s&&s.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<o3&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&i[0]!==void 0&&i[1]!==void 0){let s=ZT(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!i){this._oldHasSelection&&this._fireOnSelectionChange(e,t,i);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){let r=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:r>1&&t!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;let a=r.translateBufferLineToString(e[1],!1),o=this._convertViewportColToCharacterIndex(n,e[0]),c=o,l=e[0]-o,h=0,u=0,d=0,f=0;if(a.charAt(o)===" "){for(;o>0&&a.charAt(o-1)===" ";)o--;for(;c<a.length&&a.charAt(c+1)===" ";)c++}else{let w=e[0],g=e[0];n.getWidth(w)===0&&(h++,w--),n.getWidth(g)===2&&(u++,g++);let p=n.getString(g).length;for(p>1&&(f+=p-1,c+=p-1);w>0&&o>0&&!this._isCharWordSeparator(n.loadCell(w-1,this._workCell));){n.loadCell(w-1,this._workCell);let v=this._workCell.getChars().length;this._workCell.getWidth()===0?(h++,w--):v>1&&(d+=v-1,o-=v-1),o--,w--}for(;g<n.length&&c+1<a.length&&!this._isCharWordSeparator(n.loadCell(g+1,this._workCell));){n.loadCell(g+1,this._workCell);let v=this._workCell.getChars().length;this._workCell.getWidth()===2?(u++,g++):v>1&&(f+=v-1,c+=v-1),c++,g++}}c++;let _=o+l-h+d,m=Math.min(this._bufferService.cols,c-o+h+u-d-f);if(!(!t&&a.slice(o,c).trim()==="")){if(i&&_===0&&n.getCodePoint(0)!==32){let w=r.lines.get(e[1]-1);if(w&&n.isWrapped&&w.getCodePoint(this._bufferService.cols-1)!==32){let g=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(g){let p=this._bufferService.cols-g.start;_-=p,m+=p}}}if(s&&_+m===this._bufferService.cols&&n.getCodePoint(this._bufferService.cols-1)!==32){let w=r.lines.get(e[1]+1);if(w!=null&&w.isWrapped&&w.getCodePoint(0)!==32){let g=this._getWordAt([0,e[1]+1],!1,!1,!0);g&&(m+=g.length)}}return{start:_,length:m}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Vg(i,this._bufferService.cols)}};pd=Te([j(3,yt),j(4,Dr),j(5,Jf),j(6,St),j(7,os),j(8,as)],pd);var Gg=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},$g=class{constructor(){this._color=new Gg,this._css=new Gg}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},Ke=Object.freeze((()=>{let e=[Ee.toColor("#2e3436"),Ee.toColor("#cc0000"),Ee.toColor("#4e9a06"),Ee.toColor("#c4a000"),Ee.toColor("#3465a4"),Ee.toColor("#75507b"),Ee.toColor("#06989a"),Ee.toColor("#d3d7cf"),Ee.toColor("#555753"),Ee.toColor("#ef2929"),Ee.toColor("#8ae234"),Ee.toColor("#fce94f"),Ee.toColor("#729fcf"),Ee.toColor("#ad7fa8"),Ee.toColor("#34e2e2"),Ee.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let s=t[i/36%6|0],r=t[i/6%6|0],n=t[i%6];e.push({css:Ie.toCss(s,r,n),rgba:Ie.toRgba(s,r,n)})}for(let i=0;i<24;i++){let s=8+i*10;e.push({css:Ie.toCss(s,s,s),rgba:Ie.toRgba(s,s,s)})}return e})()),tr=Ee.toColor("#ffffff"),aa=Ee.toColor("#000000"),Xg=Ee.toColor("#ffffff"),Zg=aa,Xn={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},u3=tr,vd=class extends Z{constructor(e){super(),this._optionsService=e,this._contrastCache=new $g,this._halfContrastCache=new $g,this._onChangeColors=this._register(new P),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:tr,background:aa,cursor:Xg,cursorAccent:Zg,selectionForeground:void 0,selectionBackgroundTransparent:Xn,selectionBackgroundOpaque:ve.blend(aa,Xn),selectionInactiveBackgroundTransparent:Xn,selectionInactiveBackgroundOpaque:ve.blend(aa,Xn),scrollbarSliderBackground:ve.opacity(tr,.2),scrollbarSliderHoverBackground:ve.opacity(tr,.4),scrollbarSliderActiveBackground:ve.opacity(tr,.5),overviewRulerBorder:tr,ansi:Ke.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)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=he(e.foreground,tr),t.background=he(e.background,aa),t.cursor=ve.blend(t.background,he(e.cursor,Xg)),t.cursorAccent=ve.blend(t.background,he(e.cursorAccent,Zg)),t.selectionBackgroundTransparent=he(e.selectionBackground,Xn),t.selectionBackgroundOpaque=ve.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=he(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=ve.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?he(e.selectionForeground,Fg):void 0,t.selectionForeground===Fg&&(t.selectionForeground=void 0),ve.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=ve.opacity(t.selectionBackgroundTransparent,.3)),ve.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=ve.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=he(e.scrollbarSliderBackground,ve.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=he(e.scrollbarSliderHoverBackground,ve.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=he(e.scrollbarSliderActiveBackground,ve.opacity(t.foreground,.5)),t.overviewRulerBorder=he(e.overviewRulerBorder,u3),t.ansi=Ke.slice(),t.ansi[0]=he(e.black,Ke[0]),t.ansi[1]=he(e.red,Ke[1]),t.ansi[2]=he(e.green,Ke[2]),t.ansi[3]=he(e.yellow,Ke[3]),t.ansi[4]=he(e.blue,Ke[4]),t.ansi[5]=he(e.magenta,Ke[5]),t.ansi[6]=he(e.cyan,Ke[6]),t.ansi[7]=he(e.white,Ke[7]),t.ansi[8]=he(e.brightBlack,Ke[8]),t.ansi[9]=he(e.brightRed,Ke[9]),t.ansi[10]=he(e.brightGreen,Ke[10]),t.ansi[11]=he(e.brightYellow,Ke[11]),t.ansi[12]=he(e.brightBlue,Ke[12]),t.ansi[13]=he(e.brightMagenta,Ke[13]),t.ansi[14]=he(e.brightCyan,Ke[14]),t.ansi[15]=he(e.brightWhite,Ke[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<i;s++)t.ansi[s+16]=he(e.extendedAnsi[s],Ke[s+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){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}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]}}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()}}};vd=Te([j(0,St)],vd);function he(e,t){if(e!==void 0)try{return Ee.toColor(e)}catch{}return t}var h3=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(let[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},d3=class{constructor(){this._services=new h3,this._services.set(Qf,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=nM(e).sort((n,a)=>n.index-a.index),s=[];for(let n of i){let a=this._services.get(n.id);if(!a)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${n.id._id}.`);s.push(a)}let r=i.length>0?i[0].index:t.length;if(t.length!==r)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);return new e(...t,...s)}},f3={trace:0,debug:1,info:2,warn:3,error:4,off:5},_3="xterm.js: ",yd=class extends Z{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=f3[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":_3)+t,...i)}trace(e,...t){var i;this._logLevel<=0&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var i;this._logLevel<=1&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var i;this._logLevel<=2&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var i;this._logLevel<=3&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var i;this._logLevel<=4&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,e,t)}};yd=Te([j(0,St)],yd);var Qg=class extends Z{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new P),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new P),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new P),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,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(e,t,...i){if(t){for(let s=e;s<this._length-t;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<i.length;s++)this._array[this._getCyclicIndex(e+s)]=i[s];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));let s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+i,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},$=3,Pe=Object.freeze(new ro),Wo=0,Bu=2,oa=class c1{constructor(t,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*$);let r=i||ri.fromCharData([0,Db,1,0]);for(let n=0;n<t;++n)this.setCell(n,r);this.length=t}get(t){let i=this._data[t*$+0],s=i&2097151;return[this._data[t*$+1],i&2097152?this._combined[t]:s?gs(s):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*$+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*$+0]=t|2097152|i[2]<<22):this._data[t*$+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*$+0]>>22}hasWidth(t){return this._data[t*$+0]&12582912}getFg(t){return this._data[t*$+1]}getBg(t){return this._data[t*$+2]}hasContent(t){return this._data[t*$+0]&4194303}getCodePoint(t){let i=this._data[t*$+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*$+0]&2097152}getString(t){let i=this._data[t*$+0];return i&2097152?this._combined[t]:i&2097151?gs(i&2097151):""}isProtected(t){return this._data[t*$+2]&536870912}loadCell(t,i){return Wo=t*$,i.content=this._data[Wo+0],i.fg=this._data[Wo+1],i.bg=this._data[Wo+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*$+0]=i.content,this._data[t*$+1]=i.fg,this._data[t*$+2]=i.bg}setCellFromCodepoint(t,i,s,r){r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*$+0]=i|s<<22,this._data[t*$+1]=r.fg,this._data[t*$+2]=r.bg}addCodepointToCell(t,i,s){let r=this._data[t*$+0];r&2097152?this._combined[t]+=gs(i):r&2097151?(this._combined[t]=gs(r&2097151)+gs(i),r&=-2097152,r|=2097152):r=i|1<<22,s&&(r&=-12582913,r|=s<<22),this._data[t*$+0]=r}insertCells(t,i,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length-t){let r=new ri;for(let n=this.length-t-i-1;n>=0;--n)this.setCell(t+i+n,this.loadCell(t+n,r));for(let n=0;n<i;++n)this.setCell(t+n,s)}else for(let r=t;r<this.length;++r)this.setCell(r,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(t,i,s){if(t%=this.length,i<this.length-t){let r=new ri;for(let n=0;n<this.length-t-i;++n)this.setCell(t+n,this.loadCell(t+i+n,r));for(let n=this.length-i;n<this.length;++n)this.setCell(n,s)}else for(let r=t;r<this.length;++r)this.setCell(r,s);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,s)}replaceCells(t,i,s,r=!1){if(r){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,s),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.setCell(t++,s)}resize(t,i){if(t===this.length)return this._data.length*4*Bu<this._data.buffer.byteLength;let s=t*$;if(t>this.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let r=new Uint32Array(s);r.set(this._data),this._data=r}for(let r=this.length;r<t;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,s);let r=Object.keys(this._combined);for(let a=0;a<r.length;a++){let o=parseInt(r[a],10);o>=t&&delete this._combined[o]}let n=Object.keys(this._extendedAttrs);for(let a=0;a<n.length;a++){let o=parseInt(n[a],10);o>=t&&delete this._extendedAttrs[o]}}return this.length=t,s*4*Bu<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Bu<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i){for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,t);return}this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(let i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){let t=new c1(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let i in this._combined)t._combined[i]=this._combined[i];for(let i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*$+0]&4194303)return t+(this._data[t*$+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*$+0]&4194303||this._data[t*$+2]&50331648)return t+(this._data[t*$+0]>>22);return 0}copyCellsFrom(t,i,s,r,n){let a=t._data;if(n)for(let c=r-1;c>=0;c--){for(let l=0;l<$;l++)this._data[(s+c)*$+l]=a[(i+c)*$+l];a[(i+c)*$+2]&268435456&&(this._extendedAttrs[s+c]=t._extendedAttrs[i+c])}else for(let c=0;c<r;c++){for(let l=0;l<$;l++)this._data[(s+c)*$+l]=a[(i+c)*$+l];a[(i+c)*$+2]&268435456&&(this._extendedAttrs[s+c]=t._extendedAttrs[i+c])}let o=Object.keys(t._combined);for(let c=0;c<o.length;c++){let l=parseInt(o[c],10);l>=i&&(this._combined[l-i+s]=t._combined[l])}}translateToString(t,i,s,r){i=i??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),r&&(r.length=0);let n="";for(;i<s;){let a=this._data[i*$+0],o=a&2097151,c=a&2097152?this._combined[i]:o?gs(o):As;if(n+=c,r)for(let l=0;l<c.length;++l)r.push(i);i+=a>>22||1}return r&&r.push(i),n}};function m3(e,t,i,s,r,n){let a=[];for(let o=0;o<e.length-1;o++){let c=o,l=e.get(++c);if(!l.isWrapped)continue;let h=[e.get(o)];for(;c<e.length&&l.isWrapped;)h.push(l),l=e.get(++c);if(!n&&s>=o&&s<c){o+=h.length-1;continue}let u=0,d=Ia(h,u,t),f=1,_=0;for(;f<h.length;){let w=Ia(h,f,t),g=w-_,p=i-d,v=Math.min(g,p);h[u].copyCellsFrom(h[f],_,d,v,!1),d+=v,d===i&&(u++,d=0),_+=v,_===w&&(f++,_=0),d===0&&u!==0&&h[u-1].getWidth(i-1)===2&&(h[u].copyCellsFrom(h[u-1],i-1,d++,1,!1),h[u-1].setCell(i-1,r))}h[u].replaceCells(d,i,r);let m=0;for(let w=h.length-1;w>0&&(w>u||h[w].getTrimmedLength()===0);w--)m++;m>0&&(a.push(o+h.length-m),a.push(m)),o+=h.length-1}return a}function g3(e,t){let i=[],s=0,r=t[s],n=0;for(let a=0;a<e.length;a++)if(r===a){let o=t[++s];e.onDeleteEmitter.fire({index:a-n,amount:o}),a+=o-1,n+=o,r=t[++s]}else i.push(a);return{layout:i,countRemoved:n}}function p3(e,t){let i=[];for(let s=0;s<t.length;s++)i.push(e.get(t[s]));for(let s=0;s<i.length;s++)e.set(s,i[s]);e.length=t.length}function v3(e,t,i){let s=[],r=e.map((c,l)=>Ia(e,l,t)).reduce((c,l)=>c+l),n=0,a=0,o=0;for(;o<r;){if(r-o<i){s.push(r-o);break}n+=i;let c=Ia(e,a,t);n>c&&(n-=c,a++);let l=e[a].getWidth(n-1)===2;l&&n--;let h=l?i-1:i;s.push(h),o+=h}return s}function Ia(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,r=e[t+1].getWidth(0)===2;return s&&r?i-1:i}var u1=class h1{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=h1._nextId++,this._onDispose=this.register(new P),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),vr(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};u1._nextId=1;var y3=u1,$e={},ir=$e.B;$e[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:"≥","{":"π","|":"≠","}":"£","~":"·"};$e.A={"#":"£"};$e.B=void 0;$e[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};$e.C=$e[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};$e.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};$e.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};$e.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};$e.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};$e.E=$e[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};$e.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};$e.H=$e[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};$e["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Jg=4294967295,ep=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Pe.clone(),this.savedCharset=ir,this.markers=[],this._nullCell=ri.fromCharData([0,Db,1,0]),this._whitespaceCell=ri.fromCharData([0,As,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Zl,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new Qg(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Vl),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Vl),this._whitespaceCell}getBlankLine(e,t){return new oa(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>Jg?Jg:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Pe);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new Qg(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(Pe),s=0,r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols<e)for(let a=0;a<this.lines.length;a++)s+=+this.lines.get(a).resize(e,i);let n=0;if(this._rows<t)for(let a=this._rows;a<t;a++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new oa(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new oa(e,i)));else for(let a=this._rows;a>t;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){let a=this.lines.length-r;a>0&&(this.lines.trimStart(a),this.ybase=Math.max(this.ybase-a,0),this.ydisp=Math.max(this.ydisp-a,0),this.savedY=Math.max(this.savedY-a,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let n=0;n<this.lines.length;n++)s+=+this.lines.get(n).resize(e,i);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),s>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=m3(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Pe),i);if(s.length>0){let r=g3(this.lines,s);p3(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let s=this.getNullCell(Pe),r=i;for(;r-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new oa(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=this.getNullCell(Pe),r=[],n=0;for(let a=this.lines.length-1;a>=0;a--){let o=this.lines.get(a);if(!o||!o.isWrapped&&o.getTrimmedLength()<=e)continue;let c=[o];for(;o.isWrapped&&a>0;)o=this.lines.get(--a),c.unshift(o);if(!i){let v=this.ybase+this.y;if(v>=a&&v<a+c.length)continue}let l=c[c.length-1].getTrimmedLength(),h=v3(c,this._cols,e),u=h.length-c.length,d;this.ybase===0&&this.y!==this.lines.length-1?d=Math.max(0,this.y-this.lines.maxLength+u):d=Math.max(0,this.lines.length-this.lines.maxLength+u);let f=[];for(let v=0;v<u;v++){let y=this.getBlankLine(Pe,!0);f.push(y)}f.length>0&&(r.push({start:a+c.length+n,newLines:f}),n+=f.length),c.push(...f);let _=h.length-1,m=h[_];m===0&&(_--,m=h[_]);let w=c.length-u-1,g=l;for(;w>=0;){let v=Math.min(g,m);if(c[_]===void 0)break;if(c[_].copyCellsFrom(c[w],g-v,m-v,v,!0),m-=v,m===0&&(_--,m=h[_]),g-=v,g===0){w--;let y=Math.max(w,0);g=Ia(c,y,this._cols)}}for(let v=0;v<c.length;v++)h[v]<e&&c[v].setCell(h[v],s);let p=u-d;for(;p-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+u,this.ybase+t-1)}if(r.length>0){let a=[],o=[];for(let m=0;m<this.lines.length;m++)o.push(this.lines.get(m));let c=this.lines.length,l=c-1,h=0,u=r[h];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);let d=0;for(let m=Math.min(this.lines.maxLength-1,c+n-1);m>=0;m--)if(u&&u.start>l+d){for(let w=u.newLines.length-1;w>=0;w--)this.lines.set(m--,u.newLines[w]);m++,a.push({index:l+1,amount:u.newLines.length}),d+=u.newLines.length,u=r[++h]}else this.lines.set(m,o[l--]);let f=0;for(let m=a.length-1;m>=0;m--)a[m].index+=f,this.lines.onInsertEmitter.fire(a[m]),f+=a[m].amount;let _=Math.max(0,c+n-this.lines.maxLength);_>0&&this.lines.onTrimEmitter.fire(_)}}translateBufferLineToString(e,t,i=0,s){let r=this.lines.get(e);return r?r.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new y3(e);return this.markers.push(t),t.register(this.lines.onTrim(i=>{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.line<i.index+i.amount&&t.dispose(),t.line>i.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},S3=class extends Z{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new P),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 ep(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new ep(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},d1=2,f1=1,Sd=class extends Z{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new P),this.onResize=this._onResize.event,this._onScroll=this._register(new P),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,d1),this.rows=Math.max(e.rawOptions.rows||0,f1),this.buffers=this._register(new S3(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(i.scrollTop===0){let a=i.lines.isFull;n===i.lines.length-1?a?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),a?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let a=n-r+1;i.lines.shiftElements(r+1,a-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),s!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};Sd=Te([j(0,St)],Sd);var Hr={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Xl,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},b3=["normal","bold","100","200","300","400","500","600","700","800","900"],w3=class extends Z{constructor(e){super(),this._onOptionChange=this._register(new P),this.onOptionChange=this._onOptionChange.event;let t={...Hr};for(let i in e)if(i in t)try{let s=e[i];t[i]=this._sanitizeAndValidateOption(i,s)}catch(s){console.error(s)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(Ce(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in Hr))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in Hr))throw new Error(`No option with key "${i}"`);s=this._sanitizeAndValidateOption(i,s),this.rawOptions[i]!==s&&(this.rawOptions[i]=s,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let s={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Hr[e]),!C3(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Hr[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=b3.includes(t)?t:Hr[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function C3(e){return e==="block"||e==="underline"||e==="bar"}function la(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let s in e)i[s]=t<=1?e[s]:e[s]&&la(e[s],t-1);return i}var tp=Object.freeze({insertMode:!1}),ip=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),bd=class extends Z{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new P),this.onData=this._onData.event,this._onUserInput=this._register(new P),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new P),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new P),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=la(tp),this.decPrivateModes=la(ip)}reset(){this.modes=la(tp),this.decPrivateModes=la(ip)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};bd=Te([j(0,yt),j(1,Nb),j(2,St)],bd);var sp={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function zu(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}var Lu=String.fromCharCode,rp={DEFAULT:e=>{let t=[zu(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Lu(t[0])}${Lu(t[1])}${Lu(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${zu(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${zu(e,!0)};${e.x};${e.y}${t}`}},wd=class extends Z{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new P),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(sp))this.addProtocol(s,sp[s]);for(let s of Object.keys(rp))this.addEncoding(s,rp[s]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let s=t/i,r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=s+0,Math.abs(e.deltaY)<50&&(r*=.3),this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};wd=Te([j(0,yt),j(1,Dr),j(2,St)],wd);var Hu=[[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]],x3=[[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]],Ye;function E3(e,t){let i=0,s=t.length-1,r;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e<t[r][0])s=r-1;else return!0;return!1}var A3=class{constructor(){if(this.version="6",!Ye){Ye=new Uint8Array(65536),Ye.fill(1),Ye[0]=0,Ye.fill(0,1,32),Ye.fill(0,127,160),Ye.fill(2,4352,4448),Ye[9001]=2,Ye[9002]=2,Ye.fill(2,11904,42192),Ye[12351]=1,Ye.fill(2,44032,55204),Ye.fill(2,63744,64256),Ye.fill(2,65040,65050),Ye.fill(2,65072,65136),Ye.fill(2,65280,65377),Ye.fill(2,65504,65511);for(let e=0;e<Hu.length;++e)Ye.fill(0,Hu[e][0],Hu[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Ye[e]:E3(e,x3)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let r=sr.extractWidth(t);r===0?s=!1:r>i&&(i=r)}return sr.createPropertyValue(0,i,s)}},sr=class hl{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new P,this.onChange=this._onChange.event;let t=new A3;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,s=!1){return(t&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,s=0,r=t.length;for(let n=0;n<r;++n){let a=t.charCodeAt(n);if(55296<=a&&a<=56319){if(++n>=r)return i+this.wcwidth(a);let l=t.charCodeAt(n);56320<=l&&l<=57343?a=(a-55296)*1024+l-56320+65536:i+=this.wcwidth(l)}let o=this.charProperties(a,s),c=hl.extractWidth(o);hl.extractShouldJoin(o)&&(c-=hl.extractWidth(s)),i+=c,s=o}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},k3=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function np(e){var s;let t=(s=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:s.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}var Zn=2147483647,D3=256,_1=class Cd{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>D3)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new Cd;if(!t.length)return i;for(let s=Array.isArray(t[0])?1:0;s<t.length;++s){let r=t[s];if(Array.isArray(r))for(let n=0;n<r.length;++n)i.addSubParam(r[n]);else i.addParam(r)}return i}clone(){let t=new Cd(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let i=0;i<this.length;++i){t.push(this.params[i]);let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Zn?Zn:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Zn?Zn:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,s=this._subParamsIdx[t]&255;return s-i>0?this._subParams.subarray(i,s):null}getSubParamsAll(){let t={};for(let i=0;i<this.length;++i){let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&(t[i]=this._subParams.slice(s,r))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,r=s[i-1];s[i-1]=~r?Math.min(r*10+t,Zn):t}},Qn=[],R3=class{constructor(){this._state=0,this._active=Qn,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Qn}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Qn,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Qn,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,i){if(!this._active.length)this._handlerFb(this._id,"PUT",Dc(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t<i;){let s=e[t++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-48}this._state===2&&i-t>0&&this._put(e,t,i)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].end(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=Qn,this._id=-1,this._state=0}}},Nt=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Dc(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},Jn=[],M3=class{constructor(){this._handlers=Object.create(null),this._active=Jn,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Jn}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Jn,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Jn,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",Dc(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].unhook(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=Jn,this._ident=0}},ca=new _1;ca.addParam(0);var ap=class{constructor(e){this._handler=e,this._data="",this._params=ca,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ca,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Dc(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(i=>(this._params=ca,this._data="",this._hitLimit=!1,i));return this._params=ca,this._data="",this._hitLimit=!1,t}},T3=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}},$t=160,O3=function(){let e=new T3(4095),t=Array.apply(null,Array(256)).map((o,c)=>c),i=(o,c)=>t.slice(o,c),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));let n=i(0,14),a;e.setDefault(1,0),e.addMany(s,0,2,0);for(a in n)e.addMany([24,26,153,154],a,3,0),e.addMany(i(128,144),a,3,0),e.addMany(i(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add($t,0,2,0),e.add($t,8,5,8),e.add($t,6,0,6),e.add($t,11,0,11),e.add($t,13,13,13),e}(),N3=class extends Z{constructor(e=O3){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _1,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,s)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Ce(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new R3),this._dcsParser=this._register(new M3),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let r=0;r<e.intermediates.length;++r){let n=e.intermediates.charCodeAt(r);if(32>n||n>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=n}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let s=this._escHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let s=this._csiHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s=0,r=0,n=0,a;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,n=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let o=this._parseStack.handlers,c=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&c>-1){for(;c>=0&&(a=o[c](this._params),a!==!0);c--)if(a instanceof Promise)return this._parseStack.handlerPos=c,a}this._parseStack.handlers=[];break;case 4:if(i===!1&&c>-1){for(;c>=0&&(a=o[c](),a!==!0);c--)if(a instanceof Promise)return this._parseStack.handlerPos=c,a}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(s!==24&&s!==26,i),a)return a;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],a=this._oscParser.end(s!==24&&s!==26,i),a)return a;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,n=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let o=n;o<t;++o){switch(s=e[o],r=this._transitions.table[this.currentState<<8|(s<160?s:$t)],r>>4){case 2:for(let d=o+1;;++d){if(d>=t||(s=e[d])<32||s>126&&s<$t){this._printHandler(e,o,d),o=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<$t){this._printHandler(e,o,d),o=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<$t){this._printHandler(e,o,d),o=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<$t){this._printHandler(e,o,d),o=d-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:o,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let c=this._csiHandlers[this._collect<<8|s],l=c?c.length-1:-1;for(;l>=0&&(a=c[l](this._params),a!==!0);l--)if(a instanceof Promise)return this._preserveStack(3,c,l,r,o),a;l<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++o<t&&(s=e[o])>47&&s<60);o--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let h=this._escHandlers[this._collect<<8|s],u=h?h.length-1:-1;for(;u>=0&&(a=h[u](),a!==!0);u--)if(a instanceof Promise)return this._preserveStack(4,h,u,r,o),a;u<0&&this._escHandlerFb(this._collect<<8|s),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|s,this._params);break;case 13:for(let d=o+1;;++d)if(d>=t||(s=e[d])===24||s===26||s===27||s>127&&s<$t){this._dcsParser.put(e,o,d),o=d-1;break}break;case 14:if(a=this._dcsParser.unhook(s!==24&&s!==26),a)return this._preserveStack(6,[],0,r,o),a;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let d=o+1;;d++)if(d>=t||(s=e[d])<32||s>127&&s<$t){this._oscParser.put(e,o,d),o=d-1;break}break;case 6:if(a=this._oscParser.end(s!==24&&s!==26),a)return this._preserveStack(5,[],0,r,o),a;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=r&15}}},B3=/^([\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})$/,z3=/^[\da-f]+$/;function op(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=B3.exec(t);if(i){let s=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/s*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/s*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/s*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),z3.exec(t)&&[3,6,9,12].includes(t.length))){let i=t.length/3,s=[0,0,0];for(let r=0;r<3;++r){let n=parseInt(t.slice(i*r,i*r+i),16);s[r]=i===1?n<<4:i===2?n:i===3?n>>4:n>>8}return s}}function Pu(e,t){let i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function L3(e,t=16){let[i,s,r]=e;return`rgb:${Pu(i,t)}/${Pu(s,t)}/${Pu(r,t)}`}var H3={"(":0,")":1,"*":2,"+":3,"-":1,".":2},ds=131072,lp=10;function cp(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var up=5e3,hp=0,P3=class extends Z{constructor(e,t,i,s,r,n,a,o,c=new N3){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=n,this._coreMouseService=a,this._unicodeService=o,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new sM,this._utf8Decoder=new rM,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Pe.clone(),this._eraseAttrDataInternal=Pe.clone(),this._onRequestBell=this._register(new P),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new P),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new P),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new P),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new P),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new P),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new P),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new P),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new P),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new P),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new P),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new P),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new P),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 xd(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(l=>this._activeBuffer=l.activeBuffer)),this._parser.setCsiHandlerFallback((l,h)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(l),params:h.toArray()})}),this._parser.setEscHandlerFallback(l=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(l)})}),this._parser.setExecuteHandlerFallback(l=>{this._logService.debug("Unknown EXECUTE code: ",{code:l})}),this._parser.setOscHandlerFallback((l,h,u)=>{this._logService.debug("Unknown OSC code: ",{identifier:l,action:h,data:u})}),this._parser.setDcsHandlerFallback((l,h,u)=>{h==="HOOK"&&(u=u.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(l),action:h,payload:u})}),this._parser.setPrintHandler((l,h,u)=>this.print(l,h,u)),this._parser.registerCsiHandler({final:"@"},l=>this.insertChars(l)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},l=>this.scrollLeft(l)),this._parser.registerCsiHandler({final:"A"},l=>this.cursorUp(l)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},l=>this.scrollRight(l)),this._parser.registerCsiHandler({final:"B"},l=>this.cursorDown(l)),this._parser.registerCsiHandler({final:"C"},l=>this.cursorForward(l)),this._parser.registerCsiHandler({final:"D"},l=>this.cursorBackward(l)),this._parser.registerCsiHandler({final:"E"},l=>this.cursorNextLine(l)),this._parser.registerCsiHandler({final:"F"},l=>this.cursorPrecedingLine(l)),this._parser.registerCsiHandler({final:"G"},l=>this.cursorCharAbsolute(l)),this._parser.registerCsiHandler({final:"H"},l=>this.cursorPosition(l)),this._parser.registerCsiHandler({final:"I"},l=>this.cursorForwardTab(l)),this._parser.registerCsiHandler({final:"J"},l=>this.eraseInDisplay(l,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},l=>this.eraseInDisplay(l,!0)),this._parser.registerCsiHandler({final:"K"},l=>this.eraseInLine(l,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},l=>this.eraseInLine(l,!0)),this._parser.registerCsiHandler({final:"L"},l=>this.insertLines(l)),this._parser.registerCsiHandler({final:"M"},l=>this.deleteLines(l)),this._parser.registerCsiHandler({final:"P"},l=>this.deleteChars(l)),this._parser.registerCsiHandler({final:"S"},l=>this.scrollUp(l)),this._parser.registerCsiHandler({final:"T"},l=>this.scrollDown(l)),this._parser.registerCsiHandler({final:"X"},l=>this.eraseChars(l)),this._parser.registerCsiHandler({final:"Z"},l=>this.cursorBackwardTab(l)),this._parser.registerCsiHandler({final:"`"},l=>this.charPosAbsolute(l)),this._parser.registerCsiHandler({final:"a"},l=>this.hPositionRelative(l)),this._parser.registerCsiHandler({final:"b"},l=>this.repeatPrecedingCharacter(l)),this._parser.registerCsiHandler({final:"c"},l=>this.sendDeviceAttributesPrimary(l)),this._parser.registerCsiHandler({prefix:">",final:"c"},l=>this.sendDeviceAttributesSecondary(l)),this._parser.registerCsiHandler({final:"d"},l=>this.linePosAbsolute(l)),this._parser.registerCsiHandler({final:"e"},l=>this.vPositionRelative(l)),this._parser.registerCsiHandler({final:"f"},l=>this.hVPosition(l)),this._parser.registerCsiHandler({final:"g"},l=>this.tabClear(l)),this._parser.registerCsiHandler({final:"h"},l=>this.setMode(l)),this._parser.registerCsiHandler({prefix:"?",final:"h"},l=>this.setModePrivate(l)),this._parser.registerCsiHandler({final:"l"},l=>this.resetMode(l)),this._parser.registerCsiHandler({prefix:"?",final:"l"},l=>this.resetModePrivate(l)),this._parser.registerCsiHandler({final:"m"},l=>this.charAttributes(l)),this._parser.registerCsiHandler({final:"n"},l=>this.deviceStatus(l)),this._parser.registerCsiHandler({prefix:"?",final:"n"},l=>this.deviceStatusPrivate(l)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},l=>this.softReset(l)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},l=>this.setCursorStyle(l)),this._parser.registerCsiHandler({final:"r"},l=>this.setScrollRegion(l)),this._parser.registerCsiHandler({final:"s"},l=>this.saveCursor(l)),this._parser.registerCsiHandler({final:"t"},l=>this.windowOptions(l)),this._parser.registerCsiHandler({final:"u"},l=>this.restoreCursor(l)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},l=>this.insertColumns(l)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},l=>this.deleteColumns(l)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},l=>this.selectProtected(l)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},l=>this.requestMode(l,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},l=>this.requestMode(l,!1)),this._parser.setExecuteHandler(T.BEL,()=>this.bell()),this._parser.setExecuteHandler(T.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(T.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(T.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(T.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(T.BS,()=>this.backspace()),this._parser.setExecuteHandler(T.HT,()=>this.tab()),this._parser.setExecuteHandler(T.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(T.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(cl.IND,()=>this.index()),this._parser.setExecuteHandler(cl.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(cl.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Nt(l=>(this.setTitle(l),this.setIconName(l),!0))),this._parser.registerOscHandler(1,new Nt(l=>this.setIconName(l))),this._parser.registerOscHandler(2,new Nt(l=>this.setTitle(l))),this._parser.registerOscHandler(4,new Nt(l=>this.setOrReportIndexedColor(l))),this._parser.registerOscHandler(8,new Nt(l=>this.setHyperlink(l))),this._parser.registerOscHandler(10,new Nt(l=>this.setOrReportFgColor(l))),this._parser.registerOscHandler(11,new Nt(l=>this.setOrReportBgColor(l))),this._parser.registerOscHandler(12,new Nt(l=>this.setOrReportCursorColor(l))),this._parser.registerOscHandler(104,new Nt(l=>this.restoreIndexedColor(l))),this._parser.registerOscHandler(110,new Nt(l=>this.restoreFgColor(l))),this._parser.registerOscHandler(111,new Nt(l=>this.restoreBgColor(l))),this._parser.registerOscHandler(112,new Nt(l=>this.restoreCursorColor(l))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let l in $e)this._parser.registerEscHandler({intermediates:"(",final:l},()=>this.selectCharset("("+l)),this._parser.registerEscHandler({intermediates:")",final:l},()=>this.selectCharset(")"+l)),this._parser.registerEscHandler({intermediates:"*",final:l},()=>this.selectCharset("*"+l)),this._parser.registerEscHandler({intermediates:"+",final:l},()=>this.selectCharset("+"+l)),this._parser.registerEscHandler({intermediates:"-",final:l},()=>this.selectCharset("-"+l)),this._parser.registerEscHandler({intermediates:".",final:l},()=>this.selectCharset("."+l)),this._parser.registerEscHandler({intermediates:"/",final:l},()=>this.selectCharset("/"+l));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(l=>(this._logService.error("Parsing error: ",l),l)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new ap((l,h)=>this.requestStatusString(l,h)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),up))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${up} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0,a=this._parseStack.paused;if(a){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>ds&&(n=this._parseStack.position+ds)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,l=>String.fromCharCode(l)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(l=>l.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<ds&&(this._parseBuffer=new Uint32Array(Math.min(e.length,ds))),a||this._dirtyRowTracker.clearRange(),e.length>ds)for(let l=n;l<e.length;l+=ds){let h=l+ds<e.length?l+ds:e.length,u=typeof e=="string"?this._stringDecoder.decode(e.substring(l,h),this._parseBuffer):this._utf8Decoder.decode(e.subarray(l,h),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,u))return this._preserveStack(s,r,u,l),this._logSlowResolvingAsync(i),i}else if(!a){let l=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,l))return this._preserveStack(s,r,l,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==s||this._activeBuffer.y!==r)&&this._onCursorMove.fire();let o=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(o,this._bufferService.rows-1)})}print(e,t,i){let s,r,n=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,o=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,l=this._coreService.modes.insertMode,h=this._curAttrData,u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&u.getWidth(this._activeBuffer.x-1)===2&&u.setCellFromCodepoint(this._activeBuffer.x-1,0,1,h);let d=this._parser.precedingJoinState;for(let f=t;f<i;++f){if(s=e[f],s<127&&n){let g=n[String.fromCharCode(s)];g&&(s=g.charCodeAt(0))}let _=this._unicodeService.charProperties(s,d);r=sr.extractWidth(_);let m=sr.extractShouldJoin(_),w=m?sr.extractWidth(d):0;if(d=_,a&&this._onA11yChar.fire(gs(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+r-w>o){if(c){let g=u,p=this._activeBuffer.x-w;for(this._activeBuffer.x=w,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),u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),w>0&&u instanceof oa&&u.copyCellsFrom(g,p,0,w,!1);p<o;)g.setCellFromCodepoint(p++,0,1,h)}else if(this._activeBuffer.x=o-1,r===2)continue}if(m&&this._activeBuffer.x){let g=u.getWidth(this._activeBuffer.x-1)?1:2;u.addCodepointToCell(this._activeBuffer.x-g,s,r);for(let p=r-w;--p>=0;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,h);continue}if(l&&(u.insertCells(this._activeBuffer.x,r-w,this._activeBuffer.getNullCell(h)),u.getWidth(o-1)===2&&u.setCellFromCodepoint(o-1,0,1,h)),u.setCellFromCodepoint(this._activeBuffer.x++,s,r,h),r>0)for(;--r;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,h)}this._parser.precedingJoinState=d,this._activeBuffer.x<o&&i-t>0&&u.getWidth(this._activeBuffer.x)===0&&!u.hasContent(this._activeBuffer.x)&&u.setCellFromCodepoint(this._activeBuffer.x,0,1,h),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>cp(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new ap(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Nt(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){var s;this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!((s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i))!=null&&s.getTrimmedLength()););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let r=this._activeBuffer.lines.length-this._bufferService.rows;r>0&&(this._activeBuffer.lines.trimStart(r),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-r,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-r,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(Pe));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let i=e.params[0]||1,s=sr.extractWidth(t),r=this._activeBuffer.x-s,n=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(r),a=new Uint32Array(n.length*i),o=0;for(let l=0;l<n.length;){let h=n.codePointAt(l)||0;a[o++]=h,l+=h>65535?2:1}let c=o;for(let l=1;l<i;++l)a.copyWithin(c,0,o),c+=o;return this.print(a,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(T.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(T.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(T.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(T.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(T.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,ir),this._charsetService.setgCharset(1,ir),this._charsetService.setgCharset(2,ir),this._charsetService.setgCharset(3,ir);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(m=>(m[m.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",m[m.SET=1]="SET",m[m.RESET=2]="RESET",m[m.PERMANENTLY_SET=3]="PERMANENTLY_SET",m[m.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(i={}));let s=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:n}=this._coreMouseService,a=this._coreService,{buffers:o,cols:c}=this._bufferService,{active:l,alt:h}=o,u=this._optionsService.rawOptions,d=(m,w)=>(a.triggerDataEvent(`${T.ESC}[${t?"":"?"}${m};${w}$y`),!0),f=m=>m?1:2,_=e.params[0];return t?_===2?d(_,4):_===4?d(_,f(a.modes.insertMode)):_===12?d(_,3):_===20?d(_,f(u.convertEol)):d(_,0):_===1?d(_,f(s.applicationCursorKeys)):_===3?d(_,u.windowOptions.setWinLines?c===80?2:c===132?1:0:0):_===6?d(_,f(s.origin)):_===7?d(_,f(s.wraparound)):_===8?d(_,3):_===9?d(_,f(r==="X10")):_===12?d(_,f(u.cursorBlink)):_===25?d(_,f(!a.isCursorHidden)):_===45?d(_,f(s.reverseWraparound)):_===66?d(_,f(s.applicationKeypad)):_===67?d(_,4):_===1e3?d(_,f(r==="VT200")):_===1002?d(_,f(r==="DRAG")):_===1003?d(_,f(r==="ANY")):_===1004?d(_,f(s.sendFocus)):_===1005?d(_,4):_===1006?d(_,f(n==="SGR")):_===1015?d(_,4):_===1016?d(_,f(n==="SGR_PIXELS")):_===1048?d(_,1):_===47||_===1047||_===1049?d(_,f(l===h)):_===2004?d(_,f(s.bracketedPasteMode)):_===2026?d(_,f(s.synchronizedOutput)):d(_,0)}_updateAttrColor(e,t,i,s,r){return t===2?(e|=50331648,e&=-16777216,e|=ro.fromColorRGB([i,s,r])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let s=[0,0,-1,0,0,0],r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){let a=e.getSubParams(t+n),o=0;do s[1]===5&&(r=1),s[n+o+1+r]=a[o];while(++o<a.length&&o+n+1+r<s.length);break}if(s[1]===5&&n+r>=2||s[1]===2&&n+r>=5)break;s[1]&&(r=1)}while(++n+t<e.length&&n+r<s.length);for(let a=2;a<s.length;++a)s[a]===-1&&(s[a]=0);switch(s[0]){case 38:i.fg=this._updateAttrColor(i.fg,s[1],s[3],s[4],s[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,s[1],s[3],s[4],s[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,s[1],s[3],s[4],s[5])}return n}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Pe.fg,e.bg=Pe.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,i,s=this._curAttrData;for(let r=0;r<t;r++)i=e.params[r],i>=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777216|i-90|8):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777216|i-100|8):i===0?this._processSGR0(s):i===1?s.fg|=134217728:i===3?s.bg|=67108864:i===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):i===5?s.fg|=536870912:i===7?s.fg|=67108864:i===8?s.fg|=1073741824:i===9?s.fg|=2147483648:i===2?s.bg|=134217728:i===21?this._processUnderline(2,s):i===22?(s.fg&=-134217729,s.bg&=-134217729):i===23?s.bg&=-67108865:i===24?(s.fg&=-268435457,this._processUnderline(0,s)):i===25?s.fg&=-536870913:i===27?s.fg&=-67108865:i===28?s.fg&=-1073741825:i===29?s.fg&=2147483647:i===39?(s.fg&=-67108864,s.fg|=Pe.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=Pe.bg&16777215):i===38||i===48||i===58?r+=this._extractColor(e,r,s):i===53?s.bg|=1073741824:i===55?s.bg&=-1073741825:i===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):i===100?(s.fg&=-67108864,s.fg|=Pe.fg&16777215,s.bg&=-67108864,s.bg|=Pe.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${T.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${T.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${T.ESC}[?${t};${i}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Pe.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!cp(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${T.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>lp&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>lp&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],i=e.split(";");for(;i.length>1;){let s=i.shift(),r=i.shift();if(/^\d+$/.exec(s)){let n=parseInt(s);if(dp(n))if(r==="?")t.push({type:0,index:n});else{let a=op(r);a&&t.push({type:1,index:n,color:a})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(i,s):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),s,r=i.findIndex(n=>n.startsWith("id="));return r!==-1&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let i=e.split(";");for(let s=0;s<i.length&&!(t>=this._specialColors.length);++s,++t)if(i[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=op(i[s]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],i=e.split(";");for(let s=0;s<i.length;++s)if(/^\d+$/.exec(i[s])){let r=parseInt(i[s]);dp(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,ir),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(H3[e[0]],$e[e[1]]||ir),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=Pe.clone(),this._eraseAttrDataInternal=Pe.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new ri;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let i=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(i);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let i=a=>(this._coreService.triggerDataEvent(`${T.ESC}${a}${T.ESC}\\`),!0),s=this._bufferService.buffer,r=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${s.scrollTop+1};${s.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},xd=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(hp=e,e=t,t=hp),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};xd=Te([j(0,yt)],xd);function dp(e){return 0<=e&&e<256}var U3=5e7,fp=12,j3=50,W3=class extends Z{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new P),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let i;for(;i=this._writeBuffer.shift();){this._action(i);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>U3)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],r=this._action(s,t);if(r){let a=o=>performance.now()-i>=fp?setTimeout(()=>this._innerWrite(0,o)):this._innerWrite(i,o);r.catch(o=>(queueMicrotask(()=>{throw o}),Promise.resolve(!1))).then(a);return}let n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-i>=fp)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>j3&&(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()}},Ed=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let o=t.addMarker(t.ybase+t.y),c={data:e,id:this._nextId++,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(c,o)),this._dataByLinkId.set(c.id,c),c.id}let i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;let n=t.addMarker(t.ybase+t.y),a={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(a,n)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);i.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(i,s))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Ed=Te([j(0,yt)],Ed);var _p=!1,I3=class extends Z{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new An),this._onBinary=this._register(new P),this.onBinary=this._onBinary.event,this._onData=this._register(new P),this.onData=this._onData.event,this._onLineFeed=this._register(new P),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new P),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new P),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new P),this._instantiationService=new d3,this.optionsService=this._register(new w3(e)),this._instantiationService.setService(St,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Sd)),this._instantiationService.setService(yt,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(yd)),this._instantiationService.setService(Nb,this._logService),this.coreService=this._register(this._instantiationService.createInstance(bd)),this._instantiationService.setService(Dr,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(wd)),this._instantiationService.setService(Ob,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(sr)),this._instantiationService.setService(lM,this.unicodeService),this._charsetService=this._instantiationService.createInstance(k3),this._instantiationService.setService(oM,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Ed),this._instantiationService.setService(Bb,this._oscLinkService),this._inputHandler=this._register(new P3(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(ct.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(ct.forward(this._bufferService.onResize,this._onResize)),this._register(ct.forward(this.coreService.onData,this._onData)),this._register(ct.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new W3((t,i)=>this._inputHandler.parse(t,i))),this._register(ct.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new P),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.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(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!_p&&(this._logService.warn("writeSync is unreliable and will be removed soon."),_p=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,d1),t=Math.max(t,f1),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(np.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(np(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Ce(()=>{for(let t of e)t.dispose()})}}},q3={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:["'",'"']};function F3(e,t,i,s){var a;let r={type:0,cancel:!1,key:void 0},n=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?r.key=T.ESC+"OA":r.key=T.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?r.key=T.ESC+"OD":r.key=T.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?r.key=T.ESC+"OC":r.key=T.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?r.key=T.ESC+"OB":r.key=T.ESC+"[B");break;case 8:r.key=e.ctrlKey?"\b":T.DEL,e.altKey&&(r.key=T.ESC+r.key);break;case 9:if(e.shiftKey){r.key=T.ESC+"[Z";break}r.key=T.HT,r.cancel=!0;break;case 13:r.key=e.altKey?T.ESC+T.CR:T.CR,r.cancel=!0;break;case 27:r.key=T.ESC,e.altKey&&(r.key=T.ESC+T.ESC),r.cancel=!0;break;case 37:if(e.metaKey)break;n?r.key=T.ESC+"[1;"+(n+1)+"D":t?r.key=T.ESC+"OD":r.key=T.ESC+"[D";break;case 39:if(e.metaKey)break;n?r.key=T.ESC+"[1;"+(n+1)+"C":t?r.key=T.ESC+"OC":r.key=T.ESC+"[C";break;case 38:if(e.metaKey)break;n?r.key=T.ESC+"[1;"+(n+1)+"A":t?r.key=T.ESC+"OA":r.key=T.ESC+"[A";break;case 40:if(e.metaKey)break;n?r.key=T.ESC+"[1;"+(n+1)+"B":t?r.key=T.ESC+"OB":r.key=T.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(r.key=T.ESC+"[2~");break;case 46:n?r.key=T.ESC+"[3;"+(n+1)+"~":r.key=T.ESC+"[3~";break;case 36:n?r.key=T.ESC+"[1;"+(n+1)+"H":t?r.key=T.ESC+"OH":r.key=T.ESC+"[H";break;case 35:n?r.key=T.ESC+"[1;"+(n+1)+"F":t?r.key=T.ESC+"OF":r.key=T.ESC+"[F";break;case 33:e.shiftKey?r.type=2:e.ctrlKey?r.key=T.ESC+"[5;"+(n+1)+"~":r.key=T.ESC+"[5~";break;case 34:e.shiftKey?r.type=3:e.ctrlKey?r.key=T.ESC+"[6;"+(n+1)+"~":r.key=T.ESC+"[6~";break;case 112:n?r.key=T.ESC+"[1;"+(n+1)+"P":r.key=T.ESC+"OP";break;case 113:n?r.key=T.ESC+"[1;"+(n+1)+"Q":r.key=T.ESC+"OQ";break;case 114:n?r.key=T.ESC+"[1;"+(n+1)+"R":r.key=T.ESC+"OR";break;case 115:n?r.key=T.ESC+"[1;"+(n+1)+"S":r.key=T.ESC+"OS";break;case 116:n?r.key=T.ESC+"[15;"+(n+1)+"~":r.key=T.ESC+"[15~";break;case 117:n?r.key=T.ESC+"[17;"+(n+1)+"~":r.key=T.ESC+"[17~";break;case 118:n?r.key=T.ESC+"[18;"+(n+1)+"~":r.key=T.ESC+"[18~";break;case 119:n?r.key=T.ESC+"[19;"+(n+1)+"~":r.key=T.ESC+"[19~";break;case 120:n?r.key=T.ESC+"[20;"+(n+1)+"~":r.key=T.ESC+"[20~";break;case 121:n?r.key=T.ESC+"[21;"+(n+1)+"~":r.key=T.ESC+"[21~";break;case 122:n?r.key=T.ESC+"[23;"+(n+1)+"~":r.key=T.ESC+"[23~";break;case 123:n?r.key=T.ESC+"[24;"+(n+1)+"~":r.key=T.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?r.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?r.key=T.NUL:e.keyCode>=51&&e.keyCode<=55?r.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?r.key=T.DEL:e.keyCode===219?r.key=T.ESC:e.keyCode===220?r.key=T.FS:e.keyCode===221&&(r.key=T.GS);else if((!i||s)&&e.altKey&&!e.metaKey){let o=(a=q3[e.keyCode])==null?void 0:a[e.shiftKey?1:0];if(o)r.key=T.ESC+o;else if(e.keyCode>=65&&e.keyCode<=90){let c=e.ctrlKey?e.keyCode-64:e.keyCode+32,l=String.fromCharCode(c);e.shiftKey&&(l=l.toUpperCase()),r.key=T.ESC+l}else if(e.keyCode===32)r.key=T.ESC+(e.ctrlKey?T.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let c=e.code.slice(3,4);e.shiftKey||(c=c.toLowerCase()),r.key=T.ESC+c,r.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(r.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?r.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(r.key=T.US),e.key==="@"&&(r.key=T.NUL));break}return r}var ze=0,K3=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Zl,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Zl,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((r,n)=>this._getKey(r)-this._getKey(n)),t=0,i=0,s=new Array(this._array.length+this._insertedValues.length);for(let r=0;r<s.length;r++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(s[r]=e[t],t++):s[r]=this._array[i++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(ze=this._search(t),ze===-1)||this._getKey(this._array[ze])!==t)return!1;do if(this._array[ze]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ze),!0;while(++ze<this._array.length&&this._getKey(this._array[ze])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((r,n)=>r-n),t=0,i=new Array(this._array.length-e.length),s=0;for(let r=0;r<this._array.length;r++)e[t]===r?t++:i[s++]=this._array[r];this._array=i,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ze=this._search(e),!(ze<0||ze>=this._array.length)&&this._getKey(this._array[ze])===e))do yield this._array[ze];while(++ze<this._array.length&&this._getKey(this._array[ze])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ze=this._search(e),!(ze<0||ze>=this._array.length)&&this._getKey(this._array[ze])===e))do t(this._array[ze]);while(++ze<this._array.length&&this._getKey(this._array[ze])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,i=this._array.length-1;for(;i>=t;){let s=t+i>>1,r=this._getKey(this._array[s]);if(r>e)i=s-1;else if(r<e)t=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},Uu=0,mp=0,Y3=class extends Z{constructor(){super(),this._decorations=new K3(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new P),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new P),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Ce(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new V3(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let s=0,r=0;for(let n of this._decorations.getKeyIterator(t))s=n.options.x??0,r=s+(n.options.width??1),e>=s&&e<r&&(!i||(n.options.layer??"bottom")===i)&&(yield n)}forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,r=>{Uu=r.options.x??0,mp=Uu+(r.options.width??1),e>=Uu&&e<mp&&(!i||(r.options.layer??"bottom")===i)&&s(r)})}},V3=class extends Ls{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new P),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new P),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Ee.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Ee.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},G3=1e3,$3=class{constructor(e,t=G3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let r=s-this._lastRefreshMs,n=this._debounceThresholdMS-r;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},n)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},gp=20,Ql=class extends Z{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let r=this._coreBrowserService.mainDocument;this._accessibilityContainer=r.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=r.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let n=0;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);if(this._topBoundaryFocusListener=n=>this._handleBoundaryFocus(n,0),this._bottomBoundaryFocusListener=n=>this._handleBoundaryFocus(n,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=r.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new $3(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(n=>this._handleResize(n.rows))),this._register(this._terminal.onRender(n=>this._refreshRows(n.start,n.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(n=>this._handleChar(n))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
243
|
+
`))),this._register(this._terminal.onA11yTab(n=>this._handleTab(n))),this._register(this._terminal.onKey(n=>this._handleKey(n.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Y(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Ce(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<gp+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
244
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===gp+1&&(this._liveRegion.textContent+=Kh.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){let n=i.lines.get(i.ydisp+r),a=[],o=(n==null?void 0:n.translateToString(!0,void 0,void 0,a))||"",c=(i.ydisp+r+1).toString(),l=this._rowElements[r];l&&(o.length===0?(l.textContent=" ",this._rowColumns.set(l,[0,1])):(l.textContent=o,this._rowColumns.set(l,a)),l.setAttribute("aria-posinset",c),l.setAttribute("aria-setsize",s),this._alignRowWidth(l))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),n=t===0?"1":`${this._terminal.buffer.lines.length}`;if(r===n||e.relatedTarget!==s)return;let a,o;if(t===0?(a=i,o=this._rowElements.pop(),this._rowContainer.removeChild(o)):(a=this._rowElements.shift(),o=i,this._rowContainer.removeChild(a)),a.removeEventListener("focus",this._topBoundaryFocusListener),o.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let c=this._createAccessibilityTreeNode();this._rowElements.unshift(c),this._rowContainer.insertAdjacentElement("afterbegin",c)}else{let c=this._createAccessibilityTreeNode();this._rowElements.push(c),this._rowContainer.appendChild(c)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var o;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:((o=s.textContent)==null?void 0:o.length)??0}),!this._rowContainer.contains(i.node))return;let r=({node:c,offset:l})=>{let h=c instanceof Text?c.parentNode:c,u=parseInt(h==null?void 0:h.getAttribute("aria-posinset"),10)-1;if(isNaN(u))return console.warn("row is invalid. Race condition?"),null;let d=this._rowColumns.get(h);if(!d)return console.warn("columns is null. Race condition?"),null;let f=l<d.length?d[l]:d.slice(-1)[0]+1;return f>=this._terminal.cols&&(++u,f=0),{row:u,column:f}},n=r(t),a=r(i);if(!(!n||!a)){if(n.row>a.row||n.row===a.row&&n.column>=a.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(a.row-n.row)*this._terminal.cols-n.column+a.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var r,n;e.style.transform="";let t=e.getBoundingClientRect().width,i=(n=(r=this._rowColumns.get(e))==null?void 0:r.slice(-1))==null?void 0:n[0];if(!i)return;let s=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${s/t})`}};Ql=Te([j(1,Qf),j(2,as),j(3,os)],Ql);var Ad=class extends Z{constructor(e,t,i,s,r){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new P),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new P),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Ce(()=>{var n;vr(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(n=this._activeProviderReplies)==null||n.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Y(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Y(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Y(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Y(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let s=0;s<i.length;s++){let r=i[s];if(r.classList.contains("xterm"))break;if(r.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var s,r;(!this._activeProviderReplies||!t)&&((s=this._activeProviderReplies)==null||s.forEach(n=>{n==null||n.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[n,a]of this._linkProviderService.linkProviders.entries())t?(r=this._activeProviderReplies)!=null&&r.get(n)&&(i=this._checkLinkProviderResult(n,e,i)):a.provideLinks(e.y,o=>{var l,h;if(this._isMouseOut)return;let c=o==null?void 0:o.map(u=>({link:u}));(l=this._activeProviderReplies)==null||l.set(n,c),i=this._checkLinkProviderResult(n,e,i),((h=this._activeProviderReplies)==null?void 0:h.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let s=0;s<t.size;s++){let r=t.get(s);if(r)for(let n=0;n<r.length;n++){let a=r[n],o=a.link.range.start.y<e?0:a.link.range.start.x,c=a.link.range.end.y>e?this._bufferService.cols:a.link.range.end.x;for(let l=o;l<=c;l++){if(i.has(l)){r.splice(n--,1);break}i.add(l)}}}}_checkLinkProviderResult(e,t,i){var n;if(!this._activeProviderReplies)return i;let s=this._activeProviderReplies.get(e),r=!1;for(let a=0;a<e;a++)(!this._activeProviderReplies.has(a)||this._activeProviderReplies.get(a))&&(r=!0);if(!r&&s){let a=s.find(o=>this._linkAtPosition(o.link,t));a&&(i=!0,this._handleNewLink(a))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let a=0;a<this._activeProviderReplies.size;a++){let o=(n=this._activeProviderReplies.get(a))==null?void 0:n.find(c=>this._linkAtPosition(c.link,t));if(o){i=!0,this._handleNewLink(o);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&X3(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,vr(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var i,s;return(s=(i=this._currentLink)==null?void 0:i.state)==null?void 0:s.decorations.pointerCursor},set:i=>{var s;(s=this._currentLink)!=null&&s.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>{var i,s;return(s=(i=this._currentLink)==null?void 0:i.state)==null?void 0:s.decorations.underline},set:i=>{var s,r,n;(s=this._currentLink)!=null&&s.state&&((n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.underline)!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let s=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(s,r),this._lastMouseEvent)){let n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._askForLink(n,!1)}})))}_linkHover(e,t,i){var s;(s=this._currentLink)!=null&&s.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){var s;(s=this._currentLink)!=null&&s.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=s}_positionFromMouseEvent(e,t,i){let s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};Ad=Te([j(1,Jf),j(2,os),j(3,yt),j(4,Lb)],Ad);function X3(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var Z3=class extends I3{constructor(e={}){super(e),this._linkifier=this._register(new An),this.browser=t1,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new An),this._onCursorMove=this._register(new P),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new P),this.onKey=this._onKey.event,this._onRender=this._register(new P),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new P),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new P),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new P),this.onBell=this._onBell.event,this._onFocus=this._register(new P),this._onBlur=this._register(new P),this._onA11yCharEmitter=this._register(new P),this._onA11yTabEmitter=this._register(new P),this._onWillOpen=this._register(new P),this._setup(),this._decorationService=this._instantiationService.createInstance(Y3),this._instantiationService.setService(no,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(jT),this._instantiationService.setService(Lb,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Vh)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(ct.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(ct.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(ct.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(ct.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Ce(()=>{var t,i;this._customKeyEventHandler=void 0,(i=(t=this.element)==null?void 0:t.parentNode)==null||i.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let t of e){let i,s="";switch(t.index){case 256:i="foreground",s="10";break;case 257:i="background",s="11";break;case 258:i="cursor",s="12";break;default:i="ansi",s="4;"+t.index}switch(t.type){case 0:let r=ve.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${T.ESC}]${s};${L3(r)}${Jb.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(n=>n.ansi[t.index]=Ie.toColor(...t.color));else{let n=i;this._themeService.modifyColors(a=>a[n]=Ie.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Ql,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,a=this.buffer.y*this._renderService.dimensions.css.cell.height,o=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=o+"px",this.textarea.style.top=a+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Y(this.element,"copy",t=>{this.hasSelection()&&tM(t,this._selectionService)}));let e=t=>iM(t,this.textarea,this.coreService,this.optionsService);this._register(Y(this.textarea,"paste",e)),this._register(Y(this.element,"paste",e)),i1?this._register(Y(this.element,"mousedown",t=>{t.button===2&&Ag(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Y(this.element,"contextmenu",t=>{Ag(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),o_&&this._register(Y(this.element,"auxclick",t=>{t.button===1&&kb(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Y(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Y(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Y(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Y(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Y(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Y(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Y(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var r;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((r=this.element)==null?void 0:r.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Y(this.screenElement,"mousemove",n=>this.updateCursorStyle(n))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Fh.get()),n1||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(PT,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(as,this._coreBrowserService),this._register(Y(this.textarea,"focus",n=>this._handleTextAreaFocus(n))),this._register(Y(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(_d,this._document,this._helperContainer),this._instantiationService.setService(Rc,this._charSizeService),this._themeService=this._instantiationService.createInstance(vd),this._instantiationService.setService(Pn,this._themeService),this._characterJoinerService=this._instantiationService.createInstance($l),this._instantiationService.setService(zb,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(gd,this.rows,this.screenElement)),this._instantiationService.setService(os,this._renderService),this._register(this._renderService.onRenderedViewportChange(n=>this._onRender.fire(n))),this.onResize(n=>this._renderService.resize(n.cols,n.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(hd,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(md),this._instantiationService.setService(Jf,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(Ad,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(cd,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(n=>{super.scrollLines(n,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(pd,this.element,this.screenElement,s)),this._instantiationService.setService(uM,this._selectionService),this._register(this._selectionService.onRequestScrollLines(n=>this.scrollLines(n.amount,n.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(n=>this._renderService.handleSelectionChanged(n.start,n.end,n.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(n=>{this.textarea.value=n,this.textarea.focus(),this.textarea.select()})),this._register(ct.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var n;this._selectionService.refresh(),(n=this._viewport)==null||n.queueSync()})),this._register(this._instantiationService.createInstance(ud,this.screenElement)),this._register(Y(this.element,"mousedown",n=>this._selectionService.handleMouseDown(n))),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(Ql,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",n=>this._handleScreenReaderModeOptionChange(n))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Gl,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",n=>{!this._overviewRulerRenderer&&n&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Gl,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(fd,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(n){var l,h,u,d,f;let a=e._mouseService.getMouseReportCoords(n,e.screenElement);if(!a)return!1;let o,c;switch(n.overrideType||n.type){case"mousemove":c=32,n.buttons===void 0?(o=3,n.button!==void 0&&(o=n.button<3?n.button:3)):o=n.buttons&1?0:n.buttons&4?1:n.buttons&2?2:3;break;case"mouseup":c=0,o=n.button<3?n.button:3;break;case"mousedown":c=1,o=n.button<3?n.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(n)===!1)return!1;let _=n.deltaY;if(_===0||e.coreMouseService.consumeWheelEvent(n,(d=(u=(h=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:h.device)==null?void 0:u.cell)==null?void 0:d.height,(f=e._coreBrowserService)==null?void 0:f.dpr)===0)return!1;c=_<0?0:1,o=4;break;default:return!1}return c===void 0||o===void 0||o>4?!1:e.coreMouseService.triggerMouseEvent({col:a.col,row:a.row,x:a.x,y:a.y,button:o,action:c,ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:n=>(i(n),n.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(n)),wheel:n=>(i(n),this.cancel(n,!0)),mousedrag:n=>{n.buttons&&i(n)},mousemove:n=>{n.buttons||i(n)}};this._register(this.coreMouseService.onProtocolChange(n=>{n?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(n)),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()),n&8?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),n&16?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),n&2?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),n&4?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Y(t,"mousedown",n=>{if(n.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(n)))return i(n),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(n)})),this._register(Y(t,"wheel",n=>{var a,o,c,l,h;if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(n)===!1)return!1;if(!this.buffer.hasScrollback){if(n.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(n,(l=(c=(o=(a=e._renderService)==null?void 0:a.dimensions)==null?void 0:o.device)==null?void 0:c.cell)==null?void 0:l.height,(h=e._coreBrowserService)==null?void 0:h.dpr)===0)return this.cancel(n,!0);let u=T.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(n.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(u,!0),this.cancel(n,!0)}}},{passive:!1}))}refresh(e,t){var i;(i=this._renderService)==null||i.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?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(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){Ab(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,i){this._selectionService.setSelection(e,t,i)}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 e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var i;(i=this._selectionService)==null||i.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let i=F3(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let s=this.rows-1;return this.scrollLines(i.type===2?-s:s),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((i.key===T.ETX||i.key===T.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Q3(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var i;(i=this._charSizeService)==null||i.measure()}clear(){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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Pe));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(T.ESC+"[I"):this.coreService.triggerDataEvent(T.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${T.ESC}[4;${i};${t}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${T.ESC}[6;${r};${s}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function Q3(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var J3=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},e5=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new ri)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},pp=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new e5(t)}getNullCell(){return new ri}},t5=class extends Z{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new P),this.onBufferChange=this._onBufferChange.event,this._normal=new pp(this._core.buffers.normal,"normal"),this._alternate=new pp(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)}},i5=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,s)=>t(i,s.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},s5=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},r5=["cols","rows"],pi=0,n5=class extends Z{constructor(e){super(),this._core=this._register(new Z3(e)),this._addonManager=this._register(new J3),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],i=(s,r)=>{this._checkReadonlyOptions(s),this._core.options[s]=r};for(let s in this._core.options){let r={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,r)}}_checkReadonlyOptions(e){if(r5.includes(e))throw new Error(`Option "${e}" 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 i5(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new s5(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 t5(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
245
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Fh.get()},set promptLabel(e){Fh.set(e)},get tooMuchOutput(){return Kh.get()},set tooMuchOutput(e){Kh.set(e)}}}_verifyIntegers(...e){for(pi of e)if(pi===1/0||isNaN(pi)||pi%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(pi of e)if(pi&&(pi===1/0||isNaN(pi)||pi%1!==0||pi<0))throw new Error("This API only accepts positive integers")}};/**
|
|
246
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
247
|
+
* @license MIT
|
|
248
|
+
*
|
|
249
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
250
|
+
* @license MIT
|
|
251
|
+
*
|
|
252
|
+
* Originally forked from (with the author's permission):
|
|
253
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
254
|
+
* http://bellard.org/jslinux/
|
|
255
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
256
|
+
*/var a5=2,o5=1,l5=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var u;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((u=this._terminal.options.overviewRuler)==null?void 0:u.width)||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),a={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},o=a.top+a.bottom,c=a.right+a.left,l=s-o,h=r-c-t;return{cols:Math.max(a5,Math.floor(h/e.css.cell.width)),rows:Math.max(o5,Math.floor(l/e.css.cell.height))}}};function c5({session:e}){const t=S.useRef(null);return S.useEffect(()=>{const i=t.current;if(!i)return;const s=new n5({fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:13,theme:{background:"#18181b"},cursorBlink:!0}),r=new l5;s.loadAddon(r),s.open(i),r.fit();const n=window.location.protocol==="https:"?"wss":"ws",a=new WebSocket(`${n}://${window.location.host}/api/terminal?sessionId=${encodeURIComponent(e.sessionId)}`),o=h=>a.readyState===WebSocket.OPEN&&a.send(JSON.stringify(h));a.onopen=()=>o({type:"resize",cols:s.cols,rows:s.rows}),a.onmessage=h=>{const u=JSON.parse(h.data);u.type==="output"&&u.data!==void 0&&s.write(u.data)},a.onclose=()=>s.write(`\r
|
|
257
|
+
\x1B[2m[disconnected]\x1B[0m\r
|
|
258
|
+
`);const c=s.onData(h=>o({type:"input",data:h})),l=new ResizeObserver(()=>{r.fit(),o({type:"resize",cols:s.cols,rows:s.rows})});return l.observe(i),()=>{l.disconnect(),c.dispose(),a.close(),s.dispose()}},[e.sessionId]),b.jsx("div",{ref:t,className:"h-full w-full bg-[#18181b] p-1"})}function u5(e){return[{id:"files",title:e("apps.files"),icon:A0,defaultSize:{w:520,h:460},render:t=>b.jsx(VR,{...t})},{id:"editor",title:e("apps.editor"),icon:Fx,defaultSize:{w:600,h:480},render:t=>b.jsx(XR,{...t})},{id:"monitor",title:e("apps.monitor"),icon:Px,defaultSize:{w:460,h:360},render:t=>b.jsx(GR,{...t})},{id:"system",title:e("apps.system"),icon:$x,defaultSize:{w:560,h:460},render:t=>b.jsx($R,{...t})},{id:"terminal",title:e("apps.terminal"),icon:_2,defaultSize:{w:640,h:420},render:t=>b.jsx(c5,{...t})}]}function h5({t:e,session:t,onDisconnect:i}){const s=S.useMemo(()=>u5(e),[e]),r=OR(),[n,a]=S.useState(null),o=S.useCallback(u=>{a(u);const d=s.find(f=>f.id==="editor");d&&r.openApp(d)},[s,r]),c={t:e,session:t,editorTarget:n,openEditor:o},l=r.windows.filter(u=>!u.minimized),h=l.length>0?l.reduce((u,d)=>u.z>=d.z?u:d).id:null;return b.jsxs("div",{className:"flex h-screen flex-col overflow-hidden bg-background",children:[b.jsxs("div",{className:"relative min-h-0 flex-1",style:{backgroundColor:"oklch(0.16 0.006 285.8)",backgroundImage:"radial-gradient(60% 60% at 25% 15%, rgba(99,102,241,0.16), transparent 70%),radial-gradient(55% 55% at 85% 80%, rgba(56,189,248,0.10), transparent 70%)"},children:[b.jsx("div",{className:"pointer-events-none absolute top-4 left-4 text-xs font-semibold tracking-widest text-muted-foreground/60 select-none",children:"DeskSSH"}),r.windows.map(u=>{var d;return u.minimized?null:b.jsx(zR,{win:u,active:u.id===h,onFocus:()=>r.focus(u.id),onClose:()=>r.close(u.id),onMinimize:()=>r.minimize(u.id),onToggleMaximize:()=>r.toggleMaximize(u.id),onMove:(f,_)=>r.move(u.id,f,_),onResize:(f,_)=>r.resize(u.id,f,_),children:(d=s.find(f=>f.id===u.appId))==null?void 0:d.render(c)},u.id)})]}),b.jsx(jR,{t:e,apps:s,windows:r.windows,activeId:h,host:t.host,onLaunch:r.openApp,onSelectWindow:r.focus,onDisconnect:i})]})}function d5(){const e=S.useMemo(()=>Ex(Cx()),[]),[t,i]=S.useState(null),[s,r]=S.useState(!1),[n,a]=S.useState(null),[o,c]=S.useState(null),[l,h]=S.useState(null);function u(m){r(!0),a(null),Ax(m).then(w=>{if(w.status==="verify-host-key"){h(m),c({fingerprint:w.fingerprint,algorithm:w.algorithm});return}i(w)}).catch(w=>a(w instanceof Error?w.message:String(w))).finally(()=>r(!1))}function d(){if(!l||!o)return;const m={...l,trustFingerprint:o.fingerprint};c(null),h(null),u(m)}function f(){c(null),h(null)}function _(){t&&kx(t.sessionId),i(null)}return t?b.jsx(h5,{t:e,session:t,onDisconnect:_}):b.jsxs("main",{className:"flex min-h-screen flex-col items-center gap-6 px-4 py-10",children:[b.jsx("header",{className:"text-sm font-bold tracking-wide text-muted-foreground",children:"DeskSSH"}),b.jsx(SR,{t:e,busy:s,error:n,onSubmit:u}),b.jsx(TR,{t:e,prompt:o,onConfirm:d,onCancel:f})]})}const m1=document.getElementById("root");if(!m1)throw new Error("Root element #root not found");vx.createRoot(m1).render(b.jsx(S.StrictMode,{children:b.jsx(d5,{})}));
|