aegis-bridge 2.13.1 → 2.15.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.
@@ -0,0 +1,312 @@
1
+ var g0=Object.defineProperty;var y0=(i,r,a)=>r in i?g0(i,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[r]=a;var _t=(i,r,a)=>y0(i,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const v of document.querySelectorAll('link[rel="modulepreload"]'))o(v);new MutationObserver(v=>{for(const k of v)if(k.type==="childList")for(const E of k.addedNodes)E.tagName==="LINK"&&E.rel==="modulepreload"&&o(E)}).observe(document,{childList:!0,subtree:!0});function a(v){const k={};return v.integrity&&(k.integrity=v.integrity),v.referrerPolicy&&(k.referrerPolicy=v.referrerPolicy),v.crossOrigin==="use-credentials"?k.credentials="include":v.crossOrigin==="anonymous"?k.credentials="omit":k.credentials="same-origin",k}function o(v){if(v.ep)return;v.ep=!0;const k=a(v);fetch(v.href,k)}})();function F_(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Xc={exports:{}},Nn={};/**
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 Um;function b0(){if(Um)return Nn;Um=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(o,v,k){var E=null;if(k!==void 0&&(E=""+k),v.key!==void 0&&(E=""+v.key),"key"in v){k={};for(var c in v)c!=="key"&&(k[c]=v[c])}else k=v;return v=k.ref,{$$typeof:i,type:o,key:E,ref:v!==void 0?v:null,props:k}}return Nn.Fragment=r,Nn.jsx=a,Nn.jsxs=a,Nn}var $m;function S0(){return $m||($m=1,Xc.exports=b0()),Xc.exports}var b=S0(),Jc={exports:{}},we={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Im;function x0(){if(Im)return we;Im=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),E=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),x=Symbol.iterator;function T(N){return N===null||typeof N!="object"?null:(N=x&&N[x]||N["@@iterator"],typeof N=="function"?N:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,m={};function g(N,B,P){this.props=N,this.context=B,this.refs=m,this.updater=P||O}g.prototype.isReactComponent={},g.prototype.setState=function(N,B){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,B,"setState")},g.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function d(){}d.prototype=g.prototype;function p(N,B,P){this.props=N,this.context=B,this.refs=m,this.updater=P||O}var S=p.prototype=new d;S.constructor=p,C(S,g.prototype),S.isPureReactComponent=!0;var A=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function L(N,B,P){var Y=P.ref;return{$$typeof:i,type:N,key:B,ref:Y!==void 0?Y:null,props:P}}function $(N,B){return L(N.type,B,N.props)}function F(N){return typeof N=="object"&&N!==null&&N.$$typeof===i}function K(N){var B={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(P){return B[P]})}var Z=/\/+/g;function J(N,B){return typeof N=="object"&&N!==null&&N.key!=null?K(""+N.key):B.toString(36)}function ee(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(R,R):(N.status="pending",N.then(function(B){N.status==="pending"&&(N.status="fulfilled",N.value=B)},function(B){N.status==="pending"&&(N.status="rejected",N.reason=B)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function q(N,B,P,Y,re){var he=typeof N;(he==="undefined"||he==="boolean")&&(N=null);var V=!1;if(N===null)V=!0;else switch(he){case"bigint":case"string":case"number":V=!0;break;case"object":switch(N.$$typeof){case i:case r:V=!0;break;case y:return V=N._init,q(V(N._payload),B,P,Y,re)}}if(V)return re=re(N),V=Y===""?"."+J(N,0):Y,A(re)?(P="",V!=null&&(P=V.replace(Z,"$&/")+"/"),q(re,B,P,"",function(oe){return oe})):re!=null&&(F(re)&&(re=$(re,P+(re.key==null||N&&N.key===re.key?"":(""+re.key).replace(Z,"$&/")+"/")+V)),B.push(re)),1;V=0;var H=Y===""?".":Y+":";if(A(N))for(var ce=0;ce<N.length;ce++)Y=N[ce],he=H+J(Y,ce),V+=q(Y,B,P,he,re);else if(ce=T(N),typeof ce=="function")for(N=ce.call(N),ce=0;!(Y=N.next()).done;)Y=Y.value,he=H+J(Y,ce++),V+=q(Y,B,P,he,re);else if(he==="object"){if(typeof N.then=="function")return q(ee(N),B,P,Y,re);throw B=String(N),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return V}function Q(N,B,P){if(N==null)return N;var Y=[],re=0;return q(N,Y,"","",function(he){return B.call(P,he,re++)}),Y}function ne(N){if(N._status===-1){var B=N._result;B=B(),B.then(function(P){(N._status===0||N._status===-1)&&(N._status=1,N._result=P)},function(P){(N._status===0||N._status===-1)&&(N._status=2,N._result=P)}),N._status===-1&&(N._status=0,N._result=B)}if(N._status===1)return N._result.default;throw N._result}var j=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},U={map:Q,forEach:function(N,B,P){Q(N,function(){B.apply(this,arguments)},P)},count:function(N){var B=0;return Q(N,function(){B++}),B},toArray:function(N){return Q(N,function(B){return B})||[]},only:function(N){if(!F(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return we.Activity=f,we.Children=U,we.Component=g,we.Fragment=a,we.Profiler=v,we.PureComponent=p,we.StrictMode=o,we.Suspense=h,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,we.__COMPILER_RUNTIME={__proto__:null,c:function(N){return M.H.useMemoCache(N)}},we.cache=function(N){return function(){return N.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(N,B,P){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var Y=C({},N.props),re=N.key;if(B!=null)for(he in B.key!==void 0&&(re=""+B.key),B)!w.call(B,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&B.ref===void 0||(Y[he]=B[he]);var he=arguments.length-2;if(he===1)Y.children=P;else if(1<he){for(var V=Array(he),H=0;H<he;H++)V[H]=arguments[H+2];Y.children=V}return L(N.type,re,Y)},we.createContext=function(N){return N={$$typeof:E,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:k,_context:N},N},we.createElement=function(N,B,P){var Y,re={},he=null;if(B!=null)for(Y in B.key!==void 0&&(he=""+B.key),B)w.call(B,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(re[Y]=B[Y]);var V=arguments.length-2;if(V===1)re.children=P;else if(1<V){for(var H=Array(V),ce=0;ce<V;ce++)H[ce]=arguments[ce+2];re.children=H}if(N&&N.defaultProps)for(Y in V=N.defaultProps,V)re[Y]===void 0&&(re[Y]=V[Y]);return L(N,he,re)},we.createRef=function(){return{current:null}},we.forwardRef=function(N){return{$$typeof:c,render:N}},we.isValidElement=F,we.lazy=function(N){return{$$typeof:y,_payload:{_status:-1,_result:N},_init:ne}},we.memo=function(N,B){return{$$typeof:u,type:N,compare:B===void 0?null:B}},we.startTransition=function(N){var B=M.T,P={};M.T=P;try{var Y=N(),re=M.S;re!==null&&re(P,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(R,j)}catch(he){j(he)}finally{B!==null&&P.types!==null&&(B.types=P.types),M.T=B}},we.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},we.use=function(N){return M.H.use(N)},we.useActionState=function(N,B,P){return M.H.useActionState(N,B,P)},we.useCallback=function(N,B){return M.H.useCallback(N,B)},we.useContext=function(N){return M.H.useContext(N)},we.useDebugValue=function(){},we.useDeferredValue=function(N,B){return M.H.useDeferredValue(N,B)},we.useEffect=function(N,B){return M.H.useEffect(N,B)},we.useEffectEvent=function(N){return M.H.useEffectEvent(N)},we.useId=function(){return M.H.useId()},we.useImperativeHandle=function(N,B,P){return M.H.useImperativeHandle(N,B,P)},we.useInsertionEffect=function(N,B){return M.H.useInsertionEffect(N,B)},we.useLayoutEffect=function(N,B){return M.H.useLayoutEffect(N,B)},we.useMemo=function(N,B){return M.H.useMemo(N,B)},we.useOptimistic=function(N,B){return M.H.useOptimistic(N,B)},we.useReducer=function(N,B,P){return M.H.useReducer(N,B,P)},we.useRef=function(N){return M.H.useRef(N)},we.useState=function(N){return M.H.useState(N)},we.useSyncExternalStore=function(N,B,P){return M.H.useSyncExternalStore(N,B,P)},we.useTransition=function(){return M.H.useTransition()},we.version="19.2.4",we}var Pm;function Cu(){return Pm||(Pm=1,Jc.exports=x0()),Jc.exports}var I=Cu();const Hn=F_(I);var Qc={exports:{}},Ln={},eu={exports:{}},tu={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Zm;function C0(){return Zm||(Zm=1,(function(i){function r(q,Q){var ne=q.length;q.push(Q);e:for(;0<ne;){var j=ne-1>>>1,U=q[j];if(0<v(U,Q))q[j]=Q,q[ne]=U,ne=j;else break e}}function a(q){return q.length===0?null:q[0]}function o(q){if(q.length===0)return null;var Q=q[0],ne=q.pop();if(ne!==Q){q[0]=ne;e:for(var j=0,U=q.length,N=U>>>1;j<N;){var B=2*(j+1)-1,P=q[B],Y=B+1,re=q[Y];if(0>v(P,ne))Y<U&&0>v(re,P)?(q[j]=re,q[Y]=ne,j=Y):(q[j]=P,q[B]=ne,j=B);else if(Y<U&&0>v(re,ne))q[j]=re,q[Y]=ne,j=Y;else break e}}return Q}function v(q,Q){var ne=q.sortIndex-Q.sortIndex;return ne!==0?ne:q.id-Q.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var k=performance;i.unstable_now=function(){return k.now()}}else{var E=Date,c=E.now();i.unstable_now=function(){return E.now()-c}}var h=[],u=[],y=1,f=null,x=3,T=!1,O=!1,C=!1,m=!1,g=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;function S(q){for(var Q=a(u);Q!==null;){if(Q.callback===null)o(u);else if(Q.startTime<=q)o(u),Q.sortIndex=Q.expirationTime,r(h,Q);else break;Q=a(u)}}function A(q){if(C=!1,S(q),!O)if(a(h)!==null)O=!0,R||(R=!0,K());else{var Q=a(u);Q!==null&&ee(A,Q.startTime-q)}}var R=!1,M=-1,w=5,L=-1;function $(){return m?!0:!(i.unstable_now()-L<w)}function F(){if(m=!1,R){var q=i.unstable_now();L=q;var Q=!0;try{e:{O=!1,C&&(C=!1,d(M),M=-1),T=!0;var ne=x;try{t:{for(S(q),f=a(h);f!==null&&!(f.expirationTime>q&&$());){var j=f.callback;if(typeof j=="function"){f.callback=null,x=f.priorityLevel;var U=j(f.expirationTime<=q);if(q=i.unstable_now(),typeof U=="function"){f.callback=U,S(q),Q=!0;break t}f===a(h)&&o(h),S(q)}else o(h);f=a(h)}if(f!==null)Q=!0;else{var N=a(u);N!==null&&ee(A,N.startTime-q),Q=!1}}break e}finally{f=null,x=ne,T=!1}Q=void 0}}finally{Q?K():R=!1}}}var K;if(typeof p=="function")K=function(){p(F)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,J=Z.port2;Z.port1.onmessage=F,K=function(){J.postMessage(null)}}else K=function(){g(F,0)};function ee(q,Q){M=g(function(){q(i.unstable_now())},Q)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(q){q.callback=null},i.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<q?Math.floor(1e3/q):5},i.unstable_getCurrentPriorityLevel=function(){return x},i.unstable_next=function(q){switch(x){case 1:case 2:case 3:var Q=3;break;default:Q=x}var ne=x;x=Q;try{return q()}finally{x=ne}},i.unstable_requestPaint=function(){m=!0},i.unstable_runWithPriority=function(q,Q){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var ne=x;x=q;try{return Q()}finally{x=ne}},i.unstable_scheduleCallback=function(q,Q,ne){var j=i.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?j+ne:j):ne=j,q){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=ne+U,q={id:y++,callback:Q,priorityLevel:q,startTime:ne,expirationTime:U,sortIndex:-1},ne>j?(q.sortIndex=ne,r(u,q),a(h)===null&&q===a(u)&&(C?(d(M),M=-1):C=!0,ee(A,ne-j))):(q.sortIndex=U,r(h,q),O||T||(O=!0,R||(R=!0,K()))),q},i.unstable_shouldYield=$,i.unstable_wrapCallback=function(q){var Q=x;return function(){var ne=x;x=Q;try{return q.apply(this,arguments)}finally{x=ne}}}})(tu)),tu}var Fm;function w0(){return Fm||(Fm=1,eu.exports=C0()),eu.exports}var iu={exports:{}},kt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var qm;function E0(){if(qm)return kt;qm=1;var i=Cu();function r(h){var u="https://react.dev/errors/"+h;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)u+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(r(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},v=Symbol.for("react.portal");function k(h,u,y){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:v,key:f==null?null:""+f,children:h,containerInfo:u,implementation:y}}var E=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(h,u){if(h==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,kt.createPortal=function(h,u){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(r(299));return k(h,u,null,y)},kt.flushSync=function(h){var u=E.T,y=o.p;try{if(E.T=null,o.p=2,h)return h()}finally{E.T=u,o.p=y,o.d.f()}},kt.preconnect=function(h,u){typeof h=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,o.d.C(h,u))},kt.prefetchDNS=function(h){typeof h=="string"&&o.d.D(h)},kt.preinit=function(h,u){if(typeof h=="string"&&u&&typeof u.as=="string"){var y=u.as,f=c(y,u.crossOrigin),x=typeof u.integrity=="string"?u.integrity:void 0,T=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;y==="style"?o.d.S(h,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:x,fetchPriority:T}):y==="script"&&o.d.X(h,{crossOrigin:f,integrity:x,fetchPriority:T,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},kt.preinitModule=function(h,u){if(typeof h=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var y=c(u.as,u.crossOrigin);o.d.M(h,{crossOrigin:y,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&o.d.M(h)},kt.preload=function(h,u){if(typeof h=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var y=u.as,f=c(y,u.crossOrigin);o.d.L(h,y,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},kt.preloadModule=function(h,u){if(typeof h=="string")if(u){var y=c(u.as,u.crossOrigin);o.d.m(h,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:y,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else o.d.m(h)},kt.requestFormReset=function(h){o.d.r(h)},kt.unstable_batchedUpdates=function(h,u){return h(u)},kt.useFormState=function(h,u,y){return E.H.useFormState(h,u,y)},kt.useFormStatus=function(){return E.H.useHostTransitionStatus()},kt.version="19.2.4",kt}var Km;function k0(){if(Km)return iu.exports;Km=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),iu.exports=E0(),iu.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 Vm;function T0(){if(Vm)return Ln;Vm=1;var i=w0(),r=Cu(),a=k0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function v(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function k(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function E(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(k(e)!==e)throw Error(o(188))}function u(e){var t=e.alternate;if(!t){if(t=k(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,n=t;;){var l=s.return;if(l===null)break;var _=l.alternate;if(_===null){if(n=l.return,n!==null){s=n;continue}break}if(l.child===_.child){for(_=l.child;_;){if(_===s)return h(l),e;if(_===n)return h(l),t;_=_.sibling}throw Error(o(188))}if(s.return!==n.return)s=l,n=_;else{for(var D=!1,z=l.child;z;){if(z===s){D=!0,s=l,n=_;break}if(z===n){D=!0,n=l,s=_;break}z=z.sibling}if(!D){for(z=_.child;z;){if(z===s){D=!0,s=_,n=l;break}if(z===n){D=!0,n=_,s=l;break}z=z.sibling}if(!D)throw Error(o(189))}}if(s.alternate!==n)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,x=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),p=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function K(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Symbol.for("react.client.reference");function J(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case A:return"Suspense";case R:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case p:return e.displayName||"Context";case d:return(e._context.displayName||"Context")+".Consumer";case S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M:return t=e.displayName||null,t!==null?t:J(e.type)||"Memo";case w:t=e._payload,e=e._init;try{return J(e(t))}catch{}}return null}var ee=Array.isArray,q=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},j=[],U=-1;function N(e){return{current:e}}function B(e){0>U||(e.current=j[U],j[U]=null,U--)}function P(e,t){U++,j[U]=e.current,e.current=t}var Y=N(null),re=N(null),he=N(null),V=N(null);function H(e,t){switch(P(he,t),P(re,e),P(Y,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?lm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=lm(t),e=cm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(Y),P(Y,e)}function ce(){B(Y),B(re),B(he)}function oe(e){e.memoizedState!==null&&P(V,e);var t=Y.current,s=cm(t,e.type);t!==s&&(P(re,e),P(Y,s))}function me(e){re.current===e&&(B(Y),B(re)),V.current===e&&(B(V),Rn._currentValue=ne)}var _e,Te;function je(e){if(_e===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);_e=t&&t[1]||"",Te=-1<s.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+_e+e+Te}var Ze=!1;function ut(e,t){if(!e||Ze)return"";Ze=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ae){var se=ae}Reflect.construct(e,[],fe)}else{try{fe.call()}catch(ae){se=ae}e.call(fe.prototype)}}else{try{throw Error()}catch(ae){se=ae}(fe=e())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ae){if(ae&&se&&typeof ae.stack=="string")return[ae.stack,se.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=n.DetermineComponentFrameRoot(),D=_[0],z=_[1];if(D&&z){var G=D.split(`
44
+ `),ie=z.split(`
45
+ `);for(l=n=0;n<G.length&&!G[n].includes("DetermineComponentFrameRoot");)n++;for(;l<ie.length&&!ie[l].includes("DetermineComponentFrameRoot");)l++;if(n===G.length||l===ie.length)for(n=G.length-1,l=ie.length-1;1<=n&&0<=l&&G[n]!==ie[l];)l--;for(;1<=n&&0<=l;n--,l--)if(G[n]!==ie[l]){if(n!==1||l!==1)do if(n--,l--,0>l||G[n]!==ie[l]){var le=`
46
+ `+G[n].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=n&&0<=l);break}}}finally{Ze=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?je(s):""}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je("Lazy");case 13:return e.child!==t&&t!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return ut(e.type,!1);case 11:return ut(e.type.render,!1);case 1:return ut(e.type,!0);case 31:return je("Activity");default:return""}}function pe(e){try{var t="",s=null;do t+=Ce(e,s),s=e,e=e.return;while(e);return t}catch(n){return`
47
+ Error generating stack: `+n.message+`
48
+ `+n.stack}}var Rt=Object.prototype.hasOwnProperty,mi=i.unstable_scheduleCallback,xs=i.unstable_cancelCallback,qs=i.unstable_shouldYield,Dt=i.unstable_requestPaint,vt=i.unstable_now,Yt=i.unstable_getCurrentPriorityLevel,Pi=i.unstable_ImmediatePriority,Ks=i.unstable_UserBlockingPriority,Ut=i.unstable_NormalPriority,Vs=i.unstable_LowPriority,li=i.unstable_IdlePriority,Cs=i.log,Ye=i.unstable_setDisableYieldValue,ws=null,$t=null;function Zi(e){if(typeof Cs=="function"&&Ye(e),$t&&typeof $t.setStrictMode=="function")try{$t.setStrictMode(ws,e)}catch{}}var It=Math.clz32?Math.clz32:rv,iv=Math.log,sv=Math.LN2;function rv(e){return e>>>=0,e===0?32:31-(iv(e)/sv|0)|0}var Yn=256,Wn=262144,Xn=4194304;function Es(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Jn(e,t,s){var n=e.pendingLanes;if(n===0)return 0;var l=0,_=e.suspendedLanes,D=e.pingedLanes;e=e.warmLanes;var z=n&134217727;return z!==0?(n=z&~_,n!==0?l=Es(n):(D&=z,D!==0?l=Es(D):s||(s=z&~e,s!==0&&(l=Es(s))))):(z=n&~_,z!==0?l=Es(z):D!==0?l=Es(D):s||(s=n&~e,s!==0&&(l=Es(s)))),l===0?0:t!==0&&t!==l&&(t&_)===0&&(_=l&-l,s=t&-t,_>=s||_===32&&(s&4194048)!==0)?t:l}function Ir(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nv(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pu(){var e=Xn;return Xn<<=1,(Xn&62914560)===0&&(Xn=4194304),e}function Uo(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Pr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function av(e,t,s,n,l,_){var D=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var z=e.entanglements,G=e.expirationTimes,ie=e.hiddenUpdates;for(s=D&~s;0<s;){var le=31-It(s),fe=1<<le;z[le]=0,G[le]=-1;var se=ie[le];if(se!==null)for(ie[le]=null,le=0;le<se.length;le++){var ae=se[le];ae!==null&&(ae.lane&=-536870913)}s&=~fe}n!==0&&Zu(e,n,0),_!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=_&~(D&~t))}function Zu(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-It(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|s&261930}function Fu(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var n=31-It(s),l=1<<n;l&t|e[n]&t&&(e[n]|=t),s&=~l}}function qu(e,t){var s=t&-t;return s=(s&42)!==0?1:$o(s),(s&(e.suspendedLanes|t))!==0?0:s}function $o(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Io(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ku(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:Mm(e.type))}function Vu(e,t){var s=Q.p;try{return Q.p=e,t()}finally{Q.p=s}}var Fi=Math.random().toString(36).slice(2),St="__reactFiber$"+Fi,Ot="__reactProps$"+Fi,Gs="__reactContainer$"+Fi,Po="__reactEvents$"+Fi,ov="__reactListeners$"+Fi,lv="__reactHandles$"+Fi,Gu="__reactResources$"+Fi,Zr="__reactMarker$"+Fi;function Zo(e){delete e[St],delete e[Ot],delete e[Po],delete e[ov],delete e[lv]}function Ys(e){var t=e[St];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Gs]||s[St]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=pm(e);e!==null;){if(s=e[St])return s;e=pm(e)}return t}e=s,s=e.parentNode}return null}function Ws(e){if(e=e[St]||e[Gs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Fr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Xs(e){var t=e[Gu];return t||(t=e[Gu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[Zr]=!0}var Yu=new Set,Wu={};function ks(e,t){Js(e,t),Js(e+"Capture",t)}function Js(e,t){for(Wu[e]=t,e=0;e<t.length;e++)Yu.add(t[e])}var cv=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]*$"),Xu={},Ju={};function uv(e){return Rt.call(Ju,e)?!0:Rt.call(Xu,e)?!1:cv.test(e)?Ju[e]=!0:(Xu[e]=!0,!1)}function Qn(e,t,s){if(uv(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function ea(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function xi(e,t,s,n){if(n===null)e.removeAttribute(s);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+n)}}function Wt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hv(e,t,s){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,_=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(D){s=""+D,_.call(this,D)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(D){s=""+D},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fo(e){if(!e._valueTracker){var t=Qu(e)?"checked":"value";e._valueTracker=hv(e,t,""+e[t])}}function eh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),n="";return e&&(n=Qu(e)?e.checked?"true":"false":e.value),e=n,e!==s?(t.setValue(e),!0):!1}function ta(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var dv=/[\n"\\]/g;function Xt(e){return e.replace(dv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function qo(e,t,s,n,l,_,D,z){e.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?e.type=D:e.removeAttribute("type"),t!=null?D==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Wt(t)):e.value!==""+Wt(t)&&(e.value=""+Wt(t)):D!=="submit"&&D!=="reset"||e.removeAttribute("value"),t!=null?Ko(e,D,Wt(t)):s!=null?Ko(e,D,Wt(s)):n!=null&&e.removeAttribute("value"),l==null&&_!=null&&(e.defaultChecked=!!_),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?e.name=""+Wt(z):e.removeAttribute("name")}function th(e,t,s,n,l,_,D,z){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.type=_),t!=null||s!=null){if(!(_!=="submit"&&_!=="reset"||t!=null)){Fo(e);return}s=s!=null?""+Wt(s):"",t=t!=null?""+Wt(t):s,z||t===e.value||(e.value=t),e.defaultValue=t}n=n??l,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=z?e.checked:!!n,e.defaultChecked=!!n,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(e.name=D),Fo(e)}function Ko(e,t,s){t==="number"&&ta(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Qs(e,t,s,n){if(e=e.options,t){t={};for(var l=0;l<s.length;l++)t["$"+s[l]]=!0;for(s=0;s<e.length;s++)l=t.hasOwnProperty("$"+e[s].value),e[s].selected!==l&&(e[s].selected=l),l&&n&&(e[s].defaultSelected=!0)}else{for(s=""+Wt(s),t=null,l=0;l<e.length;l++){if(e[l].value===s){e[l].selected=!0,n&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function ih(e,t,s){if(t!=null&&(t=""+Wt(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Wt(s):""}function sh(e,t,s,n){if(t==null){if(n!=null){if(s!=null)throw Error(o(92));if(ee(n)){if(1<n.length)throw Error(o(93));n=n[0]}s=n}s==null&&(s=""),t=s}s=Wt(t),e.defaultValue=s,n=e.textContent,n===s&&n!==""&&n!==null&&(e.value=n),Fo(e)}function er(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var fv=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 rh(e,t,s){var n=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,s):typeof s!="number"||s===0||fv.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function nh(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var n in s)!s.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var l in t)n=t[l],t.hasOwnProperty(l)&&s[l]!==n&&rh(e,l,n)}else for(var _ in t)t.hasOwnProperty(_)&&rh(e,_,t[_])}function Vo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mv=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"]]),_v=/^[\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 ia(e){return _v.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ci(){}var Go=null;function Yo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tr=null,ir=null;function ah(e){var t=Ws(e);if(t&&(e=t.stateNode)){var s=e[Ot]||null;e:switch(e=t.stateNode,t.type){case"input":if(qo(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Xt(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var n=s[t];if(n!==e&&n.form===e.form){var l=n[Ot]||null;if(!l)throw Error(o(90));qo(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<s.length;t++)n=s[t],n.form===e.form&&eh(n)}break e;case"textarea":ih(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Qs(e,!!s.multiple,t,!1)}}}var Wo=!1;function oh(e,t,s){if(Wo)return e(t,s);Wo=!0;try{var n=e(t);return n}finally{if(Wo=!1,(tr!==null||ir!==null)&&(Za(),tr&&(t=tr,e=ir,ir=tr=null,ah(t),e)))for(t=0;t<e.length;t++)ah(e[t])}}function qr(e,t){var s=e.stateNode;if(s===null)return null;var n=s[Ot]||null;if(n===null)return null;s=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var wi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xo=!1;if(wi)try{var Kr={};Object.defineProperty(Kr,"passive",{get:function(){Xo=!0}}),window.addEventListener("test",Kr,Kr),window.removeEventListener("test",Kr,Kr)}catch{Xo=!1}var qi=null,Jo=null,sa=null;function lh(){if(sa)return sa;var e,t=Jo,s=t.length,n,l="value"in qi?qi.value:qi.textContent,_=l.length;for(e=0;e<s&&t[e]===l[e];e++);var D=s-e;for(n=1;n<=D&&t[s-n]===l[_-n];n++);return sa=l.slice(e,1<n?1-n:void 0)}function ra(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function na(){return!0}function ch(){return!1}function Mt(e){function t(s,n,l,_,D){this._reactName=s,this._targetInst=l,this.type=n,this.nativeEvent=_,this.target=D,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(s=e[z],this[z]=s?s(_):_[z]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?na:ch,this.isPropagationStopped=ch,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=na)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=na)},persist:function(){},isPersistent:na}),t}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},aa=Mt(Ts),Vr=f({},Ts,{view:0,detail:0}),pv=Mt(Vr),Qo,el,Gr,oa=f({},Vr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:il,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Gr&&(Gr&&e.type==="mousemove"?(Qo=e.screenX-Gr.screenX,el=e.screenY-Gr.screenY):el=Qo=0,Gr=e),Qo)},movementY:function(e){return"movementY"in e?e.movementY:el}}),uh=Mt(oa),vv=f({},oa,{dataTransfer:0}),gv=Mt(vv),yv=f({},Vr,{relatedTarget:0}),tl=Mt(yv),bv=f({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),Sv=Mt(bv),xv=f({},Ts,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Cv=Mt(xv),wv=f({},Ts,{data:0}),hh=Mt(wv),Ev={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kv={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"},Tv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Av(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Tv[e])?!!t[e]:!1}function il(){return Av}var Rv=f({},Vr,{key:function(e){if(e.key){var t=Ev[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ra(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?kv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:il,charCode:function(e){return e.type==="keypress"?ra(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ra(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Dv=Mt(Rv),Ov=f({},oa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dh=Mt(Ov),Mv=f({},Vr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:il}),Nv=Mt(Mv),Lv=f({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),jv=Mt(Lv),Bv=f({},oa,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),zv=Mt(Bv),Hv=f({},Ts,{newState:0,oldState:0}),Uv=Mt(Hv),$v=[9,13,27,32],sl=wi&&"CompositionEvent"in window,Yr=null;wi&&"documentMode"in document&&(Yr=document.documentMode);var Iv=wi&&"TextEvent"in window&&!Yr,fh=wi&&(!sl||Yr&&8<Yr&&11>=Yr),mh=" ",_h=!1;function ph(e,t){switch(e){case"keyup":return $v.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var sr=!1;function Pv(e,t){switch(e){case"compositionend":return vh(t);case"keypress":return t.which!==32?null:(_h=!0,mh);case"textInput":return e=t.data,e===mh&&_h?null:e;default:return null}}function Zv(e,t){if(sr)return e==="compositionend"||!sl&&ph(e,t)?(e=lh(),sa=Jo=qi=null,sr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return fh&&t.locale!=="ko"?null:t.data;default:return null}}var Fv={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 gh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Fv[e.type]:t==="textarea"}function yh(e,t,s,n){tr?ir?ir.push(n):ir=[n]:tr=n,t=Wa(t,"onChange"),0<t.length&&(s=new aa("onChange","change",null,s,n),e.push({event:s,listeners:t}))}var Wr=null,Xr=null;function qv(e){im(e,0)}function la(e){var t=Fr(e);if(eh(t))return e}function bh(e,t){if(e==="change")return t}var Sh=!1;if(wi){var rl;if(wi){var nl="oninput"in document;if(!nl){var xh=document.createElement("div");xh.setAttribute("oninput","return;"),nl=typeof xh.oninput=="function"}rl=nl}else rl=!1;Sh=rl&&(!document.documentMode||9<document.documentMode)}function Ch(){Wr&&(Wr.detachEvent("onpropertychange",wh),Xr=Wr=null)}function wh(e){if(e.propertyName==="value"&&la(Xr)){var t=[];yh(t,Xr,e,Yo(e)),oh(qv,t)}}function Kv(e,t,s){e==="focusin"?(Ch(),Wr=t,Xr=s,Wr.attachEvent("onpropertychange",wh)):e==="focusout"&&Ch()}function Vv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return la(Xr)}function Gv(e,t){if(e==="click")return la(t)}function Yv(e,t){if(e==="input"||e==="change")return la(t)}function Wv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:Wv;function Jr(e,t){if(Pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),n=Object.keys(t);if(s.length!==n.length)return!1;for(n=0;n<s.length;n++){var l=s[n];if(!Rt.call(t,l)||!Pt(e[l],t[l]))return!1}return!0}function Eh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kh(e,t){var s=Eh(e);e=0;for(var n;s;){if(s.nodeType===3){if(n=e+s.textContent.length,e<=t&&n>=t)return{node:s,offset:t-e};e=n}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Eh(s)}}function Th(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Th(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ah(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ta(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=ta(e.document)}return t}function al(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Xv=wi&&"documentMode"in document&&11>=document.documentMode,rr=null,ol=null,Qr=null,ll=!1;function Rh(e,t,s){var n=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;ll||rr==null||rr!==ta(n)||(n=rr,"selectionStart"in n&&al(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Qr&&Jr(Qr,n)||(Qr=n,n=Wa(ol,"onSelect"),0<n.length&&(t=new aa("onSelect","select",null,t,s),e.push({event:t,listeners:n}),t.target=rr)))}function As(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var nr={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionrun:As("Transition","TransitionRun"),transitionstart:As("Transition","TransitionStart"),transitioncancel:As("Transition","TransitionCancel"),transitionend:As("Transition","TransitionEnd")},cl={},Dh={};wi&&(Dh=document.createElement("div").style,"AnimationEvent"in window||(delete nr.animationend.animation,delete nr.animationiteration.animation,delete nr.animationstart.animation),"TransitionEvent"in window||delete nr.transitionend.transition);function Rs(e){if(cl[e])return cl[e];if(!nr[e])return e;var t=nr[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Dh)return cl[e]=t[s];return e}var Oh=Rs("animationend"),Mh=Rs("animationiteration"),Nh=Rs("animationstart"),Jv=Rs("transitionrun"),Qv=Rs("transitionstart"),eg=Rs("transitioncancel"),Lh=Rs("transitionend"),jh=new Map,ul="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(" ");ul.push("scrollEnd");function ci(e,t){jh.set(e,t),ks(t,[e])}var ca=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Jt=[],ar=0,hl=0;function ua(){for(var e=ar,t=hl=ar=0;t<e;){var s=Jt[t];Jt[t++]=null;var n=Jt[t];Jt[t++]=null;var l=Jt[t];Jt[t++]=null;var _=Jt[t];if(Jt[t++]=null,n!==null&&l!==null){var D=n.pending;D===null?l.next=l:(l.next=D.next,D.next=l),n.pending=l}_!==0&&Bh(s,l,_)}}function ha(e,t,s,n){Jt[ar++]=e,Jt[ar++]=t,Jt[ar++]=s,Jt[ar++]=n,hl|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function dl(e,t,s,n){return ha(e,t,s,n),da(e)}function Ds(e,t){return ha(e,null,null,t),da(e)}function Bh(e,t,s){e.lanes|=s;var n=e.alternate;n!==null&&(n.lanes|=s);for(var l=!1,_=e.return;_!==null;)_.childLanes|=s,n=_.alternate,n!==null&&(n.childLanes|=s),_.tag===22&&(e=_.stateNode,e===null||e._visibility&1||(l=!0)),e=_,_=_.return;return e.tag===3?(_=e.stateNode,l&&t!==null&&(l=31-It(s),e=_.hiddenUpdates,n=e[l],n===null?e[l]=[t]:n.push(t),t.lane=s|536870912),_):null}function da(e){if(50<xn)throw xn=0,Sc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var or={};function tg(e,t,s,n){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zt(e,t,s,n){return new tg(e,t,s,n)}function fl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ei(e,t){var s=e.alternate;return s===null?(s=Zt(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function zh(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function fa(e,t,s,n,l,_){var D=0;if(n=e,typeof e=="function")fl(e)&&(D=1);else if(typeof e=="string")D=a0(e,s,Y.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case L:return e=Zt(31,s,t,l),e.elementType=L,e.lanes=_,e;case C:return Os(s.children,l,_,t);case m:D=8,l|=24;break;case g:return e=Zt(12,s,t,l|2),e.elementType=g,e.lanes=_,e;case A:return e=Zt(13,s,t,l),e.elementType=A,e.lanes=_,e;case R:return e=Zt(19,s,t,l),e.elementType=R,e.lanes=_,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case p:D=10;break e;case d:D=9;break e;case S:D=11;break e;case M:D=14;break e;case w:D=16,n=null;break e}D=29,s=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=Zt(D,s,t,l),t.elementType=e,t.type=n,t.lanes=_,t}function Os(e,t,s,n){return e=Zt(7,e,n,t),e.lanes=s,e}function ml(e,t,s){return e=Zt(6,e,null,t),e.lanes=s,e}function Hh(e){var t=Zt(18,null,null,0);return t.stateNode=e,t}function _l(e,t,s){return t=Zt(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Uh=new WeakMap;function Qt(e,t){if(typeof e=="object"&&e!==null){var s=Uh.get(e);return s!==void 0?s:(t={value:e,source:t,stack:pe(t)},Uh.set(e,t),t)}return{value:e,source:t,stack:pe(t)}}var lr=[],cr=0,ma=null,en=0,ei=[],ti=0,Ki=null,_i=1,pi="";function ki(e,t){lr[cr++]=en,lr[cr++]=ma,ma=e,en=t}function $h(e,t,s){ei[ti++]=_i,ei[ti++]=pi,ei[ti++]=Ki,Ki=e;var n=_i;e=pi;var l=32-It(n)-1;n&=~(1<<l),s+=1;var _=32-It(t)+l;if(30<_){var D=l-l%5;_=(n&(1<<D)-1).toString(32),n>>=D,l-=D,_i=1<<32-It(t)+l|s<<l|n,pi=_+e}else _i=1<<_|s<<l|n,pi=e}function pl(e){e.return!==null&&(ki(e,1),$h(e,1,0))}function vl(e){for(;e===ma;)ma=lr[--cr],lr[cr]=null,en=lr[--cr],lr[cr]=null;for(;e===Ki;)Ki=ei[--ti],ei[ti]=null,pi=ei[--ti],ei[ti]=null,_i=ei[--ti],ei[ti]=null}function Ih(e,t){ei[ti++]=_i,ei[ti++]=pi,ei[ti++]=Ki,_i=t.id,pi=t.overflow,Ki=e}var xt=null,We=null,Le=!1,Vi=null,ii=!1,gl=Error(o(519));function Gi(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw tn(Qt(t,e)),gl}function Ph(e){var t=e.stateNode,s=e.type,n=e.memoizedProps;switch(t[St]=e,t[Ot]=n,s){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(s=0;s<wn.length;s++)De(wn[s],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),th(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),sh(t,n.value,n.defaultValue,n.children)}s=n.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||n.suppressHydrationWarning===!0||am(t.textContent,s)?(n.popover!=null&&(De("beforetoggle",t),De("toggle",t)),n.onScroll!=null&&De("scroll",t),n.onScrollEnd!=null&&De("scrollend",t),n.onClick!=null&&(t.onclick=Ci),t=!0):t=!1,t||Gi(e,!0)}function Zh(e){for(xt=e.return;xt;)switch(xt.tag){case 5:case 31:case 13:ii=!1;return;case 27:case 3:ii=!0;return;default:xt=xt.return}}function ur(e){if(e!==xt)return!1;if(!Le)return Zh(e),Le=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Bc(e.type,e.memoizedProps)),s=!s),s&&We&&Gi(e),Zh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));We=_m(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));We=_m(e)}else t===27?(t=We,ls(e.type)?(e=Ic,Ic=null,We=e):We=t):We=xt?ri(e.stateNode.nextSibling):null;return!0}function Ms(){We=xt=null,Le=!1}function yl(){var e=Vi;return e!==null&&(Bt===null?Bt=e:Bt.push.apply(Bt,e),Vi=null),e}function tn(e){Vi===null?Vi=[e]:Vi.push(e)}var bl=N(null),Ns=null,Ti=null;function Yi(e,t,s){P(bl,t._currentValue),t._currentValue=s}function Ai(e){e._currentValue=bl.current,B(bl)}function Sl(e,t,s){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===s)break;e=e.return}}function xl(e,t,s,n){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var _=l.dependencies;if(_!==null){var D=l.child;_=_.firstContext;e:for(;_!==null;){var z=_;_=l;for(var G=0;G<t.length;G++)if(z.context===t[G]){_.lanes|=s,z=_.alternate,z!==null&&(z.lanes|=s),Sl(_.return,s,e),n||(D=null);break e}_=z.next}}else if(l.tag===18){if(D=l.return,D===null)throw Error(o(341));D.lanes|=s,_=D.alternate,_!==null&&(_.lanes|=s),Sl(D,s,e),D=null}else D=l.child;if(D!==null)D.return=l;else for(D=l;D!==null;){if(D===e){D=null;break}if(l=D.sibling,l!==null){l.return=D.return,D=l;break}D=D.return}l=D}}function hr(e,t,s,n){e=null;for(var l=t,_=!1;l!==null;){if(!_){if((l.flags&524288)!==0)_=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var D=l.alternate;if(D===null)throw Error(o(387));if(D=D.memoizedProps,D!==null){var z=l.type;Pt(l.pendingProps.value,D.value)||(e!==null?e.push(z):e=[z])}}else if(l===V.current){if(D=l.alternate,D===null)throw Error(o(387));D.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(Rn):e=[Rn])}l=l.return}e!==null&&xl(t,e,s,n),t.flags|=262144}function _a(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ls(e){Ns=e,Ti=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return Fh(Ns,e)}function pa(e,t){return Ns===null&&Ls(e),Fh(e,t)}function Fh(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Ti===null){if(e===null)throw Error(o(308));Ti=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ti=Ti.next=t;return s}var ig=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},sg=i.unstable_scheduleCallback,rg=i.unstable_NormalPriority,ht={$$typeof:p,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cl(){return{controller:new ig,data:new Map,refCount:0}}function sn(e){e.refCount--,e.refCount===0&&sg(rg,function(){e.controller.abort()})}var rn=null,wl=0,dr=0,fr=null;function ng(e,t){if(rn===null){var s=rn=[];wl=0,dr=Tc(),fr={status:"pending",value:void 0,then:function(n){s.push(n)}}}return wl++,t.then(qh,qh),t}function qh(){if(--wl===0&&rn!==null){fr!==null&&(fr.status="fulfilled");var e=rn;rn=null,dr=0,fr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ag(e,t){var s=[],n={status:"pending",value:null,reason:null,then:function(l){s.push(l)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var l=0;l<s.length;l++)(0,s[l])(t)},function(l){for(n.status="rejected",n.reason=l,l=0;l<s.length;l++)(0,s[l])(void 0)}),n}var Kh=q.S;q.S=function(e,t){Df=vt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ng(e,t),Kh!==null&&Kh(e,t)};var js=N(null);function El(){var e=js.current;return e!==null?e:Ve.pooledCache}function va(e,t){t===null?P(js,js.current):P(js,t.pool)}function Vh(){var e=El();return e===null?null:{parent:ht._currentValue,pool:e}}var mr=Error(o(460)),kl=Error(o(474)),ga=Error(o(542)),ya={then:function(){}};function Gh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Yh(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Ci,Ci),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Xh(e),e;default:if(typeof t.status=="string")t.then(Ci,Ci);else{if(e=Ve,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=n}},function(n){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Xh(e),e}throw zs=t,mr}}function Bs(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(zs=s,mr):s}}var zs=null;function Wh(){if(zs===null)throw Error(o(459));var e=zs;return zs=null,e}function Xh(e){if(e===mr||e===ga)throw Error(o(483))}var _r=null,nn=0;function ba(e){var t=nn;return nn+=1,_r===null&&(_r=[]),Yh(_r,e,t)}function an(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Sa(e,t){throw t.$$typeof===x?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Jh(e){function t(X,W){if(e){var te=X.deletions;te===null?(X.deletions=[W],X.flags|=16):te.push(W)}}function s(X,W){if(!e)return null;for(;W!==null;)t(X,W),W=W.sibling;return null}function n(X){for(var W=new Map;X!==null;)X.key!==null?W.set(X.key,X):W.set(X.index,X),X=X.sibling;return W}function l(X,W){return X=Ei(X,W),X.index=0,X.sibling=null,X}function _(X,W,te){return X.index=te,e?(te=X.alternate,te!==null?(te=te.index,te<W?(X.flags|=67108866,W):te):(X.flags|=67108866,W)):(X.flags|=1048576,W)}function D(X){return e&&X.alternate===null&&(X.flags|=67108866),X}function z(X,W,te,ue){return W===null||W.tag!==6?(W=ml(te,X.mode,ue),W.return=X,W):(W=l(W,te),W.return=X,W)}function G(X,W,te,ue){var ye=te.type;return ye===C?le(X,W,te.props.children,ue,te.key):W!==null&&(W.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===w&&Bs(ye)===W.type)?(W=l(W,te.props),an(W,te),W.return=X,W):(W=fa(te.type,te.key,te.props,null,X.mode,ue),an(W,te),W.return=X,W)}function ie(X,W,te,ue){return W===null||W.tag!==4||W.stateNode.containerInfo!==te.containerInfo||W.stateNode.implementation!==te.implementation?(W=_l(te,X.mode,ue),W.return=X,W):(W=l(W,te.children||[]),W.return=X,W)}function le(X,W,te,ue,ye){return W===null||W.tag!==7?(W=Os(te,X.mode,ue,ye),W.return=X,W):(W=l(W,te),W.return=X,W)}function fe(X,W,te){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=ml(""+W,X.mode,te),W.return=X,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case T:return te=fa(W.type,W.key,W.props,null,X.mode,te),an(te,W),te.return=X,te;case O:return W=_l(W,X.mode,te),W.return=X,W;case w:return W=Bs(W),fe(X,W,te)}if(ee(W)||K(W))return W=Os(W,X.mode,te,null),W.return=X,W;if(typeof W.then=="function")return fe(X,ba(W),te);if(W.$$typeof===p)return fe(X,pa(X,W),te);Sa(X,W)}return null}function se(X,W,te,ue){var ye=W!==null?W.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return ye!==null?null:z(X,W,""+te,ue);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case T:return te.key===ye?G(X,W,te,ue):null;case O:return te.key===ye?ie(X,W,te,ue):null;case w:return te=Bs(te),se(X,W,te,ue)}if(ee(te)||K(te))return ye!==null?null:le(X,W,te,ue,null);if(typeof te.then=="function")return se(X,W,ba(te),ue);if(te.$$typeof===p)return se(X,W,pa(X,te),ue);Sa(X,te)}return null}function ae(X,W,te,ue,ye){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return X=X.get(te)||null,z(W,X,""+ue,ye);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case T:return X=X.get(ue.key===null?te:ue.key)||null,G(W,X,ue,ye);case O:return X=X.get(ue.key===null?te:ue.key)||null,ie(W,X,ue,ye);case w:return ue=Bs(ue),ae(X,W,te,ue,ye)}if(ee(ue)||K(ue))return X=X.get(te)||null,le(W,X,ue,ye,null);if(typeof ue.then=="function")return ae(X,W,te,ba(ue),ye);if(ue.$$typeof===p)return ae(X,W,te,pa(W,ue),ye);Sa(W,ue)}return null}function ve(X,W,te,ue){for(var ye=null,Be=null,ge=W,ke=W=0,Ne=null;ge!==null&&ke<te.length;ke++){ge.index>ke?(Ne=ge,ge=null):Ne=ge.sibling;var ze=se(X,ge,te[ke],ue);if(ze===null){ge===null&&(ge=Ne);break}e&&ge&&ze.alternate===null&&t(X,ge),W=_(ze,W,ke),Be===null?ye=ze:Be.sibling=ze,Be=ze,ge=Ne}if(ke===te.length)return s(X,ge),Le&&ki(X,ke),ye;if(ge===null){for(;ke<te.length;ke++)ge=fe(X,te[ke],ue),ge!==null&&(W=_(ge,W,ke),Be===null?ye=ge:Be.sibling=ge,Be=ge);return Le&&ki(X,ke),ye}for(ge=n(ge);ke<te.length;ke++)Ne=ae(ge,X,ke,te[ke],ue),Ne!==null&&(e&&Ne.alternate!==null&&ge.delete(Ne.key===null?ke:Ne.key),W=_(Ne,W,ke),Be===null?ye=Ne:Be.sibling=Ne,Be=Ne);return e&&ge.forEach(function(fs){return t(X,fs)}),Le&&ki(X,ke),ye}function xe(X,W,te,ue){if(te==null)throw Error(o(151));for(var ye=null,Be=null,ge=W,ke=W=0,Ne=null,ze=te.next();ge!==null&&!ze.done;ke++,ze=te.next()){ge.index>ke?(Ne=ge,ge=null):Ne=ge.sibling;var fs=se(X,ge,ze.value,ue);if(fs===null){ge===null&&(ge=Ne);break}e&&ge&&fs.alternate===null&&t(X,ge),W=_(fs,W,ke),Be===null?ye=fs:Be.sibling=fs,Be=fs,ge=Ne}if(ze.done)return s(X,ge),Le&&ki(X,ke),ye;if(ge===null){for(;!ze.done;ke++,ze=te.next())ze=fe(X,ze.value,ue),ze!==null&&(W=_(ze,W,ke),Be===null?ye=ze:Be.sibling=ze,Be=ze);return Le&&ki(X,ke),ye}for(ge=n(ge);!ze.done;ke++,ze=te.next())ze=ae(ge,X,ke,ze.value,ue),ze!==null&&(e&&ze.alternate!==null&&ge.delete(ze.key===null?ke:ze.key),W=_(ze,W,ke),Be===null?ye=ze:Be.sibling=ze,Be=ze);return e&&ge.forEach(function(v0){return t(X,v0)}),Le&&ki(X,ke),ye}function Ke(X,W,te,ue){if(typeof te=="object"&&te!==null&&te.type===C&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case T:e:{for(var ye=te.key;W!==null;){if(W.key===ye){if(ye=te.type,ye===C){if(W.tag===7){s(X,W.sibling),ue=l(W,te.props.children),ue.return=X,X=ue;break e}}else if(W.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===w&&Bs(ye)===W.type){s(X,W.sibling),ue=l(W,te.props),an(ue,te),ue.return=X,X=ue;break e}s(X,W);break}else t(X,W);W=W.sibling}te.type===C?(ue=Os(te.props.children,X.mode,ue,te.key),ue.return=X,X=ue):(ue=fa(te.type,te.key,te.props,null,X.mode,ue),an(ue,te),ue.return=X,X=ue)}return D(X);case O:e:{for(ye=te.key;W!==null;){if(W.key===ye)if(W.tag===4&&W.stateNode.containerInfo===te.containerInfo&&W.stateNode.implementation===te.implementation){s(X,W.sibling),ue=l(W,te.children||[]),ue.return=X,X=ue;break e}else{s(X,W);break}else t(X,W);W=W.sibling}ue=_l(te,X.mode,ue),ue.return=X,X=ue}return D(X);case w:return te=Bs(te),Ke(X,W,te,ue)}if(ee(te))return ve(X,W,te,ue);if(K(te)){if(ye=K(te),typeof ye!="function")throw Error(o(150));return te=ye.call(te),xe(X,W,te,ue)}if(typeof te.then=="function")return Ke(X,W,ba(te),ue);if(te.$$typeof===p)return Ke(X,W,pa(X,te),ue);Sa(X,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,W!==null&&W.tag===6?(s(X,W.sibling),ue=l(W,te),ue.return=X,X=ue):(s(X,W),ue=ml(te,X.mode,ue),ue.return=X,X=ue),D(X)):s(X,W)}return function(X,W,te,ue){try{nn=0;var ye=Ke(X,W,te,ue);return _r=null,ye}catch(ge){if(ge===mr||ge===ga)throw ge;var Be=Zt(29,ge,null,X.mode);return Be.lanes=ue,Be.return=X,Be}finally{}}}var Hs=Jh(!0),Qh=Jh(!1),Wi=!1;function Tl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Al(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Xi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ji(e,t,s){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(He&2)!==0){var l=n.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),n.pending=t,t=da(e),Bh(e,null,s),t}return ha(e,n,t,s),da(e)}function on(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,Fu(e,s)}}function Rl(e,t){var s=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,s===n)){var l=null,_=null;if(s=s.firstBaseUpdate,s!==null){do{var D={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};_===null?l=_=D:_=_.next=D,s=s.next}while(s!==null);_===null?l=_=t:_=_.next=t}else l=_=t;s={baseState:n.baseState,firstBaseUpdate:l,lastBaseUpdate:_,shared:n.shared,callbacks:n.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Dl=!1;function ln(){if(Dl){var e=fr;if(e!==null)throw e}}function cn(e,t,s,n){Dl=!1;var l=e.updateQueue;Wi=!1;var _=l.firstBaseUpdate,D=l.lastBaseUpdate,z=l.shared.pending;if(z!==null){l.shared.pending=null;var G=z,ie=G.next;G.next=null,D===null?_=ie:D.next=ie,D=G;var le=e.alternate;le!==null&&(le=le.updateQueue,z=le.lastBaseUpdate,z!==D&&(z===null?le.firstBaseUpdate=ie:z.next=ie,le.lastBaseUpdate=G))}if(_!==null){var fe=l.baseState;D=0,le=ie=G=null,z=_;do{var se=z.lane&-536870913,ae=se!==z.lane;if(ae?(Me&se)===se:(n&se)===se){se!==0&&se===dr&&(Dl=!0),le!==null&&(le=le.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var ve=e,xe=z;se=t;var Ke=s;switch(xe.tag){case 1:if(ve=xe.payload,typeof ve=="function"){fe=ve.call(Ke,fe,se);break e}fe=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=xe.payload,se=typeof ve=="function"?ve.call(Ke,fe,se):ve,se==null)break e;fe=f({},fe,se);break e;case 2:Wi=!0}}se=z.callback,se!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=l.callbacks,ae===null?l.callbacks=[se]:ae.push(se))}else ae={lane:se,tag:z.tag,payload:z.payload,callback:z.callback,next:null},le===null?(ie=le=ae,G=fe):le=le.next=ae,D|=se;if(z=z.next,z===null){if(z=l.shared.pending,z===null)break;ae=z,z=ae.next,ae.next=null,l.lastBaseUpdate=ae,l.shared.pending=null}}while(!0);le===null&&(G=fe),l.baseState=G,l.firstBaseUpdate=ie,l.lastBaseUpdate=le,_===null&&(l.shared.lanes=0),ss|=D,e.lanes=D,e.memoizedState=fe}}function ed(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function td(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)ed(s[e],t)}var pr=N(null),xa=N(0);function id(e,t){e=zi,P(xa,e),P(pr,t),zi=e|t.baseLanes}function Ol(){P(xa,zi),P(pr,pr.current)}function Ml(){zi=xa.current,B(pr),B(xa)}var Ft=N(null),si=null;function Qi(e){var t=e.alternate;P(ot,ot.current&1),P(Ft,e),si===null&&(t===null||pr.current!==null||t.memoizedState!==null)&&(si=e)}function Nl(e){P(ot,ot.current),P(Ft,e),si===null&&(si=e)}function sd(e){e.tag===22?(P(ot,ot.current),P(Ft,e),si===null&&(si=e)):es()}function es(){P(ot,ot.current),P(Ft,Ft.current)}function qt(e){B(Ft),si===e&&(si=null),B(ot)}var ot=N(0);function Ca(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Uc(s)||$c(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ri=0,Ee=null,Fe=null,dt=null,wa=!1,vr=!1,Us=!1,Ea=0,un=0,gr=null,og=0;function st(){throw Error(o(321))}function Ll(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Pt(e[s],t[s]))return!1;return!0}function jl(e,t,s,n,l,_){return Ri=_,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,q.H=e===null||e.memoizedState===null?$d:Wl,Us=!1,_=s(n,l),Us=!1,vr&&(_=nd(t,s,n,l)),rd(e),_}function rd(e){q.H=fn;var t=Fe!==null&&Fe.next!==null;if(Ri=0,dt=Fe=Ee=null,wa=!1,un=0,gr=null,t)throw Error(o(300));e===null||ft||(e=e.dependencies,e!==null&&_a(e)&&(ft=!0))}function nd(e,t,s,n){Ee=e;var l=0;do{if(vr&&(gr=null),un=0,vr=!1,25<=l)throw Error(o(301));if(l+=1,dt=Fe=null,e.updateQueue!=null){var _=e.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}q.H=Id,_=t(s,n)}while(vr);return _}function lg(){var e=q.H,t=e.useState()[0];return t=typeof t.then=="function"?hn(t):t,e=e.useState()[0],(Fe!==null?Fe.memoizedState:null)!==e&&(Ee.flags|=1024),t}function Bl(){var e=Ea!==0;return Ea=0,e}function zl(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Hl(e){if(wa){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}wa=!1}Ri=0,dt=Fe=Ee=null,vr=!1,un=Ea=0,gr=null}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?Ee.memoizedState=dt=e:dt=dt.next=e,dt}function lt(){if(Fe===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=dt===null?Ee.memoizedState:dt.next;if(t!==null)dt=t,Fe=e;else{if(e===null)throw Ee.alternate===null?Error(o(467)):Error(o(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},dt===null?Ee.memoizedState=dt=e:dt=dt.next=e}return dt}function ka(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hn(e){var t=un;return un+=1,gr===null&&(gr=[]),e=Yh(gr,e,t),t=Ee,(dt===null?t.memoizedState:dt.next)===null&&(t=t.alternate,q.H=t===null||t.memoizedState===null?$d:Wl),e}function Ta(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return hn(e);if(e.$$typeof===p)return Ct(e)}throw Error(o(438,String(e)))}function Ul(e){var t=null,s=Ee.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var n=Ee.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=ka(),Ee.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),n=0;n<e;n++)s[n]=$;return t.index++,s}function Di(e,t){return typeof t=="function"?t(e):t}function Aa(e){var t=lt();return $l(t,Fe,e)}function $l(e,t,s){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=s;var l=e.baseQueue,_=n.pending;if(_!==null){if(l!==null){var D=l.next;l.next=_.next,_.next=D}t.baseQueue=l=_,n.pending=null}if(_=e.baseState,l===null)e.memoizedState=_;else{t=l.next;var z=D=null,G=null,ie=t,le=!1;do{var fe=ie.lane&-536870913;if(fe!==ie.lane?(Me&fe)===fe:(Ri&fe)===fe){var se=ie.revertLane;if(se===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),fe===dr&&(le=!0);else if((Ri&se)===se){ie=ie.next,se===dr&&(le=!0);continue}else fe={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},G===null?(z=G=fe,D=_):G=G.next=fe,Ee.lanes|=se,ss|=se;fe=ie.action,Us&&s(_,fe),_=ie.hasEagerState?ie.eagerState:s(_,fe)}else se={lane:fe,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},G===null?(z=G=se,D=_):G=G.next=se,Ee.lanes|=fe,ss|=fe;ie=ie.next}while(ie!==null&&ie!==t);if(G===null?D=_:G.next=z,!Pt(_,e.memoizedState)&&(ft=!0,le&&(s=fr,s!==null)))throw s;e.memoizedState=_,e.baseState=D,e.baseQueue=G,n.lastRenderedState=_}return l===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Il(e){var t=lt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var n=s.dispatch,l=s.pending,_=t.memoizedState;if(l!==null){s.pending=null;var D=l=l.next;do _=e(_,D.action),D=D.next;while(D!==l);Pt(_,t.memoizedState)||(ft=!0),t.memoizedState=_,t.baseQueue===null&&(t.baseState=_),s.lastRenderedState=_}return[_,n]}function ad(e,t,s){var n=Ee,l=lt(),_=Le;if(_){if(s===void 0)throw Error(o(407));s=s()}else s=t();var D=!Pt((Fe||l).memoizedState,s);if(D&&(l.memoizedState=s,ft=!0),l=l.queue,Fl(cd.bind(null,n,l,e),[e]),l.getSnapshot!==t||D||dt!==null&&dt.memoizedState.tag&1){if(n.flags|=2048,yr(9,{destroy:void 0},ld.bind(null,n,l,s,t),null),Ve===null)throw Error(o(349));_||(Ri&127)!==0||od(n,t,s)}return s}function od(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ee.updateQueue,t===null?(t=ka(),Ee.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function ld(e,t,s,n){t.value=s,t.getSnapshot=n,ud(t)&&hd(e)}function cd(e,t,s){return s(function(){ud(t)&&hd(e)})}function ud(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Pt(e,s)}catch{return!0}}function hd(e){var t=Ds(e,2);t!==null&&zt(t,e,2)}function Pl(e){var t=Tt();if(typeof e=="function"){var s=e;if(e=s(),Us){Zi(!0);try{s()}finally{Zi(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:e},t}function dd(e,t,s,n){return e.baseState=s,$l(e,Fe,typeof n=="function"?n:Di)}function cg(e,t,s,n,l){if(Oa(e))throw Error(o(485));if(e=t.action,e!==null){var _={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){_.listeners.push(D)}};q.T!==null?s(!0):_.isTransition=!1,n(_),s=t.pending,s===null?(_.next=t.pending=_,fd(t,_)):(_.next=s.next,t.pending=s.next=_)}}function fd(e,t){var s=t.action,n=t.payload,l=e.state;if(t.isTransition){var _=q.T,D={};q.T=D;try{var z=s(l,n),G=q.S;G!==null&&G(D,z),md(e,t,z)}catch(ie){Zl(e,t,ie)}finally{_!==null&&D.types!==null&&(_.types=D.types),q.T=_}}else try{_=s(l,n),md(e,t,_)}catch(ie){Zl(e,t,ie)}}function md(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(n){_d(e,t,n)},function(n){return Zl(e,t,n)}):_d(e,t,s)}function _d(e,t,s){t.status="fulfilled",t.value=s,pd(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,fd(e,s)))}function Zl(e,t,s){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=s,pd(t),t=t.next;while(t!==n)}e.action=null}function pd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function vd(e,t){return t}function gd(e,t){if(Le){var s=Ve.formState;if(s!==null){e:{var n=Ee;if(Le){if(We){t:{for(var l=We,_=ii;l.nodeType!==8;){if(!_){l=null;break t}if(l=ri(l.nextSibling),l===null){l=null;break t}}_=l.data,l=_==="F!"||_==="F"?l:null}if(l){We=ri(l.nextSibling),n=l.data==="F!";break e}}Gi(n)}n=!1}n&&(t=s[0])}}return s=Tt(),s.memoizedState=s.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vd,lastRenderedState:t},s.queue=n,s=zd.bind(null,Ee,n),n.dispatch=s,n=Pl(!1),_=Yl.bind(null,Ee,!1,n.queue),n=Tt(),l={state:t,dispatch:null,action:e,pending:null},n.queue=l,s=cg.bind(null,Ee,l,_,s),l.dispatch=s,n.memoizedState=e,[t,s,!1]}function yd(e){var t=lt();return bd(t,Fe,e)}function bd(e,t,s){if(t=$l(e,t,vd)[0],e=Aa(Di)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=hn(t)}catch(D){throw D===mr?ga:D}else n=t;t=lt();var l=t.queue,_=l.dispatch;return s!==t.memoizedState&&(Ee.flags|=2048,yr(9,{destroy:void 0},ug.bind(null,l,s),null)),[n,_,e]}function ug(e,t){e.action=t}function Sd(e){var t=lt(),s=Fe;if(s!==null)return bd(t,s,e);lt(),t=t.memoizedState,s=lt();var n=s.queue.dispatch;return s.memoizedState=e,[t,n,!1]}function yr(e,t,s,n){return e={tag:e,create:s,deps:n,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=ka(),Ee.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(n=s.next,s.next=e,e.next=n,t.lastEffect=e),e}function xd(){return lt().memoizedState}function Ra(e,t,s,n){var l=Tt();Ee.flags|=e,l.memoizedState=yr(1|t,{destroy:void 0},s,n===void 0?null:n)}function Da(e,t,s,n){var l=lt();n=n===void 0?null:n;var _=l.memoizedState.inst;Fe!==null&&n!==null&&Ll(n,Fe.memoizedState.deps)?l.memoizedState=yr(t,_,s,n):(Ee.flags|=e,l.memoizedState=yr(1|t,_,s,n))}function Cd(e,t){Ra(8390656,8,e,t)}function Fl(e,t){Da(2048,8,e,t)}function hg(e){Ee.flags|=4;var t=Ee.updateQueue;if(t===null)t=ka(),Ee.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function wd(e){var t=lt().memoizedState;return hg({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Ed(e,t){return Da(4,2,e,t)}function kd(e,t){return Da(4,4,e,t)}function Td(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ad(e,t,s){s=s!=null?s.concat([e]):null,Da(4,4,Td.bind(null,t,e),s)}function ql(){}function Rd(e,t){var s=lt();t=t===void 0?null:t;var n=s.memoizedState;return t!==null&&Ll(t,n[1])?n[0]:(s.memoizedState=[e,t],e)}function Dd(e,t){var s=lt();t=t===void 0?null:t;var n=s.memoizedState;if(t!==null&&Ll(t,n[1]))return n[0];if(n=e(),Us){Zi(!0);try{e()}finally{Zi(!1)}}return s.memoizedState=[n,t],n}function Kl(e,t,s){return s===void 0||(Ri&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Mf(),Ee.lanes|=e,ss|=e,s)}function Od(e,t,s,n){return Pt(s,t)?s:pr.current!==null?(e=Kl(e,s,n),Pt(e,t)||(ft=!0),e):(Ri&42)===0||(Ri&1073741824)!==0&&(Me&261930)===0?(ft=!0,e.memoizedState=s):(e=Mf(),Ee.lanes|=e,ss|=e,t)}function Md(e,t,s,n,l){var _=Q.p;Q.p=_!==0&&8>_?_:8;var D=q.T,z={};q.T=z,Yl(e,!1,t,s);try{var G=l(),ie=q.S;if(ie!==null&&ie(z,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var le=ag(G,n);dn(e,t,le,Gt(e))}else dn(e,t,n,Gt(e))}catch(fe){dn(e,t,{then:function(){},status:"rejected",reason:fe},Gt())}finally{Q.p=_,D!==null&&z.types!==null&&(D.types=z.types),q.T=D}}function dg(){}function Vl(e,t,s,n){if(e.tag!==5)throw Error(o(476));var l=Nd(e).queue;Md(e,l,t,ne,s===null?dg:function(){return Ld(e),s(n)})}function Nd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:ne},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ld(e){var t=Nd(e);t.next===null&&(t=e.alternate.memoizedState),dn(e,t.next.queue,{},Gt())}function Gl(){return Ct(Rn)}function jd(){return lt().memoizedState}function Bd(){return lt().memoizedState}function fg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Gt();e=Xi(s);var n=Ji(t,e,s);n!==null&&(zt(n,t,s),on(n,t,s)),t={cache:Cl()},e.payload=t;return}t=t.return}}function mg(e,t,s){var n=Gt();s={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Oa(e)?Hd(t,s):(s=dl(e,t,s,n),s!==null&&(zt(s,e,n),Ud(s,t,n)))}function zd(e,t,s){var n=Gt();dn(e,t,s,n)}function dn(e,t,s,n){var l={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Oa(e))Hd(t,l);else{var _=e.alternate;if(e.lanes===0&&(_===null||_.lanes===0)&&(_=t.lastRenderedReducer,_!==null))try{var D=t.lastRenderedState,z=_(D,s);if(l.hasEagerState=!0,l.eagerState=z,Pt(z,D))return ha(e,t,l,0),Ve===null&&ua(),!1}catch{}finally{}if(s=dl(e,t,l,n),s!==null)return zt(s,e,n),Ud(s,t,n),!0}return!1}function Yl(e,t,s,n){if(n={lane:2,revertLane:Tc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Oa(e)){if(t)throw Error(o(479))}else t=dl(e,s,n,2),t!==null&&zt(t,e,2)}function Oa(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Hd(e,t){vr=wa=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Ud(e,t,s){if((s&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,Fu(e,s)}}var fn={readContext:Ct,use:Ta,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};fn.useEffectEvent=st;var $d={readContext:Ct,use:Ta,useCallback:function(e,t){return Tt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:Cd,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Ra(4194308,4,Td.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Ra(4194308,4,e,t)},useInsertionEffect:function(e,t){Ra(4,2,e,t)},useMemo:function(e,t){var s=Tt();t=t===void 0?null:t;var n=e();if(Us){Zi(!0);try{e()}finally{Zi(!1)}}return s.memoizedState=[n,t],n},useReducer:function(e,t,s){var n=Tt();if(s!==void 0){var l=s(t);if(Us){Zi(!0);try{s(t)}finally{Zi(!1)}}}else l=t;return n.memoizedState=n.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},n.queue=e,e=e.dispatch=mg.bind(null,Ee,e),[n.memoizedState,e]},useRef:function(e){var t=Tt();return e={current:e},t.memoizedState=e},useState:function(e){e=Pl(e);var t=e.queue,s=zd.bind(null,Ee,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:ql,useDeferredValue:function(e,t){var s=Tt();return Kl(s,e,t)},useTransition:function(){var e=Pl(!1);return e=Md.bind(null,Ee,e.queue,!0,!1),Tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var n=Ee,l=Tt();if(Le){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),Ve===null)throw Error(o(349));(Me&127)!==0||od(n,t,s)}l.memoizedState=s;var _={value:s,getSnapshot:t};return l.queue=_,Cd(cd.bind(null,n,_,e),[e]),n.flags|=2048,yr(9,{destroy:void 0},ld.bind(null,n,_,s,t),null),s},useId:function(){var e=Tt(),t=Ve.identifierPrefix;if(Le){var s=pi,n=_i;s=(n&~(1<<32-It(n)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Ea++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=og++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Gl,useFormState:gd,useActionState:gd,useOptimistic:function(e){var t=Tt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Yl.bind(null,Ee,!0,s),s.dispatch=t,[e,t]},useMemoCache:Ul,useCacheRefresh:function(){return Tt().memoizedState=fg.bind(null,Ee)},useEffectEvent:function(e){var t=Tt(),s={impl:e};return t.memoizedState=s,function(){if((He&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Wl={readContext:Ct,use:Ta,useCallback:Rd,useContext:Ct,useEffect:Fl,useImperativeHandle:Ad,useInsertionEffect:Ed,useLayoutEffect:kd,useMemo:Dd,useReducer:Aa,useRef:xd,useState:function(){return Aa(Di)},useDebugValue:ql,useDeferredValue:function(e,t){var s=lt();return Od(s,Fe.memoizedState,e,t)},useTransition:function(){var e=Aa(Di)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:hn(e),t]},useSyncExternalStore:ad,useId:jd,useHostTransitionStatus:Gl,useFormState:yd,useActionState:yd,useOptimistic:function(e,t){var s=lt();return dd(s,Fe,e,t)},useMemoCache:Ul,useCacheRefresh:Bd};Wl.useEffectEvent=wd;var Id={readContext:Ct,use:Ta,useCallback:Rd,useContext:Ct,useEffect:Fl,useImperativeHandle:Ad,useInsertionEffect:Ed,useLayoutEffect:kd,useMemo:Dd,useReducer:Il,useRef:xd,useState:function(){return Il(Di)},useDebugValue:ql,useDeferredValue:function(e,t){var s=lt();return Fe===null?Kl(s,e,t):Od(s,Fe.memoizedState,e,t)},useTransition:function(){var e=Il(Di)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:hn(e),t]},useSyncExternalStore:ad,useId:jd,useHostTransitionStatus:Gl,useFormState:Sd,useActionState:Sd,useOptimistic:function(e,t){var s=lt();return Fe!==null?dd(s,Fe,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Ul,useCacheRefresh:Bd};Id.useEffectEvent=wd;function Xl(e,t,s,n){t=e.memoizedState,s=s(n,t),s=s==null?t:f({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Jl={enqueueSetState:function(e,t,s){e=e._reactInternals;var n=Gt(),l=Xi(n);l.payload=t,s!=null&&(l.callback=s),t=Ji(e,l,n),t!==null&&(zt(t,e,n),on(t,e,n))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var n=Gt(),l=Xi(n);l.tag=1,l.payload=t,s!=null&&(l.callback=s),t=Ji(e,l,n),t!==null&&(zt(t,e,n),on(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Gt(),n=Xi(s);n.tag=2,t!=null&&(n.callback=t),t=Ji(e,n,s),t!==null&&(zt(t,e,s),on(t,e,s))}};function Pd(e,t,s,n,l,_,D){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,_,D):t.prototype&&t.prototype.isPureReactComponent?!Jr(s,n)||!Jr(l,_):!0}function Zd(e,t,s,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,n),t.state!==e&&Jl.enqueueReplaceState(t,t.state,null)}function $s(e,t){var s=t;if("ref"in t){s={};for(var n in t)n!=="ref"&&(s[n]=t[n])}if(e=e.defaultProps){s===t&&(s=f({},s));for(var l in e)s[l]===void 0&&(s[l]=e[l])}return s}function Fd(e){ca(e)}function qd(e){console.error(e)}function Kd(e){ca(e)}function Ma(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Vd(e,t,s){try{var n=e.onCaughtError;n(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function Ql(e,t,s){return s=Xi(s),s.tag=3,s.payload={element:null},s.callback=function(){Ma(e,t)},s}function Gd(e){return e=Xi(e),e.tag=3,e}function Yd(e,t,s,n){var l=s.type.getDerivedStateFromError;if(typeof l=="function"){var _=n.value;e.payload=function(){return l(_)},e.callback=function(){Vd(t,s,n)}}var D=s.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(e.callback=function(){Vd(t,s,n),typeof l!="function"&&(rs===null?rs=new Set([this]):rs.add(this));var z=n.stack;this.componentDidCatch(n.value,{componentStack:z!==null?z:""})})}function _g(e,t,s,n,l){if(s.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=s.alternate,t!==null&&hr(t,s,l,!0),s=Ft.current,s!==null){switch(s.tag){case 31:case 13:return si===null?Fa():s.alternate===null&&rt===0&&(rt=3),s.flags&=-257,s.flags|=65536,s.lanes=l,n===ya?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([n]):t.add(n),wc(e,n,l)),!1;case 22:return s.flags|=65536,n===ya?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([n]):s.add(n)),wc(e,n,l)),!1}throw Error(o(435,s.tag))}return wc(e,n,l),Fa(),!1}if(Le)return t=Ft.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,n!==gl&&(e=Error(o(422),{cause:n}),tn(Qt(e,s)))):(n!==gl&&(t=Error(o(423),{cause:n}),tn(Qt(t,s))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,n=Qt(n,s),l=Ql(e.stateNode,n,l),Rl(e,l),rt!==4&&(rt=2)),!1;var _=Error(o(520),{cause:n});if(_=Qt(_,s),Sn===null?Sn=[_]:Sn.push(_),rt!==4&&(rt=2),t===null)return!0;n=Qt(n,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=l&-l,s.lanes|=e,e=Ql(s.stateNode,n,e),Rl(s,e),!1;case 1:if(t=s.type,_=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(rs===null||!rs.has(_))))return s.flags|=65536,l&=-l,s.lanes|=l,l=Gd(l),Yd(l,e,s,n),Rl(s,l),!1}s=s.return}while(s!==null);return!1}var ec=Error(o(461)),ft=!1;function wt(e,t,s,n){t.child=e===null?Qh(t,null,s,n):Hs(t,e.child,s,n)}function Wd(e,t,s,n,l){s=s.render;var _=t.ref;if("ref"in n){var D={};for(var z in n)z!=="ref"&&(D[z]=n[z])}else D=n;return Ls(t),n=jl(e,t,s,D,_,l),z=Bl(),e!==null&&!ft?(zl(e,t,l),Oi(e,t,l)):(Le&&z&&pl(t),t.flags|=1,wt(e,t,n,l),t.child)}function Xd(e,t,s,n,l){if(e===null){var _=s.type;return typeof _=="function"&&!fl(_)&&_.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=_,Jd(e,t,_,n,l)):(e=fa(s.type,null,n,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(_=e.child,!lc(e,l)){var D=_.memoizedProps;if(s=s.compare,s=s!==null?s:Jr,s(D,n)&&e.ref===t.ref)return Oi(e,t,l)}return t.flags|=1,e=Ei(_,n),e.ref=t.ref,e.return=t,t.child=e}function Jd(e,t,s,n,l){if(e!==null){var _=e.memoizedProps;if(Jr(_,n)&&e.ref===t.ref)if(ft=!1,t.pendingProps=n=_,lc(e,l))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,Oi(e,t,l)}return tc(e,t,s,n,l)}function Qd(e,t,s,n){var l=n.children,_=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(_=_!==null?_.baseLanes|s:s,e!==null){for(n=t.child=e.child,l=0;n!==null;)l=l|n.lanes|n.childLanes,n=n.sibling;n=l&~_}else n=0,t.child=null;return ef(e,t,_,s,n)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&va(t,_!==null?_.cachePool:null),_!==null?id(t,_):Ol(),sd(t);else return n=t.lanes=536870912,ef(e,t,_!==null?_.baseLanes|s:s,s,n)}else _!==null?(va(t,_.cachePool),id(t,_),es(),t.memoizedState=null):(e!==null&&va(t,null),Ol(),es());return wt(e,t,l,s),t.child}function mn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ef(e,t,s,n,l){var _=El();return _=_===null?null:{parent:ht._currentValue,pool:_},t.memoizedState={baseLanes:s,cachePool:_},e!==null&&va(t,null),Ol(),sd(t),e!==null&&hr(e,t,n,!0),t.childLanes=l,null}function Na(e,t){return t=ja({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function tf(e,t,s){return Hs(t,e.child,null,s),e=Na(t,t.pendingProps),e.flags|=2,qt(t),t.memoizedState=null,e}function pg(e,t,s){var n=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(n.mode==="hidden")return e=Na(t,n),t.lanes=536870912,mn(null,e);if(Nl(t),(e=We)?(e=mm(e,ii),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki!==null?{id:_i,overflow:pi}:null,retryLane:536870912,hydrationErrors:null},s=Hh(e),s.return=t,t.child=s,xt=t,We=null)):e=null,e===null)throw Gi(t);return t.lanes=536870912,null}return Na(t,n)}var _=e.memoizedState;if(_!==null){var D=_.dehydrated;if(Nl(t),l)if(t.flags&256)t.flags&=-257,t=tf(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(ft||hr(e,t,s,!1),l=(s&e.childLanes)!==0,ft||l){if(n=Ve,n!==null&&(D=qu(n,s),D!==0&&D!==_.retryLane))throw _.retryLane=D,Ds(e,D),zt(n,e,D),ec;Fa(),t=tf(e,t,s)}else e=_.treeContext,We=ri(D.nextSibling),xt=t,Le=!0,Vi=null,ii=!1,e!==null&&Ih(t,e),t=Na(t,n),t.flags|=4096;return t}return e=Ei(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function La(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function tc(e,t,s,n,l){return Ls(t),s=jl(e,t,s,n,void 0,l),n=Bl(),e!==null&&!ft?(zl(e,t,l),Oi(e,t,l)):(Le&&n&&pl(t),t.flags|=1,wt(e,t,s,l),t.child)}function sf(e,t,s,n,l,_){return Ls(t),t.updateQueue=null,s=nd(t,n,s,l),rd(e),n=Bl(),e!==null&&!ft?(zl(e,t,_),Oi(e,t,_)):(Le&&n&&pl(t),t.flags|=1,wt(e,t,s,_),t.child)}function rf(e,t,s,n,l){if(Ls(t),t.stateNode===null){var _=or,D=s.contextType;typeof D=="object"&&D!==null&&(_=Ct(D)),_=new s(n,_),t.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Jl,t.stateNode=_,_._reactInternals=t,_=t.stateNode,_.props=n,_.state=t.memoizedState,_.refs={},Tl(t),D=s.contextType,_.context=typeof D=="object"&&D!==null?Ct(D):or,_.state=t.memoizedState,D=s.getDerivedStateFromProps,typeof D=="function"&&(Xl(t,s,D,n),_.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(D=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),D!==_.state&&Jl.enqueueReplaceState(_,_.state,null),cn(t,n,_,l),ln(),_.state=t.memoizedState),typeof _.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){_=t.stateNode;var z=t.memoizedProps,G=$s(s,z);_.props=G;var ie=_.context,le=s.contextType;D=or,typeof le=="object"&&le!==null&&(D=Ct(le));var fe=s.getDerivedStateFromProps;le=typeof fe=="function"||typeof _.getSnapshotBeforeUpdate=="function",z=t.pendingProps!==z,le||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(z||ie!==D)&&Zd(t,_,n,D),Wi=!1;var se=t.memoizedState;_.state=se,cn(t,n,_,l),ln(),ie=t.memoizedState,z||se!==ie||Wi?(typeof fe=="function"&&(Xl(t,s,fe,n),ie=t.memoizedState),(G=Wi||Pd(t,s,G,n,se,ie,D))?(le||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(t.flags|=4194308)):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=ie),_.props=n,_.state=ie,_.context=D,n=G):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{_=t.stateNode,Al(e,t),D=t.memoizedProps,le=$s(s,D),_.props=le,fe=t.pendingProps,se=_.context,ie=s.contextType,G=or,typeof ie=="object"&&ie!==null&&(G=Ct(ie)),z=s.getDerivedStateFromProps,(ie=typeof z=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(D!==fe||se!==G)&&Zd(t,_,n,G),Wi=!1,se=t.memoizedState,_.state=se,cn(t,n,_,l),ln();var ae=t.memoizedState;D!==fe||se!==ae||Wi||e!==null&&e.dependencies!==null&&_a(e.dependencies)?(typeof z=="function"&&(Xl(t,s,z,n),ae=t.memoizedState),(le=Wi||Pd(t,s,le,n,se,ae,G)||e!==null&&e.dependencies!==null&&_a(e.dependencies))?(ie||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(n,ae,G),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(n,ae,G)),typeof _.componentDidUpdate=="function"&&(t.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof _.componentDidUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=ae),_.props=n,_.state=ae,_.context=G,n=le):(typeof _.componentDidUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),n=!1)}return _=n,La(e,t),n=(t.flags&128)!==0,_||n?(_=t.stateNode,s=n&&typeof s.getDerivedStateFromError!="function"?null:_.render(),t.flags|=1,e!==null&&n?(t.child=Hs(t,e.child,null,l),t.child=Hs(t,null,s,l)):wt(e,t,s,l),t.memoizedState=_.state,e=t.child):e=Oi(e,t,l),e}function nf(e,t,s,n){return Ms(),t.flags|=256,wt(e,t,s,n),t.child}var ic={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function sc(e){return{baseLanes:e,cachePool:Vh()}}function rc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Vt),e}function af(e,t,s){var n=t.pendingProps,l=!1,_=(t.flags&128)!==0,D;if((D=_)||(D=e!==null&&e.memoizedState===null?!1:(ot.current&2)!==0),D&&(l=!0,t.flags&=-129),D=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(l?Qi(t):es(),(e=We)?(e=mm(e,ii),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki!==null?{id:_i,overflow:pi}:null,retryLane:536870912,hydrationErrors:null},s=Hh(e),s.return=t,t.child=s,xt=t,We=null)):e=null,e===null)throw Gi(t);return $c(e)?t.lanes=32:t.lanes=536870912,null}var z=n.children;return n=n.fallback,l?(es(),l=t.mode,z=ja({mode:"hidden",children:z},l),n=Os(n,l,s,null),z.return=t,n.return=t,z.sibling=n,t.child=z,n=t.child,n.memoizedState=sc(s),n.childLanes=rc(e,D,s),t.memoizedState=ic,mn(null,n)):(Qi(t),nc(t,z))}var G=e.memoizedState;if(G!==null&&(z=G.dehydrated,z!==null)){if(_)t.flags&256?(Qi(t),t.flags&=-257,t=ac(e,t,s)):t.memoizedState!==null?(es(),t.child=e.child,t.flags|=128,t=null):(es(),z=n.fallback,l=t.mode,n=ja({mode:"visible",children:n.children},l),z=Os(z,l,s,null),z.flags|=2,n.return=t,z.return=t,n.sibling=z,t.child=n,Hs(t,e.child,null,s),n=t.child,n.memoizedState=sc(s),n.childLanes=rc(e,D,s),t.memoizedState=ic,t=mn(null,n));else if(Qi(t),$c(z)){if(D=z.nextSibling&&z.nextSibling.dataset,D)var ie=D.dgst;D=ie,n=Error(o(419)),n.stack="",n.digest=D,tn({value:n,source:null,stack:null}),t=ac(e,t,s)}else if(ft||hr(e,t,s,!1),D=(s&e.childLanes)!==0,ft||D){if(D=Ve,D!==null&&(n=qu(D,s),n!==0&&n!==G.retryLane))throw G.retryLane=n,Ds(e,n),zt(D,e,n),ec;Uc(z)||Fa(),t=ac(e,t,s)}else Uc(z)?(t.flags|=192,t.child=e.child,t=null):(e=G.treeContext,We=ri(z.nextSibling),xt=t,Le=!0,Vi=null,ii=!1,e!==null&&Ih(t,e),t=nc(t,n.children),t.flags|=4096);return t}return l?(es(),z=n.fallback,l=t.mode,G=e.child,ie=G.sibling,n=Ei(G,{mode:"hidden",children:n.children}),n.subtreeFlags=G.subtreeFlags&65011712,ie!==null?z=Ei(ie,z):(z=Os(z,l,s,null),z.flags|=2),z.return=t,n.return=t,n.sibling=z,t.child=n,mn(null,n),n=t.child,z=e.child.memoizedState,z===null?z=sc(s):(l=z.cachePool,l!==null?(G=ht._currentValue,l=l.parent!==G?{parent:G,pool:G}:l):l=Vh(),z={baseLanes:z.baseLanes|s,cachePool:l}),n.memoizedState=z,n.childLanes=rc(e,D,s),t.memoizedState=ic,mn(e.child,n)):(Qi(t),s=e.child,e=s.sibling,s=Ei(s,{mode:"visible",children:n.children}),s.return=t,s.sibling=null,e!==null&&(D=t.deletions,D===null?(t.deletions=[e],t.flags|=16):D.push(e)),t.child=s,t.memoizedState=null,s)}function nc(e,t){return t=ja({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ja(e,t){return e=Zt(22,e,null,t),e.lanes=0,e}function ac(e,t,s){return Hs(t,e.child,null,s),e=nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function of(e,t,s){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Sl(e.return,t,s)}function oc(e,t,s,n,l,_){var D=e.memoizedState;D===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:l,treeForkCount:_}:(D.isBackwards=t,D.rendering=null,D.renderingStartTime=0,D.last=n,D.tail=s,D.tailMode=l,D.treeForkCount=_)}function lf(e,t,s){var n=t.pendingProps,l=n.revealOrder,_=n.tail;n=n.children;var D=ot.current,z=(D&2)!==0;if(z?(D=D&1|2,t.flags|=128):D&=1,P(ot,D),wt(e,t,n,s),n=Le?en:0,!z&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&of(e,s,t);else if(e.tag===19)of(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(l){case"forwards":for(s=t.child,l=null;s!==null;)e=s.alternate,e!==null&&Ca(e)===null&&(l=s),s=s.sibling;s=l,s===null?(l=t.child,t.child=null):(l=s.sibling,s.sibling=null),oc(t,!1,l,s,_,n);break;case"backwards":case"unstable_legacy-backwards":for(s=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Ca(e)===null){t.child=l;break}e=l.sibling,l.sibling=s,s=l,l=e}oc(t,!0,s,null,_,n);break;case"together":oc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Oi(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),ss|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(hr(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,s=Ei(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Ei(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function lc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&_a(e)))}function vg(e,t,s){switch(t.tag){case 3:H(t,t.stateNode.containerInfo),Yi(t,ht,e.memoizedState.cache),Ms();break;case 27:case 5:oe(t);break;case 4:H(t,t.stateNode.containerInfo);break;case 10:Yi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Nl(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Qi(t),t.flags|=128,null):(s&t.child.childLanes)!==0?af(e,t,s):(Qi(t),e=Oi(e,t,s),e!==null?e.sibling:null);Qi(t);break;case 19:var l=(e.flags&128)!==0;if(n=(s&t.childLanes)!==0,n||(hr(e,t,s,!1),n=(s&t.childLanes)!==0),l){if(n)return lf(e,t,s);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),P(ot,ot.current),n)break;return null;case 22:return t.lanes=0,Qd(e,t,s,t.pendingProps);case 24:Yi(t,ht,e.memoizedState.cache)}return Oi(e,t,s)}function cf(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!lc(e,s)&&(t.flags&128)===0)return ft=!1,vg(e,t,s);ft=(e.flags&131072)!==0}else ft=!1,Le&&(t.flags&1048576)!==0&&$h(t,en,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Bs(t.elementType),t.type=e,typeof e=="function")fl(e)?(n=$s(e,n),t.tag=1,t=rf(null,t,e,n,s)):(t.tag=0,t=tc(null,t,e,n,s));else{if(e!=null){var l=e.$$typeof;if(l===S){t.tag=11,t=Wd(null,t,e,n,s);break e}else if(l===M){t.tag=14,t=Xd(null,t,e,n,s);break e}}throw t=J(e)||e,Error(o(306,t,""))}}return t;case 0:return tc(e,t,t.type,t.pendingProps,s);case 1:return n=t.type,l=$s(n,t.pendingProps),rf(e,t,n,l,s);case 3:e:{if(H(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var _=t.memoizedState;l=_.element,Al(e,t),cn(t,n,null,s);var D=t.memoizedState;if(n=D.cache,Yi(t,ht,n),n!==_.cache&&xl(t,[ht],s,!0),ln(),n=D.element,_.isDehydrated)if(_={element:n,isDehydrated:!1,cache:D.cache},t.updateQueue.baseState=_,t.memoizedState=_,t.flags&256){t=nf(e,t,n,s);break e}else if(n!==l){l=Qt(Error(o(424)),t),tn(l),t=nf(e,t,n,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(We=ri(e.firstChild),xt=t,Le=!0,Vi=null,ii=!0,s=Qh(t,null,n,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ms(),n===l){t=Oi(e,t,s);break e}wt(e,t,n,s)}t=t.child}return t;case 26:return La(e,t),e===null?(s=bm(t.type,null,t.pendingProps,null))?t.memoizedState=s:Le||(s=t.type,e=t.pendingProps,n=Xa(he.current).createElement(s),n[St]=t,n[Ot]=e,Et(n,s,e),yt(n),t.stateNode=n):t.memoizedState=bm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&Le&&(n=t.stateNode=vm(t.type,t.pendingProps,he.current),xt=t,ii=!0,l=We,ls(t.type)?(Ic=l,We=ri(n.firstChild)):We=l),wt(e,t,t.pendingProps.children,s),La(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((l=n=We)&&(n=Vg(n,t.type,t.pendingProps,ii),n!==null?(t.stateNode=n,xt=t,We=ri(n.firstChild),ii=!1,l=!0):l=!1),l||Gi(t)),oe(t),l=t.type,_=t.pendingProps,D=e!==null?e.memoizedProps:null,n=_.children,Bc(l,_)?n=null:D!==null&&Bc(l,D)&&(t.flags|=32),t.memoizedState!==null&&(l=jl(e,t,lg,null,null,s),Rn._currentValue=l),La(e,t),wt(e,t,n,s),t.child;case 6:return e===null&&Le&&((e=s=We)&&(s=Gg(s,t.pendingProps,ii),s!==null?(t.stateNode=s,xt=t,We=null,e=!0):e=!1),e||Gi(t)),null;case 13:return af(e,t,s);case 4:return H(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hs(t,null,n,s):wt(e,t,n,s),t.child;case 11:return Wd(e,t,t.type,t.pendingProps,s);case 7:return wt(e,t,t.pendingProps,s),t.child;case 8:return wt(e,t,t.pendingProps.children,s),t.child;case 12:return wt(e,t,t.pendingProps.children,s),t.child;case 10:return n=t.pendingProps,Yi(t,t.type,n.value),wt(e,t,n.children,s),t.child;case 9:return l=t.type._context,n=t.pendingProps.children,Ls(t),l=Ct(l),n=n(l),t.flags|=1,wt(e,t,n,s),t.child;case 14:return Xd(e,t,t.type,t.pendingProps,s);case 15:return Jd(e,t,t.type,t.pendingProps,s);case 19:return lf(e,t,s);case 31:return pg(e,t,s);case 22:return Qd(e,t,s,t.pendingProps);case 24:return Ls(t),n=Ct(ht),e===null?(l=El(),l===null&&(l=Ve,_=Cl(),l.pooledCache=_,_.refCount++,_!==null&&(l.pooledCacheLanes|=s),l=_),t.memoizedState={parent:n,cache:l},Tl(t),Yi(t,ht,l)):((e.lanes&s)!==0&&(Al(e,t),cn(t,null,null,s),ln()),l=e.memoizedState,_=t.memoizedState,l.parent!==n?(l={parent:n,cache:n},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),Yi(t,ht,n)):(n=_.cache,Yi(t,ht,n),n!==l.cache&&xl(t,[ht],s,!0))),wt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Mi(e){e.flags|=4}function cc(e,t,s,n,l){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(Bf())e.flags|=8192;else throw zs=ya,kl}else e.flags&=-16777217}function uf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Em(t))if(Bf())e.flags|=8192;else throw zs=ya,kl}function Ba(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Pu():536870912,e.lanes|=t,Cr|=t)}function _n(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var n=null;s!==null;)s.alternate!==null&&(n=s),s=s.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,n=0;if(t)for(var l=e.child;l!==null;)s|=l.lanes|l.childLanes,n|=l.subtreeFlags&65011712,n|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)s|=l.lanes|l.childLanes,n|=l.subtreeFlags,n|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=n,e.childLanes=s,t}function gg(e,t,s){var n=t.pendingProps;switch(vl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return Xe(t),null;case 3:return s=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ai(ht),ce(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ur(t)?Mi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,yl())),Xe(t),null;case 26:var l=t.type,_=t.memoizedState;return e===null?(Mi(t),_!==null?(Xe(t),uf(t,_)):(Xe(t),cc(t,l,null,n,s))):_?_!==e.memoizedState?(Mi(t),Xe(t),uf(t,_)):(Xe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Mi(t),Xe(t),cc(t,l,e,n,s)),null;case 27:if(me(t),s=he.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Mi(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return Xe(t),null}e=Y.current,ur(t)?Ph(t):(e=vm(l,n,s),t.stateNode=e,Mi(t))}return Xe(t),null;case 5:if(me(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Mi(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return Xe(t),null}if(_=Y.current,ur(t))Ph(t);else{var D=Xa(he.current);switch(_){case 1:_=D.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:_=D.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":_=D.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":_=D.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":_=D.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof n.is=="string"?D.createElement("select",{is:n.is}):D.createElement("select"),n.multiple?_.multiple=!0:n.size&&(_.size=n.size);break;default:_=typeof n.is=="string"?D.createElement(l,{is:n.is}):D.createElement(l)}}_[St]=t,_[Ot]=n;e:for(D=t.child;D!==null;){if(D.tag===5||D.tag===6)_.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===t)break e;for(;D.sibling===null;){if(D.return===null||D.return===t)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}t.stateNode=_;e:switch(Et(_,l,n),l){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Mi(t)}}return Xe(t),cc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Mi(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=he.current,ur(t)){if(e=t.stateNode,s=t.memoizedProps,n=null,l=xt,l!==null)switch(l.tag){case 27:case 5:n=l.memoizedProps}e[St]=t,e=!!(e.nodeValue===s||n!==null&&n.suppressHydrationWarning===!0||am(e.nodeValue,s)),e||Gi(t,!0)}else e=Xa(e).createTextNode(n),e[St]=t,t.stateNode=e}return Xe(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(n=ur(t),s!==null){if(e===null){if(!n)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[St]=t}else Ms(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),e=!1}else s=yl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(qt(t),t):(qt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Xe(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=ur(t),n!==null&&n.dehydrated!==null){if(e===null){if(!l)throw Error(o(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(o(317));l[St]=t}else Ms(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),l=!1}else l=yl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(qt(t),t):(qt(t),null)}return qt(t),(t.flags&128)!==0?(t.lanes=s,t):(s=n!==null,e=e!==null&&e.memoizedState!==null,s&&(n=t.child,l=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(l=n.alternate.memoizedState.cachePool.pool),_=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(_=n.memoizedState.cachePool.pool),_!==l&&(n.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),Ba(t,t.updateQueue),Xe(t),null);case 4:return ce(),e===null&&Oc(t.stateNode.containerInfo),Xe(t),null;case 10:return Ai(t.type),Xe(t),null;case 19:if(B(ot),n=t.memoizedState,n===null)return Xe(t),null;if(l=(t.flags&128)!==0,_=n.rendering,_===null)if(l)_n(n,!1);else{if(rt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(_=Ca(e),_!==null){for(t.flags|=128,_n(n,!1),e=_.updateQueue,t.updateQueue=e,Ba(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)zh(s,e),s=s.sibling;return P(ot,ot.current&1|2),Le&&ki(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&vt()>Ia&&(t.flags|=128,l=!0,_n(n,!1),t.lanes=4194304)}else{if(!l)if(e=Ca(_),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,Ba(t,e),_n(n,!0),n.tail===null&&n.tailMode==="hidden"&&!_.alternate&&!Le)return Xe(t),null}else 2*vt()-n.renderingStartTime>Ia&&s!==536870912&&(t.flags|=128,l=!0,_n(n,!1),t.lanes=4194304);n.isBackwards?(_.sibling=t.child,t.child=_):(e=n.last,e!==null?e.sibling=_:t.child=_,n.last=_)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=vt(),e.sibling=null,s=ot.current,P(ot,l?s&1|2:s&1),Le&&ki(t,n.treeForkCount),e):(Xe(t),null);case 22:case 23:return qt(t),Ml(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(s&536870912)!==0&&(t.flags&128)===0&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),s=t.updateQueue,s!==null&&Ba(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==s&&(t.flags|=2048),e!==null&&B(js),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ai(ht),Xe(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function yg(e,t){switch(vl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ai(ht),ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(qt(t),t.alternate===null)throw Error(o(340));Ms()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(qt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ms()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(ot),null;case 4:return ce(),null;case 10:return Ai(t.type),null;case 22:case 23:return qt(t),Ml(),e!==null&&B(js),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ai(ht),null;case 25:return null;default:return null}}function hf(e,t){switch(vl(t),t.tag){case 3:Ai(ht),ce();break;case 26:case 27:case 5:me(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&qt(t);break;case 13:qt(t);break;case 19:B(ot);break;case 10:Ai(t.type);break;case 22:case 23:qt(t),Ml(),e!==null&&B(js);break;case 24:Ai(ht)}}function pn(e,t){try{var s=t.updateQueue,n=s!==null?s.lastEffect:null;if(n!==null){var l=n.next;s=l;do{if((s.tag&e)===e){n=void 0;var _=s.create,D=s.inst;n=_(),D.destroy=n}s=s.next}while(s!==l)}}catch(z){Ie(t,t.return,z)}}function ts(e,t,s){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var _=l.next;n=_;do{if((n.tag&e)===e){var D=n.inst,z=D.destroy;if(z!==void 0){D.destroy=void 0,l=t;var G=s,ie=z;try{ie()}catch(le){Ie(l,G,le)}}}n=n.next}while(n!==_)}}catch(le){Ie(t,t.return,le)}}function df(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{td(t,s)}catch(n){Ie(e,e.return,n)}}}function ff(e,t,s){s.props=$s(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(n){Ie(e,t,n)}}function vn(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof s=="function"?e.refCleanup=s(n):s.current=n}}catch(l){Ie(e,t,l)}}function vi(e,t){var s=e.ref,n=e.refCleanup;if(s!==null)if(typeof n=="function")try{n()}catch(l){Ie(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(l){Ie(e,t,l)}else s.current=null}function mf(e){var t=e.type,s=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break e;case"img":s.src?n.src=s.src:s.srcSet&&(n.srcset=s.srcSet)}}catch(l){Ie(e,e.return,l)}}function uc(e,t,s){try{var n=e.stateNode;Ig(n,e.type,s,t),n[Ot]=t}catch(l){Ie(e,e.return,l)}}function _f(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ls(e.type)||e.tag===4}function hc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_f(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ls(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function dc(e,t,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Ci));else if(n!==4&&(n===27&&ls(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(dc(e,t,s),e=e.sibling;e!==null;)dc(e,t,s),e=e.sibling}function za(e,t,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(n!==4&&(n===27&&ls(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(za(e,t,s),e=e.sibling;e!==null;)za(e,t,s),e=e.sibling}function pf(e){var t=e.stateNode,s=e.memoizedProps;try{for(var n=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);Et(t,n,s),t[St]=e,t[Ot]=s}catch(_){Ie(e,e.return,_)}}var Ni=!1,mt=!1,fc=!1,vf=typeof WeakSet=="function"?WeakSet:Set,bt=null;function bg(e,t){if(e=e.containerInfo,Lc=ro,e=Ah(e),al(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var n=s.getSelection&&s.getSelection();if(n&&n.rangeCount!==0){s=n.anchorNode;var l=n.anchorOffset,_=n.focusNode;n=n.focusOffset;try{s.nodeType,_.nodeType}catch{s=null;break e}var D=0,z=-1,G=-1,ie=0,le=0,fe=e,se=null;t:for(;;){for(var ae;fe!==s||l!==0&&fe.nodeType!==3||(z=D+l),fe!==_||n!==0&&fe.nodeType!==3||(G=D+n),fe.nodeType===3&&(D+=fe.nodeValue.length),(ae=fe.firstChild)!==null;)se=fe,fe=ae;for(;;){if(fe===e)break t;if(se===s&&++ie===l&&(z=D),se===_&&++le===n&&(G=D),(ae=fe.nextSibling)!==null)break;fe=se,se=fe.parentNode}fe=ae}s=z===-1||G===-1?null:{start:z,end:G}}else s=null}s=s||{start:0,end:0}}else s=null;for(jc={focusedElem:e,selectionRange:s},ro=!1,bt=t;bt!==null;)if(t=bt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,bt=e;else for(;bt!==null;){switch(t=bt,_=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)l=e[s],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&_!==null){e=void 0,s=t,l=_.memoizedProps,_=_.memoizedState,n=s.stateNode;try{var ve=$s(s.type,l);e=n.getSnapshotBeforeUpdate(ve,_),n.__reactInternalSnapshotBeforeUpdate=e}catch(xe){Ie(s,s.return,xe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Hc(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Hc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,bt=e;break}bt=t.return}}function gf(e,t,s){var n=s.flags;switch(s.tag){case 0:case 11:case 15:ji(e,s),n&4&&pn(5,s);break;case 1:if(ji(e,s),n&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(D){Ie(s,s.return,D)}else{var l=$s(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(D){Ie(s,s.return,D)}}n&64&&df(s),n&512&&vn(s,s.return);break;case 3:if(ji(e,s),n&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{td(e,t)}catch(D){Ie(s,s.return,D)}}break;case 27:t===null&&n&4&&pf(s);case 26:case 5:ji(e,s),t===null&&n&4&&mf(s),n&512&&vn(s,s.return);break;case 12:ji(e,s);break;case 31:ji(e,s),n&4&&Sf(e,s);break;case 13:ji(e,s),n&4&&xf(e,s),n&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Rg.bind(null,s),Yg(e,s))));break;case 22:if(n=s.memoizedState!==null||Ni,!n){t=t!==null&&t.memoizedState!==null||mt,l=Ni;var _=mt;Ni=n,(mt=t)&&!_?Bi(e,s,(s.subtreeFlags&8772)!==0):ji(e,s),Ni=l,mt=_}break;case 30:break;default:ji(e,s)}}function yf(e){var t=e.alternate;t!==null&&(e.alternate=null,yf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Zo(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Je=null,Nt=!1;function Li(e,t,s){for(s=s.child;s!==null;)bf(e,t,s),s=s.sibling}function bf(e,t,s){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(ws,s)}catch{}switch(s.tag){case 26:mt||vi(s,t),Li(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:mt||vi(s,t);var n=Je,l=Nt;ls(s.type)&&(Je=s.stateNode,Nt=!1),Li(e,t,s),kn(s.stateNode),Je=n,Nt=l;break;case 5:mt||vi(s,t);case 6:if(n=Je,l=Nt,Je=null,Li(e,t,s),Je=n,Nt=l,Je!==null)if(Nt)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(s.stateNode)}catch(_){Ie(s,t,_)}else try{Je.removeChild(s.stateNode)}catch(_){Ie(s,t,_)}break;case 18:Je!==null&&(Nt?(e=Je,dm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Or(e)):dm(Je,s.stateNode));break;case 4:n=Je,l=Nt,Je=s.stateNode.containerInfo,Nt=!0,Li(e,t,s),Je=n,Nt=l;break;case 0:case 11:case 14:case 15:ts(2,s,t),mt||ts(4,s,t),Li(e,t,s);break;case 1:mt||(vi(s,t),n=s.stateNode,typeof n.componentWillUnmount=="function"&&ff(s,t,n)),Li(e,t,s);break;case 21:Li(e,t,s);break;case 22:mt=(n=mt)||s.memoizedState!==null,Li(e,t,s),mt=n;break;default:Li(e,t,s)}}function Sf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Or(e)}catch(s){Ie(t,t.return,s)}}}function xf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Or(e)}catch(s){Ie(t,t.return,s)}}function Sg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vf),t;default:throw Error(o(435,e.tag))}}function Ha(e,t){var s=Sg(e);t.forEach(function(n){if(!s.has(n)){s.add(n);var l=Dg.bind(null,e,n);n.then(l,l)}})}function Lt(e,t){var s=t.deletions;if(s!==null)for(var n=0;n<s.length;n++){var l=s[n],_=e,D=t,z=D;e:for(;z!==null;){switch(z.tag){case 27:if(ls(z.type)){Je=z.stateNode,Nt=!1;break e}break;case 5:Je=z.stateNode,Nt=!1;break e;case 3:case 4:Je=z.stateNode.containerInfo,Nt=!0;break e}z=z.return}if(Je===null)throw Error(o(160));bf(_,D,l),Je=null,Nt=!1,_=l.alternate,_!==null&&(_.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cf(t,e),t=t.sibling}var ui=null;function Cf(e,t){var s=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Lt(t,e),jt(e),n&4&&(ts(3,e,e.return),pn(3,e),ts(5,e,e.return));break;case 1:Lt(t,e),jt(e),n&512&&(mt||s===null||vi(s,s.return)),n&64&&Ni&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?n:s.concat(n))));break;case 26:var l=ui;if(Lt(t,e),jt(e),n&512&&(mt||s===null||vi(s,s.return)),n&4){var _=s!==null?s.memoizedState:null;if(n=e.memoizedState,s===null)if(n===null)if(e.stateNode===null){e:{n=e.type,s=e.memoizedProps,l=l.ownerDocument||l;t:switch(n){case"title":_=l.getElementsByTagName("title")[0],(!_||_[Zr]||_[St]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=l.createElement(n),l.head.insertBefore(_,l.querySelector("head > title"))),Et(_,n,s),_[St]=e,yt(_),n=_;break e;case"link":var D=Cm("link","href",l).get(n+(s.href||""));if(D){for(var z=0;z<D.length;z++)if(_=D[z],_.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&_.getAttribute("rel")===(s.rel==null?null:s.rel)&&_.getAttribute("title")===(s.title==null?null:s.title)&&_.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){D.splice(z,1);break t}}_=l.createElement(n),Et(_,n,s),l.head.appendChild(_);break;case"meta":if(D=Cm("meta","content",l).get(n+(s.content||""))){for(z=0;z<D.length;z++)if(_=D[z],_.getAttribute("content")===(s.content==null?null:""+s.content)&&_.getAttribute("name")===(s.name==null?null:s.name)&&_.getAttribute("property")===(s.property==null?null:s.property)&&_.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&_.getAttribute("charset")===(s.charSet==null?null:s.charSet)){D.splice(z,1);break t}}_=l.createElement(n),Et(_,n,s),l.head.appendChild(_);break;default:throw Error(o(468,n))}_[St]=e,yt(_),n=_}e.stateNode=n}else wm(l,e.type,e.stateNode);else e.stateNode=xm(l,n,e.memoizedProps);else _!==n?(_===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):_.count--,n===null?wm(l,e.type,e.stateNode):xm(l,n,e.memoizedProps)):n===null&&e.stateNode!==null&&uc(e,e.memoizedProps,s.memoizedProps)}break;case 27:Lt(t,e),jt(e),n&512&&(mt||s===null||vi(s,s.return)),s!==null&&n&4&&uc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Lt(t,e),jt(e),n&512&&(mt||s===null||vi(s,s.return)),e.flags&32){l=e.stateNode;try{er(l,"")}catch(ve){Ie(e,e.return,ve)}}n&4&&e.stateNode!=null&&(l=e.memoizedProps,uc(e,l,s!==null?s.memoizedProps:l)),n&1024&&(fc=!0);break;case 6:if(Lt(t,e),jt(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,s=e.stateNode;try{s.nodeValue=n}catch(ve){Ie(e,e.return,ve)}}break;case 3:if(eo=null,l=ui,ui=Ja(t.containerInfo),Lt(t,e),ui=l,jt(e),n&4&&s!==null&&s.memoizedState.isDehydrated)try{Or(t.containerInfo)}catch(ve){Ie(e,e.return,ve)}fc&&(fc=!1,wf(e));break;case 4:n=ui,ui=Ja(e.stateNode.containerInfo),Lt(t,e),jt(e),ui=n;break;case 12:Lt(t,e),jt(e);break;case 31:Lt(t,e),jt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ha(e,n)));break;case 13:Lt(t,e),jt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&($a=vt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ha(e,n)));break;case 22:l=e.memoizedState!==null;var G=s!==null&&s.memoizedState!==null,ie=Ni,le=mt;if(Ni=ie||l,mt=le||G,Lt(t,e),mt=le,Ni=ie,jt(e),n&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(s===null||G||Ni||mt||Is(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){G=s=t;try{if(_=G.stateNode,l)D=_.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{z=G.stateNode;var fe=G.memoizedProps.style,se=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;z.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(ve){Ie(G,G.return,ve)}}}else if(t.tag===6){if(s===null){G=t;try{G.stateNode.nodeValue=l?"":G.memoizedProps}catch(ve){Ie(G,G.return,ve)}}}else if(t.tag===18){if(s===null){G=t;try{var ae=G.stateNode;l?fm(ae,!0):fm(G.stateNode,!1)}catch(ve){Ie(G,G.return,ve)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(s=n.retryQueue,s!==null&&(n.retryQueue=null,Ha(e,s))));break;case 19:Lt(t,e),jt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ha(e,n)));break;case 30:break;case 21:break;default:Lt(t,e),jt(e)}}function jt(e){var t=e.flags;if(t&2){try{for(var s,n=e.return;n!==null;){if(_f(n)){s=n;break}n=n.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var l=s.stateNode,_=hc(e);za(e,_,l);break;case 5:var D=s.stateNode;s.flags&32&&(er(D,""),s.flags&=-33);var z=hc(e);za(e,z,D);break;case 3:case 4:var G=s.stateNode.containerInfo,ie=hc(e);dc(e,ie,G);break;default:throw Error(o(161))}}catch(le){Ie(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ji(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gf(e,t.alternate,t),t=t.sibling}function Is(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ts(4,t,t.return),Is(t);break;case 1:vi(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&ff(t,t.return,s),Is(t);break;case 27:kn(t.stateNode);case 26:case 5:vi(t,t.return),Is(t);break;case 22:t.memoizedState===null&&Is(t);break;case 30:Is(t);break;default:Is(t)}e=e.sibling}}function Bi(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,l=e,_=t,D=_.flags;switch(_.tag){case 0:case 11:case 15:Bi(l,_,s),pn(4,_);break;case 1:if(Bi(l,_,s),n=_,l=n.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(ie){Ie(n,n.return,ie)}if(n=_,l=n.updateQueue,l!==null){var z=n.stateNode;try{var G=l.shared.hiddenCallbacks;if(G!==null)for(l.shared.hiddenCallbacks=null,l=0;l<G.length;l++)ed(G[l],z)}catch(ie){Ie(n,n.return,ie)}}s&&D&64&&df(_),vn(_,_.return);break;case 27:pf(_);case 26:case 5:Bi(l,_,s),s&&n===null&&D&4&&mf(_),vn(_,_.return);break;case 12:Bi(l,_,s);break;case 31:Bi(l,_,s),s&&D&4&&Sf(l,_);break;case 13:Bi(l,_,s),s&&D&4&&xf(l,_);break;case 22:_.memoizedState===null&&Bi(l,_,s),vn(_,_.return);break;case 30:break;default:Bi(l,_,s)}t=t.sibling}}function mc(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&sn(s))}function _c(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sn(e))}function hi(e,t,s,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ef(e,t,s,n),t=t.sibling}function Ef(e,t,s,n){var l=t.flags;switch(t.tag){case 0:case 11:case 15:hi(e,t,s,n),l&2048&&pn(9,t);break;case 1:hi(e,t,s,n);break;case 3:hi(e,t,s,n),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sn(e)));break;case 12:if(l&2048){hi(e,t,s,n),e=t.stateNode;try{var _=t.memoizedProps,D=_.id,z=_.onPostCommit;typeof z=="function"&&z(D,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(G){Ie(t,t.return,G)}}else hi(e,t,s,n);break;case 31:hi(e,t,s,n);break;case 13:hi(e,t,s,n);break;case 23:break;case 22:_=t.stateNode,D=t.alternate,t.memoizedState!==null?_._visibility&2?hi(e,t,s,n):gn(e,t):_._visibility&2?hi(e,t,s,n):(_._visibility|=2,br(e,t,s,n,(t.subtreeFlags&10256)!==0||!1)),l&2048&&mc(D,t);break;case 24:hi(e,t,s,n),l&2048&&_c(t.alternate,t);break;default:hi(e,t,s,n)}}function br(e,t,s,n,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var _=e,D=t,z=s,G=n,ie=D.flags;switch(D.tag){case 0:case 11:case 15:br(_,D,z,G,l),pn(8,D);break;case 23:break;case 22:var le=D.stateNode;D.memoizedState!==null?le._visibility&2?br(_,D,z,G,l):gn(_,D):(le._visibility|=2,br(_,D,z,G,l)),l&&ie&2048&&mc(D.alternate,D);break;case 24:br(_,D,z,G,l),l&&ie&2048&&_c(D.alternate,D);break;default:br(_,D,z,G,l)}t=t.sibling}}function gn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,n=t,l=n.flags;switch(n.tag){case 22:gn(s,n),l&2048&&mc(n.alternate,n);break;case 24:gn(s,n),l&2048&&_c(n.alternate,n);break;default:gn(s,n)}t=t.sibling}}var yn=8192;function Sr(e,t,s){if(e.subtreeFlags&yn)for(e=e.child;e!==null;)kf(e,t,s),e=e.sibling}function kf(e,t,s){switch(e.tag){case 26:Sr(e,t,s),e.flags&yn&&e.memoizedState!==null&&o0(s,ui,e.memoizedState,e.memoizedProps);break;case 5:Sr(e,t,s);break;case 3:case 4:var n=ui;ui=Ja(e.stateNode.containerInfo),Sr(e,t,s),ui=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=yn,yn=16777216,Sr(e,t,s),yn=n):Sr(e,t,s));break;default:Sr(e,t,s)}}function Tf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function bn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var n=t[s];bt=n,Rf(n,e)}Tf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Af(e),e=e.sibling}function Af(e){switch(e.tag){case 0:case 11:case 15:bn(e),e.flags&2048&&ts(9,e,e.return);break;case 3:bn(e);break;case 12:bn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ua(e)):bn(e);break;default:bn(e)}}function Ua(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var n=t[s];bt=n,Rf(n,e)}Tf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ts(8,t,t.return),Ua(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Ua(t));break;default:Ua(t)}e=e.sibling}}function Rf(e,t){for(;bt!==null;){var s=bt;switch(s.tag){case 0:case 11:case 15:ts(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var n=s.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:sn(s.memoizedState.cache)}if(n=s.child,n!==null)n.return=s,bt=n;else e:for(s=e;bt!==null;){n=bt;var l=n.sibling,_=n.return;if(yf(n),n===s){bt=null;break e}if(l!==null){l.return=_,bt=l;break e}bt=_}}}var xg={getCacheForType:function(e){var t=Ct(ht),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ct(ht).controller.signal}},Cg=typeof WeakMap=="function"?WeakMap:Map,He=0,Ve=null,Re=null,Me=0,$e=0,Kt=null,is=!1,xr=!1,pc=!1,zi=0,rt=0,ss=0,Ps=0,vc=0,Vt=0,Cr=0,Sn=null,Bt=null,gc=!1,$a=0,Df=0,Ia=1/0,Pa=null,rs=null,gt=0,ns=null,wr=null,Hi=0,yc=0,bc=null,Of=null,xn=0,Sc=null;function Gt(){return(He&2)!==0&&Me!==0?Me&-Me:q.T!==null?Tc():Ku()}function Mf(){if(Vt===0)if((Me&536870912)===0||Le){var e=Wn;Wn<<=1,(Wn&3932160)===0&&(Wn=262144),Vt=e}else Vt=536870912;return e=Ft.current,e!==null&&(e.flags|=32),Vt}function zt(e,t,s){(e===Ve&&($e===2||$e===9)||e.cancelPendingCommit!==null)&&(Er(e,0),as(e,Me,Vt,!1)),Pr(e,s),((He&2)===0||e!==Ve)&&(e===Ve&&((He&2)===0&&(Ps|=s),rt===4&&as(e,Me,Vt,!1)),gi(e))}function Nf(e,t,s){if((He&6)!==0)throw Error(o(327));var n=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Ir(e,t),l=n?kg(e,t):Cc(e,t,!0),_=n;do{if(l===0){xr&&!n&&as(e,t,0,!1);break}else{if(s=e.current.alternate,_&&!wg(s)){l=Cc(e,t,!1),_=!1;continue}if(l===2){if(_=t,e.errorRecoveryDisabledLanes&_)var D=0;else D=e.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){t=D;e:{var z=e;l=Sn;var G=z.current.memoizedState.isDehydrated;if(G&&(Er(z,D).flags|=256),D=Cc(z,D,!1),D!==2){if(pc&&!G){z.errorRecoveryDisabledLanes|=_,Ps|=_,l=4;break e}_=Bt,Bt=l,_!==null&&(Bt===null?Bt=_:Bt.push.apply(Bt,_))}l=D}if(_=!1,l!==2)continue}}if(l===1){Er(e,0),as(e,t,0,!0);break}e:{switch(n=e,_=l,_){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:as(n,t,Vt,!is);break e;case 2:Bt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(l=$a+300-vt(),10<l)){if(as(n,t,Vt,!is),Jn(n,0,!0)!==0)break e;Hi=t,n.timeoutHandle=um(Lf.bind(null,n,s,Bt,Pa,gc,t,Vt,Ps,Cr,is,_,"Throttled",-0,0),l);break e}Lf(n,s,Bt,Pa,gc,t,Vt,Ps,Cr,is,_,null,-0,0)}}break}while(!0);gi(e)}function Lf(e,t,s,n,l,_,D,z,G,ie,le,fe,se,ae){if(e.timeoutHandle=-1,fe=t.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ci},kf(t,_,fe);var ve=(_&62914560)===_?$a-vt():(_&4194048)===_?Df-vt():0;if(ve=l0(fe,ve),ve!==null){Hi=_,e.cancelPendingCommit=ve(Pf.bind(null,e,t,_,s,n,l,D,z,G,le,fe,null,se,ae)),as(e,_,D,!ie);return}}Pf(e,t,_,s,n,l,D,z,G)}function wg(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var n=0;n<s.length;n++){var l=s[n],_=l.getSnapshot;l=l.value;try{if(!Pt(_(),l))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function as(e,t,s,n){t&=~vc,t&=~Ps,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var l=t;0<l;){var _=31-It(l),D=1<<_;n[_]=-1,l&=~D}s!==0&&Zu(e,s,t)}function Za(){return(He&6)===0?(Cn(0),!1):!0}function xc(){if(Re!==null){if($e===0)var e=Re.return;else e=Re,Ti=Ns=null,Hl(e),_r=null,nn=0,e=Re;for(;e!==null;)hf(e.alternate,e),e=e.return;Re=null}}function Er(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,Fg(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Hi=0,xc(),Ve=e,Re=s=Ei(e.current,null),Me=t,$e=0,Kt=null,is=!1,xr=Ir(e,t),pc=!1,Cr=Vt=vc=Ps=ss=rt=0,Bt=Sn=null,gc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var l=31-It(n),_=1<<l;t|=e[l],n&=~_}return zi=t,ua(),s}function jf(e,t){Ee=null,q.H=fn,t===mr||t===ga?(t=Wh(),$e=3):t===kl?(t=Wh(),$e=4):$e=t===ec?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Kt=t,Re===null&&(rt=1,Ma(e,Qt(t,e.current)))}function Bf(){var e=Ft.current;return e===null?!0:(Me&4194048)===Me?si===null:(Me&62914560)===Me||(Me&536870912)!==0?e===si:!1}function zf(){var e=q.H;return q.H=fn,e===null?fn:e}function Hf(){var e=q.A;return q.A=xg,e}function Fa(){rt=4,is||(Me&4194048)!==Me&&Ft.current!==null||(xr=!0),(ss&134217727)===0&&(Ps&134217727)===0||Ve===null||as(Ve,Me,Vt,!1)}function Cc(e,t,s){var n=He;He|=2;var l=zf(),_=Hf();(Ve!==e||Me!==t)&&(Pa=null,Er(e,t)),t=!1;var D=rt;e:do try{if($e!==0&&Re!==null){var z=Re,G=Kt;switch($e){case 8:xc(),D=6;break e;case 3:case 2:case 9:case 6:Ft.current===null&&(t=!0);var ie=$e;if($e=0,Kt=null,kr(e,z,G,ie),s&&xr){D=0;break e}break;default:ie=$e,$e=0,Kt=null,kr(e,z,G,ie)}}Eg(),D=rt;break}catch(le){jf(e,le)}while(!0);return t&&e.shellSuspendCounter++,Ti=Ns=null,He=n,q.H=l,q.A=_,Re===null&&(Ve=null,Me=0,ua()),D}function Eg(){for(;Re!==null;)Uf(Re)}function kg(e,t){var s=He;He|=2;var n=zf(),l=Hf();Ve!==e||Me!==t?(Pa=null,Ia=vt()+500,Er(e,t)):xr=Ir(e,t);e:do try{if($e!==0&&Re!==null){t=Re;var _=Kt;t:switch($e){case 1:$e=0,Kt=null,kr(e,t,_,1);break;case 2:case 9:if(Gh(_)){$e=0,Kt=null,$f(t);break}t=function(){$e!==2&&$e!==9||Ve!==e||($e=7),gi(e)},_.then(t,t);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:Gh(_)?($e=0,Kt=null,$f(t)):($e=0,Kt=null,kr(e,t,_,7));break;case 5:var D=null;switch(Re.tag){case 26:D=Re.memoizedState;case 5:case 27:var z=Re;if(D?Em(D):z.stateNode.complete){$e=0,Kt=null;var G=z.sibling;if(G!==null)Re=G;else{var ie=z.return;ie!==null?(Re=ie,qa(ie)):Re=null}break t}}$e=0,Kt=null,kr(e,t,_,5);break;case 6:$e=0,Kt=null,kr(e,t,_,6);break;case 8:xc(),rt=6;break e;default:throw Error(o(462))}}Tg();break}catch(le){jf(e,le)}while(!0);return Ti=Ns=null,q.H=n,q.A=l,He=s,Re!==null?0:(Ve=null,Me=0,ua(),rt)}function Tg(){for(;Re!==null&&!qs();)Uf(Re)}function Uf(e){var t=cf(e.alternate,e,zi);e.memoizedProps=e.pendingProps,t===null?qa(e):Re=t}function $f(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=sf(s,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=sf(s,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:Hl(t);default:hf(s,t),t=Re=zh(t,zi),t=cf(s,t,zi)}e.memoizedProps=e.pendingProps,t===null?qa(e):Re=t}function kr(e,t,s,n){Ti=Ns=null,Hl(t),_r=null,nn=0;var l=t.return;try{if(_g(e,l,t,s,Me)){rt=1,Ma(e,Qt(s,e.current)),Re=null;return}}catch(_){if(l!==null)throw Re=l,_;rt=1,Ma(e,Qt(s,e.current)),Re=null;return}t.flags&32768?(Le||n===1?e=!0:xr||(Me&536870912)!==0?e=!1:(is=e=!0,(n===2||n===9||n===3||n===6)&&(n=Ft.current,n!==null&&n.tag===13&&(n.flags|=16384))),If(t,e)):qa(t)}function qa(e){var t=e;do{if((t.flags&32768)!==0){If(t,is);return}e=t.return;var s=gg(t.alternate,t,zi);if(s!==null){Re=s;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);rt===0&&(rt=5)}function If(e,t){do{var s=yg(e.alternate,e);if(s!==null){s.flags&=32767,Re=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Re=e;return}Re=e=s}while(e!==null);rt=6,Re=null}function Pf(e,t,s,n,l,_,D,z,G){e.cancelPendingCommit=null;do Ka();while(gt!==0);if((He&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(_=t.lanes|t.childLanes,_|=hl,av(e,s,_,D,z,G),e===Ve&&(Re=Ve=null,Me=0),wr=t,ns=e,Hi=s,yc=_,bc=l,Of=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Og(Ut,function(){return Vf(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=q.T,q.T=null,l=Q.p,Q.p=2,D=He,He|=4;try{bg(e,t,s)}finally{He=D,Q.p=l,q.T=n}}gt=1,Zf(),Ff(),qf()}}function Zf(){if(gt===1){gt=0;var e=ns,t=wr,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var n=Q.p;Q.p=2;var l=He;He|=4;try{Cf(t,e);var _=jc,D=Ah(e.containerInfo),z=_.focusedElem,G=_.selectionRange;if(D!==z&&z&&z.ownerDocument&&Th(z.ownerDocument.documentElement,z)){if(G!==null&&al(z)){var ie=G.start,le=G.end;if(le===void 0&&(le=ie),"selectionStart"in z)z.selectionStart=ie,z.selectionEnd=Math.min(le,z.value.length);else{var fe=z.ownerDocument||document,se=fe&&fe.defaultView||window;if(se.getSelection){var ae=se.getSelection(),ve=z.textContent.length,xe=Math.min(G.start,ve),Ke=G.end===void 0?xe:Math.min(G.end,ve);!ae.extend&&xe>Ke&&(D=Ke,Ke=xe,xe=D);var X=kh(z,xe),W=kh(z,Ke);if(X&&W&&(ae.rangeCount!==1||ae.anchorNode!==X.node||ae.anchorOffset!==X.offset||ae.focusNode!==W.node||ae.focusOffset!==W.offset)){var te=fe.createRange();te.setStart(X.node,X.offset),ae.removeAllRanges(),xe>Ke?(ae.addRange(te),ae.extend(W.node,W.offset)):(te.setEnd(W.node,W.offset),ae.addRange(te))}}}}for(fe=[],ae=z;ae=ae.parentNode;)ae.nodeType===1&&fe.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<fe.length;z++){var ue=fe[z];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}ro=!!Lc,jc=Lc=null}finally{He=l,Q.p=n,q.T=s}}e.current=t,gt=2}}function Ff(){if(gt===2){gt=0;var e=ns,t=wr,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=q.T,q.T=null;var n=Q.p;Q.p=2;var l=He;He|=4;try{gf(e,t.alternate,t)}finally{He=l,Q.p=n,q.T=s}}gt=3}}function qf(){if(gt===4||gt===3){gt=0,Dt();var e=ns,t=wr,s=Hi,n=Of;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?gt=5:(gt=0,wr=ns=null,Kf(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(rs=null),Io(s),t=t.stateNode,$t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(ws,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=q.T,l=Q.p,Q.p=2,q.T=null;try{for(var _=e.onRecoverableError,D=0;D<n.length;D++){var z=n[D];_(z.value,{componentStack:z.stack})}}finally{q.T=t,Q.p=l}}(Hi&3)!==0&&Ka(),gi(e),l=e.pendingLanes,(s&261930)!==0&&(l&42)!==0?e===Sc?xn++:(xn=0,Sc=e):xn=0,Cn(0)}}function Kf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sn(t)))}function Ka(){return Zf(),Ff(),qf(),Vf()}function Vf(){if(gt!==5)return!1;var e=ns,t=yc;yc=0;var s=Io(Hi),n=q.T,l=Q.p;try{Q.p=32>s?32:s,q.T=null,s=bc,bc=null;var _=ns,D=Hi;if(gt=0,wr=ns=null,Hi=0,(He&6)!==0)throw Error(o(331));var z=He;if(He|=4,Af(_.current),Ef(_,_.current,D,s),He=z,Cn(0,!1),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(ws,_)}catch{}return!0}finally{Q.p=l,q.T=n,Kf(e,t)}}function Gf(e,t,s){t=Qt(s,t),t=Ql(e.stateNode,t,2),e=Ji(e,t,2),e!==null&&(Pr(e,2),gi(e))}function Ie(e,t,s){if(e.tag===3)Gf(e,e,s);else for(;t!==null;){if(t.tag===3){Gf(t,e,s);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(rs===null||!rs.has(n))){e=Qt(s,e),s=Gd(2),n=Ji(t,s,2),n!==null&&(Yd(s,n,t,e),Pr(n,2),gi(n));break}}t=t.return}}function wc(e,t,s){var n=e.pingCache;if(n===null){n=e.pingCache=new Cg;var l=new Set;n.set(t,l)}else l=n.get(t),l===void 0&&(l=new Set,n.set(t,l));l.has(s)||(pc=!0,l.add(s),e=Ag.bind(null,e,t,s),t.then(e,e))}function Ag(e,t,s){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Ve===e&&(Me&s)===s&&(rt===4||rt===3&&(Me&62914560)===Me&&300>vt()-$a?(He&2)===0&&Er(e,0):vc|=s,Cr===Me&&(Cr=0)),gi(e)}function Yf(e,t){t===0&&(t=Pu()),e=Ds(e,t),e!==null&&(Pr(e,t),gi(e))}function Rg(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Yf(e,s)}function Dg(e,t){var s=0;switch(e.tag){case 31:case 13:var n=e.stateNode,l=e.memoizedState;l!==null&&(s=l.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}n!==null&&n.delete(t),Yf(e,s)}function Og(e,t){return mi(e,t)}var Va=null,Tr=null,Ec=!1,Ga=!1,kc=!1,os=0;function gi(e){e!==Tr&&e.next===null&&(Tr===null?Va=Tr=e:Tr=Tr.next=e),Ga=!0,Ec||(Ec=!0,Ng())}function Cn(e,t){if(!kc&&Ga){kc=!0;do for(var s=!1,n=Va;n!==null;){if(e!==0){var l=n.pendingLanes;if(l===0)var _=0;else{var D=n.suspendedLanes,z=n.pingedLanes;_=(1<<31-It(42|e)+1)-1,_&=l&~(D&~z),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(s=!0,Qf(n,_))}else _=Me,_=Jn(n,n===Ve?_:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(_&3)===0||Ir(n,_)||(s=!0,Qf(n,_));n=n.next}while(s);kc=!1}}function Mg(){Wf()}function Wf(){Ga=Ec=!1;var e=0;os!==0&&Zg()&&(e=os);for(var t=vt(),s=null,n=Va;n!==null;){var l=n.next,_=Xf(n,t);_===0?(n.next=null,s===null?Va=l:s.next=l,l===null&&(Tr=s)):(s=n,(e!==0||(_&3)!==0)&&(Ga=!0)),n=l}gt!==0&&gt!==5||Cn(e),os!==0&&(os=0)}function Xf(e,t){for(var s=e.suspendedLanes,n=e.pingedLanes,l=e.expirationTimes,_=e.pendingLanes&-62914561;0<_;){var D=31-It(_),z=1<<D,G=l[D];G===-1?((z&s)===0||(z&n)!==0)&&(l[D]=nv(z,t)):G<=t&&(e.expiredLanes|=z),_&=~z}if(t=Ve,s=Me,s=Jn(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,s===0||e===t&&($e===2||$e===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&xs(n),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Ir(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(n!==null&&xs(n),Io(s)){case 2:case 8:s=Ks;break;case 32:s=Ut;break;case 268435456:s=li;break;default:s=Ut}return n=Jf.bind(null,e),s=mi(s,n),e.callbackPriority=t,e.callbackNode=s,t}return n!==null&&n!==null&&xs(n),e.callbackPriority=2,e.callbackNode=null,2}function Jf(e,t){if(gt!==0&&gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Ka()&&e.callbackNode!==s)return null;var n=Me;return n=Jn(e,e===Ve?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Nf(e,n,t),Xf(e,vt()),e.callbackNode!=null&&e.callbackNode===s?Jf.bind(null,e):null)}function Qf(e,t){if(Ka())return null;Nf(e,t,!0)}function Ng(){qg(function(){(He&6)!==0?mi(Pi,Mg):Wf()})}function Tc(){if(os===0){var e=dr;e===0&&(e=Yn,Yn<<=1,(Yn&261888)===0&&(Yn=256)),os=e}return os}function em(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ia(""+e)}function tm(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function Lg(e,t,s,n,l){if(t==="submit"&&s&&s.stateNode===l){var _=em((l[Ot]||null).action),D=n.submitter;D&&(t=(t=D[Ot]||null)?em(t.formAction):D.getAttribute("formAction"),t!==null&&(_=t,D=null));var z=new aa("action","action",null,n,l);e.push({event:z,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(os!==0){var G=D?tm(l,D):new FormData(l);Vl(s,{pending:!0,data:G,method:l.method,action:_},null,G)}}else typeof _=="function"&&(z.preventDefault(),G=D?tm(l,D):new FormData(l),Vl(s,{pending:!0,data:G,method:l.method,action:_},_,G))},currentTarget:l}]})}}for(var Ac=0;Ac<ul.length;Ac++){var Rc=ul[Ac],jg=Rc.toLowerCase(),Bg=Rc[0].toUpperCase()+Rc.slice(1);ci(jg,"on"+Bg)}ci(Oh,"onAnimationEnd"),ci(Mh,"onAnimationIteration"),ci(Nh,"onAnimationStart"),ci("dblclick","onDoubleClick"),ci("focusin","onFocus"),ci("focusout","onBlur"),ci(Jv,"onTransitionRun"),ci(Qv,"onTransitionStart"),ci(eg,"onTransitionCancel"),ci(Lh,"onTransitionEnd"),Js("onMouseEnter",["mouseout","mouseover"]),Js("onMouseLeave",["mouseout","mouseover"]),Js("onPointerEnter",["pointerout","pointerover"]),Js("onPointerLeave",["pointerout","pointerover"]),ks("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ks("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ks("onBeforeInput",["compositionend","keypress","textInput","paste"]),ks("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wn="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(" "),zg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wn));function im(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var n=e[s],l=n.event;n=n.listeners;e:{var _=void 0;if(t)for(var D=n.length-1;0<=D;D--){var z=n[D],G=z.instance,ie=z.currentTarget;if(z=z.listener,G!==_&&l.isPropagationStopped())break e;_=z,l.currentTarget=ie;try{_(l)}catch(le){ca(le)}l.currentTarget=null,_=G}else for(D=0;D<n.length;D++){if(z=n[D],G=z.instance,ie=z.currentTarget,z=z.listener,G!==_&&l.isPropagationStopped())break e;_=z,l.currentTarget=ie;try{_(l)}catch(le){ca(le)}l.currentTarget=null,_=G}}}}function De(e,t){var s=t[Po];s===void 0&&(s=t[Po]=new Set);var n=e+"__bubble";s.has(n)||(sm(t,e,2,!1),s.add(n))}function Dc(e,t,s){var n=0;t&&(n|=4),sm(s,e,n,t)}var Ya="_reactListening"+Math.random().toString(36).slice(2);function Oc(e){if(!e[Ya]){e[Ya]=!0,Yu.forEach(function(s){s!=="selectionchange"&&(zg.has(s)||Dc(s,!1,e),Dc(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ya]||(t[Ya]=!0,Dc("selectionchange",!1,t))}}function sm(e,t,s,n){switch(Mm(t)){case 2:var l=h0;break;case 8:l=d0;break;default:l=Kc}s=l.bind(null,t,s,e),l=void 0,!Xo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),n?l!==void 0?e.addEventListener(t,s,{capture:!0,passive:l}):e.addEventListener(t,s,!0):l!==void 0?e.addEventListener(t,s,{passive:l}):e.addEventListener(t,s,!1)}function Mc(e,t,s,n,l){var _=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var D=n.tag;if(D===3||D===4){var z=n.stateNode.containerInfo;if(z===l)break;if(D===4)for(D=n.return;D!==null;){var G=D.tag;if((G===3||G===4)&&D.stateNode.containerInfo===l)return;D=D.return}for(;z!==null;){if(D=Ys(z),D===null)return;if(G=D.tag,G===5||G===6||G===26||G===27){n=_=D;continue e}z=z.parentNode}}n=n.return}oh(function(){var ie=_,le=Yo(s),fe=[];e:{var se=jh.get(e);if(se!==void 0){var ae=aa,ve=e;switch(e){case"keypress":if(ra(s)===0)break e;case"keydown":case"keyup":ae=Dv;break;case"focusin":ve="focus",ae=tl;break;case"focusout":ve="blur",ae=tl;break;case"beforeblur":case"afterblur":ae=tl;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=uh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=gv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Nv;break;case Oh:case Mh:case Nh:ae=Sv;break;case Lh:ae=jv;break;case"scroll":case"scrollend":ae=pv;break;case"wheel":ae=zv;break;case"copy":case"cut":case"paste":ae=Cv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=dh;break;case"toggle":case"beforetoggle":ae=Uv}var xe=(t&4)!==0,Ke=!xe&&(e==="scroll"||e==="scrollend"),X=xe?se!==null?se+"Capture":null:se;xe=[];for(var W=ie,te;W!==null;){var ue=W;if(te=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||te===null||X===null||(ue=qr(W,X),ue!=null&&xe.push(En(W,ue,te))),Ke)break;W=W.return}0<xe.length&&(se=new ae(se,ve,null,s,le),fe.push({event:se,listeners:xe}))}}if((t&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",ae=e==="mouseout"||e==="pointerout",se&&s!==Go&&(ve=s.relatedTarget||s.fromElement)&&(Ys(ve)||ve[Gs]))break e;if((ae||se)&&(se=le.window===le?le:(se=le.ownerDocument)?se.defaultView||se.parentWindow:window,ae?(ve=s.relatedTarget||s.toElement,ae=ie,ve=ve?Ys(ve):null,ve!==null&&(Ke=k(ve),xe=ve.tag,ve!==Ke||xe!==5&&xe!==27&&xe!==6)&&(ve=null)):(ae=null,ve=ie),ae!==ve)){if(xe=uh,ue="onMouseLeave",X="onMouseEnter",W="mouse",(e==="pointerout"||e==="pointerover")&&(xe=dh,ue="onPointerLeave",X="onPointerEnter",W="pointer"),Ke=ae==null?se:Fr(ae),te=ve==null?se:Fr(ve),se=new xe(ue,W+"leave",ae,s,le),se.target=Ke,se.relatedTarget=te,ue=null,Ys(le)===ie&&(xe=new xe(X,W+"enter",ve,s,le),xe.target=te,xe.relatedTarget=Ke,ue=xe),Ke=ue,ae&&ve)t:{for(xe=Hg,X=ae,W=ve,te=0,ue=X;ue;ue=xe(ue))te++;ue=0;for(var ye=W;ye;ye=xe(ye))ue++;for(;0<te-ue;)X=xe(X),te--;for(;0<ue-te;)W=xe(W),ue--;for(;te--;){if(X===W||W!==null&&X===W.alternate){xe=X;break t}X=xe(X),W=xe(W)}xe=null}else xe=null;ae!==null&&rm(fe,se,ae,xe,!1),ve!==null&&Ke!==null&&rm(fe,Ke,ve,xe,!0)}}e:{if(se=ie?Fr(ie):window,ae=se.nodeName&&se.nodeName.toLowerCase(),ae==="select"||ae==="input"&&se.type==="file")var Be=bh;else if(gh(se))if(Sh)Be=Yv;else{Be=Vv;var ge=Kv}else ae=se.nodeName,!ae||ae.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ie&&Vo(ie.elementType)&&(Be=bh):Be=Gv;if(Be&&(Be=Be(e,ie))){yh(fe,Be,s,le);break e}ge&&ge(e,se,ie),e==="focusout"&&ie&&se.type==="number"&&ie.memoizedProps.value!=null&&Ko(se,"number",se.value)}switch(ge=ie?Fr(ie):window,e){case"focusin":(gh(ge)||ge.contentEditable==="true")&&(rr=ge,ol=ie,Qr=null);break;case"focusout":Qr=ol=rr=null;break;case"mousedown":ll=!0;break;case"contextmenu":case"mouseup":case"dragend":ll=!1,Rh(fe,s,le);break;case"selectionchange":if(Xv)break;case"keydown":case"keyup":Rh(fe,s,le)}var ke;if(sl)e:{switch(e){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else sr?ph(e,s)&&(Ne="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ne="onCompositionStart");Ne&&(fh&&s.locale!=="ko"&&(sr||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&sr&&(ke=lh()):(qi=le,Jo="value"in qi?qi.value:qi.textContent,sr=!0)),ge=Wa(ie,Ne),0<ge.length&&(Ne=new hh(Ne,e,null,s,le),fe.push({event:Ne,listeners:ge}),ke?Ne.data=ke:(ke=vh(s),ke!==null&&(Ne.data=ke)))),(ke=Iv?Pv(e,s):Zv(e,s))&&(Ne=Wa(ie,"onBeforeInput"),0<Ne.length&&(ge=new hh("onBeforeInput","beforeinput",null,s,le),fe.push({event:ge,listeners:Ne}),ge.data=ke)),Lg(fe,e,ie,s,le)}im(fe,t)})}function En(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Wa(e,t){for(var s=t+"Capture",n=[];e!==null;){var l=e,_=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||_===null||(l=qr(e,s),l!=null&&n.unshift(En(e,l,_)),l=qr(e,t),l!=null&&n.push(En(e,l,_))),e.tag===3)return n;e=e.return}return[]}function Hg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rm(e,t,s,n,l){for(var _=t._reactName,D=[];s!==null&&s!==n;){var z=s,G=z.alternate,ie=z.stateNode;if(z=z.tag,G!==null&&G===n)break;z!==5&&z!==26&&z!==27||ie===null||(G=ie,l?(ie=qr(s,_),ie!=null&&D.unshift(En(s,ie,G))):l||(ie=qr(s,_),ie!=null&&D.push(En(s,ie,G)))),s=s.return}D.length!==0&&e.push({event:t,listeners:D})}var Ug=/\r\n?/g,$g=/\u0000|\uFFFD/g;function nm(e){return(typeof e=="string"?e:""+e).replace(Ug,`
49
+ `).replace($g,"")}function am(e,t){return t=nm(t),nm(e)===t}function qe(e,t,s,n,l,_){switch(s){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||er(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&er(e,""+n);break;case"className":ea(e,"class",n);break;case"tabIndex":ea(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ea(e,s,n);break;case"style":nh(e,n,_);break;case"data":if(t!=="object"){ea(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=ia(""+n),e.setAttribute(s,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(s,"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 _=="function"&&(s==="formAction"?(t!=="input"&&qe(e,t,"name",l.name,l,null),qe(e,t,"formEncType",l.formEncType,l,null),qe(e,t,"formMethod",l.formMethod,l,null),qe(e,t,"formTarget",l.formTarget,l,null)):(qe(e,t,"encType",l.encType,l,null),qe(e,t,"method",l.method,l,null),qe(e,t,"target",l.target,l,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=ia(""+n),e.setAttribute(s,n);break;case"onClick":n!=null&&(e.onclick=Ci);break;case"onScroll":n!=null&&De("scroll",e);break;case"onScrollEnd":n!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(s=n.__html,s!=null){if(l.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}s=ia(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,""+n):e.removeAttribute(s);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":n===!0?e.setAttribute(s,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,n):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(s,n):e.removeAttribute(s);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(s):e.setAttribute(s,n);break;case"popover":De("beforetoggle",e),De("toggle",e),Qn(e,"popover",n);break;case"xlinkActuate":xi(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":xi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":xi(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":xi(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":xi(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":xi(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":xi(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":xi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":xi(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Qn(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=mv.get(s)||s,Qn(e,s,n))}}function Nc(e,t,s,n,l,_){switch(s){case"style":nh(e,n,_);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(s=n.__html,s!=null){if(l.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof n=="string"?er(e,n):(typeof n=="number"||typeof n=="bigint")&&er(e,""+n);break;case"onScroll":n!=null&&De("scroll",e);break;case"onScrollEnd":n!=null&&De("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Ci);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wu.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(l=s.endsWith("Capture"),t=s.slice(2,l?s.length-7:void 0),_=e[Ot]||null,_=_!=null?_[s]:null,typeof _=="function"&&e.removeEventListener(t,_,l),typeof n=="function")){typeof _!="function"&&_!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,n,l);break e}s in e?e[s]=n:n===!0?e.setAttribute(s,""):Qn(e,s,n)}}}function Et(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var n=!1,l=!1,_;for(_ in s)if(s.hasOwnProperty(_)){var D=s[_];if(D!=null)switch(_){case"src":n=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:qe(e,t,_,D,s,null)}}l&&qe(e,t,"srcSet",s.srcSet,s,null),n&&qe(e,t,"src",s.src,s,null);return;case"input":De("invalid",e);var z=_=D=l=null,G=null,ie=null;for(n in s)if(s.hasOwnProperty(n)){var le=s[n];if(le!=null)switch(n){case"name":l=le;break;case"type":D=le;break;case"checked":G=le;break;case"defaultChecked":ie=le;break;case"value":_=le;break;case"defaultValue":z=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(o(137,t));break;default:qe(e,t,n,le,s,null)}}th(e,_,z,G,ie,D,l,!1);return;case"select":De("invalid",e),n=D=_=null;for(l in s)if(s.hasOwnProperty(l)&&(z=s[l],z!=null))switch(l){case"value":_=z;break;case"defaultValue":D=z;break;case"multiple":n=z;default:qe(e,t,l,z,s,null)}t=_,s=D,e.multiple=!!n,t!=null?Qs(e,!!n,t,!1):s!=null&&Qs(e,!!n,s,!0);return;case"textarea":De("invalid",e),_=l=n=null;for(D in s)if(s.hasOwnProperty(D)&&(z=s[D],z!=null))switch(D){case"value":n=z;break;case"defaultValue":l=z;break;case"children":_=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(o(91));break;default:qe(e,t,D,z,s,null)}sh(e,n,l,_);return;case"option":for(G in s)if(s.hasOwnProperty(G)&&(n=s[G],n!=null))switch(G){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:qe(e,t,G,n,s,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(n=0;n<wn.length;n++)De(wn[n],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in s)if(s.hasOwnProperty(ie)&&(n=s[ie],n!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:qe(e,t,ie,n,s,null)}return;default:if(Vo(t)){for(le in s)s.hasOwnProperty(le)&&(n=s[le],n!==void 0&&Nc(e,t,le,n,s,void 0));return}}for(z in s)s.hasOwnProperty(z)&&(n=s[z],n!=null&&qe(e,t,z,n,s,null))}function Ig(e,t,s,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,_=null,D=null,z=null,G=null,ie=null,le=null;for(ae in s){var fe=s[ae];if(s.hasOwnProperty(ae)&&fe!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":G=fe;default:n.hasOwnProperty(ae)||qe(e,t,ae,null,n,fe)}}for(var se in n){var ae=n[se];if(fe=s[se],n.hasOwnProperty(se)&&(ae!=null||fe!=null))switch(se){case"type":_=ae;break;case"name":l=ae;break;case"checked":ie=ae;break;case"defaultChecked":le=ae;break;case"value":D=ae;break;case"defaultValue":z=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,t));break;default:ae!==fe&&qe(e,t,se,ae,n,fe)}}qo(e,D,z,G,ie,le,_,l);return;case"select":ae=D=z=se=null;for(_ in s)if(G=s[_],s.hasOwnProperty(_)&&G!=null)switch(_){case"value":break;case"multiple":ae=G;default:n.hasOwnProperty(_)||qe(e,t,_,null,n,G)}for(l in n)if(_=n[l],G=s[l],n.hasOwnProperty(l)&&(_!=null||G!=null))switch(l){case"value":se=_;break;case"defaultValue":z=_;break;case"multiple":D=_;default:_!==G&&qe(e,t,l,_,n,G)}t=z,s=D,n=ae,se!=null?Qs(e,!!s,se,!1):!!n!=!!s&&(t!=null?Qs(e,!!s,t,!0):Qs(e,!!s,s?[]:"",!1));return;case"textarea":ae=se=null;for(z in s)if(l=s[z],s.hasOwnProperty(z)&&l!=null&&!n.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:qe(e,t,z,null,n,l)}for(D in n)if(l=n[D],_=s[D],n.hasOwnProperty(D)&&(l!=null||_!=null))switch(D){case"value":se=l;break;case"defaultValue":ae=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(o(91));break;default:l!==_&&qe(e,t,D,l,n,_)}ih(e,se,ae);return;case"option":for(var ve in s)if(se=s[ve],s.hasOwnProperty(ve)&&se!=null&&!n.hasOwnProperty(ve))switch(ve){case"selected":e.selected=!1;break;default:qe(e,t,ve,null,n,se)}for(G in n)if(se=n[G],ae=s[G],n.hasOwnProperty(G)&&se!==ae&&(se!=null||ae!=null))switch(G){case"selected":e.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:qe(e,t,G,se,n,ae)}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 xe in s)se=s[xe],s.hasOwnProperty(xe)&&se!=null&&!n.hasOwnProperty(xe)&&qe(e,t,xe,null,n,se);for(ie in n)if(se=n[ie],ae=s[ie],n.hasOwnProperty(ie)&&se!==ae&&(se!=null||ae!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(o(137,t));break;default:qe(e,t,ie,se,n,ae)}return;default:if(Vo(t)){for(var Ke in s)se=s[Ke],s.hasOwnProperty(Ke)&&se!==void 0&&!n.hasOwnProperty(Ke)&&Nc(e,t,Ke,void 0,n,se);for(le in n)se=n[le],ae=s[le],!n.hasOwnProperty(le)||se===ae||se===void 0&&ae===void 0||Nc(e,t,le,se,n,ae);return}}for(var X in s)se=s[X],s.hasOwnProperty(X)&&se!=null&&!n.hasOwnProperty(X)&&qe(e,t,X,null,n,se);for(fe in n)se=n[fe],ae=s[fe],!n.hasOwnProperty(fe)||se===ae||se==null&&ae==null||qe(e,t,fe,se,n,ae)}function om(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Pg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),n=0;n<s.length;n++){var l=s[n],_=l.transferSize,D=l.initiatorType,z=l.duration;if(_&&z&&om(D)){for(D=0,z=l.responseEnd,n+=1;n<s.length;n++){var G=s[n],ie=G.startTime;if(ie>z)break;var le=G.transferSize,fe=G.initiatorType;le&&om(fe)&&(G=G.responseEnd,D+=le*(G<z?1:(z-ie)/(G-ie)))}if(--n,t+=8*(_+D)/(l.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Lc=null,jc=null;function Xa(e){return e.nodeType===9?e:e.ownerDocument}function lm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function cm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Bc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var zc=null;function Zg(){var e=window.event;return e&&e.type==="popstate"?e===zc?!1:(zc=e,!0):(zc=null,!1)}var um=typeof setTimeout=="function"?setTimeout:void 0,Fg=typeof clearTimeout=="function"?clearTimeout:void 0,hm=typeof Promise=="function"?Promise:void 0,qg=typeof queueMicrotask=="function"?queueMicrotask:typeof hm<"u"?function(e){return hm.resolve(null).then(e).catch(Kg)}:um;function Kg(e){setTimeout(function(){throw e})}function ls(e){return e==="head"}function dm(e,t){var s=t,n=0;do{var l=s.nextSibling;if(e.removeChild(s),l&&l.nodeType===8)if(s=l.data,s==="/$"||s==="/&"){if(n===0){e.removeChild(l),Or(t);return}n--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")n++;else if(s==="html")kn(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,kn(s);for(var _=s.firstChild;_;){var D=_.nextSibling,z=_.nodeName;_[Zr]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&_.rel.toLowerCase()==="stylesheet"||s.removeChild(_),_=D}}else s==="body"&&kn(e.ownerDocument.body);s=l}while(s);Or(t)}function fm(e,t){var s=e;e=0;do{var n=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),n&&n.nodeType===8)if(s=n.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=n}while(s)}function Hc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Hc(s),Zo(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function Vg(e,t,s,n){for(;e.nodeType===1;){var l=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Zr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(_=e.getAttribute("rel"),_==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(_!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(_=e.getAttribute("src"),(_!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&_&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var _=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===_)return e}else return e;if(e=ri(e.nextSibling),e===null)break}return null}function Gg(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=ri(e.nextSibling),e===null))return null;return e}function mm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ri(e.nextSibling),e===null))return null;return e}function Uc(e){return e.data==="$?"||e.data==="$~"}function $c(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Yg(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var n=function(){t(),s.removeEventListener("DOMContentLoaded",n)};s.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function ri(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Ic=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return ri(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function pm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function vm(e,t,s){switch(t=Xa(s),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function kn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Zo(e)}var ni=new Map,gm=new Set;function Ja(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ui=Q.d;Q.d={f:Wg,r:Xg,D:Jg,C:Qg,L:e0,m:t0,X:s0,S:i0,M:r0};function Wg(){var e=Ui.f(),t=Za();return e||t}function Xg(e){var t=Ws(e);t!==null&&t.tag===5&&t.type==="form"?Ld(t):Ui.r(e)}var Ar=typeof document>"u"?null:document;function ym(e,t,s){var n=Ar;if(n&&typeof t=="string"&&t){var l=Xt(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof s=="string"&&(l+='[crossorigin="'+s+'"]'),gm.has(l)||(gm.add(l),e={rel:e,crossOrigin:s,href:t},n.querySelector(l)===null&&(t=n.createElement("link"),Et(t,"link",e),yt(t),n.head.appendChild(t)))}}function Jg(e){Ui.D(e),ym("dns-prefetch",e,null)}function Qg(e,t){Ui.C(e,t),ym("preconnect",e,t)}function e0(e,t,s){Ui.L(e,t,s);var n=Ar;if(n&&e&&t){var l='link[rel="preload"][as="'+Xt(t)+'"]';t==="image"&&s&&s.imageSrcSet?(l+='[imagesrcset="'+Xt(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(l+='[imagesizes="'+Xt(s.imageSizes)+'"]')):l+='[href="'+Xt(e)+'"]';var _=l;switch(t){case"style":_=Rr(e);break;case"script":_=Dr(e)}ni.has(_)||(e=f({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),ni.set(_,e),n.querySelector(l)!==null||t==="style"&&n.querySelector(Tn(_))||t==="script"&&n.querySelector(An(_))||(t=n.createElement("link"),Et(t,"link",e),yt(t),n.head.appendChild(t)))}}function t0(e,t){Ui.m(e,t);var s=Ar;if(s&&e){var n=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+Xt(n)+'"][href="'+Xt(e)+'"]',_=l;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Dr(e)}if(!ni.has(_)&&(e=f({rel:"modulepreload",href:e},t),ni.set(_,e),s.querySelector(l)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(An(_)))return}n=s.createElement("link"),Et(n,"link",e),yt(n),s.head.appendChild(n)}}}function i0(e,t,s){Ui.S(e,t,s);var n=Ar;if(n&&e){var l=Xs(n).hoistableStyles,_=Rr(e);t=t||"default";var D=l.get(_);if(!D){var z={loading:0,preload:null};if(D=n.querySelector(Tn(_)))z.loading=5;else{e=f({rel:"stylesheet",href:e,"data-precedence":t},s),(s=ni.get(_))&&Pc(e,s);var G=D=n.createElement("link");yt(G),Et(G,"link",e),G._p=new Promise(function(ie,le){G.onload=ie,G.onerror=le}),G.addEventListener("load",function(){z.loading|=1}),G.addEventListener("error",function(){z.loading|=2}),z.loading|=4,Qa(D,t,n)}D={type:"stylesheet",instance:D,count:1,state:z},l.set(_,D)}}}function s0(e,t){Ui.X(e,t);var s=Ar;if(s&&e){var n=Xs(s).hoistableScripts,l=Dr(e),_=n.get(l);_||(_=s.querySelector(An(l)),_||(e=f({src:e,async:!0},t),(t=ni.get(l))&&Zc(e,t),_=s.createElement("script"),yt(_),Et(_,"link",e),s.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},n.set(l,_))}}function r0(e,t){Ui.M(e,t);var s=Ar;if(s&&e){var n=Xs(s).hoistableScripts,l=Dr(e),_=n.get(l);_||(_=s.querySelector(An(l)),_||(e=f({src:e,async:!0,type:"module"},t),(t=ni.get(l))&&Zc(e,t),_=s.createElement("script"),yt(_),Et(_,"link",e),s.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},n.set(l,_))}}function bm(e,t,s,n){var l=(l=he.current)?Ja(l):null;if(!l)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Rr(s.href),s=Xs(l).hoistableStyles,n=s.get(t),n||(n={type:"style",instance:null,count:0,state:null},s.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Rr(s.href);var _=Xs(l).hoistableStyles,D=_.get(e);if(D||(l=l.ownerDocument||l,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(e,D),(_=l.querySelector(Tn(e)))&&!_._p&&(D.instance=_,D.state.loading=5),ni.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},ni.set(e,s),_||n0(l,e,s,D.state))),t&&n===null)throw Error(o(528,""));return D}if(t&&n!==null)throw Error(o(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Dr(s),s=Xs(l).hoistableScripts,n=s.get(t),n||(n={type:"script",instance:null,count:0,state:null},s.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Rr(e){return'href="'+Xt(e)+'"'}function Tn(e){return'link[rel="stylesheet"]['+e+"]"}function Sm(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function n0(e,t,s,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Et(t,"link",s),yt(t),e.head.appendChild(t))}function Dr(e){return'[src="'+Xt(e)+'"]'}function An(e){return"script[async]"+e}function xm(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Xt(s.href)+'"]');if(n)return t.instance=n,yt(n),n;var l=f({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),yt(n),Et(n,"style",l),Qa(n,s.precedence,e),t.instance=n;case"stylesheet":l=Rr(s.href);var _=e.querySelector(Tn(l));if(_)return t.state.loading|=4,t.instance=_,yt(_),_;n=Sm(s),(l=ni.get(l))&&Pc(n,l),_=(e.ownerDocument||e).createElement("link"),yt(_);var D=_;return D._p=new Promise(function(z,G){D.onload=z,D.onerror=G}),Et(_,"link",n),t.state.loading|=4,Qa(_,s.precedence,e),t.instance=_;case"script":return _=Dr(s.src),(l=e.querySelector(An(_)))?(t.instance=l,yt(l),l):(n=s,(l=ni.get(_))&&(n=f({},s),Zc(n,l)),e=e.ownerDocument||e,l=e.createElement("script"),yt(l),Et(l,"link",n),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Qa(n,s.precedence,e));return t.instance}function Qa(e,t,s){for(var n=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=n.length?n[n.length-1]:null,_=l,D=0;D<n.length;D++){var z=n[D];if(z.dataset.precedence===t)_=z;else if(_!==l)break}_?_.parentNode.insertBefore(e,_.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Pc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Zc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var eo=null;function Cm(e,t,s){if(eo===null){var n=new Map,l=eo=new Map;l.set(s,n)}else l=eo,n=l.get(s),n||(n=new Map,l.set(s,n));if(n.has(e))return n;for(n.set(e,null),s=s.getElementsByTagName(e),l=0;l<s.length;l++){var _=s[l];if(!(_[Zr]||_[St]||e==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var D=_.getAttribute(t)||"";D=e+D;var z=n.get(D);z?z.push(_):n.set(D,[_])}}return n}function wm(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function a0(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Em(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function o0(e,t,s,n){if(s.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var l=Rr(n.href),_=t.querySelector(Tn(l));if(_){t=_._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=to.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=_,yt(_);return}_=t.ownerDocument||t,n=Sm(n),(l=ni.get(l))&&Pc(n,l),_=_.createElement("link"),yt(_);var D=_;D._p=new Promise(function(z,G){D.onload=z,D.onerror=G}),Et(_,"link",n),s.instance=_}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=to.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Fc=0;function l0(e,t){return e.stylesheets&&e.count===0&&so(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var n=setTimeout(function(){if(e.stylesheets&&so(e,e.stylesheets),e.unsuspend){var _=e.unsuspend;e.unsuspend=null,_()}},6e4+t);0<e.imgBytes&&Fc===0&&(Fc=62500*Pg());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&so(e,e.stylesheets),e.unsuspend)){var _=e.unsuspend;e.unsuspend=null,_()}},(e.imgBytes>Fc?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(l)}}:null}function to(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)so(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var io=null;function so(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,io=new Map,t.forEach(c0,e),io=null,to.call(e))}function c0(e,t){if(!(t.state.loading&4)){var s=io.get(e);if(s)var n=s.get(null);else{s=new Map,io.set(e,s);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<l.length;_++){var D=l[_];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(s.set(D.dataset.precedence,D),n=D)}n&&s.set(null,n)}l=t.instance,D=l.getAttribute("data-precedence"),_=s.get(D)||n,_===n&&s.set(null,l),s.set(D,l),this.count++,n=to.bind(this),l.addEventListener("load",n),l.addEventListener("error",n),_?_.parentNode.insertBefore(l,_.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var Rn={$$typeof:p,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function u0(e,t,s,n,l,_,D,z,G){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Uo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uo(0),this.hiddenUpdates=Uo(null),this.identifierPrefix=n,this.onUncaughtError=l,this.onCaughtError=_,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function km(e,t,s,n,l,_,D,z,G,ie,le,fe){return e=new u0(e,t,s,D,G,ie,le,fe,z),t=1,_===!0&&(t|=24),_=Zt(3,null,null,t),e.current=_,_.stateNode=e,t=Cl(),t.refCount++,e.pooledCache=t,t.refCount++,_.memoizedState={element:n,isDehydrated:s,cache:t},Tl(_),e}function Tm(e){return e?(e=or,e):or}function Am(e,t,s,n,l,_){l=Tm(l),n.context===null?n.context=l:n.pendingContext=l,n=Xi(t),n.payload={element:s},_=_===void 0?null:_,_!==null&&(n.callback=_),s=Ji(e,n,t),s!==null&&(zt(s,e,t),on(s,e,t))}function Rm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function qc(e,t){Rm(e,t),(e=e.alternate)&&Rm(e,t)}function Dm(e){if(e.tag===13||e.tag===31){var t=Ds(e,67108864);t!==null&&zt(t,e,67108864),qc(e,67108864)}}function Om(e){if(e.tag===13||e.tag===31){var t=Gt();t=$o(t);var s=Ds(e,t);s!==null&&zt(s,e,t),qc(e,t)}}var ro=!0;function h0(e,t,s,n){var l=q.T;q.T=null;var _=Q.p;try{Q.p=2,Kc(e,t,s,n)}finally{Q.p=_,q.T=l}}function d0(e,t,s,n){var l=q.T;q.T=null;var _=Q.p;try{Q.p=8,Kc(e,t,s,n)}finally{Q.p=_,q.T=l}}function Kc(e,t,s,n){if(ro){var l=Vc(n);if(l===null)Mc(e,t,n,no,s),Nm(e,n);else if(m0(l,e,t,s,n))n.stopPropagation();else if(Nm(e,n),t&4&&-1<f0.indexOf(e)){for(;l!==null;){var _=Ws(l);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var D=Es(_.pendingLanes);if(D!==0){var z=_;for(z.pendingLanes|=2,z.entangledLanes|=2;D;){var G=1<<31-It(D);z.entanglements[1]|=G,D&=~G}gi(_),(He&6)===0&&(Ia=vt()+500,Cn(0))}}break;case 31:case 13:z=Ds(_,2),z!==null&&zt(z,_,2),Za(),qc(_,2)}if(_=Vc(n),_===null&&Mc(e,t,n,no,s),_===l)break;l=_}l!==null&&n.stopPropagation()}else Mc(e,t,n,null,s)}}function Vc(e){return e=Yo(e),Gc(e)}var no=null;function Gc(e){if(no=null,e=Ys(e),e!==null){var t=k(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=E(t),e!==null)return e;e=null}else if(s===31){if(e=c(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return no=e,null}function Mm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Yt()){case Pi:return 2;case Ks:return 8;case Ut:case Vs:return 32;case li:return 268435456;default:return 32}default:return 32}}var Yc=!1,cs=null,us=null,hs=null,Dn=new Map,On=new Map,ds=[],f0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Nm(e,t){switch(e){case"focusin":case"focusout":cs=null;break;case"dragenter":case"dragleave":us=null;break;case"mouseover":case"mouseout":hs=null;break;case"pointerover":case"pointerout":Dn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":On.delete(t.pointerId)}}function Mn(e,t,s,n,l,_){return e===null||e.nativeEvent!==_?(e={blockedOn:t,domEventName:s,eventSystemFlags:n,nativeEvent:_,targetContainers:[l]},t!==null&&(t=Ws(t),t!==null&&Dm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function m0(e,t,s,n,l){switch(t){case"focusin":return cs=Mn(cs,e,t,s,n,l),!0;case"dragenter":return us=Mn(us,e,t,s,n,l),!0;case"mouseover":return hs=Mn(hs,e,t,s,n,l),!0;case"pointerover":var _=l.pointerId;return Dn.set(_,Mn(Dn.get(_)||null,e,t,s,n,l)),!0;case"gotpointercapture":return _=l.pointerId,On.set(_,Mn(On.get(_)||null,e,t,s,n,l)),!0}return!1}function Lm(e){var t=Ys(e.target);if(t!==null){var s=k(t);if(s!==null){if(t=s.tag,t===13){if(t=E(s),t!==null){e.blockedOn=t,Vu(e.priority,function(){Om(s)});return}}else if(t===31){if(t=c(s),t!==null){e.blockedOn=t,Vu(e.priority,function(){Om(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ao(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Vc(e.nativeEvent);if(s===null){s=e.nativeEvent;var n=new s.constructor(s.type,s);Go=n,s.target.dispatchEvent(n),Go=null}else return t=Ws(s),t!==null&&Dm(t),e.blockedOn=s,!1;t.shift()}return!0}function jm(e,t,s){ao(e)&&s.delete(t)}function _0(){Yc=!1,cs!==null&&ao(cs)&&(cs=null),us!==null&&ao(us)&&(us=null),hs!==null&&ao(hs)&&(hs=null),Dn.forEach(jm),On.forEach(jm)}function oo(e,t){e.blockedOn===t&&(e.blockedOn=null,Yc||(Yc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,_0)))}var lo=null;function Bm(e){lo!==e&&(lo=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){lo===e&&(lo=null);for(var t=0;t<e.length;t+=3){var s=e[t],n=e[t+1],l=e[t+2];if(typeof n!="function"){if(Gc(n||s)===null)continue;break}var _=Ws(s);_!==null&&(e.splice(t,3),t-=3,Vl(_,{pending:!0,data:l,method:s.method,action:n},n,l))}}))}function Or(e){function t(G){return oo(G,e)}cs!==null&&oo(cs,e),us!==null&&oo(us,e),hs!==null&&oo(hs,e),Dn.forEach(t),On.forEach(t);for(var s=0;s<ds.length;s++){var n=ds[s];n.blockedOn===e&&(n.blockedOn=null)}for(;0<ds.length&&(s=ds[0],s.blockedOn===null);)Lm(s),s.blockedOn===null&&ds.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(n=0;n<s.length;n+=3){var l=s[n],_=s[n+1],D=l[Ot]||null;if(typeof _=="function")D||Bm(s);else if(D){var z=null;if(_&&_.hasAttribute("formAction")){if(l=_,D=_[Ot]||null)z=D.formAction;else if(Gc(l)!==null)continue}else z=D.action;typeof z=="function"?s[n+1]=z:(s.splice(n,3),n-=3),Bm(s)}}}function zm(){function e(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(D){return l=D})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),n||setTimeout(s,20)}function s(){if(!n&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function Wc(e){this._internalRoot=e}co.prototype.render=Wc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,n=Gt();Am(s,n,e,t,null,null)},co.prototype.unmount=Wc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Am(e.current,2,null,e,null,null),Za(),t[Gs]=null}};function co(e){this._internalRoot=e}co.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ku();e={blockedOn:null,target:e,priority:t};for(var s=0;s<ds.length&&t!==0&&t<ds[s].priority;s++);ds.splice(s,0,e),s===0&&Lm(e)}};var Hm=r.version;if(Hm!=="19.2.4")throw Error(o(527,Hm,"19.2.4"));Q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=u(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var p0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var uo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uo.isDisabled&&uo.supportsFiber)try{ws=uo.inject(p0),$t=uo}catch{}}return Ln.createRoot=function(e,t){if(!v(e))throw Error(o(299));var s=!1,n="",l=Fd,_=qd,D=Kd;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(_=t.onCaughtError),t.onRecoverableError!==void 0&&(D=t.onRecoverableError)),t=km(e,1,!1,null,null,s,n,null,l,_,D,zm),e[Gs]=t.current,Oc(e),new Wc(t)},Ln.hydrateRoot=function(e,t,s){if(!v(e))throw Error(o(299));var n=!1,l="",_=Fd,D=qd,z=Kd,G=null;return s!=null&&(s.unstable_strictMode===!0&&(n=!0),s.identifierPrefix!==void 0&&(l=s.identifierPrefix),s.onUncaughtError!==void 0&&(_=s.onUncaughtError),s.onCaughtError!==void 0&&(D=s.onCaughtError),s.onRecoverableError!==void 0&&(z=s.onRecoverableError),s.formState!==void 0&&(G=s.formState)),t=km(e,1,!0,t,s??null,n,l,G,_,D,z,zm),t.context=Tm(null),s=t.current,n=Gt(),n=$o(n),l=Xi(n),l.callback=null,Ji(s,l,n),s=n,t.current.lanes=s,Pr(t,s),gi(t),e[Gs]=t.current,Oc(e),new co(t)},Ln.version="19.2.4",Ln}var Gm;function A0(){if(Gm)return Qc.exports;Gm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),Qc.exports=T0(),Qc.exports}var R0=A0();const D0=F_(R0);/**
50
+ * react-router v7.13.2
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var Ym="popstate";function Wm(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function O0(i={}){function r(o,v){var u;let k=(u=v.state)==null?void 0:u.masked,{pathname:E,search:c,hash:h}=k||o.location;return fu("",{pathname:E,search:c,hash:h},v.state&&v.state.usr||null,v.state&&v.state.key||"default",k?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,v){return typeof v=="string"?v:In(v)}return N0(r,a,null,i)}function tt(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function bi(i,r){if(!i){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function M0(){return Math.random().toString(36).substring(2,10)}function Xm(i,r){return{usr:i.state,key:i.key,idx:r,masked:i.unstable_mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function fu(i,r,a=null,o,v){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof r=="string"?Hr(r):r,state:a,key:r&&r.key||o||M0(),unstable_mask:v}}function In({pathname:i="/",search:r="",hash:a=""}){return r&&r!=="?"&&(i+=r.charAt(0)==="?"?r:"?"+r),a&&a!=="#"&&(i+=a.charAt(0)==="#"?a:"#"+a),i}function Hr(i){let r={};if(i){let a=i.indexOf("#");a>=0&&(r.hash=i.substring(a),i=i.substring(0,a));let o=i.indexOf("?");o>=0&&(r.search=i.substring(o),i=i.substring(0,o)),i&&(r.pathname=i)}return r}function N0(i,r,a,o={}){let{window:v=document.defaultView,v5Compat:k=!1}=o,E=v.history,c="POP",h=null,u=y();u==null&&(u=0,E.replaceState({...E.state,idx:u},""));function y(){return(E.state||{idx:null}).idx}function f(){c="POP";let m=y(),g=m==null?null:m-u;u=m,h&&h({action:c,location:C.location,delta:g})}function x(m,g){c="PUSH";let d=Wm(m)?m:fu(C.location,m,g);u=y()+1;let p=Xm(d,u),S=C.createHref(d.unstable_mask||d);try{E.pushState(p,"",S)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;v.location.assign(S)}k&&h&&h({action:c,location:C.location,delta:1})}function T(m,g){c="REPLACE";let d=Wm(m)?m:fu(C.location,m,g);u=y();let p=Xm(d,u),S=C.createHref(d.unstable_mask||d);E.replaceState(p,"",S),k&&h&&h({action:c,location:C.location,delta:0})}function O(m){return L0(m)}let C={get action(){return c},get location(){return i(v,E)},listen(m){if(h)throw new Error("A history only accepts one active listener");return v.addEventListener(Ym,f),h=m,()=>{v.removeEventListener(Ym,f),h=null}},createHref(m){return r(v,m)},createURL:O,encodeLocation(m){let g=O(m);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:x,replace:T,go(m){return E.go(m)}};return C}function L0(i,r=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),tt(a,"No window.location.(origin|href) available to create URL");let o=typeof i=="string"?i:In(i);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function q_(i,r,a="/"){return j0(i,r,a,!1)}function j0(i,r,a,o){let v=typeof r=="string"?Hr(r):r,k=Ii(v.pathname||"/",a);if(k==null)return null;let E=K_(i);B0(E);let c=null;for(let h=0;c==null&&h<E.length;++h){let u=V0(k);c=q0(E[h],u,o)}return c}function K_(i,r=[],a=[],o="",v=!1){let k=(E,c,h=v,u)=>{let y={relativePath:u===void 0?E.path||"":u,caseSensitive:E.caseSensitive===!0,childrenIndex:c,route:E};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&h)return;tt(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let f=yi([o,y.relativePath]),x=a.concat(y);E.children&&E.children.length>0&&(tt(E.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),K_(E.children,r,x,f,h)),!(E.path==null&&!E.index)&&r.push({path:f,score:Z0(f,E.index),routesMeta:x})};return i.forEach((E,c)=>{var h;if(E.path===""||!((h=E.path)!=null&&h.includes("?")))k(E,c);else for(let u of V_(E.path))k(E,c,!0,u)}),r}function V_(i){let r=i.split("/");if(r.length===0)return[];let[a,...o]=r,v=a.endsWith("?"),k=a.replace(/\?$/,"");if(o.length===0)return v?[k,""]:[k];let E=V_(o.join("/")),c=[];return c.push(...E.map(h=>h===""?k:[k,h].join("/"))),v&&c.push(...E),c.map(h=>i.startsWith("/")&&h===""?"/":h)}function B0(i){i.sort((r,a)=>r.score!==a.score?a.score-r.score:F0(r.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var z0=/^:[\w-]+$/,H0=3,U0=2,$0=1,I0=10,P0=-2,Jm=i=>i==="*";function Z0(i,r){let a=i.split("/"),o=a.length;return a.some(Jm)&&(o+=P0),r&&(o+=U0),a.filter(v=>!Jm(v)).reduce((v,k)=>v+(z0.test(k)?H0:k===""?$0:I0),o)}function F0(i,r){return i.length===r.length&&i.slice(0,-1).every((o,v)=>o===r[v])?i[i.length-1]-r[r.length-1]:0}function q0(i,r,a=!1){let{routesMeta:o}=i,v={},k="/",E=[];for(let c=0;c<o.length;++c){let h=o[c],u=c===o.length-1,y=k==="/"?r:r.slice(k.length)||"/",f=xo({path:h.relativePath,caseSensitive:h.caseSensitive,end:u},y),x=h.route;if(!f&&u&&a&&!o[o.length-1].route.index&&(f=xo({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},y)),!f)return null;Object.assign(v,f.params),E.push({params:v,pathname:yi([k,f.pathname]),pathnameBase:X0(yi([k,f.pathnameBase])),route:x}),f.pathnameBase!=="/"&&(k=yi([k,f.pathnameBase]))}return E}function xo(i,r){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[a,o]=K0(i.path,i.caseSensitive,i.end),v=r.match(a);if(!v)return null;let k=v[0],E=k.replace(/(.)\/+$/,"$1"),c=v.slice(1);return{params:o.reduce((u,{paramName:y,isOptional:f},x)=>{if(y==="*"){let O=c[x]||"";E=k.slice(0,k.length-O.length).replace(/(.)\/+$/,"$1")}const T=c[x];return f&&!T?u[y]=void 0:u[y]=(T||"").replace(/%2F/g,"/"),u},{}),pathname:k,pathnameBase:E,pattern:i}}function K0(i,r=!1,a=!0){bi(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let o=[],v="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(E,c,h,u,y)=>{if(o.push({paramName:c,isOptional:h!=null}),h){let f=y.charAt(u+E.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(o.push({paramName:"*"}),v+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?v+="\\/*$":i!==""&&i!=="/"&&(v+="(?:(?=\\/|$))"),[new RegExp(v,r?void 0:"i"),o]}function V0(i){try{return i.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return bi(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),i}}function Ii(i,r){if(r==="/")return i;if(!i.toLowerCase().startsWith(r.toLowerCase()))return null;let a=r.endsWith("/")?r.length-1:r.length,o=i.charAt(a);return o&&o!=="/"?null:i.slice(a)||"/"}var G0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Y0(i,r="/"){let{pathname:a,search:o="",hash:v=""}=typeof i=="string"?Hr(i):i,k;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?k=Qm(a.substring(1),"/"):k=Qm(a,r)):k=r,{pathname:k,search:J0(o),hash:Q0(v)}}function Qm(i,r){let a=r.replace(/\/+$/,"").split("/");return i.split("/").forEach(v=>{v===".."?a.length>1&&a.pop():v!=="."&&a.push(v)}),a.length>1?a.join("/"):"/"}function su(i,r,a,o){return`Cannot include a '${i}' character in a manually specified \`to.${r}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function W0(i){return i.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function G_(i){let r=W0(i);return r.map((a,o)=>o===r.length-1?a.pathname:a.pathnameBase)}function wu(i,r,a,o=!1){let v;typeof i=="string"?v=Hr(i):(v={...i},tt(!v.pathname||!v.pathname.includes("?"),su("?","pathname","search",v)),tt(!v.pathname||!v.pathname.includes("#"),su("#","pathname","hash",v)),tt(!v.search||!v.search.includes("#"),su("#","search","hash",v)));let k=i===""||v.pathname==="",E=k?"/":v.pathname,c;if(E==null)c=a;else{let f=r.length-1;if(!o&&E.startsWith("..")){let x=E.split("/");for(;x[0]==="..";)x.shift(),f-=1;v.pathname=x.join("/")}c=f>=0?r[f]:"/"}let h=Y0(v,c),u=E&&E!=="/"&&E.endsWith("/"),y=(k||E===".")&&a.endsWith("/");return!h.pathname.endsWith("/")&&(u||y)&&(h.pathname+="/"),h}var yi=i=>i.join("/").replace(/\/\/+/g,"/"),X0=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),J0=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,Q0=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,ey=class{constructor(i,r,a,o=!1){this.status=i,this.statusText=r||"",this.internal=o,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function ty(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function iy(i){return i.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Y_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function W_(i,r){let a=i;if(typeof a!="string"||!G0.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,v=!1;if(Y_)try{let k=new URL(window.location.href),E=a.startsWith("//")?new URL(k.protocol+a):new URL(a),c=Ii(E.pathname,r);E.origin===k.origin&&c!=null?a=c+E.search+E.hash:v=!0}catch{bi(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:v,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var X_=["POST","PUT","PATCH","DELETE"];new Set(X_);var sy=["GET",...X_];new Set(sy);var Ur=I.createContext(null);Ur.displayName="DataRouter";var Ro=I.createContext(null);Ro.displayName="DataRouterState";var ry=I.createContext(!1),J_=I.createContext({isTransitioning:!1});J_.displayName="ViewTransition";var ny=I.createContext(new Map);ny.displayName="Fetchers";var ay=I.createContext(null);ay.displayName="Await";var ai=I.createContext(null);ai.displayName="Navigation";var Zn=I.createContext(null);Zn.displayName="Location";var fi=I.createContext({outlet:null,matches:[],isDataRoute:!1});fi.displayName="Route";var Eu=I.createContext(null);Eu.displayName="RouteError";var Q_="REACT_ROUTER_ERROR",oy="REDIRECT",ly="ROUTE_ERROR_RESPONSE";function cy(i){if(i.startsWith(`${Q_}:${oy}:{`))try{let r=JSON.parse(i.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function uy(i){if(i.startsWith(`${Q_}:${ly}:{`))try{let r=JSON.parse(i.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new ey(r.status,r.statusText,r.data)}catch{}}function hy(i,{relative:r}={}){tt(Fn(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=I.useContext(ai),{hash:v,pathname:k,search:E}=qn(i,{relative:r}),c=k;return a!=="/"&&(c=k==="/"?a:yi([a,k])),o.createHref({pathname:c,search:E,hash:v})}function Fn(){return I.useContext(Zn)!=null}function ys(){return tt(Fn(),"useLocation() may be used only in the context of a <Router> component."),I.useContext(Zn).location}var ep="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function tp(i){I.useContext(ai).static||I.useLayoutEffect(i)}function Do(){let{isDataRoute:i}=I.useContext(fi);return i?ky():dy()}function dy(){tt(Fn(),"useNavigate() may be used only in the context of a <Router> component.");let i=I.useContext(Ur),{basename:r,navigator:a}=I.useContext(ai),{matches:o}=I.useContext(fi),{pathname:v}=ys(),k=JSON.stringify(G_(o)),E=I.useRef(!1);return tp(()=>{E.current=!0}),I.useCallback((h,u={})=>{if(bi(E.current,ep),!E.current)return;if(typeof h=="number"){a.go(h);return}let y=wu(h,JSON.parse(k),v,u.relative==="path");i==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:yi([r,y.pathname])),(u.replace?a.replace:a.push)(y,u.state,u)},[r,a,k,v,i])}var fy=I.createContext(null);function my(i){let r=I.useContext(fi).outlet;return I.useMemo(()=>r&&I.createElement(fy.Provider,{value:i},r),[r,i])}function ip(){let{matches:i}=I.useContext(fi),r=i[i.length-1];return r?r.params:{}}function qn(i,{relative:r}={}){let{matches:a}=I.useContext(fi),{pathname:o}=ys(),v=JSON.stringify(G_(a));return I.useMemo(()=>wu(i,JSON.parse(v),o,r==="path"),[i,v,o,r])}function _y(i,r){return sp(i,r)}function sp(i,r,a){var m;tt(Fn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=I.useContext(ai),{matches:v}=I.useContext(fi),k=v[v.length-1],E=k?k.params:{},c=k?k.pathname:"/",h=k?k.pathnameBase:"/",u=k&&k.route;{let g=u&&u.path||"";np(c,!u||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${g}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let y=ys(),f;if(r){let g=typeof r=="string"?Hr(r):r;tt(h==="/"||((m=g.pathname)==null?void 0:m.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${g.pathname}" was given in the \`location\` prop.`),f=g}else f=y;let x=f.pathname||"/",T=x;if(h!=="/"){let g=h.replace(/^\//,"").split("/");T="/"+x.replace(/^\//,"").split("/").slice(g.length).join("/")}let O=q_(i,{pathname:T});bi(u||O!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),bi(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=by(O&&O.map(g=>Object.assign({},g,{params:Object.assign({},E,g.params),pathname:yi([h,o.encodeLocation?o.encodeLocation(g.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?h:yi([h,o.encodeLocation?o.encodeLocation(g.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),v,a);return r&&C?I.createElement(Zn.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...f},navigationType:"POP"}},C):C}function py(){let i=Ey(),r=ty(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),a=i instanceof Error?i.stack:null,o="rgba(200,200,200, 0.5)",v={padding:"0.5rem",backgroundColor:o},k={padding:"2px 4px",backgroundColor:o},E=null;return console.error("Error handled by React Router default ErrorBoundary:",i),E=I.createElement(I.Fragment,null,I.createElement("p",null,"💿 Hey developer 👋"),I.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",I.createElement("code",{style:k},"ErrorBoundary")," or"," ",I.createElement("code",{style:k},"errorElement")," prop on your route.")),I.createElement(I.Fragment,null,I.createElement("h2",null,"Unexpected Application Error!"),I.createElement("h3",{style:{fontStyle:"italic"}},r),a?I.createElement("pre",{style:v},a):null,E)}var vy=I.createElement(py,null),rp=class extends I.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,r){return r.location!==i.location||r.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:r.error,location:r.location,revalidation:i.revalidation||r.revalidation}}componentDidCatch(i,r){this.props.onError?this.props.onError(i,r):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const a=uy(i.digest);a&&(i=a)}let r=i!==void 0?I.createElement(fi.Provider,{value:this.props.routeContext},I.createElement(Eu.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?I.createElement(gy,{error:i},r):r}};rp.contextType=ry;var ru=new WeakMap;function gy({children:i,error:r}){let{basename:a}=I.useContext(ai);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let o=cy(r.digest);if(o){let v=ru.get(r);if(v)throw v;let k=W_(o.location,a);if(Y_&&!ru.get(r))if(k.isExternal||o.reloadDocument)window.location.href=k.absoluteURL||k.to;else{const E=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(k.to,{replace:o.replace}));throw ru.set(r,E),E}return I.createElement("meta",{httpEquiv:"refresh",content:`0;url=${k.absoluteURL||k.to}`})}}return i}function yy({routeContext:i,match:r,children:a}){let o=I.useContext(Ur);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),I.createElement(fi.Provider,{value:i},a)}function by(i,r=[],a){let o=a==null?void 0:a.state;if(i==null){if(!o)return null;if(o.errors)i=o.matches;else if(r.length===0&&!o.initialized&&o.matches.length>0)i=o.matches;else return null}let v=i,k=o==null?void 0:o.errors;if(k!=null){let y=v.findIndex(f=>f.route.id&&(k==null?void 0:k[f.route.id])!==void 0);tt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(k).join(",")}`),v=v.slice(0,Math.min(v.length,y+1))}let E=!1,c=-1;if(a&&o){E=o.renderFallback;for(let y=0;y<v.length;y++){let f=v[y];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=y),f.route.id){let{loaderData:x,errors:T}=o,O=f.route.loader&&!x.hasOwnProperty(f.route.id)&&(!T||T[f.route.id]===void 0);if(f.route.lazy||O){a.isStatic&&(E=!0),c>=0?v=v.slice(0,c+1):v=[v[0]];break}}}}let h=a==null?void 0:a.onError,u=o&&h?(y,f)=>{var x,T;h(y,{location:o.location,params:((T=(x=o.matches)==null?void 0:x[0])==null?void 0:T.params)??{},unstable_pattern:iy(o.matches),errorInfo:f})}:void 0;return v.reduceRight((y,f,x)=>{let T,O=!1,C=null,m=null;o&&(T=k&&f.route.id?k[f.route.id]:void 0,C=f.route.errorElement||vy,E&&(c<0&&x===0?(np("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),O=!0,m=null):c===x&&(O=!0,m=f.route.hydrateFallbackElement||null)));let g=r.concat(v.slice(0,x+1)),d=()=>{let p;return T?p=C:O?p=m:f.route.Component?p=I.createElement(f.route.Component,null):f.route.element?p=f.route.element:p=y,I.createElement(yy,{match:f,routeContext:{outlet:y,matches:g,isDataRoute:o!=null},children:p})};return o&&(f.route.ErrorBoundary||f.route.errorElement||x===0)?I.createElement(rp,{location:o.location,revalidation:o.revalidation,component:C,error:T,children:d(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:u}):d()},null)}function ku(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sy(i){let r=I.useContext(Ur);return tt(r,ku(i)),r}function xy(i){let r=I.useContext(Ro);return tt(r,ku(i)),r}function Cy(i){let r=I.useContext(fi);return tt(r,ku(i)),r}function Tu(i){let r=Cy(i),a=r.matches[r.matches.length-1];return tt(a.route.id,`${i} can only be used on routes that contain a unique "id"`),a.route.id}function wy(){return Tu("useRouteId")}function Ey(){var o;let i=I.useContext(Eu),r=xy("useRouteError"),a=Tu("useRouteError");return i!==void 0?i:(o=r.errors)==null?void 0:o[a]}function ky(){let{router:i}=Sy("useNavigate"),r=Tu("useNavigate"),a=I.useRef(!1);return tp(()=>{a.current=!0}),I.useCallback(async(v,k={})=>{bi(a.current,ep),a.current&&(typeof v=="number"?await i.navigate(v):await i.navigate(v,{fromRouteId:r,...k}))},[i,r])}var e_={};function np(i,r,a){!r&&!e_[i]&&(e_[i]=!0,bi(!1,a))}I.memo(Ty);function Ty({routes:i,future:r,state:a,isStatic:o,onError:v}){return sp(i,void 0,{state:a,isStatic:o,onError:v})}function Ay(i){return my(i.context)}function _s(i){tt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Ry({basename:i="/",children:r=null,location:a,navigationType:o="POP",navigator:v,static:k=!1,unstable_useTransitions:E}){tt(!Fn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=i.replace(/^\/*/,"/"),h=I.useMemo(()=>({basename:c,navigator:v,static:k,unstable_useTransitions:E,future:{}}),[c,v,k,E]);typeof a=="string"&&(a=Hr(a));let{pathname:u="/",search:y="",hash:f="",state:x=null,key:T="default",unstable_mask:O}=a,C=I.useMemo(()=>{let m=Ii(u,c);return m==null?null:{location:{pathname:m,search:y,hash:f,state:x,key:T,unstable_mask:O},navigationType:o}},[c,u,y,f,x,T,o,O]);return bi(C!=null,`<Router basename="${c}"> is not able to match the URL "${u}${y}${f}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:I.createElement(ai.Provider,{value:h},I.createElement(Zn.Provider,{children:r,value:C}))}function Dy({children:i,location:r}){return _y(mu(i),r)}function mu(i,r=[]){let a=[];return I.Children.forEach(i,(o,v)=>{if(!I.isValidElement(o))return;let k=[...r,v];if(o.type===I.Fragment){a.push.apply(a,mu(o.props.children,k));return}tt(o.type===_s,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),tt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let E={id:o.props.id||k.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(E.children=mu(o.props.children,k)),a.push(E)}),a}var bo="get",So="application/x-www-form-urlencoded";function Oo(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function Oy(i){return Oo(i)&&i.tagName.toLowerCase()==="button"}function My(i){return Oo(i)&&i.tagName.toLowerCase()==="form"}function Ny(i){return Oo(i)&&i.tagName.toLowerCase()==="input"}function Ly(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function jy(i,r){return i.button===0&&(!r||r==="_self")&&!Ly(i)}var ho=null;function By(){if(ho===null)try{new FormData(document.createElement("form"),0),ho=!1}catch{ho=!0}return ho}var zy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nu(i){return i!=null&&!zy.has(i)?(bi(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${So}"`),null):i}function Hy(i,r){let a,o,v,k,E;if(My(i)){let c=i.getAttribute("action");o=c?Ii(c,r):null,a=i.getAttribute("method")||bo,v=nu(i.getAttribute("enctype"))||So,k=new FormData(i)}else if(Oy(i)||Ny(i)&&(i.type==="submit"||i.type==="image")){let c=i.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=i.getAttribute("formaction")||c.getAttribute("action");if(o=h?Ii(h,r):null,a=i.getAttribute("formmethod")||c.getAttribute("method")||bo,v=nu(i.getAttribute("formenctype"))||nu(c.getAttribute("enctype"))||So,k=new FormData(c,i),!By()){let{name:u,type:y,value:f}=i;if(y==="image"){let x=u?`${u}.`:"";k.append(`${x}x`,"0"),k.append(`${x}y`,"0")}else u&&k.append(u,f)}}else{if(Oo(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=bo,o=null,v=So,E=i}return k&&v==="text/plain"&&(E=k,k=void 0),{action:o,method:a.toLowerCase(),encType:v,formData:k,body:E}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Au(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function Uy(i,r,a,o){let v=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return a?v.pathname.endsWith("/")?v.pathname=`${v.pathname}_.${o}`:v.pathname=`${v.pathname}.${o}`:v.pathname==="/"?v.pathname=`_root.${o}`:r&&Ii(v.pathname,r)==="/"?v.pathname=`${r.replace(/\/$/,"")}/_root.${o}`:v.pathname=`${v.pathname.replace(/\/$/,"")}.${o}`,v}async function $y(i,r){if(i.id in r)return r[i.id];try{let a=await import(i.module);return r[i.id]=a,a}catch(a){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Iy(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function Py(i,r,a){let o=await Promise.all(i.map(async v=>{let k=r.routes[v.route.id];if(k){let E=await $y(k,a);return E.links?E.links():[]}return[]}));return Ky(o.flat(1).filter(Iy).filter(v=>v.rel==="stylesheet"||v.rel==="preload").map(v=>v.rel==="stylesheet"?{...v,rel:"prefetch",as:"style"}:{...v,rel:"prefetch"}))}function t_(i,r,a,o,v,k){let E=(h,u)=>a[u]?h.route.id!==a[u].route.id:!0,c=(h,u)=>{var y;return a[u].pathname!==h.pathname||((y=a[u].route.path)==null?void 0:y.endsWith("*"))&&a[u].params["*"]!==h.params["*"]};return k==="assets"?r.filter((h,u)=>E(h,u)||c(h,u)):k==="data"?r.filter((h,u)=>{var f;let y=o.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(E(h,u)||c(h,u))return!0;if(h.route.shouldRevalidate){let x=h.route.shouldRevalidate({currentUrl:new URL(v.pathname+v.search+v.hash,window.origin),currentParams:((f=a[0])==null?void 0:f.params)||{},nextUrl:new URL(i,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function Zy(i,r,{includeHydrateFallback:a}={}){return Fy(i.map(o=>{let v=r.routes[o.route.id];if(!v)return[];let k=[v.module];return v.clientActionModule&&(k=k.concat(v.clientActionModule)),v.clientLoaderModule&&(k=k.concat(v.clientLoaderModule)),a&&v.hydrateFallbackModule&&(k=k.concat(v.hydrateFallbackModule)),v.imports&&(k=k.concat(v.imports)),k}).flat(1))}function Fy(i){return[...new Set(i)]}function qy(i){let r={},a=Object.keys(i).sort();for(let o of a)r[o]=i[o];return r}function Ky(i,r){let a=new Set;return new Set(r),i.reduce((o,v)=>{let k=JSON.stringify(qy(v));return a.has(k)||(a.add(k),o.push({key:k,link:v})),o},[])}function ap(){let i=I.useContext(Ur);return Au(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function Vy(){let i=I.useContext(Ro);return Au(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var Ru=I.createContext(void 0);Ru.displayName="FrameworkContext";function op(){let i=I.useContext(Ru);return Au(i,"You must render this element inside a <HydratedRouter> element"),i}function Gy(i,r){let a=I.useContext(Ru),[o,v]=I.useState(!1),[k,E]=I.useState(!1),{onFocus:c,onBlur:h,onMouseEnter:u,onMouseLeave:y,onTouchStart:f}=r,x=I.useRef(null);I.useEffect(()=>{if(i==="render"&&E(!0),i==="viewport"){let C=g=>{g.forEach(d=>{E(d.isIntersecting)})},m=new IntersectionObserver(C,{threshold:.5});return x.current&&m.observe(x.current),()=>{m.disconnect()}}},[i]),I.useEffect(()=>{if(o){let C=setTimeout(()=>{E(!0)},100);return()=>{clearTimeout(C)}}},[o]);let T=()=>{v(!0)},O=()=>{v(!1),E(!1)};return a?i!=="intent"?[k,x,{}]:[k,x,{onFocus:jn(c,T),onBlur:jn(h,O),onMouseEnter:jn(u,T),onMouseLeave:jn(y,O),onTouchStart:jn(f,T)}]:[!1,x,{}]}function jn(i,r){return a=>{i&&i(a),a.defaultPrevented||r(a)}}function Yy({page:i,...r}){let{router:a}=ap(),o=I.useMemo(()=>q_(a.routes,i,a.basename),[a.routes,i,a.basename]);return o?I.createElement(Xy,{page:i,matches:o,...r}):null}function Wy(i){let{manifest:r,routeModules:a}=op(),[o,v]=I.useState([]);return I.useEffect(()=>{let k=!1;return Py(i,r,a).then(E=>{k||v(E)}),()=>{k=!0}},[i,r,a]),o}function Xy({page:i,matches:r,...a}){let o=ys(),{future:v,manifest:k,routeModules:E}=op(),{basename:c}=ap(),{loaderData:h,matches:u}=Vy(),y=I.useMemo(()=>t_(i,r,u,k,o,"data"),[i,r,u,k,o]),f=I.useMemo(()=>t_(i,r,u,k,o,"assets"),[i,r,u,k,o]),x=I.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let C=new Set,m=!1;if(r.forEach(d=>{var S;let p=k.routes[d.route.id];!p||!p.hasLoader||(!y.some(A=>A.route.id===d.route.id)&&d.route.id in h&&((S=E[d.route.id])!=null&&S.shouldRevalidate)||p.hasClientLoader?m=!0:C.add(d.route.id))}),C.size===0)return[];let g=Uy(i,c,v.unstable_trailingSlashAwareDataRequests,"data");return m&&C.size>0&&g.searchParams.set("_routes",r.filter(d=>C.has(d.route.id)).map(d=>d.route.id).join(",")),[g.pathname+g.search]},[c,v.unstable_trailingSlashAwareDataRequests,h,o,k,y,r,i,E]),T=I.useMemo(()=>Zy(f,k),[f,k]),O=Wy(f);return I.createElement(I.Fragment,null,x.map(C=>I.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...a})),T.map(C=>I.createElement("link",{key:C,rel:"modulepreload",href:C,...a})),O.map(({key:C,link:m})=>I.createElement("link",{key:C,nonce:a.nonce,...m,crossOrigin:m.crossOrigin??a.crossOrigin})))}function Jy(...i){return r=>{i.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var Qy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Qy&&(window.__reactRouterVersion="7.13.2")}catch{}function eb({basename:i,children:r,unstable_useTransitions:a,window:o}){let v=I.useRef();v.current==null&&(v.current=O0({window:o,v5Compat:!0}));let k=v.current,[E,c]=I.useState({action:k.action,location:k.location}),h=I.useCallback(u=>{a===!1?c(u):I.startTransition(()=>c(u))},[a]);return I.useLayoutEffect(()=>k.listen(h),[k,h]),I.createElement(Ry,{basename:i,children:r,location:E.location,navigationType:E.action,navigator:k,unstable_useTransitions:a})}var lp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,di=I.forwardRef(function({onClick:r,discover:a="render",prefetch:o="none",relative:v,reloadDocument:k,replace:E,unstable_mask:c,state:h,target:u,to:y,preventScrollReset:f,viewTransition:x,unstable_defaultShouldRevalidate:T,...O},C){let{basename:m,navigator:g,unstable_useTransitions:d}=I.useContext(ai),p=typeof y=="string"&&lp.test(y),S=W_(y,m);y=S.to;let A=hy(y,{relative:v}),R=ys(),M=null;if(c){let ee=wu(c,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);m!=="/"&&(ee.pathname=ee.pathname==="/"?m:yi([m,ee.pathname])),M=g.createHref(ee)}let[w,L,$]=Gy(o,O),F=sb(y,{replace:E,unstable_mask:c,state:h,target:u,preventScrollReset:f,relative:v,viewTransition:x,unstable_defaultShouldRevalidate:T,unstable_useTransitions:d});function K(ee){r&&r(ee),ee.defaultPrevented||F(ee)}let Z=!(S.isExternal||k),J=I.createElement("a",{...O,...$,href:(Z?M:void 0)||S.absoluteURL||A,onClick:Z?K:r,ref:Jy(C,L),target:u,"data-discover":!p&&a==="render"?"true":void 0});return w&&!p?I.createElement(I.Fragment,null,J,I.createElement(Yy,{page:A})):J});di.displayName="Link";var cp=I.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:o="",end:v=!1,style:k,to:E,viewTransition:c,children:h,...u},y){let f=qn(E,{relative:u.relative}),x=ys(),T=I.useContext(Ro),{navigator:O,basename:C}=I.useContext(ai),m=T!=null&&lb(f)&&c===!0,g=O.encodeLocation?O.encodeLocation(f).pathname:f.pathname,d=x.pathname,p=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;a||(d=d.toLowerCase(),p=p?p.toLowerCase():null,g=g.toLowerCase()),p&&C&&(p=Ii(p,C)||p);const S=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let A=d===g||!v&&d.startsWith(g)&&d.charAt(S)==="/",R=p!=null&&(p===g||!v&&p.startsWith(g)&&p.charAt(g.length)==="/"),M={isActive:A,isPending:R,isTransitioning:m},w=A?r:void 0,L;typeof o=="function"?L=o(M):L=[o,A?"active":null,R?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let $=typeof k=="function"?k(M):k;return I.createElement(di,{...u,"aria-current":w,className:L,ref:y,style:$,to:E,viewTransition:c},typeof h=="function"?h(M):h)});cp.displayName="NavLink";var tb=I.forwardRef(({discover:i="render",fetcherKey:r,navigate:a,reloadDocument:o,replace:v,state:k,method:E=bo,action:c,onSubmit:h,relative:u,preventScrollReset:y,viewTransition:f,unstable_defaultShouldRevalidate:x,...T},O)=>{let{unstable_useTransitions:C}=I.useContext(ai),m=ab(),g=ob(c,{relative:u}),d=E.toLowerCase()==="get"?"get":"post",p=typeof c=="string"&&lp.test(c),S=A=>{if(h&&h(A),A.defaultPrevented)return;A.preventDefault();let R=A.nativeEvent.submitter,M=(R==null?void 0:R.getAttribute("formmethod"))||E,w=()=>m(R||A.currentTarget,{fetcherKey:r,method:M,navigate:a,replace:v,state:k,relative:u,preventScrollReset:y,viewTransition:f,unstable_defaultShouldRevalidate:x});C&&a!==!1?I.startTransition(()=>w()):w()};return I.createElement("form",{ref:O,method:d,action:g,onSubmit:o?h:S,...T,"data-discover":!p&&i==="render"?"true":void 0})});tb.displayName="Form";function ib(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function up(i){let r=I.useContext(Ur);return tt(r,ib(i)),r}function sb(i,{target:r,replace:a,unstable_mask:o,state:v,preventScrollReset:k,relative:E,viewTransition:c,unstable_defaultShouldRevalidate:h,unstable_useTransitions:u}={}){let y=Do(),f=ys(),x=qn(i,{relative:E});return I.useCallback(T=>{if(jy(T,r)){T.preventDefault();let O=a!==void 0?a:In(f)===In(x),C=()=>y(i,{replace:O,unstable_mask:o,state:v,preventScrollReset:k,relative:E,viewTransition:c,unstable_defaultShouldRevalidate:h});u?I.startTransition(()=>C()):C()}},[f,y,x,a,o,v,r,i,k,E,c,h,u])}var rb=0,nb=()=>`__${String(++rb)}__`;function ab(){let{router:i}=up("useSubmit"),{basename:r}=I.useContext(ai),a=wy(),o=i.fetch,v=i.navigate;return I.useCallback(async(k,E={})=>{let{action:c,method:h,encType:u,formData:y,body:f}=Hy(k,r);if(E.navigate===!1){let x=E.fetcherKey||nb();await o(x,a,E.action||c,{unstable_defaultShouldRevalidate:E.unstable_defaultShouldRevalidate,preventScrollReset:E.preventScrollReset,formData:y,body:f,formMethod:E.method||h,formEncType:E.encType||u,flushSync:E.flushSync})}else await v(E.action||c,{unstable_defaultShouldRevalidate:E.unstable_defaultShouldRevalidate,preventScrollReset:E.preventScrollReset,formData:y,body:f,formMethod:E.method||h,formEncType:E.encType||u,replace:E.replace,state:E.state,fromRouteId:a,flushSync:E.flushSync,viewTransition:E.viewTransition})},[o,v,r,a])}function ob(i,{relative:r}={}){let{basename:a}=I.useContext(ai),o=I.useContext(fi);tt(o,"useFormAction must be used inside a RouteContext");let[v]=o.matches.slice(-1),k={...qn(i||".",{relative:r})},E=ys();if(i==null){k.search=E.search;let c=new URLSearchParams(k.search),h=c.getAll("index");if(h.some(y=>y==="")){c.delete("index"),h.filter(f=>f).forEach(f=>c.append("index",f));let y=c.toString();k.search=y?`?${y}`:""}}return(!i||i===".")&&v.route.index&&(k.search=k.search?k.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(k.pathname=k.pathname==="/"?a:yi([a,k.pathname])),In(k)}function lb(i,{relative:r}={}){let a=I.useContext(J_);tt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=up("useViewTransitionState"),v=qn(i,{relative:r});if(!a.isTransitioning)return!1;let k=Ii(a.currentLocation.pathname,o)||a.currentLocation.pathname,E=Ii(a.nextLocation.pathname,o)||a.nextLocation.pathname;return xo(v.pathname,E)!=null||xo(v.pathname,k)!=null}class cb extends I.Component{constructor(){super(...arguments);_t(this,"state",{hasError:!1,error:null});_t(this,"handleReload",()=>{this.setState({hasError:!1,error:null}),window.location.reload()})}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,o){console.error("[ErrorBoundary]",a,o.componentStack)}render(){var a;return this.state.hasError?b.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-center px-4",children:[b.jsx("div",{className:"text-6xl mb-4",children:"⚠"}),b.jsx("h1",{className:"text-lg text-[#e0e0e0] mb-2",children:"Something went wrong"}),b.jsx("p",{className:"text-sm text-[#555] mb-6 max-w-md",children:((a=this.state.error)==null?void 0:a.message)??"An unexpected error occurred."}),b.jsx("button",{onClick:this.handleReload,className:"px-4 py-2 text-sm font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors",children:"Reload"})]}):this.props.children}}/**
61
+ * @license lucide-react v0.474.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const ub=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hp=(...i)=>i.filter((r,a,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===a).join(" ").trim();/**
66
+ * @license lucide-react v0.474.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */var hb={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"};/**
71
+ * @license lucide-react v0.474.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const db=I.forwardRef(({color:i="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:v="",children:k,iconNode:E,...c},h)=>I.createElement("svg",{ref:h,...hb,width:r,height:r,stroke:i,strokeWidth:o?Number(a)*24/Number(r):a,className:hp("lucide",v),...c},[...E.map(([u,y])=>I.createElement(u,y)),...Array.isArray(k)?k:[k]]));/**
76
+ * @license lucide-react v0.474.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const Oe=(i,r)=>{const a=I.forwardRef(({className:o,...v},k)=>I.createElement(db,{ref:k,iconNode:r,className:hp(`lucide-${ub(i)}`,o),...v}));return a.displayName=`${i}`,a};/**
81
+ * @license lucide-react v0.474.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const fb=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],dp=Oe("Activity",fb);/**
86
+ * @license lucide-react v0.474.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const mb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],fp=Oe("Ban",mb);/**
91
+ * @license lucide-react v0.474.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const _b=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],mp=Oe("Camera",_b);/**
96
+ * @license lucide-react v0.474.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const pb=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],vb=Oe("ChevronLeft",pb);/**
101
+ * @license lucide-react v0.474.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const gb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],yb=Oe("ChevronRight",gb);/**
106
+ * @license lucide-react v0.474.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const bb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Du=Oe("CircleCheck",bb);/**
111
+ * @license lucide-react v0.474.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const Sb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],xb=Oe("CirclePlus",Sb);/**
116
+ * @license lucide-react v0.474.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const Cb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],jr=Oe("CircleX",Cb);/**
121
+ * @license lucide-react v0.474.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const wb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],fo=Oe("Clock",wb);/**
126
+ * @license lucide-react v0.474.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const Eb=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],kb=Oe("Copy",Eb);/**
131
+ * @license lucide-react v0.474.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const Tb=[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]],Ab=Oe("CornerDownLeft",Tb);/**
136
+ * @license lucide-react v0.474.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const Rb=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Db=Oe("EyeOff",Rb);/**
141
+ * @license lucide-react v0.474.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const Ob=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Mb=Oe("Eye",Ob);/**
146
+ * @license lucide-react v0.474.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const Nb=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],Lb=Oe("GitBranch",Nb);/**
151
+ * @license lucide-react v0.474.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const jb=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],_u=Oe("KeyRound",jb);/**
156
+ * @license lucide-react v0.474.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const Bb=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],i_=Oe("Layers",Bb);/**
161
+ * @license lucide-react v0.474.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const zb=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Hb=Oe("LayoutDashboard",zb);/**
166
+ * @license lucide-react v0.474.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const Ub=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],$n=Oe("LoaderCircle",Ub);/**
171
+ * @license lucide-react v0.474.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const $b=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],Ib=Oe("MessageSquare",$b);/**
176
+ * @license lucide-react v0.474.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const Pb=[["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]],Zb=Oe("Octagon",Pb);/**
181
+ * @license lucide-react v0.474.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const Fb=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],_p=Oe("Play",Fb);/**
186
+ * @license lucide-react v0.474.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const qb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Kn=Oe("Plus",qb);/**
191
+ * @license lucide-react v0.474.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const Kb=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],Vb=Oe("Power",Kb);/**
196
+ * @license lucide-react v0.474.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const Gb=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],pp=Oe("RefreshCw",Gb);/**
201
+ * @license lucide-react v0.474.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const Yb=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Wb=Oe("Search",Yb);/**
206
+ * @license lucide-react v0.474.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const Xb=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],pu=Oe("Send",Xb);/**
211
+ * @license lucide-react v0.474.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const Jb=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],s_=Oe("ShieldAlert",Jb);/**
216
+ * @license lucide-react v0.474.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const Qb=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],e1=Oe("ShieldCheck",Qb);/**
221
+ * @license lucide-react v0.474.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const t1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],i1=Oe("Shield",t1);/**
226
+ * @license lucide-react v0.474.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const s1=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],r1=Oe("Skull",s1);/**
231
+ * @license lucide-react v0.474.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const n1=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],a1=Oe("Terminal",n1);/**
236
+ * @license lucide-react v0.474.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const o1=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Ou=Oe("Trash2",o1);/**
241
+ * @license lucide-react v0.474.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const l1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Mu=Oe("TriangleAlert",l1);/**
246
+ * @license lucide-react v0.474.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const c1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]],u1=Oe("UserCheck",c1);/**
251
+ * @license lucide-react v0.474.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const h1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],d1=Oe("Users",h1);/**
256
+ * @license lucide-react v0.474.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const f1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vn=Oe("X",f1);/**
261
+ * @license lucide-react v0.474.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const m1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],_1=Oe("Zap",m1),r_=i=>{let r;const a=new Set,o=(u,y)=>{const f=typeof u=="function"?u(r):u;if(!Object.is(f,r)){const x=r;r=y??(typeof f!="object"||f===null)?f:Object.assign({},r,f),a.forEach(T=>T(r,x))}},v=()=>r,c={setState:o,getState:v,getInitialState:()=>h,subscribe:u=>(a.add(u),()=>a.delete(u))},h=r=i(o,v,c);return c},p1=(i=>i?r_(i):r_),v1=i=>i;function g1(i,r=v1){const a=Hn.useSyncExternalStore(i.subscribe,Hn.useCallback(()=>r(i.getState()),[i,r]),Hn.useCallback(()=>r(i.getInitialState()),[i,r]));return Hn.useDebugValue(a),a}const n_=i=>{const r=p1(i),a=o=>g1(r,o);return Object.assign(a,r),a},vp=(i=>i?n_(i):n_),et=vp(i=>({token:localStorage.getItem("aegis_token"),setToken:r=>{localStorage.setItem("aegis_token",r),i({token:r})},clearToken:()=>{localStorage.removeItem("aegis_token"),i({token:null})},sessions:[],setSessions:r=>i({sessions:r}),healthMap:{},setSessionsAndHealth:(r,a)=>i({sessions:r,healthMap:a}),metrics:null,setMetrics:r=>i({metrics:r}),sseConnected:!1,setSseConnected:r=>i({sseConnected:r}),sseError:null,setSseError:r=>i({sseError:r}),activities:[],addActivity:r=>i(a=>({activities:[r,...a.activities].slice(0,200)})),clearActivities:()=>i({activities:[]}),activityFilterSession:null,setActivityFilterSession:r=>i({activityFilterSession:r}),activityFilterType:null,setActivityFilterType:r=>i({activityFilterType:r})}));function de(i,r,a){function o(c,h){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:h,constr:E,traits:new Set},enumerable:!1}),c._zod.traits.has(i))return;c._zod.traits.add(i),r(c,h);const u=E.prototype,y=Object.keys(u);for(let f=0;f<y.length;f++){const x=y[f];x in c||(c[x]=u[x].bind(c))}}const v=(a==null?void 0:a.Parent)??Object;class k extends v{}Object.defineProperty(k,"name",{value:i});function E(c){var h;const u=a!=null&&a.Parent?new k:this;o(u,c),(h=u._zod).deferred??(h.deferred=[]);for(const y of u._zod.deferred)y();return u}return Object.defineProperty(E,"init",{value:o}),Object.defineProperty(E,Symbol.hasInstance,{value:c=>{var h,u;return a!=null&&a.Parent&&c instanceof a.Parent?!0:(u=(h=c==null?void 0:c._zod)==null?void 0:h.traits)==null?void 0:u.has(i)}}),Object.defineProperty(E,"name",{value:i}),E}class Lr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gp extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const yp={};function vs(i){return yp}function bp(i){const r=Object.values(i).filter(o=>typeof o=="number");return Object.entries(i).filter(([o,v])=>r.indexOf(+o)===-1).map(([o,v])=>v)}function vu(i,r){return typeof r=="bigint"?r.toString():r}function Nu(i){return{get value(){{const r=i();return Object.defineProperty(this,"value",{value:r}),r}}}}function Lu(i){return i==null}function ju(i){const r=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;return i.slice(r,a)}function y1(i,r){const a=(i.toString().split(".")[1]||"").length,o=r.toString();let v=(o.split(".")[1]||"").length;if(v===0&&/\d?e-\d?/.test(o)){const h=o.match(/\d?e-(\d?)/);h!=null&&h[1]&&(v=Number.parseInt(h[1]))}const k=a>v?a:v,E=Number.parseInt(i.toFixed(k).replace(".","")),c=Number.parseInt(r.toFixed(k).replace(".",""));return E%c/10**k}const a_=Symbol("evaluating");function Pe(i,r,a){let o;Object.defineProperty(i,r,{get(){if(o!==a_)return o===void 0&&(o=a_,o=a()),o},set(v){Object.defineProperty(i,r,{value:v})},configurable:!0})}function Fs(i,r,a){Object.defineProperty(i,r,{value:a,writable:!0,enumerable:!0,configurable:!0})}function bs(...i){const r={};for(const a of i){const o=Object.getOwnPropertyDescriptors(a);Object.assign(r,o)}return Object.defineProperties({},r)}function o_(i){return JSON.stringify(i)}function b1(i){return i.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Sp="captureStackTrace"in Error?Error.captureStackTrace:(...i)=>{};function Co(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}const S1=Nu(()=>{var i;if(typeof navigator<"u"&&((i=navigator==null?void 0:navigator.userAgent)!=null&&i.includes("Cloudflare")))return!1;try{const r=Function;return new r(""),!0}catch{return!1}});function Br(i){if(Co(i)===!1)return!1;const r=i.constructor;if(r===void 0||typeof r!="function")return!0;const a=r.prototype;return!(Co(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function xp(i){return Br(i)?{...i}:Array.isArray(i)?[...i]:i}const x1=new Set(["string","number","symbol"]);function Mo(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ss(i,r,a){const o=new i._zod.constr(r??i._zod.def);return(!r||a!=null&&a.parent)&&(o._zod.parent=i),o}function be(i){const r=i;if(!r)return{};if(typeof r=="string")return{error:()=>r};if((r==null?void 0:r.message)!==void 0){if((r==null?void 0:r.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function C1(i){return Object.keys(i).filter(r=>i[r]._zod.optin==="optional"&&i[r]._zod.optout==="optional")}const w1={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function E1(i,r){const a=i._zod.def,o=a.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const k=bs(i._zod.def,{get shape(){const E={};for(const c in r){if(!(c in a.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(E[c]=a.shape[c])}return Fs(this,"shape",E),E},checks:[]});return Ss(i,k)}function k1(i,r){const a=i._zod.def,o=a.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const k=bs(i._zod.def,{get shape(){const E={...i._zod.def.shape};for(const c in r){if(!(c in a.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&delete E[c]}return Fs(this,"shape",E),E},checks:[]});return Ss(i,k)}function T1(i,r){if(!Br(r))throw new Error("Invalid input to extend: expected a plain object");const a=i._zod.def.checks;if(a&&a.length>0){const k=i._zod.def.shape;for(const E in r)if(Object.getOwnPropertyDescriptor(k,E)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const v=bs(i._zod.def,{get shape(){const k={...i._zod.def.shape,...r};return Fs(this,"shape",k),k}});return Ss(i,v)}function A1(i,r){if(!Br(r))throw new Error("Invalid input to safeExtend: expected a plain object");const a=bs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r};return Fs(this,"shape",o),o}});return Ss(i,a)}function R1(i,r){const a=bs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r._zod.def.shape};return Fs(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:[]});return Ss(i,a)}function D1(i,r,a){const v=r._zod.def.checks;if(v&&v.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const E=bs(r._zod.def,{get shape(){const c=r._zod.def.shape,h={...c};if(a)for(const u in a){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);a[u]&&(h[u]=i?new i({type:"optional",innerType:c[u]}):c[u])}else for(const u in c)h[u]=i?new i({type:"optional",innerType:c[u]}):c[u];return Fs(this,"shape",h),h},checks:[]});return Ss(r,E)}function O1(i,r,a){const o=bs(r._zod.def,{get shape(){const v=r._zod.def.shape,k={...v};if(a)for(const E in a){if(!(E in k))throw new Error(`Unrecognized key: "${E}"`);a[E]&&(k[E]=new i({type:"nonoptional",innerType:v[E]}))}else for(const E in v)k[E]=new i({type:"nonoptional",innerType:v[E]});return Fs(this,"shape",k),k}});return Ss(r,o)}function Mr(i,r=0){var a;if(i.aborted===!0)return!0;for(let o=r;o<i.issues.length;o++)if(((a=i.issues[o])==null?void 0:a.continue)!==!0)return!0;return!1}function Nr(i,r){return r.map(a=>{var o;return(o=a).path??(o.path=[]),a.path.unshift(i),a})}function mo(i){return typeof i=="string"?i:i==null?void 0:i.message}function gs(i,r,a){var v,k,E,c,h,u;const o={...i,path:i.path??[]};if(!i.message){const y=mo((E=(k=(v=i.inst)==null?void 0:v._zod.def)==null?void 0:k.error)==null?void 0:E.call(k,i))??mo((c=r==null?void 0:r.error)==null?void 0:c.call(r,i))??mo((h=a.customError)==null?void 0:h.call(a,i))??mo((u=a.localeError)==null?void 0:u.call(a,i))??"Invalid input";o.message=y}return delete o.inst,delete o.continue,r!=null&&r.reportInput||delete o.input,o}function Bu(i){return Array.isArray(i)?"array":typeof i=="string"?"string":"unknown"}function Pn(...i){const[r,a,o]=i;return typeof r=="string"?{message:r,code:"custom",input:a,inst:o}:{...r}}const Cp=(i,r)=>{i.name="$ZodError",Object.defineProperty(i,"_zod",{value:i._zod,enumerable:!1}),Object.defineProperty(i,"issues",{value:r,enumerable:!1}),i.message=JSON.stringify(r,vu,2),Object.defineProperty(i,"toString",{value:()=>i.message,enumerable:!1})},wp=de("$ZodError",Cp),Ep=de("$ZodError",Cp,{Parent:Error});function M1(i,r=a=>a.message){const a={},o=[];for(const v of i.issues)v.path.length>0?(a[v.path[0]]=a[v.path[0]]||[],a[v.path[0]].push(r(v))):o.push(r(v));return{formErrors:o,fieldErrors:a}}function N1(i,r=a=>a.message){const a={_errors:[]},o=v=>{for(const k of v.issues)if(k.code==="invalid_union"&&k.errors.length)k.errors.map(E=>o({issues:E}));else if(k.code==="invalid_key")o({issues:k.issues});else if(k.code==="invalid_element")o({issues:k.issues});else if(k.path.length===0)a._errors.push(r(k));else{let E=a,c=0;for(;c<k.path.length;){const h=k.path[c];c===k.path.length-1?(E[h]=E[h]||{_errors:[]},E[h]._errors.push(r(k))):E[h]=E[h]||{_errors:[]},E=E[h],c++}}};return o(i),a}const zu=i=>(r,a,o,v)=>{const k=o?Object.assign(o,{async:!1}):{async:!1},E=r._zod.run({value:a,issues:[]},k);if(E instanceof Promise)throw new Lr;if(E.issues.length){const c=new((v==null?void 0:v.Err)??i)(E.issues.map(h=>gs(h,k,vs())));throw Sp(c,v==null?void 0:v.callee),c}return E.value},Hu=i=>async(r,a,o,v)=>{const k=o?Object.assign(o,{async:!0}):{async:!0};let E=r._zod.run({value:a,issues:[]},k);if(E instanceof Promise&&(E=await E),E.issues.length){const c=new((v==null?void 0:v.Err)??i)(E.issues.map(h=>gs(h,k,vs())));throw Sp(c,v==null?void 0:v.callee),c}return E.value},No=i=>(r,a,o)=>{const v=o?{...o,async:!1}:{async:!1},k=r._zod.run({value:a,issues:[]},v);if(k instanceof Promise)throw new Lr;return k.issues.length?{success:!1,error:new(i??wp)(k.issues.map(E=>gs(E,v,vs())))}:{success:!0,data:k.value}},L1=No(Ep),Lo=i=>async(r,a,o)=>{const v=o?Object.assign(o,{async:!0}):{async:!0};let k=r._zod.run({value:a,issues:[]},v);return k instanceof Promise&&(k=await k),k.issues.length?{success:!1,error:new i(k.issues.map(E=>gs(E,v,vs())))}:{success:!0,data:k.value}},j1=Lo(Ep),B1=i=>(r,a,o)=>{const v=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return zu(i)(r,a,v)},z1=i=>(r,a,o)=>zu(i)(r,a,o),H1=i=>async(r,a,o)=>{const v=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Hu(i)(r,a,v)},U1=i=>async(r,a,o)=>Hu(i)(r,a,o),$1=i=>(r,a,o)=>{const v=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return No(i)(r,a,v)},I1=i=>(r,a,o)=>No(i)(r,a,o),P1=i=>async(r,a,o)=>{const v=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Lo(i)(r,a,v)},Z1=i=>async(r,a,o)=>Lo(i)(r,a,o),F1=/^[cC][^\s-]{8,}$/,q1=/^[0-9a-z]+$/,K1=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,V1=/^[0-9a-vA-V]{20}$/,G1=/^[A-Za-z0-9]{27}$/,Y1=/^[a-zA-Z0-9_-]{21}$/,W1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,X1=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,l_=i=>i?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${i}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,J1=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Q1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function eS(){return new RegExp(Q1,"u")}const tS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,iS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,sS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,rS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kp=/^[A-Za-z0-9_-]*$/,aS=/^\+[1-9]\d{6,14}$/,Tp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",oS=new RegExp(`^${Tp}$`);function Ap(i){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof i.precision=="number"?i.precision===-1?`${r}`:i.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${i.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function lS(i){return new RegExp(`^${Ap(i)}$`)}function cS(i){const r=Ap({precision:i.precision}),a=["Z"];i.local&&a.push(""),i.offset&&a.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${r}(?:${a.join("|")})`;return new RegExp(`^${Tp}T(?:${o})$`)}const uS=i=>{const r=i?`[\\s\\S]{${(i==null?void 0:i.minimum)??0},${(i==null?void 0:i.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},hS=/^-?\d+$/,Rp=/^-?\d+(?:\.\d+)?$/,dS=/^(?:true|false)$/i,fS=/^[^A-Z]*$/,mS=/^[^a-z]*$/,Ht=de("$ZodCheck",(i,r)=>{var a;i._zod??(i._zod={}),i._zod.def=r,(a=i._zod).onattach??(a.onattach=[])}),Dp={number:"number",bigint:"bigint",object:"date"},Op=de("$ZodCheckLessThan",(i,r)=>{Ht.init(i,r);const a=Dp[typeof r.value];i._zod.onattach.push(o=>{const v=o._zod.bag,k=(r.inclusive?v.maximum:v.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<k&&(r.inclusive?v.maximum=r.value:v.exclusiveMaximum=r.value)}),i._zod.check=o=>{(r.inclusive?o.value<=r.value:o.value<r.value)||o.issues.push({origin:a,code:"too_big",maximum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:i,continue:!r.abort})}}),Mp=de("$ZodCheckGreaterThan",(i,r)=>{Ht.init(i,r);const a=Dp[typeof r.value];i._zod.onattach.push(o=>{const v=o._zod.bag,k=(r.inclusive?v.minimum:v.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>k&&(r.inclusive?v.minimum=r.value:v.exclusiveMinimum=r.value)}),i._zod.check=o=>{(r.inclusive?o.value>=r.value:o.value>r.value)||o.issues.push({origin:a,code:"too_small",minimum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:i,continue:!r.abort})}}),_S=de("$ZodCheckMultipleOf",(i,r)=>{Ht.init(i,r),i._zod.onattach.push(a=>{var o;(o=a._zod.bag).multipleOf??(o.multipleOf=r.value)}),i._zod.check=a=>{if(typeof a.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof a.value=="bigint"?a.value%r.value===BigInt(0):y1(a.value,r.value)===0)||a.issues.push({origin:typeof a.value,code:"not_multiple_of",divisor:r.value,input:a.value,inst:i,continue:!r.abort})}}),pS=de("$ZodCheckNumberFormat",(i,r)=>{var E;Ht.init(i,r),r.format=r.format||"float64";const a=(E=r.format)==null?void 0:E.includes("int"),o=a?"int":"number",[v,k]=w1[r.format];i._zod.onattach.push(c=>{const h=c._zod.bag;h.format=r.format,h.minimum=v,h.maximum=k,a&&(h.pattern=hS)}),i._zod.check=c=>{const h=c.value;if(a){if(!Number.isInteger(h)){c.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:h,inst:i});return}if(!Number.isSafeInteger(h)){h>0?c.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:o,inclusive:!0,continue:!r.abort}):c.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:o,inclusive:!0,continue:!r.abort});return}}h<v&&c.issues.push({origin:"number",input:h,code:"too_small",minimum:v,inclusive:!0,inst:i,continue:!r.abort}),h>k&&c.issues.push({origin:"number",input:h,code:"too_big",maximum:k,inclusive:!0,inst:i,continue:!r.abort})}}),vS=de("$ZodCheckMaxLength",(i,r)=>{var a;Ht.init(i,r),(a=i._zod.def).when??(a.when=o=>{const v=o.value;return!Lu(v)&&v.length!==void 0}),i._zod.onattach.push(o=>{const v=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<v&&(o._zod.bag.maximum=r.maximum)}),i._zod.check=o=>{const v=o.value;if(v.length<=r.maximum)return;const E=Bu(v);o.issues.push({origin:E,code:"too_big",maximum:r.maximum,inclusive:!0,input:v,inst:i,continue:!r.abort})}}),gS=de("$ZodCheckMinLength",(i,r)=>{var a;Ht.init(i,r),(a=i._zod.def).when??(a.when=o=>{const v=o.value;return!Lu(v)&&v.length!==void 0}),i._zod.onattach.push(o=>{const v=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>v&&(o._zod.bag.minimum=r.minimum)}),i._zod.check=o=>{const v=o.value;if(v.length>=r.minimum)return;const E=Bu(v);o.issues.push({origin:E,code:"too_small",minimum:r.minimum,inclusive:!0,input:v,inst:i,continue:!r.abort})}}),yS=de("$ZodCheckLengthEquals",(i,r)=>{var a;Ht.init(i,r),(a=i._zod.def).when??(a.when=o=>{const v=o.value;return!Lu(v)&&v.length!==void 0}),i._zod.onattach.push(o=>{const v=o._zod.bag;v.minimum=r.length,v.maximum=r.length,v.length=r.length}),i._zod.check=o=>{const v=o.value,k=v.length;if(k===r.length)return;const E=Bu(v),c=k>r.length;o.issues.push({origin:E,...c?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:i,continue:!r.abort})}}),jo=de("$ZodCheckStringFormat",(i,r)=>{var a,o;Ht.init(i,r),i._zod.onattach.push(v=>{const k=v._zod.bag;k.format=r.format,r.pattern&&(k.patterns??(k.patterns=new Set),k.patterns.add(r.pattern))}),r.pattern?(a=i._zod).check??(a.check=v=>{r.pattern.lastIndex=0,!r.pattern.test(v.value)&&v.issues.push({origin:"string",code:"invalid_format",format:r.format,input:v.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:i,continue:!r.abort})}):(o=i._zod).check??(o.check=()=>{})}),bS=de("$ZodCheckRegex",(i,r)=>{jo.init(i,r),i._zod.check=a=>{r.pattern.lastIndex=0,!r.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:r.pattern.toString(),inst:i,continue:!r.abort})}}),SS=de("$ZodCheckLowerCase",(i,r)=>{r.pattern??(r.pattern=fS),jo.init(i,r)}),xS=de("$ZodCheckUpperCase",(i,r)=>{r.pattern??(r.pattern=mS),jo.init(i,r)}),CS=de("$ZodCheckIncludes",(i,r)=>{Ht.init(i,r);const a=Mo(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position}}${a}`:a);r.pattern=o,i._zod.onattach.push(v=>{const k=v._zod.bag;k.patterns??(k.patterns=new Set),k.patterns.add(o)}),i._zod.check=v=>{v.value.includes(r.includes,r.position)||v.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:v.value,inst:i,continue:!r.abort})}}),wS=de("$ZodCheckStartsWith",(i,r)=>{Ht.init(i,r);const a=new RegExp(`^${Mo(r.prefix)}.*`);r.pattern??(r.pattern=a),i._zod.onattach.push(o=>{const v=o._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(a)}),i._zod.check=o=>{o.value.startsWith(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:i,continue:!r.abort})}}),ES=de("$ZodCheckEndsWith",(i,r)=>{Ht.init(i,r);const a=new RegExp(`.*${Mo(r.suffix)}$`);r.pattern??(r.pattern=a),i._zod.onattach.push(o=>{const v=o._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(a)}),i._zod.check=o=>{o.value.endsWith(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:i,continue:!r.abort})}}),kS=de("$ZodCheckOverwrite",(i,r)=>{Ht.init(i,r),i._zod.check=a=>{a.value=r.tx(a.value)}});class TS{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const o=r.split(`
266
+ `).filter(E=>E),v=Math.min(...o.map(E=>E.length-E.trimStart().length)),k=o.map(E=>E.slice(v)).map(E=>" ".repeat(this.indent*2)+E);for(const E of k)this.content.push(E)}compile(){const r=Function,a=this==null?void 0:this.args,v=[...((this==null?void 0:this.content)??[""]).map(k=>` ${k}`)];return new r(...a,v.join(`
267
+ `))}}const AS={major:4,minor:3,patch:6},nt=de("$ZodType",(i,r)=>{var v;var a;i??(i={}),i._zod.def=r,i._zod.bag=i._zod.bag||{},i._zod.version=AS;const o=[...i._zod.def.checks??[]];i._zod.traits.has("$ZodCheck")&&o.unshift(i);for(const k of o)for(const E of k._zod.onattach)E(i);if(o.length===0)(a=i._zod).deferred??(a.deferred=[]),(v=i._zod.deferred)==null||v.push(()=>{i._zod.run=i._zod.parse});else{const k=(c,h,u)=>{let y=Mr(c),f;for(const x of h){if(x._zod.def.when){if(!x._zod.def.when(c))continue}else if(y)continue;const T=c.issues.length,O=x._zod.check(c);if(O instanceof Promise&&(u==null?void 0:u.async)===!1)throw new Lr;if(f||O instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await O,c.issues.length!==T&&(y||(y=Mr(c,T)))});else{if(c.issues.length===T)continue;y||(y=Mr(c,T))}}return f?f.then(()=>c):c},E=(c,h,u)=>{if(Mr(c))return c.aborted=!0,c;const y=k(h,o,u);if(y instanceof Promise){if(u.async===!1)throw new Lr;return y.then(f=>i._zod.parse(f,u))}return i._zod.parse(y,u)};i._zod.run=(c,h)=>{if(h.skipChecks)return i._zod.parse(c,h);if(h.direction==="backward"){const y=i._zod.parse({value:c.value,issues:[]},{...h,skipChecks:!0});return y instanceof Promise?y.then(f=>E(f,c,h)):E(y,c,h)}const u=i._zod.parse(c,h);if(u instanceof Promise){if(h.async===!1)throw new Lr;return u.then(y=>k(y,o,h))}return k(u,o,h)}}Pe(i,"~standard",()=>({validate:k=>{var E;try{const c=L1(i,k);return c.success?{value:c.data}:{issues:(E=c.error)==null?void 0:E.issues}}catch{return j1(i,k).then(h=>{var u;return h.success?{value:h.data}:{issues:(u=h.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),Uu=de("$ZodString",(i,r)=>{var a;nt.init(i,r),i._zod.pattern=[...((a=i==null?void 0:i._zod.bag)==null?void 0:a.patterns)??[]].pop()??uS(i._zod.bag),i._zod.parse=(o,v)=>{if(r.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:i}),o}}),Qe=de("$ZodStringFormat",(i,r)=>{jo.init(i,r),Uu.init(i,r)}),RS=de("$ZodGUID",(i,r)=>{r.pattern??(r.pattern=X1),Qe.init(i,r)}),DS=de("$ZodUUID",(i,r)=>{if(r.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(o===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=l_(o))}else r.pattern??(r.pattern=l_());Qe.init(i,r)}),OS=de("$ZodEmail",(i,r)=>{r.pattern??(r.pattern=J1),Qe.init(i,r)}),MS=de("$ZodURL",(i,r)=>{Qe.init(i,r),i._zod.check=a=>{try{const o=a.value.trim(),v=new URL(o);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(v.hostname)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:a.value,inst:i,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(v.protocol.endsWith(":")?v.protocol.slice(0,-1):v.protocol)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:a.value,inst:i,continue:!r.abort})),r.normalize?a.value=v.href:a.value=o;return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:i,continue:!r.abort})}}}),NS=de("$ZodEmoji",(i,r)=>{r.pattern??(r.pattern=eS()),Qe.init(i,r)}),LS=de("$ZodNanoID",(i,r)=>{r.pattern??(r.pattern=Y1),Qe.init(i,r)}),jS=de("$ZodCUID",(i,r)=>{r.pattern??(r.pattern=F1),Qe.init(i,r)}),BS=de("$ZodCUID2",(i,r)=>{r.pattern??(r.pattern=q1),Qe.init(i,r)}),zS=de("$ZodULID",(i,r)=>{r.pattern??(r.pattern=K1),Qe.init(i,r)}),HS=de("$ZodXID",(i,r)=>{r.pattern??(r.pattern=V1),Qe.init(i,r)}),US=de("$ZodKSUID",(i,r)=>{r.pattern??(r.pattern=G1),Qe.init(i,r)}),$S=de("$ZodISODateTime",(i,r)=>{r.pattern??(r.pattern=cS(r)),Qe.init(i,r)}),IS=de("$ZodISODate",(i,r)=>{r.pattern??(r.pattern=oS),Qe.init(i,r)}),PS=de("$ZodISOTime",(i,r)=>{r.pattern??(r.pattern=lS(r)),Qe.init(i,r)}),ZS=de("$ZodISODuration",(i,r)=>{r.pattern??(r.pattern=W1),Qe.init(i,r)}),FS=de("$ZodIPv4",(i,r)=>{r.pattern??(r.pattern=tS),Qe.init(i,r),i._zod.bag.format="ipv4"}),qS=de("$ZodIPv6",(i,r)=>{r.pattern??(r.pattern=iS),Qe.init(i,r),i._zod.bag.format="ipv6",i._zod.check=a=>{try{new URL(`http://[${a.value}]`)}catch{a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:i,continue:!r.abort})}}}),KS=de("$ZodCIDRv4",(i,r)=>{r.pattern??(r.pattern=sS),Qe.init(i,r)}),VS=de("$ZodCIDRv6",(i,r)=>{r.pattern??(r.pattern=rS),Qe.init(i,r),i._zod.check=a=>{const o=a.value.split("/");try{if(o.length!==2)throw new Error;const[v,k]=o;if(!k)throw new Error;const E=Number(k);if(`${E}`!==k)throw new Error;if(E<0||E>128)throw new Error;new URL(`http://[${v}]`)}catch{a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:i,continue:!r.abort})}}});function Np(i){if(i==="")return!0;if(i.length%4!==0)return!1;try{return atob(i),!0}catch{return!1}}const GS=de("$ZodBase64",(i,r)=>{r.pattern??(r.pattern=nS),Qe.init(i,r),i._zod.bag.contentEncoding="base64",i._zod.check=a=>{Np(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:i,continue:!r.abort})}});function YS(i){if(!kp.test(i))return!1;const r=i.replace(/[-_]/g,o=>o==="-"?"+":"/"),a=r.padEnd(Math.ceil(r.length/4)*4,"=");return Np(a)}const WS=de("$ZodBase64URL",(i,r)=>{r.pattern??(r.pattern=kp),Qe.init(i,r),i._zod.bag.contentEncoding="base64url",i._zod.check=a=>{YS(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:i,continue:!r.abort})}}),XS=de("$ZodE164",(i,r)=>{r.pattern??(r.pattern=aS),Qe.init(i,r)});function JS(i,r=null){try{const a=i.split(".");if(a.length!==3)return!1;const[o]=a;if(!o)return!1;const v=JSON.parse(atob(o));return!("typ"in v&&(v==null?void 0:v.typ)!=="JWT"||!v.alg||r&&(!("alg"in v)||v.alg!==r))}catch{return!1}}const QS=de("$ZodJWT",(i,r)=>{Qe.init(i,r),i._zod.check=a=>{JS(a.value,r.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:i,continue:!r.abort})}}),Lp=de("$ZodNumber",(i,r)=>{nt.init(i,r),i._zod.pattern=i._zod.bag.pattern??Rp,i._zod.parse=(a,o)=>{if(r.coerce)try{a.value=Number(a.value)}catch{}const v=a.value;if(typeof v=="number"&&!Number.isNaN(v)&&Number.isFinite(v))return a;const k=typeof v=="number"?Number.isNaN(v)?"NaN":Number.isFinite(v)?void 0:"Infinity":void 0;return a.issues.push({expected:"number",code:"invalid_type",input:v,inst:i,...k?{received:k}:{}}),a}}),ex=de("$ZodNumberFormat",(i,r)=>{pS.init(i,r),Lp.init(i,r)}),tx=de("$ZodBoolean",(i,r)=>{nt.init(i,r),i._zod.pattern=dS,i._zod.parse=(a,o)=>{if(r.coerce)try{a.value=!!a.value}catch{}const v=a.value;return typeof v=="boolean"||a.issues.push({expected:"boolean",code:"invalid_type",input:v,inst:i}),a}}),ix=de("$ZodUnknown",(i,r)=>{nt.init(i,r),i._zod.parse=a=>a}),sx=de("$ZodNever",(i,r)=>{nt.init(i,r),i._zod.parse=(a,o)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:i}),a)});function c_(i,r,a){i.issues.length&&r.issues.push(...Nr(a,i.issues)),r.value[a]=i.value}const rx=de("$ZodArray",(i,r)=>{nt.init(i,r),i._zod.parse=(a,o)=>{const v=a.value;if(!Array.isArray(v))return a.issues.push({expected:"array",code:"invalid_type",input:v,inst:i}),a;a.value=Array(v.length);const k=[];for(let E=0;E<v.length;E++){const c=v[E],h=r.element._zod.run({value:c,issues:[]},o);h instanceof Promise?k.push(h.then(u=>c_(u,a,E))):c_(h,a,E)}return k.length?Promise.all(k).then(()=>a):a}});function wo(i,r,a,o,v){if(i.issues.length){if(v&&!(a in o))return;r.issues.push(...Nr(a,i.issues))}i.value===void 0?a in o&&(r.value[a]=void 0):r.value[a]=i.value}function jp(i){var o,v,k,E;const r=Object.keys(i.shape);for(const c of r)if(!((E=(k=(v=(o=i.shape)==null?void 0:o[c])==null?void 0:v._zod)==null?void 0:k.traits)!=null&&E.has("$ZodType")))throw new Error(`Invalid element at key "${c}": expected a Zod schema`);const a=C1(i.shape);return{...i,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(a)}}function Bp(i,r,a,o,v,k){const E=[],c=v.keySet,h=v.catchall._zod,u=h.def.type,y=h.optout==="optional";for(const f in r){if(c.has(f))continue;if(u==="never"){E.push(f);continue}const x=h.run({value:r[f],issues:[]},o);x instanceof Promise?i.push(x.then(T=>wo(T,a,f,r,y))):wo(x,a,f,r,y)}return E.length&&a.issues.push({code:"unrecognized_keys",keys:E,input:r,inst:k}),i.length?Promise.all(i).then(()=>a):a}const nx=de("$ZodObject",(i,r)=>{nt.init(i,r);const a=Object.getOwnPropertyDescriptor(r,"shape");if(!(a!=null&&a.get)){const c=r.shape;Object.defineProperty(r,"shape",{get:()=>{const h={...c};return Object.defineProperty(r,"shape",{value:h}),h}})}const o=Nu(()=>jp(r));Pe(i._zod,"propValues",()=>{const c=r.shape,h={};for(const u in c){const y=c[u]._zod;if(y.values){h[u]??(h[u]=new Set);for(const f of y.values)h[u].add(f)}}return h});const v=Co,k=r.catchall;let E;i._zod.parse=(c,h)=>{E??(E=o.value);const u=c.value;if(!v(u))return c.issues.push({expected:"object",code:"invalid_type",input:u,inst:i}),c;c.value={};const y=[],f=E.shape;for(const x of E.keys){const T=f[x],O=T._zod.optout==="optional",C=T._zod.run({value:u[x],issues:[]},h);C instanceof Promise?y.push(C.then(m=>wo(m,c,x,u,O))):wo(C,c,x,u,O)}return k?Bp(y,u,c,h,o.value,i):y.length?Promise.all(y).then(()=>c):c}}),ax=de("$ZodObjectJIT",(i,r)=>{nx.init(i,r);const a=i._zod.parse,o=Nu(()=>jp(r)),v=x=>{var p;const T=new TS(["shape","payload","ctx"]),O=o.value,C=S=>{const A=o_(S);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};T.write("const input = payload.value;");const m=Object.create(null);let g=0;for(const S of O.keys)m[S]=`key_${g++}`;T.write("const newResult = {};");for(const S of O.keys){const A=m[S],R=o_(S),M=x[S],w=((p=M==null?void 0:M._zod)==null?void 0:p.optout)==="optional";T.write(`const ${A} = ${C(S)};`),w?T.write(`
268
+ if (${A}.issues.length) {
269
+ if (${R} in input) {
270
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
271
+ ...iss,
272
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
273
+ })));
274
+ }
275
+ }
276
+
277
+ if (${A}.value === undefined) {
278
+ if (${R} in input) {
279
+ newResult[${R}] = undefined;
280
+ }
281
+ } else {
282
+ newResult[${R}] = ${A}.value;
283
+ }
284
+
285
+ `):T.write(`
286
+ if (${A}.issues.length) {
287
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
288
+ ...iss,
289
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
290
+ })));
291
+ }
292
+
293
+ if (${A}.value === undefined) {
294
+ if (${R} in input) {
295
+ newResult[${R}] = undefined;
296
+ }
297
+ } else {
298
+ newResult[${R}] = ${A}.value;
299
+ }
300
+
301
+ `)}T.write("payload.value = newResult;"),T.write("return payload;");const d=T.compile();return(S,A)=>d(x,S,A)};let k;const E=Co,c=!yp.jitless,u=c&&S1.value,y=r.catchall;let f;i._zod.parse=(x,T)=>{f??(f=o.value);const O=x.value;return E(O)?c&&u&&(T==null?void 0:T.async)===!1&&T.jitless!==!0?(k||(k=v(r.shape)),x=k(x,T),y?Bp([],O,x,T,f,i):x):a(x,T):(x.issues.push({expected:"object",code:"invalid_type",input:O,inst:i}),x)}});function u_(i,r,a,o){for(const k of i)if(k.issues.length===0)return r.value=k.value,r;const v=i.filter(k=>!Mr(k));return v.length===1?(r.value=v[0].value,v[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:a,errors:i.map(k=>k.issues.map(E=>gs(E,o,vs())))}),r)}const ox=de("$ZodUnion",(i,r)=>{nt.init(i,r),Pe(i._zod,"optin",()=>r.options.some(v=>v._zod.optin==="optional")?"optional":void 0),Pe(i._zod,"optout",()=>r.options.some(v=>v._zod.optout==="optional")?"optional":void 0),Pe(i._zod,"values",()=>{if(r.options.every(v=>v._zod.values))return new Set(r.options.flatMap(v=>Array.from(v._zod.values)))}),Pe(i._zod,"pattern",()=>{if(r.options.every(v=>v._zod.pattern)){const v=r.options.map(k=>k._zod.pattern);return new RegExp(`^(${v.map(k=>ju(k.source)).join("|")})$`)}});const a=r.options.length===1,o=r.options[0]._zod.run;i._zod.parse=(v,k)=>{if(a)return o(v,k);let E=!1;const c=[];for(const h of r.options){const u=h._zod.run({value:v.value,issues:[]},k);if(u instanceof Promise)c.push(u),E=!0;else{if(u.issues.length===0)return u;c.push(u)}}return E?Promise.all(c).then(h=>u_(h,v,i,k)):u_(c,v,i,k)}}),lx=de("$ZodIntersection",(i,r)=>{nt.init(i,r),i._zod.parse=(a,o)=>{const v=a.value,k=r.left._zod.run({value:v,issues:[]},o),E=r.right._zod.run({value:v,issues:[]},o);return k instanceof Promise||E instanceof Promise?Promise.all([k,E]).then(([h,u])=>h_(a,h,u)):h_(a,k,E)}});function gu(i,r){if(i===r)return{valid:!0,data:i};if(i instanceof Date&&r instanceof Date&&+i==+r)return{valid:!0,data:i};if(Br(i)&&Br(r)){const a=Object.keys(r),o=Object.keys(i).filter(k=>a.indexOf(k)!==-1),v={...i,...r};for(const k of o){const E=gu(i[k],r[k]);if(!E.valid)return{valid:!1,mergeErrorPath:[k,...E.mergeErrorPath]};v[k]=E.data}return{valid:!0,data:v}}if(Array.isArray(i)&&Array.isArray(r)){if(i.length!==r.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let o=0;o<i.length;o++){const v=i[o],k=r[o],E=gu(v,k);if(!E.valid)return{valid:!1,mergeErrorPath:[o,...E.mergeErrorPath]};a.push(E.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function h_(i,r,a){const o=new Map;let v;for(const c of r.issues)if(c.code==="unrecognized_keys"){v??(v=c);for(const h of c.keys)o.has(h)||o.set(h,{}),o.get(h).l=!0}else i.issues.push(c);for(const c of a.issues)if(c.code==="unrecognized_keys")for(const h of c.keys)o.has(h)||o.set(h,{}),o.get(h).r=!0;else i.issues.push(c);const k=[...o].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(k.length&&v&&i.issues.push({...v,keys:k}),Mr(i))return i;const E=gu(r.value,a.value);if(!E.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(E.mergeErrorPath)}`);return i.value=E.data,i}const cx=de("$ZodRecord",(i,r)=>{nt.init(i,r),i._zod.parse=(a,o)=>{const v=a.value;if(!Br(v))return a.issues.push({expected:"record",code:"invalid_type",input:v,inst:i}),a;const k=[],E=r.keyType._zod.values;if(E){a.value={};const c=new Set;for(const u of E)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){c.add(typeof u=="number"?u.toString():u);const y=r.valueType._zod.run({value:v[u],issues:[]},o);y instanceof Promise?k.push(y.then(f=>{f.issues.length&&a.issues.push(...Nr(u,f.issues)),a.value[u]=f.value})):(y.issues.length&&a.issues.push(...Nr(u,y.issues)),a.value[u]=y.value)}let h;for(const u in v)c.has(u)||(h=h??[],h.push(u));h&&h.length>0&&a.issues.push({code:"unrecognized_keys",input:v,inst:i,keys:h})}else{a.value={};for(const c of Reflect.ownKeys(v)){if(c==="__proto__")continue;let h=r.keyType._zod.run({value:c,issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Rp.test(c)&&h.issues.length){const f=r.keyType._zod.run({value:Number(c),issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(h=f)}if(h.issues.length){r.mode==="loose"?a.value[c]=v[c]:a.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(f=>gs(f,o,vs())),input:c,path:[c],inst:i});continue}const y=r.valueType._zod.run({value:v[c],issues:[]},o);y instanceof Promise?k.push(y.then(f=>{f.issues.length&&a.issues.push(...Nr(c,f.issues)),a.value[h.value]=f.value})):(y.issues.length&&a.issues.push(...Nr(c,y.issues)),a.value[h.value]=y.value)}}return k.length?Promise.all(k).then(()=>a):a}}),ux=de("$ZodEnum",(i,r)=>{nt.init(i,r);const a=bp(r.entries),o=new Set(a);i._zod.values=o,i._zod.pattern=new RegExp(`^(${a.filter(v=>x1.has(typeof v)).map(v=>typeof v=="string"?Mo(v):v.toString()).join("|")})$`),i._zod.parse=(v,k)=>{const E=v.value;return o.has(E)||v.issues.push({code:"invalid_value",values:a,input:E,inst:i}),v}}),hx=de("$ZodTransform",(i,r)=>{nt.init(i,r),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new gp(i.constructor.name);const v=r.transform(a.value,a);if(o.async)return(v instanceof Promise?v:Promise.resolve(v)).then(E=>(a.value=E,a));if(v instanceof Promise)throw new Lr;return a.value=v,a}});function d_(i,r){return i.issues.length&&r===void 0?{issues:[],value:void 0}:i}const zp=de("$ZodOptional",(i,r)=>{nt.init(i,r),i._zod.optin="optional",i._zod.optout="optional",Pe(i._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),Pe(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${ju(a.source)})?$`):void 0}),i._zod.parse=(a,o)=>{if(r.innerType._zod.optin==="optional"){const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(k=>d_(k,a.value)):d_(v,a.value)}return a.value===void 0?a:r.innerType._zod.run(a,o)}}),dx=de("$ZodExactOptional",(i,r)=>{zp.init(i,r),Pe(i._zod,"values",()=>r.innerType._zod.values),Pe(i._zod,"pattern",()=>r.innerType._zod.pattern),i._zod.parse=(a,o)=>r.innerType._zod.run(a,o)}),fx=de("$ZodNullable",(i,r)=>{nt.init(i,r),Pe(i._zod,"optin",()=>r.innerType._zod.optin),Pe(i._zod,"optout",()=>r.innerType._zod.optout),Pe(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${ju(a.source)}|null)$`):void 0}),Pe(i._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),i._zod.parse=(a,o)=>a.value===null?a:r.innerType._zod.run(a,o)}),mx=de("$ZodDefault",(i,r)=>{nt.init(i,r),i._zod.optin="optional",Pe(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);if(a.value===void 0)return a.value=r.defaultValue,a;const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(k=>f_(k,r)):f_(v,r)}});function f_(i,r){return i.value===void 0&&(i.value=r.defaultValue),i}const _x=de("$ZodPrefault",(i,r)=>{nt.init(i,r),i._zod.optin="optional",Pe(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>(o.direction==="backward"||a.value===void 0&&(a.value=r.defaultValue),r.innerType._zod.run(a,o))}),px=de("$ZodNonOptional",(i,r)=>{nt.init(i,r),Pe(i._zod,"values",()=>{const a=r.innerType._zod.values;return a?new Set([...a].filter(o=>o!==void 0)):void 0}),i._zod.parse=(a,o)=>{const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(k=>m_(k,i)):m_(v,i)}});function m_(i,r){return!i.issues.length&&i.value===void 0&&i.issues.push({code:"invalid_type",expected:"nonoptional",input:i.value,inst:r}),i}const vx=de("$ZodCatch",(i,r)=>{nt.init(i,r),Pe(i._zod,"optin",()=>r.innerType._zod.optin),Pe(i._zod,"optout",()=>r.innerType._zod.optout),Pe(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(k=>(a.value=k.value,k.issues.length&&(a.value=r.catchValue({...a,error:{issues:k.issues.map(E=>gs(E,o,vs()))},input:a.value}),a.issues=[]),a)):(a.value=v.value,v.issues.length&&(a.value=r.catchValue({...a,error:{issues:v.issues.map(k=>gs(k,o,vs()))},input:a.value}),a.issues=[]),a)}}),gx=de("$ZodPipe",(i,r)=>{nt.init(i,r),Pe(i._zod,"values",()=>r.in._zod.values),Pe(i._zod,"optin",()=>r.in._zod.optin),Pe(i._zod,"optout",()=>r.out._zod.optout),Pe(i._zod,"propValues",()=>r.in._zod.propValues),i._zod.parse=(a,o)=>{if(o.direction==="backward"){const k=r.out._zod.run(a,o);return k instanceof Promise?k.then(E=>_o(E,r.in,o)):_o(k,r.in,o)}const v=r.in._zod.run(a,o);return v instanceof Promise?v.then(k=>_o(k,r.out,o)):_o(v,r.out,o)}});function _o(i,r,a){return i.issues.length?(i.aborted=!0,i):r._zod.run({value:i.value,issues:i.issues},a)}const yx=de("$ZodReadonly",(i,r)=>{nt.init(i,r),Pe(i._zod,"propValues",()=>r.innerType._zod.propValues),Pe(i._zod,"values",()=>r.innerType._zod.values),Pe(i._zod,"optin",()=>{var a,o;return(o=(a=r.innerType)==null?void 0:a._zod)==null?void 0:o.optin}),Pe(i._zod,"optout",()=>{var a,o;return(o=(a=r.innerType)==null?void 0:a._zod)==null?void 0:o.optout}),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(__):__(v)}});function __(i){return i.value=Object.freeze(i.value),i}const bx=de("$ZodCustom",(i,r)=>{Ht.init(i,r),nt.init(i,r),i._zod.parse=(a,o)=>a,i._zod.check=a=>{const o=a.value,v=r.fn(o);if(v instanceof Promise)return v.then(k=>p_(k,a,o,i));p_(v,a,o,i)}});function p_(i,r,a,o){if(!i){const v={code:"custom",input:a,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(v.params=o._zod.def.params),r.issues.push(Pn(v))}}var v_;class Sx{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...a){const o=a[0];return this._map.set(r,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,r),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){const a=this._map.get(r);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(r),this}get(r){const a=r._zod.parent;if(a){const o={...this.get(a)??{}};delete o.id;const v={...o,...this._map.get(r)};return Object.keys(v).length?v:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function xx(){return new Sx}(v_=globalThis).__zod_globalRegistry??(v_.__zod_globalRegistry=xx());const Un=globalThis.__zod_globalRegistry;function Cx(i,r){return new i({type:"string",...be(r)})}function wx(i,r){return new i({type:"string",format:"email",check:"string_format",abort:!1,...be(r)})}function g_(i,r){return new i({type:"string",format:"guid",check:"string_format",abort:!1,...be(r)})}function Ex(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,...be(r)})}function kx(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...be(r)})}function Tx(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...be(r)})}function Ax(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...be(r)})}function Rx(i,r){return new i({type:"string",format:"url",check:"string_format",abort:!1,...be(r)})}function Dx(i,r){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,...be(r)})}function Ox(i,r){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,...be(r)})}function Mx(i,r){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,...be(r)})}function Nx(i,r){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,...be(r)})}function Lx(i,r){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,...be(r)})}function jx(i,r){return new i({type:"string",format:"xid",check:"string_format",abort:!1,...be(r)})}function Bx(i,r){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,...be(r)})}function zx(i,r){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,...be(r)})}function Hx(i,r){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,...be(r)})}function Ux(i,r){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,...be(r)})}function $x(i,r){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,...be(r)})}function Ix(i,r){return new i({type:"string",format:"base64",check:"string_format",abort:!1,...be(r)})}function Px(i,r){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,...be(r)})}function Zx(i,r){return new i({type:"string",format:"e164",check:"string_format",abort:!1,...be(r)})}function Fx(i,r){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,...be(r)})}function qx(i,r){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...be(r)})}function Kx(i,r){return new i({type:"string",format:"date",check:"string_format",...be(r)})}function Vx(i,r){return new i({type:"string",format:"time",check:"string_format",precision:null,...be(r)})}function Gx(i,r){return new i({type:"string",format:"duration",check:"string_format",...be(r)})}function Yx(i,r){return new i({type:"number",checks:[],...be(r)})}function Wx(i,r){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",...be(r)})}function Xx(i,r){return new i({type:"boolean",...be(r)})}function Jx(i){return new i({type:"unknown"})}function Qx(i,r){return new i({type:"never",...be(r)})}function y_(i,r){return new Op({check:"less_than",...be(r),value:i,inclusive:!1})}function au(i,r){return new Op({check:"less_than",...be(r),value:i,inclusive:!0})}function b_(i,r){return new Mp({check:"greater_than",...be(r),value:i,inclusive:!1})}function ou(i,r){return new Mp({check:"greater_than",...be(r),value:i,inclusive:!0})}function S_(i,r){return new _S({check:"multiple_of",...be(r),value:i})}function Hp(i,r){return new vS({check:"max_length",...be(r),maximum:i})}function Eo(i,r){return new gS({check:"min_length",...be(r),minimum:i})}function Up(i,r){return new yS({check:"length_equals",...be(r),length:i})}function eC(i,r){return new bS({check:"string_format",format:"regex",...be(r),pattern:i})}function tC(i){return new SS({check:"string_format",format:"lowercase",...be(i)})}function iC(i){return new xS({check:"string_format",format:"uppercase",...be(i)})}function sC(i,r){return new CS({check:"string_format",format:"includes",...be(r),includes:i})}function rC(i,r){return new wS({check:"string_format",format:"starts_with",...be(r),prefix:i})}function nC(i,r){return new ES({check:"string_format",format:"ends_with",...be(r),suffix:i})}function $r(i){return new kS({check:"overwrite",tx:i})}function aC(i){return $r(r=>r.normalize(i))}function oC(){return $r(i=>i.trim())}function lC(){return $r(i=>i.toLowerCase())}function cC(){return $r(i=>i.toUpperCase())}function uC(){return $r(i=>b1(i))}function hC(i,r,a){return new i({type:"array",element:r,...be(a)})}function dC(i,r,a){return new i({type:"custom",check:"custom",fn:r,...be(a)})}function fC(i){const r=mC(a=>(a.addIssue=o=>{if(typeof o=="string")a.issues.push(Pn(o,a.value,r._zod.def));else{const v=o;v.fatal&&(v.continue=!1),v.code??(v.code="custom"),v.input??(v.input=a.value),v.inst??(v.inst=r),v.continue??(v.continue=!r._zod.def.abort),a.issues.push(Pn(v))}},i(a.value,a)));return r}function mC(i,r){const a=new Ht({check:"custom",...be(r)});return a._zod.check=i,a}function $p(i){let r=(i==null?void 0:i.target)??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:i.processors??{},metadataRegistry:(i==null?void 0:i.metadata)??Un,target:r,unrepresentable:(i==null?void 0:i.unrepresentable)??"throw",override:(i==null?void 0:i.override)??(()=>{}),io:(i==null?void 0:i.io)??"output",counter:0,seen:new Map,cycles:(i==null?void 0:i.cycles)??"ref",reused:(i==null?void 0:i.reused)??"inline",external:(i==null?void 0:i.external)??void 0}}function pt(i,r,a={path:[],schemaPath:[]}){var y,f;var o;const v=i._zod.def,k=r.seen.get(i);if(k)return k.count++,a.schemaPath.includes(i)&&(k.cycle=a.path),k.schema;const E={schema:{},count:1,cycle:void 0,path:a.path};r.seen.set(i,E);const c=(f=(y=i._zod).toJSONSchema)==null?void 0:f.call(y);if(c)E.schema=c;else{const x={...a,schemaPath:[...a.schemaPath,i],path:a.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(r,E.schema,x);else{const O=E.schema,C=r.processors[v.type];if(!C)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${v.type}`);C(i,r,O,x)}const T=i._zod.parent;T&&(E.ref||(E.ref=T),pt(T,r,x),r.seen.get(T).isParent=!0)}const h=r.metadataRegistry.get(i);return h&&Object.assign(E.schema,h),r.io==="input"&&At(i)&&(delete E.schema.examples,delete E.schema.default),r.io==="input"&&E.schema._prefault&&((o=E.schema).default??(o.default=E.schema._prefault)),delete E.schema._prefault,r.seen.get(i).schema}function Ip(i,r){var E,c,h,u;const a=i.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const y of i.seen.entries()){const f=(E=i.metadataRegistry.get(y[0]))==null?void 0:E.id;if(f){const x=o.get(f);if(x&&x!==y[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(f,y[0])}}const v=y=>{var C;const f=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){const m=(C=i.external.registry.get(y[0]))==null?void 0:C.id,g=i.external.uri??(p=>p);if(m)return{ref:g(m)};const d=y[1].defId??y[1].schema.id??`schema${i.counter++}`;return y[1].defId=d,{defId:d,ref:`${g("__shared")}#/${f}/${d}`}}if(y[1]===a)return{ref:"#"};const T=`#/${f}/`,O=y[1].schema.id??`__schema${i.counter++}`;return{defId:O,ref:T+O}},k=y=>{if(y[1].schema.$ref)return;const f=y[1],{ref:x,defId:T}=v(y);f.def={...f.schema},T&&(f.defId=T);const O=f.schema;for(const C in O)delete O[C];O.$ref=x};if(i.cycles==="throw")for(const y of i.seen.entries()){const f=y[1];if(f.cycle)throw new Error(`Cycle detected: #/${(c=f.cycle)==null?void 0:c.join("/")}/<root>
302
+
303
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of i.seen.entries()){const f=y[1];if(r===y[0]){k(y);continue}if(i.external){const T=(h=i.external.registry.get(y[0]))==null?void 0:h.id;if(r!==y[0]&&T){k(y);continue}}if((u=i.metadataRegistry.get(y[0]))==null?void 0:u.id){k(y);continue}if(f.cycle){k(y);continue}if(f.count>1&&i.reused==="ref"){k(y);continue}}}function Pp(i,r){var E,c,h;const a=i.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=u=>{const y=i.seen.get(u);if(y.ref===null)return;const f=y.def??y.schema,x={...f},T=y.ref;if(y.ref=null,T){o(T);const C=i.seen.get(T),m=C.schema;if(m.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(m)):Object.assign(f,m),Object.assign(f,x),u._zod.parent===T)for(const d in f)d==="$ref"||d==="allOf"||d in x||delete f[d];if(m.$ref&&C.def)for(const d in f)d==="$ref"||d==="allOf"||d in C.def&&JSON.stringify(f[d])===JSON.stringify(C.def[d])&&delete f[d]}const O=u._zod.parent;if(O&&O!==T){o(O);const C=i.seen.get(O);if(C!=null&&C.schema.$ref&&(f.$ref=C.schema.$ref,C.def))for(const m in f)m==="$ref"||m==="allOf"||m in C.def&&JSON.stringify(f[m])===JSON.stringify(C.def[m])&&delete f[m]}i.override({zodSchema:u,jsonSchema:f,path:y.path??[]})};for(const u of[...i.seen.entries()].reverse())o(u[0]);const v={};if(i.target==="draft-2020-12"?v.$schema="https://json-schema.org/draft/2020-12/schema":i.target==="draft-07"?v.$schema="http://json-schema.org/draft-07/schema#":i.target==="draft-04"?v.$schema="http://json-schema.org/draft-04/schema#":i.target,(E=i.external)!=null&&E.uri){const u=(c=i.external.registry.get(r))==null?void 0:c.id;if(!u)throw new Error("Schema is missing an `id` property");v.$id=i.external.uri(u)}Object.assign(v,a.def??a.schema);const k=((h=i.external)==null?void 0:h.defs)??{};for(const u of i.seen.entries()){const y=u[1];y.def&&y.defId&&(k[y.defId]=y.def)}i.external||Object.keys(k).length>0&&(i.target==="draft-2020-12"?v.$defs=k:v.definitions=k);try{const u=JSON.parse(JSON.stringify(v));return Object.defineProperty(u,"~standard",{value:{...r["~standard"],jsonSchema:{input:ko(r,"input",i.processors),output:ko(r,"output",i.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function At(i,r){const a=r??{seen:new Set};if(a.seen.has(i))return!1;a.seen.add(i);const o=i._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return At(o.element,a);if(o.type==="set")return At(o.valueType,a);if(o.type==="lazy")return At(o.getter(),a);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return At(o.innerType,a);if(o.type==="intersection")return At(o.left,a)||At(o.right,a);if(o.type==="record"||o.type==="map")return At(o.keyType,a)||At(o.valueType,a);if(o.type==="pipe")return At(o.in,a)||At(o.out,a);if(o.type==="object"){for(const v in o.shape)if(At(o.shape[v],a))return!0;return!1}if(o.type==="union"){for(const v of o.options)if(At(v,a))return!0;return!1}if(o.type==="tuple"){for(const v of o.items)if(At(v,a))return!0;return!!(o.rest&&At(o.rest,a))}return!1}const _C=(i,r={})=>a=>{const o=$p({...a,processors:r});return pt(i,o),Ip(o,i),Pp(o,i)},ko=(i,r,a={})=>o=>{const{libraryOptions:v,target:k}=o??{},E=$p({...v??{},target:k,io:r,processors:a});return pt(i,E),Ip(E,i),Pp(E,i)},pC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vC=(i,r,a,o)=>{const v=a;v.type="string";const{minimum:k,maximum:E,format:c,patterns:h,contentEncoding:u}=i._zod.bag;if(typeof k=="number"&&(v.minLength=k),typeof E=="number"&&(v.maxLength=E),c&&(v.format=pC[c]??c,v.format===""&&delete v.format,c==="time"&&delete v.format),u&&(v.contentEncoding=u),h&&h.size>0){const y=[...h];y.length===1?v.pattern=y[0].source:y.length>1&&(v.allOf=[...y.map(f=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},gC=(i,r,a,o)=>{const v=a,{minimum:k,maximum:E,format:c,multipleOf:h,exclusiveMaximum:u,exclusiveMinimum:y}=i._zod.bag;typeof c=="string"&&c.includes("int")?v.type="integer":v.type="number",typeof y=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(v.minimum=y,v.exclusiveMinimum=!0):v.exclusiveMinimum=y),typeof k=="number"&&(v.minimum=k,typeof y=="number"&&r.target!=="draft-04"&&(y>=k?delete v.minimum:delete v.exclusiveMinimum)),typeof u=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(v.maximum=u,v.exclusiveMaximum=!0):v.exclusiveMaximum=u),typeof E=="number"&&(v.maximum=E,typeof u=="number"&&r.target!=="draft-04"&&(u<=E?delete v.maximum:delete v.exclusiveMaximum)),typeof h=="number"&&(v.multipleOf=h)},yC=(i,r,a,o)=>{a.type="boolean"},bC=(i,r,a,o)=>{a.not={}},SC=(i,r,a,o)=>{},xC=(i,r,a,o)=>{const v=i._zod.def,k=bp(v.entries);k.every(E=>typeof E=="number")&&(a.type="number"),k.every(E=>typeof E=="string")&&(a.type="string"),a.enum=k},CC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},wC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},EC=(i,r,a,o)=>{const v=a,k=i._zod.def,{minimum:E,maximum:c}=i._zod.bag;typeof E=="number"&&(v.minItems=E),typeof c=="number"&&(v.maxItems=c),v.type="array",v.items=pt(k.element,r,{...o,path:[...o.path,"items"]})},kC=(i,r,a,o)=>{var u;const v=a,k=i._zod.def;v.type="object",v.properties={};const E=k.shape;for(const y in E)v.properties[y]=pt(E[y],r,{...o,path:[...o.path,"properties",y]});const c=new Set(Object.keys(E)),h=new Set([...c].filter(y=>{const f=k.shape[y]._zod;return r.io==="input"?f.optin===void 0:f.optout===void 0}));h.size>0&&(v.required=Array.from(h)),((u=k.catchall)==null?void 0:u._zod.def.type)==="never"?v.additionalProperties=!1:k.catchall?k.catchall&&(v.additionalProperties=pt(k.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(v.additionalProperties=!1)},TC=(i,r,a,o)=>{const v=i._zod.def,k=v.inclusive===!1,E=v.options.map((c,h)=>pt(c,r,{...o,path:[...o.path,k?"oneOf":"anyOf",h]}));k?a.oneOf=E:a.anyOf=E},AC=(i,r,a,o)=>{const v=i._zod.def,k=pt(v.left,r,{...o,path:[...o.path,"allOf",0]}),E=pt(v.right,r,{...o,path:[...o.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,h=[...c(k)?k.allOf:[k],...c(E)?E.allOf:[E]];a.allOf=h},RC=(i,r,a,o)=>{const v=a,k=i._zod.def;v.type="object";const E=k.keyType,c=E._zod.bag,h=c==null?void 0:c.patterns;if(k.mode==="loose"&&h&&h.size>0){const y=pt(k.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});v.patternProperties={};for(const f of h)v.patternProperties[f.source]=y}else(r.target==="draft-07"||r.target==="draft-2020-12")&&(v.propertyNames=pt(k.keyType,r,{...o,path:[...o.path,"propertyNames"]})),v.additionalProperties=pt(k.valueType,r,{...o,path:[...o.path,"additionalProperties"]});const u=E._zod.values;if(u){const y=[...u].filter(f=>typeof f=="string"||typeof f=="number");y.length>0&&(v.required=y)}},DC=(i,r,a,o)=>{const v=i._zod.def,k=pt(v.innerType,r,o),E=r.seen.get(i);r.target==="openapi-3.0"?(E.ref=v.innerType,a.nullable=!0):a.anyOf=[k,{type:"null"}]},OC=(i,r,a,o)=>{const v=i._zod.def;pt(v.innerType,r,o);const k=r.seen.get(i);k.ref=v.innerType},MC=(i,r,a,o)=>{const v=i._zod.def;pt(v.innerType,r,o);const k=r.seen.get(i);k.ref=v.innerType,a.default=JSON.parse(JSON.stringify(v.defaultValue))},NC=(i,r,a,o)=>{const v=i._zod.def;pt(v.innerType,r,o);const k=r.seen.get(i);k.ref=v.innerType,r.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(v.defaultValue)))},LC=(i,r,a,o)=>{const v=i._zod.def;pt(v.innerType,r,o);const k=r.seen.get(i);k.ref=v.innerType;let E;try{E=v.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=E},jC=(i,r,a,o)=>{const v=i._zod.def,k=r.io==="input"?v.in._zod.def.type==="transform"?v.out:v.in:v.out;pt(k,r,o);const E=r.seen.get(i);E.ref=k},BC=(i,r,a,o)=>{const v=i._zod.def;pt(v.innerType,r,o);const k=r.seen.get(i);k.ref=v.innerType,a.readOnly=!0},Zp=(i,r,a,o)=>{const v=i._zod.def;pt(v.innerType,r,o);const k=r.seen.get(i);k.ref=v.innerType},zC=de("ZodISODateTime",(i,r)=>{$S.init(i,r),it.init(i,r)});function HC(i){return qx(zC,i)}const UC=de("ZodISODate",(i,r)=>{IS.init(i,r),it.init(i,r)});function $C(i){return Kx(UC,i)}const IC=de("ZodISOTime",(i,r)=>{PS.init(i,r),it.init(i,r)});function PC(i){return Vx(IC,i)}const ZC=de("ZodISODuration",(i,r)=>{ZS.init(i,r),it.init(i,r)});function FC(i){return Gx(ZC,i)}const qC=(i,r)=>{wp.init(i,r),i.name="ZodError",Object.defineProperties(i,{format:{value:a=>N1(i,a)},flatten:{value:a=>M1(i,a)},addIssue:{value:a=>{i.issues.push(a),i.message=JSON.stringify(i.issues,vu,2)}},addIssues:{value:a=>{i.issues.push(...a),i.message=JSON.stringify(i.issues,vu,2)}},isEmpty:{get(){return i.issues.length===0}}})},oi=de("ZodError",qC,{Parent:Error}),KC=zu(oi),VC=Hu(oi),GC=No(oi),YC=Lo(oi),WC=B1(oi),XC=z1(oi),JC=H1(oi),QC=U1(oi),e2=$1(oi),t2=I1(oi),i2=P1(oi),s2=Z1(oi),at=de("ZodType",(i,r)=>(nt.init(i,r),Object.assign(i["~standard"],{jsonSchema:{input:ko(i,"input"),output:ko(i,"output")}}),i.toJSONSchema=_C(i,{}),i.def=r,i.type=r.type,Object.defineProperty(i,"_def",{value:r}),i.check=(...a)=>i.clone(bs(r,{checks:[...r.checks??[],...a.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),i.with=i.check,i.clone=(a,o)=>Ss(i,a,o),i.brand=()=>i,i.register=((a,o)=>(a.add(i,o),i)),i.parse=(a,o)=>KC(i,a,o,{callee:i.parse}),i.safeParse=(a,o)=>GC(i,a,o),i.parseAsync=async(a,o)=>VC(i,a,o,{callee:i.parseAsync}),i.safeParseAsync=async(a,o)=>YC(i,a,o),i.spa=i.safeParseAsync,i.encode=(a,o)=>WC(i,a,o),i.decode=(a,o)=>XC(i,a,o),i.encodeAsync=async(a,o)=>JC(i,a,o),i.decodeAsync=async(a,o)=>QC(i,a,o),i.safeEncode=(a,o)=>e2(i,a,o),i.safeDecode=(a,o)=>t2(i,a,o),i.safeEncodeAsync=async(a,o)=>i2(i,a,o),i.safeDecodeAsync=async(a,o)=>s2(i,a,o),i.refine=(a,o)=>i.check(W2(a,o)),i.superRefine=a=>i.check(X2(a)),i.overwrite=a=>i.check($r(a)),i.optional=()=>w_(i),i.exactOptional=()=>z2(i),i.nullable=()=>E_(i),i.nullish=()=>w_(E_(i)),i.nonoptional=a=>Z2(i,a),i.array=()=>Gn(i),i.or=a=>D2([i,a]),i.and=a=>M2(i,a),i.transform=a=>k_(i,j2(a)),i.default=a=>$2(i,a),i.prefault=a=>P2(i,a),i.catch=a=>q2(i,a),i.pipe=a=>k_(i,a),i.readonly=()=>G2(i),i.describe=a=>{const o=i.clone();return Un.add(o,{description:a}),o},Object.defineProperty(i,"description",{get(){var a;return(a=Un.get(i))==null?void 0:a.description},configurable:!0}),i.meta=(...a)=>{if(a.length===0)return Un.get(i);const o=i.clone();return Un.add(o,a[0]),o},i.isOptional=()=>i.safeParse(void 0).success,i.isNullable=()=>i.safeParse(null).success,i.apply=a=>a(i),i)),Fp=de("_ZodString",(i,r)=>{Uu.init(i,r),at.init(i,r),i._zod.processJSONSchema=(o,v,k)=>vC(i,o,v);const a=i._zod.bag;i.format=a.format??null,i.minLength=a.minimum??null,i.maxLength=a.maximum??null,i.regex=(...o)=>i.check(eC(...o)),i.includes=(...o)=>i.check(sC(...o)),i.startsWith=(...o)=>i.check(rC(...o)),i.endsWith=(...o)=>i.check(nC(...o)),i.min=(...o)=>i.check(Eo(...o)),i.max=(...o)=>i.check(Hp(...o)),i.length=(...o)=>i.check(Up(...o)),i.nonempty=(...o)=>i.check(Eo(1,...o)),i.lowercase=o=>i.check(tC(o)),i.uppercase=o=>i.check(iC(o)),i.trim=()=>i.check(oC()),i.normalize=(...o)=>i.check(aC(...o)),i.toLowerCase=()=>i.check(lC()),i.toUpperCase=()=>i.check(cC()),i.slugify=()=>i.check(uC())}),r2=de("ZodString",(i,r)=>{Uu.init(i,r),Fp.init(i,r),i.email=a=>i.check(wx(n2,a)),i.url=a=>i.check(Rx(a2,a)),i.jwt=a=>i.check(Fx(S2,a)),i.emoji=a=>i.check(Dx(o2,a)),i.guid=a=>i.check(g_(x_,a)),i.uuid=a=>i.check(Ex(po,a)),i.uuidv4=a=>i.check(kx(po,a)),i.uuidv6=a=>i.check(Tx(po,a)),i.uuidv7=a=>i.check(Ax(po,a)),i.nanoid=a=>i.check(Ox(l2,a)),i.guid=a=>i.check(g_(x_,a)),i.cuid=a=>i.check(Mx(c2,a)),i.cuid2=a=>i.check(Nx(u2,a)),i.ulid=a=>i.check(Lx(h2,a)),i.base64=a=>i.check(Ix(g2,a)),i.base64url=a=>i.check(Px(y2,a)),i.xid=a=>i.check(jx(d2,a)),i.ksuid=a=>i.check(Bx(f2,a)),i.ipv4=a=>i.check(zx(m2,a)),i.ipv6=a=>i.check(Hx(_2,a)),i.cidrv4=a=>i.check(Ux(p2,a)),i.cidrv6=a=>i.check($x(v2,a)),i.e164=a=>i.check(Zx(b2,a)),i.datetime=a=>i.check(HC(a)),i.date=a=>i.check($C(a)),i.time=a=>i.check(PC(a)),i.duration=a=>i.check(FC(a))});function Ae(i){return Cx(r2,i)}const it=de("ZodStringFormat",(i,r)=>{Qe.init(i,r),Fp.init(i,r)}),n2=de("ZodEmail",(i,r)=>{OS.init(i,r),it.init(i,r)}),x_=de("ZodGUID",(i,r)=>{RS.init(i,r),it.init(i,r)}),po=de("ZodUUID",(i,r)=>{DS.init(i,r),it.init(i,r)}),a2=de("ZodURL",(i,r)=>{MS.init(i,r),it.init(i,r)}),o2=de("ZodEmoji",(i,r)=>{NS.init(i,r),it.init(i,r)}),l2=de("ZodNanoID",(i,r)=>{LS.init(i,r),it.init(i,r)}),c2=de("ZodCUID",(i,r)=>{jS.init(i,r),it.init(i,r)}),u2=de("ZodCUID2",(i,r)=>{BS.init(i,r),it.init(i,r)}),h2=de("ZodULID",(i,r)=>{zS.init(i,r),it.init(i,r)}),d2=de("ZodXID",(i,r)=>{HS.init(i,r),it.init(i,r)}),f2=de("ZodKSUID",(i,r)=>{US.init(i,r),it.init(i,r)}),m2=de("ZodIPv4",(i,r)=>{FS.init(i,r),it.init(i,r)}),_2=de("ZodIPv6",(i,r)=>{qS.init(i,r),it.init(i,r)}),p2=de("ZodCIDRv4",(i,r)=>{KS.init(i,r),it.init(i,r)}),v2=de("ZodCIDRv6",(i,r)=>{VS.init(i,r),it.init(i,r)}),g2=de("ZodBase64",(i,r)=>{GS.init(i,r),it.init(i,r)}),y2=de("ZodBase64URL",(i,r)=>{WS.init(i,r),it.init(i,r)}),b2=de("ZodE164",(i,r)=>{XS.init(i,r),it.init(i,r)}),S2=de("ZodJWT",(i,r)=>{QS.init(i,r),it.init(i,r)}),qp=de("ZodNumber",(i,r)=>{Lp.init(i,r),at.init(i,r),i._zod.processJSONSchema=(o,v,k)=>gC(i,o,v),i.gt=(o,v)=>i.check(b_(o,v)),i.gte=(o,v)=>i.check(ou(o,v)),i.min=(o,v)=>i.check(ou(o,v)),i.lt=(o,v)=>i.check(y_(o,v)),i.lte=(o,v)=>i.check(au(o,v)),i.max=(o,v)=>i.check(au(o,v)),i.int=o=>i.check(C_(o)),i.safe=o=>i.check(C_(o)),i.positive=o=>i.check(b_(0,o)),i.nonnegative=o=>i.check(ou(0,o)),i.negative=o=>i.check(y_(0,o)),i.nonpositive=o=>i.check(au(0,o)),i.multipleOf=(o,v)=>i.check(S_(o,v)),i.step=(o,v)=>i.check(S_(o,v)),i.finite=()=>i;const a=i._zod.bag;i.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,i.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,i.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),i.isFinite=!0,i.format=a.format??null});function Se(i){return Yx(qp,i)}const x2=de("ZodNumberFormat",(i,r)=>{ex.init(i,r),qp.init(i,r)});function C_(i){return Wx(x2,i)}const C2=de("ZodBoolean",(i,r)=>{tx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>yC(i,a,o)});function $i(i){return Xx(C2,i)}const w2=de("ZodUnknown",(i,r)=>{ix.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>SC()});function To(){return Jx(w2)}const E2=de("ZodNever",(i,r)=>{sx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>bC(i,a,o)});function k2(i){return Qx(E2,i)}const T2=de("ZodArray",(i,r)=>{rx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>EC(i,a,o,v),i.element=r.element,i.min=(a,o)=>i.check(Eo(a,o)),i.nonempty=a=>i.check(Eo(1,a)),i.max=(a,o)=>i.check(Hp(a,o)),i.length=(a,o)=>i.check(Up(a,o)),i.unwrap=()=>i.element});function Gn(i,r){return hC(T2,i,r)}const A2=de("ZodObject",(i,r)=>{ax.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>kC(i,a,o,v),Pe(i,"shape",()=>r.shape),i.keyof=()=>zr(Object.keys(i._zod.def.shape)),i.catchall=a=>i.clone({...i._zod.def,catchall:a}),i.passthrough=()=>i.clone({...i._zod.def,catchall:To()}),i.loose=()=>i.clone({...i._zod.def,catchall:To()}),i.strict=()=>i.clone({...i._zod.def,catchall:k2()}),i.strip=()=>i.clone({...i._zod.def,catchall:void 0}),i.extend=a=>T1(i,a),i.safeExtend=a=>A1(i,a),i.merge=a=>R1(i,a),i.pick=a=>E1(i,a),i.omit=a=>k1(i,a),i.partial=(...a)=>D1(Kp,i,a[0]),i.required=(...a)=>O1(Vp,i,a[0])});function Ge(i,r){const a={type:"object",shape:i??{},...be(r)};return new A2(a)}const R2=de("ZodUnion",(i,r)=>{ox.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>TC(i,a,o,v),i.options=r.options});function D2(i,r){return new R2({type:"union",options:i,...be(r)})}const O2=de("ZodIntersection",(i,r)=>{lx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>AC(i,a,o,v)});function M2(i,r){return new O2({type:"intersection",left:i,right:r})}const N2=de("ZodRecord",(i,r)=>{cx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>RC(i,a,o,v),i.keyType=r.keyType,i.valueType=r.valueType});function Bo(i,r,a){return new N2({type:"record",keyType:i,valueType:r,...be(a)})}const yu=de("ZodEnum",(i,r)=>{ux.init(i,r),at.init(i,r),i._zod.processJSONSchema=(o,v,k)=>xC(i,o,v),i.enum=r.entries,i.options=Object.values(r.entries);const a=new Set(Object.keys(r.entries));i.extract=(o,v)=>{const k={};for(const E of o)if(a.has(E))k[E]=r.entries[E];else throw new Error(`Key ${E} not found in enum`);return new yu({...r,checks:[],...be(v),entries:k})},i.exclude=(o,v)=>{const k={...r.entries};for(const E of o)if(a.has(E))delete k[E];else throw new Error(`Key ${E} not found in enum`);return new yu({...r,checks:[],...be(v),entries:k})}});function zr(i,r){const a=Array.isArray(i)?Object.fromEntries(i.map(o=>[o,o])):i;return new yu({type:"enum",entries:a,...be(r)})}const L2=de("ZodTransform",(i,r)=>{hx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>wC(i,a),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new gp(i.constructor.name);a.addIssue=k=>{if(typeof k=="string")a.issues.push(Pn(k,a.value,r));else{const E=k;E.fatal&&(E.continue=!1),E.code??(E.code="custom"),E.input??(E.input=a.value),E.inst??(E.inst=i),a.issues.push(Pn(E))}};const v=r.transform(a.value,a);return v instanceof Promise?v.then(k=>(a.value=k,a)):(a.value=v,a)}});function j2(i){return new L2({type:"transform",transform:i})}const Kp=de("ZodOptional",(i,r)=>{zp.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>Zp(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function w_(i){return new Kp({type:"optional",innerType:i})}const B2=de("ZodExactOptional",(i,r)=>{dx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>Zp(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function z2(i){return new B2({type:"optional",innerType:i})}const H2=de("ZodNullable",(i,r)=>{fx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>DC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function E_(i){return new H2({type:"nullable",innerType:i})}const U2=de("ZodDefault",(i,r)=>{mx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>MC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function $2(i,r){return new U2({type:"default",innerType:i,get defaultValue(){return typeof r=="function"?r():xp(r)}})}const I2=de("ZodPrefault",(i,r)=>{_x.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>NC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function P2(i,r){return new I2({type:"prefault",innerType:i,get defaultValue(){return typeof r=="function"?r():xp(r)}})}const Vp=de("ZodNonOptional",(i,r)=>{px.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>OC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function Z2(i,r){return new Vp({type:"nonoptional",innerType:i,...be(r)})}const F2=de("ZodCatch",(i,r)=>{vx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>LC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function q2(i,r){return new F2({type:"catch",innerType:i,catchValue:typeof r=="function"?r:()=>r})}const K2=de("ZodPipe",(i,r)=>{gx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>jC(i,a,o,v),i.in=r.in,i.out=r.out});function k_(i,r){return new K2({type:"pipe",in:i,out:r})}const V2=de("ZodReadonly",(i,r)=>{yx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>BC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function G2(i){return new V2({type:"readonly",innerType:i})}const Y2=de("ZodCustom",(i,r)=>{bx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,v)=>CC(i,a)});function W2(i,r={}){return dC(Y2,i,r)}function X2(i){return fC(i)}const $u=zr(["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"]),Iu=Ge({ok:$i()}),J2=Ge({id:Ae(),name:Ae(),createdAt:Se(),lastUsedAt:Se(),rateLimit:Se()}),Q2=Ge({id:Ae(),name:Ae(),key:Ae()}),ew=Iu.extend({delivered:$i(),attempts:Se()}),tw=Ge({status:Ae(),version:Ae(),uptime:Se(),sessions:Ge({active:Se(),total:Se()}),timestamp:Ae()}),zo=Ge({id:Ae(),windowId:Ae(),windowName:Ae(),workDir:Ae(),claudeSessionId:Ae().optional(),jsonlPath:Ae().optional(),byteOffset:Se(),monitorOffset:Se(),status:$u,createdAt:Se(),lastActivity:Se(),stallThresholdMs:Se(),permissionMode:Ae(),autoApprove:$i().optional(),settingsPatched:$i().optional(),promptDelivery:Ge({delivered:$i(),attempts:Se()}).optional(),actionHints:Bo(Ae(),Ge({method:Ae(),url:Ae(),description:Ae()})).optional()}),iw=Ge({sessions:Gn(zo),pagination:Ge({page:Se(),limit:Se(),total:Se(),totalPages:Se()})}),sw=Ge({alive:$i(),windowExists:$i(),claudeRunning:$i(),paneCommand:Ae().nullable(),status:$u,hasTranscript:$i(),lastActivity:Se(),lastActivityAgo:Se(),sessionAge:Se(),details:Ae(),actionHints:Bo(Ae(),Ge({method:Ae(),url:Ae(),description:Ae()})).optional()}),rw=Ge({durationSec:Se(),messages:Se(),toolCalls:Se(),approvals:Se(),autoApprovals:Se(),statusChanges:Gn(Ae()),tokenUsage:Ge({inputTokens:Se(),outputTokens:Se(),cacheCreationTokens:Se(),cacheReadTokens:Se(),estimatedCostUsd:Se()}).optional()}),ps=Ge({min:Se().nullable(),max:Se().nullable(),avg:Se().nullable(),count:Se()}),nw=Ge({sessionId:Ae(),realtime:Ge({hook_latency_ms:Se().nullable(),state_change_detection_ms:Se().nullable(),permission_response_ms:Se().nullable()}).nullable(),aggregated:Ge({hook_latency_ms:ps,state_change_detection_ms:ps,permission_response_ms:ps,channel_delivery_ms:ps}).nullable()}),aw=Ge({role:zr(["user","assistant","system"]),contentType:zr(["text","thinking","tool_use","tool_result","tool_error","permission_request","progress"]),text:Ae(),toolName:Ae().optional(),toolUseId:Ae().optional(),timestamp:Ae().optional()}),ow=Ge({messages:Gn(aw),status:$u,statusText:Ae().nullable(),interactiveContent:Ae().nullable()}),lw=Ge({uptime:Se(),sessions:Ge({total_created:Se(),currently_active:Se(),completed:Se(),failed:Se(),avg_duration_sec:Se(),avg_messages_per_session:Se()}),auto_approvals:Se(),webhooks_sent:Se(),webhooks_failed:Se(),screenshots_taken:Se(),pipelines_created:Se(),batches_created:Se(),prompt_delivery:Ge({sent:Se(),delivered:Se(),failed:Se(),success_rate:Se().nullable()}),latency:Ge({hook_latency_ms:ps,state_change_detection_ms:ps,permission_response_ms:ps,channel_delivery_ms:ps})}),cw=zr(["status","message","approval","ended","heartbeat","stall","dead","system","hook","subagent_start","subagent_stop","verification"]),uw=Ge({event:cw,sessionId:Ae(),timestamp:Ae(),data:Bo(Ae(),To())}),hw=zr(["session_status_change","session_message","session_approval","session_ended","session_created","session_stall","session_dead","session_subagent_start","session_subagent_stop","session_verification"]),dw=Ge({event:hw,sessionId:Ae(),timestamp:Ae(),data:Bo(Ae(),To())}),fw=3e4,mw=300*1e3;class Ao{constructor(r,a,o={}){_t(this,"eventSource",null);_t(this,"consecutiveFailures",0);_t(this,"failStartTime",null);_t(this,"destroyed",!1);_t(this,"gaveUp",!1);_t(this,"reconnectTimer",null);_t(this,"url");_t(this,"callbacks");_t(this,"onMessage");this.url=r,this.onMessage=a,this.callbacks=o,this.connect()}connect(){this.destroyed||(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.eventSource=new EventSource(this.url),this.eventSource.onmessage=this.onMessage,this.eventSource.onopen=()=>{var r,a;this.destroyed||(this.consecutiveFailures=0,this.failStartTime=null,this.gaveUp=!1,(a=(r=this.callbacks).onOpen)==null||a.call(r))},this.eventSource.onerror=()=>{var a,o,v,k,E,c,h;if(this.destroyed)return;if((a=this.eventSource)==null||a.close(),this.eventSource=null,this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=mw){this.gaveUp||(this.gaveUp=!0,(v=(o=this.callbacks).onGiveUp)==null||v.call(o),(E=(k=this.callbacks).onClose)==null||E.call(k));return}this.consecutiveFailures++;const r=Math.min(fw,1e3*Math.pow(2,this.consecutiveFailures-1));(h=(c=this.callbacks).onReconnecting)==null||h.call(c,this.consecutiveFailures,r),this.reconnectTimer=setTimeout(()=>this.connect(),r)})}close(){var r;this.destroyed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(r=this.eventSource)==null||r.close(),this.eventSource=null}}const _w="",T_=["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"];function pw(i){if(!i)return{};if(i instanceof Headers){const r={};return i.forEach((a,o)=>{r[o]=a}),r}return i}function vw(i,r,a){const o=r.safeParse(i);if(o.success)return o.data;throw console.error(`[aegis] API response validation failed (${a}):`,o.error.issues),new Error(`API response validation failed for ${a}: ${o.error.issues.map(v=>v.message).join(", ")}`)}function gw(i){return!(i.name==="AbortError"||!i.message||i.message.includes("HTTP "))}async function Ue(i,r={}){const a=localStorage.getItem("aegis_token"),o={"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...pw(r.headers)},{retries:v=0,schema:k,schemaContext:E,...c}=r;let h=null;for(let u=0;u<=v;u++)try{const y=await fetch(`${_w}${i}`,{...c,headers:o});if(!y.ok){const x=await y.json().catch(()=>({error:y.statusText})),T=new Error(x.error??`HTTP ${y.status}`);throw T.statusCode=y.status,T}const f=await y.json();return k?vw(f,k,E??i):f}catch(y){if(h=y,u<v&&gw(h))await new Promise(f=>setTimeout(f,1e3*Math.pow(2,u)));else throw h}throw h}function yw(){return Ue("/v1/health",{schema:tw,schemaContext:"getHealth"})}function bw(){return Ue("/v1/metrics",{schema:lw,schemaContext:"getMetrics"})}function bu(i={}){const r=new URLSearchParams;i.page!==void 0&&r.set("page",String(i.page)),i.limit!==void 0&&r.set("limit",String(i.limit)),i.status&&r.set("status",i.status);const a=r.toString(),o=a?`/v1/sessions?${a}`:"/v1/sessions";return Ue(o,{schema:iw,schemaContext:"getSessions"})}async function Sw(){const i={all:0},[r,...a]=await Promise.all([bu({page:1,limit:1}),...T_.map(o=>bu({page:1,limit:1,status:o}))]);return i.all=r.pagination.total,T_.forEach((o,v)=>{var k;i[o]=((k=a[v])==null?void 0:k.pagination.total)??0}),i}function xw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}`,{schema:zo,schemaContext:"getSession"})}function A_(i){const{signal:r,...a}=i;return Ue("/v1/sessions",{method:"POST",body:JSON.stringify(a),signal:r,schema:zo,schemaContext:"createSession"})}function Su(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}`,{method:"DELETE",schema:Iu,schemaContext:"killSession"})}function Cw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/health`,{schema:sw,schemaContext:"getSessionHealth"})}function ww(){return Ue("/v1/sessions/health")}function Ew(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/read`,{schema:ow,schemaContext:"getSessionMessages"})}function kw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/metrics`,{schema:rw,schemaContext:"getSessionMetrics"})}function Tw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/latency`,{schema:nw,schemaContext:"getSessionLatency"})}function Aw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/pane`)}function Rw(i,r){return Ue(`/v1/sessions/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({text:r}),schema:ew,schemaContext:"sendMessage"})}function Gp(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/approve`,{method:"POST"})}function Dw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/reject`,{method:"POST"})}function xu(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/interrupt`,{method:"POST"})}function Ow(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/escape`,{method:"POST"})}function Mw(i,r={}){return Ue(`/v1/sessions/${encodeURIComponent(i)}/fork`,{method:"POST",body:JSON.stringify(r),schema:zo,schemaContext:"forkSession"})}const R_=3,Nw=1e3;async function Yp(i,r){for(let a=0;a<R_;a++){if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");try{return await Pw(r)}catch{if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");if(a<R_-1){const o=Nw*Math.pow(2,a);await new Promise(v=>{const k=setTimeout(v,o);r==null||r.addEventListener("abort",()=>{clearTimeout(k),v(void 0)},{once:!0})})}}}throw i==null||i(),new Error("Real-time updates unavailable")}function Wp(i,r,a,o){const v=`/v1/sessions/${encodeURIComponent(i)}/events`;let k=null,E=!1;const c=new AbortController;return a?Yp(o==null?void 0:o.onGiveUp,c.signal).then(h=>{if(E)return;const u=`${v}?token=${encodeURIComponent(h.token)}`;k=new Ao(u,r,o)}).catch(()=>{}):k=new Ao(v,r,o),()=>{E=!0,c.abort(),k==null||k.close()}}function Lw(i,r,a){const o="/v1/events";let v=null,k=!1;const E=new AbortController,c=h=>{try{const u=dw.safeParse(JSON.parse(h.data));if(!u.success){console.warn("Global SSE event failed validation",u.error.message);return}i(u.data)}catch{}};return r?Yp(a==null?void 0:a.onGiveUp,E.signal).then(h=>{if(k)return;const u=`${o}?token=${encodeURIComponent(h.token)}`;v=new Ao(u,c,a)}).catch(()=>{}):v=new Ao(o,c,a),()=>{var h;k=!0,E.abort(),(h=a==null?void 0:a.onClose)==null||h.call(a),v==null||v.close()}}function jw(i,r){return Ue(`/v1/sessions/${encodeURIComponent(i)}/command`,{method:"POST",body:JSON.stringify({command:r})})}function Bw(i,r){return Ue(`/v1/sessions/${encodeURIComponent(i)}/bash`,{method:"POST",body:JSON.stringify({command:r})})}function zw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/screenshot`,{method:"POST"})}function Hw(i){const{signal:r,...a}=i;return Ue("/v1/sessions/batch",{method:"POST",signal:r,body:JSON.stringify(a)})}function Uw(i){return Ue("/v1/pipelines",{method:"POST",body:JSON.stringify(i)})}function $w(){return Ue("/v1/pipelines")}function Iw(i){return Ue(`/v1/pipelines/${encodeURIComponent(i)}`)}function Pw(i){return Ue("/v1/auth/sse-token",{method:"POST",signal:i})}function Zw(i){return Ue("/v1/auth/keys",{method:"POST",body:JSON.stringify({name:i}),schema:Q2,schemaContext:"createAuthKey"})}function Fw(){return Ue("/v1/auth/keys",{schema:Gn(J2),schemaContext:"getAuthKeys"})}function qw(i){return Ue(`/v1/auth/keys/${encodeURIComponent(i)}`,{method:"DELETE",schema:Iu,schemaContext:"revokeAuthKey"})}function Kw(i){return Ue("/v1/templates",{method:"POST",body:JSON.stringify(i)})}function Vw(){return Ue("/v1/templates")}const vo=new Map;let Gw=0;const Si=vp(i=>({toasts:[],addToast:(r,a,o)=>{const v=`toast-${++Gw}`,k=setTimeout(()=>{vo.delete(v),i(E=>({toasts:E.toasts.filter(c=>c.id!==v)}))},4e3);return vo.set(v,k),i(E=>({toasts:[...E.toasts,{id:v,type:r,title:a,description:o}]})),v},removeToast:r=>{const a=vo.get(r);a&&(clearTimeout(a),vo.delete(r)),i(o=>({toasts:o.toasts.filter(v=>v.id!==r)}))}})),Yw={error:"border-red-500/50 bg-red-950/80 text-red-200",success:"border-green-500/50 bg-green-950/80 text-green-200",info:"border-cyan-500/50 bg-cyan-950/80 text-cyan-200",warning:"border-yellow-500/50 bg-yellow-950/80 text-yellow-200"};function Ww({id:i,type:r,title:a,description:o}){const v=Si(k=>k.removeToast);return b.jsxs("div",{role:"alert",className:`flex items-start gap-3 rounded-lg border px-4 py-3 shadow-lg backdrop-blur-sm animate-slide-in ${Yw[r]}`,children:[b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("p",{className:"text-sm font-medium",children:a}),o&&b.jsx("p",{className:"mt-0.5 text-xs opacity-80",children:o})]}),b.jsx("button",{onClick:()=>v(i),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:b.jsx(Vn,{className:"h-3.5 w-3.5"})})]})}function Xw(){const i=Si(r=>r.toasts);return i.length===0?null:b.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:i.map(r=>b.jsx("div",{className:"pointer-events-auto",children:b.jsx(Ww,{id:r.id,type:r.type,title:r.title,description:r.description})},r.id))})}const Jw=[{to:"/",label:"Overview",icon:Hb},{to:"/pipelines",label:"Pipelines",icon:dp},{to:"/auth/keys",label:"Auth Keys",icon:_u}],Qw=5,eE=1e3;function tE(){const i=et(u=>u.sseConnected),r=et(u=>u.setSseConnected),a=et(u=>u.sseError),o=et(u=>u.setSseError),v=et(u=>u.addActivity),k=et(u=>u.token),E=I.useRef(null),[c,h]=I.useState(0);return I.useEffect(()=>{let u=!1,y,f=null;function x(T){if(!u)try{y=Lw(O=>{O.sessionId&&v(O)},k,{onOpen:()=>{E.current&&(clearTimeout(E.current),E.current=null),r(!0),o(null),h(0)},onClose:()=>{E.current=setTimeout(()=>{r(!1)},2e3)},onGiveUp:()=>{o("SSE connection failed — real-time updates unavailable"),r(!1)}})}catch(O){if(console.error("Failed to subscribe to global SSE (attempt %d):",T+1,O),T<Qw){const C=eE*Math.pow(2,T);h(T+1),f=setTimeout(()=>x(T+1),C)}else o("SSE subscription failed after retries — real-time updates unavailable"),r(!1)}}return x(0),()=>{u=!0,E.current&&clearTimeout(E.current),f&&clearTimeout(f),y==null||y()}},[r,o,v,k]),b.jsxs("div",{className:"flex h-screen overflow-hidden bg-void",children:[b.jsxs("aside",{className:"flex w-56 flex-col border-r border-void-lighter bg-void-light shrink-0",children:[b.jsxs("div",{className:"flex items-center gap-2 px-4 py-5 border-b border-void-lighter",children:[b.jsx(i1,{className:"h-6 w-6 text-blue-500"}),b.jsx("span",{className:"text-lg font-semibold tracking-tight text-gray-100",children:"Aegis"})]}),b.jsxs("nav",{className:"flex flex-col gap-1 px-2 py-4 flex-1",children:[Jw.map(({to:u,label:y,icon:f})=>b.jsxs(cp,{to:u,end:u==="/",className:({isActive:x})=>`flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${x?"bg-cyan/10 text-cyan":"text-gray-400 hover:bg-void-lighter hover:text-gray-200"}`,children:[b.jsx(f,{className:"h-4 w-4"}),y]},u)),b.jsx("div",{className:"mt-4 border-t border-void-lighter pt-4 opacity-40",children:b.jsxs("button",{type:"button",disabled:!0,"aria-disabled":"true",title:"Sessions navigation is not available yet",className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm text-gray-500",children:[b.jsx(a1,{className:"h-4 w-4"}),"Sessions"]})})]})]}),b.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[b.jsxs("header",{className:"flex items-center justify-between border-b border-void-lighter bg-void-light px-6 py-3 shrink-0",children:[b.jsx("h1",{className:"text-sm font-medium text-gray-300",children:"Aegis Dashboard"}),b.jsx("div",{className:"flex items-center gap-3",children:b.jsx("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",title:a??void 0,children:a?b.jsxs(b.Fragment,{children:[b.jsx(Mu,{className:"h-3 w-3 text-amber-500"}),b.jsxs("span",{className:"text-amber-500",children:["SSE Error",c>0?` (retry ${c})`:""]})]}):b.jsxs(b.Fragment,{children:[b.jsx("span",{className:`status-dot ${i?"status-dot--idle":""}`,style:i?void 0:{backgroundColor:"#666"}}),i?"SSE Live":"SSE Off"]})})})]}),b.jsx("main",{className:"flex-1 overflow-auto p-6",children:b.jsx(Ay,{})})]}),b.jsx(Xw,{})]})}function iE(i){if(i<0)return"0s";const r=Math.floor(i/3600),a=Math.floor(i%3600/60);return r>0&&a>0?`${r}h ${a}m`:r>0?`${r}h`:a>0?`${a}m`:`${Math.floor(i)}s`}function Zs(i){const r=Date.now()-i;if(r<0)return"just now";const a=Math.floor(r/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);if(o<60)return`${o}m ago`;const v=Math.floor(o/60);return v<24?`${v}h ago`:`${Math.floor(v/24)}d ago`}function sE(i){if(i<0)return"0s";const r=Math.floor(i/1e3);if(r<60)return`${r}s`;const a=Math.floor(r/60),o=r%60;if(a<60)return`${a}m ${o.toString().padStart(2,"0")}s`;const v=Math.floor(a/60),k=a%60;return`${v}h ${k.toString().padStart(2,"0")}m`}const rE=15e3,nE=6e4;function aE(i){return new Date(i).toLocaleString()}function oE(i){return i.length<=12?"•".repeat(i.length):`${i.slice(0,8)}${"•".repeat(Math.max(8,i.length-12))}${i.slice(-4)}`}function lE(){const[i,r]=I.useState([]),[a,o]=I.useState(!0),[v,k]=I.useState(null),[E,c]=I.useState(""),[h,u]=I.useState(!1),[y,f]=I.useState(!1),[x,T]=I.useState(null),[O,C]=I.useState(null),[m,g]=I.useState(!1),d=Si(M=>M.addToast),p=I.useCallback(async(M=!1)=>{M?f(!0):o(!0);try{const w=await Fw();r(w.slice().sort((L,$)=>$.createdAt-L.createdAt)),k(null)}catch(w){const L=w instanceof Error?w.message:"Failed to load auth keys";k(L),d("error","Failed to load auth keys",L)}finally{M?f(!1):o(!1)}},[d]);I.useEffect(()=>{p();const M=setInterval(()=>{p(!0)},rE);return()=>clearInterval(M)},[p]),I.useEffect(()=>{if(!O)return;const M=setTimeout(()=>{C(null),g(!1)},nE);return()=>clearTimeout(M)},[O]);async function S(M){M.preventDefault();const w=E.trim();if(w){u(!0);try{const L=await Zw(w);C(L),g(!1),c(""),d("success","Auth key created","Store the secret now. It is only shown once."),await p(!0)}catch(L){d("error","Failed to create auth key",L instanceof Error?L.message:void 0)}finally{u(!1)}}}async function A(){var M;if(O)try{if(!((M=navigator.clipboard)!=null&&M.writeText))throw new Error("Clipboard access is unavailable in this browser");await navigator.clipboard.writeText(O.key),d("success","Auth key copied")}catch(w){d("warning","Failed to copy auth key",w instanceof Error?w.message:void 0)}}async function R(M,w){if(window.confirm(`Revoke auth key "${w}"? This cannot be undone.`)){T(M);try{await qw(M),r(L=>L.filter($=>$.id!==M)),(O==null?void 0:O.id)===M&&(C(null),g(!1)),d("success","Auth key revoked")}catch(L){d("error","Failed to revoke auth key",L instanceof Error?L.message:void 0)}finally{T(null)}}}return b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Auth Keys"}),b.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Create, review, and revoke dashboard API keys without exposing stored secrets."})]}),b.jsxs("button",{type:"button",onClick:()=>void p(!0),disabled:y,className:"flex min-h-[44px] items-center justify-center gap-2 rounded border border-[#1a1a2e] bg-[#111118] px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:border-[#00e5ff]/30 hover:text-[#00e5ff] disabled:cursor-not-allowed disabled:opacity-60",children:[b.jsx(pp,{className:`h-3.5 w-3.5 ${y?"animate-spin":""}`}),"Refresh"]})]}),b.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,360px)_minmax(0,1fr)]",children:[b.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[b.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-100",children:[b.jsx(Kn,{className:"h-4 w-4 text-[#00e5ff]"}),"Create Key"]}),b.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"New secrets are never persisted in the dashboard and are cleared from view after one minute."}),b.jsxs("form",{className:"mt-4 space-y-4",onSubmit:S,children:[b.jsxs("div",{children:[b.jsx("label",{className:"mb-1.5 block text-xs font-medium text-gray-400",htmlFor:"auth-key-name",children:"Key Name"}),b.jsx("input",{id:"auth-key-name",type:"text",value:E,onChange:M=>c(M.target.value),placeholder:"ops-primary",className:"min-h-[44px] w-full rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2.5 text-sm text-gray-200 placeholder-gray-600 focus:border-[#00e5ff] focus:outline-none"})]}),b.jsxs("button",{type:"submit",disabled:h||!E.trim(),className:"flex min-h-[44px] w-full items-center justify-center gap-2 rounded border border-[#00e5ff]/30 bg-[#00e5ff]/10 px-3 py-2 text-sm font-medium text-[#00e5ff] transition-colors hover:bg-[#00e5ff]/20 disabled:cursor-not-allowed disabled:opacity-60",children:[b.jsx(_u,{className:"h-4 w-4"}),h?"Creating…":"Create Auth Key"]})]}),O?b.jsxs("div",{className:"mt-5 rounded-lg border border-emerald-500/20 bg-emerald-500/5 p-4",role:"status",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{children:[b.jsx("h3",{className:"text-sm font-semibold text-emerald-300",children:"Store this key now"}),b.jsx("p",{className:"mt-1 text-xs text-emerald-200/80",children:"This secret is shown once and is hidden by default."})]}),b.jsx("button",{type:"button",onClick:()=>{C(null),g(!1)},className:"text-xs font-medium text-emerald-200/80 transition-colors hover:text-emerald-200",children:"Dismiss"})]}),b.jsxs("dl",{className:"mt-4 space-y-3 text-sm text-gray-200",children:[b.jsxs("div",{children:[b.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Name"}),b.jsx("dd",{className:"mt-1 font-medium text-gray-100",children:O.name})]}),b.jsxs("div",{children:[b.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Secret"}),b.jsx("dd",{className:"mt-1 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 font-mono text-xs text-[#9af5ff]",children:m?O.key:oE(O.key)})]})]}),b.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[b.jsxs("button",{type:"button",onClick:()=>g(M=>!M),className:"flex min-h-[40px] items-center gap-2 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:border-[#00e5ff]/30 hover:text-[#00e5ff]",children:[m?b.jsx(Db,{className:"h-3.5 w-3.5"}):b.jsx(Mb,{className:"h-3.5 w-3.5"}),m?"Hide secret":"Reveal secret"]}),b.jsxs("button",{type:"button",onClick:()=>void A(),className:"flex min-h-[40px] items-center gap-2 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:border-[#00e5ff]/30 hover:text-[#00e5ff]",children:[b.jsx(kb,{className:"h-3.5 w-3.5"}),"Copy secret"]})]})]}):null]}),b.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[b.jsx("div",{className:"flex items-center justify-between gap-3 border-b border-[#1a1a2e] pb-4",children:b.jsxs("div",{children:[b.jsx("h3",{className:"text-sm font-semibold text-gray-100",children:"Existing Keys"}),b.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[i.length," key",i.length===1?"":"s"," configured"]})]})}),a?b.jsx("div",{className:"flex min-h-[240px] items-center justify-center text-sm text-gray-500",children:b.jsx("div",{className:"animate-pulse",children:"Loading auth keys…"})}):v?b.jsxs("div",{className:"mt-4 rounded-lg border border-amber-500/20 bg-amber-500/5 p-4 text-sm text-amber-200",children:[b.jsx("p",{className:"font-medium",children:"Unable to load auth keys"}),b.jsx("p",{className:"mt-1 text-amber-200/80",children:v}),b.jsx("button",{type:"button",onClick:()=>void p(),className:"mt-4 rounded border border-amber-500/30 px-3 py-2 text-xs font-medium text-amber-200 transition-colors hover:bg-amber-500/10",children:"Retry"})]}):i.length===0?b.jsxs("div",{className:"flex min-h-[240px] flex-col items-center justify-center rounded-lg border border-dashed border-[#1a1a2e] bg-[#0a0a0f] px-6 text-center",children:[b.jsx(_u,{className:"h-8 w-8 text-gray-600"}),b.jsx("p",{className:"mt-4 text-sm font-medium text-gray-300",children:"No auth keys yet"}),b.jsx("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:"Create a key to grant API access without sharing the dashboard bearer token."})]}):b.jsx("div",{className:"mt-4 space-y-3",children:i.map(M=>b.jsx("article",{className:"rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-4",children:b.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[b.jsxs("div",{className:"min-w-0",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"truncate font-medium text-gray-100",children:M.name}),b.jsx("span",{className:"rounded-full border border-[#1a1a2e] bg-[#111118] px-2 py-0.5 font-mono text-[11px] text-gray-500",children:M.id})]}),b.jsxs("p",{className:"mt-2 text-sm text-gray-400",children:["Created ",b.jsx("span",{title:aE(M.createdAt),children:Zs(M.createdAt)})]})]}),b.jsxs("button",{type:"button",onClick:()=>void R(M.id,M.name),disabled:x===M.id,className:"flex min-h-[40px] items-center justify-center gap-2 rounded border border-red-500/20 bg-red-500/5 px-3 py-2 text-xs font-medium text-red-300 transition-colors hover:bg-red-500/10 disabled:cursor-not-allowed disabled:opacity-60",children:[b.jsx(Ou,{className:"h-3.5 w-3.5"}),x===M.id?"Revoking…":"Revoke"]})]})},M.id))})]})]})]})}const cE={blue:"text-[#3b82f6]",green:"text-[#22c55e]",amber:"text-[#f59e0b]",red:"text-[#ef4444]",purple:"text-[#a78bfa]"},uE={blue:"bg-[#3b82f6]",green:"bg-[#22c55e]",amber:"bg-[#f59e0b]",red:"bg-[#ef4444]",purple:"bg-[#a78bfa]"};function ct({label:i,value:r,icon:a,suffix:o,subLabel:v,color:k="blue",bar:E}){return b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[b.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm text-[#888]",children:[a,i]}),b.jsxs("div",{className:`font-mono text-2xl ${cE[k]}`,children:[r,o&&b.jsx("span",{className:"ml-1 text-base text-[#666]",children:o})]}),E!==void 0&&b.jsx("div",{className:"mt-2 h-1.5 w-full overflow-hidden rounded-full bg-[#1e1e2a]",children:b.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${uE[k]}`,style:{width:`${Math.min(100,Math.max(0,E))}%`}})}),v&&b.jsx("div",{className:"mt-1.5 text-xs text-[#666]",children:v})]})}function hE(){var Z,J,ee;const i=et(q=>q.metrics),r=et(q=>q.sseConnected),a=et(q=>q.setMetrics),[o,v]=I.useState(null),k=I.useCallback(async()=>{try{const[q,Q]=await Promise.all([bw(),yw()]);a(q),v(Q)}catch(q){Si.getState().addToast("error","Failed to load metrics",q instanceof Error?q.message:void 0)}},[a]);I.useEffect(()=>{if(k(),r)return;const q=setInterval(k,1e4);return()=>clearInterval(q)},[k,r]);const E=i,c=(E==null?void 0:E.sessions.currently_active)??(o==null?void 0:o.sessions.active)??0,h=(E==null?void 0:E.sessions.total_created)??(o==null?void 0:o.sessions.total)??0,u=(E==null?void 0:E.sessions.completed)??0,y=(E==null?void 0:E.sessions.failed)??0,x=(E==null?void 0:E.prompt_delivery.success_rate)??null,T=(E==null?void 0:E.prompt_delivery.delivered)??0,O=(E==null?void 0:E.prompt_delivery.failed)??0,C=(E==null?void 0:E.prompt_delivery.sent)??0,m=(o==null?void 0:o.uptime)??(E==null?void 0:E.uptime)??0,g=((Z=E==null?void 0:E.latency)==null?void 0:Z.hook_latency_ms.avg)??null,d=((J=E==null?void 0:E.latency)==null?void 0:J.permission_response_ms.avg)??null,p=((ee=E==null?void 0:E.latency)==null?void 0:ee.channel_delivery_ms.avg)??null,S=(E==null?void 0:E.webhooks_sent)??0,A=(E==null?void 0:E.webhooks_failed)??0,R=(E==null?void 0:E.auto_approvals)??0,M=(E==null?void 0:E.pipelines_created)??0,w=(E==null?void 0:E.batches_created)??0,L=(E==null?void 0:E.screenshots_taken)??0,$=(E==null?void 0:E.sessions.avg_messages_per_session)??0,F=q=>q===null?"—":`${Math.round(q)} ms`,K=x===null?"blue":x>=99?"green":x>=90?"amber":"red";return b.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-4",children:[b.jsx(ct,{label:"Active Sessions",value:c,icon:b.jsx(dp,{className:"h-4 w-4"})}),b.jsx(ct,{label:"Total Created",value:h,icon:b.jsx(i_,{className:"h-4 w-4"}),subLabel:h>0?`${$} avg msgs/session`:void 0}),u>0&&b.jsx(ct,{label:"Completed",value:u,icon:b.jsx(Du,{className:"h-4 w-4"}),color:"green"}),y>0&&b.jsx(ct,{label:"Failed",value:y,icon:b.jsx(Mu,{className:"h-4 w-4"}),color:"red"}),b.jsx(ct,{label:"Delivery Rate",value:x!==null?x.toFixed(1):"—",suffix:"%",icon:b.jsx(_1,{className:"h-4 w-4"}),color:K,bar:x??void 0}),T>0&&b.jsx(ct,{label:"Prompts Delivered",value:T,subLabel:C>0?`${C} sent total`:void 0,icon:b.jsx(pu,{className:"h-4 w-4"}),color:"green"}),O>0&&b.jsx(ct,{label:"Prompts Failed",value:O,icon:b.jsx(jr,{className:"h-4 w-4"}),color:"red"}),S>0&&b.jsx(ct,{label:"Webhooks Sent",value:S,icon:b.jsx(pu,{className:"h-4 w-4"}),color:"green",subLabel:A>0?`${A} failed`:"0 failed"}),A>0&&S===0&&b.jsx(ct,{label:"Webhooks Failed",value:A,icon:b.jsx(jr,{className:"h-4 w-4"}),color:"red"}),R>0&&b.jsx(ct,{label:"Auto-Approvals",value:R,icon:b.jsx(e1,{className:"h-4 w-4"}),color:"purple"}),M>0&&b.jsx(ct,{label:"Pipelines Created",value:M,icon:b.jsx(Lb,{className:"h-4 w-4"}),color:"purple"}),w>0&&b.jsx(ct,{label:"Batches Created",value:w,icon:b.jsx(i_,{className:"h-4 w-4"}),color:"purple"}),L>0&&b.jsx(ct,{label:"Screenshots",value:L,icon:b.jsx(mp,{className:"h-4 w-4"})}),b.jsx(ct,{label:"Avg Hook Latency",value:F(g),icon:b.jsx(fo,{className:"h-4 w-4"})}),b.jsx(ct,{label:"Avg Permission Latency",value:F(d),icon:b.jsx(fo,{className:"h-4 w-4"})}),b.jsx(ct,{label:"Avg Channel Latency",value:F(p),icon:b.jsx(fo,{className:"h-4 w-4"})}),b.jsx(ct,{label:"Uptime",value:iE(m),icon:b.jsx(fo,{className:"h-4 w-4"})})]})}const D_={idle:"#10b981",working:"#3b82f6",permission_prompt:"#f59e0b",bash_approval:"#f59e0b",plan_mode:"#ff8800",ask_question:"#ef4444",settings:"#3b82f6",error:"#ff0000",compacting:"#f59e0b",context_warning:"#f59e0b",waiting_for_input:"#f59e0b",unknown:"#666666"},dE=new Set(["working","permission_prompt","bash_approval","ask_question"]),O_={idle:"Idle",working:"Working",permission_prompt:"Permission prompt",bash_approval:"Bash approval",plan_mode:"Plan mode",ask_question:"Awaiting question",settings:"Settings",error:"Error",compacting:"Compacting",context_warning:"Context warning",waiting_for_input:"Waiting for input",unknown:"Unknown"};function Ho({status:i}){const r=D_[i]??D_.unknown,a=dE.has(i),o=O_[i]??O_.unknown;return b.jsx("span",{role:"img","aria-label":`Status: ${o}`,title:o,style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:r,boxShadow:`0 0 6px ${r}66`,animation:a?"pulse 1.5s ease-in-out infinite":void 0}})}const fE=5e3,M_=20,N_=100,mE={all:0,idle:0,working:0,compacting:0,context_warning:0,waiting_for_input:0,permission_prompt:0,plan_mode:0,ask_question:0,bash_approval:0,settings:0,error:0,unknown:0},L_=["all","idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"],Xp=i=>i.status==="permission_prompt"||i.status==="bash_approval",Jp=(i,r=40)=>i.length>r?`…${i.slice(i.length-r+1)}`:i;function j_(i){return i==="all"?"All":i.split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function _E(i,r){return r?`${i.windowName} ${i.id} ${i.workDir}`.toLowerCase().includes(r):!0}function pE(i,r){return i.id===r.id&&i.windowName===r.windowName&&i.workDir===r.workDir&&i.status===r.status&&i.createdAt===r.createdAt&&i.lastActivity===r.lastActivity&&i.permissionMode===r.permissionMode}function Qp(i,r){return pE(i.session,r.session)&&i.isAlive===r.isAlive&&i.selected===r.selected&&i.currentAction===r.currentAction}const vE=I.memo(function({session:r,isAlive:a,selected:o,currentAction:v,onToggleSelect:k,onApprove:E,onInterrupt:c,onKill:h}){return b.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors active:bg-[#1a1a2e]/50",children:[b.jsxs("div",{className:"mb-2 flex items-start justify-between gap-3",children:[b.jsxs("label",{className:"flex min-w-0 flex-1 items-center gap-3 text-sm text-gray-200",children:[b.jsx("input",{type:"checkbox","aria-label":`Select session ${r.windowName||r.id}`,checked:o,onChange:u=>k(r.id,u.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"}),b.jsxs("div",{className:"min-w-0",children:[b.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[b.jsx(Ho,{status:r.status}),b.jsx(di,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"truncate font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id}),!a&&b.jsx(jr,{className:"h-3.5 w-3.5 shrink-0 text-red-400"})]}),b.jsx("div",{className:"mt-1 truncate font-mono text-xs text-gray-500",children:Jp(r.workDir,50)})]})]}),b.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[Xp(r)&&b.jsx("button",{onClick:u=>E(u,r.id),disabled:v==="approve",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-green-900/30 p-2 text-green-400 transition-colors hover:bg-green-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Approve",children:b.jsx(_p,{className:"h-4 w-4"})}),b.jsx("button",{onClick:u=>c(u,r.id),disabled:v==="interrupt"||v==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-yellow-900/30 p-2 text-yellow-400 transition-colors hover:bg-yellow-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Interrupt",children:b.jsx(fp,{className:"h-4 w-4"})}),b.jsx("button",{onClick:u=>h(u,r.id),disabled:v==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-red-900/30 p-2 text-red-400 transition-colors hover:bg-red-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Kill",children:b.jsx(jr,{className:"h-4 w-4"})})]})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-gray-500",children:[b.jsxs("span",{children:["Age: ",Zs(r.createdAt)]}),b.jsxs("span",{children:["Active: ",Zs(r.lastActivity)]}),r.permissionMode&&r.permissionMode!=="default"?b.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-green-400",children:[b.jsx(Du,{className:"h-3 w-3"})," ",r.permissionMode]}):b.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-void-lighter px-2 py-0.5 text-gray-500",children:"default"})]})]})},Qp),gE=I.memo(function({session:r,isAlive:a,selected:o,currentAction:v,onToggleSelect:k,onApprove:E,onInterrupt:c,onKill:h}){return b.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[b.jsx("td",{className:"px-4 py-3",children:b.jsx("input",{type:"checkbox","aria-label":`Select session ${r.windowName||r.id}`,checked:o,onChange:u=>k(r.id,u.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"})}),b.jsx("td",{className:"px-4 py-3",children:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Ho,{status:r.status}),!a&&b.jsx(jr,{className:"h-3.5 w-3.5 text-red-400"})]})}),b.jsx("td",{className:"px-4 py-3",children:b.jsx(di,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id})}),b.jsx("td",{className:"max-w-[200px] truncate px-4 py-3 font-mono text-xs text-gray-400",title:r.workDir,children:Jp(r.workDir)}),b.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:Zs(r.createdAt)}),b.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:Zs(r.lastActivity)}),b.jsx("td",{className:"px-4 py-3",children:r.permissionMode&&r.permissionMode!=="default"?b.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-xs text-green-400",children:[b.jsx(Du,{className:"h-3 w-3"}),r.permissionMode]}):b.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-void-lighter px-2 py-0.5 text-xs text-gray-500",children:"default"})}),b.jsx("td",{className:"px-4 py-3",children:b.jsxs("div",{className:"flex items-center gap-1.5",children:[Xp(r)&&b.jsx("button",{onClick:u=>E(u,r.id),disabled:v==="approve",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-green-900/30 text-xs font-medium text-green-400 transition-colors hover:bg-green-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Approve",children:b.jsx(_p,{className:"h-3 w-3"})}),b.jsx("button",{onClick:u=>c(u,r.id),disabled:v==="interrupt"||v==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-yellow-900/30 text-xs font-medium text-yellow-400 transition-colors hover:bg-yellow-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Interrupt",children:b.jsx(fp,{className:"h-3 w-3"})}),b.jsx("button",{onClick:u=>h(u,r.id),disabled:v==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-red-900/30 text-xs font-medium text-red-400 transition-colors hover:bg-red-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Kill",children:b.jsx(jr,{className:"h-3 w-3"})})]})})]})},Qp);function yE(){const i=et(B=>B.sessions),r=et(B=>B.healthMap),a=et(B=>B.sseConnected),o=et(B=>B.setSessionsAndHealth),v=Si(B=>B.addToast),[k,E]=I.useState({}),[c,h]=I.useState([]),[u,y]=I.useState(null),[f,x]=I.useState("all"),[T,O]=I.useState(mE),[C,m]=I.useState(""),g=I.useDeferredValue(C.trim().toLowerCase()),[d,p]=I.useState({page:1,limit:M_,total:0,totalPages:0}),[S,A]=I.useState(1),[R,M]=I.useState(!0),[w,L]=I.useState(!1),$=I.useCallback(async()=>{M(!0);try{const B=g.length>0,P=bu({page:B?1:S,limit:B?N_:M_,status:f==="all"?void 0:f}),[Y,re]=await Promise.all([P,Sw()]),he=B?Y.sessions.filter(H=>_E(H,g)):Y.sessions;let V={};try{const H=await ww(),ce=new Set(he.map(oe=>oe.id));for(const[oe,me]of Object.entries(H))ce.has(oe)&&(V[oe]={alive:me.alive,loading:!1})}catch{}o(he,V),O(re),L(B&&Y.pagination.total>Y.sessions.length),p(B?{page:1,limit:he.length,total:he.length,totalPages:he.length>0?1:0}:Y.pagination)}catch(B){v("error","Failed to fetch sessions",B instanceof Error?B.message:void 0)}finally{M(!1)}},[v,g,S,o,f]);I.useEffect(()=>{if($(),a)return;const B=setInterval($,fE);return()=>clearInterval(B)},[$,a]),I.useEffect(()=>{const B=new Set(i.map(P=>P.id));h(P=>P.filter(Y=>B.has(Y)))},[i]);const F=I.useCallback(async(B,P,Y)=>{E(re=>({...re,[B]:P}));try{await Y()}finally{E(re=>({...re,[B]:null}))}},[]),K=I.useCallback(async(B,P)=>{B.preventDefault(),await F(P,"approve",async()=>{try{await Gp(P),await $()}catch(Y){v("error","Approve failed",Y instanceof Error?Y.message:void 0)}})},[v,$,F]),Z=I.useCallback(async(B,P)=>{B.preventDefault(),await F(P,"interrupt",async()=>{try{await xu(P),await $()}catch(Y){v("error","Interrupt failed",Y instanceof Error?Y.message:void 0)}})},[v,$,F]),J=I.useCallback(async(B,P)=>{B.preventDefault(),confirm("Kill this session?")&&await F(P,"kill",async()=>{try{await Su(P),await $()}catch(Y){v("error","Failed to kill session",Y instanceof Error?Y.message:void 0)}})},[v,$,F]),ee=I.useCallback((B,P)=>{h(Y=>P?Y.includes(B)?Y:[...Y,B]:Y.filter(re=>re!==B))},[]),q=I.useCallback(B=>{if(!B){h([]);return}h(i.map(P=>P.id))},[i]),Q=I.useCallback(async B=>{if(c.length!==0&&!(B==="kill"&&!confirm(`Kill ${c.length} selected session${c.length===1?"":"s"}?`))){y(B),E(P=>{const Y={...P};for(const re of c)Y[re]=B;return Y});try{const P=await Promise.allSettled(c.map(he=>B==="interrupt"?xu(he):Su(he))),Y=P.filter(he=>he.status==="fulfilled").length,re=P.length-Y;Y>0&&v("success",B==="interrupt"?"Bulk interrupt complete":"Bulk kill complete",`${Y} session${Y===1?"":"s"} updated.`),re>0&&v("warning",`Some sessions failed to ${B}`,`${re} session${re===1?"":"s"} could not be updated.`),h([]),await $()}finally{y(null),E(P=>{const Y={...P};for(const re of c)Y[re]=null;return Y})}}},[v,$,c]),ne=I.useMemo(()=>new Set(c),[c]),j=I.useMemo(()=>i.map(B=>{const P=r[B.id];return{session:B,isAlive:P?P.alive:!0,selected:ne.has(B.id),currentAction:k[B.id]??null}}),[k,r,ne,i]),U=i.length>0&&i.every(B=>ne.has(B.id)),N=f!=="all"||g.length>0;return R&&i.length===0?b.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:b.jsx("p",{className:"text-gray-500",children:"Loading sessions..."})}):b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[b.jsxs("div",{className:"flex flex-col gap-4 xl:flex-row xl:items-start xl:justify-between",children:[b.jsxs("div",{className:"flex-1 space-y-3",children:[b.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[b.jsxs("label",{className:"flex min-w-0 flex-1 items-center gap-2 rounded-md border border-void-lighter bg-void px-3 py-2 text-sm text-gray-300 focus-within:border-cyan",children:[b.jsx(Wb,{className:"h-4 w-4 text-gray-500"}),b.jsx("input",{value:C,onChange:B=>{m(B.target.value),A(1)},placeholder:"Search by session name or work directory",className:"w-full bg-transparent text-sm text-gray-100 outline-none placeholder:text-gray-500","aria-label":"Search sessions"})]}),b.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-400",children:[b.jsx("span",{children:"Status"}),b.jsx("select",{value:f,onChange:B=>{x(B.target.value),A(1)},"aria-label":"Filter by status",className:"rounded-md border border-void-lighter bg-void px-3 py-2 text-sm text-gray-100 outline-none focus:border-cyan",children:L_.map(B=>b.jsxs("option",{value:B,children:[j_(B)," (",T[B]??0,")"]},B))})]})]}),b.jsx("div",{className:"flex flex-wrap gap-2",children:L_.filter(B=>B==="all"||(T[B]??0)>0).map(B=>{const P=f===B;return b.jsxs("button",{type:"button",onClick:()=>{x(B),A(1)},className:`rounded-full border px-3 py-1 text-xs transition-colors ${P?"border-cyan bg-cyan/10 text-cyan":"border-void-lighter bg-void text-gray-400 hover:border-cyan/40 hover:text-gray-200"}`,children:[j_(B)," ",b.jsx("span",{className:"text-gray-500",children:T[B]??0})]},B)})})]}),b.jsxs("div",{className:"text-right text-xs text-gray-500",children:[b.jsxs("div",{children:["Showing ",b.jsx("span",{className:"text-gray-300",children:i.length}),g.length>0?` matching session${i.length===1?"":"s"}`:` of ${d.total} session${d.total===1?"":"s"}`]}),w&&b.jsxs("div",{className:"mt-1 text-amber-400",children:["Search scans the first ",N_," sessions in the selected status."]})]})]}),c.length>0&&b.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-md border border-cyan/20 bg-cyan/5 p-3 lg:flex-row lg:items-center lg:justify-between",children:[b.jsxs("div",{className:"text-sm text-gray-300",children:[c.length," session",c.length===1?"":"s"," selected"]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx("button",{type:"button",onClick:()=>Q("interrupt"),disabled:u!==null,className:"rounded-md bg-yellow-900/30 px-3 py-2 text-sm font-medium text-yellow-300 transition-colors hover:bg-yellow-900/50 disabled:pointer-events-none disabled:opacity-40",children:"Interrupt Selected"}),b.jsx("button",{type:"button",onClick:()=>Q("kill"),disabled:u!==null,className:"rounded-md bg-red-900/30 px-3 py-2 text-sm font-medium text-red-300 transition-colors hover:bg-red-900/50 disabled:pointer-events-none disabled:opacity-40",children:"Kill Selected"}),b.jsx("button",{type:"button",onClick:()=>h([]),disabled:u!==null,className:"rounded-md border border-void-lighter px-3 py-2 text-sm text-gray-400 transition-colors hover:border-gray-500 hover:text-gray-200 disabled:pointer-events-none disabled:opacity-40",children:"Clear"})]})]})]}),i.length===0?b.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:b.jsx("p",{className:"text-gray-400",children:N?"No sessions match the current filter.":"No active sessions"})}):b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"space-y-3 md:hidden",children:[b.jsxs("div",{className:"flex items-center justify-between rounded-md border border-void-lighter bg-[#111118] px-4 py-3 text-sm text-gray-400",children:[b.jsxs("label",{className:"flex items-center gap-2",children:[b.jsx("input",{type:"checkbox","aria-label":"Select all visible sessions",checked:U,onChange:B=>q(B.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"}),"Select visible"]}),b.jsxs("span",{children:[i.length," visible"]})]}),j.map(B=>b.jsx(vE,{session:B.session,isAlive:B.isAlive,selected:B.selected,currentAction:B.currentAction,onToggleSelect:ee,onApprove:K,onInterrupt:Z,onKill:J},B.session.id))]}),b.jsx("div",{className:"hidden overflow-x-auto rounded-lg border border-void-lighter bg-[#111118] md:block",children:b.jsxs("table",{className:"w-full text-left text-sm",children:[b.jsx("thead",{children:b.jsxs("tr",{className:"border-b border-void-lighter text-[#666]",children:[b.jsx("th",{className:"px-4 py-3 font-medium",children:b.jsx("input",{type:"checkbox","aria-label":"Select all visible sessions",checked:U,onChange:B=>q(B.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"})}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"WorkDir"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Age"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Last Activity"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Permission"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Actions"})]})}),b.jsx("tbody",{children:j.map(B=>b.jsx(gE,{session:B.session,isAlive:B.isAlive,selected:B.selected,currentAction:B.currentAction,onToggleSelect:ee,onApprove:K,onInterrupt:Z,onKill:J},B.session.id))})]})}),g.length===0&&d.totalPages>1&&b.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-void-lighter bg-[#111118] px-4 py-3 text-sm text-gray-400",children:[b.jsxs("span",{children:["Page ",d.page," of ",d.totalPages]}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsxs("button",{type:"button",onClick:()=>A(B=>Math.max(1,B-1)),disabled:d.page<=1,className:"flex items-center gap-1 rounded-md border border-void-lighter px-3 py-2 transition-colors hover:border-gray-500 hover:text-gray-200 disabled:pointer-events-none disabled:opacity-40",children:[b.jsx(vb,{className:"h-4 w-4"})," Previous"]}),b.jsxs("button",{type:"button",onClick:()=>A(B=>Math.min(d.totalPages,B+1)),disabled:d.page>=d.totalPages,className:"flex items-center gap-1 rounded-md border border-void-lighter px-3 py-2 transition-colors hover:border-gray-500 hover:text-gray-200 disabled:pointer-events-none disabled:opacity-40",children:["Next ",b.jsx(yb,{className:"h-4 w-4"})]})]})]})]})]})}const lu={session_status_change:{icon:pp,label:"Status",color:"#3b82f6"},session_message:{icon:Ib,label:"Message",color:"#10b981"},session_approval:{icon:s_,label:"Approval",color:"#f59e0b"},session_ended:{icon:Vb,label:"Ended",color:"#ef4444"},session_created:{icon:xb,label:"Created",color:"#6366f1"},session_stall:{icon:Mu,label:"Stall",color:"#d97706"},session_dead:{icon:r1,label:"Dead",color:"#dc2626"},session_subagent_start:{icon:d1,label:"Subagent",color:"#3b82f6"},session_subagent_stop:{icon:u1,label:"Subagent Done",color:"#10b981"},session_verification:{icon:s_,label:"Verification",color:"#0891b2"}};function ms(i,r="unknown"){return typeof i=="string"?i:r}function bE(i){const r=i.data;switch(i.event){case"session_status_change":{const a=ms(r.status),o=typeof r.detail=="string"?`: ${r.detail}`:"";return`Status -> ${a}${o}`}case"session_message":{const a=r.role==="user"?"User":r.role==="assistant"?"Claude":"System",o=typeof r.text=="string"?r.text:JSON.stringify(r.text??"");return`${a}: ${B_(o,80)}`}case"session_approval":{const a=typeof r.prompt=="string"?r.prompt:JSON.stringify(r.prompt??"");return`Approval needed: ${B_(a,80)}`}case"session_ended":return`Session ended: ${ms(r.reason)}`;case"session_created":return`Created in ${ms(r.workDir,"unknown dir")}`;case"session_stall":return`Session stalled: ${ms(r.stallType)}`;case"session_dead":return`Session dead: ${ms(r.stallType)}`;case"session_subagent_start":return`Subagent started: ${ms(r.name)}`;case"session_subagent_stop":return`Subagent finished: ${ms(r.name)}`;case"session_verification":return`Verification: ${ms(r.summary??r.status,"completed")}`;default:return JSON.stringify(r)}}function B_(i,r){return i.length>r?i.slice(0,r)+"...":i}function SE(i){try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function xE(){const i=et(u=>u.activities),r=et(u=>u.activityFilterSession),a=et(u=>u.activityFilterType),o=et(u=>u.setActivityFilterSession),v=et(u=>u.setActivityFilterType),k=et(u=>u.sessions),E=I.useMemo(()=>i.filter(u=>!(r&&u.sessionId!==r||a&&u.event!==a)),[i,r,a]),c=I.useMemo(()=>{const u=new Map;for(const y of k)u.set(y.id,y.windowName??y.id.slice(0,8));return u},[k]),h=u=>c.get(u)??(u??"unknown").slice(0,8);return b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg w-full",children:[b.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 px-3 sm:px-4 py-3 border-b border-[#1a1a2e]",children:[b.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Activity Stream"}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsxs("select",{value:r??"",onChange:u=>o(u.target.value||null),className:"min-h-[44px] text-xs bg-[#0a0a0f] border border-[#1a1a2e] rounded px-2 py-2 text-gray-400 focus:outline-none focus:border-[#3b82f6]",children:[b.jsx("option",{value:"",children:"All sessions"}),k.map(u=>b.jsx("option",{value:u.id,children:u.windowName||u.id.slice(0,8)},u.id))]}),b.jsxs("select",{value:a??"",onChange:u=>v(u.target.value||null),className:"min-h-[44px] text-xs bg-[#0a0a0f] border border-[#1a1a2e] rounded px-2 py-2 text-gray-400 focus:outline-none focus:border-[#3b82f6]",children:[b.jsx("option",{value:"",children:"All types"}),Object.entries(lu).map(([u,y])=>b.jsx("option",{value:u,children:y.label},u))]}),(r||a)&&b.jsx("button",{onClick:()=>{o(null),v(null)},className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300",children:b.jsx(Vn,{className:"h-4 w-4"})})]})]}),b.jsxs("div",{className:"max-h-[360px] overflow-y-auto divide-y divide-[#1a1a2e]/50",children:[E.length===0&&b.jsx("div",{className:"px-4 py-8 text-center text-sm text-[#555]",children:"No activity yet"}),E.map((u,y)=>{const f=lu[u.event]??lu.session_status_change,x=f.icon;return b.jsxs("div",{className:"flex items-start gap-2 sm:gap-3 px-3 sm:px-4 py-2 sm:py-2.5 hover:bg-[#1a1a2e]/30 transition-colors",children:[b.jsx(x,{className:"h-4 w-4 mt-0.5 shrink-0",style:{color:f.color}}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[b.jsx("span",{className:"text-xs font-medium text-gray-300 truncate",children:h(u.sessionId)}),b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded hidden sm:inline-block",style:{backgroundColor:`${f.color}15`,color:f.color},children:f.label})]}),b.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:bE(u)})]}),b.jsx("span",{className:"text-[10px] text-[#444] shrink-0 tabular-nums mt-0.5",children:SE(u.timestamp)})]},`${u.sessionId}-${u.timestamp}-${y}`)})]})]})}let CE=0;function Bn(){return{workDir:"",name:"",prompt:"",_key:CE++}}function wE({open:i,onClose:r}){const a=Do(),o=I.useRef(null),v=I.useRef(null),k=I.useCallback(()=>{Q(),r()},[r]),E=I.useRef(null);I.useEffect(()=>{if(!i)return;const P=Y=>{var re;Y.key==="Escape"&&((re=v.current)==null||re.abort(),k())};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[i,k]),I.useEffect(()=>{if(!i)return;const P=E.current;if(!P)return;const Y='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',re=he=>{if(he.key!=="Tab")return;const V=Array.from(P.querySelectorAll(Y));if(V.length===0)return;const H=V[0],ce=V[V.length-1];he.shiftKey?document.activeElement===H&&(he.preventDefault(),ce.focus()):document.activeElement===ce&&(he.preventDefault(),H.focus())};return P.addEventListener("keydown",re),()=>P.removeEventListener("keydown",re)},[i]),I.useEffect(()=>{if(i){const P=setTimeout(()=>{var Y;return(Y=o.current)==null?void 0:Y.focus()},50);return()=>clearTimeout(P)}},[i]);const[c,h]=I.useState([]),[u,y]=I.useState(!1);I.useEffect(()=>{i&&(y(!0),Vw().then(h).catch(()=>h([])).finally(()=>y(!1)))},[i]);const[f,x]=I.useState(""),[T,O]=I.useState(""),[C,m]=I.useState(""),[g,d]=I.useState("default"),[p,S]=I.useState(!1),[A,R]=I.useState(null),[M,w]=I.useState("single"),[L,$]=I.useState(""),[F,K]=I.useState([Bn(),Bn()]),[Z,J]=I.useState(""),[ee,q]=I.useState(null);function Q(){x(""),O(""),m(""),d("default"),S(!1),R(null),K([Bn(),Bn()]),J(""),q(null),w("single"),$("")}function ne(){F.length>=10||K([...F,Bn()])}function j(P){F.length<=1||K(F.filter((Y,re)=>re!==P))}function U(P,Y,re){K(F.map((he,V)=>V===P?{...he,[Y]:re}:he))}async function N(P){var he;P.preventDefault(),R(null),q(null);const Y=F.filter(V=>V.workDir.trim());if(Y.length===0){R("At least one working directory is required");return}S(!0),(he=v.current)==null||he.abort();const re=new AbortController;v.current=re;try{const V=await Hw({sessions:Y.map(H=>({workDir:H.workDir.trim(),name:H.name.trim()||void 0,prompt:H.prompt.trim()||Z.trim()||void 0,permissionMode:g})),signal:re.signal});q(V)}catch(V){if(re.signal.aborted)return;R(V instanceof Error?V.message:"Failed to create sessions")}finally{v.current===re&&(v.current=null,S(!1))}}if(!i)return null;async function B(P){var re;if(P.preventDefault(),R(null),!f.trim()){R("Working directory is required");return}S(!0),(re=v.current)==null||re.abort();const Y=new AbortController;v.current=Y;try{const he=await A_({workDir:f.trim(),name:T.trim()||void 0,prompt:C.trim()||void 0,permissionMode:g,signal:Y.signal});Q(),r(),a(`/sessions/${he.id}`)}catch(he){if(Y.signal.aborted)return;R(he instanceof Error?he.message:"Failed to create session")}finally{v.current===Y&&(v.current=null,S(!1))}}return b.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[b.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:k}),b.jsxs("div",{ref:E,role:"dialog","aria-modal":"true","aria-label":"Create new session",className:`relative w-full ${M==="batch"?"max-w-2xl":"max-w-md"} mx-4 bg-[#111118] border border-[#1a1a2e] rounded-lg shadow-2xl max-h-[90vh] overflow-y-auto`,children:[b.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Session"}),b.jsxs("div",{className:"flex rounded bg-[#0a0a0f] p-0.5",children:[b.jsx("button",{type:"button",onClick:()=>w("single"),className:`px-3 py-1 text-xs rounded transition-colors ${M==="single"?"bg-[#3b82f6]/10 text-[#3b82f6]":"text-gray-500 hover:text-gray-300"}`,children:"Single"}),b.jsx("button",{type:"button",onClick:()=>w("batch"),className:`px-3 py-1 text-xs rounded transition-colors ${M==="batch"?"bg-[#3b82f6]/10 text-[#3b82f6]":"text-gray-500 hover:text-gray-300"}`,children:"Batch"}),c.length>0&&b.jsx("button",{type:"button",onClick:()=>w("template"),className:`px-3 py-1 text-xs rounded transition-colors ${M==="template"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Template"})]})]}),b.jsx("button",{onClick:k,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:b.jsx(Vn,{className:"h-4 w-4"})})]}),M==="single"&&b.jsxs("form",{onSubmit:B,className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Working Directory ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("input",{type:"text",ref:o,value:f,onChange:P=>x(P.target.value),placeholder:"/home/user/project",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] font-mono"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Session Name"}),b.jsx("input",{type:"text",value:T,onChange:P=>O(P.target.value),placeholder:"my-session",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Initial Prompt"}),b.jsx("textarea",{value:C,onChange:P=>m(P.target.value),placeholder:"Fix the login bug...",rows:3,className:"w-full min-h-[88px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] resize-none"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),b.jsxs("select",{value:g,onChange:P=>d(P.target.value),className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 focus:outline-none focus:border-[#3b82f6]",children:[b.jsx("option",{value:"default",children:"default - asks for everything"}),b.jsx("option",{value:"plan",children:"plan - auto-reads, asks for writes"}),b.jsx("option",{value:"acceptEdits",children:"acceptEdits - auto-edits, asks for bash"}),b.jsx("option",{value:"bypassPermissions",children:"bypassPermissions - never asks"}),b.jsx("option",{value:"auto",children:"auto - auto-approve in sandbox"})]})]}),A&&b.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:A}),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:k,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),b.jsxs("button",{type:"submit",disabled:p||!f.trim(),className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[p&&b.jsx($n,{className:"h-3 w-3 animate-spin"}),"Create Session"]})]})]}),M==="batch"&&!ee&&b.jsxs("form",{onSubmit:N,className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Shared Prompt"}),b.jsx("textarea",{value:Z,onChange:P=>J(P.target.value),placeholder:"Apply to all sessions without a per-row prompt...",rows:2,className:"w-full min-h-[88px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] resize-none"})]}),b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[b.jsxs("span",{children:["Working Directory ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("span",{children:"Name"}),b.jsx("span",{children:"Prompt (override)"}),b.jsx("span",{})]}),b.jsx("div",{className:"space-y-2",children:F.map((P,Y)=>b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[b.jsx("input",{type:"text",value:P.workDir,onChange:re=>U(Y,"workDir",re.target.value),placeholder:"/home/user/project",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] font-mono"}),b.jsx("input",{type:"text",value:P.name,onChange:re=>U(Y,"name",re.target.value),placeholder:"name",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"}),b.jsx("input",{type:"text",value:P.prompt,onChange:re=>U(Y,"prompt",re.target.value),placeholder:"Override prompt...",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"}),b.jsx("button",{type:"button",onClick:()=>j(Y),disabled:F.length<=1,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ef4444] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:b.jsx(Ou,{className:"h-3.5 w-3.5"})})]},P._key))}),F.length<10&&b.jsxs("button",{type:"button",onClick:ne,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[b.jsx(Kn,{className:"h-3.5 w-3.5"}),"Add session"]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),b.jsxs("select",{value:g,onChange:P=>d(P.target.value),className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 focus:outline-none focus:border-[#3b82f6]",children:[b.jsx("option",{value:"default",children:"default - asks for everything"}),b.jsx("option",{value:"plan",children:"plan - auto-reads, asks for writes"}),b.jsx("option",{value:"acceptEdits",children:"acceptEdits - auto-edits, asks for bash"}),b.jsx("option",{value:"bypassPermissions",children:"bypassPermissions - never asks"}),b.jsx("option",{value:"auto",children:"auto - auto-approve in sandbox"})]})]}),A&&b.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:A}),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:k,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),b.jsxs("button",{type:"submit",disabled:p||!F.some(P=>P.workDir.trim()),className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[p&&b.jsx($n,{className:"h-3 w-3 animate-spin"}),"Create ",F.filter(P=>P.workDir.trim()).length," Session(s)"]})]})]}),M==="template"&&b.jsxs("form",{onSubmit:async P=>{var he;P.preventDefault(),R(null);const Y=c.find(V=>V.id===L);if(!Y){R("Please select a template");return}S(!0),(he=v.current)==null||he.abort();const re=new AbortController;v.current=re;try{const V=await A_({workDir:Y.workDir,prompt:Y.prompt,claudeCommand:Y.claudeCommand,env:Y.env,stallThresholdMs:Y.stallThresholdMs,permissionMode:Y.permissionMode,autoApprove:Y.autoApprove,signal:re.signal});Q(),r(),a(`/sessions/${V.id}`)}catch(V){if(re.signal.aborted)return;R(V instanceof Error?V.message:"Failed to create session from template")}finally{v.current===re&&(v.current=null,S(!1))}},className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsx("label",{htmlFor:"template-select",className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Select Template"}),u?b.jsx("div",{className:"text-xs text-gray-500 italic",children:"Loading templates…"}):c.length===0?b.jsx("div",{className:"text-xs text-gray-500 italic",children:"No templates available"}):b.jsxs("select",{id:"template-select",value:L,onChange:P=>$(P.target.value),className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 focus:outline-none focus:border-[#00e5ff]",children:[b.jsx("option",{value:"",children:"— Choose a template —"}),c.map(P=>b.jsxs("option",{value:P.id,children:[P.name," ",P.description?`— ${P.description}`:""]},P.id))]})]}),A&&b.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:A}),L&&c.find(P=>P.id===L)&&(()=>{const P=c.find(Y=>Y.id===L);return b.jsxs("div",{className:"text-xs space-y-1 p-3 bg-[#0a0a0f] rounded border border-[#1a1a2e]",children:[b.jsxs("div",{className:"text-gray-400",children:[b.jsx("strong",{children:"WorkDir:"})," ",b.jsx("span",{className:"font-mono text-gray-500",children:P.workDir})]}),P.stallThresholdMs&&b.jsxs("div",{className:"text-gray-400",children:[b.jsx("strong",{children:"Stall Threshold:"})," ",b.jsxs("span",{className:"text-gray-500",children:[P.stallThresholdMs,"ms"]})]}),P.permissionMode&&P.permissionMode!=="default"&&b.jsxs("div",{className:"text-gray-400",children:[b.jsx("strong",{children:"Permission Mode:"})," ",b.jsx("span",{className:"text-gray-500",children:P.permissionMode})]})]})})(),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:k,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),b.jsxs("button",{type:"submit",disabled:p||!L,className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[p&&b.jsx($n,{className:"h-3 w-3 animate-spin"}),"Create from Template"]})]})]}),ee&&b.jsxs("div",{className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[ee.created>0&&b.jsxs("span",{className:"text-xs font-medium text-emerald-400 bg-emerald-400/10 border border-emerald-400/20 rounded px-3 py-1.5",children:[ee.created," created"]}),ee.failed>0&&b.jsxs("span",{className:"text-xs font-medium text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-1.5",children:[ee.failed," failed"]})]}),ee.sessions.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Created sessions"}),b.jsx("ul",{className:"space-y-1",children:ee.sessions.map(P=>b.jsx("li",{children:b.jsxs("button",{type:"button",onClick:()=>{k(),a(`/sessions/${P.id}`)},className:"text-xs text-[#3b82f6] hover:underline font-mono",children:[P.id.slice(0,8),"...",P.name?` - ${P.name}`:""]})},P.id))})]}),ee.errors.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Errors"}),b.jsx("ul",{className:"space-y-1",children:ee.errors.map((P,Y)=>b.jsx("li",{className:"text-xs text-[#ef4444]",children:P},Y))})]}),b.jsx("div",{className:"flex justify-end pt-2",children:b.jsx("button",{type:"button",onClick:k,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Close"})})]})]})]})}function EE(){const[i,r]=I.useState(!1);return b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Overview"}),b.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Aegis session monitoring and metrics"})]}),b.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-1.5 px-3 py-2 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors",children:[b.jsx(Kn,{className:"h-3.5 w-3.5"}),"New Session"]})]}),b.jsx(hE,{}),b.jsxs("div",{children:[b.jsx("h3",{className:"mb-3 text-lg font-semibold text-gray-200",children:"Sessions"}),b.jsx(yE,{})]}),b.jsx(xE,{}),b.jsx(wE,{open:i,onClose:()=>r(!1)})]})}function z_(i){return i instanceof Error&&"statusCode"in i}function kE(i){const r=et(j=>j.token),a=Si(j=>j.addToast),[o,v]=I.useState(null),[k,E]=I.useState(null),[c,h]=I.useState(!1),[u,y]=I.useState(!0),[f,x]=I.useState(""),[T,O]=I.useState(!0),[C,m]=I.useState(null),[g,d]=I.useState(!0),[p,S]=I.useState(null),[A,R]=I.useState(!0),M=I.useRef(i);M.current=i;const w=I.useRef(!1),L=I.useRef(0),$=I.useRef(void 0),F=I.useRef(void 0),K=I.useCallback(async()=>{try{const[j,U]=await Promise.allSettled([xw(M.current),Cw(M.current)]);if(j.status==="rejected"&&z_(j.reason)&&j.reason.statusCode===404||U.status==="rejected"&&z_(U.reason)&&U.reason.statusCode===404){h(!0);return}j.status==="fulfilled"&&v(j.value),U.status==="fulfilled"&&E(U.value)}catch(j){a("error","Failed to load session",j instanceof Error?j.message:void 0)}finally{y(!1)}},[a]);$.current=K;const Z=I.useCallback(async()=>{if(w.current)return;const j=M.current;try{const U=await Aw(j);w.current||x(U.pane??"")}catch(U){a("warning","Failed to load terminal pane",U instanceof Error?U.message:void 0)}finally{w.current||O(!1)}try{const U=await kw(j);w.current||m(U)}catch(U){a("warning","Failed to load session metrics",U instanceof Error?U.message:void 0)}finally{w.current||d(!1)}try{const U=await Tw(j);w.current||S(U)}catch(U){a("warning","Failed to load session latency",U instanceof Error?U.message:void 0)}finally{w.current||R(!1)}},[a]);F.current=Z;const J=I.useRef(void 0),ee=I.useRef(void 0),q=I.useCallback(()=>{J.current&&(clearTimeout(J.current),J.current=void 0),ee.current&&(clearTimeout(ee.current),ee.current=void 0)},[]);I.useEffect(()=>(w.current=!1,L.current++,y(!0),O(!0),d(!0),R(!0),K(),Z(),()=>{w.current=!0,q()}),[i,K,Z,q]);const Q=I.useCallback(()=>{J.current&&clearTimeout(J.current);const j=L.current;J.current=setTimeout(()=>{var U;L.current===j&&((U=F.current)==null||U.call(F))},1e3)},[]),ne=I.useCallback(()=>{ee.current&&clearTimeout(ee.current);const j=L.current;ee.current=setTimeout(()=>{var U;L.current===j&&((U=$.current)==null||U.call($))},1e3)},[]);return I.useEffect(()=>{if(!i)return;let j=!0;const U=Wp(i,N=>{var B,P;if(j)try{const Y=uw.safeParse(JSON.parse(N.data));if(!Y.success){console.warn("SSE event failed validation",Y.error.message);return}switch(Y.data.event){case"status":case"approval":case"stall":case"dead":ne(),Q();break;case"message":Q();break;case"ended":(B=$.current)==null||B.call($),(P=F.current)==null||P.call(F);break}}catch{}},r);return()=>{j=!1,q(),U()}},[i,r,ne,Q,q]),{session:o,health:k,notFound:c,loading:u,paneContent:f,paneLoading:T,metrics:C,metricsLoading:g,latency:p,latencyLoading:A,refetchPaneAndMetrics:Z}}const TE={idle:"Idle",working:"Working",permission_prompt:"Permission",plan_mode:"Planning",ask_question:"Question",bash_approval:"Bash Approval",settings:"Settings",error:"Error",compacting:"Compacting",context_warning:"Context Warning",waiting_for_input:"Waiting",unknown:"Unknown"};function H_(i,r){if(i.length<=r)return i;const a=i.slice(0,Math.ceil(r/2)-1),o=i.slice(-(Math.floor(r/2)-2));return`${a}…${o}`}function U_(i){return new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function AE({session:i,health:r,onApprove:a,onReject:o,onInterrupt:v,onKill:k,onSaveTemplate:E}){const[c,h]=I.useState(!1),u=r.status==="permission_prompt"||r.status==="bash_approval";return b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3 sm:p-4",children:[b.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[b.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[b.jsx(Ho,{status:r.status}),b.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:TE[r.status]})]}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("h1",{className:"text-base sm:text-lg font-semibold text-[#e0e0e0] truncate",children:i.windowName||"Untitled Session"}),b.jsx("div",{className:"text-xs text-[#555] font-mono truncate mt-0.5",children:H_(i.workDir,40)})]}),b.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[i.permissionMode&&i.permissionMode!=="default"&&b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#003322] text-[#10b981] border border-[#10b981]/30",children:i.permissionMode}),r.alive?b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#111118] text-[#888] border border-[#1a1a2e]",children:"Alive"}):b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#331111] text-[#ef4444] border border-[#ef4444]/30",children:"Dead"})]})]}),b.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 text-[11px] text-[#555] mb-3 flex-wrap",children:[b.jsxs("span",{children:["Created: ",U_(i.createdAt)]}),b.jsxs("span",{className:"hidden sm:inline",children:["Last activity: ",U_(i.lastActivity)]}),b.jsxs("span",{className:"font-mono hidden sm:inline",children:["ID: ",H_(i.id,16)]}),r.details&&b.jsx("span",{className:"text-[#888] italic",children:r.details})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u&&b.jsxs(b.Fragment,{children:[b.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#10b981] border border-[#10b981]/30 transition-colors",children:"Approve"}),b.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ef4444] border border-[#ef4444]/30 transition-colors",children:"Reject"})]}),b.jsx("button",{onClick:v,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",children:"Interrupt"}),b.jsx("button",{onClick:E,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",title:"Save this session as a template",children:"Save as Template"}),c?b.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[b.jsx("span",{className:"text-xs text-[#ef4444]",children:"Confirm kill?"}),b.jsx("button",{onClick:()=>{k==null||k(),h(!1)},className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] text-[#ef4444] border border-[#ef4444]/30 transition-colors",children:"Yes, Kill"}),b.jsx("button",{onClick:()=>h(!1),className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",children:"Cancel"})]}):b.jsx("button",{onClick:()=>h(!0),className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors ml-auto",children:"Kill"})]})]})}var cu={exports:{}},$_;function RE(){return $_||($_=1,(function(i,r){(function(a,o){i.exports=o()})(globalThis,(()=>(()=>{var a={4567:function(E,c,h){var u=this&&this.__decorate||function(d,p,S,A){var R,M=arguments.length,w=M<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,p,S,A);else for(var L=d.length-1;L>=0;L--)(R=d[L])&&(w=(M<3?R(w):M>3?R(p,S,w):R(p,S))||w);return M>3&&w&&Object.defineProperty(p,S,w),w},y=this&&this.__param||function(d,p){return function(S,A){p(S,A,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const f=h(9042),x=h(9924),T=h(844),O=h(4725),C=h(2585),m=h(3656);let g=c.AccessibilityManager=class extends T.Disposable{constructor(d,p,S,A){super(),this._terminal=d,this._coreBrowserService=S,this._renderService=A,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new x.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
304
+ `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,m.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,T.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(d){for(let p=0;p<d;p++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
305
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,p){this._liveRegionDebouncer.refresh(d,p,this._terminal.rows)}_renderRows(d,p){const S=this._terminal.buffer,A=S.lines.length.toString();for(let R=d;R<=p;R++){const M=S.lines.get(S.ydisp+R),w=[],L=(M==null?void 0:M.translateToString(!0,void 0,void 0,w))||"",$=(S.ydisp+R+1).toString(),F=this._rowElements[R];F&&(L.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=L,this._rowColumns.set(F,w)),F.setAttribute("aria-posinset",$),F.setAttribute("aria-setsize",A))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,p){const S=d.target,A=this._rowElements[p===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(p===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==A)return;let R,M;if(p===0?(R=S,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(R=this._rowElements.shift(),M=S,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),p===0){const w=this._createAccessibilityTreeNode();this._rowElements.unshift(w),this._rowContainer.insertAdjacentElement("afterbegin",w)}else{const w=this._createAccessibilityTreeNode();this._rowElements.push(w),this._rowContainer.appendChild(w)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(p===0?-1:1),this._rowElements[p===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var L;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let p={node:d.anchorNode,offset:d.anchorOffset},S={node:d.focusNode,offset:d.focusOffset};if((p.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||p.node===S.node&&p.offset>S.offset)&&([p,S]=[S,p]),p.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(p={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(p.node))return;const A=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(A)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:A,offset:((L=A.textContent)==null?void 0:L.length)??0}),!this._rowContainer.contains(S.node))return;const R=({node:$,offset:F})=>{const K=$ instanceof Text?$.parentNode:$;let Z=parseInt(K==null?void 0:K.getAttribute("aria-posinset"),10)-1;if(isNaN(Z))return console.warn("row is invalid. Race condition?"),null;const J=this._rowColumns.get(K);if(!J)return console.warn("columns is null. Race condition?"),null;let ee=F<J.length?J[F]:J.slice(-1)[0]+1;return ee>=this._terminal.cols&&(++Z,ee=0),{row:Z,column:ee}},M=R(p),w=R(S);if(M&&w){if(M.row>w.row||M.row===w.row&&M.column>=w.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(w.row-M.row)*this._terminal.cols-M.column+w.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let p=this._rowContainer.children.length;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=g=u([y(1,C.IInstantiationService),y(2,O.ICoreBrowserService),y(3,O.IRenderService)],g)},3614:(E,c)=>{function h(x){return x.replace(/\r?\n/g,"\r")}function u(x,T){return T?"\x1B[200~"+x+"\x1B[201~":x}function y(x,T,O,C){x=u(x=h(x),O.decPrivateModes.bracketedPasteMode&&C.rawOptions.ignoreBracketedPasteMode!==!0),O.triggerDataEvent(x,!0),T.value=""}function f(x,T,O){const C=O.getBoundingClientRect(),m=x.clientX-C.left-10,g=x.clientY-C.top-10;T.style.width="20px",T.style.height="20px",T.style.left=`${m}px`,T.style.top=`${g}px`,T.style.zIndex="1000",T.focus()}Object.defineProperty(c,"__esModule",{value:!0}),c.rightClickHandler=c.moveTextAreaUnderMouseCursor=c.paste=c.handlePasteEvent=c.copyHandler=c.bracketTextForPaste=c.prepareTextForTerminal=void 0,c.prepareTextForTerminal=h,c.bracketTextForPaste=u,c.copyHandler=function(x,T){x.clipboardData&&x.clipboardData.setData("text/plain",T.selectionText),x.preventDefault()},c.handlePasteEvent=function(x,T,O,C){x.stopPropagation(),x.clipboardData&&y(x.clipboardData.getData("text/plain"),T,O,C)},c.paste=y,c.moveTextAreaUnderMouseCursor=f,c.rightClickHandler=function(x,T,O,C,m){f(x,T,O),m&&C.rightClickSelect(x),T.value=C.selectionText,T.select()}},7239:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const u=h(1505);c.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(y,f,x){this._css.set(y,f,x)}getCss(y,f){return this._css.get(y,f)}setColor(y,f,x){this._color.set(y,f,x)}getColor(y,f){return this._color.get(y,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(h,u,y,f){h.addEventListener(u,y,f);let x=!1;return{dispose:()=>{x||(x=!0,h.removeEventListener(u,y,f))}}}},3551:function(E,c,h){var u=this&&this.__decorate||function(g,d,p,S){var A,R=arguments.length,M=R<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(g,d,p,S);else for(var w=g.length-1;w>=0;w--)(A=g[w])&&(M=(R<3?A(M):R>3?A(d,p,M):A(d,p))||M);return R>3&&M&&Object.defineProperty(d,p,M),M},y=this&&this.__param||function(g,d){return function(p,S){d(p,S,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const f=h(3656),x=h(8460),T=h(844),O=h(2585),C=h(4725);let m=c.Linkifier=class extends T.Disposable{get currentLink(){return this._currentLink}constructor(g,d,p,S,A){super(),this._element=g,this._mouseService=d,this._renderService=p,this._bufferService=S,this._linkProviderService=A,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new x.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new x.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,T.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,T.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(g){this._lastMouseEvent=g;const d=this._positionFromMouseEvent(g,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const p=g.composedPath();for(let S=0;S<p.length;S++){const A=p[S];if(A.classList.contains("xterm"))break;if(A.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_handleHover(g){if(this._activeLine!==g.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(g,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,g)||(this._clearCurrentLink(),this._askForLink(g,!0))}_askForLink(g,d){var S,A;this._activeProviderReplies&&d||((S=this._activeProviderReplies)==null||S.forEach((R=>{R==null||R.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=g.y);let p=!1;for(const[R,M]of this._linkProviderService.linkProviders.entries())d?(A=this._activeProviderReplies)!=null&&A.get(R)&&(p=this._checkLinkProviderResult(R,g,p)):M.provideLinks(g.y,(w=>{var $,F;if(this._isMouseOut)return;const L=w==null?void 0:w.map((K=>({link:K})));($=this._activeProviderReplies)==null||$.set(R,L),p=this._checkLinkProviderResult(R,g,p),((F=this._activeProviderReplies)==null?void 0:F.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(g.y,this._activeProviderReplies)}))}_removeIntersectingLinks(g,d){const p=new Set;for(let S=0;S<d.size;S++){const A=d.get(S);if(A)for(let R=0;R<A.length;R++){const M=A[R],w=M.link.range.start.y<g?0:M.link.range.start.x,L=M.link.range.end.y>g?this._bufferService.cols:M.link.range.end.x;for(let $=w;$<=L;$++){if(p.has($)){A.splice(R--,1);break}p.add($)}}}}_checkLinkProviderResult(g,d,p){var R;if(!this._activeProviderReplies)return p;const S=this._activeProviderReplies.get(g);let A=!1;for(let M=0;M<g;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(A=!0);if(!A&&S){const M=S.find((w=>this._linkAtPosition(w.link,d)));M&&(p=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!p)for(let M=0;M<this._activeProviderReplies.size;M++){const w=(R=this._activeProviderReplies.get(M))==null?void 0:R.find((L=>this._linkAtPosition(L.link,d)));if(w){p=!0,this._handleNewLink(w);break}}return p}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(g){if(!this._currentLink)return;const d=this._positionFromMouseEvent(g,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(g,this._currentLink.link.text)}_clearCurrentLink(g,d){this._currentLink&&this._lastMouseEvent&&(!g||!d||this._currentLink.link.range.start.y>=g&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,T.disposeArray)(this._linkCacheDisposables))}_handleNewLink(g){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(g.link,d)&&(this._currentLink=g,this._currentLink.state={decorations:{underline:g.link.decorations===void 0||g.link.decorations.underline,pointerCursor:g.link.decorations===void 0||g.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,g.link,this._lastMouseEvent),g.link.decorations={},Object.defineProperties(g.link.decorations,{pointerCursor:{get:()=>{var p,S;return(S=(p=this._currentLink)==null?void 0:p.state)==null?void 0:S.decorations.pointerCursor},set:p=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==p&&(this._currentLink.state.decorations.pointerCursor=p,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",p))}},underline:{get:()=>{var p,S;return(S=(p=this._currentLink)==null?void 0:p.state)==null?void 0:S.decorations.underline},set:p=>{var S,A,R;(S=this._currentLink)!=null&&S.state&&((R=(A=this._currentLink)==null?void 0:A.state)==null?void 0:R.decorations.underline)!==p&&(this._currentLink.state.decorations.underline=p,this._currentLink.state.isHovered&&this._fireUnderlineEvent(g.link,p))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((p=>{if(!this._currentLink)return;const S=p.start===0?0:p.start+1+this._bufferService.buffer.ydisp,A=this._bufferService.buffer.ydisp+1+p.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=A&&(this._clearCurrentLink(S,A),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(g,d,p){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&g.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(p,d.text)}_fireUnderlineEvent(g,d){const p=g.range,S=this._bufferService.buffer.ydisp,A=this._createLinkUnderlineEvent(p.start.x-1,p.start.y-S-1,p.end.x,p.end.y-S-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(A)}_linkLeave(g,d,p){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&g.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(p,d.text)}_linkAtPosition(g,d){const p=g.range.start.y*this._bufferService.cols+g.range.start.x,S=g.range.end.y*this._bufferService.cols+g.range.end.x,A=d.y*this._bufferService.cols+d.x;return p<=A&&A<=S}_positionFromMouseEvent(g,d,p){const S=p.getCoords(g,d,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(g,d,p,S,A){return{x1:g,y1:d,x2:p,y2:S,cols:this._bufferService.cols,fg:A}}};c.Linkifier=m=u([y(1,C.IMouseService),y(2,C.IRenderService),y(3,O.IBufferService),y(4,C.ILinkProviderService)],m)},9042:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.tooMuchOutput=c.promptLabel=void 0,c.promptLabel="Terminal input",c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(E,c,h){var u=this&&this.__decorate||function(C,m,g,d){var p,S=arguments.length,A=S<3?m:d===null?d=Object.getOwnPropertyDescriptor(m,g):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,m,g,d);else for(var R=C.length-1;R>=0;R--)(p=C[R])&&(A=(S<3?p(A):S>3?p(m,g,A):p(m,g))||A);return S>3&&A&&Object.defineProperty(m,g,A),A},y=this&&this.__param||function(C,m){return function(g,d){m(g,d,C)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const f=h(511),x=h(2585);let T=c.OscLinkProvider=class{constructor(C,m,g){this._bufferService=C,this._optionsService=m,this._oscLinkService=g}provideLinks(C,m){var L;const g=this._bufferService.buffer.lines.get(C-1);if(!g)return void m(void 0);const d=[],p=this._optionsService.rawOptions.linkHandler,S=new f.CellData,A=g.getTrimmedLength();let R=-1,M=-1,w=!1;for(let $=0;$<A;$++)if(M!==-1||g.hasContent($)){if(g.loadCell($,S),S.hasExtendedAttrs()&&S.extended.urlId){if(M===-1){M=$,R=S.extended.urlId;continue}w=S.extended.urlId!==R}else M!==-1&&(w=!0);if(w||M!==-1&&$===A-1){const F=(L=this._oscLinkService.getLinkData(R))==null?void 0:L.uri;if(F){const K={start:{x:M+1,y:C},end:{x:$+(w||$!==A-1?0:1),y:C}};let Z=!1;if(!(p!=null&&p.allowNonHttpProtocols))try{const J=new URL(F);["http:","https:"].includes(J.protocol)||(Z=!0)}catch{Z=!0}Z||d.push({text:F,range:K,activate:(J,ee)=>p?p.activate(J,ee,K):O(0,ee),hover:(J,ee)=>{var q;return(q=p==null?void 0:p.hover)==null?void 0:q.call(p,J,ee,K)},leave:(J,ee)=>{var q;return(q=p==null?void 0:p.leave)==null?void 0:q.call(p,J,ee,K)}})}w=!1,S.hasExtendedAttrs()&&S.extended.urlId?(M=$,R=S.extended.urlId):(M=-1,R=-1)}}m(d)}};function O(C,m){if(confirm(`Do you want to navigate to ${m}?
306
+
307
+ WARNING: This link could potentially be dangerous`)){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=m}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=T=u([y(0,x.IBufferService),y(1,x.IOptionsService),y(2,x.IOscLinkService)],T)},6193:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(h,u){this._renderCallback=h,this._coreBrowserService=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(h){return this._refreshCallbacks.push(h),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(h,u,y){this._rowCount=y,h=h!==void 0?h:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const h=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const h of this._refreshCallbacks)h(0);this._refreshCallbacks=[]}}},3236:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const u=h(3614),y=h(3656),f=h(3551),x=h(9042),T=h(3730),O=h(1680),C=h(3107),m=h(5744),g=h(2950),d=h(1296),p=h(428),S=h(4269),A=h(5114),R=h(8934),M=h(3230),w=h(9312),L=h(4725),$=h(6731),F=h(8055),K=h(8969),Z=h(8460),J=h(844),ee=h(6114),q=h(8437),Q=h(2584),ne=h(7399),j=h(5941),U=h(9074),N=h(2585),B=h(5435),P=h(4567),Y=h(779);class re extends K.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(V={}){super(V),this.browser=ee,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new J.MutableDisposable),this._onCursorMove=this.register(new Z.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new Z.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new Z.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new Z.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new Z.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new Z.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new Z.EventEmitter),this._onBlur=this.register(new Z.EventEmitter),this._onA11yCharEmitter=this.register(new Z.EventEmitter),this._onA11yTabEmitter=this.register(new Z.EventEmitter),this._onWillOpen=this.register(new Z.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(U.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Y.LinkProviderService),this._instantiationService.setService(L.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(T.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((H,ce)=>this.refresh(H,ce)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((H=>this._reportWindowsOptions(H)))),this.register(this._inputHandler.onColor((H=>this._handleColorEvent(H)))),this.register((0,Z.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,Z.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,Z.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,Z.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((H=>this._afterResize(H.cols,H.rows)))),this.register((0,J.toDisposable)((()=>{var H,ce;this._customKeyEventHandler=void 0,(ce=(H=this.element)==null?void 0:H.parentNode)==null||ce.removeChild(this.element)})))}_handleColorEvent(V){if(this._themeService)for(const H of V){let ce,oe="";switch(H.index){case 256:ce="foreground",oe="10";break;case 257:ce="background",oe="11";break;case 258:ce="cursor",oe="12";break;default:ce="ansi",oe="4;"+H.index}switch(H.type){case 0:const me=F.color.toColorRGB(ce==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[ce]);this.coreService.triggerDataEvent(`${Q.C0.ESC}]${oe};${(0,j.toRgbString)(me)}${Q.C1_ESCAPED.ST}`);break;case 1:if(ce==="ansi")this._themeService.modifyColors((_e=>_e.ansi[H.index]=F.channels.toColor(...H.color)));else{const _e=ce;this._themeService.modifyColors((Te=>Te[_e]=F.channels.toColor(...H.color)))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(V){V?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(P.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(V){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var V;return(V=this.textarea)==null?void 0:V.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const V=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(V);if(!H)return;const ce=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,me=H.getWidth(ce),_e=this._renderService.dimensions.css.cell.width*me,Te=this.buffer.y*this._renderService.dimensions.css.cell.height,je=ce*this._renderService.dimensions.css.cell.width;this.textarea.style.left=je+"px",this.textarea.style.top=Te+"px",this.textarea.style.width=_e+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(H=>{this.hasSelection()&&(0,u.copyHandler)(H,this._selectionService)})));const V=H=>(0,u.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",V)),this.register((0,y.addDisposableDomListener)(this.element,"paste",V)),ee.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(H=>{H.button===2&&(0,u.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,u.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ee.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,u.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(V=>this._keyUp(V)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(V=>this._keyDown(V)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(V=>this._keyPress(V)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(V=>this._compositionHelper.compositionupdate(V)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(V=>this._inputEvent(V)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(V){var ce;if(!V)throw new Error("Terminal requires a parent element.");if(V.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ce=this.element)==null?void 0:ce.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=V.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"),V.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,y.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",x.promptLabel),ee.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(A.CoreBrowserService,this.textarea,V.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(L.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance($.ThemeService),this._instantiationService.setService(L.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(L.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(L.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(g.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(L.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(O.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(w.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(C.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),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(P.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const V=this,H=this.element;function ce(_e){const Te=V._mouseService.getMouseReportCoords(_e,V.screenElement);if(!Te)return!1;let je,Ze;switch(_e.overrideType||_e.type){case"mousemove":Ze=32,_e.buttons===void 0?(je=3,_e.button!==void 0&&(je=_e.button<3?_e.button:3)):je=1&_e.buttons?0:4&_e.buttons?1:2&_e.buttons?2:3;break;case"mouseup":Ze=0,je=_e.button<3?_e.button:3;break;case"mousedown":Ze=1,je=_e.button<3?_e.button:3;break;case"wheel":if(V._customWheelEventHandler&&V._customWheelEventHandler(_e)===!1||V.viewport.getLinesScrolled(_e)===0)return!1;Ze=_e.deltaY<0?0:1,je=4;break;default:return!1}return!(Ze===void 0||je===void 0||je>4)&&V.coreMouseService.triggerMouseEvent({col:Te.col,row:Te.row,x:Te.x,y:Te.y,button:je,action:Ze,ctrl:_e.ctrlKey,alt:_e.altKey,shift:_e.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},me={mouseup:_e=>(ce(_e),_e.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(_e)),wheel:_e=>(ce(_e),this.cancel(_e,!0)),mousedrag:_e=>{_e.buttons&&ce(_e)},mousemove:_e=>{_e.buttons||ce(_e)}};this.register(this.coreMouseService.onProtocolChange((_e=>{_e?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(_e)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&_e?oe.mousemove||(H.addEventListener("mousemove",me.mousemove),oe.mousemove=me.mousemove):(H.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&_e?oe.wheel||(H.addEventListener("wheel",me.wheel,{passive:!1}),oe.wheel=me.wheel):(H.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&_e?oe.mouseup||(oe.mouseup=me.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&_e?oe.mousedrag||(oe.mousedrag=me.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(H,"mousedown",(_e=>{if(_e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(_e))return ce(_e),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(_e)}))),this.register((0,y.addDisposableDomListener)(H,"wheel",(_e=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(_e)===!1)return!1;if(!this.buffer.hasScrollback){const Te=this.viewport.getLinesScrolled(_e);if(Te===0)return;const je=Q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(_e.deltaY<0?"A":"B");let Ze="";for(let ut=0;ut<Math.abs(Te);ut++)Ze+=je;return this.coreService.triggerDataEvent(Ze,!0),this.cancel(_e,!0)}return this.viewport.handleWheel(_e)?this.cancel(_e):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(H,"touchstart",(_e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(_e),this.cancel(_e)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(H,"touchmove",(_e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(_e)?void 0:this.cancel(_e)}),{passive:!1}))}refresh(V,H){var ce;(ce=this._renderService)==null||ce.refreshRows(V,H)}updateCursorStyle(V){var H;(H=this._selectionService)!=null&&H.shouldColumnSelect(V)?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(V,H,ce=0){var oe;ce===1?(super.scrollLines(V,H,ce),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(V)}paste(V){(0,u.paste)(V,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(V){this._customKeyEventHandler=V}attachCustomWheelEventHandler(V){this._customWheelEventHandler=V}registerLinkProvider(V){return this._linkProviderService.registerLinkProvider(V)}registerCharacterJoiner(V){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(V);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(V){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(V)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(V){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+V)}registerDecoration(V){return this._decorationService.registerDecoration(V)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(V,H,ce){this._selectionService.setSelection(V,H,ce)}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 V;(V=this._selectionService)==null||V.clearSelection()}selectAll(){var V;(V=this._selectionService)==null||V.selectAll()}selectLines(V,H){var ce;(ce=this._selectionService)==null||ce.selectLines(V,H)}_keyDown(V){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&V.altKey;if(!H&&!this._compositionHelper.keydown(V))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||V.key!=="Dead"&&V.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ce=(0,ne.evaluateKeyboardEvent)(V,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(V),ce.type===3||ce.type===2){const oe=this.rows-1;return this.scrollLines(ce.type===2?-oe:oe),this.cancel(V,!0)}return ce.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,V)||(ce.cancel&&this.cancel(V,!0),!ce.key||!!(V.key&&!V.ctrlKey&&!V.altKey&&!V.metaKey&&V.key.length===1&&V.key.charCodeAt(0)>=65&&V.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ce.key!==Q.C0.ETX&&ce.key!==Q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ce.key,domEvent:V}),this._showCursor(),this.coreService.triggerDataEvent(ce.key,!0),!this.optionsService.rawOptions.screenReaderMode||V.altKey||V.ctrlKey?this.cancel(V,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(V,H){const ce=V.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||V.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||V.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?ce:ce&&(!H.keyCode||H.keyCode>47)}_keyUp(V){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1||((function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18})(V)||this.focus(),this.updateCursorStyle(V),this._keyPressHandled=!1)}_keyPress(V){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1)return!1;if(this.cancel(V),V.charCode)H=V.charCode;else if(V.which===null||V.which===void 0)H=V.keyCode;else{if(V.which===0||V.charCode===0)return!1;H=V.which}return!(!H||(V.altKey||V.ctrlKey||V.metaKey)&&!this._isThirdLevelShift(this.browser,V)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:V}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(V){if(V.data&&V.inputType==="insertText"&&(!V.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=V.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(V),!0}return!1}resize(V,H){V!==this.cols||H!==this.rows?super.resize(V,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(V,H){var ce,oe;(ce=this._charSizeService)==null||ce.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var V;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 H=1;H<this.rows;H++)this.buffer.lines.push(this.buffer.getBlankLine(q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(V=this.viewport)==null||V.reset(),this.refresh(0,this.rows-1)}}reset(){var H,ce;this.options.rows=this.rows,this.options.cols=this.cols;const V=this._customKeyEventHandler;this._setup(),super.reset(),(H=this._selectionService)==null||H.reset(),this._decorationService.reset(),(ce=this.viewport)==null||ce.reset(),this._customKeyEventHandler=V,this.refresh(0,this.rows-1)}clearTextureAtlas(){var V;(V=this._renderService)==null||V.clearTextureAtlas()}_reportFocus(){var V;(V=this.element)!=null&&V.classList.contains("focus")?this.coreService.triggerDataEvent(Q.C0.ESC+"[I"):this.coreService.triggerDataEvent(Q.C0.ESC+"[O")}_reportWindowsOptions(V){if(this._renderService)switch(V){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=this._renderService.dimensions.css.canvas.width.toFixed(0),ce=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[4;${ce};${H}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const oe=this._renderService.dimensions.css.cell.width.toFixed(0),me=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[6;${me};${oe}t`)}}cancel(V,H){if(this.options.cancelEvents||H)return V.preventDefault(),V.stopPropagation(),!1}}c.Terminal=re},9924:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(h,u=1e3){this._renderCallback=h,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(h,u,y){this._rowCount=y,h=h!==void 0?h:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const x=f-this._lastRefreshMs,T=this._debounceThresholdMS-x;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),T)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const h=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,u)}}},1680:function(E,c,h){var u=this&&this.__decorate||function(g,d,p,S){var A,R=arguments.length,M=R<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(g,d,p,S);else for(var w=g.length-1;w>=0;w--)(A=g[w])&&(M=(R<3?A(M):R>3?A(d,p,M):A(d,p))||M);return R>3&&M&&Object.defineProperty(d,p,M),M},y=this&&this.__param||function(g,d){return function(p,S){d(p,S,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const f=h(3656),x=h(4725),T=h(8460),O=h(844),C=h(2585);let m=c.Viewport=class extends O.Disposable{constructor(g,d,p,S,A,R,M,w){super(),this._viewportElement=g,this._scrollArea=d,this._bufferService=p,this._optionsService=S,this._charSizeService=A,this._renderService=R,this._coreBrowserService=M,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new T.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((L=>this._renderDimensions=L))),this._handleThemeChange(w.colors),this.register(w.onChangeColors((L=>this._handleThemeChange(L)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(g){this._viewportElement.style.backgroundColor=g.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(g){if(g)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const g=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==g&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=g),this._refreshAnimationFrame=null}syncScrollArea(g=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(g);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(g)}_handleScroll(g){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const g=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(g*(this._smoothScrollState.target-this._smoothScrollState.origin)),g<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(g,d){const p=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&p<this._lastRecordedBufferHeight)||(g.cancelable&&g.preventDefault(),!1)}handleWheel(g){const d=this._getPixelsScrolled(g);return d!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(g,d))}scrollLines(g){if(g!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=g*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!1})}_getPixelsScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let d=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(g,d){var w;let p,S="";const A=[],R=d??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let L=g;L<R;L++){const $=M.get(L);if(!$)continue;const F=(w=M.get(L+1))==null?void 0:w.isWrapped;if(S+=$.translateToString(!F),!F||L===M.length-1){const K=document.createElement("div");K.textContent=S,A.push(K),S.length>0&&(p=K),S=""}}return{bufferElements:A,cursorElement:p}}getLinesScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let d=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(g,d){const p=this._optionsService.rawOptions.fastScrollModifier;return p==="alt"&&d.altKey||p==="ctrl"&&d.ctrlKey||p==="shift"&&d.shiftKey?g*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:g*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(g){this._lastTouchY=g.touches[0].pageY}handleTouchMove(g){const d=this._lastTouchY-g.touches[0].pageY;return this._lastTouchY=g.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(g,d))}};c.Viewport=m=u([y(2,C.IBufferService),y(3,C.IOptionsService),y(4,x.ICharSizeService),y(5,x.IRenderService),y(6,x.ICoreBrowserService),y(7,x.IThemeService)],m)},3107:function(E,c,h){var u=this&&this.__decorate||function(C,m,g,d){var p,S=arguments.length,A=S<3?m:d===null?d=Object.getOwnPropertyDescriptor(m,g):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,m,g,d);else for(var R=C.length-1;R>=0;R--)(p=C[R])&&(A=(S<3?p(A):S>3?p(m,g,A):p(m,g))||A);return S>3&&A&&Object.defineProperty(m,g,A),A},y=this&&this.__param||function(C,m){return function(g,d){m(g,d,C)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const f=h(4725),x=h(844),T=h(2585);let O=c.BufferDecorationRenderer=class extends x.Disposable{constructor(C,m,g,d,p){super(),this._screenElement=C,this._bufferService=m,this._coreBrowserService=g,this._decorationService=d,this._renderService=p,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((S=>this._removeDecoration(S)))),this.register((0,x.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const C of this._decorationService.decorations)this._renderDecoration(C);this._dimensionsChanged=!1}_renderDecoration(C){this._refreshStyle(C),this._dimensionsChanged&&this._refreshXPosition(C)}_createElement(C){var d;const m=this._coreBrowserService.mainDocument.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",((d=C==null?void 0:C.options)==null?void 0:d.layer)==="top"),m.style.width=`${Math.round((C.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(C.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(C.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",m.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const g=C.options.x??0;return g&&g>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(C,m),m}_refreshStyle(C){const m=C.marker.line-this._bufferService.buffers.active.ydisp;if(m<0||m>=this._bufferService.rows)C.element&&(C.element.style.display="none",C.onRenderEmitter.fire(C.element));else{let g=this._decorationElements.get(C);g||(g=this._createElement(C),C.element=g,this._decorationElements.set(C,g),this._container.appendChild(g),C.onDispose((()=>{this._decorationElements.delete(C),g.remove()}))),g.style.top=m*this._renderService.dimensions.css.cell.height+"px",g.style.display=this._altBufferIsActive?"none":"block",C.onRenderEmitter.fire(g)}}_refreshXPosition(C,m=C.element){if(!m)return;const g=C.options.x??0;(C.options.anchor||"left")==="right"?m.style.right=g?g*this._renderService.dimensions.css.cell.width+"px":"":m.style.left=g?g*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(C){var m;(m=this._decorationElements.get(C))==null||m.remove(),this._decorationElements.delete(C),C.dispose()}};c.BufferDecorationRenderer=O=u([y(1,T.IBufferService),y(2,f.ICoreBrowserService),y(3,T.IDecorationService),y(4,f.IRenderService)],O)},5871:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorZoneStore=void 0,c.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(h){if(h.options.overviewRulerOptions){for(const u of this._zones)if(u.color===h.options.overviewRulerOptions.color&&u.position===h.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,h.marker.line))return;if(this._lineAdjacentToZone(u,h.marker.line,h.options.overviewRulerOptions.position))return void this._addLineToZone(u,h.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=h.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=h.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=h.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=h.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:h.options.overviewRulerOptions.color,position:h.options.overviewRulerOptions.position,startBufferLine:h.marker.line,endBufferLine:h.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(h){this._linePadding=h}_lineIntersectsZone(h,u){return u>=h.startBufferLine&&u<=h.endBufferLine}_lineAdjacentToZone(h,u,y){return u>=h.startBufferLine-this._linePadding[y||"full"]&&u<=h.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(h,u){h.startBufferLine=Math.min(h.startBufferLine,u),h.endBufferLine=Math.max(h.endBufferLine,u)}}},5744:function(E,c,h){var u=this&&this.__decorate||function(p,S,A,R){var M,w=arguments.length,L=w<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(p,S,A,R);else for(var $=p.length-1;$>=0;$--)(M=p[$])&&(L=(w<3?M(L):w>3?M(S,A,L):M(S,A))||L);return w>3&&L&&Object.defineProperty(S,A,L),L},y=this&&this.__param||function(p,S){return function(A,R){S(A,R,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const f=h(5871),x=h(4725),T=h(844),O=h(2585),C={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0};let d=c.OverviewRulerRenderer=class extends T.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(p,S,A,R,M,w,L){var F;super(),this._viewportElement=p,this._screenElement=S,this._bufferService=A,this._decorationService=R,this._renderService=M,this._optionsService=w,this._coreBrowserService=L,this._colorZoneStore=new f.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(F=this._viewportElement.parentElement)==null||F.insertBefore(this._canvas,this._viewportElement);const $=this._canvas.getContext("2d");if(!$)throw new Error("Ctx cannot be null");this._ctx=$,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,T.toDisposable)((()=>{var K;(K=this._canvas)==null||K.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const p=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);m.full=this._canvas.width,m.left=p,m.center=S,m.right=p,this._refreshDrawHeightConstants(),g.full=0,g.left=0,g.center=m.left,g.right=m.left+m.center}_refreshDrawHeightConstants(){C.full=Math.round(2*this._coreBrowserService.dpr);const p=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(p,12),6)*this._coreBrowserService.dpr);C.left=S,C.center=S,C.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const p=this._colorZoneStore.zones;for(const S of p)S.position!=="full"&&this._renderColorZone(S);for(const S of p)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(p){this._ctx.fillStyle=p.color,this._ctx.fillRect(g[p.position||"full"],Math.round((this._canvas.height-1)*(p.startBufferLine/this._bufferService.buffers.active.lines.length)-C[p.position||"full"]/2),m[p.position||"full"],Math.round((this._canvas.height-1)*((p.endBufferLine-p.startBufferLine)/this._bufferService.buffers.active.lines.length)+C[p.position||"full"]))}_queueRefresh(p,S){this._shouldUpdateDimensions=p||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=d=u([y(2,O.IBufferService),y(3,O.IDecorationService),y(4,x.IRenderService),y(5,O.IOptionsService),y(6,x.ICoreBrowserService)],d)},2950:function(E,c,h){var u=this&&this.__decorate||function(C,m,g,d){var p,S=arguments.length,A=S<3?m:d===null?d=Object.getOwnPropertyDescriptor(m,g):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,m,g,d);else for(var R=C.length-1;R>=0;R--)(p=C[R])&&(A=(S<3?p(A):S>3?p(m,g,A):p(m,g))||A);return S>3&&A&&Object.defineProperty(m,g,A),A},y=this&&this.__param||function(C,m){return function(g,d){m(g,d,C)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const f=h(4725),x=h(2585),T=h(2584);let O=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(C,m,g,d,p,S){this._textarea=C,this._compositionView=m,this._bufferService=g,this._optionsService=d,this._coreService=p,this._renderService=S,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(C){this._compositionView.textContent=C.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(C){if(this._isComposing||this._isSendingComposition){if(C.keyCode===229||C.keyCode===16||C.keyCode===17||C.keyCode===18)return!1;this._finalizeComposition(!1)}return C.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(C){if(this._compositionView.classList.remove("active"),this._isComposing=!1,C){const m={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let g;this._isSendingComposition=!1,m.start+=this._dataAlreadySent.length,g=this._isComposing?this._textarea.value.substring(m.start,m.end):this._textarea.value.substring(m.start),g.length>0&&this._coreService.triggerDataEvent(g,!0)}}),0)}else{this._isSendingComposition=!1;const m=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(m,!0)}}_handleAnyTextareaChanges(){const C=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const m=this._textarea.value,g=m.replace(C,"");this._dataAlreadySent=g,m.length>C.length?this._coreService.triggerDataEvent(g,!0):m.length<C.length?this._coreService.triggerDataEvent(`${T.C0.DEL}`,!0):m.length===C.length&&m!==C&&this._coreService.triggerDataEvent(m,!0)}}),0)}updateCompositionElements(C){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const m=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),g=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,p=m*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=p+"px",this._compositionView.style.top=d+"px",this._compositionView.style.height=g+"px",this._compositionView.style.lineHeight=g+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=p+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}C||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=O=u([y(2,x.IBufferService),y(3,x.IOptionsService),y(4,x.ICoreService),y(5,f.IRenderService)],O)},9806:(E,c)=>{function h(u,y,f){const x=f.getBoundingClientRect(),T=u.getComputedStyle(f),O=parseInt(T.getPropertyValue("padding-left")),C=parseInt(T.getPropertyValue("padding-top"));return[y.clientX-x.left-O,y.clientY-x.top-C]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=h,c.getCoords=function(u,y,f,x,T,O,C,m,g){if(!O)return;const d=h(u,y,f);return d?(d[0]=Math.ceil((d[0]+(g?C/2:0))/C),d[1]=Math.ceil(d[1]/m),d[0]=Math.min(Math.max(d[0],1),x+(g?1:0)),d[1]=Math.min(Math.max(d[1],1),T),d):void 0}},9504:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const u=h(2584);function y(m,g,d,p){const S=m-f(m,d),A=g-f(g,d),R=Math.abs(S-A)-(function(M,w,L){let $=0;const F=M-f(M,L),K=w-f(w,L);for(let Z=0;Z<Math.abs(F-K);Z++){const J=x(M,w)==="A"?-1:1,ee=L.buffer.lines.get(F+J*Z);ee!=null&&ee.isWrapped&&$++}return $})(m,g,d);return C(R,O(x(m,g),p))}function f(m,g){let d=0,p=g.buffer.lines.get(m),S=p==null?void 0:p.isWrapped;for(;S&&m>=0&&m<g.rows;)d++,p=g.buffer.lines.get(--m),S=p==null?void 0:p.isWrapped;return d}function x(m,g){return m>g?"A":"B"}function T(m,g,d,p,S,A){let R=m,M=g,w="";for(;R!==d||M!==p;)R+=S?1:-1,S&&R>A.cols-1?(w+=A.buffer.translateBufferLineToString(M,!1,m,R),R=0,m=0,M++):!S&&R<0&&(w+=A.buffer.translateBufferLineToString(M,!1,0,m+1),R=A.cols-1,m=R,M--);return w+A.buffer.translateBufferLineToString(M,!1,m,R)}function O(m,g){const d=g?"O":"[";return u.C0.ESC+d+m}function C(m,g){m=Math.floor(m);let d="";for(let p=0;p<m;p++)d+=g;return d}c.moveToCellSequence=function(m,g,d,p){const S=d.buffer.x,A=d.buffer.y;if(!d.buffer.hasScrollback)return(function(w,L,$,F,K,Z){return y(L,F,K,Z).length===0?"":C(T(w,L,w,L-f(L,K),!1,K).length,O("D",Z))})(S,A,0,g,d,p)+y(A,g,d,p)+(function(w,L,$,F,K,Z){let J;J=y(L,F,K,Z).length>0?F-f(F,K):L;const ee=F,q=(function(Q,ne,j,U,N,B){let P;return P=y(j,U,N,B).length>0?U-f(U,N):ne,Q<j&&P<=U||Q>=j&&P<U?"C":"D"})(w,L,$,F,K,Z);return C(T(w,J,$,ee,q==="C",K).length,O(q,Z))})(S,A,m,g,d,p);let R;if(A===g)return R=S>m?"D":"C",C(Math.abs(S-m),O(R,p));R=A>g?"D":"C";const M=Math.abs(A-g);return C((function(w,L){return L.cols-w})(A>g?m:S,d)+(M-1)*d.cols+1+((A>g?S:m)-1),O(R,p))}},1296:function(E,c,h){var u=this&&this.__decorate||function(Z,J,ee,q){var Q,ne=arguments.length,j=ne<3?J:q===null?q=Object.getOwnPropertyDescriptor(J,ee):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(Z,J,ee,q);else for(var U=Z.length-1;U>=0;U--)(Q=Z[U])&&(j=(ne<3?Q(j):ne>3?Q(J,ee,j):Q(J,ee))||j);return ne>3&&j&&Object.defineProperty(J,ee,j),j},y=this&&this.__param||function(Z,J){return function(ee,q){J(ee,q,Z)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const f=h(3787),x=h(2550),T=h(2223),O=h(6171),C=h(6052),m=h(4725),g=h(8055),d=h(8460),p=h(844),S=h(2585),A="xterm-dom-renderer-owner-",R="xterm-rows",M="xterm-fg-",w="xterm-bg-",L="xterm-focus",$="xterm-selection";let F=1,K=c.DomRenderer=class extends p.Disposable{constructor(Z,J,ee,q,Q,ne,j,U,N,B,P,Y,re){super(),this._terminal=Z,this._document=J,this._element=ee,this._screenElement=q,this._viewportElement=Q,this._helperContainer=ne,this._linkifier2=j,this._charSizeService=N,this._optionsService=B,this._bufferService=P,this._coreBrowserService=Y,this._themeService=re,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,C.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),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($),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,O.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((he=>this._injectCss(he)))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(A+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((he=>this._handleLinkHover(he)))),this.register(this._linkifier2.onHideLinkUnderline((he=>this._handleLinkLeave(he)))),this.register((0,p.toDisposable)((()=>{this._element.classList.remove(A+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new x.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const Z=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*Z,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*Z),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/Z),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/Z),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const ee of this._rowElements)ee.style.width=`${this.dimensions.css.canvas.width}px`,ee.style.height=`${this.dimensions.css.cell.height}px`,ee.style.lineHeight=`${this.dimensions.css.cell.height}px`,ee.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const J=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=J,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(Z){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let J=`${this._terminalSelector} .${R} { color: ${Z.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;J+=`${this._terminalSelector} .${R} .xterm-dim { color: ${g.color.multiplyOpacity(Z.foreground,.5).css};}`,J+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const ee=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,Q=`blink_block_${this._terminalClass}`;J+=`@keyframes ${ee} { 50% { border-bottom-style: hidden; }}`,J+=`@keyframes ${q} { 50% { box-shadow: none; }}`,J+=`@keyframes ${Q} { 0% { background-color: ${Z.cursor.css}; color: ${Z.cursorAccent.css}; } 50% { background-color: inherit; color: ${Z.cursor.css}; }}`,J+=`${this._terminalSelector} .${R}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ee} 1s step-end infinite;}${this._terminalSelector} .${R}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${R}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${Z.cursor.css}; color: ${Z.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${Z.cursor.css} !important; color: ${Z.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${Z.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${Z.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${Z.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,J+=`${this._terminalSelector} .${$} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${$} div { position: absolute; background-color: ${Z.selectionBackgroundOpaque.css};}${this._terminalSelector} .${$} div { position: absolute; background-color: ${Z.selectionInactiveBackgroundOpaque.css};}`;for(const[ne,j]of Z.ansi.entries())J+=`${this._terminalSelector} .${M}${ne} { color: ${j.css}; }${this._terminalSelector} .${M}${ne}.xterm-dim { color: ${g.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${w}${ne} { background-color: ${j.css}; }`;J+=`${this._terminalSelector} .${M}${T.INVERTED_DEFAULT_COLOR} { color: ${g.color.opaque(Z.background).css}; }${this._terminalSelector} .${M}${T.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${g.color.multiplyOpacity(g.color.opaque(Z.background),.5).css}; }${this._terminalSelector} .${w}${T.INVERTED_DEFAULT_COLOR} { background-color: ${Z.foreground.css}; }`,this._themeStyleElement.textContent=J}_setDefaultSpacing(){const Z=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${Z}px`,this._rowFactory.defaultSpacing=Z}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(Z,J){for(let ee=this._rowElements.length;ee<=J;ee++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>J;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(Z,J){this._refreshRowElements(Z,J),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(L),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(L),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(Z,J,ee){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(Z,J,ee),this.renderRows(0,this._bufferService.rows-1),!Z||!J)return;this._selectionRenderModel.update(this._terminal,Z,J,ee);const q=this._selectionRenderModel.viewportStartRow,Q=this._selectionRenderModel.viewportEndRow,ne=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(ne>=this._bufferService.rows||j<0)return;const U=this._document.createDocumentFragment();if(ee){const N=Z[0]>J[0];U.appendChild(this._createSelectionElement(ne,N?J[0]:Z[0],N?Z[0]:J[0],j-ne+1))}else{const N=q===ne?Z[0]:0,B=ne===Q?J[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(ne,N,B));const P=j-ne-1;if(U.appendChild(this._createSelectionElement(ne+1,0,this._bufferService.cols,P)),ne!==j){const Y=Q===j?J[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(j,0,Y))}}this._selectionContainer.appendChild(U)}_createSelectionElement(Z,J,ee,q=1){const Q=this._document.createElement("div"),ne=J*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(ee-J);return ne+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-ne),Q.style.height=q*this.dimensions.css.cell.height+"px",Q.style.top=Z*this.dimensions.css.cell.height+"px",Q.style.left=`${ne}px`,Q.style.width=`${j}px`,Q}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const Z of this._rowElements)Z.replaceChildren()}renderRows(Z,J){const ee=this._bufferService.buffer,q=ee.ybase+ee.y,Q=Math.min(ee.x,this._bufferService.cols-1),ne=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=Z;N<=J;N++){const B=N+ee.ydisp,P=this._rowElements[N],Y=ee.lines.get(B);if(!P||!Y)break;P.replaceChildren(...this._rowFactory.createRow(Y,B,B===q,j,U,Q,ne,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${A}${this._terminalClass}`}_handleLinkHover(Z){this._setCellUnderline(Z.x1,Z.x2,Z.y1,Z.y2,Z.cols,!0)}_handleLinkLeave(Z){this._setCellUnderline(Z.x1,Z.x2,Z.y1,Z.y2,Z.cols,!1)}_setCellUnderline(Z,J,ee,q,Q,ne){ee<0&&(Z=0),q<0&&(J=0);const j=this._bufferService.rows-1;ee=Math.max(Math.min(ee,j),0),q=Math.max(Math.min(q,j),0),Q=Math.min(Q,this._bufferService.cols);const U=this._bufferService.buffer,N=U.ybase+U.y,B=Math.min(U.x,Q-1),P=this._optionsService.rawOptions.cursorBlink,Y=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let he=ee;he<=q;++he){const V=he+U.ydisp,H=this._rowElements[he],ce=U.lines.get(V);if(!H||!ce)break;H.replaceChildren(...this._rowFactory.createRow(ce,V,V===N,Y,re,B,P,this.dimensions.css.cell.width,this._widthCache,ne?he===ee?Z:0:-1,ne?(he===q?J:Q)-1:-1))}}};c.DomRenderer=K=u([y(7,S.IInstantiationService),y(8,m.ICharSizeService),y(9,S.IOptionsService),y(10,S.IBufferService),y(11,m.ICoreBrowserService),y(12,m.IThemeService)],K)},3787:function(E,c,h){var u=this&&this.__decorate||function(R,M,w,L){var $,F=arguments.length,K=F<3?M:L===null?L=Object.getOwnPropertyDescriptor(M,w):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(R,M,w,L);else for(var Z=R.length-1;Z>=0;Z--)($=R[Z])&&(K=(F<3?$(K):F>3?$(M,w,K):$(M,w))||K);return F>3&&K&&Object.defineProperty(M,w,K),K},y=this&&this.__param||function(R,M){return function(w,L){M(w,L,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const f=h(2223),x=h(643),T=h(511),O=h(2585),C=h(8055),m=h(4725),g=h(4269),d=h(6171),p=h(3734);let S=c.DomRendererRowFactory=class{constructor(R,M,w,L,$,F,K){this._document=R,this._characterJoinerService=M,this._optionsService=w,this._coreBrowserService=L,this._coreService=$,this._decorationService=F,this._themeService=K,this._workCell=new T.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,M,w){this._selectionStart=R,this._selectionEnd=M,this._columnSelectMode=w}createRow(R,M,w,L,$,F,K,Z,J,ee,q){const Q=[],ne=this._characterJoinerService.getJoinedCharacters(M),j=this._themeService.colors;let U,N=R.getNoBgTrimmedLength();w&&N<F+1&&(N=F+1);let B=0,P="",Y=0,re=0,he=0,V=!1,H=0,ce=!1,oe=0;const me=[],_e=ee!==-1&&q!==-1;for(let Te=0;Te<N;Te++){R.loadCell(Te,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let Ze=!1,ut=Te,Ce=this._workCell;if(ne.length>0&&Te===ne[0][0]){Ze=!0;const Ye=ne.shift();Ce=new g.JoinedCellData(this._workCell,R.translateToString(!0,Ye[0],Ye[1]),Ye[1]-Ye[0]),ut=Ye[1]-1,je=Ce.getWidth()}const pe=this._isCellInSelection(Te,M),Rt=w&&Te===F,mi=_e&&Te>=ee&&Te<=q;let xs=!1;this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ye=>{xs=!0}));let qs=Ce.getChars()||x.WHITESPACE_CELL_CHAR;if(qs===" "&&(Ce.isUnderline()||Ce.isOverline())&&(qs=" "),oe=je*Z-J.get(qs,Ce.isBold(),Ce.isItalic()),U){if(B&&(pe&&ce||!pe&&!ce&&Ce.bg===Y)&&(pe&&ce&&j.selectionForeground||Ce.fg===re)&&Ce.extended.ext===he&&mi===V&&oe===H&&!Rt&&!Ze&&!xs){Ce.isInvisible()?P+=x.WHITESPACE_CELL_CHAR:P+=qs,B++;continue}B&&(U.textContent=P),U=this._document.createElement("span"),B=0,P=""}else U=this._document.createElement("span");if(Y=Ce.bg,re=Ce.fg,he=Ce.extended.ext,V=mi,H=oe,ce=pe,Ze&&F>=Te&&F<=ut&&(F=Te),!this._coreService.isCursorHidden&&Rt&&this._coreService.isCursorInitialized){if(me.push("xterm-cursor"),this._coreBrowserService.isFocused)K&&me.push("xterm-cursor-blink"),me.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){case"outline":me.push("xterm-cursor-outline");break;case"block":me.push("xterm-cursor-block");break;case"bar":me.push("xterm-cursor-bar");break;case"underline":me.push("xterm-cursor-underline")}}if(Ce.isBold()&&me.push("xterm-bold"),Ce.isItalic()&&me.push("xterm-italic"),Ce.isDim()&&me.push("xterm-dim"),P=Ce.isInvisible()?x.WHITESPACE_CELL_CHAR:Ce.getChars()||x.WHITESPACE_CELL_CHAR,Ce.isUnderline()&&(me.push(`xterm-underline-${Ce.extended.underlineStyle}`),P===" "&&(P=" "),!Ce.isUnderlineColorDefault()))if(Ce.isUnderlineColorRGB())U.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(Ce.getUnderlineColor()).join(",")})`;else{let Ye=Ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ce.isBold()&&Ye<8&&(Ye+=8),U.style.textDecorationColor=j.ansi[Ye].css}Ce.isOverline()&&(me.push("xterm-overline"),P===" "&&(P=" ")),Ce.isStrikethrough()&&me.push("xterm-strikethrough"),mi&&(U.style.textDecoration="underline");let Dt=Ce.getFgColor(),vt=Ce.getFgColorMode(),Yt=Ce.getBgColor(),Pi=Ce.getBgColorMode();const Ks=!!Ce.isInverse();if(Ks){const Ye=Dt;Dt=Yt,Yt=Ye;const ws=vt;vt=Pi,Pi=ws}let Ut,Vs,li,Cs=!1;switch(this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ye=>{Ye.options.layer!=="top"&&Cs||(Ye.backgroundColorRGB&&(Pi=50331648,Yt=Ye.backgroundColorRGB.rgba>>8&16777215,Ut=Ye.backgroundColorRGB),Ye.foregroundColorRGB&&(vt=50331648,Dt=Ye.foregroundColorRGB.rgba>>8&16777215,Vs=Ye.foregroundColorRGB),Cs=Ye.options.layer==="top")})),!Cs&&pe&&(Ut=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,Yt=Ut.rgba>>8&16777215,Pi=50331648,Cs=!0,j.selectionForeground&&(vt=50331648,Dt=j.selectionForeground.rgba>>8&16777215,Vs=j.selectionForeground)),Cs&&me.push("xterm-decoration-top"),Pi){case 16777216:case 33554432:li=j.ansi[Yt],me.push(`xterm-bg-${Yt}`);break;case 50331648:li=C.channels.toColor(Yt>>16,Yt>>8&255,255&Yt),this._addStyle(U,`background-color:#${A((Yt>>>0).toString(16),"0",6)}`);break;default:Ks?(li=j.foreground,me.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):li=j.background}switch(Ut||Ce.isDim()&&(Ut=C.color.multiplyOpacity(li,.5)),vt){case 16777216:case 33554432:Ce.isBold()&&Dt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Dt+=8),this._applyMinimumContrast(U,li,j.ansi[Dt],Ce,Ut,void 0)||me.push(`xterm-fg-${Dt}`);break;case 50331648:const Ye=C.channels.toColor(Dt>>16&255,Dt>>8&255,255&Dt);this._applyMinimumContrast(U,li,Ye,Ce,Ut,Vs)||this._addStyle(U,`color:#${A(Dt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(U,li,j.foreground,Ce,Ut,Vs)||Ks&&me.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}me.length&&(U.className=me.join(" "),me.length=0),Rt||Ze||xs?U.textContent=P:B++,oe!==this.defaultSpacing&&(U.style.letterSpacing=`${oe}px`),Q.push(U),Te=ut}return U&&B&&(U.textContent=P),Q}_applyMinimumContrast(R,M,w,L,$,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(L.getCode()))return!1;const K=this._getContrastCache(L);let Z;if($||F||(Z=K.getColor(M.rgba,w.rgba)),Z===void 0){const J=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);Z=C.color.ensureContrastRatio($||M,F||w,J),K.setColor(($||M).rgba,(F||w).rgba,Z??null)}return!!Z&&(this._addStyle(R,`color:${Z.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,M){R.setAttribute("style",`${R.getAttribute("style")||""}${M};`)}_isCellInSelection(R,M){const w=this._selectionStart,L=this._selectionEnd;return!(!w||!L)&&(this._columnSelectMode?w[0]<=L[0]?R>=w[0]&&M>=w[1]&&R<L[0]&&M<=L[1]:R<w[0]&&M>=w[1]&&R>=L[0]&&M<=L[1]:M>w[1]&&M<L[1]||w[1]===L[1]&&M===w[1]&&R>=w[0]&&R<L[0]||w[1]<L[1]&&M===L[1]&&R<L[0]||w[1]<L[1]&&M===w[1]&&R>=w[0])}};function A(R,M,w){for(;R.length<w;)R=M+R;return R}c.DomRendererRowFactory=S=u([y(1,m.ICharacterJoinerService),y(2,O.IOptionsService),y(3,m.ICoreBrowserService),y(4,O.ICoreService),y(5,O.IDecorationService),y(6,m.IThemeService)],S)},2550:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(h,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=h.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const y=h.createElement("span");y.classList.add("xterm-char-measure-element");const f=h.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const x=h.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontStyle="italic";const T=h.createElement("span");T.classList.add("xterm-char-measure-element"),T.style.fontWeight="bold",T.style.fontStyle="italic",this._measureElements=[y,f,x,T],this._container.appendChild(y),this._container.appendChild(f),this._container.appendChild(x),this._container.appendChild(T),u.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(h,u,y,f){h===this._font&&u===this._fontSize&&y===this._weight&&f===this._weightBold||(this._font=h,this._fontSize=u,this._weight=y,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(h,u,y){let f=0;if(!u&&!y&&h.length===1&&(f=h.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const O=this._measure(h,0);return O>0&&(this._flat[f]=O),O}let x=h;u&&(x+="B"),y&&(x+="I");let T=this._holey.get(x);if(T===void 0){let O=0;u&&(O|=1),y&&(O|=2),T=this._measure(h,O),T>0&&this._holey.set(x,T)}return T}_measure(h,u){const y=this._measureElements[u];return y.textContent=h.repeat(32),y.offsetWidth/32}}},2223:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const u=h(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(E,c)=>{function h(y){return 57508<=y&&y<=57558}function u(y){return y>=128512&&y<=128591||y>=127744&&y<=128511||y>=128640&&y<=128767||y>=9728&&y<=9983||y>=9984&&y<=10175||y>=65024&&y<=65039||y>=129280&&y<=129535||y>=127462&&y<=127487}Object.defineProperty(c,"__esModule",{value:!0}),c.computeNextVariantOffset=c.createRenderDimensions=c.treatGlyphAsBackgroundColor=c.allowRescaling=c.isEmoji=c.isRestrictedPowerlineGlyph=c.isPowerlineGlyph=c.throwIfFalsy=void 0,c.throwIfFalsy=function(y){if(!y)throw new Error("value must not be falsy");return y},c.isPowerlineGlyph=h,c.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},c.isEmoji=u,c.allowRescaling=function(y,f,x,T){return f===1&&x>Math.ceil(1.5*T)&&y!==void 0&&y>255&&!u(y)&&!h(y)&&!(function(O){return 57344<=O&&O<=63743})(y)},c.treatGlyphAsBackgroundColor=function(y){return h(y)||(function(f){return 9472<=f&&f<=9631})(y)},c.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},c.computeNextVariantOffset=function(y,f,x=0){return(y-(2*Math.round(f)-x))%(2*Math.round(f))}},6052:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class h{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(y,f,x,T=!1){if(this.selectionStart=f,this.selectionEnd=x,!f||!x||f[0]===x[0]&&f[1]===x[1])return void this.clear();const O=y.buffers.active.ydisp,C=f[1]-O,m=x[1]-O,g=Math.max(C,0),d=Math.min(m,y.rows-1);g>=y.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=T,this.viewportStartRow=C,this.viewportEndRow=m,this.viewportCappedStartRow=g,this.viewportCappedEndRow=d,this.startCol=f[0],this.endCol=x[0])}isCellSelected(y,f,x){return!!this.hasSelection&&(x-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&x>=this.viewportCappedStartRow&&f<this.endCol&&x<=this.viewportCappedEndRow:f<this.startCol&&x>=this.viewportCappedStartRow&&f>=this.endCol&&x<=this.viewportCappedEndRow:x>this.viewportStartRow&&x<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&x===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&x===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&x===this.viewportStartRow&&f>=this.startCol)}}c.createSelectionRenderModel=function(){return new h}},456:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(h){this._bufferService=h,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?h%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)-1]:[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[h,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[Math.max(h,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const h=this.selectionStart,u=this.selectionEnd;return!(!h||!u)&&(h[1]>u[1]||h[1]===u[1]&&h[0]>u[0])}handleTrim(h){return this.selectionStart&&(this.selectionStart[1]-=h),this.selectionEnd&&(this.selectionEnd[1]-=h),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(E,c,h){var u=this&&this.__decorate||function(d,p,S,A){var R,M=arguments.length,w=M<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,p,S,A);else for(var L=d.length-1;L>=0;L--)(R=d[L])&&(w=(M<3?R(w):M>3?R(p,S,w):R(p,S))||w);return M>3&&w&&Object.defineProperty(p,S,w),w},y=this&&this.__param||function(d,p){return function(S,A){p(S,A,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const f=h(2585),x=h(8460),T=h(844);let O=c.CharSizeService=class extends T.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,p,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new x.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new g(this._optionsService))}catch{this._measureStrategy=this.register(new m(d,p,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};c.CharSizeService=O=u([y(2,f.IOptionsService)],O);class C extends T.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(p,S){p!==void 0&&p>0&&S!==void 0&&S>0&&(this._result.width=p,this._result.height=S)}}class m extends C{constructor(p,S,A){super(),this._document=p,this._parentElement=S,this._optionsService=A,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class g extends C{constructor(p){super(),this._optionsService=p,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const p=this._ctx.measureText("W");return this._validateAndSet(p.width,p.fontBoundingBoxAscent+p.fontBoundingBoxDescent),this._result}}},4269:function(E,c,h){var u=this&&this.__decorate||function(g,d,p,S){var A,R=arguments.length,M=R<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(g,d,p,S);else for(var w=g.length-1;w>=0;w--)(A=g[w])&&(M=(R<3?A(M):R>3?A(d,p,M):A(d,p))||M);return R>3&&M&&Object.defineProperty(d,p,M),M},y=this&&this.__param||function(g,d){return function(p,S){d(p,S,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const f=h(3734),x=h(643),T=h(511),O=h(2585);class C extends f.AttributeData{constructor(d,p,S){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=p,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=C;let m=c.CharacterJoinerService=class ev{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new T.CellData}register(d){const p={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(p),p.id}deregister(d){for(let p=0;p<this._characterJoiners.length;p++)if(this._characterJoiners[p].id===d)return this._characterJoiners.splice(p,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const p=this._bufferService.buffer.lines.get(d);if(!p||p.length===0)return[];const S=[],A=p.translateToString(!0);let R=0,M=0,w=0,L=p.getFg(0),$=p.getBg(0);for(let F=0;F<p.getTrimmedLength();F++)if(p.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==$){if(F-R>1){const K=this._getJoinedRanges(A,w,M,p,R);for(let Z=0;Z<K.length;Z++)S.push(K[Z])}R=F,w=M,L=this._workCell.fg,$=this._workCell.bg}M+=this._workCell.getChars().length||x.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const F=this._getJoinedRanges(A,w,M,p,R);for(let K=0;K<F.length;K++)S.push(F[K])}return S}_getJoinedRanges(d,p,S,A,R){const M=d.substring(p,S);let w=[];try{w=this._characterJoiners[0].handler(M)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const $=this._characterJoiners[L].handler(M);for(let F=0;F<$.length;F++)ev._mergeRanges(w,$[F])}catch($){console.error($)}return this._stringRangesToCellRanges(w,A,R),w}_stringRangesToCellRanges(d,p,S){let A=0,R=!1,M=0,w=d[A];if(w){for(let L=S;L<this._bufferService.cols;L++){const $=p.getWidth(L),F=p.getString(L).length||x.WHITESPACE_CELL_CHAR.length;if($!==0){if(!R&&w[0]<=M&&(w[0]=L,R=!0),w[1]<=M){if(w[1]=L,w=d[++A],!w)break;w[0]<=M?(w[0]=L,R=!0):R=!1}M+=F}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(d,p){let S=!1;for(let A=0;A<d.length;A++){const R=d[A];if(S){if(p[1]<=R[0])return d[A-1][1]=p[1],d;if(p[1]<=R[1])return d[A-1][1]=Math.max(p[1],R[1]),d.splice(A,1),d;d.splice(A,1),A--}else{if(p[1]<=R[0])return d.splice(A,0,p),d;if(p[1]<=R[1])return R[0]=Math.min(p[0],R[0]),d;p[0]<R[1]&&(R[0]=Math.min(p[0],R[0]),S=!0)}}return S?d[d.length-1][1]=p[1]:d.push(p),d}};c.CharacterJoinerService=m=u([y(0,O.IBufferService)],m)},5114:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const u=h(844),y=h(8460),f=h(3656);class x extends u.Disposable{constructor(C,m,g){super(),this._textarea=C,this._window=m,this.mainDocument=g,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new T(this._window),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new y.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((d=>this._screenDprMonitor.setWindow(d)))),this.register((0,y.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(C){this._window!==C&&(this._window=C,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}}c.CoreBrowserService=x;class T extends u.Disposable{constructor(C){super(),this._parentWindow=C,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(C){this._parentWindow=C,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var C;this._outerListener&&((C=this._resolutionMediaMatchList)==null||C.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const u=h(844);class y extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(x){return this.linkProviders.push(x),{dispose:()=>{const T=this.linkProviders.indexOf(x);T!==-1&&this.linkProviders.splice(T,1)}}}}c.LinkProviderService=y},8934:function(E,c,h){var u=this&&this.__decorate||function(O,C,m,g){var d,p=arguments.length,S=p<3?C:g===null?g=Object.getOwnPropertyDescriptor(C,m):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(O,C,m,g);else for(var A=O.length-1;A>=0;A--)(d=O[A])&&(S=(p<3?d(S):p>3?d(C,m,S):d(C,m))||S);return p>3&&S&&Object.defineProperty(C,m,S),S},y=this&&this.__param||function(O,C){return function(m,g){C(m,g,O)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const f=h(4725),x=h(9806);let T=c.MouseService=class{constructor(O,C){this._renderService=O,this._charSizeService=C}getCoords(O,C,m,g,d){return(0,x.getCoords)(window,O,C,m,g,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(O,C){const m=(0,x.getCoordsRelativeToElement)(window,O,C);if(this._charSizeService.hasValidSize)return m[0]=Math.min(Math.max(m[0],0),this._renderService.dimensions.css.canvas.width-1),m[1]=Math.min(Math.max(m[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(m[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(m[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(m[0]),y:Math.floor(m[1])}}};c.MouseService=T=u([y(0,f.IRenderService),y(1,f.ICharSizeService)],T)},3230:function(E,c,h){var u=this&&this.__decorate||function(d,p,S,A){var R,M=arguments.length,w=M<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,p,S,A);else for(var L=d.length-1;L>=0;L--)(R=d[L])&&(w=(M<3?R(w):M>3?R(p,S,w):R(p,S))||w);return M>3&&w&&Object.defineProperty(p,S,w),w},y=this&&this.__param||function(d,p){return function(S,A){p(S,A,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const f=h(6193),x=h(4725),T=h(8460),O=h(844),C=h(7226),m=h(2585);let g=c.RenderService=class extends O.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,p,S,A,R,M,w,L){super(),this._rowCount=d,this._charSizeService=A,this._renderer=this.register(new O.MutableDisposable),this._pausedResizeTask=new C.DebouncedIdleTask,this._observerDisposable=this.register(new O.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new T.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new T.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new T.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new T.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer((($,F)=>this._renderRows($,F)),w),this.register(this._renderDebouncer),this.register(w.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>{var $;return($=this._renderer.value)==null?void 0:$.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(L.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(w.window,p),this.register(w.onWindowChange(($=>this._registerIntersectionObserver($,p))))}_registerIntersectionObserver(d,p){if("IntersectionObserver"in d){const S=new d.IntersectionObserver((A=>this._handleIntersectionChange(A[A.length-1])),{threshold:0});S.observe(p),this._observerDisposable.value=(0,O.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.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(d,p,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,p,this._rowCount))}_renderRows(d,p){this._renderer.value&&(d=Math.min(d,this._rowCount-1),p=Math.min(p,this._rowCount-1),this._renderer.value.renderRows(d,p),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:p}),this._onRender.fire({start:d,end:p}),this._isNextRenderRedrawOnly=!0)}resize(d,p){this._rowCount=p,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(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw((p=>this.refreshRows(p.start,p.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var d,p;this._renderer.value&&((p=(d=this._renderer.value).clearTextureAtlas)==null||p.call(d),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(d,p){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(d,p)})):this._renderer.value.handleResize(d,p),this._fullRefresh())}handleCharSizeChanged(){var d;(d=this._renderer.value)==null||d.handleCharSizeChanged()}handleBlur(){var d;(d=this._renderer.value)==null||d.handleBlur()}handleFocus(){var d;(d=this._renderer.value)==null||d.handleFocus()}handleSelectionChanged(d,p,S){var A;this._selectionState.start=d,this._selectionState.end=p,this._selectionState.columnSelectMode=S,(A=this._renderer.value)==null||A.handleSelectionChanged(d,p,S)}handleCursorMove(){var d;(d=this._renderer.value)==null||d.handleCursorMove()}clear(){var d;(d=this._renderer.value)==null||d.clear()}};c.RenderService=g=u([y(2,m.IOptionsService),y(3,x.ICharSizeService),y(4,m.IDecorationService),y(5,m.IBufferService),y(6,x.ICoreBrowserService),y(7,x.IThemeService)],g)},9312:function(E,c,h){var u=this&&this.__decorate||function(w,L,$,F){var K,Z=arguments.length,J=Z<3?L:F===null?F=Object.getOwnPropertyDescriptor(L,$):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(w,L,$,F);else for(var ee=w.length-1;ee>=0;ee--)(K=w[ee])&&(J=(Z<3?K(J):Z>3?K(L,$,J):K(L,$))||J);return Z>3&&J&&Object.defineProperty(L,$,J),J},y=this&&this.__param||function(w,L){return function($,F){L($,F,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const f=h(9806),x=h(9504),T=h(456),O=h(4725),C=h(8460),m=h(844),g=h(6114),d=h(4841),p=h(511),S=h(2585),A=" ",R=new RegExp(A,"g");let M=c.SelectionService=class extends m.Disposable{constructor(w,L,$,F,K,Z,J,ee,q){super(),this._element=w,this._screenElement=L,this._linkifier=$,this._bufferService=F,this._coreService=K,this._mouseService=Z,this._optionsService=J,this._renderService=ee,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new C.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new C.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Q=>this._handleMouseMove(Q),this._mouseUpListener=Q=>this._handleMouseUp(Q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Q=>this._handleTrim(Q))),this.register(this._bufferService.buffers.onBufferActivate((Q=>this._handleBufferActivate(Q)))),this.enable(),this._model=new T.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,m.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const w=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!w||!L||w[0]===L[0]&&w[1]===L[1])}get selectionText(){const w=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!w||!L)return"";const $=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(w[0]===L[0])return"";const K=w[0]<L[0]?w[0]:L[0],Z=w[0]<L[0]?L[0]:w[0];for(let J=w[1];J<=L[1];J++){const ee=$.translateBufferLineToString(J,!0,K,Z);F.push(ee)}}else{const K=w[1]===L[1]?L[0]:void 0;F.push($.translateBufferLineToString(w[1],!0,w[0],K));for(let Z=w[1]+1;Z<=L[1]-1;Z++){const J=$.lines.get(Z),ee=$.translateBufferLineToString(Z,!0);J!=null&&J.isWrapped?F[F.length-1]+=ee:F.push(ee)}if(w[1]!==L[1]){const Z=$.lines.get(L[1]),J=$.translateBufferLineToString(L[1],!0,0,L[0]);Z&&Z.isWrapped?F[F.length-1]+=J:F.push(J)}}return F.map((K=>K.replace(R," "))).join(g.isWindows?`\r
308
+ `:`
309
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(w){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),g.isLinux&&w&&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(w){const L=this._getMouseBufferCoords(w),$=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!($&&F&&L)&&this._areCoordsInSelection(L,$,F)}isCellInSelection(w,L){const $=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!$||!F)&&this._areCoordsInSelection([w,L],$,F)}_areCoordsInSelection(w,L,$){return w[1]>L[1]&&w[1]<$[1]||L[1]===$[1]&&w[1]===L[1]&&w[0]>=L[0]&&w[0]<$[0]||L[1]<$[1]&&w[1]===$[1]&&w[0]<$[0]||L[1]<$[1]&&w[1]===L[1]&&w[0]>=L[0]}_selectWordAtCursor(w,L){var K,Z;const $=(Z=(K=this._linkifier.currentLink)==null?void 0:K.link)==null?void 0:Z.range;if($)return this._model.selectionStart=[$.start.x-1,$.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)($,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(w);return!!F&&(this._selectWordAt(F,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,L){this._model.clearSelection(),w=Math.max(w,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const L=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(w){let L=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const $=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=$?0:(L>$&&(L-=$),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(w){return g.isMac?w.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:w.shiftKey}handleMouseDown(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._handleIncrementalClick(w):w.detail===1?this._handleSingleClick(w):w.detail===2?this._handleDoubleClick(w):w.detail===3&&this._handleTripleClick(w),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))}_handleSingleClick(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const L=this._getMouseBufferCoords(w);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(w){return w.altKey&&!(g.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(w),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const $=this._bufferService.buffer;if(this._model.selectionEnd[1]<$.lines.length){const F=$.lines.get(this._model.selectionEnd[1]);F&&F.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const w=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}}_handleMouseUp(w){const L=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&w.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const $=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if($&&$[0]!==void 0&&$[1]!==void 0){const F=(0,x.moveToCellSequence)($[0]-1,$[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,$=!(!w||!L||w[0]===L[0]&&w[1]===L[1]);$?w&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,L,$)):this._oldHasSelection&&this._fireOnSelectionChange(w,L,$)}_fireOnSelectionChange(w,L,$){this._oldSelectionStart=w,this._oldSelectionEnd=L,this._oldHasSelection=$,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(w,L){let $=L;for(let F=0;L>=F;F++){const K=w.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?$--:K>1&&L!==F&&($+=K-1)}return $}setSelection(w,L,$){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,L],this._model.selectionStartLength=$,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,L,$=!0,F=!0){if(w[0]>=this._bufferService.cols)return;const K=this._bufferService.buffer,Z=K.lines.get(w[1]);if(!Z)return;const J=K.translateBufferLineToString(w[1],!1);let ee=this._convertViewportColToCharacterIndex(Z,w[0]),q=ee;const Q=w[0]-ee;let ne=0,j=0,U=0,N=0;if(J.charAt(ee)===" "){for(;ee>0&&J.charAt(ee-1)===" ";)ee--;for(;q<J.length&&J.charAt(q+1)===" ";)q++}else{let Y=w[0],re=w[0];Z.getWidth(Y)===0&&(ne++,Y--),Z.getWidth(re)===2&&(j++,re++);const he=Z.getString(re).length;for(he>1&&(N+=he-1,q+=he-1);Y>0&&ee>0&&!this._isCharWordSeparator(Z.loadCell(Y-1,this._workCell));){Z.loadCell(Y-1,this._workCell);const V=this._workCell.getChars().length;this._workCell.getWidth()===0?(ne++,Y--):V>1&&(U+=V-1,ee-=V-1),ee--,Y--}for(;re<Z.length&&q+1<J.length&&!this._isCharWordSeparator(Z.loadCell(re+1,this._workCell));){Z.loadCell(re+1,this._workCell);const V=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,re++):V>1&&(N+=V-1,q+=V-1),q++,re++}}q++;let B=ee+Q-ne+U,P=Math.min(this._bufferService.cols,q-ee+ne+j-U-N);if(L||J.slice(ee,q).trim()!==""){if($&&B===0&&Z.getCodePoint(0)!==32){const Y=K.lines.get(w[1]-1);if(Y&&Z.isWrapped&&Y.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(re){const he=this._bufferService.cols-re.start;B-=he,P+=he}}}if(F&&B+P===this._bufferService.cols&&Z.getCodePoint(this._bufferService.cols-1)!==32){const Y=K.lines.get(w[1]+1);if(Y!=null&&Y.isWrapped&&Y.getCodePoint(0)!==32){const re=this._getWordAt([0,w[1]+1],!1,!1,!0);re&&(P+=re.length)}}return{start:B,length:P}}}_selectWordAt(w,L){const $=this._getWordAt(w,L);if($){for(;$.start<0;)$.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[$.start,w[1]],this._model.selectionStartLength=$.length}}_selectToWordAt(w){const L=this._getWordAt(w,!0);if(L){let $=w[1];for(;L.start<0;)L.start+=this._bufferService.cols,$--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,$++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,$]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const L=this._bufferService.buffer.getWrappedRangeForLine(w),$={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)($,this._bufferService.cols)}};c.SelectionService=M=u([y(3,S.IBufferService),y(4,S.ICoreService),y(5,O.IMouseService),y(6,S.IOptionsService),y(7,O.IRenderService),y(8,O.ICoreBrowserService)],M)},4725:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ILinkProviderService=c.IThemeService=c.ICharacterJoinerService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;const u=h(8343);c.ICharSizeService=(0,u.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),c.IMouseService=(0,u.createDecorator)("MouseService"),c.IRenderService=(0,u.createDecorator)("RenderService"),c.ISelectionService=(0,u.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,u.createDecorator)("ThemeService"),c.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(E,c,h){var u=this&&this.__decorate||function(M,w,L,$){var F,K=arguments.length,Z=K<3?w:$===null?$=Object.getOwnPropertyDescriptor(w,L):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(M,w,L,$);else for(var J=M.length-1;J>=0;J--)(F=M[J])&&(Z=(K<3?F(Z):K>3?F(w,L,Z):F(w,L))||Z);return K>3&&Z&&Object.defineProperty(w,L,Z),Z},y=this&&this.__param||function(M,w){return function(L,$){w(L,$,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const f=h(7239),x=h(8055),T=h(8460),O=h(844),C=h(2585),m=x.css.toColor("#ffffff"),g=x.css.toColor("#000000"),d=x.css.toColor("#ffffff"),p=x.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[x.css.toColor("#2e3436"),x.css.toColor("#cc0000"),x.css.toColor("#4e9a06"),x.css.toColor("#c4a000"),x.css.toColor("#3465a4"),x.css.toColor("#75507b"),x.css.toColor("#06989a"),x.css.toColor("#d3d7cf"),x.css.toColor("#555753"),x.css.toColor("#ef2929"),x.css.toColor("#8ae234"),x.css.toColor("#fce94f"),x.css.toColor("#729fcf"),x.css.toColor("#ad7fa8"),x.css.toColor("#34e2e2"),x.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let L=0;L<216;L++){const $=w[L/36%6|0],F=w[L/6%6|0],K=w[L%6];M.push({css:x.channels.toCss($,F,K),rgba:x.channels.toRgba($,F,K)})}for(let L=0;L<24;L++){const $=8+10*L;M.push({css:x.channels.toCss($,$,$),rgba:x.channels.toRgba($,$,$)})}return M})());let A=c.ThemeService=class extends O.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new T.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:m,background:g,cursor:d,cursorAccent:p,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:x.color.blend(g,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:x.color.blend(g,S),ansi:c.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(M={}){const w=this._colors;if(w.foreground=R(M.foreground,m),w.background=R(M.background,g),w.cursor=R(M.cursor,d),w.cursorAccent=R(M.cursorAccent,p),w.selectionBackgroundTransparent=R(M.selectionBackground,S),w.selectionBackgroundOpaque=x.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=R(M.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=x.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=M.selectionForeground?R(M.selectionForeground,x.NULL_COLOR):void 0,w.selectionForeground===x.NULL_COLOR&&(w.selectionForeground=void 0),x.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=x.color.opacity(w.selectionBackgroundTransparent,.3)),x.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=x.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=c.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=R(M.black,c.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=R(M.red,c.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=R(M.green,c.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=R(M.yellow,c.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=R(M.blue,c.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=R(M.magenta,c.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=R(M.cyan,c.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=R(M.white,c.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=R(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=R(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=R(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=R(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=R(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=R(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=R(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=R(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const L=Math.min(w.ansi.length-16,M.extendedAnsi.length);for(let $=0;$<L;$++)w.ansi[$+16]=R(M.extendedAnsi[$],c.DEFAULT_ANSI_COLORS[$+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let w=0;w<this._restoreColors.ansi.length;++w)this._colors.ansi[w]=this._restoreColors.ansi[w]}modifyColors(M){M(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(M,w){if(M!==void 0)try{return x.css.toColor(M)}catch{}return w}c.ThemeService=A=u([y(0,C.IOptionsService)],A)},6349:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const u=h(8460),y=h(844);class f extends y.Disposable{constructor(T){super(),this._maxLength=T,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(T){if(this._maxLength===T)return;const O=new Array(T);for(let C=0;C<Math.min(T,this.length);C++)O[C]=this._array[this._getCyclicIndex(C)];this._array=O,this._maxLength=T,this._startIndex=0}get length(){return this._length}set length(T){if(T>this._length)for(let O=this._length;O<T;O++)this._array[O]=void 0;this._length=T}get(T){return this._array[this._getCyclicIndex(T)]}set(T,O){this._array[this._getCyclicIndex(T)]=O}push(T){this._array[this._getCyclicIndex(this._length)]=T,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(T,O,...C){if(O){for(let m=T;m<this._length-O;m++)this._array[this._getCyclicIndex(m)]=this._array[this._getCyclicIndex(m+O)];this._length-=O,this.onDeleteEmitter.fire({index:T,amount:O})}for(let m=this._length-1;m>=T;m--)this._array[this._getCyclicIndex(m+C.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<C.length;m++)this._array[this._getCyclicIndex(T+m)]=C[m];if(C.length&&this.onInsertEmitter.fire({index:T,amount:C.length}),this._length+C.length>this._maxLength){const m=this._length+C.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=C.length}trimStart(T){T>this._length&&(T=this._length),this._startIndex+=T,this._length-=T,this.onTrimEmitter.fire(T)}shiftElements(T,O,C){if(!(O<=0)){if(T<0||T>=this._length)throw new Error("start argument out of range");if(T+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(let g=O-1;g>=0;g--)this.set(T+g+C,this.get(T+g));const m=T+O+C-this._length;if(m>0)for(this._length+=m;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let m=0;m<O;m++)this.set(T+m+C,this.get(T+m))}}_getCyclicIndex(T){return(this._startIndex+T)%this._maxLength}}c.CircularList=f},1439:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function h(u,y=5){if(typeof u!="object")return u;const f=Array.isArray(u)?[]:{};for(const x in u)f[x]=y<=1?u[x]:u[x]&&h(u[x],y-1);return f}},8055:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.contrastRatio=c.toPaddedHex=c.rgba=c.rgb=c.css=c.color=c.channels=c.NULL_COLOR=void 0;let h=0,u=0,y=0,f=0;var x,T,O,C,m;function g(p){const S=p.toString(16);return S.length<2?"0"+S:S}function d(p,S){return p<S?(S+.05)/(p+.05):(p+.05)/(S+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(p){p.toCss=function(S,A,R,M){return M!==void 0?`#${g(S)}${g(A)}${g(R)}${g(M)}`:`#${g(S)}${g(A)}${g(R)}`},p.toRgba=function(S,A,R,M=255){return(S<<24|A<<16|R<<8|M)>>>0},p.toColor=function(S,A,R,M){return{css:p.toCss(S,A,R,M),rgba:p.toRgba(S,A,R,M)}}})(x||(c.channels=x={})),(function(p){function S(A,R){return f=Math.round(255*R),[h,u,y]=m.toChannels(A.rgba),{css:x.toCss(h,u,y,f),rgba:x.toRgba(h,u,y,f)}}p.blend=function(A,R){if(f=(255&R.rgba)/255,f===1)return{css:R.css,rgba:R.rgba};const M=R.rgba>>24&255,w=R.rgba>>16&255,L=R.rgba>>8&255,$=A.rgba>>24&255,F=A.rgba>>16&255,K=A.rgba>>8&255;return h=$+Math.round((M-$)*f),u=F+Math.round((w-F)*f),y=K+Math.round((L-K)*f),{css:x.toCss(h,u,y),rgba:x.toRgba(h,u,y)}},p.isOpaque=function(A){return(255&A.rgba)==255},p.ensureContrastRatio=function(A,R,M){const w=m.ensureContrastRatio(A.rgba,R.rgba,M);if(w)return x.toColor(w>>24&255,w>>16&255,w>>8&255)},p.opaque=function(A){const R=(255|A.rgba)>>>0;return[h,u,y]=m.toChannels(R),{css:x.toCss(h,u,y),rgba:R}},p.opacity=S,p.multiplyOpacity=function(A,R){return f=255&A.rgba,S(A,f*R/255)},p.toColorRGB=function(A){return[A.rgba>>24&255,A.rgba>>16&255,A.rgba>>8&255]}})(T||(c.color=T={})),(function(p){let S,A;try{const R=document.createElement("canvas");R.width=1,R.height=1;const M=R.getContext("2d",{willReadFrequently:!0});M&&(S=M,S.globalCompositeOperation="copy",A=S.createLinearGradient(0,0,1,1))}catch{}p.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return h=parseInt(R.slice(1,2).repeat(2),16),u=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),x.toColor(h,u,y);case 5:return h=parseInt(R.slice(1,2).repeat(2),16),u=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),f=parseInt(R.slice(4,5).repeat(2),16),x.toColor(h,u,y,f);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const M=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return h=parseInt(M[1]),u=parseInt(M[2]),y=parseInt(M[3]),f=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),x.toColor(h,u,y,f);if(!S||!A)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=A,S.fillStyle=R,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[h,u,y,f]=S.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:x.toRgba(h,u,y,f),css:R}}})(O||(c.css=O={})),(function(p){function S(A,R,M){const w=A/255,L=R/255,$=M/255;return .2126*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*($<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4))}p.relativeLuminance=function(A){return S(A>>16&255,A>>8&255,255&A)},p.relativeLuminance2=S})(C||(c.rgb=C={})),(function(p){function S(R,M,w){const L=R>>24&255,$=R>>16&255,F=R>>8&255;let K=M>>24&255,Z=M>>16&255,J=M>>8&255,ee=d(C.relativeLuminance2(K,Z,J),C.relativeLuminance2(L,$,F));for(;ee<w&&(K>0||Z>0||J>0);)K-=Math.max(0,Math.ceil(.1*K)),Z-=Math.max(0,Math.ceil(.1*Z)),J-=Math.max(0,Math.ceil(.1*J)),ee=d(C.relativeLuminance2(K,Z,J),C.relativeLuminance2(L,$,F));return(K<<24|Z<<16|J<<8|255)>>>0}function A(R,M,w){const L=R>>24&255,$=R>>16&255,F=R>>8&255;let K=M>>24&255,Z=M>>16&255,J=M>>8&255,ee=d(C.relativeLuminance2(K,Z,J),C.relativeLuminance2(L,$,F));for(;ee<w&&(K<255||Z<255||J<255);)K=Math.min(255,K+Math.ceil(.1*(255-K))),Z=Math.min(255,Z+Math.ceil(.1*(255-Z))),J=Math.min(255,J+Math.ceil(.1*(255-J))),ee=d(C.relativeLuminance2(K,Z,J),C.relativeLuminance2(L,$,F));return(K<<24|Z<<16|J<<8|255)>>>0}p.blend=function(R,M){if(f=(255&M)/255,f===1)return M;const w=M>>24&255,L=M>>16&255,$=M>>8&255,F=R>>24&255,K=R>>16&255,Z=R>>8&255;return h=F+Math.round((w-F)*f),u=K+Math.round((L-K)*f),y=Z+Math.round(($-Z)*f),x.toRgba(h,u,y)},p.ensureContrastRatio=function(R,M,w){const L=C.relativeLuminance(R>>8),$=C.relativeLuminance(M>>8);if(d(L,$)<w){if($<L){const Z=S(R,M,w),J=d(L,C.relativeLuminance(Z>>8));if(J<w){const ee=A(R,M,w);return J>d(L,C.relativeLuminance(ee>>8))?Z:ee}return Z}const F=A(R,M,w),K=d(L,C.relativeLuminance(F>>8));if(K<w){const Z=S(R,M,w);return K>d(L,C.relativeLuminance(Z>>8))?F:Z}return F}},p.reduceLuminance=S,p.increaseLuminance=A,p.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(m||(c.rgba=m={})),c.toPaddedHex=g,c.contrastRatio=d},8969:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const u=h(844),y=h(2585),f=h(4348),x=h(7866),T=h(744),O=h(7302),C=h(6975),m=h(8460),g=h(1753),d=h(1480),p=h(7994),S=h(9282),A=h(5435),R=h(5981),M=h(2660);let w=!1;class L extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event((F=>{var K;(K=this._onScrollApi)==null||K.fire(F.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(F){for(const K in F)this.optionsService.options[K]=F[K]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new m.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new O.OptionsService(F)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(T.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(x.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(C.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(g.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(p.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(y.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new A.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,m.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,m.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,m.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,m.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((K=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((K=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((K,Z)=>this._inputHandler.parse(K,Z)))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,K){this._writeBuffer.write(F,K)}writeSync(F,K){this._logService.logLevel<=y.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(F,K)}input(F,K=!0){this.coreService.triggerDataEvent(F,K)}resize(F,K){isNaN(F)||isNaN(K)||(F=Math.max(F,T.MINIMUM_COLS),K=Math.max(K,T.MINIMUM_ROWS),this._bufferService.resize(F,K))}scroll(F,K=!1){this._bufferService.scroll(F,K)}scrollLines(F,K,Z){this._bufferService.scrollLines(F,K,Z)}scrollPages(F){this.scrollLines(F*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(F){const K=F-this._bufferService.buffer.ydisp;K!==0&&this.scrollLines(K)}registerEscHandler(F,K){return this._inputHandler.registerEscHandler(F,K)}registerDcsHandler(F,K){return this._inputHandler.registerDcsHandler(F,K)}registerCsiHandler(F,K){return this._inputHandler.registerCsiHandler(F,K)}registerOscHandler(F,K){return this._inputHandler.registerOscHandler(F,K)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const K=this.optionsService.rawOptions.windowsPty;K&&K.buildNumber!==void 0&&K.buildNumber!==void 0?F=K.backend==="conpty"&&K.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(F=!0),F?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const F=[];F.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const K of F)K.dispose()}))}}}c.CoreTerminal=L},8460:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===h)return void this._listeners.splice(u,1)}}})),this._event}fire(h,u){const y=[];for(let f=0;f<this._listeners.length;f++)y.push(this._listeners[f]);for(let f=0;f<y.length;f++)y[f].call(void 0,h,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(h,u){return h((y=>u.fire(y)))},c.runAndSubscribe=function(h,u){return u(void 0),h((y=>u(y)))}},5435:function(E,c,h){var u=this&&this.__decorate||function(ne,j,U,N){var B,P=arguments.length,Y=P<3?j:N===null?N=Object.getOwnPropertyDescriptor(j,U):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(ne,j,U,N);else for(var re=ne.length-1;re>=0;re--)(B=ne[re])&&(Y=(P<3?B(Y):P>3?B(j,U,Y):B(j,U))||Y);return P>3&&Y&&Object.defineProperty(j,U,Y),Y},y=this&&this.__param||function(ne,j){return function(U,N){j(U,N,ne)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const f=h(2584),x=h(7116),T=h(2015),O=h(844),C=h(482),m=h(8437),g=h(8460),d=h(643),p=h(511),S=h(3734),A=h(2585),R=h(1480),M=h(6242),w=h(6351),L=h(5941),$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function K(ne,j){if(ne>24)return j.setWinLines||!1;switch(ne){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var Z;(function(ne){ne[ne.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ne[ne.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(Z||(c.WindowsOptionsReportType=Z={}));let J=0;class ee extends O.Disposable{getAttrData(){return this._curAttrData}constructor(j,U,N,B,P,Y,re,he,V=new T.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=U,this._coreService=N,this._logService=B,this._optionsService=P,this._oscLinkService=Y,this._coreMouseService=re,this._unicodeService=he,this._parser=V,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new C.StringToUtf32,this._utf8Decoder=new C.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new g.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new g.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new g.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new g.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new g.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new g.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new g.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new g.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new g.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new g.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new g.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new g.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,ce)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:ce.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,ce,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:ce,data:oe})})),this._parser.setDcsHandlerFallback(((H,ce,oe)=>{ce==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:ce,payload:oe})})),this._parser.setPrintHandler(((H,ce,oe)=>this.print(H,ce,oe))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new M.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new M.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new M.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new M.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new M.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new M.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new M.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new M.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new M.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new M.OscHandler((H=>this.restoreCursorColor(H)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const H in x.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new w.DcsHandler(((H,ce)=>this.requestStatusString(H,ce))))}_preserveStack(j,U,N,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=U,this._parseStack.decodedLength=N,this._parseStack.position=B}_logSlowResolvingAsync(j){this._logService.logLevel<=A.LogLevelEnum.WARN&&Promise.race([j,new Promise(((U,N)=>setTimeout((()=>N("#SLOW_TIMEOUT")),5e3)))]).catch((U=>{if(U!=="#SLOW_TIMEOUT")throw U;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,U){let N,B=this._activeBuffer.x,P=this._activeBuffer.y,Y=0;const re=this._parseStack.paused;if(re){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,U))return this._logSlowResolvingAsync(N),N;B=this._parseStack.cursorStartX,P=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>F&&(Y=this._parseStack.position+F)}if(this._logService.logLevel<=A.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(H=>String.fromCharCode(H))).join("")}"`),typeof j=="string"?j.split("").map((H=>H.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(j.length,F))),re||this._dirtyRowTracker.clearRange(),j.length>F)for(let H=Y;H<j.length;H+=F){const ce=H+F<j.length?H+F:j.length,oe=typeof j=="string"?this._stringDecoder.decode(j.substring(H,ce),this._parseBuffer):this._utf8Decoder.decode(j.subarray(H,ce),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,oe))return this._preserveStack(B,P,oe,H),this._logSlowResolvingAsync(N),N}else if(!re){const H=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,H))return this._preserveStack(B,P,H,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===B&&this._activeBuffer.y===P||this._onCursorMove.fire();const he=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(Math.min(V,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(j,U,N){let B,P;const Y=this._charsetService.charset,re=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,V=this._coreService.decPrivateModes.wraparound,H=this._coreService.modes.insertMode,ce=this._curAttrData;let oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-U>0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ce);let me=this._parser.precedingJoinState;for(let _e=U;_e<N;++_e){if(B=j[_e],B<127&&Y){const ut=Y[String.fromCharCode(B)];ut&&(B=ut.charCodeAt(0))}const Te=this._unicodeService.charProperties(B,me);P=R.UnicodeService.extractWidth(Te);const je=R.UnicodeService.extractShouldJoin(Te),Ze=je?R.UnicodeService.extractWidth(me):0;if(me=Te,re&&this._onA11yChar.fire((0,C.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+P-Ze>he){if(V){const ut=oe;let Ce=this._activeBuffer.x-Ze;for(this._activeBuffer.x=Ze,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),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ze>0&&oe instanceof m.BufferLine&&oe.copyCellsFrom(ut,Ce,0,Ze,!1);Ce<he;)ut.setCellFromCodepoint(Ce++,0,1,ce)}else if(this._activeBuffer.x=he-1,P===2)continue}if(je&&this._activeBuffer.x){const ut=oe.getWidth(this._activeBuffer.x-1)?1:2;oe.addCodepointToCell(this._activeBuffer.x-ut,B,P);for(let Ce=P-Ze;--Ce>=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}else if(H&&(oe.insertCells(this._activeBuffer.x,P-Ze,this._activeBuffer.getNullCell(ce)),oe.getWidth(he-1)===2&&oe.setCellFromCodepoint(he-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,ce)),oe.setCellFromCodepoint(this._activeBuffer.x++,B,P,ce),P>0)for(;--P;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}this._parser.precedingJoinState=me,this._activeBuffer.x<he&&N-U>0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,ce),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,U){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,U):this._parser.registerCsiHandler(j,(N=>!K(N.params[0],this._optionsService.rawOptions.windowOptions)||U(N)))}registerDcsHandler(j,U){return this._parser.registerDcsHandler(j,new w.DcsHandler(U))}registerEscHandler(j,U){return this._parser.registerEscHandler(j,U)}registerOscHandler(j,U){return this._parser.registerOscHandler(j,new M.OscHandler(U))}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 j;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&&((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&j.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);U.hasWidth(this._activeBuffer.x)&&!U.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,U){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+U):(this._activeBuffer.x=j,this._activeBuffer.y=U),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,U){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+U)}cursorUp(j){const U=this._activeBuffer.y-this._activeBuffer.scrollTop;return U>=0?this._moveCursor(0,-Math.min(U,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const U=this._activeBuffer.scrollBottom-this._activeBuffer.y;return U>=0?this._moveCursor(0,Math.min(U,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const U=j.params[0];return U===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:U===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=j.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=j.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const U=j.params[0];return U===1&&(this._curAttrData.bg|=536870912),U!==2&&U!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,U,N,B=!1,P=!1){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);Y.replaceCells(U,N,this._activeBuffer.getNullCell(this._eraseAttrData()),P),B&&(Y.isWrapped=!1)}_resetBufferLine(j,U=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),U),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),N.isWrapped=!1)}eraseInDisplay(j,U=!1){let N;switch(this._restrictCursor(this._bufferService.cols),j.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,U);N<this._bufferService.rows;N++)this._resetBufferLine(N,U);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,U),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,U);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,U);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(j,U=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,U);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,U)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let U=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;U--;)this._activeBuffer.lines.splice(P-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(j){this._restrictCursor();let U=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;U--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let U=j.params[0]||1;for(;U--;)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(j){let U=j.params[0]||1;for(;U--;)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(m.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);B.deleteCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);B.insertCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);B.insertCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);B.deleteCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const U=this._parser.precedingJoinState;if(!U)return!0;const N=j.params[0]||1,B=R.UnicodeService.extractWidth(U),P=this._activeBuffer.x-B,Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(P),re=new Uint32Array(Y.length*N);let he=0;for(let H=0;H<Y.length;){const ce=Y.codePointAt(H)||0;re[he++]=ce,H+=ce>65535?2:1}let V=he;for(let H=1;H<N;++H)re.copyWithin(V,0,he),V+=he;return this.print(re,0,V),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,x.DEFAULT_CHARSET),this._charsetService.setgCharset(1,x.DEFAULT_CHARSET),this._charsetService.setgCharset(2,x.DEFAULT_CHARSET),this._charsetService.setgCharset(3,x.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),j.params[U]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(j,U){const N=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:P}=this._coreMouseService,Y=this._coreService,{buffers:re,cols:he}=this._bufferService,{active:V,alt:H}=re,ce=this._optionsService.rawOptions,oe=je=>je?1:2,me=j.params[0];return _e=me,Te=U?me===2?4:me===4?oe(Y.modes.insertMode):me===12?3:me===20?oe(ce.convertEol):0:me===1?oe(N.applicationCursorKeys):me===3?ce.windowOptions.setWinLines?he===80?2:he===132?1:0:0:me===6?oe(N.origin):me===7?oe(N.wraparound):me===8?3:me===9?oe(B==="X10"):me===12?oe(ce.cursorBlink):me===25?oe(!Y.isCursorHidden):me===45?oe(N.reverseWraparound):me===66?oe(N.applicationKeypad):me===67?4:me===1e3?oe(B==="VT200"):me===1002?oe(B==="DRAG"):me===1003?oe(B==="ANY"):me===1004?oe(N.sendFocus):me===1005?4:me===1006?oe(P==="SGR"):me===1015?4:me===1016?oe(P==="SGR_PIXELS"):me===1048?1:me===47||me===1047||me===1049?oe(V===H):me===2004?oe(N.bracketedPasteMode):0,Y.triggerDataEvent(`${f.C0.ESC}[${U?"":"?"}${_e};${Te}$y`),!0;var _e,Te}_updateAttrColor(j,U,N,B,P){return U===2?(j|=50331648,j&=-16777216,j|=S.AttributeData.fromColorRGB([N,B,P])):U===5&&(j&=-50331904,j|=33554432|255&N),j}_extractColor(j,U,N){const B=[0,0,-1,0,0,0];let P=0,Y=0;do{if(B[Y+P]=j.params[U+Y],j.hasSubParams(U+Y)){const re=j.getSubParams(U+Y);let he=0;do B[1]===5&&(P=1),B[Y+he+1+P]=re[he];while(++he<re.length&&he+Y+1+P<B.length);break}if(B[1]===5&&Y+P>=2||B[1]===2&&Y+P>=5)break;B[1]&&(P=1)}while(++Y+U<j.length&&Y+P<B.length);for(let re=2;re<B.length;++re)B[re]===-1&&(B[re]=0);switch(B[0]){case 38:N.fg=this._updateAttrColor(N.fg,B[1],B[3],B[4],B[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,B[1],B[3],B[4],B[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,B[1],B[3],B[4],B[5])}return Y}_processUnderline(j,U){U.extended=U.extended.clone(),(!~j||j>5)&&(j=1),U.extended.underlineStyle=j,U.fg|=268435456,j===0&&(U.fg&=-268435457),U.updateExtended()}_processSGR0(j){j.fg=m.DEFAULT_ATTR_DATA.fg,j.bg=m.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const U=j.length;let N;const B=this._curAttrData;for(let P=0;P<U;P++)N=j.params[P],N>=30&&N<=37?(B.fg&=-50331904,B.fg|=16777216|N-30):N>=40&&N<=47?(B.bg&=-50331904,B.bg|=16777216|N-40):N>=90&&N<=97?(B.fg&=-50331904,B.fg|=16777224|N-90):N>=100&&N<=107?(B.bg&=-50331904,B.bg|=16777224|N-100):N===0?this._processSGR0(B):N===1?B.fg|=134217728:N===3?B.bg|=67108864:N===4?(B.fg|=268435456,this._processUnderline(j.hasSubParams(P)?j.getSubParams(P)[0]:1,B)):N===5?B.fg|=536870912:N===7?B.fg|=67108864:N===8?B.fg|=1073741824:N===9?B.fg|=2147483648:N===2?B.bg|=134217728:N===21?this._processUnderline(2,B):N===22?(B.fg&=-134217729,B.bg&=-134217729):N===23?B.bg&=-67108865:N===24?(B.fg&=-268435457,this._processUnderline(0,B)):N===25?B.fg&=-536870913:N===27?B.fg&=-67108865:N===28?B.fg&=-1073741825:N===29?B.fg&=2147483647:N===39?(B.fg&=-67108864,B.fg|=16777215&m.DEFAULT_ATTR_DATA.fg):N===49?(B.bg&=-67108864,B.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?P+=this._extractColor(j,P,B):N===53?B.bg|=1073741824:N===55?B.bg&=-1073741825:N===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):N===100?(B.fg&=-67108864,B.fg|=16777215&m.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const U=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${U};${N}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const U=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${U};${N}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(j){const U=j.params[0]||1;switch(U){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const N=U%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(j){const U=j.params[0]||1;let N;return(j.length<2||(N=j.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>U&&(this._activeBuffer.scrollTop=U-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(j){if(!K(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const U=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:U!==2&&this._onRequestWindowsOptionsReport.fire(Z.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(Z.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:U!==0&&U!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),U!==0&&U!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:U!==0&&U!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),U!==0&&U!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const U=[],N=j.split(";");for(;N.length>1;){const B=N.shift(),P=N.shift();if(/^\d+$/.exec(B)){const Y=parseInt(B);if(Q(Y))if(P==="?")U.push({type:0,index:Y});else{const re=(0,L.parseColor)(P);re&&U.push({type:1,index:Y,color:re})}}}return U.length&&this._onColor.fire(U),!0}setHyperlink(j){const U=j.split(";");return!(U.length<2)&&(U[1]?this._createHyperlink(U[0],U[1]):!U[0]&&this._finishHyperlink())}_createHyperlink(j,U){this._getCurrentLinkId()&&this._finishHyperlink();const N=j.split(":");let B;const P=N.findIndex((Y=>Y.startsWith("id=")));return P!==-1&&(B=N[P].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:U}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,U){const N=j.split(";");for(let B=0;B<N.length&&!(U>=this._specialColors.length);++B,++U)if(N[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[U]}]);else{const P=(0,L.parseColor)(N[B]);P&&this._onColor.fire([{type:1,index:this._specialColors[U],color:P}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const U=[],N=j.split(";");for(let B=0;B<N.length;++B)if(/^\d+$/.exec(N[B])){const P=parseInt(N[B]);Q(P)&&U.push({type:2,index:P})}return U.length&&this._onColor.fire(U),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,x.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset($[j[0]],x.CHARSETS[j[1]]||x.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new p.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let U=0;U<this._bufferService.rows;++U){const N=this._activeBuffer.ybase+this._activeBuffer.y+U,B=this._activeBuffer.lines.get(N);B&&(B.fill(j),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,U){const N=this._bufferService.buffer,B=this._optionsService.rawOptions;return(P=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${P}${f.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,U){this._dirtyRowTracker.markRangeDirty(j,U)}}c.InputHandler=ee;let q=class{constructor(ne){this._bufferService=ne,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ne){ne<this.start?this.start=ne:ne>this.end&&(this.end=ne)}markRangeDirty(ne,j){ne>j&&(J=ne,ne=j,j=J),ne<this.start&&(this.start=ne),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Q(ne){return 0<=ne&&ne<256}q=u([y(0,A.IBufferService)],q)},844:(E,c)=>{function h(u){for(const y of u)y.dispose();u.length=0}Object.defineProperty(c,"__esModule",{value:!0}),c.getDisposeArrayDisposable=c.disposeArray=c.toDisposable=c.MutableDisposable=c.Disposable=void 0,c.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const y=this._disposables.indexOf(u);y!==-1&&this._disposables.splice(y,1)}},c.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var y;this._isDisposed||u===this._value||((y=this._value)==null||y.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},c.toDisposable=function(u){return{dispose:u}},c.disposeArray=h,c.getDisposeArrayDisposable=function(u){return{dispose:()=>h(u)}}},1505:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(y,f,x){this._data[y]||(this._data[y]={}),this._data[y][f]=x}get(y,f){return this._data[y]?this._data[y][f]:void 0}clear(){this._data={}}}c.TwoKeyMap=h,c.FourKeyMap=class{constructor(){this._data=new h}set(u,y,f,x,T){this._data.get(u,y)||this._data.set(u,y,new h),this._data.get(u,y).set(f,x,T)}get(u,y,f,x){var T;return(T=this._data.get(u,y))==null?void 0:T.get(f,x)}clear(){this._data.clear()}}},6114:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.isChromeOS=c.isLinux=c.isWindows=c.isIphone=c.isIpad=c.isMac=c.getSafariVersion=c.isSafari=c.isLegacyEdge=c.isFirefox=c.isNode=void 0,c.isNode=typeof process<"u"&&"title"in process;const h=c.isNode?"node":navigator.userAgent,u=c.isNode?"node":navigator.platform;c.isFirefox=h.includes("Firefox"),c.isLegacyEdge=h.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(h),c.getSafariVersion=function(){if(!c.isSafari)return 0;const y=h.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),c.isIpad=u==="iPad",c.isIphone=u==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),c.isLinux=u.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(h)},6106:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let h=0;c.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(h=this._search(this._getKey(u)),this._array.splice(h,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const y=this._getKey(u);if(y===void 0||(h=this._search(y),h===-1)||this._getKey(this._array[h])!==y)return!1;do if(this._array[h]===u)return this._array.splice(h,1),!0;while(++h<this._array.length&&this._getKey(this._array[h])===y);return!1}*getKeyIterator(u){if(this._array.length!==0&&(h=this._search(u),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===u))do yield this._array[h];while(++h<this._array.length&&this._getKey(this._array[h])===u)}forEachByKey(u,y){if(this._array.length!==0&&(h=this._search(u),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===u))do y(this._array[h]);while(++h<this._array.length&&this._getKey(this._array[h])===u)}values(){return[...this._array].values()}_search(u){let y=0,f=this._array.length-1;for(;f>=y;){let x=y+f>>1;const T=this._getKey(this._array[x]);if(T>u)f=x-1;else{if(!(T<u)){for(;x>0&&this._getKey(this._array[x-1])===u;)x--;return x}y=x+1}}return y}}},7226:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const u=h(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(T){this._tasks.push(T),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(T){this._idleCallback=void 0;let O=0,C=0,m=T.timeRemaining(),g=0;for(;this._i<this._tasks.length;){if(O=Date.now(),this._tasks[this._i]()||this._i++,O=Math.max(1,Date.now()-O),C=Math.max(O,C),g=T.timeRemaining(),1.5*C>g)return m-O<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-O))}ms`),void this._start();m=g}this.clear()}}class f extends y{_requestCallback(T){return setTimeout((()=>T(this._createDeadline(16))))}_cancelCallback(T){clearTimeout(T)}_createDeadline(T){const O=Date.now()+T;return{timeRemaining:()=>Math.max(0,O-Date.now())}}}c.PriorityTaskQueue=f,c.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(x){return requestIdleCallback(x)}_cancelCallback(x){cancelIdleCallback(x)}}:f,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(x){this._queue.clear(),this._queue.enqueue(x)}flush(){this._queue.flush()}}},9282:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const u=h(643);c.updateWindowsModeWrappedState=function(y){const f=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),x=f==null?void 0:f.get(y.cols-1),T=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);T&&x&&(T.isWrapped=x[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&x[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new h;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}c.AttributeData=h;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,x=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=x}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=u},9092:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const u=h(6349),y=h(7226),f=h(3734),x=h(8437),T=h(4634),O=h(511),C=h(643),m=h(4863),g=h(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(d,p,S){this._hasScrollback=d,this._optionsService=p,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=x.DEFAULT_ATTR_DATA.clone(),this.savedCharset=g.DEFAULT_CHARSET,this.markers=[],this._nullCell=O.CellData.fromCharData([0,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),this._whitespaceCell=O.CellData.fromCharData([0,C.WHITESPACE_CELL_CHAR,C.WHITESPACE_CELL_WIDTH,C.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,p){return new x.BufferLine(this._bufferService.cols,this.getNullCell(d),p)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const p=d+this._optionsService.rawOptions.scrollback;return p>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:p}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=x.DEFAULT_ATTR_DATA);let p=this._rows;for(;p--;)this.lines.push(this.getBlankLine(d))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,p){const S=this.getNullCell(x.DEFAULT_ATTR_DATA);let A=0;const R=this._getCorrectBufferLength(p);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<d)for(let w=0;w<this.lines.length;w++)A+=+this.lines.get(w).resize(d,S);let M=0;if(this._rows<p)for(let w=this._rows;w<p;w++)this.lines.length<p+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new x.BufferLine(d,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new x.BufferLine(d,S)));else for(let w=this._rows;w>p;w--)this.lines.length>p+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const w=this.lines.length-R;w>0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=R}this.x=Math.min(this.x,d-1),this.y=Math.min(this.y,p-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=p-1,this._isReflowEnabled&&(this._reflow(d,p),this._cols>d))for(let M=0;M<this.lines.length;M++)A+=+this.lines.get(M).resize(d,S);this._cols=d,this._rows=p,this._memoryCleanupQueue.clear(),A>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let p=0;for(;this._memoryCleanupPosition<this.lines.length;)if(p+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),p>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,p){this._cols!==d&&(d>this._cols?this._reflowLarger(d,p):this._reflowSmaller(d,p))}_reflowLarger(d,p){const S=(0,T.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(x.DEFAULT_ATTR_DATA));if(S.length>0){const A=(0,T.reflowLargerCreateNewLayout)(this.lines,S);(0,T.reflowLargerApplyNewLayout)(this.lines,A.layout),this._reflowLargerAdjustViewport(d,p,A.countRemoved)}}_reflowLargerAdjustViewport(d,p,S){const A=this.getNullCell(x.DEFAULT_ATTR_DATA);let R=S;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<p&&this.lines.push(new x.BufferLine(d,A))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(d,p){const S=this.getNullCell(x.DEFAULT_ATTR_DATA),A=[];let R=0;for(let M=this.lines.length-1;M>=0;M--){let w=this.lines.get(M);if(!w||!w.isWrapped&&w.getTrimmedLength()<=d)continue;const L=[w];for(;w.isWrapped&&M>0;)w=this.lines.get(--M),L.unshift(w);const $=this.ybase+this.y;if($>=M&&$<M+L.length)continue;const F=L[L.length-1].getTrimmedLength(),K=(0,T.reflowSmallerGetNewLineLengths)(L,this._cols,d),Z=K.length-L.length;let J;J=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+Z):Math.max(0,this.lines.length-this.lines.maxLength+Z);const ee=[];for(let N=0;N<Z;N++){const B=this.getBlankLine(x.DEFAULT_ATTR_DATA,!0);ee.push(B)}ee.length>0&&(A.push({start:M+L.length+R,newLines:ee}),R+=ee.length),L.push(...ee);let q=K.length-1,Q=K[q];Q===0&&(q--,Q=K[q]);let ne=L.length-Z-1,j=F;for(;ne>=0;){const N=Math.min(j,Q);if(L[q]===void 0)break;if(L[q].copyCellsFrom(L[ne],j-N,Q-N,N,!0),Q-=N,Q===0&&(q--,Q=K[q]),j-=N,j===0){ne--;const B=Math.max(ne,0);j=(0,T.getWrappedLineTrimmedLength)(L,B,this._cols)}}for(let N=0;N<L.length;N++)K[N]<d&&L[N].setCell(K[N],S);let U=Z-J;for(;U-- >0;)this.ybase===0?this.y<p-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-p&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+Z,this.ybase+p-1)}if(A.length>0){const M=[],w=[];for(let q=0;q<this.lines.length;q++)w.push(this.lines.get(q));const L=this.lines.length;let $=L-1,F=0,K=A[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let Z=0;for(let q=Math.min(this.lines.maxLength-1,L+R-1);q>=0;q--)if(K&&K.start>$+Z){for(let Q=K.newLines.length-1;Q>=0;Q--)this.lines.set(q--,K.newLines[Q]);q++,M.push({index:$+1,amount:K.newLines.length}),Z+=K.newLines.length,K=A[++F]}else this.lines.set(q,w[$--]);let J=0;for(let q=M.length-1;q>=0;q--)M[q].index+=J,this.lines.onInsertEmitter.fire(M[q]),J+=M[q].amount;const ee=Math.max(0,L+R-this.lines.maxLength);ee>0&&this.lines.onTrimEmitter.fire(ee)}}translateBufferLineToString(d,p,S=0,A){const R=this.lines.get(d);return R?R.translateToString(p,S,A):""}getWrappedRangeForLine(d){let p=d,S=d;for(;p>0&&this.lines.get(p).isWrapped;)p--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:p,last:S}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].line===d&&(this.markers[p].dispose(),this.markers.splice(p--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const p=new m.Marker(d);return this.markers.push(p),p.register(this.lines.onTrim((S=>{p.line-=S,p.line<0&&p.dispose()}))),p.register(this.lines.onInsert((S=>{p.line>=S.index&&(p.line+=S.amount)}))),p.register(this.lines.onDelete((S=>{p.line>=S.index&&p.line<S.index+S.amount&&p.dispose(),p.line>S.index&&(p.line-=S.amount)}))),p.register(p.onDispose((()=>this._removeMarker(p)))),p}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const u=h(3734),y=h(511),f=h(643),x=h(482);c.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let T=0;class O{constructor(m,g,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const p=g||y.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let S=0;S<m;++S)this.setCell(S,p);this.length=m}get(m){const g=this._data[3*m+0],d=2097151&g;return[this._data[3*m+1],2097152&g?this._combined[m]:d?(0,x.stringFromCodePoint)(d):"",g>>22,2097152&g?this._combined[m].charCodeAt(this._combined[m].length-1):d]}set(m,g){this._data[3*m+1]=g[f.CHAR_DATA_ATTR_INDEX],g[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=g[1],this._data[3*m+0]=2097152|m|g[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=g[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(m){return this._data[3*m+0]>>22}hasWidth(m){return 12582912&this._data[3*m+0]}getFg(m){return this._data[3*m+1]}getBg(m){return this._data[3*m+2]}hasContent(m){return 4194303&this._data[3*m+0]}getCodePoint(m){const g=this._data[3*m+0];return 2097152&g?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&g}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const g=this._data[3*m+0];return 2097152&g?this._combined[m]:2097151&g?(0,x.stringFromCodePoint)(2097151&g):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,g){return T=3*m,g.content=this._data[T+0],g.fg=this._data[T+1],g.bg=this._data[T+2],2097152&g.content&&(g.combinedData=this._combined[m]),268435456&g.bg&&(g.extended=this._extendedAttrs[m]),g}setCell(m,g){2097152&g.content&&(this._combined[m]=g.combinedData),268435456&g.bg&&(this._extendedAttrs[m]=g.extended),this._data[3*m+0]=g.content,this._data[3*m+1]=g.fg,this._data[3*m+2]=g.bg}setCellFromCodepoint(m,g,d,p){268435456&p.bg&&(this._extendedAttrs[m]=p.extended),this._data[3*m+0]=g|d<<22,this._data[3*m+1]=p.fg,this._data[3*m+2]=p.bg}addCodepointToCell(m,g,d){let p=this._data[3*m+0];2097152&p?this._combined[m]+=(0,x.stringFromCodePoint)(g):2097151&p?(this._combined[m]=(0,x.stringFromCodePoint)(2097151&p)+(0,x.stringFromCodePoint)(g),p&=-2097152,p|=2097152):p=g|4194304,d&&(p&=-12582913,p|=d<<22),this._data[3*m+0]=p}insertCells(m,g,d){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,d),g<this.length-m){const p=new y.CellData;for(let S=this.length-m-g-1;S>=0;--S)this.setCell(m+g+S,this.loadCell(m+S,p));for(let S=0;S<g;++S)this.setCell(m+S,d)}else for(let p=m;p<this.length;++p)this.setCell(p,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(m,g,d){if(m%=this.length,g<this.length-m){const p=new y.CellData;for(let S=0;S<this.length-m-g;++S)this.setCell(m+S,this.loadCell(m+g+S,p));for(let S=this.length-g;S<this.length;++S)this.setCell(S,d)}else for(let p=m;p<this.length;++p)this.setCell(p,d);m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,d),this.getWidth(m)!==0||this.hasContent(m)||this.setCellFromCodepoint(m,0,1,d)}replaceCells(m,g,d,p=!1){if(p)for(m&&this.getWidth(m-1)===2&&!this.isProtected(m-1)&&this.setCellFromCodepoint(m-1,0,1,d),g<this.length&&this.getWidth(g-1)===2&&!this.isProtected(g)&&this.setCellFromCodepoint(g,0,1,d);m<g&&m<this.length;)this.isProtected(m)||this.setCell(m,d),m++;else for(m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,d),g<this.length&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g,0,1,d);m<g&&m<this.length;)this.setCell(m++,d)}resize(m,g){if(m===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*m;if(m>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const p=new Uint32Array(d);p.set(this._data),this._data=p}for(let p=this.length;p<m;++p)this.setCell(p,g)}else{this._data=this._data.subarray(0,d);const p=Object.keys(this._combined);for(let A=0;A<p.length;A++){const R=parseInt(p[A],10);R>=m&&delete this._combined[R]}const S=Object.keys(this._extendedAttrs);for(let A=0;A<S.length;A++){const R=parseInt(S[A],10);R>=m&&delete this._extendedAttrs[R]}}return this.length=m,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const m=new Uint32Array(this._data.length);return m.set(this._data),this._data=m,1}return 0}fill(m,g=!1){if(g)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,m);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,m)}}copyFrom(m){this.length!==m.length?this._data=new Uint32Array(m._data):this._data.set(m._data),this.length=m.length,this._combined={};for(const g in m._combined)this._combined[g]=m._combined[g];this._extendedAttrs={};for(const g in m._extendedAttrs)this._extendedAttrs[g]=m._extendedAttrs[g];this.isWrapped=m.isWrapped}clone(){const m=new O(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const g in this._combined)m._combined[g]=this._combined[g];for(const g in this._extendedAttrs)m._extendedAttrs[g]=this._extendedAttrs[g];return m.isWrapped=this.isWrapped,m}getTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0])return m+(this._data[3*m+0]>>22);return 0}getNoBgTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0]||50331648&this._data[3*m+2])return m+(this._data[3*m+0]>>22);return 0}copyCellsFrom(m,g,d,p,S){const A=m._data;if(S)for(let M=p-1;M>=0;M--){for(let w=0;w<3;w++)this._data[3*(d+M)+w]=A[3*(g+M)+w];268435456&A[3*(g+M)+2]&&(this._extendedAttrs[d+M]=m._extendedAttrs[g+M])}else for(let M=0;M<p;M++){for(let w=0;w<3;w++)this._data[3*(d+M)+w]=A[3*(g+M)+w];268435456&A[3*(g+M)+2]&&(this._extendedAttrs[d+M]=m._extendedAttrs[g+M])}const R=Object.keys(m._combined);for(let M=0;M<R.length;M++){const w=parseInt(R[M],10);w>=g&&(this._combined[w-g+d]=m._combined[w])}}translateToString(m,g,d,p){g=g??0,d=d??this.length,m&&(d=Math.min(d,this.getTrimmedLength())),p&&(p.length=0);let S="";for(;g<d;){const A=this._data[3*g+0],R=2097151&A,M=2097152&A?this._combined[g]:R?(0,x.stringFromCodePoint)(R):f.WHITESPACE_CELL_CHAR;if(S+=M,p)for(let w=0;w<M.length;++w)p.push(g);g+=A>>22||1}return p&&p.push(g),S}}c.BufferLine=O},4841:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(h,u){if(h.start.y>h.end.y)throw new Error(`Buffer range end (${h.end.x}, ${h.end.y}) cannot be before start (${h.start.x}, ${h.start.y})`);return u*(h.end.y-h.start.y)+(h.end.x-h.start.x+1)}},4634:(E,c)=>{function h(u,y,f){if(y===u.length-1)return u[y].getTrimmedLength();const x=!u[y].hasContent(f-1)&&u[y].getWidth(f-1)===1,T=u[y+1].getWidth(0)===2;return x&&T?f-1:f}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(u,y,f,x,T){const O=[];for(let C=0;C<u.length-1;C++){let m=C,g=u.get(++m);if(!g.isWrapped)continue;const d=[u.get(C)];for(;m<u.length&&g.isWrapped;)d.push(g),g=u.get(++m);if(x>=C&&x<m){C+=d.length-1;continue}let p=0,S=h(d,p,y),A=1,R=0;for(;A<d.length;){const w=h(d,A,y),L=w-R,$=f-S,F=Math.min(L,$);d[p].copyCellsFrom(d[A],R,S,F,!1),S+=F,S===f&&(p++,S=0),R+=F,R===w&&(A++,R=0),S===0&&p!==0&&d[p-1].getWidth(f-1)===2&&(d[p].copyCellsFrom(d[p-1],f-1,S++,1,!1),d[p-1].setCell(f-1,T))}d[p].replaceCells(S,f,T);let M=0;for(let w=d.length-1;w>0&&(w>p||d[w].getTrimmedLength()===0);w--)M++;M>0&&(O.push(C+d.length-M),O.push(M)),C+=d.length-1}return O},c.reflowLargerCreateNewLayout=function(u,y){const f=[];let x=0,T=y[x],O=0;for(let C=0;C<u.length;C++)if(T===C){const m=y[++x];u.onDeleteEmitter.fire({index:C-O,amount:m}),C+=m-1,O+=m,T=y[++x]}else f.push(C);return{layout:f,countRemoved:O}},c.reflowLargerApplyNewLayout=function(u,y){const f=[];for(let x=0;x<y.length;x++)f.push(u.get(y[x]));for(let x=0;x<f.length;x++)u.set(x,f[x]);u.length=y.length},c.reflowSmallerGetNewLineLengths=function(u,y,f){const x=[],T=u.map(((g,d)=>h(u,d,y))).reduce(((g,d)=>g+d));let O=0,C=0,m=0;for(;m<T;){if(T-m<f){x.push(T-m);break}O+=f;const g=h(u,C,y);O>g&&(O-=g,C++);const d=u[C].getWidth(O-1)===2;d&&O--;const p=d?f-1:f;x.push(p),m+=p}return x},c.getWrappedLineTrimmedLength=h},5295:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const u=h(8460),y=h(844),f=h(9092);class x extends y.Disposable{constructor(O,C){super(),this._optionsService=O,this._bufferService=C,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(O){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(O),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(O,C){this._normal.resize(O,C),this._alt.resize(O,C),this.setupTabStops(O)}setupTabStops(O){this._normal.setupTabStops(O),this._alt.setupTabStops(O)}}c.BufferSet=x},511:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const u=h(482),y=h(643),f=h(3734);class x extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(O){const C=new x;return C.setFromCharData(O),C}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(O){this.fg=O[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let C=!1;if(O[y.CHAR_DATA_CHAR_INDEX].length>2)C=!0;else if(O[y.CHAR_DATA_CHAR_INDEX].length===2){const m=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const g=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=g&&g<=57343?this.content=1024*(m-55296)+g-56320+65536|O[y.CHAR_DATA_WIDTH_INDEX]<<22:C=!0}else C=!0}else this.content=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|O[y.CHAR_DATA_WIDTH_INDEX]<<22;C&&(this.combinedData=O[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|O[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=x},643:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WHITESPACE_CELL_CODE=c.WHITESPACE_CELL_WIDTH=c.WHITESPACE_CELL_CHAR=c.NULL_CELL_CODE=c.NULL_CELL_WIDTH=c.NULL_CELL_CHAR=c.CHAR_DATA_CODE_INDEX=c.CHAR_DATA_WIDTH_INDEX=c.CHAR_DATA_CHAR_INDEX=c.CHAR_DATA_ATTR_INDEX=c.DEFAULT_EXT=c.DEFAULT_ATTR=c.DEFAULT_COLOR=void 0,c.DEFAULT_COLOR=0,c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,c.DEFAULT_EXT=0,c.CHAR_DATA_ATTR_INDEX=0,c.CHAR_DATA_CHAR_INDEX=1,c.CHAR_DATA_WIDTH_INDEX=2,c.CHAR_DATA_CODE_INDEX=3,c.NULL_CELL_CHAR="",c.NULL_CELL_WIDTH=1,c.NULL_CELL_CODE=0,c.WHITESPACE_CELL_CHAR=" ",c.WHITESPACE_CELL_WIDTH=1,c.WHITESPACE_CELL_CODE=32},4863:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const u=h(8460),y=h(844);class f{get id(){return this._id}constructor(T){this.line=T,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,y.disposeArray)(this._disposables),this._disposables.length=0)}register(T){return this._disposables.push(T),T}}c.Marker=f,f._nextId=1},7116:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DEFAULT_CHARSET=c.CHARSETS=void 0,c.CHARSETS={},c.DEFAULT_CHARSET=c.CHARSETS.B,c.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},c.CHARSETS.A={"#":"£"},c.CHARSETS.B=void 0,c.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},c.CHARSETS.C=c.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},c.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},c.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},c.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},c.CHARSETS.E=c.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},c.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},c.CHARSETS.H=c.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(E,c)=>{var h,u,y;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
310
+ `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(h||(c.C0=h={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(u||(c.C1=u={})),(function(f){f.ST=`${h.ESC}\\`})(y||(c.C1_ESCAPED=y={}))},7399:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const u=h(2584),y={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};c.evaluateKeyboardEvent=function(f,x,T,O){const C={type:0,cancel:!1,key:void 0},m=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?C.key=x?u.C0.ESC+"OA":u.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?C.key=x?u.C0.ESC+"OD":u.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?C.key=x?u.C0.ESC+"OC":u.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(C.key=x?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:C.key=f.ctrlKey?"\b":u.C0.DEL,f.altKey&&(C.key=u.C0.ESC+C.key);break;case 9:if(f.shiftKey){C.key=u.C0.ESC+"[Z";break}C.key=u.C0.HT,C.cancel=!0;break;case 13:C.key=f.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,C.cancel=!0;break;case 27:C.key=u.C0.ESC,f.altKey&&(C.key=u.C0.ESC+u.C0.ESC),C.cancel=!0;break;case 37:if(f.metaKey)break;m?(C.key=u.C0.ESC+"[1;"+(m+1)+"D",C.key===u.C0.ESC+"[1;3D"&&(C.key=u.C0.ESC+(T?"b":"[1;5D"))):C.key=x?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(f.metaKey)break;m?(C.key=u.C0.ESC+"[1;"+(m+1)+"C",C.key===u.C0.ESC+"[1;3C"&&(C.key=u.C0.ESC+(T?"f":"[1;5C"))):C.key=x?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(f.metaKey)break;m?(C.key=u.C0.ESC+"[1;"+(m+1)+"A",T||C.key!==u.C0.ESC+"[1;3A"||(C.key=u.C0.ESC+"[1;5A")):C.key=x?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(f.metaKey)break;m?(C.key=u.C0.ESC+"[1;"+(m+1)+"B",T||C.key!==u.C0.ESC+"[1;3B"||(C.key=u.C0.ESC+"[1;5B")):C.key=x?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(C.key=u.C0.ESC+"[2~");break;case 46:C.key=m?u.C0.ESC+"[3;"+(m+1)+"~":u.C0.ESC+"[3~";break;case 36:C.key=m?u.C0.ESC+"[1;"+(m+1)+"H":x?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:C.key=m?u.C0.ESC+"[1;"+(m+1)+"F":x?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:f.shiftKey?C.type=2:f.ctrlKey?C.key=u.C0.ESC+"[5;"+(m+1)+"~":C.key=u.C0.ESC+"[5~";break;case 34:f.shiftKey?C.type=3:f.ctrlKey?C.key=u.C0.ESC+"[6;"+(m+1)+"~":C.key=u.C0.ESC+"[6~";break;case 112:C.key=m?u.C0.ESC+"[1;"+(m+1)+"P":u.C0.ESC+"OP";break;case 113:C.key=m?u.C0.ESC+"[1;"+(m+1)+"Q":u.C0.ESC+"OQ";break;case 114:C.key=m?u.C0.ESC+"[1;"+(m+1)+"R":u.C0.ESC+"OR";break;case 115:C.key=m?u.C0.ESC+"[1;"+(m+1)+"S":u.C0.ESC+"OS";break;case 116:C.key=m?u.C0.ESC+"[15;"+(m+1)+"~":u.C0.ESC+"[15~";break;case 117:C.key=m?u.C0.ESC+"[17;"+(m+1)+"~":u.C0.ESC+"[17~";break;case 118:C.key=m?u.C0.ESC+"[18;"+(m+1)+"~":u.C0.ESC+"[18~";break;case 119:C.key=m?u.C0.ESC+"[19;"+(m+1)+"~":u.C0.ESC+"[19~";break;case 120:C.key=m?u.C0.ESC+"[20;"+(m+1)+"~":u.C0.ESC+"[20~";break;case 121:C.key=m?u.C0.ESC+"[21;"+(m+1)+"~":u.C0.ESC+"[21~";break;case 122:C.key=m?u.C0.ESC+"[23;"+(m+1)+"~":u.C0.ESC+"[23~";break;case 123:C.key=m?u.C0.ESC+"[24;"+(m+1)+"~":u.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(T&&!O||!f.altKey||f.metaKey)!T||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?C.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(C.key=u.C0.US),f.key==="@"&&(C.key=u.C0.NUL)):f.keyCode===65&&(C.type=1);else{const g=y[f.keyCode],d=g==null?void 0:g[f.shiftKey?1:0];if(d)C.key=u.C0.ESC+d;else if(f.keyCode>=65&&f.keyCode<=90){const p=f.ctrlKey?f.keyCode-64:f.keyCode+32;let S=String.fromCharCode(p);f.shiftKey&&(S=S.toUpperCase()),C.key=u.C0.ESC+S}else if(f.keyCode===32)C.key=u.C0.ESC+(f.ctrlKey?u.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let p=f.code.slice(3,4);f.shiftKey||(p=p.toLowerCase()),C.key=u.C0.ESC+p,C.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?C.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?C.key=u.C0.NUL:f.keyCode>=51&&f.keyCode<=55?C.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?C.key=u.C0.DEL:f.keyCode===219?C.key=u.C0.ESC:f.keyCode===220?C.key=u.C0.FS:f.keyCode===221&&(C.key=u.C0.GS)}return C}},482:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},c.utf32ToString=function(h,u=0,y=h.length){let f="";for(let x=u;x<y;++x){let T=h[x];T>65535?(T-=65536,f+=String.fromCharCode(55296+(T>>10))+String.fromCharCode(T%1024+56320)):f+=String.fromCharCode(T)}return f},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,u){const y=h.length;if(!y)return 0;let f=0,x=0;if(this._interim){const T=h.charCodeAt(x++);56320<=T&&T<=57343?u[f++]=1024*(this._interim-55296)+T-56320+65536:(u[f++]=this._interim,u[f++]=T),this._interim=0}for(let T=x;T<y;++T){const O=h.charCodeAt(T);if(55296<=O&&O<=56319){if(++T>=y)return this._interim=O,f;const C=h.charCodeAt(T);56320<=C&&C<=57343?u[f++]=1024*(O-55296)+C-56320+65536:(u[f++]=O,u[f++]=C)}else O!==65279&&(u[f++]=O)}return f}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,u){const y=h.length;if(!y)return 0;let f,x,T,O,C=0,m=0,g=0;if(this.interim[0]){let S=!1,A=this.interim[0];A&=(224&A)==192?31:(240&A)==224?15:7;let R,M=0;for(;(R=63&this.interim[++M])&&M<4;)A<<=6,A|=R;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=w-M;for(;g<L;){if(g>=y)return 0;if(R=h[g++],(192&R)!=128){g--,S=!0;break}this.interim[M++]=R,A<<=6,A|=63&R}S||(w===2?A<128?g--:u[C++]=A:w===3?A<2048||A>=55296&&A<=57343||A===65279||(u[C++]=A):A<65536||A>1114111||(u[C++]=A)),this.interim.fill(0)}const d=y-4;let p=g;for(;p<y;){for(;!(!(p<d)||128&(f=h[p])||128&(x=h[p+1])||128&(T=h[p+2])||128&(O=h[p+3]));)u[C++]=f,u[C++]=x,u[C++]=T,u[C++]=O,p+=4;if(f=h[p++],f<128)u[C++]=f;else if((224&f)==192){if(p>=y)return this.interim[0]=f,C;if(x=h[p++],(192&x)!=128){p--;continue}if(m=(31&f)<<6|63&x,m<128){p--;continue}u[C++]=m}else if((240&f)==224){if(p>=y)return this.interim[0]=f,C;if(x=h[p++],(192&x)!=128){p--;continue}if(p>=y)return this.interim[0]=f,this.interim[1]=x,C;if(T=h[p++],(192&T)!=128){p--;continue}if(m=(15&f)<<12|(63&x)<<6|63&T,m<2048||m>=55296&&m<=57343||m===65279)continue;u[C++]=m}else if((248&f)==240){if(p>=y)return this.interim[0]=f,C;if(x=h[p++],(192&x)!=128){p--;continue}if(p>=y)return this.interim[0]=f,this.interim[1]=x,C;if(T=h[p++],(192&T)!=128){p--;continue}if(p>=y)return this.interim[0]=f,this.interim[1]=x,this.interim[2]=T,C;if(O=h[p++],(192&O)!=128){p--;continue}if(m=(7&f)<<18|(63&x)<<12|(63&T)<<6|63&O,m<65536||m>1114111)continue;u[C++]=m}}return C}}},225:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const u=h(1480),y=[[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]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let x;c.UnicodeV6=class{constructor(){if(this.version="6",!x){x=new Uint8Array(65536),x.fill(1),x[0]=0,x.fill(0,1,32),x.fill(0,127,160),x.fill(2,4352,4448),x[9001]=2,x[9002]=2,x.fill(2,11904,42192),x[12351]=1,x.fill(2,44032,55204),x.fill(2,63744,64256),x.fill(2,65040,65050),x.fill(2,65072,65136),x.fill(2,65280,65377),x.fill(2,65504,65511);for(let T=0;T<y.length;++T)x.fill(0,y[T][0],y[T][1]+1)}}wcwidth(T){return T<32?0:T<127?1:T<65536?x[T]:(function(O,C){let m,g=0,d=C.length-1;if(O<C[0][0]||O>C[d][1])return!1;for(;d>=g;)if(m=g+d>>1,O>C[m][1])g=m+1;else{if(!(O<C[m][0]))return!0;d=m-1}return!1})(T,f)?0:T>=131072&&T<=196605||T>=196608&&T<=262141?2:1}charProperties(T,O){let C=this.wcwidth(T),m=C===0&&O!==0;if(m){const g=u.UnicodeService.extractWidth(O);g===0?m=!1:g>C&&(C=g)}return u.UnicodeService.createPropertyValue(0,C,m)}}},5981:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const u=h(8460),y=h(844);class f extends y.Disposable{constructor(T){super(),this._action=T,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(T,O){if(O!==void 0&&this._syncCalls>O)return void(this._syncCalls=0);if(this._pendingData+=T.length,this._writeBuffer.push(T),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let C;for(this._isSyncWriting=!0;C=this._writeBuffer.shift();){this._action(C);const m=this._callbacks.shift();m&&m()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(T,O){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=T.length,this._writeBuffer.push(T),this._callbacks.push(O),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=T.length,this._writeBuffer.push(T),this._callbacks.push(O)}_innerWrite(T=0,O=!0){const C=T||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const m=this._writeBuffer[this._bufferOffset],g=this._action(m,O);if(g){const p=S=>Date.now()-C>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(C,S);return void g.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(p)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=m.length,Date.now()-C>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}c.WriteBuffer=f},5941:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.parseColor=void 0;const h=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function y(f,x){const T=f.toString(16),O=T.length<2?"0"+T:T;switch(x){case 4:return T[0];case 8:return O;case 12:return(O+O).slice(0,3);default:return O+O}}c.parseColor=function(f){if(!f)return;let x=f.toLowerCase();if(x.indexOf("rgb:")===0){x=x.slice(4);const T=h.exec(x);if(T){const O=T[1]?15:T[4]?255:T[7]?4095:65535;return[Math.round(parseInt(T[1]||T[4]||T[7]||T[10],16)/O*255),Math.round(parseInt(T[2]||T[5]||T[8]||T[11],16)/O*255),Math.round(parseInt(T[3]||T[6]||T[9]||T[12],16)/O*255)]}}else if(x.indexOf("#")===0&&(x=x.slice(1),u.exec(x)&&[3,6,9,12].includes(x.length))){const T=x.length/3,O=[0,0,0];for(let C=0;C<3;++C){const m=parseInt(x.slice(T*C,T*C+T),16);O[C]=T===1?m<<4:T===2?m:T===3?m>>4:m>>8}return O}},c.toRgbString=function(f,x=16){const[T,O,C]=f;return`rgb:${y(T,x)}/${y(O,x)}/${y(C,x)}`}},5770:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const u=h(482),y=h(8742),f=h(5770),x=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=x,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=x}registerHandler(O,C){this._handlers[O]===void 0&&(this._handlers[O]=[]);const m=this._handlers[O];return m.push(C),{dispose:()=>{const g=m.indexOf(C);g!==-1&&m.splice(g,1)}}}clearHandler(O){this._handlers[O]&&delete this._handlers[O]}setHandlerFallback(O){this._handlerFb=O}reset(){if(this._active.length)for(let O=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;O>=0;--O)this._active[O].unhook(!1);this._stack.paused=!1,this._active=x,this._ident=0}hook(O,C){if(this.reset(),this._ident=O,this._active=this._handlers[O]||x,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].hook(C);else this._handlerFb(this._ident,"HOOK",C)}put(O,C,m){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(O,C,m);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(O,C,m))}unhook(O,C=!0){if(this._active.length){let m=!1,g=this._active.length-1,d=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,m=C,d=this._stack.fallThrough,this._stack.paused=!1),!d&&m===!1){for(;g>=0&&(m=this._active[g].unhook(O),m!==!0);g--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,m;g--}for(;g>=0;g--)if(m=this._active[g].unhook(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,m}else this._handlerFb(this._ident,"UNHOOK",O);this._active=x,this._ident=0}};const T=new y.Params;T.addParam(0),c.DcsHandler=class{constructor(O){this._handler=O,this._data="",this._params=T,this._hitLimit=!1}hook(O){this._params=O.length>1||O.params[0]?O.clone():T,this._data="",this._hitLimit=!1}put(O,C,m){this._hitLimit||(this._data+=(0,u.utf32ToString)(O,C,m),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(O){let C=!1;if(this._hitLimit)C=!1;else if(O&&(C=this._handler(this._data,this._params),C instanceof Promise))return C.then((m=>(this._params=T,this._data="",this._hitLimit=!1,m)));return this._params=T,this._data="",this._hitLimit=!1,C}}},2015:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const u=h(844),y=h(8742),f=h(6242),x=h(6351);class T{constructor(g){this.table=new Uint8Array(g)}setDefault(g,d){this.table.fill(g<<4|d)}add(g,d,p,S){this.table[d<<8|g]=p<<4|S}addMany(g,d,p,S){for(let A=0;A<g.length;A++)this.table[d<<8|g[A]]=p<<4|S}}c.TransitionTable=T;const O=160;c.VT500_TRANSITION_TABLE=(function(){const m=new T(4095),g=Array.apply(null,Array(256)).map(((M,w)=>w)),d=(M,w)=>g.slice(M,w),p=d(32,127),S=d(0,24);S.push(25),S.push.apply(S,d(28,32));const A=d(0,14);let R;for(R in m.setDefault(1,0),m.addMany(p,0,2,0),A)m.addMany([24,26,153,154],R,3,0),m.addMany(d(128,144),R,3,0),m.addMany(d(144,152),R,3,0),m.add(156,R,0,0),m.add(27,R,11,1),m.add(157,R,4,8),m.addMany([152,158,159],R,0,7),m.add(155,R,11,3),m.add(144,R,11,9);return m.addMany(S,0,3,0),m.addMany(S,1,3,1),m.add(127,1,0,1),m.addMany(S,8,0,8),m.addMany(S,3,3,3),m.add(127,3,0,3),m.addMany(S,4,3,4),m.add(127,4,0,4),m.addMany(S,6,3,6),m.addMany(S,5,3,5),m.add(127,5,0,5),m.addMany(S,2,3,2),m.add(127,2,0,2),m.add(93,1,4,8),m.addMany(p,8,5,8),m.add(127,8,5,8),m.addMany([156,27,24,26,7],8,6,0),m.addMany(d(28,32),8,0,8),m.addMany([88,94,95],1,0,7),m.addMany(p,7,0,7),m.addMany(S,7,0,7),m.add(156,7,0,0),m.add(127,7,0,7),m.add(91,1,11,3),m.addMany(d(64,127),3,7,0),m.addMany(d(48,60),3,8,4),m.addMany([60,61,62,63],3,9,4),m.addMany(d(48,60),4,8,4),m.addMany(d(64,127),4,7,0),m.addMany([60,61,62,63],4,0,6),m.addMany(d(32,64),6,0,6),m.add(127,6,0,6),m.addMany(d(64,127),6,0,0),m.addMany(d(32,48),3,9,5),m.addMany(d(32,48),5,9,5),m.addMany(d(48,64),5,0,6),m.addMany(d(64,127),5,7,0),m.addMany(d(32,48),4,9,5),m.addMany(d(32,48),1,9,2),m.addMany(d(32,48),2,9,2),m.addMany(d(48,127),2,10,0),m.addMany(d(48,80),1,10,0),m.addMany(d(81,88),1,10,0),m.addMany([89,90,92],1,10,0),m.addMany(d(96,127),1,10,0),m.add(80,1,11,9),m.addMany(S,9,0,9),m.add(127,9,0,9),m.addMany(d(28,32),9,0,9),m.addMany(d(32,48),9,9,12),m.addMany(d(48,60),9,8,10),m.addMany([60,61,62,63],9,9,10),m.addMany(S,11,0,11),m.addMany(d(32,128),11,0,11),m.addMany(d(28,32),11,0,11),m.addMany(S,10,0,10),m.add(127,10,0,10),m.addMany(d(28,32),10,0,10),m.addMany(d(48,60),10,8,10),m.addMany([60,61,62,63],10,0,11),m.addMany(d(32,48),10,9,12),m.addMany(S,12,0,12),m.add(127,12,0,12),m.addMany(d(28,32),12,0,12),m.addMany(d(32,48),12,9,12),m.addMany(d(48,64),12,0,11),m.addMany(d(64,127),12,12,13),m.addMany(d(64,127),10,12,13),m.addMany(d(64,127),9,12,13),m.addMany(S,13,13,13),m.addMany(p,13,13,13),m.add(127,13,0,13),m.addMany([27,156,24,26],13,14,0),m.add(O,0,2,0),m.add(O,8,5,8),m.add(O,6,0,6),m.add(O,11,0,11),m.add(O,13,13,13),m})();class C extends u.Disposable{constructor(g=c.VT500_TRANSITION_TABLE){super(),this._transitions=g,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(d,p,S)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,p)=>{},this._escHandlerFb=d=>{},this._errorHandlerFb=d=>d,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new x.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(g,d=[64,126]){let p=0;if(g.prefix){if(g.prefix.length>1)throw new Error("only one byte as prefix supported");if(p=g.prefix.charCodeAt(0),p&&60>p||p>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(g.intermediates){if(g.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let A=0;A<g.intermediates.length;++A){const R=g.intermediates.charCodeAt(A);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");p<<=8,p|=R}}if(g.final.length!==1)throw new Error("final must be a single byte");const S=g.final.charCodeAt(0);if(d[0]>S||S>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return p<<=8,p|=S,p}identToString(g){const d=[];for(;g;)d.push(String.fromCharCode(255&g)),g>>=8;return d.reverse().join("")}setPrintHandler(g){this._printHandler=g}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(g,d){const p=this._identifier(g,[48,126]);this._escHandlers[p]===void 0&&(this._escHandlers[p]=[]);const S=this._escHandlers[p];return S.push(d),{dispose:()=>{const A=S.indexOf(d);A!==-1&&S.splice(A,1)}}}clearEscHandler(g){this._escHandlers[this._identifier(g,[48,126])]&&delete this._escHandlers[this._identifier(g,[48,126])]}setEscHandlerFallback(g){this._escHandlerFb=g}setExecuteHandler(g,d){this._executeHandlers[g.charCodeAt(0)]=d}clearExecuteHandler(g){this._executeHandlers[g.charCodeAt(0)]&&delete this._executeHandlers[g.charCodeAt(0)]}setExecuteHandlerFallback(g){this._executeHandlerFb=g}registerCsiHandler(g,d){const p=this._identifier(g);this._csiHandlers[p]===void 0&&(this._csiHandlers[p]=[]);const S=this._csiHandlers[p];return S.push(d),{dispose:()=>{const A=S.indexOf(d);A!==-1&&S.splice(A,1)}}}clearCsiHandler(g){this._csiHandlers[this._identifier(g)]&&delete this._csiHandlers[this._identifier(g)]}setCsiHandlerFallback(g){this._csiHandlerFb=g}registerDcsHandler(g,d){return this._dcsParser.registerHandler(this._identifier(g),d)}clearDcsHandler(g){this._dcsParser.clearHandler(this._identifier(g))}setDcsHandlerFallback(g){this._dcsParser.setHandlerFallback(g)}registerOscHandler(g,d){return this._oscParser.registerHandler(g,d)}clearOscHandler(g){this._oscParser.clearHandler(g)}setOscHandlerFallback(g){this._oscParser.setHandlerFallback(g)}setErrorHandler(g){this._errorHandler=g}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(g,d,p,S,A){this._parseStack.state=g,this._parseStack.handlers=d,this._parseStack.handlerPos=p,this._parseStack.transition=S,this._parseStack.chunkPos=A}parse(g,d,p){let S,A=0,R=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(p===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const w=this._parseStack.handlers;let L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(p===!1&&L>-1){for(;L>=0&&(S=w[L](this._params),S!==!0);L--)if(S instanceof Promise)return this._parseStack.handlerPos=L,S}this._parseStack.handlers=[];break;case 4:if(p===!1&&L>-1){for(;L>=0&&(S=w[L](),S!==!0);L--)if(S instanceof Promise)return this._parseStack.handlerPos=L,S}this._parseStack.handlers=[];break;case 6:if(A=g[this._parseStack.chunkPos],S=this._dcsParser.unhook(A!==24&&A!==26,p),S)return S;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(A=g[this._parseStack.chunkPos],S=this._oscParser.end(A!==24&&A!==26,p),S)return S;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let w=M;w<d;++w){switch(A=g[w],R=this._transitions.table[this.currentState<<8|(A<160?A:O)],R>>4){case 2:for(let Z=w+1;;++Z){if(Z>=d||(A=g[Z])<32||A>126&&A<O){this._printHandler(g,w,Z),w=Z-1;break}if(++Z>=d||(A=g[Z])<32||A>126&&A<O){this._printHandler(g,w,Z),w=Z-1;break}if(++Z>=d||(A=g[Z])<32||A>126&&A<O){this._printHandler(g,w,Z),w=Z-1;break}if(++Z>=d||(A=g[Z])<32||A>126&&A<O){this._printHandler(g,w,Z),w=Z-1;break}}break;case 3:this._executeHandlers[A]?this._executeHandlers[A]():this._executeHandlerFb(A),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:w,code:A,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const L=this._csiHandlers[this._collect<<8|A];let $=L?L.length-1:-1;for(;$>=0&&(S=L[$](this._params),S!==!0);$--)if(S instanceof Promise)return this._preserveStack(3,L,$,R,w),S;$<0&&this._csiHandlerFb(this._collect<<8|A,this._params),this.precedingJoinState=0;break;case 8:do switch(A){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(A-48)}while(++w<d&&(A=g[w])>47&&A<60);w--;break;case 9:this._collect<<=8,this._collect|=A;break;case 10:const F=this._escHandlers[this._collect<<8|A];let K=F?F.length-1:-1;for(;K>=0&&(S=F[K](),S!==!0);K--)if(S instanceof Promise)return this._preserveStack(4,F,K,R,w),S;K<0&&this._escHandlerFb(this._collect<<8|A),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|A,this._params);break;case 13:for(let Z=w+1;;++Z)if(Z>=d||(A=g[Z])===24||A===26||A===27||A>127&&A<O){this._dcsParser.put(g,w,Z),w=Z-1;break}break;case 14:if(S=this._dcsParser.unhook(A!==24&&A!==26),S)return this._preserveStack(6,[],0,R,w),S;A===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let Z=w+1;;Z++)if(Z>=d||(A=g[Z])<32||A>127&&A<O){this._oscParser.put(g,w,Z),w=Z-1;break}break;case 6:if(S=this._oscParser.end(A!==24&&A!==26),S)return this._preserveStack(5,[],0,R,w),S;A===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}c.EscapeSequenceParser=C},6242:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const u=h(5770),y=h(482),f=[];c.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(x,T){this._handlers[x]===void 0&&(this._handlers[x]=[]);const O=this._handlers[x];return O.push(T),{dispose:()=>{const C=O.indexOf(T);C!==-1&&O.splice(C,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].start();else this._handlerFb(this._id,"START")}_put(x,T,O){if(this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].put(x,T,O);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(x,T,O))}start(){this.reset(),this._state=1}put(x,T,O){if(this._state!==3){if(this._state===1)for(;T<O;){const C=x[T++];if(C===59){this._state=2,this._start();break}if(C<48||57<C)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+C-48}this._state===2&&O-T>0&&this._put(x,T,O)}}end(x,T=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let O=!1,C=this._active.length-1,m=!1;if(this._stack.paused&&(C=this._stack.loopPosition-1,O=T,m=this._stack.fallThrough,this._stack.paused=!1),!m&&O===!1){for(;C>=0&&(O=this._active[C].end(x),O!==!0);C--)if(O instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!1,O;C--}for(;C>=0;C--)if(O=this._active[C].end(!1),O instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!0,O}else this._handlerFb(this._id,"END",x);this._active=f,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(x){this._handler=x,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(x,T,O){this._hitLimit||(this._data+=(0,y.utf32ToString)(x,T,O),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(x){let T=!1;if(this._hitLimit)T=!1;else if(x&&(T=this._handler(this._data),T instanceof Promise))return T.then((O=>(this._data="",this._hitLimit=!1,O)));return this._data="",this._hitLimit=!1,T}}},8742:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const h=2147483647;class u{static fromArray(f){const x=new u;if(!f.length)return x;for(let T=Array.isArray(f[0])?1:0;T<f.length;++T){const O=f[T];if(Array.isArray(O))for(let C=0;C<O.length;++C)x.addSubParam(O[C]);else x.addParam(O)}return x}constructor(f=32,x=32){if(this.maxLength=f,this.maxSubParamsLength=x,x>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(x),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new u(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let x=0;x<this.length;++x){f.push(this.params[x]);const T=this._subParamsIdx[x]>>8,O=255&this._subParamsIdx[x];O-T>0&&f.push(Array.prototype.slice.call(this._subParams,T,O))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>h?h:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>h?h:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const x=this._subParamsIdx[f]>>8,T=255&this._subParamsIdx[f];return T-x>0?this._subParams.subarray(x,T):null}getSubParamsAll(){const f={};for(let x=0;x<this.length;++x){const T=this._subParamsIdx[x]>>8,O=255&this._subParamsIdx[x];O-T>0&&(f[x]=this._subParams.slice(T,O))}return f}addDigit(f){let x;if(this._rejectDigits||!(x=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const T=this._digitIsSub?this._subParams:this.params,O=T[x-1];T[x-1]=~O?Math.min(10*O+f,h):f}}c.Params=u},5741:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let h=this._addons.length-1;h>=0;h--)this._addons[h].instance.dispose()}loadAddon(h,u){const y={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(y),u.dispose=()=>this._wrappedAddonDispose(y),u.activate(h)}_wrappedAddonDispose(h){if(h.isDisposed)return;let u=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===h){u=y;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");h.isDisposed=!0,h.dispose.apply(h.instance),this._addons.splice(u,1)}}},8771:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const u=h(3785),y=h(511);c.BufferApiView=class{constructor(f,x){this._buffer=f,this.type=x}init(f){return this._buffer=f,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(f){const x=this._buffer.lines.get(f);if(x)return new u.BufferLineApiView(x)}getNullCell(){return new y.CellData}}},3785:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const u=h(511);c.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,f){if(!(y<0||y>=this._line.length))return f?(this._line.loadCell(y,f),f):this._line.loadCell(y,new u.CellData)}translateToString(y,f,x){return this._line.translateToString(y,f,x)}}},8285:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const u=h(8771),y=h(8460),f=h(844);class x extends f.Disposable{constructor(O){super(),this._core=O,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}c.BufferNamespaceApi=x},7975:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(h){this._core=h}registerCsiHandler(h,u){return this._core.registerCsiHandler(h,(y=>u(y.toArray())))}addCsiHandler(h,u){return this.registerCsiHandler(h,u)}registerDcsHandler(h,u){return this._core.registerDcsHandler(h,((y,f)=>u(y,f.toArray())))}addDcsHandler(h,u){return this.registerDcsHandler(h,u)}registerEscHandler(h,u){return this._core.registerEscHandler(h,u)}addEscHandler(h,u){return this.registerEscHandler(h,u)}registerOscHandler(h,u){return this._core.registerOscHandler(h,u)}addOscHandler(h,u){return this.registerOscHandler(h,u)}}},7090:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(h){this._core=h}register(h){this._core.unicodeService.register(h)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(h){this._core.unicodeService.activeVersion=h}}},744:function(E,c,h){var u=this&&this.__decorate||function(m,g,d,p){var S,A=arguments.length,R=A<3?g:p===null?p=Object.getOwnPropertyDescriptor(g,d):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,g,d,p);else for(var M=m.length-1;M>=0;M--)(S=m[M])&&(R=(A<3?S(R):A>3?S(g,d,R):S(g,d))||R);return A>3&&R&&Object.defineProperty(g,d,R),R},y=this&&this.__param||function(m,g){return function(d,p){g(d,p,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const f=h(8460),x=h(844),T=h(5295),O=h(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let C=c.BufferService=class extends x.Disposable{get buffer(){return this.buffers.active}constructor(m){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(m.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(m.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new T.BufferSet(m,this))}resize(m,g){this.cols=m,this.rows=g,this.buffers.resize(m,g),this._onResize.fire({cols:m,rows:g})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(m,g=!1){const d=this.buffer;let p;p=this._cachedBlankLine,p&&p.length===this.cols&&p.getFg(0)===m.fg&&p.getBg(0)===m.bg||(p=d.getBlankLine(m,g),this._cachedBlankLine=p),p.isWrapped=g;const S=d.ybase+d.scrollTop,A=d.ybase+d.scrollBottom;if(d.scrollTop===0){const R=d.lines.isFull;A===d.lines.length-1?R?d.lines.recycle().copyFrom(p):d.lines.push(p.clone()):d.lines.splice(A+1,0,p.clone()),R?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const R=A-S+1;d.lines.shiftElements(S+1,R-1,-1),d.lines.set(A,p.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(m,g,d){const p=this.buffer;if(m<0){if(p.ydisp===0)return;this.isUserScrolling=!0}else m+p.ydisp>=p.ybase&&(this.isUserScrolling=!1);const S=p.ydisp;p.ydisp=Math.max(Math.min(p.ydisp+m,p.ybase),0),S!==p.ydisp&&(g||this._onScroll.fire(p.ydisp))}};c.BufferService=C=u([y(0,O.IOptionsService)],C)},7994:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0,c.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(h){this.glevel=h,this.charset=this._charsets[h]}setgCharset(h,u){this._charsets[h]=u,this.glevel===h&&(this.charset=u)}}},1753:function(E,c,h){var u=this&&this.__decorate||function(p,S,A,R){var M,w=arguments.length,L=w<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(p,S,A,R);else for(var $=p.length-1;$>=0;$--)(M=p[$])&&(L=(w<3?M(L):w>3?M(S,A,L):M(S,A))||L);return w>3&&L&&Object.defineProperty(S,A,L),L},y=this&&this.__param||function(p,S){return function(A,R){S(A,R,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const f=h(2585),x=h(8460),T=h(844),O={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:p=>p.button!==4&&p.action===1&&(p.ctrl=!1,p.alt=!1,p.shift=!1,!0)},VT200:{events:19,restrict:p=>p.action!==32},DRAG:{events:23,restrict:p=>p.action!==32||p.button!==3},ANY:{events:31,restrict:p=>!0}};function C(p,S){let A=(p.ctrl?16:0)|(p.shift?4:0)|(p.alt?8:0);return p.button===4?(A|=64,A|=p.action):(A|=3&p.button,4&p.button&&(A|=64),8&p.button&&(A|=128),p.action===32?A|=32:p.action!==0||S||(A|=3)),A}const m=String.fromCharCode,g={DEFAULT:p=>{const S=[C(p,!1)+32,p.col+32,p.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${m(S[0])}${m(S[1])}${m(S[2])}`},SGR:p=>{const S=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${C(p,!0)};${p.col};${p.row}${S}`},SGR_PIXELS:p=>{const S=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${C(p,!0)};${p.x};${p.y}${S}`}};let d=c.CoreMouseService=class extends T.Disposable{constructor(p,S){super(),this._bufferService=p,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new x.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const A of Object.keys(O))this.addProtocol(A,O[A]);for(const A of Object.keys(g))this.addEncoding(A,g[A]);this.reset()}addProtocol(p,S){this._protocols[p]=S}addEncoding(p,S){this._encodings[p]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(p){if(!this._protocols[p])throw new Error(`unknown protocol "${p}"`);this._activeProtocol=p,this._onProtocolChange.fire(this._protocols[p].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(p){if(!this._encodings[p])throw new Error(`unknown encoding "${p}"`);this._activeEncoding=p}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(p){if(p.col<0||p.col>=this._bufferService.cols||p.row<0||p.row>=this._bufferService.rows||p.button===4&&p.action===32||p.button===3&&p.action!==32||p.button!==4&&(p.action===2||p.action===3)||(p.col++,p.row++,p.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,p,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(p))return!1;const S=this._encodings[this._activeEncoding](p);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=p,!0}explainEvents(p){return{down:!!(1&p),up:!!(2&p),drag:!!(4&p),move:!!(8&p),wheel:!!(16&p)}}_equalEvents(p,S,A){if(A){if(p.x!==S.x||p.y!==S.y)return!1}else if(p.col!==S.col||p.row!==S.row)return!1;return p.button===S.button&&p.action===S.action&&p.ctrl===S.ctrl&&p.alt===S.alt&&p.shift===S.shift}};c.CoreMouseService=d=u([y(0,f.IBufferService),y(1,f.ICoreService)],d)},6975:function(E,c,h){var u=this&&this.__decorate||function(d,p,S,A){var R,M=arguments.length,w=M<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,p,S,A);else for(var L=d.length-1;L>=0;L--)(R=d[L])&&(w=(M<3?R(w):M>3?R(p,S,w):R(p,S))||w);return M>3&&w&&Object.defineProperty(p,S,w),w},y=this&&this.__param||function(d,p){return function(S,A){p(S,A,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const f=h(1439),x=h(8460),T=h(844),O=h(2585),C=Object.freeze({insertMode:!1}),m=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let g=c.CoreService=class extends T.Disposable{constructor(d,p,S){super(),this._bufferService=d,this._logService=p,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new x.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new x.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(C),this.decPrivateModes=(0,f.clone)(m)}reset(){this.modes=(0,f.clone)(C),this.decPrivateModes=(0,f.clone)(m)}triggerDataEvent(d,p=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;p&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),p&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,(()=>d.split("").map((A=>A.charCodeAt(0))))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,(()=>d.split("").map((p=>p.charCodeAt(0))))),this._onBinary.fire(d))}};c.CoreService=g=u([y(0,O.IBufferService),y(1,O.ILogService),y(2,O.IOptionsService)],g)},9074:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const u=h(8055),y=h(8460),f=h(844),x=h(6106);let T=0,O=0;class C extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new x.SortedList((d=>d==null?void 0:d.marker.line)),this._onDecorationRegistered=this.register(new y.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new y.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(d){if(d.marker.isDisposed)return;const p=new m(d);if(p){const S=p.marker.onDispose((()=>p.dispose()));p.onDispose((()=>{p&&(this._decorations.delete(p)&&this._onDecorationRemoved.fire(p),S.dispose())})),this._decorations.insert(p),this._onDecorationRegistered.fire(p)}return p}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,p,S){let A=0,R=0;for(const M of this._decorations.getKeyIterator(p))A=M.options.x??0,R=A+(M.options.width??1),d>=A&&d<R&&(!S||(M.options.layer??"bottom")===S)&&(yield M)}forEachDecorationAtCell(d,p,S,A){this._decorations.forEachByKey(p,(R=>{T=R.options.x??0,O=T+(R.options.width??1),d>=T&&d<O&&(!S||(R.options.layer??"bottom")===S)&&A(R)}))}}c.DecorationService=C;class m extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(d){super(),this.options=d,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=d.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const u=h(2585),y=h(8343);class f{constructor(...T){this._entries=new Map;for(const[O,C]of T)this.set(O,C)}set(T,O){const C=this._entries.get(T);return this._entries.set(T,O),C}forEach(T){for(const[O,C]of this._entries.entries())T(O,C)}has(T){return this._entries.has(T)}get(T){return this._entries.get(T)}}c.ServiceCollection=f,c.InstantiationService=class{constructor(){this._services=new f,this._services.set(u.IInstantiationService,this)}setService(x,T){this._services.set(x,T)}getService(x){return this._services.get(x)}createInstance(x,...T){const O=(0,y.getServiceDependencies)(x).sort(((g,d)=>g.index-d.index)),C=[];for(const g of O){const d=this._services.get(g.id);if(!d)throw new Error(`[createInstance] ${x.name} depends on UNKNOWN service ${g.id}.`);C.push(d)}const m=O.length>0?O[0].index:T.length;if(T.length!==m)throw new Error(`[createInstance] First service dependency of ${x.name} at position ${m+1} conflicts with ${T.length} static arguments`);return new x(...T,...C)}}},7866:function(E,c,h){var u=this&&this.__decorate||function(m,g,d,p){var S,A=arguments.length,R=A<3?g:p===null?p=Object.getOwnPropertyDescriptor(g,d):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,g,d,p);else for(var M=m.length-1;M>=0;M--)(S=m[M])&&(R=(A<3?S(R):A>3?S(g,d,R):S(g,d))||R);return A>3&&R&&Object.defineProperty(g,d,R),R},y=this&&this.__param||function(m,g){return function(d,p){g(d,p,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const f=h(844),x=h(2585),T={trace:x.LogLevelEnum.TRACE,debug:x.LogLevelEnum.DEBUG,info:x.LogLevelEnum.INFO,warn:x.LogLevelEnum.WARN,error:x.LogLevelEnum.ERROR,off:x.LogLevelEnum.OFF};let O,C=c.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=x.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),O=this}_updateLogLevel(){this._logLevel=T[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let g=0;g<m.length;g++)typeof m[g]=="function"&&(m[g]=m[g]())}_log(m,g,d){this._evalLazyOptionalParams(d),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+g,...d)}trace(m,...g){var d;this._logLevel<=x.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,m,g)}debug(m,...g){var d;this._logLevel<=x.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,m,g)}info(m,...g){var d;this._logLevel<=x.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,m,g)}warn(m,...g){var d;this._logLevel<=x.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,m,g)}error(m,...g){var d;this._logLevel<=x.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,m,g)}};c.LogService=C=u([y(0,x.IOptionsService)],C),c.setTraceLogger=function(m){O=m},c.traceCall=function(m,g,d){if(typeof d.value!="function")throw new Error("not supported");const p=d.value;d.value=function(...S){if(O.logLevel!==x.LogLevelEnum.TRACE)return p.apply(this,S);O.trace(`GlyphRenderer#${p.name}(${S.map((R=>JSON.stringify(R))).join(", ")})`);const A=p.apply(this,S);return O.trace(`GlyphRenderer#${p.name} return`,A),A}}},7302:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const u=h(8460),y=h(844),f=h(6114);c.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const x=["normal","bold","100","200","300","400","500","600","700","800","900"];class T extends y.Disposable{constructor(C){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const m={...c.DEFAULT_OPTIONS};for(const g in C)if(g in m)try{const d=C[g];m[g]=this._sanitizeAndValidateOption(g,d)}catch(d){console.error(d)}this.rawOptions=m,this.options={...m},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(C,m){return this.onOptionChange((g=>{g===C&&m(this.rawOptions[C])}))}onMultipleOptionChange(C,m){return this.onOptionChange((g=>{C.indexOf(g)!==-1&&m()}))}_setupOptions(){const C=g=>{if(!(g in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);return this.rawOptions[g]},m=(g,d)=>{if(!(g in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);d=this._sanitizeAndValidateOption(g,d),this.rawOptions[g]!==d&&(this.rawOptions[g]=d,this._onOptionChange.fire(g))};for(const g in this.rawOptions){const d={get:C.bind(this,g),set:m.bind(this,g)};Object.defineProperty(this.options,g,d)}}_sanitizeAndValidateOption(C,m){switch(C){case"cursorStyle":if(m||(m=c.DEFAULT_OPTIONS[C]),!(function(g){return g==="block"||g==="underline"||g==="bar"})(m))throw new Error(`"${m}" is not a valid value for ${C}`);break;case"wordSeparator":m||(m=c.DEFAULT_OPTIONS[C]);break;case"fontWeight":case"fontWeightBold":if(typeof m=="number"&&1<=m&&m<=1e3)break;m=x.includes(m)?m:c.DEFAULT_OPTIONS[C];break;case"cursorWidth":m=Math.floor(m);case"lineHeight":case"tabStopWidth":if(m<1)throw new Error(`${C} cannot be less than 1, value: ${m}`);break;case"minimumContrastRatio":m=Math.max(1,Math.min(21,Math.round(10*m)/10));break;case"scrollback":if((m=Math.min(m,4294967295))<0)throw new Error(`${C} cannot be less than 0, value: ${m}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(m<=0)throw new Error(`${C} cannot be less than or equal to 0, value: ${m}`);break;case"rows":case"cols":if(!m&&m!==0)throw new Error(`${C} must be numeric, value: ${m}`);break;case"windowsPty":m=m??{}}return m}}c.OptionsService=T},2660:function(E,c,h){var u=this&&this.__decorate||function(T,O,C,m){var g,d=arguments.length,p=d<3?O:m===null?m=Object.getOwnPropertyDescriptor(O,C):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(T,O,C,m);else for(var S=T.length-1;S>=0;S--)(g=T[S])&&(p=(d<3?g(p):d>3?g(O,C,p):g(O,C))||p);return d>3&&p&&Object.defineProperty(O,C,p),p},y=this&&this.__param||function(T,O){return function(C,m){O(C,m,T)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const f=h(2585);let x=c.OscLinkService=class{constructor(T){this._bufferService=T,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(T){const O=this._bufferService.buffer;if(T.id===void 0){const S=O.addMarker(O.ybase+O.y),A={data:T,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(A,S))),this._dataByLinkId.set(A.id,A),A.id}const C=T,m=this._getEntryIdKey(C),g=this._entriesWithId.get(m);if(g)return this.addLineToLink(g.id,O.ybase+O.y),g.id;const d=O.addMarker(O.ybase+O.y),p={id:this._nextId++,key:this._getEntryIdKey(C),data:C,lines:[d]};return d.onDispose((()=>this._removeMarkerFromLink(p,d))),this._entriesWithId.set(p.key,p),this._dataByLinkId.set(p.id,p),p.id}addLineToLink(T,O){const C=this._dataByLinkId.get(T);if(C&&C.lines.every((m=>m.line!==O))){const m=this._bufferService.buffer.addMarker(O);C.lines.push(m),m.onDispose((()=>this._removeMarkerFromLink(C,m)))}}getLinkData(T){var O;return(O=this._dataByLinkId.get(T))==null?void 0:O.data}_getEntryIdKey(T){return`${T.id};;${T.uri}`}_removeMarkerFromLink(T,O){const C=T.lines.indexOf(O);C!==-1&&(T.lines.splice(C,1),T.lines.length===0&&(T.data.id!==void 0&&this._entriesWithId.delete(T.key),this._dataByLinkId.delete(T.id)))}};c.OscLinkService=x=u([y(0,f.IBufferService)],x)},8343:(E,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const h="di$target",u="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(y){return y[u]||[]},c.createDecorator=function(y){if(c.serviceRegistry.has(y))return c.serviceRegistry.get(y);const f=function(x,T,O){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(C,m,g){m[h]===m?m[u].push({id:C,index:g}):(m[u]=[{id:C,index:g}],m[h]=m)})(f,x,O)};return f.toString=()=>y,c.serviceRegistry.set(y,f),f}},2585:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.IDecorationService=c.IUnicodeService=c.IOscLinkService=c.IOptionsService=c.ILogService=c.LogLevelEnum=c.IInstantiationService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;const u=h(8343);var y;c.IBufferService=(0,u.createDecorator)("BufferService"),c.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),c.ICoreService=(0,u.createDecorator)("CoreService"),c.ICharsetService=(0,u.createDecorator)("CharsetService"),c.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(y||(c.LogLevelEnum=y={})),c.ILogService=(0,u.createDecorator)("LogService"),c.IOptionsService=(0,u.createDecorator)("OptionsService"),c.IOscLinkService=(0,u.createDecorator)("OscLinkService"),c.IUnicodeService=(0,u.createDecorator)("UnicodeService"),c.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(E,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const u=h(8460),y=h(225);class f{static extractShouldJoin(T){return(1&T)!=0}static extractWidth(T){return T>>1&3}static extractCharKind(T){return T>>3}static createPropertyValue(T,O,C=!1){return(16777215&T)<<3|(3&O)<<1|(C?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const T=new y.UnicodeV6;this.register(T),this._active=T.version,this._activeProvider=T}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(T){if(!this._providers[T])throw new Error(`unknown Unicode version "${T}"`);this._active=T,this._activeProvider=this._providers[T],this._onChange.fire(T)}register(T){this._providers[T.version]=T}wcwidth(T){return this._activeProvider.wcwidth(T)}getStringCellWidth(T){let O=0,C=0;const m=T.length;for(let g=0;g<m;++g){let d=T.charCodeAt(g);if(55296<=d&&d<=56319){if(++g>=m)return O+this.wcwidth(d);const A=T.charCodeAt(g);56320<=A&&A<=57343?d=1024*(d-55296)+A-56320+65536:O+=this.wcwidth(A)}const p=this.charProperties(d,C);let S=f.extractWidth(p);f.extractShouldJoin(p)&&(S-=f.extractWidth(C)),O+=S,C=p}return O}charProperties(T,O){return this._activeProvider.charProperties(T,O)}}c.UnicodeService=f}},o={};function v(E){var c=o[E];if(c!==void 0)return c.exports;var h=o[E]={exports:{}};return a[E].call(h.exports,h,h.exports,v),h.exports}var k={};return(()=>{var E=k;Object.defineProperty(E,"__esModule",{value:!0}),E.Terminal=void 0;const c=v(9042),h=v(3236),u=v(844),y=v(5741),f=v(8285),x=v(7975),T=v(7090),O=["cols","rows"];class C extends u.Disposable{constructor(g){super(),this._core=this.register(new h.Terminal(g)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const d=S=>this._core.options[S],p=(S,A)=>{this._checkReadonlyOptions(S),this._core.options[S]=A};for(const S in this._core.options){const A={get:d.bind(this,S),set:p.bind(this,S)};Object.defineProperty(this._publicOptions,S,A)}}_checkReadonlyOptions(g){if(O.includes(g))throw new Error(`Option "${g}" 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 x.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new T.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const g=this._core.coreService.decPrivateModes;let d="none";switch(this._core.coreMouseService.activeProtocol){case"X10":d="x10";break;case"VT200":d="vt200";break;case"DRAG":d="drag";break;case"ANY":d="any"}return{applicationCursorKeysMode:g.applicationCursorKeys,applicationKeypadMode:g.applicationKeypad,bracketedPasteMode:g.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:g.origin,reverseWraparoundMode:g.reverseWraparound,sendFocusMode:g.sendFocus,wraparoundMode:g.wraparound}}get options(){return this._publicOptions}set options(g){for(const d in g)this._publicOptions[d]=g[d]}blur(){this._core.blur()}focus(){this._core.focus()}input(g,d=!0){this._core.input(g,d)}resize(g,d){this._verifyIntegers(g,d),this._core.resize(g,d)}open(g){this._core.open(g)}attachCustomKeyEventHandler(g){this._core.attachCustomKeyEventHandler(g)}attachCustomWheelEventHandler(g){this._core.attachCustomWheelEventHandler(g)}registerLinkProvider(g){return this._core.registerLinkProvider(g)}registerCharacterJoiner(g){return this._checkProposedApi(),this._core.registerCharacterJoiner(g)}deregisterCharacterJoiner(g){this._checkProposedApi(),this._core.deregisterCharacterJoiner(g)}registerMarker(g=0){return this._verifyIntegers(g),this._core.registerMarker(g)}registerDecoration(g){return this._checkProposedApi(),this._verifyPositiveIntegers(g.x??0,g.width??0,g.height??0),this._core.registerDecoration(g)}hasSelection(){return this._core.hasSelection()}select(g,d,p){this._verifyIntegers(g,d,p),this._core.select(g,d,p)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(g,d){this._verifyIntegers(g,d),this._core.selectLines(g,d)}dispose(){super.dispose()}scrollLines(g){this._verifyIntegers(g),this._core.scrollLines(g)}scrollPages(g){this._verifyIntegers(g),this._core.scrollPages(g)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(g){this._verifyIntegers(g),this._core.scrollToLine(g)}clear(){this._core.clear()}write(g,d){this._core.write(g,d)}writeln(g,d){this._core.write(g),this._core.write(`\r
311
+ `,d)}paste(g){this._core.paste(g)}refresh(g,d){this._verifyIntegers(g,d),this._core.refresh(g,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(g){this._addonManager.loadAddon(this,g)}static get strings(){return c}_verifyIntegers(...g){for(const d of g)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...g){for(const d of g)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}E.Terminal=C})(),k})()))})(cu)),cu.exports}var DE=RE(),uu={exports:{}},I_;function OE(){return I_||(I_=1,(function(i,r){(function(a,o){i.exports=o()})(self,(()=>(()=>{var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(v){this._terminal=v}dispose(){}fit(){const v=this.proposeDimensions();if(!v||!this._terminal||isNaN(v.cols)||isNaN(v.rows))return;const k=this._terminal._core;this._terminal.rows===v.rows&&this._terminal.cols===v.cols||(k._renderService.clear(),this._terminal.resize(v.cols,v.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const v=this._terminal._core,k=v._renderService.dimensions;if(k.css.cell.width===0||k.css.cell.height===0)return;const E=this._terminal.options.scrollback===0?0:v.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),h=parseInt(c.getPropertyValue("height")),u=Math.max(0,parseInt(c.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),f=h-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),x=u-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-E;return{cols:Math.max(2,Math.floor(x/k.css.cell.width)),rows:Math.max(1,Math.floor(f/k.css.cell.height))}}}})(),a})()))})(uu)),uu.exports}var ME=OE();const NE=3e4,LE=300*1e3;class jE{constructor(r,a,o){_t(this,"ws",null);_t(this,"consecutiveFailures",0);_t(this,"failStartTime",null);_t(this,"destroyed",!1);_t(this,"reconnectTimer",null);_t(this,"url");_t(this,"authToken");_t(this,"callbacks");this.url=r,this.authToken=o,this.callbacks=a,this.connect()}connect(){if(!this.destroyed){try{this.ws=new WebSocket(this.url)}catch{this.scheduleReconnect();return}this.ws.onopen=()=>{var r,a,o;this.destroyed||(this.consecutiveFailures=0,this.failStartTime=null,this.authToken&&((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"auth",token:this.authToken})),(o=(a=this.callbacks).onOpen)==null||o.call(a))},this.ws.onmessage=r=>{if(!this.destroyed)try{this.callbacks.onMessage(JSON.parse(r.data))}catch{}},this.ws.onclose=()=>{this.destroyed||(this.ws=null,this.scheduleReconnect())},this.ws.onerror=()=>{this.destroyed}}}scheduleReconnect(){var a,o,v,k,E,c;if(this.destroyed)return;if(this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=LE){(o=(a=this.callbacks).onGiveUp)==null||o.call(a),(k=(v=this.callbacks).onClose)==null||k.call(v);return}this.consecutiveFailures++;const r=Math.min(NE,1e3*Math.pow(2,this.consecutiveFailures-1));(c=(E=this.callbacks).onReconnecting)==null||c.call(E,this.consecutiveFailures,r),this.reconnectTimer=setTimeout(()=>this.connect(),r)}send(r){var a;((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(r))}close(){var r;this.destroyed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(r=this.ws)==null||r.close(),this.ws=null}}const go=1e3;function hu(i){return`${i.timestamp??""}:${i.role}:${i.contentType}:${i.text.length}:${i.text.slice(0,80)}`}function P_(i){const r=i.role==="assistant"?"Agent":i.role==="user"?"You":i.role,a=i.contentType==="tool_use"?"[Tool]":i.contentType==="tool_result"?"[Result]":i.contentType==="thinking"?"[Thinking]":"",v=`\x1B[36m${a?`${r} ${a}`:r}\x1B[0m:`,k=i.text.split(`
312
+ `)[0].slice(0,200)+(i.text.length>200?"…":"");return`${v} ${k}`}function BE({sessionId:i,status:r}){const a=et(w=>w.token),o=I.useRef(null),v=I.useRef(null),k=I.useRef(null),E=I.useRef(null),c=I.useRef(r),h=I.useRef(""),[u,y]=I.useState([]),[f,x]=I.useState(!0),[T,O]=I.useState({thinking:!1,tool_use:!0,tool_result:!0}),C=I.useRef(new Set),[m,g]=I.useState("connecting"),[d,p]=I.useState(null);I.useEffect(()=>{c.current=r},[r]);const S=I.useMemo(()=>u.filter(w=>w.role==="user"?!0:!(w.contentType==="thinking"&&!T.thinking||w.contentType==="tool_use"&&!T.tool_use||w.contentType==="tool_result"&&!T.tool_result)),[u,T]);I.useEffect(()=>{let w=!1;return Ew(i).then(L=>{if(!w){const $=L.messages??[],F=$.length>go?$.slice($.length-go):$;y(F),C.current=new Set(F.map(hu))}}).finally(()=>{w||x(!1)}),()=>{w=!0}},[i]),I.useEffect(()=>{const w=Wp(i,L=>{try{const $=JSON.parse(L.data);if($.event!=="message")return;const F=$.data;y(K=>{const Z=hu(F);if(C.current.has(Z))return K;C.current.add(Z);const J=[...K,F];if(J.length>go){const ee=J.length-go,q=J.slice(ee);for(let Q=0;Q<ee;Q++)C.current.delete(hu(J[Q]));return q}return J})}catch{}},a);return()=>w()},[i,a]),I.useEffect(()=>{if(!o.current)return;const w=new DE.Terminal({cursorBlink:!0,fontSize:13,fontFamily:'"JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace',theme:{background:"#000000",foreground:"#00ff88",cursor:"#00ff88",cursorAccent:"#000000",selectionBackground:"#00e5ff40"},convertEol:!0,scrollback:2e3}),L=new ME.FitAddon;w.loadAddon(L),w.open(o.current),L.fit(),v.current=w,k.current=L;const $=new ResizeObserver(()=>{var Z;L.fit();const{cols:F,rows:K}=w;(Z=E.current)==null||Z.send({type:"resize",cols:F,rows:K})});return o.current&&$.observe(o.current),()=>{$.disconnect(),w.dispose(),v.current=null,k.current=null}},[]),I.useEffect(()=>{var $;const w=v.current;if(!w||f)return;if(w.reset(),S.length>0){w.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),w.writeln("\x1B[33m║ SESSION TRANSCRIPT ║\x1B[0m"),w.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),w.writeln("");for(const F of S)w.writeln(P_(F));w.writeln(""),w.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),w.writeln("\x1B[33m║ LIVE TERMINAL OUTPUT ║\x1B[0m"),w.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),w.writeln("")}const L=h.current;L&&w.write(L),($=k.current)==null||$.fit()},[S,f]),I.useEffect(()=>{const L=(()=>{const F=window.location.origin,K=`/v1/sessions/${encodeURIComponent(i)}/terminal`;return`${F.replace(/^http/,"ws")}${K}`})(),$=new jE(L,{onMessage:F=>{const K=F,Z=v.current;if(Z)switch(K.type){case"pane":{const J=h.current,ee=K.content;if(J&&ee.startsWith(J))Z.write(ee.slice(J.length));else{h.current=ee;const q=v.current;if(q){if(q.reset(),S.length>0){q.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),q.writeln("\x1B[33m║ SESSION TRANSCRIPT ║\x1B[0m"),q.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),q.writeln("");for(const Q of S)q.writeln(P_(Q));q.writeln(""),q.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),q.writeln("\x1B[33m║ LIVE TERMINAL OUTPUT ║\x1B[0m"),q.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),q.writeln("")}q.write(ee)}}h.current=ee,p(null);break}case"status":break;case"error":p(K.message);break}},onOpen:()=>{var K;g("connected"),p(null);const F=v.current;k.current&&F&&((K=E.current)==null||K.send({type:"resize",cols:F.cols,rows:F.rows}))},onReconnecting:()=>{g("reconnecting")},onGiveUp:()=>{g("disconnected")},onClose:()=>{g("disconnected")}},a??void 0);return E.current=$,()=>{E.current=null,$.close()}},[i,a,S]),I.useEffect(()=>{const w=v.current;if(!w)return;const L=w.onData($=>{var F;(F=E.current)==null||F.send({type:"input",text:$})});return()=>{L.dispose()}},[]);const A=I.useCallback(w=>{O(L=>({...L,[w]:!L[w]}))},[]),R=r==="working",M=m==="connected";return b.jsxs("div",{className:"flex flex-col h-full bg-[#111118] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-xs border-b border-[#1a1a2e] bg-[#0a0a0f] shrink-0 flex-wrap gap-2",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"text-[10px] text-[#555] uppercase tracking-wider",children:"Filter:"}),["thinking","tool_use","tool_result"].map(w=>b.jsx("button",{onClick:()=>A(w),"aria-pressed":T[w],className:`text-xs px-2 py-0.5 rounded border transition-colors ${T[w]?"border-[#00e5ff]/40 text-[#00e5ff] bg-[#00e5ff]/10":"border-[#1a1a2e] text-[#555] hover:text-[#888]"}`,children:w==="tool_use"?"Tools":w==="tool_result"?"Results":w},w)),b.jsxs("span",{className:"text-[10px] text-[#444]",children:[S.length," / ",u.length," messages"]})]}),b.jsxs("div",{className:"flex items-center gap-3 ml-auto",children:[b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:M?"#00e5ff":m==="reconnecting"?"#ffaa00":"#666",boxShadow:M?"0 0 4px #00e5ff40":"none",animation:m==="reconnecting"?"pulse 1s ease-in-out infinite":"none"}}),b.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:m==="connecting"?"connecting…":m==="reconnecting"?"reconnecting…":m==="connected"?"ws live":"disconnected"})]}),b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:R?"#00ff88":"#888",boxShadow:R?"0 0 4px #00ff88":"none"}}),b.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:R?"active":"idle"})]})]})]}),d&&b.jsx("div",{className:"px-4 py-2 text-xs text-[#ff3366] bg-[#ff336610] border-b border-[#ff336620]",children:d}),b.jsx("div",{ref:o,className:"flex-1 overflow-hidden"})]})}function yo(i){return i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(1)}k`:i.toString()}function zE({metrics:i,loading:r}){if(r||!i)return b.jsx("div",{className:"flex items-center justify-center h-48 text-[#555] text-sm animate-pulse",children:"Loading metrics..."});const a=[{label:"Duration",value:sE(i.durationSec*1e3),icon:"⏱",color:"#3b82f6"},{label:"Messages",value:i.messages.toString(),icon:"💬",color:"#3b82f6"},{label:"Tool Calls",value:i.toolCalls.toString(),icon:"🔧",color:"#3b82f6"},{label:"Approvals",value:i.approvals.toString(),icon:"✅",color:"#10b981"},{label:"Auto-approvals",value:i.autoApprovals.toString(),icon:"⚡",color:"#f59e0b"},{label:"Status Changes",value:i.statusChanges.length.toString(),icon:"🔄",color:"#8888ff"}],o=i.tokenUsage;return b.jsxs("div",{className:"space-y-4",children:[b.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:a.map(v=>b.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors duration-150 hover:border-[#3b82f6]/30",children:[b.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[b.jsx("span",{className:"text-base",children:v.icon}),b.jsx("span",{className:"text-[10px] text-[#888] uppercase tracking-wider",children:v.label})]}),b.jsx("div",{className:"text-2xl font-semibold font-mono tabular-nums",style:{color:v.color},children:v.value})]},v.label))}),o&&b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[b.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Token Usage"}),b.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Input"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#3b82f6]",children:yo(o.inputTokens)})]}),b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Output"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#10b981]",children:yo(o.outputTokens)})]}),b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Cache Write"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#f59e0b]",children:yo(o.cacheCreationTokens)})]}),b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Cache Read"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#f59e0b]",children:yo(o.cacheReadTokens)})]}),b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#001a1f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Est. Cost"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#00e5ff]",children:`$${o.estimatedCostUsd<.01?o.estimatedCostUsd.toFixed(4):o.estimatedCostUsd.toFixed(3)}`})]})]}),b.jsx("div",{className:"mt-2 text-[11px] text-[#444]",children:"Cost estimate uses Anthropic list prices (sonnet tier by default). Actual cost may vary by model and plan."})]}),i.statusChanges.length>0&&b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[b.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Status Changes"}),b.jsx("div",{className:"flex flex-wrap gap-2",children:i.statusChanges.map((v,k)=>b.jsx("div",{className:"text-xs font-mono text-[#555] bg-[#0a0a0f] px-2 py-1 rounded border border-[#1a1a2e]",children:v},k))})]})]})}function du(i){return i===null?"--":`${Math.round(i)} ms`}function HE(i){return i===null?"0%":`${Math.min(100,Math.round(i/500*100))}%`}function UE({latency:i,loading:r}){var o,v,k;if(r)return b.jsx("div",{className:"flex items-center justify-center h-36 text-[#555] text-sm animate-pulse",children:"Loading latency metrics..."});if(!i||!i.aggregated)return b.jsx("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 text-sm text-[#888]",children:"No latency samples yet."});const a=[{label:"State Change Detection",latest:((o=i.realtime)==null?void 0:o.state_change_detection_ms)??null,avg:i.aggregated.state_change_detection_ms.avg,max:i.aggregated.state_change_detection_ms.max,count:i.aggregated.state_change_detection_ms.count},{label:"Channel Delivery",latest:null,avg:i.aggregated.channel_delivery_ms.avg,max:i.aggregated.channel_delivery_ms.max,count:i.aggregated.channel_delivery_ms.count},{label:"Permission Response",latest:((v=i.realtime)==null?void 0:v.permission_response_ms)??null,avg:i.aggregated.permission_response_ms.avg,max:i.aggregated.permission_response_ms.max,count:i.aggregated.permission_response_ms.count},{label:"Hook Processing",latest:((k=i.realtime)==null?void 0:k.hook_latency_ms)??null,avg:i.aggregated.hook_latency_ms.avg,max:i.aggregated.hook_latency_ms.max,count:i.aggregated.hook_latency_ms.count}];return b.jsxs("div",{className:"space-y-3",children:[b.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider",children:"Latency"}),b.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:a.map(E=>b.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4",children:[b.jsxs("div",{className:"flex items-center justify-between text-xs text-[#888] uppercase tracking-wider",children:[b.jsx("span",{children:E.label}),b.jsxs("span",{children:[E.count," sample",E.count===1?"":"s"]})]}),b.jsx("div",{className:"mt-3 h-1.5 rounded bg-[#1a1a2e] overflow-hidden",children:b.jsx("div",{className:"h-full bg-[#00e5ff]/70 transition-all duration-300",style:{width:HE(E.avg)}})}),b.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-2 text-xs font-mono text-[#bbb]",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[#666] mb-1",children:"Latest"}),b.jsx("div",{className:"text-[#00e5ff]",children:du(E.latest)})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[#666] mb-1",children:"Avg"}),b.jsx("div",{className:"text-[#00ff88]",children:du(E.avg)})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[#666] mb-1",children:"Max"}),b.jsx("div",{className:"text-[#ffaa00]",children:du(E.max)})]})]})]},E.label))})]})}const $E=new Set(["bypassPermissions","dontAsk","acceptEdits","plan","auto"]);function IE({prompt:i,permissionMode:r,onApprove:a,onReject:o}){const[v,k]=I.useState(!1);return r&&r!=="default"&&$E.has(r)?b.jsx("div",{className:"flex items-center gap-2 px-4 py-2 bg-[#003322]/50 border border-[#10b981]/30 rounded-lg text-sm",children:b.jsxs("span",{className:"text-[#10b981] font-semibold text-xs uppercase tracking-wider",children:["AUTO-APPROVED (",r,")"]})}):b.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 px-3 sm:px-4 py-3 bg-[#1a1a00]/60 border border-[#f59e0b]/40 rounded-lg",children:[b.jsxs("div",{className:"flex items-center gap-3 sm:gap-2 min-w-0",children:[b.jsx("span",{className:"text-[#f59e0b] text-lg shrink-0",children:"âš "}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("div",{className:"text-xs text-[#f59e0b] font-semibold uppercase tracking-wider mb-0.5",children:"Permission Required"}),b.jsxs("div",{className:`text-sm text-[#e0e0e0] font-mono cursor-pointer ${v?"":"truncate"}`,onClick:()=>k(!v),title:v?void 0:"Click to expand",children:[i,!v&&i.length>60&&b.jsx("span",{className:"text-[#888] ml-1",children:"..."})]})]})]}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[b.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#10b981] border border-[#10b981]/30 transition-colors",children:"Approve"}),b.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ef4444] border border-[#ef4444]/30 transition-colors",children:"Reject"})]})]})}function PE({open:i,onClose:r,sessionId:a}){const o=I.useRef(null),v=I.useRef(null),[k,E]=I.useState(""),[c,h]=I.useState(""),[u,y]=I.useState(!1),[f,x]=I.useState(null),T=Si(m=>m.addToast),O=I.useCallback(()=>{E(""),h(""),x(null),y(!1),r()},[r]);I.useEffect(()=>{if(!i)return;const m=g=>{var d;g.key==="Escape"&&((d=o.current)==null||d.abort(),O())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[i,O]),I.useEffect(()=>{if(!i)return;const m=v.current;if(!m)return;const g='input, textarea, button, [tabindex]:not([tabindex="-1"])',d=p=>{if(p.key!=="Tab")return;const S=Array.from(m.querySelectorAll(g));if(S.length===0)return;const A=S[0],R=S[S.length-1];p.shiftKey?document.activeElement===A&&(p.preventDefault(),R.focus()):document.activeElement===R&&(p.preventDefault(),A.focus())};return m.addEventListener("keydown",d),()=>m.removeEventListener("keydown",d)},[i]);async function C(m){var d;if(m.preventDefault(),x(null),!k.trim()){x("Template name is required");return}y(!0),(d=o.current)==null||d.abort();const g=new AbortController;o.current=g;try{await Kw({name:k.trim(),description:c.trim()||void 0,sessionId:a}),T("success","Template saved",`"${k.trim()}" created successfully`),O()}catch(p){if(g.signal.aborted)return;x(p instanceof Error?p.message:"Failed to save template")}finally{o.current===g&&(o.current=null,y(!1))}}return i?b.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[b.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:O}),b.jsxs("div",{ref:v,role:"dialog","aria-modal":"true","aria-label":"Save session as template",className:"relative w-full max-w-md mx-4 bg-[#111118] border border-[#1a1a2e] rounded-lg shadow-2xl max-h-[90vh] overflow-y-auto",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[b.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"Save as Template"}),b.jsx("button",{onClick:O,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:b.jsx(Vn,{className:"h-4 w-4"})})]}),b.jsxs("form",{onSubmit:C,className:"p-4 sm:p-5 space-y-4",children:[f&&b.jsx("div",{className:"p-3 rounded bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:f}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:"template-name",className:"block text-xs font-medium text-gray-300 mb-1.5",children:"Template Name *"}),b.jsx("input",{id:"template-name",type:"text",value:k,onChange:m=>E(m.target.value),placeholder:"My template name",className:"w-full px-3 py-2 text-sm rounded bg-[#0a0a0f] border border-[#1a1a2e] text-gray-100 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] transition-colors",disabled:u})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:"template-desc",className:"block text-xs font-medium text-gray-300 mb-1.5",children:"Description (optional)"}),b.jsx("textarea",{id:"template-desc",value:c,onChange:m=>h(m.target.value),placeholder:"What is this template for?",rows:3,className:"w-full px-3 py-2 text-sm rounded bg-[#0a0a0f] border border-[#1a1a2e] text-gray-100 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] transition-colors resize-none",disabled:u})]}),b.jsxs("div",{className:"flex gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:O,disabled:u,className:"flex-1 px-3 py-2 text-xs font-medium rounded bg-[#0a0a0f] border border-[#1a1a2e] text-gray-300 hover:text-gray-100 hover:border-[#333] transition-colors disabled:opacity-50",children:"Cancel"}),b.jsx("button",{type:"submit",disabled:u,className:"flex-1 px-3 py-2 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",children:u?b.jsxs(b.Fragment,{children:[b.jsx($n,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save Template"})]})]})]})]}):null}const ZE=[{id:"session",label:"Session"},{id:"metrics",label:"Metrics"}],Z_=["/clear","/compact","/cost","/config"];function FE(){const{id:i}=ip(),r=Do(),[a,o]=I.useState("session"),[v,k]=I.useState(!1),{session:E,health:c,notFound:h,loading:u,metrics:y,metricsLoading:f,latency:x,latencyLoading:T}=kE(i??""),[O,C]=I.useState(""),[m,g]=I.useState(!1),[d,p]=I.useState(Z_[0]),[S,A]=I.useState(!1),[R,M]=I.useState(""),[w,L]=I.useState(!1),[$,F]=I.useState(!1),[K,Z]=I.useState(!1),[J,ee]=I.useState(!1),[q,Q]=I.useState(null),ne=I.useRef(null),j=I.useRef(!1),U=Si(pe=>pe.addToast);if(u)return b.jsx("div",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center text-[#555] text-sm",children:b.jsx("div",{className:"animate-pulse",children:"Loading session…"})});if(h||!E||!c)return b.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-[#555]",children:[b.jsx("div",{className:"text-6xl mb-4",children:"404"}),b.jsx("div",{className:"text-lg mb-6 text-[#e0e0e0]",children:"Session not found"}),b.jsx(di,{to:"/",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Overview"})]});const N=E,B=c,P=B.status==="permission_prompt"||B.status==="bash_approval";function Y(){Gp(N.id).catch(pe=>U("error","Approve failed",pe instanceof Error?pe.message:void 0))}function re(){Dw(N.id).catch(pe=>U("error","Reject failed",pe instanceof Error?pe.message:void 0))}function he(){xu(N.id).catch(pe=>U("error","Interrupt failed",pe instanceof Error?pe.message:void 0))}async function V(){try{const pe=await Mw(N.id,{name:void 0});U("success","Session forked",`New session ${pe.id.slice(0,8)} created`),r(`/session/${pe.id}`)}catch(pe){U("error","Fork failed",pe instanceof Error?pe.message:void 0)}}function H(){Ow(N.id).catch(pe=>U("error","Escape failed",pe instanceof Error?pe.message:void 0))}async function ce(){try{await Su(N.id),r("/")}catch(pe){U("error","Failed to kill session",pe instanceof Error?pe.message:void 0)}}async function oe(){if(!K){Z(!0);try{const pe=await zw(N.id);Q({image:pe.image,mimeType:pe.mimeType,capturedAt:Date.now()}),U("success","Screenshot captured")}catch(pe){(typeof pe=="object"&&pe!==null&&"statusCode"in pe?pe.statusCode:void 0)===501?(ee(!0),U("warning","Screenshot unavailable","Playwright is not installed on the server.")):U("error","Screenshot failed",pe instanceof Error?pe.message:void 0)}finally{Z(!1)}}}async function me(){var Rt;const pe=O.trim();if(pe&&!j.current){j.current=!0,g(!0);try{await Rw(N.id,pe),C("")}catch(mi){U("error","Failed to send message",mi instanceof Error?mi.message:void 0)}finally{g(!1),j.current=!1,(Rt=ne.current)==null||Rt.focus()}}}function _e(){var pe;C(d),(pe=ne.current)==null||pe.focus()}async function Te(){if(!(!d||S)){A(!0);try{await jw(N.id,d),C("")}catch(pe){U("error","Failed to send slash command",pe instanceof Error?pe.message:void 0)}finally{A(!1)}}}async function je(){const pe=R.trim();if(!(!pe||$)){F(!0);try{await Bw(N.id,pe),M(""),L(!1)}catch(Rt){U("error","Failed to send bash command",Rt instanceof Error?Rt.message:void 0)}finally{F(!1)}}}function Ze(){R.trim()&&L(!0)}function ut(pe){M(pe),w&&L(!1)}function Ce(pe){pe.key==="Enter"&&!pe.shiftKey&&(pe.preventDefault(),me())}return b.jsxs("div",{className:"min-h-screen bg-[#0a0a0f]",children:[b.jsxs("div",{className:"max-w-6xl mx-auto px-3 sm:px-4 py-3 sm:py-4 space-y-3 sm:space-y-4",children:[b.jsxs("nav",{className:"text-xs text-[#555] flex items-center gap-1",children:[b.jsx(di,{to:"/",className:"hover:text-[#00e5ff] transition-colors",children:"Overview"}),b.jsx("span",{className:"text-[#333]",children:"/"}),b.jsx("span",{className:"text-[#e0e0e0] truncate max-w-[160px] sm:max-w-xs",children:N.windowName||N.id})]}),b.jsx(AE,{session:N,health:B,onApprove:Y,onReject:re,onInterrupt:he,onFork:V,onKill:ce,onSaveTemplate:()=>k(!0)}),b.jsx("div",{className:"flex border-b border-[#1a1a2e]",role:"tablist",children:ZE.map(pe=>b.jsxs("button",{id:`tab-${pe.id}`,onClick:()=>o(pe.id),role:"tab","aria-selected":a===pe.id,"aria-controls":`panel-${pe.id}`,tabIndex:a===pe.id?0:-1,className:`flex-1 min-h-[44px] text-sm font-medium transition-colors relative ${a===pe.id?"text-[#00e5ff]":"text-[#555] hover:text-[#888]"}`,children:[pe.label,a===pe.id&&b.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-[#00e5ff]"})]},pe.id))}),b.jsxs("div",{className:"bg-[#0a0a0f] rounded-lg min-h-[300px] sm:min-h-[400px]",children:[P&&b.jsx("div",{className:"p-3 sm:p-4 pb-0",children:b.jsx(IE,{prompt:B.details,permissionMode:N.permissionMode,onApprove:Y,onReject:re})}),a==="session"&&b.jsx("div",{id:"panel-session",role:"tabpanel","aria-labelledby":"tab-session",tabIndex:0,className:"h-[calc(100vh-380px)] sm:h-[calc(100vh-420px)] min-h-[250px] sm:min-h-[300px]",children:b.jsx(BE,{sessionId:N.id,status:B.status})}),a==="metrics"&&b.jsxs("div",{id:"panel-metrics",role:"tabpanel","aria-labelledby":"tab-metrics",tabIndex:0,className:"p-3 sm:p-4",children:[b.jsx(zE,{metrics:y,loading:f}),b.jsx("div",{className:"mt-4",children:b.jsx(UE,{latency:x,loading:T})})]})]}),b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("label",{htmlFor:"session-message-input",className:"sr-only",children:"Session message input"}),b.jsx("input",{id:"session-message-input",ref:ne,type:"text",value:O,onChange:pe=>C(pe.target.value),onKeyDown:Ce,placeholder:"Send a message to Claude…",disabled:m||!B.alive,className:"flex-1 min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] font-mono disabled:opacity-50"}),b.jsx("button",{onClick:me,disabled:m||!O.trim()||!B.alive,className:"min-h-[44px] min-w-[44px] flex items-center justify-center p-2.5 rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send message",children:b.jsx(pu,{className:"h-4 w-4"})})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#1a1a2e]/50",children:[b.jsx("label",{className:"sr-only",htmlFor:"slash-command-select",children:"Common slash command"}),b.jsx("select",{id:"slash-command-select",value:d,onChange:pe=>p(pe.target.value),disabled:S||!B.alive,className:"min-h-[44px] rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs font-medium text-gray-200 focus:outline-none focus:border-[#00e5ff] disabled:opacity-50",children:Z_.map(pe=>b.jsx("option",{value:pe,children:pe},pe))}),b.jsx("button",{onClick:_e,disabled:S||!B.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Insert selected slash command into the message input",children:"Insert Slash"}),b.jsx("button",{onClick:Te,disabled:S||!B.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#002a33] hover:bg-[#003744] text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send selected slash command immediately",children:S?"Sending Slash…":"Run Slash"}),b.jsx("label",{className:"sr-only",htmlFor:"bash-command-input",children:"Bash command"}),b.jsx("input",{id:"bash-command-input",type:"text",value:R,onChange:pe=>ut(pe.target.value),placeholder:"Bash command (requires confirmation)…",disabled:$||!B.alive,className:"min-h-[44px] min-w-[220px] flex-1 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#ffaa00] font-mono disabled:opacity-50"}),w?b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-[11px] text-[#ffaa00] italic",children:"Confirm bash command execution."}),b.jsx("button",{onClick:je,disabled:$||!R.trim()||!B.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#3a2e00] hover:bg-[#4a3900] text-[#ffaa00] border border-[#ffaa00]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send bash command",children:$?"Sending Bash…":"Confirm Bash"}),b.jsx("button",{onClick:()=>L(!1),disabled:$,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:"Cancel Bash"})]}):b.jsx("button",{onClick:Ze,disabled:$||!R.trim()||!B.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#2b2200] hover:bg-[#3a2e00] text-[#ffaa00] border border-[#ffaa00]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Review bash command before sending",children:"Review Bash"}),!J&&b.jsxs("button",{onClick:oe,disabled:K||!B.alive,className:"flex items-center gap-1.5 min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",title:"Capture screenshot",children:[b.jsx(mp,{className:"h-3.5 w-3.5"}),K?"Capturing…":"Screenshot"]}),b.jsxs("button",{onClick:he,"aria-label":"Interrupt session with Ctrl+C",className:"flex items-center gap-1.5 min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors",title:"Interrupt (Ctrl+C)",children:[b.jsx(Zb,{className:"h-3.5 w-3.5"}),"Interrupt"]}),b.jsxs("button",{onClick:H,"aria-label":"Send Escape to session",className:"flex items-center gap-1.5 min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors",title:"Send Escape",children:[b.jsx(Ab,{className:"h-3.5 w-3.5"}),"Escape"]})]}),q&&b.jsxs("div",{className:"mt-3 rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[b.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:"Latest screenshot"}),b.jsx("span",{className:"text-[11px] text-gray-500",children:new Date(q.capturedAt).toLocaleTimeString()})]}),b.jsx("img",{src:q.image,alt:"Session screenshot preview",className:"max-h-[420px] w-full rounded border border-[#1a1a2e] object-contain bg-black"}),b.jsx("div",{className:"mt-2 text-[11px] text-gray-500",children:q.mimeType??"image/png"})]})]})]}),b.jsx(PE,{open:v,onClose:()=>k(!1),sessionId:i??""})]})}const qE={running:"bg-cyan/10 text-cyan border-cyan/30",completed:"bg-emerald-400/10 text-emerald-400 border-emerald-400/30",failed:"bg-red-400/10 text-red-400 border-red-400/30",pending:"bg-gray-500/10 text-gray-400 border-gray-500/30"},KE=new Set(["running"]);function tv({status:i}){const r=qE[i]??"bg-gray-500/10 text-gray-500 border-gray-500/30",a=KE.has(i);return b.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${r}`,children:[a&&b.jsxs("span",{className:"relative flex h-2 w-2",children:[b.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 bg-current"}),b.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]}),i]})}let VE=0;function zn(){return{workDir:"",name:"",prompt:"",_key:VE++}}function GE({open:i,onClose:r}){const a=Do(),o=I.useRef(null),v=I.useRef(null),[k,E]=I.useState(""),[c,h]=I.useState([zn(),zn()]),[u,y]=I.useState(!1),[f,x]=I.useState(null),T=I.useCallback(()=>{O(),r()},[r]);function O(){E(""),h([zn(),zn()]),y(!1),x(null)}I.useEffect(()=>{if(!i)return;const S=A=>{A.key==="Escape"&&T()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[i,T]),I.useEffect(()=>{if(!i)return;const S=o.current;if(!S)return;const A='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',R=M=>{if(M.key!=="Tab")return;const w=Array.from(S.querySelectorAll(A));if(w.length===0)return;const L=w[0],$=w[w.length-1];M.shiftKey?document.activeElement===L&&(M.preventDefault(),$.focus()):document.activeElement===$&&(M.preventDefault(),L.focus())};return S.addEventListener("keydown",R),()=>S.removeEventListener("keydown",R)},[i]),I.useEffect(()=>{if(i){const S=setTimeout(()=>{var A;return(A=v.current)==null?void 0:A.focus()},50);return()=>clearTimeout(S)}},[i]);function C(){c.length>=10||h([...c,zn()])}function m(S){c.length<=1||h(c.filter((A,R)=>R!==S))}function g(S,A,R){h(c.map((M,w)=>w===S?{...M,[A]:R}:M))}async function d(S){S.preventDefault(),x(null);const A=c.filter(R=>R.workDir.trim());if(!k.trim()){x("Pipeline name is required");return}if(A.length===0){x("At least one step with a working directory is required");return}y(!0);try{const R=await Uw({name:k.trim(),workDir:A[0].workDir.trim(),stages:A.map(M=>({workDir:M.workDir.trim(),name:M.name.trim()||void 0,prompt:M.prompt.trim()||void 0}))});O(),r(),a(`/pipelines/${R.id}`)}catch(R){x(R instanceof Error?R.message:"Failed to create pipeline")}finally{y(!1)}}if(!i)return null;const p=k.trim()&&c.some(S=>S.workDir.trim());return b.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[b.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:T}),b.jsxs("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":"Create new pipeline",className:"relative w-full max-w-2xl mx-4 bg-[#111118] border border-[#1a1a2e] rounded-lg shadow-2xl max-h-[90vh] overflow-y-auto",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[b.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Pipeline"}),b.jsx("button",{onClick:T,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:b.jsx(Vn,{className:"h-4 w-4"})})]}),b.jsxs("form",{onSubmit:d,className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Pipeline Name ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("input",{type:"text",ref:v,value:k,onChange:S=>E(S.target.value),placeholder:"my-pipeline","aria-label":"Pipeline Name",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"})]}),b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[b.jsxs("span",{children:["Working Directory ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("span",{children:"Name"}),b.jsx("span",{children:"Prompt"}),b.jsx("span",{})]}),b.jsx("div",{className:"space-y-2",children:c.map((S,A)=>b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[b.jsx("input",{type:"text",value:S.workDir,onChange:R=>g(A,"workDir",R.target.value),placeholder:"/home/user/project",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] font-mono"}),b.jsx("input",{type:"text",value:S.name,onChange:R=>g(A,"name",R.target.value),placeholder:"name",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"}),b.jsx("input",{type:"text",value:S.prompt,onChange:R=>g(A,"prompt",R.target.value),placeholder:"Initial prompt...",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"}),b.jsx("button",{type:"button",onClick:()=>m(A),disabled:c.length<=1,"aria-label":`Remove step ${A+1}`,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ef4444] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:b.jsx(Ou,{className:"h-3.5 w-3.5"})})]},S._key))}),c.length<10&&b.jsxs("button",{type:"button",onClick:C,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[b.jsx(Kn,{className:"h-3.5 w-3.5"}),"Add Step"]}),f&&b.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:f}),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:T,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),b.jsxs("button",{type:"submit",disabled:u||!p,className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[u&&b.jsx($n,{className:"h-3 w-3 animate-spin"}),"Create Pipeline"]})]})]})]})]})}const YE=5e3,WE=3e4,XE=6e4;function JE(){const[i,r]=I.useState([]),[a,o]=I.useState(!0),[v,k]=I.useState(!1),E=et(y=>y.sseConnected),c=Si(y=>y.addToast),h=I.useCallback(async()=>{try{const y=await $w();return r(y),!0}catch(y){return c("error","Failed to fetch pipelines",y instanceof Error?y.message:void 0),!1}finally{o(!1)}},[c]);I.useEffect(()=>{let y,f=!1,x=0;const T=async()=>{if(f)return;const O=await h();if(f)return;const C=E?WE:YE;let m=C;if(O)x=0;else{x+=1;const g=2**x;m=Math.min(C*g,XE)}y=setTimeout(()=>{T()},m)};return T(),()=>{f=!0,y&&clearTimeout(y)}},[h,E]);const u={total:i.length,running:i.filter(y=>y.status==="running").length,completed:i.filter(y=>y.status==="completed").length,failed:i.filter(y=>y.status==="failed").length};return a?b.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:b.jsx("div",{className:"animate-pulse",children:"Loading pipelines…"})}):b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Pipelines"}),b.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage and monitor session pipelines"})]}),b.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-1.5 px-3 py-2 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors",children:[b.jsx(Kn,{className:"h-3.5 w-3.5"}),"New Pipeline"]})]}),b.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[b.jsx(ct,{label:"Total",value:u.total}),b.jsx(ct,{label:"Running",value:u.running}),b.jsx(ct,{label:"Completed",value:u.completed}),b.jsx(ct,{label:"Failed",value:u.failed})]}),i.length===0?b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:[b.jsx("p",{className:"text-gray-500",children:"No pipelines yet"}),b.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"Create a pipeline to run sessions in sequence"})]}):b.jsx("div",{className:"space-y-3",children:i.map(y=>b.jsx(di,{to:`/pipelines/${y.id}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 hover:border-[#00e5ff]/30 transition-colors",children:b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[b.jsx("span",{className:"font-medium text-gray-200 truncate",children:y.name}),b.jsx(tv,{status:y.status})]}),b.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 shrink-0 ml-4",children:[b.jsxs("span",{children:[y.stages.length," step",y.stages.length!==1?"s":""]}),b.jsx("span",{children:Zs(y.createdAt)})]})]})},y.id))}),b.jsx(GE,{open:v,onClose:()=>k(!1)})]})}const QE=3e3,e4=3e4,t4=6e4;function i4(){const{id:i}=ip(),[r,a]=I.useState(null),[o,v]=I.useState(!0),[k,E]=I.useState(!1),c=et(y=>y.sseConnected),h=Si(y=>y.addToast),u=I.useCallback(async()=>{if(!i)return!1;try{const y=await Iw(i);return a(y),E(!1),!0}catch(y){const f=y;return f.statusCode===404?E(!0):h("error","Failed to fetch pipeline",f.message),!1}finally{v(!1)}},[i,h]);return I.useEffect(()=>{let y,f=!1,x=0;const T=async()=>{if(f)return;const O=await u();if(f)return;const C=c?e4:QE;let m=C;if(O)x=0;else{x+=1;const g=2**x;m=Math.min(C*g,t4)}y=setTimeout(()=>{T()},m)};return T(),()=>{f=!0,y&&clearTimeout(y)}},[u,c]),o?b.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:b.jsx("div",{className:"animate-pulse",children:"Loading pipeline…"})}):k||!r?b.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] text-gray-500",children:[b.jsx("div",{className:"text-6xl mb-4",children:"404"}),b.jsx("div",{className:"text-lg mb-6 text-gray-200",children:"Pipeline not found"}),b.jsx(di,{to:"/pipelines",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Pipelines"})]}):b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("nav",{className:"text-xs text-gray-500 flex items-center gap-1",children:[b.jsx(di,{to:"/pipelines",className:"hover:text-[#00e5ff] transition-colors",children:"Pipelines"}),b.jsx("span",{className:"text-gray-700",children:"/"}),b.jsx("span",{className:"text-gray-200 truncate max-w-xs",children:r.name})]}),b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:r.name}),b.jsx(tv,{status:r.status})]}),b.jsxs("div",{className:"text-xs text-gray-500",children:["Created ",Zs(r.createdAt)]})]}),b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118]",children:[b.jsx("div",{className:"px-4 py-3 border-b border-void-lighter",children:b.jsxs("h3",{className:"text-sm font-semibold text-gray-200",children:["Steps (",r.stages.length,")"]})}),r.stages.length===0?b.jsx("div",{className:"p-8 text-center text-gray-500 text-sm",children:"No steps yet"}):b.jsxs("table",{className:"w-full text-left text-sm",children:[b.jsx("thead",{children:b.jsxs("tr",{className:"border-b border-void-lighter text-gray-600",children:[b.jsx("th",{className:"px-4 py-3 font-medium w-16",children:"#"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Session"})]})}),b.jsx("tbody",{children:r.stages.map((y,f)=>b.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[b.jsxs("td",{className:"px-4 py-3 text-gray-500 font-mono text-xs",children:["#",f+1]}),b.jsx("td",{className:"px-4 py-3",children:b.jsx(Ho,{status:y.status})}),b.jsx("td",{className:"px-4 py-3",children:y.sessionId?b.jsx(di,{to:`/sessions/${encodeURIComponent(y.sessionId)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:y.name}):b.jsx("span",{className:"font-medium text-gray-200",children:y.name})}),b.jsx("td",{className:"px-4 py-3 font-mono text-xs text-gray-400",children:y.sessionId??"—"})]},y.name))})]})]})]})}function s4(){return b.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 text-center",children:[b.jsx("h1",{className:"text-6xl font-bold text-gray-500",children:"404"}),b.jsx("p",{className:"text-lg text-gray-400",children:"Page not found"}),b.jsx(di,{to:"/",className:"mt-2 rounded-lg bg-cyan px-4 py-2 text-sm font-medium text-void transition-colors hover:bg-cyan/80",children:"Back to Dashboard"})]})}function r4(){return b.jsx(cb,{children:b.jsx(Dy,{children:b.jsxs(_s,{element:b.jsx(tE,{}),children:[b.jsx(_s,{path:"/",element:b.jsx(EE,{})}),b.jsx(_s,{path:"/auth/keys",element:b.jsx(lE,{})}),b.jsx(_s,{path:"/sessions/:id",element:b.jsx(FE,{})}),b.jsx(_s,{path:"/pipelines",element:b.jsx(JE,{})}),b.jsx(_s,{path:"/pipelines/:id",element:b.jsx(i4,{})}),b.jsx(_s,{path:"*",element:b.jsx(s4,{})})]})})})}D0.createRoot(document.getElementById("root")).render(b.jsx(Hn.StrictMode,{children:b.jsx(eb,{basename:"/dashboard",children:b.jsx(r4,{})})}));