@unlikeotherai/unloved 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +820 -0
- package/package.json +32 -0
- package/public/assets/index-BBCy7fgT.js +152 -0
- package/public/assets/index-u3hNJUdm.css +1 -0
- package/public/assets/inter-latin-100-normal-Cg8nSI4P.woff2 +0 -0
- package/public/assets/inter-latin-100-normal-J9XNenR1.woff +0 -0
- package/public/assets/inter-latin-200-normal-CGIQ4gbF.woff2 +0 -0
- package/public/assets/inter-latin-200-normal-fAycq8N-.woff +0 -0
- package/public/assets/inter-latin-300-normal-BVlfKGgI.woff2 +0 -0
- package/public/assets/inter-latin-300-normal-i8F0SvXL.woff +0 -0
- package/public/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
- package/public/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
- package/public/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
- package/public/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
- package/public/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
- package/public/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
- package/public/assets/inter-latin-700-normal-Drs_5D37.woff2 +0 -0
- package/public/assets/inter-latin-700-normal-KTwiWvO9.woff +0 -0
- package/public/assets/inter-latin-800-normal-BYj_oED-.woff2 +0 -0
- package/public/assets/inter-latin-800-normal-D1mf63XC.woff +0 -0
- package/public/assets/inter-latin-900-normal-D4nM5aha.woff2 +0 -0
- package/public/assets/inter-latin-900-normal-EUCDUbiG.woff +0 -0
- package/public/assets/jetbrains-mono-latin-100-normal-DlYB2XW3.woff2 +0 -0
- package/public/assets/jetbrains-mono-latin-100-normal-DzH8uRxw.woff +0 -0
- package/public/assets/jetbrains-mono-latin-200-normal-CHn02WOn.woff +0 -0
- package/public/assets/jetbrains-mono-latin-200-normal-DvzYDkvL.woff2 +0 -0
- package/public/assets/jetbrains-mono-latin-300-normal-BYcAiAh2.woff +0 -0
- package/public/assets/jetbrains-mono-latin-300-normal-DuMDZskh.woff2 +0 -0
- package/public/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/public/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/public/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/public/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/public/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
- package/public/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- package/public/assets/jetbrains-mono-latin-700-normal-BYuf6tUa.woff2 +0 -0
- package/public/assets/jetbrains-mono-latin-700-normal-D3wTyLJW.woff +0 -0
- package/public/assets/jetbrains-mono-latin-800-normal-D2mQHRMK.woff2 +0 -0
- package/public/assets/jetbrains-mono-latin-800-normal-Dj9qwObk.woff +0 -0
- package/public/favicon.png +0 -0
- package/public/index.html +14 -0
- package/public/logo.png +0 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
var Qv=e=>{throw TypeError(e)};var Jv=(e,i,n)=>i.has(e)||Qv("Cannot "+n);var ll=(e,i,n)=>(Jv(e,i,"read from private field"),n?n.call(e):i.get(e)),eg=(e,i,n)=>i.has(e)?Qv("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,n),tg=(e,i,n,l)=>(Jv(e,i,"write to private field"),l?l.call(e,n):i.set(e,n),n);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function n(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(o){if(o.ep)return;o.ep=!0;const c=n(o);fetch(o.href,c)}})();function ay(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bc={exports:{}},al={};/**
|
|
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 ig;function oy(){if(ig)return al;ig=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function n(l,o,c){var f=null;if(c!==void 0&&(f=""+c),o.key!==void 0&&(f=""+o.key),"key"in o){c={};for(var _ in o)_!=="key"&&(c[_]=o[_])}else c=o;return o=c.ref,{$$typeof:e,type:l,key:f,ref:o!==void 0?o:null,props:c}}return al.Fragment=i,al.jsx=n,al.jsxs=n,al}var sg;function hy(){return sg||(sg=1,Bc.exports=oy()),Bc.exports}var Z=hy(),Oc={exports:{}},ol={},zc={exports:{}},Lc={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* scheduler.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 rg;function cy(){return rg||(rg=1,(function(e){function i(k,U){var H=k.length;k.push(U);e:for(;0<H;){var oe=H-1>>>1,w=k[oe];if(0<o(w,U))k[oe]=U,k[H]=w,H=oe;else break e}}function n(k){return k.length===0?null:k[0]}function l(k){if(k.length===0)return null;var U=k[0],H=k.pop();if(H!==U){k[0]=H;e:for(var oe=0,w=k.length,j=w>>>1;oe<j;){var J=2*(oe+1)-1,F=k[J],se=J+1,_e=k[se];if(0>o(F,H))se<w&&0>o(_e,F)?(k[oe]=_e,k[se]=H,oe=se):(k[oe]=F,k[J]=H,oe=J);else if(se<w&&0>o(_e,H))k[oe]=_e,k[se]=H,oe=se;else break e}}return U}function o(k,U){var H=k.sortIndex-U.sortIndex;return H!==0?H:k.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var f=Date,_=f.now();e.unstable_now=function(){return f.now()-_}}var v=[],d=[],m=1,S=null,y=3,D=!1,C=!1,E=!1,B=!1,z=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function q(k){for(var U=n(d);U!==null;){if(U.callback===null)l(d);else if(U.startTime<=k)l(d),U.sortIndex=U.expirationTime,i(v,U);else break;U=n(d)}}function L(k){if(E=!1,q(k),!C)if(n(v)!==null)C=!0,ee||(ee=!0,V());else{var U=n(d);U!==null&&G(L,U.startTime-k)}}var ee=!1,le=-1,de=5,Te=-1;function Qe(){return B?!0:!(e.unstable_now()-Te<de)}function ie(){if(B=!1,ee){var k=e.unstable_now();Te=k;var U=!0;try{e:{C=!1,E&&(E=!1,Q(le),le=-1),D=!0;var H=y;try{t:{for(q(k),S=n(v);S!==null&&!(S.expirationTime>k&&Qe());){var oe=S.callback;if(typeof oe=="function"){S.callback=null,y=S.priorityLevel;var w=oe(S.expirationTime<=k);if(k=e.unstable_now(),typeof w=="function"){S.callback=w,q(k),U=!0;break t}S===n(v)&&l(v),q(k)}else l(v);S=n(v)}if(S!==null)U=!0;else{var j=n(d);j!==null&&G(L,j.startTime-k),U=!1}}break e}finally{S=null,y=H,D=!1}U=void 0}}finally{U?V():ee=!1}}}var V;if(typeof X=="function")V=function(){X(ie)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,$=N.port2;N.port1.onmessage=ie,V=function(){$.postMessage(null)}}else V=function(){z(ie,0)};function G(k,U){le=z(function(){k(e.unstable_now())},U)}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(k){k.callback=null},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):de=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(k){switch(y){case 1:case 2:case 3:var U=3;break;default:U=y}var H=y;y=U;try{return k()}finally{y=H}},e.unstable_requestPaint=function(){B=!0},e.unstable_runWithPriority=function(k,U){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var H=y;y=k;try{return U()}finally{y=H}},e.unstable_scheduleCallback=function(k,U,H){var oe=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?oe+H:oe):H=oe,k){case 1:var w=-1;break;case 2:w=250;break;case 5:w=1073741823;break;case 4:w=1e4;break;default:w=5e3}return w=H+w,k={id:m++,callback:U,priorityLevel:k,startTime:H,expirationTime:w,sortIndex:-1},H>oe?(k.sortIndex=H,i(d,k),n(v)===null&&k===n(d)&&(E?(Q(le),le=-1):E=!0,G(L,H-oe))):(k.sortIndex=w,i(v,k),C||D||(C=!0,ee||(ee=!0,V()))),k},e.unstable_shouldYield=Qe,e.unstable_wrapCallback=function(k){var U=y;return function(){var H=y;y=U;try{return k.apply(this,arguments)}finally{y=H}}}})(Lc)),Lc}var ng;function uy(){return ng||(ng=1,zc.exports=cy()),zc.exports}var Nc={exports:{}},ve={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* react.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var lg;function fy(){if(lg)return ve;lg=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),S=Symbol.iterator;function y(w){return w===null||typeof w!="object"?null:(w=S&&w[S]||w["@@iterator"],typeof w=="function"?w:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,E={};function B(w,j,J){this.props=w,this.context=j,this.refs=E,this.updater=J||D}B.prototype.isReactComponent={},B.prototype.setState=function(w,j){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,j,"setState")},B.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function z(){}z.prototype=B.prototype;function Q(w,j,J){this.props=w,this.context=j,this.refs=E,this.updater=J||D}var X=Q.prototype=new z;X.constructor=Q,C(X,B.prototype),X.isPureReactComponent=!0;var q=Array.isArray,L={H:null,A:null,T:null,S:null,V:null},ee=Object.prototype.hasOwnProperty;function le(w,j,J,F,se,_e){return J=_e.ref,{$$typeof:e,type:w,key:j,ref:J!==void 0?J:null,props:_e}}function de(w,j){return le(w.type,j,void 0,void 0,void 0,w.props)}function Te(w){return typeof w=="object"&&w!==null&&w.$$typeof===e}function Qe(w){var j={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(J){return j[J]})}var ie=/\/+/g;function V(w,j){return typeof w=="object"&&w!==null&&w.key!=null?Qe(""+w.key):j.toString(36)}function N(){}function $(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(N,N):(w.status="pending",w.then(function(j){w.status==="pending"&&(w.status="fulfilled",w.value=j)},function(j){w.status==="pending"&&(w.status="rejected",w.reason=j)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function G(w,j,J,F,se){var _e=typeof w;(_e==="undefined"||_e==="boolean")&&(w=null);var re=!1;if(w===null)re=!0;else switch(_e){case"bigint":case"string":case"number":re=!0;break;case"object":switch(w.$$typeof){case e:case i:re=!0;break;case m:return re=w._init,G(re(w._payload),j,J,F,se)}}if(re)return se=se(w),re=F===""?"."+V(w,0):F,q(se)?(J="",re!=null&&(J=re.replace(ie,"$&/")+"/"),G(se,j,J,"",function(st){return st})):se!=null&&(Te(se)&&(se=de(se,J+(se.key==null||w&&w.key===se.key?"":(""+se.key).replace(ie,"$&/")+"/")+re)),j.push(se)),1;re=0;var Ue=F===""?".":F+":";if(q(w))for(var De=0;De<w.length;De++)F=w[De],_e=Ue+V(F,De),re+=G(F,j,J,_e,se);else if(De=y(w),typeof De=="function")for(w=De.call(w),De=0;!(F=w.next()).done;)F=F.value,_e=Ue+V(F,De++),re+=G(F,j,J,_e,se);else if(_e==="object"){if(typeof w.then=="function")return G($(w),j,J,F,se);throw j=String(w),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return re}function k(w,j,J){if(w==null)return w;var F=[],se=0;return G(w,F,"","",function(_e){return j.call(J,_e,se++)}),F}function U(w){if(w._status===-1){var j=w._result;j=j(),j.then(function(J){(w._status===0||w._status===-1)&&(w._status=1,w._result=J)},function(J){(w._status===0||w._status===-1)&&(w._status=2,w._result=J)}),w._status===-1&&(w._status=0,w._result=j)}if(w._status===1)return w._result.default;throw w._result}var H=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)};function oe(){}return ve.Children={map:k,forEach:function(w,j,J){k(w,function(){j.apply(this,arguments)},J)},count:function(w){var j=0;return k(w,function(){j++}),j},toArray:function(w){return k(w,function(j){return j})||[]},only:function(w){if(!Te(w))throw Error("React.Children.only expected to receive a single React element child.");return w}},ve.Component=B,ve.Fragment=n,ve.Profiler=o,ve.PureComponent=Q,ve.StrictMode=l,ve.Suspense=v,ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,ve.__COMPILER_RUNTIME={__proto__:null,c:function(w){return L.H.useMemoCache(w)}},ve.cache=function(w){return function(){return w.apply(null,arguments)}},ve.cloneElement=function(w,j,J){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var F=C({},w.props),se=w.key,_e=void 0;if(j!=null)for(re in j.ref!==void 0&&(_e=void 0),j.key!==void 0&&(se=""+j.key),j)!ee.call(j,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&j.ref===void 0||(F[re]=j[re]);var re=arguments.length-2;if(re===1)F.children=J;else if(1<re){for(var Ue=Array(re),De=0;De<re;De++)Ue[De]=arguments[De+2];F.children=Ue}return le(w.type,se,void 0,void 0,_e,F)},ve.createContext=function(w){return w={$$typeof:f,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:c,_context:w},w},ve.createElement=function(w,j,J){var F,se={},_e=null;if(j!=null)for(F in j.key!==void 0&&(_e=""+j.key),j)ee.call(j,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(se[F]=j[F]);var re=arguments.length-2;if(re===1)se.children=J;else if(1<re){for(var Ue=Array(re),De=0;De<re;De++)Ue[De]=arguments[De+2];se.children=Ue}if(w&&w.defaultProps)for(F in re=w.defaultProps,re)se[F]===void 0&&(se[F]=re[F]);return le(w,_e,void 0,void 0,null,se)},ve.createRef=function(){return{current:null}},ve.forwardRef=function(w){return{$$typeof:_,render:w}},ve.isValidElement=Te,ve.lazy=function(w){return{$$typeof:m,_payload:{_status:-1,_result:w},_init:U}},ve.memo=function(w,j){return{$$typeof:d,type:w,compare:j===void 0?null:j}},ve.startTransition=function(w){var j=L.T,J={};L.T=J;try{var F=w(),se=L.S;se!==null&&se(J,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(oe,H)}catch(_e){H(_e)}finally{L.T=j}},ve.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},ve.use=function(w){return L.H.use(w)},ve.useActionState=function(w,j,J){return L.H.useActionState(w,j,J)},ve.useCallback=function(w,j){return L.H.useCallback(w,j)},ve.useContext=function(w){return L.H.useContext(w)},ve.useDebugValue=function(){},ve.useDeferredValue=function(w,j){return L.H.useDeferredValue(w,j)},ve.useEffect=function(w,j,J){var F=L.H;if(typeof J=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return F.useEffect(w,j)},ve.useId=function(){return L.H.useId()},ve.useImperativeHandle=function(w,j,J){return L.H.useImperativeHandle(w,j,J)},ve.useInsertionEffect=function(w,j){return L.H.useInsertionEffect(w,j)},ve.useLayoutEffect=function(w,j){return L.H.useLayoutEffect(w,j)},ve.useMemo=function(w,j){return L.H.useMemo(w,j)},ve.useOptimistic=function(w,j){return L.H.useOptimistic(w,j)},ve.useReducer=function(w,j,J){return L.H.useReducer(w,j,J)},ve.useRef=function(w){return L.H.useRef(w)},ve.useState=function(w){return L.H.useState(w)},ve.useSyncExternalStore=function(w,j,J){return L.H.useSyncExternalStore(w,j,J)},ve.useTransition=function(){return L.H.useTransition()},ve.version="19.1.0",ve}var ag;function Pu(){return ag||(ag=1,Nc.exports=fy()),Nc.exports}var Hc={exports:{}},Et={};/**
|
|
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 og;function dy(){if(og)return Et;og=1;var e=Pu();function i(v){var d="https://react.dev/errors/"+v;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+v+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var l={d:{f:n,r:function(){throw Error(i(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(v,d,m){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:S==null?null:""+S,children:v,containerInfo:d,implementation:m}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function _(v,d){if(v==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Et.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Et.createPortal=function(v,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(i(299));return c(v,d,null,m)},Et.flushSync=function(v){var d=f.T,m=l.p;try{if(f.T=null,l.p=2,v)return v()}finally{f.T=d,l.p=m,l.d.f()}},Et.preconnect=function(v,d){typeof v=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,l.d.C(v,d))},Et.prefetchDNS=function(v){typeof v=="string"&&l.d.D(v)},Et.preinit=function(v,d){if(typeof v=="string"&&d&&typeof d.as=="string"){var m=d.as,S=_(m,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,D=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?l.d.S(v,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:S,integrity:y,fetchPriority:D}):m==="script"&&l.d.X(v,{crossOrigin:S,integrity:y,fetchPriority:D,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Et.preinitModule=function(v,d){if(typeof v=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=_(d.as,d.crossOrigin);l.d.M(v,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&l.d.M(v)},Et.preload=function(v,d){if(typeof v=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,S=_(m,d.crossOrigin);l.d.L(v,m,{crossOrigin:S,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Et.preloadModule=function(v,d){if(typeof v=="string")if(d){var m=_(d.as,d.crossOrigin);l.d.m(v,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else l.d.m(v)},Et.requestFormReset=function(v){l.d.r(v)},Et.unstable_batchedUpdates=function(v,d){return v(d)},Et.useFormState=function(v,d,m){return f.H.useFormState(v,d,m)},Et.useFormStatus=function(){return f.H.useHostTransitionStatus()},Et.version="19.1.0",Et}var hg;function _y(){if(hg)return Hc.exports;hg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Hc.exports=dy(),Hc.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 cg;function vy(){if(cg)return ol;cg=1;var e=uy(),i=Pu(),n=_y();function l(t){var s="https://react.dev/errors/"+t;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)s+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+t+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var s=t,r=t;if(t.alternate)for(;s.return;)s=s.return;else{t=s;do s=t,(s.flags&4098)!==0&&(r=s.return),t=s.return;while(t)}return s.tag===3?r:null}function f(t){if(t.tag===13){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function _(t){if(c(t)!==t)throw Error(l(188))}function v(t){var s=t.alternate;if(!s){if(s=c(t),s===null)throw Error(l(188));return s!==t?null:t}for(var r=t,a=s;;){var h=r.return;if(h===null)break;var u=h.alternate;if(u===null){if(a=h.return,a!==null){r=a;continue}break}if(h.child===u.child){for(u=h.child;u;){if(u===r)return _(h),t;if(u===a)return _(h),s;u=u.sibling}throw Error(l(188))}if(r.return!==a.return)r=h,a=u;else{for(var g=!1,p=h.child;p;){if(p===r){g=!0,r=h,a=u;break}if(p===a){g=!0,a=h,r=u;break}p=p.sibling}if(!g){for(p=u.child;p;){if(p===r){g=!0,r=u,a=h;break}if(p===a){g=!0,a=u,r=h;break}p=p.sibling}if(!g)throw Error(l(189))}}if(r.alternate!==a)throw Error(l(190))}if(r.tag!==3)throw Error(l(188));return r.stateNode.current===r?t:s}function d(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t;for(t=t.child;t!==null;){if(s=d(t),s!==null)return s;t=t.sibling}return null}var m=Object.assign,S=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),Q=Symbol.for("react.consumer"),X=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),Te=Symbol.for("react.activity"),Qe=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function V(t){return t===null||typeof t!="object"?null:(t=ie&&t[ie]||t["@@iterator"],typeof t=="function"?t:null)}var N=Symbol.for("react.client.reference");function $(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===N?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case B:return"Profiler";case E:return"StrictMode";case L:return"Suspense";case ee:return"SuspenseList";case Te:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case D:return"Portal";case X:return(t.displayName||"Context")+".Provider";case Q:return(t._context.displayName||"Context")+".Consumer";case q:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case le:return s=t.displayName||null,s!==null?s:$(t.type)||"Memo";case de:s=t._payload,t=t._init;try{return $(t(s))}catch{}}return null}var G=Array.isArray,k=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},oe=[],w=-1;function j(t){return{current:t}}function J(t){0>w||(t.current=oe[w],oe[w]=null,w--)}function F(t,s){w++,oe[w]=t.current,t.current=s}var se=j(null),_e=j(null),re=j(null),Ue=j(null);function De(t,s){switch(F(re,s),F(_e,t),F(se,null),s.nodeType){case 9:case 11:t=(t=s.documentElement)&&(t=t.namespaceURI)?kv(t):0;break;default:if(t=s.tagName,s=s.namespaceURI)s=kv(s),t=Dv(s,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}J(se),F(se,t)}function st(){J(se),J(_e),J(re)}function Zi(t){t.memoizedState!==null&&F(Ue,t);var s=se.current,r=Dv(s,t.type);s!==r&&(F(_e,t),F(se,r))}function gi(t){_e.current===t&&(J(se),J(_e)),Ue.current===t&&(J(Ue),tl._currentValue=H)}var Qt=Object.prototype.hasOwnProperty,xe=e.unstable_scheduleCallback,Ts=e.unstable_cancelCallback,Pm=e.unstable_shouldYield,qm=e.unstable_requestPaint,pi=e.unstable_now,jm=e.unstable_getCurrentPriorityLevel,lf=e.unstable_ImmediatePriority,af=e.unstable_UserBlockingPriority,Tl=e.unstable_NormalPriority,Wm=e.unstable_LowPriority,of=e.unstable_IdlePriority,Ym=e.log,Km=e.unstable_setDisableYieldValue,hn=null,qt=null;function Qi(t){if(typeof Ym=="function"&&Km(t),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(hn,t)}catch{}}var jt=Math.clz32?Math.clz32:Gm,Vm=Math.log,Xm=Math.LN2;function Gm(t){return t>>>=0,t===0?32:31-(Vm(t)/Xm|0)|0}var Al=256,Bl=4194304;function As(t){var s=t&42;if(s!==0)return s;switch(t&-t){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:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ol(t,s,r){var a=t.pendingLanes;if(a===0)return 0;var h=0,u=t.suspendedLanes,g=t.pingedLanes;t=t.warmLanes;var p=a&134217727;return p!==0?(a=p&~u,a!==0?h=As(a):(g&=p,g!==0?h=As(g):r||(r=p&~t,r!==0&&(h=As(r))))):(p=a&~u,p!==0?h=As(p):g!==0?h=As(g):r||(r=a&~t,r!==0&&(h=As(r)))),h===0?0:s!==0&&s!==h&&(s&u)===0&&(u=h&-h,r=s&-s,u>=r||u===32&&(r&4194048)!==0)?s:h}function cn(t,s){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&s)===0}function $m(t,s){switch(t){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 hf(){var t=Al;return Al<<=1,(Al&4194048)===0&&(Al=256),t}function cf(){var t=Bl;return Bl<<=1,(Bl&62914560)===0&&(Bl=4194304),t}function bo(t){for(var s=[],r=0;31>r;r++)s.push(t);return s}function un(t,s){t.pendingLanes|=s,s!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Fm(t,s,r,a,h,u){var g=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var p=t.entanglements,b=t.expirationTimes,T=t.hiddenUpdates;for(r=g&~r;0<r;){var P=31-jt(r),K=1<<P;p[P]=0,b[P]=-1;var A=T[P];if(A!==null)for(T[P]=null,P=0;P<A.length;P++){var O=A[P];O!==null&&(O.lane&=-536870913)}r&=~K}a!==0&&uf(t,a,0),u!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=u&~(g&~s))}function uf(t,s,r){t.pendingLanes|=s,t.suspendedLanes&=~s;var a=31-jt(s);t.entangledLanes|=s,t.entanglements[a]=t.entanglements[a]|1073741824|r&4194090}function ff(t,s){var r=t.entangledLanes|=s;for(t=t.entanglements;r;){var a=31-jt(r),h=1<<a;h&s|t[a]&s&&(t[a]|=s),r&=~h}}function wo(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Co(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function df(){var t=U.p;return t!==0?t:(t=window.event,t===void 0?32:Xv(t.type))}function Im(t,s){var r=U.p;try{return U.p=t,s()}finally{U.p=r}}var Ji=Math.random().toString(36).slice(2),Ct="__reactFiber$"+Ji,Ot="__reactProps$"+Ji,cr="__reactContainer$"+Ji,xo="__reactEvents$"+Ji,Zm="__reactListeners$"+Ji,Qm="__reactHandles$"+Ji,_f="__reactResources$"+Ji,fn="__reactMarker$"+Ji;function Eo(t){delete t[Ct],delete t[Ot],delete t[xo],delete t[Zm],delete t[Qm]}function ur(t){var s=t[Ct];if(s)return s;for(var r=t.parentNode;r;){if(s=r[cr]||r[Ct]){if(r=s.alternate,s.child!==null||r!==null&&r.child!==null)for(t=Av(t);t!==null;){if(r=t[Ct])return r;t=Av(t)}return s}t=r,r=t.parentNode}return null}function fr(t){if(t=t[Ct]||t[cr]){var s=t.tag;if(s===5||s===6||s===13||s===26||s===27||s===3)return t}return null}function dn(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t.stateNode;throw Error(l(33))}function dr(t){var s=t[_f];return s||(s=t[_f]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function ht(t){t[fn]=!0}var vf=new Set,gf={};function Bs(t,s){_r(t,s),_r(t+"Capture",s)}function _r(t,s){for(gf[t]=s,t=0;t<s.length;t++)vf.add(s[t])}var Jm=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]*$"),pf={},mf={};function eS(t){return Qt.call(mf,t)?!0:Qt.call(pf,t)?!1:Jm.test(t)?mf[t]=!0:(pf[t]=!0,!1)}function zl(t,s,r){if(eS(s))if(r===null)t.removeAttribute(s);else{switch(typeof r){case"undefined":case"function":case"symbol":t.removeAttribute(s);return;case"boolean":var a=s.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){t.removeAttribute(s);return}}t.setAttribute(s,""+r)}}function Ll(t,s,r){if(r===null)t.removeAttribute(s);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttribute(s,""+r)}}function Ai(t,s,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttributeNS(s,r,""+a)}}var ko,Sf;function vr(t){if(ko===void 0)try{throw Error()}catch(r){var s=r.stack.trim().match(/\n( *(at )?)/);ko=s&&s[1]||"",Sf=-1<r.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+ko+t+Sf}var Do=!1;function Mo(t,s){if(!t||Do)return"";Do=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(s){var K=function(){throw Error()};if(Object.defineProperty(K.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(K,[])}catch(O){var A=O}Reflect.construct(t,[],K)}else{try{K.call()}catch(O){A=O}t.call(K.prototype)}}else{try{throw Error()}catch(O){A=O}(K=t())&&typeof K.catch=="function"&&K.catch(function(){})}}catch(O){if(O&&A&&typeof O.stack=="string")return[O.stack,A.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),g=u[0],p=u[1];if(g&&p){var b=g.split(`
|
|
44
|
+
`),T=p.split(`
|
|
45
|
+
`);for(h=a=0;a<b.length&&!b[a].includes("DetermineComponentFrameRoot");)a++;for(;h<T.length&&!T[h].includes("DetermineComponentFrameRoot");)h++;if(a===b.length||h===T.length)for(a=b.length-1,h=T.length-1;1<=a&&0<=h&&b[a]!==T[h];)h--;for(;1<=a&&0<=h;a--,h--)if(b[a]!==T[h]){if(a!==1||h!==1)do if(a--,h--,0>h||b[a]!==T[h]){var P=`
|
|
46
|
+
`+b[a].replace(" at new "," at ");return t.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",t.displayName)),P}while(1<=a&&0<=h);break}}}finally{Do=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?vr(r):""}function tS(t){switch(t.tag){case 26:case 27:case 5:return vr(t.type);case 16:return vr("Lazy");case 13:return vr("Suspense");case 19:return vr("SuspenseList");case 0:case 15:return Mo(t.type,!1);case 11:return Mo(t.type.render,!1);case 1:return Mo(t.type,!0);case 31:return vr("Activity");default:return""}}function yf(t){try{var s="";do s+=tS(t),t=t.return;while(t);return s}catch(r){return`
|
|
47
|
+
Error generating stack: `+r.message+`
|
|
48
|
+
`+r.stack}}function Jt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function bf(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function iS(t){var s=bf(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,s),a=""+t[s];if(!t.hasOwnProperty(s)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var h=r.get,u=r.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return h.call(this)},set:function(g){a=""+g,u.call(this,g)}}),Object.defineProperty(t,s,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(g){a=""+g},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function Nl(t){t._valueTracker||(t._valueTracker=iS(t))}function wf(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var r=s.getValue(),a="";return t&&(a=bf(t)?t.checked?"true":"false":t.value),t=a,t!==r?(s.setValue(t),!0):!1}function Hl(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var sS=/[\n"\\]/g;function ei(t){return t.replace(sS,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ro(t,s,r,a,h,u,g,p){t.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?t.type=g:t.removeAttribute("type"),s!=null?g==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+Jt(s)):t.value!==""+Jt(s)&&(t.value=""+Jt(s)):g!=="submit"&&g!=="reset"||t.removeAttribute("value"),s!=null?To(t,g,Jt(s)):r!=null?To(t,g,Jt(r)):a!=null&&t.removeAttribute("value"),h==null&&u!=null&&(t.defaultChecked=!!u),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?t.name=""+Jt(p):t.removeAttribute("name")}function Cf(t,s,r,a,h,u,g,p){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),s!=null||r!=null){if(!(u!=="submit"&&u!=="reset"||s!=null))return;r=r!=null?""+Jt(r):"",s=s!=null?""+Jt(s):r,p||s===t.value||(t.value=s),t.defaultValue=s}a=a??h,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=p?t.checked:!!a,t.defaultChecked=!!a,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.name=g)}function To(t,s,r){s==="number"&&Hl(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function gr(t,s,r,a){if(t=t.options,s){s={};for(var h=0;h<r.length;h++)s["$"+r[h]]=!0;for(r=0;r<t.length;r++)h=s.hasOwnProperty("$"+t[r].value),t[r].selected!==h&&(t[r].selected=h),h&&a&&(t[r].defaultSelected=!0)}else{for(r=""+Jt(r),s=null,h=0;h<t.length;h++){if(t[h].value===r){t[h].selected=!0,a&&(t[h].defaultSelected=!0);return}s!==null||t[h].disabled||(s=t[h])}s!==null&&(s.selected=!0)}}function xf(t,s,r){if(s!=null&&(s=""+Jt(s),s!==t.value&&(t.value=s),r==null)){t.defaultValue!==s&&(t.defaultValue=s);return}t.defaultValue=r!=null?""+Jt(r):""}function Ef(t,s,r,a){if(s==null){if(a!=null){if(r!=null)throw Error(l(92));if(G(a)){if(1<a.length)throw Error(l(93));a=a[0]}r=a}r==null&&(r=""),s=r}r=Jt(s),t.defaultValue=r,a=t.textContent,a===r&&a!==""&&a!==null&&(t.value=a)}function pr(t,s){if(s){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=s;return}}t.textContent=s}var rS=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 kf(t,s,r){var a=s.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?a?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="":a?t.setProperty(s,r):typeof r!="number"||r===0||rS.has(s)?s==="float"?t.cssFloat=r:t[s]=(""+r).trim():t[s]=r+"px"}function Df(t,s,r){if(s!=null&&typeof s!="object")throw Error(l(62));if(t=t.style,r!=null){for(var a in r)!r.hasOwnProperty(a)||s!=null&&s.hasOwnProperty(a)||(a.indexOf("--")===0?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="");for(var h in s)a=s[h],s.hasOwnProperty(h)&&r[h]!==a&&kf(t,h,a)}else for(var u in s)s.hasOwnProperty(u)&&kf(t,u,s[u])}function Ao(t){if(t.indexOf("-")===-1)return!1;switch(t){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 nS=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"]]),lS=/^[\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 Ul(t){return lS.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Bo=null;function Oo(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var mr=null,Sr=null;function Mf(t){var s=fr(t);if(s&&(t=s.stateNode)){var r=t[Ot]||null;e:switch(t=s.stateNode,s.type){case"input":if(Ro(t,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),s=r.name,r.type==="radio"&&s!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+ei(""+s)+'"][type="radio"]'),s=0;s<r.length;s++){var a=r[s];if(a!==t&&a.form===t.form){var h=a[Ot]||null;if(!h)throw Error(l(90));Ro(a,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(s=0;s<r.length;s++)a=r[s],a.form===t.form&&wf(a)}break e;case"textarea":xf(t,r.value,r.defaultValue);break e;case"select":s=r.value,s!=null&&gr(t,!!r.multiple,s,!1)}}}var zo=!1;function Rf(t,s,r){if(zo)return t(s,r);zo=!0;try{var a=t(s);return a}finally{if(zo=!1,(mr!==null||Sr!==null)&&(Ca(),mr&&(s=mr,t=Sr,Sr=mr=null,Mf(s),t)))for(s=0;s<t.length;s++)Mf(t[s])}}function _n(t,s){var r=t.stateNode;if(r===null)return null;var a=r[Ot]||null;if(a===null)return null;r=a[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(t=t.type,a=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!a;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(l(231,s,typeof r));return r}var Bi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lo=!1;if(Bi)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){Lo=!0}}),window.addEventListener("test",vn,vn),window.removeEventListener("test",vn,vn)}catch{Lo=!1}var es=null,No=null,Pl=null;function Tf(){if(Pl)return Pl;var t,s=No,r=s.length,a,h="value"in es?es.value:es.textContent,u=h.length;for(t=0;t<r&&s[t]===h[t];t++);var g=r-t;for(a=1;a<=g&&s[r-a]===h[u-a];a++);return Pl=h.slice(t,1<a?1-a:void 0)}function ql(t){var s=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&s===13&&(t=13)):t=s,t===10&&(t=13),32<=t||t===13?t:0}function jl(){return!0}function Af(){return!1}function zt(t){function s(r,a,h,u,g){this._reactName=r,this._targetInst=h,this.type=a,this.nativeEvent=u,this.target=g,this.currentTarget=null;for(var p in t)t.hasOwnProperty(p)&&(r=t[p],this[p]=r?r(u):u[p]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?jl:Af,this.isPropagationStopped=Af,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=jl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=jl)},persist:function(){},isPersistent:jl}),s}var Os={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wl=zt(Os),gn=m({},Os,{view:0,detail:0}),aS=zt(gn),Ho,Uo,pn,Yl=m({},gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qo,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==pn&&(pn&&t.type==="mousemove"?(Ho=t.screenX-pn.screenX,Uo=t.screenY-pn.screenY):Uo=Ho=0,pn=t),Ho)},movementY:function(t){return"movementY"in t?t.movementY:Uo}}),Bf=zt(Yl),oS=m({},Yl,{dataTransfer:0}),hS=zt(oS),cS=m({},gn,{relatedTarget:0}),Po=zt(cS),uS=m({},Os,{animationName:0,elapsedTime:0,pseudoElement:0}),fS=zt(uS),dS=m({},Os,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),_S=zt(dS),vS=m({},Os,{data:0}),Of=zt(vS),gS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pS={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"},mS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SS(t){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(t):(t=mS[t])?!!s[t]:!1}function qo(){return SS}var yS=m({},gn,{key:function(t){if(t.key){var s=gS[t.key]||t.key;if(s!=="Unidentified")return s}return t.type==="keypress"?(t=ql(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?pS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qo,charCode:function(t){return t.type==="keypress"?ql(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ql(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),bS=zt(yS),wS=m({},Yl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zf=zt(wS),CS=m({},gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qo}),xS=zt(CS),ES=m({},Os,{propertyName:0,elapsedTime:0,pseudoElement:0}),kS=zt(ES),DS=m({},Yl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),MS=zt(DS),RS=m({},Os,{newState:0,oldState:0}),TS=zt(RS),AS=[9,13,27,32],jo=Bi&&"CompositionEvent"in window,mn=null;Bi&&"documentMode"in document&&(mn=document.documentMode);var BS=Bi&&"TextEvent"in window&&!mn,Lf=Bi&&(!jo||mn&&8<mn&&11>=mn),Nf=" ",Hf=!1;function Uf(t,s){switch(t){case"keyup":return AS.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pf(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var yr=!1;function OS(t,s){switch(t){case"compositionend":return Pf(s);case"keypress":return s.which!==32?null:(Hf=!0,Nf);case"textInput":return t=s.data,t===Nf&&Hf?null:t;default:return null}}function zS(t,s){if(yr)return t==="compositionend"||!jo&&Uf(t,s)?(t=Tf(),Pl=No=es=null,yr=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Lf&&s.locale!=="ko"?null:s.data;default:return null}}var LS={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 qf(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s==="input"?!!LS[t.type]:s==="textarea"}function jf(t,s,r,a){mr?Sr?Sr.push(a):Sr=[a]:mr=a,s=Ra(s,"onChange"),0<s.length&&(r=new Wl("onChange","change",null,r,a),t.push({event:r,listeners:s}))}var Sn=null,yn=null;function NS(t){bv(t,0)}function Kl(t){var s=dn(t);if(wf(s))return t}function Wf(t,s){if(t==="change")return s}var Yf=!1;if(Bi){var Wo;if(Bi){var Yo="oninput"in document;if(!Yo){var Kf=document.createElement("div");Kf.setAttribute("oninput","return;"),Yo=typeof Kf.oninput=="function"}Wo=Yo}else Wo=!1;Yf=Wo&&(!document.documentMode||9<document.documentMode)}function Vf(){Sn&&(Sn.detachEvent("onpropertychange",Xf),yn=Sn=null)}function Xf(t){if(t.propertyName==="value"&&Kl(yn)){var s=[];jf(s,yn,t,Oo(t)),Rf(NS,s)}}function HS(t,s,r){t==="focusin"?(Vf(),Sn=s,yn=r,Sn.attachEvent("onpropertychange",Xf)):t==="focusout"&&Vf()}function US(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Kl(yn)}function PS(t,s){if(t==="click")return Kl(s)}function qS(t,s){if(t==="input"||t==="change")return Kl(s)}function jS(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var Wt=typeof Object.is=="function"?Object.is:jS;function bn(t,s){if(Wt(t,s))return!0;if(typeof t!="object"||t===null||typeof s!="object"||s===null)return!1;var r=Object.keys(t),a=Object.keys(s);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var h=r[a];if(!Qt.call(s,h)||!Wt(t[h],s[h]))return!1}return!0}function Gf(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function $f(t,s){var r=Gf(t);t=0;for(var a;r;){if(r.nodeType===3){if(a=t+r.textContent.length,t<=s&&a>=s)return{node:r,offset:s-t};t=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Gf(r)}}function Ff(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?Ff(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function If(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var s=Hl(t.document);s instanceof t.HTMLIFrameElement;){try{var r=typeof s.contentWindow.location.href=="string"}catch{r=!1}if(r)t=s.contentWindow;else break;s=Hl(t.document)}return s}function Ko(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}var WS=Bi&&"documentMode"in document&&11>=document.documentMode,br=null,Vo=null,wn=null,Xo=!1;function Zf(t,s,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Xo||br==null||br!==Hl(a)||(a=br,"selectionStart"in a&&Ko(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),wn&&bn(wn,a)||(wn=a,a=Ra(Vo,"onSelect"),0<a.length&&(s=new Wl("onSelect","select",null,s,r),t.push({event:s,listeners:a}),s.target=br)))}function zs(t,s){var r={};return r[t.toLowerCase()]=s.toLowerCase(),r["Webkit"+t]="webkit"+s,r["Moz"+t]="moz"+s,r}var wr={animationend:zs("Animation","AnimationEnd"),animationiteration:zs("Animation","AnimationIteration"),animationstart:zs("Animation","AnimationStart"),transitionrun:zs("Transition","TransitionRun"),transitionstart:zs("Transition","TransitionStart"),transitioncancel:zs("Transition","TransitionCancel"),transitionend:zs("Transition","TransitionEnd")},Go={},Qf={};Bi&&(Qf=document.createElement("div").style,"AnimationEvent"in window||(delete wr.animationend.animation,delete wr.animationiteration.animation,delete wr.animationstart.animation),"TransitionEvent"in window||delete wr.transitionend.transition);function Ls(t){if(Go[t])return Go[t];if(!wr[t])return t;var s=wr[t],r;for(r in s)if(s.hasOwnProperty(r)&&r in Qf)return Go[t]=s[r];return t}var Jf=Ls("animationend"),ed=Ls("animationiteration"),td=Ls("animationstart"),YS=Ls("transitionrun"),KS=Ls("transitionstart"),VS=Ls("transitioncancel"),id=Ls("transitionend"),sd=new Map,$o="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(" ");$o.push("scrollEnd");function fi(t,s){sd.set(t,s),Bs(s,[t])}var rd=new WeakMap;function ti(t,s){if(typeof t=="object"&&t!==null){var r=rd.get(t);return r!==void 0?r:(s={value:t,source:s,stack:yf(s)},rd.set(t,s),s)}return{value:t,source:s,stack:yf(s)}}var ii=[],Cr=0,Fo=0;function Vl(){for(var t=Cr,s=Fo=Cr=0;s<t;){var r=ii[s];ii[s++]=null;var a=ii[s];ii[s++]=null;var h=ii[s];ii[s++]=null;var u=ii[s];if(ii[s++]=null,a!==null&&h!==null){var g=a.pending;g===null?h.next=h:(h.next=g.next,g.next=h),a.pending=h}u!==0&&nd(r,h,u)}}function Xl(t,s,r,a){ii[Cr++]=t,ii[Cr++]=s,ii[Cr++]=r,ii[Cr++]=a,Fo|=a,t.lanes|=a,t=t.alternate,t!==null&&(t.lanes|=a)}function Io(t,s,r,a){return Xl(t,s,r,a),Gl(t)}function xr(t,s){return Xl(t,null,null,s),Gl(t)}function nd(t,s,r){t.lanes|=r;var a=t.alternate;a!==null&&(a.lanes|=r);for(var h=!1,u=t.return;u!==null;)u.childLanes|=r,a=u.alternate,a!==null&&(a.childLanes|=r),u.tag===22&&(t=u.stateNode,t===null||t._visibility&1||(h=!0)),t=u,u=u.return;return t.tag===3?(u=t.stateNode,h&&s!==null&&(h=31-jt(r),t=u.hiddenUpdates,a=t[h],a===null?t[h]=[s]:a.push(s),s.lane=r|536870912),u):null}function Gl(t){if(50<Gn)throw Gn=0,ic=null,Error(l(185));for(var s=t.return;s!==null;)t=s,s=t.return;return t.tag===3?t.stateNode:null}var Er={};function XS(t,s,r,a){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yt(t,s,r,a){return new XS(t,s,r,a)}function Zo(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Oi(t,s){var r=t.alternate;return r===null?(r=Yt(t.tag,s,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=s,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&65011712,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,s=t.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r.refCleanup=t.refCleanup,r}function ld(t,s){t.flags&=65011714;var r=t.alternate;return r===null?(t.childLanes=0,t.lanes=s,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,t.type=r.type,s=r.dependencies,t.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),t}function $l(t,s,r,a,h,u){var g=0;if(a=t,typeof t=="function")Zo(t)&&(g=1);else if(typeof t=="string")g=$0(t,r,se.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Te:return t=Yt(31,r,s,h),t.elementType=Te,t.lanes=u,t;case C:return Ns(r.children,h,u,s);case E:g=8,h|=24;break;case B:return t=Yt(12,r,s,h|2),t.elementType=B,t.lanes=u,t;case L:return t=Yt(13,r,s,h),t.elementType=L,t.lanes=u,t;case ee:return t=Yt(19,r,s,h),t.elementType=ee,t.lanes=u,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case z:case X:g=10;break e;case Q:g=9;break e;case q:g=11;break e;case le:g=14;break e;case de:g=16,a=null;break e}g=29,r=Error(l(130,t===null?"null":typeof t,"")),a=null}return s=Yt(g,r,s,h),s.elementType=t,s.type=a,s.lanes=u,s}function Ns(t,s,r,a){return t=Yt(7,t,a,s),t.lanes=r,t}function Qo(t,s,r){return t=Yt(6,t,null,s),t.lanes=r,t}function Jo(t,s,r){return s=Yt(4,t.children!==null?t.children:[],t.key,s),s.lanes=r,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}var kr=[],Dr=0,Fl=null,Il=0,si=[],ri=0,Hs=null,zi=1,Li="";function Us(t,s){kr[Dr++]=Il,kr[Dr++]=Fl,Fl=t,Il=s}function ad(t,s,r){si[ri++]=zi,si[ri++]=Li,si[ri++]=Hs,Hs=t;var a=zi;t=Li;var h=32-jt(a)-1;a&=~(1<<h),r+=1;var u=32-jt(s)+h;if(30<u){var g=h-h%5;u=(a&(1<<g)-1).toString(32),a>>=g,h-=g,zi=1<<32-jt(s)+h|r<<h|a,Li=u+t}else zi=1<<u|r<<h|a,Li=t}function eh(t){t.return!==null&&(Us(t,1),ad(t,1,0))}function th(t){for(;t===Fl;)Fl=kr[--Dr],kr[Dr]=null,Il=kr[--Dr],kr[Dr]=null;for(;t===Hs;)Hs=si[--ri],si[ri]=null,Li=si[--ri],si[ri]=null,zi=si[--ri],si[ri]=null}var Mt=null,Ve=null,ke=!1,Ps=null,mi=!1,ih=Error(l(519));function qs(t){var s=Error(l(418,""));throw En(ti(s,t)),ih}function od(t){var s=t.stateNode,r=t.type,a=t.memoizedProps;switch(s[Ct]=t,s[Ot]=a,r){case"dialog":we("cancel",s),we("close",s);break;case"iframe":case"object":case"embed":we("load",s);break;case"video":case"audio":for(r=0;r<Fn.length;r++)we(Fn[r],s);break;case"source":we("error",s);break;case"img":case"image":case"link":we("error",s),we("load",s);break;case"details":we("toggle",s);break;case"input":we("invalid",s),Cf(s,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0),Nl(s);break;case"select":we("invalid",s);break;case"textarea":we("invalid",s),Ef(s,a.value,a.defaultValue,a.children),Nl(s)}r=a.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||s.textContent===""+r||a.suppressHydrationWarning===!0||Ev(s.textContent,r)?(a.popover!=null&&(we("beforetoggle",s),we("toggle",s)),a.onScroll!=null&&we("scroll",s),a.onScrollEnd!=null&&we("scrollend",s),a.onClick!=null&&(s.onclick=Ta),s=!0):s=!1,s||qs(t)}function hd(t){for(Mt=t.return;Mt;)switch(Mt.tag){case 5:case 13:mi=!1;return;case 27:case 3:mi=!0;return;default:Mt=Mt.return}}function Cn(t){if(t!==Mt)return!1;if(!ke)return hd(t),ke=!0,!1;var s=t.tag,r;if((r=s!==3&&s!==27)&&((r=s===5)&&(r=t.type,r=!(r!=="form"&&r!=="button")||mc(t.type,t.memoizedProps)),r=!r),r&&Ve&&qs(t),hd(t),s===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));e:{for(t=t.nextSibling,s=0;t;){if(t.nodeType===8)if(r=t.data,r==="/$"){if(s===0){Ve=_i(t.nextSibling);break e}s--}else r!=="$"&&r!=="$!"&&r!=="$?"||s++;t=t.nextSibling}Ve=null}}else s===27?(s=Ve,gs(t.type)?(t=wc,wc=null,Ve=t):Ve=s):Ve=Mt?_i(t.stateNode.nextSibling):null;return!0}function xn(){Ve=Mt=null,ke=!1}function cd(){var t=Ps;return t!==null&&(Ht===null?Ht=t:Ht.push.apply(Ht,t),Ps=null),t}function En(t){Ps===null?Ps=[t]:Ps.push(t)}var sh=j(null),js=null,Ni=null;function ts(t,s,r){F(sh,s._currentValue),s._currentValue=r}function Hi(t){t._currentValue=sh.current,J(sh)}function rh(t,s,r){for(;t!==null;){var a=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,a!==null&&(a.childLanes|=s)):a!==null&&(a.childLanes&s)!==s&&(a.childLanes|=s),t===r)break;t=t.return}}function nh(t,s,r,a){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var u=h.dependencies;if(u!==null){var g=h.child;u=u.firstContext;e:for(;u!==null;){var p=u;u=h;for(var b=0;b<s.length;b++)if(p.context===s[b]){u.lanes|=r,p=u.alternate,p!==null&&(p.lanes|=r),rh(u.return,r,t),a||(g=null);break e}u=p.next}}else if(h.tag===18){if(g=h.return,g===null)throw Error(l(341));g.lanes|=r,u=g.alternate,u!==null&&(u.lanes|=r),rh(g,r,t),g=null}else g=h.child;if(g!==null)g.return=h;else for(g=h;g!==null;){if(g===t){g=null;break}if(h=g.sibling,h!==null){h.return=g.return,g=h;break}g=g.return}h=g}}function kn(t,s,r,a){t=null;for(var h=s,u=!1;h!==null;){if(!u){if((h.flags&524288)!==0)u=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var g=h.alternate;if(g===null)throw Error(l(387));if(g=g.memoizedProps,g!==null){var p=h.type;Wt(h.pendingProps.value,g.value)||(t!==null?t.push(p):t=[p])}}else if(h===Ue.current){if(g=h.alternate,g===null)throw Error(l(387));g.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(tl):t=[tl])}h=h.return}t!==null&&nh(s,t,r,a),s.flags|=262144}function Zl(t){for(t=t.firstContext;t!==null;){if(!Wt(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ws(t){js=t,Ni=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function xt(t){return ud(js,t)}function Ql(t,s){return js===null&&Ws(t),ud(t,s)}function ud(t,s){var r=s._currentValue;if(s={context:s,memoizedValue:r,next:null},Ni===null){if(t===null)throw Error(l(308));Ni=s,t.dependencies={lanes:0,firstContext:s},t.flags|=524288}else Ni=Ni.next=s;return r}var GS=typeof AbortController<"u"?AbortController:function(){var t=[],s=this.signal={aborted:!1,addEventListener:function(r,a){t.push(a)}};this.abort=function(){s.aborted=!0,t.forEach(function(r){return r()})}},$S=e.unstable_scheduleCallback,FS=e.unstable_NormalPriority,rt={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lh(){return{controller:new GS,data:new Map,refCount:0}}function Dn(t){t.refCount--,t.refCount===0&&$S(FS,function(){t.controller.abort()})}var Mn=null,ah=0,Mr=0,Rr=null;function IS(t,s){if(Mn===null){var r=Mn=[];ah=0,Mr=hc(),Rr={status:"pending",value:void 0,then:function(a){r.push(a)}}}return ah++,s.then(fd,fd),s}function fd(){if(--ah===0&&Mn!==null){Rr!==null&&(Rr.status="fulfilled");var t=Mn;Mn=null,Mr=0,Rr=null;for(var s=0;s<t.length;s++)(0,t[s])()}}function ZS(t,s){var r=[],a={status:"pending",value:null,reason:null,then:function(h){r.push(h)}};return t.then(function(){a.status="fulfilled",a.value=s;for(var h=0;h<r.length;h++)(0,r[h])(s)},function(h){for(a.status="rejected",a.reason=h,h=0;h<r.length;h++)(0,r[h])(void 0)}),a}var dd=k.S;k.S=function(t,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&IS(t,s),dd!==null&&dd(t,s)};var Ys=j(null);function oh(){var t=Ys.current;return t!==null?t:He.pooledCache}function Jl(t,s){s===null?F(Ys,Ys.current):F(Ys,s.pool)}function _d(){var t=oh();return t===null?null:{parent:rt._currentValue,pool:t}}var Rn=Error(l(460)),vd=Error(l(474)),ea=Error(l(542)),hh={then:function(){}};function gd(t){return t=t.status,t==="fulfilled"||t==="rejected"}function ta(){}function pd(t,s,r){switch(r=t[r],r===void 0?t.push(s):r!==s&&(s.then(ta,ta),s=r),s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,Sd(t),t;default:if(typeof s.status=="string")s.then(ta,ta);else{if(t=He,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=s,t.status="pending",t.then(function(a){if(s.status==="pending"){var h=s;h.status="fulfilled",h.value=a}},function(a){if(s.status==="pending"){var h=s;h.status="rejected",h.reason=a}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,Sd(t),t}throw Tn=s,Rn}}var Tn=null;function md(){if(Tn===null)throw Error(l(459));var t=Tn;return Tn=null,t}function Sd(t){if(t===Rn||t===ea)throw Error(l(483))}var is=!1;function ch(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uh(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ss(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function rs(t,s,r){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(Me&2)!==0){var h=a.pending;return h===null?s.next=s:(s.next=h.next,h.next=s),a.pending=s,s=Gl(t),nd(t,null,r),s}return Xl(t,a,s,r),Gl(t)}function An(t,s,r){if(s=s.updateQueue,s!==null&&(s=s.shared,(r&4194048)!==0)){var a=s.lanes;a&=t.pendingLanes,r|=a,s.lanes=r,ff(t,r)}}function fh(t,s){var r=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var h=null,u=null;if(r=r.firstBaseUpdate,r!==null){do{var g={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};u===null?h=u=g:u=u.next=g,r=r.next}while(r!==null);u===null?h=u=s:u=u.next=s}else h=u=s;r={baseState:a.baseState,firstBaseUpdate:h,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=s:t.next=s,r.lastBaseUpdate=s}var dh=!1;function Bn(){if(dh){var t=Rr;if(t!==null)throw t}}function On(t,s,r,a){dh=!1;var h=t.updateQueue;is=!1;var u=h.firstBaseUpdate,g=h.lastBaseUpdate,p=h.shared.pending;if(p!==null){h.shared.pending=null;var b=p,T=b.next;b.next=null,g===null?u=T:g.next=T,g=b;var P=t.alternate;P!==null&&(P=P.updateQueue,p=P.lastBaseUpdate,p!==g&&(p===null?P.firstBaseUpdate=T:p.next=T,P.lastBaseUpdate=b))}if(u!==null){var K=h.baseState;g=0,P=T=b=null,p=u;do{var A=p.lane&-536870913,O=A!==p.lane;if(O?(Ce&A)===A:(a&A)===A){A!==0&&A===Mr&&(dh=!0),P!==null&&(P=P.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var ue=t,he=p;A=s;var Oe=r;switch(he.tag){case 1:if(ue=he.payload,typeof ue=="function"){K=ue.call(Oe,K,A);break e}K=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=he.payload,A=typeof ue=="function"?ue.call(Oe,K,A):ue,A==null)break e;K=m({},K,A);break e;case 2:is=!0}}A=p.callback,A!==null&&(t.flags|=64,O&&(t.flags|=8192),O=h.callbacks,O===null?h.callbacks=[A]:O.push(A))}else O={lane:A,tag:p.tag,payload:p.payload,callback:p.callback,next:null},P===null?(T=P=O,b=K):P=P.next=O,g|=A;if(p=p.next,p===null){if(p=h.shared.pending,p===null)break;O=p,p=O.next,O.next=null,h.lastBaseUpdate=O,h.shared.pending=null}}while(!0);P===null&&(b=K),h.baseState=b,h.firstBaseUpdate=T,h.lastBaseUpdate=P,u===null&&(h.shared.lanes=0),fs|=g,t.lanes=g,t.memoizedState=K}}function yd(t,s){if(typeof t!="function")throw Error(l(191,t));t.call(s)}function bd(t,s){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;t<r.length;t++)yd(r[t],s)}var Tr=j(null),ia=j(0);function wd(t,s){t=Ki,F(ia,t),F(Tr,s),Ki=t|s.baseLanes}function _h(){F(ia,Ki),F(Tr,Tr.current)}function vh(){Ki=ia.current,J(Tr),J(ia)}var ns=0,pe=null,Ae=null,Je=null,sa=!1,Ar=!1,Ks=!1,ra=0,zn=0,Br=null,QS=0;function Fe(){throw Error(l(321))}function gh(t,s){if(s===null)return!1;for(var r=0;r<s.length&&r<t.length;r++)if(!Wt(t[r],s[r]))return!1;return!0}function ph(t,s,r,a,h,u){return ns=u,pe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,k.H=t===null||t.memoizedState===null?n_:l_,Ks=!1,u=r(a,h),Ks=!1,Ar&&(u=xd(s,r,a,h)),Cd(t),u}function Cd(t){k.H=ca;var s=Ae!==null&&Ae.next!==null;if(ns=0,Je=Ae=pe=null,sa=!1,zn=0,Br=null,s)throw Error(l(300));t===null||ct||(t=t.dependencies,t!==null&&Zl(t)&&(ct=!0))}function xd(t,s,r,a){pe=t;var h=0;do{if(Ar&&(Br=null),zn=0,Ar=!1,25<=h)throw Error(l(301));if(h+=1,Je=Ae=null,t.updateQueue!=null){var u=t.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}k.H=n0,u=s(r,a)}while(Ar);return u}function JS(){var t=k.H,s=t.useState()[0];return s=typeof s.then=="function"?Ln(s):s,t=t.useState()[0],(Ae!==null?Ae.memoizedState:null)!==t&&(pe.flags|=1024),s}function mh(){var t=ra!==0;return ra=0,t}function Sh(t,s,r){s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~r}function yh(t){if(sa){for(t=t.memoizedState;t!==null;){var s=t.queue;s!==null&&(s.pending=null),t=t.next}sa=!1}ns=0,Je=Ae=pe=null,Ar=!1,zn=ra=0,Br=null}function Lt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?pe.memoizedState=Je=t:Je=Je.next=t,Je}function et(){if(Ae===null){var t=pe.alternate;t=t!==null?t.memoizedState:null}else t=Ae.next;var s=Je===null?pe.memoizedState:Je.next;if(s!==null)Je=s,Ae=t;else{if(t===null)throw pe.alternate===null?Error(l(467)):Error(l(310));Ae=t,t={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},Je===null?pe.memoizedState=Je=t:Je=Je.next=t}return Je}function bh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ln(t){var s=zn;return zn+=1,Br===null&&(Br=[]),t=pd(Br,t,s),s=pe,(Je===null?s.memoizedState:Je.next)===null&&(s=s.alternate,k.H=s===null||s.memoizedState===null?n_:l_),t}function na(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ln(t);if(t.$$typeof===X)return xt(t)}throw Error(l(438,String(t)))}function wh(t){var s=null,r=pe.updateQueue;if(r!==null&&(s=r.memoCache),s==null){var a=pe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(s={data:a.data.map(function(h){return h.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),r===null&&(r=bh(),pe.updateQueue=r),r.memoCache=s,r=s.data[s.index],r===void 0)for(r=s.data[s.index]=Array(t),a=0;a<t;a++)r[a]=Qe;return s.index++,r}function Ui(t,s){return typeof s=="function"?s(t):s}function la(t){var s=et();return Ch(s,Ae,t)}function Ch(t,s,r){var a=t.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=r;var h=t.baseQueue,u=a.pending;if(u!==null){if(h!==null){var g=h.next;h.next=u.next,u.next=g}s.baseQueue=h=u,a.pending=null}if(u=t.baseState,h===null)t.memoizedState=u;else{s=h.next;var p=g=null,b=null,T=s,P=!1;do{var K=T.lane&-536870913;if(K!==T.lane?(Ce&K)===K:(ns&K)===K){var A=T.revertLane;if(A===0)b!==null&&(b=b.next={lane:0,revertLane:0,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null}),K===Mr&&(P=!0);else if((ns&A)===A){T=T.next,A===Mr&&(P=!0);continue}else K={lane:0,revertLane:T.revertLane,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},b===null?(p=b=K,g=u):b=b.next=K,pe.lanes|=A,fs|=A;K=T.action,Ks&&r(u,K),u=T.hasEagerState?T.eagerState:r(u,K)}else A={lane:K,revertLane:T.revertLane,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},b===null?(p=b=A,g=u):b=b.next=A,pe.lanes|=K,fs|=K;T=T.next}while(T!==null&&T!==s);if(b===null?g=u:b.next=p,!Wt(u,t.memoizedState)&&(ct=!0,P&&(r=Rr,r!==null)))throw r;t.memoizedState=u,t.baseState=g,t.baseQueue=b,a.lastRenderedState=u}return h===null&&(a.lanes=0),[t.memoizedState,a.dispatch]}function xh(t){var s=et(),r=s.queue;if(r===null)throw Error(l(311));r.lastRenderedReducer=t;var a=r.dispatch,h=r.pending,u=s.memoizedState;if(h!==null){r.pending=null;var g=h=h.next;do u=t(u,g.action),g=g.next;while(g!==h);Wt(u,s.memoizedState)||(ct=!0),s.memoizedState=u,s.baseQueue===null&&(s.baseState=u),r.lastRenderedState=u}return[u,a]}function Ed(t,s,r){var a=pe,h=et(),u=ke;if(u){if(r===void 0)throw Error(l(407));r=r()}else r=s();var g=!Wt((Ae||h).memoizedState,r);g&&(h.memoizedState=r,ct=!0),h=h.queue;var p=Md.bind(null,a,h,t);if(Nn(2048,8,p,[t]),h.getSnapshot!==s||g||Je!==null&&Je.memoizedState.tag&1){if(a.flags|=2048,Or(9,aa(),Dd.bind(null,a,h,r,s),null),He===null)throw Error(l(349));u||(ns&124)!==0||kd(a,s,r)}return r}function kd(t,s,r){t.flags|=16384,t={getSnapshot:s,value:r},s=pe.updateQueue,s===null?(s=bh(),pe.updateQueue=s,s.stores=[t]):(r=s.stores,r===null?s.stores=[t]:r.push(t))}function Dd(t,s,r,a){s.value=r,s.getSnapshot=a,Rd(s)&&Td(t)}function Md(t,s,r){return r(function(){Rd(s)&&Td(t)})}function Rd(t){var s=t.getSnapshot;t=t.value;try{var r=s();return!Wt(t,r)}catch{return!0}}function Td(t){var s=xr(t,2);s!==null&&$t(s,t,2)}function Eh(t){var s=Lt();if(typeof t=="function"){var r=t;if(t=r(),Ks){Qi(!0);try{r()}finally{Qi(!1)}}}return s.memoizedState=s.baseState=t,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ui,lastRenderedState:t},s}function Ad(t,s,r,a){return t.baseState=r,Ch(t,Ae,typeof a=="function"?a:Ui)}function e0(t,s,r,a,h){if(ha(t))throw Error(l(485));if(t=s.action,t!==null){var u={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){u.listeners.push(g)}};k.T!==null?r(!0):u.isTransition=!1,a(u),r=s.pending,r===null?(u.next=s.pending=u,Bd(s,u)):(u.next=r.next,s.pending=r.next=u)}}function Bd(t,s){var r=s.action,a=s.payload,h=t.state;if(s.isTransition){var u=k.T,g={};k.T=g;try{var p=r(h,a),b=k.S;b!==null&&b(g,p),Od(t,s,p)}catch(T){kh(t,s,T)}finally{k.T=u}}else try{u=r(h,a),Od(t,s,u)}catch(T){kh(t,s,T)}}function Od(t,s,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(a){zd(t,s,a)},function(a){return kh(t,s,a)}):zd(t,s,r)}function zd(t,s,r){s.status="fulfilled",s.value=r,Ld(s),t.state=r,s=t.pending,s!==null&&(r=s.next,r===s?t.pending=null:(r=r.next,s.next=r,Bd(t,r)))}function kh(t,s,r){var a=t.pending;if(t.pending=null,a!==null){a=a.next;do s.status="rejected",s.reason=r,Ld(s),s=s.next;while(s!==a)}t.action=null}function Ld(t){t=t.listeners;for(var s=0;s<t.length;s++)(0,t[s])()}function Nd(t,s){return s}function Hd(t,s){if(ke){var r=He.formState;if(r!==null){e:{var a=pe;if(ke){if(Ve){t:{for(var h=Ve,u=mi;h.nodeType!==8;){if(!u){h=null;break t}if(h=_i(h.nextSibling),h===null){h=null;break t}}u=h.data,h=u==="F!"||u==="F"?h:null}if(h){Ve=_i(h.nextSibling),a=h.data==="F!";break e}}qs(a)}a=!1}a&&(s=r[0])}}return r=Lt(),r.memoizedState=r.baseState=s,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nd,lastRenderedState:s},r.queue=a,r=i_.bind(null,pe,a),a.dispatch=r,a=Eh(!1),u=Ah.bind(null,pe,!1,a.queue),a=Lt(),h={state:s,dispatch:null,action:t,pending:null},a.queue=h,r=e0.bind(null,pe,h,u,r),h.dispatch=r,a.memoizedState=t,[s,r,!1]}function Ud(t){var s=et();return Pd(s,Ae,t)}function Pd(t,s,r){if(s=Ch(t,s,Nd)[0],t=la(Ui)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var a=Ln(s)}catch(g){throw g===Rn?ea:g}else a=s;s=et();var h=s.queue,u=h.dispatch;return r!==s.memoizedState&&(pe.flags|=2048,Or(9,aa(),t0.bind(null,h,r),null)),[a,u,t]}function t0(t,s){t.action=s}function qd(t){var s=et(),r=Ae;if(r!==null)return Pd(s,r,t);et(),s=s.memoizedState,r=et();var a=r.queue.dispatch;return r.memoizedState=t,[s,a,!1]}function Or(t,s,r,a){return t={tag:t,create:r,deps:a,inst:s,next:null},s=pe.updateQueue,s===null&&(s=bh(),pe.updateQueue=s),r=s.lastEffect,r===null?s.lastEffect=t.next=t:(a=r.next,r.next=t,t.next=a,s.lastEffect=t),t}function aa(){return{destroy:void 0,resource:void 0}}function jd(){return et().memoizedState}function oa(t,s,r,a){var h=Lt();a=a===void 0?null:a,pe.flags|=t,h.memoizedState=Or(1|s,aa(),r,a)}function Nn(t,s,r,a){var h=et();a=a===void 0?null:a;var u=h.memoizedState.inst;Ae!==null&&a!==null&&gh(a,Ae.memoizedState.deps)?h.memoizedState=Or(s,u,r,a):(pe.flags|=t,h.memoizedState=Or(1|s,u,r,a))}function Wd(t,s){oa(8390656,8,t,s)}function Yd(t,s){Nn(2048,8,t,s)}function Kd(t,s){return Nn(4,2,t,s)}function Vd(t,s){return Nn(4,4,t,s)}function Xd(t,s){if(typeof s=="function"){t=t();var r=s(t);return function(){typeof r=="function"?r():s(null)}}if(s!=null)return t=t(),s.current=t,function(){s.current=null}}function Gd(t,s,r){r=r!=null?r.concat([t]):null,Nn(4,4,Xd.bind(null,s,t),r)}function Dh(){}function $d(t,s){var r=et();s=s===void 0?null:s;var a=r.memoizedState;return s!==null&&gh(s,a[1])?a[0]:(r.memoizedState=[t,s],t)}function Fd(t,s){var r=et();s=s===void 0?null:s;var a=r.memoizedState;if(s!==null&&gh(s,a[1]))return a[0];if(a=t(),Ks){Qi(!0);try{t()}finally{Qi(!1)}}return r.memoizedState=[a,s],a}function Mh(t,s,r){return r===void 0||(ns&1073741824)!==0?t.memoizedState=s:(t.memoizedState=r,t=Q_(),pe.lanes|=t,fs|=t,r)}function Id(t,s,r,a){return Wt(r,s)?r:Tr.current!==null?(t=Mh(t,r,a),Wt(t,s)||(ct=!0),t):(ns&42)===0?(ct=!0,t.memoizedState=r):(t=Q_(),pe.lanes|=t,fs|=t,s)}function Zd(t,s,r,a,h){var u=U.p;U.p=u!==0&&8>u?u:8;var g=k.T,p={};k.T=p,Ah(t,!1,s,r);try{var b=h(),T=k.S;if(T!==null&&T(p,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var P=ZS(b,a);Hn(t,s,P,Gt(t))}else Hn(t,s,a,Gt(t))}catch(K){Hn(t,s,{then:function(){},status:"rejected",reason:K},Gt())}finally{U.p=u,k.T=g}}function i0(){}function Rh(t,s,r,a){if(t.tag!==5)throw Error(l(476));var h=Qd(t).queue;Zd(t,h,s,H,r===null?i0:function(){return Jd(t),r(a)})}function Qd(t){var s=t.memoizedState;if(s!==null)return s;s={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ui,lastRenderedState:H},next:null};var r={};return s.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ui,lastRenderedState:r},next:null},t.memoizedState=s,t=t.alternate,t!==null&&(t.memoizedState=s),s}function Jd(t){var s=Qd(t).next.queue;Hn(t,s,{},Gt())}function Th(){return xt(tl)}function e_(){return et().memoizedState}function t_(){return et().memoizedState}function s0(t){for(var s=t.return;s!==null;){switch(s.tag){case 24:case 3:var r=Gt();t=ss(r);var a=rs(s,t,r);a!==null&&($t(a,s,r),An(a,s,r)),s={cache:lh()},t.payload=s;return}s=s.return}}function r0(t,s,r){var a=Gt();r={lane:a,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},ha(t)?s_(s,r):(r=Io(t,s,r,a),r!==null&&($t(r,t,a),r_(r,s,a)))}function i_(t,s,r){var a=Gt();Hn(t,s,r,a)}function Hn(t,s,r,a){var h={lane:a,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(ha(t))s_(s,h);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=s.lastRenderedReducer,u!==null))try{var g=s.lastRenderedState,p=u(g,r);if(h.hasEagerState=!0,h.eagerState=p,Wt(p,g))return Xl(t,s,h,0),He===null&&Vl(),!1}catch{}finally{}if(r=Io(t,s,h,a),r!==null)return $t(r,t,a),r_(r,s,a),!0}return!1}function Ah(t,s,r,a){if(a={lane:2,revertLane:hc(),action:a,hasEagerState:!1,eagerState:null,next:null},ha(t)){if(s)throw Error(l(479))}else s=Io(t,r,a,2),s!==null&&$t(s,t,2)}function ha(t){var s=t.alternate;return t===pe||s!==null&&s===pe}function s_(t,s){Ar=sa=!0;var r=t.pending;r===null?s.next=s:(s.next=r.next,r.next=s),t.pending=s}function r_(t,s,r){if((r&4194048)!==0){var a=s.lanes;a&=t.pendingLanes,r|=a,s.lanes=r,ff(t,r)}}var ca={readContext:xt,use:na,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useLayoutEffect:Fe,useInsertionEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useSyncExternalStore:Fe,useId:Fe,useHostTransitionStatus:Fe,useFormState:Fe,useActionState:Fe,useOptimistic:Fe,useMemoCache:Fe,useCacheRefresh:Fe},n_={readContext:xt,use:na,useCallback:function(t,s){return Lt().memoizedState=[t,s===void 0?null:s],t},useContext:xt,useEffect:Wd,useImperativeHandle:function(t,s,r){r=r!=null?r.concat([t]):null,oa(4194308,4,Xd.bind(null,s,t),r)},useLayoutEffect:function(t,s){return oa(4194308,4,t,s)},useInsertionEffect:function(t,s){oa(4,2,t,s)},useMemo:function(t,s){var r=Lt();s=s===void 0?null:s;var a=t();if(Ks){Qi(!0);try{t()}finally{Qi(!1)}}return r.memoizedState=[a,s],a},useReducer:function(t,s,r){var a=Lt();if(r!==void 0){var h=r(s);if(Ks){Qi(!0);try{r(s)}finally{Qi(!1)}}}else h=s;return a.memoizedState=a.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},a.queue=t,t=t.dispatch=r0.bind(null,pe,t),[a.memoizedState,t]},useRef:function(t){var s=Lt();return t={current:t},s.memoizedState=t},useState:function(t){t=Eh(t);var s=t.queue,r=i_.bind(null,pe,s);return s.dispatch=r,[t.memoizedState,r]},useDebugValue:Dh,useDeferredValue:function(t,s){var r=Lt();return Mh(r,t,s)},useTransition:function(){var t=Eh(!1);return t=Zd.bind(null,pe,t.queue,!0,!1),Lt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,s,r){var a=pe,h=Lt();if(ke){if(r===void 0)throw Error(l(407));r=r()}else{if(r=s(),He===null)throw Error(l(349));(Ce&124)!==0||kd(a,s,r)}h.memoizedState=r;var u={value:r,getSnapshot:s};return h.queue=u,Wd(Md.bind(null,a,u,t),[t]),a.flags|=2048,Or(9,aa(),Dd.bind(null,a,u,r,s),null),r},useId:function(){var t=Lt(),s=He.identifierPrefix;if(ke){var r=Li,a=zi;r=(a&~(1<<32-jt(a)-1)).toString(32)+r,s="«"+s+"R"+r,r=ra++,0<r&&(s+="H"+r.toString(32)),s+="»"}else r=QS++,s="«"+s+"r"+r.toString(32)+"»";return t.memoizedState=s},useHostTransitionStatus:Th,useFormState:Hd,useActionState:Hd,useOptimistic:function(t){var s=Lt();s.memoizedState=s.baseState=t;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=r,s=Ah.bind(null,pe,!0,r),r.dispatch=s,[t,s]},useMemoCache:wh,useCacheRefresh:function(){return Lt().memoizedState=s0.bind(null,pe)}},l_={readContext:xt,use:na,useCallback:$d,useContext:xt,useEffect:Yd,useImperativeHandle:Gd,useInsertionEffect:Kd,useLayoutEffect:Vd,useMemo:Fd,useReducer:la,useRef:jd,useState:function(){return la(Ui)},useDebugValue:Dh,useDeferredValue:function(t,s){var r=et();return Id(r,Ae.memoizedState,t,s)},useTransition:function(){var t=la(Ui)[0],s=et().memoizedState;return[typeof t=="boolean"?t:Ln(t),s]},useSyncExternalStore:Ed,useId:e_,useHostTransitionStatus:Th,useFormState:Ud,useActionState:Ud,useOptimistic:function(t,s){var r=et();return Ad(r,Ae,t,s)},useMemoCache:wh,useCacheRefresh:t_},n0={readContext:xt,use:na,useCallback:$d,useContext:xt,useEffect:Yd,useImperativeHandle:Gd,useInsertionEffect:Kd,useLayoutEffect:Vd,useMemo:Fd,useReducer:xh,useRef:jd,useState:function(){return xh(Ui)},useDebugValue:Dh,useDeferredValue:function(t,s){var r=et();return Ae===null?Mh(r,t,s):Id(r,Ae.memoizedState,t,s)},useTransition:function(){var t=xh(Ui)[0],s=et().memoizedState;return[typeof t=="boolean"?t:Ln(t),s]},useSyncExternalStore:Ed,useId:e_,useHostTransitionStatus:Th,useFormState:qd,useActionState:qd,useOptimistic:function(t,s){var r=et();return Ae!==null?Ad(r,Ae,t,s):(r.baseState=t,[t,r.queue.dispatch])},useMemoCache:wh,useCacheRefresh:t_},zr=null,Un=0;function ua(t){var s=Un;return Un+=1,zr===null&&(zr=[]),pd(zr,t,s)}function Pn(t,s){s=s.props.ref,t.ref=s!==void 0?s:null}function fa(t,s){throw s.$$typeof===S?Error(l(525)):(t=Object.prototype.toString.call(s),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":t)))}function a_(t){var s=t._init;return s(t._payload)}function o_(t){function s(M,x){if(t){var R=M.deletions;R===null?(M.deletions=[x],M.flags|=16):R.push(x)}}function r(M,x){if(!t)return null;for(;x!==null;)s(M,x),x=x.sibling;return null}function a(M){for(var x=new Map;M!==null;)M.key!==null?x.set(M.key,M):x.set(M.index,M),M=M.sibling;return x}function h(M,x){return M=Oi(M,x),M.index=0,M.sibling=null,M}function u(M,x,R){return M.index=R,t?(R=M.alternate,R!==null?(R=R.index,R<x?(M.flags|=67108866,x):R):(M.flags|=67108866,x)):(M.flags|=1048576,x)}function g(M){return t&&M.alternate===null&&(M.flags|=67108866),M}function p(M,x,R,W){return x===null||x.tag!==6?(x=Qo(R,M.mode,W),x.return=M,x):(x=h(x,R),x.return=M,x)}function b(M,x,R,W){var ne=R.type;return ne===C?P(M,x,R.props.children,W,R.key):x!==null&&(x.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===de&&a_(ne)===x.type)?(x=h(x,R.props),Pn(x,R),x.return=M,x):(x=$l(R.type,R.key,R.props,null,M.mode,W),Pn(x,R),x.return=M,x)}function T(M,x,R,W){return x===null||x.tag!==4||x.stateNode.containerInfo!==R.containerInfo||x.stateNode.implementation!==R.implementation?(x=Jo(R,M.mode,W),x.return=M,x):(x=h(x,R.children||[]),x.return=M,x)}function P(M,x,R,W,ne){return x===null||x.tag!==7?(x=Ns(R,M.mode,W,ne),x.return=M,x):(x=h(x,R),x.return=M,x)}function K(M,x,R){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return x=Qo(""+x,M.mode,R),x.return=M,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case y:return R=$l(x.type,x.key,x.props,null,M.mode,R),Pn(R,x),R.return=M,R;case D:return x=Jo(x,M.mode,R),x.return=M,x;case de:var W=x._init;return x=W(x._payload),K(M,x,R)}if(G(x)||V(x))return x=Ns(x,M.mode,R,null),x.return=M,x;if(typeof x.then=="function")return K(M,ua(x),R);if(x.$$typeof===X)return K(M,Ql(M,x),R);fa(M,x)}return null}function A(M,x,R,W){var ne=x!==null?x.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return ne!==null?null:p(M,x,""+R,W);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case y:return R.key===ne?b(M,x,R,W):null;case D:return R.key===ne?T(M,x,R,W):null;case de:return ne=R._init,R=ne(R._payload),A(M,x,R,W)}if(G(R)||V(R))return ne!==null?null:P(M,x,R,W,null);if(typeof R.then=="function")return A(M,x,ua(R),W);if(R.$$typeof===X)return A(M,x,Ql(M,R),W);fa(M,R)}return null}function O(M,x,R,W,ne){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return M=M.get(R)||null,p(x,M,""+W,ne);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case y:return M=M.get(W.key===null?R:W.key)||null,b(x,M,W,ne);case D:return M=M.get(W.key===null?R:W.key)||null,T(x,M,W,ne);case de:var ye=W._init;return W=ye(W._payload),O(M,x,R,W,ne)}if(G(W)||V(W))return M=M.get(R)||null,P(x,M,W,ne,null);if(typeof W.then=="function")return O(M,x,R,ua(W),ne);if(W.$$typeof===X)return O(M,x,R,Ql(x,W),ne);fa(x,W)}return null}function ue(M,x,R,W){for(var ne=null,ye=null,ae=x,ce=x=0,ft=null;ae!==null&&ce<R.length;ce++){ae.index>ce?(ft=ae,ae=null):ft=ae.sibling;var Ee=A(M,ae,R[ce],W);if(Ee===null){ae===null&&(ae=ft);break}t&&ae&&Ee.alternate===null&&s(M,ae),x=u(Ee,x,ce),ye===null?ne=Ee:ye.sibling=Ee,ye=Ee,ae=ft}if(ce===R.length)return r(M,ae),ke&&Us(M,ce),ne;if(ae===null){for(;ce<R.length;ce++)ae=K(M,R[ce],W),ae!==null&&(x=u(ae,x,ce),ye===null?ne=ae:ye.sibling=ae,ye=ae);return ke&&Us(M,ce),ne}for(ae=a(ae);ce<R.length;ce++)ft=O(ae,M,ce,R[ce],W),ft!==null&&(t&&ft.alternate!==null&&ae.delete(ft.key===null?ce:ft.key),x=u(ft,x,ce),ye===null?ne=ft:ye.sibling=ft,ye=ft);return t&&ae.forEach(function(bs){return s(M,bs)}),ke&&Us(M,ce),ne}function he(M,x,R,W){if(R==null)throw Error(l(151));for(var ne=null,ye=null,ae=x,ce=x=0,ft=null,Ee=R.next();ae!==null&&!Ee.done;ce++,Ee=R.next()){ae.index>ce?(ft=ae,ae=null):ft=ae.sibling;var bs=A(M,ae,Ee.value,W);if(bs===null){ae===null&&(ae=ft);break}t&&ae&&bs.alternate===null&&s(M,ae),x=u(bs,x,ce),ye===null?ne=bs:ye.sibling=bs,ye=bs,ae=ft}if(Ee.done)return r(M,ae),ke&&Us(M,ce),ne;if(ae===null){for(;!Ee.done;ce++,Ee=R.next())Ee=K(M,Ee.value,W),Ee!==null&&(x=u(Ee,x,ce),ye===null?ne=Ee:ye.sibling=Ee,ye=Ee);return ke&&Us(M,ce),ne}for(ae=a(ae);!Ee.done;ce++,Ee=R.next())Ee=O(ae,M,ce,Ee.value,W),Ee!==null&&(t&&Ee.alternate!==null&&ae.delete(Ee.key===null?ce:Ee.key),x=u(Ee,x,ce),ye===null?ne=Ee:ye.sibling=Ee,ye=Ee);return t&&ae.forEach(function(ly){return s(M,ly)}),ke&&Us(M,ce),ne}function Oe(M,x,R,W){if(typeof R=="object"&&R!==null&&R.type===C&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case y:e:{for(var ne=R.key;x!==null;){if(x.key===ne){if(ne=R.type,ne===C){if(x.tag===7){r(M,x.sibling),W=h(x,R.props.children),W.return=M,M=W;break e}}else if(x.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===de&&a_(ne)===x.type){r(M,x.sibling),W=h(x,R.props),Pn(W,R),W.return=M,M=W;break e}r(M,x);break}else s(M,x);x=x.sibling}R.type===C?(W=Ns(R.props.children,M.mode,W,R.key),W.return=M,M=W):(W=$l(R.type,R.key,R.props,null,M.mode,W),Pn(W,R),W.return=M,M=W)}return g(M);case D:e:{for(ne=R.key;x!==null;){if(x.key===ne)if(x.tag===4&&x.stateNode.containerInfo===R.containerInfo&&x.stateNode.implementation===R.implementation){r(M,x.sibling),W=h(x,R.children||[]),W.return=M,M=W;break e}else{r(M,x);break}else s(M,x);x=x.sibling}W=Jo(R,M.mode,W),W.return=M,M=W}return g(M);case de:return ne=R._init,R=ne(R._payload),Oe(M,x,R,W)}if(G(R))return ue(M,x,R,W);if(V(R)){if(ne=V(R),typeof ne!="function")throw Error(l(150));return R=ne.call(R),he(M,x,R,W)}if(typeof R.then=="function")return Oe(M,x,ua(R),W);if(R.$$typeof===X)return Oe(M,x,Ql(M,R),W);fa(M,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,x!==null&&x.tag===6?(r(M,x.sibling),W=h(x,R),W.return=M,M=W):(r(M,x),W=Qo(R,M.mode,W),W.return=M,M=W),g(M)):r(M,x)}return function(M,x,R,W){try{Un=0;var ne=Oe(M,x,R,W);return zr=null,ne}catch(ae){if(ae===Rn||ae===ea)throw ae;var ye=Yt(29,ae,null,M.mode);return ye.lanes=W,ye.return=M,ye}finally{}}}var Lr=o_(!0),h_=o_(!1),ni=j(null),Si=null;function ls(t){var s=t.alternate;F(nt,nt.current&1),F(ni,t),Si===null&&(s===null||Tr.current!==null||s.memoizedState!==null)&&(Si=t)}function c_(t){if(t.tag===22){if(F(nt,nt.current),F(ni,t),Si===null){var s=t.alternate;s!==null&&s.memoizedState!==null&&(Si=t)}}else as()}function as(){F(nt,nt.current),F(ni,ni.current)}function Pi(t){J(ni),Si===t&&(Si=null),J(nt)}var nt=j(0);function da(t){for(var s=t;s!==null;){if(s.tag===13){var r=s.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||bc(r)))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}function Bh(t,s,r,a){s=t.memoizedState,r=r(a,s),r=r==null?s:m({},s,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var Oh={enqueueSetState:function(t,s,r){t=t._reactInternals;var a=Gt(),h=ss(a);h.payload=s,r!=null&&(h.callback=r),s=rs(t,h,a),s!==null&&($t(s,t,a),An(s,t,a))},enqueueReplaceState:function(t,s,r){t=t._reactInternals;var a=Gt(),h=ss(a);h.tag=1,h.payload=s,r!=null&&(h.callback=r),s=rs(t,h,a),s!==null&&($t(s,t,a),An(s,t,a))},enqueueForceUpdate:function(t,s){t=t._reactInternals;var r=Gt(),a=ss(r);a.tag=2,s!=null&&(a.callback=s),s=rs(t,a,r),s!==null&&($t(s,t,r),An(s,t,r))}};function u_(t,s,r,a,h,u,g){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(a,u,g):s.prototype&&s.prototype.isPureReactComponent?!bn(r,a)||!bn(h,u):!0}function f_(t,s,r,a){t=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(r,a),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(r,a),s.state!==t&&Oh.enqueueReplaceState(s,s.state,null)}function Vs(t,s){var r=s;if("ref"in s){r={};for(var a in s)a!=="ref"&&(r[a]=s[a])}if(t=t.defaultProps){r===s&&(r=m({},r));for(var h in t)r[h]===void 0&&(r[h]=t[h])}return r}var _a=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function d_(t){_a(t)}function __(t){console.error(t)}function v_(t){_a(t)}function va(t,s){try{var r=t.onUncaughtError;r(s.value,{componentStack:s.stack})}catch(a){setTimeout(function(){throw a})}}function g_(t,s,r){try{var a=t.onCaughtError;a(r.value,{componentStack:r.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function zh(t,s,r){return r=ss(r),r.tag=3,r.payload={element:null},r.callback=function(){va(t,s)},r}function p_(t){return t=ss(t),t.tag=3,t}function m_(t,s,r,a){var h=r.type.getDerivedStateFromError;if(typeof h=="function"){var u=a.value;t.payload=function(){return h(u)},t.callback=function(){g_(s,r,a)}}var g=r.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(t.callback=function(){g_(s,r,a),typeof h!="function"&&(ds===null?ds=new Set([this]):ds.add(this));var p=a.stack;this.componentDidCatch(a.value,{componentStack:p!==null?p:""})})}function l0(t,s,r,a,h){if(r.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(s=r.alternate,s!==null&&kn(s,r,h,!0),r=ni.current,r!==null){switch(r.tag){case 13:return Si===null?rc():r.alternate===null&&Xe===0&&(Xe=3),r.flags&=-257,r.flags|=65536,r.lanes=h,a===hh?r.flags|=16384:(s=r.updateQueue,s===null?r.updateQueue=new Set([a]):s.add(a),lc(t,a,h)),!1;case 22:return r.flags|=65536,a===hh?r.flags|=16384:(s=r.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([a])},r.updateQueue=s):(r=s.retryQueue,r===null?s.retryQueue=new Set([a]):r.add(a)),lc(t,a,h)),!1}throw Error(l(435,r.tag))}return lc(t,a,h),rc(),!1}if(ke)return s=ni.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=h,a!==ih&&(t=Error(l(422),{cause:a}),En(ti(t,r)))):(a!==ih&&(s=Error(l(423),{cause:a}),En(ti(s,r))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,a=ti(a,r),h=zh(t.stateNode,a,h),fh(t,h),Xe!==4&&(Xe=2)),!1;var u=Error(l(520),{cause:a});if(u=ti(u,r),Xn===null?Xn=[u]:Xn.push(u),Xe!==4&&(Xe=2),s===null)return!0;a=ti(a,r),r=s;do{switch(r.tag){case 3:return r.flags|=65536,t=h&-h,r.lanes|=t,t=zh(r.stateNode,a,t),fh(r,t),!1;case 1:if(s=r.type,u=r.stateNode,(r.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(ds===null||!ds.has(u))))return r.flags|=65536,h&=-h,r.lanes|=h,h=p_(h),m_(h,t,r,a),fh(r,h),!1}r=r.return}while(r!==null);return!1}var S_=Error(l(461)),ct=!1;function mt(t,s,r,a){s.child=t===null?h_(s,null,r,a):Lr(s,t.child,r,a)}function y_(t,s,r,a,h){r=r.render;var u=s.ref;if("ref"in a){var g={};for(var p in a)p!=="ref"&&(g[p]=a[p])}else g=a;return Ws(s),a=ph(t,s,r,g,u,h),p=mh(),t!==null&&!ct?(Sh(t,s,h),qi(t,s,h)):(ke&&p&&eh(s),s.flags|=1,mt(t,s,a,h),s.child)}function b_(t,s,r,a,h){if(t===null){var u=r.type;return typeof u=="function"&&!Zo(u)&&u.defaultProps===void 0&&r.compare===null?(s.tag=15,s.type=u,w_(t,s,u,a,h)):(t=$l(r.type,null,a,s,s.mode,h),t.ref=s.ref,t.return=s,s.child=t)}if(u=t.child,!Wh(t,h)){var g=u.memoizedProps;if(r=r.compare,r=r!==null?r:bn,r(g,a)&&t.ref===s.ref)return qi(t,s,h)}return s.flags|=1,t=Oi(u,a),t.ref=s.ref,t.return=s,s.child=t}function w_(t,s,r,a,h){if(t!==null){var u=t.memoizedProps;if(bn(u,a)&&t.ref===s.ref)if(ct=!1,s.pendingProps=a=u,Wh(t,h))(t.flags&131072)!==0&&(ct=!0);else return s.lanes=t.lanes,qi(t,s,h)}return Lh(t,s,r,a,h)}function C_(t,s,r){var a=s.pendingProps,h=a.children,u=t!==null?t.memoizedState:null;if(a.mode==="hidden"){if((s.flags&128)!==0){if(a=u!==null?u.baseLanes|r:r,t!==null){for(h=s.child=t.child,u=0;h!==null;)u=u|h.lanes|h.childLanes,h=h.sibling;s.childLanes=u&~a}else s.childLanes=0,s.child=null;return x_(t,s,a,r)}if((r&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},t!==null&&Jl(s,u!==null?u.cachePool:null),u!==null?wd(s,u):_h(),c_(s);else return s.lanes=s.childLanes=536870912,x_(t,s,u!==null?u.baseLanes|r:r,r)}else u!==null?(Jl(s,u.cachePool),wd(s,u),as(),s.memoizedState=null):(t!==null&&Jl(s,null),_h(),as());return mt(t,s,h,r),s.child}function x_(t,s,r,a){var h=oh();return h=h===null?null:{parent:rt._currentValue,pool:h},s.memoizedState={baseLanes:r,cachePool:h},t!==null&&Jl(s,null),_h(),c_(s),t!==null&&kn(t,s,a,!0),null}function ga(t,s){var r=s.ref;if(r===null)t!==null&&t.ref!==null&&(s.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(l(284));(t===null||t.ref!==r)&&(s.flags|=4194816)}}function Lh(t,s,r,a,h){return Ws(s),r=ph(t,s,r,a,void 0,h),a=mh(),t!==null&&!ct?(Sh(t,s,h),qi(t,s,h)):(ke&&a&&eh(s),s.flags|=1,mt(t,s,r,h),s.child)}function E_(t,s,r,a,h,u){return Ws(s),s.updateQueue=null,r=xd(s,a,r,h),Cd(t),a=mh(),t!==null&&!ct?(Sh(t,s,u),qi(t,s,u)):(ke&&a&&eh(s),s.flags|=1,mt(t,s,r,u),s.child)}function k_(t,s,r,a,h){if(Ws(s),s.stateNode===null){var u=Er,g=r.contextType;typeof g=="object"&&g!==null&&(u=xt(g)),u=new r(a,u),s.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Oh,s.stateNode=u,u._reactInternals=s,u=s.stateNode,u.props=a,u.state=s.memoizedState,u.refs={},ch(s),g=r.contextType,u.context=typeof g=="object"&&g!==null?xt(g):Er,u.state=s.memoizedState,g=r.getDerivedStateFromProps,typeof g=="function"&&(Bh(s,r,g,a),u.state=s.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(g=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),g!==u.state&&Oh.enqueueReplaceState(u,u.state,null),On(s,a,u,h),Bn(),u.state=s.memoizedState),typeof u.componentDidMount=="function"&&(s.flags|=4194308),a=!0}else if(t===null){u=s.stateNode;var p=s.memoizedProps,b=Vs(r,p);u.props=b;var T=u.context,P=r.contextType;g=Er,typeof P=="object"&&P!==null&&(g=xt(P));var K=r.getDerivedStateFromProps;P=typeof K=="function"||typeof u.getSnapshotBeforeUpdate=="function",p=s.pendingProps!==p,P||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p||T!==g)&&f_(s,u,a,g),is=!1;var A=s.memoizedState;u.state=A,On(s,a,u,h),Bn(),T=s.memoizedState,p||A!==T||is?(typeof K=="function"&&(Bh(s,r,K,a),T=s.memoizedState),(b=is||u_(s,r,b,a,A,T,g))?(P||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(s.flags|=4194308)):(typeof u.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=a,s.memoizedState=T),u.props=a,u.state=T,u.context=g,a=b):(typeof u.componentDidMount=="function"&&(s.flags|=4194308),a=!1)}else{u=s.stateNode,uh(t,s),g=s.memoizedProps,P=Vs(r,g),u.props=P,K=s.pendingProps,A=u.context,T=r.contextType,b=Er,typeof T=="object"&&T!==null&&(b=xt(T)),p=r.getDerivedStateFromProps,(T=typeof p=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==K||A!==b)&&f_(s,u,a,b),is=!1,A=s.memoizedState,u.state=A,On(s,a,u,h),Bn();var O=s.memoizedState;g!==K||A!==O||is||t!==null&&t.dependencies!==null&&Zl(t.dependencies)?(typeof p=="function"&&(Bh(s,r,p,a),O=s.memoizedState),(P=is||u_(s,r,P,a,A,O,b)||t!==null&&t.dependencies!==null&&Zl(t.dependencies))?(T||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,O,b),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,O,b)),typeof u.componentDidUpdate=="function"&&(s.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof u.componentDidUpdate!="function"||g===t.memoizedProps&&A===t.memoizedState||(s.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===t.memoizedProps&&A===t.memoizedState||(s.flags|=1024),s.memoizedProps=a,s.memoizedState=O),u.props=a,u.state=O,u.context=b,a=P):(typeof u.componentDidUpdate!="function"||g===t.memoizedProps&&A===t.memoizedState||(s.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===t.memoizedProps&&A===t.memoizedState||(s.flags|=1024),a=!1)}return u=a,ga(t,s),a=(s.flags&128)!==0,u||a?(u=s.stateNode,r=a&&typeof r.getDerivedStateFromError!="function"?null:u.render(),s.flags|=1,t!==null&&a?(s.child=Lr(s,t.child,null,h),s.child=Lr(s,null,r,h)):mt(t,s,r,h),s.memoizedState=u.state,t=s.child):t=qi(t,s,h),t}function D_(t,s,r,a){return xn(),s.flags|=256,mt(t,s,r,a),s.child}var Nh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hh(t){return{baseLanes:t,cachePool:_d()}}function Uh(t,s,r){return t=t!==null?t.childLanes&~r:0,s&&(t|=li),t}function M_(t,s,r){var a=s.pendingProps,h=!1,u=(s.flags&128)!==0,g;if((g=u)||(g=t!==null&&t.memoizedState===null?!1:(nt.current&2)!==0),g&&(h=!0,s.flags&=-129),g=(s.flags&32)!==0,s.flags&=-33,t===null){if(ke){if(h?ls(s):as(),ke){var p=Ve,b;if(b=p){e:{for(b=p,p=mi;b.nodeType!==8;){if(!p){p=null;break e}if(b=_i(b.nextSibling),b===null){p=null;break e}}p=b}p!==null?(s.memoizedState={dehydrated:p,treeContext:Hs!==null?{id:zi,overflow:Li}:null,retryLane:536870912,hydrationErrors:null},b=Yt(18,null,null,0),b.stateNode=p,b.return=s,s.child=b,Mt=s,Ve=null,b=!0):b=!1}b||qs(s)}if(p=s.memoizedState,p!==null&&(p=p.dehydrated,p!==null))return bc(p)?s.lanes=32:s.lanes=536870912,null;Pi(s)}return p=a.children,a=a.fallback,h?(as(),h=s.mode,p=pa({mode:"hidden",children:p},h),a=Ns(a,h,r,null),p.return=s,a.return=s,p.sibling=a,s.child=p,h=s.child,h.memoizedState=Hh(r),h.childLanes=Uh(t,g,r),s.memoizedState=Nh,a):(ls(s),Ph(s,p))}if(b=t.memoizedState,b!==null&&(p=b.dehydrated,p!==null)){if(u)s.flags&256?(ls(s),s.flags&=-257,s=qh(t,s,r)):s.memoizedState!==null?(as(),s.child=t.child,s.flags|=128,s=null):(as(),h=a.fallback,p=s.mode,a=pa({mode:"visible",children:a.children},p),h=Ns(h,p,r,null),h.flags|=2,a.return=s,h.return=s,a.sibling=h,s.child=a,Lr(s,t.child,null,r),a=s.child,a.memoizedState=Hh(r),a.childLanes=Uh(t,g,r),s.memoizedState=Nh,s=h);else if(ls(s),bc(p)){if(g=p.nextSibling&&p.nextSibling.dataset,g)var T=g.dgst;g=T,a=Error(l(419)),a.stack="",a.digest=g,En({value:a,source:null,stack:null}),s=qh(t,s,r)}else if(ct||kn(t,s,r,!1),g=(r&t.childLanes)!==0,ct||g){if(g=He,g!==null&&(a=r&-r,a=(a&42)!==0?1:wo(a),a=(a&(g.suspendedLanes|r))!==0?0:a,a!==0&&a!==b.retryLane))throw b.retryLane=a,xr(t,a),$t(g,t,a),S_;p.data==="$?"||rc(),s=qh(t,s,r)}else p.data==="$?"?(s.flags|=192,s.child=t.child,s=null):(t=b.treeContext,Ve=_i(p.nextSibling),Mt=s,ke=!0,Ps=null,mi=!1,t!==null&&(si[ri++]=zi,si[ri++]=Li,si[ri++]=Hs,zi=t.id,Li=t.overflow,Hs=s),s=Ph(s,a.children),s.flags|=4096);return s}return h?(as(),h=a.fallback,p=s.mode,b=t.child,T=b.sibling,a=Oi(b,{mode:"hidden",children:a.children}),a.subtreeFlags=b.subtreeFlags&65011712,T!==null?h=Oi(T,h):(h=Ns(h,p,r,null),h.flags|=2),h.return=s,a.return=s,a.sibling=h,s.child=a,a=h,h=s.child,p=t.child.memoizedState,p===null?p=Hh(r):(b=p.cachePool,b!==null?(T=rt._currentValue,b=b.parent!==T?{parent:T,pool:T}:b):b=_d(),p={baseLanes:p.baseLanes|r,cachePool:b}),h.memoizedState=p,h.childLanes=Uh(t,g,r),s.memoizedState=Nh,a):(ls(s),r=t.child,t=r.sibling,r=Oi(r,{mode:"visible",children:a.children}),r.return=s,r.sibling=null,t!==null&&(g=s.deletions,g===null?(s.deletions=[t],s.flags|=16):g.push(t)),s.child=r,s.memoizedState=null,r)}function Ph(t,s){return s=pa({mode:"visible",children:s},t.mode),s.return=t,t.child=s}function pa(t,s){return t=Yt(22,t,null,s),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function qh(t,s,r){return Lr(s,t.child,null,r),t=Ph(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function R_(t,s,r){t.lanes|=s;var a=t.alternate;a!==null&&(a.lanes|=s),rh(t.return,s,r)}function jh(t,s,r,a,h){var u=t.memoizedState;u===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:h}:(u.isBackwards=s,u.rendering=null,u.renderingStartTime=0,u.last=a,u.tail=r,u.tailMode=h)}function T_(t,s,r){var a=s.pendingProps,h=a.revealOrder,u=a.tail;if(mt(t,s,a.children,r),a=nt.current,(a&2)!==0)a=a&1|2,s.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&R_(t,r,s);else if(t.tag===19)R_(t,r,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===s)break e;for(;t.sibling===null;){if(t.return===null||t.return===s)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}a&=1}switch(F(nt,a),h){case"forwards":for(r=s.child,h=null;r!==null;)t=r.alternate,t!==null&&da(t)===null&&(h=r),r=r.sibling;r=h,r===null?(h=s.child,s.child=null):(h=r.sibling,r.sibling=null),jh(s,!1,h,r,u);break;case"backwards":for(r=null,h=s.child,s.child=null;h!==null;){if(t=h.alternate,t!==null&&da(t)===null){s.child=h;break}t=h.sibling,h.sibling=r,r=h,h=t}jh(s,!0,r,null,u);break;case"together":jh(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function qi(t,s,r){if(t!==null&&(s.dependencies=t.dependencies),fs|=s.lanes,(r&s.childLanes)===0)if(t!==null){if(kn(t,s,r,!1),(r&s.childLanes)===0)return null}else return null;if(t!==null&&s.child!==t.child)throw Error(l(153));if(s.child!==null){for(t=s.child,r=Oi(t,t.pendingProps),s.child=r,r.return=s;t.sibling!==null;)t=t.sibling,r=r.sibling=Oi(t,t.pendingProps),r.return=s;r.sibling=null}return s.child}function Wh(t,s){return(t.lanes&s)!==0?!0:(t=t.dependencies,!!(t!==null&&Zl(t)))}function a0(t,s,r){switch(s.tag){case 3:De(s,s.stateNode.containerInfo),ts(s,rt,t.memoizedState.cache),xn();break;case 27:case 5:Zi(s);break;case 4:De(s,s.stateNode.containerInfo);break;case 10:ts(s,s.type,s.memoizedProps.value);break;case 13:var a=s.memoizedState;if(a!==null)return a.dehydrated!==null?(ls(s),s.flags|=128,null):(r&s.child.childLanes)!==0?M_(t,s,r):(ls(s),t=qi(t,s,r),t!==null?t.sibling:null);ls(s);break;case 19:var h=(t.flags&128)!==0;if(a=(r&s.childLanes)!==0,a||(kn(t,s,r,!1),a=(r&s.childLanes)!==0),h){if(a)return T_(t,s,r);s.flags|=128}if(h=s.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),F(nt,nt.current),a)break;return null;case 22:case 23:return s.lanes=0,C_(t,s,r);case 24:ts(s,rt,t.memoizedState.cache)}return qi(t,s,r)}function A_(t,s,r){if(t!==null)if(t.memoizedProps!==s.pendingProps)ct=!0;else{if(!Wh(t,r)&&(s.flags&128)===0)return ct=!1,a0(t,s,r);ct=(t.flags&131072)!==0}else ct=!1,ke&&(s.flags&1048576)!==0&&ad(s,Il,s.index);switch(s.lanes=0,s.tag){case 16:e:{t=s.pendingProps;var a=s.elementType,h=a._init;if(a=h(a._payload),s.type=a,typeof a=="function")Zo(a)?(t=Vs(a,t),s.tag=1,s=k_(null,s,a,t,r)):(s.tag=0,s=Lh(null,s,a,t,r));else{if(a!=null){if(h=a.$$typeof,h===q){s.tag=11,s=y_(null,s,a,t,r);break e}else if(h===le){s.tag=14,s=b_(null,s,a,t,r);break e}}throw s=$(a)||a,Error(l(306,s,""))}}return s;case 0:return Lh(t,s,s.type,s.pendingProps,r);case 1:return a=s.type,h=Vs(a,s.pendingProps),k_(t,s,a,h,r);case 3:e:{if(De(s,s.stateNode.containerInfo),t===null)throw Error(l(387));a=s.pendingProps;var u=s.memoizedState;h=u.element,uh(t,s),On(s,a,null,r);var g=s.memoizedState;if(a=g.cache,ts(s,rt,a),a!==u.cache&&nh(s,[rt],r,!0),Bn(),a=g.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:g.cache},s.updateQueue.baseState=u,s.memoizedState=u,s.flags&256){s=D_(t,s,a,r);break e}else if(a!==h){h=ti(Error(l(424)),s),En(h),s=D_(t,s,a,r);break e}else{switch(t=s.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Ve=_i(t.firstChild),Mt=s,ke=!0,Ps=null,mi=!0,r=h_(s,null,a,r),s.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(xn(),a===h){s=qi(t,s,r);break e}mt(t,s,a,r)}s=s.child}return s;case 26:return ga(t,s),t===null?(r=Lv(s.type,null,s.pendingProps,null))?s.memoizedState=r:ke||(r=s.type,t=s.pendingProps,a=Aa(re.current).createElement(r),a[Ct]=s,a[Ot]=t,yt(a,r,t),ht(a),s.stateNode=a):s.memoizedState=Lv(s.type,t.memoizedProps,s.pendingProps,t.memoizedState),null;case 27:return Zi(s),t===null&&ke&&(a=s.stateNode=Bv(s.type,s.pendingProps,re.current),Mt=s,mi=!0,h=Ve,gs(s.type)?(wc=h,Ve=_i(a.firstChild)):Ve=h),mt(t,s,s.pendingProps.children,r),ga(t,s),t===null&&(s.flags|=4194304),s.child;case 5:return t===null&&ke&&((h=a=Ve)&&(a=L0(a,s.type,s.pendingProps,mi),a!==null?(s.stateNode=a,Mt=s,Ve=_i(a.firstChild),mi=!1,h=!0):h=!1),h||qs(s)),Zi(s),h=s.type,u=s.pendingProps,g=t!==null?t.memoizedProps:null,a=u.children,mc(h,u)?a=null:g!==null&&mc(h,g)&&(s.flags|=32),s.memoizedState!==null&&(h=ph(t,s,JS,null,null,r),tl._currentValue=h),ga(t,s),mt(t,s,a,r),s.child;case 6:return t===null&&ke&&((t=r=Ve)&&(r=N0(r,s.pendingProps,mi),r!==null?(s.stateNode=r,Mt=s,Ve=null,t=!0):t=!1),t||qs(s)),null;case 13:return M_(t,s,r);case 4:return De(s,s.stateNode.containerInfo),a=s.pendingProps,t===null?s.child=Lr(s,null,a,r):mt(t,s,a,r),s.child;case 11:return y_(t,s,s.type,s.pendingProps,r);case 7:return mt(t,s,s.pendingProps,r),s.child;case 8:return mt(t,s,s.pendingProps.children,r),s.child;case 12:return mt(t,s,s.pendingProps.children,r),s.child;case 10:return a=s.pendingProps,ts(s,s.type,a.value),mt(t,s,a.children,r),s.child;case 9:return h=s.type._context,a=s.pendingProps.children,Ws(s),h=xt(h),a=a(h),s.flags|=1,mt(t,s,a,r),s.child;case 14:return b_(t,s,s.type,s.pendingProps,r);case 15:return w_(t,s,s.type,s.pendingProps,r);case 19:return T_(t,s,r);case 31:return a=s.pendingProps,r=s.mode,a={mode:a.mode,children:a.children},t===null?(r=pa(a,r),r.ref=s.ref,s.child=r,r.return=s,s=r):(r=Oi(t.child,a),r.ref=s.ref,s.child=r,r.return=s,s=r),s;case 22:return C_(t,s,r);case 24:return Ws(s),a=xt(rt),t===null?(h=oh(),h===null&&(h=He,u=lh(),h.pooledCache=u,u.refCount++,u!==null&&(h.pooledCacheLanes|=r),h=u),s.memoizedState={parent:a,cache:h},ch(s),ts(s,rt,h)):((t.lanes&r)!==0&&(uh(t,s),On(s,null,null,r),Bn()),h=t.memoizedState,u=s.memoizedState,h.parent!==a?(h={parent:a,cache:a},s.memoizedState=h,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=h),ts(s,rt,a)):(a=u.cache,ts(s,rt,a),a!==h.cache&&nh(s,[rt],r,!0))),mt(t,s,s.pendingProps.children,r),s.child;case 29:throw s.pendingProps}throw Error(l(156,s.tag))}function ji(t){t.flags|=4}function B_(t,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!qv(s)){if(s=ni.current,s!==null&&((Ce&4194048)===Ce?Si!==null:(Ce&62914560)!==Ce&&(Ce&536870912)===0||s!==Si))throw Tn=hh,vd;t.flags|=8192}}function ma(t,s){s!==null&&(t.flags|=4),t.flags&16384&&(s=t.tag!==22?cf():536870912,t.lanes|=s,Pr|=s)}function qn(t,s){if(!ke)switch(t.tailMode){case"hidden":s=t.tail;for(var r=null;s!==null;)s.alternate!==null&&(r=s),s=s.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?s||t.tail===null?t.tail=null:t.tail.sibling=null:a.sibling=null}}function We(t){var s=t.alternate!==null&&t.alternate.child===t.child,r=0,a=0;if(s)for(var h=t.child;h!==null;)r|=h.lanes|h.childLanes,a|=h.subtreeFlags&65011712,a|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)r|=h.lanes|h.childLanes,a|=h.subtreeFlags,a|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=a,t.childLanes=r,s}function o0(t,s,r){var a=s.pendingProps;switch(th(s),s.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(s),null;case 1:return We(s),null;case 3:return r=s.stateNode,a=null,t!==null&&(a=t.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),Hi(rt),st(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Cn(s)?ji(s):t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,cd())),We(s),null;case 26:return r=s.memoizedState,t===null?(ji(s),r!==null?(We(s),B_(s,r)):(We(s),s.flags&=-16777217)):r?r!==t.memoizedState?(ji(s),We(s),B_(s,r)):(We(s),s.flags&=-16777217):(t.memoizedProps!==a&&ji(s),We(s),s.flags&=-16777217),null;case 27:gi(s),r=re.current;var h=s.type;if(t!==null&&s.stateNode!=null)t.memoizedProps!==a&&ji(s);else{if(!a){if(s.stateNode===null)throw Error(l(166));return We(s),null}t=se.current,Cn(s)?od(s):(t=Bv(h,a,r),s.stateNode=t,ji(s))}return We(s),null;case 5:if(gi(s),r=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==a&&ji(s);else{if(!a){if(s.stateNode===null)throw Error(l(166));return We(s),null}if(t=se.current,Cn(s))od(s);else{switch(h=Aa(re.current),t){case 1:t=h.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:t=h.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":t=h.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":t=h.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":t=h.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof a.is=="string"?h.createElement("select",{is:a.is}):h.createElement("select"),a.multiple?t.multiple=!0:a.size&&(t.size=a.size);break;default:t=typeof a.is=="string"?h.createElement(r,{is:a.is}):h.createElement(r)}}t[Ct]=s,t[Ot]=a;e:for(h=s.child;h!==null;){if(h.tag===5||h.tag===6)t.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===s)break e;for(;h.sibling===null;){if(h.return===null||h.return===s)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}s.stateNode=t;e:switch(yt(t,r,a),r){case"button":case"input":case"select":case"textarea":t=!!a.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&ji(s)}}return We(s),s.flags&=-16777217,null;case 6:if(t&&s.stateNode!=null)t.memoizedProps!==a&&ji(s);else{if(typeof a!="string"&&s.stateNode===null)throw Error(l(166));if(t=re.current,Cn(s)){if(t=s.stateNode,r=s.memoizedProps,a=null,h=Mt,h!==null)switch(h.tag){case 27:case 5:a=h.memoizedProps}t[Ct]=s,t=!!(t.nodeValue===r||a!==null&&a.suppressHydrationWarning===!0||Ev(t.nodeValue,r)),t||qs(s)}else t=Aa(t).createTextNode(a),t[Ct]=s,s.stateNode=t}return We(s),null;case 13:if(a=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Cn(s),a!==null&&a.dehydrated!==null){if(t===null){if(!h)throw Error(l(318));if(h=s.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(l(317));h[Ct]=s}else xn(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;We(s),h=!1}else h=cd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return s.flags&256?(Pi(s),s):(Pi(s),null)}if(Pi(s),(s.flags&128)!==0)return s.lanes=r,s;if(r=a!==null,t=t!==null&&t.memoizedState!==null,r){a=s.child,h=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(h=a.alternate.memoizedState.cachePool.pool);var u=null;a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==h&&(a.flags|=2048)}return r!==t&&r&&(s.child.flags|=8192),ma(s,s.updateQueue),We(s),null;case 4:return st(),t===null&&dc(s.stateNode.containerInfo),We(s),null;case 10:return Hi(s.type),We(s),null;case 19:if(J(nt),h=s.memoizedState,h===null)return We(s),null;if(a=(s.flags&128)!==0,u=h.rendering,u===null)if(a)qn(h,!1);else{if(Xe!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(u=da(t),u!==null){for(s.flags|=128,qn(h,!1),t=u.updateQueue,s.updateQueue=t,ma(s,t),s.subtreeFlags=0,t=r,r=s.child;r!==null;)ld(r,t),r=r.sibling;return F(nt,nt.current&1|2),s.child}t=t.sibling}h.tail!==null&&pi()>ba&&(s.flags|=128,a=!0,qn(h,!1),s.lanes=4194304)}else{if(!a)if(t=da(u),t!==null){if(s.flags|=128,a=!0,t=t.updateQueue,s.updateQueue=t,ma(s,t),qn(h,!0),h.tail===null&&h.tailMode==="hidden"&&!u.alternate&&!ke)return We(s),null}else 2*pi()-h.renderingStartTime>ba&&r!==536870912&&(s.flags|=128,a=!0,qn(h,!1),s.lanes=4194304);h.isBackwards?(u.sibling=s.child,s.child=u):(t=h.last,t!==null?t.sibling=u:s.child=u,h.last=u)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=pi(),s.sibling=null,t=nt.current,F(nt,a?t&1|2:t&1),s):(We(s),null);case 22:case 23:return Pi(s),vh(),a=s.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(s.flags|=8192):a&&(s.flags|=8192),a?(r&536870912)!==0&&(s.flags&128)===0&&(We(s),s.subtreeFlags&6&&(s.flags|=8192)):We(s),r=s.updateQueue,r!==null&&ma(s,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==r&&(s.flags|=2048),t!==null&&J(Ys),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),s.memoizedState.cache!==r&&(s.flags|=2048),Hi(rt),We(s),null;case 25:return null;case 30:return null}throw Error(l(156,s.tag))}function h0(t,s){switch(th(s),s.tag){case 1:return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return Hi(rt),st(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 26:case 27:case 5:return gi(s),null;case 13:if(Pi(s),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));xn()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return J(nt),null;case 4:return st(),null;case 10:return Hi(s.type),null;case 22:case 23:return Pi(s),vh(),t!==null&&J(Ys),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 24:return Hi(rt),null;case 25:return null;default:return null}}function O_(t,s){switch(th(s),s.tag){case 3:Hi(rt),st();break;case 26:case 27:case 5:gi(s);break;case 4:st();break;case 13:Pi(s);break;case 19:J(nt);break;case 10:Hi(s.type);break;case 22:case 23:Pi(s),vh(),t!==null&&J(Ys);break;case 24:Hi(rt)}}function jn(t,s){try{var r=s.updateQueue,a=r!==null?r.lastEffect:null;if(a!==null){var h=a.next;r=h;do{if((r.tag&t)===t){a=void 0;var u=r.create,g=r.inst;a=u(),g.destroy=a}r=r.next}while(r!==h)}}catch(p){Ne(s,s.return,p)}}function os(t,s,r){try{var a=s.updateQueue,h=a!==null?a.lastEffect:null;if(h!==null){var u=h.next;a=u;do{if((a.tag&t)===t){var g=a.inst,p=g.destroy;if(p!==void 0){g.destroy=void 0,h=s;var b=r,T=p;try{T()}catch(P){Ne(h,b,P)}}}a=a.next}while(a!==u)}}catch(P){Ne(s,s.return,P)}}function z_(t){var s=t.updateQueue;if(s!==null){var r=t.stateNode;try{bd(s,r)}catch(a){Ne(t,t.return,a)}}}function L_(t,s,r){r.props=Vs(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(a){Ne(t,s,a)}}function Wn(t,s){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof r=="function"?t.refCleanup=r(a):r.current=a}}catch(h){Ne(t,s,h)}}function yi(t,s){var r=t.ref,a=t.refCleanup;if(r!==null)if(typeof a=="function")try{a()}catch(h){Ne(t,s,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(h){Ne(t,s,h)}else r.current=null}function N_(t){var s=t.type,r=t.memoizedProps,a=t.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":r.autoFocus&&a.focus();break e;case"img":r.src?a.src=r.src:r.srcSet&&(a.srcset=r.srcSet)}}catch(h){Ne(t,t.return,h)}}function Yh(t,s,r){try{var a=t.stateNode;T0(a,t.type,r,s),a[Ot]=s}catch(h){Ne(t,t.return,h)}}function H_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&gs(t.type)||t.tag===4}function Kh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||H_(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&gs(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Vh(t,s,r){var a=t.tag;if(a===5||a===6)t=t.stateNode,s?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,s):(s=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.appendChild(t),r=r._reactRootContainer,r!=null||s.onclick!==null||(s.onclick=Ta));else if(a!==4&&(a===27&&gs(t.type)&&(r=t.stateNode,s=null),t=t.child,t!==null))for(Vh(t,s,r),t=t.sibling;t!==null;)Vh(t,s,r),t=t.sibling}function Sa(t,s,r){var a=t.tag;if(a===5||a===6)t=t.stateNode,s?r.insertBefore(t,s):r.appendChild(t);else if(a!==4&&(a===27&&gs(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(Sa(t,s,r),t=t.sibling;t!==null;)Sa(t,s,r),t=t.sibling}function U_(t){var s=t.stateNode,r=t.memoizedProps;try{for(var a=t.type,h=s.attributes;h.length;)s.removeAttributeNode(h[0]);yt(s,a,r),s[Ct]=t,s[Ot]=r}catch(u){Ne(t,t.return,u)}}var Wi=!1,Ie=!1,Xh=!1,P_=typeof WeakSet=="function"?WeakSet:Set,ut=null;function c0(t,s){if(t=t.containerInfo,gc=Ha,t=If(t),Ko(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var h=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{r.nodeType,u.nodeType}catch{r=null;break e}var g=0,p=-1,b=-1,T=0,P=0,K=t,A=null;t:for(;;){for(var O;K!==r||h!==0&&K.nodeType!==3||(p=g+h),K!==u||a!==0&&K.nodeType!==3||(b=g+a),K.nodeType===3&&(g+=K.nodeValue.length),(O=K.firstChild)!==null;)A=K,K=O;for(;;){if(K===t)break t;if(A===r&&++T===h&&(p=g),A===u&&++P===a&&(b=g),(O=K.nextSibling)!==null)break;K=A,A=K.parentNode}K=O}r=p===-1||b===-1?null:{start:p,end:b}}else r=null}r=r||{start:0,end:0}}else r=null;for(pc={focusedElem:t,selectionRange:r},Ha=!1,ut=s;ut!==null;)if(s=ut,t=s.child,(s.subtreeFlags&1024)!==0&&t!==null)t.return=s,ut=t;else for(;ut!==null;){switch(s=ut,u=s.alternate,t=s.flags,s.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&u!==null){t=void 0,r=s,h=u.memoizedProps,u=u.memoizedState,a=r.stateNode;try{var ue=Vs(r.type,h,r.elementType===r.type);t=a.getSnapshotBeforeUpdate(ue,u),a.__reactInternalSnapshotBeforeUpdate=t}catch(he){Ne(r,r.return,he)}}break;case 3:if((t&1024)!==0){if(t=s.stateNode.containerInfo,r=t.nodeType,r===9)yc(t);else if(r===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":yc(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=s.sibling,t!==null){t.return=s.return,ut=t;break}ut=s.return}}function q_(t,s,r){var a=r.flags;switch(r.tag){case 0:case 11:case 15:hs(t,r),a&4&&jn(5,r);break;case 1:if(hs(t,r),a&4)if(t=r.stateNode,s===null)try{t.componentDidMount()}catch(g){Ne(r,r.return,g)}else{var h=Vs(r.type,s.memoizedProps);s=s.memoizedState;try{t.componentDidUpdate(h,s,t.__reactInternalSnapshotBeforeUpdate)}catch(g){Ne(r,r.return,g)}}a&64&&z_(r),a&512&&Wn(r,r.return);break;case 3:if(hs(t,r),a&64&&(t=r.updateQueue,t!==null)){if(s=null,r.child!==null)switch(r.child.tag){case 27:case 5:s=r.child.stateNode;break;case 1:s=r.child.stateNode}try{bd(t,s)}catch(g){Ne(r,r.return,g)}}break;case 27:s===null&&a&4&&U_(r);case 26:case 5:hs(t,r),s===null&&a&4&&N_(r),a&512&&Wn(r,r.return);break;case 12:hs(t,r);break;case 13:hs(t,r),a&4&&Y_(t,r),a&64&&(t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(r=S0.bind(null,r),H0(t,r))));break;case 22:if(a=r.memoizedState!==null||Wi,!a){s=s!==null&&s.memoizedState!==null||Ie,h=Wi;var u=Ie;Wi=a,(Ie=s)&&!u?cs(t,r,(r.subtreeFlags&8772)!==0):hs(t,r),Wi=h,Ie=u}break;case 30:break;default:hs(t,r)}}function j_(t){var s=t.alternate;s!==null&&(t.alternate=null,j_(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&Eo(s)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var qe=null,Nt=!1;function Yi(t,s,r){for(r=r.child;r!==null;)W_(t,s,r),r=r.sibling}function W_(t,s,r){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(hn,r)}catch{}switch(r.tag){case 26:Ie||yi(r,s),Yi(t,s,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Ie||yi(r,s);var a=qe,h=Nt;gs(r.type)&&(qe=r.stateNode,Nt=!1),Yi(t,s,r),Zn(r.stateNode),qe=a,Nt=h;break;case 5:Ie||yi(r,s);case 6:if(a=qe,h=Nt,qe=null,Yi(t,s,r),qe=a,Nt=h,qe!==null)if(Nt)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(r.stateNode)}catch(u){Ne(r,s,u)}else try{qe.removeChild(r.stateNode)}catch(u){Ne(r,s,u)}break;case 18:qe!==null&&(Nt?(t=qe,Tv(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,r.stateNode),nl(t)):Tv(qe,r.stateNode));break;case 4:a=qe,h=Nt,qe=r.stateNode.containerInfo,Nt=!0,Yi(t,s,r),qe=a,Nt=h;break;case 0:case 11:case 14:case 15:Ie||os(2,r,s),Ie||os(4,r,s),Yi(t,s,r);break;case 1:Ie||(yi(r,s),a=r.stateNode,typeof a.componentWillUnmount=="function"&&L_(r,s,a)),Yi(t,s,r);break;case 21:Yi(t,s,r);break;case 22:Ie=(a=Ie)||r.memoizedState!==null,Yi(t,s,r),Ie=a;break;default:Yi(t,s,r)}}function Y_(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{nl(t)}catch(r){Ne(s,s.return,r)}}function u0(t){switch(t.tag){case 13:case 19:var s=t.stateNode;return s===null&&(s=t.stateNode=new P_),s;case 22:return t=t.stateNode,s=t._retryCache,s===null&&(s=t._retryCache=new P_),s;default:throw Error(l(435,t.tag))}}function Gh(t,s){var r=u0(t);s.forEach(function(a){var h=y0.bind(null,t,a);r.has(a)||(r.add(a),a.then(h,h))})}function Kt(t,s){var r=s.deletions;if(r!==null)for(var a=0;a<r.length;a++){var h=r[a],u=t,g=s,p=g;e:for(;p!==null;){switch(p.tag){case 27:if(gs(p.type)){qe=p.stateNode,Nt=!1;break e}break;case 5:qe=p.stateNode,Nt=!1;break e;case 3:case 4:qe=p.stateNode.containerInfo,Nt=!0;break e}p=p.return}if(qe===null)throw Error(l(160));W_(u,g,h),qe=null,Nt=!1,u=h.alternate,u!==null&&(u.return=null),h.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)K_(s,t),s=s.sibling}var di=null;function K_(t,s){var r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Kt(s,t),Vt(t),a&4&&(os(3,t,t.return),jn(3,t),os(5,t,t.return));break;case 1:Kt(s,t),Vt(t),a&512&&(Ie||r===null||yi(r,r.return)),a&64&&Wi&&(t=t.updateQueue,t!==null&&(a=t.callbacks,a!==null&&(r=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=r===null?a:r.concat(a))));break;case 26:var h=di;if(Kt(s,t),Vt(t),a&512&&(Ie||r===null||yi(r,r.return)),a&4){var u=r!==null?r.memoizedState:null;if(a=t.memoizedState,r===null)if(a===null)if(t.stateNode===null){e:{a=t.type,r=t.memoizedProps,h=h.ownerDocument||h;t:switch(a){case"title":u=h.getElementsByTagName("title")[0],(!u||u[fn]||u[Ct]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=h.createElement(a),h.head.insertBefore(u,h.querySelector("head > title"))),yt(u,a,r),u[Ct]=t,ht(u),a=u;break e;case"link":var g=Uv("link","href",h).get(a+(r.href||""));if(g){for(var p=0;p<g.length;p++)if(u=g[p],u.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&u.getAttribute("rel")===(r.rel==null?null:r.rel)&&u.getAttribute("title")===(r.title==null?null:r.title)&&u.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){g.splice(p,1);break t}}u=h.createElement(a),yt(u,a,r),h.head.appendChild(u);break;case"meta":if(g=Uv("meta","content",h).get(a+(r.content||""))){for(p=0;p<g.length;p++)if(u=g[p],u.getAttribute("content")===(r.content==null?null:""+r.content)&&u.getAttribute("name")===(r.name==null?null:r.name)&&u.getAttribute("property")===(r.property==null?null:r.property)&&u.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&u.getAttribute("charset")===(r.charSet==null?null:r.charSet)){g.splice(p,1);break t}}u=h.createElement(a),yt(u,a,r),h.head.appendChild(u);break;default:throw Error(l(468,a))}u[Ct]=t,ht(u),a=u}t.stateNode=a}else Pv(h,t.type,t.stateNode);else t.stateNode=Hv(h,a,t.memoizedProps);else u!==a?(u===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):u.count--,a===null?Pv(h,t.type,t.stateNode):Hv(h,a,t.memoizedProps)):a===null&&t.stateNode!==null&&Yh(t,t.memoizedProps,r.memoizedProps)}break;case 27:Kt(s,t),Vt(t),a&512&&(Ie||r===null||yi(r,r.return)),r!==null&&a&4&&Yh(t,t.memoizedProps,r.memoizedProps);break;case 5:if(Kt(s,t),Vt(t),a&512&&(Ie||r===null||yi(r,r.return)),t.flags&32){h=t.stateNode;try{pr(h,"")}catch(O){Ne(t,t.return,O)}}a&4&&t.stateNode!=null&&(h=t.memoizedProps,Yh(t,h,r!==null?r.memoizedProps:h)),a&1024&&(Xh=!0);break;case 6:if(Kt(s,t),Vt(t),a&4){if(t.stateNode===null)throw Error(l(162));a=t.memoizedProps,r=t.stateNode;try{r.nodeValue=a}catch(O){Ne(t,t.return,O)}}break;case 3:if(za=null,h=di,di=Ba(s.containerInfo),Kt(s,t),di=h,Vt(t),a&4&&r!==null&&r.memoizedState.isDehydrated)try{nl(s.containerInfo)}catch(O){Ne(t,t.return,O)}Xh&&(Xh=!1,V_(t));break;case 4:a=di,di=Ba(t.stateNode.containerInfo),Kt(s,t),Vt(t),di=a;break;case 12:Kt(s,t),Vt(t);break;case 13:Kt(s,t),Vt(t),t.child.flags&8192&&t.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Jh=pi()),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,Gh(t,a)));break;case 22:h=t.memoizedState!==null;var b=r!==null&&r.memoizedState!==null,T=Wi,P=Ie;if(Wi=T||h,Ie=P||b,Kt(s,t),Ie=P,Wi=T,Vt(t),a&8192)e:for(s=t.stateNode,s._visibility=h?s._visibility&-2:s._visibility|1,h&&(r===null||b||Wi||Ie||Xs(t)),r=null,s=t;;){if(s.tag===5||s.tag===26){if(r===null){b=r=s;try{if(u=b.stateNode,h)g=u.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{p=b.stateNode;var K=b.memoizedProps.style,A=K!=null&&K.hasOwnProperty("display")?K.display:null;p.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(O){Ne(b,b.return,O)}}}else if(s.tag===6){if(r===null){b=s;try{b.stateNode.nodeValue=h?"":b.memoizedProps}catch(O){Ne(b,b.return,O)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===t)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;r===s&&(r=null),s=s.return}r===s&&(r=null),s.sibling.return=s.return,s=s.sibling}a&4&&(a=t.updateQueue,a!==null&&(r=a.retryQueue,r!==null&&(a.retryQueue=null,Gh(t,r))));break;case 19:Kt(s,t),Vt(t),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,Gh(t,a)));break;case 30:break;case 21:break;default:Kt(s,t),Vt(t)}}function Vt(t){var s=t.flags;if(s&2){try{for(var r,a=t.return;a!==null;){if(H_(a)){r=a;break}a=a.return}if(r==null)throw Error(l(160));switch(r.tag){case 27:var h=r.stateNode,u=Kh(t);Sa(t,u,h);break;case 5:var g=r.stateNode;r.flags&32&&(pr(g,""),r.flags&=-33);var p=Kh(t);Sa(t,p,g);break;case 3:case 4:var b=r.stateNode.containerInfo,T=Kh(t);Vh(t,T,b);break;default:throw Error(l(161))}}catch(P){Ne(t,t.return,P)}t.flags&=-3}s&4096&&(t.flags&=-4097)}function V_(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var s=t;V_(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),t=t.sibling}}function hs(t,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)q_(t,s.alternate,s),s=s.sibling}function Xs(t){for(t=t.child;t!==null;){var s=t;switch(s.tag){case 0:case 11:case 14:case 15:os(4,s,s.return),Xs(s);break;case 1:yi(s,s.return);var r=s.stateNode;typeof r.componentWillUnmount=="function"&&L_(s,s.return,r),Xs(s);break;case 27:Zn(s.stateNode);case 26:case 5:yi(s,s.return),Xs(s);break;case 22:s.memoizedState===null&&Xs(s);break;case 30:Xs(s);break;default:Xs(s)}t=t.sibling}}function cs(t,s,r){for(r=r&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var a=s.alternate,h=t,u=s,g=u.flags;switch(u.tag){case 0:case 11:case 15:cs(h,u,r),jn(4,u);break;case 1:if(cs(h,u,r),a=u,h=a.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(T){Ne(a,a.return,T)}if(a=u,h=a.updateQueue,h!==null){var p=a.stateNode;try{var b=h.shared.hiddenCallbacks;if(b!==null)for(h.shared.hiddenCallbacks=null,h=0;h<b.length;h++)yd(b[h],p)}catch(T){Ne(a,a.return,T)}}r&&g&64&&z_(u),Wn(u,u.return);break;case 27:U_(u);case 26:case 5:cs(h,u,r),r&&a===null&&g&4&&N_(u),Wn(u,u.return);break;case 12:cs(h,u,r);break;case 13:cs(h,u,r),r&&g&4&&Y_(h,u);break;case 22:u.memoizedState===null&&cs(h,u,r),Wn(u,u.return);break;case 30:break;default:cs(h,u,r)}s=s.sibling}}function $h(t,s){var r=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),t=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(t=s.memoizedState.cachePool.pool),t!==r&&(t!=null&&t.refCount++,r!=null&&Dn(r))}function Fh(t,s){t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&Dn(t))}function bi(t,s,r,a){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)X_(t,s,r,a),s=s.sibling}function X_(t,s,r,a){var h=s.flags;switch(s.tag){case 0:case 11:case 15:bi(t,s,r,a),h&2048&&jn(9,s);break;case 1:bi(t,s,r,a);break;case 3:bi(t,s,r,a),h&2048&&(t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&Dn(t)));break;case 12:if(h&2048){bi(t,s,r,a),t=s.stateNode;try{var u=s.memoizedProps,g=u.id,p=u.onPostCommit;typeof p=="function"&&p(g,s.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(b){Ne(s,s.return,b)}}else bi(t,s,r,a);break;case 13:bi(t,s,r,a);break;case 23:break;case 22:u=s.stateNode,g=s.alternate,s.memoizedState!==null?u._visibility&2?bi(t,s,r,a):Yn(t,s):u._visibility&2?bi(t,s,r,a):(u._visibility|=2,Nr(t,s,r,a,(s.subtreeFlags&10256)!==0)),h&2048&&$h(g,s);break;case 24:bi(t,s,r,a),h&2048&&Fh(s.alternate,s);break;default:bi(t,s,r,a)}}function Nr(t,s,r,a,h){for(h=h&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;){var u=t,g=s,p=r,b=a,T=g.flags;switch(g.tag){case 0:case 11:case 15:Nr(u,g,p,b,h),jn(8,g);break;case 23:break;case 22:var P=g.stateNode;g.memoizedState!==null?P._visibility&2?Nr(u,g,p,b,h):Yn(u,g):(P._visibility|=2,Nr(u,g,p,b,h)),h&&T&2048&&$h(g.alternate,g);break;case 24:Nr(u,g,p,b,h),h&&T&2048&&Fh(g.alternate,g);break;default:Nr(u,g,p,b,h)}s=s.sibling}}function Yn(t,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var r=t,a=s,h=a.flags;switch(a.tag){case 22:Yn(r,a),h&2048&&$h(a.alternate,a);break;case 24:Yn(r,a),h&2048&&Fh(a.alternate,a);break;default:Yn(r,a)}s=s.sibling}}var Kn=8192;function Hr(t){if(t.subtreeFlags&Kn)for(t=t.child;t!==null;)G_(t),t=t.sibling}function G_(t){switch(t.tag){case 26:Hr(t),t.flags&Kn&&t.memoizedState!==null&&I0(di,t.memoizedState,t.memoizedProps);break;case 5:Hr(t);break;case 3:case 4:var s=di;di=Ba(t.stateNode.containerInfo),Hr(t),di=s;break;case 22:t.memoizedState===null&&(s=t.alternate,s!==null&&s.memoizedState!==null?(s=Kn,Kn=16777216,Hr(t),Kn=s):Hr(t));break;default:Hr(t)}}function $_(t){var s=t.alternate;if(s!==null&&(t=s.child,t!==null)){s.child=null;do s=t.sibling,t.sibling=null,t=s;while(t!==null)}}function Vn(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var r=0;r<s.length;r++){var a=s[r];ut=a,I_(a,t)}$_(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)F_(t),t=t.sibling}function F_(t){switch(t.tag){case 0:case 11:case 15:Vn(t),t.flags&2048&&os(9,t,t.return);break;case 3:Vn(t);break;case 12:Vn(t);break;case 22:var s=t.stateNode;t.memoizedState!==null&&s._visibility&2&&(t.return===null||t.return.tag!==13)?(s._visibility&=-3,ya(t)):Vn(t);break;default:Vn(t)}}function ya(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var r=0;r<s.length;r++){var a=s[r];ut=a,I_(a,t)}$_(t)}for(t=t.child;t!==null;){switch(s=t,s.tag){case 0:case 11:case 15:os(8,s,s.return),ya(s);break;case 22:r=s.stateNode,r._visibility&2&&(r._visibility&=-3,ya(s));break;default:ya(s)}t=t.sibling}}function I_(t,s){for(;ut!==null;){var r=ut;switch(r.tag){case 0:case 11:case 15:os(8,r,s);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var a=r.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Dn(r.memoizedState.cache)}if(a=r.child,a!==null)a.return=r,ut=a;else e:for(r=t;ut!==null;){a=ut;var h=a.sibling,u=a.return;if(j_(a),a===r){ut=null;break e}if(h!==null){h.return=u,ut=h;break e}ut=u}}}var f0={getCacheForType:function(t){var s=xt(rt),r=s.data.get(t);return r===void 0&&(r=t(),s.data.set(t,r)),r}},d0=typeof WeakMap=="function"?WeakMap:Map,Me=0,He=null,be=null,Ce=0,Re=0,Xt=null,us=!1,Ur=!1,Ih=!1,Ki=0,Xe=0,fs=0,Gs=0,Zh=0,li=0,Pr=0,Xn=null,Ht=null,Qh=!1,Jh=0,ba=1/0,wa=null,ds=null,St=0,_s=null,qr=null,jr=0,ec=0,tc=null,Z_=null,Gn=0,ic=null;function Gt(){if((Me&2)!==0&&Ce!==0)return Ce&-Ce;if(k.T!==null){var t=Mr;return t!==0?t:hc()}return df()}function Q_(){li===0&&(li=(Ce&536870912)===0||ke?hf():536870912);var t=ni.current;return t!==null&&(t.flags|=32),li}function $t(t,s,r){(t===He&&(Re===2||Re===9)||t.cancelPendingCommit!==null)&&(Wr(t,0),vs(t,Ce,li,!1)),un(t,r),((Me&2)===0||t!==He)&&(t===He&&((Me&2)===0&&(Gs|=r),Xe===4&&vs(t,Ce,li,!1)),wi(t))}function J_(t,s,r){if((Me&6)!==0)throw Error(l(327));var a=!r&&(s&124)===0&&(s&t.expiredLanes)===0||cn(t,s),h=a?g0(t,s):nc(t,s,!0),u=a;do{if(h===0){Ur&&!a&&vs(t,s,0,!1);break}else{if(r=t.current.alternate,u&&!_0(r)){h=nc(t,s,!1),u=!1;continue}if(h===2){if(u=s,t.errorRecoveryDisabledLanes&u)var g=0;else g=t.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){s=g;e:{var p=t;h=Xn;var b=p.current.memoizedState.isDehydrated;if(b&&(Wr(p,g).flags|=256),g=nc(p,g,!1),g!==2){if(Ih&&!b){p.errorRecoveryDisabledLanes|=u,Gs|=u,h=4;break e}u=Ht,Ht=h,u!==null&&(Ht===null?Ht=u:Ht.push.apply(Ht,u))}h=g}if(u=!1,h!==2)continue}}if(h===1){Wr(t,0),vs(t,s,0,!0);break}e:{switch(a=t,u=h,u){case 0:case 1:throw Error(l(345));case 4:if((s&4194048)!==s)break;case 6:vs(a,s,li,!us);break e;case 2:Ht=null;break;case 3:case 5:break;default:throw Error(l(329))}if((s&62914560)===s&&(h=Jh+300-pi(),10<h)){if(vs(a,s,li,!us),Ol(a,0,!0)!==0)break e;a.timeoutHandle=Mv(ev.bind(null,a,r,Ht,wa,Qh,s,li,Gs,Pr,us,u,2,-0,0),h);break e}ev(a,r,Ht,wa,Qh,s,li,Gs,Pr,us,u,0,-0,0)}}break}while(!0);wi(t)}function ev(t,s,r,a,h,u,g,p,b,T,P,K,A,O){if(t.timeoutHandle=-1,K=s.subtreeFlags,(K&8192||(K&16785408)===16785408)&&(el={stylesheets:null,count:0,unsuspend:F0},G_(s),K=Z0(),K!==null)){t.cancelPendingCommit=K(av.bind(null,t,s,u,r,a,h,g,p,b,P,1,A,O)),vs(t,u,g,!T);return}av(t,s,u,r,a,h,g,p,b)}function _0(t){for(var s=t;;){var r=s.tag;if((r===0||r===11||r===15)&&s.flags&16384&&(r=s.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var a=0;a<r.length;a++){var h=r[a],u=h.getSnapshot;h=h.value;try{if(!Wt(u(),h))return!1}catch{return!1}}if(r=s.child,s.subtreeFlags&16384&&r!==null)r.return=s,s=r;else{if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function vs(t,s,r,a){s&=~Zh,s&=~Gs,t.suspendedLanes|=s,t.pingedLanes&=~s,a&&(t.warmLanes|=s),a=t.expirationTimes;for(var h=s;0<h;){var u=31-jt(h),g=1<<u;a[u]=-1,h&=~g}r!==0&&uf(t,r,s)}function Ca(){return(Me&6)===0?($n(0),!1):!0}function sc(){if(be!==null){if(Re===0)var t=be.return;else t=be,Ni=js=null,yh(t),zr=null,Un=0,t=be;for(;t!==null;)O_(t.alternate,t),t=t.return;be=null}}function Wr(t,s){var r=t.timeoutHandle;r!==-1&&(t.timeoutHandle=-1,B0(r)),r=t.cancelPendingCommit,r!==null&&(t.cancelPendingCommit=null,r()),sc(),He=t,be=r=Oi(t.current,null),Ce=s,Re=0,Xt=null,us=!1,Ur=cn(t,s),Ih=!1,Pr=li=Zh=Gs=fs=Xe=0,Ht=Xn=null,Qh=!1,(s&8)!==0&&(s|=s&32);var a=t.entangledLanes;if(a!==0)for(t=t.entanglements,a&=s;0<a;){var h=31-jt(a),u=1<<h;s|=t[h],a&=~u}return Ki=s,Vl(),r}function tv(t,s){pe=null,k.H=ca,s===Rn||s===ea?(s=md(),Re=3):s===vd?(s=md(),Re=4):Re=s===S_?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Xt=s,be===null&&(Xe=1,va(t,ti(s,t.current)))}function iv(){var t=k.H;return k.H=ca,t===null?ca:t}function sv(){var t=k.A;return k.A=f0,t}function rc(){Xe=4,us||(Ce&4194048)!==Ce&&ni.current!==null||(Ur=!0),(fs&134217727)===0&&(Gs&134217727)===0||He===null||vs(He,Ce,li,!1)}function nc(t,s,r){var a=Me;Me|=2;var h=iv(),u=sv();(He!==t||Ce!==s)&&(wa=null,Wr(t,s)),s=!1;var g=Xe;e:do try{if(Re!==0&&be!==null){var p=be,b=Xt;switch(Re){case 8:sc(),g=6;break e;case 3:case 2:case 9:case 6:ni.current===null&&(s=!0);var T=Re;if(Re=0,Xt=null,Yr(t,p,b,T),r&&Ur){g=0;break e}break;default:T=Re,Re=0,Xt=null,Yr(t,p,b,T)}}v0(),g=Xe;break}catch(P){tv(t,P)}while(!0);return s&&t.shellSuspendCounter++,Ni=js=null,Me=a,k.H=h,k.A=u,be===null&&(He=null,Ce=0,Vl()),g}function v0(){for(;be!==null;)rv(be)}function g0(t,s){var r=Me;Me|=2;var a=iv(),h=sv();He!==t||Ce!==s?(wa=null,ba=pi()+500,Wr(t,s)):Ur=cn(t,s);e:do try{if(Re!==0&&be!==null){s=be;var u=Xt;t:switch(Re){case 1:Re=0,Xt=null,Yr(t,s,u,1);break;case 2:case 9:if(gd(u)){Re=0,Xt=null,nv(s);break}s=function(){Re!==2&&Re!==9||He!==t||(Re=7),wi(t)},u.then(s,s);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:gd(u)?(Re=0,Xt=null,nv(s)):(Re=0,Xt=null,Yr(t,s,u,7));break;case 5:var g=null;switch(be.tag){case 26:g=be.memoizedState;case 5:case 27:var p=be;if(!g||qv(g)){Re=0,Xt=null;var b=p.sibling;if(b!==null)be=b;else{var T=p.return;T!==null?(be=T,xa(T)):be=null}break t}}Re=0,Xt=null,Yr(t,s,u,5);break;case 6:Re=0,Xt=null,Yr(t,s,u,6);break;case 8:sc(),Xe=6;break e;default:throw Error(l(462))}}p0();break}catch(P){tv(t,P)}while(!0);return Ni=js=null,k.H=a,k.A=h,Me=r,be!==null?0:(He=null,Ce=0,Vl(),Xe)}function p0(){for(;be!==null&&!Pm();)rv(be)}function rv(t){var s=A_(t.alternate,t,Ki);t.memoizedProps=t.pendingProps,s===null?xa(t):be=s}function nv(t){var s=t,r=s.alternate;switch(s.tag){case 15:case 0:s=E_(r,s,s.pendingProps,s.type,void 0,Ce);break;case 11:s=E_(r,s,s.pendingProps,s.type.render,s.ref,Ce);break;case 5:yh(s);default:O_(r,s),s=be=ld(s,Ki),s=A_(r,s,Ki)}t.memoizedProps=t.pendingProps,s===null?xa(t):be=s}function Yr(t,s,r,a){Ni=js=null,yh(s),zr=null,Un=0;var h=s.return;try{if(l0(t,h,s,r,Ce)){Xe=1,va(t,ti(r,t.current)),be=null;return}}catch(u){if(h!==null)throw be=h,u;Xe=1,va(t,ti(r,t.current)),be=null;return}s.flags&32768?(ke||a===1?t=!0:Ur||(Ce&536870912)!==0?t=!1:(us=t=!0,(a===2||a===9||a===3||a===6)&&(a=ni.current,a!==null&&a.tag===13&&(a.flags|=16384))),lv(s,t)):xa(s)}function xa(t){var s=t;do{if((s.flags&32768)!==0){lv(s,us);return}t=s.return;var r=o0(s.alternate,s,Ki);if(r!==null){be=r;return}if(s=s.sibling,s!==null){be=s;return}be=s=t}while(s!==null);Xe===0&&(Xe=5)}function lv(t,s){do{var r=h0(t.alternate,t);if(r!==null){r.flags&=32767,be=r;return}if(r=t.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!s&&(t=t.sibling,t!==null)){be=t;return}be=t=r}while(t!==null);Xe=6,be=null}function av(t,s,r,a,h,u,g,p,b){t.cancelPendingCommit=null;do Ea();while(St!==0);if((Me&6)!==0)throw Error(l(327));if(s!==null){if(s===t.current)throw Error(l(177));if(u=s.lanes|s.childLanes,u|=Fo,Fm(t,r,u,g,p,b),t===He&&(be=He=null,Ce=0),qr=s,_s=t,jr=r,ec=u,tc=h,Z_=a,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,b0(Tl,function(){return fv(),null})):(t.callbackNode=null,t.callbackPriority=0),a=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||a){a=k.T,k.T=null,h=U.p,U.p=2,g=Me,Me|=4;try{c0(t,s,r)}finally{Me=g,U.p=h,k.T=a}}St=1,ov(),hv(),cv()}}function ov(){if(St===1){St=0;var t=_s,s=qr,r=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||r){r=k.T,k.T=null;var a=U.p;U.p=2;var h=Me;Me|=4;try{K_(s,t);var u=pc,g=If(t.containerInfo),p=u.focusedElem,b=u.selectionRange;if(g!==p&&p&&p.ownerDocument&&Ff(p.ownerDocument.documentElement,p)){if(b!==null&&Ko(p)){var T=b.start,P=b.end;if(P===void 0&&(P=T),"selectionStart"in p)p.selectionStart=T,p.selectionEnd=Math.min(P,p.value.length);else{var K=p.ownerDocument||document,A=K&&K.defaultView||window;if(A.getSelection){var O=A.getSelection(),ue=p.textContent.length,he=Math.min(b.start,ue),Oe=b.end===void 0?he:Math.min(b.end,ue);!O.extend&&he>Oe&&(g=Oe,Oe=he,he=g);var M=$f(p,he),x=$f(p,Oe);if(M&&x&&(O.rangeCount!==1||O.anchorNode!==M.node||O.anchorOffset!==M.offset||O.focusNode!==x.node||O.focusOffset!==x.offset)){var R=K.createRange();R.setStart(M.node,M.offset),O.removeAllRanges(),he>Oe?(O.addRange(R),O.extend(x.node,x.offset)):(R.setEnd(x.node,x.offset),O.addRange(R))}}}}for(K=[],O=p;O=O.parentNode;)O.nodeType===1&&K.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<K.length;p++){var W=K[p];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}Ha=!!gc,pc=gc=null}finally{Me=h,U.p=a,k.T=r}}t.current=s,St=2}}function hv(){if(St===2){St=0;var t=_s,s=qr,r=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||r){r=k.T,k.T=null;var a=U.p;U.p=2;var h=Me;Me|=4;try{q_(t,s.alternate,s)}finally{Me=h,U.p=a,k.T=r}}St=3}}function cv(){if(St===4||St===3){St=0,qm();var t=_s,s=qr,r=jr,a=Z_;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?St=5:(St=0,qr=_s=null,uv(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(ds=null),Co(r),s=s.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(hn,s,void 0,(s.current.flags&128)===128)}catch{}if(a!==null){s=k.T,h=U.p,U.p=2,k.T=null;try{for(var u=t.onRecoverableError,g=0;g<a.length;g++){var p=a[g];u(p.value,{componentStack:p.stack})}}finally{k.T=s,U.p=h}}(jr&3)!==0&&Ea(),wi(t),h=t.pendingLanes,(r&4194090)!==0&&(h&42)!==0?t===ic?Gn++:(Gn=0,ic=t):Gn=0,$n(0)}}function uv(t,s){(t.pooledCacheLanes&=s)===0&&(s=t.pooledCache,s!=null&&(t.pooledCache=null,Dn(s)))}function Ea(t){return ov(),hv(),cv(),fv()}function fv(){if(St!==5)return!1;var t=_s,s=ec;ec=0;var r=Co(jr),a=k.T,h=U.p;try{U.p=32>r?32:r,k.T=null,r=tc,tc=null;var u=_s,g=jr;if(St=0,qr=_s=null,jr=0,(Me&6)!==0)throw Error(l(331));var p=Me;if(Me|=4,F_(u.current),X_(u,u.current,g,r),Me=p,$n(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(hn,u)}catch{}return!0}finally{U.p=h,k.T=a,uv(t,s)}}function dv(t,s,r){s=ti(r,s),s=zh(t.stateNode,s,2),t=rs(t,s,2),t!==null&&(un(t,2),wi(t))}function Ne(t,s,r){if(t.tag===3)dv(t,t,r);else for(;s!==null;){if(s.tag===3){dv(s,t,r);break}else if(s.tag===1){var a=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(ds===null||!ds.has(a))){t=ti(r,t),r=p_(2),a=rs(s,r,2),a!==null&&(m_(r,a,s,t),un(a,2),wi(a));break}}s=s.return}}function lc(t,s,r){var a=t.pingCache;if(a===null){a=t.pingCache=new d0;var h=new Set;a.set(s,h)}else h=a.get(s),h===void 0&&(h=new Set,a.set(s,h));h.has(r)||(Ih=!0,h.add(r),t=m0.bind(null,t,s,r),s.then(t,t))}function m0(t,s,r){var a=t.pingCache;a!==null&&a.delete(s),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,He===t&&(Ce&r)===r&&(Xe===4||Xe===3&&(Ce&62914560)===Ce&&300>pi()-Jh?(Me&2)===0&&Wr(t,0):Zh|=r,Pr===Ce&&(Pr=0)),wi(t)}function _v(t,s){s===0&&(s=cf()),t=xr(t,s),t!==null&&(un(t,s),wi(t))}function S0(t){var s=t.memoizedState,r=0;s!==null&&(r=s.retryLane),_v(t,r)}function y0(t,s){var r=0;switch(t.tag){case 13:var a=t.stateNode,h=t.memoizedState;h!==null&&(r=h.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(l(314))}a!==null&&a.delete(s),_v(t,r)}function b0(t,s){return xe(t,s)}var ka=null,Kr=null,ac=!1,Da=!1,oc=!1,$s=0;function wi(t){t!==Kr&&t.next===null&&(Kr===null?ka=Kr=t:Kr=Kr.next=t),Da=!0,ac||(ac=!0,C0())}function $n(t,s){if(!oc&&Da){oc=!0;do for(var r=!1,a=ka;a!==null;){if(t!==0){var h=a.pendingLanes;if(h===0)var u=0;else{var g=a.suspendedLanes,p=a.pingedLanes;u=(1<<31-jt(42|t)+1)-1,u&=h&~(g&~p),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(r=!0,mv(a,u))}else u=Ce,u=Ol(a,a===He?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||cn(a,u)||(r=!0,mv(a,u));a=a.next}while(r);oc=!1}}function w0(){vv()}function vv(){Da=ac=!1;var t=0;$s!==0&&(A0()&&(t=$s),$s=0);for(var s=pi(),r=null,a=ka;a!==null;){var h=a.next,u=gv(a,s);u===0?(a.next=null,r===null?ka=h:r.next=h,h===null&&(Kr=r)):(r=a,(t!==0||(u&3)!==0)&&(Da=!0)),a=h}$n(t)}function gv(t,s){for(var r=t.suspendedLanes,a=t.pingedLanes,h=t.expirationTimes,u=t.pendingLanes&-62914561;0<u;){var g=31-jt(u),p=1<<g,b=h[g];b===-1?((p&r)===0||(p&a)!==0)&&(h[g]=$m(p,s)):b<=s&&(t.expiredLanes|=p),u&=~p}if(s=He,r=Ce,r=Ol(t,t===s?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a=t.callbackNode,r===0||t===s&&(Re===2||Re===9)||t.cancelPendingCommit!==null)return a!==null&&a!==null&&Ts(a),t.callbackNode=null,t.callbackPriority=0;if((r&3)===0||cn(t,r)){if(s=r&-r,s===t.callbackPriority)return s;switch(a!==null&&Ts(a),Co(r)){case 2:case 8:r=af;break;case 32:r=Tl;break;case 268435456:r=of;break;default:r=Tl}return a=pv.bind(null,t),r=xe(r,a),t.callbackPriority=s,t.callbackNode=r,s}return a!==null&&a!==null&&Ts(a),t.callbackPriority=2,t.callbackNode=null,2}function pv(t,s){if(St!==0&&St!==5)return t.callbackNode=null,t.callbackPriority=0,null;var r=t.callbackNode;if(Ea()&&t.callbackNode!==r)return null;var a=Ce;return a=Ol(t,t===He?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a===0?null:(J_(t,a,s),gv(t,pi()),t.callbackNode!=null&&t.callbackNode===r?pv.bind(null,t):null)}function mv(t,s){if(Ea())return null;J_(t,s,!0)}function C0(){O0(function(){(Me&6)!==0?xe(lf,w0):vv()})}function hc(){return $s===0&&($s=hf()),$s}function Sv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ul(""+t)}function yv(t,s){var r=s.ownerDocument.createElement("input");return r.name=s.name,r.value=s.value,t.id&&r.setAttribute("form",t.id),s.parentNode.insertBefore(r,s),t=new FormData(t),r.parentNode.removeChild(r),t}function x0(t,s,r,a,h){if(s==="submit"&&r&&r.stateNode===h){var u=Sv((h[Ot]||null).action),g=a.submitter;g&&(s=(s=g[Ot]||null)?Sv(s.formAction):g.getAttribute("formAction"),s!==null&&(u=s,g=null));var p=new Wl("action","action",null,a,h);t.push({event:p,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if($s!==0){var b=g?yv(h,g):new FormData(h);Rh(r,{pending:!0,data:b,method:h.method,action:u},null,b)}}else typeof u=="function"&&(p.preventDefault(),b=g?yv(h,g):new FormData(h),Rh(r,{pending:!0,data:b,method:h.method,action:u},u,b))},currentTarget:h}]})}}for(var cc=0;cc<$o.length;cc++){var uc=$o[cc],E0=uc.toLowerCase(),k0=uc[0].toUpperCase()+uc.slice(1);fi(E0,"on"+k0)}fi(Jf,"onAnimationEnd"),fi(ed,"onAnimationIteration"),fi(td,"onAnimationStart"),fi("dblclick","onDoubleClick"),fi("focusin","onFocus"),fi("focusout","onBlur"),fi(YS,"onTransitionRun"),fi(KS,"onTransitionStart"),fi(VS,"onTransitionCancel"),fi(id,"onTransitionEnd"),_r("onMouseEnter",["mouseout","mouseover"]),_r("onMouseLeave",["mouseout","mouseover"]),_r("onPointerEnter",["pointerout","pointerover"]),_r("onPointerLeave",["pointerout","pointerover"]),Bs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),D0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fn));function bv(t,s){s=(s&4)!==0;for(var r=0;r<t.length;r++){var a=t[r],h=a.event;a=a.listeners;e:{var u=void 0;if(s)for(var g=a.length-1;0<=g;g--){var p=a[g],b=p.instance,T=p.currentTarget;if(p=p.listener,b!==u&&h.isPropagationStopped())break e;u=p,h.currentTarget=T;try{u(h)}catch(P){_a(P)}h.currentTarget=null,u=b}else for(g=0;g<a.length;g++){if(p=a[g],b=p.instance,T=p.currentTarget,p=p.listener,b!==u&&h.isPropagationStopped())break e;u=p,h.currentTarget=T;try{u(h)}catch(P){_a(P)}h.currentTarget=null,u=b}}}}function we(t,s){var r=s[xo];r===void 0&&(r=s[xo]=new Set);var a=t+"__bubble";r.has(a)||(wv(s,t,2,!1),r.add(a))}function fc(t,s,r){var a=0;s&&(a|=4),wv(r,t,a,s)}var Ma="_reactListening"+Math.random().toString(36).slice(2);function dc(t){if(!t[Ma]){t[Ma]=!0,vf.forEach(function(r){r!=="selectionchange"&&(D0.has(r)||fc(r,!1,t),fc(r,!0,t))});var s=t.nodeType===9?t:t.ownerDocument;s===null||s[Ma]||(s[Ma]=!0,fc("selectionchange",!1,s))}}function wv(t,s,r,a){switch(Xv(s)){case 2:var h=ey;break;case 8:h=ty;break;default:h=Dc}r=h.bind(null,s,r,t),h=void 0,!Lo||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(h=!0),a?h!==void 0?t.addEventListener(s,r,{capture:!0,passive:h}):t.addEventListener(s,r,!0):h!==void 0?t.addEventListener(s,r,{passive:h}):t.addEventListener(s,r,!1)}function _c(t,s,r,a,h){var u=a;if((s&1)===0&&(s&2)===0&&a!==null)e:for(;;){if(a===null)return;var g=a.tag;if(g===3||g===4){var p=a.stateNode.containerInfo;if(p===h)break;if(g===4)for(g=a.return;g!==null;){var b=g.tag;if((b===3||b===4)&&g.stateNode.containerInfo===h)return;g=g.return}for(;p!==null;){if(g=ur(p),g===null)return;if(b=g.tag,b===5||b===6||b===26||b===27){a=u=g;continue e}p=p.parentNode}}a=a.return}Rf(function(){var T=u,P=Oo(r),K=[];e:{var A=sd.get(t);if(A!==void 0){var O=Wl,ue=t;switch(t){case"keypress":if(ql(r)===0)break e;case"keydown":case"keyup":O=bS;break;case"focusin":ue="focus",O=Po;break;case"focusout":ue="blur",O=Po;break;case"beforeblur":case"afterblur":O=Po;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=Bf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=hS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=xS;break;case Jf:case ed:case td:O=fS;break;case id:O=kS;break;case"scroll":case"scrollend":O=aS;break;case"wheel":O=MS;break;case"copy":case"cut":case"paste":O=_S;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=zf;break;case"toggle":case"beforetoggle":O=TS}var he=(s&4)!==0,Oe=!he&&(t==="scroll"||t==="scrollend"),M=he?A!==null?A+"Capture":null:A;he=[];for(var x=T,R;x!==null;){var W=x;if(R=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||R===null||M===null||(W=_n(x,M),W!=null&&he.push(In(x,W,R))),Oe)break;x=x.return}0<he.length&&(A=new O(A,ue,null,r,P),K.push({event:A,listeners:he}))}}if((s&7)===0){e:{if(A=t==="mouseover"||t==="pointerover",O=t==="mouseout"||t==="pointerout",A&&r!==Bo&&(ue=r.relatedTarget||r.fromElement)&&(ur(ue)||ue[cr]))break e;if((O||A)&&(A=P.window===P?P:(A=P.ownerDocument)?A.defaultView||A.parentWindow:window,O?(ue=r.relatedTarget||r.toElement,O=T,ue=ue?ur(ue):null,ue!==null&&(Oe=c(ue),he=ue.tag,ue!==Oe||he!==5&&he!==27&&he!==6)&&(ue=null)):(O=null,ue=T),O!==ue)){if(he=Bf,W="onMouseLeave",M="onMouseEnter",x="mouse",(t==="pointerout"||t==="pointerover")&&(he=zf,W="onPointerLeave",M="onPointerEnter",x="pointer"),Oe=O==null?A:dn(O),R=ue==null?A:dn(ue),A=new he(W,x+"leave",O,r,P),A.target=Oe,A.relatedTarget=R,W=null,ur(P)===T&&(he=new he(M,x+"enter",ue,r,P),he.target=R,he.relatedTarget=Oe,W=he),Oe=W,O&&ue)t:{for(he=O,M=ue,x=0,R=he;R;R=Vr(R))x++;for(R=0,W=M;W;W=Vr(W))R++;for(;0<x-R;)he=Vr(he),x--;for(;0<R-x;)M=Vr(M),R--;for(;x--;){if(he===M||M!==null&&he===M.alternate)break t;he=Vr(he),M=Vr(M)}he=null}else he=null;O!==null&&Cv(K,A,O,he,!1),ue!==null&&Oe!==null&&Cv(K,Oe,ue,he,!0)}}e:{if(A=T?dn(T):window,O=A.nodeName&&A.nodeName.toLowerCase(),O==="select"||O==="input"&&A.type==="file")var ne=Wf;else if(qf(A))if(Yf)ne=qS;else{ne=US;var ye=HS}else O=A.nodeName,!O||O.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?T&&Ao(T.elementType)&&(ne=Wf):ne=PS;if(ne&&(ne=ne(t,T))){jf(K,ne,r,P);break e}ye&&ye(t,A,T),t==="focusout"&&T&&A.type==="number"&&T.memoizedProps.value!=null&&To(A,"number",A.value)}switch(ye=T?dn(T):window,t){case"focusin":(qf(ye)||ye.contentEditable==="true")&&(br=ye,Vo=T,wn=null);break;case"focusout":wn=Vo=br=null;break;case"mousedown":Xo=!0;break;case"contextmenu":case"mouseup":case"dragend":Xo=!1,Zf(K,r,P);break;case"selectionchange":if(WS)break;case"keydown":case"keyup":Zf(K,r,P)}var ae;if(jo)e:{switch(t){case"compositionstart":var ce="onCompositionStart";break e;case"compositionend":ce="onCompositionEnd";break e;case"compositionupdate":ce="onCompositionUpdate";break e}ce=void 0}else yr?Uf(t,r)&&(ce="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(ce="onCompositionStart");ce&&(Lf&&r.locale!=="ko"&&(yr||ce!=="onCompositionStart"?ce==="onCompositionEnd"&&yr&&(ae=Tf()):(es=P,No="value"in es?es.value:es.textContent,yr=!0)),ye=Ra(T,ce),0<ye.length&&(ce=new Of(ce,t,null,r,P),K.push({event:ce,listeners:ye}),ae?ce.data=ae:(ae=Pf(r),ae!==null&&(ce.data=ae)))),(ae=BS?OS(t,r):zS(t,r))&&(ce=Ra(T,"onBeforeInput"),0<ce.length&&(ye=new Of("onBeforeInput","beforeinput",null,r,P),K.push({event:ye,listeners:ce}),ye.data=ae)),x0(K,t,T,r,P)}bv(K,s)})}function In(t,s,r){return{instance:t,listener:s,currentTarget:r}}function Ra(t,s){for(var r=s+"Capture",a=[];t!==null;){var h=t,u=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||u===null||(h=_n(t,r),h!=null&&a.unshift(In(t,h,u)),h=_n(t,s),h!=null&&a.push(In(t,h,u))),t.tag===3)return a;t=t.return}return[]}function Vr(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Cv(t,s,r,a,h){for(var u=s._reactName,g=[];r!==null&&r!==a;){var p=r,b=p.alternate,T=p.stateNode;if(p=p.tag,b!==null&&b===a)break;p!==5&&p!==26&&p!==27||T===null||(b=T,h?(T=_n(r,u),T!=null&&g.unshift(In(r,T,b))):h||(T=_n(r,u),T!=null&&g.push(In(r,T,b)))),r=r.return}g.length!==0&&t.push({event:s,listeners:g})}var M0=/\r\n?/g,R0=/\u0000|\uFFFD/g;function xv(t){return(typeof t=="string"?t:""+t).replace(M0,`
|
|
49
|
+
`).replace(R0,"")}function Ev(t,s){return s=xv(s),xv(t)===s}function Ta(){}function Be(t,s,r,a,h,u){switch(r){case"children":typeof a=="string"?s==="body"||s==="textarea"&&a===""||pr(t,a):(typeof a=="number"||typeof a=="bigint")&&s!=="body"&&pr(t,""+a);break;case"className":Ll(t,"class",a);break;case"tabIndex":Ll(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Ll(t,r,a);break;case"style":Df(t,a,u);break;case"data":if(s!=="object"){Ll(t,"data",a);break}case"src":case"href":if(a===""&&(s!=="a"||r!=="href")){t.removeAttribute(r);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(r);break}a=Ul(""+a),t.setAttribute(r,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(r,"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 u=="function"&&(r==="formAction"?(s!=="input"&&Be(t,s,"name",h.name,h,null),Be(t,s,"formEncType",h.formEncType,h,null),Be(t,s,"formMethod",h.formMethod,h,null),Be(t,s,"formTarget",h.formTarget,h,null)):(Be(t,s,"encType",h.encType,h,null),Be(t,s,"method",h.method,h,null),Be(t,s,"target",h.target,h,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(r);break}a=Ul(""+a),t.setAttribute(r,a);break;case"onClick":a!=null&&(t.onclick=Ta);break;case"onScroll":a!=null&&we("scroll",t);break;case"onScrollEnd":a!=null&&we("scrollend",t);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(r=a.__html,r!=null){if(h.children!=null)throw Error(l(60));t.innerHTML=r}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}r=Ul(""+a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(r,""+a):t.removeAttribute(r);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":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(r,""):t.removeAttribute(r);break;case"capture":case"download":a===!0?t.setAttribute(r,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(r,a):t.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(r,a):t.removeAttribute(r);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(r):t.setAttribute(r,a);break;case"popover":we("beforetoggle",t),we("toggle",t),zl(t,"popover",a);break;case"xlinkActuate":Ai(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ai(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ai(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ai(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ai(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ai(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ai(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ai(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ai(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":zl(t,"is",a);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=nS.get(r)||r,zl(t,r,a))}}function vc(t,s,r,a,h,u){switch(r){case"style":Df(t,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(r=a.__html,r!=null){if(h.children!=null)throw Error(l(60));t.innerHTML=r}}break;case"children":typeof a=="string"?pr(t,a):(typeof a=="number"||typeof a=="bigint")&&pr(t,""+a);break;case"onScroll":a!=null&&we("scroll",t);break;case"onScrollEnd":a!=null&&we("scrollend",t);break;case"onClick":a!=null&&(t.onclick=Ta);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gf.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(h=r.endsWith("Capture"),s=r.slice(2,h?r.length-7:void 0),u=t[Ot]||null,u=u!=null?u[r]:null,typeof u=="function"&&t.removeEventListener(s,u,h),typeof a=="function")){typeof u!="function"&&u!==null&&(r in t?t[r]=null:t.hasAttribute(r)&&t.removeAttribute(r)),t.addEventListener(s,a,h);break e}r in t?t[r]=a:a===!0?t.setAttribute(r,""):zl(t,r,a)}}}function yt(t,s,r){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":we("error",t),we("load",t);var a=!1,h=!1,u;for(u in r)if(r.hasOwnProperty(u)){var g=r[u];if(g!=null)switch(u){case"src":a=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,s));default:Be(t,s,u,g,r,null)}}h&&Be(t,s,"srcSet",r.srcSet,r,null),a&&Be(t,s,"src",r.src,r,null);return;case"input":we("invalid",t);var p=u=g=h=null,b=null,T=null;for(a in r)if(r.hasOwnProperty(a)){var P=r[a];if(P!=null)switch(a){case"name":h=P;break;case"type":g=P;break;case"checked":b=P;break;case"defaultChecked":T=P;break;case"value":u=P;break;case"defaultValue":p=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(l(137,s));break;default:Be(t,s,a,P,r,null)}}Cf(t,u,p,b,T,g,h,!1),Nl(t);return;case"select":we("invalid",t),a=g=u=null;for(h in r)if(r.hasOwnProperty(h)&&(p=r[h],p!=null))switch(h){case"value":u=p;break;case"defaultValue":g=p;break;case"multiple":a=p;default:Be(t,s,h,p,r,null)}s=u,r=g,t.multiple=!!a,s!=null?gr(t,!!a,s,!1):r!=null&&gr(t,!!a,r,!0);return;case"textarea":we("invalid",t),u=h=a=null;for(g in r)if(r.hasOwnProperty(g)&&(p=r[g],p!=null))switch(g){case"value":a=p;break;case"defaultValue":h=p;break;case"children":u=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(l(91));break;default:Be(t,s,g,p,r,null)}Ef(t,a,h,u),Nl(t);return;case"option":for(b in r)if(r.hasOwnProperty(b)&&(a=r[b],a!=null))switch(b){case"selected":t.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Be(t,s,b,a,r,null)}return;case"dialog":we("beforetoggle",t),we("toggle",t),we("cancel",t),we("close",t);break;case"iframe":case"object":we("load",t);break;case"video":case"audio":for(a=0;a<Fn.length;a++)we(Fn[a],t);break;case"image":we("error",t),we("load",t);break;case"details":we("toggle",t);break;case"embed":case"source":case"link":we("error",t),we("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(T in r)if(r.hasOwnProperty(T)&&(a=r[T],a!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,s));default:Be(t,s,T,a,r,null)}return;default:if(Ao(s)){for(P in r)r.hasOwnProperty(P)&&(a=r[P],a!==void 0&&vc(t,s,P,a,r,void 0));return}}for(p in r)r.hasOwnProperty(p)&&(a=r[p],a!=null&&Be(t,s,p,a,r,null))}function T0(t,s,r,a){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,u=null,g=null,p=null,b=null,T=null,P=null;for(O in r){var K=r[O];if(r.hasOwnProperty(O)&&K!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":b=K;default:a.hasOwnProperty(O)||Be(t,s,O,null,a,K)}}for(var A in a){var O=a[A];if(K=r[A],a.hasOwnProperty(A)&&(O!=null||K!=null))switch(A){case"type":u=O;break;case"name":h=O;break;case"checked":T=O;break;case"defaultChecked":P=O;break;case"value":g=O;break;case"defaultValue":p=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(l(137,s));break;default:O!==K&&Be(t,s,A,O,a,K)}}Ro(t,g,p,b,T,P,u,h);return;case"select":O=g=p=A=null;for(u in r)if(b=r[u],r.hasOwnProperty(u)&&b!=null)switch(u){case"value":break;case"multiple":O=b;default:a.hasOwnProperty(u)||Be(t,s,u,null,a,b)}for(h in a)if(u=a[h],b=r[h],a.hasOwnProperty(h)&&(u!=null||b!=null))switch(h){case"value":A=u;break;case"defaultValue":p=u;break;case"multiple":g=u;default:u!==b&&Be(t,s,h,u,a,b)}s=p,r=g,a=O,A!=null?gr(t,!!r,A,!1):!!a!=!!r&&(s!=null?gr(t,!!r,s,!0):gr(t,!!r,r?[]:"",!1));return;case"textarea":O=A=null;for(p in r)if(h=r[p],r.hasOwnProperty(p)&&h!=null&&!a.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:Be(t,s,p,null,a,h)}for(g in a)if(h=a[g],u=r[g],a.hasOwnProperty(g)&&(h!=null||u!=null))switch(g){case"value":A=h;break;case"defaultValue":O=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(l(91));break;default:h!==u&&Be(t,s,g,h,a,u)}xf(t,A,O);return;case"option":for(var ue in r)if(A=r[ue],r.hasOwnProperty(ue)&&A!=null&&!a.hasOwnProperty(ue))switch(ue){case"selected":t.selected=!1;break;default:Be(t,s,ue,null,a,A)}for(b in a)if(A=a[b],O=r[b],a.hasOwnProperty(b)&&A!==O&&(A!=null||O!=null))switch(b){case"selected":t.selected=A&&typeof A!="function"&&typeof A!="symbol";break;default:Be(t,s,b,A,a,O)}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 he in r)A=r[he],r.hasOwnProperty(he)&&A!=null&&!a.hasOwnProperty(he)&&Be(t,s,he,null,a,A);for(T in a)if(A=a[T],O=r[T],a.hasOwnProperty(T)&&A!==O&&(A!=null||O!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(l(137,s));break;default:Be(t,s,T,A,a,O)}return;default:if(Ao(s)){for(var Oe in r)A=r[Oe],r.hasOwnProperty(Oe)&&A!==void 0&&!a.hasOwnProperty(Oe)&&vc(t,s,Oe,void 0,a,A);for(P in a)A=a[P],O=r[P],!a.hasOwnProperty(P)||A===O||A===void 0&&O===void 0||vc(t,s,P,A,a,O);return}}for(var M in r)A=r[M],r.hasOwnProperty(M)&&A!=null&&!a.hasOwnProperty(M)&&Be(t,s,M,null,a,A);for(K in a)A=a[K],O=r[K],!a.hasOwnProperty(K)||A===O||A==null&&O==null||Be(t,s,K,A,a,O)}var gc=null,pc=null;function Aa(t){return t.nodeType===9?t:t.ownerDocument}function kv(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Dv(t,s){if(t===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&s==="foreignObject"?0:t}function mc(t,s){return t==="textarea"||t==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Sc=null;function A0(){var t=window.event;return t&&t.type==="popstate"?t===Sc?!1:(Sc=t,!0):(Sc=null,!1)}var Mv=typeof setTimeout=="function"?setTimeout:void 0,B0=typeof clearTimeout=="function"?clearTimeout:void 0,Rv=typeof Promise=="function"?Promise:void 0,O0=typeof queueMicrotask=="function"?queueMicrotask:typeof Rv<"u"?function(t){return Rv.resolve(null).then(t).catch(z0)}:Mv;function z0(t){setTimeout(function(){throw t})}function gs(t){return t==="head"}function Tv(t,s){var r=s,a=0,h=0;do{var u=r.nextSibling;if(t.removeChild(r),u&&u.nodeType===8)if(r=u.data,r==="/$"){if(0<a&&8>a){r=a;var g=t.ownerDocument;if(r&1&&Zn(g.documentElement),r&2&&Zn(g.body),r&4)for(r=g.head,Zn(r),g=r.firstChild;g;){var p=g.nextSibling,b=g.nodeName;g[fn]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&g.rel.toLowerCase()==="stylesheet"||r.removeChild(g),g=p}}if(h===0){t.removeChild(u),nl(s);return}h--}else r==="$"||r==="$?"||r==="$!"?h++:a=r.charCodeAt(0)-48;else a=0;r=u}while(r);nl(s)}function yc(t){var s=t.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var r=s;switch(s=s.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":yc(r),Eo(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}t.removeChild(r)}}function L0(t,s,r,a){for(;t.nodeType===1;){var h=r;if(t.nodeName.toLowerCase()!==s.toLowerCase()){if(!a&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(a){if(!t[fn])switch(s){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(u=t.getAttribute("rel"),u==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(u!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(u=t.getAttribute("src"),(u!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&u&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(s==="input"&&t.type==="hidden"){var u=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===u)return t}else return t;if(t=_i(t.nextSibling),t===null)break}return null}function N0(t,s,r){if(s==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=_i(t.nextSibling),t===null))return null;return t}function bc(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function H0(t,s){var r=t.ownerDocument;if(t.data!=="$?"||r.readyState==="complete")s();else{var a=function(){s(),r.removeEventListener("DOMContentLoaded",a)};r.addEventListener("DOMContentLoaded",a),t._reactRetry=a}}function _i(t){for(;t!=null;t=t.nextSibling){var s=t.nodeType;if(s===1||s===3)break;if(s===8){if(s=t.data,s==="$"||s==="$!"||s==="$?"||s==="F!"||s==="F")break;if(s==="/$")return null}}return t}var wc=null;function Av(t){t=t.previousSibling;for(var s=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(s===0)return t;s--}else r==="/$"&&s++}t=t.previousSibling}return null}function Bv(t,s,r){switch(s=Aa(r),t){case"html":if(t=s.documentElement,!t)throw Error(l(452));return t;case"head":if(t=s.head,!t)throw Error(l(453));return t;case"body":if(t=s.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function Zn(t){for(var s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Eo(t)}var ai=new Map,Ov=new Set;function Ba(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Vi=U.d;U.d={f:U0,r:P0,D:q0,C:j0,L:W0,m:Y0,X:V0,S:K0,M:X0};function U0(){var t=Vi.f(),s=Ca();return t||s}function P0(t){var s=fr(t);s!==null&&s.tag===5&&s.type==="form"?Jd(s):Vi.r(t)}var Xr=typeof document>"u"?null:document;function zv(t,s,r){var a=Xr;if(a&&typeof s=="string"&&s){var h=ei(s);h='link[rel="'+t+'"][href="'+h+'"]',typeof r=="string"&&(h+='[crossorigin="'+r+'"]'),Ov.has(h)||(Ov.add(h),t={rel:t,crossOrigin:r,href:s},a.querySelector(h)===null&&(s=a.createElement("link"),yt(s,"link",t),ht(s),a.head.appendChild(s)))}}function q0(t){Vi.D(t),zv("dns-prefetch",t,null)}function j0(t,s){Vi.C(t,s),zv("preconnect",t,s)}function W0(t,s,r){Vi.L(t,s,r);var a=Xr;if(a&&t&&s){var h='link[rel="preload"][as="'+ei(s)+'"]';s==="image"&&r&&r.imageSrcSet?(h+='[imagesrcset="'+ei(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(h+='[imagesizes="'+ei(r.imageSizes)+'"]')):h+='[href="'+ei(t)+'"]';var u=h;switch(s){case"style":u=Gr(t);break;case"script":u=$r(t)}ai.has(u)||(t=m({rel:"preload",href:s==="image"&&r&&r.imageSrcSet?void 0:t,as:s},r),ai.set(u,t),a.querySelector(h)!==null||s==="style"&&a.querySelector(Qn(u))||s==="script"&&a.querySelector(Jn(u))||(s=a.createElement("link"),yt(s,"link",t),ht(s),a.head.appendChild(s)))}}function Y0(t,s){Vi.m(t,s);var r=Xr;if(r&&t){var a=s&&typeof s.as=="string"?s.as:"script",h='link[rel="modulepreload"][as="'+ei(a)+'"][href="'+ei(t)+'"]',u=h;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=$r(t)}if(!ai.has(u)&&(t=m({rel:"modulepreload",href:t},s),ai.set(u,t),r.querySelector(h)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Jn(u)))return}a=r.createElement("link"),yt(a,"link",t),ht(a),r.head.appendChild(a)}}}function K0(t,s,r){Vi.S(t,s,r);var a=Xr;if(a&&t){var h=dr(a).hoistableStyles,u=Gr(t);s=s||"default";var g=h.get(u);if(!g){var p={loading:0,preload:null};if(g=a.querySelector(Qn(u)))p.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":s},r),(r=ai.get(u))&&Cc(t,r);var b=g=a.createElement("link");ht(b),yt(b,"link",t),b._p=new Promise(function(T,P){b.onload=T,b.onerror=P}),b.addEventListener("load",function(){p.loading|=1}),b.addEventListener("error",function(){p.loading|=2}),p.loading|=4,Oa(g,s,a)}g={type:"stylesheet",instance:g,count:1,state:p},h.set(u,g)}}}function V0(t,s){Vi.X(t,s);var r=Xr;if(r&&t){var a=dr(r).hoistableScripts,h=$r(t),u=a.get(h);u||(u=r.querySelector(Jn(h)),u||(t=m({src:t,async:!0},s),(s=ai.get(h))&&xc(t,s),u=r.createElement("script"),ht(u),yt(u,"link",t),r.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(h,u))}}function X0(t,s){Vi.M(t,s);var r=Xr;if(r&&t){var a=dr(r).hoistableScripts,h=$r(t),u=a.get(h);u||(u=r.querySelector(Jn(h)),u||(t=m({src:t,async:!0,type:"module"},s),(s=ai.get(h))&&xc(t,s),u=r.createElement("script"),ht(u),yt(u,"link",t),r.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(h,u))}}function Lv(t,s,r,a){var h=(h=re.current)?Ba(h):null;if(!h)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(s=Gr(r.href),r=dr(h).hoistableStyles,a=r.get(s),a||(a={type:"style",instance:null,count:0,state:null},r.set(s,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Gr(r.href);var u=dr(h).hoistableStyles,g=u.get(t);if(g||(h=h.ownerDocument||h,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,g),(u=h.querySelector(Qn(t)))&&!u._p&&(g.instance=u,g.state.loading=5),ai.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},ai.set(t,r),u||G0(h,t,r,g.state))),s&&a===null)throw Error(l(528,""));return g}if(s&&a!==null)throw Error(l(529,""));return null;case"script":return s=r.async,r=r.src,typeof r=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=$r(r),r=dr(h).hoistableScripts,a=r.get(s),a||(a={type:"script",instance:null,count:0,state:null},r.set(s,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Gr(t){return'href="'+ei(t)+'"'}function Qn(t){return'link[rel="stylesheet"]['+t+"]"}function Nv(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function G0(t,s,r,a){t.querySelector('link[rel="preload"][as="style"]['+s+"]")?a.loading=1:(s=t.createElement("link"),a.preload=s,s.addEventListener("load",function(){return a.loading|=1}),s.addEventListener("error",function(){return a.loading|=2}),yt(s,"link",r),ht(s),t.head.appendChild(s))}function $r(t){return'[src="'+ei(t)+'"]'}function Jn(t){return"script[async]"+t}function Hv(t,s,r){if(s.count++,s.instance===null)switch(s.type){case"style":var a=t.querySelector('style[data-href~="'+ei(r.href)+'"]');if(a)return s.instance=a,ht(a),a;var h=m({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),ht(a),yt(a,"style",h),Oa(a,r.precedence,t),s.instance=a;case"stylesheet":h=Gr(r.href);var u=t.querySelector(Qn(h));if(u)return s.state.loading|=4,s.instance=u,ht(u),u;a=Nv(r),(h=ai.get(h))&&Cc(a,h),u=(t.ownerDocument||t).createElement("link"),ht(u);var g=u;return g._p=new Promise(function(p,b){g.onload=p,g.onerror=b}),yt(u,"link",a),s.state.loading|=4,Oa(u,r.precedence,t),s.instance=u;case"script":return u=$r(r.src),(h=t.querySelector(Jn(u)))?(s.instance=h,ht(h),h):(a=r,(h=ai.get(u))&&(a=m({},r),xc(a,h)),t=t.ownerDocument||t,h=t.createElement("script"),ht(h),yt(h,"link",a),t.head.appendChild(h),s.instance=h);case"void":return null;default:throw Error(l(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(a=s.instance,s.state.loading|=4,Oa(a,r.precedence,t));return s.instance}function Oa(t,s,r){for(var a=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=a.length?a[a.length-1]:null,u=h,g=0;g<a.length;g++){var p=a[g];if(p.dataset.precedence===s)u=p;else if(u!==h)break}u?u.parentNode.insertBefore(t,u.nextSibling):(s=r.nodeType===9?r.head:r,s.insertBefore(t,s.firstChild))}function Cc(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.title==null&&(t.title=s.title)}function xc(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.integrity==null&&(t.integrity=s.integrity)}var za=null;function Uv(t,s,r){if(za===null){var a=new Map,h=za=new Map;h.set(r,a)}else h=za,a=h.get(r),a||(a=new Map,h.set(r,a));if(a.has(t))return a;for(a.set(t,null),r=r.getElementsByTagName(t),h=0;h<r.length;h++){var u=r[h];if(!(u[fn]||u[Ct]||t==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var g=u.getAttribute(s)||"";g=t+g;var p=a.get(g);p?p.push(u):a.set(g,[u])}}return a}function Pv(t,s,r){t=t.ownerDocument||t,t.head.insertBefore(r,s==="title"?t.querySelector("head > title"):null)}function $0(t,s,r){if(r===1||s.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return t=s.disabled,typeof s.precedence=="string"&&t==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function qv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var el=null;function F0(){}function I0(t,s,r){if(el===null)throw Error(l(475));var a=el;if(s.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=Gr(r.href),u=t.querySelector(Qn(h));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(a.count++,a=La.bind(a),t.then(a,a)),s.state.loading|=4,s.instance=u,ht(u);return}u=t.ownerDocument||t,r=Nv(r),(h=ai.get(h))&&Cc(r,h),u=u.createElement("link"),ht(u);var g=u;g._p=new Promise(function(p,b){g.onload=p,g.onerror=b}),yt(u,"link",r),s.instance=u}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(a.count++,s=La.bind(a),t.addEventListener("load",s),t.addEventListener("error",s))}}function Z0(){if(el===null)throw Error(l(475));var t=el;return t.stylesheets&&t.count===0&&Ec(t,t.stylesheets),0<t.count?function(s){var r=setTimeout(function(){if(t.stylesheets&&Ec(t,t.stylesheets),t.unsuspend){var a=t.unsuspend;t.unsuspend=null,a()}},6e4);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(r)}}:null}function La(){if(this.count--,this.count===0){if(this.stylesheets)Ec(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Na=null;function Ec(t,s){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Na=new Map,s.forEach(Q0,t),Na=null,La.call(t))}function Q0(t,s){if(!(s.state.loading&4)){var r=Na.get(t);if(r)var a=r.get(null);else{r=new Map,Na.set(t,r);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<h.length;u++){var g=h[u];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(r.set(g.dataset.precedence,g),a=g)}a&&r.set(null,a)}h=s.instance,g=h.getAttribute("data-precedence"),u=r.get(g)||a,u===a&&r.set(null,h),r.set(g,h),this.count++,a=La.bind(this),h.addEventListener("load",a),h.addEventListener("error",a),u?u.parentNode.insertBefore(h,u.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),s.state.loading|=4}}var tl={$$typeof:X,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function J0(t,s,r,a,h,u,g,p){this.tag=1,this.containerInfo=t,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=bo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bo(0),this.hiddenUpdates=bo(null),this.identifierPrefix=a,this.onUncaughtError=h,this.onCaughtError=u,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=p,this.incompleteTransitions=new Map}function jv(t,s,r,a,h,u,g,p,b,T,P,K){return t=new J0(t,s,r,g,p,b,T,K),s=1,u===!0&&(s|=24),u=Yt(3,null,null,s),t.current=u,u.stateNode=t,s=lh(),s.refCount++,t.pooledCache=s,s.refCount++,u.memoizedState={element:a,isDehydrated:r,cache:s},ch(u),t}function Wv(t){return t?(t=Er,t):Er}function Yv(t,s,r,a,h,u){h=Wv(h),a.context===null?a.context=h:a.pendingContext=h,a=ss(s),a.payload={element:r},u=u===void 0?null:u,u!==null&&(a.callback=u),r=rs(t,a,s),r!==null&&($t(r,t,s),An(r,t,s))}function Kv(t,s){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<s?r:s}}function kc(t,s){Kv(t,s),(t=t.alternate)&&Kv(t,s)}function Vv(t){if(t.tag===13){var s=xr(t,67108864);s!==null&&$t(s,t,67108864),kc(t,67108864)}}var Ha=!0;function ey(t,s,r,a){var h=k.T;k.T=null;var u=U.p;try{U.p=2,Dc(t,s,r,a)}finally{U.p=u,k.T=h}}function ty(t,s,r,a){var h=k.T;k.T=null;var u=U.p;try{U.p=8,Dc(t,s,r,a)}finally{U.p=u,k.T=h}}function Dc(t,s,r,a){if(Ha){var h=Mc(a);if(h===null)_c(t,s,a,Ua,r),Gv(t,a);else if(sy(h,t,s,r,a))a.stopPropagation();else if(Gv(t,a),s&4&&-1<iy.indexOf(t)){for(;h!==null;){var u=fr(h);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var g=As(u.pendingLanes);if(g!==0){var p=u;for(p.pendingLanes|=2,p.entangledLanes|=2;g;){var b=1<<31-jt(g);p.entanglements[1]|=b,g&=~b}wi(u),(Me&6)===0&&(ba=pi()+500,$n(0))}}break;case 13:p=xr(u,2),p!==null&&$t(p,u,2),Ca(),kc(u,2)}if(u=Mc(a),u===null&&_c(t,s,a,Ua,r),u===h)break;h=u}h!==null&&a.stopPropagation()}else _c(t,s,a,null,r)}}function Mc(t){return t=Oo(t),Rc(t)}var Ua=null;function Rc(t){if(Ua=null,t=ur(t),t!==null){var s=c(t);if(s===null)t=null;else{var r=s.tag;if(r===13){if(t=f(s),t!==null)return t;t=null}else if(r===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;t=null}else s!==t&&(t=null)}}return Ua=t,null}function Xv(t){switch(t){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(jm()){case lf:return 2;case af:return 8;case Tl:case Wm:return 32;case of:return 268435456;default:return 32}default:return 32}}var Tc=!1,ps=null,ms=null,Ss=null,il=new Map,sl=new Map,ys=[],iy="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 Gv(t,s){switch(t){case"focusin":case"focusout":ps=null;break;case"dragenter":case"dragleave":ms=null;break;case"mouseover":case"mouseout":Ss=null;break;case"pointerover":case"pointerout":il.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":sl.delete(s.pointerId)}}function rl(t,s,r,a,h,u){return t===null||t.nativeEvent!==u?(t={blockedOn:s,domEventName:r,eventSystemFlags:a,nativeEvent:u,targetContainers:[h]},s!==null&&(s=fr(s),s!==null&&Vv(s)),t):(t.eventSystemFlags|=a,s=t.targetContainers,h!==null&&s.indexOf(h)===-1&&s.push(h),t)}function sy(t,s,r,a,h){switch(s){case"focusin":return ps=rl(ps,t,s,r,a,h),!0;case"dragenter":return ms=rl(ms,t,s,r,a,h),!0;case"mouseover":return Ss=rl(Ss,t,s,r,a,h),!0;case"pointerover":var u=h.pointerId;return il.set(u,rl(il.get(u)||null,t,s,r,a,h)),!0;case"gotpointercapture":return u=h.pointerId,sl.set(u,rl(sl.get(u)||null,t,s,r,a,h)),!0}return!1}function $v(t){var s=ur(t.target);if(s!==null){var r=c(s);if(r!==null){if(s=r.tag,s===13){if(s=f(r),s!==null){t.blockedOn=s,Im(t.priority,function(){if(r.tag===13){var a=Gt();a=wo(a);var h=xr(r,a);h!==null&&$t(h,r,a),kc(r,a)}});return}}else if(s===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Pa(t){if(t.blockedOn!==null)return!1;for(var s=t.targetContainers;0<s.length;){var r=Mc(t.nativeEvent);if(r===null){r=t.nativeEvent;var a=new r.constructor(r.type,r);Bo=a,r.target.dispatchEvent(a),Bo=null}else return s=fr(r),s!==null&&Vv(s),t.blockedOn=r,!1;s.shift()}return!0}function Fv(t,s,r){Pa(t)&&r.delete(s)}function ry(){Tc=!1,ps!==null&&Pa(ps)&&(ps=null),ms!==null&&Pa(ms)&&(ms=null),Ss!==null&&Pa(Ss)&&(Ss=null),il.forEach(Fv),sl.forEach(Fv)}function qa(t,s){t.blockedOn===s&&(t.blockedOn=null,Tc||(Tc=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ry)))}var ja=null;function Iv(t){ja!==t&&(ja=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ja===t&&(ja=null);for(var s=0;s<t.length;s+=3){var r=t[s],a=t[s+1],h=t[s+2];if(typeof a!="function"){if(Rc(a||r)===null)continue;break}var u=fr(r);u!==null&&(t.splice(s,3),s-=3,Rh(u,{pending:!0,data:h,method:r.method,action:a},a,h))}}))}function nl(t){function s(b){return qa(b,t)}ps!==null&&qa(ps,t),ms!==null&&qa(ms,t),Ss!==null&&qa(Ss,t),il.forEach(s),sl.forEach(s);for(var r=0;r<ys.length;r++){var a=ys[r];a.blockedOn===t&&(a.blockedOn=null)}for(;0<ys.length&&(r=ys[0],r.blockedOn===null);)$v(r),r.blockedOn===null&&ys.shift();if(r=(t.ownerDocument||t).$$reactFormReplay,r!=null)for(a=0;a<r.length;a+=3){var h=r[a],u=r[a+1],g=h[Ot]||null;if(typeof u=="function")g||Iv(r);else if(g){var p=null;if(u&&u.hasAttribute("formAction")){if(h=u,g=u[Ot]||null)p=g.formAction;else if(Rc(h)!==null)continue}else p=g.action;typeof p=="function"?r[a+1]=p:(r.splice(a,3),a-=3),Iv(r)}}}function Ac(t){this._internalRoot=t}Wa.prototype.render=Ac.prototype.render=function(t){var s=this._internalRoot;if(s===null)throw Error(l(409));var r=s.current,a=Gt();Yv(r,a,t,s,null,null)},Wa.prototype.unmount=Ac.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var s=t.containerInfo;Yv(t.current,2,null,t,null,null),Ca(),s[cr]=null}};function Wa(t){this._internalRoot=t}Wa.prototype.unstable_scheduleHydration=function(t){if(t){var s=df();t={blockedOn:null,target:t,priority:s};for(var r=0;r<ys.length&&s!==0&&s<ys[r].priority;r++);ys.splice(r,0,t),r===0&&$v(t)}};var Zv=i.version;if(Zv!=="19.1.0")throw Error(l(527,Zv,"19.1.0"));U.findDOMNode=function(t){var s=t._reactInternals;if(s===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=v(s),t=t!==null?d(t):null,t=t===null?null:t.stateNode,t};var ny={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ya=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ya.isDisabled&&Ya.supportsFiber)try{hn=Ya.inject(ny),qt=Ya}catch{}}return ol.createRoot=function(t,s){if(!o(t))throw Error(l(299));var r=!1,a="",h=d_,u=__,g=v_,p=null;return s!=null&&(s.unstable_strictMode===!0&&(r=!0),s.identifierPrefix!==void 0&&(a=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(u=s.onCaughtError),s.onRecoverableError!==void 0&&(g=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(p=s.unstable_transitionCallbacks)),s=jv(t,1,!1,null,null,r,a,h,u,g,p,null),t[cr]=s.current,dc(t),new Ac(s)},ol.hydrateRoot=function(t,s,r){if(!o(t))throw Error(l(299));var a=!1,h="",u=d_,g=__,p=v_,b=null,T=null;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onUncaughtError!==void 0&&(u=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(p=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(b=r.unstable_transitionCallbacks),r.formState!==void 0&&(T=r.formState)),s=jv(t,1,!0,s,r??null,a,h,u,g,p,b,T),s.context=Wv(null),r=s.current,a=Gt(),a=wo(a),h=ss(a),h.callback=null,rs(r,h,a),r=a,s.current.lanes=r,un(s,r),wi(s),t[cr]=s.current,dc(t),new Wa(s)},ol.version="19.1.0",ol}var ug;function gy(){if(ug)return Oc.exports;ug=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Oc.exports=vy(),Oc.exports}var py=gy(),ge=Pu();const Ka=ay(ge),fg=e=>{let i;const n=new Set,l=(d,m)=>{const S=typeof d=="function"?d(i):d;if(!Object.is(S,i)){const y=i;i=m??(typeof S!="object"||S===null)?S:Object.assign({},i,S),n.forEach(D=>D(i,y))}},o=()=>i,_={setState:l,getState:o,getInitialState:()=>v,subscribe:d=>(n.add(d),()=>n.delete(d))},v=i=e(l,o,_);return _},my=(e=>e?fg(e):fg),Sy=e=>e;function yy(e,i=Sy){const n=Ka.useSyncExternalStore(e.subscribe,Ka.useCallback(()=>i(e.getState()),[e,i]),Ka.useCallback(()=>i(e.getInitialState()),[e,i]));return Ka.useDebugValue(n),n}const dg=e=>{const i=my(e),n=l=>yy(i,l);return Object.assign(n,i),n},go=(e=>e?dg(e):dg),qu=go(e=>({sidebarOpen:!0,previewVisible:!0,toggleSidebar:()=>e(i=>({sidebarOpen:!i.sidebarOpen})),setPreviewVisible:i=>e({previewVisible:i})}));/**
|
|
50
|
+
* @license lucide-react v0.511.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 by=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,n,l)=>l?l.toUpperCase():n.toLowerCase()),_g=e=>{const i=wy(e);return i.charAt(0).toUpperCase()+i.slice(1)},Bp=(...e)=>e.filter((i,n,l)=>!!i&&i.trim()!==""&&l.indexOf(i)===n).join(" ").trim(),Cy=e=>{for(const i in e)if(i.startsWith("aria-")||i==="role"||i==="title")return!0};/**
|
|
55
|
+
* @license lucide-react v0.511.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
|
+
*/var xy={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"};/**
|
|
60
|
+
* @license lucide-react v0.511.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 Ey=ge.forwardRef(({color:e="currentColor",size:i=24,strokeWidth:n=2,absoluteStrokeWidth:l,className:o="",children:c,iconNode:f,..._},v)=>ge.createElement("svg",{ref:v,...xy,width:i,height:i,stroke:e,strokeWidth:l?Number(n)*24/Number(i):n,className:Bp("lucide",o),...!c&&!Cy(_)&&{"aria-hidden":"true"},..._},[...f.map(([d,m])=>ge.createElement(d,m)),...Array.isArray(c)?c:[c]]));/**
|
|
65
|
+
* @license lucide-react v0.511.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 lr=(e,i)=>{const n=ge.forwardRef(({className:l,...o},c)=>ge.createElement(Ey,{ref:c,iconNode:i,className:Bp(`lucide-${by(_g(e))}`,`lucide-${e}`,l),...o}));return n.displayName=_g(e),n};/**
|
|
70
|
+
* @license lucide-react v0.511.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
|
+
*/const ky=[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]],Dy=lr("hammer",ky);/**
|
|
75
|
+
* @license lucide-react v0.511.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 My=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Ry=lr("menu",My);/**
|
|
80
|
+
* @license lucide-react v0.511.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 Ty=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Ay=lr("moon",Ty);/**
|
|
85
|
+
* @license lucide-react v0.511.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 By=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Oy=lr("plus",By);/**
|
|
90
|
+
* @license lucide-react v0.511.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 zy=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Ly=lr("rotate-cw",zy);/**
|
|
95
|
+
* @license lucide-react v0.511.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 Ny=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Hy=lr("sun",Ny);/**
|
|
100
|
+
* @license lucide-react v0.511.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 Uy=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Py=lr("x",Uy),qy={primary:"bg-accent text-white hover:bg-accent-hover",secondary:"bg-[#E5E7EB] text-text-primary hover:bg-[#D1D5DB] dark:bg-divider-dark dark:text-text-dark dark:hover:bg-divider-dark",ghost:"bg-transparent hover:bg-sidebar-hover dark:hover:bg-divider-dark"},jy="h-9 cursor-pointer rounded-button px-3.5 text-sm font-medium transition-colors duration-150";function vg({variant:e="primary",className:i,children:n,type:l="button",...o}){return Z.jsx("button",{type:l,className:[jy,qy[e],i].filter(Boolean).join(" "),...o,children:n})}const Wy="h-10 w-full rounded-input border border-divider bg-white px-3.5 text-base transition-colors outline-none focus:border-accent focus:ring-3 focus:ring-accent-ring dark:border-divider-dark dark:bg-card-dark dark:text-text-dark";function Yy({className:e,...i}){return Z.jsx("input",{className:[Wy,e].filter(Boolean).join(" "),...i})}const gg=e=>{document.documentElement.classList.toggle("dark",e==="dark")},Qc=go((e,i)=>({mode:"light",setMode:n=>{e({mode:n}),gg(n),fetch("/api/config",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme:n})})},toggle:()=>{const n=i().mode==="dark"?"light":"dark";i().setMode(n)},hydrate:async()=>{try{const n=await fetch("/api/config");if(!n.ok)return;const l=await n.json();e({mode:l.theme}),gg(l.theme)}catch{}}}));function Ky({className:e}){const i=Qc(l=>l.mode),n=Qc(l=>l.toggle);return Z.jsx("button",{type:"button",onClick:n,className:["flex h-8 w-8 cursor-pointer items-center justify-center rounded-full text-text-primary transition-colors duration-150 hover:bg-sidebar-hover dark:text-text-dark dark:hover:bg-divider-dark",e].filter(Boolean).join(" "),"aria-label":"Toggle theme",children:i==="dark"?Z.jsx(Ay,{size:18,strokeWidth:1.8}):Z.jsx(Hy,{size:18,strokeWidth:1.8})})}let Fr=null;const Zt=go((e,i)=>({sessions:[],activeSessionName:null,sessionMetas:{},error:null,fetchSessions:async()=>{try{const n=await fetch("/api/tmux/sessions");if(!n.ok)return;const l=await n.json();e({sessions:l})}catch{}},setActiveSession:n=>{e({activeSessionName:n,error:null}),i().fetchMeta(n)},clearActiveSession:()=>{e({activeSessionName:null})},createSession:async n=>{e({error:null});try{const l=await fetch("/api/tmux/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})});if(!l.ok){const o=await l.json();e({error:o.error??"Failed to create session"});return}await i().fetchSessions(),i().setActiveSession(n)}catch{e({error:"Server unreachable"})}},fetchMeta:async n=>{try{const l=await fetch(`/api/sessions/${encodeURIComponent(n)}/meta`);if(!l.ok)return;const o=await l.json();e(c=>({sessionMetas:{...c.sessionMetas,[n]:o}}))}catch{}},triggerRestart:async n=>{try{await fetch(`/api/sessions/${encodeURIComponent(n)}/restart`,{method:"POST"})}catch{}},startPolling:()=>{Fr&&clearInterval(Fr);const n=()=>{i().fetchSessions();const l=i().activeSessionName;l&&i().fetchMeta(l)};return n(),Fr=setInterval(n,3e3),()=>{Fr&&(clearInterval(Fr),Fr=null)}}}));function Vy({name:e,attached:i,active:n,onClick:l}){return Z.jsxs("button",{type:"button",onClick:l,className:["flex w-full cursor-pointer items-center gap-2.5 rounded-sidebar px-3 py-2 text-left text-sm transition-colors",n?"bg-sidebar-active font-medium text-text-primary shadow-subtle dark:bg-divider-dark dark:text-text-dark":"text-text-secondary hover:bg-sidebar-hover dark:hover:bg-divider-dark"].join(" "),children:[i&&Z.jsx("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full bg-green-500"}),Z.jsx("span",{className:"truncate font-mono text-[13px]",children:e})]})}function Xy(){const e=Zt(l=>l.sessions),i=Zt(l=>l.activeSessionName),n=Zt(l=>l.setActiveSession);return e.length===0?Z.jsx("p",{className:"px-3 py-4 text-xs text-text-secondary",children:"No tmux sessions running."}):Z.jsx("div",{className:"flex flex-col gap-0.5",children:e.map(l=>Z.jsx(Vy,{name:l.name,attached:l.attached,active:l.name===i,onClick:()=>n(l.name)},l.name))})}function Gy({onClose:e}){const[i,n]=ge.useState(""),l=Zt(f=>f.createSession),o=Zt(f=>f.error),c=async f=>{f.preventDefault();const _=i.trim();_&&(await l(_),Zt.getState().error||e())};return Z.jsxs("form",{onSubmit:c,className:"flex flex-col gap-2 rounded-sidebar bg-sidebar-active p-3 shadow-subtle dark:bg-bg-dark",children:[Z.jsx(Yy,{value:i,onChange:f=>n(f.target.value),placeholder:"Session name",autoFocus:!0,className:"h-8 text-sm"}),o&&Z.jsx("p",{className:"text-xs text-red-500",children:o}),Z.jsxs("div",{className:"flex gap-2",children:[Z.jsx(vg,{type:"submit",className:"flex-1 h-8 text-xs",children:"Create"}),Z.jsx(vg,{variant:"ghost",onClick:e,className:"h-8 text-xs",children:"Cancel"})]})]})}function $y(){const[e,i]=ge.useState(!1);return Z.jsxs("aside",{className:"flex h-full w-[var(--sidebar-width)] shrink-0 flex-col border-r border-divider bg-sidebar dark:border-divider-dark dark:bg-card-dark",children:[Z.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-4",children:[Z.jsx("img",{src:"/logo.png",alt:"unloved",className:"h-7 w-7"}),Z.jsx("span",{className:"text-sm font-semibold text-text-primary dark:text-text-dark",children:"unloved"})]}),Z.jsx("div",{className:"h-px bg-divider dark:bg-divider-dark"}),Z.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:Z.jsx(Xy,{})}),Z.jsx("div",{className:"px-3 pb-2",children:e?Z.jsx(Gy,{onClose:()=>i(!1)}):Z.jsxs("button",{type:"button",onClick:()=>i(!0),className:"flex w-full cursor-pointer items-center gap-2 rounded-sidebar px-3 py-2 text-sm text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark",children:[Z.jsx(Oy,{size:16}),"New session"]})}),Z.jsx("div",{className:"border-t border-divider px-3 py-3 dark:border-divider-dark",children:Z.jsx(Ky,{className:"static h-8 w-8"})})]})}function Fy(){const e=Zt(v=>v.activeSessionName),i=Zt(v=>v.sessionMetas),n=Zt(v=>v.triggerRestart),l=Zt(v=>v.clearActiveSession),o=qu(v=>v.toggleSidebar);ge.useRef(null);const c=e?i[e]:null,f=c==null?void 0:c.previewUrl,_=()=>{const v=document.querySelector('iframe[title="Preview"]');if(!v)return;const d=v.src;v.src="about:blank",requestAnimationFrame(()=>{v.src=d})};return Z.jsxs("header",{className:"flex h-[var(--header-height)] shrink-0 items-center gap-3 border-b border-divider px-4 dark:border-divider-dark",children:[Z.jsx("button",{type:"button",onClick:o,className:"flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-sidebar text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark","aria-label":"Toggle sidebar",children:Z.jsx(Ry,{size:18})}),e?Z.jsxs(Z.Fragment,{children:[Z.jsx("span",{className:"shrink-0 font-mono text-sm font-medium text-text-primary dark:text-text-dark",children:e}),f&&Z.jsxs("div",{className:"flex h-9 w-[var(--console-width)] max-w-[420px] shrink-0 items-center gap-2 rounded-input border border-divider bg-sidebar px-3 dark:border-divider-dark dark:bg-bg-dark",children:[Z.jsx("span",{className:"flex-1 truncate font-mono text-xs text-text-secondary","data-testid":"header-url",children:f}),Z.jsx("button",{type:"button",onClick:_,className:"flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark","aria-label":"Refresh preview",children:Z.jsx(Ly,{size:13})})]}),Z.jsx("div",{className:"flex-1"}),(c==null?void 0:c.restartCommand)&&Z.jsxs("button",{type:"button",onClick:()=>n(e),className:"flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-button bg-accent px-3 text-xs font-medium text-white transition-colors hover:bg-accent-hover","aria-label":"Rebuild",children:[Z.jsx(Dy,{size:14}),"Rebuild"]}),Z.jsxs("button",{type:"button",onClick:l,className:"flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-sidebar px-2.5 text-xs text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark","aria-label":"Disconnect",children:[Z.jsx(Py,{size:14}),"Disconnect"]})]}):Z.jsx("span",{className:"text-sm text-text-secondary",children:"Select a session"})]})}function Iy(){return Z.jsxs("div",{className:"w-full max-w-md rounded-card bg-card p-8 shadow-card dark:bg-card-dark",children:[Z.jsxs("div",{className:"flex flex-col items-center gap-3",children:[Z.jsx("img",{src:"/logo.png",alt:"unloved",className:"h-12 w-12"}),Z.jsx("h1",{className:"text-[28px] font-semibold text-text-primary dark:text-text-dark",children:"unloved"}),Z.jsx("p",{className:"text-sm text-text-secondary",children:"Local AI coding cockpit"})]}),Z.jsx("div",{className:"h-6"}),Z.jsx("p",{className:"text-center text-sm text-text-secondary",children:"Select a session from the sidebar to get started, or create a new one."})]})}function Zy(){return Z.jsxs("div",{className:"fixed inset-0 -z-10 overflow-hidden",children:[Z.jsx("div",{className:"absolute top-[-140px] left-1/2 h-[400px] w-[400px] -translate-x-1/2 rounded-full bg-gradient-top opacity-70 blur-[120px] dark:bg-gradient-mid dark:opacity-25"}),Z.jsx("div",{className:"absolute top-1/2 left-1/2 h-[500px] w-[500px] -translate-x-1/2 -translate-y-1/2 rounded-full bg-gradient-mid opacity-30 blur-[120px] dark:opacity-15"}),Z.jsx("div",{className:"absolute right-[-100px] bottom-[-100px] h-[350px] w-[350px] rounded-full bg-linear-to-br from-gradient-pink to-gradient-red opacity-40 blur-[120px] dark:opacity-20"})]})}function Qy(e,i){const n=getComputedStyle(e),l=parseFloat(n.fontSize);return i*l}function Jy(e,i){const n=getComputedStyle(e.ownerDocument.body),l=parseFloat(n.fontSize);return i*l}function e1(e){return e/100*window.innerHeight}function t1(e){return e/100*window.innerWidth}function i1(e){switch(typeof e){case"number":return[e,"px"];case"string":{const i=parseFloat(e);return e.endsWith("%")?[i,"%"]:e.endsWith("px")?[i,"px"]:e.endsWith("rem")?[i,"rem"]:e.endsWith("em")?[i,"em"]:e.endsWith("vh")?[i,"vh"]:e.endsWith("vw")?[i,"vw"]:[i,"%"]}}}function Va({groupSize:e,panelElement:i,styleProp:n}){let l;const[o,c]=i1(n);switch(c){case"%":{l=o/100*e;break}case"px":{l=o;break}case"rem":{l=Jy(i,o);break}case"em":{l=Qy(i,o);break}case"vh":{l=e1(o);break}case"vw":{l=t1(o);break}}return l}function Pt(e){return parseFloat(e.toFixed(3))}function nn({group:e}){const{orientation:i,panels:n}=e;return n.reduce((l,o)=>(l+=i==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,l),0)}function Jc(e){const{panels:i}=e,n=nn({group:e});return n===0?i.map(l=>({groupResizeBehavior:l.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:l.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:l.panelConstraints.disabled,minSize:0,maxSize:100,panelId:l.id})):i.map(l=>{const{element:o,panelConstraints:c}=l;let f=0;if(c.collapsedSize!==void 0){const m=Va({groupSize:n,panelElement:o,styleProp:c.collapsedSize});f=Pt(m/n*100)}let _;if(c.defaultSize!==void 0){const m=Va({groupSize:n,panelElement:o,styleProp:c.defaultSize});_=Pt(m/n*100)}let v=0;if(c.minSize!==void 0){const m=Va({groupSize:n,panelElement:o,styleProp:c.minSize});v=Pt(m/n*100)}let d=100;if(c.maxSize!==void 0){const m=Va({groupSize:n,panelElement:o,styleProp:c.maxSize});d=Pt(m/n*100)}return{groupResizeBehavior:c.groupResizeBehavior,collapsedSize:f,collapsible:c.collapsible===!0,defaultSize:_,disabled:c.disabled,minSize:v,maxSize:d,panelId:l.id}})}function Le(e,i="Assertion error"){if(!e)throw Error(i)}function eu(e,i){return Array.from(i).sort(e==="horizontal"?s1:r1)}function s1(e,i){const n=e.element.offsetLeft-i.element.offsetLeft;return n!==0?n:e.element.offsetWidth-i.element.offsetWidth}function r1(e,i){const n=e.element.offsetTop-i.element.offsetTop;return n!==0?n:e.element.offsetHeight-i.element.offsetHeight}function Op(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function zp(e,i){return{x:e.x>=i.left&&e.x<=i.right?0:Math.min(Math.abs(e.x-i.left),Math.abs(e.x-i.right)),y:e.y>=i.top&&e.y<=i.bottom?0:Math.min(Math.abs(e.y-i.top),Math.abs(e.y-i.bottom))}}function n1({orientation:e,rects:i,targetRect:n}){const l={x:n.x+n.width/2,y:n.y+n.height/2};let o,c=Number.MAX_VALUE;for(const f of i){const{x:_,y:v}=zp(l,f),d=e==="horizontal"?_:v;d<c&&(c=d,o=f)}return Le(o,"No rect found"),o}let Xa;function l1(){return Xa===void 0&&(typeof matchMedia=="function"?Xa=!!matchMedia("(pointer:coarse)").matches:Xa=!1),Xa}function Lp(e){const{element:i,orientation:n,panels:l,separators:o}=e,c=eu(n,Array.from(i.children).filter(Op).map(C=>({element:C}))).map(({element:C})=>C),f=[];let _=!1,v=!1,d=-1,m=-1,S=0,y,D=[];{let C=-1;for(const E of c)E.hasAttribute("data-panel")&&(C++,E.ariaDisabled===null&&(S++,d===-1&&(d=C),m=C))}if(S>1){let C=-1;for(const E of c)if(E.hasAttribute("data-panel")){C++;const B=l.find(z=>z.element===E);if(B){if(y){const z=y.element.getBoundingClientRect(),Q=E.getBoundingClientRect();let X;if(v){const q=n==="horizontal"?new DOMRect(z.right,z.top,0,z.height):new DOMRect(z.left,z.bottom,z.width,0),L=n==="horizontal"?new DOMRect(Q.left,Q.top,0,Q.height):new DOMRect(Q.left,Q.top,Q.width,0);switch(D.length){case 0:{X=[q,L];break}case 1:{const ee=D[0],le=n1({orientation:n,rects:[z,Q],targetRect:ee.element.getBoundingClientRect()});X=[ee,le===z?L:q];break}default:{X=D;break}}}else D.length?X=D:X=[n==="horizontal"?new DOMRect(z.right,Q.top,Q.left-z.right,Q.height):new DOMRect(Q.left,z.bottom,Q.width,Q.top-z.bottom)];for(const q of X){let L="width"in q?q:q.element.getBoundingClientRect();const ee=l1()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(L.width<ee){const de=ee-L.width;L=new DOMRect(L.x-de/2,L.y,L.width+de,L.height)}if(L.height<ee){const de=ee-L.height;L=new DOMRect(L.x,L.y-de/2,L.width,L.height+de)}const le=C<=d||C>m;!_&&!le&&f.push({group:e,groupSize:nn({group:e}),panels:[y,B],separator:"width"in q?void 0:q,rect:L}),_=!1}}v=!1,y=B,D=[]}}else if(E.hasAttribute("data-separator")){E.ariaDisabled!==null&&(_=!0);const B=o.find(z=>z.element===E);B?D.push(B):(y=void 0,D=[])}else v=!0}return f}var ks,Mp;let Np=(Mp=class{constructor(){eg(this,ks,{})}addListener(i,n){const l=ll(this,ks)[i];return l===void 0?ll(this,ks)[i]=[n]:l.includes(n)||l.push(n),()=>{this.removeListener(i,n)}}emit(i,n){const l=ll(this,ks)[i];if(l!==void 0)if(l.length===1)l[0].call(null,n);else{let o=!1,c=null;const f=Array.from(l);for(let _=0;_<f.length;_++){const v=f[_];try{v.call(null,n)}catch(d){c===null&&(o=!0,c=d)}}if(o)throw c}}removeAllListeners(){tg(this,ks,{})}removeListener(i,n){const l=ll(this,ks)[i];if(l!==void 0){const o=l.indexOf(n);o>=0&&l.splice(o,1)}}},ks=new WeakMap,Mp),Di=new Map;const Hp=new Np;function a1(e){Di=new Map(Di),Di.delete(e)}function pg(e,i){for(const[n]of Di)if(n.id===e)return n}function Ms(e,i){for(const[n,l]of Di)if(n.id===e)return l;if(i)throw Error(`Could not find data for Group with id ${e}`)}function ar(){return Di}function ju(e,i){return Hp.addListener("groupChange",n=>{n.group.id===e&&i(n)})}function $i(e,i){const n=Di.get(e);Di=new Map(Di),Di.set(e,i),Hp.emit("groupChange",{group:e,prev:n,next:i})}function o1(e,i,n){let l,o={x:1/0,y:1/0};for(const c of i){const f=zp(n,c.rect);switch(e){case"horizontal":{f.x<=o.x&&(l=c,o=f);break}case"vertical":{f.y<=o.y&&(l=c,o=f);break}}}return l?{distance:o,hitRegion:l}:void 0}function h1(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function c1(e,i){if(e===i)throw new Error("Cannot compare node with itself");const n={a:yg(e),b:yg(i)};let l;for(;n.a.at(-1)===n.b.at(-1);)l=n.a.pop(),n.b.pop();Le(l,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Sg(mg(n.a)),b:Sg(mg(n.b))};if(o.a===o.b){const c=l.childNodes,f={a:n.a.at(-1),b:n.b.at(-1)};let _=c.length;for(;_--;){const v=c[_];if(v===f.a)return 1;if(v===f.b)return-1}}return Math.sign(o.a-o.b)}const u1=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function f1(e){const i=getComputedStyle(Up(e)??e).display;return i==="flex"||i==="inline-flex"}function d1(e){const i=getComputedStyle(e);return!!(i.position==="fixed"||i.zIndex!=="auto"&&(i.position!=="static"||f1(e))||+i.opacity<1||"transform"in i&&i.transform!=="none"||"webkitTransform"in i&&i.webkitTransform!=="none"||"mixBlendMode"in i&&i.mixBlendMode!=="normal"||"filter"in i&&i.filter!=="none"||"webkitFilter"in i&&i.webkitFilter!=="none"||"isolation"in i&&i.isolation==="isolate"||u1.test(i.willChange)||i.webkitOverflowScrolling==="touch")}function mg(e){let i=e.length;for(;i--;){const n=e[i];if(Le(n,"Missing node"),d1(n))return n}return null}function Sg(e){return e&&Number(getComputedStyle(e).zIndex)||0}function yg(e){const i=[];for(;e;)i.push(e),e=Up(e);return i}function Up(e){const{parentNode:i}=e;return h1(i)?i.host:i}function _1(e,i){return e.x<i.x+i.width&&e.x+e.width>i.x&&e.y<i.y+i.height&&e.y+e.height>i.y}function v1({groupElement:e,hitRegion:i,pointerEventTarget:n}){if(!Op(n)||n.contains(e)||e.contains(n))return!0;if(c1(n,e)>0){let l=n;for(;l;){if(l.contains(e))return!0;if(_1(l.getBoundingClientRect(),i))return!1;l=l.parentElement}}return!0}function Wu(e,i){const n=[];return i.forEach((l,o)=>{if(o.disabled)return;const c=Lp(o),f=o1(o.orientation,c,{x:e.clientX,y:e.clientY});f&&f.distance.x<=0&&f.distance.y<=0&&v1({groupElement:o.element,hitRegion:f.hitRegion.rect,pointerEventTarget:e.target})&&n.push(f.hitRegion)}),n}function g1(e,i){if(e.length!==i.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=i[n])return!1;return!0}function Tt(e,i,n=0){return Math.abs(Pt(e)-Pt(i))<=n}function ki(e,i){return Tt(e,i)?0:e>i?1:-1}function en({overrideDisabledPanels:e,panelConstraints:i,prevSize:n,size:l}){const{collapsedSize:o=0,collapsible:c,disabled:f,maxSize:_=100,minSize:v=0}=i;if(f&&!e)return n;if(ki(l,v)<0)if(c){const d=(o+v)/2;ki(l,d)<0?l=o:l=v}else l=v;return l=Math.min(_,l),l=Pt(l),l}function wl({delta:e,initialLayout:i,panelConstraints:n,pivotIndices:l,prevLayout:o,trigger:c}){if(Tt(e,0))return i;const f=c==="imperative-api",_=Object.values(i),v=Object.values(o),d=[..._],[m,S]=l;Le(m!=null,"Invalid first pivot index"),Le(S!=null,"Invalid second pivot index");let y=0;switch(c){case"keyboard":{{const E=e<0?S:m,B=n[E];Le(B,`Panel constraints not found for index ${E}`);const{collapsedSize:z=0,collapsible:Q,minSize:X=0}=B;if(Q){const q=_[E];if(Le(q!=null,`Previous layout not found for panel index ${E}`),Tt(q,z)){const L=X-q;ki(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}{const E=e<0?m:S,B=n[E];Le(B,`No panel constraints found for index ${E}`);const{collapsedSize:z=0,collapsible:Q,minSize:X=0}=B;if(Q){const q=_[E];if(Le(q!=null,`Previous layout not found for panel index ${E}`),Tt(q,X)){const L=q-z;ki(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}break}default:{const E=e<0?S:m,B=n[E];Le(B,`Panel constraints not found for index ${E}`);const z=_[E],{collapsible:Q,collapsedSize:X,minSize:q}=B;if(Q&&ki(z,q)<0)if(e>0){const L=q-X,ee=L/2,le=z+e;ki(le,q)<0&&(e=ki(e,ee)<=0?0:L)}else{const L=q-X,ee=100-L/2,le=z-e;ki(le,q)<0&&(e=ki(100+e,ee)>0?0:-L)}break}}{const E=e<0?1:-1;let B=e<0?S:m,z=0;for(;;){const X=_[B];Le(X!=null,`Previous layout not found for panel index ${B}`);const q=en({overrideDisabledPanels:f,panelConstraints:n[B],prevSize:X,size:100})-X;if(z+=q,B+=E,B<0||B>=n.length)break}const Q=Math.min(Math.abs(e),Math.abs(z));e=e<0?0-Q:Q}{let E=e<0?m:S;for(;E>=0&&E<n.length;){const B=Math.abs(e)-Math.abs(y),z=_[E];Le(z!=null,`Previous layout not found for panel index ${E}`);const Q=z-B,X=en({overrideDisabledPanels:f,panelConstraints:n[E],prevSize:z,size:Q});if(!Tt(z,X)&&(y+=z-X,d[E]=X,y.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?E--:E++}}if(g1(v,d))return o;{const E=e<0?S:m,B=_[E];Le(B!=null,`Previous layout not found for panel index ${E}`);const z=B+y,Q=en({overrideDisabledPanels:f,panelConstraints:n[E],prevSize:B,size:z});if(d[E]=Q,!Tt(Q,z)){let X=z-Q,q=e<0?S:m;for(;q>=0&&q<n.length;){const L=d[q];Le(L!=null,`Previous layout not found for panel index ${q}`);const ee=L+X,le=en({overrideDisabledPanels:f,panelConstraints:n[q],prevSize:L,size:ee});if(Tt(L,le)||(X-=le-L,d[q]=le),Tt(X,0))break;e>0?q--:q++}}}const D=Object.values(d).reduce((E,B)=>B+E,0);if(!Tt(D,100,.1))return o;const C=Object.keys(o);return d.reduce((E,B,z)=>(E[C[z]]=B,E),{})}function tr(e,i){if(Object.keys(e).length!==Object.keys(i).length)return!1;for(const n in e)if(i[n]===void 0||ki(e[n],i[n])!==0)return!1;return!0}function ir({layout:e,panelConstraints:i}){const n=Object.values(e),l=[...n],o=l.reduce((_,v)=>_+v,0);if(l.length!==i.length)throw Error(`Invalid ${i.length} panel layout: ${l.map(_=>`${_}%`).join(", ")}`);if(!Tt(o,100)&&l.length>0)for(let _=0;_<i.length;_++){const v=l[_];Le(v!=null,`No layout data found for index ${_}`);const d=100/o*v;l[_]=d}let c=0;for(let _=0;_<i.length;_++){const v=n[_];Le(v!=null,`No layout data found for index ${_}`);const d=l[_];Le(d!=null,`No layout data found for index ${_}`);const m=en({overrideDisabledPanels:!0,panelConstraints:i[_],prevSize:v,size:d});d!=m&&(c+=d-m,l[_]=m)}if(!Tt(c,0))for(let _=0;_<i.length;_++){const v=l[_];Le(v!=null,`No layout data found for index ${_}`);const d=v+c,m=en({overrideDisabledPanels:!0,panelConstraints:i[_],prevSize:v,size:d});if(v!==m&&(c-=m-v,l[_]=m,Tt(c,0)))break}const f=Object.keys(e);return l.reduce((_,v,d)=>(_[f[d]]=v,_),{})}function Pp({groupId:e,panelId:i}){const n=()=>{const _=ar();for(const[v,{defaultLayoutDeferred:d,derivedPanelConstraints:m,layout:S,groupSize:y,separatorToPanels:D}]of _)if(v.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:m,group:v,groupSize:y,layout:S,separatorToPanels:D};throw Error(`Group ${e} not found`)},l=()=>{const _=n().derivedPanelConstraints.find(v=>v.panelId===i);if(_!==void 0)return _;throw Error(`Panel constraints not found for Panel ${i}`)},o=()=>{const _=n().group.panels.find(v=>v.id===i);if(_!==void 0)return _;throw Error(`Layout not found for Panel ${i}`)},c=()=>{const _=n().layout[i];if(_!==void 0)return _;throw Error(`Layout not found for Panel ${i}`)},f=_=>{const v=c();if(_===v)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:m,group:S,groupSize:y,layout:D,separatorToPanels:C}=n(),E=S.panels.findIndex(X=>X.id===i),B=E===S.panels.length-1,z=wl({delta:B?v-_:_-v,initialLayout:D,panelConstraints:m,pivotIndices:B?[E-1,E]:[E,E+1],prevLayout:D,trigger:"imperative-api"}),Q=ir({layout:z,panelConstraints:m});tr(D,Q)||$i(S,{defaultLayoutDeferred:d,derivedPanelConstraints:m,groupSize:y,layout:Q,separatorToPanels:C})};return{collapse:()=>{const{collapsible:_,collapsedSize:v}=l(),{mutableValues:d}=o(),m=c();_&&m!==v&&(d.expandToSize=m,f(v))},expand:()=>{const{collapsible:_,collapsedSize:v,minSize:d}=l(),{mutableValues:m}=o(),S=c();if(_&&S===v){let y=m.expandToSize??d;y===0&&(y=1),f(y)}},getSize:()=>{const{group:_}=n(),v=c(),{element:d}=o(),m=_.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:v,inPixels:m}},isCollapsed:()=>{const{collapsible:_,collapsedSize:v}=l(),d=c();return _&&Tt(v,d)},resize:_=>{if(c()!==_){let v;switch(typeof _){case"number":{const{group:d}=n(),m=nn({group:d});v=Pt(_/m*100);break}case"string":{v=parseFloat(_);break}}f(v)}}}}function bg(e){if(e.defaultPrevented)return;const i=ar();Wu(e,i).forEach(n=>{if(n.separator){const l=n.panels.find(o=>o.panelConstraints.defaultSize!==void 0);if(l){const o=l.panelConstraints.defaultSize,c=Pp({groupId:n.group.id,panelId:l.id});c&&o!==void 0&&(c.resize(o),e.preventDefault())}}})}function to(e){const i=ar();for(const[n]of i)if(n.separators.some(l=>l.element===e))return n;throw Error("Could not find parent Group for separator element")}function qp({groupId:e}){const i=()=>{const n=ar();for(const[l,o]of n)if(l.id===e)return{group:l,...o};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:l}=i();return n?{}:l},setLayout(n){const{defaultLayoutDeferred:l,derivedPanelConstraints:o,group:c,groupSize:f,layout:_,separatorToPanels:v}=i(),d=ir({layout:n,panelConstraints:o});return l?_:(tr(_,d)||$i(c,{defaultLayoutDeferred:l,derivedPanelConstraints:o,groupSize:f,layout:d,separatorToPanels:v}),d)}}}function Fs(e,i){const n=to(e),l=Ms(n.id,!0),o=n.separators.find(m=>m.element===e);Le(o,"Matching separator not found");const c=l.separatorToPanels.get(o);Le(c,"Matching panels not found");const f=c.map(m=>n.panels.indexOf(m)),_=qp({groupId:n.id}).getLayout(),v=wl({delta:i,initialLayout:_,panelConstraints:l.derivedPanelConstraints,pivotIndices:f,prevLayout:_,trigger:"keyboard"}),d=ir({layout:v,panelConstraints:l.derivedPanelConstraints});tr(_,d)||$i(n,{defaultLayoutDeferred:l.defaultLayoutDeferred,derivedPanelConstraints:l.derivedPanelConstraints,groupSize:l.groupSize,layout:d,separatorToPanels:l.separatorToPanels})}function wg(e){if(e.defaultPrevented)return;const i=e.currentTarget,n=to(i);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Fs(i,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Fs(i,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Fs(i,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Fs(i,-5);break}case"End":{e.preventDefault(),Fs(i,100);break}case"Enter":{e.preventDefault();const l=to(i),o=Ms(l.id,!0),{derivedPanelConstraints:c,layout:f,separatorToPanels:_}=o,v=l.separators.find(y=>y.element===i);Le(v,"Matching separator not found");const d=_.get(v);Le(d,"Matching panels not found");const m=d[0],S=c.find(y=>y.panelId===m.id);if(Le(S,"Panel metadata not found"),S.collapsible){const y=f[m.id],D=S.collapsedSize===y?l.mutableState.expandedPanelSizes[m.id]??S.minSize:S.collapsedSize;Fs(i,D-y)}break}case"F6":{e.preventDefault();const l=to(i).separators.map(f=>f.element),o=Array.from(l).findIndex(f=>f===e.currentTarget);Le(o!==null,"Index not found");const c=e.shiftKey?o>0?o-1:l.length-1:o+1<l.length?o+1:0;l[c].focus();break}case"Home":{e.preventDefault(),Fs(i,-100);break}}}let sn={cursorFlags:0,state:"inactive"};const Yu=new Np;function sr(){return sn}function p1(e){return Yu.addListener("change",e)}function m1(e){const i=sn,n={...sn};n.cursorFlags=e,sn=n,Yu.emit("change",{prev:i,next:n})}function rn(e){const i=sn;sn=e,Yu.emit("change",{prev:i,next:e})}function Cg(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const i=ar(),n=Wu(e,i),l=new Map;let o=!1;n.forEach(c=>{c.separator&&(o||(o=!0,c.separator.element.focus()));const f=i.get(c.group);f&&l.set(c.group,f.layout)}),rn({cursorFlags:0,hitRegions:n,initialLayoutMap:l,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const S1=e=>e,Uc=()=>{},jp=1,Wp=2,Yp=4,Kp=8,xg=3,Eg=12;let Ga;function kg(){return Ga===void 0&&(Ga=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Ga=!0)),Ga}function y1({cursorFlags:e,groups:i,state:n}){let l=0,o=0;switch(n){case"active":case"hover":i.forEach(c=>{if(!c.mutableState.disableCursor)switch(c.orientation){case"horizontal":{l++;break}case"vertical":{o++;break}}})}if(!(l===0&&o===0)){switch(n){case"active":{if(e&&kg()){const c=(e&jp)!==0,f=(e&Wp)!==0,_=(e&Yp)!==0,v=(e&Kp)!==0;if(c)return _?"se-resize":v?"ne-resize":"e-resize";if(f)return _?"sw-resize":v?"nw-resize":"w-resize";if(_)return"s-resize";if(v)return"n-resize"}break}}return kg()?l>0&&o>0?"move":l>0?"ew-resize":"ns-resize":l>0&&o>0?"grab":l>0?"col-resize":"row-resize"}}const Dg=new WeakMap;function Ku(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:i,styleSheet:n}=Dg.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const l=sr();switch(l.state){case"active":case"hover":{const o=y1({cursorFlags:l.cursorFlags,groups:l.hitRegions.map(f=>f.group),state:l.state}),c=`*, *:hover {cursor: ${o} !important; }`;if(i===c)return;i=c,o?n.cssRules.length===0?n.insertRule(c):n.replaceSync(c):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{i=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}Dg.set(e,{prevStyle:i,styleSheet:n})}function Vp({document:e,event:i,hitRegions:n,initialLayoutMap:l,mountedGroups:o,pointerDownAtPoint:c,prevCursorFlags:f}){let _=0;n.forEach(d=>{const{group:m,groupSize:S}=d,{orientation:y,panels:D}=m,{disableCursor:C}=m.mutableState;let E=0;c?y==="horizontal"?E=(i.clientX-c.x)/S*100:E=(i.clientY-c.y)/S*100:y==="horizontal"?E=i.clientX<0?-100:100:E=i.clientY<0?-100:100;const B=l.get(m),z=o.get(m);if(!B||!z)return;const{defaultLayoutDeferred:Q,derivedPanelConstraints:X,groupSize:q,layout:L,separatorToPanels:ee}=z;if(X&&L&&ee){const le=wl({delta:E,initialLayout:B,panelConstraints:X,pivotIndices:d.panels.map(de=>D.indexOf(de)),prevLayout:L,trigger:"mouse-or-touch"});if(tr(le,L)){if(E!==0&&!C)switch(y){case"horizontal":{_|=E<0?jp:Wp;break}case"vertical":{_|=E<0?Yp:Kp;break}}}else $i(d.group,{defaultLayoutDeferred:Q,derivedPanelConstraints:X,groupSize:q,layout:le,separatorToPanels:ee})}});let v=0;i.movementX===0?v|=f&xg:v|=_&xg,i.movementY===0?v|=f&Eg:v|=_&Eg,m1(v),Ku(e)}function Mg(e){const i=ar(),n=sr();switch(n.state){case"active":Vp({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:i,prevCursorFlags:n.cursorFlags})}}function Rg(e){if(e.defaultPrevented)return;const i=sr(),n=ar();switch(i.state){case"active":{if(e.buttons===0){rn({cursorFlags:0,state:"inactive"}),i.hitRegions.forEach(l=>{const o=Ms(l.group.id,!0);$i(l.group,o)});return}Vp({document:e.currentTarget,event:e,hitRegions:i.hitRegions,initialLayoutMap:i.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:i.pointerDownAtPoint,prevCursorFlags:i.cursorFlags});break}default:{const l=Wu(e,n);l.length===0?i.state!=="inactive"&&rn({cursorFlags:0,state:"inactive"}):rn({cursorFlags:0,hitRegions:l,state:"hover"}),Ku(e.currentTarget);break}}}function Tg(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(sr().state){case"hover":rn({cursorFlags:0,state:"inactive"})}}function Ag(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const i=sr();switch(i.state){case"active":rn({cursorFlags:0,state:"inactive"}),i.hitRegions.length>0&&(Ku(e.currentTarget),i.hitRegions.forEach(n=>{const l=Ms(n.group.id,!0);$i(n.group,l)}),e.preventDefault())}}function Bg(e){let i=0,n=0;const l={};for(const c of e)if(c.defaultSize!==void 0){i++;const f=Pt(c.defaultSize);n+=f,l[c.panelId]=f}else l[c.panelId]=void 0;const o=e.length-i;if(o!==0){const c=Pt((100-n)/o);for(const f of e)f.defaultSize===void 0&&(l[f.panelId]=c)}return l}function b1(e,i,n){if(!n[0])return;const l=e.panels.find(v=>v.element===i);if(!l||!l.onResize)return;const o=nn({group:e}),c=e.orientation==="horizontal"?l.element.offsetWidth:l.element.offsetHeight,f=l.mutableValues.prevSize,_={asPercentage:Pt(c/o*100),inPixels:c};l.mutableValues.prevSize=_,l.onResize(_,l.id,f)}function w1(e,i){if(Object.keys(e).length!==Object.keys(i).length)return!1;for(const n in e)if(e[n]!==i[n])return!1;return!0}function C1({group:e,nextGroupSize:i,prevGroupSize:n,prevLayout:l}){if(n<=0||i<=0||n===i)return l;let o=0,c=0,f=!1;const _=new Map,v=[];for(const S of e.panels){const y=l[S.id]??0;switch(S.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{f=!0;const D=y/100*n,C=Pt(D/i*100);_.set(S.id,C),o+=C;break}case"preserve-relative-size":default:{v.push(S.id),c+=y;break}}}if(!f||v.length===0)return l;const d=100-o,m={...l};if(_.forEach((S,y)=>{m[y]=S}),c>0)for(const S of v){const y=l[S]??0;m[S]=Pt(y/c*d)}else{const S=Pt(d/v.length);for(const y of v)m[y]=S}return m}function x1(e,i){const n=e.map(o=>o.id),l=Object.keys(i);if(n.length!==l.length)return!1;for(const o of n)if(!l.includes(o))return!1;return!0}const Ir=new Map;function E1(e){let i=!0;Le(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,l=new Set,o=new Set,c=new n(C=>{for(const E of C){const{borderBoxSize:B,target:z}=E;if(z===e.element){if(i){const Q=nn({group:e});if(Q===0)return;const X=Ms(e.id);if(!X)return;const q=Jc(e),L=X.defaultLayoutDeferred?Bg(q):X.layout,ee=C1({group:e,nextGroupSize:Q,prevGroupSize:X.groupSize,prevLayout:L}),le=ir({layout:ee,panelConstraints:q});if(!X.defaultLayoutDeferred&&tr(X.layout,le)&&w1(X.derivedPanelConstraints,q)&&X.groupSize===Q)return;$i(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:q,groupSize:Q,layout:le,separatorToPanels:X.separatorToPanels})}}else b1(e,z,B)}});c.observe(e.element),e.panels.forEach(C=>{Le(!l.has(C.id),`Panel ids must be unique; id "${C.id}" was used more than once`),l.add(C.id),C.onResize&&c.observe(C.element)});const f=nn({group:e}),_=Jc(e),v=e.panels.map(({id:C})=>C).join(",");let d=e.mutableState.defaultLayout;d&&(x1(e.panels,d)||(d=void 0));const m=e.mutableState.layouts[v]??d??Bg(_),S=ir({layout:m,panelConstraints:_}),y=e.element.ownerDocument;Ir.set(y,(Ir.get(y)??0)+1);const D=new Map;return Lp(e).forEach(C=>{C.separator&&D.set(C.separator,C.panels)}),$i(e,{defaultLayoutDeferred:f===0,derivedPanelConstraints:_,groupSize:f,layout:S,separatorToPanels:D}),e.separators.forEach(C=>{Le(!o.has(C.id),`Separator ids must be unique; id "${C.id}" was used more than once`),o.add(C.id),C.element.addEventListener("keydown",wg)}),Ir.get(y)===1&&(y.addEventListener("dblclick",bg,!0),y.addEventListener("pointerdown",Cg,!0),y.addEventListener("pointerleave",Mg),y.addEventListener("pointermove",Rg),y.addEventListener("pointerout",Tg),y.addEventListener("pointerup",Ag,!0)),function(){i=!1,Ir.set(y,Math.max(0,(Ir.get(y)??0)-1)),a1(e),e.separators.forEach(C=>{C.element.removeEventListener("keydown",wg)}),Ir.get(y)||(y.removeEventListener("dblclick",bg,!0),y.removeEventListener("pointerdown",Cg,!0),y.removeEventListener("pointerleave",Mg),y.removeEventListener("pointermove",Rg),y.removeEventListener("pointerout",Tg),y.removeEventListener("pointerup",Ag,!0)),c.disconnect()}}function k1(){const[e,i]=ge.useState({}),n=ge.useCallback(()=>i({}),[]);return[e,n]}function Vu(e){const i=ge.useId();return`${e??i}`}const or=typeof window<"u"?ge.useLayoutEffect:ge.useEffect;function yl(e){const i=ge.useRef(e);return or(()=>{i.current=e},[e]),ge.useCallback((...n)=>{var l;return(l=i.current)==null?void 0:l.call(i,...n)},[i])}function Xu(...e){return yl(i=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(i);break}case"object":{n.current=i;break}}})})}function Gu(e){const i=ge.useRef({...e});return or(()=>{for(const n in e)i.current[n]=e[n]},[e]),i.current}const Xp=ge.createContext(null);function D1(e,i){const n=ge.useRef({getLayout:()=>({}),setLayout:S1});ge.useImperativeHandle(i,()=>n.current,[]),or(()=>{Object.assign(n.current,qp({groupId:e}))})}function Gp({children:e,className:i,defaultLayout:n,disableCursor:l,disabled:o,elementRef:c,groupRef:f,id:_,onLayoutChange:v,onLayoutChanged:d,orientation:m="horizontal",resizeTargetMinimumSize:S={coarse:20,fine:10},style:y,...D}){const C=ge.useRef({onLayoutChange:{},onLayoutChanged:{}}),E=yl(ie=>{tr(C.current.onLayoutChange,ie)||(C.current.onLayoutChange=ie,v==null||v(ie))}),B=yl(ie=>{tr(C.current.onLayoutChanged,ie)||(C.current.onLayoutChanged=ie,d==null||d(ie))}),z=Vu(_),Q=ge.useRef(null),[X,q]=k1(),L=ge.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:S,separators:[]}),ee=Xu(Q,c);D1(z,f);const le=yl((ie,V)=>{const N=sr(),$=pg(ie),G=Ms(ie);if(G){let k=!1;switch(N.state){case"active":{k=N.hitRegions.some(U=>U.group===$);break}}return{flexGrow:G.layout[V]??1,pointerEvents:k?"none":void 0}}return{flexGrow:(n==null?void 0:n[V])??1}}),de=Gu({defaultLayout:n,disableCursor:l}),Te=ge.useMemo(()=>({get disableCursor(){return!!de.disableCursor},getPanelStyles:le,id:z,orientation:m,registerPanel:ie=>{const V=L.current;return V.panels=eu(m,[...V.panels,ie]),q(),()=>{V.panels=V.panels.filter(N=>N!==ie),q()}},registerSeparator:ie=>{const V=L.current;return V.separators=eu(m,[...V.separators,ie]),q(),()=>{V.separators=V.separators.filter(N=>N!==ie),q()}},togglePanelDisabled:(ie,V)=>{const N=L.current.panels.find(k=>k.id===ie);N&&(N.panelConstraints.disabled=V);const $=pg(z),G=Ms(z);$&&G&&$i($,{...G,derivedPanelConstraints:Jc($)})},toggleSeparatorDisabled:(ie,V)=>{const N=L.current.separators.find($=>$.id===ie);N&&(N.disabled=V)}}),[le,z,q,m,de]),Qe=ge.useRef(null);return or(()=>{const ie=Q.current;if(ie===null)return;const V=L.current;let N;if(de.defaultLayout!==void 0&&Object.keys(de.defaultLayout).length===V.panels.length){N={};for(const w of V.panels){const j=de.defaultLayout[w.id];j!==void 0&&(N[w.id]=j)}}const $={disabled:!!o,element:ie,id:z,mutableState:{defaultLayout:N,disableCursor:!!de.disableCursor,expandedPanelSizes:L.current.lastExpandedPanelSizes,layouts:L.current.layouts},orientation:m,panels:V.panels,resizeTargetMinimumSize:V.resizeTargetMinimumSize,separators:V.separators};Qe.current=$;const G=E1($),{defaultLayoutDeferred:k,derivedPanelConstraints:U,layout:H}=Ms($.id,!0);!k&&U.length>0&&(E(H),B(H));const oe=ju(z,w=>{const{defaultLayoutDeferred:j,derivedPanelConstraints:J,layout:F}=w.next;if(j||J.length===0)return;const se=$.panels.map(({id:re})=>re).join(",");$.mutableState.layouts[se]=F,J.forEach(re=>{if(re.collapsible){const{layout:Ue}=w.prev??{};if(Ue){const De=Tt(re.collapsedSize,F[re.panelId]),st=Tt(re.collapsedSize,Ue[re.panelId]);De&&!st&&($.mutableState.expandedPanelSizes[re.panelId]=Ue[re.panelId])}}});const _e=sr().state!=="active";E(F),_e&&B(F)});return()=>{Qe.current=null,G(),oe()}},[o,z,B,E,m,X,de]),ge.useEffect(()=>{const ie=Qe.current;ie&&(ie.mutableState.defaultLayout=n,ie.mutableState.disableCursor=!!l)}),Z.jsx(Xp.Provider,{value:Te,children:Z.jsx("div",{...D,className:i,"data-group":!0,"data-testid":z,id:z,ref:ee,style:{height:"100%",width:"100%",overflow:"hidden",...y,display:"flex",flexDirection:m==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:m==="horizontal"?"pan-y":"pan-x"},children:e})})}Gp.displayName="Group";function $u(){const e=ge.useContext(Xp);return Le(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function M1(e,i){const{id:n}=$u(),l=ge.useRef({collapse:Uc,expand:Uc,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Uc});ge.useImperativeHandle(i,()=>l.current,[]),or(()=>{Object.assign(l.current,Pp({groupId:n,panelId:e}))})}function tu({children:e,className:i,collapsedSize:n="0%",collapsible:l=!1,defaultSize:o,disabled:c,elementRef:f,groupResizeBehavior:_="preserve-relative-size",id:v,maxSize:d="100%",minSize:m="0%",onResize:S,panelRef:y,style:D,...C}){const E=!!v,B=Vu(v),z=Gu({disabled:c}),Q=ge.useRef(null),X=Xu(Q,f),{getPanelStyles:q,id:L,orientation:ee,registerPanel:le,togglePanelDisabled:de}=$u(),Te=S!==null,Qe=yl((V,N,$)=>{S==null||S(V,v,$)});or(()=>{const V=Q.current;if(V!==null){const N={element:V,id:B,idIsStable:E,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:Te?Qe:void 0,panelConstraints:{groupResizeBehavior:_,collapsedSize:n,collapsible:l,defaultSize:o,disabled:z.disabled,maxSize:d,minSize:m}};return le(N)}},[_,n,l,o,Te,B,E,d,m,Qe,le,z]),ge.useEffect(()=>{de(B,!!c)},[c,B,de]),M1(B,y);const ie=ge.useSyncExternalStore(V=>ju(L,V),()=>JSON.stringify(q(L,B)),()=>JSON.stringify(q(L,B)));return Z.jsx("div",{...C,"aria-disabled":c||void 0,"data-panel":!0,"data-testid":B,id:B,ref:X,style:{...R1,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(ie)},children:Z.jsx("div",{className:i,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...D,touchAction:ee==="horizontal"?"pan-y":"pan-x"},children:e})})}tu.displayName="Panel";const R1={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function T1({layout:e,panelConstraints:i,panelId:n,panelIndex:l}){let o,c;const f=e[n],_=i.find(v=>v.panelId===n);if(_){const v=_.maxSize,d=_.collapsible?_.collapsedSize:_.minSize,m=[l,l+1];c=ir({layout:wl({delta:d-f,initialLayout:e,panelConstraints:i,pivotIndices:m,prevLayout:e}),panelConstraints:i})[n],o=ir({layout:wl({delta:v-f,initialLayout:e,panelConstraints:i,pivotIndices:m,prevLayout:e}),panelConstraints:i})[n]}return{valueControls:n,valueMax:o,valueMin:c,valueNow:f}}function $p({children:e,className:i,disabled:n,elementRef:l,id:o,style:c,...f}){const _=Vu(o),v=Gu({disabled:n}),[d,m]=ge.useState({}),[S,y]=ge.useState("inactive"),D=ge.useRef(null),C=Xu(D,l),{disableCursor:E,id:B,orientation:z,registerSeparator:Q,toggleSeparatorDisabled:X}=$u(),q=z==="horizontal"?"vertical":"horizontal";or(()=>{const ee=D.current;if(ee!==null){const le={disabled:v.disabled,element:ee,id:_},de=Q(le),Te=p1(ie=>{y(ie.next.state!=="inactive"&&ie.next.hitRegions.some(V=>V.separator===le)?ie.next.state:"inactive")}),Qe=ju(B,ie=>{const{derivedPanelConstraints:V,layout:N,separatorToPanels:$}=ie.next,G=$.get(le);if(G){const k=G[0],U=G.indexOf(k);m(T1({layout:N,panelConstraints:V,panelId:k.id,panelIndex:U}))}});return()=>{Te(),Qe(),de()}}},[B,_,Q,v]),ge.useEffect(()=>{X(_,!!n)},[n,_,X]);let L;return n&&!E&&(L="not-allowed"),Z.jsx("div",{...f,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":q,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:i,"data-separator":n?"disabled":S,"data-testid":_,id:_,ref:C,role:"separator",style:{flexBasis:"auto",cursor:L,...c,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}$p.displayName="Separator";/**
|
|
105
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
106
|
+
* @license MIT
|
|
107
|
+
*
|
|
108
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
109
|
+
* @license MIT
|
|
110
|
+
*
|
|
111
|
+
* Originally forked from (with the author's permission):
|
|
112
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
113
|
+
* http://bellard.org/jslinux/
|
|
114
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
115
|
+
*/var Fp=Object.defineProperty,A1=Object.getOwnPropertyDescriptor,B1=(e,i)=>{for(var n in i)Fp(e,n,{get:i[n],enumerable:!0})},$e=(e,i,n,l)=>{for(var o=l>1?void 0:l?A1(i,n):i,c=e.length-1,f;c>=0;c--)(f=e[c])&&(o=(l?f(i,n,o):f(o))||o);return l&&o&&Fp(i,n,o),o},te=(e,i)=>(n,l)=>i(n,l,e),Og="Terminal input",iu={get:()=>Og,set:e=>Og=e},zg="Too much output to announce, navigate to rows manually to read",su={get:()=>zg,set:e=>zg=e};function O1(e){return e.replace(/\r?\n/g,"\r")}function z1(e,i){return i?"\x1B[200~"+e+"\x1B[201~":e}function L1(e,i){e.clipboardData&&e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault()}function N1(e,i,n,l){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");Ip(o,i,n,l)}}function Ip(e,i,n,l){e=O1(e),e=z1(e,n.decPrivateModes.bracketedPasteMode&&l.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),i.value=""}function Zp(e,i,n){let l=n.getBoundingClientRect(),o=e.clientX-l.left-10,c=e.clientY-l.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${o}px`,i.style.top=`${c}px`,i.style.zIndex="1000",i.focus()}function Lg(e,i,n,l,o){Zp(e,i,n),o&&l.rightClickSelect(e),i.value=l.selectionText,i.select()}function Es(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function po(e,i=0,n=e.length){let l="";for(let o=i;o<n;++o){let c=e[o];c>65535?(c-=65536,l+=String.fromCharCode((c>>10)+55296)+String.fromCharCode(c%1024+56320)):l+=String.fromCharCode(c)}return l}var H1=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let n=e.length;if(!n)return 0;let l=0,o=0;if(this._interim){let c=e.charCodeAt(o++);56320<=c&&c<=57343?i[l++]=(this._interim-55296)*1024+c-56320+65536:(i[l++]=this._interim,i[l++]=c),this._interim=0}for(let c=o;c<n;++c){let f=e.charCodeAt(c);if(55296<=f&&f<=56319){if(++c>=n)return this._interim=f,l;let _=e.charCodeAt(c);56320<=_&&_<=57343?i[l++]=(f-55296)*1024+_-56320+65536:(i[l++]=f,i[l++]=_);continue}f!==65279&&(i[l++]=f)}return l}},U1=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let n=e.length;if(!n)return 0;let l=0,o,c,f,_,v=0,d=0;if(this.interim[0]){let y=!1,D=this.interim[0];D&=(D&224)===192?31:(D&240)===224?15:7;let C=0,E;for(;(E=this.interim[++C]&63)&&C<4;)D<<=6,D|=E;let B=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,z=B-C;for(;d<z;){if(d>=n)return 0;if(E=e[d++],(E&192)!==128){d--,y=!0;break}else this.interim[C++]=E,D<<=6,D|=E&63}y||(B===2?D<128?d--:i[l++]=D:B===3?D<2048||D>=55296&&D<=57343||D===65279||(i[l++]=D):D<65536||D>1114111||(i[l++]=D)),this.interim.fill(0)}let m=n-4,S=d;for(;S<n;){for(;S<m&&!((o=e[S])&128)&&!((c=e[S+1])&128)&&!((f=e[S+2])&128)&&!((_=e[S+3])&128);)i[l++]=o,i[l++]=c,i[l++]=f,i[l++]=_,S+=4;if(o=e[S++],o<128)i[l++]=o;else if((o&224)===192){if(S>=n)return this.interim[0]=o,l;if(c=e[S++],(c&192)!==128){S--;continue}if(v=(o&31)<<6|c&63,v<128){S--;continue}i[l++]=v}else if((o&240)===224){if(S>=n)return this.interim[0]=o,l;if(c=e[S++],(c&192)!==128){S--;continue}if(S>=n)return this.interim[0]=o,this.interim[1]=c,l;if(f=e[S++],(f&192)!==128){S--;continue}if(v=(o&15)<<12|(c&63)<<6|f&63,v<2048||v>=55296&&v<=57343||v===65279)continue;i[l++]=v}else if((o&248)===240){if(S>=n)return this.interim[0]=o,l;if(c=e[S++],(c&192)!==128){S--;continue}if(S>=n)return this.interim[0]=o,this.interim[1]=c,l;if(f=e[S++],(f&192)!==128){S--;continue}if(S>=n)return this.interim[0]=o,this.interim[1]=c,this.interim[2]=f,l;if(_=e[S++],(_&192)!==128){S--;continue}if(v=(o&7)<<18|(c&63)<<12|(f&63)<<6|_&63,v<65536||v>1114111)continue;i[l++]=v}}return l}},Qp="",Ds=" ",kl=class Jp{constructor(){this.fg=0,this.bg=0,this.extended=new ho}static toColorRGB(i){return[i>>>16&255,i>>>8&255,i&255]}static fromColorRGB(i){return(i[0]&255)<<16|(i[1]&255)<<8|i[2]&255}clone(){let i=new Jp;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}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}},ho=class em{constructor(i=0,n=0){this._ext=0,this._urlId=0,this._ext=i,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(i){this._ext=i}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(i){this._ext&=-469762049,this._ext|=i<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(i){this._ext&=-67108864,this._ext|=i&67108863}get urlId(){return this._urlId}set urlId(i){this._urlId=i}get underlineVariantOffset(){let i=(this._ext&3758096384)>>29;return i<0?i^4294967288:i}set underlineVariantOffset(i){this._ext&=536870911,this._ext|=i<<29&3758096384}clone(){return new em(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},ui=class tm extends kl{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ho,this.combinedData=""}static fromCharData(i){let n=new tm;return n.setFromCharData(i),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Es(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(i){this.fg=i[0],this.bg=0;let n=!1;if(i[1].length>2)n=!0;else if(i[1].length===2){let l=i[1].charCodeAt(0);if(55296<=l&&l<=56319){let o=i[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(l-55296)*1024+o-56320+65536|i[2]<<22:n=!0}else n=!0}else this.content=i[1].charCodeAt(0)|i[2]<<22;n&&(this.combinedData=i[1],this.content=2097152|i[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Ng="di$target",ru="di$dependencies",Pc=new Map;function P1(e){return e[ru]||[]}function pt(e){if(Pc.has(e))return Pc.get(e);let i=function(n,l,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");q1(i,n,o)};return i._id=e,Pc.set(e,i),i}function q1(e,i,n){i[Ng]===i?i[ru].push({id:e,index:n}):(i[ru]=[{id:e,index:n}],i[Ng]=i)}var At=pt("BufferService"),im=pt("CoreMouseService"),hr=pt("CoreService"),j1=pt("CharsetService"),Fu=pt("InstantiationService"),sm=pt("LogService"),Bt=pt("OptionsService"),rm=pt("OscLinkService"),W1=pt("UnicodeService"),Dl=pt("DecorationService"),nu=class{constructor(e,i,n){this._bufferService=e,this._optionsService=i,this._oscLinkService=n}provideLinks(e,i){var m;let n=this._bufferService.buffer.lines.get(e-1);if(!n){i(void 0);return}let l=[],o=this._optionsService.rawOptions.linkHandler,c=new ui,f=n.getTrimmedLength(),_=-1,v=-1,d=!1;for(let S=0;S<f;S++)if(!(v===-1&&!n.hasContent(S))){if(n.loadCell(S,c),c.hasExtendedAttrs()&&c.extended.urlId)if(v===-1){v=S,_=c.extended.urlId;continue}else d=c.extended.urlId!==_;else v!==-1&&(d=!0);if(d||v!==-1&&S===f-1){let y=(m=this._oscLinkService.getLinkData(_))==null?void 0:m.uri;if(y){let D={start:{x:v+1,y:e},end:{x:S+(!d&&S===f-1?1:0),y:e}},C=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{let E=new URL(y);["http:","https:"].includes(E.protocol)||(C=!0)}catch{C=!0}C||l.push({text:y,range:D,activate:(E,B)=>o?o.activate(E,B,D):Y1(E,B),hover:(E,B)=>{var z;return(z=o==null?void 0:o.hover)==null?void 0:z.call(o,E,B,D)},leave:(E,B)=>{var z;return(z=o==null?void 0:o.leave)==null?void 0:z.call(o,E,B,D)}})}d=!1,c.hasExtendedAttrs()&&c.extended.urlId?(v=S,_=c.extended.urlId):(v=-1,_=-1)}}i(l)}};nu=$e([te(0,At),te(1,Bt),te(2,rm)],nu);function Y1(e,i){if(confirm(`Do you want to navigate to ${i}?
|
|
116
|
+
|
|
117
|
+
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}var mo=pt("CharSizeService"),Fi=pt("CoreBrowserService"),Iu=pt("MouseService"),Ii=pt("RenderService"),K1=pt("SelectionService"),nm=pt("CharacterJoinerService"),an=pt("ThemeService"),lm=pt("LinkProviderService"),V1=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Hg.isErrorNoTelemetry(e)?new Hg(e.message+`
|
|
118
|
+
|
|
119
|
+
`+e.stack):new Error(e.message+`
|
|
120
|
+
|
|
121
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(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)}},X1=new V1;function io(e){G1(e)||X1.onUnexpectedError(e)}var lu="Canceled";function G1(e){return e instanceof $1?!0:e instanceof Error&&e.name===lu&&e.message===lu}var $1=class extends Error{constructor(){super(lu),this.name=this.message}};function F1(e){return new Error(`Illegal argument: ${e}`)}var Hg=class au extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof au)return i;let n=new au;return n.message=i.message,n.stack=i.stack,n}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}},ou=class am extends Error{constructor(i){super(i||"An unexpected bug occurred."),Object.setPrototypeOf(this,am.prototype)}};function Ft(e,i=0){return e[e.length-(1+i)]}var I1;(e=>{function i(c){return c<0}e.isLessThan=i;function n(c){return c<=0}e.isLessThanOrEqual=n;function l(c){return c>0}e.isGreaterThan=l;function o(c){return c===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(I1||(I1={}));function Z1(e,i){let n=this,l=!1,o;return function(){return l||(l=!0,i||(o=e.apply(n,arguments))),o}}var om;(e=>{function i(q){return q&&typeof q=="object"&&typeof q[Symbol.iterator]=="function"}e.is=i;let n=Object.freeze([]);function l(){return n}e.empty=l;function*o(q){yield q}e.single=o;function c(q){return i(q)?q:o(q)}e.wrap=c;function f(q){return q||n}e.from=f;function*_(q){for(let L=q.length-1;L>=0;L--)yield q[L]}e.reverse=_;function v(q){return!q||q[Symbol.iterator]().next().done===!0}e.isEmpty=v;function d(q){return q[Symbol.iterator]().next().value}e.first=d;function m(q,L){let ee=0;for(let le of q)if(L(le,ee++))return!0;return!1}e.some=m;function S(q,L){for(let ee of q)if(L(ee))return ee}e.find=S;function*y(q,L){for(let ee of q)L(ee)&&(yield ee)}e.filter=y;function*D(q,L){let ee=0;for(let le of q)yield L(le,ee++)}e.map=D;function*C(q,L){let ee=0;for(let le of q)yield*L(le,ee++)}e.flatMap=C;function*E(...q){for(let L of q)yield*L}e.concat=E;function B(q,L,ee){let le=ee;for(let de of q)le=L(le,de);return le}e.reduce=B;function*z(q,L,ee=q.length){for(L<0&&(L+=q.length),ee<0?ee+=q.length:ee>q.length&&(ee=q.length);L<ee;L++)yield q[L]}e.slice=z;function Q(q,L=Number.POSITIVE_INFINITY){let ee=[];if(L===0)return[ee,q];let le=q[Symbol.iterator]();for(let de=0;de<L;de++){let Te=le.next();if(Te.done)return[ee,e.empty()];ee.push(Te.value)}return[ee,{[Symbol.iterator](){return le}}]}e.consume=Q;async function X(q){let L=[];for await(let ee of q)L.push(ee);return Promise.resolve(L)}e.asyncToArray=X})(om||(om={}));function rr(e){if(om.is(e)){let i=[];for(let n of e)if(n)try{n.dispose()}catch(l){i.push(l)}if(i.length===1)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Q1(...e){return je(()=>rr(e))}function je(e){return{dispose:Z1(()=>{e()})}}var hm=class cm{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{rr(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?cm.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(i),i}delete(i){if(i){if(i===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(i),i.dispose()}}deleteAndLeak(i){i&&this._toDispose.has(i)&&(this._toDispose.delete(i),void 0)}};hm.DISABLE_DISPOSED_WARNING=!1;var Rs=hm,Se=class{constructor(){this._store=new Rs,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)}};Se.None=Object.freeze({dispose(){}});var ln=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var i;this._isDisposed||e===this._value||((i=this._value)==null||i.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}},Gi=typeof window=="object"?window:globalThis,hu=class cu{constructor(i){this.element=i,this.next=cu.Undefined,this.prev=cu.Undefined}};hu.Undefined=new hu(void 0);var Ye=hu,Ug=class{constructor(){this._first=Ye.Undefined,this._last=Ye.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ye.Undefined}clear(){let e=this._first;for(;e!==Ye.Undefined;){let i=e.next;e.prev=Ye.Undefined,e.next=Ye.Undefined,e=i}this._first=Ye.Undefined,this._last=Ye.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let n=new Ye(e);if(this._first===Ye.Undefined)this._first=n,this._last=n;else if(i){let o=this._last;this._last=n,n.prev=o,o.next=n}else{let o=this._first;this._first=n,n.next=o,o.prev=n}this._size+=1;let l=!1;return()=>{l||(l=!0,this._remove(n))}}shift(){if(this._first!==Ye.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ye.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ye.Undefined&&e.next!==Ye.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===Ye.Undefined&&e.next===Ye.Undefined?(this._first=Ye.Undefined,this._last=Ye.Undefined):e.next===Ye.Undefined?(this._last=this._last.prev,this._last.next=Ye.Undefined):e.prev===Ye.Undefined&&(this._first=this._first.next,this._first.prev=Ye.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ye.Undefined;)yield e.element,e=e.next}},J1=globalThis.performance&&typeof globalThis.performance.now=="function",eb=class um{static create(i){return new um(i)}constructor(i){this._now=J1&&i===!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}},wt;(e=>{e.None=()=>Se.None;function i(V,N){return S(V,()=>{},0,void 0,!0,void 0,N)}e.defer=i;function n(V){return(N,$=null,G)=>{let k=!1,U;return U=V(H=>{if(!k)return U?U.dispose():k=!0,N.call($,H)},null,G),k&&U.dispose(),U}}e.once=n;function l(V,N,$){return d((G,k=null,U)=>V(H=>G.call(k,N(H)),null,U),$)}e.map=l;function o(V,N,$){return d((G,k=null,U)=>V(H=>{N(H),G.call(k,H)},null,U),$)}e.forEach=o;function c(V,N,$){return d((G,k=null,U)=>V(H=>N(H)&&G.call(k,H),null,U),$)}e.filter=c;function f(V){return V}e.signal=f;function _(...V){return(N,$=null,G)=>{let k=Q1(...V.map(U=>U(H=>N.call($,H))));return m(k,G)}}e.any=_;function v(V,N,$,G){let k=$;return l(V,U=>(k=N(k,U),k),G)}e.reduce=v;function d(V,N){let $,G={onWillAddFirstListener(){$=V(k.fire,k)},onDidRemoveLastListener(){$==null||$.dispose()}},k=new I(G);return N==null||N.add(k),k.event}function m(V,N){return N instanceof Array?N.push(V):N&&N.add(V),V}function S(V,N,$=100,G=!1,k=!1,U,H){let oe,w,j,J=0,F,se={leakWarningThreshold:U,onWillAddFirstListener(){oe=V(re=>{J++,w=N(w,re),G&&!j&&(_e.fire(w),w=void 0),F=()=>{let Ue=w;w=void 0,j=void 0,(!G||J>1)&&_e.fire(Ue),J=0},typeof $=="number"?(clearTimeout(j),j=setTimeout(F,$)):j===void 0&&(j=0,queueMicrotask(F))})},onWillRemoveListener(){k&&J>0&&(F==null||F())},onDidRemoveLastListener(){F=void 0,oe.dispose()}},_e=new I(se);return H==null||H.add(_e),_e.event}e.debounce=S;function y(V,N=0,$){return e.debounce(V,(G,k)=>G?(G.push(k),G):[k],N,void 0,!0,void 0,$)}e.accumulate=y;function D(V,N=(G,k)=>G===k,$){let G=!0,k;return c(V,U=>{let H=G||!N(U,k);return G=!1,k=U,H},$)}e.latch=D;function C(V,N,$){return[e.filter(V,N,$),e.filter(V,G=>!N(G),$)]}e.split=C;function E(V,N=!1,$=[],G){let k=$.slice(),U=V(w=>{k?k.push(w):oe.fire(w)});G&&G.add(U);let H=()=>{k==null||k.forEach(w=>oe.fire(w)),k=null},oe=new I({onWillAddFirstListener(){U||(U=V(w=>oe.fire(w)),G&&G.add(U))},onDidAddFirstListener(){k&&(N?setTimeout(H):H())},onDidRemoveLastListener(){U&&U.dispose(),U=null}});return G&&G.add(oe),oe.event}e.buffer=E;function B(V,N){return($,G,k)=>{let U=N(new Q);return V(function(H){let oe=U.evaluate(H);oe!==z&&$.call(G,oe)},void 0,k)}}e.chain=B;let z=Symbol("HaltChainable");class Q{constructor(){this.steps=[]}map(N){return this.steps.push(N),this}forEach(N){return this.steps.push($=>(N($),$)),this}filter(N){return this.steps.push($=>N($)?$:z),this}reduce(N,$){let G=$;return this.steps.push(k=>(G=N(G,k),G)),this}latch(N=($,G)=>$===G){let $=!0,G;return this.steps.push(k=>{let U=$||!N(k,G);return $=!1,G=k,U?k:z}),this}evaluate(N){for(let $ of this.steps)if(N=$(N),N===z)break;return N}}function X(V,N,$=G=>G){let G=(...oe)=>H.fire($(...oe)),k=()=>V.on(N,G),U=()=>V.removeListener(N,G),H=new I({onWillAddFirstListener:k,onDidRemoveLastListener:U});return H.event}e.fromNodeEventEmitter=X;function q(V,N,$=G=>G){let G=(...oe)=>H.fire($(...oe)),k=()=>V.addEventListener(N,G),U=()=>V.removeEventListener(N,G),H=new I({onWillAddFirstListener:k,onDidRemoveLastListener:U});return H.event}e.fromDOMEventEmitter=q;function L(V){return new Promise(N=>n(V)(N))}e.toPromise=L;function ee(V){let N=new I;return V.then($=>{N.fire($)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}e.fromPromise=ee;function le(V,N){return V($=>N.fire($))}e.forward=le;function de(V,N,$){return N($),V(G=>N(G))}e.runAndSubscribe=de;class Te{constructor(N,$){this._observable=N,this._counter=0,this._hasChanged=!1;let G={onWillAddFirstListener:()=>{N.addObserver(this)},onDidRemoveLastListener:()=>{N.removeObserver(this)}};this.emitter=new I(G),$&&$.add(this.emitter)}beginUpdate(N){this._counter++}handlePossibleChange(N){}handleChange(N,$){this._hasChanged=!0}endUpdate(N){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Qe(V,N){return new Te(V,N).emitter.event}e.fromObservable=Qe;function ie(V){return(N,$,G)=>{let k=0,U=!1,H={beginUpdate(){k++},endUpdate(){k--,k===0&&(V.reportChanges(),U&&(U=!1,N.call($)))},handlePossibleChange(){},handleChange(){U=!0}};V.addObserver(H),V.reportChanges();let oe={dispose(){V.removeObserver(H)}};return G instanceof Rs?G.add(oe):Array.isArray(G)&&G.push(oe),oe}}e.fromObservableLight=ie})(wt||(wt={}));var uu=class fu{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${fu._idPool++}`,fu.all.add(this)}start(i){this._stopWatch=new eb,this.listenerCount=i}stop(){if(this._stopWatch){let i=this._stopWatch.elapsed();this.durations.push(i),this.elapsedOverall+=i,this.invocationCount+=1,this._stopWatch=void 0}}};uu.all=new Set,uu._idPool=0;var tb=uu,ib=-1,fm=class dm{constructor(i,n,l=(dm._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=n,this.name=l,this._warnCountdown=0}dispose(){var i;(i=this._stacks)==null||i.clear()}check(i,n){let l=this.threshold;if(l<=0||n<l)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(i.value)||0;if(this._stacks.set(i.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=l*.5;let[c,f]=this.getMostFrequentStack(),_=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${f}):`;console.warn(_),console.warn(c);let v=new nb(_,c);this._errorHandler(v)}return()=>{let c=this._stacks.get(i.value)||0;this._stacks.set(i.value,c-1)}}getMostFrequentStack(){if(!this._stacks)return;let i,n=0;for(let[l,o]of this._stacks)(!i||n<o)&&(i=[l,o],n=o);return i}};fm._idPool=1;var sb=fm,rb=class _m{constructor(i){this.value=i}static create(){let i=new Error;return new _m(i.stack??"")}print(){console.warn(this.value.split(`
|
|
122
|
+
`).slice(2).join(`
|
|
123
|
+
`))}},nb=class extends Error{constructor(e,i){super(e),this.name="ListenerLeakError",this.stack=i}},lb=class extends Error{constructor(e,i){super(e),this.name="ListenerRefusalError",this.stack=i}},ab=0,qc=class{constructor(e){this.value=e,this.id=ab++}},ob=2,hb,I=class{constructor(i){var n,l,o,c;this._size=0,this._options=i,this._leakageMon=(n=this._options)!=null&&n.leakWarningThreshold?new sb((i==null?void 0:i.onListenerError)??io,((l=this._options)==null?void 0:l.leakWarningThreshold)??ib):void 0,this._perfMon=(o=this._options)!=null&&o._profName?new tb(this._options._profName):void 0,this._deliveryQueue=(c=this._options)==null?void 0:c.deliveryQueue}dispose(){var i,n,l,o;this._disposed||(this._disposed=!0,((i=this._deliveryQueue)==null?void 0:i.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(l=(n=this._options)==null?void 0:n.onDidRemoveLastListener)==null||l.call(n),(o=this._leakageMon)==null||o.dispose())}get event(){return this._event??(this._event=(i,n,l)=>{var _,v,d,m,S;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let y=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(y);let D=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],C=new lb(`${y}. HINT: Stack shows most frequent listener (${D[1]}-times)`,D[0]);return(((_=this._options)==null?void 0:_.onListenerError)||io)(C),Se.None}if(this._disposed)return Se.None;n&&(i=i.bind(n));let o=new qc(i),c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=rb.create(),c=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof qc?(this._deliveryQueue??(this._deliveryQueue=new cb),this._listeners=[this._listeners,o]):this._listeners.push(o):((d=(v=this._options)==null?void 0:v.onWillAddFirstListener)==null||d.call(v,this),this._listeners=o,(S=(m=this._options)==null?void 0:m.onDidAddFirstListener)==null||S.call(m,this)),this._size++;let f=je(()=>{c==null||c(),this._removeListener(o)});return l instanceof Rs?l.add(f):Array.isArray(l)&&l.push(f),f}),this._event}_removeListener(i){var c,f,_,v;if((f=(c=this._options)==null?void 0:c.onWillRemoveListener)==null||f.call(c,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(v=(_=this._options)==null?void 0:_.onDidRemoveLastListener)==null||v.call(_,this),this._size=0;return}let n=this._listeners,l=n.indexOf(i);if(l===-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--,n[l]=void 0;let o=this._deliveryQueue.current===this;if(this._size*ob<=n.length){let d=0;for(let m=0;m<n.length;m++)n[m]?n[d++]=n[m]:o&&(this._deliveryQueue.end--,d<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=d}}_deliver(i,n){var o;if(!i)return;let l=((o=this._options)==null?void 0:o.onListenerError)||io;if(!l){i.value(n);return}try{i.value(n)}catch(c){l(c)}}_deliverQueue(i){let n=i.current._listeners;for(;i.i<i.end;)this._deliver(n[i.i++],i.value);i.reset()}fire(i){var n,l,o,c;if((n=this._deliveryQueue)!=null&&n.current&&(this._deliverQueue(this._deliveryQueue),(l=this._perfMon)==null||l.stop()),(o=this._perfMon)==null||o.start(this._size),this._listeners)if(this._listeners instanceof qc)this._deliver(this._listeners,i);else{let f=this._deliveryQueue;f.enqueue(this,i,this._listeners.length),this._deliverQueue(f)}(c=this._perfMon)==null||c.stop()}hasListeners(){return this._size>0}},cb=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,n){this.i=0,this.end=n,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},du=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new I,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new I,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(i){return this.mapWindowIdToZoomLevel.get(this.getWindowId(i))??0}setZoomLevel(i,n){if(this.getZoomLevel(n)===i)return;let l=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(l,i),this._onDidChangeZoomLevel.fire(l)}getZoomFactor(i){return this.mapWindowIdToZoomFactor.get(this.getWindowId(i))??1}setZoomFactor(i,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),i)}setFullscreen(i,n){if(this.isFullscreen(n)===i)return;let l=this.getWindowId(n);this.mapWindowIdToFullScreen.set(l,i),this._onDidChangeFullscreen.fire(l)}isFullscreen(i){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(i))}getWindowId(i){return i.vscodeWindowId}};du.INSTANCE=new du;var Zu=du;function ub(e,i,n){typeof i=="string"&&(i=e.matchMedia(i)),i.addEventListener("change",n)}Zu.INSTANCE.onDidChangeZoomLevel;function fb(e){return Zu.INSTANCE.getZoomFactor(e)}Zu.INSTANCE.onDidChangeFullscreen;var on=typeof navigator=="object"?navigator.userAgent:"",_u=on.indexOf("Firefox")>=0,db=on.indexOf("AppleWebKit")>=0,Qu=on.indexOf("Chrome")>=0,_b=!Qu&&on.indexOf("Safari")>=0;on.indexOf("Electron/")>=0;on.indexOf("Android")>=0;var jc=!1;if(typeof Gi.matchMedia=="function"){let e=Gi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),i=Gi.matchMedia("(display-mode: fullscreen)");jc=e.matches,ub(Gi,e,({matches:n})=>{jc&&i.matches||(jc=n)})}var tn="en",vu=!1,gu=!1,so=!1,vm=!1,$a,ro=tn,Pg=tn,vb,vi,er=globalThis,bt,Rp;typeof er.vscode<"u"&&typeof er.vscode.process<"u"?bt=er.vscode.process:typeof process<"u"&&typeof((Rp=process==null?void 0:process.versions)==null?void 0:Rp.node)=="string"&&(bt=process);var Tp,gb=typeof((Tp=bt==null?void 0:bt.versions)==null?void 0:Tp.electron)=="string",pb=gb&&(bt==null?void 0:bt.type)==="renderer",Ap;if(typeof bt=="object"){vu=bt.platform==="win32",gu=bt.platform==="darwin",so=bt.platform==="linux",so&&bt.env.SNAP&&bt.env.SNAP_REVISION,bt.env.CI||bt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,$a=tn,ro=tn;let e=bt.env.VSCODE_NLS_CONFIG;if(e)try{let i=JSON.parse(e);$a=i.userLocale,Pg=i.osLocale,ro=i.resolvedLanguage||tn,vb=(Ap=i.languagePack)==null?void 0:Ap.translationsConfigFile}catch{}vm=!0}else typeof navigator=="object"&&!pb?(vi=navigator.userAgent,vu=vi.indexOf("Windows")>=0,gu=vi.indexOf("Macintosh")>=0,(vi.indexOf("Macintosh")>=0||vi.indexOf("iPad")>=0||vi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,so=vi.indexOf("Linux")>=0,(vi==null?void 0:vi.indexOf("Mobi"))>=0,ro=globalThis._VSCODE_NLS_LANGUAGE||tn,$a=navigator.language.toLowerCase(),Pg=$a):console.error("Unable to resolve platform.");var gm=vu,Ri=gu,mb=so,qg=vm,Ti=vi,ws=ro,Sb;(e=>{function i(){return ws}e.value=i;function n(){return ws.length===2?ws==="en":ws.length>=3?ws[0]==="e"&&ws[1]==="n"&&ws[2]==="-":!1}e.isDefaultVariant=n;function l(){return ws==="en"}e.isDefault=l})(Sb||(Sb={}));var yb=typeof er.postMessage=="function"&&!er.importScripts;(()=>{if(yb){let e=[];er.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let l=0,o=e.length;l<o;l++){let c=e[l];if(c.id===n.data.vscodeScheduleAsyncWork){e.splice(l,1),c.callback();return}}});let i=0;return n=>{let l=++i;e.push({id:l,callback:n}),er.postMessage({vscodeScheduleAsyncWork:l},"*")}}return e=>setTimeout(e)})();var bb=!!(Ti&&Ti.indexOf("Chrome")>=0);Ti&&Ti.indexOf("Firefox")>=0;!bb&&Ti&&Ti.indexOf("Safari")>=0;Ti&&Ti.indexOf("Edg/")>=0;Ti&&Ti.indexOf("Android")>=0;var Zr=typeof navigator=="object"?navigator:{};qg||document.queryCommandSupported&&document.queryCommandSupported("copy")||Zr&&Zr.clipboard&&Zr.clipboard.writeText,qg||Zr&&Zr.clipboard&&Zr.clipboard.readText;var Ju=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Wc=new Ju,jg=new Ju,Wg=new Ju,wb=new Array(230),pm;(e=>{function i(_){return Wc.keyCodeToStr(_)}e.toString=i;function n(_){return Wc.strToKeyCode(_)}e.fromString=n;function l(_){return jg.keyCodeToStr(_)}e.toUserSettingsUS=l;function o(_){return Wg.keyCodeToStr(_)}e.toUserSettingsGeneral=o;function c(_){return jg.strToKeyCode(_)||Wg.strToKeyCode(_)}e.fromUserSettings=c;function f(_){if(_>=98&&_<=113)return null;switch(_){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Wc.keyCodeToStr(_)}e.toElectronAccelerator=f})(pm||(pm={}));var Cb=class mm{constructor(i,n,l,o,c){this.ctrlKey=i,this.shiftKey=n,this.altKey=l,this.metaKey=o,this.keyCode=c}equals(i){return i instanceof mm&&this.ctrlKey===i.ctrlKey&&this.shiftKey===i.shiftKey&&this.altKey===i.altKey&&this.metaKey===i.metaKey&&this.keyCode===i.keyCode}getHashCode(){let i=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",l=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${i}${n}${l}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new xb([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},xb=class{constructor(e){if(e.length===0)throw F1("chords");this.chords=e}getHashCode(){let e="";for(let i=0,n=this.chords.length;i<n;i++)i!==0&&(e+=";"),e+=this.chords[i].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let i=0;i<this.chords.length;i++)if(!this.chords[i].equals(e.chords[i]))return!1;return!0}};function Eb(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return pm.fromString(n)}let i=e.keyCode;if(i===3)return 7;if(_u)switch(i){case 59:return 85;case 60:if(mb)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ri)return 57;break}else if(db&&(Ri&&i===93||!Ri&&i===92))return 57;return wb[i]||0}var kb=Ri?256:2048,Db=512,Mb=1024,Rb=Ri?2048:256,Yg=class{constructor(e){var n;this._standardKeyboardEventBrand=!0;let i=e;this.browserEvent=i,this.target=i.target,this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,this.altGraphKey=(n=i.getModifierState)==null?void 0:n.call(i,"AltGraph"),this.keyCode=Eb(i),this.code=i.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 i=0;return this.ctrlKey&&(i|=kb),this.altKey&&(i|=Db),this.shiftKey&&(i|=Mb),this.metaKey&&(i|=Rb),i|=e,i}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Cb(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Kg=new WeakMap;function Tb(e){if(!e.parent||e.parent===e)return null;try{let i=e.location,n=e.parent.location;if(i.origin!=="null"&&n.origin!=="null"&&i.origin!==n.origin)return null}catch{return null}return e.parent}var Ab=class{static getSameOriginWindowChain(e){let i=Kg.get(e);if(!i){i=[],Kg.set(e,i);let n=e,l;do l=Tb(n),l?i.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):i.push({window:new WeakRef(n),iframeElement:null}),n=l;while(n)}return i.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,i){if(!i||e===i)return{top:0,left:0};let n=0,l=0,o=this.getSameOriginWindowChain(e);for(let c of o){let f=c.window.deref();if(n+=(f==null?void 0:f.scrollY)??0,l+=(f==null?void 0:f.scrollX)??0,f===i||!c.iframeElement)break;let _=c.iframeElement.getBoundingClientRect();n+=_.top,l+=_.left}return{top:n,left:l}}},Fa=class{constructor(e,i){this.timestamp=Date.now(),this.browserEvent=i,this.leftButton=i.button===0,this.middleButton=i.button===1,this.rightButton=i.button===2,this.buttons=i.buttons,this.target=i.target,this.detail=i.detail||1,i.type==="dblclick"&&(this.detail=2),this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,typeof i.pageX=="number"?(this.posx=i.pageX,this.posy=i.pageY):(this.posx=i.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=i.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=Ab.getPositionOfChildWindowRelativeToAncestorWindow(e,i.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Vg=class{constructor(e,i=0,n=0){var o;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=i;let l=!1;if(Qu){let c=navigator.userAgent.match(/Chrome\/(\d+)/);l=(c?parseInt(c[1]):123)<=122}if(e){let c=e,f=e,_=((o=e.view)==null?void 0:o.devicePixelRatio)||1;if(typeof c.wheelDeltaY<"u")l?this.deltaY=c.wheelDeltaY/(120*_):this.deltaY=c.wheelDeltaY/120;else if(typeof f.VERTICAL_AXIS<"u"&&f.axis===f.VERTICAL_AXIS)this.deltaY=-f.detail/3;else if(e.type==="wheel"){let v=e;v.deltaMode===v.DOM_DELTA_LINE?_u&&!Ri?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof c.wheelDeltaX<"u")_b&&gm?this.deltaX=-(c.wheelDeltaX/120):l?this.deltaX=c.wheelDeltaX/(120*_):this.deltaX=c.wheelDeltaX/120;else if(typeof f.HORIZONTAL_AXIS<"u"&&f.axis===f.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let v=e;v.deltaMode===v.DOM_DELTA_LINE?_u&&!Ri?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(l?this.deltaY=e.wheelDelta/(120*_):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},Sm=Object.freeze(function(e,i){let n=setTimeout(e.bind(i),0);return{dispose(){clearTimeout(n)}}}),Bb;(e=>{function i(n){return n===e.None||n===e.Cancelled||n instanceof Ob?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=i,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:wt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Sm})})(Bb||(Bb={}));var Ob=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?Sm:(this._emitter||(this._emitter=new I),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},ef=class{constructor(e,i){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof i=="number"&&this.setIfNotSet(e,i)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,i){if(this._isDisposed)throw new ou("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},i)}setIfNotSet(e,i){if(this._isDisposed)throw new ou("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},i))}},zb=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,i,n=globalThis){if(this.isDisposed)throw new ou("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let l=n.setInterval(()=>{e()},i);this.disposable=je(()=>{n.clearInterval(l),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Lb;(e=>{async function i(l){let o,c=await Promise.all(l.map(f=>f.then(_=>_,_=>{o||(o=_)})));if(typeof o<"u")throw o;return c}e.settled=i;function n(l){return new Promise(async(o,c)=>{try{await l(o,c)}catch(f){c(f)}})}e.withAsyncBody=n})(Lb||(Lb={}));var Xg=class hi{static fromArray(i){return new hi(n=>{n.emitMany(i)})}static fromPromise(i){return new hi(async n=>{n.emitMany(await i)})}static fromPromises(i){return new hi(async n=>{await Promise.all(i.map(async l=>n.emitOne(await l)))})}static merge(i){return new hi(async n=>{await Promise.all(i.map(async l=>{for await(let o of l)n.emitOne(o)}))})}constructor(i,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new I,queueMicrotask(async()=>{let l={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(i(l)),this.resolve()}catch(o){this.reject(o)}finally{l.emitOne=void 0,l.emitMany=void 0,l.reject=void 0}})}[Symbol.asyncIterator](){let i=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(i<this._results.length)return{done:!1,value:this._results[i++]};if(this._state===1)return{done:!0,value:void 0};await wt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(i,n){return new hi(async l=>{for await(let o of i)l.emitOne(n(o))})}map(i){return hi.map(this,i)}static filter(i,n){return new hi(async l=>{for await(let o of i)n(o)&&l.emitOne(o)})}filter(i){return hi.filter(this,i)}static coalesce(i){return hi.filter(i,n=>!!n)}coalesce(){return hi.coalesce(this)}static async toPromise(i){let n=[];for await(let l of i)n.push(l);return n}toPromise(){return hi.toPromise(this)}emitOne(i){this._state===0&&(this._results.push(i),this._onStateChanged.fire())}emitMany(i){this._state===0&&(this._results=this._results.concat(i),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(i){this._state===0&&(this._state=2,this._error=i,this._onStateChanged.fire())}};Xg.EMPTY=Xg.fromArray([]);var{getWindow:Mi,getWindowId:Nb,onDidRegisterWindow:Hb}=(function(){let e=new Map,i={window:Gi,disposables:new Rs};e.set(Gi.vscodeWindowId,i);let n=new I,l=new I,o=new I;function c(f,_){return(typeof f=="number"?e.get(f):void 0)??(_?i:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:l.event,registerWindow(f){if(e.has(f.vscodeWindowId))return Se.None;let _=new Rs,v={window:f,disposables:_.add(new Rs)};return e.set(f.vscodeWindowId,v),_.add(je(()=>{e.delete(f.vscodeWindowId),l.fire(f)})),_.add(fe(f,dt.BEFORE_UNLOAD,()=>{o.fire(f)})),n.fire(v),_},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(f){return f.vscodeWindowId},hasWindow(f){return e.has(f)},getWindowById:c,getWindow(f){var d;let _=f;if((d=_==null?void 0:_.ownerDocument)!=null&&d.defaultView)return _.ownerDocument.defaultView.window;let v=f;return v!=null&&v.view?v.view.window:Gi},getDocument(f){return Mi(f).document}}})(),Ub=class{constructor(e,i,n,l){this._node=e,this._type=i,this._handler=n,this._options=l||!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 fe(e,i,n,l){return new Ub(e,i,n,l)}var Gg=function(e,i,n,l){return fe(e,i,n,l)},tf,Pb=class extends zb{constructor(e){super(),this.defaultTarget=e&&Mi(e)}cancelAndSet(e,i,n){return super.cancelAndSet(e,i,n??this.defaultTarget)}},$g=class{constructor(e,i=0){this._runner=e,this.priority=i,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){io(e)}}static sort(e,i){return i.priority-e.priority}};(function(){let e=new Map,i=new Map,n=new Map,l=new Map,o=c=>{n.set(c,!1);let f=e.get(c)??[];for(i.set(c,f),e.set(c,[]),l.set(c,!0);f.length>0;)f.sort($g.sort),f.shift().execute();l.set(c,!1)};tf=(c,f,_=0)=>{let v=Nb(c),d=new $g(f,_),m=e.get(v);return m||(m=[],e.set(v,m)),m.push(d),n.get(v)||(n.set(v,!0),c.requestAnimationFrame(()=>o(v))),d}})();function qb(e){let i=e.getBoundingClientRect(),n=Mi(e);return{left:i.left+n.scrollX,top:i.top+n.scrollY,width:i.width,height:i.height}}var dt={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"},jb=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 i=Ut(e);this._maxWidth!==i&&(this._maxWidth=i,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let i=Ut(e);this._width!==i&&(this._width=i,this.domNode.style.width=this._width)}setHeight(e){let i=Ut(e);this._height!==i&&(this._height=i,this.domNode.style.height=this._height)}setTop(e){let i=Ut(e);this._top!==i&&(this._top=i,this.domNode.style.top=this._top)}setLeft(e){let i=Ut(e);this._left!==i&&(this._left=i,this.domNode.style.left=this._left)}setBottom(e){let i=Ut(e);this._bottom!==i&&(this._bottom=i,this.domNode.style.bottom=this._bottom)}setRight(e){let i=Ut(e);this._right!==i&&(this._right=i,this.domNode.style.right=this._right)}setPaddingTop(e){let i=Ut(e);this._paddingTop!==i&&(this._paddingTop=i,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let i=Ut(e);this._paddingLeft!==i&&(this._paddingLeft=i,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let i=Ut(e);this._paddingBottom!==i&&(this._paddingBottom=i,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let i=Ut(e);this._paddingRight!==i&&(this._paddingRight=i,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 i=Ut(e);this._fontSize!==i&&(this._fontSize=i,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 i=Ut(e);this._lineHeight!==i&&(this._lineHeight=i,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let i=Ut(e);this._letterSpacing!==i&&(this._letterSpacing=i,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,i){this.domNode.classList.toggle(e,i),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,i){this.domNode.setAttribute(e,i)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Ut(e){return typeof e=="number"?`${e}px`:e}function bl(e){return new jb(e)}var ym=class{constructor(){this._hooks=new Rs,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,i){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(i)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,i,n,l,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=l,this._onStopCallback=o;let c=e;try{e.setPointerCapture(i),this._hooks.add(je(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{c=Mi(e)}this._hooks.add(fe(c,dt.POINTER_MOVE,f=>{if(f.buttons!==n){this.stopMonitoring(!0);return}f.preventDefault(),this._pointerMoveCallback(f)})),this._hooks.add(fe(c,dt.POINTER_UP,f=>this.stopMonitoring(!0)))}};function Wb(e,i,n){let l=null,o=null;if(typeof n.value=="function"?(l="value",o=n.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(l="get",o=n.get),!o)throw new Error("not supported");let c=`$memoize$${i}`;n[l]=function(...f){return this.hasOwnProperty(c)||Object.defineProperty(this,c,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,f)}),this[c]}}var Ei;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Ei||(Ei={}));var vl=class Dt extends Se{constructor(){super(),this.dispatched=!1,this.targets=new Ug,this.ignoreTargets=new Ug,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(wt.runAndSubscribe(Hb,({window:i,disposables:n})=>{n.add(fe(i.document,"touchstart",l=>this.onTouchStart(l),{passive:!1})),n.add(fe(i.document,"touchend",l=>this.onTouchEnd(i,l))),n.add(fe(i.document,"touchmove",l=>this.onTouchMove(l),{passive:!1}))},{window:Gi,disposables:this._store}))}static addTarget(i){if(!Dt.isTouchDevice())return Se.None;Dt.INSTANCE||(Dt.INSTANCE=new Dt);let n=Dt.INSTANCE.targets.push(i);return je(n)}static ignoreTarget(i){if(!Dt.isTouchDevice())return Se.None;Dt.INSTANCE||(Dt.INSTANCE=new Dt);let n=Dt.INSTANCE.ignoreTargets.push(i);return je(n)}static isTouchDevice(){return"ontouchstart"in Gi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(i){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let l=0,o=i.targetTouches.length;l<o;l++){let c=i.targetTouches.item(l);this.activeTouches[c.identifier]={id:c.identifier,initialTarget:c.target,initialTimeStamp:n,initialPageX:c.pageX,initialPageY:c.pageY,rollingTimestamps:[n],rollingPageX:[c.pageX],rollingPageY:[c.pageY]};let f=this.newGestureEvent(Ei.Start,c.target);f.pageX=c.pageX,f.pageY=c.pageY,this.dispatchEvent(f)}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}onTouchEnd(i,n){let l=Date.now(),o=Object.keys(this.activeTouches).length;for(let c=0,f=n.changedTouches.length;c<f;c++){let _=n.changedTouches.item(c);if(!this.activeTouches.hasOwnProperty(String(_.identifier))){console.warn("move of an UNKNOWN touch",_);continue}let v=this.activeTouches[_.identifier],d=Date.now()-v.initialTimeStamp;if(d<Dt.HOLD_DELAY&&Math.abs(v.initialPageX-Ft(v.rollingPageX))<30&&Math.abs(v.initialPageY-Ft(v.rollingPageY))<30){let m=this.newGestureEvent(Ei.Tap,v.initialTarget);m.pageX=Ft(v.rollingPageX),m.pageY=Ft(v.rollingPageY),this.dispatchEvent(m)}else if(d>=Dt.HOLD_DELAY&&Math.abs(v.initialPageX-Ft(v.rollingPageX))<30&&Math.abs(v.initialPageY-Ft(v.rollingPageY))<30){let m=this.newGestureEvent(Ei.Contextmenu,v.initialTarget);m.pageX=Ft(v.rollingPageX),m.pageY=Ft(v.rollingPageY),this.dispatchEvent(m)}else if(o===1){let m=Ft(v.rollingPageX),S=Ft(v.rollingPageY),y=Ft(v.rollingTimestamps)-v.rollingTimestamps[0],D=m-v.rollingPageX[0],C=S-v.rollingPageY[0],E=[...this.targets].filter(B=>v.initialTarget instanceof Node&&B.contains(v.initialTarget));this.inertia(i,E,l,Math.abs(D)/y,D>0?1:-1,m,Math.abs(C)/y,C>0?1:-1,S)}this.dispatchEvent(this.newGestureEvent(Ei.End,v.initialTarget)),delete this.activeTouches[_.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(i,n){let l=document.createEvent("CustomEvent");return l.initEvent(i,!1,!0),l.initialTarget=n,l.tapCount=0,l}dispatchEvent(i){if(i.type===Ei.Tap){let n=new Date().getTime(),l=0;n-this._lastSetTapCountTime>Dt.CLEAR_TAP_COUNT_TIME?l=1:l=2,this._lastSetTapCountTime=n,i.tapCount=l}else(i.type===Ei.Change||i.type===Ei.Contextmenu)&&(this._lastSetTapCountTime=0);if(i.initialTarget instanceof Node){for(let l of this.ignoreTargets)if(l.contains(i.initialTarget))return;let n=[];for(let l of this.targets)if(l.contains(i.initialTarget)){let o=0,c=i.initialTarget;for(;c&&c!==l;)o++,c=c.parentElement;n.push([o,l])}n.sort((l,o)=>l[0]-o[0]);for(let[l,o]of n)o.dispatchEvent(i),this.dispatched=!0}}inertia(i,n,l,o,c,f,_,v,d){this.handle=tf(i,()=>{let m=Date.now(),S=m-l,y=0,D=0,C=!0;o+=Dt.SCROLL_FRICTION*S,_+=Dt.SCROLL_FRICTION*S,o>0&&(C=!1,y=c*o*S),_>0&&(C=!1,D=v*_*S);let E=this.newGestureEvent(Ei.Change);E.translationX=y,E.translationY=D,n.forEach(B=>B.dispatchEvent(E)),C||this.inertia(i,n,m,o,c,f+y,_,v,d+D)})}onTouchMove(i){let n=Date.now();for(let l=0,o=i.changedTouches.length;l<o;l++){let c=i.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(c.identifier))){console.warn("end of an UNKNOWN touch",c);continue}let f=this.activeTouches[c.identifier],_=this.newGestureEvent(Ei.Change,f.initialTarget);_.translationX=c.pageX-Ft(f.rollingPageX),_.translationY=c.pageY-Ft(f.rollingPageY),_.pageX=c.pageX,_.pageY=c.pageY,this.dispatchEvent(_),f.rollingPageX.length>3&&(f.rollingPageX.shift(),f.rollingPageY.shift(),f.rollingTimestamps.shift()),f.rollingPageX.push(c.pageX),f.rollingPageY.push(c.pageY),f.rollingTimestamps.push(n)}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}};vl.SCROLL_FRICTION=-.005,vl.HOLD_DELAY=700,vl.CLEAR_TAP_COUNT_TIME=400,$e([Wb],vl,"isTouchDevice",1);var Yb=vl,sf=class extends Se{onclick(e,i){this._register(fe(e,dt.CLICK,n=>i(new Fa(Mi(e),n))))}onmousedown(e,i){this._register(fe(e,dt.MOUSE_DOWN,n=>i(new Fa(Mi(e),n))))}onmouseover(e,i){this._register(fe(e,dt.MOUSE_OVER,n=>i(new Fa(Mi(e),n))))}onmouseleave(e,i){this._register(fe(e,dt.MOUSE_LEAVE,n=>i(new Fa(Mi(e),n))))}onkeydown(e,i){this._register(fe(e,dt.KEY_DOWN,n=>i(new Yg(n))))}onkeyup(e,i){this._register(fe(e,dt.KEY_UP,n=>i(new Yg(n))))}oninput(e,i){this._register(fe(e,dt.INPUT,i))}onblur(e,i){this._register(fe(e,dt.BLUR,i))}onfocus(e,i){this._register(fe(e,dt.FOCUS,i))}onchange(e,i){this._register(fe(e,dt.CHANGE,i))}ignoreGesture(e){return Yb.ignoreTarget(e)}},Fg=11,Kb=class extends sf{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=Fg+"px",this.domNode.style.height=Fg+"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 ym),this._register(Gg(this.bgDomNode,dt.POINTER_DOWN,i=>this._arrowPointerDown(i))),this._register(Gg(this.domNode,dt.POINTER_DOWN,i=>this._arrowPointerDown(i))),this._pointerdownRepeatTimer=this._register(new Pb),this._pointerdownScheduleRepeatTimer=this._register(new ef)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Mi(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(i,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},Vb=class pu{constructor(i,n,l,o,c,f,_){this._forceIntegerValues=i,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,l=l|0,o=o|0,c=c|0,f=f|0,_=_|0),this.rawScrollLeft=o,this.rawScrollTop=_,n<0&&(n=0),o+n>l&&(o=l-n),o<0&&(o=0),c<0&&(c=0),_+c>f&&(_=f-c),_<0&&(_=0),this.width=n,this.scrollWidth=l,this.scrollLeft=o,this.height=c,this.scrollHeight=f,this.scrollTop=_}equals(i){return this.rawScrollLeft===i.rawScrollLeft&&this.rawScrollTop===i.rawScrollTop&&this.width===i.width&&this.scrollWidth===i.scrollWidth&&this.scrollLeft===i.scrollLeft&&this.height===i.height&&this.scrollHeight===i.scrollHeight&&this.scrollTop===i.scrollTop}withScrollDimensions(i,n){return new pu(this._forceIntegerValues,typeof i.width<"u"?i.width:this.width,typeof i.scrollWidth<"u"?i.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof i.height<"u"?i.height:this.height,typeof i.scrollHeight<"u"?i.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(i){return new pu(this._forceIntegerValues,this.width,this.scrollWidth,typeof i.scrollLeft<"u"?i.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof i.scrollTop<"u"?i.scrollTop:this.rawScrollTop)}createScrollEvent(i,n){let l=this.width!==i.width,o=this.scrollWidth!==i.scrollWidth,c=this.scrollLeft!==i.scrollLeft,f=this.height!==i.height,_=this.scrollHeight!==i.scrollHeight,v=this.scrollTop!==i.scrollTop;return{inSmoothScrolling:n,oldWidth:i.width,oldScrollWidth:i.scrollWidth,oldScrollLeft:i.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:i.height,oldScrollHeight:i.scrollHeight,oldScrollTop:i.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:l,scrollWidthChanged:o,scrollLeftChanged:c,heightChanged:f,scrollHeightChanged:_,scrollTopChanged:v}}},Xb=class extends Se{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new I),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Vb(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,i){var l;let n=this._state.withScrollDimensions(e,i);this._setState(n,!!this._smoothScrolling),(l=this._smoothScrolling)==null||l.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let i=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(i,!1)}setScrollPositionSmooth(e,i){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 n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let l;i?l=new Zg(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):l=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=l}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=Zg.start(this._state,n,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(),i=this._state.withScrollPosition(e);if(this._setState(i,!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,i){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,i)))}},Ig=class{constructor(e,i,n){this.scrollLeft=e,this.scrollTop=i,this.isDone=n}};function Yc(e,i){let n=i-e;return function(l){return e+n*Fb(l)}}function Gb(e,i,n){return function(l){return l<n?e(l/n):i((l-n)/(1-n))}}var Zg=class mu{constructor(i,n,l,o){this.from=i,this.to=n,this.duration=o,this.startTime=l,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(i,n,l){if(Math.abs(i-n)>2.5*l){let o,c;return i<n?(o=i+.75*l,c=n-.75*l):(o=i-.75*l,c=n+.75*l),Gb(Yc(i,o),Yc(c,n),.33)}return Yc(i,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(i){this.to=i.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(i){let n=(i-this.startTime)/this.duration;if(n<1){let l=this.scrollLeft(n),o=this.scrollTop(n);return new Ig(l,o,!1)}return new Ig(this.to.scrollLeft,this.to.scrollTop,!0)}combine(i,n,l){return mu.start(i,n,l)}static start(i,n,l){l=l+10;let o=Date.now()-10;return new mu(i,n,o,l)}};function $b(e){return Math.pow(e,3)}function Fb(e){return 1-$b(1-e)}var Ib=class extends Se{constructor(e,i,n){super(),this._visibility=e,this._visibleClassName=i,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new ef)}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 i;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(i=this._domNode)==null||i.setClassName(this._invisibleClassName+(e?" fade":"")))}},Zb=140,bm=class extends sf{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 Ib(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new ym),this._shouldRender=!0,this.domNode=bl(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(fe(this.domNode.domNode,dt.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new Kb(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,n,l){this.slider=bl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(i),typeof n=="number"&&this.slider.setWidth(n),typeof l=="number"&&this.slider.setHeight(l),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(fe(this.slider.domNode,dt.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.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 i=this.domNode.domNode.getClientRects()[0].top,n=i+this._scrollbarState.getSliderPosition(),l=i+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);n<=o&&o<=l?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let i,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")i=e.offsetX,n=e.offsetY;else{let o=qb(this.domNode.domNode);i=e.pageX-o.left,n=e.pageY-o.top}let l=this._pointerDownRelativePosition(i,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(l):this._scrollbarState.getDesiredScrollPositionFromOffset(l)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),l=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{let c=this._sliderOrthogonalPointerPosition(o),f=Math.abs(c-n);if(gm&&f>Zb){this._setDesiredScrollPositionNow(l.getScrollPosition());return}let _=this._sliderPointerPosition(o)-i;this._setDesiredScrollPositionNow(l.getDesiredScrollPositionFromDelta(_))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let i={};this.writeScrollPosition(i,e),this._scrollable.setScrollPositionNow(i)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},wm=class Su{constructor(i,n,l,o,c,f){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(l),this._arrowSize=Math.round(i),this._visibleSize=o,this._scrollSize=c,this._scrollPosition=f,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Su(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(i){let n=Math.round(i);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(i){let n=Math.round(i);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(i){let n=Math.round(i);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(i){this._scrollbarSize=Math.round(i)}setOppositeScrollbarSize(i){this._oppositeScrollbarSize=Math.round(i)}static _computeValues(i,n,l,o,c){let f=Math.max(0,l-i),_=Math.max(0,f-2*n),v=o>0&&o>l;if(!v)return{computedAvailableSize:Math.round(f),computedIsNeeded:v,computedSliderSize:Math.round(_),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(l*_/o))),m=(_-d)/(o-l),S=c*m;return{computedAvailableSize:Math.round(f),computedIsNeeded:v,computedSliderSize:Math.round(d),computedSliderRatio:m,computedSliderPosition:Math.round(S)}}_refreshComputedValues(){let i=Su._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=i.computedAvailableSize,this._computedIsNeeded=i.computedIsNeeded,this._computedSliderSize=i.computedSliderSize,this._computedSliderRatio=i.computedSliderRatio,this._computedSliderPosition=i.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(i){if(!this._computedIsNeeded)return 0;let n=i-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(i){if(!this._computedIsNeeded)return 0;let n=i-this._arrowSize,l=this._scrollPosition;return n<this._computedSliderPosition?l-=this._visibleSize:l+=this._visibleSize,l}getDesiredScrollPositionFromDelta(i){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+i;return Math.round(n/this._computedSliderRatio)}},Qb=class extends bm{constructor(e,i,n){let l=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new wm(i.horizontalHasArrows?i.arrowSize:0,i.horizontal===2?0:i.horizontalScrollbarSize,i.vertical===2?0:i.verticalScrollbarSize,l.width,l.scrollWidth,o.scrollLeft),visibility:i.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:i.scrollByPage}),i.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((i.horizontalScrollbarSize-i.horizontalSliderSize)/2),0,void 0,i.horizontalSliderSize)}_updateSlider(e,i){this.slider.setWidth(e),this.slider.setLeft(i)}_renderDomNode(e,i){this.domNode.setWidth(e),this.domNode.setHeight(i),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,i){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,i){e.scrollLeft=i}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}},Jb=class extends bm{constructor(e,i,n){let l=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new wm(i.verticalHasArrows?i.arrowSize:0,i.vertical===2?0:i.verticalScrollbarSize,0,l.height,l.scrollHeight,o.scrollTop),visibility:i.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:i.scrollByPage}),i.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((i.verticalScrollbarSize-i.verticalSliderSize)/2),i.verticalSliderSize,void 0)}_updateSlider(e,i){this.slider.setHeight(e),this.slider.setTop(i)}_renderDomNode(e,i){this.domNode.setWidth(i),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,i){return i}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,i){e.scrollTop=i}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},ew=500,Qg=50,tw=class{constructor(e,i,n){this.timestamp=e,this.deltaX=i,this.deltaY=n,this.score=0}},yu=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let i=1,n=0,l=1,o=this._rear;do{let c=o===this._front?i:Math.pow(2,-l);if(i-=c,n+=this._memory[o].score*c,o===this._front)break;o=(this._capacity+o-1)%this._capacity,l++}while(!0);return n<=.5}acceptStandardWheelEvent(i){if(Qu){let n=Mi(i.browserEvent),l=fb(n);this.accept(Date.now(),i.deltaX*l,i.deltaY*l)}else this.accept(Date.now(),i.deltaX,i.deltaY)}accept(i,n,l){let o=null,c=new tw(i,n,l);this._front===-1&&this._rear===-1?(this._memory[0]=c,this._front=0,this._rear=0):(o=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]=c),c.score=this._computeScore(c,o)}_computeScore(i,n){if(Math.abs(i.deltaX)>0&&Math.abs(i.deltaY)>0)return 1;let l=.5;if((!this._isAlmostInt(i.deltaX)||!this._isAlmostInt(i.deltaY))&&(l+=.25),n){let o=Math.abs(i.deltaX),c=Math.abs(i.deltaY),f=Math.abs(n.deltaX),_=Math.abs(n.deltaY),v=Math.max(Math.min(o,f),1),d=Math.max(Math.min(c,_),1),m=Math.max(o,f),S=Math.max(c,_);m%v===0&&S%d===0&&(l-=.5)}return Math.min(Math.max(l,0),1)}_isAlmostInt(i){return Math.abs(Math.round(i)-i)<.01}};yu.INSTANCE=new yu;var iw=yu,sw=class extends sf{constructor(e,i,n){super(),this._onScroll=this._register(new I),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new I),this.onWillScroll=this._onWillScroll.event,this._options=nw(i),this._scrollable=n,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let l={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Jb(this._scrollable,this._options,l)),this._horizontalScrollbar=this._register(new Qb(this._scrollable,this._options,l)),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=bl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=bl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=bl(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,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new ef),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=rr(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,Ri&&(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 Vg(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=rr(this._mouseWheelToDispose),e)){let i=n=>{this._onMouseWheel(new Vg(n))};this._mouseWheelToDispose.push(fe(this._listenOnDomNode,dt.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var o;if((o=e.browserEvent)!=null&&o.defaultPrevented)return;let i=iw.INSTANCE;i.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let c=e.deltaY*this._options.mouseWheelScrollSensitivity,f=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&f+c===0?f=c=0:Math.abs(c)>=Math.abs(f)?f=0:c=0),this._options.flipAxes&&([c,f]=[f,c]);let _=!Ri&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||_)&&!f&&(f=c,c=0),e.browserEvent&&e.browserEvent.altKey&&(f=f*this._options.fastScrollSensitivity,c=c*this._options.fastScrollSensitivity);let v=this._scrollable.getFutureScrollPosition(),d={};if(c){let m=Qg*c,S=v.scrollTop-(m<0?Math.floor(m):Math.ceil(m));this._verticalScrollbar.writeScrollPosition(d,S)}if(f){let m=Qg*f,S=v.scrollLeft-(m<0?Math.floor(m):Math.ceil(m));this._horizontalScrollbar.writeScrollPosition(d,S)}d=this._scrollable.validateScrollPosition(d),(v.scrollLeft!==d.scrollLeft||v.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),n=!0)}let l=n;!l&&this._options.alwaysConsumeMouseWheel&&(l=!0),!l&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(l=!0),l&&(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(),i=e.scrollTop>0,n=e.scrollLeft>0,l=n?" left":"",o=i?" top":"",c=n||i?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${l}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${c}${o}${l}`)}}_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(),ew)}},rw=class extends sw{constructor(e,i,n){super(e,i,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function nw(e){let i={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 i.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:i.horizontalScrollbarSize,i.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:i.verticalScrollbarSize,Ri&&(i.className+=" mac"),i}var bu=class extends Se{constructor(e,i,n,l,o,c,f,_){super(),this._bufferService=n,this._optionsService=f,this._renderService=_,this._onRequestScrollLines=this._register(new I),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let v=this._register(new Xb({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>tf(l.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{v.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new rw(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},v)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(wt.runAndSubscribe(c.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=c.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(je(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=l.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register(je(()=>this._styleElement.remove())),this._register(wt.runAndSubscribe(c.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${c.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${c.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${c.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
124
|
+
`)})),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(d=>this._handleScroll(d)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,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 i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=i-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};bu=$e([te(2,At),te(3,Fi),te(4,im),te(5,an),te(6,Bt),te(7,Ii)],bu);var wu=class extends Se{constructor(e,i,n,l,o){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=n,this._decorationService=l,this._renderService=o,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(c=>this._removeDecoration(c))),this._register(je(()=>{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 l;let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((l=e==null?void 0:e.options)==null?void 0:l.layer)==="top"),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=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,i=e.element){if(!i)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?i.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var i;(i=this._decorationElements.get(e))==null||i.remove(),this._decorationElements.delete(e),e.dispose()}};wu=$e([te(1,At),te(2,Fi),te(3,Dl),te(4,Ii)],wu);var lw=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 i of this._zones)if(i.color===e.options.overviewRulerOptions.color&&i.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(i,e.marker.line))return;if(this._lineAdjacentToZone(i,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(i,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,i){return i>=e.startBufferLine&&i<=e.endBufferLine}_lineAdjacentToZone(e,i,n){return i>=e.startBufferLine-this._linePadding[n||"full"]&&i<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,i){e.startBufferLine=Math.min(e.startBufferLine,i),e.endBufferLine=Math.max(e.endBufferLine,i)}},Ci={full:0,left:0,center:0,right:0},Cs={full:0,left:0,center:0,right:0},hl={full:0,left:0,center:0,right:0},co=class extends Se{constructor(e,i,n,l,o,c,f,_){var d;super(),this._viewportElement=e,this._screenElement=i,this._bufferService=n,this._decorationService=l,this._renderService=o,this._optionsService=c,this._themeService=f,this._coreBrowserService=_,this._colorZoneStore=new lw,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(),(d=this._viewportElement.parentElement)==null||d.insertBefore(this._canvas,this._viewportElement),this._register(je(()=>{var m;return(m=this._canvas)==null?void 0:m.remove()}));let v=this._canvas.getContext("2d");if(v)this._ctx=v;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),i=Math.ceil((this._canvas.width-1)/3);Cs.full=this._canvas.width,Cs.left=e,Cs.center=i,Cs.right=e,this._refreshDrawHeightConstants(),hl.full=1,hl.left=1,hl.center=1+Cs.left,hl.right=1+Cs.left+Cs.center}_refreshDrawHeightConstants(){Ci.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,i=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Ci.left=i,Ci.center=i,Ci.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ci.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ci.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ci.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ci.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 i of this._decorationService.decorations)this._colorZoneStore.addDecoration(i);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i of e)i.position!=="full"&&this._renderColorZone(i);for(let i of e)i.position==="full"&&this._renderColorZone(i);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(hl[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Ci[e.position||"full"]/2),Cs[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Ci[e.position||"full"]))}_queueRefresh(e,i){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};co=$e([te(2,At),te(3,Dl),te(4,Ii),te(5,Bt),te(6,an),te(7,Fi)],co);var Y;(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=`
|
|
125
|
+
`,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=""))(Y||(Y={}));var no;(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=""))(no||(no={}));var Cm;(e=>e.ST=`${Y.ESC}\\`)(Cm||(Cm={}));var Cu=class{constructor(e,i,n,l,o,c){this._textarea=e,this._compositionView=i,this._bufferService=n,this._optionsService=l,this._coreService=o,this._renderService=c,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 i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;i.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(i.start,this._compositionPosition.start):n=this._textarea.value.substring(i.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let i=this._textarea.value,n=i.replace(e,"");this._dataAlreadySent=n,i.length>e.length?this._coreService.triggerDataEvent(n,!0):i.length<e.length?this._coreService.triggerDataEvent(`${Y.DEL}`,!0):i.length===e.length&&i!==e&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let c=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(c.width,1)+"px",this._textarea.style.height=Math.max(c.height,1)+"px",this._textarea.style.lineHeight=c.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Cu=$e([te(2,At),te(3,Bt),te(4,hr),te(5,Ii)],Cu);var _t=0,vt=0,gt=0,Ge=0,Jg={css:"#00000000",rgba:0},it;(e=>{function i(o,c,f,_){return _!==void 0?`#${Is(o)}${Is(c)}${Is(f)}${Is(_)}`:`#${Is(o)}${Is(c)}${Is(f)}`}e.toCss=i;function n(o,c,f,_=255){return(o<<24|c<<16|f<<8|_)>>>0}e.toRgba=n;function l(o,c,f,_){return{css:e.toCss(o,c,f,_),rgba:e.toRgba(o,c,f,_)}}e.toColor=l})(it||(it={}));var Pe;(e=>{function i(v,d){if(Ge=(d.rgba&255)/255,Ge===1)return{css:d.css,rgba:d.rgba};let m=d.rgba>>24&255,S=d.rgba>>16&255,y=d.rgba>>8&255,D=v.rgba>>24&255,C=v.rgba>>16&255,E=v.rgba>>8&255;_t=D+Math.round((m-D)*Ge),vt=C+Math.round((S-C)*Ge),gt=E+Math.round((y-E)*Ge);let B=it.toCss(_t,vt,gt),z=it.toRgba(_t,vt,gt);return{css:B,rgba:z}}e.blend=i;function n(v){return(v.rgba&255)===255}e.isOpaque=n;function l(v,d,m){let S=lo.ensureContrastRatio(v.rgba,d.rgba,m);if(S)return it.toColor(S>>24&255,S>>16&255,S>>8&255)}e.ensureContrastRatio=l;function o(v){let d=(v.rgba|255)>>>0;return[_t,vt,gt]=lo.toChannels(d),{css:it.toCss(_t,vt,gt),rgba:d}}e.opaque=o;function c(v,d){return Ge=Math.round(d*255),[_t,vt,gt]=lo.toChannels(v.rgba),{css:it.toCss(_t,vt,gt,Ge),rgba:it.toRgba(_t,vt,gt,Ge)}}e.opacity=c;function f(v,d){return Ge=v.rgba&255,c(v,Ge*d/255)}e.multiplyOpacity=f;function _(v){return[v.rgba>>24&255,v.rgba>>16&255,v.rgba>>8&255]}e.toColorRGB=_})(Pe||(Pe={}));var Ke;(e=>{let i,n;try{let o=document.createElement("canvas");o.width=1,o.height=1;let c=o.getContext("2d",{willReadFrequently:!0});c&&(i=c,i.globalCompositeOperation="copy",n=i.createLinearGradient(0,0,1,1))}catch{}function l(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return _t=parseInt(o.slice(1,2).repeat(2),16),vt=parseInt(o.slice(2,3).repeat(2),16),gt=parseInt(o.slice(3,4).repeat(2),16),it.toColor(_t,vt,gt);case 5:return _t=parseInt(o.slice(1,2).repeat(2),16),vt=parseInt(o.slice(2,3).repeat(2),16),gt=parseInt(o.slice(3,4).repeat(2),16),Ge=parseInt(o.slice(4,5).repeat(2),16),it.toColor(_t,vt,gt,Ge);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let c=o.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return _t=parseInt(c[1]),vt=parseInt(c[2]),gt=parseInt(c[3]),Ge=Math.round((c[5]===void 0?1:parseFloat(c[5]))*255),it.toColor(_t,vt,gt,Ge);if(!i||!n)throw new Error("css.toColor: Unsupported css format");if(i.fillStyle=n,i.fillStyle=o,typeof i.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(i.fillRect(0,0,1,1),[_t,vt,gt,Ge]=i.getImageData(0,0,1,1).data,Ge!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:it.toRgba(_t,vt,gt,Ge),css:o}}e.toColor=l})(Ke||(Ke={}));var Rt;(e=>{function i(l){return n(l>>16&255,l>>8&255,l&255)}e.relativeLuminance=i;function n(l,o,c){let f=l/255,_=o/255,v=c/255,d=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4),m=_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4),S=v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4);return d*.2126+m*.7152+S*.0722}e.relativeLuminance2=n})(Rt||(Rt={}));var lo;(e=>{function i(f,_){if(Ge=(_&255)/255,Ge===1)return _;let v=_>>24&255,d=_>>16&255,m=_>>8&255,S=f>>24&255,y=f>>16&255,D=f>>8&255;return _t=S+Math.round((v-S)*Ge),vt=y+Math.round((d-y)*Ge),gt=D+Math.round((m-D)*Ge),it.toRgba(_t,vt,gt)}e.blend=i;function n(f,_,v){let d=Rt.relativeLuminance(f>>8),m=Rt.relativeLuminance(_>>8);if(Xi(d,m)<v){if(m<d){let D=l(f,_,v),C=Xi(d,Rt.relativeLuminance(D>>8));if(C<v){let E=o(f,_,v),B=Xi(d,Rt.relativeLuminance(E>>8));return C>B?D:E}return D}let S=o(f,_,v),y=Xi(d,Rt.relativeLuminance(S>>8));if(y<v){let D=l(f,_,v),C=Xi(d,Rt.relativeLuminance(D>>8));return y>C?S:D}return S}}e.ensureContrastRatio=n;function l(f,_,v){let d=f>>24&255,m=f>>16&255,S=f>>8&255,y=_>>24&255,D=_>>16&255,C=_>>8&255,E=Xi(Rt.relativeLuminance2(y,D,C),Rt.relativeLuminance2(d,m,S));for(;E<v&&(y>0||D>0||C>0);)y-=Math.max(0,Math.ceil(y*.1)),D-=Math.max(0,Math.ceil(D*.1)),C-=Math.max(0,Math.ceil(C*.1)),E=Xi(Rt.relativeLuminance2(y,D,C),Rt.relativeLuminance2(d,m,S));return(y<<24|D<<16|C<<8|255)>>>0}e.reduceLuminance=l;function o(f,_,v){let d=f>>24&255,m=f>>16&255,S=f>>8&255,y=_>>24&255,D=_>>16&255,C=_>>8&255,E=Xi(Rt.relativeLuminance2(y,D,C),Rt.relativeLuminance2(d,m,S));for(;E<v&&(y<255||D<255||C<255);)y=Math.min(255,y+Math.ceil((255-y)*.1)),D=Math.min(255,D+Math.ceil((255-D)*.1)),C=Math.min(255,C+Math.ceil((255-C)*.1)),E=Xi(Rt.relativeLuminance2(y,D,C),Rt.relativeLuminance2(d,m,S));return(y<<24|D<<16|C<<8|255)>>>0}e.increaseLuminance=o;function c(f){return[f>>24&255,f>>16&255,f>>8&255,f&255]}e.toChannels=c})(lo||(lo={}));function Is(e){let i=e.toString(16);return i.length<2?"0"+i:i}function Xi(e,i){return e<i?(i+.05)/(e+.05):(e+.05)/(i+.05)}var aw=class extends kl{constructor(e,i,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=n}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()]}},uo=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new ui}register(e){let i={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(i),i.id}deregister(e){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===e)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let i=this._bufferService.buffer.lines.get(e);if(!i||i.length===0)return[];let n=[],l=i.translateToString(!0),o=0,c=0,f=0,_=i.getFg(0),v=i.getBg(0);for(let d=0;d<i.getTrimmedLength();d++)if(i.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==_||this._workCell.bg!==v){if(d-o>1){let m=this._getJoinedRanges(l,f,c,i,o);for(let S=0;S<m.length;S++)n.push(m[S])}o=d,f=c,_=this._workCell.fg,v=this._workCell.bg}c+=this._workCell.getChars().length||Ds.length}if(this._bufferService.cols-o>1){let d=this._getJoinedRanges(l,f,c,i,o);for(let m=0;m<d.length;m++)n.push(d[m])}return n}_getJoinedRanges(e,i,n,l,o){let c=e.substring(i,n),f=[];try{f=this._characterJoiners[0].handler(c)}catch(_){console.error(_)}for(let _=1;_<this._characterJoiners.length;_++)try{let v=this._characterJoiners[_].handler(c);for(let d=0;d<v.length;d++)uo._mergeRanges(f,v[d])}catch(v){console.error(v)}return this._stringRangesToCellRanges(f,l,o),f}_stringRangesToCellRanges(e,i,n){let l=0,o=!1,c=0,f=e[l];if(f){for(let _=n;_<this._bufferService.cols;_++){let v=i.getWidth(_),d=i.getString(_).length||Ds.length;if(v!==0){if(!o&&f[0]<=c&&(f[0]=_,o=!0),f[1]<=c){if(f[1]=_,f=e[++l],!f)break;f[0]<=c?(f[0]=_,o=!0):o=!1}c+=d}}f&&(f[1]=this._bufferService.cols)}}static _mergeRanges(e,i){let n=!1;for(let l=0;l<e.length;l++){let o=e[l];if(n){if(i[1]<=o[0])return e[l-1][1]=i[1],e;if(i[1]<=o[1])return e[l-1][1]=Math.max(i[1],o[1]),e.splice(l,1),e;e.splice(l,1),l--}else{if(i[1]<=o[0])return e.splice(l,0,i),e;if(i[1]<=o[1])return o[0]=Math.min(i[0],o[0]),e;i[0]<o[1]&&(o[0]=Math.min(i[0],o[0]),n=!0);continue}}return n?e[e.length-1][1]=i[1]:e.push(i),e}};uo=$e([te(0,At)],uo);function ow(e){return 57508<=e&&e<=57558}function hw(e){return 9472<=e&&e<=9631}function cw(e){return ow(e)||hw(e)}function uw(){return{css:{canvas:Ia(),cell:Ia()},device:{canvas:Ia(),cell:Ia(),char:{width:0,height:0,left:0,top:0}}}}function Ia(){return{width:0,height:0}}var xu=class{constructor(e,i,n,l,o,c,f){this._document=e,this._characterJoinerService=i,this._optionsService=n,this._coreBrowserService=l,this._coreService=o,this._decorationService=c,this._themeService=f,this._workCell=new ui,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,i,n){this._selectionStart=e,this._selectionEnd=i,this._columnSelectMode=n}createRow(e,i,n,l,o,c,f,_,v,d,m){let S=[],y=this._characterJoinerService.getJoinedCharacters(i),D=this._themeService.colors,C=e.getNoBgTrimmedLength();n&&C<c+1&&(C=c+1);let E,B=0,z="",Q=0,X=0,q=0,L=0,ee=!1,le=0,de=!1,Te=0,Qe=0,ie=[],V=d!==-1&&m!==-1;for(let N=0;N<C;N++){e.loadCell(N,this._workCell);let $=this._workCell.getWidth();if($===0)continue;let G=!1,k=N>=Qe,U=N,H=this._workCell;if(y.length>0&&N===y[0][0]&&k){let xe=y.shift(),Ts=this._isCellInSelection(xe[0],i);for(Q=xe[0]+1;Q<xe[1];Q++)k&&(k=Ts===this._isCellInSelection(Q,i));k&&(k=!n||c<xe[0]||c>=xe[1]),k?(G=!0,H=new aw(this._workCell,e.translateToString(!0,xe[0],xe[1]),xe[1]-xe[0]),U=xe[1]-1,$=H.getWidth()):Qe=xe[1]}let oe=this._isCellInSelection(N,i),w=n&&N===c,j=V&&N>=d&&N<=m,J=!1;this._decorationService.forEachDecorationAtCell(N,i,void 0,xe=>{J=!0});let F=H.getChars()||Ds;if(F===" "&&(H.isUnderline()||H.isOverline())&&(F=" "),Te=$*_-v.get(F,H.isBold(),H.isItalic()),!E)E=this._document.createElement("span");else if(B&&(oe&&de||!oe&&!de&&H.bg===X)&&(oe&&de&&D.selectionForeground||H.fg===q)&&H.extended.ext===L&&j===ee&&Te===le&&!w&&!G&&!J&&k){H.isInvisible()?z+=Ds:z+=F,B++;continue}else B&&(E.textContent=z),E=this._document.createElement("span"),B=0,z="";if(X=H.bg,q=H.fg,L=H.extended.ext,ee=j,le=Te,de=oe,G&&c>=N&&c<=U&&(c=N),!this._coreService.isCursorHidden&&w&&this._coreService.isCursorInitialized){if(ie.push("xterm-cursor"),this._coreBrowserService.isFocused)f&&ie.push("xterm-cursor-blink"),ie.push(l==="bar"?"xterm-cursor-bar":l==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":ie.push("xterm-cursor-outline");break;case"block":ie.push("xterm-cursor-block");break;case"bar":ie.push("xterm-cursor-bar");break;case"underline":ie.push("xterm-cursor-underline");break}}if(H.isBold()&&ie.push("xterm-bold"),H.isItalic()&&ie.push("xterm-italic"),H.isDim()&&ie.push("xterm-dim"),H.isInvisible()?z=Ds:z=H.getChars()||Ds,H.isUnderline()&&(ie.push(`xterm-underline-${H.extended.underlineStyle}`),z===" "&&(z=" "),!H.isUnderlineColorDefault()))if(H.isUnderlineColorRGB())E.style.textDecorationColor=`rgb(${kl.toColorRGB(H.getUnderlineColor()).join(",")})`;else{let xe=H.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&H.isBold()&&xe<8&&(xe+=8),E.style.textDecorationColor=D.ansi[xe].css}H.isOverline()&&(ie.push("xterm-overline"),z===" "&&(z=" ")),H.isStrikethrough()&&ie.push("xterm-strikethrough"),j&&(E.style.textDecoration="underline");let se=H.getFgColor(),_e=H.getFgColorMode(),re=H.getBgColor(),Ue=H.getBgColorMode(),De=!!H.isInverse();if(De){let xe=se;se=re,re=xe;let Ts=_e;_e=Ue,Ue=Ts}let st,Zi,gi=!1;this._decorationService.forEachDecorationAtCell(N,i,void 0,xe=>{xe.options.layer!=="top"&&gi||(xe.backgroundColorRGB&&(Ue=50331648,re=xe.backgroundColorRGB.rgba>>8&16777215,st=xe.backgroundColorRGB),xe.foregroundColorRGB&&(_e=50331648,se=xe.foregroundColorRGB.rgba>>8&16777215,Zi=xe.foregroundColorRGB),gi=xe.options.layer==="top")}),!gi&&oe&&(st=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,re=st.rgba>>8&16777215,Ue=50331648,gi=!0,D.selectionForeground&&(_e=50331648,se=D.selectionForeground.rgba>>8&16777215,Zi=D.selectionForeground)),gi&&ie.push("xterm-decoration-top");let Qt;switch(Ue){case 16777216:case 33554432:Qt=D.ansi[re],ie.push(`xterm-bg-${re}`);break;case 50331648:Qt=it.toColor(re>>16,re>>8&255,re&255),this._addStyle(E,`background-color:#${ep((re>>>0).toString(16),"0",6)}`);break;case 0:default:De?(Qt=D.foreground,ie.push("xterm-bg-257")):Qt=D.background}switch(st||H.isDim()&&(st=Pe.multiplyOpacity(Qt,.5)),_e){case 16777216:case 33554432:H.isBold()&&se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(se+=8),this._applyMinimumContrast(E,Qt,D.ansi[se],H,st,void 0)||ie.push(`xterm-fg-${se}`);break;case 50331648:let xe=it.toColor(se>>16&255,se>>8&255,se&255);this._applyMinimumContrast(E,Qt,xe,H,st,Zi)||this._addStyle(E,`color:#${ep(se.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(E,Qt,D.foreground,H,st,Zi)||De&&ie.push("xterm-fg-257")}ie.length&&(E.className=ie.join(" "),ie.length=0),!w&&!G&&!J&&k?B++:E.textContent=z,Te!==this.defaultSpacing&&(E.style.letterSpacing=`${Te}px`),S.push(E),N=U}return E&&B&&(E.textContent=z),S}_applyMinimumContrast(e,i,n,l,o,c){if(this._optionsService.rawOptions.minimumContrastRatio===1||cw(l.getCode()))return!1;let f=this._getContrastCache(l),_;if(!o&&!c&&(_=f.getColor(i.rgba,n.rgba)),_===void 0){let v=this._optionsService.rawOptions.minimumContrastRatio/(l.isDim()?2:1);_=Pe.ensureContrastRatio(o||i,c||n,v),f.setColor((o||i).rgba,(c||n).rgba,_??null)}return _?(this._addStyle(e,`color:${_.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,i){e.setAttribute("style",`${e.getAttribute("style")||""}${i};`)}_isCellInSelection(e,i){let n=this._selectionStart,l=this._selectionEnd;return!n||!l?!1:this._columnSelectMode?n[0]<=l[0]?e>=n[0]&&i>=n[1]&&e<l[0]&&i<=l[1]:e<n[0]&&i>=n[1]&&e>=l[0]&&i<=l[1]:i>n[1]&&i<l[1]||n[1]===l[1]&&i===n[1]&&e>=n[0]&&e<l[0]||n[1]<l[1]&&i===l[1]&&e<l[0]||n[1]<l[1]&&i===n[1]&&e>=n[0]}};xu=$e([te(1,nm),te(2,Bt),te(3,Fi),te(4,hr),te(5,Dl),te(6,an)],xu);function ep(e,i,n){for(;e.length<n;)e=i+e;return e}var fw=class{constructor(e,i){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 n=e.createElement("span");n.classList.add("xterm-char-measure-element");let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontStyle="italic";let c=e.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontWeight="bold",c.style.fontStyle="italic",this._measureElements=[n,l,o,c],this._container.appendChild(n),this._container.appendChild(l),this._container.appendChild(o),this._container.appendChild(c),i.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,i,n,l){e===this._font&&i===this._fontSize&&n===this._weight&&l===this._weightBold||(this._font=e,this._fontSize=i,this._weight=n,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(e,i,n){let l=0;if(!i&&!n&&e.length===1&&(l=e.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];let f=this._measure(e,0);return f>0&&(this._flat[l]=f),f}let o=e;i&&(o+="B"),n&&(o+="I");let c=this._holey.get(o);if(c===void 0){let f=0;i&&(f|=1),n&&(f|=2),c=this._measure(e,f),c>0&&this._holey.set(o,c)}return c}_measure(e,i){let n=this._measureElements[i];return n.textContent=e.repeat(32),n.offsetWidth/32}},dw=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,i,n,l=!1){if(this.selectionStart=i,this.selectionEnd=n,!i||!n||i[0]===n[0]&&i[1]===n[1]){this.clear();return}let o=e.buffers.active.ydisp,c=i[1]-o,f=n[1]-o,_=Math.max(c,0),v=Math.min(f,e.rows-1);if(_>=e.rows||v<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=l,this.viewportStartRow=c,this.viewportEndRow=f,this.viewportCappedStartRow=_,this.viewportCappedEndRow=v,this.startCol=i[0],this.endCol=n[0]}isCellSelected(e,i,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&n>=this.viewportCappedStartRow&&i<this.endCol&&n<=this.viewportCappedEndRow:i<this.startCol&&n>=this.viewportCappedStartRow&&i>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol):!1}};function _w(){return new dw}var Kc="xterm-dom-renderer-owner-",oi="xterm-rows",Za="xterm-fg-",tp="xterm-bg-",cl="xterm-focus",Qa="xterm-selection",vw=1,Eu=class extends Se{constructor(e,i,n,l,o,c,f,_,v,d,m,S,y,D){super(),this._terminal=e,this._document=i,this._element=n,this._screenElement=l,this._viewportElement=o,this._helperContainer=c,this._linkifier2=f,this._charSizeService=v,this._optionsService=d,this._bufferService=m,this._coreService=S,this._coreBrowserService=y,this._themeService=D,this._terminalClass=vw++,this._rowElements=[],this._selectionRenderModel=_w(),this.onRequestRedraw=this._register(new I).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(oi),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(Qa),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=uw(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(C=>this._injectCss(C))),this._injectCss(this._themeService.colors),this._rowFactory=_.createInstance(xu,document),this._element.classList.add(Kc+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(C=>this._handleLinkHover(C))),this._register(this._linkifier2.onHideLinkUnderline(C=>this._handleLinkLeave(C))),this._register(je(()=>{this._element.classList.remove(Kc+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new fw(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 n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${oi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i,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 i=`${this._terminalSelector} .${oi} { 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}`;i+=`${this._terminalSelector} .${oi} .xterm-dim { color: ${Pe.multiplyOpacity(e.foreground,.5).css};}`,i+=`${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 n=`blink_underline_${this._terminalClass}`,l=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;i+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,i+=`@keyframes ${l} { 50% { box-shadow: none; }}`,i+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i+=`${this._terminalSelector} .${oi}.${cl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${oi}.${cl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${l} 1s step-end infinite;}${this._terminalSelector} .${oi}.${cl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${oi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${oi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${oi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${oi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${oi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${Qa} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Qa} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Qa} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[c,f]of e.ansi.entries())i+=`${this._terminalSelector} .${Za}${c} { color: ${f.css}; }${this._terminalSelector} .${Za}${c}.xterm-dim { color: ${Pe.multiplyOpacity(f,.5).css}; }${this._terminalSelector} .${tp}${c} { background-color: ${f.css}; }`;i+=`${this._terminalSelector} .${Za}257 { color: ${Pe.opaque(e.background).css}; }${this._terminalSelector} .${Za}257.xterm-dim { color: ${Pe.multiplyOpacity(Pe.opaque(e.background),.5).css}; }${this._terminalSelector} .${tp}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i}_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,i){for(let n=this._rowElements.length;n<=i;n++){let l=this._document.createElement("div");this._rowContainer.appendChild(l),this._rowElements.push(l)}for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i){this._refreshRowElements(e,i),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(cl),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(cl),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,n),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,n),!this._selectionRenderModel.hasSelection))return;let l=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,c=this._selectionRenderModel.viewportCappedStartRow,f=this._selectionRenderModel.viewportCappedEndRow,_=this._document.createDocumentFragment();if(n){let v=e[0]>i[0];_.appendChild(this._createSelectionElement(c,v?i[0]:e[0],v?e[0]:i[0],f-c+1))}else{let v=l===c?e[0]:0,d=c===o?i[0]:this._bufferService.cols;_.appendChild(this._createSelectionElement(c,v,d));let m=f-c-1;if(_.appendChild(this._createSelectionElement(c+1,0,this._bufferService.cols,m)),c!==f){let S=o===f?i[0]:this._bufferService.cols;_.appendChild(this._createSelectionElement(f,0,S))}}this._selectionContainer.appendChild(_)}_createSelectionElement(e,i,n,l=1){let o=this._document.createElement("div"),c=i*this.dimensions.css.cell.width,f=this.dimensions.css.cell.width*(n-i);return c+f>this.dimensions.css.canvas.width&&(f=this.dimensions.css.canvas.width-c),o.style.height=`${l*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${c}px`,o.style.width=`${f}px`,o}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,i){let n=this._bufferService.buffer,l=n.ybase+n.y,o=Math.min(n.x,this._bufferService.cols-1),c=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,f=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let v=e;v<=i;v++){let d=v+n.ydisp,m=this._rowElements[v],S=n.lines.get(d);if(!m||!S)break;m.replaceChildren(...this._rowFactory.createRow(S,d,d===l,f,_,o,c,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Kc}${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,i,n,l,o,c){n<0&&(e=0),l<0&&(i=0);let f=this._bufferService.rows-1;n=Math.max(Math.min(n,f),0),l=Math.max(Math.min(l,f),0),o=Math.min(o,this._bufferService.cols);let _=this._bufferService.buffer,v=_.ybase+_.y,d=Math.min(_.x,o-1),m=this._optionsService.rawOptions.cursorBlink,S=this._optionsService.rawOptions.cursorStyle,y=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=n;D<=l;++D){let C=D+_.ydisp,E=this._rowElements[D],B=_.lines.get(C);if(!E||!B)break;E.replaceChildren(...this._rowFactory.createRow(B,C,C===v,S,y,d,m,this.dimensions.css.cell.width,this._widthCache,c?D===n?e:0:-1,c?(D===l?i:o)-1:-1))}}};Eu=$e([te(7,Fu),te(8,mo),te(9,Bt),te(10,At),te(11,hr),te(12,Fi),te(13,an)],Eu);var ku=class extends Se{constructor(e,i,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new I),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new pw(this._optionsService))}catch{this._measureStrategy=this._register(new gw(e,i,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())}};ku=$e([te(2,Bt)],ku);var xm=class extends Se{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,i){e!==void 0&&e>0&&i!==void 0&&i>0&&(this._result.width=e,this._result.height=i)}},gw=class extends xm{constructor(e,i,n){super(),this._document=e,this._parentElement=i,this._optionsService=n,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}},pw=class extends xm{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i=this._ctx.measureText("W");if(!("width"in i&&"fontBoundingBoxAscent"in i&&"fontBoundingBoxDescent"in i))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}},mw=class extends Se{constructor(e,i,n){super(),this._textarea=e,this._window=i,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new Sw(this._window)),this._onDprChange=this._register(new I),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new I),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(l=>this._screenDprMonitor.setWindow(l))),this._register(wt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(fe(this._textarea,"focus",()=>this._isFocused=!0)),this._register(fe(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}},Sw=class extends Se{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ln),this._onDprChange=this._register(new I),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(je(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=fe(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)}},yw=class extends Se{constructor(){super(),this.linkProviders=[],this._register(je(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let i=this.linkProviders.indexOf(e);i!==-1&&this.linkProviders.splice(i,1)}}}};function rf(e,i,n){let l=n.getBoundingClientRect(),o=e.getComputedStyle(n),c=parseInt(o.getPropertyValue("padding-left")),f=parseInt(o.getPropertyValue("padding-top"));return[i.clientX-l.left-c,i.clientY-l.top-f]}function bw(e,i,n,l,o,c,f,_,v){if(!c)return;let d=rf(e,i,n);if(d)return d[0]=Math.ceil((d[0]+(v?f/2:0))/f),d[1]=Math.ceil(d[1]/_),d[0]=Math.min(Math.max(d[0],1),l+(v?1:0)),d[1]=Math.min(Math.max(d[1],1),o),d}var Du=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,n,l,o){return bw(window,e,i,n,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,i){let n=rf(window,e,i);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};Du=$e([te(0,Ii),te(1,mo)],Du);var ww=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,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,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i: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,i):i,!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),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Em={};B1(Em,{getSafariVersion:()=>xw,isChromeOS:()=>Rm,isFirefox:()=>km,isIpad:()=>Ew,isIphone:()=>kw,isLegacyEdge:()=>Cw,isLinux:()=>nf,isMac:()=>fo,isNode:()=>So,isSafari:()=>Dm,isWindows:()=>Mm});var So=typeof process<"u"&&"title"in process,Ml=So?"node":navigator.userAgent,Rl=So?"node":navigator.platform,km=Ml.includes("Firefox"),Cw=Ml.includes("Edge"),Dm=/^((?!chrome|android).)*safari/i.test(Ml);function xw(){if(!Dm)return 0;let e=Ml.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var fo=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Rl),Ew=Rl==="iPad",kw=Rl==="iPhone",Mm=["Windows","Win16","Win32","WinCE"].includes(Rl),nf=Rl.indexOf("Linux")>=0,Rm=/\bCrOS\b/.test(Ml),Tm=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 i=0,n=0,l=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(i=performance.now(),this._tasks[this._i]()||this._i++,i=Math.max(1,performance.now()-i),n=Math.max(i,n),o=e.timeRemaining(),n*1.5>o){l-i<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-i))}ms`),this._start();return}l=o}this.clear()}},Dw=class extends Tm{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},Mw=class extends Tm{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},_o=!So&&"requestIdleCallback"in window?Mw:Dw,Rw=class{constructor(){this._queue=new _o}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Mu=class extends Se{constructor(e,i,n,l,o,c,f,_,v){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=l,this._coreService=o,this._coreBrowserService=_,this._renderer=this._register(new ln),this._pausedResizeTask=new Rw,this._observerDisposable=this._register(new ln),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 I),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new I),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new I),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new I),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new ww((d,m)=>this._renderRows(d,m),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new Tw(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(je(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(f.onResize(()=>this._fullRefresh())),this._register(f.buffers.onBufferActivate(()=>{var d;return(d=this._renderer.value)==null?void 0:d.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(c.onDecorationRegistered(()=>this._fullRefresh())),this._register(c.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(f.cols,f.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(f.buffer.y,f.buffer.y,!0))),this._register(v.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,i)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(l=>this._handleIntersectionChange(l[l.length-1]),{threshold:0});n.observe(i),this._observerDisposable.value=je(()=>n.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,i,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}let l=this._syncOutputHandler.flush();l&&(e=Math.min(e,l.start),i=Math.max(i,l.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount)}_renderRows(e,i){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),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:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0}}resize(e,i){this._rowCount=i,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(i=>this.refreshRows(i.start,i.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,i;this._renderer.value&&((i=(e=this._renderer.value).clearTextureAtlas)==null||i.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,i)}):this._renderer.value.handleResize(e,i),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,i,n){var l;this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=n,(l=this._renderer.value)==null||l.handleSelectionChanged(e,i,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Mu=$e([te(2,Bt),te(3,mo),te(4,hr),te(5,Dl),te(6,At),te(7,Fi),te(8,an)],Mu);var Tw=class{constructor(e,i,n){this._coreBrowserService=e,this._coreService=i,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,i){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,i)):(this._start=e,this._end=i,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 Aw(e,i,n,l){let o=n.buffer.x,c=n.buffer.y;if(!n.buffer.hasScrollback)return zw(o,c,e,i,n,l)+yo(c,i,n,l)+Lw(o,c,e,i,n,l);let f;if(c===i)return f=o>e?"D":"C",xl(Math.abs(o-e),Cl(f,l));f=c>i?"D":"C";let _=Math.abs(c-i),v=Ow(c>i?e:o,n)+(_-1)*n.cols+1+Bw(c>i?o:e);return xl(v,Cl(f,l))}function Bw(e,i){return e-1}function Ow(e,i){return i.cols-e}function zw(e,i,n,l,o,c){return yo(i,l,o,c).length===0?"":xl(Bm(e,i,e,i-nr(i,o),!1,o).length,Cl("D",c))}function yo(e,i,n,l){let o=e-nr(e,n),c=i-nr(i,n),f=Math.abs(o-c)-Nw(e,i,n);return xl(f,Cl(Am(e,i),l))}function Lw(e,i,n,l,o,c){let f;yo(i,l,o,c).length>0?f=l-nr(l,o):f=i;let _=l,v=Hw(e,i,n,l,o,c);return xl(Bm(e,f,n,_,v==="C",o).length,Cl(v,c))}function Nw(e,i,n){var f;let l=0,o=e-nr(e,n),c=i-nr(i,n);for(let _=0;_<Math.abs(o-c);_++){let v=Am(e,i)==="A"?-1:1;(f=n.buffer.lines.get(o+v*_))!=null&&f.isWrapped&&l++}return l}function nr(e,i){let n=0,l=i.buffer.lines.get(e),o=l==null?void 0:l.isWrapped;for(;o&&e>=0&&e<i.rows;)n++,l=i.buffer.lines.get(--e),o=l==null?void 0:l.isWrapped;return n}function Hw(e,i,n,l,o,c){let f;return yo(n,l,o,c).length>0?f=l-nr(l,o):f=i,e<n&&f<=l||e>=n&&f<l?"C":"D"}function Am(e,i){return e>i?"A":"B"}function Bm(e,i,n,l,o,c){let f=e,_=i,v="";for(;(f!==n||_!==l)&&_>=0&&_<c.buffer.lines.length;)f+=o?1:-1,o&&f>c.cols-1?(v+=c.buffer.translateBufferLineToString(_,!1,e,f),f=0,e=0,_++):!o&&f<0&&(v+=c.buffer.translateBufferLineToString(_,!1,0,e+1),f=c.cols-1,e=f,_--);return v+c.buffer.translateBufferLineToString(_,!1,e,f)}function Cl(e,i){let n=i?"O":"[";return Y.ESC+n+e}function xl(e,i){e=Math.floor(e);let n="";for(let l=0;l<e;l++)n+=i;return n}var Uw=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,i=this.selectionEnd;return!e||!i?!1:e[1]>i[1]||e[1]===i[1]&&e[0]>i[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 ip(e,i){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 i*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Vc=50,Pw=15,qw=50,jw=500,Ww=" ",Yw=new RegExp(Ww,"g"),Ru=class extends Se{constructor(e,i,n,l,o,c,f,_,v){super(),this._element=e,this._screenElement=i,this._linkifier=n,this._bufferService=l,this._coreService=o,this._mouseService=c,this._optionsService=f,this._renderService=_,this._coreBrowserService=v,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new ui,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new I),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new I),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new I),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new I),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new Uw(this._bufferService),this._activeSelectionMode=0,this._register(je(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.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,i=this._model.finalSelectionEnd;return!e||!i?!1:e[0]!==i[0]||e[1]!==i[1]}get selectionText(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;if(!e||!i)return"";let n=this._bufferService.buffer,l=[];if(this._activeSelectionMode===3){if(e[0]===i[0])return"";let o=e[0]<i[0]?e[0]:i[0],c=e[0]<i[0]?i[0]:e[0];for(let f=e[1];f<=i[1];f++){let _=n.translateBufferLineToString(f,!0,o,c);l.push(_)}}else{let o=e[1]===i[1]?i[0]:void 0;l.push(n.translateBufferLineToString(e[1],!0,e[0],o));for(let c=e[1]+1;c<=i[1]-1;c++){let f=n.lines.get(c),_=n.translateBufferLineToString(c,!0);f!=null&&f.isWrapped?l[l.length-1]+=_:l.push(_)}if(e[1]!==i[1]){let c=n.lines.get(i[1]),f=n.translateBufferLineToString(i[1],!0,0,i[0]);c&&c.isWrapped?l[l.length-1]+=f:l.push(f)}}return l.map(o=>o.replace(Yw," ")).join(Mm?`\r
|
|
126
|
+
`:`
|
|
127
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),nf&&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 i=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,l=this._model.finalSelectionEnd;return!n||!l||!i?!1:this._areCoordsInSelection(i,n,l)}isCellInSelection(e,i){let n=this._model.finalSelectionStart,l=this._model.finalSelectionEnd;return!n||!l?!1:this._areCoordsInSelection([e,i],n,l)}_areCoordsInSelection(e,i,n){return e[1]>i[1]&&e[1]<n[1]||i[1]===n[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<n[0]||i[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||i[1]<n[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){var o,c;let n=(c=(o=this._linkifier.currentLink)==null?void 0:o.link)==null?void 0:c.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=ip(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let l=this._getMouseBufferCoords(e);return l?(this._selectWordAt(l,i),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=rf(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=n?0:(i>n&&(i-=n),i=Math.min(Math.max(i,-Vc),Vc),i/=Vc,i/Math.abs(i)+Math.round(i*(Pw-1)))}shouldForceSelection(e){return fo?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(),qw)}_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 i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&i.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(fo&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=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 n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let l=n.lines.get(this._model.selectionEnd[1]);l&&l.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!i||i[0]!==this._model.selectionEnd[0]||i[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 i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i<jw&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let l=Aw(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(l,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd,n=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,i,n);return}!e||!i||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||i[0]!==this._oldSelectionEnd[0]||i[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,i,n)}_fireOnSelectionChange(e,i,n){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(i=>this._handleTrim(i))}_convertViewportColToCharacterIndex(e,i){let n=i;for(let l=0;i>=l;l++){let o=e.loadCell(l,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:o>1&&i!==l&&(n+=o-1)}return n}setSelection(e,i,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,n=!0,l=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,c=o.lines.get(e[1]);if(!c)return;let f=o.translateBufferLineToString(e[1],!1),_=this._convertViewportColToCharacterIndex(c,e[0]),v=_,d=e[0]-_,m=0,S=0,y=0,D=0;if(f.charAt(_)===" "){for(;_>0&&f.charAt(_-1)===" ";)_--;for(;v<f.length&&f.charAt(v+1)===" ";)v++}else{let B=e[0],z=e[0];c.getWidth(B)===0&&(m++,B--),c.getWidth(z)===2&&(S++,z++);let Q=c.getString(z).length;for(Q>1&&(D+=Q-1,v+=Q-1);B>0&&_>0&&!this._isCharWordSeparator(c.loadCell(B-1,this._workCell));){c.loadCell(B-1,this._workCell);let X=this._workCell.getChars().length;this._workCell.getWidth()===0?(m++,B--):X>1&&(y+=X-1,_-=X-1),_--,B--}for(;z<c.length&&v+1<f.length&&!this._isCharWordSeparator(c.loadCell(z+1,this._workCell));){c.loadCell(z+1,this._workCell);let X=this._workCell.getChars().length;this._workCell.getWidth()===2?(S++,z++):X>1&&(D+=X-1,v+=X-1),v++,z++}}v++;let C=_+d-m+y,E=Math.min(this._bufferService.cols,v-_+m+S-y-D);if(!(!i&&f.slice(_,v).trim()==="")){if(n&&C===0&&c.getCodePoint(0)!==32){let B=o.lines.get(e[1]-1);if(B&&c.isWrapped&&B.getCodePoint(this._bufferService.cols-1)!==32){let z=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(z){let Q=this._bufferService.cols-z.start;C-=Q,E+=Q}}}if(l&&C+E===this._bufferService.cols&&c.getCodePoint(this._bufferService.cols-1)!==32){let B=o.lines.get(e[1]+1);if(B!=null&&B.isWrapped&&B.getCodePoint(0)!==32){let z=this._getWordAt([0,e[1]+1],!1,!1,!0);z&&(E+=z.length)}}return{start:C,length:E}}}_selectWordAt(e,i){let n=this._getWordAt(e,i);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let n=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=ip(n,this._bufferService.cols)}};Ru=$e([te(3,At),te(4,hr),te(5,Iu),te(6,Bt),te(7,Ii),te(8,Fi)],Ru);var sp=class{constructor(){this._data={}}set(e,i,n){this._data[e]||(this._data[e]={}),this._data[e][i]=n}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},rp=class{constructor(){this._color=new sp,this._css=new sp}setCss(e,i,n){this._css.set(e,i,n)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,n){this._color.set(e,i,n)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},lt=Object.freeze((()=>{let e=[Ke.toColor("#2e3436"),Ke.toColor("#cc0000"),Ke.toColor("#4e9a06"),Ke.toColor("#c4a000"),Ke.toColor("#3465a4"),Ke.toColor("#75507b"),Ke.toColor("#06989a"),Ke.toColor("#d3d7cf"),Ke.toColor("#555753"),Ke.toColor("#ef2929"),Ke.toColor("#8ae234"),Ke.toColor("#fce94f"),Ke.toColor("#729fcf"),Ke.toColor("#ad7fa8"),Ke.toColor("#34e2e2"),Ke.toColor("#eeeeec")],i=[0,95,135,175,215,255];for(let n=0;n<216;n++){let l=i[n/36%6|0],o=i[n/6%6|0],c=i[n%6];e.push({css:it.toCss(l,o,c),rgba:it.toRgba(l,o,c)})}for(let n=0;n<24;n++){let l=8+n*10;e.push({css:it.toCss(l,l,l),rgba:it.toRgba(l,l,l)})}return e})()),Zs=Ke.toColor("#ffffff"),gl=Ke.toColor("#000000"),np=Ke.toColor("#ffffff"),lp=gl,ul={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},Kw=Zs,Tu=class extends Se{constructor(e){super(),this._optionsService=e,this._contrastCache=new rp,this._halfContrastCache=new rp,this._onChangeColors=this._register(new I),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Zs,background:gl,cursor:np,cursorAccent:lp,selectionForeground:void 0,selectionBackgroundTransparent:ul,selectionBackgroundOpaque:Pe.blend(gl,ul),selectionInactiveBackgroundTransparent:ul,selectionInactiveBackgroundOpaque:Pe.blend(gl,ul),scrollbarSliderBackground:Pe.opacity(Zs,.2),scrollbarSliderHoverBackground:Pe.opacity(Zs,.4),scrollbarSliderActiveBackground:Pe.opacity(Zs,.5),overviewRulerBorder:Zs,ansi:lt.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 i=this._colors;if(i.foreground=ze(e.foreground,Zs),i.background=ze(e.background,gl),i.cursor=Pe.blend(i.background,ze(e.cursor,np)),i.cursorAccent=Pe.blend(i.background,ze(e.cursorAccent,lp)),i.selectionBackgroundTransparent=ze(e.selectionBackground,ul),i.selectionBackgroundOpaque=Pe.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=ze(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=Pe.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?ze(e.selectionForeground,Jg):void 0,i.selectionForeground===Jg&&(i.selectionForeground=void 0),Pe.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=Pe.opacity(i.selectionBackgroundTransparent,.3)),Pe.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=Pe.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=ze(e.scrollbarSliderBackground,Pe.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=ze(e.scrollbarSliderHoverBackground,Pe.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=ze(e.scrollbarSliderActiveBackground,Pe.opacity(i.foreground,.5)),i.overviewRulerBorder=ze(e.overviewRulerBorder,Kw),i.ansi=lt.slice(),i.ansi[0]=ze(e.black,lt[0]),i.ansi[1]=ze(e.red,lt[1]),i.ansi[2]=ze(e.green,lt[2]),i.ansi[3]=ze(e.yellow,lt[3]),i.ansi[4]=ze(e.blue,lt[4]),i.ansi[5]=ze(e.magenta,lt[5]),i.ansi[6]=ze(e.cyan,lt[6]),i.ansi[7]=ze(e.white,lt[7]),i.ansi[8]=ze(e.brightBlack,lt[8]),i.ansi[9]=ze(e.brightRed,lt[9]),i.ansi[10]=ze(e.brightGreen,lt[10]),i.ansi[11]=ze(e.brightYellow,lt[11]),i.ansi[12]=ze(e.brightBlue,lt[12]),i.ansi[13]=ze(e.brightMagenta,lt[13]),i.ansi[14]=ze(e.brightCyan,lt[14]),i.ansi[15]=ze(e.brightWhite,lt[15]),e.extendedAnsi){let n=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let l=0;l<n;l++)i.ansi[l+16]=ze(e.extendedAnsi[l],lt[l+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 i=0;i<this._restoreColors.ansi.length;++i)this._colors.ansi[i]=this._restoreColors.ansi[i];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()}}};Tu=$e([te(0,Bt)],Tu);function ze(e,i){if(e!==void 0)try{return Ke.toColor(e)}catch{}return i}var Vw=class{constructor(...e){this._entries=new Map;for(let[i,n]of e)this.set(i,n)}set(e,i){let n=this._entries.get(e);return this._entries.set(e,i),n}forEach(e){for(let[i,n]of this._entries.entries())e(i,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},Xw=class{constructor(){this._services=new Vw,this._services.set(Fu,this)}setService(e,i){this._services.set(e,i)}getService(e){return this._services.get(e)}createInstance(e,...i){let n=P1(e).sort((c,f)=>c.index-f.index),l=[];for(let c of n){let f=this._services.get(c.id);if(!f)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${c.id._id}.`);l.push(f)}let o=n.length>0?n[0].index:i.length;if(i.length!==o)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${i.length} static arguments`);return new e(...i,...l)}},Gw={trace:0,debug:1,info:2,warn:3,error:4,off:5},$w="xterm.js: ",Au=class extends Se{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=Gw[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":$w)+i,...n)}trace(e,...i){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,i)}debug(e,...i){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,i)}info(e,...i){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,i)}warn(e,...i){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,i)}error(e,...i){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,i)}};Au=$e([te(0,Bt)],Au);var ap=class extends Se{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new I),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new I),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new I),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 i=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)i[n]=this._array[this._getCyclicIndex(n)];this._array=i,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i=this._length;i<e;i++)this._array[i]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i){this._array[this._getCyclicIndex(e)]=i}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,i,...n){if(i){for(let l=e;l<this._length-i;l++)this._array[this._getCyclicIndex(l)]=this._array[this._getCyclicIndex(l+i)];this._length-=i,this.onDeleteEmitter.fire({index:e,amount:i})}for(let l=this._length-1;l>=e;l--)this._array[this._getCyclicIndex(l+n.length)]=this._array[this._getCyclicIndex(l)];for(let l=0;l<n.length;l++)this._array[this._getCyclicIndex(e+l)]=n[l];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let l=this._length+n.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,n){if(!(i<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let o=i-1;o>=0;o--)this.set(e+o+n,this.get(e+o));let l=e+i+n-this._length;if(l>0)for(this._length+=l;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let l=0;l<i;l++)this.set(e+l+n,this.get(e+l))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},me=3,tt=Object.freeze(new kl),Ja=0,Xc=2,pl=class Om{constructor(i,n,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(i*me);let o=n||ui.fromCharData([0,Qp,1,0]);for(let c=0;c<i;++c)this.setCell(c,o);this.length=i}get(i){let n=this._data[i*me+0],l=n&2097151;return[this._data[i*me+1],n&2097152?this._combined[i]:l?Es(l):"",n>>22,n&2097152?this._combined[i].charCodeAt(this._combined[i].length-1):l]}set(i,n){this._data[i*me+1]=n[0],n[1].length>1?(this._combined[i]=n[1],this._data[i*me+0]=i|2097152|n[2]<<22):this._data[i*me+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(i){return this._data[i*me+0]>>22}hasWidth(i){return this._data[i*me+0]&12582912}getFg(i){return this._data[i*me+1]}getBg(i){return this._data[i*me+2]}hasContent(i){return this._data[i*me+0]&4194303}getCodePoint(i){let n=this._data[i*me+0];return n&2097152?this._combined[i].charCodeAt(this._combined[i].length-1):n&2097151}isCombined(i){return this._data[i*me+0]&2097152}getString(i){let n=this._data[i*me+0];return n&2097152?this._combined[i]:n&2097151?Es(n&2097151):""}isProtected(i){return this._data[i*me+2]&536870912}loadCell(i,n){return Ja=i*me,n.content=this._data[Ja+0],n.fg=this._data[Ja+1],n.bg=this._data[Ja+2],n.content&2097152&&(n.combinedData=this._combined[i]),n.bg&268435456&&(n.extended=this._extendedAttrs[i]),n}setCell(i,n){n.content&2097152&&(this._combined[i]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[i]=n.extended),this._data[i*me+0]=n.content,this._data[i*me+1]=n.fg,this._data[i*me+2]=n.bg}setCellFromCodepoint(i,n,l,o){o.bg&268435456&&(this._extendedAttrs[i]=o.extended),this._data[i*me+0]=n|l<<22,this._data[i*me+1]=o.fg,this._data[i*me+2]=o.bg}addCodepointToCell(i,n,l){let o=this._data[i*me+0];o&2097152?this._combined[i]+=Es(n):o&2097151?(this._combined[i]=Es(o&2097151)+Es(n),o&=-2097152,o|=2097152):o=n|1<<22,l&&(o&=-12582913,o|=l<<22),this._data[i*me+0]=o}insertCells(i,n,l){if(i%=this.length,i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,l),n<this.length-i){let o=new ui;for(let c=this.length-i-n-1;c>=0;--c)this.setCell(i+n+c,this.loadCell(i+c,o));for(let c=0;c<n;++c)this.setCell(i+c,l)}else for(let o=i;o<this.length;++o)this.setCell(o,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(i,n,l){if(i%=this.length,n<this.length-i){let o=new ui;for(let c=0;c<this.length-i-n;++c)this.setCell(i+c,this.loadCell(i+n+c,o));for(let c=this.length-n;c<this.length;++c)this.setCell(c,l)}else for(let o=i;o<this.length;++o)this.setCell(o,l);i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,l),this.getWidth(i)===0&&!this.hasContent(i)&&this.setCellFromCodepoint(i,0,1,l)}replaceCells(i,n,l,o=!1){if(o){for(i&&this.getWidth(i-1)===2&&!this.isProtected(i-1)&&this.setCellFromCodepoint(i-1,0,1,l),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,l);i<n&&i<this.length;)this.isProtected(i)||this.setCell(i,l),i++;return}for(i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,l),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,l);i<n&&i<this.length;)this.setCell(i++,l)}resize(i,n){if(i===this.length)return this._data.length*4*Xc<this._data.buffer.byteLength;let l=i*me;if(i>this.length){if(this._data.buffer.byteLength>=l*4)this._data=new Uint32Array(this._data.buffer,0,l);else{let o=new Uint32Array(l);o.set(this._data),this._data=o}for(let o=this.length;o<i;++o)this.setCell(o,n)}else{this._data=this._data.subarray(0,l);let o=Object.keys(this._combined);for(let f=0;f<o.length;f++){let _=parseInt(o[f],10);_>=i&&delete this._combined[_]}let c=Object.keys(this._extendedAttrs);for(let f=0;f<c.length;f++){let _=parseInt(c[f],10);_>=i&&delete this._extendedAttrs[_]}}return this.length=i,l*4*Xc<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Xc<this._data.buffer.byteLength){let i=new Uint32Array(this._data.length);return i.set(this._data),this._data=i,1}return 0}fill(i,n=!1){if(n){for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,i);return}this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,i)}copyFrom(i){this.length!==i.length?this._data=new Uint32Array(i._data):this._data.set(i._data),this.length=i.length,this._combined={};for(let n in i._combined)this._combined[n]=i._combined[n];this._extendedAttrs={};for(let n in i._extendedAttrs)this._extendedAttrs[n]=i._extendedAttrs[n];this.isWrapped=i.isWrapped}clone(){let i=new Om(0);i._data=new Uint32Array(this._data),i.length=this.length;for(let n in this._combined)i._combined[n]=this._combined[n];for(let n in this._extendedAttrs)i._extendedAttrs[n]=this._extendedAttrs[n];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(this._data[i*me+0]&4194303)return i+(this._data[i*me+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(this._data[i*me+0]&4194303||this._data[i*me+2]&50331648)return i+(this._data[i*me+0]>>22);return 0}copyCellsFrom(i,n,l,o,c){let f=i._data;if(c)for(let v=o-1;v>=0;v--){for(let d=0;d<me;d++)this._data[(l+v)*me+d]=f[(n+v)*me+d];f[(n+v)*me+2]&268435456&&(this._extendedAttrs[l+v]=i._extendedAttrs[n+v])}else for(let v=0;v<o;v++){for(let d=0;d<me;d++)this._data[(l+v)*me+d]=f[(n+v)*me+d];f[(n+v)*me+2]&268435456&&(this._extendedAttrs[l+v]=i._extendedAttrs[n+v])}let _=Object.keys(i._combined);for(let v=0;v<_.length;v++){let d=parseInt(_[v],10);d>=n&&(this._combined[d-n+l]=i._combined[d])}}translateToString(i,n,l,o){n=n??0,l=l??this.length,i&&(l=Math.min(l,this.getTrimmedLength())),o&&(o.length=0);let c="";for(;n<l;){let f=this._data[n*me+0],_=f&2097151,v=f&2097152?this._combined[n]:_?Es(_):Ds;if(c+=v,o)for(let d=0;d<v.length;++d)o.push(n);n+=f>>22||1}return o&&o.push(n),c}};function Fw(e,i,n,l,o,c){let f=[];for(let _=0;_<e.length-1;_++){let v=_,d=e.get(++v);if(!d.isWrapped)continue;let m=[e.get(_)];for(;v<e.length&&d.isWrapped;)m.push(d),d=e.get(++v);if(!c&&l>=_&&l<v){_+=m.length-1;continue}let S=0,y=El(m,S,i),D=1,C=0;for(;D<m.length;){let B=El(m,D,i),z=B-C,Q=n-y,X=Math.min(z,Q);m[S].copyCellsFrom(m[D],C,y,X,!1),y+=X,y===n&&(S++,y=0),C+=X,C===B&&(D++,C=0),y===0&&S!==0&&m[S-1].getWidth(n-1)===2&&(m[S].copyCellsFrom(m[S-1],n-1,y++,1,!1),m[S-1].setCell(n-1,o))}m[S].replaceCells(y,n,o);let E=0;for(let B=m.length-1;B>0&&(B>S||m[B].getTrimmedLength()===0);B--)E++;E>0&&(f.push(_+m.length-E),f.push(E)),_+=m.length-1}return f}function Iw(e,i){let n=[],l=0,o=i[l],c=0;for(let f=0;f<e.length;f++)if(o===f){let _=i[++l];e.onDeleteEmitter.fire({index:f-c,amount:_}),f+=_-1,c+=_,o=i[++l]}else n.push(f);return{layout:n,countRemoved:c}}function Zw(e,i){let n=[];for(let l=0;l<i.length;l++)n.push(e.get(i[l]));for(let l=0;l<n.length;l++)e.set(l,n[l]);e.length=i.length}function Qw(e,i,n){let l=[],o=e.map((v,d)=>El(e,d,i)).reduce((v,d)=>v+d),c=0,f=0,_=0;for(;_<o;){if(o-_<n){l.push(o-_);break}c+=n;let v=El(e,f,i);c>v&&(c-=v,f++);let d=e[f].getWidth(c-1)===2;d&&c--;let m=d?n-1:n;l.push(m),_+=m}return l}function El(e,i,n){if(i===e.length-1)return e[i].getTrimmedLength();let l=!e[i].hasContent(n-1)&&e[i].getWidth(n-1)===1,o=e[i+1].getWidth(0)===2;return l&&o?n-1:n}var zm=class Lm{constructor(i){this.line=i,this.isDisposed=!1,this._disposables=[],this._id=Lm._nextId++,this._onDispose=this.register(new I),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),rr(this._disposables),this._disposables.length=0)}register(i){return this._disposables.push(i),i}};zm._nextId=1;var Jw=zm,ot={},Qs=ot.B;ot[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ot.A={"#":"£"};ot.B=void 0;ot[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ot.C=ot[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ot.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ot.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ot.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ot.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ot.E=ot[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ot.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ot.H=ot[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ot["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var op=4294967295,hp=class{constructor(e,i,n){this._hasScrollback=e,this._optionsService=i,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=tt.clone(),this.savedCharset=Qs,this.markers=[],this._nullCell=ui.fromCharData([0,Qp,1,0]),this._whitespaceCell=ui.fromCharData([0,Ds,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new _o,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new ap(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 ho),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 ho),this._whitespaceCell}getBlankLine(e,i){return new pl(this._bufferService.cols,this.getNullCell(e),i)}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 i=e+this._optionsService.rawOptions.scrollback;return i>op?op:i}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=tt);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new ap(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){let n=this.getNullCell(tt),l=0,o=this._getCorrectBufferLength(i);if(o>this.lines.maxLength&&(this.lines.maxLength=o),this.lines.length>0){if(this._cols<e)for(let f=0;f<this.lines.length;f++)l+=+this.lines.get(f).resize(e,n);let c=0;if(this._rows<i)for(let f=this._rows;f<i;f++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new pl(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+c+1?(this.ybase--,c++,this.ydisp>0&&this.ydisp--):this.lines.push(new pl(e,n)));else for(let f=this._rows;f>i;f--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(o<this.lines.maxLength){let f=this.lines.length-o;f>0&&(this.lines.trimStart(f),this.ybase=Math.max(this.ybase-f,0),this.ydisp=Math.max(this.ydisp-f,0),this.savedY=Math.max(this.savedY-f,0)),this.lines.maxLength=o}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,i-1),c&&(this.y+=c),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(e,i),this._cols>e))for(let c=0;c<this.lines.length;c++)l+=+this.lines.get(c).resize(e,n);this._cols=e,this._rows=i,this._memoryCleanupQueue.clear(),l>.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 i=0;for(;this._memoryCleanupPosition<this.lines.length;)if(i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),i>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,i){this._cols!==e&&(e>this._cols?this._reflowLarger(e,i):this._reflowSmaller(e,i))}_reflowLarger(e,i){let n=this._optionsService.rawOptions.reflowCursorLine,l=Fw(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(tt),n);if(l.length>0){let o=Iw(this.lines,l);Zw(this.lines,o.layout),this._reflowLargerAdjustViewport(e,i,o.countRemoved)}}_reflowLargerAdjustViewport(e,i,n){let l=this.getNullCell(tt),o=n;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new pl(e,l))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,i){let n=this._optionsService.rawOptions.reflowCursorLine,l=this.getNullCell(tt),o=[],c=0;for(let f=this.lines.length-1;f>=0;f--){let _=this.lines.get(f);if(!_||!_.isWrapped&&_.getTrimmedLength()<=e)continue;let v=[_];for(;_.isWrapped&&f>0;)_=this.lines.get(--f),v.unshift(_);if(!n){let X=this.ybase+this.y;if(X>=f&&X<f+v.length)continue}let d=v[v.length-1].getTrimmedLength(),m=Qw(v,this._cols,e),S=m.length-v.length,y;this.ybase===0&&this.y!==this.lines.length-1?y=Math.max(0,this.y-this.lines.maxLength+S):y=Math.max(0,this.lines.length-this.lines.maxLength+S);let D=[];for(let X=0;X<S;X++){let q=this.getBlankLine(tt,!0);D.push(q)}D.length>0&&(o.push({start:f+v.length+c,newLines:D}),c+=D.length),v.push(...D);let C=m.length-1,E=m[C];E===0&&(C--,E=m[C]);let B=v.length-S-1,z=d;for(;B>=0;){let X=Math.min(z,E);if(v[C]===void 0)break;if(v[C].copyCellsFrom(v[B],z-X,E-X,X,!0),E-=X,E===0&&(C--,E=m[C]),z-=X,z===0){B--;let q=Math.max(B,0);z=El(v,q,this._cols)}}for(let X=0;X<v.length;X++)m[X]<e&&v[X].setCell(m[X],l);let Q=S-y;for(;Q-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+c)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+S,this.ybase+i-1)}if(o.length>0){let f=[],_=[];for(let E=0;E<this.lines.length;E++)_.push(this.lines.get(E));let v=this.lines.length,d=v-1,m=0,S=o[m];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+c);let y=0;for(let E=Math.min(this.lines.maxLength-1,v+c-1);E>=0;E--)if(S&&S.start>d+y){for(let B=S.newLines.length-1;B>=0;B--)this.lines.set(E--,S.newLines[B]);E++,f.push({index:d+1,amount:S.newLines.length}),y+=S.newLines.length,S=o[++m]}else this.lines.set(E,_[d--]);let D=0;for(let E=f.length-1;E>=0;E--)f[E].index+=D,this.lines.onInsertEmitter.fire(f[E]),D+=f[E].amount;let C=Math.max(0,v+c-this.lines.maxLength);C>0&&this.lines.onTrimEmitter.fire(C)}}translateBufferLineToString(e,i,n=0,l){let o=this.lines.get(e);return o?o.translateToString(i,n,l):""}getWrappedRangeForLine(e){let i=e,n=e;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:i,last:n}}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 i=0;i<this.markers.length;i++)this.markers[i].line===e&&(this.markers[i].dispose(),this.markers.splice(i--,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 i=new Jw(e);return this.markers.push(i),i.register(this.lines.onTrim(n=>{i.line-=n,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(n=>{i.line>=n.index&&(i.line+=n.amount)})),i.register(this.lines.onDelete(n=>{i.line>=n.index&&i.line<n.index+n.amount&&i.dispose(),i.line>n.index&&(i.line-=n.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},eC=class extends Se{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new I),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 hp(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new hp(!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,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},Nm=2,Hm=1,Bu=class extends Se{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new I),this.onResize=this._onResize.event,this._onScroll=this._register(new I),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Nm),this.rows=Math.max(e.rawOptions.rows||0,Hm),this.buffers=this._register(new eC(e,this)),this._register(this.buffers.onBufferActivate(i=>{this._onScroll.fire(i.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,i){let n=this.cols!==e,l=this.rows!==i;this.cols=e,this.rows=i,this.buffers.resize(e,i),this._onResize.fire({cols:e,rows:i,colsChanged:n,rowsChanged:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i=!1){let n=this.buffer,l;l=this._cachedBlankLine,(!l||l.length!==this.cols||l.getFg(0)!==e.fg||l.getBg(0)!==e.bg)&&(l=n.getBlankLine(e,i),this._cachedBlankLine=l),l.isWrapped=i;let o=n.ybase+n.scrollTop,c=n.ybase+n.scrollBottom;if(n.scrollTop===0){let f=n.lines.isFull;c===n.lines.length-1?f?n.lines.recycle().copyFrom(l):n.lines.push(l.clone()):n.lines.splice(c+1,0,l.clone()),f?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let f=c-o+1;n.lines.shiftElements(o+1,f-1,-1),n.lines.set(c,l.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,i){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let l=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),l!==n.ydisp&&(i||this._onScroll.fire(n.ydisp))}};Bu=$e([te(0,Bt)],Bu);var Qr={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:fo,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},tC=["normal","bold","100","200","300","400","500","600","700","800","900"],iC=class extends Se{constructor(e){super(),this._onOptionChange=this._register(new I),this.onOptionChange=this._onOptionChange.event;let i={...Qr};for(let n in e)if(n in i)try{let l=e[n];i[n]=this._sanitizeAndValidateOption(n,l)}catch(l){console.error(l)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(je(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(n=>{n===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&i()})}_setupOptions(){let e=n=>{if(!(n in Qr))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,l)=>{if(!(n in Qr))throw new Error(`No option with key "${n}"`);l=this._sanitizeAndValidateOption(n,l),this.rawOptions[n]!==l&&(this.rawOptions[n]=l,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let l={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this.options,n,l)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=Qr[e]),!sC(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=Qr[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=tC.includes(i)?i:Qr[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(i*10)/10));break;case"scrollback":if(i=Math.min(i,4294967295),i<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{};break}return i}};function sC(e){return e==="block"||e==="underline"||e==="bar"}function ml(e,i=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let l in e)n[l]=i<=1?e[l]:e[l]&&ml(e[l],i-1);return n}var cp=Object.freeze({insertMode:!1}),up=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Ou=class extends Se{constructor(e,i,n){super(),this._bufferService=e,this._logService=i,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new I),this.onData=this._onData.event,this._onUserInput=this._register(new I),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new I),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new I),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=ml(cp),this.decPrivateModes=ml(up)}reset(){this.modes=ml(cp),this.decPrivateModes=ml(up)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(l=>l.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(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};Ou=$e([te(0,At),te(1,sm),te(2,Bt)],Ou);var fp={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 Gc(e,i){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!i&&(n|=3)),n}var $c=String.fromCharCode,dp={DEFAULT:e=>{let i=[Gc(e,!1)+32,e.col+32,e.row+32];return i[0]>255||i[1]>255||i[2]>255?"":`\x1B[M${$c(i[0])}${$c(i[1])}${$c(i[2])}`},SGR:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Gc(e,!0)};${e.col};${e.row}${i}`},SGR_PIXELS:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Gc(e,!0)};${e.x};${e.y}${i}`}},zu=class extends Se{constructor(e,i,n){super(),this._bufferService=e,this._coreService=i,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new I),this.onProtocolChange=this._onProtocolChange.event;for(let l of Object.keys(fp))this.addProtocol(l,fp[l]);for(let l of Object.keys(dp))this.addEncoding(l,dp[l]);this.reset()}addProtocol(e,i){this._protocols[e]=i}addEncoding(e,i){this._encodings[e]=i}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,i,n){if(e.deltaY===0||e.shiftKey||i===void 0||n===void 0)return 0;let l=i/n,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=l+0,Math.abs(e.deltaY)<50&&(o*=.3),this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(e,i){return i.altKey||i.ctrlKey||i.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 i=this._encodings[this._activeEncoding](e);return i&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(i):this._coreService.triggerDataEvent(i,!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,i,n){if(n){if(e.x!==i.x||e.y!==i.y)return!1}else if(e.col!==i.col||e.row!==i.row)return!1;return!(e.button!==i.button||e.action!==i.action||e.ctrl!==i.ctrl||e.alt!==i.alt||e.shift!==i.shift)}};zu=$e([te(0,At),te(1,hr),te(2,Bt)],zu);var Fc=[[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]],rC=[[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]],at;function nC(e,i){let n=0,l=i.length-1,o;if(e<i[0][0]||e>i[l][1])return!1;for(;l>=n;)if(o=n+l>>1,e>i[o][1])n=o+1;else if(e<i[o][0])l=o-1;else return!0;return!1}var lC=class{constructor(){if(this.version="6",!at){at=new Uint8Array(65536),at.fill(1),at[0]=0,at.fill(0,1,32),at.fill(0,127,160),at.fill(2,4352,4448),at[9001]=2,at[9002]=2,at.fill(2,11904,42192),at[12351]=1,at.fill(2,44032,55204),at.fill(2,63744,64256),at.fill(2,65040,65050),at.fill(2,65072,65136),at.fill(2,65280,65377),at.fill(2,65504,65511);for(let e=0;e<Fc.length;++e)at.fill(0,Fc[e][0],Fc[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?at[e]:nC(e,rC)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let n=this.wcwidth(e),l=n===0&&i!==0;if(l){let o=Js.extractWidth(i);o===0?l=!1:o>n&&(n=o)}return Js.createPropertyValue(0,n,l)}},Js=class ao{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new I,this.onChange=this._onChange.event;let i=new lC;this.register(i),this._active=i.version,this._activeProvider=i}static extractShouldJoin(i){return(i&1)!==0}static extractWidth(i){return i>>1&3}static extractCharKind(i){return i>>3}static createPropertyValue(i,n,l=!1){return(i&16777215)<<3|(n&3)<<1|(l?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(i){if(!this._providers[i])throw new Error(`unknown Unicode version "${i}"`);this._active=i,this._activeProvider=this._providers[i],this._onChange.fire(i)}register(i){this._providers[i.version]=i}wcwidth(i){return this._activeProvider.wcwidth(i)}getStringCellWidth(i){let n=0,l=0,o=i.length;for(let c=0;c<o;++c){let f=i.charCodeAt(c);if(55296<=f&&f<=56319){if(++c>=o)return n+this.wcwidth(f);let d=i.charCodeAt(c);56320<=d&&d<=57343?f=(f-55296)*1024+d-56320+65536:n+=this.wcwidth(d)}let _=this.charProperties(f,l),v=ao.extractWidth(_);ao.extractShouldJoin(_)&&(v-=ao.extractWidth(l)),n+=v,l=_}return n}charProperties(i,n){return this._activeProvider.charProperties(i,n)}},aC=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,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function _p(e){var l;let i=(l=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:l.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&i&&(n.isWrapped=i[3]!==0&&i[3]!==32)}var fl=2147483647,oC=256,Um=class Lu{constructor(i=32,n=32){if(this.maxLength=i,this.maxSubParamsLength=n,n>oC)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(i),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(i),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(i){let n=new Lu;if(!i.length)return n;for(let l=Array.isArray(i[0])?1:0;l<i.length;++l){let o=i[l];if(Array.isArray(o))for(let c=0;c<o.length;++c)n.addSubParam(o[c]);else n.addParam(o)}return n}clone(){let i=new Lu(this.maxLength,this.maxSubParamsLength);return i.params.set(this.params),i.length=this.length,i._subParams.set(this._subParams),i._subParamsLength=this._subParamsLength,i._subParamsIdx.set(this._subParamsIdx),i._rejectDigits=this._rejectDigits,i._rejectSubDigits=this._rejectSubDigits,i._digitIsSub=this._digitIsSub,i}toArray(){let i=[];for(let n=0;n<this.length;++n){i.push(this.params[n]);let l=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-l>0&&i.push(Array.prototype.slice.call(this._subParams,l,o))}return i}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(i){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(i<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=i>fl?fl:i}addSubParam(i){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(i<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=i>fl?fl:i,this._subParamsIdx[this.length-1]++}}hasSubParams(i){return(this._subParamsIdx[i]&255)-(this._subParamsIdx[i]>>8)>0}getSubParams(i){let n=this._subParamsIdx[i]>>8,l=this._subParamsIdx[i]&255;return l-n>0?this._subParams.subarray(n,l):null}getSubParamsAll(){let i={};for(let n=0;n<this.length;++n){let l=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-l>0&&(i[n]=this._subParams.slice(l,o))}return i}addDigit(i){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let l=this._digitIsSub?this._subParams:this.params,o=l[n-1];l[n-1]=~o?Math.min(o*10+i,fl):i}},dl=[],hC=class{constructor(){this._state=0,this._active=dl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let l=n.indexOf(i);l!==-1&&n.splice(l,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=dl}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=dl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||dl,!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,i,n){if(!this._active.length)this._handlerFb(this._id,"PUT",po(e,i,n));else for(let l=this._active.length-1;l>=0;l--)this._active[l].put(e,i,n)}start(){this.reset(),this._state=1}put(e,i,n){if(this._state!==3){if(this._state===1)for(;i<n;){let l=e[i++];if(l===59){this._state=2,this._start();break}if(l<48||57<l){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+l-48}this._state===2&&n-i>0&&this._put(e,i,n)}}end(e,i=!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 n=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,n=i,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;l>=0&&(n=this._active[l].end(e),n!==!0);l--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,n;l--}for(;l>=0;l--)if(n=this._active[l].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,n}this._active=dl,this._id=-1,this._state=0}}},It=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=po(e,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data),i instanceof Promise))return i.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,i}},_l=[],cC=class{constructor(){this._handlers=Object.create(null),this._active=_l,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_l}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let l=n.indexOf(i);l!==-1&&n.splice(l,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=_l,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||_l,!this._active.length)this._handlerFb(this._ident,"HOOK",i);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(i)}put(e,i,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",po(e,i,n));else for(let l=this._active.length-1;l>=0;l--)this._active[l].put(e,i,n)}unhook(e,i=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,n=i,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;l>=0&&(n=this._active[l].unhook(e),n!==!0);l--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,n;l--}for(;l>=0;l--)if(n=this._active[l].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,n}this._active=_l,this._ident=0}},Sl=new Um;Sl.addParam(0);var vp=class{constructor(e){this._handler=e,this._data="",this._params=Sl,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Sl,this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=po(e,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data,this._params),i instanceof Promise))return i.then(n=>(this._params=Sl,this._data="",this._hitLimit=!1,n));return this._params=Sl,this._data="",this._hitLimit=!1,i}},uC=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,n,l){this.table[i<<8|e]=n<<4|l}addMany(e,i,n,l){for(let o=0;o<e.length;o++)this.table[i<<8|e[o]]=n<<4|l}},ci=160,fC=(function(){let e=new uC(4095),i=Array.apply(null,Array(256)).map((_,v)=>v),n=(_,v)=>i.slice(_,v),l=n(32,127),o=n(0,24);o.push(25),o.push.apply(o,n(28,32));let c=n(0,14),f;e.setDefault(1,0),e.addMany(l,0,2,0);for(f in c)e.addMany([24,26,153,154],f,3,0),e.addMany(n(128,144),f,3,0),e.addMany(n(144,152),f,3,0),e.add(156,f,0,0),e.add(27,f,11,1),e.add(157,f,4,8),e.addMany([152,158,159],f,0,7),e.add(155,f,11,3),e.add(144,f,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(l,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(l,7,0,7),e.addMany(o,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(o,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(o,13,13,13),e.addMany(l,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(ci,0,2,0),e.add(ci,8,5,8),e.add(ci,6,0,6),e.add(ci,11,0,11),e.add(ci,13,13,13),e})(),dC=class extends Se{constructor(e=fC){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 Um,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,n,l)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,n)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(je(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new hC),this._dcsParser=this._register(new cC),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>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 o=0;o<e.intermediates.length;++o){let c=e.intermediates.charCodeAt(o);if(32>c||c>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=c}}if(e.final.length!==1)throw new Error("final must be a single byte");let l=e.final.charCodeAt(0);if(i[0]>l||l>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return n<<=8,n|=l,n}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(e&255)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let l=this._escHandlers[n];return l.push(i),{dispose:()=>{let o=l.indexOf(i);o!==-1&&l.splice(o,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,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let l=this._csiHandlers[n];return l.push(i),{dispose:()=>{let o=l.indexOf(i);o!==-1&&l.splice(o,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}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,i,n,l,o){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=n,this._parseStack.transition=l,this._parseStack.chunkPos=o}parse(e,i,n){let l=0,o=0,c=0,f;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,c=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let _=this._parseStack.handlers,v=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&v>-1){for(;v>=0&&(f=_[v](this._params),f!==!0);v--)if(f instanceof Promise)return this._parseStack.handlerPos=v,f}this._parseStack.handlers=[];break;case 4:if(n===!1&&v>-1){for(;v>=0&&(f=_[v](),f!==!0);v--)if(f instanceof Promise)return this._parseStack.handlerPos=v,f}this._parseStack.handlers=[];break;case 6:if(l=e[this._parseStack.chunkPos],f=this._dcsParser.unhook(l!==24&&l!==26,n),f)return f;l===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(l=e[this._parseStack.chunkPos],f=this._oscParser.end(l!==24&&l!==26,n),f)return f;l===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,c=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let _=c;_<i;++_){switch(l=e[_],o=this._transitions.table[this.currentState<<8|(l<160?l:ci)],o>>4){case 2:for(let y=_+1;;++y){if(y>=i||(l=e[y])<32||l>126&&l<ci){this._printHandler(e,_,y),_=y-1;break}if(++y>=i||(l=e[y])<32||l>126&&l<ci){this._printHandler(e,_,y),_=y-1;break}if(++y>=i||(l=e[y])<32||l>126&&l<ci){this._printHandler(e,_,y),_=y-1;break}if(++y>=i||(l=e[y])<32||l>126&&l<ci){this._printHandler(e,_,y),_=y-1;break}}break;case 3:this._executeHandlers[l]?this._executeHandlers[l]():this._executeHandlerFb(l),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:_,code:l,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let v=this._csiHandlers[this._collect<<8|l],d=v?v.length-1:-1;for(;d>=0&&(f=v[d](this._params),f!==!0);d--)if(f instanceof Promise)return this._preserveStack(3,v,d,o,_),f;d<0&&this._csiHandlerFb(this._collect<<8|l,this._params),this.precedingJoinState=0;break;case 8:do switch(l){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(l-48)}while(++_<i&&(l=e[_])>47&&l<60);_--;break;case 9:this._collect<<=8,this._collect|=l;break;case 10:let m=this._escHandlers[this._collect<<8|l],S=m?m.length-1:-1;for(;S>=0&&(f=m[S](),f!==!0);S--)if(f instanceof Promise)return this._preserveStack(4,m,S,o,_),f;S<0&&this._escHandlerFb(this._collect<<8|l),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|l,this._params);break;case 13:for(let y=_+1;;++y)if(y>=i||(l=e[y])===24||l===26||l===27||l>127&&l<ci){this._dcsParser.put(e,_,y),_=y-1;break}break;case 14:if(f=this._dcsParser.unhook(l!==24&&l!==26),f)return this._preserveStack(6,[],0,o,_),f;l===27&&(o|=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 y=_+1;;y++)if(y>=i||(l=e[y])<32||l>127&&l<ci){this._oscParser.put(e,_,y),_=y-1;break}break;case 6:if(f=this._oscParser.end(l!==24&&l!==26),f)return this._preserveStack(5,[],0,o,_),f;l===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},_C=/^([\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})$/,vC=/^[\da-f]+$/;function gp(e){if(!e)return;let i=e.toLowerCase();if(i.indexOf("rgb:")===0){i=i.slice(4);let n=_C.exec(i);if(n){let l=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/l*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/l*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/l*255)]}}else if(i.indexOf("#")===0&&(i=i.slice(1),vC.exec(i)&&[3,6,9,12].includes(i.length))){let n=i.length/3,l=[0,0,0];for(let o=0;o<3;++o){let c=parseInt(i.slice(n*o,n*o+n),16);l[o]=n===1?c<<4:n===2?c:n===3?c>>4:c>>8}return l}}function Ic(e,i){let n=e.toString(16),l=n.length<2?"0"+n:n;switch(i){case 4:return n[0];case 8:return l;case 12:return(l+l).slice(0,3);default:return l+l}}function gC(e,i=16){let[n,l,o]=e;return`rgb:${Ic(n,i)}/${Ic(l,i)}/${Ic(o,i)}`}var pC={"(":0,")":1,"*":2,"+":3,"-":1,".":2},xs=131072,pp=10;function mp(e,i){if(e>24)return i.setWinLines||!1;switch(e){case 1:return!!i.restoreWin;case 2:return!!i.minimizeWin;case 3:return!!i.setWinPosition;case 4:return!!i.setWinSizePixels;case 5:return!!i.raiseWin;case 6:return!!i.lowerWin;case 7:return!!i.refreshWin;case 8:return!!i.setWinSizeChars;case 9:return!!i.maximizeWin;case 10:return!!i.fullscreenWin;case 11:return!!i.getWinState;case 13:return!!i.getWinPosition;case 14:return!!i.getWinSizePixels;case 15:return!!i.getScreenSizePixels;case 16:return!!i.getCellSizePixels;case 18:return!!i.getWinSizeChars;case 19:return!!i.getScreenSizeChars;case 20:return!!i.getIconTitle;case 21:return!!i.getWinTitle;case 22:return!!i.pushTitle;case 23:return!!i.popTitle;case 24:return!!i.setWinLines}return!1}var Sp=5e3,yp=0,mC=class extends Se{constructor(e,i,n,l,o,c,f,_,v=new dC){super(),this._bufferService=e,this._charsetService=i,this._coreService=n,this._logService=l,this._optionsService=o,this._oscLinkService=c,this._coreMouseService=f,this._unicodeService=_,this._parser=v,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new H1,this._utf8Decoder=new U1,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=tt.clone(),this._eraseAttrDataInternal=tt.clone(),this._onRequestBell=this._register(new I),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new I),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new I),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new I),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new I),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new I),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new I),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new I),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new I),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new I),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new I),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new I),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new I),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 Nu(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,m)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:m.toArray()})}),this._parser.setEscHandlerFallback(d=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(d)})}),this._parser.setExecuteHandlerFallback(d=>{this._logService.debug("Unknown EXECUTE code: ",{code:d})}),this._parser.setOscHandlerFallback((d,m,S)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:m,data:S})}),this._parser.setDcsHandlerFallback((d,m,S)=>{m==="HOOK"&&(S=S.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:m,payload:S})}),this._parser.setPrintHandler((d,m,S)=>this.print(d,m,S)),this._parser.registerCsiHandler({final:"@"},d=>this.insertChars(d)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},d=>this.scrollLeft(d)),this._parser.registerCsiHandler({final:"A"},d=>this.cursorUp(d)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},d=>this.scrollRight(d)),this._parser.registerCsiHandler({final:"B"},d=>this.cursorDown(d)),this._parser.registerCsiHandler({final:"C"},d=>this.cursorForward(d)),this._parser.registerCsiHandler({final:"D"},d=>this.cursorBackward(d)),this._parser.registerCsiHandler({final:"E"},d=>this.cursorNextLine(d)),this._parser.registerCsiHandler({final:"F"},d=>this.cursorPrecedingLine(d)),this._parser.registerCsiHandler({final:"G"},d=>this.cursorCharAbsolute(d)),this._parser.registerCsiHandler({final:"H"},d=>this.cursorPosition(d)),this._parser.registerCsiHandler({final:"I"},d=>this.cursorForwardTab(d)),this._parser.registerCsiHandler({final:"J"},d=>this.eraseInDisplay(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},d=>this.eraseInDisplay(d,!0)),this._parser.registerCsiHandler({final:"K"},d=>this.eraseInLine(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},d=>this.eraseInLine(d,!0)),this._parser.registerCsiHandler({final:"L"},d=>this.insertLines(d)),this._parser.registerCsiHandler({final:"M"},d=>this.deleteLines(d)),this._parser.registerCsiHandler({final:"P"},d=>this.deleteChars(d)),this._parser.registerCsiHandler({final:"S"},d=>this.scrollUp(d)),this._parser.registerCsiHandler({final:"T"},d=>this.scrollDown(d)),this._parser.registerCsiHandler({final:"X"},d=>this.eraseChars(d)),this._parser.registerCsiHandler({final:"Z"},d=>this.cursorBackwardTab(d)),this._parser.registerCsiHandler({final:"`"},d=>this.charPosAbsolute(d)),this._parser.registerCsiHandler({final:"a"},d=>this.hPositionRelative(d)),this._parser.registerCsiHandler({final:"b"},d=>this.repeatPrecedingCharacter(d)),this._parser.registerCsiHandler({final:"c"},d=>this.sendDeviceAttributesPrimary(d)),this._parser.registerCsiHandler({prefix:">",final:"c"},d=>this.sendDeviceAttributesSecondary(d)),this._parser.registerCsiHandler({final:"d"},d=>this.linePosAbsolute(d)),this._parser.registerCsiHandler({final:"e"},d=>this.vPositionRelative(d)),this._parser.registerCsiHandler({final:"f"},d=>this.hVPosition(d)),this._parser.registerCsiHandler({final:"g"},d=>this.tabClear(d)),this._parser.registerCsiHandler({final:"h"},d=>this.setMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"h"},d=>this.setModePrivate(d)),this._parser.registerCsiHandler({final:"l"},d=>this.resetMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"l"},d=>this.resetModePrivate(d)),this._parser.registerCsiHandler({final:"m"},d=>this.charAttributes(d)),this._parser.registerCsiHandler({final:"n"},d=>this.deviceStatus(d)),this._parser.registerCsiHandler({prefix:"?",final:"n"},d=>this.deviceStatusPrivate(d)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},d=>this.softReset(d)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},d=>this.setCursorStyle(d)),this._parser.registerCsiHandler({final:"r"},d=>this.setScrollRegion(d)),this._parser.registerCsiHandler({final:"s"},d=>this.saveCursor(d)),this._parser.registerCsiHandler({final:"t"},d=>this.windowOptions(d)),this._parser.registerCsiHandler({final:"u"},d=>this.restoreCursor(d)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},d=>this.insertColumns(d)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},d=>this.deleteColumns(d)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},d=>this.selectProtected(d)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},d=>this.requestMode(d,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},d=>this.requestMode(d,!1)),this._parser.setExecuteHandler(Y.BEL,()=>this.bell()),this._parser.setExecuteHandler(Y.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(Y.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(Y.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(Y.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(Y.BS,()=>this.backspace()),this._parser.setExecuteHandler(Y.HT,()=>this.tab()),this._parser.setExecuteHandler(Y.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(Y.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(no.IND,()=>this.index()),this._parser.setExecuteHandler(no.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(no.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new It(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new It(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new It(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new It(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new It(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new It(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new It(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new It(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new It(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new It(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new It(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new It(d=>this.restoreCursorColor(d))),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 d in ot)this._parser.registerEscHandler({intermediates:"(",final:d},()=>this.selectCharset("("+d)),this._parser.registerEscHandler({intermediates:")",final:d},()=>this.selectCharset(")"+d)),this._parser.registerEscHandler({intermediates:"*",final:d},()=>this.selectCharset("*"+d)),this._parser.registerEscHandler({intermediates:"+",final:d},()=>this.selectCharset("+"+d)),this._parser.registerEscHandler({intermediates:"-",final:d},()=>this.selectCharset("-"+d)),this._parser.registerEscHandler({intermediates:".",final:d},()=>this.selectCharset("."+d)),this._parser.registerEscHandler({intermediates:"/",final:d},()=>this.selectCharset("/"+d));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(d=>(this._logService.error("Parsing error: ",d),d)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new vp((d,m)=>this.requestStatusString(d,m)))}getAttrData(){return this._curAttrData}_preserveStack(e,i,n,l){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=i,this._parseStack.decodedLength=n,this._parseStack.position=l}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((i,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),Sp))]).catch(i=>{if(i!=="#SLOW_TIMEOUT")throw i;console.warn(`async parser handler taking longer than ${Sp} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,i){let n,l=this._activeBuffer.x,o=this._activeBuffer.y,c=0,f=this._parseStack.paused;if(f){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,i))return this._logSlowResolvingAsync(n),n;l=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>xs&&(c=this._parseStack.position+xs)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(d=>d.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<xs&&(this._parseBuffer=new Uint32Array(Math.min(e.length,xs))),f||this._dirtyRowTracker.clearRange(),e.length>xs)for(let d=c;d<e.length;d+=xs){let m=d+xs<e.length?d+xs:e.length,S=typeof e=="string"?this._stringDecoder.decode(e.substring(d,m),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,m),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,S))return this._preserveStack(l,o,S,d),this._logSlowResolvingAsync(n),n}else if(!f){let d=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,d))return this._preserveStack(l,o,d,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==l||this._activeBuffer.y!==o)&&this._onCursorMove.fire();let _=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),v=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);v<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(v,this._bufferService.rows-1),end:Math.min(_,this._bufferService.rows-1)})}print(e,i,n){let l,o,c=this._charsetService.charset,f=this._optionsService.rawOptions.screenReaderMode,_=this._bufferService.cols,v=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,m=this._curAttrData,S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-i>0&&S.getWidth(this._activeBuffer.x-1)===2&&S.setCellFromCodepoint(this._activeBuffer.x-1,0,1,m);let y=this._parser.precedingJoinState;for(let D=i;D<n;++D){if(l=e[D],l<127&&c){let z=c[String.fromCharCode(l)];z&&(l=z.charCodeAt(0))}let C=this._unicodeService.charProperties(l,y);o=Js.extractWidth(C);let E=Js.extractShouldJoin(C),B=E?Js.extractWidth(y):0;if(y=C,f&&this._onA11yChar.fire(Es(l)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-B>_){if(v){let z=S,Q=this._activeBuffer.x-B;for(this._activeBuffer.x=B,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),S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),B>0&&S instanceof pl&&S.copyCellsFrom(z,Q,0,B,!1);Q<_;)z.setCellFromCodepoint(Q++,0,1,m)}else if(this._activeBuffer.x=_-1,o===2)continue}if(E&&this._activeBuffer.x){let z=S.getWidth(this._activeBuffer.x-1)?1:2;S.addCodepointToCell(this._activeBuffer.x-z,l,o);for(let Q=o-B;--Q>=0;)S.setCellFromCodepoint(this._activeBuffer.x++,0,0,m);continue}if(d&&(S.insertCells(this._activeBuffer.x,o-B,this._activeBuffer.getNullCell(m)),S.getWidth(_-1)===2&&S.setCellFromCodepoint(_-1,0,1,m)),S.setCellFromCodepoint(this._activeBuffer.x++,l,o,m),o>0)for(;--o;)S.setCellFromCodepoint(this._activeBuffer.x++,0,0,m)}this._parser.precedingJoinState=y,this._activeBuffer.x<_&&n-i>0&&S.getWidth(this._activeBuffer.x)===0&&!S.hasContent(this._activeBuffer.x)&&S.setCellFromCodepoint(this._activeBuffer.x,0,1,m),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,i){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>mp(n.params[0],this._optionsService.rawOptions.windowOptions)?i(n):!0):this._parser.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._parser.registerDcsHandler(e,new vp(i))}registerEscHandler(e,i){return this._parser.registerEscHandler(e,i)}registerOscHandler(e,i){return this._parser.registerOscHandler(e,new It(i))}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 i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);i.hasWidth(this._activeBuffer.x)&&!i.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,i){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+i):(this._activeBuffer.x=e,this._activeBuffer.y=i),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,i){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+i)}cursorUp(e){let i=this._activeBuffer.y-this._activeBuffer.scrollTop;return i>=0?this._moveCursor(0,-Math.min(i,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let i=this._activeBuffer.scrollBottom-this._activeBuffer.y;return i>=0?this._moveCursor(0,Math.min(i,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 i=e.params[0];return i===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:i===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let i=e.params[0];return i===1&&(this._curAttrData.bg|=536870912),(i===2||i===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,i,n,l=!1,o=!1){let c=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);c.replaceCells(i,n,this._activeBuffer.getNullCell(this._eraseAttrData()),o),l&&(c.isWrapped=!1)}_resetBufferLine(e,i=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),i),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,i=!1){var l;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,i);n<this._bufferService.rows;n++)this._resetBufferLine(n,i);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,i),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,i);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&l.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,i);this._dirtyRowTracker.markDirty(0)}break;case 3:let o=this._activeBuffer.lines.length-this._bufferService.rows;o>0&&(this._activeBuffer.lines.trimStart(o),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-o,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-o,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,i=!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,i);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,i);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,i);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,l=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-l+1;for(;i--;)this._activeBuffer.lines.splice(o-1,1),this._activeBuffer.lines.splice(n,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 i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,l;for(l=this._bufferService.rows-1-this._activeBuffer.scrollBottom,l=this._bufferService.rows-1+this._activeBuffer.ybase-l;i--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(l,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 i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.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 i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let i=e.params[0]||1;for(;i--;)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 i=e.params[0]||1;for(;i--;)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(tt));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 i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.deleteCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.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 i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.insertCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.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 i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.insertCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.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 i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.deleteCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.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 i=this._parser.precedingJoinState;if(!i)return!0;let n=e.params[0]||1,l=Js.extractWidth(i),o=this._activeBuffer.x-l,c=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(o),f=new Uint32Array(c.length*n),_=0;for(let d=0;d<c.length;){let m=c.codePointAt(d)||0;f[_++]=m,d+=m>65535?2:1}let v=_;for(let d=1;d<n;++d)f.copyWithin(v,0,_),v+=_;return this.print(f,0,v),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(Y.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(Y.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(Y.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(Y.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(Y.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Qs),this._charsetService.setgCharset(1,Qs),this._charsetService.setgCharset(2,Qs),this._charsetService.setgCharset(3,Qs);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 i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){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[i]===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,i){(E=>(E[E.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",E[E.SET=1]="SET",E[E.RESET=2]="RESET",E[E.PERMANENTLY_SET=3]="PERMANENTLY_SET",E[E.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let l=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:c}=this._coreMouseService,f=this._coreService,{buffers:_,cols:v}=this._bufferService,{active:d,alt:m}=_,S=this._optionsService.rawOptions,y=(E,B)=>(f.triggerDataEvent(`${Y.ESC}[${i?"":"?"}${E};${B}$y`),!0),D=E=>E?1:2,C=e.params[0];return i?C===2?y(C,4):C===4?y(C,D(f.modes.insertMode)):C===12?y(C,3):C===20?y(C,D(S.convertEol)):y(C,0):C===1?y(C,D(l.applicationCursorKeys)):C===3?y(C,S.windowOptions.setWinLines?v===80?2:v===132?1:0:0):C===6?y(C,D(l.origin)):C===7?y(C,D(l.wraparound)):C===8?y(C,3):C===9?y(C,D(o==="X10")):C===12?y(C,D(S.cursorBlink)):C===25?y(C,D(!f.isCursorHidden)):C===45?y(C,D(l.reverseWraparound)):C===66?y(C,D(l.applicationKeypad)):C===67?y(C,4):C===1e3?y(C,D(o==="VT200")):C===1002?y(C,D(o==="DRAG")):C===1003?y(C,D(o==="ANY")):C===1004?y(C,D(l.sendFocus)):C===1005?y(C,4):C===1006?y(C,D(c==="SGR")):C===1015?y(C,4):C===1016?y(C,D(c==="SGR_PIXELS")):C===1048?y(C,1):C===47||C===1047||C===1049?y(C,D(d===m)):C===2004?y(C,D(l.bracketedPasteMode)):C===2026?y(C,D(l.synchronizedOutput)):y(C,0)}_updateAttrColor(e,i,n,l,o){return i===2?(e|=50331648,e&=-16777216,e|=kl.fromColorRGB([n,l,o])):i===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,i,n){let l=[0,0,-1,0,0,0],o=0,c=0;do{if(l[c+o]=e.params[i+c],e.hasSubParams(i+c)){let f=e.getSubParams(i+c),_=0;do l[1]===5&&(o=1),l[c+_+1+o]=f[_];while(++_<f.length&&_+c+1+o<l.length);break}if(l[1]===5&&c+o>=2||l[1]===2&&c+o>=5)break;l[1]&&(o=1)}while(++c+i<e.length&&c+o<l.length);for(let f=2;f<l.length;++f)l[f]===-1&&(l[f]=0);switch(l[0]){case 38:n.fg=this._updateAttrColor(n.fg,l[1],l[3],l[4],l[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,l[1],l[3],l[4],l[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,l[1],l[3],l[4],l[5])}return c}_processUnderline(e,i){i.extended=i.extended.clone(),(!~e||e>5)&&(e=1),i.extended.underlineStyle=e,i.fg|=268435456,e===0&&(i.fg&=-268435457),i.updateExtended()}_processSGR0(e){e.fg=tt.fg,e.bg=tt.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 i=e.length,n,l=this._curAttrData;for(let o=0;o<i;o++)n=e.params[o],n>=30&&n<=37?(l.fg&=-50331904,l.fg|=16777216|n-30):n>=40&&n<=47?(l.bg&=-50331904,l.bg|=16777216|n-40):n>=90&&n<=97?(l.fg&=-50331904,l.fg|=16777216|n-90|8):n>=100&&n<=107?(l.bg&=-50331904,l.bg|=16777216|n-100|8):n===0?this._processSGR0(l):n===1?l.fg|=134217728:n===3?l.bg|=67108864:n===4?(l.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,l)):n===5?l.fg|=536870912:n===7?l.fg|=67108864:n===8?l.fg|=1073741824:n===9?l.fg|=2147483648:n===2?l.bg|=134217728:n===21?this._processUnderline(2,l):n===22?(l.fg&=-134217729,l.bg&=-134217729):n===23?l.bg&=-67108865:n===24?(l.fg&=-268435457,this._processUnderline(0,l)):n===25?l.fg&=-536870913:n===27?l.fg&=-67108865:n===28?l.fg&=-1073741825:n===29?l.fg&=2147483647:n===39?(l.fg&=-67108864,l.fg|=tt.fg&16777215):n===49?(l.bg&=-67108864,l.bg|=tt.bg&16777215):n===38||n===48||n===58?o+=this._extractColor(e,o,l):n===53?l.bg|=1073741824:n===55?l.bg&=-1073741825:n===59?(l.extended=l.extended.clone(),l.extended.underlineColor=-1,l.updateExtended()):n===100?(l.fg&=-67108864,l.fg|=tt.fg&16777215,l.bg&=-67108864,l.bg|=tt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${Y.ESC}[0n`);break;case 6:let i=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Y.ESC}[${i};${n}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let i=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Y.ESC}[?${i};${n}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=tt.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 i=e.length===0?1:e.params[0];if(i===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(i){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 n=i%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let i=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>i&&(this._activeBuffer.scrollTop=i-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!mp(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let i=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:i!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${Y.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(i===0||i===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>pp&&this._windowTitleStack.shift()),(i===0||i===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>pp&&this._iconNameStack.shift());break;case 23:(i===0||i===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(i===0||i===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 i=[],n=e.split(";");for(;n.length>1;){let l=n.shift(),o=n.shift();if(/^\d+$/.exec(l)){let c=parseInt(l);if(bp(c))if(o==="?")i.push({type:0,index:c});else{let f=gp(o);f&&i.push({type:1,index:c,color:f})}}}return i.length&&this._onColor.fire(i),!0}setHyperlink(e){let i=e.indexOf(";");if(i===-1)return!0;let n=e.slice(0,i).trim(),l=e.slice(i+1);return l?this._createHyperlink(n,l):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,i){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),l,o=n.findIndex(c=>c.startsWith("id="));return o!==-1&&(l=n[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:l,uri:i}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,i){let n=e.split(";");for(let l=0;l<n.length&&!(i>=this._specialColors.length);++l,++i)if(n[l]==="?")this._onColor.fire([{type:0,index:this._specialColors[i]}]);else{let o=gp(n[l]);o&&this._onColor.fire([{type:1,index:this._specialColors[i],color:o}])}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 i=[],n=e.split(";");for(let l=0;l<n.length;++l)if(/^\d+$/.exec(n[l])){let o=parseInt(n[l]);bp(o)&&i.push({type:2,index:o})}return i.length&&this._onColor.fire(i),!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,Qs),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(pC[e[0]],ot[e[1]]||Qs),!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=tt.clone(),this._eraseAttrDataInternal=tt.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 ui;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let i=0;i<this._bufferService.rows;++i){let n=this._activeBuffer.ybase+this._activeBuffer.y+i,l=this._activeBuffer.lines.get(n);l&&(l.fill(e),l.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,i){let n=f=>(this._coreService.triggerDataEvent(`${Y.ESC}${f}${Y.ESC}\\`),!0),l=this._bufferService.buffer,o=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${l.scrollTop+1};${l.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[o.cursorStyle]-(o.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,i){this._dirtyRowTracker.markRangeDirty(e,i)}},Nu=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,i){e>i&&(yp=e,e=i,i=yp),e<this.start&&(this.start=e),i>this.end&&(this.end=i)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Nu=$e([te(0,At)],Nu);function bp(e){return 0<=e&&e<256}var SC=5e7,wp=12,yC=50,bC=class extends Se{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 I),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){if(i!==void 0&&this._syncCalls>i){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 n;for(;n=this._writeBuffer.shift();){this._action(n);let l=this._callbacks.shift();l&&l()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,i){if(this._pendingData>SC)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(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let l=this._writeBuffer[this._bufferOffset],o=this._action(l,i);if(o){let f=_=>performance.now()-n>=wp?setTimeout(()=>this._innerWrite(0,_)):this._innerWrite(n,_);o.catch(_=>(queueMicrotask(()=>{throw _}),Promise.resolve(!1))).then(f);return}let c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=l.length,performance.now()-n>=wp)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>yC&&(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()}},Hu=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(e.id===void 0){let _=i.addMarker(i.ybase+i.y),v={data:e,id:this._nextId++,lines:[_]};return _.onDispose(()=>this._removeMarkerFromLink(v,_)),this._dataByLinkId.set(v.id,v),v.id}let n=e,l=this._getEntryIdKey(n),o=this._entriesWithId.get(l);if(o)return this.addLineToLink(o.id,i.ybase+i.y),o.id;let c=i.addMarker(i.ybase+i.y),f={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(f,c)),this._entriesWithId.set(f.key,f),this._dataByLinkId.set(f.id,f),f.id}addLineToLink(e,i){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(l=>l.line!==i)){let l=this._bufferService.buffer.addMarker(i);n.lines.push(l),l.onDispose(()=>this._removeMarkerFromLink(n,l))}}getLinkData(e){var i;return(i=this._dataByLinkId.get(e))==null?void 0:i.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let n=e.lines.indexOf(i);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Hu=$e([te(0,At)],Hu);var Cp=!1,wC=class extends Se{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ln),this._onBinary=this._register(new I),this.onBinary=this._onBinary.event,this._onData=this._register(new I),this.onData=this._onData.event,this._onLineFeed=this._register(new I),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new I),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new I),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new I),this._instantiationService=new Xw,this.optionsService=this._register(new iC(e)),this._instantiationService.setService(Bt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Bu)),this._instantiationService.setService(At,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Au)),this._instantiationService.setService(sm,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Ou)),this._instantiationService.setService(hr,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(zu)),this._instantiationService.setService(im,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Js)),this._instantiationService.setService(W1,this.unicodeService),this._charsetService=this._instantiationService.createInstance(aC),this._instantiationService.setService(j1,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Hu),this._instantiationService.setService(rm,this._oscLinkService),this._inputHandler=this._register(new mC(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(wt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(wt.forward(this._bufferService.onResize,this._onResize)),this._register(wt.forward(this.coreService.onData,this._onData)),this._register(wt.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 bC((i,n)=>this._inputHandler.parse(i,n))),this._register(wt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new I),this._onScroll.event(e=>{var i;(i=this._onScrollApi)==null||i.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 i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!Cp&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Cp=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,Nm),i=Math.max(i,Hm),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}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 i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&i.buildNumber!==void 0&&i.buildNumber!==void 0?e=i.backend==="conpty"&&i.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(_p.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(_p(this._bufferService),!1))),this._windowsWrappingHeuristics.value=je(()=>{for(let i of e)i.dispose()})}}},CC={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 xC(e,i,n,l){var f;let o={type:0,cancel:!1,key:void 0},c=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?i?o.key=Y.ESC+"OA":o.key=Y.ESC+"[A":e.key==="UIKeyInputLeftArrow"?i?o.key=Y.ESC+"OD":o.key=Y.ESC+"[D":e.key==="UIKeyInputRightArrow"?i?o.key=Y.ESC+"OC":o.key=Y.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(i?o.key=Y.ESC+"OB":o.key=Y.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":Y.DEL,e.altKey&&(o.key=Y.ESC+o.key);break;case 9:if(e.shiftKey){o.key=Y.ESC+"[Z";break}o.key=Y.HT,o.cancel=!0;break;case 13:o.key=e.altKey?Y.ESC+Y.CR:Y.CR,o.cancel=!0;break;case 27:o.key=Y.ESC,e.altKey&&(o.key=Y.ESC+Y.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;c?o.key=Y.ESC+"[1;"+(c+1)+"D":i?o.key=Y.ESC+"OD":o.key=Y.ESC+"[D";break;case 39:if(e.metaKey)break;c?o.key=Y.ESC+"[1;"+(c+1)+"C":i?o.key=Y.ESC+"OC":o.key=Y.ESC+"[C";break;case 38:if(e.metaKey)break;c?o.key=Y.ESC+"[1;"+(c+1)+"A":i?o.key=Y.ESC+"OA":o.key=Y.ESC+"[A";break;case 40:if(e.metaKey)break;c?o.key=Y.ESC+"[1;"+(c+1)+"B":i?o.key=Y.ESC+"OB":o.key=Y.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=Y.ESC+"[2~");break;case 46:c?o.key=Y.ESC+"[3;"+(c+1)+"~":o.key=Y.ESC+"[3~";break;case 36:c?o.key=Y.ESC+"[1;"+(c+1)+"H":i?o.key=Y.ESC+"OH":o.key=Y.ESC+"[H";break;case 35:c?o.key=Y.ESC+"[1;"+(c+1)+"F":i?o.key=Y.ESC+"OF":o.key=Y.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=Y.ESC+"[5;"+(c+1)+"~":o.key=Y.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=Y.ESC+"[6;"+(c+1)+"~":o.key=Y.ESC+"[6~";break;case 112:c?o.key=Y.ESC+"[1;"+(c+1)+"P":o.key=Y.ESC+"OP";break;case 113:c?o.key=Y.ESC+"[1;"+(c+1)+"Q":o.key=Y.ESC+"OQ";break;case 114:c?o.key=Y.ESC+"[1;"+(c+1)+"R":o.key=Y.ESC+"OR";break;case 115:c?o.key=Y.ESC+"[1;"+(c+1)+"S":o.key=Y.ESC+"OS";break;case 116:c?o.key=Y.ESC+"[15;"+(c+1)+"~":o.key=Y.ESC+"[15~";break;case 117:c?o.key=Y.ESC+"[17;"+(c+1)+"~":o.key=Y.ESC+"[17~";break;case 118:c?o.key=Y.ESC+"[18;"+(c+1)+"~":o.key=Y.ESC+"[18~";break;case 119:c?o.key=Y.ESC+"[19;"+(c+1)+"~":o.key=Y.ESC+"[19~";break;case 120:c?o.key=Y.ESC+"[20;"+(c+1)+"~":o.key=Y.ESC+"[20~";break;case 121:c?o.key=Y.ESC+"[21;"+(c+1)+"~":o.key=Y.ESC+"[21~";break;case 122:c?o.key=Y.ESC+"[23;"+(c+1)+"~":o.key=Y.ESC+"[23~";break;case 123:c?o.key=Y.ESC+"[24;"+(c+1)+"~":o.key=Y.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=Y.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=Y.DEL:e.keyCode===219?o.key=Y.ESC:e.keyCode===220?o.key=Y.FS:e.keyCode===221&&(o.key=Y.GS);else if((!n||l)&&e.altKey&&!e.metaKey){let _=(f=CC[e.keyCode])==null?void 0:f[e.shiftKey?1:0];if(_)o.key=Y.ESC+_;else if(e.keyCode>=65&&e.keyCode<=90){let v=e.ctrlKey?e.keyCode-64:e.keyCode+32,d=String.fromCharCode(v);e.shiftKey&&(d=d.toUpperCase()),o.key=Y.ESC+d}else if(e.keyCode===32)o.key=Y.ESC+(e.ctrlKey?Y.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let v=e.code.slice(3,4);e.shiftKey||(v=v.toLowerCase()),o.key=Y.ESC+v,o.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(o.key=Y.US),e.key==="@"&&(o.key=Y.NUL));break}return o}var Ze=0,EC=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new _o,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new _o,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((o,c)=>this._getKey(o)-this._getKey(c)),i=0,n=0,l=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<l.length;o++)n>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[n])?(l[o]=e[i],i++):l[o]=this._array[n++];this._array=l,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 i=this._getKey(e);if(i===void 0||(Ze=this._search(i),Ze===-1)||this._getKey(this._array[Ze])!==i)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])===i);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((o,c)=>o-c),i=0,n=new Array(this._array.length-e.length),l=0;for(let o=0;o<this._array.length;o++)e[i]===o?i++:n[l++]=this._array[o];this._array=n,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,i){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 i(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 i=0,n=this._array.length-1;for(;n>=i;){let l=i+n>>1,o=this._getKey(this._array[l]);if(o>e)n=l-1;else if(o<e)i=l+1;else{for(;l>0&&this._getKey(this._array[l-1])===e;)l--;return l}}return i}},Zc=0,xp=0,kC=class extends Se{constructor(){super(),this._decorations=new EC(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new I),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new I),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(je(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let i=new DC(e);if(i){let n=i.marker.onDispose(()=>i.dispose()),l=i.onDispose(()=>{l.dispose(),i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),n.dispose())});this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i,n){let l=0,o=0;for(let c of this._decorations.getKeyIterator(i))l=c.options.x??0,o=l+(c.options.width??1),e>=l&&e<o&&(!n||(c.options.layer??"bottom")===n)&&(yield c)}forEachDecorationAtCell(e,i,n,l){this._decorations.forEachByKey(i,o=>{Zc=o.options.x??0,xp=Zc+(o.options.width??1),e>=Zc&&e<xp&&(!n||(o.options.layer??"bottom")===n)&&l(o)})}},DC=class extends Rs{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new I),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new I),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=Ke.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Ke.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},MC=1e3,RC=class{constructor(e,i=MC){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i: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,i):i;let l=performance.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=l-this._lastRefreshMs,c=this._debounceThresholdMS-o;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},c)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},Ep=20,vo=class extends Se{constructor(e,i,n,l){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=l,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let o=this._coreBrowserService.mainDocument;this._accessibilityContainer=o.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,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=o.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new RC(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(c=>this._handleResize(c.rows))),this._register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(c=>this._handleChar(c))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
128
|
+
`))),this._register(this._terminal.onA11yTab(c=>this._handleTab(c))),this._register(this._terminal.onKey(c=>this._handleKey(c.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(fe(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(je(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Ep+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
129
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Ep+1&&(this._liveRegion.textContent+=su.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,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){let n=this._terminal.buffer,l=n.lines.length.toString();for(let o=e;o<=i;o++){let c=n.lines.get(n.ydisp+o),f=[],_=(c==null?void 0:c.translateToString(!0,void 0,void 0,f))||"",v=(n.ydisp+o+1).toString(),d=this._rowElements[o];d&&(_.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=_,this._rowColumns.set(d,f)),d.setAttribute("aria-posinset",v),d.setAttribute("aria-setsize",l),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){let n=e.target,l=this._rowElements[i===0?1:this._rowElements.length-2],o=n.getAttribute("aria-posinset"),c=i===0?"1":`${this._terminal.buffer.lines.length}`;if(o===c||e.relatedTarget!==l)return;let f,_;if(i===0?(f=n,_=this._rowElements.pop(),this._rowContainer.removeChild(_)):(f=this._rowElements.shift(),_=n,this._rowContainer.removeChild(f)),f.removeEventListener("focus",this._topBoundaryFocusListener),_.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){let v=this._createAccessibilityTreeNode();this._rowElements.unshift(v),this._rowContainer.insertAdjacentElement("afterbegin",v)}else{let v=this._createAccessibilityTreeNode();this._rowElements.push(v),this._rowContainer.appendChild(v)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var _;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 i={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===n.node&&i.offset>n.offset)&&([i,n]=[n,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;let l=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(l)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:l,offset:((_=l.textContent)==null?void 0:_.length)??0}),!this._rowContainer.contains(n.node))return;let o=({node:v,offset:d})=>{let m=v instanceof Text?v.parentNode:v,S=parseInt(m==null?void 0:m.getAttribute("aria-posinset"),10)-1;if(isNaN(S))return console.warn("row is invalid. Race condition?"),null;let y=this._rowColumns.get(m);if(!y)return console.warn("columns is null. Race condition?"),null;let D=d<y.length?y[d]:y.slice(-1)[0]+1;return D>=this._terminal.cols&&(++S,D=0),{row:S,column:D}},c=o(i),f=o(n);if(!(!c||!f)){if(c.row>f.row||c.row===f.row&&c.column>=f.column)throw new Error("invalid range");this._terminal.select(c.column,c.row,(f.row-c.row)*this._terminal.cols-c.column+f.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;i<this._terminal.rows;i++)this._rowElements[i]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i]);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 o,c;e.style.transform="";let i=e.getBoundingClientRect().width,n=(c=(o=this._rowColumns.get(e))==null?void 0:o.slice(-1))==null?void 0:c[0];if(!n)return;let l=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${l/i})`}};vo=$e([te(1,Fu),te(2,Fi),te(3,Ii)],vo);var Uu=class extends Se{constructor(e,i,n,l,o){super(),this._element=e,this._mouseService=i,this._renderService=n,this._bufferService=l,this._linkProviderService=o,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new I),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new I),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(je(()=>{var c;rr(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(c=this._activeProviderReplies)==null||c.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(fe(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(fe(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(fe(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(fe(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;let n=e.composedPath();for(let l=0;l<n.length;l++){let o=n[l];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}(!this._lastBufferCell||i.x!==this._lastBufferCell.x||i.y!==this._lastBufferCell.y)&&(this._handleHover(i),this._lastBufferCell=i)}_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,i){var l,o;(!this._activeProviderReplies||!i)&&((l=this._activeProviderReplies)==null||l.forEach(c=>{c==null||c.forEach(f=>{f.link.dispose&&f.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[c,f]of this._linkProviderService.linkProviders.entries())i?(o=this._activeProviderReplies)!=null&&o.get(c)&&(n=this._checkLinkProviderResult(c,e,n)):f.provideLinks(e.y,_=>{var d,m;if(this._isMouseOut)return;let v=_==null?void 0:_.map(S=>({link:S}));(d=this._activeProviderReplies)==null||d.set(c,v),n=this._checkLinkProviderResult(c,e,n),((m=this._activeProviderReplies)==null?void 0:m.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,i){let n=new Set;for(let l=0;l<i.size;l++){let o=i.get(l);if(o)for(let c=0;c<o.length;c++){let f=o[c],_=f.link.range.start.y<e?0:f.link.range.start.x,v=f.link.range.end.y>e?this._bufferService.cols:f.link.range.end.x;for(let d=_;d<=v;d++){if(n.has(d)){o.splice(c--,1);break}n.add(d)}}}}_checkLinkProviderResult(e,i,n){var c;if(!this._activeProviderReplies)return n;let l=this._activeProviderReplies.get(e),o=!1;for(let f=0;f<e;f++)(!this._activeProviderReplies.has(f)||this._activeProviderReplies.get(f))&&(o=!0);if(!o&&l){let f=l.find(_=>this._linkAtPosition(_.link,i));f&&(n=!0,this._handleNewLink(f))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let f=0;f<this._activeProviderReplies.size;f++){let _=(c=this._activeProviderReplies.get(f))==null?void 0:c.find(v=>this._linkAtPosition(v.link,i));if(_){n=!0,this._handleNewLink(_);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);i&&this._mouseDownLink&&TC(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,i){!this._currentLink||!this._lastMouseEvent||(!e||!i||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,rr(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(e.link,i)&&(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 n,l;return(l=(n=this._currentLink)==null?void 0:n.state)==null?void 0:l.decorations.pointerCursor},set:n=>{var l;(l=this._currentLink)!=null&&l.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,l;return(l=(n=this._currentLink)==null?void 0:n.state)==null?void 0:l.decorations.underline},set:n=>{var l,o,c;(l=this._currentLink)!=null&&l.state&&((c=(o=this._currentLink)==null?void 0:o.state)==null?void 0:c.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let l=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(l,o),this._lastMouseEvent)){let c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}})))}_linkHover(e,i,n){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(n,i.text)}_fireUnderlineEvent(e,i){let n=e.range,l=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-l-1,n.end.x,n.end.y-l-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,i,n){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(n,i.text)}_linkAtPosition(e,i){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,l=e.range.end.y*this._bufferService.cols+e.range.end.x,o=i.y*this._bufferService.cols+i.x;return n<=o&&o<=l}_positionFromMouseEvent(e,i,n){let l=n.getCoords(e,i,this._bufferService.cols,this._bufferService.rows);if(l)return{x:l[0],y:l[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,i,n,l,o){return{x1:e,y1:i,x2:n,y2:l,cols:this._bufferService.cols,fg:o}}};Uu=$e([te(1,Iu),te(2,Ii),te(3,At),te(4,lm)],Uu);function TC(e,i){return e.text===i.text&&e.range.start.x===i.range.start.x&&e.range.start.y===i.range.start.y&&e.range.end.x===i.range.end.x&&e.range.end.y===i.range.end.y}var AC=class extends wC{constructor(e={}){super(e),this._linkifier=this._register(new ln),this.browser=Em,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ln),this._onCursorMove=this._register(new I),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new I),this.onKey=this._onKey.event,this._onRender=this._register(new I),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new I),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new I),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new I),this.onBell=this._onBell.event,this._onFocus=this._register(new I),this._onBlur=this._register(new I),this._onA11yCharEmitter=this._register(new I),this._onA11yTabEmitter=this._register(new I),this._onWillOpen=this._register(new I),this._setup(),this._decorationService=this._instantiationService.createInstance(kC),this._instantiationService.setService(Dl,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(yw),this._instantiationService.setService(lm,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(nu)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh((i==null?void 0:i.start)??0,(i==null?void 0:i.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(i=>this._reportWindowsOptions(i))),this._register(this._inputHandler.onColor(i=>this._handleColorEvent(i))),this._register(wt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(wt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(wt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(wt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register(je(()=>{var i,n;this._customKeyEventHandler=void 0,(n=(i=this.element)==null?void 0:i.parentNode)==null||n.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 i of e){let n,l="";switch(i.index){case 256:n="foreground",l="10";break;case 257:n="background",l="11";break;case 258:n="cursor",l="12";break;default:n="ansi",l="4;"+i.index}switch(i.type){case 0:let o=Pe.toColorRGB(n==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${Y.ESC}]${l};${gC(o)}${Cm.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(c=>c.ansi[i.index]=it.toColor(...i.color));else{let c=n;this._themeService.modifyColors(f=>f[c]=it.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.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(vo,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.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(Y.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,i=this.buffer.lines.get(e);if(!i)return;let n=Math.min(this.buffer.x,this.cols-1),l=this._renderService.dimensions.css.cell.height,o=i.getWidth(n),c=this._renderService.dimensions.css.cell.width*o,f=this.buffer.y*this._renderService.dimensions.css.cell.height,_=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_+"px",this.textarea.style.top=f+"px",this.textarea.style.width=c+"px",this.textarea.style.height=l+"px",this.textarea.style.lineHeight=l+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(fe(this.element,"copy",i=>{this.hasSelection()&&L1(i,this._selectionService)}));let e=i=>N1(i,this.textarea,this.coreService,this.optionsService);this._register(fe(this.textarea,"paste",e)),this._register(fe(this.element,"paste",e)),km?this._register(fe(this.element,"mousedown",i=>{i.button===2&&Lg(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(fe(this.element,"contextmenu",i=>{Lg(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),nf&&this._register(fe(this.element,"auxclick",i=>{i.button===1&&Zp(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(fe(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(fe(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(fe(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(fe(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(fe(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(fe(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(fe(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var o;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"),((o=this.element)==null?void 0:o.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 i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(fe(this.screenElement,"mousemove",c=>this.updateCursorStyle(c))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",iu.get()),Rm||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",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(mw,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Fi,this._coreBrowserService),this._register(fe(this.textarea,"focus",c=>this._handleTextAreaFocus(c))),this._register(fe(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(ku,this._document,this._helperContainer),this._instantiationService.setService(mo,this._charSizeService),this._themeService=this._instantiationService.createInstance(Tu),this._instantiationService.setService(an,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(uo),this._instantiationService.setService(nm,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Mu,this.rows,this.screenElement)),this._instantiationService.setService(Ii,this._renderService),this._register(this._renderService.onRenderedViewportChange(c=>this._onRender.fire(c))),this.onResize(c=>this._renderService.resize(c.cols,c.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Cu,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Du),this._instantiationService.setService(Iu,this._mouseService);let l=this._linkifier.value=this._register(this._instantiationService.createInstance(Uu,this.screenElement));this.element.appendChild(i);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(bu,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(c=>{super.scrollLines(c,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Ru,this.element,this.screenElement,l)),this._instantiationService.setService(K1,this._selectionService),this._register(this._selectionService.onRequestScrollLines(c=>this.scrollLines(c.amount,c.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(c=>this._renderService.handleSelectionChanged(c.start,c.end,c.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(c=>{this.textarea.value=c,this.textarea.focus(),this.textarea.select()})),this._register(wt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var c;this._selectionService.refresh(),(c=this._viewport)==null||c.queueSync()})),this._register(this._instantiationService.createInstance(wu,this.screenElement)),this._register(fe(this.element,"mousedown",c=>this._selectionService.handleMouseDown(c))),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(vo,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",c=>this._handleScreenReaderModeOptionChange(c))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(co,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",c=>{!this._overviewRulerRenderer&&c&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(co,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Eu,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function n(c){var d,m,S,y,D;let f=e._mouseService.getMouseReportCoords(c,e.screenElement);if(!f)return!1;let _,v;switch(c.overrideType||c.type){case"mousemove":v=32,c.buttons===void 0?(_=3,c.button!==void 0&&(_=c.button<3?c.button:3)):_=c.buttons&1?0:c.buttons&4?1:c.buttons&2?2:3;break;case"mouseup":v=0,_=c.button<3?c.button:3;break;case"mousedown":v=1,_=c.button<3?c.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(c)===!1)return!1;let C=c.deltaY;if(C===0||e.coreMouseService.consumeWheelEvent(c,(y=(S=(m=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:m.device)==null?void 0:S.cell)==null?void 0:y.height,(D=e._coreBrowserService)==null?void 0:D.dpr)===0)return!1;v=C<0?0:1,_=4;break;default:return!1}return v===void 0||_===void 0||_>4?!1:e.coreMouseService.triggerMouseEvent({col:f.col,row:f.row,x:f.x,y:f.y,button:_,action:v,ctrl:c.ctrlKey,alt:c.altKey,shift:c.shiftKey})}let l={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:c=>(n(c),c.buttons||(this._document.removeEventListener("mouseup",l.mouseup),l.mousedrag&&this._document.removeEventListener("mousemove",l.mousedrag)),this.cancel(c)),wheel:c=>(n(c),this.cancel(c,!0)),mousedrag:c=>{c.buttons&&n(c)},mousemove:c=>{c.buttons||n(c)}};this._register(this.coreMouseService.onProtocolChange(c=>{c?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(c)),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()),c&8?l.mousemove||(i.addEventListener("mousemove",o.mousemove),l.mousemove=o.mousemove):(i.removeEventListener("mousemove",l.mousemove),l.mousemove=null),c&16?l.wheel||(i.addEventListener("wheel",o.wheel,{passive:!1}),l.wheel=o.wheel):(i.removeEventListener("wheel",l.wheel),l.wheel=null),c&2?l.mouseup||(l.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",l.mouseup),l.mouseup=null),c&4?l.mousedrag||(l.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",l.mousedrag),l.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(fe(i,"mousedown",c=>{if(c.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(c)))return n(c),l.mouseup&&this._document.addEventListener("mouseup",l.mouseup),l.mousedrag&&this._document.addEventListener("mousemove",l.mousedrag),this.cancel(c)})),this._register(fe(i,"wheel",c=>{var f,_,v,d,m;if(!l.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(c)===!1)return!1;if(!this.buffer.hasScrollback){if(c.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(c,(d=(v=(_=(f=e._renderService)==null?void 0:f.dimensions)==null?void 0:_.device)==null?void 0:v.cell)==null?void 0:d.height,(m=e._coreBrowserService)==null?void 0:m.dpr)===0)return this.cancel(c,!0);let S=Y.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(c.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(S,!0),this.cancel(c,!0)}}},{passive:!1}))}refresh(e,i){var n;(n=this._renderService)==null||n.refreshRows(e,i)}updateCursorStyle(e){var i;(i=this._selectionService)!=null&&i.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,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),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 i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}paste(e){Ip(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 i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}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,i,n){this._selectionService.setSelection(e,i,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,i){var n;(n=this._selectionService)==null||n.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!i&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=xC(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let l=this.rows-1;return this.scrollLines(n.type===2?-l:l),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.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((n.key===Y.ETX||n.key===Y.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i){let n=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return i.type==="keypress"?n:n&&(!i.keyCode||i.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(BC(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(e.which===null||e.which===void 0)i=e.keyCode;else if(e.which!==0&&e.charCode!==0)i=e.which;else return!1;return!i||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!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 i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){var n;(n=this._charSizeService)==null||n.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(tt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var i;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(i=this._selectionService)==null||i.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(Y.ESC+"[I"):this.coreService.triggerDataEvent(Y.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.ESC}[4;${n};${i}t`);break;case 1:let l=this._renderService.dimensions.css.cell.width.toFixed(0),o=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.ESC}[6;${o};${l}t`);break}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}};function BC(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var OC=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let n={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(n),i.dispose=()=>this._wrappedAddonDispose(n),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){i=n;break}if(i===-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(i,1)}},zC=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,i){if(!(e<0||e>=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new ui)}translateToString(e,i,n){return this._line.translateToString(e,i,n)}},kp=class{constructor(e,i){this._buffer=e,this.type=i}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 i=this._buffer.lines.get(e);if(i)return new zC(i)}getNullCell(){return new ui}},LC=class extends Se{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new I),this.onBufferChange=this._onBufferChange.event,this._normal=new kp(this._core.buffers.normal,"normal"),this._alternate=new kp(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)}},NC=class{constructor(e){this._core=e}registerCsiHandler(e,i){return this._core.registerCsiHandler(e,n=>i(n.toArray()))}addCsiHandler(e,i){return this.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._core.registerDcsHandler(e,(n,l)=>i(n,l.toArray()))}addDcsHandler(e,i){return this.registerDcsHandler(e,i)}registerEscHandler(e,i){return this._core.registerEscHandler(e,i)}addEscHandler(e,i){return this.registerEscHandler(e,i)}registerOscHandler(e,i){return this._core.registerOscHandler(e,i)}addOscHandler(e,i){return this.registerOscHandler(e,i)}},HC=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}},UC=["cols","rows"],xi=0,PC=class extends Se{constructor(e){super(),this._core=this._register(new AC(e)),this._addonManager=this._register(new OC),this._publicOptions={...this._core.options};let i=l=>this._core.options[l],n=(l,o)=>{this._checkReadonlyOptions(l),this._core.options[l]=o};for(let l in this._core.options){let o={get:i.bind(this,l),set:n.bind(this,l)};Object.defineProperty(this._publicOptions,l,o)}}_checkReadonlyOptions(e){if(UC.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 NC(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new HC(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 LC(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,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 i in e)this._publicOptions[i]=e[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,i=!0){this._core.input(e,i)}resize(e,i){this._verifyIntegers(e,i),this._core.resize(e,i)}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,i,n){this._verifyIntegers(e,i,n),this._core.select(e,i,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,i){this._verifyIntegers(e,i),this._core.selectLines(e,i)}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,i){this._core.write(e,i)}writeln(e,i){this._core.write(e),this._core.write(`\r
|
|
130
|
+
`,i)}paste(e){this._core.paste(e)}refresh(e,i){this._verifyIntegers(e,i),this._core.refresh(e,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return iu.get()},set promptLabel(e){iu.set(e)},get tooMuchOutput(){return su.get()},set tooMuchOutput(e){su.set(e)}}}_verifyIntegers(...e){for(xi of e)if(xi===1/0||isNaN(xi)||xi%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(xi of e)if(xi&&(xi===1/0||isNaN(xi)||xi%1!==0||xi<0))throw new Error("This API only accepts positive integers")}};/**
|
|
131
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
132
|
+
* @license MIT
|
|
133
|
+
*
|
|
134
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
135
|
+
* @license MIT
|
|
136
|
+
*
|
|
137
|
+
* Originally forked from (with the author's permission):
|
|
138
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
139
|
+
* http://bellard.org/jslinux/
|
|
140
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
141
|
+
*/var qC=2,jC=1,WC=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let i=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var S;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 i=this._terminal.options.scrollback===0?0:((S=this._terminal.options.overviewRuler)==null?void 0:S.width)||14,n=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(n.getPropertyValue("height")),o=Math.max(0,parseInt(n.getPropertyValue("width"))),c=window.getComputedStyle(this._terminal.element),f={top:parseInt(c.getPropertyValue("padding-top")),bottom:parseInt(c.getPropertyValue("padding-bottom")),right:parseInt(c.getPropertyValue("padding-right")),left:parseInt(c.getPropertyValue("padding-left"))},_=f.top+f.bottom,v=f.right+f.left,d=l-_,m=o-v-i;return{cols:Math.max(qC,Math.floor(m/e.css.cell.width)),rows:Math.max(jC,Math.floor(d/e.css.cell.height))}}};/**
|
|
142
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
143
|
+
* @license MIT
|
|
144
|
+
*
|
|
145
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
146
|
+
* @license MIT
|
|
147
|
+
*
|
|
148
|
+
* Originally forked from (with the author's permission):
|
|
149
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
150
|
+
* http://bellard.org/jslinux/
|
|
151
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
152
|
+
*/var YC=class{constructor(e,i,n,l={}){this._terminal=e,this._regex=i,this._handler=n,this._options=l}provideLinks(e,i){let n=VC.computeLink(e,this._regex,this._terminal,this._handler);i(this._addCallbacks(n))}_addCallbacks(e){return e.map(i=>(i.leave=this._options.leave,i.hover=(n,l)=>{if(this._options.hover){let{range:o}=i;this._options.hover(n,l,o)}},i))}};function KC(e){try{let i=new URL(e),n=i.password&&i.username?`${i.protocol}//${i.username}:${i.password}@${i.host}`:i.username?`${i.protocol}//${i.username}@${i.host}`:`${i.protocol}//${i.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var VC=class oo{static computeLink(i,n,l,o){let c=new RegExp(n.source,(n.flags||"")+"g"),[f,_]=oo._getWindowedLineStrings(i-1,l),v=f.join(""),d,m=[];for(;d=c.exec(v);){let S=d[0];if(!KC(S))continue;let[y,D]=oo._mapStrIdx(l,_,0,d.index),[C,E]=oo._mapStrIdx(l,y,D,S.length);if(y===-1||D===-1||C===-1||E===-1)continue;let B={start:{x:D+1,y:y+1},end:{x:E,y:C+1}};m.push({range:B,text:S,activate:o})}return m}static _getWindowedLineStrings(i,n){let l,o=i,c=i,f=0,_="",v=[];if(l=n.buffer.active.getLine(i)){let d=l.translateToString(!0);if(l.isWrapped&&d[0]!==" "){for(f=0;(l=n.buffer.active.getLine(--o))&&f<2048&&(_=l.translateToString(!0),f+=_.length,v.push(_),!(!l.isWrapped||_.indexOf(" ")!==-1)););v.reverse()}for(v.push(d),f=0;(l=n.buffer.active.getLine(++c))&&l.isWrapped&&f<2048&&(_=l.translateToString(!0),f+=_.length,v.push(_),_.indexOf(" ")===-1););}return[v,o]}static _mapStrIdx(i,n,l,o){let c=i.buffer.active,f=c.getNullCell(),_=l;for(;o;){let v=c.getLine(n);if(!v)return[-1,-1];for(let d=_;d<v.length;++d){v.getCell(d,f);let m=f.getChars();if(f.getWidth()&&(o-=m.length||1,d===v.length-1&&m==="")){let S=c.getLine(n+1);S&&S.isWrapped&&(S.getCell(0,f),f.getWidth()===2&&(o+=1))}if(o<0)return[n,d]}n++,_=0}return[n,_]}},XC=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function GC(e,i){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}var $C=class{constructor(e=GC,i={}){this._handler=e,this._options=i}activate(e){this._terminal=e;let i=this._options,n=i.urlRegex||XC;this._linkProvider=this._terminal.registerLinkProvider(new YC(this._terminal,n,this._handler,i))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};let kt=null;const Jr=go((e,i)=>({connected:!1,connectedSession:null,onMessage:null,connect:n=>{kt&&(kt.close(),kt=null);const o=`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/ws/terminal/${encodeURIComponent(n)}`,c=new WebSocket(o);kt=c,c.binaryType="arraybuffer",c.onopen=()=>{e({connected:!0,connectedSession:n})},c.onmessage=f=>{const _=i().onMessage;if(_)if(f.data instanceof ArrayBuffer)_(f.data);else try{const v=JSON.parse(f.data);v.type==="replay"?_(v.data):v.type==="error"&&console.error("[ws]",v.message)}catch{_(f.data)}},c.onclose=()=>{e({connected:!1,connectedSession:null}),kt=null},c.onerror=()=>{c.close()}},disconnect:()=>{kt&&(kt.close(),kt=null),e({connected:!1,connectedSession:null})},send:n=>{(kt==null?void 0:kt.readyState)===WebSocket.OPEN&&kt.send(n)},resize:(n,l)=>{(kt==null?void 0:kt.readyState)===WebSocket.OPEN&&kt.send(JSON.stringify({type:"resize",cols:n,rows:l}))},setOnMessage:n=>{e({onMessage:n})}}));function eo(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function FC(e,i){const n=ge.useRef(null),l=ge.useRef(null);ge.useEffect(()=>{const o=i.current;if(!o)return;const c=new PC({fontFamily:eo("--font-mono")||"'JetBrains Mono', monospace",fontSize:14,theme:{background:eo("--color-terminal-bg")||"#0D1117",foreground:eo("--color-terminal-text")||"#E6EDF3",cursor:eo("--color-terminal-text")||"#E6EDF3",selectionBackground:"rgba(91,107,255,0.3)"},cursorBlink:!0,allowProposedApi:!0}),f=new WC;c.loadAddon(f),c.loadAddon(new $C),c.open(o),f.fit(),n.current=c,l.current=f,Jr.getState().setOnMessage(d=>{typeof d=="string"?c.write(d):c.write(new Uint8Array(d))});const _=c.onData(d=>{Jr.getState().send(d)});Jr.getState().connect(e);const v=new ResizeObserver(()=>{f.fit();const{cols:d,rows:m}=c;Jr.getState().resize(d,m)});return v.observe(o),()=>{v.disconnect(),_.dispose(),Jr.getState().setOnMessage(null),Jr.getState().disconnect(),c.dispose(),n.current=null,l.current=null}},[e,i])}function Dp({sessionName:e}){const i=ge.useRef(null);return FC(e,i),Z.jsx("div",{ref:i,className:"h-full w-full bg-terminal-bg"})}function IC({url:e}){return Z.jsx("iframe",{src:e,title:"Preview",className:"h-full w-full border-0"})}function ZC({sessionName:e}){const i=Zt(f=>f.sessionMetas),n=qu(f=>f.previewVisible),l=i[e],o=l==null?void 0:l.previewUrl;return n&&!!o?Z.jsxs(Gp,{orientation:"vertical",className:"min-h-0 flex-1",children:[Z.jsx(tu,{defaultSize:"60%",minSize:"20%",children:Z.jsx(Dp,{sessionName:e})}),Z.jsx($p,{className:"h-1.5 bg-divider transition-colors hover:bg-accent dark:bg-divider-dark dark:hover:bg-accent-dark"}),Z.jsx(tu,{defaultSize:"40%",minSize:"15%",children:Z.jsx(IC,{url:o})})]}):Z.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:Z.jsx(Dp,{sessionName:e})})}function QC(){const e=Zt(i=>i.activeSessionName);return e?Z.jsx(ZC,{sessionName:e}):Z.jsxs("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden",children:[Z.jsx(Zy,{}),Z.jsx(Iy,{})]})}function JC(){return Z.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[Z.jsx(Fy,{}),Z.jsx(QC,{})]})}function e2(){const e=qu(i=>i.sidebarOpen);return Z.jsxs("div",{className:"flex h-dvh w-dvw overflow-hidden bg-bg dark:bg-bg-dark",children:[e&&Z.jsx($y,{}),Z.jsx(JC,{})]})}function t2(){const e=Qc(n=>n.hydrate),i=Zt(n=>n.startPolling);return ge.useEffect(()=>(e(),i()),[e,i]),Z.jsx(e2,{})}py.createRoot(document.getElementById("root")).render(Z.jsx(t2,{}));
|