aegis-bridge 2.6.2 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/dist/assets/{index-Bfabq3q-.js → index-G8fziBeQ.js} +25 -25
- package/dashboard/dist/index.html +1 -1
- package/dist/dashboard/assets/{index-Bfabq3q-.js → index-G8fziBeQ.js} +25 -25
- package/dist/dashboard/index.html +1 -1
- package/dist/hook-settings.js +4 -0
- package/dist/mcp-server.d.ts +72 -23
- package/dist/monitor.d.ts +10 -0
- package/dist/monitor.js +53 -31
- package/dist/session.d.ts +3 -0
- package/dist/session.js +16 -1
- package/dist/transcript.js +16 -6
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var L0=Object.defineProperty;var N0=(i,r,a)=>r in i?L0(i,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[r]=a;var wt=(i,r,a)=>N0(i,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const g of document.querySelectorAll('link[rel="modulepreload"]'))o(g);new MutationObserver(g=>{for(const
|
|
1
|
+
var L0=Object.defineProperty;var N0=(i,r,a)=>r in i?L0(i,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[r]=a;var wt=(i,r,a)=>N0(i,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const g of document.querySelectorAll('link[rel="modulepreload"]'))o(g);new MutationObserver(g=>{for(const x of g)if(x.type==="childList")for(const T of x.addedNodes)T.tagName==="LINK"&&T.rel==="modulepreload"&&o(T)}).observe(document,{childList:!0,subtree:!0});function a(g){const x={};return g.integrity&&(x.integrity=g.integrity),g.referrerPolicy&&(x.referrerPolicy=g.referrerPolicy),g.crossOrigin==="use-credentials"?x.credentials="include":g.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function o(g){if(g.ep)return;g.ep=!0;const x=a(g);fetch(g.href,x)}})();function hp(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ru={exports:{}},oa={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var L0=Object.defineProperty;var N0=(i,r,a)=>r in i?L0(i,r,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var am;function B0(){if(am)return oa;am=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(o,g,
|
|
9
|
+
*/var am;function B0(){if(am)return oa;am=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(o,g,x){var T=null;if(x!==void 0&&(T=""+x),g.key!==void 0&&(T=""+g.key),"key"in g){x={};for(var c in g)c!=="key"&&(x[c]=g[c])}else x=g;return g=x.ref,{$$typeof:i,type:o,key:T,ref:g!==void 0?g:null,props:x}}return oa.Fragment=r,oa.jsx=a,oa.jsxs=a,oa}var om;function z0(){return om||(om=1,Ru.exports=B0()),Ru.exports}var O=z0(),Du={exports:{}},Ae={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react.production.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var L0=Object.defineProperty;var N0=(i,r,a)=>r in i?L0(i,r,{enumerable:!0,config
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var lm;function j0(){if(lm)return Ae;lm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),
|
|
17
|
+
*/var lm;function j0(){if(lm)return Ae;lm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),T=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"),m=Symbol.for("react.activity"),C=Symbol.iterator;function w(L){return L===null||typeof L!="object"?null:(L=C&&L[C]||L["@@iterator"],typeof L=="function"?L:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,d={};function p(L,H,X){this.props=L,this.context=H,this.refs=d,this.updater=X||E}p.prototype.isReactComponent={},p.prototype.setState=function(L,H){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,H,"setState")},p.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function f(){}f.prototype=p.prototype;function v(L,H,X){this.props=L,this.context=H,this.refs=d,this.updater=X||E}var S=v.prototype=new f;S.constructor=v,b(S,p.prototype),S.isPureReactComponent=!0;var R=Array.isArray;function D(){}var M={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function B(L,H,X){var ne=X.ref;return{$$typeof:i,type:L,key:H,ref:ne!==void 0?ne:null,props:X}}function $(L,H){return B(L.type,H,L.props)}function I(L){return typeof L=="object"&&L!==null&&L.$$typeof===i}function q(L){var H={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(X){return H[X]})}var P=/\/+/g;function Q(L,H){return typeof L=="object"&&L!==null&&L.key!=null?q(""+L.key):H.toString(36)}function se(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(D,D):(L.status="pending",L.then(function(H){L.status==="pending"&&(L.status="fulfilled",L.value=H)},function(H){L.status==="pending"&&(L.status="rejected",L.reason=H)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function G(L,H,X,ne,he){var me=typeof L;(me==="undefined"||me==="boolean")&&(L=null);var Y=!1;if(L===null)Y=!0;else switch(me){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(L.$$typeof){case i:case r:Y=!0;break;case y:return Y=L._init,G(Y(L._payload),H,X,ne,he)}}if(Y)return he=he(L),Y=ne===""?"."+Q(L,0):ne,R(he)?(X="",Y!=null&&(X=Y.replace(P,"$&/")+"/"),G(he,H,X,"",function(oe){return oe})):he!=null&&(I(he)&&(he=$(he,X+(he.key==null||L&&L.key===he.key?"":(""+he.key).replace(P,"$&/")+"/")+Y)),H.push(he)),1;Y=0;var j=ne===""?".":ne+":";if(R(L))for(var ce=0;ce<L.length;ce++)ne=L[ce],me=j+Q(ne,ce),Y+=G(ne,H,X,me,he);else if(ce=w(L),typeof ce=="function")for(L=ce.call(L),ce=0;!(ne=L.next()).done;)ne=ne.value,me=j+Q(ne,ce++),Y+=G(ne,H,X,me,he);else if(me==="object"){if(typeof L.then=="function")return G(se(L),H,X,ne,he);throw H=String(L),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return Y}function K(L,H,X){if(L==null)return L;var ne=[],he=0;return G(L,ne,"","",function(me){return H.call(X,me,he++)}),ne}function ee(L){if(L._status===-1){var H=L._result;H=H(),H.then(function(X){(L._status===0||L._status===-1)&&(L._status=1,L._result=X)},function(X){(L._status===0||L._status===-1)&&(L._status=2,L._result=X)}),L._status===-1&&(L._status=0,L._result=H)}if(L._status===1)return L._result.default;throw L._result}var N=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},U={map:K,forEach:function(L,H,X){K(L,function(){H.apply(this,arguments)},X)},count:function(L){var H=0;return K(L,function(){H++}),H},toArray:function(L){return K(L,function(H){return H})||[]},only:function(L){if(!I(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Ae.Activity=m,Ae.Children=U,Ae.Component=p,Ae.Fragment=a,Ae.Profiler=g,Ae.PureComponent=v,Ae.StrictMode=o,Ae.Suspense=h,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(L){return M.H.useMemoCache(L)}},Ae.cache=function(L){return function(){return L.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(L,H,X){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ne=b({},L.props),he=L.key;if(H!=null)for(me in H.key!==void 0&&(he=""+H.key),H)!A.call(H,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&H.ref===void 0||(ne[me]=H[me]);var me=arguments.length-2;if(me===1)ne.children=X;else if(1<me){for(var Y=Array(me),j=0;j<me;j++)Y[j]=arguments[j+2];ne.children=Y}return B(L.type,he,ne)},Ae.createContext=function(L){return L={$$typeof:T,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:x,_context:L},L},Ae.createElement=function(L,H,X){var ne,he={},me=null;if(H!=null)for(ne in H.key!==void 0&&(me=""+H.key),H)A.call(H,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(he[ne]=H[ne]);var Y=arguments.length-2;if(Y===1)he.children=X;else if(1<Y){for(var j=Array(Y),ce=0;ce<Y;ce++)j[ce]=arguments[ce+2];he.children=j}if(L&&L.defaultProps)for(ne in Y=L.defaultProps,Y)he[ne]===void 0&&(he[ne]=Y[ne]);return B(L,me,he)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(L){return{$$typeof:c,render:L}},Ae.isValidElement=I,Ae.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ee}},Ae.memo=function(L,H){return{$$typeof:u,type:L,compare:H===void 0?null:H}},Ae.startTransition=function(L){var H=M.T,X={};M.T=X;try{var ne=L(),he=M.S;he!==null&&he(X,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(D,N)}catch(me){N(me)}finally{H!==null&&X.types!==null&&(H.types=X.types),M.T=H}},Ae.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ae.use=function(L){return M.H.use(L)},Ae.useActionState=function(L,H,X){return M.H.useActionState(L,H,X)},Ae.useCallback=function(L,H){return M.H.useCallback(L,H)},Ae.useContext=function(L){return M.H.useContext(L)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(L,H){return M.H.useDeferredValue(L,H)},Ae.useEffect=function(L,H){return M.H.useEffect(L,H)},Ae.useEffectEvent=function(L){return M.H.useEffectEvent(L)},Ae.useId=function(){return M.H.useId()},Ae.useImperativeHandle=function(L,H,X){return M.H.useImperativeHandle(L,H,X)},Ae.useInsertionEffect=function(L,H){return M.H.useInsertionEffect(L,H)},Ae.useLayoutEffect=function(L,H){return M.H.useLayoutEffect(L,H)},Ae.useMemo=function(L,H){return M.H.useMemo(L,H)},Ae.useOptimistic=function(L,H){return M.H.useOptimistic(L,H)},Ae.useReducer=function(L,H,X){return M.H.useReducer(L,H,X)},Ae.useRef=function(L){return M.H.useRef(L)},Ae.useState=function(L){return M.H.useState(L)},Ae.useSyncExternalStore=function(L,H,X){return M.H.useSyncExternalStore(L,H,X)},Ae.useTransition=function(){return M.H.useTransition()},Ae.version="19.2.4",Ae}var cm;function rh(){return cm||(cm=1,Du.exports=j0()),Du.exports}var F=rh();const va=hp(F);var ku={exports:{}},la={},Ou={exports:{}},Mu={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var L0=Object.defineProperty;var N0=(i,r,a)=>r in i?L0(i,r,{enumerable:!0,config
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var um;function H0(){return um||(um=1,(function(i){function r(G,K){var ee=G.length;G.push(K);e:for(;0<ee;){var N=ee-1>>>1,U=G[N];if(0<g(U,K))G[N]=K,G[ee]=U,ee=N;else break e}}function a(G){return G.length===0?null:G[0]}function o(G){if(G.length===0)return null;var K=G[0],ee=G.pop();if(ee!==K){G[0]=ee;e:for(var N=0,U=G.length,L=U>>>1;N<L;){var H=2*(N+1)-1,X=G[H],ne=H+1,he=G[ne];if(0>g(X,ee))ne<U&&0>g(he,X)?(G[N]=he,G[ne]=ee,N=ne):(G[N]=X,G[H]=ee,N=H);else if(ne<U&&0>g(he,ee))G[N]=he,G[ne]=ee,N=ne;else break e}}return K}function g(G,K){var ee=G.sortIndex-K.sortIndex;return ee!==0?ee:G.id-K.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var
|
|
25
|
+
*/var um;function H0(){return um||(um=1,(function(i){function r(G,K){var ee=G.length;G.push(K);e:for(;0<ee;){var N=ee-1>>>1,U=G[N];if(0<g(U,K))G[N]=K,G[ee]=U,ee=N;else break e}}function a(G){return G.length===0?null:G[0]}function o(G){if(G.length===0)return null;var K=G[0],ee=G.pop();if(ee!==K){G[0]=ee;e:for(var N=0,U=G.length,L=U>>>1;N<L;){var H=2*(N+1)-1,X=G[H],ne=H+1,he=G[ne];if(0>g(X,ee))ne<U&&0>g(he,X)?(G[N]=he,G[ne]=ee,N=ne):(G[N]=X,G[H]=ee,N=H);else if(ne<U&&0>g(he,ee))G[N]=he,G[ne]=ee,N=ne;else break e}}return K}function g(G,K){var ee=G.sortIndex-K.sortIndex;return ee!==0?ee:G.id-K.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;i.unstable_now=function(){return x.now()}}else{var T=Date,c=T.now();i.unstable_now=function(){return T.now()-c}}var h=[],u=[],y=1,m=null,C=3,w=!1,E=!1,b=!1,d=!1,p=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function S(G){for(var K=a(u);K!==null;){if(K.callback===null)o(u);else if(K.startTime<=G)o(u),K.sortIndex=K.expirationTime,r(h,K);else break;K=a(u)}}function R(G){if(b=!1,S(G),!E)if(a(h)!==null)E=!0,D||(D=!0,q());else{var K=a(u);K!==null&&se(R,K.startTime-G)}}var D=!1,M=-1,A=5,B=-1;function $(){return d?!0:!(i.unstable_now()-B<A)}function I(){if(d=!1,D){var G=i.unstable_now();B=G;var K=!0;try{e:{E=!1,b&&(b=!1,f(M),M=-1),w=!0;var ee=C;try{t:{for(S(G),m=a(h);m!==null&&!(m.expirationTime>G&&$());){var N=m.callback;if(typeof N=="function"){m.callback=null,C=m.priorityLevel;var U=N(m.expirationTime<=G);if(G=i.unstable_now(),typeof U=="function"){m.callback=U,S(G),K=!0;break t}m===a(h)&&o(h),S(G)}else o(h);m=a(h)}if(m!==null)K=!0;else{var L=a(u);L!==null&&se(R,L.startTime-G),K=!1}}break e}finally{m=null,C=ee,w=!1}K=void 0}}finally{K?q():D=!1}}}var q;if(typeof v=="function")q=function(){v(I)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,Q=P.port2;P.port1.onmessage=I,q=function(){Q.postMessage(null)}}else q=function(){p(I,0)};function se(G,K){M=p(function(){G(i.unstable_now())},K)}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(G){G.callback=null},i.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<G?Math.floor(1e3/G):5},i.unstable_getCurrentPriorityLevel=function(){return C},i.unstable_next=function(G){switch(C){case 1:case 2:case 3:var K=3;break;default:K=C}var ee=C;C=K;try{return G()}finally{C=ee}},i.unstable_requestPaint=function(){d=!0},i.unstable_runWithPriority=function(G,K){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ee=C;C=G;try{return K()}finally{C=ee}},i.unstable_scheduleCallback=function(G,K,ee){var N=i.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?N+ee:N):ee=N,G){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=ee+U,G={id:y++,callback:K,priorityLevel:G,startTime:ee,expirationTime:U,sortIndex:-1},ee>N?(G.sortIndex=ee,r(u,G),a(h)===null&&G===a(u)&&(b?(f(M),M=-1):b=!0,se(R,ee-N))):(G.sortIndex=U,r(h,G),E||w||(E=!0,D||(D=!0,q()))),G},i.unstable_shouldYield=$,i.unstable_wrapCallback=function(G){var K=C;return function(){var ee=C;C=K;try{return G.apply(this,arguments)}finally{C=ee}}}})(Mu)),Mu}var hm;function U0(){return hm||(hm=1,Ou.exports=H0()),Ou.exports}var Lu={exports:{}},$t={};/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.js
|
|
28
28
|
*
|
|
@@ -30,7 +30,7 @@ var L0=Object.defineProperty;var N0=(i,r,a)=>r in i?L0(i,r,{enumerable:!0,config
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var fm;function I0(){if(fm)return $t;fm=1;var i=rh();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},g=Symbol.for("react.portal");function
|
|
33
|
+
*/var fm;function I0(){if(fm)return $t;fm=1;var i=rh();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},g=Symbol.for("react.portal");function x(h,u,y){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:g,key:m==null?null:""+m,children:h,containerInfo:u,implementation:y}}var T=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 $t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,$t.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 x(h,u,null,y)},$t.flushSync=function(h){var u=T.T,y=o.p;try{if(T.T=null,o.p=2,h)return h()}finally{T.T=u,o.p=y,o.d.f()}},$t.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))},$t.prefetchDNS=function(h){typeof h=="string"&&o.d.D(h)},$t.preinit=function(h,u){if(typeof h=="string"&&u&&typeof u.as=="string"){var y=u.as,m=c(y,u.crossOrigin),C=typeof u.integrity=="string"?u.integrity:void 0,w=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;y==="style"?o.d.S(h,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:m,integrity:C,fetchPriority:w}):y==="script"&&o.d.X(h,{crossOrigin:m,integrity:C,fetchPriority:w,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},$t.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)},$t.preload=function(h,u){if(typeof h=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var y=u.as,m=c(y,u.crossOrigin);o.d.L(h,y,{crossOrigin:m,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})}},$t.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)},$t.requestFormReset=function(h){o.d.r(h)},$t.unstable_batchedUpdates=function(h,u){return h(u)},$t.useFormState=function(h,u,y){return T.H.useFormState(h,u,y)},$t.useFormStatus=function(){return T.H.useHostTransitionStatus()},$t.version="19.2.4",$t}var dm;function P0(){if(dm)return Lu.exports;dm=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(),Lu.exports=I0(),Lu.exports}/**
|
|
34
34
|
* @license React
|
|
35
35
|
* react-dom-client.production.js
|
|
36
36
|
*
|
|
@@ -38,15 +38,15 @@ var L0=Object.defineProperty;var N0=(i,r,a)=>r in i?L0(i,r,{enumerable:!0,config
|
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the MIT license found in the
|
|
40
40
|
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var _m;function $0(){if(_m)return la;_m=1;var i=U0(),r=rh(),a=P0();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 g(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function
|
|
41
|
+
*/var _m;function $0(){if(_m)return la;_m=1;var i=U0(),r=rh(),a=P0();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 g(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function x(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 T(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(x(e)!==e)throw Error(o(188))}function u(e){var t=e.alternate;if(!t){if(t=x(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 k=!1,z=l.child;z;){if(z===s){k=!0,s=l,n=_;break}if(z===n){k=!0,n=l,s=_;break}z=z.sibling}if(!k){for(z=_.child;z;){if(z===s){k=!0,s=_,n=l;break}if(z===n){k=!0,n=_,s=l;break}z=z.sibling}if(!k)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 m=Object.assign,C=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),v=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var P=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===P?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case b:return"Fragment";case p:return"Profiler";case d:return"StrictMode";case R:return"Suspense";case D:return"SuspenseList";case B:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case v:return e.displayName||"Context";case f: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:Q(e.type)||"Memo";case A:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}var se=Array.isArray,G=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},N=[],U=-1;function L(e){return{current:e}}function H(e){0>U||(e.current=N[U],N[U]=null,U--)}function X(e,t){U++,N[U]=e.current,e.current=t}var ne=L(null),he=L(null),me=L(null),Y=L(null);function j(e,t){switch(X(me,t),X(he,e),X(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?D_(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=D_(t),e=k_(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(ne),X(ne,e)}function ce(){H(ne),H(he),H(me)}function oe(e){e.memoizedState!==null&&X(Y,e);var t=ne.current,s=k_(t,e.type);t!==s&&(X(he,e),X(ne,s))}function ve(e){he.current===e&&(H(ne),H(he)),Y.current===e&&(H(Y),sa._currentValue=ee)}var pe,Te;function je(e){if(pe===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||"",Te=-1<s.stack.indexOf(`
|
|
42
42
|
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
43
|
`+pe+e+Te}var Ue=!1;function ct(e,t){if(!e||Ue)return"";Ue=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ae){var re=ae}Reflect.construct(e,[],de)}else{try{de.call()}catch(ae){re=ae}e.call(de.prototype)}}else{try{throw Error()}catch(ae){re=ae}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ae){if(ae&&re&&typeof ae.stack=="string")return[ae.stack,re.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(),k=_[0],z=_[1];if(k&&z){var Z=k.split(`
|
|
44
44
|
`),ie=z.split(`
|
|
45
45
|
`);for(l=n=0;n<Z.length&&!Z[n].includes("DetermineComponentFrameRoot");)n++;for(;l<ie.length&&!ie[l].includes("DetermineComponentFrameRoot");)l++;if(n===Z.length||l===ie.length)for(n=Z.length-1,l=ie.length-1;1<=n&&0<=l&&Z[n]!==ie[l];)l--;for(;1<=n&&0<=l;n--,l--)if(Z[n]!==ie[l]){if(n!==1||l!==1)do if(n--,l--,0>l||Z[n]!==ie[l]){var le=`
|
|
46
46
|
`+Z[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{Ue=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?je(s):""}function Ee(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 ct(e.type,!1);case 11:return ct(e.type.render,!1);case 1:return ct(e.type,!0);case 31:return je("Activity");default:return""}}function Ft(e){try{var t="",s=null;do t+=Ee(e,s),s=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
47
|
Error generating stack: `+n.message+`
|
|
48
|
-
`+n.stack}}var mi=Object.prototype.hasOwnProperty,pi=i.unstable_scheduleCallback,Ii=i.unstable_cancelCallback,Vi=i.unstable_shouldYield,Pt=i.unstable_requestPaint,nt=i.unstable_now,Dt=i.unstable_getCurrentPriorityLevel,Zt=i.unstable_ImmediatePriority,Nt=i.unstable_UserBlockingPriority,Bt=i.unstable_NormalPriority,Ki=i.unstable_LowPriority,Kt=i.unstable_IdlePriority,Li=i.log,Ye=i.unstable_setDisableYieldValue,vi=null,kt=null;function Ot(e){if(typeof Li=="function"&&Ye(e),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(vi,e)}catch{}}var gt=Math.clz32?Math.clz32:Sl,un=Math.log,hn=Math.LN2;function Sl(e){return e>>>=0,e===0?32:31-(un(e)/hn|0)|0}var Xi=256,Ji=262144,gr=4194304;function ai(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 yr(e,t,s){var n=e.pendingLanes;if(n===0)return 0;var l=0,_=e.suspendedLanes,k=e.pingedLanes;e=e.warmLanes;var z=n&134217727;return z!==0?(n=z&~_,n!==0?l=ai(n):(k&=z,k!==0?l=ai(k):s||(s=z&~e,s!==0&&(l=ai(s))))):(z=n&~_,z!==0?l=ai(z):k!==0?l=ai(k):s||(s=n&~e,s!==0&&(l=ai(s)))),l===0?0:t!==0&&t!==l&&(t&_)===0&&(_=l&-l,s=t&-t,_>=s||_===32&&(s&4194048)!==0)?t:l}function Js(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _t(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 Qi(){var e=gr;return gr<<=1,(gr&62914560)===0&&(gr=4194304),e}function fn(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function bs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dn(e,t,s,n,l,_){var k=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,Z=e.expirationTimes,ie=e.hiddenUpdates;for(s=k&~s;0<s;){var le=31-gt(s),de=1<<le;z[le]=0,Z[le]=-1;var re=ie[le];if(re!==null)for(ie[le]=null,le=0;le<re.length;le++){var ae=re[le];ae!==null&&(ae.lane&=-536870913)}s&=~de}n!==0&&_n(e,n,0),_!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=_&~(k&~t))}function _n(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-gt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|s&261930}function mn(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var n=31-gt(s),l=1<<n;l&t|e[n]&t&&(e[n]|=t),s&=~l}}function Ea(e,t){var s=t&-t;return s=(s&42)!==0?1:Xt(s),(s&(e.suspendedLanes|t))!==0?0:s}function Xt(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 Ni(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function pn(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:Q_(e.type))}function vn(e,t){var s=K.p;try{return K.p=e,t()}finally{K.p=s}}var gi=Math.random().toString(36).slice(2),yt="__reactFiber$"+gi,it="__reactProps$"+gi,es="__reactContainer$"+gi,Sr="__reactEvents$"+gi,Ta="__reactListeners$"+gi,Aa="__reactHandles$"+gi,Ra="__reactResources$"+gi,Se="__reactMarker$"+gi;function W(e){delete e[yt],delete e[it],delete e[Sr],delete e[Ta],delete e[Aa]}function _e(e){var t=e[yt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[es]||s[yt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=j_(e);e!==null;){if(s=e[yt])return s;e=j_(e)}return t}e=s,s=e.parentNode}return null}function ge(e){if(e=e[yt]||e[es]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ze(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function at(e){var t=e[Ra];return t||(t=e[Ra]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ke(e){e[Se]=!0}var zt=new Set,yi={};function Jt(e,t){Pi(e,t),Pi(e+"Capture",t)}function Pi(e,t){for(yi[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var At=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]*$"),gn={},yn={};function Ev(e){return mi.call(yn,e)?!0:mi.call(gn,e)?!1:At.test(e)?yn[e]=!0:(gn[e]=!0,!1)}function Da(e,t,s){if(Ev(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 ka(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 ts(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 Si(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Tv(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(k){s=""+k,_.call(this,k)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(k){s=""+k},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bl(e){if(!e._valueTracker){var t=Sh(e)?"checked":"value";e._valueTracker=Tv(e,t,""+e[t])}}function bh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),n="";return e&&(n=Sh(e)?e.checked?"true":"false":e.value),e=n,e!==s?(t.setValue(e),!0):!1}function Oa(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 Av=/[\n"\\]/g;function bi(e){return e.replace(Av,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Cl(e,t,s,n,l,_,k,z){e.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.type=k:e.removeAttribute("type"),t!=null?k==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Si(t)):e.value!==""+Si(t)&&(e.value=""+Si(t)):k!=="submit"&&k!=="reset"||e.removeAttribute("value"),t!=null?xl(e,k,Si(t)):s!=null?xl(e,k,Si(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=""+Si(z):e.removeAttribute("name")}function Ch(e,t,s,n,l,_,k,z){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.type=_),t!=null||s!=null){if(!(_!=="submit"&&_!=="reset"||t!=null)){bl(e);return}s=s!=null?""+Si(s):"",t=t!=null?""+Si(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,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(e.name=k),bl(e)}function xl(e,t,s){t==="number"&&Oa(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function br(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=""+Si(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 xh(e,t,s){if(t!=null&&(t=""+Si(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Si(s):""}function wh(e,t,s,n){if(t==null){if(n!=null){if(s!=null)throw Error(o(92));if(se(n)){if(1<n.length)throw Error(o(93));n=n[0]}s=n}s==null&&(s=""),t=s}s=Si(t),e.defaultValue=s,n=e.textContent,n===s&&n!==""&&n!==null&&(e.value=n),bl(e)}function Cr(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Rv=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 Eh(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||Rv.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Th(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&&Eh(e,l,n)}else for(var _ in t)t.hasOwnProperty(_)&&Eh(e,_,t[_])}function wl(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 Dv=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"]]),kv=/^[\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 Ma(e){return kv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function is(){}var El=null;function Tl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xr=null,wr=null;function Ah(e){var t=ge(e);if(t&&(e=t.stateNode)){var s=e[it]||null;e:switch(e=t.stateNode,t.type){case"input":if(Cl(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="'+bi(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var n=s[t];if(n!==e&&n.form===e.form){var l=n[it]||null;if(!l)throw Error(o(90));Cl(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&&bh(n)}break e;case"textarea":xh(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&br(e,!!s.multiple,t,!1)}}}var Al=!1;function Rh(e,t,s){if(Al)return e(t,s);Al=!0;try{var n=e(t);return n}finally{if(Al=!1,(xr!==null||wr!==null)&&(So(),xr&&(t=xr,e=wr,wr=xr=null,Ah(t),e)))for(t=0;t<e.length;t++)Ah(e[t])}}function Sn(e,t){var s=e.stateNode;if(s===null)return null;var n=s[it]||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 ss=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rl=!1;if(ss)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){Rl=!0}}),window.addEventListener("test",bn,bn),window.removeEventListener("test",bn,bn)}catch{Rl=!1}var Cs=null,Dl=null,La=null;function Dh(){if(La)return La;var e,t=Dl,s=t.length,n,l="value"in Cs?Cs.value:Cs.textContent,_=l.length;for(e=0;e<s&&t[e]===l[e];e++);var k=s-e;for(n=1;n<=k&&t[s-n]===l[_-n];n++);return La=l.slice(e,1<n?1-n:void 0)}function Na(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 Ba(){return!0}function kh(){return!1}function Qt(e){function t(s,n,l,_,k){this._reactName=s,this._targetInst=l,this.type=n,this.nativeEvent=_,this.target=k,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)?Ba:kh,this.isPropagationStopped=kh,this}return m(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=Ba)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ba)},persist:function(){},isPersistent:Ba}),t}var Qs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},za=Qt(Qs),Cn=m({},Qs,{view:0,detail:0}),Ov=Qt(Cn),kl,Ol,xn,ja=m({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ll,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!==xn&&(xn&&e.type==="mousemove"?(kl=e.screenX-xn.screenX,Ol=e.screenY-xn.screenY):Ol=kl=0,xn=e),kl)},movementY:function(e){return"movementY"in e?e.movementY:Ol}}),Oh=Qt(ja),Mv=m({},ja,{dataTransfer:0}),Lv=Qt(Mv),Nv=m({},Cn,{relatedTarget:0}),Ml=Qt(Nv),Bv=m({},Qs,{animationName:0,elapsedTime:0,pseudoElement:0}),zv=Qt(Bv),jv=m({},Qs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hv=Qt(jv),Uv=m({},Qs,{data:0}),Mh=Qt(Uv),Iv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pv={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"},$v={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$v[e])?!!t[e]:!1}function Ll(){return Fv}var Zv=m({},Cn,{key:function(e){if(e.key){var t=Iv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Na(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ll,charCode:function(e){return e.type==="keypress"?Na(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Na(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qv=Qt(Zv),Gv=m({},ja,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lh=Qt(Gv),Wv=m({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ll}),Yv=Qt(Wv),Vv=m({},Qs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kv=Qt(Vv),Xv=m({},ja,{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}),Jv=Qt(Xv),Qv=m({},Qs,{newState:0,oldState:0}),eg=Qt(Qv),tg=[9,13,27,32],Nl=ss&&"CompositionEvent"in window,wn=null;ss&&"documentMode"in document&&(wn=document.documentMode);var ig=ss&&"TextEvent"in window&&!wn,Nh=ss&&(!Nl||wn&&8<wn&&11>=wn),Bh=" ",zh=!1;function jh(e,t){switch(e){case"keyup":return tg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Er=!1;function sg(e,t){switch(e){case"compositionend":return Hh(t);case"keypress":return t.which!==32?null:(zh=!0,Bh);case"textInput":return e=t.data,e===Bh&&zh?null:e;default:return null}}function rg(e,t){if(Er)return e==="compositionend"||!Nl&&jh(e,t)?(e=Dh(),La=Dl=Cs=null,Er=!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 Nh&&t.locale!=="ko"?null:t.data;default:return null}}var ng={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 Uh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ng[e.type]:t==="textarea"}function Ih(e,t,s,n){xr?wr?wr.push(n):wr=[n]:xr=n,t=Ao(t,"onChange"),0<t.length&&(s=new za("onChange","change",null,s,n),e.push({event:s,listeners:t}))}var En=null,Tn=null;function ag(e){x_(e,0)}function Ha(e){var t=Ze(e);if(bh(t))return e}function Ph(e,t){if(e==="change")return t}var $h=!1;if(ss){var Bl;if(ss){var zl="oninput"in document;if(!zl){var Fh=document.createElement("div");Fh.setAttribute("oninput","return;"),zl=typeof Fh.oninput=="function"}Bl=zl}else Bl=!1;$h=Bl&&(!document.documentMode||9<document.documentMode)}function Zh(){En&&(En.detachEvent("onpropertychange",qh),Tn=En=null)}function qh(e){if(e.propertyName==="value"&&Ha(Tn)){var t=[];Ih(t,Tn,e,Tl(e)),Rh(ag,t)}}function og(e,t,s){e==="focusin"?(Zh(),En=t,Tn=s,En.attachEvent("onpropertychange",qh)):e==="focusout"&&Zh()}function lg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ha(Tn)}function cg(e,t){if(e==="click")return Ha(t)}function ug(e,t){if(e==="input"||e==="change")return Ha(t)}function hg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oi=typeof Object.is=="function"?Object.is:hg;function An(e,t){if(oi(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(!mi.call(t,l)||!oi(e[l],t[l]))return!1}return!0}function Gh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wh(e,t){var s=Gh(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=Gh(s)}}function Yh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Oa(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=Oa(e.document)}return t}function jl(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 fg=ss&&"documentMode"in document&&11>=document.documentMode,Tr=null,Hl=null,Rn=null,Ul=!1;function Kh(e,t,s){var n=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ul||Tr==null||Tr!==Oa(n)||(n=Tr,"selectionStart"in n&&jl(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}),Rn&&An(Rn,n)||(Rn=n,n=Ao(Hl,"onSelect"),0<n.length&&(t=new za("onSelect","select",null,t,s),e.push({event:t,listeners:n}),t.target=Tr)))}function er(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Ar={animationend:er("Animation","AnimationEnd"),animationiteration:er("Animation","AnimationIteration"),animationstart:er("Animation","AnimationStart"),transitionrun:er("Transition","TransitionRun"),transitionstart:er("Transition","TransitionStart"),transitioncancel:er("Transition","TransitionCancel"),transitionend:er("Transition","TransitionEnd")},Il={},Xh={};ss&&(Xh=document.createElement("div").style,"AnimationEvent"in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),"TransitionEvent"in window||delete Ar.transitionend.transition);function tr(e){if(Il[e])return Il[e];if(!Ar[e])return e;var t=Ar[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Xh)return Il[e]=t[s];return e}var Jh=tr("animationend"),Qh=tr("animationiteration"),ef=tr("animationstart"),dg=tr("transitionrun"),_g=tr("transitionstart"),mg=tr("transitioncancel"),tf=tr("transitionend"),sf=new Map,Pl="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(" ");Pl.push("scrollEnd");function Bi(e,t){sf.set(e,t),Jt(t,[e])}var Ua=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ci=[],Rr=0,$l=0;function Ia(){for(var e=Rr,t=$l=Rr=0;t<e;){var s=Ci[t];Ci[t++]=null;var n=Ci[t];Ci[t++]=null;var l=Ci[t];Ci[t++]=null;var _=Ci[t];if(Ci[t++]=null,n!==null&&l!==null){var k=n.pending;k===null?l.next=l:(l.next=k.next,k.next=l),n.pending=l}_!==0&&rf(s,l,_)}}function Pa(e,t,s,n){Ci[Rr++]=e,Ci[Rr++]=t,Ci[Rr++]=s,Ci[Rr++]=n,$l|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Fl(e,t,s,n){return Pa(e,t,s,n),$a(e)}function ir(e,t){return Pa(e,null,null,t),$a(e)}function rf(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-gt(s),e=_.hiddenUpdates,n=e[l],n===null?e[l]=[t]:n.push(t),t.lane=s|536870912),_):null}function $a(e){if(50<Kn)throw Kn=0,Jc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Dr={};function pg(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 li(e,t,s,n){return new pg(e,t,s,n)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rs(e,t){var s=e.alternate;return s===null?(s=li(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 nf(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 k=0;if(n=e,typeof e=="function")Zl(e)&&(k=1);else if(typeof e=="string")k=b0(e,s,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case B:return e=li(31,s,t,l),e.elementType=B,e.lanes=_,e;case b:return sr(s.children,l,_,t);case d:k=8,l|=24;break;case p:return e=li(12,s,t,l|2),e.elementType=p,e.lanes=_,e;case R:return e=li(13,s,t,l),e.elementType=R,e.lanes=_,e;case D:return e=li(19,s,t,l),e.elementType=D,e.lanes=_,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case v:k=10;break e;case f:k=9;break e;case S:k=11;break e;case M:k=14;break e;case A:k=16,n=null;break e}k=29,s=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=li(k,s,t,l),t.elementType=e,t.type=n,t.lanes=_,t}function sr(e,t,s,n){return e=li(7,e,n,t),e.lanes=s,e}function ql(e,t,s){return e=li(6,e,null,t),e.lanes=s,e}function af(e){var t=li(18,null,null,0);return t.stateNode=e,t}function Gl(e,t,s){return t=li(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var of=new WeakMap;function xi(e,t){if(typeof e=="object"&&e!==null){var s=of.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Ft(t)},of.set(e,t),t)}return{value:e,source:t,stack:Ft(t)}}var kr=[],Or=0,Za=null,Dn=0,wi=[],Ei=0,xs=null,$i=1,Fi="";function ns(e,t){kr[Or++]=Dn,kr[Or++]=Za,Za=e,Dn=t}function lf(e,t,s){wi[Ei++]=$i,wi[Ei++]=Fi,wi[Ei++]=xs,xs=e;var n=$i;e=Fi;var l=32-gt(n)-1;n&=~(1<<l),s+=1;var _=32-gt(t)+l;if(30<_){var k=l-l%5;_=(n&(1<<k)-1).toString(32),n>>=k,l-=k,$i=1<<32-gt(t)+l|s<<l|n,Fi=_+e}else $i=1<<_|s<<l|n,Fi=e}function Wl(e){e.return!==null&&(ns(e,1),lf(e,1,0))}function Yl(e){for(;e===Za;)Za=kr[--Or],kr[Or]=null,Dn=kr[--Or],kr[Or]=null;for(;e===xs;)xs=wi[--Ei],wi[Ei]=null,Fi=wi[--Ei],wi[Ei]=null,$i=wi[--Ei],wi[Ei]=null}function cf(e,t){wi[Ei++]=$i,wi[Ei++]=Fi,wi[Ei++]=xs,$i=t.id,Fi=t.overflow,xs=e}var jt=null,et=null,He=!1,ws=null,Ti=!1,Vl=Error(o(519));function Es(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw kn(xi(t,e)),Vl}function uf(e){var t=e.stateNode,s=e.type,n=e.memoizedProps;switch(t[yt]=e,t[it]=n,s){case"dialog":Ne("cancel",t),Ne("close",t);break;case"iframe":case"object":case"embed":Ne("load",t);break;case"video":case"audio":for(s=0;s<Jn.length;s++)Ne(Jn[s],t);break;case"source":Ne("error",t);break;case"img":case"image":case"link":Ne("error",t),Ne("load",t);break;case"details":Ne("toggle",t);break;case"input":Ne("invalid",t),Ch(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Ne("invalid",t);break;case"textarea":Ne("invalid",t),wh(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||A_(t.textContent,s)?(n.popover!=null&&(Ne("beforetoggle",t),Ne("toggle",t)),n.onScroll!=null&&Ne("scroll",t),n.onScrollEnd!=null&&Ne("scrollend",t),n.onClick!=null&&(t.onclick=is),t=!0):t=!1,t||Es(e,!0)}function hf(e){for(jt=e.return;jt;)switch(jt.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:jt=jt.return}}function Mr(e){if(e!==jt)return!1;if(!He)return hf(e),He=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||du(e.type,e.memoizedProps)),s=!s),s&&et&&Es(e),hf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));et=z_(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));et=z_(e)}else t===27?(t=et,Us(e.type)?(e=gu,gu=null,et=e):et=t):et=jt?Ri(e.stateNode.nextSibling):null;return!0}function rr(){et=jt=null,He=!1}function Kl(){var e=ws;return e!==null&&(si===null?si=e:si.push.apply(si,e),ws=null),e}function kn(e){ws===null?ws=[e]:ws.push(e)}var Xl=L(null),nr=null,as=null;function Ts(e,t,s){X(Xl,t._currentValue),t._currentValue=s}function os(e){e._currentValue=Xl.current,H(Xl)}function Jl(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 Ql(e,t,s,n){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var _=l.dependencies;if(_!==null){var k=l.child;_=_.firstContext;e:for(;_!==null;){var z=_;_=l;for(var Z=0;Z<t.length;Z++)if(z.context===t[Z]){_.lanes|=s,z=_.alternate,z!==null&&(z.lanes|=s),Jl(_.return,s,e),n||(k=null);break e}_=z.next}}else if(l.tag===18){if(k=l.return,k===null)throw Error(o(341));k.lanes|=s,_=k.alternate,_!==null&&(_.lanes|=s),Jl(k,s,e),k=null}else k=l.child;if(k!==null)k.return=l;else for(k=l;k!==null;){if(k===e){k=null;break}if(l=k.sibling,l!==null){l.return=k.return,k=l;break}k=k.return}l=k}}function Lr(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 k=l.alternate;if(k===null)throw Error(o(387));if(k=k.memoizedProps,k!==null){var z=l.type;oi(l.pendingProps.value,k.value)||(e!==null?e.push(z):e=[z])}}else if(l===Y.current){if(k=l.alternate,k===null)throw Error(o(387));k.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(sa):e=[sa])}l=l.return}e!==null&&Ql(t,e,s,n),t.flags|=262144}function qa(e){for(e=e.firstContext;e!==null;){if(!oi(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ar(e){nr=e,as=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ht(e){return ff(nr,e)}function Ga(e,t){return nr===null&&ar(e),ff(e,t)}function ff(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},as===null){if(e===null)throw Error(o(308));as=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else as=as.next=t;return s}var vg=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()})}},gg=i.unstable_scheduleCallback,yg=i.unstable_NormalPriority,St={$$typeof:v,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ec(){return{controller:new vg,data:new Map,refCount:0}}function On(e){e.refCount--,e.refCount===0&&gg(yg,function(){e.controller.abort()})}var Mn=null,tc=0,Nr=0,Br=null;function Sg(e,t){if(Mn===null){var s=Mn=[];tc=0,Nr=ru(),Br={status:"pending",value:void 0,then:function(n){s.push(n)}}}return tc++,t.then(df,df),t}function df(){if(--tc===0&&Mn!==null){Br!==null&&(Br.status="fulfilled");var e=Mn;Mn=null,Nr=0,Br=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function bg(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 _f=G.S;G.S=function(e,t){Xd=nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Sg(e,t),_f!==null&&_f(e,t)};var or=L(null);function ic(){var e=or.current;return e!==null?e:Je.pooledCache}function Wa(e,t){t===null?X(or,or.current):X(or,t.pool)}function mf(){var e=ic();return e===null?null:{parent:St._currentValue,pool:e}}var zr=Error(o(460)),sc=Error(o(474)),Ya=Error(o(542)),Va={then:function(){}};function pf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function vf(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(is,is),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,yf(e),e;default:if(typeof t.status=="string")t.then(is,is);else{if(e=Je,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,yf(e),e}throw cr=t,zr}}function lr(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(cr=s,zr):s}}var cr=null;function gf(){if(cr===null)throw Error(o(459));var e=cr;return cr=null,e}function yf(e){if(e===zr||e===Ya)throw Error(o(483))}var jr=null,Ln=0;function Ka(e){var t=Ln;return Ln+=1,jr===null&&(jr=[]),vf(jr,e,t)}function Nn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Xa(e,t){throw t.$$typeof===C?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Sf(e){function t(J,V){if(e){var te=J.deletions;te===null?(J.deletions=[V],J.flags|=16):te.push(V)}}function s(J,V){if(!e)return null;for(;V!==null;)t(J,V),V=V.sibling;return null}function n(J){for(var V=new Map;J!==null;)J.key!==null?V.set(J.key,J):V.set(J.index,J),J=J.sibling;return V}function l(J,V){return J=rs(J,V),J.index=0,J.sibling=null,J}function _(J,V,te){return J.index=te,e?(te=J.alternate,te!==null?(te=te.index,te<V?(J.flags|=67108866,V):te):(J.flags|=67108866,V)):(J.flags|=1048576,V)}function k(J){return e&&J.alternate===null&&(J.flags|=67108866),J}function z(J,V,te,ue){return V===null||V.tag!==6?(V=ql(te,J.mode,ue),V.return=J,V):(V=l(V,te),V.return=J,V)}function Z(J,V,te,ue){var Ce=te.type;return Ce===b?le(J,V,te.props.children,ue,te.key):V!==null&&(V.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===A&&lr(Ce)===V.type)?(V=l(V,te.props),Nn(V,te),V.return=J,V):(V=Fa(te.type,te.key,te.props,null,J.mode,ue),Nn(V,te),V.return=J,V)}function ie(J,V,te,ue){return V===null||V.tag!==4||V.stateNode.containerInfo!==te.containerInfo||V.stateNode.implementation!==te.implementation?(V=Gl(te,J.mode,ue),V.return=J,V):(V=l(V,te.children||[]),V.return=J,V)}function le(J,V,te,ue,Ce){return V===null||V.tag!==7?(V=sr(te,J.mode,ue,Ce),V.return=J,V):(V=l(V,te),V.return=J,V)}function de(J,V,te){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=ql(""+V,J.mode,te),V.return=J,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case x:return te=Fa(V.type,V.key,V.props,null,J.mode,te),Nn(te,V),te.return=J,te;case E:return V=Gl(V,J.mode,te),V.return=J,V;case A:return V=lr(V),de(J,V,te)}if(se(V)||q(V))return V=sr(V,J.mode,te,null),V.return=J,V;if(typeof V.then=="function")return de(J,Ka(V),te);if(V.$$typeof===v)return de(J,Ga(J,V),te);Xa(J,V)}return null}function re(J,V,te,ue){var Ce=V!==null?V.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Ce!==null?null:z(J,V,""+te,ue);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case x:return te.key===Ce?Z(J,V,te,ue):null;case E:return te.key===Ce?ie(J,V,te,ue):null;case A:return te=lr(te),re(J,V,te,ue)}if(se(te)||q(te))return Ce!==null?null:le(J,V,te,ue,null);if(typeof te.then=="function")return re(J,V,Ka(te),ue);if(te.$$typeof===v)return re(J,V,Ga(J,te),ue);Xa(J,te)}return null}function ae(J,V,te,ue,Ce){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return J=J.get(te)||null,z(V,J,""+ue,Ce);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return J=J.get(ue.key===null?te:ue.key)||null,Z(V,J,ue,Ce);case E:return J=J.get(ue.key===null?te:ue.key)||null,ie(V,J,ue,Ce);case A:return ue=lr(ue),ae(J,V,te,ue,Ce)}if(se(ue)||q(ue))return J=J.get(te)||null,le(V,J,ue,Ce,null);if(typeof ue.then=="function")return ae(J,V,te,Ka(ue),Ce);if(ue.$$typeof===v)return ae(J,V,te,Ga(V,ue),Ce);Xa(V,ue)}return null}function ye(J,V,te,ue){for(var Ce=null,Pe=null,be=V,De=V=0,ze=null;be!==null&&De<te.length;De++){be.index>De?(ze=be,be=null):ze=be.sibling;var $e=re(J,be,te[De],ue);if($e===null){be===null&&(be=ze);break}e&&be&&$e.alternate===null&&t(J,be),V=_($e,V,De),Pe===null?Ce=$e:Pe.sibling=$e,Pe=$e,be=ze}if(De===te.length)return s(J,be),He&&ns(J,De),Ce;if(be===null){for(;De<te.length;De++)be=de(J,te[De],ue),be!==null&&(V=_(be,V,De),Pe===null?Ce=be:Pe.sibling=be,Pe=be);return He&&ns(J,De),Ce}for(be=n(be);De<te.length;De++)ze=ae(be,J,De,te[De],ue),ze!==null&&(e&&ze.alternate!==null&&be.delete(ze.key===null?De:ze.key),V=_(ze,V,De),Pe===null?Ce=ze:Pe.sibling=ze,Pe=ze);return e&&be.forEach(function(Zs){return t(J,Zs)}),He&&ns(J,De),Ce}function we(J,V,te,ue){if(te==null)throw Error(o(151));for(var Ce=null,Pe=null,be=V,De=V=0,ze=null,$e=te.next();be!==null&&!$e.done;De++,$e=te.next()){be.index>De?(ze=be,be=null):ze=be.sibling;var Zs=re(J,be,$e.value,ue);if(Zs===null){be===null&&(be=ze);break}e&&be&&Zs.alternate===null&&t(J,be),V=_(Zs,V,De),Pe===null?Ce=Zs:Pe.sibling=Zs,Pe=Zs,be=ze}if($e.done)return s(J,be),He&&ns(J,De),Ce;if(be===null){for(;!$e.done;De++,$e=te.next())$e=de(J,$e.value,ue),$e!==null&&(V=_($e,V,De),Pe===null?Ce=$e:Pe.sibling=$e,Pe=$e);return He&&ns(J,De),Ce}for(be=n(be);!$e.done;De++,$e=te.next())$e=ae(be,J,De,$e.value,ue),$e!==null&&(e&&$e.alternate!==null&&be.delete($e.key===null?De:$e.key),V=_($e,V,De),Pe===null?Ce=$e:Pe.sibling=$e,Pe=$e);return e&&be.forEach(function(M0){return t(J,M0)}),He&&ns(J,De),Ce}function Xe(J,V,te,ue){if(typeof te=="object"&&te!==null&&te.type===b&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case x:e:{for(var Ce=te.key;V!==null;){if(V.key===Ce){if(Ce=te.type,Ce===b){if(V.tag===7){s(J,V.sibling),ue=l(V,te.props.children),ue.return=J,J=ue;break e}}else if(V.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===A&&lr(Ce)===V.type){s(J,V.sibling),ue=l(V,te.props),Nn(ue,te),ue.return=J,J=ue;break e}s(J,V);break}else t(J,V);V=V.sibling}te.type===b?(ue=sr(te.props.children,J.mode,ue,te.key),ue.return=J,J=ue):(ue=Fa(te.type,te.key,te.props,null,J.mode,ue),Nn(ue,te),ue.return=J,J=ue)}return k(J);case E:e:{for(Ce=te.key;V!==null;){if(V.key===Ce)if(V.tag===4&&V.stateNode.containerInfo===te.containerInfo&&V.stateNode.implementation===te.implementation){s(J,V.sibling),ue=l(V,te.children||[]),ue.return=J,J=ue;break e}else{s(J,V);break}else t(J,V);V=V.sibling}ue=Gl(te,J.mode,ue),ue.return=J,J=ue}return k(J);case A:return te=lr(te),Xe(J,V,te,ue)}if(se(te))return ye(J,V,te,ue);if(q(te)){if(Ce=q(te),typeof Ce!="function")throw Error(o(150));return te=Ce.call(te),we(J,V,te,ue)}if(typeof te.then=="function")return Xe(J,V,Ka(te),ue);if(te.$$typeof===v)return Xe(J,V,Ga(J,te),ue);Xa(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,V!==null&&V.tag===6?(s(J,V.sibling),ue=l(V,te),ue.return=J,J=ue):(s(J,V),ue=ql(te,J.mode,ue),ue.return=J,J=ue),k(J)):s(J,V)}return function(J,V,te,ue){try{Ln=0;var Ce=Xe(J,V,te,ue);return jr=null,Ce}catch(be){if(be===zr||be===Ya)throw be;var Pe=li(29,be,null,J.mode);return Pe.lanes=ue,Pe.return=J,Pe}finally{}}}var ur=Sf(!0),bf=Sf(!1),As=!1;function rc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Rs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ds(e,t,s){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Fe&2)!==0){var l=n.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),n.pending=t,t=$a(e),rf(e,null,s),t}return Pa(e,n,t,s),$a(e)}function Bn(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,mn(e,s)}}function ac(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 k={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};_===null?l=_=k:_=_.next=k,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 oc=!1;function zn(){if(oc){var e=Br;if(e!==null)throw e}}function jn(e,t,s,n){oc=!1;var l=e.updateQueue;As=!1;var _=l.firstBaseUpdate,k=l.lastBaseUpdate,z=l.shared.pending;if(z!==null){l.shared.pending=null;var Z=z,ie=Z.next;Z.next=null,k===null?_=ie:k.next=ie,k=Z;var le=e.alternate;le!==null&&(le=le.updateQueue,z=le.lastBaseUpdate,z!==k&&(z===null?le.firstBaseUpdate=ie:z.next=ie,le.lastBaseUpdate=Z))}if(_!==null){var de=l.baseState;k=0,le=ie=Z=null,z=_;do{var re=z.lane&-536870913,ae=re!==z.lane;if(ae?(Be&re)===re:(n&re)===re){re!==0&&re===Nr&&(oc=!0),le!==null&&(le=le.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var ye=e,we=z;re=t;var Xe=s;switch(we.tag){case 1:if(ye=we.payload,typeof ye=="function"){de=ye.call(Xe,de,re);break e}de=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=we.payload,re=typeof ye=="function"?ye.call(Xe,de,re):ye,re==null)break e;de=m({},de,re);break e;case 2:As=!0}}re=z.callback,re!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=l.callbacks,ae===null?l.callbacks=[re]:ae.push(re))}else ae={lane:re,tag:z.tag,payload:z.payload,callback:z.callback,next:null},le===null?(ie=le=ae,Z=de):le=le.next=ae,k|=re;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&&(Z=de),l.baseState=Z,l.firstBaseUpdate=ie,l.lastBaseUpdate=le,_===null&&(l.shared.lanes=0),Ns|=k,e.lanes=k,e.memoizedState=de}}function Cf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function xf(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Cf(s[e],t)}var Hr=L(null),Ja=L(0);function wf(e,t){e=ps,X(Ja,e),X(Hr,t),ps=e|t.baseLanes}function lc(){X(Ja,ps),X(Hr,Hr.current)}function cc(){ps=Ja.current,H(Hr),H(Ja)}var ci=L(null),Ai=null;function ks(e){var t=e.alternate;X(mt,mt.current&1),X(ci,e),Ai===null&&(t===null||Hr.current!==null||t.memoizedState!==null)&&(Ai=e)}function uc(e){X(mt,mt.current),X(ci,e),Ai===null&&(Ai=e)}function Ef(e){e.tag===22?(X(mt,mt.current),X(ci,e),Ai===null&&(Ai=e)):Os()}function Os(){X(mt,mt.current),X(ci,ci.current)}function ui(e){H(ci),Ai===e&&(Ai=null),H(mt)}var mt=L(0);function Qa(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||pu(s)||vu(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 ls=0,Re=null,Ve=null,bt=null,eo=!1,Ur=!1,hr=!1,to=0,Hn=0,Ir=null,Cg=0;function ut(){throw Error(o(321))}function hc(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!oi(e[s],t[s]))return!1;return!0}function fc(e,t,s,n,l,_){return ls=_,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?ld:Ac,hr=!1,_=s(n,l),hr=!1,Ur&&(_=Af(t,s,n,l)),Tf(e),_}function Tf(e){G.H=Pn;var t=Ve!==null&&Ve.next!==null;if(ls=0,bt=Ve=Re=null,eo=!1,Hn=0,Ir=null,t)throw Error(o(300));e===null||Ct||(e=e.dependencies,e!==null&&qa(e)&&(Ct=!0))}function Af(e,t,s,n){Re=e;var l=0;do{if(Ur&&(Ir=null),Hn=0,Ur=!1,25<=l)throw Error(o(301));if(l+=1,bt=Ve=null,e.updateQueue!=null){var _=e.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}G.H=cd,_=t(s,n)}while(Ur);return _}function xg(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?Un(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Re.flags|=1024),t}function dc(){var e=to!==0;return to=0,e}function _c(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function mc(e){if(eo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}eo=!1}ls=0,bt=Ve=Re=null,Ur=!1,Hn=to=0,Ir=null}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Re.memoizedState=bt=e:bt=bt.next=e,bt}function pt(){if(Ve===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=bt===null?Re.memoizedState:bt.next;if(t!==null)bt=t,Ve=e;else{if(e===null)throw Re.alternate===null?Error(o(467)):Error(o(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},bt===null?Re.memoizedState=bt=e:bt=bt.next=e}return bt}function io(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Un(e){var t=Hn;return Hn+=1,Ir===null&&(Ir=[]),e=vf(Ir,e,t),t=Re,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?ld:Ac),e}function so(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Un(e);if(e.$$typeof===v)return Ht(e)}throw Error(o(438,String(e)))}function pc(e){var t=null,s=Re.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var n=Re.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=io(),Re.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 cs(e,t){return typeof t=="function"?t(e):t}function ro(e){var t=pt();return vc(t,Ve,e)}function vc(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 k=l.next;l.next=_.next,_.next=k}t.baseQueue=l=_,n.pending=null}if(_=e.baseState,l===null)e.memoizedState=_;else{t=l.next;var z=k=null,Z=null,ie=t,le=!1;do{var de=ie.lane&-536870913;if(de!==ie.lane?(Be&de)===de:(ls&de)===de){var re=ie.revertLane;if(re===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),de===Nr&&(le=!0);else if((ls&re)===re){ie=ie.next,re===Nr&&(le=!0);continue}else de={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Z===null?(z=Z=de,k=_):Z=Z.next=de,Re.lanes|=re,Ns|=re;de=ie.action,hr&&s(_,de),_=ie.hasEagerState?ie.eagerState:s(_,de)}else re={lane:de,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Z===null?(z=Z=re,k=_):Z=Z.next=re,Re.lanes|=de,Ns|=de;ie=ie.next}while(ie!==null&&ie!==t);if(Z===null?k=_:Z.next=z,!oi(_,e.memoizedState)&&(Ct=!0,le&&(s=Br,s!==null)))throw s;e.memoizedState=_,e.baseState=k,e.baseQueue=Z,n.lastRenderedState=_}return l===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function gc(e){var t=pt(),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 k=l=l.next;do _=e(_,k.action),k=k.next;while(k!==l);oi(_,t.memoizedState)||(Ct=!0),t.memoizedState=_,t.baseQueue===null&&(t.baseState=_),s.lastRenderedState=_}return[_,n]}function Rf(e,t,s){var n=Re,l=pt(),_=He;if(_){if(s===void 0)throw Error(o(407));s=s()}else s=t();var k=!oi((Ve||l).memoizedState,s);if(k&&(l.memoizedState=s,Ct=!0),l=l.queue,bc(Of.bind(null,n,l,e),[e]),l.getSnapshot!==t||k||bt!==null&&bt.memoizedState.tag&1){if(n.flags|=2048,Pr(9,{destroy:void 0},kf.bind(null,n,l,s,t),null),Je===null)throw Error(o(349));_||(ls&127)!==0||Df(n,t,s)}return s}function Df(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Re.updateQueue,t===null?(t=io(),Re.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function kf(e,t,s,n){t.value=s,t.getSnapshot=n,Mf(t)&&Lf(e)}function Of(e,t,s){return s(function(){Mf(t)&&Lf(e)})}function Mf(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!oi(e,s)}catch{return!0}}function Lf(e){var t=ir(e,2);t!==null&&ri(t,e,2)}function yc(e){var t=qt();if(typeof e=="function"){var s=e;if(e=s(),hr){Ot(!0);try{s()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t}function Nf(e,t,s,n){return e.baseState=s,vc(e,Ve,typeof n=="function"?n:cs)}function wg(e,t,s,n,l){if(oo(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(k){_.listeners.push(k)}};G.T!==null?s(!0):_.isTransition=!1,n(_),s=t.pending,s===null?(_.next=t.pending=_,Bf(t,_)):(_.next=s.next,t.pending=s.next=_)}}function Bf(e,t){var s=t.action,n=t.payload,l=e.state;if(t.isTransition){var _=G.T,k={};G.T=k;try{var z=s(l,n),Z=G.S;Z!==null&&Z(k,z),zf(e,t,z)}catch(ie){Sc(e,t,ie)}finally{_!==null&&k.types!==null&&(_.types=k.types),G.T=_}}else try{_=s(l,n),zf(e,t,_)}catch(ie){Sc(e,t,ie)}}function zf(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(n){jf(e,t,n)},function(n){return Sc(e,t,n)}):jf(e,t,s)}function jf(e,t,s){t.status="fulfilled",t.value=s,Hf(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Bf(e,s)))}function Sc(e,t,s){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=s,Hf(t),t=t.next;while(t!==n)}e.action=null}function Hf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Uf(e,t){return t}function If(e,t){if(He){var s=Je.formState;if(s!==null){e:{var n=Re;if(He){if(et){t:{for(var l=et,_=Ti;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){et=Ri(l.nextSibling),n=l.data==="F!";break e}}Es(n)}n=!1}n&&(t=s[0])}}return s=qt(),s.memoizedState=s.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uf,lastRenderedState:t},s.queue=n,s=nd.bind(null,Re,n),n.dispatch=s,n=yc(!1),_=Tc.bind(null,Re,!1,n.queue),n=qt(),l={state:t,dispatch:null,action:e,pending:null},n.queue=l,s=wg.bind(null,Re,l,_,s),l.dispatch=s,n.memoizedState=e,[t,s,!1]}function Pf(e){var t=pt();return $f(t,Ve,e)}function $f(e,t,s){if(t=vc(e,t,Uf)[0],e=ro(cs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Un(t)}catch(k){throw k===zr?Ya:k}else n=t;t=pt();var l=t.queue,_=l.dispatch;return s!==t.memoizedState&&(Re.flags|=2048,Pr(9,{destroy:void 0},Eg.bind(null,l,s),null)),[n,_,e]}function Eg(e,t){e.action=t}function Ff(e){var t=pt(),s=Ve;if(s!==null)return $f(t,s,e);pt(),t=t.memoizedState,s=pt();var n=s.queue.dispatch;return s.memoizedState=e,[t,n,!1]}function Pr(e,t,s,n){return e={tag:e,create:s,deps:n,inst:t,next:null},t=Re.updateQueue,t===null&&(t=io(),Re.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 Zf(){return pt().memoizedState}function no(e,t,s,n){var l=qt();Re.flags|=e,l.memoizedState=Pr(1|t,{destroy:void 0},s,n===void 0?null:n)}function ao(e,t,s,n){var l=pt();n=n===void 0?null:n;var _=l.memoizedState.inst;Ve!==null&&n!==null&&hc(n,Ve.memoizedState.deps)?l.memoizedState=Pr(t,_,s,n):(Re.flags|=e,l.memoizedState=Pr(1|t,_,s,n))}function qf(e,t){no(8390656,8,e,t)}function bc(e,t){ao(2048,8,e,t)}function Tg(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=io(),Re.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Gf(e){var t=pt().memoizedState;return Tg({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Wf(e,t){return ao(4,2,e,t)}function Yf(e,t){return ao(4,4,e,t)}function Vf(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 Kf(e,t,s){s=s!=null?s.concat([e]):null,ao(4,4,Vf.bind(null,t,e),s)}function Cc(){}function Xf(e,t){var s=pt();t=t===void 0?null:t;var n=s.memoizedState;return t!==null&&hc(t,n[1])?n[0]:(s.memoizedState=[e,t],e)}function Jf(e,t){var s=pt();t=t===void 0?null:t;var n=s.memoizedState;if(t!==null&&hc(t,n[1]))return n[0];if(n=e(),hr){Ot(!0);try{e()}finally{Ot(!1)}}return s.memoizedState=[n,t],n}function xc(e,t,s){return s===void 0||(ls&1073741824)!==0&&(Be&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Qd(),Re.lanes|=e,Ns|=e,s)}function Qf(e,t,s,n){return oi(s,t)?s:Hr.current!==null?(e=xc(e,s,n),oi(e,t)||(Ct=!0),e):(ls&42)===0||(ls&1073741824)!==0&&(Be&261930)===0?(Ct=!0,e.memoizedState=s):(e=Qd(),Re.lanes|=e,Ns|=e,t)}function ed(e,t,s,n,l){var _=K.p;K.p=_!==0&&8>_?_:8;var k=G.T,z={};G.T=z,Tc(e,!1,t,s);try{var Z=l(),ie=G.S;if(ie!==null&&ie(z,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var le=bg(Z,n);In(e,t,le,di(e))}else In(e,t,n,di(e))}catch(de){In(e,t,{then:function(){},status:"rejected",reason:de},di())}finally{K.p=_,k!==null&&z.types!==null&&(k.types=z.types),G.T=k}}function Ag(){}function wc(e,t,s,n){if(e.tag!==5)throw Error(o(476));var l=td(e).queue;ed(e,l,t,ee,s===null?Ag:function(){return id(e),s(n)})}function td(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:ee},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function id(e){var t=td(e);t.next===null&&(t=e.alternate.memoizedState),In(e,t.next.queue,{},di())}function Ec(){return Ht(sa)}function sd(){return pt().memoizedState}function rd(){return pt().memoizedState}function Rg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=di();e=Rs(s);var n=Ds(t,e,s);n!==null&&(ri(n,t,s),Bn(n,t,s)),t={cache:ec()},e.payload=t;return}t=t.return}}function Dg(e,t,s){var n=di();s={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},oo(e)?ad(t,s):(s=Fl(e,t,s,n),s!==null&&(ri(s,e,n),od(s,t,n)))}function nd(e,t,s){var n=di();In(e,t,s,n)}function In(e,t,s,n){var l={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(oo(e))ad(t,l);else{var _=e.alternate;if(e.lanes===0&&(_===null||_.lanes===0)&&(_=t.lastRenderedReducer,_!==null))try{var k=t.lastRenderedState,z=_(k,s);if(l.hasEagerState=!0,l.eagerState=z,oi(z,k))return Pa(e,t,l,0),Je===null&&Ia(),!1}catch{}finally{}if(s=Fl(e,t,l,n),s!==null)return ri(s,e,n),od(s,t,n),!0}return!1}function Tc(e,t,s,n){if(n={lane:2,revertLane:ru(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},oo(e)){if(t)throw Error(o(479))}else t=Fl(e,s,n,2),t!==null&&ri(t,e,2)}function oo(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function ad(e,t){Ur=eo=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function od(e,t,s){if((s&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,mn(e,s)}}var Pn={readContext:Ht,use:so,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};Pn.useEffectEvent=ut;var ld={readContext:Ht,use:so,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:qf,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,no(4194308,4,Vf.bind(null,t,e),s)},useLayoutEffect:function(e,t){return no(4194308,4,e,t)},useInsertionEffect:function(e,t){no(4,2,e,t)},useMemo:function(e,t){var s=qt();t=t===void 0?null:t;var n=e();if(hr){Ot(!0);try{e()}finally{Ot(!1)}}return s.memoizedState=[n,t],n},useReducer:function(e,t,s){var n=qt();if(s!==void 0){var l=s(t);if(hr){Ot(!0);try{s(t)}finally{Ot(!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=Dg.bind(null,Re,e),[n.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,s=nd.bind(null,Re,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Cc,useDeferredValue:function(e,t){var s=qt();return xc(s,e,t)},useTransition:function(){var e=yc(!1);return e=ed.bind(null,Re,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var n=Re,l=qt();if(He){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),Je===null)throw Error(o(349));(Be&127)!==0||Df(n,t,s)}l.memoizedState=s;var _={value:s,getSnapshot:t};return l.queue=_,qf(Of.bind(null,n,_,e),[e]),n.flags|=2048,Pr(9,{destroy:void 0},kf.bind(null,n,_,s,t),null),s},useId:function(){var e=qt(),t=Je.identifierPrefix;if(He){var s=Fi,n=$i;s=(n&~(1<<32-gt(n)-1)).toString(32)+s,t="_"+t+"R_"+s,s=to++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=Cg++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ec,useFormState:If,useActionState:If,useOptimistic:function(e){var t=qt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Tc.bind(null,Re,!0,s),s.dispatch=t,[e,t]},useMemoCache:pc,useCacheRefresh:function(){return qt().memoizedState=Rg.bind(null,Re)},useEffectEvent:function(e){var t=qt(),s={impl:e};return t.memoizedState=s,function(){if((Fe&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Ac={readContext:Ht,use:so,useCallback:Xf,useContext:Ht,useEffect:bc,useImperativeHandle:Kf,useInsertionEffect:Wf,useLayoutEffect:Yf,useMemo:Jf,useReducer:ro,useRef:Zf,useState:function(){return ro(cs)},useDebugValue:Cc,useDeferredValue:function(e,t){var s=pt();return Qf(s,Ve.memoizedState,e,t)},useTransition:function(){var e=ro(cs)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:Un(e),t]},useSyncExternalStore:Rf,useId:sd,useHostTransitionStatus:Ec,useFormState:Pf,useActionState:Pf,useOptimistic:function(e,t){var s=pt();return Nf(s,Ve,e,t)},useMemoCache:pc,useCacheRefresh:rd};Ac.useEffectEvent=Gf;var cd={readContext:Ht,use:so,useCallback:Xf,useContext:Ht,useEffect:bc,useImperativeHandle:Kf,useInsertionEffect:Wf,useLayoutEffect:Yf,useMemo:Jf,useReducer:gc,useRef:Zf,useState:function(){return gc(cs)},useDebugValue:Cc,useDeferredValue:function(e,t){var s=pt();return Ve===null?xc(s,e,t):Qf(s,Ve.memoizedState,e,t)},useTransition:function(){var e=gc(cs)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:Un(e),t]},useSyncExternalStore:Rf,useId:sd,useHostTransitionStatus:Ec,useFormState:Ff,useActionState:Ff,useOptimistic:function(e,t){var s=pt();return Ve!==null?Nf(s,Ve,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:pc,useCacheRefresh:rd};cd.useEffectEvent=Gf;function Rc(e,t,s,n){t=e.memoizedState,s=s(n,t),s=s==null?t:m({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Dc={enqueueSetState:function(e,t,s){e=e._reactInternals;var n=di(),l=Rs(n);l.payload=t,s!=null&&(l.callback=s),t=Ds(e,l,n),t!==null&&(ri(t,e,n),Bn(t,e,n))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var n=di(),l=Rs(n);l.tag=1,l.payload=t,s!=null&&(l.callback=s),t=Ds(e,l,n),t!==null&&(ri(t,e,n),Bn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=di(),n=Rs(s);n.tag=2,t!=null&&(n.callback=t),t=Ds(e,n,s),t!==null&&(ri(t,e,s),Bn(t,e,s))}};function ud(e,t,s,n,l,_,k){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,_,k):t.prototype&&t.prototype.isPureReactComponent?!An(s,n)||!An(l,_):!0}function hd(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&&Dc.enqueueReplaceState(t,t.state,null)}function fr(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=m({},s));for(var l in e)s[l]===void 0&&(s[l]=e[l])}return s}function fd(e){Ua(e)}function dd(e){console.error(e)}function _d(e){Ua(e)}function lo(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function md(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 kc(e,t,s){return s=Rs(s),s.tag=3,s.payload={element:null},s.callback=function(){lo(e,t)},s}function pd(e){return e=Rs(e),e.tag=3,e}function vd(e,t,s,n){var l=s.type.getDerivedStateFromError;if(typeof l=="function"){var _=n.value;e.payload=function(){return l(_)},e.callback=function(){md(t,s,n)}}var k=s.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(e.callback=function(){md(t,s,n),typeof l!="function"&&(Bs===null?Bs=new Set([this]):Bs.add(this));var z=n.stack;this.componentDidCatch(n.value,{componentStack:z!==null?z:""})})}function kg(e,t,s,n,l){if(s.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=s.alternate,t!==null&&Lr(t,s,l,!0),s=ci.current,s!==null){switch(s.tag){case 31:case 13:return Ai===null?bo():s.alternate===null&&ht===0&&(ht=3),s.flags&=-257,s.flags|=65536,s.lanes=l,n===Va?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([n]):t.add(n),tu(e,n,l)),!1;case 22:return s.flags|=65536,n===Va?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)),tu(e,n,l)),!1}throw Error(o(435,s.tag))}return tu(e,n,l),bo(),!1}if(He)return t=ci.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,n!==Vl&&(e=Error(o(422),{cause:n}),kn(xi(e,s)))):(n!==Vl&&(t=Error(o(423),{cause:n}),kn(xi(t,s))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,n=xi(n,s),l=kc(e.stateNode,n,l),ac(e,l),ht!==4&&(ht=2)),!1;var _=Error(o(520),{cause:n});if(_=xi(_,s),Vn===null?Vn=[_]:Vn.push(_),ht!==4&&(ht=2),t===null)return!0;n=xi(n,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=l&-l,s.lanes|=e,e=kc(s.stateNode,n,e),ac(s,e),!1;case 1:if(t=s.type,_=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Bs===null||!Bs.has(_))))return s.flags|=65536,l&=-l,s.lanes|=l,l=pd(l),vd(l,e,s,n),ac(s,l),!1}s=s.return}while(s!==null);return!1}var Oc=Error(o(461)),Ct=!1;function Ut(e,t,s,n){t.child=e===null?bf(t,null,s,n):ur(t,e.child,s,n)}function gd(e,t,s,n,l){s=s.render;var _=t.ref;if("ref"in n){var k={};for(var z in n)z!=="ref"&&(k[z]=n[z])}else k=n;return ar(t),n=fc(e,t,s,k,_,l),z=dc(),e!==null&&!Ct?(_c(e,t,l),us(e,t,l)):(He&&z&&Wl(t),t.flags|=1,Ut(e,t,n,l),t.child)}function yd(e,t,s,n,l){if(e===null){var _=s.type;return typeof _=="function"&&!Zl(_)&&_.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=_,Sd(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,!Uc(e,l)){var k=_.memoizedProps;if(s=s.compare,s=s!==null?s:An,s(k,n)&&e.ref===t.ref)return us(e,t,l)}return t.flags|=1,e=rs(_,n),e.ref=t.ref,e.return=t,t.child=e}function Sd(e,t,s,n,l){if(e!==null){var _=e.memoizedProps;if(An(_,n)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=n=_,Uc(e,l))(e.flags&131072)!==0&&(Ct=!0);else return t.lanes=e.lanes,us(e,t,l)}return Mc(e,t,s,n,l)}function bd(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 Cd(e,t,_,s,n)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wa(t,_!==null?_.cachePool:null),_!==null?wf(t,_):lc(),Ef(t);else return n=t.lanes=536870912,Cd(e,t,_!==null?_.baseLanes|s:s,s,n)}else _!==null?(Wa(t,_.cachePool),wf(t,_),Os(),t.memoizedState=null):(e!==null&&Wa(t,null),lc(),Os());return Ut(e,t,l,s),t.child}function $n(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Cd(e,t,s,n,l){var _=ic();return _=_===null?null:{parent:St._currentValue,pool:_},t.memoizedState={baseLanes:s,cachePool:_},e!==null&&Wa(t,null),lc(),Ef(t),e!==null&&Lr(e,t,n,!0),t.childLanes=l,null}function co(e,t){return t=ho({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function xd(e,t,s){return ur(t,e.child,null,s),e=co(t,t.pendingProps),e.flags|=2,ui(t),t.memoizedState=null,e}function Og(e,t,s){var n=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(n.mode==="hidden")return e=co(t,n),t.lanes=536870912,$n(null,e);if(uc(t),(e=et)?(e=B_(e,Ti),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xs!==null?{id:$i,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},s=af(e),s.return=t,t.child=s,jt=t,et=null)):e=null,e===null)throw Es(t);return t.lanes=536870912,null}return co(t,n)}var _=e.memoizedState;if(_!==null){var k=_.dehydrated;if(uc(t),l)if(t.flags&256)t.flags&=-257,t=xd(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ct||Lr(e,t,s,!1),l=(s&e.childLanes)!==0,Ct||l){if(n=Je,n!==null&&(k=Ea(n,s),k!==0&&k!==_.retryLane))throw _.retryLane=k,ir(e,k),ri(n,e,k),Oc;bo(),t=xd(e,t,s)}else e=_.treeContext,et=Ri(k.nextSibling),jt=t,He=!0,ws=null,Ti=!1,e!==null&&cf(t,e),t=co(t,n),t.flags|=4096;return t}return e=rs(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uo(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 Mc(e,t,s,n,l){return ar(t),s=fc(e,t,s,n,void 0,l),n=dc(),e!==null&&!Ct?(_c(e,t,l),us(e,t,l)):(He&&n&&Wl(t),t.flags|=1,Ut(e,t,s,l),t.child)}function wd(e,t,s,n,l,_){return ar(t),t.updateQueue=null,s=Af(t,n,s,l),Tf(e),n=dc(),e!==null&&!Ct?(_c(e,t,_),us(e,t,_)):(He&&n&&Wl(t),t.flags|=1,Ut(e,t,s,_),t.child)}function Ed(e,t,s,n,l){if(ar(t),t.stateNode===null){var _=Dr,k=s.contextType;typeof k=="object"&&k!==null&&(_=Ht(k)),_=new s(n,_),t.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Dc,t.stateNode=_,_._reactInternals=t,_=t.stateNode,_.props=n,_.state=t.memoizedState,_.refs={},rc(t),k=s.contextType,_.context=typeof k=="object"&&k!==null?Ht(k):Dr,_.state=t.memoizedState,k=s.getDerivedStateFromProps,typeof k=="function"&&(Rc(t,s,k,n),_.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(k=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),k!==_.state&&Dc.enqueueReplaceState(_,_.state,null),jn(t,n,_,l),zn(),_.state=t.memoizedState),typeof _.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){_=t.stateNode;var z=t.memoizedProps,Z=fr(s,z);_.props=Z;var ie=_.context,le=s.contextType;k=Dr,typeof le=="object"&&le!==null&&(k=Ht(le));var de=s.getDerivedStateFromProps;le=typeof de=="function"||typeof _.getSnapshotBeforeUpdate=="function",z=t.pendingProps!==z,le||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(z||ie!==k)&&hd(t,_,n,k),As=!1;var re=t.memoizedState;_.state=re,jn(t,n,_,l),zn(),ie=t.memoizedState,z||re!==ie||As?(typeof de=="function"&&(Rc(t,s,de,n),ie=t.memoizedState),(Z=As||ud(t,s,Z,n,re,ie,k))?(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=k,n=Z):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{_=t.stateNode,nc(e,t),k=t.memoizedProps,le=fr(s,k),_.props=le,de=t.pendingProps,re=_.context,ie=s.contextType,Z=Dr,typeof ie=="object"&&ie!==null&&(Z=Ht(ie)),z=s.getDerivedStateFromProps,(ie=typeof z=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(k!==de||re!==Z)&&hd(t,_,n,Z),As=!1,re=t.memoizedState,_.state=re,jn(t,n,_,l),zn();var ae=t.memoizedState;k!==de||re!==ae||As||e!==null&&e.dependencies!==null&&qa(e.dependencies)?(typeof z=="function"&&(Rc(t,s,z,n),ae=t.memoizedState),(le=As||ud(t,s,le,n,re,ae,Z)||e!==null&&e.dependencies!==null&&qa(e.dependencies))?(ie||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(n,ae,Z),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(n,ae,Z)),typeof _.componentDidUpdate=="function"&&(t.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof _.componentDidUpdate!="function"||k===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||k===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=ae),_.props=n,_.state=ae,_.context=Z,n=le):(typeof _.componentDidUpdate!="function"||k===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||k===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),n=!1)}return _=n,uo(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=ur(t,e.child,null,l),t.child=ur(t,null,s,l)):Ut(e,t,s,l),t.memoizedState=_.state,e=t.child):e=us(e,t,l),e}function Td(e,t,s,n){return rr(),t.flags|=256,Ut(e,t,s,n),t.child}var Lc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nc(e){return{baseLanes:e,cachePool:mf()}}function Bc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=fi),e}function Ad(e,t,s){var n=t.pendingProps,l=!1,_=(t.flags&128)!==0,k;if((k=_)||(k=e!==null&&e.memoizedState===null?!1:(mt.current&2)!==0),k&&(l=!0,t.flags&=-129),k=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(l?ks(t):Os(),(e=et)?(e=B_(e,Ti),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xs!==null?{id:$i,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},s=af(e),s.return=t,t.child=s,jt=t,et=null)):e=null,e===null)throw Es(t);return vu(e)?t.lanes=32:t.lanes=536870912,null}var z=n.children;return n=n.fallback,l?(Os(),l=t.mode,z=ho({mode:"hidden",children:z},l),n=sr(n,l,s,null),z.return=t,n.return=t,z.sibling=n,t.child=z,n=t.child,n.memoizedState=Nc(s),n.childLanes=Bc(e,k,s),t.memoizedState=Lc,$n(null,n)):(ks(t),zc(t,z))}var Z=e.memoizedState;if(Z!==null&&(z=Z.dehydrated,z!==null)){if(_)t.flags&256?(ks(t),t.flags&=-257,t=jc(e,t,s)):t.memoizedState!==null?(Os(),t.child=e.child,t.flags|=128,t=null):(Os(),z=n.fallback,l=t.mode,n=ho({mode:"visible",children:n.children},l),z=sr(z,l,s,null),z.flags|=2,n.return=t,z.return=t,n.sibling=z,t.child=n,ur(t,e.child,null,s),n=t.child,n.memoizedState=Nc(s),n.childLanes=Bc(e,k,s),t.memoizedState=Lc,t=$n(null,n));else if(ks(t),vu(z)){if(k=z.nextSibling&&z.nextSibling.dataset,k)var ie=k.dgst;k=ie,n=Error(o(419)),n.stack="",n.digest=k,kn({value:n,source:null,stack:null}),t=jc(e,t,s)}else if(Ct||Lr(e,t,s,!1),k=(s&e.childLanes)!==0,Ct||k){if(k=Je,k!==null&&(n=Ea(k,s),n!==0&&n!==Z.retryLane))throw Z.retryLane=n,ir(e,n),ri(k,e,n),Oc;pu(z)||bo(),t=jc(e,t,s)}else pu(z)?(t.flags|=192,t.child=e.child,t=null):(e=Z.treeContext,et=Ri(z.nextSibling),jt=t,He=!0,ws=null,Ti=!1,e!==null&&cf(t,e),t=zc(t,n.children),t.flags|=4096);return t}return l?(Os(),z=n.fallback,l=t.mode,Z=e.child,ie=Z.sibling,n=rs(Z,{mode:"hidden",children:n.children}),n.subtreeFlags=Z.subtreeFlags&65011712,ie!==null?z=rs(ie,z):(z=sr(z,l,s,null),z.flags|=2),z.return=t,n.return=t,n.sibling=z,t.child=n,$n(null,n),n=t.child,z=e.child.memoizedState,z===null?z=Nc(s):(l=z.cachePool,l!==null?(Z=St._currentValue,l=l.parent!==Z?{parent:Z,pool:Z}:l):l=mf(),z={baseLanes:z.baseLanes|s,cachePool:l}),n.memoizedState=z,n.childLanes=Bc(e,k,s),t.memoizedState=Lc,$n(e.child,n)):(ks(t),s=e.child,e=s.sibling,s=rs(s,{mode:"visible",children:n.children}),s.return=t,s.sibling=null,e!==null&&(k=t.deletions,k===null?(t.deletions=[e],t.flags|=16):k.push(e)),t.child=s,t.memoizedState=null,s)}function zc(e,t){return t=ho({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ho(e,t){return e=li(22,e,null,t),e.lanes=0,e}function jc(e,t,s){return ur(t,e.child,null,s),e=zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rd(e,t,s){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Jl(e.return,t,s)}function Hc(e,t,s,n,l,_){var k=e.memoizedState;k===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:l,treeForkCount:_}:(k.isBackwards=t,k.rendering=null,k.renderingStartTime=0,k.last=n,k.tail=s,k.tailMode=l,k.treeForkCount=_)}function Dd(e,t,s){var n=t.pendingProps,l=n.revealOrder,_=n.tail;n=n.children;var k=mt.current,z=(k&2)!==0;if(z?(k=k&1|2,t.flags|=128):k&=1,X(mt,k),Ut(e,t,n,s),n=He?Dn:0,!z&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rd(e,s,t);else if(e.tag===19)Rd(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&&Qa(e)===null&&(l=s),s=s.sibling;s=l,s===null?(l=t.child,t.child=null):(l=s.sibling,s.sibling=null),Hc(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&&Qa(e)===null){t.child=l;break}e=l.sibling,l.sibling=s,s=l,l=e}Hc(t,!0,s,null,_,n);break;case"together":Hc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function us(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ns|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Lr(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=rs(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=rs(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Uc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&qa(e)))}function Mg(e,t,s){switch(t.tag){case 3:j(t,t.stateNode.containerInfo),Ts(t,St,e.memoizedState.cache),rr();break;case 27:case 5:oe(t);break;case 4:j(t,t.stateNode.containerInfo);break;case 10:Ts(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,uc(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(ks(t),t.flags|=128,null):(s&t.child.childLanes)!==0?Ad(e,t,s):(ks(t),e=us(e,t,s),e!==null?e.sibling:null);ks(t);break;case 19:var l=(e.flags&128)!==0;if(n=(s&t.childLanes)!==0,n||(Lr(e,t,s,!1),n=(s&t.childLanes)!==0),l){if(n)return Dd(e,t,s);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),X(mt,mt.current),n)break;return null;case 22:return t.lanes=0,bd(e,t,s,t.pendingProps);case 24:Ts(t,St,e.memoizedState.cache)}return us(e,t,s)}function kd(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ct=!0;else{if(!Uc(e,s)&&(t.flags&128)===0)return Ct=!1,Mg(e,t,s);Ct=(e.flags&131072)!==0}else Ct=!1,He&&(t.flags&1048576)!==0&&lf(t,Dn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=lr(t.elementType),t.type=e,typeof e=="function")Zl(e)?(n=fr(e,n),t.tag=1,t=Ed(null,t,e,n,s)):(t.tag=0,t=Mc(null,t,e,n,s));else{if(e!=null){var l=e.$$typeof;if(l===S){t.tag=11,t=gd(null,t,e,n,s);break e}else if(l===M){t.tag=14,t=yd(null,t,e,n,s);break e}}throw t=Q(e)||e,Error(o(306,t,""))}}return t;case 0:return Mc(e,t,t.type,t.pendingProps,s);case 1:return n=t.type,l=fr(n,t.pendingProps),Ed(e,t,n,l,s);case 3:e:{if(j(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var _=t.memoizedState;l=_.element,nc(e,t),jn(t,n,null,s);var k=t.memoizedState;if(n=k.cache,Ts(t,St,n),n!==_.cache&&Ql(t,[St],s,!0),zn(),n=k.element,_.isDehydrated)if(_={element:n,isDehydrated:!1,cache:k.cache},t.updateQueue.baseState=_,t.memoizedState=_,t.flags&256){t=Td(e,t,n,s);break e}else if(n!==l){l=xi(Error(o(424)),t),kn(l),t=Td(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(et=Ri(e.firstChild),jt=t,He=!0,ws=null,Ti=!0,s=bf(t,null,n,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(rr(),n===l){t=us(e,t,s);break e}Ut(e,t,n,s)}t=t.child}return t;case 26:return uo(e,t),e===null?(s=P_(t.type,null,t.pendingProps,null))?t.memoizedState=s:He||(s=t.type,e=t.pendingProps,n=Ro(me.current).createElement(s),n[yt]=t,n[it]=e,It(n,s,e),ke(n),t.stateNode=n):t.memoizedState=P_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&He&&(n=t.stateNode=H_(t.type,t.pendingProps,me.current),jt=t,Ti=!0,l=et,Us(t.type)?(gu=l,et=Ri(n.firstChild)):et=l),Ut(e,t,t.pendingProps.children,s),uo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((l=n=et)&&(n=l0(n,t.type,t.pendingProps,Ti),n!==null?(t.stateNode=n,jt=t,et=Ri(n.firstChild),Ti=!1,l=!0):l=!1),l||Es(t)),oe(t),l=t.type,_=t.pendingProps,k=e!==null?e.memoizedProps:null,n=_.children,du(l,_)?n=null:k!==null&&du(l,k)&&(t.flags|=32),t.memoizedState!==null&&(l=fc(e,t,xg,null,null,s),sa._currentValue=l),uo(e,t),Ut(e,t,n,s),t.child;case 6:return e===null&&He&&((e=s=et)&&(s=c0(s,t.pendingProps,Ti),s!==null?(t.stateNode=s,jt=t,et=null,e=!0):e=!1),e||Es(t)),null;case 13:return Ad(e,t,s);case 4:return j(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ur(t,null,n,s):Ut(e,t,n,s),t.child;case 11:return gd(e,t,t.type,t.pendingProps,s);case 7:return Ut(e,t,t.pendingProps,s),t.child;case 8:return Ut(e,t,t.pendingProps.children,s),t.child;case 12:return Ut(e,t,t.pendingProps.children,s),t.child;case 10:return n=t.pendingProps,Ts(t,t.type,n.value),Ut(e,t,n.children,s),t.child;case 9:return l=t.type._context,n=t.pendingProps.children,ar(t),l=Ht(l),n=n(l),t.flags|=1,Ut(e,t,n,s),t.child;case 14:return yd(e,t,t.type,t.pendingProps,s);case 15:return Sd(e,t,t.type,t.pendingProps,s);case 19:return Dd(e,t,s);case 31:return Og(e,t,s);case 22:return bd(e,t,s,t.pendingProps);case 24:return ar(t),n=Ht(St),e===null?(l=ic(),l===null&&(l=Je,_=ec(),l.pooledCache=_,_.refCount++,_!==null&&(l.pooledCacheLanes|=s),l=_),t.memoizedState={parent:n,cache:l},rc(t),Ts(t,St,l)):((e.lanes&s)!==0&&(nc(e,t),jn(t,null,null,s),zn()),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),Ts(t,St,n)):(n=_.cache,Ts(t,St,n),n!==l.cache&&Ql(t,[St],s,!0))),Ut(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function hs(e){e.flags|=4}function Ic(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(s_())e.flags|=8192;else throw cr=Va,sc}else e.flags&=-16777217}function Od(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!G_(t))if(s_())e.flags|=8192;else throw cr=Va,sc}function fo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Qi():536870912,e.lanes|=t,qr|=t)}function Fn(e,t){if(!He)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 tt(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 Lg(e,t,s){var n=t.pendingProps;switch(Yl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:return s=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),os(St),ce(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Mr(t)?hs(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Kl())),tt(t),null;case 26:var l=t.type,_=t.memoizedState;return e===null?(hs(t),_!==null?(tt(t),Od(t,_)):(tt(t),Ic(t,l,null,n,s))):_?_!==e.memoizedState?(hs(t),tt(t),Od(t,_)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&hs(t),tt(t),Ic(t,l,e,n,s)),null;case 27:if(ve(t),s=me.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&hs(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return tt(t),null}e=ne.current,Mr(t)?uf(t):(e=H_(l,n,s),t.stateNode=e,hs(t))}return tt(t),null;case 5:if(ve(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&hs(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return tt(t),null}if(_=ne.current,Mr(t))uf(t);else{var k=Ro(me.current);switch(_){case 1:_=k.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:_=k.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":_=k.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":_=k.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":_=k.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof n.is=="string"?k.createElement("select",{is:n.is}):k.createElement("select"),n.multiple?_.multiple=!0:n.size&&(_.size=n.size);break;default:_=typeof n.is=="string"?k.createElement(l,{is:n.is}):k.createElement(l)}}_[yt]=t,_[it]=n;e:for(k=t.child;k!==null;){if(k.tag===5||k.tag===6)_.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===t)break e;for(;k.sibling===null;){if(k.return===null||k.return===t)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}t.stateNode=_;e:switch(It(_,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&&hs(t)}}return tt(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&hs(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=me.current,Mr(t)){if(e=t.stateNode,s=t.memoizedProps,n=null,l=jt,l!==null)switch(l.tag){case 27:case 5:n=l.memoizedProps}e[yt]=t,e=!!(e.nodeValue===s||n!==null&&n.suppressHydrationWarning===!0||A_(e.nodeValue,s)),e||Es(t,!0)}else e=Ro(e).createTextNode(n),e[yt]=t,t.stateNode=e}return tt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(n=Mr(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[yt]=t}else rr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else s=Kl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(ui(t),t):(ui(t),null);if((t.flags&128)!==0)throw Error(o(558))}return tt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Mr(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[yt]=t}else rr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),l=!1}else l=Kl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(ui(t),t):(ui(t),null)}return ui(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),fo(t,t.updateQueue),tt(t),null);case 4:return ce(),e===null&&lu(t.stateNode.containerInfo),tt(t),null;case 10:return os(t.type),tt(t),null;case 19:if(H(mt),n=t.memoizedState,n===null)return tt(t),null;if(l=(t.flags&128)!==0,_=n.rendering,_===null)if(l)Fn(n,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(_=Qa(e),_!==null){for(t.flags|=128,Fn(n,!1),e=_.updateQueue,t.updateQueue=e,fo(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)nf(s,e),s=s.sibling;return X(mt,mt.current&1|2),He&&ns(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&nt()>go&&(t.flags|=128,l=!0,Fn(n,!1),t.lanes=4194304)}else{if(!l)if(e=Qa(_),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,fo(t,e),Fn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!_.alternate&&!He)return tt(t),null}else 2*nt()-n.renderingStartTime>go&&s!==536870912&&(t.flags|=128,l=!0,Fn(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=nt(),e.sibling=null,s=mt.current,X(mt,l?s&1|2:s&1),He&&ns(t,n.treeForkCount),e):(tt(t),null);case 22:case 23:return ui(t),cc(),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&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),s=t.updateQueue,s!==null&&fo(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&&H(or),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),os(St),tt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Ng(e,t){switch(Yl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(St),ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(ui(t),t.alternate===null)throw Error(o(340));rr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ui(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));rr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(mt),null;case 4:return ce(),null;case 10:return os(t.type),null;case 22:case 23:return ui(t),cc(),e!==null&&H(or),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return os(St),null;case 25:return null;default:return null}}function Md(e,t){switch(Yl(t),t.tag){case 3:os(St),ce();break;case 26:case 27:case 5:ve(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&ui(t);break;case 13:ui(t);break;case 19:H(mt);break;case 10:os(t.type);break;case 22:case 23:ui(t),cc(),e!==null&&H(or);break;case 24:os(St)}}function Zn(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,k=s.inst;n=_(),k.destroy=n}s=s.next}while(s!==l)}}catch(z){Ge(t,t.return,z)}}function Ms(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 k=n.inst,z=k.destroy;if(z!==void 0){k.destroy=void 0,l=t;var Z=s,ie=z;try{ie()}catch(le){Ge(l,Z,le)}}}n=n.next}while(n!==_)}}catch(le){Ge(t,t.return,le)}}function Ld(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{xf(t,s)}catch(n){Ge(e,e.return,n)}}}function Nd(e,t,s){s.props=fr(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(n){Ge(e,t,n)}}function qn(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){Ge(e,t,l)}}function Zi(e,t){var s=e.ref,n=e.refCleanup;if(s!==null)if(typeof n=="function")try{n()}catch(l){Ge(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){Ge(e,t,l)}else s.current=null}function Bd(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){Ge(e,e.return,l)}}function Pc(e,t,s){try{var n=e.stateNode;i0(n,e.type,s,t),n[it]=t}catch(l){Ge(e,e.return,l)}}function zd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Us(e.type)||e.tag===4}function $c(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zd(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&&Us(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 Fc(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=is));else if(n!==4&&(n===27&&Us(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Fc(e,t,s),e=e.sibling;e!==null;)Fc(e,t,s),e=e.sibling}function _o(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&&Us(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(_o(e,t,s),e=e.sibling;e!==null;)_o(e,t,s),e=e.sibling}function jd(e){var t=e.stateNode,s=e.memoizedProps;try{for(var n=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);It(t,n,s),t[yt]=e,t[it]=s}catch(_){Ge(e,e.return,_)}}var fs=!1,xt=!1,Zc=!1,Hd=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function Bg(e,t){if(e=e.containerInfo,hu=Bo,e=Vh(e),jl(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 k=0,z=-1,Z=-1,ie=0,le=0,de=e,re=null;t:for(;;){for(var ae;de!==s||l!==0&&de.nodeType!==3||(z=k+l),de!==_||n!==0&&de.nodeType!==3||(Z=k+n),de.nodeType===3&&(k+=de.nodeValue.length),(ae=de.firstChild)!==null;)re=de,de=ae;for(;;){if(de===e)break t;if(re===s&&++ie===l&&(z=k),re===_&&++le===n&&(Z=k),(ae=de.nextSibling)!==null)break;de=re,re=de.parentNode}de=ae}s=z===-1||Z===-1?null:{start:z,end:Z}}else s=null}s=s||{start:0,end:0}}else s=null;for(fu={focusedElem:e,selectionRange:s},Bo=!1,Mt=t;Mt!==null;)if(t=Mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Mt=e;else for(;Mt!==null;){switch(t=Mt,_=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 ye=fr(s.type,l);e=n.getSnapshotBeforeUpdate(ye,_),n.__reactInternalSnapshotBeforeUpdate=e}catch(we){Ge(s,s.return,we)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)mu(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mu(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,Mt=e;break}Mt=t.return}}function Ud(e,t,s){var n=s.flags;switch(s.tag){case 0:case 11:case 15:_s(e,s),n&4&&Zn(5,s);break;case 1:if(_s(e,s),n&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(k){Ge(s,s.return,k)}else{var l=fr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(k){Ge(s,s.return,k)}}n&64&&Ld(s),n&512&&qn(s,s.return);break;case 3:if(_s(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{xf(e,t)}catch(k){Ge(s,s.return,k)}}break;case 27:t===null&&n&4&&jd(s);case 26:case 5:_s(e,s),t===null&&n&4&&Bd(s),n&512&&qn(s,s.return);break;case 12:_s(e,s);break;case 31:_s(e,s),n&4&&$d(e,s);break;case 13:_s(e,s),n&4&&Fd(e,s),n&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Zg.bind(null,s),u0(e,s))));break;case 22:if(n=s.memoizedState!==null||fs,!n){t=t!==null&&t.memoizedState!==null||xt,l=fs;var _=xt;fs=n,(xt=t)&&!_?ms(e,s,(s.subtreeFlags&8772)!==0):_s(e,s),fs=l,xt=_}break;case 30:break;default:_s(e,s)}}function Id(e){var t=e.alternate;t!==null&&(e.alternate=null,Id(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&W(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 st=null,ei=!1;function ds(e,t,s){for(s=s.child;s!==null;)Pd(e,t,s),s=s.sibling}function Pd(e,t,s){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(vi,s)}catch{}switch(s.tag){case 26:xt||Zi(s,t),ds(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:xt||Zi(s,t);var n=st,l=ei;Us(s.type)&&(st=s.stateNode,ei=!1),ds(e,t,s),ea(s.stateNode),st=n,ei=l;break;case 5:xt||Zi(s,t);case 6:if(n=st,l=ei,st=null,ds(e,t,s),st=n,ei=l,st!==null)if(ei)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(s.stateNode)}catch(_){Ge(s,t,_)}else try{st.removeChild(s.stateNode)}catch(_){Ge(s,t,_)}break;case 18:st!==null&&(ei?(e=st,L_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Qr(e)):L_(st,s.stateNode));break;case 4:n=st,l=ei,st=s.stateNode.containerInfo,ei=!0,ds(e,t,s),st=n,ei=l;break;case 0:case 11:case 14:case 15:Ms(2,s,t),xt||Ms(4,s,t),ds(e,t,s);break;case 1:xt||(Zi(s,t),n=s.stateNode,typeof n.componentWillUnmount=="function"&&Nd(s,t,n)),ds(e,t,s);break;case 21:ds(e,t,s);break;case 22:xt=(n=xt)||s.memoizedState!==null,ds(e,t,s),xt=n;break;default:ds(e,t,s)}}function $d(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qr(e)}catch(s){Ge(t,t.return,s)}}}function Fd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qr(e)}catch(s){Ge(t,t.return,s)}}function zg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Hd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Hd),t;default:throw Error(o(435,e.tag))}}function mo(e,t){var s=zg(e);t.forEach(function(n){if(!s.has(n)){s.add(n);var l=qg.bind(null,e,n);n.then(l,l)}})}function ti(e,t){var s=t.deletions;if(s!==null)for(var n=0;n<s.length;n++){var l=s[n],_=e,k=t,z=k;e:for(;z!==null;){switch(z.tag){case 27:if(Us(z.type)){st=z.stateNode,ei=!1;break e}break;case 5:st=z.stateNode,ei=!1;break e;case 3:case 4:st=z.stateNode.containerInfo,ei=!0;break e}z=z.return}if(st===null)throw Error(o(160));Pd(_,k,l),st=null,ei=!1,_=l.alternate,_!==null&&(_.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Zd(t,e),t=t.sibling}var zi=null;function Zd(e,t){var s=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ti(t,e),ii(e),n&4&&(Ms(3,e,e.return),Zn(3,e),Ms(5,e,e.return));break;case 1:ti(t,e),ii(e),n&512&&(xt||s===null||Zi(s,s.return)),n&64&&fs&&(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=zi;if(ti(t,e),ii(e),n&512&&(xt||s===null||Zi(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],(!_||_[Se]||_[yt]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=l.createElement(n),l.head.insertBefore(_,l.querySelector("head > title"))),It(_,n,s),_[yt]=e,ke(_),n=_;break e;case"link":var k=Z_("link","href",l).get(n+(s.href||""));if(k){for(var z=0;z<k.length;z++)if(_=k[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)){k.splice(z,1);break t}}_=l.createElement(n),It(_,n,s),l.head.appendChild(_);break;case"meta":if(k=Z_("meta","content",l).get(n+(s.content||""))){for(z=0;z<k.length;z++)if(_=k[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)){k.splice(z,1);break t}}_=l.createElement(n),It(_,n,s),l.head.appendChild(_);break;default:throw Error(o(468,n))}_[yt]=e,ke(_),n=_}e.stateNode=n}else q_(l,e.type,e.stateNode);else e.stateNode=F_(l,n,e.memoizedProps);else _!==n?(_===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):_.count--,n===null?q_(l,e.type,e.stateNode):F_(l,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Pc(e,e.memoizedProps,s.memoizedProps)}break;case 27:ti(t,e),ii(e),n&512&&(xt||s===null||Zi(s,s.return)),s!==null&&n&4&&Pc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(ti(t,e),ii(e),n&512&&(xt||s===null||Zi(s,s.return)),e.flags&32){l=e.stateNode;try{Cr(l,"")}catch(ye){Ge(e,e.return,ye)}}n&4&&e.stateNode!=null&&(l=e.memoizedProps,Pc(e,l,s!==null?s.memoizedProps:l)),n&1024&&(Zc=!0);break;case 6:if(ti(t,e),ii(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,s=e.stateNode;try{s.nodeValue=n}catch(ye){Ge(e,e.return,ye)}}break;case 3:if(Oo=null,l=zi,zi=Do(t.containerInfo),ti(t,e),zi=l,ii(e),n&4&&s!==null&&s.memoizedState.isDehydrated)try{Qr(t.containerInfo)}catch(ye){Ge(e,e.return,ye)}Zc&&(Zc=!1,qd(e));break;case 4:n=zi,zi=Do(e.stateNode.containerInfo),ti(t,e),ii(e),zi=n;break;case 12:ti(t,e),ii(e);break;case 31:ti(t,e),ii(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,mo(e,n)));break;case 13:ti(t,e),ii(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(vo=nt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,mo(e,n)));break;case 22:l=e.memoizedState!==null;var Z=s!==null&&s.memoizedState!==null,ie=fs,le=xt;if(fs=ie||l,xt=le||Z,ti(t,e),xt=le,fs=ie,ii(e),n&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(s===null||Z||fs||xt||dr(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){Z=s=t;try{if(_=Z.stateNode,l)k=_.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{z=Z.stateNode;var de=Z.memoizedProps.style,re=de!=null&&de.hasOwnProperty("display")?de.display:null;z.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(ye){Ge(Z,Z.return,ye)}}}else if(t.tag===6){if(s===null){Z=t;try{Z.stateNode.nodeValue=l?"":Z.memoizedProps}catch(ye){Ge(Z,Z.return,ye)}}}else if(t.tag===18){if(s===null){Z=t;try{var ae=Z.stateNode;l?N_(ae,!0):N_(Z.stateNode,!1)}catch(ye){Ge(Z,Z.return,ye)}}}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,mo(e,s))));break;case 19:ti(t,e),ii(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,mo(e,n)));break;case 30:break;case 21:break;default:ti(t,e),ii(e)}}function ii(e){var t=e.flags;if(t&2){try{for(var s,n=e.return;n!==null;){if(zd(n)){s=n;break}n=n.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var l=s.stateNode,_=$c(e);_o(e,_,l);break;case 5:var k=s.stateNode;s.flags&32&&(Cr(k,""),s.flags&=-33);var z=$c(e);_o(e,z,k);break;case 3:case 4:var Z=s.stateNode.containerInfo,ie=$c(e);Fc(e,ie,Z);break;default:throw Error(o(161))}}catch(le){Ge(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;qd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _s(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ud(e,t.alternate,t),t=t.sibling}function dr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ms(4,t,t.return),dr(t);break;case 1:Zi(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Nd(t,t.return,s),dr(t);break;case 27:ea(t.stateNode);case 26:case 5:Zi(t,t.return),dr(t);break;case 22:t.memoizedState===null&&dr(t);break;case 30:dr(t);break;default:dr(t)}e=e.sibling}}function ms(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,l=e,_=t,k=_.flags;switch(_.tag){case 0:case 11:case 15:ms(l,_,s),Zn(4,_);break;case 1:if(ms(l,_,s),n=_,l=n.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(ie){Ge(n,n.return,ie)}if(n=_,l=n.updateQueue,l!==null){var z=n.stateNode;try{var Z=l.shared.hiddenCallbacks;if(Z!==null)for(l.shared.hiddenCallbacks=null,l=0;l<Z.length;l++)Cf(Z[l],z)}catch(ie){Ge(n,n.return,ie)}}s&&k&64&&Ld(_),qn(_,_.return);break;case 27:jd(_);case 26:case 5:ms(l,_,s),s&&n===null&&k&4&&Bd(_),qn(_,_.return);break;case 12:ms(l,_,s);break;case 31:ms(l,_,s),s&&k&4&&$d(l,_);break;case 13:ms(l,_,s),s&&k&4&&Fd(l,_);break;case 22:_.memoizedState===null&&ms(l,_,s),qn(_,_.return);break;case 30:break;default:ms(l,_,s)}t=t.sibling}}function qc(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&&On(s))}function Gc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&On(e))}function ji(e,t,s,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Gd(e,t,s,n),t=t.sibling}function Gd(e,t,s,n){var l=t.flags;switch(t.tag){case 0:case 11:case 15:ji(e,t,s,n),l&2048&&Zn(9,t);break;case 1:ji(e,t,s,n);break;case 3:ji(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&&On(e)));break;case 12:if(l&2048){ji(e,t,s,n),e=t.stateNode;try{var _=t.memoizedProps,k=_.id,z=_.onPostCommit;typeof z=="function"&&z(k,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Z){Ge(t,t.return,Z)}}else ji(e,t,s,n);break;case 31:ji(e,t,s,n);break;case 13:ji(e,t,s,n);break;case 23:break;case 22:_=t.stateNode,k=t.alternate,t.memoizedState!==null?_._visibility&2?ji(e,t,s,n):Gn(e,t):_._visibility&2?ji(e,t,s,n):(_._visibility|=2,$r(e,t,s,n,(t.subtreeFlags&10256)!==0||!1)),l&2048&&qc(k,t);break;case 24:ji(e,t,s,n),l&2048&&Gc(t.alternate,t);break;default:ji(e,t,s,n)}}function $r(e,t,s,n,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var _=e,k=t,z=s,Z=n,ie=k.flags;switch(k.tag){case 0:case 11:case 15:$r(_,k,z,Z,l),Zn(8,k);break;case 23:break;case 22:var le=k.stateNode;k.memoizedState!==null?le._visibility&2?$r(_,k,z,Z,l):Gn(_,k):(le._visibility|=2,$r(_,k,z,Z,l)),l&&ie&2048&&qc(k.alternate,k);break;case 24:$r(_,k,z,Z,l),l&&ie&2048&&Gc(k.alternate,k);break;default:$r(_,k,z,Z,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&&qc(n.alternate,n);break;case 24:Gn(s,n),l&2048&&Gc(n.alternate,n);break;default:Gn(s,n)}t=t.sibling}}var Wn=8192;function Fr(e,t,s){if(e.subtreeFlags&Wn)for(e=e.child;e!==null;)Wd(e,t,s),e=e.sibling}function Wd(e,t,s){switch(e.tag){case 26:Fr(e,t,s),e.flags&Wn&&e.memoizedState!==null&&C0(s,zi,e.memoizedState,e.memoizedProps);break;case 5:Fr(e,t,s);break;case 3:case 4:var n=zi;zi=Do(e.stateNode.containerInfo),Fr(e,t,s),zi=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Wn,Wn=16777216,Fr(e,t,s),Wn=n):Fr(e,t,s));break;default:Fr(e,t,s)}}function Yd(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 Yn(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];Mt=n,Kd(n,e)}Yd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vd(e),e=e.sibling}function Vd(e){switch(e.tag){case 0:case 11:case 15:Yn(e),e.flags&2048&&Ms(9,e,e.return);break;case 3:Yn(e);break;case 12:Yn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,po(e)):Yn(e);break;default:Yn(e)}}function po(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];Mt=n,Kd(n,e)}Yd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ms(8,t,t.return),po(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,po(t));break;default:po(t)}e=e.sibling}}function Kd(e,t){for(;Mt!==null;){var s=Mt;switch(s.tag){case 0:case 11:case 15:Ms(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:On(s.memoizedState.cache)}if(n=s.child,n!==null)n.return=s,Mt=n;else e:for(s=e;Mt!==null;){n=Mt;var l=n.sibling,_=n.return;if(Id(n),n===s){Mt=null;break e}if(l!==null){l.return=_,Mt=l;break e}Mt=_}}}var jg={getCacheForType:function(e){var t=Ht(St),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ht(St).controller.signal}},Hg=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Je=null,Le=null,Be=0,qe=0,hi=null,Ls=!1,Zr=!1,Wc=!1,ps=0,ht=0,Ns=0,_r=0,Yc=0,fi=0,qr=0,Vn=null,si=null,Vc=!1,vo=0,Xd=0,go=1/0,yo=null,Bs=null,Rt=0,zs=null,Gr=null,vs=0,Kc=0,Xc=null,Jd=null,Kn=0,Jc=null;function di(){return(Fe&2)!==0&&Be!==0?Be&-Be:G.T!==null?ru():pn()}function Qd(){if(fi===0)if((Be&536870912)===0||He){var e=Ji;Ji<<=1,(Ji&3932160)===0&&(Ji=262144),fi=e}else fi=536870912;return e=ci.current,e!==null&&(e.flags|=32),fi}function ri(e,t,s){(e===Je&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(Wr(e,0),js(e,Be,fi,!1)),bs(e,s),((Fe&2)===0||e!==Je)&&(e===Je&&((Fe&2)===0&&(_r|=s),ht===4&&js(e,Be,fi,!1)),qi(e))}function e_(e,t,s){if((Fe&6)!==0)throw Error(o(327));var n=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Js(e,t),l=n?Pg(e,t):eu(e,t,!0),_=n;do{if(l===0){Zr&&!n&&js(e,t,0,!1);break}else{if(s=e.current.alternate,_&&!Ug(s)){l=eu(e,t,!1),_=!1;continue}if(l===2){if(_=t,e.errorRecoveryDisabledLanes&_)var k=0;else k=e.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){t=k;e:{var z=e;l=Vn;var Z=z.current.memoizedState.isDehydrated;if(Z&&(Wr(z,k).flags|=256),k=eu(z,k,!1),k!==2){if(Wc&&!Z){z.errorRecoveryDisabledLanes|=_,_r|=_,l=4;break e}_=si,si=l,_!==null&&(si===null?si=_:si.push.apply(si,_))}l=k}if(_=!1,l!==2)continue}}if(l===1){Wr(e,0),js(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:js(n,t,fi,!Ls);break e;case 2:si=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(l=vo+300-nt(),10<l)){if(js(n,t,fi,!Ls),yr(n,0,!0)!==0)break e;vs=t,n.timeoutHandle=O_(t_.bind(null,n,s,si,yo,Vc,t,fi,_r,qr,Ls,_,"Throttled",-0,0),l);break e}t_(n,s,si,yo,Vc,t,fi,_r,qr,Ls,_,null,-0,0)}}break}while(!0);qi(e)}function t_(e,t,s,n,l,_,k,z,Z,ie,le,de,re,ae){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:is},Wd(t,_,de);var ye=(_&62914560)===_?vo-nt():(_&4194048)===_?Xd-nt():0;if(ye=x0(de,ye),ye!==null){vs=_,e.cancelPendingCommit=ye(c_.bind(null,e,t,_,s,n,l,k,z,Z,le,de,null,re,ae)),js(e,_,k,!ie);return}}c_(e,t,_,s,n,l,k,z,Z)}function Ug(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(!oi(_(),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 js(e,t,s,n){t&=~Yc,t&=~_r,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var l=t;0<l;){var _=31-gt(l),k=1<<_;n[_]=-1,l&=~k}s!==0&&_n(e,s,t)}function So(){return(Fe&6)===0?(Xn(0),!1):!0}function Qc(){if(Le!==null){if(qe===0)var e=Le.return;else e=Le,as=nr=null,mc(e),jr=null,Ln=0,e=Le;for(;e!==null;)Md(e.alternate,e),e=e.return;Le=null}}function Wr(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,n0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),vs=0,Qc(),Je=e,Le=s=rs(e.current,null),Be=t,qe=0,hi=null,Ls=!1,Zr=Js(e,t),Wc=!1,qr=fi=Yc=_r=Ns=ht=0,si=Vn=null,Vc=!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-gt(n),_=1<<l;t|=e[l],n&=~_}return ps=t,Ia(),s}function i_(e,t){Re=null,G.H=Pn,t===zr||t===Ya?(t=gf(),qe=3):t===sc?(t=gf(),qe=4):qe=t===Oc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hi=t,Le===null&&(ht=1,lo(e,xi(t,e.current)))}function s_(){var e=ci.current;return e===null?!0:(Be&4194048)===Be?Ai===null:(Be&62914560)===Be||(Be&536870912)!==0?e===Ai:!1}function r_(){var e=G.H;return G.H=Pn,e===null?Pn:e}function n_(){var e=G.A;return G.A=jg,e}function bo(){ht=4,Ls||(Be&4194048)!==Be&&ci.current!==null||(Zr=!0),(Ns&134217727)===0&&(_r&134217727)===0||Je===null||js(Je,Be,fi,!1)}function eu(e,t,s){var n=Fe;Fe|=2;var l=r_(),_=n_();(Je!==e||Be!==t)&&(yo=null,Wr(e,t)),t=!1;var k=ht;e:do try{if(qe!==0&&Le!==null){var z=Le,Z=hi;switch(qe){case 8:Qc(),k=6;break e;case 3:case 2:case 9:case 6:ci.current===null&&(t=!0);var ie=qe;if(qe=0,hi=null,Yr(e,z,Z,ie),s&&Zr){k=0;break e}break;default:ie=qe,qe=0,hi=null,Yr(e,z,Z,ie)}}Ig(),k=ht;break}catch(le){i_(e,le)}while(!0);return t&&e.shellSuspendCounter++,as=nr=null,Fe=n,G.H=l,G.A=_,Le===null&&(Je=null,Be=0,Ia()),k}function Ig(){for(;Le!==null;)a_(Le)}function Pg(e,t){var s=Fe;Fe|=2;var n=r_(),l=n_();Je!==e||Be!==t?(yo=null,go=nt()+500,Wr(e,t)):Zr=Js(e,t);e:do try{if(qe!==0&&Le!==null){t=Le;var _=hi;t:switch(qe){case 1:qe=0,hi=null,Yr(e,t,_,1);break;case 2:case 9:if(pf(_)){qe=0,hi=null,o_(t);break}t=function(){qe!==2&&qe!==9||Je!==e||(qe=7),qi(e)},_.then(t,t);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:pf(_)?(qe=0,hi=null,o_(t)):(qe=0,hi=null,Yr(e,t,_,7));break;case 5:var k=null;switch(Le.tag){case 26:k=Le.memoizedState;case 5:case 27:var z=Le;if(k?G_(k):z.stateNode.complete){qe=0,hi=null;var Z=z.sibling;if(Z!==null)Le=Z;else{var ie=z.return;ie!==null?(Le=ie,Co(ie)):Le=null}break t}}qe=0,hi=null,Yr(e,t,_,5);break;case 6:qe=0,hi=null,Yr(e,t,_,6);break;case 8:Qc(),ht=6;break e;default:throw Error(o(462))}}$g();break}catch(le){i_(e,le)}while(!0);return as=nr=null,G.H=n,G.A=l,Fe=s,Le!==null?0:(Je=null,Be=0,Ia(),ht)}function $g(){for(;Le!==null&&!Vi();)a_(Le)}function a_(e){var t=kd(e.alternate,e,ps);e.memoizedProps=e.pendingProps,t===null?Co(e):Le=t}function o_(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=wd(s,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=wd(s,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:mc(t);default:Md(s,t),t=Le=nf(t,ps),t=kd(s,t,ps)}e.memoizedProps=e.pendingProps,t===null?Co(e):Le=t}function Yr(e,t,s,n){as=nr=null,mc(t),jr=null,Ln=0;var l=t.return;try{if(kg(e,l,t,s,Be)){ht=1,lo(e,xi(s,e.current)),Le=null;return}}catch(_){if(l!==null)throw Le=l,_;ht=1,lo(e,xi(s,e.current)),Le=null;return}t.flags&32768?(He||n===1?e=!0:Zr||(Be&536870912)!==0?e=!1:(Ls=e=!0,(n===2||n===9||n===3||n===6)&&(n=ci.current,n!==null&&n.tag===13&&(n.flags|=16384))),l_(t,e)):Co(t)}function Co(e){var t=e;do{if((t.flags&32768)!==0){l_(t,Ls);return}e=t.return;var s=Lg(t.alternate,t,ps);if(s!==null){Le=s;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);ht===0&&(ht=5)}function l_(e,t){do{var s=Ng(e.alternate,e);if(s!==null){s.flags&=32767,Le=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=s}while(e!==null);ht=6,Le=null}function c_(e,t,s,n,l,_,k,z,Z){e.cancelPendingCommit=null;do xo();while(Rt!==0);if((Fe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(_=t.lanes|t.childLanes,_|=$l,dn(e,s,_,k,z,Z),e===Je&&(Le=Je=null,Be=0),Gr=t,zs=e,vs=s,Kc=_,Xc=l,Jd=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Gg(Bt,function(){return __(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=G.T,G.T=null,l=K.p,K.p=2,k=Fe,Fe|=4;try{Bg(e,t,s)}finally{Fe=k,K.p=l,G.T=n}}Rt=1,u_(),h_(),f_()}}function u_(){if(Rt===1){Rt=0;var e=zs,t=Gr,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=G.T,G.T=null;var n=K.p;K.p=2;var l=Fe;Fe|=4;try{Zd(t,e);var _=fu,k=Vh(e.containerInfo),z=_.focusedElem,Z=_.selectionRange;if(k!==z&&z&&z.ownerDocument&&Yh(z.ownerDocument.documentElement,z)){if(Z!==null&&jl(z)){var ie=Z.start,le=Z.end;if(le===void 0&&(le=ie),"selectionStart"in z)z.selectionStart=ie,z.selectionEnd=Math.min(le,z.value.length);else{var de=z.ownerDocument||document,re=de&&de.defaultView||window;if(re.getSelection){var ae=re.getSelection(),ye=z.textContent.length,we=Math.min(Z.start,ye),Xe=Z.end===void 0?we:Math.min(Z.end,ye);!ae.extend&&we>Xe&&(k=Xe,Xe=we,we=k);var J=Wh(z,we),V=Wh(z,Xe);if(J&&V&&(ae.rangeCount!==1||ae.anchorNode!==J.node||ae.anchorOffset!==J.offset||ae.focusNode!==V.node||ae.focusOffset!==V.offset)){var te=de.createRange();te.setStart(J.node,J.offset),ae.removeAllRanges(),we>Xe?(ae.addRange(te),ae.extend(V.node,V.offset)):(te.setEnd(V.node,V.offset),ae.addRange(te))}}}}for(de=[],ae=z;ae=ae.parentNode;)ae.nodeType===1&&de.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<de.length;z++){var ue=de[z];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Bo=!!hu,fu=hu=null}finally{Fe=l,K.p=n,G.T=s}}e.current=t,Rt=2}}function h_(){if(Rt===2){Rt=0;var e=zs,t=Gr,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=G.T,G.T=null;var n=K.p;K.p=2;var l=Fe;Fe|=4;try{Ud(e,t.alternate,t)}finally{Fe=l,K.p=n,G.T=s}}Rt=3}}function f_(){if(Rt===4||Rt===3){Rt=0,Pt();var e=zs,t=Gr,s=vs,n=Jd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Rt=5:(Rt=0,Gr=zs=null,d_(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(Bs=null),Ni(s),t=t.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(vi,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=G.T,l=K.p,K.p=2,G.T=null;try{for(var _=e.onRecoverableError,k=0;k<n.length;k++){var z=n[k];_(z.value,{componentStack:z.stack})}}finally{G.T=t,K.p=l}}(vs&3)!==0&&xo(),qi(e),l=e.pendingLanes,(s&261930)!==0&&(l&42)!==0?e===Jc?Kn++:(Kn=0,Jc=e):Kn=0,Xn(0)}}function d_(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,On(t)))}function xo(){return u_(),h_(),f_(),__()}function __(){if(Rt!==5)return!1;var e=zs,t=Kc;Kc=0;var s=Ni(vs),n=G.T,l=K.p;try{K.p=32>s?32:s,G.T=null,s=Xc,Xc=null;var _=zs,k=vs;if(Rt=0,Gr=zs=null,vs=0,(Fe&6)!==0)throw Error(o(331));var z=Fe;if(Fe|=4,Vd(_.current),Gd(_,_.current,k,s),Fe=z,Xn(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(vi,_)}catch{}return!0}finally{K.p=l,G.T=n,d_(e,t)}}function m_(e,t,s){t=xi(s,t),t=kc(e.stateNode,t,2),e=Ds(e,t,2),e!==null&&(bs(e,2),qi(e))}function Ge(e,t,s){if(e.tag===3)m_(e,e,s);else for(;t!==null;){if(t.tag===3){m_(t,e,s);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Bs===null||!Bs.has(n))){e=xi(s,e),s=pd(2),n=Ds(t,s,2),n!==null&&(vd(s,n,t,e),bs(n,2),qi(n));break}}t=t.return}}function tu(e,t,s){var n=e.pingCache;if(n===null){n=e.pingCache=new Hg;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)||(Wc=!0,l.add(s),e=Fg.bind(null,e,t,s),t.then(e,e))}function Fg(e,t,s){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Je===e&&(Be&s)===s&&(ht===4||ht===3&&(Be&62914560)===Be&&300>nt()-vo?(Fe&2)===0&&Wr(e,0):Yc|=s,qr===Be&&(qr=0)),qi(e)}function p_(e,t){t===0&&(t=Qi()),e=ir(e,t),e!==null&&(bs(e,t),qi(e))}function Zg(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),p_(e,s)}function qg(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),p_(e,s)}function Gg(e,t){return pi(e,t)}var wo=null,Vr=null,iu=!1,Eo=!1,su=!1,Hs=0;function qi(e){e!==Vr&&e.next===null&&(Vr===null?wo=Vr=e:Vr=Vr.next=e),Eo=!0,iu||(iu=!0,Yg())}function Xn(e,t){if(!su&&Eo){su=!0;do for(var s=!1,n=wo;n!==null;){if(e!==0){var l=n.pendingLanes;if(l===0)var _=0;else{var k=n.suspendedLanes,z=n.pingedLanes;_=(1<<31-gt(42|e)+1)-1,_&=l&~(k&~z),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(s=!0,S_(n,_))}else _=Be,_=yr(n,n===Je?_:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(_&3)===0||Js(n,_)||(s=!0,S_(n,_));n=n.next}while(s);su=!1}}function Wg(){v_()}function v_(){Eo=iu=!1;var e=0;Hs!==0&&r0()&&(e=Hs);for(var t=nt(),s=null,n=wo;n!==null;){var l=n.next,_=g_(n,t);_===0?(n.next=null,s===null?wo=l:s.next=l,l===null&&(Vr=s)):(s=n,(e!==0||(_&3)!==0)&&(Eo=!0)),n=l}Rt!==0&&Rt!==5||Xn(e),Hs!==0&&(Hs=0)}function g_(e,t){for(var s=e.suspendedLanes,n=e.pingedLanes,l=e.expirationTimes,_=e.pendingLanes&-62914561;0<_;){var k=31-gt(_),z=1<<k,Z=l[k];Z===-1?((z&s)===0||(z&n)!==0)&&(l[k]=_t(z,t)):Z<=t&&(e.expiredLanes|=z),_&=~z}if(t=Je,s=Be,s=yr(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,s===0||e===t&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Ii(n),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Js(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(n!==null&&Ii(n),Ni(s)){case 2:case 8:s=Nt;break;case 32:s=Bt;break;case 268435456:s=Kt;break;default:s=Bt}return n=y_.bind(null,e),s=pi(s,n),e.callbackPriority=t,e.callbackNode=s,t}return n!==null&&n!==null&&Ii(n),e.callbackPriority=2,e.callbackNode=null,2}function y_(e,t){if(Rt!==0&&Rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(xo()&&e.callbackNode!==s)return null;var n=Be;return n=yr(e,e===Je?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(e_(e,n,t),g_(e,nt()),e.callbackNode!=null&&e.callbackNode===s?y_.bind(null,e):null)}function S_(e,t){if(xo())return null;e_(e,t,!0)}function Yg(){a0(function(){(Fe&6)!==0?pi(Zt,Wg):v_()})}function ru(){if(Hs===0){var e=Nr;e===0&&(e=Xi,Xi<<=1,(Xi&261888)===0&&(Xi=256)),Hs=e}return Hs}function b_(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ma(""+e)}function C_(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 Vg(e,t,s,n,l){if(t==="submit"&&s&&s.stateNode===l){var _=b_((l[it]||null).action),k=n.submitter;k&&(t=(t=k[it]||null)?b_(t.formAction):k.getAttribute("formAction"),t!==null&&(_=t,k=null));var z=new za("action","action",null,n,l);e.push({event:z,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Hs!==0){var Z=k?C_(l,k):new FormData(l);wc(s,{pending:!0,data:Z,method:l.method,action:_},null,Z)}}else typeof _=="function"&&(z.preventDefault(),Z=k?C_(l,k):new FormData(l),wc(s,{pending:!0,data:Z,method:l.method,action:_},_,Z))},currentTarget:l}]})}}for(var nu=0;nu<Pl.length;nu++){var au=Pl[nu],Kg=au.toLowerCase(),Xg=au[0].toUpperCase()+au.slice(1);Bi(Kg,"on"+Xg)}Bi(Jh,"onAnimationEnd"),Bi(Qh,"onAnimationIteration"),Bi(ef,"onAnimationStart"),Bi("dblclick","onDoubleClick"),Bi("focusin","onFocus"),Bi("focusout","onBlur"),Bi(dg,"onTransitionRun"),Bi(_g,"onTransitionStart"),Bi(mg,"onTransitionCancel"),Bi(tf,"onTransitionEnd"),Pi("onMouseEnter",["mouseout","mouseover"]),Pi("onMouseLeave",["mouseout","mouseover"]),Pi("onPointerEnter",["pointerout","pointerover"]),Pi("onPointerLeave",["pointerout","pointerover"]),Jt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jn="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(" "),Jg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jn));function x_(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 k=n.length-1;0<=k;k--){var z=n[k],Z=z.instance,ie=z.currentTarget;if(z=z.listener,Z!==_&&l.isPropagationStopped())break e;_=z,l.currentTarget=ie;try{_(l)}catch(le){Ua(le)}l.currentTarget=null,_=Z}else for(k=0;k<n.length;k++){if(z=n[k],Z=z.instance,ie=z.currentTarget,z=z.listener,Z!==_&&l.isPropagationStopped())break e;_=z,l.currentTarget=ie;try{_(l)}catch(le){Ua(le)}l.currentTarget=null,_=Z}}}}function Ne(e,t){var s=t[Sr];s===void 0&&(s=t[Sr]=new Set);var n=e+"__bubble";s.has(n)||(w_(t,e,2,!1),s.add(n))}function ou(e,t,s){var n=0;t&&(n|=4),w_(s,e,n,t)}var To="_reactListening"+Math.random().toString(36).slice(2);function lu(e){if(!e[To]){e[To]=!0,zt.forEach(function(s){s!=="selectionchange"&&(Jg.has(s)||ou(s,!1,e),ou(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[To]||(t[To]=!0,ou("selectionchange",!1,t))}}function w_(e,t,s,n){switch(Q_(t)){case 2:var l=T0;break;case 8:l=A0;break;default:l=xu}s=l.bind(null,t,s,e),l=void 0,!Rl||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 cu(e,t,s,n,l){var _=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var k=n.tag;if(k===3||k===4){var z=n.stateNode.containerInfo;if(z===l)break;if(k===4)for(k=n.return;k!==null;){var Z=k.tag;if((Z===3||Z===4)&&k.stateNode.containerInfo===l)return;k=k.return}for(;z!==null;){if(k=_e(z),k===null)return;if(Z=k.tag,Z===5||Z===6||Z===26||Z===27){n=_=k;continue e}z=z.parentNode}}n=n.return}Rh(function(){var ie=_,le=Tl(s),de=[];e:{var re=sf.get(e);if(re!==void 0){var ae=za,ye=e;switch(e){case"keypress":if(Na(s)===0)break e;case"keydown":case"keyup":ae=qv;break;case"focusin":ye="focus",ae=Ml;break;case"focusout":ye="blur",ae=Ml;break;case"beforeblur":case"afterblur":ae=Ml;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=Oh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=Lv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Yv;break;case Jh:case Qh:case ef:ae=zv;break;case tf:ae=Kv;break;case"scroll":case"scrollend":ae=Ov;break;case"wheel":ae=Jv;break;case"copy":case"cut":case"paste":ae=Hv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=Lh;break;case"toggle":case"beforetoggle":ae=eg}var we=(t&4)!==0,Xe=!we&&(e==="scroll"||e==="scrollend"),J=we?re!==null?re+"Capture":null:re;we=[];for(var V=ie,te;V!==null;){var ue=V;if(te=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||te===null||J===null||(ue=Sn(V,J),ue!=null&&we.push(Qn(V,ue,te))),Xe)break;V=V.return}0<we.length&&(re=new ae(re,ye,null,s,le),de.push({event:re,listeners:we}))}}if((t&7)===0){e:{if(re=e==="mouseover"||e==="pointerover",ae=e==="mouseout"||e==="pointerout",re&&s!==El&&(ye=s.relatedTarget||s.fromElement)&&(_e(ye)||ye[es]))break e;if((ae||re)&&(re=le.window===le?le:(re=le.ownerDocument)?re.defaultView||re.parentWindow:window,ae?(ye=s.relatedTarget||s.toElement,ae=ie,ye=ye?_e(ye):null,ye!==null&&(Xe=w(ye),we=ye.tag,ye!==Xe||we!==5&&we!==27&&we!==6)&&(ye=null)):(ae=null,ye=ie),ae!==ye)){if(we=Oh,ue="onMouseLeave",J="onMouseEnter",V="mouse",(e==="pointerout"||e==="pointerover")&&(we=Lh,ue="onPointerLeave",J="onPointerEnter",V="pointer"),Xe=ae==null?re:Ze(ae),te=ye==null?re:Ze(ye),re=new we(ue,V+"leave",ae,s,le),re.target=Xe,re.relatedTarget=te,ue=null,_e(le)===ie&&(we=new we(J,V+"enter",ye,s,le),we.target=te,we.relatedTarget=Xe,ue=we),Xe=ue,ae&&ye)t:{for(we=Qg,J=ae,V=ye,te=0,ue=J;ue;ue=we(ue))te++;ue=0;for(var Ce=V;Ce;Ce=we(Ce))ue++;for(;0<te-ue;)J=we(J),te--;for(;0<ue-te;)V=we(V),ue--;for(;te--;){if(J===V||V!==null&&J===V.alternate){we=J;break t}J=we(J),V=we(V)}we=null}else we=null;ae!==null&&E_(de,re,ae,we,!1),ye!==null&&Xe!==null&&E_(de,Xe,ye,we,!0)}}e:{if(re=ie?Ze(ie):window,ae=re.nodeName&&re.nodeName.toLowerCase(),ae==="select"||ae==="input"&&re.type==="file")var Pe=Ph;else if(Uh(re))if($h)Pe=ug;else{Pe=lg;var be=og}else ae=re.nodeName,!ae||ae.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ie&&wl(ie.elementType)&&(Pe=Ph):Pe=cg;if(Pe&&(Pe=Pe(e,ie))){Ih(de,Pe,s,le);break e}be&&be(e,re,ie),e==="focusout"&&ie&&re.type==="number"&&ie.memoizedProps.value!=null&&xl(re,"number",re.value)}switch(be=ie?Ze(ie):window,e){case"focusin":(Uh(be)||be.contentEditable==="true")&&(Tr=be,Hl=ie,Rn=null);break;case"focusout":Rn=Hl=Tr=null;break;case"mousedown":Ul=!0;break;case"contextmenu":case"mouseup":case"dragend":Ul=!1,Kh(de,s,le);break;case"selectionchange":if(fg)break;case"keydown":case"keyup":Kh(de,s,le)}var De;if(Nl)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Er?jh(e,s)&&(ze="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(ze="onCompositionStart");ze&&(Nh&&s.locale!=="ko"&&(Er||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Er&&(De=Dh()):(Cs=le,Dl="value"in Cs?Cs.value:Cs.textContent,Er=!0)),be=Ao(ie,ze),0<be.length&&(ze=new Mh(ze,e,null,s,le),de.push({event:ze,listeners:be}),De?ze.data=De:(De=Hh(s),De!==null&&(ze.data=De)))),(De=ig?sg(e,s):rg(e,s))&&(ze=Ao(ie,"onBeforeInput"),0<ze.length&&(be=new Mh("onBeforeInput","beforeinput",null,s,le),de.push({event:be,listeners:ze}),be.data=De)),Vg(de,e,ie,s,le)}x_(de,t)})}function Qn(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Ao(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=Sn(e,s),l!=null&&n.unshift(Qn(e,l,_)),l=Sn(e,t),l!=null&&n.push(Qn(e,l,_))),e.tag===3)return n;e=e.return}return[]}function Qg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function E_(e,t,s,n,l){for(var _=t._reactName,k=[];s!==null&&s!==n;){var z=s,Z=z.alternate,ie=z.stateNode;if(z=z.tag,Z!==null&&Z===n)break;z!==5&&z!==26&&z!==27||ie===null||(Z=ie,l?(ie=Sn(s,_),ie!=null&&k.unshift(Qn(s,ie,Z))):l||(ie=Sn(s,_),ie!=null&&k.push(Qn(s,ie,Z)))),s=s.return}k.length!==0&&e.push({event:t,listeners:k})}var e0=/\r\n?/g,t0=/\u0000|\uFFFD/g;function T_(e){return(typeof e=="string"?e:""+e).replace(e0,`
|
|
49
|
-
`).replace(t0,"")}function A_(e,t){return t=T_(t),T_(e)===t}function Ke(e,t,s,n,l,_){switch(s){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Cr(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Cr(e,""+n);break;case"className":ka(e,"class",n);break;case"tabIndex":ka(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ka(e,s,n);break;case"style":Th(e,n,_);break;case"data":if(t!=="object"){ka(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=Ma(""+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"&&Ke(e,t,"name",l.name,l,null),Ke(e,t,"formEncType",l.formEncType,l,null),Ke(e,t,"formMethod",l.formMethod,l,null),Ke(e,t,"formTarget",l.formTarget,l,null)):(Ke(e,t,"encType",l.encType,l,null),Ke(e,t,"method",l.method,l,null),Ke(e,t,"target",l.target,l,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=Ma(""+n),e.setAttribute(s,n);break;case"onClick":n!=null&&(e.onclick=is);break;case"onScroll":n!=null&&Ne("scroll",e);break;case"onScrollEnd":n!=null&&Ne("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=Ma(""+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":Ne("beforetoggle",e),Ne("toggle",e),Da(e,"popover",n);break;case"xlinkActuate":ts(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":ts(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":ts(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":ts(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":ts(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":ts(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":ts(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":ts(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":ts(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Da(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=Dv.get(s)||s,Da(e,s,n))}}function uu(e,t,s,n,l,_){switch(s){case"style":Th(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"?Cr(e,n):(typeof n=="number"||typeof n=="bigint")&&Cr(e,""+n);break;case"onScroll":n!=null&&Ne("scroll",e);break;case"onScrollEnd":n!=null&&Ne("scrollend",e);break;case"onClick":n!=null&&(e.onclick=is);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yi.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[it]||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,""):Da(e,s,n)}}}function It(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ne("error",e),Ne("load",e);var n=!1,l=!1,_;for(_ in s)if(s.hasOwnProperty(_)){var k=s[_];if(k!=null)switch(_){case"src":n=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,_,k,s,null)}}l&&Ke(e,t,"srcSet",s.srcSet,s,null),n&&Ke(e,t,"src",s.src,s,null);return;case"input":Ne("invalid",e);var z=_=k=l=null,Z=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":k=le;break;case"checked":Z=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:Ke(e,t,n,le,s,null)}}Ch(e,_,z,Z,ie,k,l,!1);return;case"select":Ne("invalid",e),n=k=_=null;for(l in s)if(s.hasOwnProperty(l)&&(z=s[l],z!=null))switch(l){case"value":_=z;break;case"defaultValue":k=z;break;case"multiple":n=z;default:Ke(e,t,l,z,s,null)}t=_,s=k,e.multiple=!!n,t!=null?br(e,!!n,t,!1):s!=null&&br(e,!!n,s,!0);return;case"textarea":Ne("invalid",e),_=l=n=null;for(k in s)if(s.hasOwnProperty(k)&&(z=s[k],z!=null))switch(k){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:Ke(e,t,k,z,s,null)}wh(e,n,l,_);return;case"option":for(Z in s)if(s.hasOwnProperty(Z)&&(n=s[Z],n!=null))switch(Z){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Ke(e,t,Z,n,s,null)}return;case"dialog":Ne("beforetoggle",e),Ne("toggle",e),Ne("cancel",e),Ne("close",e);break;case"iframe":case"object":Ne("load",e);break;case"video":case"audio":for(n=0;n<Jn.length;n++)Ne(Jn[n],e);break;case"image":Ne("error",e),Ne("load",e);break;case"details":Ne("toggle",e);break;case"embed":case"source":case"link":Ne("error",e),Ne("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:Ke(e,t,ie,n,s,null)}return;default:if(wl(t)){for(le in s)s.hasOwnProperty(le)&&(n=s[le],n!==void 0&&uu(e,t,le,n,s,void 0));return}}for(z in s)s.hasOwnProperty(z)&&(n=s[z],n!=null&&Ke(e,t,z,n,s,null))}function i0(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,k=null,z=null,Z=null,ie=null,le=null;for(ae in s){var de=s[ae];if(s.hasOwnProperty(ae)&&de!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":Z=de;default:n.hasOwnProperty(ae)||Ke(e,t,ae,null,n,de)}}for(var re in n){var ae=n[re];if(de=s[re],n.hasOwnProperty(re)&&(ae!=null||de!=null))switch(re){case"type":_=ae;break;case"name":l=ae;break;case"checked":ie=ae;break;case"defaultChecked":le=ae;break;case"value":k=ae;break;case"defaultValue":z=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,t));break;default:ae!==de&&Ke(e,t,re,ae,n,de)}}Cl(e,k,z,Z,ie,le,_,l);return;case"select":ae=k=z=re=null;for(_ in s)if(Z=s[_],s.hasOwnProperty(_)&&Z!=null)switch(_){case"value":break;case"multiple":ae=Z;default:n.hasOwnProperty(_)||Ke(e,t,_,null,n,Z)}for(l in n)if(_=n[l],Z=s[l],n.hasOwnProperty(l)&&(_!=null||Z!=null))switch(l){case"value":re=_;break;case"defaultValue":z=_;break;case"multiple":k=_;default:_!==Z&&Ke(e,t,l,_,n,Z)}t=z,s=k,n=ae,re!=null?br(e,!!s,re,!1):!!n!=!!s&&(t!=null?br(e,!!s,t,!0):br(e,!!s,s?[]:"",!1));return;case"textarea":ae=re=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:Ke(e,t,z,null,n,l)}for(k in n)if(l=n[k],_=s[k],n.hasOwnProperty(k)&&(l!=null||_!=null))switch(k){case"value":re=l;break;case"defaultValue":ae=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(o(91));break;default:l!==_&&Ke(e,t,k,l,n,_)}xh(e,re,ae);return;case"option":for(var ye in s)if(re=s[ye],s.hasOwnProperty(ye)&&re!=null&&!n.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:Ke(e,t,ye,null,n,re)}for(Z in n)if(re=n[Z],ae=s[Z],n.hasOwnProperty(Z)&&re!==ae&&(re!=null||ae!=null))switch(Z){case"selected":e.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:Ke(e,t,Z,re,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 we in s)re=s[we],s.hasOwnProperty(we)&&re!=null&&!n.hasOwnProperty(we)&&Ke(e,t,we,null,n,re);for(ie in n)if(re=n[ie],ae=s[ie],n.hasOwnProperty(ie)&&re!==ae&&(re!=null||ae!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(o(137,t));break;default:Ke(e,t,ie,re,n,ae)}return;default:if(wl(t)){for(var Xe in s)re=s[Xe],s.hasOwnProperty(Xe)&&re!==void 0&&!n.hasOwnProperty(Xe)&&uu(e,t,Xe,void 0,n,re);for(le in n)re=n[le],ae=s[le],!n.hasOwnProperty(le)||re===ae||re===void 0&&ae===void 0||uu(e,t,le,re,n,ae);return}}for(var J in s)re=s[J],s.hasOwnProperty(J)&&re!=null&&!n.hasOwnProperty(J)&&Ke(e,t,J,null,n,re);for(de in n)re=n[de],ae=s[de],!n.hasOwnProperty(de)||re===ae||re==null&&ae==null||Ke(e,t,de,re,n,ae)}function R_(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function s0(){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,k=l.initiatorType,z=l.duration;if(_&&z&&R_(k)){for(k=0,z=l.responseEnd,n+=1;n<s.length;n++){var Z=s[n],ie=Z.startTime;if(ie>z)break;var le=Z.transferSize,de=Z.initiatorType;le&&R_(de)&&(Z=Z.responseEnd,k+=le*(Z<z?1:(z-ie)/(Z-ie)))}if(--n,t+=8*(_+k)/(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 hu=null,fu=null;function Ro(e){return e.nodeType===9?e:e.ownerDocument}function D_(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 k_(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 du(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 _u=null;function r0(){var e=window.event;return e&&e.type==="popstate"?e===_u?!1:(_u=e,!0):(_u=null,!1)}var O_=typeof setTimeout=="function"?setTimeout:void 0,n0=typeof clearTimeout=="function"?clearTimeout:void 0,M_=typeof Promise=="function"?Promise:void 0,a0=typeof queueMicrotask=="function"?queueMicrotask:typeof M_<"u"?function(e){return M_.resolve(null).then(e).catch(o0)}:O_;function o0(e){setTimeout(function(){throw e})}function Us(e){return e==="head"}function L_(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),Qr(t);return}n--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")n++;else if(s==="html")ea(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,ea(s);for(var _=s.firstChild;_;){var k=_.nextSibling,z=_.nodeName;_[Se]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&_.rel.toLowerCase()==="stylesheet"||s.removeChild(_),_=k}}else s==="body"&&ea(e.ownerDocument.body);s=l}while(s);Qr(t)}function N_(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 mu(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":mu(s),W(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function l0(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[Se])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 c0(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 B_(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 pu(e){return e.data==="$?"||e.data==="$~"}function vu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function u0(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 gu=null;function z_(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 j_(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 H_(e,t,s){switch(t=Ro(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 ea(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);W(e)}var Di=new Map,U_=new Set;function Do(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gs=K.d;K.d={f:h0,r:f0,D:d0,C:_0,L:m0,m:p0,X:g0,S:v0,M:y0};function h0(){var e=gs.f(),t=So();return e||t}function f0(e){var t=ge(e);t!==null&&t.tag===5&&t.type==="form"?id(t):gs.r(e)}var Kr=typeof document>"u"?null:document;function I_(e,t,s){var n=Kr;if(n&&typeof t=="string"&&t){var l=bi(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof s=="string"&&(l+='[crossorigin="'+s+'"]'),U_.has(l)||(U_.add(l),e={rel:e,crossOrigin:s,href:t},n.querySelector(l)===null&&(t=n.createElement("link"),It(t,"link",e),ke(t),n.head.appendChild(t)))}}function d0(e){gs.D(e),I_("dns-prefetch",e,null)}function _0(e,t){gs.C(e,t),I_("preconnect",e,t)}function m0(e,t,s){gs.L(e,t,s);var n=Kr;if(n&&e&&t){var l='link[rel="preload"][as="'+bi(t)+'"]';t==="image"&&s&&s.imageSrcSet?(l+='[imagesrcset="'+bi(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(l+='[imagesizes="'+bi(s.imageSizes)+'"]')):l+='[href="'+bi(e)+'"]';var _=l;switch(t){case"style":_=Xr(e);break;case"script":_=Jr(e)}Di.has(_)||(e=m({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Di.set(_,e),n.querySelector(l)!==null||t==="style"&&n.querySelector(ta(_))||t==="script"&&n.querySelector(ia(_))||(t=n.createElement("link"),It(t,"link",e),ke(t),n.head.appendChild(t)))}}function p0(e,t){gs.m(e,t);var s=Kr;if(s&&e){var n=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+bi(n)+'"][href="'+bi(e)+'"]',_=l;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Jr(e)}if(!Di.has(_)&&(e=m({rel:"modulepreload",href:e},t),Di.set(_,e),s.querySelector(l)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ia(_)))return}n=s.createElement("link"),It(n,"link",e),ke(n),s.head.appendChild(n)}}}function v0(e,t,s){gs.S(e,t,s);var n=Kr;if(n&&e){var l=at(n).hoistableStyles,_=Xr(e);t=t||"default";var k=l.get(_);if(!k){var z={loading:0,preload:null};if(k=n.querySelector(ta(_)))z.loading=5;else{e=m({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Di.get(_))&&yu(e,s);var Z=k=n.createElement("link");ke(Z),It(Z,"link",e),Z._p=new Promise(function(ie,le){Z.onload=ie,Z.onerror=le}),Z.addEventListener("load",function(){z.loading|=1}),Z.addEventListener("error",function(){z.loading|=2}),z.loading|=4,ko(k,t,n)}k={type:"stylesheet",instance:k,count:1,state:z},l.set(_,k)}}}function g0(e,t){gs.X(e,t);var s=Kr;if(s&&e){var n=at(s).hoistableScripts,l=Jr(e),_=n.get(l);_||(_=s.querySelector(ia(l)),_||(e=m({src:e,async:!0},t),(t=Di.get(l))&&Su(e,t),_=s.createElement("script"),ke(_),It(_,"link",e),s.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},n.set(l,_))}}function y0(e,t){gs.M(e,t);var s=Kr;if(s&&e){var n=at(s).hoistableScripts,l=Jr(e),_=n.get(l);_||(_=s.querySelector(ia(l)),_||(e=m({src:e,async:!0,type:"module"},t),(t=Di.get(l))&&Su(e,t),_=s.createElement("script"),ke(_),It(_,"link",e),s.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},n.set(l,_))}}function P_(e,t,s,n){var l=(l=me.current)?Do(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=Xr(s.href),s=at(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=Xr(s.href);var _=at(l).hoistableStyles,k=_.get(e);if(k||(l=l.ownerDocument||l,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(e,k),(_=l.querySelector(ta(e)))&&!_._p&&(k.instance=_,k.state.loading=5),Di.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},Di.set(e,s),_||S0(l,e,s,k.state))),t&&n===null)throw Error(o(528,""));return k}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=Jr(s),s=at(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 Xr(e){return'href="'+bi(e)+'"'}function ta(e){return'link[rel="stylesheet"]['+e+"]"}function $_(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function S0(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}),It(t,"link",s),ke(t),e.head.appendChild(t))}function Jr(e){return'[src="'+bi(e)+'"]'}function ia(e){return"script[async]"+e}function F_(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+bi(s.href)+'"]');if(n)return t.instance=n,ke(n),n;var l=m({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ke(n),It(n,"style",l),ko(n,s.precedence,e),t.instance=n;case"stylesheet":l=Xr(s.href);var _=e.querySelector(ta(l));if(_)return t.state.loading|=4,t.instance=_,ke(_),_;n=$_(s),(l=Di.get(l))&&yu(n,l),_=(e.ownerDocument||e).createElement("link"),ke(_);var k=_;return k._p=new Promise(function(z,Z){k.onload=z,k.onerror=Z}),It(_,"link",n),t.state.loading|=4,ko(_,s.precedence,e),t.instance=_;case"script":return _=Jr(s.src),(l=e.querySelector(ia(_)))?(t.instance=l,ke(l),l):(n=s,(l=Di.get(_))&&(n=m({},s),Su(n,l)),e=e.ownerDocument||e,l=e.createElement("script"),ke(l),It(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,ko(n,s.precedence,e));return t.instance}function ko(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,k=0;k<n.length;k++){var z=n[k];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 yu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Su(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Oo=null;function Z_(e,t,s){if(Oo===null){var n=new Map,l=Oo=new Map;l.set(s,n)}else l=Oo,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(!(_[Se]||_[yt]||e==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var k=_.getAttribute(t)||"";k=e+k;var z=n.get(k);z?z.push(_):n.set(k,[_])}}return n}function q_(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function b0(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 G_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function C0(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=Xr(n.href),_=t.querySelector(ta(l));if(_){t=_._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Mo.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=_,ke(_);return}_=t.ownerDocument||t,n=$_(n),(l=Di.get(l))&&yu(n,l),_=_.createElement("link"),ke(_);var k=_;k._p=new Promise(function(z,Z){k.onload=z,k.onerror=Z}),It(_,"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=Mo.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var bu=0;function x0(e,t){return e.stylesheets&&e.count===0&&No(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var n=setTimeout(function(){if(e.stylesheets&&No(e,e.stylesheets),e.unsuspend){var _=e.unsuspend;e.unsuspend=null,_()}},6e4+t);0<e.imgBytes&&bu===0&&(bu=62500*s0());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&No(e,e.stylesheets),e.unsuspend)){var _=e.unsuspend;e.unsuspend=null,_()}},(e.imgBytes>bu?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(l)}}:null}function Mo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)No(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Lo=null;function No(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Lo=new Map,t.forEach(w0,e),Lo=null,Mo.call(e))}function w0(e,t){if(!(t.state.loading&4)){var s=Lo.get(e);if(s)var n=s.get(null);else{s=new Map,Lo.set(e,s);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<l.length;_++){var k=l[_];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(s.set(k.dataset.precedence,k),n=k)}n&&s.set(null,n)}l=t.instance,k=l.getAttribute("data-precedence"),_=s.get(k)||n,_===n&&s.set(null,l),s.set(k,l),this.count++,n=Mo.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 sa={$$typeof:v,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function E0(e,t,s,n,l,_,k,z,Z){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=fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fn(0),this.hiddenUpdates=fn(null),this.identifierPrefix=n,this.onUncaughtError=l,this.onCaughtError=_,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function W_(e,t,s,n,l,_,k,z,Z,ie,le,de){return e=new E0(e,t,s,k,Z,ie,le,de,z),t=1,_===!0&&(t|=24),_=li(3,null,null,t),e.current=_,_.stateNode=e,t=ec(),t.refCount++,e.pooledCache=t,t.refCount++,_.memoizedState={element:n,isDehydrated:s,cache:t},rc(_),e}function Y_(e){return e?(e=Dr,e):Dr}function V_(e,t,s,n,l,_){l=Y_(l),n.context===null?n.context=l:n.pendingContext=l,n=Rs(t),n.payload={element:s},_=_===void 0?null:_,_!==null&&(n.callback=_),s=Ds(e,n,t),s!==null&&(ri(s,e,t),Bn(s,e,t))}function K_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Cu(e,t){K_(e,t),(e=e.alternate)&&K_(e,t)}function X_(e){if(e.tag===13||e.tag===31){var t=ir(e,67108864);t!==null&&ri(t,e,67108864),Cu(e,67108864)}}function J_(e){if(e.tag===13||e.tag===31){var t=di();t=Xt(t);var s=ir(e,t);s!==null&&ri(s,e,t),Cu(e,t)}}var Bo=!0;function T0(e,t,s,n){var l=G.T;G.T=null;var _=K.p;try{K.p=2,xu(e,t,s,n)}finally{K.p=_,G.T=l}}function A0(e,t,s,n){var l=G.T;G.T=null;var _=K.p;try{K.p=8,xu(e,t,s,n)}finally{K.p=_,G.T=l}}function xu(e,t,s,n){if(Bo){var l=wu(n);if(l===null)cu(e,t,n,zo,s),em(e,n);else if(D0(l,e,t,s,n))n.stopPropagation();else if(em(e,n),t&4&&-1<R0.indexOf(e)){for(;l!==null;){var _=ge(l);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var k=ai(_.pendingLanes);if(k!==0){var z=_;for(z.pendingLanes|=2,z.entangledLanes|=2;k;){var Z=1<<31-gt(k);z.entanglements[1]|=Z,k&=~Z}qi(_),(Fe&6)===0&&(go=nt()+500,Xn(0))}}break;case 31:case 13:z=ir(_,2),z!==null&&ri(z,_,2),So(),Cu(_,2)}if(_=wu(n),_===null&&cu(e,t,n,zo,s),_===l)break;l=_}l!==null&&n.stopPropagation()}else cu(e,t,n,null,s)}}function wu(e){return e=Tl(e),Eu(e)}var zo=null;function Eu(e){if(zo=null,e=_e(e),e!==null){var t=w(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=T(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 zo=e,null}function Q_(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(Dt()){case Zt:return 2;case Nt:return 8;case Bt:case Ki:return 32;case Kt:return 268435456;default:return 32}default:return 32}}var Tu=!1,Is=null,Ps=null,$s=null,ra=new Map,na=new Map,Fs=[],R0="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 em(e,t){switch(e){case"focusin":case"focusout":Is=null;break;case"dragenter":case"dragleave":Ps=null;break;case"mouseover":case"mouseout":$s=null;break;case"pointerover":case"pointerout":ra.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":na.delete(t.pointerId)}}function aa(e,t,s,n,l,_){return e===null||e.nativeEvent!==_?(e={blockedOn:t,domEventName:s,eventSystemFlags:n,nativeEvent:_,targetContainers:[l]},t!==null&&(t=ge(t),t!==null&&X_(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function D0(e,t,s,n,l){switch(t){case"focusin":return Is=aa(Is,e,t,s,n,l),!0;case"dragenter":return Ps=aa(Ps,e,t,s,n,l),!0;case"mouseover":return $s=aa($s,e,t,s,n,l),!0;case"pointerover":var _=l.pointerId;return ra.set(_,aa(ra.get(_)||null,e,t,s,n,l)),!0;case"gotpointercapture":return _=l.pointerId,na.set(_,aa(na.get(_)||null,e,t,s,n,l)),!0}return!1}function tm(e){var t=_e(e.target);if(t!==null){var s=w(t);if(s!==null){if(t=s.tag,t===13){if(t=T(s),t!==null){e.blockedOn=t,vn(e.priority,function(){J_(s)});return}}else if(t===31){if(t=c(s),t!==null){e.blockedOn=t,vn(e.priority,function(){J_(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 jo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=wu(e.nativeEvent);if(s===null){s=e.nativeEvent;var n=new s.constructor(s.type,s);El=n,s.target.dispatchEvent(n),El=null}else return t=ge(s),t!==null&&X_(t),e.blockedOn=s,!1;t.shift()}return!0}function im(e,t,s){jo(e)&&s.delete(t)}function k0(){Tu=!1,Is!==null&&jo(Is)&&(Is=null),Ps!==null&&jo(Ps)&&(Ps=null),$s!==null&&jo($s)&&($s=null),ra.forEach(im),na.forEach(im)}function Ho(e,t){e.blockedOn===t&&(e.blockedOn=null,Tu||(Tu=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,k0)))}var Uo=null;function sm(e){Uo!==e&&(Uo=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Uo===e&&(Uo=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(Eu(n||s)===null)continue;break}var _=ge(s);_!==null&&(e.splice(t,3),t-=3,wc(_,{pending:!0,data:l,method:s.method,action:n},n,l))}}))}function Qr(e){function t(Z){return Ho(Z,e)}Is!==null&&Ho(Is,e),Ps!==null&&Ho(Ps,e),$s!==null&&Ho($s,e),ra.forEach(t),na.forEach(t);for(var s=0;s<Fs.length;s++){var n=Fs[s];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Fs.length&&(s=Fs[0],s.blockedOn===null);)tm(s),s.blockedOn===null&&Fs.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(n=0;n<s.length;n+=3){var l=s[n],_=s[n+1],k=l[it]||null;if(typeof _=="function")k||sm(s);else if(k){var z=null;if(_&&_.hasAttribute("formAction")){if(l=_,k=_[it]||null)z=k.formAction;else if(Eu(l)!==null)continue}else z=k.action;typeof z=="function"?s[n+1]=z:(s.splice(n,3),n-=3),sm(s)}}}function rm(){function e(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(k){return l=k})},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 Au(e){this._internalRoot=e}Io.prototype.render=Au.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,n=di();V_(s,n,e,t,null,null)},Io.prototype.unmount=Au.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;V_(e.current,2,null,e,null,null),So(),t[es]=null}};function Io(e){this._internalRoot=e}Io.prototype.unstable_scheduleHydration=function(e){if(e){var t=pn();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Fs.length&&t!==0&&t<Fs[s].priority;s++);Fs.splice(s,0,e),s===0&&tm(e)}};var nm=r.version;if(nm!=="19.2.4")throw Error(o(527,nm,"19.2.4"));K.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 O0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Po=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Po.isDisabled&&Po.supportsFiber)try{vi=Po.inject(O0),kt=Po}catch{}}return la.createRoot=function(e,t){if(!g(e))throw Error(o(299));var s=!1,n="",l=fd,_=dd,k=_d;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&&(k=t.onRecoverableError)),t=W_(e,1,!1,null,null,s,n,null,l,_,k,rm),e[es]=t.current,lu(e),new Au(t)},la.hydrateRoot=function(e,t,s){if(!g(e))throw Error(o(299));var n=!1,l="",_=fd,k=dd,z=_d,Z=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&&(k=s.onCaughtError),s.onRecoverableError!==void 0&&(z=s.onRecoverableError),s.formState!==void 0&&(Z=s.formState)),t=W_(e,1,!0,t,s??null,n,l,Z,_,k,z,rm),t.context=Y_(null),s=t.current,n=di(),n=Xt(n),l=Rs(n),l.callback=null,Ds(s,l,n),s=n,t.current.lanes=s,bs(t,s),qi(t),e[es]=t.current,lu(e),new Io(t)},la.version="19.2.4",la}var mm;function F0(){if(mm)return ku.exports;mm=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(),ku.exports=$0(),ku.exports}var Z0=F0();const q0=hp(Z0);/**
|
|
48
|
+
`+n.stack}}var mi=Object.prototype.hasOwnProperty,pi=i.unstable_scheduleCallback,Ii=i.unstable_cancelCallback,Vi=i.unstable_shouldYield,Pt=i.unstable_requestPaint,nt=i.unstable_now,Dt=i.unstable_getCurrentPriorityLevel,Zt=i.unstable_ImmediatePriority,Nt=i.unstable_UserBlockingPriority,Bt=i.unstable_NormalPriority,Ki=i.unstable_LowPriority,Kt=i.unstable_IdlePriority,Li=i.log,Ye=i.unstable_setDisableYieldValue,vi=null,kt=null;function Ot(e){if(typeof Li=="function"&&Ye(e),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(vi,e)}catch{}}var gt=Math.clz32?Math.clz32:Sl,un=Math.log,hn=Math.LN2;function Sl(e){return e>>>=0,e===0?32:31-(un(e)/hn|0)|0}var Xi=256,Ji=262144,gr=4194304;function ai(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 yr(e,t,s){var n=e.pendingLanes;if(n===0)return 0;var l=0,_=e.suspendedLanes,k=e.pingedLanes;e=e.warmLanes;var z=n&134217727;return z!==0?(n=z&~_,n!==0?l=ai(n):(k&=z,k!==0?l=ai(k):s||(s=z&~e,s!==0&&(l=ai(s))))):(z=n&~_,z!==0?l=ai(z):k!==0?l=ai(k):s||(s=n&~e,s!==0&&(l=ai(s)))),l===0?0:t!==0&&t!==l&&(t&_)===0&&(_=l&-l,s=t&-t,_>=s||_===32&&(s&4194048)!==0)?t:l}function Js(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _t(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 Qi(){var e=gr;return gr<<=1,(gr&62914560)===0&&(gr=4194304),e}function fn(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function bs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dn(e,t,s,n,l,_){var k=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,Z=e.expirationTimes,ie=e.hiddenUpdates;for(s=k&~s;0<s;){var le=31-gt(s),de=1<<le;z[le]=0,Z[le]=-1;var re=ie[le];if(re!==null)for(ie[le]=null,le=0;le<re.length;le++){var ae=re[le];ae!==null&&(ae.lane&=-536870913)}s&=~de}n!==0&&_n(e,n,0),_!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=_&~(k&~t))}function _n(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-gt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|s&261930}function mn(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var n=31-gt(s),l=1<<n;l&t|e[n]&t&&(e[n]|=t),s&=~l}}function Ea(e,t){var s=t&-t;return s=(s&42)!==0?1:Xt(s),(s&(e.suspendedLanes|t))!==0?0:s}function Xt(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 Ni(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function pn(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:Q_(e.type))}function vn(e,t){var s=K.p;try{return K.p=e,t()}finally{K.p=s}}var gi=Math.random().toString(36).slice(2),yt="__reactFiber$"+gi,it="__reactProps$"+gi,es="__reactContainer$"+gi,Sr="__reactEvents$"+gi,Ta="__reactListeners$"+gi,Aa="__reactHandles$"+gi,Ra="__reactResources$"+gi,Se="__reactMarker$"+gi;function W(e){delete e[yt],delete e[it],delete e[Sr],delete e[Ta],delete e[Aa]}function _e(e){var t=e[yt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[es]||s[yt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=j_(e);e!==null;){if(s=e[yt])return s;e=j_(e)}return t}e=s,s=e.parentNode}return null}function ge(e){if(e=e[yt]||e[es]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ze(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function at(e){var t=e[Ra];return t||(t=e[Ra]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ke(e){e[Se]=!0}var zt=new Set,yi={};function Jt(e,t){Pi(e,t),Pi(e+"Capture",t)}function Pi(e,t){for(yi[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var At=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]*$"),gn={},yn={};function Ev(e){return mi.call(yn,e)?!0:mi.call(gn,e)?!1:At.test(e)?yn[e]=!0:(gn[e]=!0,!1)}function Da(e,t,s){if(Ev(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 ka(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 ts(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 Si(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Tv(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(k){s=""+k,_.call(this,k)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(k){s=""+k},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bl(e){if(!e._valueTracker){var t=Sh(e)?"checked":"value";e._valueTracker=Tv(e,t,""+e[t])}}function bh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),n="";return e&&(n=Sh(e)?e.checked?"true":"false":e.value),e=n,e!==s?(t.setValue(e),!0):!1}function Oa(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 Av=/[\n"\\]/g;function bi(e){return e.replace(Av,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Cl(e,t,s,n,l,_,k,z){e.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.type=k:e.removeAttribute("type"),t!=null?k==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Si(t)):e.value!==""+Si(t)&&(e.value=""+Si(t)):k!=="submit"&&k!=="reset"||e.removeAttribute("value"),t!=null?xl(e,k,Si(t)):s!=null?xl(e,k,Si(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=""+Si(z):e.removeAttribute("name")}function Ch(e,t,s,n,l,_,k,z){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.type=_),t!=null||s!=null){if(!(_!=="submit"&&_!=="reset"||t!=null)){bl(e);return}s=s!=null?""+Si(s):"",t=t!=null?""+Si(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,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(e.name=k),bl(e)}function xl(e,t,s){t==="number"&&Oa(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function br(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=""+Si(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 xh(e,t,s){if(t!=null&&(t=""+Si(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Si(s):""}function wh(e,t,s,n){if(t==null){if(n!=null){if(s!=null)throw Error(o(92));if(se(n)){if(1<n.length)throw Error(o(93));n=n[0]}s=n}s==null&&(s=""),t=s}s=Si(t),e.defaultValue=s,n=e.textContent,n===s&&n!==""&&n!==null&&(e.value=n),bl(e)}function Cr(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Rv=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 Eh(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||Rv.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Th(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&&Eh(e,l,n)}else for(var _ in t)t.hasOwnProperty(_)&&Eh(e,_,t[_])}function wl(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 Dv=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"]]),kv=/^[\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 Ma(e){return kv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function is(){}var El=null;function Tl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xr=null,wr=null;function Ah(e){var t=ge(e);if(t&&(e=t.stateNode)){var s=e[it]||null;e:switch(e=t.stateNode,t.type){case"input":if(Cl(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="'+bi(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var n=s[t];if(n!==e&&n.form===e.form){var l=n[it]||null;if(!l)throw Error(o(90));Cl(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&&bh(n)}break e;case"textarea":xh(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&br(e,!!s.multiple,t,!1)}}}var Al=!1;function Rh(e,t,s){if(Al)return e(t,s);Al=!0;try{var n=e(t);return n}finally{if(Al=!1,(xr!==null||wr!==null)&&(So(),xr&&(t=xr,e=wr,wr=xr=null,Ah(t),e)))for(t=0;t<e.length;t++)Ah(e[t])}}function Sn(e,t){var s=e.stateNode;if(s===null)return null;var n=s[it]||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 ss=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rl=!1;if(ss)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){Rl=!0}}),window.addEventListener("test",bn,bn),window.removeEventListener("test",bn,bn)}catch{Rl=!1}var Cs=null,Dl=null,La=null;function Dh(){if(La)return La;var e,t=Dl,s=t.length,n,l="value"in Cs?Cs.value:Cs.textContent,_=l.length;for(e=0;e<s&&t[e]===l[e];e++);var k=s-e;for(n=1;n<=k&&t[s-n]===l[_-n];n++);return La=l.slice(e,1<n?1-n:void 0)}function Na(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 Ba(){return!0}function kh(){return!1}function Qt(e){function t(s,n,l,_,k){this._reactName=s,this._targetInst=l,this.type=n,this.nativeEvent=_,this.target=k,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)?Ba:kh,this.isPropagationStopped=kh,this}return m(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=Ba)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ba)},persist:function(){},isPersistent:Ba}),t}var Qs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},za=Qt(Qs),Cn=m({},Qs,{view:0,detail:0}),Ov=Qt(Cn),kl,Ol,xn,ja=m({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ll,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!==xn&&(xn&&e.type==="mousemove"?(kl=e.screenX-xn.screenX,Ol=e.screenY-xn.screenY):Ol=kl=0,xn=e),kl)},movementY:function(e){return"movementY"in e?e.movementY:Ol}}),Oh=Qt(ja),Mv=m({},ja,{dataTransfer:0}),Lv=Qt(Mv),Nv=m({},Cn,{relatedTarget:0}),Ml=Qt(Nv),Bv=m({},Qs,{animationName:0,elapsedTime:0,pseudoElement:0}),zv=Qt(Bv),jv=m({},Qs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hv=Qt(jv),Uv=m({},Qs,{data:0}),Mh=Qt(Uv),Iv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pv={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"},$v={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$v[e])?!!t[e]:!1}function Ll(){return Fv}var Zv=m({},Cn,{key:function(e){if(e.key){var t=Iv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Na(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ll,charCode:function(e){return e.type==="keypress"?Na(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Na(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qv=Qt(Zv),Gv=m({},ja,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lh=Qt(Gv),Wv=m({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ll}),Yv=Qt(Wv),Vv=m({},Qs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kv=Qt(Vv),Xv=m({},ja,{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}),Jv=Qt(Xv),Qv=m({},Qs,{newState:0,oldState:0}),eg=Qt(Qv),tg=[9,13,27,32],Nl=ss&&"CompositionEvent"in window,wn=null;ss&&"documentMode"in document&&(wn=document.documentMode);var ig=ss&&"TextEvent"in window&&!wn,Nh=ss&&(!Nl||wn&&8<wn&&11>=wn),Bh=" ",zh=!1;function jh(e,t){switch(e){case"keyup":return tg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Er=!1;function sg(e,t){switch(e){case"compositionend":return Hh(t);case"keypress":return t.which!==32?null:(zh=!0,Bh);case"textInput":return e=t.data,e===Bh&&zh?null:e;default:return null}}function rg(e,t){if(Er)return e==="compositionend"||!Nl&&jh(e,t)?(e=Dh(),La=Dl=Cs=null,Er=!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 Nh&&t.locale!=="ko"?null:t.data;default:return null}}var ng={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 Uh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ng[e.type]:t==="textarea"}function Ih(e,t,s,n){xr?wr?wr.push(n):wr=[n]:xr=n,t=Ao(t,"onChange"),0<t.length&&(s=new za("onChange","change",null,s,n),e.push({event:s,listeners:t}))}var En=null,Tn=null;function ag(e){x_(e,0)}function Ha(e){var t=Ze(e);if(bh(t))return e}function Ph(e,t){if(e==="change")return t}var $h=!1;if(ss){var Bl;if(ss){var zl="oninput"in document;if(!zl){var Fh=document.createElement("div");Fh.setAttribute("oninput","return;"),zl=typeof Fh.oninput=="function"}Bl=zl}else Bl=!1;$h=Bl&&(!document.documentMode||9<document.documentMode)}function Zh(){En&&(En.detachEvent("onpropertychange",qh),Tn=En=null)}function qh(e){if(e.propertyName==="value"&&Ha(Tn)){var t=[];Ih(t,Tn,e,Tl(e)),Rh(ag,t)}}function og(e,t,s){e==="focusin"?(Zh(),En=t,Tn=s,En.attachEvent("onpropertychange",qh)):e==="focusout"&&Zh()}function lg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ha(Tn)}function cg(e,t){if(e==="click")return Ha(t)}function ug(e,t){if(e==="input"||e==="change")return Ha(t)}function hg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oi=typeof Object.is=="function"?Object.is:hg;function An(e,t){if(oi(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(!mi.call(t,l)||!oi(e[l],t[l]))return!1}return!0}function Gh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wh(e,t){var s=Gh(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=Gh(s)}}function Yh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Oa(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=Oa(e.document)}return t}function jl(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 fg=ss&&"documentMode"in document&&11>=document.documentMode,Tr=null,Hl=null,Rn=null,Ul=!1;function Kh(e,t,s){var n=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ul||Tr==null||Tr!==Oa(n)||(n=Tr,"selectionStart"in n&&jl(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}),Rn&&An(Rn,n)||(Rn=n,n=Ao(Hl,"onSelect"),0<n.length&&(t=new za("onSelect","select",null,t,s),e.push({event:t,listeners:n}),t.target=Tr)))}function er(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Ar={animationend:er("Animation","AnimationEnd"),animationiteration:er("Animation","AnimationIteration"),animationstart:er("Animation","AnimationStart"),transitionrun:er("Transition","TransitionRun"),transitionstart:er("Transition","TransitionStart"),transitioncancel:er("Transition","TransitionCancel"),transitionend:er("Transition","TransitionEnd")},Il={},Xh={};ss&&(Xh=document.createElement("div").style,"AnimationEvent"in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),"TransitionEvent"in window||delete Ar.transitionend.transition);function tr(e){if(Il[e])return Il[e];if(!Ar[e])return e;var t=Ar[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Xh)return Il[e]=t[s];return e}var Jh=tr("animationend"),Qh=tr("animationiteration"),ef=tr("animationstart"),dg=tr("transitionrun"),_g=tr("transitionstart"),mg=tr("transitioncancel"),tf=tr("transitionend"),sf=new Map,Pl="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(" ");Pl.push("scrollEnd");function Bi(e,t){sf.set(e,t),Jt(t,[e])}var Ua=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ci=[],Rr=0,$l=0;function Ia(){for(var e=Rr,t=$l=Rr=0;t<e;){var s=Ci[t];Ci[t++]=null;var n=Ci[t];Ci[t++]=null;var l=Ci[t];Ci[t++]=null;var _=Ci[t];if(Ci[t++]=null,n!==null&&l!==null){var k=n.pending;k===null?l.next=l:(l.next=k.next,k.next=l),n.pending=l}_!==0&&rf(s,l,_)}}function Pa(e,t,s,n){Ci[Rr++]=e,Ci[Rr++]=t,Ci[Rr++]=s,Ci[Rr++]=n,$l|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Fl(e,t,s,n){return Pa(e,t,s,n),$a(e)}function ir(e,t){return Pa(e,null,null,t),$a(e)}function rf(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-gt(s),e=_.hiddenUpdates,n=e[l],n===null?e[l]=[t]:n.push(t),t.lane=s|536870912),_):null}function $a(e){if(50<Kn)throw Kn=0,Jc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Dr={};function pg(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 li(e,t,s,n){return new pg(e,t,s,n)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rs(e,t){var s=e.alternate;return s===null?(s=li(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 nf(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 k=0;if(n=e,typeof e=="function")Zl(e)&&(k=1);else if(typeof e=="string")k=b0(e,s,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case B:return e=li(31,s,t,l),e.elementType=B,e.lanes=_,e;case b:return sr(s.children,l,_,t);case d:k=8,l|=24;break;case p:return e=li(12,s,t,l|2),e.elementType=p,e.lanes=_,e;case R:return e=li(13,s,t,l),e.elementType=R,e.lanes=_,e;case D:return e=li(19,s,t,l),e.elementType=D,e.lanes=_,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case v:k=10;break e;case f:k=9;break e;case S:k=11;break e;case M:k=14;break e;case A:k=16,n=null;break e}k=29,s=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=li(k,s,t,l),t.elementType=e,t.type=n,t.lanes=_,t}function sr(e,t,s,n){return e=li(7,e,n,t),e.lanes=s,e}function ql(e,t,s){return e=li(6,e,null,t),e.lanes=s,e}function af(e){var t=li(18,null,null,0);return t.stateNode=e,t}function Gl(e,t,s){return t=li(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var of=new WeakMap;function xi(e,t){if(typeof e=="object"&&e!==null){var s=of.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Ft(t)},of.set(e,t),t)}return{value:e,source:t,stack:Ft(t)}}var kr=[],Or=0,Za=null,Dn=0,wi=[],Ei=0,xs=null,$i=1,Fi="";function ns(e,t){kr[Or++]=Dn,kr[Or++]=Za,Za=e,Dn=t}function lf(e,t,s){wi[Ei++]=$i,wi[Ei++]=Fi,wi[Ei++]=xs,xs=e;var n=$i;e=Fi;var l=32-gt(n)-1;n&=~(1<<l),s+=1;var _=32-gt(t)+l;if(30<_){var k=l-l%5;_=(n&(1<<k)-1).toString(32),n>>=k,l-=k,$i=1<<32-gt(t)+l|s<<l|n,Fi=_+e}else $i=1<<_|s<<l|n,Fi=e}function Wl(e){e.return!==null&&(ns(e,1),lf(e,1,0))}function Yl(e){for(;e===Za;)Za=kr[--Or],kr[Or]=null,Dn=kr[--Or],kr[Or]=null;for(;e===xs;)xs=wi[--Ei],wi[Ei]=null,Fi=wi[--Ei],wi[Ei]=null,$i=wi[--Ei],wi[Ei]=null}function cf(e,t){wi[Ei++]=$i,wi[Ei++]=Fi,wi[Ei++]=xs,$i=t.id,Fi=t.overflow,xs=e}var jt=null,et=null,He=!1,ws=null,Ti=!1,Vl=Error(o(519));function Es(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw kn(xi(t,e)),Vl}function uf(e){var t=e.stateNode,s=e.type,n=e.memoizedProps;switch(t[yt]=e,t[it]=n,s){case"dialog":Ne("cancel",t),Ne("close",t);break;case"iframe":case"object":case"embed":Ne("load",t);break;case"video":case"audio":for(s=0;s<Jn.length;s++)Ne(Jn[s],t);break;case"source":Ne("error",t);break;case"img":case"image":case"link":Ne("error",t),Ne("load",t);break;case"details":Ne("toggle",t);break;case"input":Ne("invalid",t),Ch(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Ne("invalid",t);break;case"textarea":Ne("invalid",t),wh(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||A_(t.textContent,s)?(n.popover!=null&&(Ne("beforetoggle",t),Ne("toggle",t)),n.onScroll!=null&&Ne("scroll",t),n.onScrollEnd!=null&&Ne("scrollend",t),n.onClick!=null&&(t.onclick=is),t=!0):t=!1,t||Es(e,!0)}function hf(e){for(jt=e.return;jt;)switch(jt.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:jt=jt.return}}function Mr(e){if(e!==jt)return!1;if(!He)return hf(e),He=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||du(e.type,e.memoizedProps)),s=!s),s&&et&&Es(e),hf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));et=z_(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));et=z_(e)}else t===27?(t=et,Us(e.type)?(e=gu,gu=null,et=e):et=t):et=jt?Ri(e.stateNode.nextSibling):null;return!0}function rr(){et=jt=null,He=!1}function Kl(){var e=ws;return e!==null&&(si===null?si=e:si.push.apply(si,e),ws=null),e}function kn(e){ws===null?ws=[e]:ws.push(e)}var Xl=L(null),nr=null,as=null;function Ts(e,t,s){X(Xl,t._currentValue),t._currentValue=s}function os(e){e._currentValue=Xl.current,H(Xl)}function Jl(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 Ql(e,t,s,n){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var _=l.dependencies;if(_!==null){var k=l.child;_=_.firstContext;e:for(;_!==null;){var z=_;_=l;for(var Z=0;Z<t.length;Z++)if(z.context===t[Z]){_.lanes|=s,z=_.alternate,z!==null&&(z.lanes|=s),Jl(_.return,s,e),n||(k=null);break e}_=z.next}}else if(l.tag===18){if(k=l.return,k===null)throw Error(o(341));k.lanes|=s,_=k.alternate,_!==null&&(_.lanes|=s),Jl(k,s,e),k=null}else k=l.child;if(k!==null)k.return=l;else for(k=l;k!==null;){if(k===e){k=null;break}if(l=k.sibling,l!==null){l.return=k.return,k=l;break}k=k.return}l=k}}function Lr(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 k=l.alternate;if(k===null)throw Error(o(387));if(k=k.memoizedProps,k!==null){var z=l.type;oi(l.pendingProps.value,k.value)||(e!==null?e.push(z):e=[z])}}else if(l===Y.current){if(k=l.alternate,k===null)throw Error(o(387));k.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(sa):e=[sa])}l=l.return}e!==null&&Ql(t,e,s,n),t.flags|=262144}function qa(e){for(e=e.firstContext;e!==null;){if(!oi(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ar(e){nr=e,as=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ht(e){return ff(nr,e)}function Ga(e,t){return nr===null&&ar(e),ff(e,t)}function ff(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},as===null){if(e===null)throw Error(o(308));as=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else as=as.next=t;return s}var vg=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()})}},gg=i.unstable_scheduleCallback,yg=i.unstable_NormalPriority,St={$$typeof:v,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ec(){return{controller:new vg,data:new Map,refCount:0}}function On(e){e.refCount--,e.refCount===0&&gg(yg,function(){e.controller.abort()})}var Mn=null,tc=0,Nr=0,Br=null;function Sg(e,t){if(Mn===null){var s=Mn=[];tc=0,Nr=ru(),Br={status:"pending",value:void 0,then:function(n){s.push(n)}}}return tc++,t.then(df,df),t}function df(){if(--tc===0&&Mn!==null){Br!==null&&(Br.status="fulfilled");var e=Mn;Mn=null,Nr=0,Br=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function bg(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 _f=G.S;G.S=function(e,t){Xd=nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Sg(e,t),_f!==null&&_f(e,t)};var or=L(null);function ic(){var e=or.current;return e!==null?e:Je.pooledCache}function Wa(e,t){t===null?X(or,or.current):X(or,t.pool)}function mf(){var e=ic();return e===null?null:{parent:St._currentValue,pool:e}}var zr=Error(o(460)),sc=Error(o(474)),Ya=Error(o(542)),Va={then:function(){}};function pf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function vf(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(is,is),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,yf(e),e;default:if(typeof t.status=="string")t.then(is,is);else{if(e=Je,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,yf(e),e}throw cr=t,zr}}function lr(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(cr=s,zr):s}}var cr=null;function gf(){if(cr===null)throw Error(o(459));var e=cr;return cr=null,e}function yf(e){if(e===zr||e===Ya)throw Error(o(483))}var jr=null,Ln=0;function Ka(e){var t=Ln;return Ln+=1,jr===null&&(jr=[]),vf(jr,e,t)}function Nn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Xa(e,t){throw t.$$typeof===C?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Sf(e){function t(J,V){if(e){var te=J.deletions;te===null?(J.deletions=[V],J.flags|=16):te.push(V)}}function s(J,V){if(!e)return null;for(;V!==null;)t(J,V),V=V.sibling;return null}function n(J){for(var V=new Map;J!==null;)J.key!==null?V.set(J.key,J):V.set(J.index,J),J=J.sibling;return V}function l(J,V){return J=rs(J,V),J.index=0,J.sibling=null,J}function _(J,V,te){return J.index=te,e?(te=J.alternate,te!==null?(te=te.index,te<V?(J.flags|=67108866,V):te):(J.flags|=67108866,V)):(J.flags|=1048576,V)}function k(J){return e&&J.alternate===null&&(J.flags|=67108866),J}function z(J,V,te,ue){return V===null||V.tag!==6?(V=ql(te,J.mode,ue),V.return=J,V):(V=l(V,te),V.return=J,V)}function Z(J,V,te,ue){var Ce=te.type;return Ce===b?le(J,V,te.props.children,ue,te.key):V!==null&&(V.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===A&&lr(Ce)===V.type)?(V=l(V,te.props),Nn(V,te),V.return=J,V):(V=Fa(te.type,te.key,te.props,null,J.mode,ue),Nn(V,te),V.return=J,V)}function ie(J,V,te,ue){return V===null||V.tag!==4||V.stateNode.containerInfo!==te.containerInfo||V.stateNode.implementation!==te.implementation?(V=Gl(te,J.mode,ue),V.return=J,V):(V=l(V,te.children||[]),V.return=J,V)}function le(J,V,te,ue,Ce){return V===null||V.tag!==7?(V=sr(te,J.mode,ue,Ce),V.return=J,V):(V=l(V,te),V.return=J,V)}function de(J,V,te){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=ql(""+V,J.mode,te),V.return=J,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case w:return te=Fa(V.type,V.key,V.props,null,J.mode,te),Nn(te,V),te.return=J,te;case E:return V=Gl(V,J.mode,te),V.return=J,V;case A:return V=lr(V),de(J,V,te)}if(se(V)||q(V))return V=sr(V,J.mode,te,null),V.return=J,V;if(typeof V.then=="function")return de(J,Ka(V),te);if(V.$$typeof===v)return de(J,Ga(J,V),te);Xa(J,V)}return null}function re(J,V,te,ue){var Ce=V!==null?V.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Ce!==null?null:z(J,V,""+te,ue);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case w:return te.key===Ce?Z(J,V,te,ue):null;case E:return te.key===Ce?ie(J,V,te,ue):null;case A:return te=lr(te),re(J,V,te,ue)}if(se(te)||q(te))return Ce!==null?null:le(J,V,te,ue,null);if(typeof te.then=="function")return re(J,V,Ka(te),ue);if(te.$$typeof===v)return re(J,V,Ga(J,te),ue);Xa(J,te)}return null}function ae(J,V,te,ue,Ce){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return J=J.get(te)||null,z(V,J,""+ue,Ce);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case w:return J=J.get(ue.key===null?te:ue.key)||null,Z(V,J,ue,Ce);case E:return J=J.get(ue.key===null?te:ue.key)||null,ie(V,J,ue,Ce);case A:return ue=lr(ue),ae(J,V,te,ue,Ce)}if(se(ue)||q(ue))return J=J.get(te)||null,le(V,J,ue,Ce,null);if(typeof ue.then=="function")return ae(J,V,te,Ka(ue),Ce);if(ue.$$typeof===v)return ae(J,V,te,Ga(V,ue),Ce);Xa(V,ue)}return null}function ye(J,V,te,ue){for(var Ce=null,Pe=null,be=V,De=V=0,ze=null;be!==null&&De<te.length;De++){be.index>De?(ze=be,be=null):ze=be.sibling;var $e=re(J,be,te[De],ue);if($e===null){be===null&&(be=ze);break}e&&be&&$e.alternate===null&&t(J,be),V=_($e,V,De),Pe===null?Ce=$e:Pe.sibling=$e,Pe=$e,be=ze}if(De===te.length)return s(J,be),He&&ns(J,De),Ce;if(be===null){for(;De<te.length;De++)be=de(J,te[De],ue),be!==null&&(V=_(be,V,De),Pe===null?Ce=be:Pe.sibling=be,Pe=be);return He&&ns(J,De),Ce}for(be=n(be);De<te.length;De++)ze=ae(be,J,De,te[De],ue),ze!==null&&(e&&ze.alternate!==null&&be.delete(ze.key===null?De:ze.key),V=_(ze,V,De),Pe===null?Ce=ze:Pe.sibling=ze,Pe=ze);return e&&be.forEach(function(Zs){return t(J,Zs)}),He&&ns(J,De),Ce}function we(J,V,te,ue){if(te==null)throw Error(o(151));for(var Ce=null,Pe=null,be=V,De=V=0,ze=null,$e=te.next();be!==null&&!$e.done;De++,$e=te.next()){be.index>De?(ze=be,be=null):ze=be.sibling;var Zs=re(J,be,$e.value,ue);if(Zs===null){be===null&&(be=ze);break}e&&be&&Zs.alternate===null&&t(J,be),V=_(Zs,V,De),Pe===null?Ce=Zs:Pe.sibling=Zs,Pe=Zs,be=ze}if($e.done)return s(J,be),He&&ns(J,De),Ce;if(be===null){for(;!$e.done;De++,$e=te.next())$e=de(J,$e.value,ue),$e!==null&&(V=_($e,V,De),Pe===null?Ce=$e:Pe.sibling=$e,Pe=$e);return He&&ns(J,De),Ce}for(be=n(be);!$e.done;De++,$e=te.next())$e=ae(be,J,De,$e.value,ue),$e!==null&&(e&&$e.alternate!==null&&be.delete($e.key===null?De:$e.key),V=_($e,V,De),Pe===null?Ce=$e:Pe.sibling=$e,Pe=$e);return e&&be.forEach(function(M0){return t(J,M0)}),He&&ns(J,De),Ce}function Xe(J,V,te,ue){if(typeof te=="object"&&te!==null&&te.type===b&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case w:e:{for(var Ce=te.key;V!==null;){if(V.key===Ce){if(Ce=te.type,Ce===b){if(V.tag===7){s(J,V.sibling),ue=l(V,te.props.children),ue.return=J,J=ue;break e}}else if(V.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===A&&lr(Ce)===V.type){s(J,V.sibling),ue=l(V,te.props),Nn(ue,te),ue.return=J,J=ue;break e}s(J,V);break}else t(J,V);V=V.sibling}te.type===b?(ue=sr(te.props.children,J.mode,ue,te.key),ue.return=J,J=ue):(ue=Fa(te.type,te.key,te.props,null,J.mode,ue),Nn(ue,te),ue.return=J,J=ue)}return k(J);case E:e:{for(Ce=te.key;V!==null;){if(V.key===Ce)if(V.tag===4&&V.stateNode.containerInfo===te.containerInfo&&V.stateNode.implementation===te.implementation){s(J,V.sibling),ue=l(V,te.children||[]),ue.return=J,J=ue;break e}else{s(J,V);break}else t(J,V);V=V.sibling}ue=Gl(te,J.mode,ue),ue.return=J,J=ue}return k(J);case A:return te=lr(te),Xe(J,V,te,ue)}if(se(te))return ye(J,V,te,ue);if(q(te)){if(Ce=q(te),typeof Ce!="function")throw Error(o(150));return te=Ce.call(te),we(J,V,te,ue)}if(typeof te.then=="function")return Xe(J,V,Ka(te),ue);if(te.$$typeof===v)return Xe(J,V,Ga(J,te),ue);Xa(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,V!==null&&V.tag===6?(s(J,V.sibling),ue=l(V,te),ue.return=J,J=ue):(s(J,V),ue=ql(te,J.mode,ue),ue.return=J,J=ue),k(J)):s(J,V)}return function(J,V,te,ue){try{Ln=0;var Ce=Xe(J,V,te,ue);return jr=null,Ce}catch(be){if(be===zr||be===Ya)throw be;var Pe=li(29,be,null,J.mode);return Pe.lanes=ue,Pe.return=J,Pe}finally{}}}var ur=Sf(!0),bf=Sf(!1),As=!1;function rc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Rs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ds(e,t,s){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Fe&2)!==0){var l=n.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),n.pending=t,t=$a(e),rf(e,null,s),t}return Pa(e,n,t,s),$a(e)}function Bn(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,mn(e,s)}}function ac(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 k={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};_===null?l=_=k:_=_.next=k,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 oc=!1;function zn(){if(oc){var e=Br;if(e!==null)throw e}}function jn(e,t,s,n){oc=!1;var l=e.updateQueue;As=!1;var _=l.firstBaseUpdate,k=l.lastBaseUpdate,z=l.shared.pending;if(z!==null){l.shared.pending=null;var Z=z,ie=Z.next;Z.next=null,k===null?_=ie:k.next=ie,k=Z;var le=e.alternate;le!==null&&(le=le.updateQueue,z=le.lastBaseUpdate,z!==k&&(z===null?le.firstBaseUpdate=ie:z.next=ie,le.lastBaseUpdate=Z))}if(_!==null){var de=l.baseState;k=0,le=ie=Z=null,z=_;do{var re=z.lane&-536870913,ae=re!==z.lane;if(ae?(Be&re)===re:(n&re)===re){re!==0&&re===Nr&&(oc=!0),le!==null&&(le=le.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var ye=e,we=z;re=t;var Xe=s;switch(we.tag){case 1:if(ye=we.payload,typeof ye=="function"){de=ye.call(Xe,de,re);break e}de=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=we.payload,re=typeof ye=="function"?ye.call(Xe,de,re):ye,re==null)break e;de=m({},de,re);break e;case 2:As=!0}}re=z.callback,re!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=l.callbacks,ae===null?l.callbacks=[re]:ae.push(re))}else ae={lane:re,tag:z.tag,payload:z.payload,callback:z.callback,next:null},le===null?(ie=le=ae,Z=de):le=le.next=ae,k|=re;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&&(Z=de),l.baseState=Z,l.firstBaseUpdate=ie,l.lastBaseUpdate=le,_===null&&(l.shared.lanes=0),Ns|=k,e.lanes=k,e.memoizedState=de}}function Cf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function xf(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Cf(s[e],t)}var Hr=L(null),Ja=L(0);function wf(e,t){e=ps,X(Ja,e),X(Hr,t),ps=e|t.baseLanes}function lc(){X(Ja,ps),X(Hr,Hr.current)}function cc(){ps=Ja.current,H(Hr),H(Ja)}var ci=L(null),Ai=null;function ks(e){var t=e.alternate;X(mt,mt.current&1),X(ci,e),Ai===null&&(t===null||Hr.current!==null||t.memoizedState!==null)&&(Ai=e)}function uc(e){X(mt,mt.current),X(ci,e),Ai===null&&(Ai=e)}function Ef(e){e.tag===22?(X(mt,mt.current),X(ci,e),Ai===null&&(Ai=e)):Os()}function Os(){X(mt,mt.current),X(ci,ci.current)}function ui(e){H(ci),Ai===e&&(Ai=null),H(mt)}var mt=L(0);function Qa(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||pu(s)||vu(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 ls=0,Re=null,Ve=null,bt=null,eo=!1,Ur=!1,hr=!1,to=0,Hn=0,Ir=null,Cg=0;function ut(){throw Error(o(321))}function hc(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!oi(e[s],t[s]))return!1;return!0}function fc(e,t,s,n,l,_){return ls=_,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?ld:Ac,hr=!1,_=s(n,l),hr=!1,Ur&&(_=Af(t,s,n,l)),Tf(e),_}function Tf(e){G.H=Pn;var t=Ve!==null&&Ve.next!==null;if(ls=0,bt=Ve=Re=null,eo=!1,Hn=0,Ir=null,t)throw Error(o(300));e===null||Ct||(e=e.dependencies,e!==null&&qa(e)&&(Ct=!0))}function Af(e,t,s,n){Re=e;var l=0;do{if(Ur&&(Ir=null),Hn=0,Ur=!1,25<=l)throw Error(o(301));if(l+=1,bt=Ve=null,e.updateQueue!=null){var _=e.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}G.H=cd,_=t(s,n)}while(Ur);return _}function xg(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?Un(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Re.flags|=1024),t}function dc(){var e=to!==0;return to=0,e}function _c(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function mc(e){if(eo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}eo=!1}ls=0,bt=Ve=Re=null,Ur=!1,Hn=to=0,Ir=null}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Re.memoizedState=bt=e:bt=bt.next=e,bt}function pt(){if(Ve===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=bt===null?Re.memoizedState:bt.next;if(t!==null)bt=t,Ve=e;else{if(e===null)throw Re.alternate===null?Error(o(467)):Error(o(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},bt===null?Re.memoizedState=bt=e:bt=bt.next=e}return bt}function io(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Un(e){var t=Hn;return Hn+=1,Ir===null&&(Ir=[]),e=vf(Ir,e,t),t=Re,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?ld:Ac),e}function so(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Un(e);if(e.$$typeof===v)return Ht(e)}throw Error(o(438,String(e)))}function pc(e){var t=null,s=Re.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var n=Re.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=io(),Re.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 cs(e,t){return typeof t=="function"?t(e):t}function ro(e){var t=pt();return vc(t,Ve,e)}function vc(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 k=l.next;l.next=_.next,_.next=k}t.baseQueue=l=_,n.pending=null}if(_=e.baseState,l===null)e.memoizedState=_;else{t=l.next;var z=k=null,Z=null,ie=t,le=!1;do{var de=ie.lane&-536870913;if(de!==ie.lane?(Be&de)===de:(ls&de)===de){var re=ie.revertLane;if(re===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),de===Nr&&(le=!0);else if((ls&re)===re){ie=ie.next,re===Nr&&(le=!0);continue}else de={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Z===null?(z=Z=de,k=_):Z=Z.next=de,Re.lanes|=re,Ns|=re;de=ie.action,hr&&s(_,de),_=ie.hasEagerState?ie.eagerState:s(_,de)}else re={lane:de,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Z===null?(z=Z=re,k=_):Z=Z.next=re,Re.lanes|=de,Ns|=de;ie=ie.next}while(ie!==null&&ie!==t);if(Z===null?k=_:Z.next=z,!oi(_,e.memoizedState)&&(Ct=!0,le&&(s=Br,s!==null)))throw s;e.memoizedState=_,e.baseState=k,e.baseQueue=Z,n.lastRenderedState=_}return l===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function gc(e){var t=pt(),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 k=l=l.next;do _=e(_,k.action),k=k.next;while(k!==l);oi(_,t.memoizedState)||(Ct=!0),t.memoizedState=_,t.baseQueue===null&&(t.baseState=_),s.lastRenderedState=_}return[_,n]}function Rf(e,t,s){var n=Re,l=pt(),_=He;if(_){if(s===void 0)throw Error(o(407));s=s()}else s=t();var k=!oi((Ve||l).memoizedState,s);if(k&&(l.memoizedState=s,Ct=!0),l=l.queue,bc(Of.bind(null,n,l,e),[e]),l.getSnapshot!==t||k||bt!==null&&bt.memoizedState.tag&1){if(n.flags|=2048,Pr(9,{destroy:void 0},kf.bind(null,n,l,s,t),null),Je===null)throw Error(o(349));_||(ls&127)!==0||Df(n,t,s)}return s}function Df(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Re.updateQueue,t===null?(t=io(),Re.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function kf(e,t,s,n){t.value=s,t.getSnapshot=n,Mf(t)&&Lf(e)}function Of(e,t,s){return s(function(){Mf(t)&&Lf(e)})}function Mf(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!oi(e,s)}catch{return!0}}function Lf(e){var t=ir(e,2);t!==null&&ri(t,e,2)}function yc(e){var t=qt();if(typeof e=="function"){var s=e;if(e=s(),hr){Ot(!0);try{s()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t}function Nf(e,t,s,n){return e.baseState=s,vc(e,Ve,typeof n=="function"?n:cs)}function wg(e,t,s,n,l){if(oo(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(k){_.listeners.push(k)}};G.T!==null?s(!0):_.isTransition=!1,n(_),s=t.pending,s===null?(_.next=t.pending=_,Bf(t,_)):(_.next=s.next,t.pending=s.next=_)}}function Bf(e,t){var s=t.action,n=t.payload,l=e.state;if(t.isTransition){var _=G.T,k={};G.T=k;try{var z=s(l,n),Z=G.S;Z!==null&&Z(k,z),zf(e,t,z)}catch(ie){Sc(e,t,ie)}finally{_!==null&&k.types!==null&&(_.types=k.types),G.T=_}}else try{_=s(l,n),zf(e,t,_)}catch(ie){Sc(e,t,ie)}}function zf(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(n){jf(e,t,n)},function(n){return Sc(e,t,n)}):jf(e,t,s)}function jf(e,t,s){t.status="fulfilled",t.value=s,Hf(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Bf(e,s)))}function Sc(e,t,s){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=s,Hf(t),t=t.next;while(t!==n)}e.action=null}function Hf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Uf(e,t){return t}function If(e,t){if(He){var s=Je.formState;if(s!==null){e:{var n=Re;if(He){if(et){t:{for(var l=et,_=Ti;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){et=Ri(l.nextSibling),n=l.data==="F!";break e}}Es(n)}n=!1}n&&(t=s[0])}}return s=qt(),s.memoizedState=s.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uf,lastRenderedState:t},s.queue=n,s=nd.bind(null,Re,n),n.dispatch=s,n=yc(!1),_=Tc.bind(null,Re,!1,n.queue),n=qt(),l={state:t,dispatch:null,action:e,pending:null},n.queue=l,s=wg.bind(null,Re,l,_,s),l.dispatch=s,n.memoizedState=e,[t,s,!1]}function Pf(e){var t=pt();return $f(t,Ve,e)}function $f(e,t,s){if(t=vc(e,t,Uf)[0],e=ro(cs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Un(t)}catch(k){throw k===zr?Ya:k}else n=t;t=pt();var l=t.queue,_=l.dispatch;return s!==t.memoizedState&&(Re.flags|=2048,Pr(9,{destroy:void 0},Eg.bind(null,l,s),null)),[n,_,e]}function Eg(e,t){e.action=t}function Ff(e){var t=pt(),s=Ve;if(s!==null)return $f(t,s,e);pt(),t=t.memoizedState,s=pt();var n=s.queue.dispatch;return s.memoizedState=e,[t,n,!1]}function Pr(e,t,s,n){return e={tag:e,create:s,deps:n,inst:t,next:null},t=Re.updateQueue,t===null&&(t=io(),Re.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 Zf(){return pt().memoizedState}function no(e,t,s,n){var l=qt();Re.flags|=e,l.memoizedState=Pr(1|t,{destroy:void 0},s,n===void 0?null:n)}function ao(e,t,s,n){var l=pt();n=n===void 0?null:n;var _=l.memoizedState.inst;Ve!==null&&n!==null&&hc(n,Ve.memoizedState.deps)?l.memoizedState=Pr(t,_,s,n):(Re.flags|=e,l.memoizedState=Pr(1|t,_,s,n))}function qf(e,t){no(8390656,8,e,t)}function bc(e,t){ao(2048,8,e,t)}function Tg(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=io(),Re.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Gf(e){var t=pt().memoizedState;return Tg({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Wf(e,t){return ao(4,2,e,t)}function Yf(e,t){return ao(4,4,e,t)}function Vf(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 Kf(e,t,s){s=s!=null?s.concat([e]):null,ao(4,4,Vf.bind(null,t,e),s)}function Cc(){}function Xf(e,t){var s=pt();t=t===void 0?null:t;var n=s.memoizedState;return t!==null&&hc(t,n[1])?n[0]:(s.memoizedState=[e,t],e)}function Jf(e,t){var s=pt();t=t===void 0?null:t;var n=s.memoizedState;if(t!==null&&hc(t,n[1]))return n[0];if(n=e(),hr){Ot(!0);try{e()}finally{Ot(!1)}}return s.memoizedState=[n,t],n}function xc(e,t,s){return s===void 0||(ls&1073741824)!==0&&(Be&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Qd(),Re.lanes|=e,Ns|=e,s)}function Qf(e,t,s,n){return oi(s,t)?s:Hr.current!==null?(e=xc(e,s,n),oi(e,t)||(Ct=!0),e):(ls&42)===0||(ls&1073741824)!==0&&(Be&261930)===0?(Ct=!0,e.memoizedState=s):(e=Qd(),Re.lanes|=e,Ns|=e,t)}function ed(e,t,s,n,l){var _=K.p;K.p=_!==0&&8>_?_:8;var k=G.T,z={};G.T=z,Tc(e,!1,t,s);try{var Z=l(),ie=G.S;if(ie!==null&&ie(z,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var le=bg(Z,n);In(e,t,le,di(e))}else In(e,t,n,di(e))}catch(de){In(e,t,{then:function(){},status:"rejected",reason:de},di())}finally{K.p=_,k!==null&&z.types!==null&&(k.types=z.types),G.T=k}}function Ag(){}function wc(e,t,s,n){if(e.tag!==5)throw Error(o(476));var l=td(e).queue;ed(e,l,t,ee,s===null?Ag:function(){return id(e),s(n)})}function td(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:ee},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function id(e){var t=td(e);t.next===null&&(t=e.alternate.memoizedState),In(e,t.next.queue,{},di())}function Ec(){return Ht(sa)}function sd(){return pt().memoizedState}function rd(){return pt().memoizedState}function Rg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=di();e=Rs(s);var n=Ds(t,e,s);n!==null&&(ri(n,t,s),Bn(n,t,s)),t={cache:ec()},e.payload=t;return}t=t.return}}function Dg(e,t,s){var n=di();s={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},oo(e)?ad(t,s):(s=Fl(e,t,s,n),s!==null&&(ri(s,e,n),od(s,t,n)))}function nd(e,t,s){var n=di();In(e,t,s,n)}function In(e,t,s,n){var l={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(oo(e))ad(t,l);else{var _=e.alternate;if(e.lanes===0&&(_===null||_.lanes===0)&&(_=t.lastRenderedReducer,_!==null))try{var k=t.lastRenderedState,z=_(k,s);if(l.hasEagerState=!0,l.eagerState=z,oi(z,k))return Pa(e,t,l,0),Je===null&&Ia(),!1}catch{}finally{}if(s=Fl(e,t,l,n),s!==null)return ri(s,e,n),od(s,t,n),!0}return!1}function Tc(e,t,s,n){if(n={lane:2,revertLane:ru(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},oo(e)){if(t)throw Error(o(479))}else t=Fl(e,s,n,2),t!==null&&ri(t,e,2)}function oo(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function ad(e,t){Ur=eo=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function od(e,t,s){if((s&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,mn(e,s)}}var Pn={readContext:Ht,use:so,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};Pn.useEffectEvent=ut;var ld={readContext:Ht,use:so,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:qf,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,no(4194308,4,Vf.bind(null,t,e),s)},useLayoutEffect:function(e,t){return no(4194308,4,e,t)},useInsertionEffect:function(e,t){no(4,2,e,t)},useMemo:function(e,t){var s=qt();t=t===void 0?null:t;var n=e();if(hr){Ot(!0);try{e()}finally{Ot(!1)}}return s.memoizedState=[n,t],n},useReducer:function(e,t,s){var n=qt();if(s!==void 0){var l=s(t);if(hr){Ot(!0);try{s(t)}finally{Ot(!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=Dg.bind(null,Re,e),[n.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,s=nd.bind(null,Re,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Cc,useDeferredValue:function(e,t){var s=qt();return xc(s,e,t)},useTransition:function(){var e=yc(!1);return e=ed.bind(null,Re,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var n=Re,l=qt();if(He){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),Je===null)throw Error(o(349));(Be&127)!==0||Df(n,t,s)}l.memoizedState=s;var _={value:s,getSnapshot:t};return l.queue=_,qf(Of.bind(null,n,_,e),[e]),n.flags|=2048,Pr(9,{destroy:void 0},kf.bind(null,n,_,s,t),null),s},useId:function(){var e=qt(),t=Je.identifierPrefix;if(He){var s=Fi,n=$i;s=(n&~(1<<32-gt(n)-1)).toString(32)+s,t="_"+t+"R_"+s,s=to++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=Cg++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ec,useFormState:If,useActionState:If,useOptimistic:function(e){var t=qt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Tc.bind(null,Re,!0,s),s.dispatch=t,[e,t]},useMemoCache:pc,useCacheRefresh:function(){return qt().memoizedState=Rg.bind(null,Re)},useEffectEvent:function(e){var t=qt(),s={impl:e};return t.memoizedState=s,function(){if((Fe&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Ac={readContext:Ht,use:so,useCallback:Xf,useContext:Ht,useEffect:bc,useImperativeHandle:Kf,useInsertionEffect:Wf,useLayoutEffect:Yf,useMemo:Jf,useReducer:ro,useRef:Zf,useState:function(){return ro(cs)},useDebugValue:Cc,useDeferredValue:function(e,t){var s=pt();return Qf(s,Ve.memoizedState,e,t)},useTransition:function(){var e=ro(cs)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:Un(e),t]},useSyncExternalStore:Rf,useId:sd,useHostTransitionStatus:Ec,useFormState:Pf,useActionState:Pf,useOptimistic:function(e,t){var s=pt();return Nf(s,Ve,e,t)},useMemoCache:pc,useCacheRefresh:rd};Ac.useEffectEvent=Gf;var cd={readContext:Ht,use:so,useCallback:Xf,useContext:Ht,useEffect:bc,useImperativeHandle:Kf,useInsertionEffect:Wf,useLayoutEffect:Yf,useMemo:Jf,useReducer:gc,useRef:Zf,useState:function(){return gc(cs)},useDebugValue:Cc,useDeferredValue:function(e,t){var s=pt();return Ve===null?xc(s,e,t):Qf(s,Ve.memoizedState,e,t)},useTransition:function(){var e=gc(cs)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:Un(e),t]},useSyncExternalStore:Rf,useId:sd,useHostTransitionStatus:Ec,useFormState:Ff,useActionState:Ff,useOptimistic:function(e,t){var s=pt();return Ve!==null?Nf(s,Ve,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:pc,useCacheRefresh:rd};cd.useEffectEvent=Gf;function Rc(e,t,s,n){t=e.memoizedState,s=s(n,t),s=s==null?t:m({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Dc={enqueueSetState:function(e,t,s){e=e._reactInternals;var n=di(),l=Rs(n);l.payload=t,s!=null&&(l.callback=s),t=Ds(e,l,n),t!==null&&(ri(t,e,n),Bn(t,e,n))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var n=di(),l=Rs(n);l.tag=1,l.payload=t,s!=null&&(l.callback=s),t=Ds(e,l,n),t!==null&&(ri(t,e,n),Bn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=di(),n=Rs(s);n.tag=2,t!=null&&(n.callback=t),t=Ds(e,n,s),t!==null&&(ri(t,e,s),Bn(t,e,s))}};function ud(e,t,s,n,l,_,k){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,_,k):t.prototype&&t.prototype.isPureReactComponent?!An(s,n)||!An(l,_):!0}function hd(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&&Dc.enqueueReplaceState(t,t.state,null)}function fr(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=m({},s));for(var l in e)s[l]===void 0&&(s[l]=e[l])}return s}function fd(e){Ua(e)}function dd(e){console.error(e)}function _d(e){Ua(e)}function lo(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function md(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 kc(e,t,s){return s=Rs(s),s.tag=3,s.payload={element:null},s.callback=function(){lo(e,t)},s}function pd(e){return e=Rs(e),e.tag=3,e}function vd(e,t,s,n){var l=s.type.getDerivedStateFromError;if(typeof l=="function"){var _=n.value;e.payload=function(){return l(_)},e.callback=function(){md(t,s,n)}}var k=s.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(e.callback=function(){md(t,s,n),typeof l!="function"&&(Bs===null?Bs=new Set([this]):Bs.add(this));var z=n.stack;this.componentDidCatch(n.value,{componentStack:z!==null?z:""})})}function kg(e,t,s,n,l){if(s.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=s.alternate,t!==null&&Lr(t,s,l,!0),s=ci.current,s!==null){switch(s.tag){case 31:case 13:return Ai===null?bo():s.alternate===null&&ht===0&&(ht=3),s.flags&=-257,s.flags|=65536,s.lanes=l,n===Va?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([n]):t.add(n),tu(e,n,l)),!1;case 22:return s.flags|=65536,n===Va?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)),tu(e,n,l)),!1}throw Error(o(435,s.tag))}return tu(e,n,l),bo(),!1}if(He)return t=ci.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,n!==Vl&&(e=Error(o(422),{cause:n}),kn(xi(e,s)))):(n!==Vl&&(t=Error(o(423),{cause:n}),kn(xi(t,s))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,n=xi(n,s),l=kc(e.stateNode,n,l),ac(e,l),ht!==4&&(ht=2)),!1;var _=Error(o(520),{cause:n});if(_=xi(_,s),Vn===null?Vn=[_]:Vn.push(_),ht!==4&&(ht=2),t===null)return!0;n=xi(n,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=l&-l,s.lanes|=e,e=kc(s.stateNode,n,e),ac(s,e),!1;case 1:if(t=s.type,_=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Bs===null||!Bs.has(_))))return s.flags|=65536,l&=-l,s.lanes|=l,l=pd(l),vd(l,e,s,n),ac(s,l),!1}s=s.return}while(s!==null);return!1}var Oc=Error(o(461)),Ct=!1;function Ut(e,t,s,n){t.child=e===null?bf(t,null,s,n):ur(t,e.child,s,n)}function gd(e,t,s,n,l){s=s.render;var _=t.ref;if("ref"in n){var k={};for(var z in n)z!=="ref"&&(k[z]=n[z])}else k=n;return ar(t),n=fc(e,t,s,k,_,l),z=dc(),e!==null&&!Ct?(_c(e,t,l),us(e,t,l)):(He&&z&&Wl(t),t.flags|=1,Ut(e,t,n,l),t.child)}function yd(e,t,s,n,l){if(e===null){var _=s.type;return typeof _=="function"&&!Zl(_)&&_.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=_,Sd(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,!Uc(e,l)){var k=_.memoizedProps;if(s=s.compare,s=s!==null?s:An,s(k,n)&&e.ref===t.ref)return us(e,t,l)}return t.flags|=1,e=rs(_,n),e.ref=t.ref,e.return=t,t.child=e}function Sd(e,t,s,n,l){if(e!==null){var _=e.memoizedProps;if(An(_,n)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=n=_,Uc(e,l))(e.flags&131072)!==0&&(Ct=!0);else return t.lanes=e.lanes,us(e,t,l)}return Mc(e,t,s,n,l)}function bd(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 Cd(e,t,_,s,n)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wa(t,_!==null?_.cachePool:null),_!==null?wf(t,_):lc(),Ef(t);else return n=t.lanes=536870912,Cd(e,t,_!==null?_.baseLanes|s:s,s,n)}else _!==null?(Wa(t,_.cachePool),wf(t,_),Os(),t.memoizedState=null):(e!==null&&Wa(t,null),lc(),Os());return Ut(e,t,l,s),t.child}function $n(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Cd(e,t,s,n,l){var _=ic();return _=_===null?null:{parent:St._currentValue,pool:_},t.memoizedState={baseLanes:s,cachePool:_},e!==null&&Wa(t,null),lc(),Ef(t),e!==null&&Lr(e,t,n,!0),t.childLanes=l,null}function co(e,t){return t=ho({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function xd(e,t,s){return ur(t,e.child,null,s),e=co(t,t.pendingProps),e.flags|=2,ui(t),t.memoizedState=null,e}function Og(e,t,s){var n=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(n.mode==="hidden")return e=co(t,n),t.lanes=536870912,$n(null,e);if(uc(t),(e=et)?(e=B_(e,Ti),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xs!==null?{id:$i,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},s=af(e),s.return=t,t.child=s,jt=t,et=null)):e=null,e===null)throw Es(t);return t.lanes=536870912,null}return co(t,n)}var _=e.memoizedState;if(_!==null){var k=_.dehydrated;if(uc(t),l)if(t.flags&256)t.flags&=-257,t=xd(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ct||Lr(e,t,s,!1),l=(s&e.childLanes)!==0,Ct||l){if(n=Je,n!==null&&(k=Ea(n,s),k!==0&&k!==_.retryLane))throw _.retryLane=k,ir(e,k),ri(n,e,k),Oc;bo(),t=xd(e,t,s)}else e=_.treeContext,et=Ri(k.nextSibling),jt=t,He=!0,ws=null,Ti=!1,e!==null&&cf(t,e),t=co(t,n),t.flags|=4096;return t}return e=rs(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uo(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 Mc(e,t,s,n,l){return ar(t),s=fc(e,t,s,n,void 0,l),n=dc(),e!==null&&!Ct?(_c(e,t,l),us(e,t,l)):(He&&n&&Wl(t),t.flags|=1,Ut(e,t,s,l),t.child)}function wd(e,t,s,n,l,_){return ar(t),t.updateQueue=null,s=Af(t,n,s,l),Tf(e),n=dc(),e!==null&&!Ct?(_c(e,t,_),us(e,t,_)):(He&&n&&Wl(t),t.flags|=1,Ut(e,t,s,_),t.child)}function Ed(e,t,s,n,l){if(ar(t),t.stateNode===null){var _=Dr,k=s.contextType;typeof k=="object"&&k!==null&&(_=Ht(k)),_=new s(n,_),t.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Dc,t.stateNode=_,_._reactInternals=t,_=t.stateNode,_.props=n,_.state=t.memoizedState,_.refs={},rc(t),k=s.contextType,_.context=typeof k=="object"&&k!==null?Ht(k):Dr,_.state=t.memoizedState,k=s.getDerivedStateFromProps,typeof k=="function"&&(Rc(t,s,k,n),_.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(k=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),k!==_.state&&Dc.enqueueReplaceState(_,_.state,null),jn(t,n,_,l),zn(),_.state=t.memoizedState),typeof _.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){_=t.stateNode;var z=t.memoizedProps,Z=fr(s,z);_.props=Z;var ie=_.context,le=s.contextType;k=Dr,typeof le=="object"&&le!==null&&(k=Ht(le));var de=s.getDerivedStateFromProps;le=typeof de=="function"||typeof _.getSnapshotBeforeUpdate=="function",z=t.pendingProps!==z,le||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(z||ie!==k)&&hd(t,_,n,k),As=!1;var re=t.memoizedState;_.state=re,jn(t,n,_,l),zn(),ie=t.memoizedState,z||re!==ie||As?(typeof de=="function"&&(Rc(t,s,de,n),ie=t.memoizedState),(Z=As||ud(t,s,Z,n,re,ie,k))?(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=k,n=Z):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{_=t.stateNode,nc(e,t),k=t.memoizedProps,le=fr(s,k),_.props=le,de=t.pendingProps,re=_.context,ie=s.contextType,Z=Dr,typeof ie=="object"&&ie!==null&&(Z=Ht(ie)),z=s.getDerivedStateFromProps,(ie=typeof z=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(k!==de||re!==Z)&&hd(t,_,n,Z),As=!1,re=t.memoizedState,_.state=re,jn(t,n,_,l),zn();var ae=t.memoizedState;k!==de||re!==ae||As||e!==null&&e.dependencies!==null&&qa(e.dependencies)?(typeof z=="function"&&(Rc(t,s,z,n),ae=t.memoizedState),(le=As||ud(t,s,le,n,re,ae,Z)||e!==null&&e.dependencies!==null&&qa(e.dependencies))?(ie||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(n,ae,Z),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(n,ae,Z)),typeof _.componentDidUpdate=="function"&&(t.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof _.componentDidUpdate!="function"||k===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||k===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=ae),_.props=n,_.state=ae,_.context=Z,n=le):(typeof _.componentDidUpdate!="function"||k===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||k===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),n=!1)}return _=n,uo(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=ur(t,e.child,null,l),t.child=ur(t,null,s,l)):Ut(e,t,s,l),t.memoizedState=_.state,e=t.child):e=us(e,t,l),e}function Td(e,t,s,n){return rr(),t.flags|=256,Ut(e,t,s,n),t.child}var Lc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nc(e){return{baseLanes:e,cachePool:mf()}}function Bc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=fi),e}function Ad(e,t,s){var n=t.pendingProps,l=!1,_=(t.flags&128)!==0,k;if((k=_)||(k=e!==null&&e.memoizedState===null?!1:(mt.current&2)!==0),k&&(l=!0,t.flags&=-129),k=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(l?ks(t):Os(),(e=et)?(e=B_(e,Ti),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xs!==null?{id:$i,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},s=af(e),s.return=t,t.child=s,jt=t,et=null)):e=null,e===null)throw Es(t);return vu(e)?t.lanes=32:t.lanes=536870912,null}var z=n.children;return n=n.fallback,l?(Os(),l=t.mode,z=ho({mode:"hidden",children:z},l),n=sr(n,l,s,null),z.return=t,n.return=t,z.sibling=n,t.child=z,n=t.child,n.memoizedState=Nc(s),n.childLanes=Bc(e,k,s),t.memoizedState=Lc,$n(null,n)):(ks(t),zc(t,z))}var Z=e.memoizedState;if(Z!==null&&(z=Z.dehydrated,z!==null)){if(_)t.flags&256?(ks(t),t.flags&=-257,t=jc(e,t,s)):t.memoizedState!==null?(Os(),t.child=e.child,t.flags|=128,t=null):(Os(),z=n.fallback,l=t.mode,n=ho({mode:"visible",children:n.children},l),z=sr(z,l,s,null),z.flags|=2,n.return=t,z.return=t,n.sibling=z,t.child=n,ur(t,e.child,null,s),n=t.child,n.memoizedState=Nc(s),n.childLanes=Bc(e,k,s),t.memoizedState=Lc,t=$n(null,n));else if(ks(t),vu(z)){if(k=z.nextSibling&&z.nextSibling.dataset,k)var ie=k.dgst;k=ie,n=Error(o(419)),n.stack="",n.digest=k,kn({value:n,source:null,stack:null}),t=jc(e,t,s)}else if(Ct||Lr(e,t,s,!1),k=(s&e.childLanes)!==0,Ct||k){if(k=Je,k!==null&&(n=Ea(k,s),n!==0&&n!==Z.retryLane))throw Z.retryLane=n,ir(e,n),ri(k,e,n),Oc;pu(z)||bo(),t=jc(e,t,s)}else pu(z)?(t.flags|=192,t.child=e.child,t=null):(e=Z.treeContext,et=Ri(z.nextSibling),jt=t,He=!0,ws=null,Ti=!1,e!==null&&cf(t,e),t=zc(t,n.children),t.flags|=4096);return t}return l?(Os(),z=n.fallback,l=t.mode,Z=e.child,ie=Z.sibling,n=rs(Z,{mode:"hidden",children:n.children}),n.subtreeFlags=Z.subtreeFlags&65011712,ie!==null?z=rs(ie,z):(z=sr(z,l,s,null),z.flags|=2),z.return=t,n.return=t,n.sibling=z,t.child=n,$n(null,n),n=t.child,z=e.child.memoizedState,z===null?z=Nc(s):(l=z.cachePool,l!==null?(Z=St._currentValue,l=l.parent!==Z?{parent:Z,pool:Z}:l):l=mf(),z={baseLanes:z.baseLanes|s,cachePool:l}),n.memoizedState=z,n.childLanes=Bc(e,k,s),t.memoizedState=Lc,$n(e.child,n)):(ks(t),s=e.child,e=s.sibling,s=rs(s,{mode:"visible",children:n.children}),s.return=t,s.sibling=null,e!==null&&(k=t.deletions,k===null?(t.deletions=[e],t.flags|=16):k.push(e)),t.child=s,t.memoizedState=null,s)}function zc(e,t){return t=ho({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ho(e,t){return e=li(22,e,null,t),e.lanes=0,e}function jc(e,t,s){return ur(t,e.child,null,s),e=zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rd(e,t,s){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Jl(e.return,t,s)}function Hc(e,t,s,n,l,_){var k=e.memoizedState;k===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:l,treeForkCount:_}:(k.isBackwards=t,k.rendering=null,k.renderingStartTime=0,k.last=n,k.tail=s,k.tailMode=l,k.treeForkCount=_)}function Dd(e,t,s){var n=t.pendingProps,l=n.revealOrder,_=n.tail;n=n.children;var k=mt.current,z=(k&2)!==0;if(z?(k=k&1|2,t.flags|=128):k&=1,X(mt,k),Ut(e,t,n,s),n=He?Dn:0,!z&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rd(e,s,t);else if(e.tag===19)Rd(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&&Qa(e)===null&&(l=s),s=s.sibling;s=l,s===null?(l=t.child,t.child=null):(l=s.sibling,s.sibling=null),Hc(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&&Qa(e)===null){t.child=l;break}e=l.sibling,l.sibling=s,s=l,l=e}Hc(t,!0,s,null,_,n);break;case"together":Hc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function us(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ns|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Lr(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=rs(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=rs(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Uc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&qa(e)))}function Mg(e,t,s){switch(t.tag){case 3:j(t,t.stateNode.containerInfo),Ts(t,St,e.memoizedState.cache),rr();break;case 27:case 5:oe(t);break;case 4:j(t,t.stateNode.containerInfo);break;case 10:Ts(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,uc(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(ks(t),t.flags|=128,null):(s&t.child.childLanes)!==0?Ad(e,t,s):(ks(t),e=us(e,t,s),e!==null?e.sibling:null);ks(t);break;case 19:var l=(e.flags&128)!==0;if(n=(s&t.childLanes)!==0,n||(Lr(e,t,s,!1),n=(s&t.childLanes)!==0),l){if(n)return Dd(e,t,s);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),X(mt,mt.current),n)break;return null;case 22:return t.lanes=0,bd(e,t,s,t.pendingProps);case 24:Ts(t,St,e.memoizedState.cache)}return us(e,t,s)}function kd(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ct=!0;else{if(!Uc(e,s)&&(t.flags&128)===0)return Ct=!1,Mg(e,t,s);Ct=(e.flags&131072)!==0}else Ct=!1,He&&(t.flags&1048576)!==0&&lf(t,Dn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=lr(t.elementType),t.type=e,typeof e=="function")Zl(e)?(n=fr(e,n),t.tag=1,t=Ed(null,t,e,n,s)):(t.tag=0,t=Mc(null,t,e,n,s));else{if(e!=null){var l=e.$$typeof;if(l===S){t.tag=11,t=gd(null,t,e,n,s);break e}else if(l===M){t.tag=14,t=yd(null,t,e,n,s);break e}}throw t=Q(e)||e,Error(o(306,t,""))}}return t;case 0:return Mc(e,t,t.type,t.pendingProps,s);case 1:return n=t.type,l=fr(n,t.pendingProps),Ed(e,t,n,l,s);case 3:e:{if(j(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var _=t.memoizedState;l=_.element,nc(e,t),jn(t,n,null,s);var k=t.memoizedState;if(n=k.cache,Ts(t,St,n),n!==_.cache&&Ql(t,[St],s,!0),zn(),n=k.element,_.isDehydrated)if(_={element:n,isDehydrated:!1,cache:k.cache},t.updateQueue.baseState=_,t.memoizedState=_,t.flags&256){t=Td(e,t,n,s);break e}else if(n!==l){l=xi(Error(o(424)),t),kn(l),t=Td(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(et=Ri(e.firstChild),jt=t,He=!0,ws=null,Ti=!0,s=bf(t,null,n,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(rr(),n===l){t=us(e,t,s);break e}Ut(e,t,n,s)}t=t.child}return t;case 26:return uo(e,t),e===null?(s=P_(t.type,null,t.pendingProps,null))?t.memoizedState=s:He||(s=t.type,e=t.pendingProps,n=Ro(me.current).createElement(s),n[yt]=t,n[it]=e,It(n,s,e),ke(n),t.stateNode=n):t.memoizedState=P_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&He&&(n=t.stateNode=H_(t.type,t.pendingProps,me.current),jt=t,Ti=!0,l=et,Us(t.type)?(gu=l,et=Ri(n.firstChild)):et=l),Ut(e,t,t.pendingProps.children,s),uo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((l=n=et)&&(n=l0(n,t.type,t.pendingProps,Ti),n!==null?(t.stateNode=n,jt=t,et=Ri(n.firstChild),Ti=!1,l=!0):l=!1),l||Es(t)),oe(t),l=t.type,_=t.pendingProps,k=e!==null?e.memoizedProps:null,n=_.children,du(l,_)?n=null:k!==null&&du(l,k)&&(t.flags|=32),t.memoizedState!==null&&(l=fc(e,t,xg,null,null,s),sa._currentValue=l),uo(e,t),Ut(e,t,n,s),t.child;case 6:return e===null&&He&&((e=s=et)&&(s=c0(s,t.pendingProps,Ti),s!==null?(t.stateNode=s,jt=t,et=null,e=!0):e=!1),e||Es(t)),null;case 13:return Ad(e,t,s);case 4:return j(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ur(t,null,n,s):Ut(e,t,n,s),t.child;case 11:return gd(e,t,t.type,t.pendingProps,s);case 7:return Ut(e,t,t.pendingProps,s),t.child;case 8:return Ut(e,t,t.pendingProps.children,s),t.child;case 12:return Ut(e,t,t.pendingProps.children,s),t.child;case 10:return n=t.pendingProps,Ts(t,t.type,n.value),Ut(e,t,n.children,s),t.child;case 9:return l=t.type._context,n=t.pendingProps.children,ar(t),l=Ht(l),n=n(l),t.flags|=1,Ut(e,t,n,s),t.child;case 14:return yd(e,t,t.type,t.pendingProps,s);case 15:return Sd(e,t,t.type,t.pendingProps,s);case 19:return Dd(e,t,s);case 31:return Og(e,t,s);case 22:return bd(e,t,s,t.pendingProps);case 24:return ar(t),n=Ht(St),e===null?(l=ic(),l===null&&(l=Je,_=ec(),l.pooledCache=_,_.refCount++,_!==null&&(l.pooledCacheLanes|=s),l=_),t.memoizedState={parent:n,cache:l},rc(t),Ts(t,St,l)):((e.lanes&s)!==0&&(nc(e,t),jn(t,null,null,s),zn()),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),Ts(t,St,n)):(n=_.cache,Ts(t,St,n),n!==l.cache&&Ql(t,[St],s,!0))),Ut(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function hs(e){e.flags|=4}function Ic(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(s_())e.flags|=8192;else throw cr=Va,sc}else e.flags&=-16777217}function Od(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!G_(t))if(s_())e.flags|=8192;else throw cr=Va,sc}function fo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Qi():536870912,e.lanes|=t,qr|=t)}function Fn(e,t){if(!He)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 tt(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 Lg(e,t,s){var n=t.pendingProps;switch(Yl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:return s=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),os(St),ce(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Mr(t)?hs(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Kl())),tt(t),null;case 26:var l=t.type,_=t.memoizedState;return e===null?(hs(t),_!==null?(tt(t),Od(t,_)):(tt(t),Ic(t,l,null,n,s))):_?_!==e.memoizedState?(hs(t),tt(t),Od(t,_)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&hs(t),tt(t),Ic(t,l,e,n,s)),null;case 27:if(ve(t),s=me.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&hs(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return tt(t),null}e=ne.current,Mr(t)?uf(t):(e=H_(l,n,s),t.stateNode=e,hs(t))}return tt(t),null;case 5:if(ve(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&hs(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return tt(t),null}if(_=ne.current,Mr(t))uf(t);else{var k=Ro(me.current);switch(_){case 1:_=k.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:_=k.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":_=k.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":_=k.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":_=k.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof n.is=="string"?k.createElement("select",{is:n.is}):k.createElement("select"),n.multiple?_.multiple=!0:n.size&&(_.size=n.size);break;default:_=typeof n.is=="string"?k.createElement(l,{is:n.is}):k.createElement(l)}}_[yt]=t,_[it]=n;e:for(k=t.child;k!==null;){if(k.tag===5||k.tag===6)_.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===t)break e;for(;k.sibling===null;){if(k.return===null||k.return===t)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}t.stateNode=_;e:switch(It(_,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&&hs(t)}}return tt(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&hs(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=me.current,Mr(t)){if(e=t.stateNode,s=t.memoizedProps,n=null,l=jt,l!==null)switch(l.tag){case 27:case 5:n=l.memoizedProps}e[yt]=t,e=!!(e.nodeValue===s||n!==null&&n.suppressHydrationWarning===!0||A_(e.nodeValue,s)),e||Es(t,!0)}else e=Ro(e).createTextNode(n),e[yt]=t,t.stateNode=e}return tt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(n=Mr(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[yt]=t}else rr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else s=Kl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(ui(t),t):(ui(t),null);if((t.flags&128)!==0)throw Error(o(558))}return tt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Mr(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[yt]=t}else rr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),l=!1}else l=Kl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(ui(t),t):(ui(t),null)}return ui(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),fo(t,t.updateQueue),tt(t),null);case 4:return ce(),e===null&&lu(t.stateNode.containerInfo),tt(t),null;case 10:return os(t.type),tt(t),null;case 19:if(H(mt),n=t.memoizedState,n===null)return tt(t),null;if(l=(t.flags&128)!==0,_=n.rendering,_===null)if(l)Fn(n,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(_=Qa(e),_!==null){for(t.flags|=128,Fn(n,!1),e=_.updateQueue,t.updateQueue=e,fo(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)nf(s,e),s=s.sibling;return X(mt,mt.current&1|2),He&&ns(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&nt()>go&&(t.flags|=128,l=!0,Fn(n,!1),t.lanes=4194304)}else{if(!l)if(e=Qa(_),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,fo(t,e),Fn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!_.alternate&&!He)return tt(t),null}else 2*nt()-n.renderingStartTime>go&&s!==536870912&&(t.flags|=128,l=!0,Fn(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=nt(),e.sibling=null,s=mt.current,X(mt,l?s&1|2:s&1),He&&ns(t,n.treeForkCount),e):(tt(t),null);case 22:case 23:return ui(t),cc(),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&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),s=t.updateQueue,s!==null&&fo(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&&H(or),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),os(St),tt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Ng(e,t){switch(Yl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(St),ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(ui(t),t.alternate===null)throw Error(o(340));rr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ui(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));rr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(mt),null;case 4:return ce(),null;case 10:return os(t.type),null;case 22:case 23:return ui(t),cc(),e!==null&&H(or),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return os(St),null;case 25:return null;default:return null}}function Md(e,t){switch(Yl(t),t.tag){case 3:os(St),ce();break;case 26:case 27:case 5:ve(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&ui(t);break;case 13:ui(t);break;case 19:H(mt);break;case 10:os(t.type);break;case 22:case 23:ui(t),cc(),e!==null&&H(or);break;case 24:os(St)}}function Zn(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,k=s.inst;n=_(),k.destroy=n}s=s.next}while(s!==l)}}catch(z){Ge(t,t.return,z)}}function Ms(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 k=n.inst,z=k.destroy;if(z!==void 0){k.destroy=void 0,l=t;var Z=s,ie=z;try{ie()}catch(le){Ge(l,Z,le)}}}n=n.next}while(n!==_)}}catch(le){Ge(t,t.return,le)}}function Ld(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{xf(t,s)}catch(n){Ge(e,e.return,n)}}}function Nd(e,t,s){s.props=fr(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(n){Ge(e,t,n)}}function qn(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){Ge(e,t,l)}}function Zi(e,t){var s=e.ref,n=e.refCleanup;if(s!==null)if(typeof n=="function")try{n()}catch(l){Ge(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){Ge(e,t,l)}else s.current=null}function Bd(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){Ge(e,e.return,l)}}function Pc(e,t,s){try{var n=e.stateNode;i0(n,e.type,s,t),n[it]=t}catch(l){Ge(e,e.return,l)}}function zd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Us(e.type)||e.tag===4}function $c(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zd(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&&Us(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 Fc(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=is));else if(n!==4&&(n===27&&Us(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Fc(e,t,s),e=e.sibling;e!==null;)Fc(e,t,s),e=e.sibling}function _o(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&&Us(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(_o(e,t,s),e=e.sibling;e!==null;)_o(e,t,s),e=e.sibling}function jd(e){var t=e.stateNode,s=e.memoizedProps;try{for(var n=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);It(t,n,s),t[yt]=e,t[it]=s}catch(_){Ge(e,e.return,_)}}var fs=!1,xt=!1,Zc=!1,Hd=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function Bg(e,t){if(e=e.containerInfo,hu=Bo,e=Vh(e),jl(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 k=0,z=-1,Z=-1,ie=0,le=0,de=e,re=null;t:for(;;){for(var ae;de!==s||l!==0&&de.nodeType!==3||(z=k+l),de!==_||n!==0&&de.nodeType!==3||(Z=k+n),de.nodeType===3&&(k+=de.nodeValue.length),(ae=de.firstChild)!==null;)re=de,de=ae;for(;;){if(de===e)break t;if(re===s&&++ie===l&&(z=k),re===_&&++le===n&&(Z=k),(ae=de.nextSibling)!==null)break;de=re,re=de.parentNode}de=ae}s=z===-1||Z===-1?null:{start:z,end:Z}}else s=null}s=s||{start:0,end:0}}else s=null;for(fu={focusedElem:e,selectionRange:s},Bo=!1,Mt=t;Mt!==null;)if(t=Mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Mt=e;else for(;Mt!==null;){switch(t=Mt,_=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 ye=fr(s.type,l);e=n.getSnapshotBeforeUpdate(ye,_),n.__reactInternalSnapshotBeforeUpdate=e}catch(we){Ge(s,s.return,we)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)mu(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mu(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,Mt=e;break}Mt=t.return}}function Ud(e,t,s){var n=s.flags;switch(s.tag){case 0:case 11:case 15:_s(e,s),n&4&&Zn(5,s);break;case 1:if(_s(e,s),n&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(k){Ge(s,s.return,k)}else{var l=fr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(k){Ge(s,s.return,k)}}n&64&&Ld(s),n&512&&qn(s,s.return);break;case 3:if(_s(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{xf(e,t)}catch(k){Ge(s,s.return,k)}}break;case 27:t===null&&n&4&&jd(s);case 26:case 5:_s(e,s),t===null&&n&4&&Bd(s),n&512&&qn(s,s.return);break;case 12:_s(e,s);break;case 31:_s(e,s),n&4&&$d(e,s);break;case 13:_s(e,s),n&4&&Fd(e,s),n&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Zg.bind(null,s),u0(e,s))));break;case 22:if(n=s.memoizedState!==null||fs,!n){t=t!==null&&t.memoizedState!==null||xt,l=fs;var _=xt;fs=n,(xt=t)&&!_?ms(e,s,(s.subtreeFlags&8772)!==0):_s(e,s),fs=l,xt=_}break;case 30:break;default:_s(e,s)}}function Id(e){var t=e.alternate;t!==null&&(e.alternate=null,Id(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&W(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 st=null,ei=!1;function ds(e,t,s){for(s=s.child;s!==null;)Pd(e,t,s),s=s.sibling}function Pd(e,t,s){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(vi,s)}catch{}switch(s.tag){case 26:xt||Zi(s,t),ds(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:xt||Zi(s,t);var n=st,l=ei;Us(s.type)&&(st=s.stateNode,ei=!1),ds(e,t,s),ea(s.stateNode),st=n,ei=l;break;case 5:xt||Zi(s,t);case 6:if(n=st,l=ei,st=null,ds(e,t,s),st=n,ei=l,st!==null)if(ei)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(s.stateNode)}catch(_){Ge(s,t,_)}else try{st.removeChild(s.stateNode)}catch(_){Ge(s,t,_)}break;case 18:st!==null&&(ei?(e=st,L_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Qr(e)):L_(st,s.stateNode));break;case 4:n=st,l=ei,st=s.stateNode.containerInfo,ei=!0,ds(e,t,s),st=n,ei=l;break;case 0:case 11:case 14:case 15:Ms(2,s,t),xt||Ms(4,s,t),ds(e,t,s);break;case 1:xt||(Zi(s,t),n=s.stateNode,typeof n.componentWillUnmount=="function"&&Nd(s,t,n)),ds(e,t,s);break;case 21:ds(e,t,s);break;case 22:xt=(n=xt)||s.memoizedState!==null,ds(e,t,s),xt=n;break;default:ds(e,t,s)}}function $d(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qr(e)}catch(s){Ge(t,t.return,s)}}}function Fd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qr(e)}catch(s){Ge(t,t.return,s)}}function zg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Hd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Hd),t;default:throw Error(o(435,e.tag))}}function mo(e,t){var s=zg(e);t.forEach(function(n){if(!s.has(n)){s.add(n);var l=qg.bind(null,e,n);n.then(l,l)}})}function ti(e,t){var s=t.deletions;if(s!==null)for(var n=0;n<s.length;n++){var l=s[n],_=e,k=t,z=k;e:for(;z!==null;){switch(z.tag){case 27:if(Us(z.type)){st=z.stateNode,ei=!1;break e}break;case 5:st=z.stateNode,ei=!1;break e;case 3:case 4:st=z.stateNode.containerInfo,ei=!0;break e}z=z.return}if(st===null)throw Error(o(160));Pd(_,k,l),st=null,ei=!1,_=l.alternate,_!==null&&(_.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Zd(t,e),t=t.sibling}var zi=null;function Zd(e,t){var s=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ti(t,e),ii(e),n&4&&(Ms(3,e,e.return),Zn(3,e),Ms(5,e,e.return));break;case 1:ti(t,e),ii(e),n&512&&(xt||s===null||Zi(s,s.return)),n&64&&fs&&(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=zi;if(ti(t,e),ii(e),n&512&&(xt||s===null||Zi(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],(!_||_[Se]||_[yt]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=l.createElement(n),l.head.insertBefore(_,l.querySelector("head > title"))),It(_,n,s),_[yt]=e,ke(_),n=_;break e;case"link":var k=Z_("link","href",l).get(n+(s.href||""));if(k){for(var z=0;z<k.length;z++)if(_=k[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)){k.splice(z,1);break t}}_=l.createElement(n),It(_,n,s),l.head.appendChild(_);break;case"meta":if(k=Z_("meta","content",l).get(n+(s.content||""))){for(z=0;z<k.length;z++)if(_=k[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)){k.splice(z,1);break t}}_=l.createElement(n),It(_,n,s),l.head.appendChild(_);break;default:throw Error(o(468,n))}_[yt]=e,ke(_),n=_}e.stateNode=n}else q_(l,e.type,e.stateNode);else e.stateNode=F_(l,n,e.memoizedProps);else _!==n?(_===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):_.count--,n===null?q_(l,e.type,e.stateNode):F_(l,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Pc(e,e.memoizedProps,s.memoizedProps)}break;case 27:ti(t,e),ii(e),n&512&&(xt||s===null||Zi(s,s.return)),s!==null&&n&4&&Pc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(ti(t,e),ii(e),n&512&&(xt||s===null||Zi(s,s.return)),e.flags&32){l=e.stateNode;try{Cr(l,"")}catch(ye){Ge(e,e.return,ye)}}n&4&&e.stateNode!=null&&(l=e.memoizedProps,Pc(e,l,s!==null?s.memoizedProps:l)),n&1024&&(Zc=!0);break;case 6:if(ti(t,e),ii(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,s=e.stateNode;try{s.nodeValue=n}catch(ye){Ge(e,e.return,ye)}}break;case 3:if(Oo=null,l=zi,zi=Do(t.containerInfo),ti(t,e),zi=l,ii(e),n&4&&s!==null&&s.memoizedState.isDehydrated)try{Qr(t.containerInfo)}catch(ye){Ge(e,e.return,ye)}Zc&&(Zc=!1,qd(e));break;case 4:n=zi,zi=Do(e.stateNode.containerInfo),ti(t,e),ii(e),zi=n;break;case 12:ti(t,e),ii(e);break;case 31:ti(t,e),ii(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,mo(e,n)));break;case 13:ti(t,e),ii(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(vo=nt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,mo(e,n)));break;case 22:l=e.memoizedState!==null;var Z=s!==null&&s.memoizedState!==null,ie=fs,le=xt;if(fs=ie||l,xt=le||Z,ti(t,e),xt=le,fs=ie,ii(e),n&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(s===null||Z||fs||xt||dr(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){Z=s=t;try{if(_=Z.stateNode,l)k=_.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{z=Z.stateNode;var de=Z.memoizedProps.style,re=de!=null&&de.hasOwnProperty("display")?de.display:null;z.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(ye){Ge(Z,Z.return,ye)}}}else if(t.tag===6){if(s===null){Z=t;try{Z.stateNode.nodeValue=l?"":Z.memoizedProps}catch(ye){Ge(Z,Z.return,ye)}}}else if(t.tag===18){if(s===null){Z=t;try{var ae=Z.stateNode;l?N_(ae,!0):N_(Z.stateNode,!1)}catch(ye){Ge(Z,Z.return,ye)}}}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,mo(e,s))));break;case 19:ti(t,e),ii(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,mo(e,n)));break;case 30:break;case 21:break;default:ti(t,e),ii(e)}}function ii(e){var t=e.flags;if(t&2){try{for(var s,n=e.return;n!==null;){if(zd(n)){s=n;break}n=n.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var l=s.stateNode,_=$c(e);_o(e,_,l);break;case 5:var k=s.stateNode;s.flags&32&&(Cr(k,""),s.flags&=-33);var z=$c(e);_o(e,z,k);break;case 3:case 4:var Z=s.stateNode.containerInfo,ie=$c(e);Fc(e,ie,Z);break;default:throw Error(o(161))}}catch(le){Ge(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;qd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _s(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ud(e,t.alternate,t),t=t.sibling}function dr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ms(4,t,t.return),dr(t);break;case 1:Zi(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Nd(t,t.return,s),dr(t);break;case 27:ea(t.stateNode);case 26:case 5:Zi(t,t.return),dr(t);break;case 22:t.memoizedState===null&&dr(t);break;case 30:dr(t);break;default:dr(t)}e=e.sibling}}function ms(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,l=e,_=t,k=_.flags;switch(_.tag){case 0:case 11:case 15:ms(l,_,s),Zn(4,_);break;case 1:if(ms(l,_,s),n=_,l=n.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(ie){Ge(n,n.return,ie)}if(n=_,l=n.updateQueue,l!==null){var z=n.stateNode;try{var Z=l.shared.hiddenCallbacks;if(Z!==null)for(l.shared.hiddenCallbacks=null,l=0;l<Z.length;l++)Cf(Z[l],z)}catch(ie){Ge(n,n.return,ie)}}s&&k&64&&Ld(_),qn(_,_.return);break;case 27:jd(_);case 26:case 5:ms(l,_,s),s&&n===null&&k&4&&Bd(_),qn(_,_.return);break;case 12:ms(l,_,s);break;case 31:ms(l,_,s),s&&k&4&&$d(l,_);break;case 13:ms(l,_,s),s&&k&4&&Fd(l,_);break;case 22:_.memoizedState===null&&ms(l,_,s),qn(_,_.return);break;case 30:break;default:ms(l,_,s)}t=t.sibling}}function qc(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&&On(s))}function Gc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&On(e))}function ji(e,t,s,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Gd(e,t,s,n),t=t.sibling}function Gd(e,t,s,n){var l=t.flags;switch(t.tag){case 0:case 11:case 15:ji(e,t,s,n),l&2048&&Zn(9,t);break;case 1:ji(e,t,s,n);break;case 3:ji(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&&On(e)));break;case 12:if(l&2048){ji(e,t,s,n),e=t.stateNode;try{var _=t.memoizedProps,k=_.id,z=_.onPostCommit;typeof z=="function"&&z(k,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Z){Ge(t,t.return,Z)}}else ji(e,t,s,n);break;case 31:ji(e,t,s,n);break;case 13:ji(e,t,s,n);break;case 23:break;case 22:_=t.stateNode,k=t.alternate,t.memoizedState!==null?_._visibility&2?ji(e,t,s,n):Gn(e,t):_._visibility&2?ji(e,t,s,n):(_._visibility|=2,$r(e,t,s,n,(t.subtreeFlags&10256)!==0||!1)),l&2048&&qc(k,t);break;case 24:ji(e,t,s,n),l&2048&&Gc(t.alternate,t);break;default:ji(e,t,s,n)}}function $r(e,t,s,n,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var _=e,k=t,z=s,Z=n,ie=k.flags;switch(k.tag){case 0:case 11:case 15:$r(_,k,z,Z,l),Zn(8,k);break;case 23:break;case 22:var le=k.stateNode;k.memoizedState!==null?le._visibility&2?$r(_,k,z,Z,l):Gn(_,k):(le._visibility|=2,$r(_,k,z,Z,l)),l&&ie&2048&&qc(k.alternate,k);break;case 24:$r(_,k,z,Z,l),l&&ie&2048&&Gc(k.alternate,k);break;default:$r(_,k,z,Z,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&&qc(n.alternate,n);break;case 24:Gn(s,n),l&2048&&Gc(n.alternate,n);break;default:Gn(s,n)}t=t.sibling}}var Wn=8192;function Fr(e,t,s){if(e.subtreeFlags&Wn)for(e=e.child;e!==null;)Wd(e,t,s),e=e.sibling}function Wd(e,t,s){switch(e.tag){case 26:Fr(e,t,s),e.flags&Wn&&e.memoizedState!==null&&C0(s,zi,e.memoizedState,e.memoizedProps);break;case 5:Fr(e,t,s);break;case 3:case 4:var n=zi;zi=Do(e.stateNode.containerInfo),Fr(e,t,s),zi=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Wn,Wn=16777216,Fr(e,t,s),Wn=n):Fr(e,t,s));break;default:Fr(e,t,s)}}function Yd(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 Yn(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];Mt=n,Kd(n,e)}Yd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vd(e),e=e.sibling}function Vd(e){switch(e.tag){case 0:case 11:case 15:Yn(e),e.flags&2048&&Ms(9,e,e.return);break;case 3:Yn(e);break;case 12:Yn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,po(e)):Yn(e);break;default:Yn(e)}}function po(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];Mt=n,Kd(n,e)}Yd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ms(8,t,t.return),po(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,po(t));break;default:po(t)}e=e.sibling}}function Kd(e,t){for(;Mt!==null;){var s=Mt;switch(s.tag){case 0:case 11:case 15:Ms(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:On(s.memoizedState.cache)}if(n=s.child,n!==null)n.return=s,Mt=n;else e:for(s=e;Mt!==null;){n=Mt;var l=n.sibling,_=n.return;if(Id(n),n===s){Mt=null;break e}if(l!==null){l.return=_,Mt=l;break e}Mt=_}}}var jg={getCacheForType:function(e){var t=Ht(St),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ht(St).controller.signal}},Hg=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Je=null,Le=null,Be=0,qe=0,hi=null,Ls=!1,Zr=!1,Wc=!1,ps=0,ht=0,Ns=0,_r=0,Yc=0,fi=0,qr=0,Vn=null,si=null,Vc=!1,vo=0,Xd=0,go=1/0,yo=null,Bs=null,Rt=0,zs=null,Gr=null,vs=0,Kc=0,Xc=null,Jd=null,Kn=0,Jc=null;function di(){return(Fe&2)!==0&&Be!==0?Be&-Be:G.T!==null?ru():pn()}function Qd(){if(fi===0)if((Be&536870912)===0||He){var e=Ji;Ji<<=1,(Ji&3932160)===0&&(Ji=262144),fi=e}else fi=536870912;return e=ci.current,e!==null&&(e.flags|=32),fi}function ri(e,t,s){(e===Je&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(Wr(e,0),js(e,Be,fi,!1)),bs(e,s),((Fe&2)===0||e!==Je)&&(e===Je&&((Fe&2)===0&&(_r|=s),ht===4&&js(e,Be,fi,!1)),qi(e))}function e_(e,t,s){if((Fe&6)!==0)throw Error(o(327));var n=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Js(e,t),l=n?Pg(e,t):eu(e,t,!0),_=n;do{if(l===0){Zr&&!n&&js(e,t,0,!1);break}else{if(s=e.current.alternate,_&&!Ug(s)){l=eu(e,t,!1),_=!1;continue}if(l===2){if(_=t,e.errorRecoveryDisabledLanes&_)var k=0;else k=e.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){t=k;e:{var z=e;l=Vn;var Z=z.current.memoizedState.isDehydrated;if(Z&&(Wr(z,k).flags|=256),k=eu(z,k,!1),k!==2){if(Wc&&!Z){z.errorRecoveryDisabledLanes|=_,_r|=_,l=4;break e}_=si,si=l,_!==null&&(si===null?si=_:si.push.apply(si,_))}l=k}if(_=!1,l!==2)continue}}if(l===1){Wr(e,0),js(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:js(n,t,fi,!Ls);break e;case 2:si=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(l=vo+300-nt(),10<l)){if(js(n,t,fi,!Ls),yr(n,0,!0)!==0)break e;vs=t,n.timeoutHandle=O_(t_.bind(null,n,s,si,yo,Vc,t,fi,_r,qr,Ls,_,"Throttled",-0,0),l);break e}t_(n,s,si,yo,Vc,t,fi,_r,qr,Ls,_,null,-0,0)}}break}while(!0);qi(e)}function t_(e,t,s,n,l,_,k,z,Z,ie,le,de,re,ae){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:is},Wd(t,_,de);var ye=(_&62914560)===_?vo-nt():(_&4194048)===_?Xd-nt():0;if(ye=x0(de,ye),ye!==null){vs=_,e.cancelPendingCommit=ye(c_.bind(null,e,t,_,s,n,l,k,z,Z,le,de,null,re,ae)),js(e,_,k,!ie);return}}c_(e,t,_,s,n,l,k,z,Z)}function Ug(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(!oi(_(),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 js(e,t,s,n){t&=~Yc,t&=~_r,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var l=t;0<l;){var _=31-gt(l),k=1<<_;n[_]=-1,l&=~k}s!==0&&_n(e,s,t)}function So(){return(Fe&6)===0?(Xn(0),!1):!0}function Qc(){if(Le!==null){if(qe===0)var e=Le.return;else e=Le,as=nr=null,mc(e),jr=null,Ln=0,e=Le;for(;e!==null;)Md(e.alternate,e),e=e.return;Le=null}}function Wr(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,n0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),vs=0,Qc(),Je=e,Le=s=rs(e.current,null),Be=t,qe=0,hi=null,Ls=!1,Zr=Js(e,t),Wc=!1,qr=fi=Yc=_r=Ns=ht=0,si=Vn=null,Vc=!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-gt(n),_=1<<l;t|=e[l],n&=~_}return ps=t,Ia(),s}function i_(e,t){Re=null,G.H=Pn,t===zr||t===Ya?(t=gf(),qe=3):t===sc?(t=gf(),qe=4):qe=t===Oc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hi=t,Le===null&&(ht=1,lo(e,xi(t,e.current)))}function s_(){var e=ci.current;return e===null?!0:(Be&4194048)===Be?Ai===null:(Be&62914560)===Be||(Be&536870912)!==0?e===Ai:!1}function r_(){var e=G.H;return G.H=Pn,e===null?Pn:e}function n_(){var e=G.A;return G.A=jg,e}function bo(){ht=4,Ls||(Be&4194048)!==Be&&ci.current!==null||(Zr=!0),(Ns&134217727)===0&&(_r&134217727)===0||Je===null||js(Je,Be,fi,!1)}function eu(e,t,s){var n=Fe;Fe|=2;var l=r_(),_=n_();(Je!==e||Be!==t)&&(yo=null,Wr(e,t)),t=!1;var k=ht;e:do try{if(qe!==0&&Le!==null){var z=Le,Z=hi;switch(qe){case 8:Qc(),k=6;break e;case 3:case 2:case 9:case 6:ci.current===null&&(t=!0);var ie=qe;if(qe=0,hi=null,Yr(e,z,Z,ie),s&&Zr){k=0;break e}break;default:ie=qe,qe=0,hi=null,Yr(e,z,Z,ie)}}Ig(),k=ht;break}catch(le){i_(e,le)}while(!0);return t&&e.shellSuspendCounter++,as=nr=null,Fe=n,G.H=l,G.A=_,Le===null&&(Je=null,Be=0,Ia()),k}function Ig(){for(;Le!==null;)a_(Le)}function Pg(e,t){var s=Fe;Fe|=2;var n=r_(),l=n_();Je!==e||Be!==t?(yo=null,go=nt()+500,Wr(e,t)):Zr=Js(e,t);e:do try{if(qe!==0&&Le!==null){t=Le;var _=hi;t:switch(qe){case 1:qe=0,hi=null,Yr(e,t,_,1);break;case 2:case 9:if(pf(_)){qe=0,hi=null,o_(t);break}t=function(){qe!==2&&qe!==9||Je!==e||(qe=7),qi(e)},_.then(t,t);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:pf(_)?(qe=0,hi=null,o_(t)):(qe=0,hi=null,Yr(e,t,_,7));break;case 5:var k=null;switch(Le.tag){case 26:k=Le.memoizedState;case 5:case 27:var z=Le;if(k?G_(k):z.stateNode.complete){qe=0,hi=null;var Z=z.sibling;if(Z!==null)Le=Z;else{var ie=z.return;ie!==null?(Le=ie,Co(ie)):Le=null}break t}}qe=0,hi=null,Yr(e,t,_,5);break;case 6:qe=0,hi=null,Yr(e,t,_,6);break;case 8:Qc(),ht=6;break e;default:throw Error(o(462))}}$g();break}catch(le){i_(e,le)}while(!0);return as=nr=null,G.H=n,G.A=l,Fe=s,Le!==null?0:(Je=null,Be=0,Ia(),ht)}function $g(){for(;Le!==null&&!Vi();)a_(Le)}function a_(e){var t=kd(e.alternate,e,ps);e.memoizedProps=e.pendingProps,t===null?Co(e):Le=t}function o_(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=wd(s,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=wd(s,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:mc(t);default:Md(s,t),t=Le=nf(t,ps),t=kd(s,t,ps)}e.memoizedProps=e.pendingProps,t===null?Co(e):Le=t}function Yr(e,t,s,n){as=nr=null,mc(t),jr=null,Ln=0;var l=t.return;try{if(kg(e,l,t,s,Be)){ht=1,lo(e,xi(s,e.current)),Le=null;return}}catch(_){if(l!==null)throw Le=l,_;ht=1,lo(e,xi(s,e.current)),Le=null;return}t.flags&32768?(He||n===1?e=!0:Zr||(Be&536870912)!==0?e=!1:(Ls=e=!0,(n===2||n===9||n===3||n===6)&&(n=ci.current,n!==null&&n.tag===13&&(n.flags|=16384))),l_(t,e)):Co(t)}function Co(e){var t=e;do{if((t.flags&32768)!==0){l_(t,Ls);return}e=t.return;var s=Lg(t.alternate,t,ps);if(s!==null){Le=s;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);ht===0&&(ht=5)}function l_(e,t){do{var s=Ng(e.alternate,e);if(s!==null){s.flags&=32767,Le=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=s}while(e!==null);ht=6,Le=null}function c_(e,t,s,n,l,_,k,z,Z){e.cancelPendingCommit=null;do xo();while(Rt!==0);if((Fe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(_=t.lanes|t.childLanes,_|=$l,dn(e,s,_,k,z,Z),e===Je&&(Le=Je=null,Be=0),Gr=t,zs=e,vs=s,Kc=_,Xc=l,Jd=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Gg(Bt,function(){return __(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=G.T,G.T=null,l=K.p,K.p=2,k=Fe,Fe|=4;try{Bg(e,t,s)}finally{Fe=k,K.p=l,G.T=n}}Rt=1,u_(),h_(),f_()}}function u_(){if(Rt===1){Rt=0;var e=zs,t=Gr,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=G.T,G.T=null;var n=K.p;K.p=2;var l=Fe;Fe|=4;try{Zd(t,e);var _=fu,k=Vh(e.containerInfo),z=_.focusedElem,Z=_.selectionRange;if(k!==z&&z&&z.ownerDocument&&Yh(z.ownerDocument.documentElement,z)){if(Z!==null&&jl(z)){var ie=Z.start,le=Z.end;if(le===void 0&&(le=ie),"selectionStart"in z)z.selectionStart=ie,z.selectionEnd=Math.min(le,z.value.length);else{var de=z.ownerDocument||document,re=de&&de.defaultView||window;if(re.getSelection){var ae=re.getSelection(),ye=z.textContent.length,we=Math.min(Z.start,ye),Xe=Z.end===void 0?we:Math.min(Z.end,ye);!ae.extend&&we>Xe&&(k=Xe,Xe=we,we=k);var J=Wh(z,we),V=Wh(z,Xe);if(J&&V&&(ae.rangeCount!==1||ae.anchorNode!==J.node||ae.anchorOffset!==J.offset||ae.focusNode!==V.node||ae.focusOffset!==V.offset)){var te=de.createRange();te.setStart(J.node,J.offset),ae.removeAllRanges(),we>Xe?(ae.addRange(te),ae.extend(V.node,V.offset)):(te.setEnd(V.node,V.offset),ae.addRange(te))}}}}for(de=[],ae=z;ae=ae.parentNode;)ae.nodeType===1&&de.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<de.length;z++){var ue=de[z];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Bo=!!hu,fu=hu=null}finally{Fe=l,K.p=n,G.T=s}}e.current=t,Rt=2}}function h_(){if(Rt===2){Rt=0;var e=zs,t=Gr,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=G.T,G.T=null;var n=K.p;K.p=2;var l=Fe;Fe|=4;try{Ud(e,t.alternate,t)}finally{Fe=l,K.p=n,G.T=s}}Rt=3}}function f_(){if(Rt===4||Rt===3){Rt=0,Pt();var e=zs,t=Gr,s=vs,n=Jd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Rt=5:(Rt=0,Gr=zs=null,d_(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(Bs=null),Ni(s),t=t.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(vi,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=G.T,l=K.p,K.p=2,G.T=null;try{for(var _=e.onRecoverableError,k=0;k<n.length;k++){var z=n[k];_(z.value,{componentStack:z.stack})}}finally{G.T=t,K.p=l}}(vs&3)!==0&&xo(),qi(e),l=e.pendingLanes,(s&261930)!==0&&(l&42)!==0?e===Jc?Kn++:(Kn=0,Jc=e):Kn=0,Xn(0)}}function d_(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,On(t)))}function xo(){return u_(),h_(),f_(),__()}function __(){if(Rt!==5)return!1;var e=zs,t=Kc;Kc=0;var s=Ni(vs),n=G.T,l=K.p;try{K.p=32>s?32:s,G.T=null,s=Xc,Xc=null;var _=zs,k=vs;if(Rt=0,Gr=zs=null,vs=0,(Fe&6)!==0)throw Error(o(331));var z=Fe;if(Fe|=4,Vd(_.current),Gd(_,_.current,k,s),Fe=z,Xn(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(vi,_)}catch{}return!0}finally{K.p=l,G.T=n,d_(e,t)}}function m_(e,t,s){t=xi(s,t),t=kc(e.stateNode,t,2),e=Ds(e,t,2),e!==null&&(bs(e,2),qi(e))}function Ge(e,t,s){if(e.tag===3)m_(e,e,s);else for(;t!==null;){if(t.tag===3){m_(t,e,s);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Bs===null||!Bs.has(n))){e=xi(s,e),s=pd(2),n=Ds(t,s,2),n!==null&&(vd(s,n,t,e),bs(n,2),qi(n));break}}t=t.return}}function tu(e,t,s){var n=e.pingCache;if(n===null){n=e.pingCache=new Hg;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)||(Wc=!0,l.add(s),e=Fg.bind(null,e,t,s),t.then(e,e))}function Fg(e,t,s){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Je===e&&(Be&s)===s&&(ht===4||ht===3&&(Be&62914560)===Be&&300>nt()-vo?(Fe&2)===0&&Wr(e,0):Yc|=s,qr===Be&&(qr=0)),qi(e)}function p_(e,t){t===0&&(t=Qi()),e=ir(e,t),e!==null&&(bs(e,t),qi(e))}function Zg(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),p_(e,s)}function qg(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),p_(e,s)}function Gg(e,t){return pi(e,t)}var wo=null,Vr=null,iu=!1,Eo=!1,su=!1,Hs=0;function qi(e){e!==Vr&&e.next===null&&(Vr===null?wo=Vr=e:Vr=Vr.next=e),Eo=!0,iu||(iu=!0,Yg())}function Xn(e,t){if(!su&&Eo){su=!0;do for(var s=!1,n=wo;n!==null;){if(e!==0){var l=n.pendingLanes;if(l===0)var _=0;else{var k=n.suspendedLanes,z=n.pingedLanes;_=(1<<31-gt(42|e)+1)-1,_&=l&~(k&~z),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(s=!0,S_(n,_))}else _=Be,_=yr(n,n===Je?_:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(_&3)===0||Js(n,_)||(s=!0,S_(n,_));n=n.next}while(s);su=!1}}function Wg(){v_()}function v_(){Eo=iu=!1;var e=0;Hs!==0&&r0()&&(e=Hs);for(var t=nt(),s=null,n=wo;n!==null;){var l=n.next,_=g_(n,t);_===0?(n.next=null,s===null?wo=l:s.next=l,l===null&&(Vr=s)):(s=n,(e!==0||(_&3)!==0)&&(Eo=!0)),n=l}Rt!==0&&Rt!==5||Xn(e),Hs!==0&&(Hs=0)}function g_(e,t){for(var s=e.suspendedLanes,n=e.pingedLanes,l=e.expirationTimes,_=e.pendingLanes&-62914561;0<_;){var k=31-gt(_),z=1<<k,Z=l[k];Z===-1?((z&s)===0||(z&n)!==0)&&(l[k]=_t(z,t)):Z<=t&&(e.expiredLanes|=z),_&=~z}if(t=Je,s=Be,s=yr(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,s===0||e===t&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Ii(n),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Js(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(n!==null&&Ii(n),Ni(s)){case 2:case 8:s=Nt;break;case 32:s=Bt;break;case 268435456:s=Kt;break;default:s=Bt}return n=y_.bind(null,e),s=pi(s,n),e.callbackPriority=t,e.callbackNode=s,t}return n!==null&&n!==null&&Ii(n),e.callbackPriority=2,e.callbackNode=null,2}function y_(e,t){if(Rt!==0&&Rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(xo()&&e.callbackNode!==s)return null;var n=Be;return n=yr(e,e===Je?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(e_(e,n,t),g_(e,nt()),e.callbackNode!=null&&e.callbackNode===s?y_.bind(null,e):null)}function S_(e,t){if(xo())return null;e_(e,t,!0)}function Yg(){a0(function(){(Fe&6)!==0?pi(Zt,Wg):v_()})}function ru(){if(Hs===0){var e=Nr;e===0&&(e=Xi,Xi<<=1,(Xi&261888)===0&&(Xi=256)),Hs=e}return Hs}function b_(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ma(""+e)}function C_(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 Vg(e,t,s,n,l){if(t==="submit"&&s&&s.stateNode===l){var _=b_((l[it]||null).action),k=n.submitter;k&&(t=(t=k[it]||null)?b_(t.formAction):k.getAttribute("formAction"),t!==null&&(_=t,k=null));var z=new za("action","action",null,n,l);e.push({event:z,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Hs!==0){var Z=k?C_(l,k):new FormData(l);wc(s,{pending:!0,data:Z,method:l.method,action:_},null,Z)}}else typeof _=="function"&&(z.preventDefault(),Z=k?C_(l,k):new FormData(l),wc(s,{pending:!0,data:Z,method:l.method,action:_},_,Z))},currentTarget:l}]})}}for(var nu=0;nu<Pl.length;nu++){var au=Pl[nu],Kg=au.toLowerCase(),Xg=au[0].toUpperCase()+au.slice(1);Bi(Kg,"on"+Xg)}Bi(Jh,"onAnimationEnd"),Bi(Qh,"onAnimationIteration"),Bi(ef,"onAnimationStart"),Bi("dblclick","onDoubleClick"),Bi("focusin","onFocus"),Bi("focusout","onBlur"),Bi(dg,"onTransitionRun"),Bi(_g,"onTransitionStart"),Bi(mg,"onTransitionCancel"),Bi(tf,"onTransitionEnd"),Pi("onMouseEnter",["mouseout","mouseover"]),Pi("onMouseLeave",["mouseout","mouseover"]),Pi("onPointerEnter",["pointerout","pointerover"]),Pi("onPointerLeave",["pointerout","pointerover"]),Jt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jn="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(" "),Jg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jn));function x_(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 k=n.length-1;0<=k;k--){var z=n[k],Z=z.instance,ie=z.currentTarget;if(z=z.listener,Z!==_&&l.isPropagationStopped())break e;_=z,l.currentTarget=ie;try{_(l)}catch(le){Ua(le)}l.currentTarget=null,_=Z}else for(k=0;k<n.length;k++){if(z=n[k],Z=z.instance,ie=z.currentTarget,z=z.listener,Z!==_&&l.isPropagationStopped())break e;_=z,l.currentTarget=ie;try{_(l)}catch(le){Ua(le)}l.currentTarget=null,_=Z}}}}function Ne(e,t){var s=t[Sr];s===void 0&&(s=t[Sr]=new Set);var n=e+"__bubble";s.has(n)||(w_(t,e,2,!1),s.add(n))}function ou(e,t,s){var n=0;t&&(n|=4),w_(s,e,n,t)}var To="_reactListening"+Math.random().toString(36).slice(2);function lu(e){if(!e[To]){e[To]=!0,zt.forEach(function(s){s!=="selectionchange"&&(Jg.has(s)||ou(s,!1,e),ou(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[To]||(t[To]=!0,ou("selectionchange",!1,t))}}function w_(e,t,s,n){switch(Q_(t)){case 2:var l=T0;break;case 8:l=A0;break;default:l=xu}s=l.bind(null,t,s,e),l=void 0,!Rl||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 cu(e,t,s,n,l){var _=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var k=n.tag;if(k===3||k===4){var z=n.stateNode.containerInfo;if(z===l)break;if(k===4)for(k=n.return;k!==null;){var Z=k.tag;if((Z===3||Z===4)&&k.stateNode.containerInfo===l)return;k=k.return}for(;z!==null;){if(k=_e(z),k===null)return;if(Z=k.tag,Z===5||Z===6||Z===26||Z===27){n=_=k;continue e}z=z.parentNode}}n=n.return}Rh(function(){var ie=_,le=Tl(s),de=[];e:{var re=sf.get(e);if(re!==void 0){var ae=za,ye=e;switch(e){case"keypress":if(Na(s)===0)break e;case"keydown":case"keyup":ae=qv;break;case"focusin":ye="focus",ae=Ml;break;case"focusout":ye="blur",ae=Ml;break;case"beforeblur":case"afterblur":ae=Ml;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=Oh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=Lv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Yv;break;case Jh:case Qh:case ef:ae=zv;break;case tf:ae=Kv;break;case"scroll":case"scrollend":ae=Ov;break;case"wheel":ae=Jv;break;case"copy":case"cut":case"paste":ae=Hv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=Lh;break;case"toggle":case"beforetoggle":ae=eg}var we=(t&4)!==0,Xe=!we&&(e==="scroll"||e==="scrollend"),J=we?re!==null?re+"Capture":null:re;we=[];for(var V=ie,te;V!==null;){var ue=V;if(te=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||te===null||J===null||(ue=Sn(V,J),ue!=null&&we.push(Qn(V,ue,te))),Xe)break;V=V.return}0<we.length&&(re=new ae(re,ye,null,s,le),de.push({event:re,listeners:we}))}}if((t&7)===0){e:{if(re=e==="mouseover"||e==="pointerover",ae=e==="mouseout"||e==="pointerout",re&&s!==El&&(ye=s.relatedTarget||s.fromElement)&&(_e(ye)||ye[es]))break e;if((ae||re)&&(re=le.window===le?le:(re=le.ownerDocument)?re.defaultView||re.parentWindow:window,ae?(ye=s.relatedTarget||s.toElement,ae=ie,ye=ye?_e(ye):null,ye!==null&&(Xe=x(ye),we=ye.tag,ye!==Xe||we!==5&&we!==27&&we!==6)&&(ye=null)):(ae=null,ye=ie),ae!==ye)){if(we=Oh,ue="onMouseLeave",J="onMouseEnter",V="mouse",(e==="pointerout"||e==="pointerover")&&(we=Lh,ue="onPointerLeave",J="onPointerEnter",V="pointer"),Xe=ae==null?re:Ze(ae),te=ye==null?re:Ze(ye),re=new we(ue,V+"leave",ae,s,le),re.target=Xe,re.relatedTarget=te,ue=null,_e(le)===ie&&(we=new we(J,V+"enter",ye,s,le),we.target=te,we.relatedTarget=Xe,ue=we),Xe=ue,ae&&ye)t:{for(we=Qg,J=ae,V=ye,te=0,ue=J;ue;ue=we(ue))te++;ue=0;for(var Ce=V;Ce;Ce=we(Ce))ue++;for(;0<te-ue;)J=we(J),te--;for(;0<ue-te;)V=we(V),ue--;for(;te--;){if(J===V||V!==null&&J===V.alternate){we=J;break t}J=we(J),V=we(V)}we=null}else we=null;ae!==null&&E_(de,re,ae,we,!1),ye!==null&&Xe!==null&&E_(de,Xe,ye,we,!0)}}e:{if(re=ie?Ze(ie):window,ae=re.nodeName&&re.nodeName.toLowerCase(),ae==="select"||ae==="input"&&re.type==="file")var Pe=Ph;else if(Uh(re))if($h)Pe=ug;else{Pe=lg;var be=og}else ae=re.nodeName,!ae||ae.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ie&&wl(ie.elementType)&&(Pe=Ph):Pe=cg;if(Pe&&(Pe=Pe(e,ie))){Ih(de,Pe,s,le);break e}be&&be(e,re,ie),e==="focusout"&&ie&&re.type==="number"&&ie.memoizedProps.value!=null&&xl(re,"number",re.value)}switch(be=ie?Ze(ie):window,e){case"focusin":(Uh(be)||be.contentEditable==="true")&&(Tr=be,Hl=ie,Rn=null);break;case"focusout":Rn=Hl=Tr=null;break;case"mousedown":Ul=!0;break;case"contextmenu":case"mouseup":case"dragend":Ul=!1,Kh(de,s,le);break;case"selectionchange":if(fg)break;case"keydown":case"keyup":Kh(de,s,le)}var De;if(Nl)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Er?jh(e,s)&&(ze="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(ze="onCompositionStart");ze&&(Nh&&s.locale!=="ko"&&(Er||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Er&&(De=Dh()):(Cs=le,Dl="value"in Cs?Cs.value:Cs.textContent,Er=!0)),be=Ao(ie,ze),0<be.length&&(ze=new Mh(ze,e,null,s,le),de.push({event:ze,listeners:be}),De?ze.data=De:(De=Hh(s),De!==null&&(ze.data=De)))),(De=ig?sg(e,s):rg(e,s))&&(ze=Ao(ie,"onBeforeInput"),0<ze.length&&(be=new Mh("onBeforeInput","beforeinput",null,s,le),de.push({event:be,listeners:ze}),be.data=De)),Vg(de,e,ie,s,le)}x_(de,t)})}function Qn(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Ao(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=Sn(e,s),l!=null&&n.unshift(Qn(e,l,_)),l=Sn(e,t),l!=null&&n.push(Qn(e,l,_))),e.tag===3)return n;e=e.return}return[]}function Qg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function E_(e,t,s,n,l){for(var _=t._reactName,k=[];s!==null&&s!==n;){var z=s,Z=z.alternate,ie=z.stateNode;if(z=z.tag,Z!==null&&Z===n)break;z!==5&&z!==26&&z!==27||ie===null||(Z=ie,l?(ie=Sn(s,_),ie!=null&&k.unshift(Qn(s,ie,Z))):l||(ie=Sn(s,_),ie!=null&&k.push(Qn(s,ie,Z)))),s=s.return}k.length!==0&&e.push({event:t,listeners:k})}var e0=/\r\n?/g,t0=/\u0000|\uFFFD/g;function T_(e){return(typeof e=="string"?e:""+e).replace(e0,`
|
|
49
|
+
`).replace(t0,"")}function A_(e,t){return t=T_(t),T_(e)===t}function Ke(e,t,s,n,l,_){switch(s){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Cr(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Cr(e,""+n);break;case"className":ka(e,"class",n);break;case"tabIndex":ka(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ka(e,s,n);break;case"style":Th(e,n,_);break;case"data":if(t!=="object"){ka(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=Ma(""+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"&&Ke(e,t,"name",l.name,l,null),Ke(e,t,"formEncType",l.formEncType,l,null),Ke(e,t,"formMethod",l.formMethod,l,null),Ke(e,t,"formTarget",l.formTarget,l,null)):(Ke(e,t,"encType",l.encType,l,null),Ke(e,t,"method",l.method,l,null),Ke(e,t,"target",l.target,l,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=Ma(""+n),e.setAttribute(s,n);break;case"onClick":n!=null&&(e.onclick=is);break;case"onScroll":n!=null&&Ne("scroll",e);break;case"onScrollEnd":n!=null&&Ne("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=Ma(""+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":Ne("beforetoggle",e),Ne("toggle",e),Da(e,"popover",n);break;case"xlinkActuate":ts(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":ts(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":ts(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":ts(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":ts(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":ts(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":ts(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":ts(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":ts(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Da(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=Dv.get(s)||s,Da(e,s,n))}}function uu(e,t,s,n,l,_){switch(s){case"style":Th(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"?Cr(e,n):(typeof n=="number"||typeof n=="bigint")&&Cr(e,""+n);break;case"onScroll":n!=null&&Ne("scroll",e);break;case"onScrollEnd":n!=null&&Ne("scrollend",e);break;case"onClick":n!=null&&(e.onclick=is);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yi.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[it]||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,""):Da(e,s,n)}}}function It(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ne("error",e),Ne("load",e);var n=!1,l=!1,_;for(_ in s)if(s.hasOwnProperty(_)){var k=s[_];if(k!=null)switch(_){case"src":n=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,_,k,s,null)}}l&&Ke(e,t,"srcSet",s.srcSet,s,null),n&&Ke(e,t,"src",s.src,s,null);return;case"input":Ne("invalid",e);var z=_=k=l=null,Z=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":k=le;break;case"checked":Z=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:Ke(e,t,n,le,s,null)}}Ch(e,_,z,Z,ie,k,l,!1);return;case"select":Ne("invalid",e),n=k=_=null;for(l in s)if(s.hasOwnProperty(l)&&(z=s[l],z!=null))switch(l){case"value":_=z;break;case"defaultValue":k=z;break;case"multiple":n=z;default:Ke(e,t,l,z,s,null)}t=_,s=k,e.multiple=!!n,t!=null?br(e,!!n,t,!1):s!=null&&br(e,!!n,s,!0);return;case"textarea":Ne("invalid",e),_=l=n=null;for(k in s)if(s.hasOwnProperty(k)&&(z=s[k],z!=null))switch(k){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:Ke(e,t,k,z,s,null)}wh(e,n,l,_);return;case"option":for(Z in s)if(s.hasOwnProperty(Z)&&(n=s[Z],n!=null))switch(Z){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Ke(e,t,Z,n,s,null)}return;case"dialog":Ne("beforetoggle",e),Ne("toggle",e),Ne("cancel",e),Ne("close",e);break;case"iframe":case"object":Ne("load",e);break;case"video":case"audio":for(n=0;n<Jn.length;n++)Ne(Jn[n],e);break;case"image":Ne("error",e),Ne("load",e);break;case"details":Ne("toggle",e);break;case"embed":case"source":case"link":Ne("error",e),Ne("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:Ke(e,t,ie,n,s,null)}return;default:if(wl(t)){for(le in s)s.hasOwnProperty(le)&&(n=s[le],n!==void 0&&uu(e,t,le,n,s,void 0));return}}for(z in s)s.hasOwnProperty(z)&&(n=s[z],n!=null&&Ke(e,t,z,n,s,null))}function i0(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,k=null,z=null,Z=null,ie=null,le=null;for(ae in s){var de=s[ae];if(s.hasOwnProperty(ae)&&de!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":Z=de;default:n.hasOwnProperty(ae)||Ke(e,t,ae,null,n,de)}}for(var re in n){var ae=n[re];if(de=s[re],n.hasOwnProperty(re)&&(ae!=null||de!=null))switch(re){case"type":_=ae;break;case"name":l=ae;break;case"checked":ie=ae;break;case"defaultChecked":le=ae;break;case"value":k=ae;break;case"defaultValue":z=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,t));break;default:ae!==de&&Ke(e,t,re,ae,n,de)}}Cl(e,k,z,Z,ie,le,_,l);return;case"select":ae=k=z=re=null;for(_ in s)if(Z=s[_],s.hasOwnProperty(_)&&Z!=null)switch(_){case"value":break;case"multiple":ae=Z;default:n.hasOwnProperty(_)||Ke(e,t,_,null,n,Z)}for(l in n)if(_=n[l],Z=s[l],n.hasOwnProperty(l)&&(_!=null||Z!=null))switch(l){case"value":re=_;break;case"defaultValue":z=_;break;case"multiple":k=_;default:_!==Z&&Ke(e,t,l,_,n,Z)}t=z,s=k,n=ae,re!=null?br(e,!!s,re,!1):!!n!=!!s&&(t!=null?br(e,!!s,t,!0):br(e,!!s,s?[]:"",!1));return;case"textarea":ae=re=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:Ke(e,t,z,null,n,l)}for(k in n)if(l=n[k],_=s[k],n.hasOwnProperty(k)&&(l!=null||_!=null))switch(k){case"value":re=l;break;case"defaultValue":ae=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(o(91));break;default:l!==_&&Ke(e,t,k,l,n,_)}xh(e,re,ae);return;case"option":for(var ye in s)if(re=s[ye],s.hasOwnProperty(ye)&&re!=null&&!n.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:Ke(e,t,ye,null,n,re)}for(Z in n)if(re=n[Z],ae=s[Z],n.hasOwnProperty(Z)&&re!==ae&&(re!=null||ae!=null))switch(Z){case"selected":e.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:Ke(e,t,Z,re,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 we in s)re=s[we],s.hasOwnProperty(we)&&re!=null&&!n.hasOwnProperty(we)&&Ke(e,t,we,null,n,re);for(ie in n)if(re=n[ie],ae=s[ie],n.hasOwnProperty(ie)&&re!==ae&&(re!=null||ae!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(o(137,t));break;default:Ke(e,t,ie,re,n,ae)}return;default:if(wl(t)){for(var Xe in s)re=s[Xe],s.hasOwnProperty(Xe)&&re!==void 0&&!n.hasOwnProperty(Xe)&&uu(e,t,Xe,void 0,n,re);for(le in n)re=n[le],ae=s[le],!n.hasOwnProperty(le)||re===ae||re===void 0&&ae===void 0||uu(e,t,le,re,n,ae);return}}for(var J in s)re=s[J],s.hasOwnProperty(J)&&re!=null&&!n.hasOwnProperty(J)&&Ke(e,t,J,null,n,re);for(de in n)re=n[de],ae=s[de],!n.hasOwnProperty(de)||re===ae||re==null&&ae==null||Ke(e,t,de,re,n,ae)}function R_(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function s0(){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,k=l.initiatorType,z=l.duration;if(_&&z&&R_(k)){for(k=0,z=l.responseEnd,n+=1;n<s.length;n++){var Z=s[n],ie=Z.startTime;if(ie>z)break;var le=Z.transferSize,de=Z.initiatorType;le&&R_(de)&&(Z=Z.responseEnd,k+=le*(Z<z?1:(z-ie)/(Z-ie)))}if(--n,t+=8*(_+k)/(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 hu=null,fu=null;function Ro(e){return e.nodeType===9?e:e.ownerDocument}function D_(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 k_(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 du(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 _u=null;function r0(){var e=window.event;return e&&e.type==="popstate"?e===_u?!1:(_u=e,!0):(_u=null,!1)}var O_=typeof setTimeout=="function"?setTimeout:void 0,n0=typeof clearTimeout=="function"?clearTimeout:void 0,M_=typeof Promise=="function"?Promise:void 0,a0=typeof queueMicrotask=="function"?queueMicrotask:typeof M_<"u"?function(e){return M_.resolve(null).then(e).catch(o0)}:O_;function o0(e){setTimeout(function(){throw e})}function Us(e){return e==="head"}function L_(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),Qr(t);return}n--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")n++;else if(s==="html")ea(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,ea(s);for(var _=s.firstChild;_;){var k=_.nextSibling,z=_.nodeName;_[Se]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&_.rel.toLowerCase()==="stylesheet"||s.removeChild(_),_=k}}else s==="body"&&ea(e.ownerDocument.body);s=l}while(s);Qr(t)}function N_(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 mu(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":mu(s),W(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function l0(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[Se])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 c0(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 B_(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 pu(e){return e.data==="$?"||e.data==="$~"}function vu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function u0(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 gu=null;function z_(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 j_(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 H_(e,t,s){switch(t=Ro(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 ea(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);W(e)}var Di=new Map,U_=new Set;function Do(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gs=K.d;K.d={f:h0,r:f0,D:d0,C:_0,L:m0,m:p0,X:g0,S:v0,M:y0};function h0(){var e=gs.f(),t=So();return e||t}function f0(e){var t=ge(e);t!==null&&t.tag===5&&t.type==="form"?id(t):gs.r(e)}var Kr=typeof document>"u"?null:document;function I_(e,t,s){var n=Kr;if(n&&typeof t=="string"&&t){var l=bi(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof s=="string"&&(l+='[crossorigin="'+s+'"]'),U_.has(l)||(U_.add(l),e={rel:e,crossOrigin:s,href:t},n.querySelector(l)===null&&(t=n.createElement("link"),It(t,"link",e),ke(t),n.head.appendChild(t)))}}function d0(e){gs.D(e),I_("dns-prefetch",e,null)}function _0(e,t){gs.C(e,t),I_("preconnect",e,t)}function m0(e,t,s){gs.L(e,t,s);var n=Kr;if(n&&e&&t){var l='link[rel="preload"][as="'+bi(t)+'"]';t==="image"&&s&&s.imageSrcSet?(l+='[imagesrcset="'+bi(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(l+='[imagesizes="'+bi(s.imageSizes)+'"]')):l+='[href="'+bi(e)+'"]';var _=l;switch(t){case"style":_=Xr(e);break;case"script":_=Jr(e)}Di.has(_)||(e=m({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Di.set(_,e),n.querySelector(l)!==null||t==="style"&&n.querySelector(ta(_))||t==="script"&&n.querySelector(ia(_))||(t=n.createElement("link"),It(t,"link",e),ke(t),n.head.appendChild(t)))}}function p0(e,t){gs.m(e,t);var s=Kr;if(s&&e){var n=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+bi(n)+'"][href="'+bi(e)+'"]',_=l;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Jr(e)}if(!Di.has(_)&&(e=m({rel:"modulepreload",href:e},t),Di.set(_,e),s.querySelector(l)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ia(_)))return}n=s.createElement("link"),It(n,"link",e),ke(n),s.head.appendChild(n)}}}function v0(e,t,s){gs.S(e,t,s);var n=Kr;if(n&&e){var l=at(n).hoistableStyles,_=Xr(e);t=t||"default";var k=l.get(_);if(!k){var z={loading:0,preload:null};if(k=n.querySelector(ta(_)))z.loading=5;else{e=m({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Di.get(_))&&yu(e,s);var Z=k=n.createElement("link");ke(Z),It(Z,"link",e),Z._p=new Promise(function(ie,le){Z.onload=ie,Z.onerror=le}),Z.addEventListener("load",function(){z.loading|=1}),Z.addEventListener("error",function(){z.loading|=2}),z.loading|=4,ko(k,t,n)}k={type:"stylesheet",instance:k,count:1,state:z},l.set(_,k)}}}function g0(e,t){gs.X(e,t);var s=Kr;if(s&&e){var n=at(s).hoistableScripts,l=Jr(e),_=n.get(l);_||(_=s.querySelector(ia(l)),_||(e=m({src:e,async:!0},t),(t=Di.get(l))&&Su(e,t),_=s.createElement("script"),ke(_),It(_,"link",e),s.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},n.set(l,_))}}function y0(e,t){gs.M(e,t);var s=Kr;if(s&&e){var n=at(s).hoistableScripts,l=Jr(e),_=n.get(l);_||(_=s.querySelector(ia(l)),_||(e=m({src:e,async:!0,type:"module"},t),(t=Di.get(l))&&Su(e,t),_=s.createElement("script"),ke(_),It(_,"link",e),s.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},n.set(l,_))}}function P_(e,t,s,n){var l=(l=me.current)?Do(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=Xr(s.href),s=at(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=Xr(s.href);var _=at(l).hoistableStyles,k=_.get(e);if(k||(l=l.ownerDocument||l,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(e,k),(_=l.querySelector(ta(e)))&&!_._p&&(k.instance=_,k.state.loading=5),Di.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},Di.set(e,s),_||S0(l,e,s,k.state))),t&&n===null)throw Error(o(528,""));return k}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=Jr(s),s=at(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 Xr(e){return'href="'+bi(e)+'"'}function ta(e){return'link[rel="stylesheet"]['+e+"]"}function $_(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function S0(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}),It(t,"link",s),ke(t),e.head.appendChild(t))}function Jr(e){return'[src="'+bi(e)+'"]'}function ia(e){return"script[async]"+e}function F_(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+bi(s.href)+'"]');if(n)return t.instance=n,ke(n),n;var l=m({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ke(n),It(n,"style",l),ko(n,s.precedence,e),t.instance=n;case"stylesheet":l=Xr(s.href);var _=e.querySelector(ta(l));if(_)return t.state.loading|=4,t.instance=_,ke(_),_;n=$_(s),(l=Di.get(l))&&yu(n,l),_=(e.ownerDocument||e).createElement("link"),ke(_);var k=_;return k._p=new Promise(function(z,Z){k.onload=z,k.onerror=Z}),It(_,"link",n),t.state.loading|=4,ko(_,s.precedence,e),t.instance=_;case"script":return _=Jr(s.src),(l=e.querySelector(ia(_)))?(t.instance=l,ke(l),l):(n=s,(l=Di.get(_))&&(n=m({},s),Su(n,l)),e=e.ownerDocument||e,l=e.createElement("script"),ke(l),It(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,ko(n,s.precedence,e));return t.instance}function ko(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,k=0;k<n.length;k++){var z=n[k];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 yu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Su(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Oo=null;function Z_(e,t,s){if(Oo===null){var n=new Map,l=Oo=new Map;l.set(s,n)}else l=Oo,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(!(_[Se]||_[yt]||e==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var k=_.getAttribute(t)||"";k=e+k;var z=n.get(k);z?z.push(_):n.set(k,[_])}}return n}function q_(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function b0(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 G_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function C0(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=Xr(n.href),_=t.querySelector(ta(l));if(_){t=_._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Mo.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=_,ke(_);return}_=t.ownerDocument||t,n=$_(n),(l=Di.get(l))&&yu(n,l),_=_.createElement("link"),ke(_);var k=_;k._p=new Promise(function(z,Z){k.onload=z,k.onerror=Z}),It(_,"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=Mo.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var bu=0;function x0(e,t){return e.stylesheets&&e.count===0&&No(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var n=setTimeout(function(){if(e.stylesheets&&No(e,e.stylesheets),e.unsuspend){var _=e.unsuspend;e.unsuspend=null,_()}},6e4+t);0<e.imgBytes&&bu===0&&(bu=62500*s0());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&No(e,e.stylesheets),e.unsuspend)){var _=e.unsuspend;e.unsuspend=null,_()}},(e.imgBytes>bu?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(l)}}:null}function Mo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)No(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Lo=null;function No(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Lo=new Map,t.forEach(w0,e),Lo=null,Mo.call(e))}function w0(e,t){if(!(t.state.loading&4)){var s=Lo.get(e);if(s)var n=s.get(null);else{s=new Map,Lo.set(e,s);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<l.length;_++){var k=l[_];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(s.set(k.dataset.precedence,k),n=k)}n&&s.set(null,n)}l=t.instance,k=l.getAttribute("data-precedence"),_=s.get(k)||n,_===n&&s.set(null,l),s.set(k,l),this.count++,n=Mo.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 sa={$$typeof:v,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function E0(e,t,s,n,l,_,k,z,Z){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=fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fn(0),this.hiddenUpdates=fn(null),this.identifierPrefix=n,this.onUncaughtError=l,this.onCaughtError=_,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function W_(e,t,s,n,l,_,k,z,Z,ie,le,de){return e=new E0(e,t,s,k,Z,ie,le,de,z),t=1,_===!0&&(t|=24),_=li(3,null,null,t),e.current=_,_.stateNode=e,t=ec(),t.refCount++,e.pooledCache=t,t.refCount++,_.memoizedState={element:n,isDehydrated:s,cache:t},rc(_),e}function Y_(e){return e?(e=Dr,e):Dr}function V_(e,t,s,n,l,_){l=Y_(l),n.context===null?n.context=l:n.pendingContext=l,n=Rs(t),n.payload={element:s},_=_===void 0?null:_,_!==null&&(n.callback=_),s=Ds(e,n,t),s!==null&&(ri(s,e,t),Bn(s,e,t))}function K_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Cu(e,t){K_(e,t),(e=e.alternate)&&K_(e,t)}function X_(e){if(e.tag===13||e.tag===31){var t=ir(e,67108864);t!==null&&ri(t,e,67108864),Cu(e,67108864)}}function J_(e){if(e.tag===13||e.tag===31){var t=di();t=Xt(t);var s=ir(e,t);s!==null&&ri(s,e,t),Cu(e,t)}}var Bo=!0;function T0(e,t,s,n){var l=G.T;G.T=null;var _=K.p;try{K.p=2,xu(e,t,s,n)}finally{K.p=_,G.T=l}}function A0(e,t,s,n){var l=G.T;G.T=null;var _=K.p;try{K.p=8,xu(e,t,s,n)}finally{K.p=_,G.T=l}}function xu(e,t,s,n){if(Bo){var l=wu(n);if(l===null)cu(e,t,n,zo,s),em(e,n);else if(D0(l,e,t,s,n))n.stopPropagation();else if(em(e,n),t&4&&-1<R0.indexOf(e)){for(;l!==null;){var _=ge(l);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var k=ai(_.pendingLanes);if(k!==0){var z=_;for(z.pendingLanes|=2,z.entangledLanes|=2;k;){var Z=1<<31-gt(k);z.entanglements[1]|=Z,k&=~Z}qi(_),(Fe&6)===0&&(go=nt()+500,Xn(0))}}break;case 31:case 13:z=ir(_,2),z!==null&&ri(z,_,2),So(),Cu(_,2)}if(_=wu(n),_===null&&cu(e,t,n,zo,s),_===l)break;l=_}l!==null&&n.stopPropagation()}else cu(e,t,n,null,s)}}function wu(e){return e=Tl(e),Eu(e)}var zo=null;function Eu(e){if(zo=null,e=_e(e),e!==null){var t=x(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=T(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 zo=e,null}function Q_(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(Dt()){case Zt:return 2;case Nt:return 8;case Bt:case Ki:return 32;case Kt:return 268435456;default:return 32}default:return 32}}var Tu=!1,Is=null,Ps=null,$s=null,ra=new Map,na=new Map,Fs=[],R0="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 em(e,t){switch(e){case"focusin":case"focusout":Is=null;break;case"dragenter":case"dragleave":Ps=null;break;case"mouseover":case"mouseout":$s=null;break;case"pointerover":case"pointerout":ra.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":na.delete(t.pointerId)}}function aa(e,t,s,n,l,_){return e===null||e.nativeEvent!==_?(e={blockedOn:t,domEventName:s,eventSystemFlags:n,nativeEvent:_,targetContainers:[l]},t!==null&&(t=ge(t),t!==null&&X_(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function D0(e,t,s,n,l){switch(t){case"focusin":return Is=aa(Is,e,t,s,n,l),!0;case"dragenter":return Ps=aa(Ps,e,t,s,n,l),!0;case"mouseover":return $s=aa($s,e,t,s,n,l),!0;case"pointerover":var _=l.pointerId;return ra.set(_,aa(ra.get(_)||null,e,t,s,n,l)),!0;case"gotpointercapture":return _=l.pointerId,na.set(_,aa(na.get(_)||null,e,t,s,n,l)),!0}return!1}function tm(e){var t=_e(e.target);if(t!==null){var s=x(t);if(s!==null){if(t=s.tag,t===13){if(t=T(s),t!==null){e.blockedOn=t,vn(e.priority,function(){J_(s)});return}}else if(t===31){if(t=c(s),t!==null){e.blockedOn=t,vn(e.priority,function(){J_(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 jo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=wu(e.nativeEvent);if(s===null){s=e.nativeEvent;var n=new s.constructor(s.type,s);El=n,s.target.dispatchEvent(n),El=null}else return t=ge(s),t!==null&&X_(t),e.blockedOn=s,!1;t.shift()}return!0}function im(e,t,s){jo(e)&&s.delete(t)}function k0(){Tu=!1,Is!==null&&jo(Is)&&(Is=null),Ps!==null&&jo(Ps)&&(Ps=null),$s!==null&&jo($s)&&($s=null),ra.forEach(im),na.forEach(im)}function Ho(e,t){e.blockedOn===t&&(e.blockedOn=null,Tu||(Tu=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,k0)))}var Uo=null;function sm(e){Uo!==e&&(Uo=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Uo===e&&(Uo=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(Eu(n||s)===null)continue;break}var _=ge(s);_!==null&&(e.splice(t,3),t-=3,wc(_,{pending:!0,data:l,method:s.method,action:n},n,l))}}))}function Qr(e){function t(Z){return Ho(Z,e)}Is!==null&&Ho(Is,e),Ps!==null&&Ho(Ps,e),$s!==null&&Ho($s,e),ra.forEach(t),na.forEach(t);for(var s=0;s<Fs.length;s++){var n=Fs[s];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Fs.length&&(s=Fs[0],s.blockedOn===null);)tm(s),s.blockedOn===null&&Fs.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(n=0;n<s.length;n+=3){var l=s[n],_=s[n+1],k=l[it]||null;if(typeof _=="function")k||sm(s);else if(k){var z=null;if(_&&_.hasAttribute("formAction")){if(l=_,k=_[it]||null)z=k.formAction;else if(Eu(l)!==null)continue}else z=k.action;typeof z=="function"?s[n+1]=z:(s.splice(n,3),n-=3),sm(s)}}}function rm(){function e(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(k){return l=k})},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 Au(e){this._internalRoot=e}Io.prototype.render=Au.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,n=di();V_(s,n,e,t,null,null)},Io.prototype.unmount=Au.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;V_(e.current,2,null,e,null,null),So(),t[es]=null}};function Io(e){this._internalRoot=e}Io.prototype.unstable_scheduleHydration=function(e){if(e){var t=pn();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Fs.length&&t!==0&&t<Fs[s].priority;s++);Fs.splice(s,0,e),s===0&&tm(e)}};var nm=r.version;if(nm!=="19.2.4")throw Error(o(527,nm,"19.2.4"));K.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 O0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Po=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Po.isDisabled&&Po.supportsFiber)try{vi=Po.inject(O0),kt=Po}catch{}}return la.createRoot=function(e,t){if(!g(e))throw Error(o(299));var s=!1,n="",l=fd,_=dd,k=_d;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&&(k=t.onRecoverableError)),t=W_(e,1,!1,null,null,s,n,null,l,_,k,rm),e[es]=t.current,lu(e),new Au(t)},la.hydrateRoot=function(e,t,s){if(!g(e))throw Error(o(299));var n=!1,l="",_=fd,k=dd,z=_d,Z=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&&(k=s.onCaughtError),s.onRecoverableError!==void 0&&(z=s.onRecoverableError),s.formState!==void 0&&(Z=s.formState)),t=W_(e,1,!0,t,s??null,n,l,Z,_,k,z,rm),t.context=Y_(null),s=t.current,n=di(),n=Xt(n),l=Rs(n),l.callback=null,Ds(s,l,n),s=n,t.current.lanes=s,bs(t,s),qi(t),e[es]=t.current,lu(e),new Io(t)},la.version="19.2.4",la}var mm;function F0(){if(mm)return ku.exports;mm=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(),ku.exports=$0(),ku.exports}var Z0=F0();const q0=hp(Z0);/**
|
|
50
50
|
* react-router v7.13.2
|
|
51
51
|
*
|
|
52
52
|
* Copyright (c) Remix Software Inc.
|
|
@@ -55,9 +55,9 @@ Error generating stack: `+n.message+`
|
|
|
55
55
|
* LICENSE.md file in the root directory of this source tree.
|
|
56
56
|
*
|
|
57
57
|
* @license MIT
|
|
58
|
-
*/var pm="popstate";function vm(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function G0(i={}){function r(o,g){var u;let w=(u=g.state)==null?void 0:u.masked,{pathname:T,search:c,hash:h}=w||o.location;return Ku("",{pathname:T,search:c,hash:h},g.state&&g.state.usr||null,g.state&&g.state.key||"default",w?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,g){return typeof g=="string"?g:ya(g)}return Y0(r,a,null,i)}function ot(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function Yi(i,r){if(!i){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function W0(){return Math.random().toString(36).substring(2,10)}function gm(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 Ku(i,r,a=null,o,g){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof r=="string"?on(r):r,state:a,key:r&&r.key||o||W0(),unstable_mask:g}}function ya({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 on(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 Y0(i,r,a,o={}){let{window:g=document.defaultView,v5Compat:w=!1}=o,T=g.history,c="POP",h=null,u=y();u==null&&(u=0,T.replaceState({...T.state,idx:u},""));function y(){return(T.state||{idx:null}).idx}function m(){c="POP";let d=y(),p=d==null?null:d-u;u=d,h&&h({action:c,location:b.location,delta:p})}function C(d,p){c="PUSH";let f=vm(d)?d:Ku(b.location,d,p);u=y()+1;let v=gm(f,u),S=b.createHref(f.unstable_mask||f);try{T.pushState(v,"",S)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;g.location.assign(S)}w&&h&&h({action:c,location:b.location,delta:1})}function x(d,p){c="REPLACE";let f=vm(d)?d:Ku(b.location,d,p);u=y();let v=gm(f,u),S=b.createHref(f.unstable_mask||f);T.replaceState(v,"",S),w&&h&&h({action:c,location:b.location,delta:0})}function E(d){return V0(d)}let b={get action(){return c},get location(){return i(g,T)},listen(d){if(h)throw new Error("A history only accepts one active listener");return g.addEventListener(pm,m),h=d,()=>{g.removeEventListener(pm,m),h=null}},createHref(d){return r(g,d)},createURL:E,encodeLocation(d){let p=E(d);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:C,replace:x,go(d){return T.go(d)}};return b}function V0(i,r=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),ot(a,"No window.location.(origin|href) available to create URL");let o=typeof i=="string"?i:ya(i);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function fp(i,r,a="/"){return K0(i,r,a,!1)}function K0(i,r,a,o){let g=typeof r=="string"?on(r):r,w=Ss(g.pathname||"/",a);if(w==null)return null;let T=dp(i);X0(T);let c=null;for(let h=0;c==null&&h<T.length;++h){let u=ly(w);c=ay(T[h],u,o)}return c}function dp(i,r=[],a=[],o="",g=!1){let w=(T,c,h=g,u)=>{let y={relativePath:u===void 0?T.path||"":u,caseSensitive:T.caseSensitive===!0,childrenIndex:c,route:T};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&h)return;ot(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 m=Wi([o,y.relativePath]),C=a.concat(y);T.children&&T.children.length>0&&(ot(T.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),dp(T.children,r,C,m,h)),!(T.path==null&&!T.index)&&r.push({path:m,score:ry(m,T.index),routesMeta:C})};return i.forEach((T,c)=>{var h;if(T.path===""||!((h=T.path)!=null&&h.includes("?")))w(T,c);else for(let u of _p(T.path))w(T,c,!0,u)}),r}function _p(i){let r=i.split("/");if(r.length===0)return[];let[a,...o]=r,g=a.endsWith("?"),w=a.replace(/\?$/,"");if(o.length===0)return g?[w,""]:[w];let T=_p(o.join("/")),c=[];return c.push(...T.map(h=>h===""?w:[w,h].join("/"))),g&&c.push(...T),c.map(h=>i.startsWith("/")&&h===""?"/":h)}function X0(i){i.sort((r,a)=>r.score!==a.score?a.score-r.score:ny(r.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var J0=/^:[\w-]+$/,Q0=3,ey=2,ty=1,iy=10,sy=-2,ym=i=>i==="*";function ry(i,r){let a=i.split("/"),o=a.length;return a.some(ym)&&(o+=sy),r&&(o+=ey),a.filter(g=>!ym(g)).reduce((g,w)=>g+(J0.test(w)?Q0:w===""?ty:iy),o)}function ny(i,r){return i.length===r.length&&i.slice(0,-1).every((o,g)=>o===r[g])?i[i.length-1]-r[r.length-1]:0}function ay(i,r,a=!1){let{routesMeta:o}=i,g={},w="/",T=[];for(let c=0;c<o.length;++c){let h=o[c],u=c===o.length-1,y=w==="/"?r:r.slice(w.length)||"/",m=tl({path:h.relativePath,caseSensitive:h.caseSensitive,end:u},y),C=h.route;if(!m&&u&&a&&!o[o.length-1].route.index&&(m=tl({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},y)),!m)return null;Object.assign(g,m.params),T.push({params:g,pathname:Wi([w,m.pathname]),pathnameBase:fy(Wi([w,m.pathnameBase])),route:C}),m.pathnameBase!=="/"&&(w=Wi([w,m.pathnameBase]))}return T}function tl(i,r){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[a,o]=oy(i.path,i.caseSensitive,i.end),g=r.match(a);if(!g)return null;let w=g[0],T=w.replace(/(.)\/+$/,"$1"),c=g.slice(1);return{params:o.reduce((u,{paramName:y,isOptional:m},C)=>{if(y==="*"){let E=c[C]||"";T=w.slice(0,w.length-E.length).replace(/(.)\/+$/,"$1")}const x=c[C];return m&&!x?u[y]=void 0:u[y]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:w,pathnameBase:T,pattern:i}}function oy(i,r=!1,a=!0){Yi(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=[],g="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(T,c,h,u,y)=>{if(o.push({paramName:c,isOptional:h!=null}),h){let m=y.charAt(u+T.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(o.push({paramName:"*"}),g+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?g+="\\/*$":i!==""&&i!=="/"&&(g+="(?:(?=\\/|$))"),[new RegExp(g,r?void 0:"i"),o]}function ly(i){try{return i.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Yi(!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 Ss(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 cy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function uy(i,r="/"){let{pathname:a,search:o="",hash:g=""}=typeof i=="string"?on(i):i,w;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?w=Sm(a.substring(1),"/"):w=Sm(a,r)):w=r,{pathname:w,search:dy(o),hash:_y(g)}}function Sm(i,r){let a=r.replace(/\/+$/,"").split("/");return i.split("/").forEach(g=>{g===".."?a.length>1&&a.pop():g!=="."&&a.push(g)}),a.length>1?a.join("/"):"/"}function Nu(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 hy(i){return i.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function mp(i){let r=hy(i);return r.map((a,o)=>o===r.length-1?a.pathname:a.pathnameBase)}function nh(i,r,a,o=!1){let g;typeof i=="string"?g=on(i):(g={...i},ot(!g.pathname||!g.pathname.includes("?"),Nu("?","pathname","search",g)),ot(!g.pathname||!g.pathname.includes("#"),Nu("#","pathname","hash",g)),ot(!g.search||!g.search.includes("#"),Nu("#","search","hash",g)));let w=i===""||g.pathname==="",T=w?"/":g.pathname,c;if(T==null)c=a;else{let m=r.length-1;if(!o&&T.startsWith("..")){let C=T.split("/");for(;C[0]==="..";)C.shift(),m-=1;g.pathname=C.join("/")}c=m>=0?r[m]:"/"}let h=uy(g,c),u=T&&T!=="/"&&T.endsWith("/"),y=(w||T===".")&&a.endsWith("/");return!h.pathname.endsWith("/")&&(u||y)&&(h.pathname+="/"),h}var Wi=i=>i.join("/").replace(/\/\/+/g,"/"),fy=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),dy=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,_y=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,my=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 py(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function vy(i){return i.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var pp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function vp(i,r){let a=i;if(typeof a!="string"||!cy.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,g=!1;if(pp)try{let w=new URL(window.location.href),T=a.startsWith("//")?new URL(w.protocol+a):new URL(a),c=Ss(T.pathname,r);T.origin===w.origin&&c!=null?a=c+T.search+T.hash:g=!0}catch{Yi(!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:g,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var gp=["POST","PUT","PATCH","DELETE"];new Set(gp);var gy=["GET",...gp];new Set(gy);var ln=F.createContext(null);ln.displayName="DataRouter";var cl=F.createContext(null);cl.displayName="DataRouterState";var yy=F.createContext(!1),yp=F.createContext({isTransitioning:!1});yp.displayName="ViewTransition";var Sy=F.createContext(new Map);Sy.displayName="Fetchers";var by=F.createContext(null);by.displayName="Await";var Oi=F.createContext(null);Oi.displayName="Navigation";var ba=F.createContext(null);ba.displayName="Location";var Ui=F.createContext({outlet:null,matches:[],isDataRoute:!1});Ui.displayName="Route";var ah=F.createContext(null);ah.displayName="RouteError";var Sp="REACT_ROUTER_ERROR",Cy="REDIRECT",xy="ROUTE_ERROR_RESPONSE";function wy(i){if(i.startsWith(`${Sp}:${Cy}:{`))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 Ey(i){if(i.startsWith(`${Sp}:${xy}:{`))try{let r=JSON.parse(i.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new my(r.status,r.statusText,r.data)}catch{}}function Ty(i,{relative:r}={}){ot(Ca(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=F.useContext(Oi),{hash:g,pathname:w,search:T}=xa(i,{relative:r}),c=w;return a!=="/"&&(c=w==="/"?a:Wi([a,w])),o.createHref({pathname:c,search:T,hash:g})}function Ca(){return F.useContext(ba)!=null}function Ys(){return ot(Ca(),"useLocation() may be used only in the context of a <Router> component."),F.useContext(ba).location}var bp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Cp(i){F.useContext(Oi).static||F.useLayoutEffect(i)}function ul(){let{isDataRoute:i}=F.useContext(Ui);return i?Py():Ay()}function Ay(){ot(Ca(),"useNavigate() may be used only in the context of a <Router> component.");let i=F.useContext(ln),{basename:r,navigator:a}=F.useContext(Oi),{matches:o}=F.useContext(Ui),{pathname:g}=Ys(),w=JSON.stringify(mp(o)),T=F.useRef(!1);return Cp(()=>{T.current=!0}),F.useCallback((h,u={})=>{if(Yi(T.current,bp),!T.current)return;if(typeof h=="number"){a.go(h);return}let y=nh(h,JSON.parse(w),g,u.relative==="path");i==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:Wi([r,y.pathname])),(u.replace?a.replace:a.push)(y,u.state,u)},[r,a,w,g,i])}var Ry=F.createContext(null);function Dy(i){let r=F.useContext(Ui).outlet;return F.useMemo(()=>r&&F.createElement(Ry.Provider,{value:i},r),[r,i])}function xp(){let{matches:i}=F.useContext(Ui),r=i[i.length-1];return r?r.params:{}}function xa(i,{relative:r}={}){let{matches:a}=F.useContext(Ui),{pathname:o}=Ys(),g=JSON.stringify(mp(a));return F.useMemo(()=>nh(i,JSON.parse(g),o,r==="path"),[i,g,o,r])}function ky(i,r){return wp(i,r)}function wp(i,r,a){var d;ot(Ca(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=F.useContext(Oi),{matches:g}=F.useContext(Ui),w=g[g.length-1],T=w?w.params:{},c=w?w.pathname:"/",h=w?w.pathnameBase:"/",u=w&&w.route;{let p=u&&u.path||"";Tp(c,!u||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${p}">) 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.
|
|
58
|
+
*/var pm="popstate";function vm(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function G0(i={}){function r(o,g){var u;let x=(u=g.state)==null?void 0:u.masked,{pathname:T,search:c,hash:h}=x||o.location;return Ku("",{pathname:T,search:c,hash:h},g.state&&g.state.usr||null,g.state&&g.state.key||"default",x?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,g){return typeof g=="string"?g:ya(g)}return Y0(r,a,null,i)}function ot(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function Yi(i,r){if(!i){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function W0(){return Math.random().toString(36).substring(2,10)}function gm(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 Ku(i,r,a=null,o,g){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof r=="string"?on(r):r,state:a,key:r&&r.key||o||W0(),unstable_mask:g}}function ya({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 on(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 Y0(i,r,a,o={}){let{window:g=document.defaultView,v5Compat:x=!1}=o,T=g.history,c="POP",h=null,u=y();u==null&&(u=0,T.replaceState({...T.state,idx:u},""));function y(){return(T.state||{idx:null}).idx}function m(){c="POP";let d=y(),p=d==null?null:d-u;u=d,h&&h({action:c,location:b.location,delta:p})}function C(d,p){c="PUSH";let f=vm(d)?d:Ku(b.location,d,p);u=y()+1;let v=gm(f,u),S=b.createHref(f.unstable_mask||f);try{T.pushState(v,"",S)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;g.location.assign(S)}x&&h&&h({action:c,location:b.location,delta:1})}function w(d,p){c="REPLACE";let f=vm(d)?d:Ku(b.location,d,p);u=y();let v=gm(f,u),S=b.createHref(f.unstable_mask||f);T.replaceState(v,"",S),x&&h&&h({action:c,location:b.location,delta:0})}function E(d){return V0(d)}let b={get action(){return c},get location(){return i(g,T)},listen(d){if(h)throw new Error("A history only accepts one active listener");return g.addEventListener(pm,m),h=d,()=>{g.removeEventListener(pm,m),h=null}},createHref(d){return r(g,d)},createURL:E,encodeLocation(d){let p=E(d);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:C,replace:w,go(d){return T.go(d)}};return b}function V0(i,r=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),ot(a,"No window.location.(origin|href) available to create URL");let o=typeof i=="string"?i:ya(i);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function fp(i,r,a="/"){return K0(i,r,a,!1)}function K0(i,r,a,o){let g=typeof r=="string"?on(r):r,x=Ss(g.pathname||"/",a);if(x==null)return null;let T=dp(i);X0(T);let c=null;for(let h=0;c==null&&h<T.length;++h){let u=ly(x);c=ay(T[h],u,o)}return c}function dp(i,r=[],a=[],o="",g=!1){let x=(T,c,h=g,u)=>{let y={relativePath:u===void 0?T.path||"":u,caseSensitive:T.caseSensitive===!0,childrenIndex:c,route:T};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&h)return;ot(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 m=Wi([o,y.relativePath]),C=a.concat(y);T.children&&T.children.length>0&&(ot(T.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),dp(T.children,r,C,m,h)),!(T.path==null&&!T.index)&&r.push({path:m,score:ry(m,T.index),routesMeta:C})};return i.forEach((T,c)=>{var h;if(T.path===""||!((h=T.path)!=null&&h.includes("?")))x(T,c);else for(let u of _p(T.path))x(T,c,!0,u)}),r}function _p(i){let r=i.split("/");if(r.length===0)return[];let[a,...o]=r,g=a.endsWith("?"),x=a.replace(/\?$/,"");if(o.length===0)return g?[x,""]:[x];let T=_p(o.join("/")),c=[];return c.push(...T.map(h=>h===""?x:[x,h].join("/"))),g&&c.push(...T),c.map(h=>i.startsWith("/")&&h===""?"/":h)}function X0(i){i.sort((r,a)=>r.score!==a.score?a.score-r.score:ny(r.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var J0=/^:[\w-]+$/,Q0=3,ey=2,ty=1,iy=10,sy=-2,ym=i=>i==="*";function ry(i,r){let a=i.split("/"),o=a.length;return a.some(ym)&&(o+=sy),r&&(o+=ey),a.filter(g=>!ym(g)).reduce((g,x)=>g+(J0.test(x)?Q0:x===""?ty:iy),o)}function ny(i,r){return i.length===r.length&&i.slice(0,-1).every((o,g)=>o===r[g])?i[i.length-1]-r[r.length-1]:0}function ay(i,r,a=!1){let{routesMeta:o}=i,g={},x="/",T=[];for(let c=0;c<o.length;++c){let h=o[c],u=c===o.length-1,y=x==="/"?r:r.slice(x.length)||"/",m=tl({path:h.relativePath,caseSensitive:h.caseSensitive,end:u},y),C=h.route;if(!m&&u&&a&&!o[o.length-1].route.index&&(m=tl({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},y)),!m)return null;Object.assign(g,m.params),T.push({params:g,pathname:Wi([x,m.pathname]),pathnameBase:fy(Wi([x,m.pathnameBase])),route:C}),m.pathnameBase!=="/"&&(x=Wi([x,m.pathnameBase]))}return T}function tl(i,r){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[a,o]=oy(i.path,i.caseSensitive,i.end),g=r.match(a);if(!g)return null;let x=g[0],T=x.replace(/(.)\/+$/,"$1"),c=g.slice(1);return{params:o.reduce((u,{paramName:y,isOptional:m},C)=>{if(y==="*"){let E=c[C]||"";T=x.slice(0,x.length-E.length).replace(/(.)\/+$/,"$1")}const w=c[C];return m&&!w?u[y]=void 0:u[y]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:x,pathnameBase:T,pattern:i}}function oy(i,r=!1,a=!0){Yi(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=[],g="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(T,c,h,u,y)=>{if(o.push({paramName:c,isOptional:h!=null}),h){let m=y.charAt(u+T.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(o.push({paramName:"*"}),g+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?g+="\\/*$":i!==""&&i!=="/"&&(g+="(?:(?=\\/|$))"),[new RegExp(g,r?void 0:"i"),o]}function ly(i){try{return i.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Yi(!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 Ss(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 cy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function uy(i,r="/"){let{pathname:a,search:o="",hash:g=""}=typeof i=="string"?on(i):i,x;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?x=Sm(a.substring(1),"/"):x=Sm(a,r)):x=r,{pathname:x,search:dy(o),hash:_y(g)}}function Sm(i,r){let a=r.replace(/\/+$/,"").split("/");return i.split("/").forEach(g=>{g===".."?a.length>1&&a.pop():g!=="."&&a.push(g)}),a.length>1?a.join("/"):"/"}function Nu(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 hy(i){return i.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function mp(i){let r=hy(i);return r.map((a,o)=>o===r.length-1?a.pathname:a.pathnameBase)}function nh(i,r,a,o=!1){let g;typeof i=="string"?g=on(i):(g={...i},ot(!g.pathname||!g.pathname.includes("?"),Nu("?","pathname","search",g)),ot(!g.pathname||!g.pathname.includes("#"),Nu("#","pathname","hash",g)),ot(!g.search||!g.search.includes("#"),Nu("#","search","hash",g)));let x=i===""||g.pathname==="",T=x?"/":g.pathname,c;if(T==null)c=a;else{let m=r.length-1;if(!o&&T.startsWith("..")){let C=T.split("/");for(;C[0]==="..";)C.shift(),m-=1;g.pathname=C.join("/")}c=m>=0?r[m]:"/"}let h=uy(g,c),u=T&&T!=="/"&&T.endsWith("/"),y=(x||T===".")&&a.endsWith("/");return!h.pathname.endsWith("/")&&(u||y)&&(h.pathname+="/"),h}var Wi=i=>i.join("/").replace(/\/\/+/g,"/"),fy=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),dy=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,_y=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,my=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 py(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function vy(i){return i.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var pp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function vp(i,r){let a=i;if(typeof a!="string"||!cy.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,g=!1;if(pp)try{let x=new URL(window.location.href),T=a.startsWith("//")?new URL(x.protocol+a):new URL(a),c=Ss(T.pathname,r);T.origin===x.origin&&c!=null?a=c+T.search+T.hash:g=!0}catch{Yi(!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:g,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var gp=["POST","PUT","PATCH","DELETE"];new Set(gp);var gy=["GET",...gp];new Set(gy);var ln=F.createContext(null);ln.displayName="DataRouter";var cl=F.createContext(null);cl.displayName="DataRouterState";var yy=F.createContext(!1),yp=F.createContext({isTransitioning:!1});yp.displayName="ViewTransition";var Sy=F.createContext(new Map);Sy.displayName="Fetchers";var by=F.createContext(null);by.displayName="Await";var Oi=F.createContext(null);Oi.displayName="Navigation";var ba=F.createContext(null);ba.displayName="Location";var Ui=F.createContext({outlet:null,matches:[],isDataRoute:!1});Ui.displayName="Route";var ah=F.createContext(null);ah.displayName="RouteError";var Sp="REACT_ROUTER_ERROR",Cy="REDIRECT",xy="ROUTE_ERROR_RESPONSE";function wy(i){if(i.startsWith(`${Sp}:${Cy}:{`))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 Ey(i){if(i.startsWith(`${Sp}:${xy}:{`))try{let r=JSON.parse(i.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new my(r.status,r.statusText,r.data)}catch{}}function Ty(i,{relative:r}={}){ot(Ca(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=F.useContext(Oi),{hash:g,pathname:x,search:T}=xa(i,{relative:r}),c=x;return a!=="/"&&(c=x==="/"?a:Wi([a,x])),o.createHref({pathname:c,search:T,hash:g})}function Ca(){return F.useContext(ba)!=null}function Ys(){return ot(Ca(),"useLocation() may be used only in the context of a <Router> component."),F.useContext(ba).location}var bp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Cp(i){F.useContext(Oi).static||F.useLayoutEffect(i)}function ul(){let{isDataRoute:i}=F.useContext(Ui);return i?Py():Ay()}function Ay(){ot(Ca(),"useNavigate() may be used only in the context of a <Router> component.");let i=F.useContext(ln),{basename:r,navigator:a}=F.useContext(Oi),{matches:o}=F.useContext(Ui),{pathname:g}=Ys(),x=JSON.stringify(mp(o)),T=F.useRef(!1);return Cp(()=>{T.current=!0}),F.useCallback((h,u={})=>{if(Yi(T.current,bp),!T.current)return;if(typeof h=="number"){a.go(h);return}let y=nh(h,JSON.parse(x),g,u.relative==="path");i==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:Wi([r,y.pathname])),(u.replace?a.replace:a.push)(y,u.state,u)},[r,a,x,g,i])}var Ry=F.createContext(null);function Dy(i){let r=F.useContext(Ui).outlet;return F.useMemo(()=>r&&F.createElement(Ry.Provider,{value:i},r),[r,i])}function xp(){let{matches:i}=F.useContext(Ui),r=i[i.length-1];return r?r.params:{}}function xa(i,{relative:r}={}){let{matches:a}=F.useContext(Ui),{pathname:o}=Ys(),g=JSON.stringify(mp(a));return F.useMemo(()=>nh(i,JSON.parse(g),o,r==="path"),[i,g,o,r])}function ky(i,r){return wp(i,r)}function wp(i,r,a){var d;ot(Ca(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=F.useContext(Oi),{matches:g}=F.useContext(Ui),x=g[g.length-1],T=x?x.params:{},c=x?x.pathname:"/",h=x?x.pathnameBase:"/",u=x&&x.route;{let p=u&&u.path||"";Tp(c,!u||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${p}">) 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
59
|
|
|
60
|
-
Please change the parent <Route path="${p}"> to <Route path="${p==="/"?"*":`${p}/*`}">.`)}let y=Ys(),m;if(r){let p=typeof r=="string"?on(r):r;ot(h==="/"||((d=p.pathname)==null?void 0:d.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 "${p.pathname}" was given in the \`location\` prop.`),m=p}else m=y;let C=m.pathname||"/",x=C;if(h!=="/"){let p=h.replace(/^\//,"").split("/");x="/"+C.replace(/^\//,"").split("/").slice(p.length).join("/")}let E=fp(i,{pathname:x});Yi(u||E!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Yi(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.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 b=By(E&&E.map(p=>Object.assign({},p,{params:Object.assign({},T,p.params),pathname:Wi([h,o.encodeLocation?o.encodeLocation(p.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?h:Wi([h,o.encodeLocation?o.encodeLocation(p.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),g,a);return r&&b?F.createElement(ba.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},b):b}function Oy(){let i=Iy(),r=py(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)",g={padding:"0.5rem",backgroundColor:o},w={padding:"2px 4px",backgroundColor:o},T=null;return console.error("Error handled by React Router default ErrorBoundary:",i),T=F.createElement(F.Fragment,null,F.createElement("p",null,"💿 Hey developer 👋"),F.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",F.createElement("code",{style:w},"ErrorBoundary")," or"," ",F.createElement("code",{style:w},"errorElement")," prop on your route.")),F.createElement(F.Fragment,null,F.createElement("h2",null,"Unexpected Application Error!"),F.createElement("h3",{style:{fontStyle:"italic"}},r),a?F.createElement("pre",{style:g},a):null,T)}var My=F.createElement(Oy,null),Ep=class extends F.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=Ey(i.digest);a&&(i=a)}let r=i!==void 0?F.createElement(Ui.Provider,{value:this.props.routeContext},F.createElement(ah.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?F.createElement(Ly,{error:i},r):r}};Ep.contextType=yy;var Bu=new WeakMap;function Ly({children:i,error:r}){let{basename:a}=F.useContext(Oi);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let o=wy(r.digest);if(o){let g=Bu.get(r);if(g)throw g;let w=vp(o.location,a);if(pp&&!Bu.get(r))if(w.isExternal||o.reloadDocument)window.location.href=w.absoluteURL||w.to;else{const T=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(w.to,{replace:o.replace}));throw Bu.set(r,T),T}return F.createElement("meta",{httpEquiv:"refresh",content:`0;url=${w.absoluteURL||w.to}`})}}return i}function Ny({routeContext:i,match:r,children:a}){let o=F.useContext(ln);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),F.createElement(Ui.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 g=i,w=o==null?void 0:o.errors;if(w!=null){let y=g.findIndex(m=>m.route.id&&(w==null?void 0:w[m.route.id])!==void 0);ot(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(w).join(",")}`),g=g.slice(0,Math.min(g.length,y+1))}let T=!1,c=-1;if(a&&o){T=o.renderFallback;for(let y=0;y<g.length;y++){let m=g[y];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(c=y),m.route.id){let{loaderData:C,errors:x}=o,E=m.route.loader&&!C.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||E){a.isStatic&&(T=!0),c>=0?g=g.slice(0,c+1):g=[g[0]];break}}}}let h=a==null?void 0:a.onError,u=o&&h?(y,m)=>{var C,x;h(y,{location:o.location,params:((x=(C=o.matches)==null?void 0:C[0])==null?void 0:x.params)??{},unstable_pattern:vy(o.matches),errorInfo:m})}:void 0;return g.reduceRight((y,m,C)=>{let x,E=!1,b=null,d=null;o&&(x=w&&m.route.id?w[m.route.id]:void 0,b=m.route.errorElement||My,T&&(c<0&&C===0?(Tp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,d=null):c===C&&(E=!0,d=m.route.hydrateFallbackElement||null)));let p=r.concat(g.slice(0,C+1)),f=()=>{let v;return x?v=b:E?v=d:m.route.Component?v=F.createElement(m.route.Component,null):m.route.element?v=m.route.element:v=y,F.createElement(Ny,{match:m,routeContext:{outlet:y,matches:p,isDataRoute:o!=null},children:v})};return o&&(m.route.ErrorBoundary||m.route.errorElement||C===0)?F.createElement(Ep,{location:o.location,revalidation:o.revalidation,component:b,error:x,children:f(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:u}):f()},null)}function oh(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zy(i){let r=F.useContext(ln);return ot(r,oh(i)),r}function jy(i){let r=F.useContext(cl);return ot(r,oh(i)),r}function Hy(i){let r=F.useContext(Ui);return ot(r,oh(i)),r}function lh(i){let r=Hy(i),a=r.matches[r.matches.length-1];return ot(a.route.id,`${i} can only be used on routes that contain a unique "id"`),a.route.id}function Uy(){return lh("useRouteId")}function Iy(){var o;let i=F.useContext(ah),r=jy("useRouteError"),a=lh("useRouteError");return i!==void 0?i:(o=r.errors)==null?void 0:o[a]}function Py(){let{router:i}=zy("useNavigate"),r=lh("useNavigate"),a=F.useRef(!1);return Cp(()=>{a.current=!0}),F.useCallback(async(g,w={})=>{Yi(a.current,bp),a.current&&(typeof g=="number"?await i.navigate(g):await i.navigate(g,{fromRouteId:r,...w}))},[i,r])}var bm={};function Tp(i,r,a){!r&&!bm[i]&&(bm[i]=!0,Yi(!1,a))}F.memo($y);function $y({routes:i,future:r,state:a,isStatic:o,onError:g}){return wp(i,void 0,{state:a,isStatic:o,onError:g})}function Fy(i){return Dy(i.context)}function pr(i){ot(!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 Zy({basename:i="/",children:r=null,location:a,navigationType:o="POP",navigator:g,static:w=!1,unstable_useTransitions:T}){ot(!Ca(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=i.replace(/^\/*/,"/"),h=F.useMemo(()=>({basename:c,navigator:g,static:w,unstable_useTransitions:T,future:{}}),[c,g,w,T]);typeof a=="string"&&(a=on(a));let{pathname:u="/",search:y="",hash:m="",state:C=null,key:x="default",unstable_mask:E}=a,b=F.useMemo(()=>{let d=Ss(u,c);return d==null?null:{location:{pathname:d,search:y,hash:m,state:C,key:x,unstable_mask:E},navigationType:o}},[c,u,y,m,C,x,o,E]);return Yi(b!=null,`<Router basename="${c}"> is not able to match the URL "${u}${y}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:F.createElement(Oi.Provider,{value:h},F.createElement(ba.Provider,{children:r,value:b}))}function qy({children:i,location:r}){return ky(Xu(i),r)}function Xu(i,r=[]){let a=[];return F.Children.forEach(i,(o,g)=>{if(!F.isValidElement(o))return;let w=[...r,g];if(o.type===F.Fragment){a.push.apply(a,Xu(o.props.children,w));return}ot(o.type===pr,`[${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>`),ot(!o.props.index||!o.props.children,"An index route cannot have child routes.");let T={id:o.props.id||w.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&&(T.children=Xu(o.props.children,w)),a.push(T)}),a}var Xo="get",Jo="application/x-www-form-urlencoded";function hl(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function Gy(i){return hl(i)&&i.tagName.toLowerCase()==="button"}function Wy(i){return hl(i)&&i.tagName.toLowerCase()==="form"}function Yy(i){return hl(i)&&i.tagName.toLowerCase()==="input"}function Vy(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function Ky(i,r){return i.button===0&&(!r||r==="_self")&&!Vy(i)}var $o=null;function Xy(){if($o===null)try{new FormData(document.createElement("form"),0),$o=!1}catch{$o=!0}return $o}var Jy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function zu(i){return i!=null&&!Jy.has(i)?(Yi(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jo}"`),null):i}function Qy(i,r){let a,o,g,w,T;if(Wy(i)){let c=i.getAttribute("action");o=c?Ss(c,r):null,a=i.getAttribute("method")||Xo,g=zu(i.getAttribute("enctype"))||Jo,w=new FormData(i)}else if(Gy(i)||Yy(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?Ss(h,r):null,a=i.getAttribute("formmethod")||c.getAttribute("method")||Xo,g=zu(i.getAttribute("formenctype"))||zu(c.getAttribute("enctype"))||Jo,w=new FormData(c,i),!Xy()){let{name:u,type:y,value:m}=i;if(y==="image"){let C=u?`${u}.`:"";w.append(`${C}x`,"0"),w.append(`${C}y`,"0")}else u&&w.append(u,m)}}else{if(hl(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Xo,o=null,g=Jo,T=i}return w&&g==="text/plain"&&(T=w,w=void 0),{action:o,method:a.toLowerCase(),encType:g,formData:w,body:T}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ch(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function eS(i,r,a,o){let g=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return a?g.pathname.endsWith("/")?g.pathname=`${g.pathname}_.${o}`:g.pathname=`${g.pathname}.${o}`:g.pathname==="/"?g.pathname=`_root.${o}`:r&&Ss(g.pathname,r)==="/"?g.pathname=`${r.replace(/\/$/,"")}/_root.${o}`:g.pathname=`${g.pathname.replace(/\/$/,"")}.${o}`,g}async function tS(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 iS(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 sS(i,r,a){let o=await Promise.all(i.map(async g=>{let w=r.routes[g.route.id];if(w){let T=await tS(w,a);return T.links?T.links():[]}return[]}));return oS(o.flat(1).filter(iS).filter(g=>g.rel==="stylesheet"||g.rel==="preload").map(g=>g.rel==="stylesheet"?{...g,rel:"prefetch",as:"style"}:{...g,rel:"prefetch"}))}function Cm(i,r,a,o,g,w){let T=(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 w==="assets"?r.filter((h,u)=>T(h,u)||c(h,u)):w==="data"?r.filter((h,u)=>{var m;let y=o.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(T(h,u)||c(h,u))return!0;if(h.route.shouldRevalidate){let C=h.route.shouldRevalidate({currentUrl:new URL(g.pathname+g.search+g.hash,window.origin),currentParams:((m=a[0])==null?void 0:m.params)||{},nextUrl:new URL(i,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof C=="boolean")return C}return!0}):[]}function rS(i,r,{includeHydrateFallback:a}={}){return nS(i.map(o=>{let g=r.routes[o.route.id];if(!g)return[];let w=[g.module];return g.clientActionModule&&(w=w.concat(g.clientActionModule)),g.clientLoaderModule&&(w=w.concat(g.clientLoaderModule)),a&&g.hydrateFallbackModule&&(w=w.concat(g.hydrateFallbackModule)),g.imports&&(w=w.concat(g.imports)),w}).flat(1))}function nS(i){return[...new Set(i)]}function aS(i){let r={},a=Object.keys(i).sort();for(let o of a)r[o]=i[o];return r}function oS(i,r){let a=new Set;return new Set(r),i.reduce((o,g)=>{let w=JSON.stringify(aS(g));return a.has(w)||(a.add(w),o.push({key:w,link:g})),o},[])}function Ap(){let i=F.useContext(ln);return ch(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function lS(){let i=F.useContext(cl);return ch(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var uh=F.createContext(void 0);uh.displayName="FrameworkContext";function Rp(){let i=F.useContext(uh);return ch(i,"You must render this element inside a <HydratedRouter> element"),i}function cS(i,r){let a=F.useContext(uh),[o,g]=F.useState(!1),[w,T]=F.useState(!1),{onFocus:c,onBlur:h,onMouseEnter:u,onMouseLeave:y,onTouchStart:m}=r,C=F.useRef(null);F.useEffect(()=>{if(i==="render"&&T(!0),i==="viewport"){let b=p=>{p.forEach(f=>{T(f.isIntersecting)})},d=new IntersectionObserver(b,{threshold:.5});return C.current&&d.observe(C.current),()=>{d.disconnect()}}},[i]),F.useEffect(()=>{if(o){let b=setTimeout(()=>{T(!0)},100);return()=>{clearTimeout(b)}}},[o]);let x=()=>{g(!0)},E=()=>{g(!1),T(!1)};return a?i!=="intent"?[w,C,{}]:[w,C,{onFocus:ca(c,x),onBlur:ca(h,E),onMouseEnter:ca(u,x),onMouseLeave:ca(y,E),onTouchStart:ca(m,x)}]:[!1,C,{}]}function ca(i,r){return a=>{i&&i(a),a.defaultPrevented||r(a)}}function uS({page:i,...r}){let{router:a}=Ap(),o=F.useMemo(()=>fp(a.routes,i,a.basename),[a.routes,i,a.basename]);return o?F.createElement(fS,{page:i,matches:o,...r}):null}function hS(i){let{manifest:r,routeModules:a}=Rp(),[o,g]=F.useState([]);return F.useEffect(()=>{let w=!1;return sS(i,r,a).then(T=>{w||g(T)}),()=>{w=!0}},[i,r,a]),o}function fS({page:i,matches:r,...a}){let o=Ys(),{future:g,manifest:w,routeModules:T}=Rp(),{basename:c}=Ap(),{loaderData:h,matches:u}=lS(),y=F.useMemo(()=>Cm(i,r,u,w,o,"data"),[i,r,u,w,o]),m=F.useMemo(()=>Cm(i,r,u,w,o,"assets"),[i,r,u,w,o]),C=F.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let b=new Set,d=!1;if(r.forEach(f=>{var S;let v=w.routes[f.route.id];!v||!v.hasLoader||(!y.some(R=>R.route.id===f.route.id)&&f.route.id in h&&((S=T[f.route.id])!=null&&S.shouldRevalidate)||v.hasClientLoader?d=!0:b.add(f.route.id))}),b.size===0)return[];let p=eS(i,c,g.unstable_trailingSlashAwareDataRequests,"data");return d&&b.size>0&&p.searchParams.set("_routes",r.filter(f=>b.has(f.route.id)).map(f=>f.route.id).join(",")),[p.pathname+p.search]},[c,g.unstable_trailingSlashAwareDataRequests,h,o,w,y,r,i,T]),x=F.useMemo(()=>rS(m,w),[m,w]),E=hS(m);return F.createElement(F.Fragment,null,C.map(b=>F.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...a})),x.map(b=>F.createElement("link",{key:b,rel:"modulepreload",href:b,...a})),E.map(({key:b,link:d})=>F.createElement("link",{key:b,nonce:a.nonce,...d,crossOrigin:d.crossOrigin??a.crossOrigin})))}function dS(...i){return r=>{i.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var _S=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_S&&(window.__reactRouterVersion="7.13.2")}catch{}function mS({basename:i,children:r,unstable_useTransitions:a,window:o}){let g=F.useRef();g.current==null&&(g.current=G0({window:o,v5Compat:!0}));let w=g.current,[T,c]=F.useState({action:w.action,location:w.location}),h=F.useCallback(u=>{a===!1?c(u):F.startTransition(()=>c(u))},[a]);return F.useLayoutEffect(()=>w.listen(h),[w,h]),F.createElement(Zy,{basename:i,children:r,location:T.location,navigationType:T.action,navigator:w,unstable_useTransitions:a})}var Dp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hi=F.forwardRef(function({onClick:r,discover:a="render",prefetch:o="none",relative:g,reloadDocument:w,replace:T,unstable_mask:c,state:h,target:u,to:y,preventScrollReset:m,viewTransition:C,unstable_defaultShouldRevalidate:x,...E},b){let{basename:d,navigator:p,unstable_useTransitions:f}=F.useContext(Oi),v=typeof y=="string"&&Dp.test(y),S=vp(y,d);y=S.to;let R=Ty(y,{relative:g}),D=Ys(),M=null;if(c){let se=nh(c,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);d!=="/"&&(se.pathname=se.pathname==="/"?d:Wi([d,se.pathname])),M=p.createHref(se)}let[A,B,$]=cS(o,E),I=gS(y,{replace:T,unstable_mask:c,state:h,target:u,preventScrollReset:m,relative:g,viewTransition:C,unstable_defaultShouldRevalidate:x,unstable_useTransitions:f});function q(se){r&&r(se),se.defaultPrevented||I(se)}let P=!(S.isExternal||w),Q=F.createElement("a",{...E,...$,href:(P?M:void 0)||S.absoluteURL||R,onClick:P?q:r,ref:dS(b,B),target:u,"data-discover":!v&&a==="render"?"true":void 0});return A&&!v?F.createElement(F.Fragment,null,Q,F.createElement(uS,{page:R})):Q});Hi.displayName="Link";var kp=F.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:o="",end:g=!1,style:w,to:T,viewTransition:c,children:h,...u},y){let m=xa(T,{relative:u.relative}),C=Ys(),x=F.useContext(cl),{navigator:E,basename:b}=F.useContext(Oi),d=x!=null&&xS(m)&&c===!0,p=E.encodeLocation?E.encodeLocation(m).pathname:m.pathname,f=C.pathname,v=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;a||(f=f.toLowerCase(),v=v?v.toLowerCase():null,p=p.toLowerCase()),v&&b&&(v=Ss(v,b)||v);const S=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let R=f===p||!g&&f.startsWith(p)&&f.charAt(S)==="/",D=v!=null&&(v===p||!g&&v.startsWith(p)&&v.charAt(p.length)==="/"),M={isActive:R,isPending:D,isTransitioning:d},A=R?r:void 0,B;typeof o=="function"?B=o(M):B=[o,R?"active":null,D?"pending":null,d?"transitioning":null].filter(Boolean).join(" ");let $=typeof w=="function"?w(M):w;return F.createElement(Hi,{...u,"aria-current":A,className:B,ref:y,style:$,to:T,viewTransition:c},typeof h=="function"?h(M):h)});kp.displayName="NavLink";var pS=F.forwardRef(({discover:i="render",fetcherKey:r,navigate:a,reloadDocument:o,replace:g,state:w,method:T=Xo,action:c,onSubmit:h,relative:u,preventScrollReset:y,viewTransition:m,unstable_defaultShouldRevalidate:C,...x},E)=>{let{unstable_useTransitions:b}=F.useContext(Oi),d=bS(),p=CS(c,{relative:u}),f=T.toLowerCase()==="get"?"get":"post",v=typeof c=="string"&&Dp.test(c),S=R=>{if(h&&h(R),R.defaultPrevented)return;R.preventDefault();let D=R.nativeEvent.submitter,M=(D==null?void 0:D.getAttribute("formmethod"))||T,A=()=>d(D||R.currentTarget,{fetcherKey:r,method:M,navigate:a,replace:g,state:w,relative:u,preventScrollReset:y,viewTransition:m,unstable_defaultShouldRevalidate:C});b&&a!==!1?F.startTransition(()=>A()):A()};return F.createElement("form",{ref:E,method:f,action:p,onSubmit:o?h:S,...x,"data-discover":!v&&i==="render"?"true":void 0})});pS.displayName="Form";function vS(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Op(i){let r=F.useContext(ln);return ot(r,vS(i)),r}function gS(i,{target:r,replace:a,unstable_mask:o,state:g,preventScrollReset:w,relative:T,viewTransition:c,unstable_defaultShouldRevalidate:h,unstable_useTransitions:u}={}){let y=ul(),m=Ys(),C=xa(i,{relative:T});return F.useCallback(x=>{if(Ky(x,r)){x.preventDefault();let E=a!==void 0?a:ya(m)===ya(C),b=()=>y(i,{replace:E,unstable_mask:o,state:g,preventScrollReset:w,relative:T,viewTransition:c,unstable_defaultShouldRevalidate:h});u?F.startTransition(()=>b()):b()}},[m,y,C,a,o,g,r,i,w,T,c,h,u])}var yS=0,SS=()=>`__${String(++yS)}__`;function bS(){let{router:i}=Op("useSubmit"),{basename:r}=F.useContext(Oi),a=Uy(),o=i.fetch,g=i.navigate;return F.useCallback(async(w,T={})=>{let{action:c,method:h,encType:u,formData:y,body:m}=Qy(w,r);if(T.navigate===!1){let C=T.fetcherKey||SS();await o(C,a,T.action||c,{unstable_defaultShouldRevalidate:T.unstable_defaultShouldRevalidate,preventScrollReset:T.preventScrollReset,formData:y,body:m,formMethod:T.method||h,formEncType:T.encType||u,flushSync:T.flushSync})}else await g(T.action||c,{unstable_defaultShouldRevalidate:T.unstable_defaultShouldRevalidate,preventScrollReset:T.preventScrollReset,formData:y,body:m,formMethod:T.method||h,formEncType:T.encType||u,replace:T.replace,state:T.state,fromRouteId:a,flushSync:T.flushSync,viewTransition:T.viewTransition})},[o,g,r,a])}function CS(i,{relative:r}={}){let{basename:a}=F.useContext(Oi),o=F.useContext(Ui);ot(o,"useFormAction must be used inside a RouteContext");let[g]=o.matches.slice(-1),w={...xa(i||".",{relative:r})},T=Ys();if(i==null){w.search=T.search;let c=new URLSearchParams(w.search),h=c.getAll("index");if(h.some(y=>y==="")){c.delete("index"),h.filter(m=>m).forEach(m=>c.append("index",m));let y=c.toString();w.search=y?`?${y}`:""}}return(!i||i===".")&&g.route.index&&(w.search=w.search?w.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(w.pathname=w.pathname==="/"?a:Wi([a,w.pathname])),ya(w)}function xS(i,{relative:r}={}){let a=F.useContext(yp);ot(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Op("useViewTransitionState"),g=xa(i,{relative:r});if(!a.isTransitioning)return!1;let w=Ss(a.currentLocation.pathname,o)||a.currentLocation.pathname,T=Ss(a.nextLocation.pathname,o)||a.nextLocation.pathname;return tl(g.pathname,T)!=null||tl(g.pathname,w)!=null}class wS extends F.Component{constructor(){super(...arguments);wt(this,"state",{hasError:!1,error:null});wt(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?O.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-center px-4",children:[O.jsx("div",{className:"text-6xl mb-4",children:"⚠"}),O.jsx("h1",{className:"text-lg text-[#e0e0e0] mb-2",children:"Something went wrong"}),O.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."}),O.jsx("button",{onClick:this.handleReload,className:"px-4 py-2 text-sm font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors",children:"Reload"})]}):this.props.children}}/**
|
|
60
|
+
Please change the parent <Route path="${p}"> to <Route path="${p==="/"?"*":`${p}/*`}">.`)}let y=Ys(),m;if(r){let p=typeof r=="string"?on(r):r;ot(h==="/"||((d=p.pathname)==null?void 0:d.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 "${p.pathname}" was given in the \`location\` prop.`),m=p}else m=y;let C=m.pathname||"/",w=C;if(h!=="/"){let p=h.replace(/^\//,"").split("/");w="/"+C.replace(/^\//,"").split("/").slice(p.length).join("/")}let E=fp(i,{pathname:w});Yi(u||E!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Yi(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.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 b=By(E&&E.map(p=>Object.assign({},p,{params:Object.assign({},T,p.params),pathname:Wi([h,o.encodeLocation?o.encodeLocation(p.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?h:Wi([h,o.encodeLocation?o.encodeLocation(p.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),g,a);return r&&b?F.createElement(ba.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},b):b}function Oy(){let i=Iy(),r=py(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)",g={padding:"0.5rem",backgroundColor:o},x={padding:"2px 4px",backgroundColor:o},T=null;return console.error("Error handled by React Router default ErrorBoundary:",i),T=F.createElement(F.Fragment,null,F.createElement("p",null,"💿 Hey developer 👋"),F.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",F.createElement("code",{style:x},"ErrorBoundary")," or"," ",F.createElement("code",{style:x},"errorElement")," prop on your route.")),F.createElement(F.Fragment,null,F.createElement("h2",null,"Unexpected Application Error!"),F.createElement("h3",{style:{fontStyle:"italic"}},r),a?F.createElement("pre",{style:g},a):null,T)}var My=F.createElement(Oy,null),Ep=class extends F.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=Ey(i.digest);a&&(i=a)}let r=i!==void 0?F.createElement(Ui.Provider,{value:this.props.routeContext},F.createElement(ah.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?F.createElement(Ly,{error:i},r):r}};Ep.contextType=yy;var Bu=new WeakMap;function Ly({children:i,error:r}){let{basename:a}=F.useContext(Oi);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let o=wy(r.digest);if(o){let g=Bu.get(r);if(g)throw g;let x=vp(o.location,a);if(pp&&!Bu.get(r))if(x.isExternal||o.reloadDocument)window.location.href=x.absoluteURL||x.to;else{const T=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(x.to,{replace:o.replace}));throw Bu.set(r,T),T}return F.createElement("meta",{httpEquiv:"refresh",content:`0;url=${x.absoluteURL||x.to}`})}}return i}function Ny({routeContext:i,match:r,children:a}){let o=F.useContext(ln);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),F.createElement(Ui.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 g=i,x=o==null?void 0:o.errors;if(x!=null){let y=g.findIndex(m=>m.route.id&&(x==null?void 0:x[m.route.id])!==void 0);ot(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(x).join(",")}`),g=g.slice(0,Math.min(g.length,y+1))}let T=!1,c=-1;if(a&&o){T=o.renderFallback;for(let y=0;y<g.length;y++){let m=g[y];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(c=y),m.route.id){let{loaderData:C,errors:w}=o,E=m.route.loader&&!C.hasOwnProperty(m.route.id)&&(!w||w[m.route.id]===void 0);if(m.route.lazy||E){a.isStatic&&(T=!0),c>=0?g=g.slice(0,c+1):g=[g[0]];break}}}}let h=a==null?void 0:a.onError,u=o&&h?(y,m)=>{var C,w;h(y,{location:o.location,params:((w=(C=o.matches)==null?void 0:C[0])==null?void 0:w.params)??{},unstable_pattern:vy(o.matches),errorInfo:m})}:void 0;return g.reduceRight((y,m,C)=>{let w,E=!1,b=null,d=null;o&&(w=x&&m.route.id?x[m.route.id]:void 0,b=m.route.errorElement||My,T&&(c<0&&C===0?(Tp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,d=null):c===C&&(E=!0,d=m.route.hydrateFallbackElement||null)));let p=r.concat(g.slice(0,C+1)),f=()=>{let v;return w?v=b:E?v=d:m.route.Component?v=F.createElement(m.route.Component,null):m.route.element?v=m.route.element:v=y,F.createElement(Ny,{match:m,routeContext:{outlet:y,matches:p,isDataRoute:o!=null},children:v})};return o&&(m.route.ErrorBoundary||m.route.errorElement||C===0)?F.createElement(Ep,{location:o.location,revalidation:o.revalidation,component:b,error:w,children:f(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:u}):f()},null)}function oh(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zy(i){let r=F.useContext(ln);return ot(r,oh(i)),r}function jy(i){let r=F.useContext(cl);return ot(r,oh(i)),r}function Hy(i){let r=F.useContext(Ui);return ot(r,oh(i)),r}function lh(i){let r=Hy(i),a=r.matches[r.matches.length-1];return ot(a.route.id,`${i} can only be used on routes that contain a unique "id"`),a.route.id}function Uy(){return lh("useRouteId")}function Iy(){var o;let i=F.useContext(ah),r=jy("useRouteError"),a=lh("useRouteError");return i!==void 0?i:(o=r.errors)==null?void 0:o[a]}function Py(){let{router:i}=zy("useNavigate"),r=lh("useNavigate"),a=F.useRef(!1);return Cp(()=>{a.current=!0}),F.useCallback(async(g,x={})=>{Yi(a.current,bp),a.current&&(typeof g=="number"?await i.navigate(g):await i.navigate(g,{fromRouteId:r,...x}))},[i,r])}var bm={};function Tp(i,r,a){!r&&!bm[i]&&(bm[i]=!0,Yi(!1,a))}F.memo($y);function $y({routes:i,future:r,state:a,isStatic:o,onError:g}){return wp(i,void 0,{state:a,isStatic:o,onError:g})}function Fy(i){return Dy(i.context)}function pr(i){ot(!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 Zy({basename:i="/",children:r=null,location:a,navigationType:o="POP",navigator:g,static:x=!1,unstable_useTransitions:T}){ot(!Ca(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=i.replace(/^\/*/,"/"),h=F.useMemo(()=>({basename:c,navigator:g,static:x,unstable_useTransitions:T,future:{}}),[c,g,x,T]);typeof a=="string"&&(a=on(a));let{pathname:u="/",search:y="",hash:m="",state:C=null,key:w="default",unstable_mask:E}=a,b=F.useMemo(()=>{let d=Ss(u,c);return d==null?null:{location:{pathname:d,search:y,hash:m,state:C,key:w,unstable_mask:E},navigationType:o}},[c,u,y,m,C,w,o,E]);return Yi(b!=null,`<Router basename="${c}"> is not able to match the URL "${u}${y}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:F.createElement(Oi.Provider,{value:h},F.createElement(ba.Provider,{children:r,value:b}))}function qy({children:i,location:r}){return ky(Xu(i),r)}function Xu(i,r=[]){let a=[];return F.Children.forEach(i,(o,g)=>{if(!F.isValidElement(o))return;let x=[...r,g];if(o.type===F.Fragment){a.push.apply(a,Xu(o.props.children,x));return}ot(o.type===pr,`[${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>`),ot(!o.props.index||!o.props.children,"An index route cannot have child routes.");let T={id:o.props.id||x.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&&(T.children=Xu(o.props.children,x)),a.push(T)}),a}var Xo="get",Jo="application/x-www-form-urlencoded";function hl(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function Gy(i){return hl(i)&&i.tagName.toLowerCase()==="button"}function Wy(i){return hl(i)&&i.tagName.toLowerCase()==="form"}function Yy(i){return hl(i)&&i.tagName.toLowerCase()==="input"}function Vy(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function Ky(i,r){return i.button===0&&(!r||r==="_self")&&!Vy(i)}var $o=null;function Xy(){if($o===null)try{new FormData(document.createElement("form"),0),$o=!1}catch{$o=!0}return $o}var Jy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function zu(i){return i!=null&&!Jy.has(i)?(Yi(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jo}"`),null):i}function Qy(i,r){let a,o,g,x,T;if(Wy(i)){let c=i.getAttribute("action");o=c?Ss(c,r):null,a=i.getAttribute("method")||Xo,g=zu(i.getAttribute("enctype"))||Jo,x=new FormData(i)}else if(Gy(i)||Yy(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?Ss(h,r):null,a=i.getAttribute("formmethod")||c.getAttribute("method")||Xo,g=zu(i.getAttribute("formenctype"))||zu(c.getAttribute("enctype"))||Jo,x=new FormData(c,i),!Xy()){let{name:u,type:y,value:m}=i;if(y==="image"){let C=u?`${u}.`:"";x.append(`${C}x`,"0"),x.append(`${C}y`,"0")}else u&&x.append(u,m)}}else{if(hl(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Xo,o=null,g=Jo,T=i}return x&&g==="text/plain"&&(T=x,x=void 0),{action:o,method:a.toLowerCase(),encType:g,formData:x,body:T}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ch(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function eS(i,r,a,o){let g=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return a?g.pathname.endsWith("/")?g.pathname=`${g.pathname}_.${o}`:g.pathname=`${g.pathname}.${o}`:g.pathname==="/"?g.pathname=`_root.${o}`:r&&Ss(g.pathname,r)==="/"?g.pathname=`${r.replace(/\/$/,"")}/_root.${o}`:g.pathname=`${g.pathname.replace(/\/$/,"")}.${o}`,g}async function tS(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 iS(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 sS(i,r,a){let o=await Promise.all(i.map(async g=>{let x=r.routes[g.route.id];if(x){let T=await tS(x,a);return T.links?T.links():[]}return[]}));return oS(o.flat(1).filter(iS).filter(g=>g.rel==="stylesheet"||g.rel==="preload").map(g=>g.rel==="stylesheet"?{...g,rel:"prefetch",as:"style"}:{...g,rel:"prefetch"}))}function Cm(i,r,a,o,g,x){let T=(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 x==="assets"?r.filter((h,u)=>T(h,u)||c(h,u)):x==="data"?r.filter((h,u)=>{var m;let y=o.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(T(h,u)||c(h,u))return!0;if(h.route.shouldRevalidate){let C=h.route.shouldRevalidate({currentUrl:new URL(g.pathname+g.search+g.hash,window.origin),currentParams:((m=a[0])==null?void 0:m.params)||{},nextUrl:new URL(i,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof C=="boolean")return C}return!0}):[]}function rS(i,r,{includeHydrateFallback:a}={}){return nS(i.map(o=>{let g=r.routes[o.route.id];if(!g)return[];let x=[g.module];return g.clientActionModule&&(x=x.concat(g.clientActionModule)),g.clientLoaderModule&&(x=x.concat(g.clientLoaderModule)),a&&g.hydrateFallbackModule&&(x=x.concat(g.hydrateFallbackModule)),g.imports&&(x=x.concat(g.imports)),x}).flat(1))}function nS(i){return[...new Set(i)]}function aS(i){let r={},a=Object.keys(i).sort();for(let o of a)r[o]=i[o];return r}function oS(i,r){let a=new Set;return new Set(r),i.reduce((o,g)=>{let x=JSON.stringify(aS(g));return a.has(x)||(a.add(x),o.push({key:x,link:g})),o},[])}function Ap(){let i=F.useContext(ln);return ch(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function lS(){let i=F.useContext(cl);return ch(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var uh=F.createContext(void 0);uh.displayName="FrameworkContext";function Rp(){let i=F.useContext(uh);return ch(i,"You must render this element inside a <HydratedRouter> element"),i}function cS(i,r){let a=F.useContext(uh),[o,g]=F.useState(!1),[x,T]=F.useState(!1),{onFocus:c,onBlur:h,onMouseEnter:u,onMouseLeave:y,onTouchStart:m}=r,C=F.useRef(null);F.useEffect(()=>{if(i==="render"&&T(!0),i==="viewport"){let b=p=>{p.forEach(f=>{T(f.isIntersecting)})},d=new IntersectionObserver(b,{threshold:.5});return C.current&&d.observe(C.current),()=>{d.disconnect()}}},[i]),F.useEffect(()=>{if(o){let b=setTimeout(()=>{T(!0)},100);return()=>{clearTimeout(b)}}},[o]);let w=()=>{g(!0)},E=()=>{g(!1),T(!1)};return a?i!=="intent"?[x,C,{}]:[x,C,{onFocus:ca(c,w),onBlur:ca(h,E),onMouseEnter:ca(u,w),onMouseLeave:ca(y,E),onTouchStart:ca(m,w)}]:[!1,C,{}]}function ca(i,r){return a=>{i&&i(a),a.defaultPrevented||r(a)}}function uS({page:i,...r}){let{router:a}=Ap(),o=F.useMemo(()=>fp(a.routes,i,a.basename),[a.routes,i,a.basename]);return o?F.createElement(fS,{page:i,matches:o,...r}):null}function hS(i){let{manifest:r,routeModules:a}=Rp(),[o,g]=F.useState([]);return F.useEffect(()=>{let x=!1;return sS(i,r,a).then(T=>{x||g(T)}),()=>{x=!0}},[i,r,a]),o}function fS({page:i,matches:r,...a}){let o=Ys(),{future:g,manifest:x,routeModules:T}=Rp(),{basename:c}=Ap(),{loaderData:h,matches:u}=lS(),y=F.useMemo(()=>Cm(i,r,u,x,o,"data"),[i,r,u,x,o]),m=F.useMemo(()=>Cm(i,r,u,x,o,"assets"),[i,r,u,x,o]),C=F.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let b=new Set,d=!1;if(r.forEach(f=>{var S;let v=x.routes[f.route.id];!v||!v.hasLoader||(!y.some(R=>R.route.id===f.route.id)&&f.route.id in h&&((S=T[f.route.id])!=null&&S.shouldRevalidate)||v.hasClientLoader?d=!0:b.add(f.route.id))}),b.size===0)return[];let p=eS(i,c,g.unstable_trailingSlashAwareDataRequests,"data");return d&&b.size>0&&p.searchParams.set("_routes",r.filter(f=>b.has(f.route.id)).map(f=>f.route.id).join(",")),[p.pathname+p.search]},[c,g.unstable_trailingSlashAwareDataRequests,h,o,x,y,r,i,T]),w=F.useMemo(()=>rS(m,x),[m,x]),E=hS(m);return F.createElement(F.Fragment,null,C.map(b=>F.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...a})),w.map(b=>F.createElement("link",{key:b,rel:"modulepreload",href:b,...a})),E.map(({key:b,link:d})=>F.createElement("link",{key:b,nonce:a.nonce,...d,crossOrigin:d.crossOrigin??a.crossOrigin})))}function dS(...i){return r=>{i.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var _S=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_S&&(window.__reactRouterVersion="7.13.2")}catch{}function mS({basename:i,children:r,unstable_useTransitions:a,window:o}){let g=F.useRef();g.current==null&&(g.current=G0({window:o,v5Compat:!0}));let x=g.current,[T,c]=F.useState({action:x.action,location:x.location}),h=F.useCallback(u=>{a===!1?c(u):F.startTransition(()=>c(u))},[a]);return F.useLayoutEffect(()=>x.listen(h),[x,h]),F.createElement(Zy,{basename:i,children:r,location:T.location,navigationType:T.action,navigator:x,unstable_useTransitions:a})}var Dp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hi=F.forwardRef(function({onClick:r,discover:a="render",prefetch:o="none",relative:g,reloadDocument:x,replace:T,unstable_mask:c,state:h,target:u,to:y,preventScrollReset:m,viewTransition:C,unstable_defaultShouldRevalidate:w,...E},b){let{basename:d,navigator:p,unstable_useTransitions:f}=F.useContext(Oi),v=typeof y=="string"&&Dp.test(y),S=vp(y,d);y=S.to;let R=Ty(y,{relative:g}),D=Ys(),M=null;if(c){let se=nh(c,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);d!=="/"&&(se.pathname=se.pathname==="/"?d:Wi([d,se.pathname])),M=p.createHref(se)}let[A,B,$]=cS(o,E),I=gS(y,{replace:T,unstable_mask:c,state:h,target:u,preventScrollReset:m,relative:g,viewTransition:C,unstable_defaultShouldRevalidate:w,unstable_useTransitions:f});function q(se){r&&r(se),se.defaultPrevented||I(se)}let P=!(S.isExternal||x),Q=F.createElement("a",{...E,...$,href:(P?M:void 0)||S.absoluteURL||R,onClick:P?q:r,ref:dS(b,B),target:u,"data-discover":!v&&a==="render"?"true":void 0});return A&&!v?F.createElement(F.Fragment,null,Q,F.createElement(uS,{page:R})):Q});Hi.displayName="Link";var kp=F.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:o="",end:g=!1,style:x,to:T,viewTransition:c,children:h,...u},y){let m=xa(T,{relative:u.relative}),C=Ys(),w=F.useContext(cl),{navigator:E,basename:b}=F.useContext(Oi),d=w!=null&&xS(m)&&c===!0,p=E.encodeLocation?E.encodeLocation(m).pathname:m.pathname,f=C.pathname,v=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;a||(f=f.toLowerCase(),v=v?v.toLowerCase():null,p=p.toLowerCase()),v&&b&&(v=Ss(v,b)||v);const S=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let R=f===p||!g&&f.startsWith(p)&&f.charAt(S)==="/",D=v!=null&&(v===p||!g&&v.startsWith(p)&&v.charAt(p.length)==="/"),M={isActive:R,isPending:D,isTransitioning:d},A=R?r:void 0,B;typeof o=="function"?B=o(M):B=[o,R?"active":null,D?"pending":null,d?"transitioning":null].filter(Boolean).join(" ");let $=typeof x=="function"?x(M):x;return F.createElement(Hi,{...u,"aria-current":A,className:B,ref:y,style:$,to:T,viewTransition:c},typeof h=="function"?h(M):h)});kp.displayName="NavLink";var pS=F.forwardRef(({discover:i="render",fetcherKey:r,navigate:a,reloadDocument:o,replace:g,state:x,method:T=Xo,action:c,onSubmit:h,relative:u,preventScrollReset:y,viewTransition:m,unstable_defaultShouldRevalidate:C,...w},E)=>{let{unstable_useTransitions:b}=F.useContext(Oi),d=bS(),p=CS(c,{relative:u}),f=T.toLowerCase()==="get"?"get":"post",v=typeof c=="string"&&Dp.test(c),S=R=>{if(h&&h(R),R.defaultPrevented)return;R.preventDefault();let D=R.nativeEvent.submitter,M=(D==null?void 0:D.getAttribute("formmethod"))||T,A=()=>d(D||R.currentTarget,{fetcherKey:r,method:M,navigate:a,replace:g,state:x,relative:u,preventScrollReset:y,viewTransition:m,unstable_defaultShouldRevalidate:C});b&&a!==!1?F.startTransition(()=>A()):A()};return F.createElement("form",{ref:E,method:f,action:p,onSubmit:o?h:S,...w,"data-discover":!v&&i==="render"?"true":void 0})});pS.displayName="Form";function vS(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Op(i){let r=F.useContext(ln);return ot(r,vS(i)),r}function gS(i,{target:r,replace:a,unstable_mask:o,state:g,preventScrollReset:x,relative:T,viewTransition:c,unstable_defaultShouldRevalidate:h,unstable_useTransitions:u}={}){let y=ul(),m=Ys(),C=xa(i,{relative:T});return F.useCallback(w=>{if(Ky(w,r)){w.preventDefault();let E=a!==void 0?a:ya(m)===ya(C),b=()=>y(i,{replace:E,unstable_mask:o,state:g,preventScrollReset:x,relative:T,viewTransition:c,unstable_defaultShouldRevalidate:h});u?F.startTransition(()=>b()):b()}},[m,y,C,a,o,g,r,i,x,T,c,h,u])}var yS=0,SS=()=>`__${String(++yS)}__`;function bS(){let{router:i}=Op("useSubmit"),{basename:r}=F.useContext(Oi),a=Uy(),o=i.fetch,g=i.navigate;return F.useCallback(async(x,T={})=>{let{action:c,method:h,encType:u,formData:y,body:m}=Qy(x,r);if(T.navigate===!1){let C=T.fetcherKey||SS();await o(C,a,T.action||c,{unstable_defaultShouldRevalidate:T.unstable_defaultShouldRevalidate,preventScrollReset:T.preventScrollReset,formData:y,body:m,formMethod:T.method||h,formEncType:T.encType||u,flushSync:T.flushSync})}else await g(T.action||c,{unstable_defaultShouldRevalidate:T.unstable_defaultShouldRevalidate,preventScrollReset:T.preventScrollReset,formData:y,body:m,formMethod:T.method||h,formEncType:T.encType||u,replace:T.replace,state:T.state,fromRouteId:a,flushSync:T.flushSync,viewTransition:T.viewTransition})},[o,g,r,a])}function CS(i,{relative:r}={}){let{basename:a}=F.useContext(Oi),o=F.useContext(Ui);ot(o,"useFormAction must be used inside a RouteContext");let[g]=o.matches.slice(-1),x={...xa(i||".",{relative:r})},T=Ys();if(i==null){x.search=T.search;let c=new URLSearchParams(x.search),h=c.getAll("index");if(h.some(y=>y==="")){c.delete("index"),h.filter(m=>m).forEach(m=>c.append("index",m));let y=c.toString();x.search=y?`?${y}`:""}}return(!i||i===".")&&g.route.index&&(x.search=x.search?x.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(x.pathname=x.pathname==="/"?a:Wi([a,x.pathname])),ya(x)}function xS(i,{relative:r}={}){let a=F.useContext(yp);ot(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Op("useViewTransitionState"),g=xa(i,{relative:r});if(!a.isTransitioning)return!1;let x=Ss(a.currentLocation.pathname,o)||a.currentLocation.pathname,T=Ss(a.nextLocation.pathname,o)||a.nextLocation.pathname;return tl(g.pathname,T)!=null||tl(g.pathname,x)!=null}class wS extends F.Component{constructor(){super(...arguments);wt(this,"state",{hasError:!1,error:null});wt(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?O.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-center px-4",children:[O.jsx("div",{className:"text-6xl mb-4",children:"⚠"}),O.jsx("h1",{className:"text-lg text-[#e0e0e0] mb-2",children:"Something went wrong"}),O.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."}),O.jsx("button",{onClick:this.handleReload,className:"px-4 py-2 text-sm font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors",children:"Reload"})]}):this.props.children}}/**
|
|
61
61
|
* @license lucide-react v0.474.0 - ISC
|
|
62
62
|
*
|
|
63
63
|
* This source code is licensed under the ISC license.
|
|
@@ -72,12 +72,12 @@ Please change the parent <Route path="${p}"> to <Route path="${p==="/"?"*":`${p}
|
|
|
72
72
|
*
|
|
73
73
|
* This source code is licensed under the ISC license.
|
|
74
74
|
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const AS=F.forwardRef(({color:i="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:g="",children:
|
|
75
|
+
*/const AS=F.forwardRef(({color:i="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:g="",children:x,iconNode:T,...c},h)=>F.createElement("svg",{ref:h,...TS,width:r,height:r,stroke:i,strokeWidth:o?Number(a)*24/Number(r):a,className:Mp("lucide",g),...c},[...T.map(([u,y])=>F.createElement(u,y)),...Array.isArray(x)?x:[x]]));/**
|
|
76
76
|
* @license lucide-react v0.474.0 - ISC
|
|
77
77
|
*
|
|
78
78
|
* This source code is licensed under the ISC license.
|
|
79
79
|
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const Qe=(i,r)=>{const a=F.forwardRef(({className:o,...g},
|
|
80
|
+
*/const Qe=(i,r)=>{const a=F.forwardRef(({className:o,...g},x)=>F.createElement(AS,{ref:x,iconNode:r,className:Mp(`lucide-${ES(i)}`,o),...g}));return a.displayName=`${i}`,a};/**
|
|
81
81
|
* @license lucide-react v0.474.0 - ISC
|
|
82
82
|
*
|
|
83
83
|
* This source code is licensed under the ISC license.
|
|
@@ -212,9 +212,9 @@ Please change the parent <Route path="${p}"> to <Route path="${p==="/"?"*":`${p}
|
|
|
212
212
|
*
|
|
213
213
|
* This source code is licensed under the ISC license.
|
|
214
214
|
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const pb=[["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"}]],vb=Qe("Zap",pb),Tm=i=>{let r;const a=new Set,o=(u,y)=>{const m=typeof u=="function"?u(r):u;if(!Object.is(m,r)){const C=r;r=y??(typeof m!="object"||m===null)?m:Object.assign({},r,m),a.forEach(x=>x(r,C))}},g=()=>r,c={setState:o,getState:g,getInitialState:()=>h,subscribe:u=>(a.add(u),()=>a.delete(u))},h=r=i(o,g,c);return c},gb=(i=>i?Tm(i):Tm),yb=i=>i;function Sb(i,r=yb){const a=va.useSyncExternalStore(i.subscribe,va.useCallback(()=>r(i.getState()),[i,r]),va.useCallback(()=>r(i.getInitialState()),[i,r]));return va.useDebugValue(a),a}const Am=i=>{const r=gb(i),a=o=>Sb(r,o);return Object.assign(a,r),a},zp=(i=>i?Am(i):Am),Et=zp(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 fe(i,r,a){function o(c,h){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:h,constr:T,traits:new Set},enumerable:!1}),c._zod.traits.has(i))return;c._zod.traits.add(i),r(c,h);const u=T.prototype,y=Object.keys(u);for(let m=0;m<y.length;m++){const C=y[m];C in c||(c[C]=u[C].bind(c))}}const g=(a==null?void 0:a.Parent)??Object;class w extends g{}Object.defineProperty(w,"name",{value:i});function T(c){var h;const u=a!=null&&a.Parent?new w:this;o(u,c),(h=u._zod).deferred??(h.deferred=[]);for(const y of u._zod.deferred)y();return u}return Object.defineProperty(T,"init",{value:o}),Object.defineProperty(T,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(T,"name",{value:i}),T}class rn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class jp extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const Hp={};function Gs(i){return Hp}function Up(i){const r=Object.values(i).filter(o=>typeof o=="number");return Object.entries(i).filter(([o,g])=>r.indexOf(+o)===-1).map(([o,g])=>g)}function Qu(i,r){return typeof r=="bigint"?r.toString():r}function hh(i){return{get value(){{const r=i();return Object.defineProperty(this,"value",{value:r}),r}}}}function fh(i){return i==null}function dh(i){const r=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;return i.slice(r,a)}function bb(i,r){const a=(i.toString().split(".")[1]||"").length,o=r.toString();let g=(o.split(".")[1]||"").length;if(g===0&&/\d?e-\d?/.test(o)){const h=o.match(/\d?e-(\d?)/);h!=null&&h[1]&&(g=Number.parseInt(h[1]))}const w=a>g?a:g,T=Number.parseInt(i.toFixed(w).replace(".","")),c=Number.parseInt(r.toFixed(w).replace(".",""));return T%c/10**w}const Rm=Symbol("evaluating");function We(i,r,a){let o;Object.defineProperty(i,r,{get(){if(o!==Rm)return o===void 0&&(o=Rm,o=a()),o},set(g){Object.defineProperty(i,r,{value:g})},configurable:!0})}function vr(i,r,a){Object.defineProperty(i,r,{value:a,writable:!0,enumerable:!0,configurable:!0})}function Vs(...i){const r={};for(const a of i){const o=Object.getOwnPropertyDescriptors(a);Object.assign(r,o)}return Object.defineProperties({},r)}function Dm(i){return JSON.stringify(i)}function Cb(i){return i.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ip="captureStackTrace"in Error?Error.captureStackTrace:(...i)=>{};function il(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}const xb=hh(()=>{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 nn(i){if(il(i)===!1)return!1;const r=i.constructor;if(r===void 0||typeof r!="function")return!0;const a=r.prototype;return!(il(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function Pp(i){return nn(i)?{...i}:Array.isArray(i)?[...i]:i}const wb=new Set(["string","number","symbol"]);function _l(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ks(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 xe(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 Eb(i){return Object.keys(i).filter(r=>i[r]._zod.optin==="optional"&&i[r]._zod.optout==="optional")}const Tb={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 Ab(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 w=Vs(i._zod.def,{get shape(){const T={};for(const c in r){if(!(c in a.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(T[c]=a.shape[c])}return vr(this,"shape",T),T},checks:[]});return Ks(i,w)}function Rb(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 w=Vs(i._zod.def,{get shape(){const T={...i._zod.def.shape};for(const c in r){if(!(c in a.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&delete T[c]}return vr(this,"shape",T),T},checks:[]});return Ks(i,w)}function Db(i,r){if(!nn(r))throw new Error("Invalid input to extend: expected a plain object");const a=i._zod.def.checks;if(a&&a.length>0){const w=i._zod.def.shape;for(const T in r)if(Object.getOwnPropertyDescriptor(w,T)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const g=Vs(i._zod.def,{get shape(){const w={...i._zod.def.shape,...r};return vr(this,"shape",w),w}});return Ks(i,g)}function kb(i,r){if(!nn(r))throw new Error("Invalid input to safeExtend: expected a plain object");const a=Vs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r};return vr(this,"shape",o),o}});return Ks(i,a)}function Ob(i,r){const a=Vs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r._zod.def.shape};return vr(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:[]});return Ks(i,a)}function Mb(i,r,a){const g=r._zod.def.checks;if(g&&g.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const T=Vs(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 vr(this,"shape",h),h},checks:[]});return Ks(r,T)}function Lb(i,r,a){const o=Vs(r._zod.def,{get shape(){const g=r._zod.def.shape,w={...g};if(a)for(const T in a){if(!(T in w))throw new Error(`Unrecognized key: "${T}"`);a[T]&&(w[T]=new i({type:"nonoptional",innerType:g[T]}))}else for(const T in g)w[T]=new i({type:"nonoptional",innerType:g[T]});return vr(this,"shape",w),w}});return Ks(r,o)}function en(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 tn(i,r){return r.map(a=>{var o;return(o=a).path??(o.path=[]),a.path.unshift(i),a})}function Zo(i){return typeof i=="string"?i:i==null?void 0:i.message}function Ws(i,r,a){var g,w,T,c,h,u;const o={...i,path:i.path??[]};if(!i.message){const y=Zo((T=(w=(g=i.inst)==null?void 0:g._zod.def)==null?void 0:w.error)==null?void 0:T.call(w,i))??Zo((c=r==null?void 0:r.error)==null?void 0:c.call(r,i))??Zo((h=a.customError)==null?void 0:h.call(a,i))??Zo((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 _h(i){return Array.isArray(i)?"array":typeof i=="string"?"string":"unknown"}function Sa(...i){const[r,a,o]=i;return typeof r=="string"?{message:r,code:"custom",input:a,inst:o}:{...r}}const $p=(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,Qu,2),Object.defineProperty(i,"toString",{value:()=>i.message,enumerable:!1})},Fp=fe("$ZodError",$p),Zp=fe("$ZodError",$p,{Parent:Error});function Nb(i,r=a=>a.message){const a={},o=[];for(const g of i.issues)g.path.length>0?(a[g.path[0]]=a[g.path[0]]||[],a[g.path[0]].push(r(g))):o.push(r(g));return{formErrors:o,fieldErrors:a}}function Bb(i,r=a=>a.message){const a={_errors:[]},o=g=>{for(const w of g.issues)if(w.code==="invalid_union"&&w.errors.length)w.errors.map(T=>o({issues:T}));else if(w.code==="invalid_key")o({issues:w.issues});else if(w.code==="invalid_element")o({issues:w.issues});else if(w.path.length===0)a._errors.push(r(w));else{let T=a,c=0;for(;c<w.path.length;){const h=w.path[c];c===w.path.length-1?(T[h]=T[h]||{_errors:[]},T[h]._errors.push(r(w))):T[h]=T[h]||{_errors:[]},T=T[h],c++}}};return o(i),a}const mh=i=>(r,a,o,g)=>{const w=o?Object.assign(o,{async:!1}):{async:!1},T=r._zod.run({value:a,issues:[]},w);if(T instanceof Promise)throw new rn;if(T.issues.length){const c=new((g==null?void 0:g.Err)??i)(T.issues.map(h=>Ws(h,w,Gs())));throw Ip(c,g==null?void 0:g.callee),c}return T.value},ph=i=>async(r,a,o,g)=>{const w=o?Object.assign(o,{async:!0}):{async:!0};let T=r._zod.run({value:a,issues:[]},w);if(T instanceof Promise&&(T=await T),T.issues.length){const c=new((g==null?void 0:g.Err)??i)(T.issues.map(h=>Ws(h,w,Gs())));throw Ip(c,g==null?void 0:g.callee),c}return T.value},ml=i=>(r,a,o)=>{const g=o?{...o,async:!1}:{async:!1},w=r._zod.run({value:a,issues:[]},g);if(w instanceof Promise)throw new rn;return w.issues.length?{success:!1,error:new(i??Fp)(w.issues.map(T=>Ws(T,g,Gs())))}:{success:!0,data:w.value}},zb=ml(Zp),pl=i=>async(r,a,o)=>{const g=o?Object.assign(o,{async:!0}):{async:!0};let w=r._zod.run({value:a,issues:[]},g);return w instanceof Promise&&(w=await w),w.issues.length?{success:!1,error:new i(w.issues.map(T=>Ws(T,g,Gs())))}:{success:!0,data:w.value}},jb=pl(Zp),Hb=i=>(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return mh(i)(r,a,g)},Ub=i=>(r,a,o)=>mh(i)(r,a,o),Ib=i=>async(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ph(i)(r,a,g)},Pb=i=>async(r,a,o)=>ph(i)(r,a,o),$b=i=>(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ml(i)(r,a,g)},Fb=i=>(r,a,o)=>ml(i)(r,a,o),Zb=i=>async(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return pl(i)(r,a,g)},qb=i=>async(r,a,o)=>pl(i)(r,a,o),Gb=/^[cC][^\s-]{8,}$/,Wb=/^[0-9a-z]+$/,Yb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vb=/^[0-9a-vA-V]{20}$/,Kb=/^[A-Za-z0-9]{27}$/,Xb=/^[a-zA-Z0-9_-]{21}$/,Jb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Qb=/^([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})$/,km=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)$/,e1=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,t1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function i1(){return new RegExp(t1,"u")}const s1=/^(?:(?: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])$/,r1=/^(([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}|:))$/,n1=/^((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])$/,a1=/^(([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])$/,o1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qp=/^[A-Za-z0-9_-]*$/,l1=/^\+[1-9]\d{6,14}$/,Gp="(?:(?:\\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])))",c1=new RegExp(`^${Gp}$`);function Wp(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 u1(i){return new RegExp(`^${Wp(i)}$`)}function h1(i){const r=Wp({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(`^${Gp}T(?:${o})$`)}const f1=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}$`)},d1=/^-?\d+$/,Yp=/^-?\d+(?:\.\d+)?$/,_1=/^(?:true|false)$/i,m1=/^[^A-Z]*$/,p1=/^[^a-z]*$/,ni=fe("$ZodCheck",(i,r)=>{var a;i._zod??(i._zod={}),i._zod.def=r,(a=i._zod).onattach??(a.onattach=[])}),Vp={number:"number",bigint:"bigint",object:"date"},Kp=fe("$ZodCheckLessThan",(i,r)=>{ni.init(i,r);const a=Vp[typeof r.value];i._zod.onattach.push(o=>{const g=o._zod.bag,w=(r.inclusive?g.maximum:g.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<w&&(r.inclusive?g.maximum=r.value:g.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})}}),Xp=fe("$ZodCheckGreaterThan",(i,r)=>{ni.init(i,r);const a=Vp[typeof r.value];i._zod.onattach.push(o=>{const g=o._zod.bag,w=(r.inclusive?g.minimum:g.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>w&&(r.inclusive?g.minimum=r.value:g.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})}}),v1=fe("$ZodCheckMultipleOf",(i,r)=>{ni.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):bb(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})}}),g1=fe("$ZodCheckNumberFormat",(i,r)=>{var T;ni.init(i,r),r.format=r.format||"float64";const a=(T=r.format)==null?void 0:T.includes("int"),o=a?"int":"number",[g,w]=Tb[r.format];i._zod.onattach.push(c=>{const h=c._zod.bag;h.format=r.format,h.minimum=g,h.maximum=w,a&&(h.pattern=d1)}),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<g&&c.issues.push({origin:"number",input:h,code:"too_small",minimum:g,inclusive:!0,inst:i,continue:!r.abort}),h>w&&c.issues.push({origin:"number",input:h,code:"too_big",maximum:w,inclusive:!0,inst:i,continue:!r.abort})}}),y1=fe("$ZodCheckMaxLength",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!fh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<g&&(o._zod.bag.maximum=r.maximum)}),i._zod.check=o=>{const g=o.value;if(g.length<=r.maximum)return;const T=_h(g);o.issues.push({origin:T,code:"too_big",maximum:r.maximum,inclusive:!0,input:g,inst:i,continue:!r.abort})}}),S1=fe("$ZodCheckMinLength",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!fh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>g&&(o._zod.bag.minimum=r.minimum)}),i._zod.check=o=>{const g=o.value;if(g.length>=r.minimum)return;const T=_h(g);o.issues.push({origin:T,code:"too_small",minimum:r.minimum,inclusive:!0,input:g,inst:i,continue:!r.abort})}}),b1=fe("$ZodCheckLengthEquals",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!fh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag;g.minimum=r.length,g.maximum=r.length,g.length=r.length}),i._zod.check=o=>{const g=o.value,w=g.length;if(w===r.length)return;const T=_h(g),c=w>r.length;o.issues.push({origin:T,...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})}}),vl=fe("$ZodCheckStringFormat",(i,r)=>{var a,o;ni.init(i,r),i._zod.onattach.push(g=>{const w=g._zod.bag;w.format=r.format,r.pattern&&(w.patterns??(w.patterns=new Set),w.patterns.add(r.pattern))}),r.pattern?(a=i._zod).check??(a.check=g=>{r.pattern.lastIndex=0,!r.pattern.test(g.value)&&g.issues.push({origin:"string",code:"invalid_format",format:r.format,input:g.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:i,continue:!r.abort})}):(o=i._zod).check??(o.check=()=>{})}),C1=fe("$ZodCheckRegex",(i,r)=>{vl.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})}}),x1=fe("$ZodCheckLowerCase",(i,r)=>{r.pattern??(r.pattern=m1),vl.init(i,r)}),w1=fe("$ZodCheckUpperCase",(i,r)=>{r.pattern??(r.pattern=p1),vl.init(i,r)}),E1=fe("$ZodCheckIncludes",(i,r)=>{ni.init(i,r);const a=_l(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position}}${a}`:a);r.pattern=o,i._zod.onattach.push(g=>{const w=g._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(o)}),i._zod.check=g=>{g.value.includes(r.includes,r.position)||g.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:g.value,inst:i,continue:!r.abort})}}),T1=fe("$ZodCheckStartsWith",(i,r)=>{ni.init(i,r);const a=new RegExp(`^${_l(r.prefix)}.*`);r.pattern??(r.pattern=a),i._zod.onattach.push(o=>{const g=o._zod.bag;g.patterns??(g.patterns=new Set),g.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})}}),A1=fe("$ZodCheckEndsWith",(i,r)=>{ni.init(i,r);const a=new RegExp(`.*${_l(r.suffix)}$`);r.pattern??(r.pattern=a),i._zod.onattach.push(o=>{const g=o._zod.bag;g.patterns??(g.patterns=new Set),g.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})}}),R1=fe("$ZodCheckOverwrite",(i,r)=>{ni.init(i,r),i._zod.check=a=>{a.value=r.tx(a.value)}});class D1{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(`
|
|
216
|
-
`).filter(T=>T),g=Math.min(...o.map(T=>T.length-T.trimStart().length)),
|
|
217
|
-
`))}}const k1={major:4,minor:3,patch:6},ft=fe("$ZodType",(i,r)=>{var g;var a;i??(i={}),i._zod.def=r,i._zod.bag=i._zod.bag||{},i._zod.version=k1;const o=[...i._zod.def.checks??[]];i._zod.traits.has("$ZodCheck")&&o.unshift(i);for(const
|
|
215
|
+
*/const pb=[["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"}]],vb=Qe("Zap",pb),Tm=i=>{let r;const a=new Set,o=(u,y)=>{const m=typeof u=="function"?u(r):u;if(!Object.is(m,r)){const C=r;r=y??(typeof m!="object"||m===null)?m:Object.assign({},r,m),a.forEach(w=>w(r,C))}},g=()=>r,c={setState:o,getState:g,getInitialState:()=>h,subscribe:u=>(a.add(u),()=>a.delete(u))},h=r=i(o,g,c);return c},gb=(i=>i?Tm(i):Tm),yb=i=>i;function Sb(i,r=yb){const a=va.useSyncExternalStore(i.subscribe,va.useCallback(()=>r(i.getState()),[i,r]),va.useCallback(()=>r(i.getInitialState()),[i,r]));return va.useDebugValue(a),a}const Am=i=>{const r=gb(i),a=o=>Sb(r,o);return Object.assign(a,r),a},zp=(i=>i?Am(i):Am),Et=zp(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 fe(i,r,a){function o(c,h){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:h,constr:T,traits:new Set},enumerable:!1}),c._zod.traits.has(i))return;c._zod.traits.add(i),r(c,h);const u=T.prototype,y=Object.keys(u);for(let m=0;m<y.length;m++){const C=y[m];C in c||(c[C]=u[C].bind(c))}}const g=(a==null?void 0:a.Parent)??Object;class x extends g{}Object.defineProperty(x,"name",{value:i});function T(c){var h;const u=a!=null&&a.Parent?new x:this;o(u,c),(h=u._zod).deferred??(h.deferred=[]);for(const y of u._zod.deferred)y();return u}return Object.defineProperty(T,"init",{value:o}),Object.defineProperty(T,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(T,"name",{value:i}),T}class rn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class jp extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const Hp={};function Gs(i){return Hp}function Up(i){const r=Object.values(i).filter(o=>typeof o=="number");return Object.entries(i).filter(([o,g])=>r.indexOf(+o)===-1).map(([o,g])=>g)}function Qu(i,r){return typeof r=="bigint"?r.toString():r}function hh(i){return{get value(){{const r=i();return Object.defineProperty(this,"value",{value:r}),r}}}}function fh(i){return i==null}function dh(i){const r=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;return i.slice(r,a)}function bb(i,r){const a=(i.toString().split(".")[1]||"").length,o=r.toString();let g=(o.split(".")[1]||"").length;if(g===0&&/\d?e-\d?/.test(o)){const h=o.match(/\d?e-(\d?)/);h!=null&&h[1]&&(g=Number.parseInt(h[1]))}const x=a>g?a:g,T=Number.parseInt(i.toFixed(x).replace(".","")),c=Number.parseInt(r.toFixed(x).replace(".",""));return T%c/10**x}const Rm=Symbol("evaluating");function We(i,r,a){let o;Object.defineProperty(i,r,{get(){if(o!==Rm)return o===void 0&&(o=Rm,o=a()),o},set(g){Object.defineProperty(i,r,{value:g})},configurable:!0})}function vr(i,r,a){Object.defineProperty(i,r,{value:a,writable:!0,enumerable:!0,configurable:!0})}function Vs(...i){const r={};for(const a of i){const o=Object.getOwnPropertyDescriptors(a);Object.assign(r,o)}return Object.defineProperties({},r)}function Dm(i){return JSON.stringify(i)}function Cb(i){return i.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ip="captureStackTrace"in Error?Error.captureStackTrace:(...i)=>{};function il(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}const xb=hh(()=>{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 nn(i){if(il(i)===!1)return!1;const r=i.constructor;if(r===void 0||typeof r!="function")return!0;const a=r.prototype;return!(il(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function Pp(i){return nn(i)?{...i}:Array.isArray(i)?[...i]:i}const wb=new Set(["string","number","symbol"]);function _l(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ks(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 xe(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 Eb(i){return Object.keys(i).filter(r=>i[r]._zod.optin==="optional"&&i[r]._zod.optout==="optional")}const Tb={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 Ab(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 x=Vs(i._zod.def,{get shape(){const T={};for(const c in r){if(!(c in a.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(T[c]=a.shape[c])}return vr(this,"shape",T),T},checks:[]});return Ks(i,x)}function Rb(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 x=Vs(i._zod.def,{get shape(){const T={...i._zod.def.shape};for(const c in r){if(!(c in a.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&delete T[c]}return vr(this,"shape",T),T},checks:[]});return Ks(i,x)}function Db(i,r){if(!nn(r))throw new Error("Invalid input to extend: expected a plain object");const a=i._zod.def.checks;if(a&&a.length>0){const x=i._zod.def.shape;for(const T in r)if(Object.getOwnPropertyDescriptor(x,T)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const g=Vs(i._zod.def,{get shape(){const x={...i._zod.def.shape,...r};return vr(this,"shape",x),x}});return Ks(i,g)}function kb(i,r){if(!nn(r))throw new Error("Invalid input to safeExtend: expected a plain object");const a=Vs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r};return vr(this,"shape",o),o}});return Ks(i,a)}function Ob(i,r){const a=Vs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r._zod.def.shape};return vr(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:[]});return Ks(i,a)}function Mb(i,r,a){const g=r._zod.def.checks;if(g&&g.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const T=Vs(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 vr(this,"shape",h),h},checks:[]});return Ks(r,T)}function Lb(i,r,a){const o=Vs(r._zod.def,{get shape(){const g=r._zod.def.shape,x={...g};if(a)for(const T in a){if(!(T in x))throw new Error(`Unrecognized key: "${T}"`);a[T]&&(x[T]=new i({type:"nonoptional",innerType:g[T]}))}else for(const T in g)x[T]=new i({type:"nonoptional",innerType:g[T]});return vr(this,"shape",x),x}});return Ks(r,o)}function en(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 tn(i,r){return r.map(a=>{var o;return(o=a).path??(o.path=[]),a.path.unshift(i),a})}function Zo(i){return typeof i=="string"?i:i==null?void 0:i.message}function Ws(i,r,a){var g,x,T,c,h,u;const o={...i,path:i.path??[]};if(!i.message){const y=Zo((T=(x=(g=i.inst)==null?void 0:g._zod.def)==null?void 0:x.error)==null?void 0:T.call(x,i))??Zo((c=r==null?void 0:r.error)==null?void 0:c.call(r,i))??Zo((h=a.customError)==null?void 0:h.call(a,i))??Zo((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 _h(i){return Array.isArray(i)?"array":typeof i=="string"?"string":"unknown"}function Sa(...i){const[r,a,o]=i;return typeof r=="string"?{message:r,code:"custom",input:a,inst:o}:{...r}}const $p=(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,Qu,2),Object.defineProperty(i,"toString",{value:()=>i.message,enumerable:!1})},Fp=fe("$ZodError",$p),Zp=fe("$ZodError",$p,{Parent:Error});function Nb(i,r=a=>a.message){const a={},o=[];for(const g of i.issues)g.path.length>0?(a[g.path[0]]=a[g.path[0]]||[],a[g.path[0]].push(r(g))):o.push(r(g));return{formErrors:o,fieldErrors:a}}function Bb(i,r=a=>a.message){const a={_errors:[]},o=g=>{for(const x of g.issues)if(x.code==="invalid_union"&&x.errors.length)x.errors.map(T=>o({issues:T}));else if(x.code==="invalid_key")o({issues:x.issues});else if(x.code==="invalid_element")o({issues:x.issues});else if(x.path.length===0)a._errors.push(r(x));else{let T=a,c=0;for(;c<x.path.length;){const h=x.path[c];c===x.path.length-1?(T[h]=T[h]||{_errors:[]},T[h]._errors.push(r(x))):T[h]=T[h]||{_errors:[]},T=T[h],c++}}};return o(i),a}const mh=i=>(r,a,o,g)=>{const x=o?Object.assign(o,{async:!1}):{async:!1},T=r._zod.run({value:a,issues:[]},x);if(T instanceof Promise)throw new rn;if(T.issues.length){const c=new((g==null?void 0:g.Err)??i)(T.issues.map(h=>Ws(h,x,Gs())));throw Ip(c,g==null?void 0:g.callee),c}return T.value},ph=i=>async(r,a,o,g)=>{const x=o?Object.assign(o,{async:!0}):{async:!0};let T=r._zod.run({value:a,issues:[]},x);if(T instanceof Promise&&(T=await T),T.issues.length){const c=new((g==null?void 0:g.Err)??i)(T.issues.map(h=>Ws(h,x,Gs())));throw Ip(c,g==null?void 0:g.callee),c}return T.value},ml=i=>(r,a,o)=>{const g=o?{...o,async:!1}:{async:!1},x=r._zod.run({value:a,issues:[]},g);if(x instanceof Promise)throw new rn;return x.issues.length?{success:!1,error:new(i??Fp)(x.issues.map(T=>Ws(T,g,Gs())))}:{success:!0,data:x.value}},zb=ml(Zp),pl=i=>async(r,a,o)=>{const g=o?Object.assign(o,{async:!0}):{async:!0};let x=r._zod.run({value:a,issues:[]},g);return x instanceof Promise&&(x=await x),x.issues.length?{success:!1,error:new i(x.issues.map(T=>Ws(T,g,Gs())))}:{success:!0,data:x.value}},jb=pl(Zp),Hb=i=>(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return mh(i)(r,a,g)},Ub=i=>(r,a,o)=>mh(i)(r,a,o),Ib=i=>async(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ph(i)(r,a,g)},Pb=i=>async(r,a,o)=>ph(i)(r,a,o),$b=i=>(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ml(i)(r,a,g)},Fb=i=>(r,a,o)=>ml(i)(r,a,o),Zb=i=>async(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return pl(i)(r,a,g)},qb=i=>async(r,a,o)=>pl(i)(r,a,o),Gb=/^[cC][^\s-]{8,}$/,Wb=/^[0-9a-z]+$/,Yb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vb=/^[0-9a-vA-V]{20}$/,Kb=/^[A-Za-z0-9]{27}$/,Xb=/^[a-zA-Z0-9_-]{21}$/,Jb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Qb=/^([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})$/,km=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)$/,e1=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,t1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function i1(){return new RegExp(t1,"u")}const s1=/^(?:(?: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])$/,r1=/^(([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}|:))$/,n1=/^((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])$/,a1=/^(([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])$/,o1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qp=/^[A-Za-z0-9_-]*$/,l1=/^\+[1-9]\d{6,14}$/,Gp="(?:(?:\\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])))",c1=new RegExp(`^${Gp}$`);function Wp(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 u1(i){return new RegExp(`^${Wp(i)}$`)}function h1(i){const r=Wp({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(`^${Gp}T(?:${o})$`)}const f1=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}$`)},d1=/^-?\d+$/,Yp=/^-?\d+(?:\.\d+)?$/,_1=/^(?:true|false)$/i,m1=/^[^A-Z]*$/,p1=/^[^a-z]*$/,ni=fe("$ZodCheck",(i,r)=>{var a;i._zod??(i._zod={}),i._zod.def=r,(a=i._zod).onattach??(a.onattach=[])}),Vp={number:"number",bigint:"bigint",object:"date"},Kp=fe("$ZodCheckLessThan",(i,r)=>{ni.init(i,r);const a=Vp[typeof r.value];i._zod.onattach.push(o=>{const g=o._zod.bag,x=(r.inclusive?g.maximum:g.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<x&&(r.inclusive?g.maximum=r.value:g.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})}}),Xp=fe("$ZodCheckGreaterThan",(i,r)=>{ni.init(i,r);const a=Vp[typeof r.value];i._zod.onattach.push(o=>{const g=o._zod.bag,x=(r.inclusive?g.minimum:g.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>x&&(r.inclusive?g.minimum=r.value:g.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})}}),v1=fe("$ZodCheckMultipleOf",(i,r)=>{ni.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):bb(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})}}),g1=fe("$ZodCheckNumberFormat",(i,r)=>{var T;ni.init(i,r),r.format=r.format||"float64";const a=(T=r.format)==null?void 0:T.includes("int"),o=a?"int":"number",[g,x]=Tb[r.format];i._zod.onattach.push(c=>{const h=c._zod.bag;h.format=r.format,h.minimum=g,h.maximum=x,a&&(h.pattern=d1)}),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<g&&c.issues.push({origin:"number",input:h,code:"too_small",minimum:g,inclusive:!0,inst:i,continue:!r.abort}),h>x&&c.issues.push({origin:"number",input:h,code:"too_big",maximum:x,inclusive:!0,inst:i,continue:!r.abort})}}),y1=fe("$ZodCheckMaxLength",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!fh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<g&&(o._zod.bag.maximum=r.maximum)}),i._zod.check=o=>{const g=o.value;if(g.length<=r.maximum)return;const T=_h(g);o.issues.push({origin:T,code:"too_big",maximum:r.maximum,inclusive:!0,input:g,inst:i,continue:!r.abort})}}),S1=fe("$ZodCheckMinLength",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!fh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>g&&(o._zod.bag.minimum=r.minimum)}),i._zod.check=o=>{const g=o.value;if(g.length>=r.minimum)return;const T=_h(g);o.issues.push({origin:T,code:"too_small",minimum:r.minimum,inclusive:!0,input:g,inst:i,continue:!r.abort})}}),b1=fe("$ZodCheckLengthEquals",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!fh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag;g.minimum=r.length,g.maximum=r.length,g.length=r.length}),i._zod.check=o=>{const g=o.value,x=g.length;if(x===r.length)return;const T=_h(g),c=x>r.length;o.issues.push({origin:T,...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})}}),vl=fe("$ZodCheckStringFormat",(i,r)=>{var a,o;ni.init(i,r),i._zod.onattach.push(g=>{const x=g._zod.bag;x.format=r.format,r.pattern&&(x.patterns??(x.patterns=new Set),x.patterns.add(r.pattern))}),r.pattern?(a=i._zod).check??(a.check=g=>{r.pattern.lastIndex=0,!r.pattern.test(g.value)&&g.issues.push({origin:"string",code:"invalid_format",format:r.format,input:g.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:i,continue:!r.abort})}):(o=i._zod).check??(o.check=()=>{})}),C1=fe("$ZodCheckRegex",(i,r)=>{vl.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})}}),x1=fe("$ZodCheckLowerCase",(i,r)=>{r.pattern??(r.pattern=m1),vl.init(i,r)}),w1=fe("$ZodCheckUpperCase",(i,r)=>{r.pattern??(r.pattern=p1),vl.init(i,r)}),E1=fe("$ZodCheckIncludes",(i,r)=>{ni.init(i,r);const a=_l(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position}}${a}`:a);r.pattern=o,i._zod.onattach.push(g=>{const x=g._zod.bag;x.patterns??(x.patterns=new Set),x.patterns.add(o)}),i._zod.check=g=>{g.value.includes(r.includes,r.position)||g.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:g.value,inst:i,continue:!r.abort})}}),T1=fe("$ZodCheckStartsWith",(i,r)=>{ni.init(i,r);const a=new RegExp(`^${_l(r.prefix)}.*`);r.pattern??(r.pattern=a),i._zod.onattach.push(o=>{const g=o._zod.bag;g.patterns??(g.patterns=new Set),g.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})}}),A1=fe("$ZodCheckEndsWith",(i,r)=>{ni.init(i,r);const a=new RegExp(`.*${_l(r.suffix)}$`);r.pattern??(r.pattern=a),i._zod.onattach.push(o=>{const g=o._zod.bag;g.patterns??(g.patterns=new Set),g.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})}}),R1=fe("$ZodCheckOverwrite",(i,r)=>{ni.init(i,r),i._zod.check=a=>{a.value=r.tx(a.value)}});class D1{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(`
|
|
216
|
+
`).filter(T=>T),g=Math.min(...o.map(T=>T.length-T.trimStart().length)),x=o.map(T=>T.slice(g)).map(T=>" ".repeat(this.indent*2)+T);for(const T of x)this.content.push(T)}compile(){const r=Function,a=this==null?void 0:this.args,g=[...((this==null?void 0:this.content)??[""]).map(x=>` ${x}`)];return new r(...a,g.join(`
|
|
217
|
+
`))}}const k1={major:4,minor:3,patch:6},ft=fe("$ZodType",(i,r)=>{var g;var a;i??(i={}),i._zod.def=r,i._zod.bag=i._zod.bag||{},i._zod.version=k1;const o=[...i._zod.def.checks??[]];i._zod.traits.has("$ZodCheck")&&o.unshift(i);for(const x of o)for(const T of x._zod.onattach)T(i);if(o.length===0)(a=i._zod).deferred??(a.deferred=[]),(g=i._zod.deferred)==null||g.push(()=>{i._zod.run=i._zod.parse});else{const x=(c,h,u)=>{let y=en(c),m;for(const C of h){if(C._zod.def.when){if(!C._zod.def.when(c))continue}else if(y)continue;const w=c.issues.length,E=C._zod.check(c);if(E instanceof Promise&&(u==null?void 0:u.async)===!1)throw new rn;if(m||E instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await E,c.issues.length!==w&&(y||(y=en(c,w)))});else{if(c.issues.length===w)continue;y||(y=en(c,w))}}return m?m.then(()=>c):c},T=(c,h,u)=>{if(en(c))return c.aborted=!0,c;const y=x(h,o,u);if(y instanceof Promise){if(u.async===!1)throw new rn;return y.then(m=>i._zod.parse(m,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(m=>T(m,c,h)):T(y,c,h)}const u=i._zod.parse(c,h);if(u instanceof Promise){if(h.async===!1)throw new rn;return u.then(y=>x(y,o,h))}return x(u,o,h)}}We(i,"~standard",()=>({validate:x=>{var T;try{const c=zb(i,x);return c.success?{value:c.data}:{issues:(T=c.error)==null?void 0:T.issues}}catch{return jb(i,x).then(h=>{var u;return h.success?{value:h.data}:{issues:(u=h.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),vh=fe("$ZodString",(i,r)=>{var a;ft.init(i,r),i._zod.pattern=[...((a=i==null?void 0:i._zod.bag)==null?void 0:a.patterns)??[]].pop()??f1(i._zod.bag),i._zod.parse=(o,g)=>{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}}),rt=fe("$ZodStringFormat",(i,r)=>{vl.init(i,r),vh.init(i,r)}),O1=fe("$ZodGUID",(i,r)=>{r.pattern??(r.pattern=Qb),rt.init(i,r)}),M1=fe("$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=km(o))}else r.pattern??(r.pattern=km());rt.init(i,r)}),L1=fe("$ZodEmail",(i,r)=>{r.pattern??(r.pattern=e1),rt.init(i,r)}),N1=fe("$ZodURL",(i,r)=>{rt.init(i,r),i._zod.check=a=>{try{const o=a.value.trim(),g=new URL(o);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(g.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(g.protocol.endsWith(":")?g.protocol.slice(0,-1):g.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=g.href:a.value=o;return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:i,continue:!r.abort})}}}),B1=fe("$ZodEmoji",(i,r)=>{r.pattern??(r.pattern=i1()),rt.init(i,r)}),z1=fe("$ZodNanoID",(i,r)=>{r.pattern??(r.pattern=Xb),rt.init(i,r)}),j1=fe("$ZodCUID",(i,r)=>{r.pattern??(r.pattern=Gb),rt.init(i,r)}),H1=fe("$ZodCUID2",(i,r)=>{r.pattern??(r.pattern=Wb),rt.init(i,r)}),U1=fe("$ZodULID",(i,r)=>{r.pattern??(r.pattern=Yb),rt.init(i,r)}),I1=fe("$ZodXID",(i,r)=>{r.pattern??(r.pattern=Vb),rt.init(i,r)}),P1=fe("$ZodKSUID",(i,r)=>{r.pattern??(r.pattern=Kb),rt.init(i,r)}),$1=fe("$ZodISODateTime",(i,r)=>{r.pattern??(r.pattern=h1(r)),rt.init(i,r)}),F1=fe("$ZodISODate",(i,r)=>{r.pattern??(r.pattern=c1),rt.init(i,r)}),Z1=fe("$ZodISOTime",(i,r)=>{r.pattern??(r.pattern=u1(r)),rt.init(i,r)}),q1=fe("$ZodISODuration",(i,r)=>{r.pattern??(r.pattern=Jb),rt.init(i,r)}),G1=fe("$ZodIPv4",(i,r)=>{r.pattern??(r.pattern=s1),rt.init(i,r),i._zod.bag.format="ipv4"}),W1=fe("$ZodIPv6",(i,r)=>{r.pattern??(r.pattern=r1),rt.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})}}}),Y1=fe("$ZodCIDRv4",(i,r)=>{r.pattern??(r.pattern=n1),rt.init(i,r)}),V1=fe("$ZodCIDRv6",(i,r)=>{r.pattern??(r.pattern=a1),rt.init(i,r),i._zod.check=a=>{const o=a.value.split("/");try{if(o.length!==2)throw new Error;const[g,x]=o;if(!x)throw new Error;const T=Number(x);if(`${T}`!==x)throw new Error;if(T<0||T>128)throw new Error;new URL(`http://[${g}]`)}catch{a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:i,continue:!r.abort})}}});function Jp(i){if(i==="")return!0;if(i.length%4!==0)return!1;try{return atob(i),!0}catch{return!1}}const K1=fe("$ZodBase64",(i,r)=>{r.pattern??(r.pattern=o1),rt.init(i,r),i._zod.bag.contentEncoding="base64",i._zod.check=a=>{Jp(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:i,continue:!r.abort})}});function X1(i){if(!qp.test(i))return!1;const r=i.replace(/[-_]/g,o=>o==="-"?"+":"/"),a=r.padEnd(Math.ceil(r.length/4)*4,"=");return Jp(a)}const J1=fe("$ZodBase64URL",(i,r)=>{r.pattern??(r.pattern=qp),rt.init(i,r),i._zod.bag.contentEncoding="base64url",i._zod.check=a=>{X1(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:i,continue:!r.abort})}}),Q1=fe("$ZodE164",(i,r)=>{r.pattern??(r.pattern=l1),rt.init(i,r)});function eC(i,r=null){try{const a=i.split(".");if(a.length!==3)return!1;const[o]=a;if(!o)return!1;const g=JSON.parse(atob(o));return!("typ"in g&&(g==null?void 0:g.typ)!=="JWT"||!g.alg||r&&(!("alg"in g)||g.alg!==r))}catch{return!1}}const tC=fe("$ZodJWT",(i,r)=>{rt.init(i,r),i._zod.check=a=>{eC(a.value,r.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:i,continue:!r.abort})}}),Qp=fe("$ZodNumber",(i,r)=>{ft.init(i,r),i._zod.pattern=i._zod.bag.pattern??Yp,i._zod.parse=(a,o)=>{if(r.coerce)try{a.value=Number(a.value)}catch{}const g=a.value;if(typeof g=="number"&&!Number.isNaN(g)&&Number.isFinite(g))return a;const x=typeof g=="number"?Number.isNaN(g)?"NaN":Number.isFinite(g)?void 0:"Infinity":void 0;return a.issues.push({expected:"number",code:"invalid_type",input:g,inst:i,...x?{received:x}:{}}),a}}),iC=fe("$ZodNumberFormat",(i,r)=>{g1.init(i,r),Qp.init(i,r)}),sC=fe("$ZodBoolean",(i,r)=>{ft.init(i,r),i._zod.pattern=_1,i._zod.parse=(a,o)=>{if(r.coerce)try{a.value=!!a.value}catch{}const g=a.value;return typeof g=="boolean"||a.issues.push({expected:"boolean",code:"invalid_type",input:g,inst:i}),a}}),rC=fe("$ZodUnknown",(i,r)=>{ft.init(i,r),i._zod.parse=a=>a}),nC=fe("$ZodNever",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:i}),a)});function Om(i,r,a){i.issues.length&&r.issues.push(...tn(a,i.issues)),r.value[a]=i.value}const aC=fe("$ZodArray",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>{const g=a.value;if(!Array.isArray(g))return a.issues.push({expected:"array",code:"invalid_type",input:g,inst:i}),a;a.value=Array(g.length);const x=[];for(let T=0;T<g.length;T++){const c=g[T],h=r.element._zod.run({value:c,issues:[]},o);h instanceof Promise?x.push(h.then(u=>Om(u,a,T))):Om(h,a,T)}return x.length?Promise.all(x).then(()=>a):a}});function sl(i,r,a,o,g){if(i.issues.length){if(g&&!(a in o))return;r.issues.push(...tn(a,i.issues))}i.value===void 0?a in o&&(r.value[a]=void 0):r.value[a]=i.value}function ev(i){var o,g,x,T;const r=Object.keys(i.shape);for(const c of r)if(!((T=(x=(g=(o=i.shape)==null?void 0:o[c])==null?void 0:g._zod)==null?void 0:x.traits)!=null&&T.has("$ZodType")))throw new Error(`Invalid element at key "${c}": expected a Zod schema`);const a=Eb(i.shape);return{...i,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(a)}}function tv(i,r,a,o,g,x){const T=[],c=g.keySet,h=g.catchall._zod,u=h.def.type,y=h.optout==="optional";for(const m in r){if(c.has(m))continue;if(u==="never"){T.push(m);continue}const C=h.run({value:r[m],issues:[]},o);C instanceof Promise?i.push(C.then(w=>sl(w,a,m,r,y))):sl(C,a,m,r,y)}return T.length&&a.issues.push({code:"unrecognized_keys",keys:T,input:r,inst:x}),i.length?Promise.all(i).then(()=>a):a}const oC=fe("$ZodObject",(i,r)=>{ft.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=hh(()=>ev(r));We(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 m of y.values)h[u].add(m)}}return h});const g=il,x=r.catchall;let T;i._zod.parse=(c,h)=>{T??(T=o.value);const u=c.value;if(!g(u))return c.issues.push({expected:"object",code:"invalid_type",input:u,inst:i}),c;c.value={};const y=[],m=T.shape;for(const C of T.keys){const w=m[C],E=w._zod.optout==="optional",b=w._zod.run({value:u[C],issues:[]},h);b instanceof Promise?y.push(b.then(d=>sl(d,c,C,u,E))):sl(b,c,C,u,E)}return x?tv(y,u,c,h,o.value,i):y.length?Promise.all(y).then(()=>c):c}}),lC=fe("$ZodObjectJIT",(i,r)=>{oC.init(i,r);const a=i._zod.parse,o=hh(()=>ev(r)),g=C=>{var v;const w=new D1(["shape","payload","ctx"]),E=o.value,b=S=>{const R=Dm(S);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};w.write("const input = payload.value;");const d=Object.create(null);let p=0;for(const S of E.keys)d[S]=`key_${p++}`;w.write("const newResult = {};");for(const S of E.keys){const R=d[S],D=Dm(S),M=C[S],A=((v=M==null?void 0:M._zod)==null?void 0:v.optout)==="optional";w.write(`const ${R} = ${b(S)};`),A?w.write(`
|
|
218
218
|
if (${R}.issues.length) {
|
|
219
219
|
if (${D} in input) {
|
|
220
220
|
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
@@ -232,7 +232,7 @@ Please change the parent <Route path="${p}"> to <Route path="${p==="/"?"*":`${p}
|
|
|
232
232
|
newResult[${D}] = ${R}.value;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
`):
|
|
235
|
+
`):w.write(`
|
|
236
236
|
if (${R}.issues.length) {
|
|
237
237
|
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
238
238
|
...iss,
|
|
@@ -248,15 +248,15 @@ Please change the parent <Route path="${p}"> to <Route path="${p==="/"?"*":`${p}
|
|
|
248
248
|
newResult[${D}] = ${R}.value;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
`)}x.write("payload.value = newResult;"),x.write("return payload;");const f=x.compile();return(S,R)=>f(C,S,R)};let w;const T=il,c=!Hp.jitless,u=c&&xb.value,y=r.catchall;let m;i._zod.parse=(C,x)=>{m??(m=o.value);const E=C.value;return T(E)?c&&u&&(x==null?void 0:x.async)===!1&&x.jitless!==!0?(w||(w=g(r.shape)),C=w(C,x),y?tv([],E,C,x,m,i):C):a(C,x):(C.issues.push({expected:"object",code:"invalid_type",input:E,inst:i}),C)}});function Mm(i,r,a,o){for(const w of i)if(w.issues.length===0)return r.value=w.value,r;const g=i.filter(w=>!en(w));return g.length===1?(r.value=g[0].value,g[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:a,errors:i.map(w=>w.issues.map(T=>Ws(T,o,Gs())))}),r)}const cC=fe("$ZodUnion",(i,r)=>{ft.init(i,r),We(i._zod,"optin",()=>r.options.some(g=>g._zod.optin==="optional")?"optional":void 0),We(i._zod,"optout",()=>r.options.some(g=>g._zod.optout==="optional")?"optional":void 0),We(i._zod,"values",()=>{if(r.options.every(g=>g._zod.values))return new Set(r.options.flatMap(g=>Array.from(g._zod.values)))}),We(i._zod,"pattern",()=>{if(r.options.every(g=>g._zod.pattern)){const g=r.options.map(w=>w._zod.pattern);return new RegExp(`^(${g.map(w=>dh(w.source)).join("|")})$`)}});const a=r.options.length===1,o=r.options[0]._zod.run;i._zod.parse=(g,w)=>{if(a)return o(g,w);let T=!1;const c=[];for(const h of r.options){const u=h._zod.run({value:g.value,issues:[]},w);if(u instanceof Promise)c.push(u),T=!0;else{if(u.issues.length===0)return u;c.push(u)}}return T?Promise.all(c).then(h=>Mm(h,g,i,w)):Mm(c,g,i,w)}}),uC=fe("$ZodIntersection",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>{const g=a.value,w=r.left._zod.run({value:g,issues:[]},o),T=r.right._zod.run({value:g,issues:[]},o);return w instanceof Promise||T instanceof Promise?Promise.all([w,T]).then(([h,u])=>Lm(a,h,u)):Lm(a,w,T)}});function eh(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(nn(i)&&nn(r)){const a=Object.keys(r),o=Object.keys(i).filter(w=>a.indexOf(w)!==-1),g={...i,...r};for(const w of o){const T=eh(i[w],r[w]);if(!T.valid)return{valid:!1,mergeErrorPath:[w,...T.mergeErrorPath]};g[w]=T.data}return{valid:!0,data:g}}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 g=i[o],w=r[o],T=eh(g,w);if(!T.valid)return{valid:!1,mergeErrorPath:[o,...T.mergeErrorPath]};a.push(T.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function Lm(i,r,a){const o=new Map;let g;for(const c of r.issues)if(c.code==="unrecognized_keys"){g??(g=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 w=[...o].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(w.length&&g&&i.issues.push({...g,keys:w}),en(i))return i;const T=eh(r.value,a.value);if(!T.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(T.mergeErrorPath)}`);return i.value=T.data,i}const hC=fe("$ZodRecord",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>{const g=a.value;if(!nn(g))return a.issues.push({expected:"record",code:"invalid_type",input:g,inst:i}),a;const w=[],T=r.keyType._zod.values;if(T){a.value={};const c=new Set;for(const u of T)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:g[u],issues:[]},o);y instanceof Promise?w.push(y.then(m=>{m.issues.length&&a.issues.push(...tn(u,m.issues)),a.value[u]=m.value})):(y.issues.length&&a.issues.push(...tn(u,y.issues)),a.value[u]=y.value)}let h;for(const u in g)c.has(u)||(h=h??[],h.push(u));h&&h.length>0&&a.issues.push({code:"unrecognized_keys",input:g,inst:i,keys:h})}else{a.value={};for(const c of Reflect.ownKeys(g)){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"&&Yp.test(c)&&h.issues.length){const m=r.keyType._zod.run({value:Number(c),issues:[]},o);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(h=m)}if(h.issues.length){r.mode==="loose"?a.value[c]=g[c]:a.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(m=>Ws(m,o,Gs())),input:c,path:[c],inst:i});continue}const y=r.valueType._zod.run({value:g[c],issues:[]},o);y instanceof Promise?w.push(y.then(m=>{m.issues.length&&a.issues.push(...tn(c,m.issues)),a.value[h.value]=m.value})):(y.issues.length&&a.issues.push(...tn(c,y.issues)),a.value[h.value]=y.value)}}return w.length?Promise.all(w).then(()=>a):a}}),fC=fe("$ZodEnum",(i,r)=>{ft.init(i,r);const a=Up(r.entries),o=new Set(a);i._zod.values=o,i._zod.pattern=new RegExp(`^(${a.filter(g=>wb.has(typeof g)).map(g=>typeof g=="string"?_l(g):g.toString()).join("|")})$`),i._zod.parse=(g,w)=>{const T=g.value;return o.has(T)||g.issues.push({code:"invalid_value",values:a,input:T,inst:i}),g}}),dC=fe("$ZodTransform",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new jp(i.constructor.name);const g=r.transform(a.value,a);if(o.async)return(g instanceof Promise?g:Promise.resolve(g)).then(T=>(a.value=T,a));if(g instanceof Promise)throw new rn;return a.value=g,a}});function Nm(i,r){return i.issues.length&&r===void 0?{issues:[],value:void 0}:i}const iv=fe("$ZodOptional",(i,r)=>{ft.init(i,r),i._zod.optin="optional",i._zod.optout="optional",We(i._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),We(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${dh(a.source)})?$`):void 0}),i._zod.parse=(a,o)=>{if(r.innerType._zod.optin==="optional"){const g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(w=>Nm(w,a.value)):Nm(g,a.value)}return a.value===void 0?a:r.innerType._zod.run(a,o)}}),_C=fe("$ZodExactOptional",(i,r)=>{iv.init(i,r),We(i._zod,"values",()=>r.innerType._zod.values),We(i._zod,"pattern",()=>r.innerType._zod.pattern),i._zod.parse=(a,o)=>r.innerType._zod.run(a,o)}),mC=fe("$ZodNullable",(i,r)=>{ft.init(i,r),We(i._zod,"optin",()=>r.innerType._zod.optin),We(i._zod,"optout",()=>r.innerType._zod.optout),We(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${dh(a.source)}|null)$`):void 0}),We(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)}),pC=fe("$ZodDefault",(i,r)=>{ft.init(i,r),i._zod.optin="optional",We(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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(w=>Bm(w,r)):Bm(g,r)}});function Bm(i,r){return i.value===void 0&&(i.value=r.defaultValue),i}const vC=fe("$ZodPrefault",(i,r)=>{ft.init(i,r),i._zod.optin="optional",We(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))}),gC=fe("$ZodNonOptional",(i,r)=>{ft.init(i,r),We(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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(w=>zm(w,i)):zm(g,i)}});function zm(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 yC=fe("$ZodCatch",(i,r)=>{ft.init(i,r),We(i._zod,"optin",()=>r.innerType._zod.optin),We(i._zod,"optout",()=>r.innerType._zod.optout),We(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);const g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(w=>(a.value=w.value,w.issues.length&&(a.value=r.catchValue({...a,error:{issues:w.issues.map(T=>Ws(T,o,Gs()))},input:a.value}),a.issues=[]),a)):(a.value=g.value,g.issues.length&&(a.value=r.catchValue({...a,error:{issues:g.issues.map(w=>Ws(w,o,Gs()))},input:a.value}),a.issues=[]),a)}}),SC=fe("$ZodPipe",(i,r)=>{ft.init(i,r),We(i._zod,"values",()=>r.in._zod.values),We(i._zod,"optin",()=>r.in._zod.optin),We(i._zod,"optout",()=>r.out._zod.optout),We(i._zod,"propValues",()=>r.in._zod.propValues),i._zod.parse=(a,o)=>{if(o.direction==="backward"){const w=r.out._zod.run(a,o);return w instanceof Promise?w.then(T=>qo(T,r.in,o)):qo(w,r.in,o)}const g=r.in._zod.run(a,o);return g instanceof Promise?g.then(w=>qo(w,r.out,o)):qo(g,r.out,o)}});function qo(i,r,a){return i.issues.length?(i.aborted=!0,i):r._zod.run({value:i.value,issues:i.issues},a)}const bC=fe("$ZodReadonly",(i,r)=>{ft.init(i,r),We(i._zod,"propValues",()=>r.innerType._zod.propValues),We(i._zod,"values",()=>r.innerType._zod.values),We(i._zod,"optin",()=>{var a,o;return(o=(a=r.innerType)==null?void 0:a._zod)==null?void 0:o.optin}),We(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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(jm):jm(g)}});function jm(i){return i.value=Object.freeze(i.value),i}const CC=fe("$ZodCustom",(i,r)=>{ni.init(i,r),ft.init(i,r),i._zod.parse=(a,o)=>a,i._zod.check=a=>{const o=a.value,g=r.fn(o);if(g instanceof Promise)return g.then(w=>Hm(w,a,o,i));Hm(g,a,o,i)}});function Hm(i,r,a,o){if(!i){const g={code:"custom",input:a,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(g.params=o._zod.def.params),r.issues.push(Sa(g))}}var Um;class xC{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 g={...o,...this._map.get(r)};return Object.keys(g).length?g:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function wC(){return new xC}(Um=globalThis).__zod_globalRegistry??(Um.__zod_globalRegistry=wC());const ga=globalThis.__zod_globalRegistry;function EC(i,r){return new i({type:"string",...xe(r)})}function TC(i,r){return new i({type:"string",format:"email",check:"string_format",abort:!1,...xe(r)})}function Im(i,r){return new i({type:"string",format:"guid",check:"string_format",abort:!1,...xe(r)})}function AC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,...xe(r)})}function RC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xe(r)})}function DC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xe(r)})}function kC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xe(r)})}function OC(i,r){return new i({type:"string",format:"url",check:"string_format",abort:!1,...xe(r)})}function MC(i,r){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,...xe(r)})}function LC(i,r){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,...xe(r)})}function NC(i,r){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,...xe(r)})}function BC(i,r){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,...xe(r)})}function zC(i,r){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,...xe(r)})}function jC(i,r){return new i({type:"string",format:"xid",check:"string_format",abort:!1,...xe(r)})}function HC(i,r){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,...xe(r)})}function UC(i,r){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,...xe(r)})}function IC(i,r){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,...xe(r)})}function PC(i,r){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xe(r)})}function $C(i,r){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xe(r)})}function FC(i,r){return new i({type:"string",format:"base64",check:"string_format",abort:!1,...xe(r)})}function ZC(i,r){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,...xe(r)})}function qC(i,r){return new i({type:"string",format:"e164",check:"string_format",abort:!1,...xe(r)})}function GC(i,r){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,...xe(r)})}function WC(i,r){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xe(r)})}function YC(i,r){return new i({type:"string",format:"date",check:"string_format",...xe(r)})}function VC(i,r){return new i({type:"string",format:"time",check:"string_format",precision:null,...xe(r)})}function KC(i,r){return new i({type:"string",format:"duration",check:"string_format",...xe(r)})}function XC(i,r){return new i({type:"number",checks:[],...xe(r)})}function JC(i,r){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",...xe(r)})}function QC(i,r){return new i({type:"boolean",...xe(r)})}function ex(i){return new i({type:"unknown"})}function tx(i,r){return new i({type:"never",...xe(r)})}function Pm(i,r){return new Kp({check:"less_than",...xe(r),value:i,inclusive:!1})}function ju(i,r){return new Kp({check:"less_than",...xe(r),value:i,inclusive:!0})}function $m(i,r){return new Xp({check:"greater_than",...xe(r),value:i,inclusive:!1})}function Hu(i,r){return new Xp({check:"greater_than",...xe(r),value:i,inclusive:!0})}function Fm(i,r){return new v1({check:"multiple_of",...xe(r),value:i})}function sv(i,r){return new y1({check:"max_length",...xe(r),maximum:i})}function rl(i,r){return new S1({check:"min_length",...xe(r),minimum:i})}function rv(i,r){return new b1({check:"length_equals",...xe(r),length:i})}function ix(i,r){return new C1({check:"string_format",format:"regex",...xe(r),pattern:i})}function sx(i){return new x1({check:"string_format",format:"lowercase",...xe(i)})}function rx(i){return new w1({check:"string_format",format:"uppercase",...xe(i)})}function nx(i,r){return new E1({check:"string_format",format:"includes",...xe(r),includes:i})}function ax(i,r){return new T1({check:"string_format",format:"starts_with",...xe(r),prefix:i})}function ox(i,r){return new A1({check:"string_format",format:"ends_with",...xe(r),suffix:i})}function cn(i){return new R1({check:"overwrite",tx:i})}function lx(i){return cn(r=>r.normalize(i))}function cx(){return cn(i=>i.trim())}function ux(){return cn(i=>i.toLowerCase())}function hx(){return cn(i=>i.toUpperCase())}function fx(){return cn(i=>Cb(i))}function dx(i,r,a){return new i({type:"array",element:r,...xe(a)})}function _x(i,r,a){return new i({type:"custom",check:"custom",fn:r,...xe(a)})}function mx(i){const r=px(a=>(a.addIssue=o=>{if(typeof o=="string")a.issues.push(Sa(o,a.value,r._zod.def));else{const g=o;g.fatal&&(g.continue=!1),g.code??(g.code="custom"),g.input??(g.input=a.value),g.inst??(g.inst=r),g.continue??(g.continue=!r._zod.def.abort),a.issues.push(Sa(g))}},i(a.value,a)));return r}function px(i,r){const a=new ni({check:"custom",...xe(r)});return a._zod.check=i,a}function nv(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)??ga,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 Tt(i,r,a={path:[],schemaPath:[]}){var y,m;var o;const g=i._zod.def,w=r.seen.get(i);if(w)return w.count++,a.schemaPath.includes(i)&&(w.cycle=a.path),w.schema;const T={schema:{},count:1,cycle:void 0,path:a.path};r.seen.set(i,T);const c=(m=(y=i._zod).toJSONSchema)==null?void 0:m.call(y);if(c)T.schema=c;else{const C={...a,schemaPath:[...a.schemaPath,i],path:a.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(r,T.schema,C);else{const E=T.schema,b=r.processors[g.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${g.type}`);b(i,r,E,C)}const x=i._zod.parent;x&&(T.ref||(T.ref=x),Tt(x,r,C),r.seen.get(x).isParent=!0)}const h=r.metadataRegistry.get(i);return h&&Object.assign(T.schema,h),r.io==="input"&&Wt(i)&&(delete T.schema.examples,delete T.schema.default),r.io==="input"&&T.schema._prefault&&((o=T.schema).default??(o.default=T.schema._prefault)),delete T.schema._prefault,r.seen.get(i).schema}function av(i,r){var T,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 m=(T=i.metadataRegistry.get(y[0]))==null?void 0:T.id;if(m){const C=o.get(m);if(C&&C!==y[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(m,y[0])}}const g=y=>{var b;const m=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){const d=(b=i.external.registry.get(y[0]))==null?void 0:b.id,p=i.external.uri??(v=>v);if(d)return{ref:p(d)};const f=y[1].defId??y[1].schema.id??`schema${i.counter++}`;return y[1].defId=f,{defId:f,ref:`${p("__shared")}#/${m}/${f}`}}if(y[1]===a)return{ref:"#"};const x=`#/${m}/`,E=y[1].schema.id??`__schema${i.counter++}`;return{defId:E,ref:x+E}},w=y=>{if(y[1].schema.$ref)return;const m=y[1],{ref:C,defId:x}=g(y);m.def={...m.schema},x&&(m.defId=x);const E=m.schema;for(const b in E)delete E[b];E.$ref=C};if(i.cycles==="throw")for(const y of i.seen.entries()){const m=y[1];if(m.cycle)throw new Error(`Cycle detected: #/${(c=m.cycle)==null?void 0:c.join("/")}/<root>
|
|
251
|
+
`)}w.write("payload.value = newResult;"),w.write("return payload;");const f=w.compile();return(S,R)=>f(C,S,R)};let x;const T=il,c=!Hp.jitless,u=c&&xb.value,y=r.catchall;let m;i._zod.parse=(C,w)=>{m??(m=o.value);const E=C.value;return T(E)?c&&u&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(x||(x=g(r.shape)),C=x(C,w),y?tv([],E,C,w,m,i):C):a(C,w):(C.issues.push({expected:"object",code:"invalid_type",input:E,inst:i}),C)}});function Mm(i,r,a,o){for(const x of i)if(x.issues.length===0)return r.value=x.value,r;const g=i.filter(x=>!en(x));return g.length===1?(r.value=g[0].value,g[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:a,errors:i.map(x=>x.issues.map(T=>Ws(T,o,Gs())))}),r)}const cC=fe("$ZodUnion",(i,r)=>{ft.init(i,r),We(i._zod,"optin",()=>r.options.some(g=>g._zod.optin==="optional")?"optional":void 0),We(i._zod,"optout",()=>r.options.some(g=>g._zod.optout==="optional")?"optional":void 0),We(i._zod,"values",()=>{if(r.options.every(g=>g._zod.values))return new Set(r.options.flatMap(g=>Array.from(g._zod.values)))}),We(i._zod,"pattern",()=>{if(r.options.every(g=>g._zod.pattern)){const g=r.options.map(x=>x._zod.pattern);return new RegExp(`^(${g.map(x=>dh(x.source)).join("|")})$`)}});const a=r.options.length===1,o=r.options[0]._zod.run;i._zod.parse=(g,x)=>{if(a)return o(g,x);let T=!1;const c=[];for(const h of r.options){const u=h._zod.run({value:g.value,issues:[]},x);if(u instanceof Promise)c.push(u),T=!0;else{if(u.issues.length===0)return u;c.push(u)}}return T?Promise.all(c).then(h=>Mm(h,g,i,x)):Mm(c,g,i,x)}}),uC=fe("$ZodIntersection",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>{const g=a.value,x=r.left._zod.run({value:g,issues:[]},o),T=r.right._zod.run({value:g,issues:[]},o);return x instanceof Promise||T instanceof Promise?Promise.all([x,T]).then(([h,u])=>Lm(a,h,u)):Lm(a,x,T)}});function eh(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(nn(i)&&nn(r)){const a=Object.keys(r),o=Object.keys(i).filter(x=>a.indexOf(x)!==-1),g={...i,...r};for(const x of o){const T=eh(i[x],r[x]);if(!T.valid)return{valid:!1,mergeErrorPath:[x,...T.mergeErrorPath]};g[x]=T.data}return{valid:!0,data:g}}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 g=i[o],x=r[o],T=eh(g,x);if(!T.valid)return{valid:!1,mergeErrorPath:[o,...T.mergeErrorPath]};a.push(T.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function Lm(i,r,a){const o=new Map;let g;for(const c of r.issues)if(c.code==="unrecognized_keys"){g??(g=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 x=[...o].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(x.length&&g&&i.issues.push({...g,keys:x}),en(i))return i;const T=eh(r.value,a.value);if(!T.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(T.mergeErrorPath)}`);return i.value=T.data,i}const hC=fe("$ZodRecord",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>{const g=a.value;if(!nn(g))return a.issues.push({expected:"record",code:"invalid_type",input:g,inst:i}),a;const x=[],T=r.keyType._zod.values;if(T){a.value={};const c=new Set;for(const u of T)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:g[u],issues:[]},o);y instanceof Promise?x.push(y.then(m=>{m.issues.length&&a.issues.push(...tn(u,m.issues)),a.value[u]=m.value})):(y.issues.length&&a.issues.push(...tn(u,y.issues)),a.value[u]=y.value)}let h;for(const u in g)c.has(u)||(h=h??[],h.push(u));h&&h.length>0&&a.issues.push({code:"unrecognized_keys",input:g,inst:i,keys:h})}else{a.value={};for(const c of Reflect.ownKeys(g)){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"&&Yp.test(c)&&h.issues.length){const m=r.keyType._zod.run({value:Number(c),issues:[]},o);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(h=m)}if(h.issues.length){r.mode==="loose"?a.value[c]=g[c]:a.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(m=>Ws(m,o,Gs())),input:c,path:[c],inst:i});continue}const y=r.valueType._zod.run({value:g[c],issues:[]},o);y instanceof Promise?x.push(y.then(m=>{m.issues.length&&a.issues.push(...tn(c,m.issues)),a.value[h.value]=m.value})):(y.issues.length&&a.issues.push(...tn(c,y.issues)),a.value[h.value]=y.value)}}return x.length?Promise.all(x).then(()=>a):a}}),fC=fe("$ZodEnum",(i,r)=>{ft.init(i,r);const a=Up(r.entries),o=new Set(a);i._zod.values=o,i._zod.pattern=new RegExp(`^(${a.filter(g=>wb.has(typeof g)).map(g=>typeof g=="string"?_l(g):g.toString()).join("|")})$`),i._zod.parse=(g,x)=>{const T=g.value;return o.has(T)||g.issues.push({code:"invalid_value",values:a,input:T,inst:i}),g}}),dC=fe("$ZodTransform",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new jp(i.constructor.name);const g=r.transform(a.value,a);if(o.async)return(g instanceof Promise?g:Promise.resolve(g)).then(T=>(a.value=T,a));if(g instanceof Promise)throw new rn;return a.value=g,a}});function Nm(i,r){return i.issues.length&&r===void 0?{issues:[],value:void 0}:i}const iv=fe("$ZodOptional",(i,r)=>{ft.init(i,r),i._zod.optin="optional",i._zod.optout="optional",We(i._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),We(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${dh(a.source)})?$`):void 0}),i._zod.parse=(a,o)=>{if(r.innerType._zod.optin==="optional"){const g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(x=>Nm(x,a.value)):Nm(g,a.value)}return a.value===void 0?a:r.innerType._zod.run(a,o)}}),_C=fe("$ZodExactOptional",(i,r)=>{iv.init(i,r),We(i._zod,"values",()=>r.innerType._zod.values),We(i._zod,"pattern",()=>r.innerType._zod.pattern),i._zod.parse=(a,o)=>r.innerType._zod.run(a,o)}),mC=fe("$ZodNullable",(i,r)=>{ft.init(i,r),We(i._zod,"optin",()=>r.innerType._zod.optin),We(i._zod,"optout",()=>r.innerType._zod.optout),We(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${dh(a.source)}|null)$`):void 0}),We(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)}),pC=fe("$ZodDefault",(i,r)=>{ft.init(i,r),i._zod.optin="optional",We(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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(x=>Bm(x,r)):Bm(g,r)}});function Bm(i,r){return i.value===void 0&&(i.value=r.defaultValue),i}const vC=fe("$ZodPrefault",(i,r)=>{ft.init(i,r),i._zod.optin="optional",We(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))}),gC=fe("$ZodNonOptional",(i,r)=>{ft.init(i,r),We(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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(x=>zm(x,i)):zm(g,i)}});function zm(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 yC=fe("$ZodCatch",(i,r)=>{ft.init(i,r),We(i._zod,"optin",()=>r.innerType._zod.optin),We(i._zod,"optout",()=>r.innerType._zod.optout),We(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);const g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(x=>(a.value=x.value,x.issues.length&&(a.value=r.catchValue({...a,error:{issues:x.issues.map(T=>Ws(T,o,Gs()))},input:a.value}),a.issues=[]),a)):(a.value=g.value,g.issues.length&&(a.value=r.catchValue({...a,error:{issues:g.issues.map(x=>Ws(x,o,Gs()))},input:a.value}),a.issues=[]),a)}}),SC=fe("$ZodPipe",(i,r)=>{ft.init(i,r),We(i._zod,"values",()=>r.in._zod.values),We(i._zod,"optin",()=>r.in._zod.optin),We(i._zod,"optout",()=>r.out._zod.optout),We(i._zod,"propValues",()=>r.in._zod.propValues),i._zod.parse=(a,o)=>{if(o.direction==="backward"){const x=r.out._zod.run(a,o);return x instanceof Promise?x.then(T=>qo(T,r.in,o)):qo(x,r.in,o)}const g=r.in._zod.run(a,o);return g instanceof Promise?g.then(x=>qo(x,r.out,o)):qo(g,r.out,o)}});function qo(i,r,a){return i.issues.length?(i.aborted=!0,i):r._zod.run({value:i.value,issues:i.issues},a)}const bC=fe("$ZodReadonly",(i,r)=>{ft.init(i,r),We(i._zod,"propValues",()=>r.innerType._zod.propValues),We(i._zod,"values",()=>r.innerType._zod.values),We(i._zod,"optin",()=>{var a,o;return(o=(a=r.innerType)==null?void 0:a._zod)==null?void 0:o.optin}),We(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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(jm):jm(g)}});function jm(i){return i.value=Object.freeze(i.value),i}const CC=fe("$ZodCustom",(i,r)=>{ni.init(i,r),ft.init(i,r),i._zod.parse=(a,o)=>a,i._zod.check=a=>{const o=a.value,g=r.fn(o);if(g instanceof Promise)return g.then(x=>Hm(x,a,o,i));Hm(g,a,o,i)}});function Hm(i,r,a,o){if(!i){const g={code:"custom",input:a,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(g.params=o._zod.def.params),r.issues.push(Sa(g))}}var Um;class xC{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 g={...o,...this._map.get(r)};return Object.keys(g).length?g:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function wC(){return new xC}(Um=globalThis).__zod_globalRegistry??(Um.__zod_globalRegistry=wC());const ga=globalThis.__zod_globalRegistry;function EC(i,r){return new i({type:"string",...xe(r)})}function TC(i,r){return new i({type:"string",format:"email",check:"string_format",abort:!1,...xe(r)})}function Im(i,r){return new i({type:"string",format:"guid",check:"string_format",abort:!1,...xe(r)})}function AC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,...xe(r)})}function RC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xe(r)})}function DC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xe(r)})}function kC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xe(r)})}function OC(i,r){return new i({type:"string",format:"url",check:"string_format",abort:!1,...xe(r)})}function MC(i,r){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,...xe(r)})}function LC(i,r){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,...xe(r)})}function NC(i,r){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,...xe(r)})}function BC(i,r){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,...xe(r)})}function zC(i,r){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,...xe(r)})}function jC(i,r){return new i({type:"string",format:"xid",check:"string_format",abort:!1,...xe(r)})}function HC(i,r){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,...xe(r)})}function UC(i,r){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,...xe(r)})}function IC(i,r){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,...xe(r)})}function PC(i,r){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xe(r)})}function $C(i,r){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xe(r)})}function FC(i,r){return new i({type:"string",format:"base64",check:"string_format",abort:!1,...xe(r)})}function ZC(i,r){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,...xe(r)})}function qC(i,r){return new i({type:"string",format:"e164",check:"string_format",abort:!1,...xe(r)})}function GC(i,r){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,...xe(r)})}function WC(i,r){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xe(r)})}function YC(i,r){return new i({type:"string",format:"date",check:"string_format",...xe(r)})}function VC(i,r){return new i({type:"string",format:"time",check:"string_format",precision:null,...xe(r)})}function KC(i,r){return new i({type:"string",format:"duration",check:"string_format",...xe(r)})}function XC(i,r){return new i({type:"number",checks:[],...xe(r)})}function JC(i,r){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",...xe(r)})}function QC(i,r){return new i({type:"boolean",...xe(r)})}function ex(i){return new i({type:"unknown"})}function tx(i,r){return new i({type:"never",...xe(r)})}function Pm(i,r){return new Kp({check:"less_than",...xe(r),value:i,inclusive:!1})}function ju(i,r){return new Kp({check:"less_than",...xe(r),value:i,inclusive:!0})}function $m(i,r){return new Xp({check:"greater_than",...xe(r),value:i,inclusive:!1})}function Hu(i,r){return new Xp({check:"greater_than",...xe(r),value:i,inclusive:!0})}function Fm(i,r){return new v1({check:"multiple_of",...xe(r),value:i})}function sv(i,r){return new y1({check:"max_length",...xe(r),maximum:i})}function rl(i,r){return new S1({check:"min_length",...xe(r),minimum:i})}function rv(i,r){return new b1({check:"length_equals",...xe(r),length:i})}function ix(i,r){return new C1({check:"string_format",format:"regex",...xe(r),pattern:i})}function sx(i){return new x1({check:"string_format",format:"lowercase",...xe(i)})}function rx(i){return new w1({check:"string_format",format:"uppercase",...xe(i)})}function nx(i,r){return new E1({check:"string_format",format:"includes",...xe(r),includes:i})}function ax(i,r){return new T1({check:"string_format",format:"starts_with",...xe(r),prefix:i})}function ox(i,r){return new A1({check:"string_format",format:"ends_with",...xe(r),suffix:i})}function cn(i){return new R1({check:"overwrite",tx:i})}function lx(i){return cn(r=>r.normalize(i))}function cx(){return cn(i=>i.trim())}function ux(){return cn(i=>i.toLowerCase())}function hx(){return cn(i=>i.toUpperCase())}function fx(){return cn(i=>Cb(i))}function dx(i,r,a){return new i({type:"array",element:r,...xe(a)})}function _x(i,r,a){return new i({type:"custom",check:"custom",fn:r,...xe(a)})}function mx(i){const r=px(a=>(a.addIssue=o=>{if(typeof o=="string")a.issues.push(Sa(o,a.value,r._zod.def));else{const g=o;g.fatal&&(g.continue=!1),g.code??(g.code="custom"),g.input??(g.input=a.value),g.inst??(g.inst=r),g.continue??(g.continue=!r._zod.def.abort),a.issues.push(Sa(g))}},i(a.value,a)));return r}function px(i,r){const a=new ni({check:"custom",...xe(r)});return a._zod.check=i,a}function nv(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)??ga,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 Tt(i,r,a={path:[],schemaPath:[]}){var y,m;var o;const g=i._zod.def,x=r.seen.get(i);if(x)return x.count++,a.schemaPath.includes(i)&&(x.cycle=a.path),x.schema;const T={schema:{},count:1,cycle:void 0,path:a.path};r.seen.set(i,T);const c=(m=(y=i._zod).toJSONSchema)==null?void 0:m.call(y);if(c)T.schema=c;else{const C={...a,schemaPath:[...a.schemaPath,i],path:a.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(r,T.schema,C);else{const E=T.schema,b=r.processors[g.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${g.type}`);b(i,r,E,C)}const w=i._zod.parent;w&&(T.ref||(T.ref=w),Tt(w,r,C),r.seen.get(w).isParent=!0)}const h=r.metadataRegistry.get(i);return h&&Object.assign(T.schema,h),r.io==="input"&&Wt(i)&&(delete T.schema.examples,delete T.schema.default),r.io==="input"&&T.schema._prefault&&((o=T.schema).default??(o.default=T.schema._prefault)),delete T.schema._prefault,r.seen.get(i).schema}function av(i,r){var T,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 m=(T=i.metadataRegistry.get(y[0]))==null?void 0:T.id;if(m){const C=o.get(m);if(C&&C!==y[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(m,y[0])}}const g=y=>{var b;const m=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){const d=(b=i.external.registry.get(y[0]))==null?void 0:b.id,p=i.external.uri??(v=>v);if(d)return{ref:p(d)};const f=y[1].defId??y[1].schema.id??`schema${i.counter++}`;return y[1].defId=f,{defId:f,ref:`${p("__shared")}#/${m}/${f}`}}if(y[1]===a)return{ref:"#"};const w=`#/${m}/`,E=y[1].schema.id??`__schema${i.counter++}`;return{defId:E,ref:w+E}},x=y=>{if(y[1].schema.$ref)return;const m=y[1],{ref:C,defId:w}=g(y);m.def={...m.schema},w&&(m.defId=w);const E=m.schema;for(const b in E)delete E[b];E.$ref=C};if(i.cycles==="throw")for(const y of i.seen.entries()){const m=y[1];if(m.cycle)throw new Error(`Cycle detected: #/${(c=m.cycle)==null?void 0:c.join("/")}/<root>
|
|
252
252
|
|
|
253
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of i.seen.entries()){const m=y[1];if(r===y[0]){w(y);continue}if(i.external){const x=(h=i.external.registry.get(y[0]))==null?void 0:h.id;if(r!==y[0]&&x){w(y);continue}}if((u=i.metadataRegistry.get(y[0]))==null?void 0:u.id){w(y);continue}if(m.cycle){w(y);continue}if(m.count>1&&i.reused==="ref"){w(y);continue}}}function ov(i,r){var T,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 m=y.def??y.schema,C={...m},x=y.ref;if(y.ref=null,x){o(x);const b=i.seen.get(x),d=b.schema;if(d.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(d)):Object.assign(m,d),Object.assign(m,C),u._zod.parent===x)for(const f in m)f==="$ref"||f==="allOf"||f in C||delete m[f];if(d.$ref&&b.def)for(const f in m)f==="$ref"||f==="allOf"||f in b.def&&JSON.stringify(m[f])===JSON.stringify(b.def[f])&&delete m[f]}const E=u._zod.parent;if(E&&E!==x){o(E);const b=i.seen.get(E);if(b!=null&&b.schema.$ref&&(m.$ref=b.schema.$ref,b.def))for(const d in m)d==="$ref"||d==="allOf"||d in b.def&&JSON.stringify(m[d])===JSON.stringify(b.def[d])&&delete m[d]}i.override({zodSchema:u,jsonSchema:m,path:y.path??[]})};for(const u of[...i.seen.entries()].reverse())o(u[0]);const g={};if(i.target==="draft-2020-12"?g.$schema="https://json-schema.org/draft/2020-12/schema":i.target==="draft-07"?g.$schema="http://json-schema.org/draft-07/schema#":i.target==="draft-04"?g.$schema="http://json-schema.org/draft-04/schema#":i.target,(T=i.external)!=null&&T.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");g.$id=i.external.uri(u)}Object.assign(g,a.def??a.schema);const w=((h=i.external)==null?void 0:h.defs)??{};for(const u of i.seen.entries()){const y=u[1];y.def&&y.defId&&(w[y.defId]=y.def)}i.external||Object.keys(w).length>0&&(i.target==="draft-2020-12"?g.$defs=w:g.definitions=w);try{const u=JSON.parse(JSON.stringify(g));return Object.defineProperty(u,"~standard",{value:{...r["~standard"],jsonSchema:{input:nl(r,"input",i.processors),output:nl(r,"output",i.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Wt(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 Wt(o.element,a);if(o.type==="set")return Wt(o.valueType,a);if(o.type==="lazy")return Wt(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 Wt(o.innerType,a);if(o.type==="intersection")return Wt(o.left,a)||Wt(o.right,a);if(o.type==="record"||o.type==="map")return Wt(o.keyType,a)||Wt(o.valueType,a);if(o.type==="pipe")return Wt(o.in,a)||Wt(o.out,a);if(o.type==="object"){for(const g in o.shape)if(Wt(o.shape[g],a))return!0;return!1}if(o.type==="union"){for(const g of o.options)if(Wt(g,a))return!0;return!1}if(o.type==="tuple"){for(const g of o.items)if(Wt(g,a))return!0;return!!(o.rest&&Wt(o.rest,a))}return!1}const vx=(i,r={})=>a=>{const o=nv({...a,processors:r});return Tt(i,o),av(o,i),ov(o,i)},nl=(i,r,a={})=>o=>{const{libraryOptions:g,target:w}=o??{},T=nv({...g??{},target:w,io:r,processors:a});return Tt(i,T),av(T,i),ov(T,i)},gx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},yx=(i,r,a,o)=>{const g=a;g.type="string";const{minimum:w,maximum:T,format:c,patterns:h,contentEncoding:u}=i._zod.bag;if(typeof w=="number"&&(g.minLength=w),typeof T=="number"&&(g.maxLength=T),c&&(g.format=gx[c]??c,g.format===""&&delete g.format,c==="time"&&delete g.format),u&&(g.contentEncoding=u),h&&h.size>0){const y=[...h];y.length===1?g.pattern=y[0].source:y.length>1&&(g.allOf=[...y.map(m=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},Sx=(i,r,a,o)=>{const g=a,{minimum:w,maximum:T,format:c,multipleOf:h,exclusiveMaximum:u,exclusiveMinimum:y}=i._zod.bag;typeof c=="string"&&c.includes("int")?g.type="integer":g.type="number",typeof y=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(g.minimum=y,g.exclusiveMinimum=!0):g.exclusiveMinimum=y),typeof w=="number"&&(g.minimum=w,typeof y=="number"&&r.target!=="draft-04"&&(y>=w?delete g.minimum:delete g.exclusiveMinimum)),typeof u=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(g.maximum=u,g.exclusiveMaximum=!0):g.exclusiveMaximum=u),typeof T=="number"&&(g.maximum=T,typeof u=="number"&&r.target!=="draft-04"&&(u<=T?delete g.maximum:delete g.exclusiveMaximum)),typeof h=="number"&&(g.multipleOf=h)},bx=(i,r,a,o)=>{a.type="boolean"},Cx=(i,r,a,o)=>{a.not={}},xx=(i,r,a,o)=>{},wx=(i,r,a,o)=>{const g=i._zod.def,w=Up(g.entries);w.every(T=>typeof T=="number")&&(a.type="number"),w.every(T=>typeof T=="string")&&(a.type="string"),a.enum=w},Ex=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Tx=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Ax=(i,r,a,o)=>{const g=a,w=i._zod.def,{minimum:T,maximum:c}=i._zod.bag;typeof T=="number"&&(g.minItems=T),typeof c=="number"&&(g.maxItems=c),g.type="array",g.items=Tt(w.element,r,{...o,path:[...o.path,"items"]})},Rx=(i,r,a,o)=>{var u;const g=a,w=i._zod.def;g.type="object",g.properties={};const T=w.shape;for(const y in T)g.properties[y]=Tt(T[y],r,{...o,path:[...o.path,"properties",y]});const c=new Set(Object.keys(T)),h=new Set([...c].filter(y=>{const m=w.shape[y]._zod;return r.io==="input"?m.optin===void 0:m.optout===void 0}));h.size>0&&(g.required=Array.from(h)),((u=w.catchall)==null?void 0:u._zod.def.type)==="never"?g.additionalProperties=!1:w.catchall?w.catchall&&(g.additionalProperties=Tt(w.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(g.additionalProperties=!1)},Dx=(i,r,a,o)=>{const g=i._zod.def,w=g.inclusive===!1,T=g.options.map((c,h)=>Tt(c,r,{...o,path:[...o.path,w?"oneOf":"anyOf",h]}));w?a.oneOf=T:a.anyOf=T},kx=(i,r,a,o)=>{const g=i._zod.def,w=Tt(g.left,r,{...o,path:[...o.path,"allOf",0]}),T=Tt(g.right,r,{...o,path:[...o.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,h=[...c(w)?w.allOf:[w],...c(T)?T.allOf:[T]];a.allOf=h},Ox=(i,r,a,o)=>{const g=a,w=i._zod.def;g.type="object";const T=w.keyType,c=T._zod.bag,h=c==null?void 0:c.patterns;if(w.mode==="loose"&&h&&h.size>0){const y=Tt(w.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});g.patternProperties={};for(const m of h)g.patternProperties[m.source]=y}else(r.target==="draft-07"||r.target==="draft-2020-12")&&(g.propertyNames=Tt(w.keyType,r,{...o,path:[...o.path,"propertyNames"]})),g.additionalProperties=Tt(w.valueType,r,{...o,path:[...o.path,"additionalProperties"]});const u=T._zod.values;if(u){const y=[...u].filter(m=>typeof m=="string"||typeof m=="number");y.length>0&&(g.required=y)}},Mx=(i,r,a,o)=>{const g=i._zod.def,w=Tt(g.innerType,r,o),T=r.seen.get(i);r.target==="openapi-3.0"?(T.ref=g.innerType,a.nullable=!0):a.anyOf=[w,{type:"null"}]},Lx=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const w=r.seen.get(i);w.ref=g.innerType},Nx=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const w=r.seen.get(i);w.ref=g.innerType,a.default=JSON.parse(JSON.stringify(g.defaultValue))},Bx=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const w=r.seen.get(i);w.ref=g.innerType,r.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(g.defaultValue)))},zx=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const w=r.seen.get(i);w.ref=g.innerType;let T;try{T=g.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=T},jx=(i,r,a,o)=>{const g=i._zod.def,w=r.io==="input"?g.in._zod.def.type==="transform"?g.out:g.in:g.out;Tt(w,r,o);const T=r.seen.get(i);T.ref=w},Hx=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const w=r.seen.get(i);w.ref=g.innerType,a.readOnly=!0},lv=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const w=r.seen.get(i);w.ref=g.innerType},Ux=fe("ZodISODateTime",(i,r)=>{$1.init(i,r),lt.init(i,r)});function Ix(i){return WC(Ux,i)}const Px=fe("ZodISODate",(i,r)=>{F1.init(i,r),lt.init(i,r)});function $x(i){return YC(Px,i)}const Fx=fe("ZodISOTime",(i,r)=>{Z1.init(i,r),lt.init(i,r)});function Zx(i){return VC(Fx,i)}const qx=fe("ZodISODuration",(i,r)=>{q1.init(i,r),lt.init(i,r)});function Gx(i){return KC(qx,i)}const Wx=(i,r)=>{Fp.init(i,r),i.name="ZodError",Object.defineProperties(i,{format:{value:a=>Bb(i,a)},flatten:{value:a=>Nb(i,a)},addIssue:{value:a=>{i.issues.push(a),i.message=JSON.stringify(i.issues,Qu,2)}},addIssues:{value:a=>{i.issues.push(...a),i.message=JSON.stringify(i.issues,Qu,2)}},isEmpty:{get(){return i.issues.length===0}}})},Mi=fe("ZodError",Wx,{Parent:Error}),Yx=mh(Mi),Vx=ph(Mi),Kx=ml(Mi),Xx=pl(Mi),Jx=Hb(Mi),Qx=Ub(Mi),ew=Ib(Mi),tw=Pb(Mi),iw=$b(Mi),sw=Fb(Mi),rw=Zb(Mi),nw=qb(Mi),dt=fe("ZodType",(i,r)=>(ft.init(i,r),Object.assign(i["~standard"],{jsonSchema:{input:nl(i,"input"),output:nl(i,"output")}}),i.toJSONSchema=vx(i,{}),i.def=r,i.type=r.type,Object.defineProperty(i,"_def",{value:r}),i.check=(...a)=>i.clone(Vs(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)=>Ks(i,a,o),i.brand=()=>i,i.register=((a,o)=>(a.add(i,o),i)),i.parse=(a,o)=>Yx(i,a,o,{callee:i.parse}),i.safeParse=(a,o)=>Kx(i,a,o),i.parseAsync=async(a,o)=>Vx(i,a,o,{callee:i.parseAsync}),i.safeParseAsync=async(a,o)=>Xx(i,a,o),i.spa=i.safeParseAsync,i.encode=(a,o)=>Jx(i,a,o),i.decode=(a,o)=>Qx(i,a,o),i.encodeAsync=async(a,o)=>ew(i,a,o),i.decodeAsync=async(a,o)=>tw(i,a,o),i.safeEncode=(a,o)=>iw(i,a,o),i.safeDecode=(a,o)=>sw(i,a,o),i.safeEncodeAsync=async(a,o)=>rw(i,a,o),i.safeDecodeAsync=async(a,o)=>nw(i,a,o),i.refine=(a,o)=>i.check(Jw(a,o)),i.superRefine=a=>i.check(Qw(a)),i.overwrite=a=>i.check(cn(a)),i.optional=()=>Gm(i),i.exactOptional=()=>Uw(i),i.nullable=()=>Wm(i),i.nullish=()=>Gm(Wm(i)),i.nonoptional=a=>qw(i,a),i.array=()=>gl(i),i.or=a=>Mw([i,a]),i.and=a=>Nw(i,a),i.transform=a=>Ym(i,jw(a)),i.default=a=>$w(i,a),i.prefault=a=>Zw(i,a),i.catch=a=>Ww(i,a),i.pipe=a=>Ym(i,a),i.readonly=()=>Kw(i),i.describe=a=>{const o=i.clone();return ga.add(o,{description:a}),o},Object.defineProperty(i,"description",{get(){var a;return(a=ga.get(i))==null?void 0:a.description},configurable:!0}),i.meta=(...a)=>{if(a.length===0)return ga.get(i);const o=i.clone();return ga.add(o,a[0]),o},i.isOptional=()=>i.safeParse(void 0).success,i.isNullable=()=>i.safeParse(null).success,i.apply=a=>a(i),i)),cv=fe("_ZodString",(i,r)=>{vh.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(o,g,w)=>yx(i,o,g);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(ix(...o)),i.includes=(...o)=>i.check(nx(...o)),i.startsWith=(...o)=>i.check(ax(...o)),i.endsWith=(...o)=>i.check(ox(...o)),i.min=(...o)=>i.check(rl(...o)),i.max=(...o)=>i.check(sv(...o)),i.length=(...o)=>i.check(rv(...o)),i.nonempty=(...o)=>i.check(rl(1,...o)),i.lowercase=o=>i.check(sx(o)),i.uppercase=o=>i.check(rx(o)),i.trim=()=>i.check(cx()),i.normalize=(...o)=>i.check(lx(...o)),i.toLowerCase=()=>i.check(ux()),i.toUpperCase=()=>i.check(hx()),i.slugify=()=>i.check(fx())}),aw=fe("ZodString",(i,r)=>{vh.init(i,r),cv.init(i,r),i.email=a=>i.check(TC(ow,a)),i.url=a=>i.check(OC(lw,a)),i.jwt=a=>i.check(GC(xw,a)),i.emoji=a=>i.check(MC(cw,a)),i.guid=a=>i.check(Im(Zm,a)),i.uuid=a=>i.check(AC(Go,a)),i.uuidv4=a=>i.check(RC(Go,a)),i.uuidv6=a=>i.check(DC(Go,a)),i.uuidv7=a=>i.check(kC(Go,a)),i.nanoid=a=>i.check(LC(uw,a)),i.guid=a=>i.check(Im(Zm,a)),i.cuid=a=>i.check(NC(hw,a)),i.cuid2=a=>i.check(BC(fw,a)),i.ulid=a=>i.check(zC(dw,a)),i.base64=a=>i.check(FC(Sw,a)),i.base64url=a=>i.check(ZC(bw,a)),i.xid=a=>i.check(jC(_w,a)),i.ksuid=a=>i.check(HC(mw,a)),i.ipv4=a=>i.check(UC(pw,a)),i.ipv6=a=>i.check(IC(vw,a)),i.cidrv4=a=>i.check(PC(gw,a)),i.cidrv6=a=>i.check($C(yw,a)),i.e164=a=>i.check(qC(Cw,a)),i.datetime=a=>i.check(Ix(a)),i.date=a=>i.check($x(a)),i.time=a=>i.check(Zx(a)),i.duration=a=>i.check(Gx(a))});function Ie(i){return EC(aw,i)}const lt=fe("ZodStringFormat",(i,r)=>{rt.init(i,r),cv.init(i,r)}),ow=fe("ZodEmail",(i,r)=>{L1.init(i,r),lt.init(i,r)}),Zm=fe("ZodGUID",(i,r)=>{O1.init(i,r),lt.init(i,r)}),Go=fe("ZodUUID",(i,r)=>{M1.init(i,r),lt.init(i,r)}),lw=fe("ZodURL",(i,r)=>{N1.init(i,r),lt.init(i,r)}),cw=fe("ZodEmoji",(i,r)=>{B1.init(i,r),lt.init(i,r)}),uw=fe("ZodNanoID",(i,r)=>{z1.init(i,r),lt.init(i,r)}),hw=fe("ZodCUID",(i,r)=>{j1.init(i,r),lt.init(i,r)}),fw=fe("ZodCUID2",(i,r)=>{H1.init(i,r),lt.init(i,r)}),dw=fe("ZodULID",(i,r)=>{U1.init(i,r),lt.init(i,r)}),_w=fe("ZodXID",(i,r)=>{I1.init(i,r),lt.init(i,r)}),mw=fe("ZodKSUID",(i,r)=>{P1.init(i,r),lt.init(i,r)}),pw=fe("ZodIPv4",(i,r)=>{G1.init(i,r),lt.init(i,r)}),vw=fe("ZodIPv6",(i,r)=>{W1.init(i,r),lt.init(i,r)}),gw=fe("ZodCIDRv4",(i,r)=>{Y1.init(i,r),lt.init(i,r)}),yw=fe("ZodCIDRv6",(i,r)=>{V1.init(i,r),lt.init(i,r)}),Sw=fe("ZodBase64",(i,r)=>{K1.init(i,r),lt.init(i,r)}),bw=fe("ZodBase64URL",(i,r)=>{J1.init(i,r),lt.init(i,r)}),Cw=fe("ZodE164",(i,r)=>{Q1.init(i,r),lt.init(i,r)}),xw=fe("ZodJWT",(i,r)=>{tC.init(i,r),lt.init(i,r)}),uv=fe("ZodNumber",(i,r)=>{Qp.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(o,g,w)=>Sx(i,o,g),i.gt=(o,g)=>i.check($m(o,g)),i.gte=(o,g)=>i.check(Hu(o,g)),i.min=(o,g)=>i.check(Hu(o,g)),i.lt=(o,g)=>i.check(Pm(o,g)),i.lte=(o,g)=>i.check(ju(o,g)),i.max=(o,g)=>i.check(ju(o,g)),i.int=o=>i.check(qm(o)),i.safe=o=>i.check(qm(o)),i.positive=o=>i.check($m(0,o)),i.nonnegative=o=>i.check(Hu(0,o)),i.negative=o=>i.check(Pm(0,o)),i.nonpositive=o=>i.check(ju(0,o)),i.multipleOf=(o,g)=>i.check(Fm(o,g)),i.step=(o,g)=>i.check(Fm(o,g)),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 Oe(i){return XC(uv,i)}const ww=fe("ZodNumberFormat",(i,r)=>{iC.init(i,r),uv.init(i,r)});function qm(i){return JC(ww,i)}const Ew=fe("ZodBoolean",(i,r)=>{sC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>bx(i,a,o)});function ys(i){return QC(Ew,i)}const Tw=fe("ZodUnknown",(i,r)=>{rC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>xx()});function al(){return ex(Tw)}const Aw=fe("ZodNever",(i,r)=>{nC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Cx(i,a,o)});function Rw(i){return tx(Aw,i)}const Dw=fe("ZodArray",(i,r)=>{aC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Ax(i,a,o,g),i.element=r.element,i.min=(a,o)=>i.check(rl(a,o)),i.nonempty=a=>i.check(rl(1,a)),i.max=(a,o)=>i.check(sv(a,o)),i.length=(a,o)=>i.check(rv(a,o)),i.unwrap=()=>i.element});function gl(i,r){return dx(Dw,i,r)}const kw=fe("ZodObject",(i,r)=>{lC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Rx(i,a,o,g),We(i,"shape",()=>r.shape),i.keyof=()=>an(Object.keys(i._zod.def.shape)),i.catchall=a=>i.clone({...i._zod.def,catchall:a}),i.passthrough=()=>i.clone({...i._zod.def,catchall:al()}),i.loose=()=>i.clone({...i._zod.def,catchall:al()}),i.strict=()=>i.clone({...i._zod.def,catchall:Rw()}),i.strip=()=>i.clone({...i._zod.def,catchall:void 0}),i.extend=a=>Db(i,a),i.safeExtend=a=>kb(i,a),i.merge=a=>Ob(i,a),i.pick=a=>Ab(i,a),i.omit=a=>Rb(i,a),i.partial=(...a)=>Mb(hv,i,a[0]),i.required=(...a)=>Lb(fv,i,a[0])});function Lt(i,r){const a={type:"object",shape:i??{},...xe(r)};return new kw(a)}const Ow=fe("ZodUnion",(i,r)=>{cC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Dx(i,a,o,g),i.options=r.options});function Mw(i,r){return new Ow({type:"union",options:i,...xe(r)})}const Lw=fe("ZodIntersection",(i,r)=>{uC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>kx(i,a,o,g)});function Nw(i,r){return new Lw({type:"intersection",left:i,right:r})}const Bw=fe("ZodRecord",(i,r)=>{hC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Ox(i,a,o,g),i.keyType=r.keyType,i.valueType=r.valueType});function yl(i,r,a){return new Bw({type:"record",keyType:i,valueType:r,...xe(a)})}const th=fe("ZodEnum",(i,r)=>{fC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(o,g,w)=>wx(i,o,g),i.enum=r.entries,i.options=Object.values(r.entries);const a=new Set(Object.keys(r.entries));i.extract=(o,g)=>{const w={};for(const T of o)if(a.has(T))w[T]=r.entries[T];else throw new Error(`Key ${T} not found in enum`);return new th({...r,checks:[],...xe(g),entries:w})},i.exclude=(o,g)=>{const w={...r.entries};for(const T of o)if(a.has(T))delete w[T];else throw new Error(`Key ${T} not found in enum`);return new th({...r,checks:[],...xe(g),entries:w})}});function an(i,r){const a=Array.isArray(i)?Object.fromEntries(i.map(o=>[o,o])):i;return new th({type:"enum",entries:a,...xe(r)})}const zw=fe("ZodTransform",(i,r)=>{dC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Tx(i,a),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new jp(i.constructor.name);a.addIssue=w=>{if(typeof w=="string")a.issues.push(Sa(w,a.value,r));else{const T=w;T.fatal&&(T.continue=!1),T.code??(T.code="custom"),T.input??(T.input=a.value),T.inst??(T.inst=i),a.issues.push(Sa(T))}};const g=r.transform(a.value,a);return g instanceof Promise?g.then(w=>(a.value=w,a)):(a.value=g,a)}});function jw(i){return new zw({type:"transform",transform:i})}const hv=fe("ZodOptional",(i,r)=>{iv.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>lv(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Gm(i){return new hv({type:"optional",innerType:i})}const Hw=fe("ZodExactOptional",(i,r)=>{_C.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>lv(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Uw(i){return new Hw({type:"optional",innerType:i})}const Iw=fe("ZodNullable",(i,r)=>{mC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Mx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Wm(i){return new Iw({type:"nullable",innerType:i})}const Pw=fe("ZodDefault",(i,r)=>{pC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Nx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function $w(i,r){return new Pw({type:"default",innerType:i,get defaultValue(){return typeof r=="function"?r():Pp(r)}})}const Fw=fe("ZodPrefault",(i,r)=>{vC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Bx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Zw(i,r){return new Fw({type:"prefault",innerType:i,get defaultValue(){return typeof r=="function"?r():Pp(r)}})}const fv=fe("ZodNonOptional",(i,r)=>{gC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Lx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function qw(i,r){return new fv({type:"nonoptional",innerType:i,...xe(r)})}const Gw=fe("ZodCatch",(i,r)=>{yC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>zx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function Ww(i,r){return new Gw({type:"catch",innerType:i,catchValue:typeof r=="function"?r:()=>r})}const Yw=fe("ZodPipe",(i,r)=>{SC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>jx(i,a,o,g),i.in=r.in,i.out=r.out});function Ym(i,r){return new Yw({type:"pipe",in:i,out:r})}const Vw=fe("ZodReadonly",(i,r)=>{bC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Hx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Kw(i){return new Vw({type:"readonly",innerType:i})}const Xw=fe("ZodCustom",(i,r)=>{CC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Ex(i,a)});function Jw(i,r={}){return _x(Xw,i,r)}function Qw(i){return mx(i)}const gh=an(["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"]),dv=Lt({ok:ys()}),eE=dv.extend({delivered:ys(),attempts:Oe()}),tE=Lt({status:Ie(),version:Ie(),uptime:Oe(),sessions:Lt({active:Oe(),total:Oe()}),timestamp:Ie()}),yh=Lt({id:Ie(),windowId:Ie(),windowName:Ie(),workDir:Ie(),claudeSessionId:Ie().optional(),jsonlPath:Ie().optional(),byteOffset:Oe(),monitorOffset:Oe(),status:gh,createdAt:Oe(),lastActivity:Oe(),stallThresholdMs:Oe(),permissionMode:Ie(),autoApprove:ys().optional(),settingsPatched:ys().optional(),promptDelivery:Lt({delivered:ys(),attempts:Oe()}).optional(),actionHints:yl(Ie(),Lt({method:Ie(),url:Ie(),description:Ie()})).optional()}),iE=Lt({sessions:gl(yh),pagination:Lt({page:Oe(),limit:Oe(),total:Oe(),totalPages:Oe()})}),sE=Lt({alive:ys(),windowExists:ys(),claudeRunning:ys(),paneCommand:Ie().nullable(),status:gh,hasTranscript:ys(),lastActivity:Oe(),lastActivityAgo:Oe(),sessionAge:Oe(),details:Ie(),actionHints:yl(Ie(),Lt({method:Ie(),url:Ie(),description:Ie()})).optional()}),rE=Lt({durationSec:Oe(),messages:Oe(),toolCalls:Oe(),approvals:Oe(),autoApprovals:Oe(),statusChanges:gl(Ie())}),nE=Lt({role:an(["user","assistant","system"]),contentType:an(["text","thinking","tool_use","tool_result","permission_request"]),text:Ie(),toolName:Ie().optional(),toolUseId:Ie().optional(),timestamp:Ie().optional()}),aE=Lt({messages:gl(nE),status:gh,statusText:Ie().nullable(),interactiveContent:Ie().nullable()}),oE=Lt({uptime:Oe(),sessions:Lt({total_created:Oe(),currently_active:Oe(),completed:Oe(),failed:Oe(),avg_duration_sec:Oe(),avg_messages_per_session:Oe()}),auto_approvals:Oe(),webhooks_sent:Oe(),webhooks_failed:Oe(),screenshots_taken:Oe(),pipelines_created:Oe(),batches_created:Oe(),prompt_delivery:Lt({sent:Oe(),delivered:Oe(),failed:Oe(),success_rate:Oe().nullable()})}),lE=an(["status","message","approval","ended","heartbeat","stall","dead","system","hook","subagent_start","subagent_stop"]),cE=Lt({event:lE,sessionId:Ie(),timestamp:Ie(),data:yl(Ie(),al()).optional()}),uE=an(["session_status_change","session_message","session_approval","session_ended","session_created","session_stall","session_dead","session_subagent_start","session_subagent_stop"]),hE=Lt({event:uE,sessionId:Ie(),timestamp:Ie(),data:yl(Ie(),al())}),fE=3e4,dE=300*1e3;class ol{constructor(r,a,o={}){wt(this,"eventSource",null);wt(this,"consecutiveFailures",0);wt(this,"failStartTime",null);wt(this,"destroyed",!1);wt(this,"gaveUp",!1);wt(this,"reconnectTimer",null);wt(this,"url");wt(this,"callbacks");wt(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,g,w,T,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>=dE){this.gaveUp||(this.gaveUp=!0,(g=(o=this.callbacks).onGiveUp)==null||g.call(o),(T=(w=this.callbacks).onClose)==null||T.call(w));return}this.consecutiveFailures++;const r=Math.min(fE,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 _E="";function mE(i){if(!i)return{};if(i instanceof Headers){const r={};return i.forEach((a,o)=>{r[o]=a}),r}return i}function pE(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(g=>g.message).join(", ")}`)}function vE(i){return!(i.name==="AbortError"||!i.message||i.message.includes("HTTP "))}async function vt(i,r={}){const a=localStorage.getItem("aegis_token"),o={"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...mE(r.headers)},{retries:g=0,schema:w,schemaContext:T,...c}=r;let h=null;for(let u=0;u<=g;u++)try{const y=await fetch(`${_E}${i}`,{...c,headers:o});if(!y.ok){const C=await y.json().catch(()=>({error:y.statusText})),x=new Error(C.error??`HTTP ${y.status}`);throw x.statusCode=y.status,x}const m=await y.json();return w?pE(m,w,T??i):m}catch(y){if(h=y,u<g&&vE(h))await new Promise(m=>setTimeout(m,1e3*Math.pow(2,u)));else throw h}throw h}function gE(){return vt("/v1/health",{schema:tE,schemaContext:"getHealth"})}function yE(){return vt("/v1/metrics",{schema:oE,schemaContext:"getMetrics"})}function SE(){return vt("/v1/sessions",{schema:iE,schemaContext:"getSessions"})}function bE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}`,{schema:yh,schemaContext:"getSession"})}function CE(i){const{signal:r,...a}=i;return vt("/v1/sessions",{method:"POST",body:JSON.stringify(a),signal:r,schema:yh,schemaContext:"createSession"})}function _v(i){return vt(`/v1/sessions/${encodeURIComponent(i)}`,{method:"DELETE",schema:dv,schemaContext:"killSession"})}function xE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/health`,{schema:sE,schemaContext:"getSessionHealth"})}function wE(){return vt("/v1/sessions/health")}function EE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/read`,{schema:aE,schemaContext:"getSessionMessages"})}function TE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/metrics`,{schema:rE,schemaContext:"getSessionMetrics"})}function AE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/pane`)}function RE(i,r){return vt(`/v1/sessions/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({text:r}),schema:eE,schemaContext:"sendMessage"})}function mv(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/approve`,{method:"POST"})}function DE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/reject`,{method:"POST"})}function pv(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/interrupt`,{method:"POST"})}function kE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/escape`,{method:"POST"})}const Vm=3,OE=1e3;async function vv(i,r){for(let a=0;a<Vm;a++){if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");try{return await jE(r)}catch{if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");if(a<Vm-1){const o=OE*Math.pow(2,a);await new Promise(g=>{const w=setTimeout(g,o);r==null||r.addEventListener("abort",()=>{clearTimeout(w),g(void 0)},{once:!0})})}}}throw i==null||i(),new Error("Real-time updates unavailable")}function gv(i,r,a,o){const g=`/v1/sessions/${encodeURIComponent(i)}/events`;let w=null,T=!1;const c=new AbortController;return a?vv(o==null?void 0:o.onGiveUp,c.signal).then(h=>{if(T)return;const u=`${g}?token=${encodeURIComponent(h.token)}`;w=new ol(u,r,o)}).catch(()=>{}):w=new ol(g,r,o),()=>{T=!0,c.abort(),w==null||w.close()}}function ME(i,r,a){const o="/v1/events";let g=null,w=!1;const T=new AbortController,c=h=>{try{const u=hE.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?vv(a==null?void 0:a.onGiveUp,T.signal).then(h=>{if(w)return;const u=`${o}?token=${encodeURIComponent(h.token)}`;g=new ol(u,c,a)}).catch(()=>{}):g=new ol(o,c,a),()=>{var h;w=!0,T.abort(),(h=a==null?void 0:a.onClose)==null||h.call(a),g==null||g.close()}}function LE(i){const{signal:r,...a}=i;return vt("/v1/sessions/batch",{method:"POST",signal:r,body:JSON.stringify(a)})}function NE(i){return vt("/v1/pipelines",{method:"POST",body:JSON.stringify(i)})}function BE(){return vt("/v1/pipelines")}function zE(i){return vt(`/v1/pipelines/${encodeURIComponent(i)}`)}function jE(i){return vt("/v1/auth/sse-token",{method:"POST",signal:i})}const Wo=new Map;let HE=0;const Xs=zp(i=>({toasts:[],addToast:(r,a,o)=>{const g=`toast-${++HE}`,w=setTimeout(()=>{Wo.delete(g),i(T=>({toasts:T.toasts.filter(c=>c.id!==g)}))},4e3);return Wo.set(g,w),i(T=>({toasts:[...T.toasts,{id:g,type:r,title:a,description:o}]})),g},removeToast:r=>{const a=Wo.get(r);a&&(clearTimeout(a),Wo.delete(r)),i(o=>({toasts:o.toasts.filter(g=>g.id!==r)}))}})),UE={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 IE({id:i,type:r,title:a,description:o}){const g=Xs(w=>w.removeToast);return O.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 ${UE[r]}`,children:[O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("p",{className:"text-sm font-medium",children:a}),o&&O.jsx("p",{className:"mt-0.5 text-xs opacity-80",children:o})]}),O.jsx("button",{onClick:()=>g(i),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:O.jsx(dl,{className:"h-3.5 w-3.5"})})]})}function PE(){const i=Xs(r=>r.toasts);return i.length===0?null:O.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=>O.jsx("div",{className:"pointer-events-auto",children:O.jsx(IE,{id:r.id,type:r.type,title:r.title,description:r.description})},r.id))})}const $E=[{to:"/",label:"Overview",icon:PS},{to:"/pipelines",label:"Pipelines",icon:Lp}],FE=5,ZE=1e3;function qE(){const i=Et(u=>u.sseConnected),r=Et(u=>u.setSseConnected),a=Et(u=>u.sseError),o=Et(u=>u.setSseError),g=Et(u=>u.addActivity),w=Et(u=>u.token),T=F.useRef(null),[c,h]=F.useState(0);return F.useEffect(()=>{let u=!1,y,m=null;function C(x){if(!u)try{y=ME(E=>{E.sessionId&&g(E)},w,{onOpen:()=>{T.current&&(clearTimeout(T.current),T.current=null),r(!0),o(null),h(0)},onClose:()=>{T.current=setTimeout(()=>{r(!1)},2e3)},onGiveUp:()=>{o("SSE connection failed — real-time updates unavailable"),r(!1)}})}catch(E){if(console.error("Failed to subscribe to global SSE (attempt %d):",x+1,E),x<FE){const b=ZE*Math.pow(2,x);h(x+1),m=setTimeout(()=>C(x+1),b)}else o("SSE subscription failed after retries — real-time updates unavailable"),r(!1)}}return C(0),()=>{u=!0,T.current&&clearTimeout(T.current),m&&clearTimeout(m),y==null||y()}},[r,o,g,w]),O.jsxs("div",{className:"flex h-screen overflow-hidden bg-void",children:[O.jsxs("aside",{className:"flex w-56 flex-col border-r border-void-lighter bg-void-light shrink-0",children:[O.jsxs("div",{className:"flex items-center gap-2 px-4 py-5 border-b border-void-lighter",children:[O.jsx(rb,{className:"h-6 w-6 text-cyan glow-text-cyan"}),O.jsx("span",{className:"text-lg font-semibold tracking-tight text-gray-100",children:"Aegis"})]}),O.jsxs("nav",{className:"flex flex-col gap-1 px-2 py-4 flex-1",children:[$E.map(({to:u,label:y,icon:m})=>O.jsxs(kp,{to:u,end:u==="/",className:({isActive:C})=>`flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${C?"bg-cyan/10 text-cyan":"text-gray-400 hover:bg-void-lighter hover:text-gray-200"}`,children:[O.jsx(m,{className:"h-4 w-4"}),y]},u)),O.jsx("div",{className:"mt-4 border-t border-void-lighter pt-4 opacity-40",children:O.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 text-sm text-gray-500",children:[O.jsx(lb,{className:"h-4 w-4"}),"Sessions"]})})]})]}),O.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[O.jsxs("header",{className:"flex items-center justify-between border-b border-void-lighter bg-void-light px-6 py-3 shrink-0",children:[O.jsx("h1",{className:"text-sm font-medium text-gray-300",children:"Aegis Dashboard"}),O.jsx("div",{className:"flex items-center gap-3",children:O.jsx("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",title:a??void 0,children:a?O.jsxs(O.Fragment,{children:[O.jsx(Bp,{className:"h-3 w-3 text-amber-500"}),O.jsxs("span",{className:"text-amber-500",children:["SSE Error",c>0?` (retry ${c})`:""]})]}):O.jsxs(O.Fragment,{children:[O.jsx("span",{className:`status-dot ${i?"status-dot--idle":""}`,style:i?void 0:{backgroundColor:"#666"}}),i?"SSE Live":"SSE Off"]})})})]}),O.jsx("main",{className:"flex-1 overflow-auto p-6",children:O.jsx(Fy,{})})]}),O.jsx(PE,{})]})}function GE(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 sn(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 g=Math.floor(o/60);return g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`}function WE(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 g=Math.floor(a/60),w=a%60;return`${g}h ${w.toString().padStart(2,"0")}m`}function qs({label:i,value:r,icon:a,suffix:o}){return O.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[O.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm text-[#888]",children:[a,i]}),O.jsxs("div",{className:"font-mono text-2xl text-[#00e5ff]",children:[r,o&&O.jsx("span",{className:"ml-1 text-base text-[#666]",children:o})]})]})}function YE(){const i=Et(u=>u.metrics),r=Et(u=>u.setMetrics),[a,o]=F.useState(null),g=F.useCallback(async()=>{try{const[u,y]=await Promise.all([yE(),gE()]);r(u),o(y)}catch(u){Xs.getState().addToast("error","Failed to load metrics",u instanceof Error?u.message:void 0)}},[r,o]);F.useEffect(()=>{g();const u=setInterval(g,1e4);return()=>clearInterval(u)},[g]);const w=(i==null?void 0:i.sessions.currently_active)??(a==null?void 0:a.sessions.active)??0,T=(i==null?void 0:i.sessions.total_created)??(a==null?void 0:a.sessions.total)??0,c=i==null?void 0:i.prompt_delivery.success_rate,h=(a==null?void 0:a.uptime)??(i==null?void 0:i.uptime)??0;return O.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[O.jsx(qs,{label:"Active Sessions",value:w,icon:O.jsx(Lp,{className:"h-4 w-4"})}),O.jsx(qs,{label:"Total Created",value:T,icon:O.jsx(US,{className:"h-4 w-4"})}),O.jsx(qs,{label:"Delivery Rate",value:c!=null?c.toFixed(1):"—",suffix:"%",icon:O.jsx(vb,{className:"h-4 w-4"})}),O.jsx(qs,{label:"Uptime",value:GE(h),icon:O.jsx(BS,{className:"h-4 w-4"})})]})}const Km={idle:"#00ff88",working:"#00e5ff",permission_prompt:"#ffaa00",bash_approval:"#ffaa00",plan_mode:"#ff8800",ask_question:"#ff3366",settings:"#00e5ff",error:"#ff0000",compacting:"#ffaa00",context_warning:"#ffaa00",waiting_for_input:"#ffaa00",unknown:"#666666"},VE=new Set(["working","permission_prompt","bash_approval","ask_question"]);function ll({status:i}){const r=Km[i]??Km.unknown,a=VE.has(i);return O.jsx("span",{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}})}function KE(){const i=Et(E=>E.sessions),r=Et(E=>E.healthMap),a=Et(E=>E.setSessionsAndHealth),o=Xs(E=>E.addToast),[g,w]=F.useState({}),T=F.useCallback((E,b)=>g[E]===b,[g]),c=F.useCallback(async(E,b,d)=>{w(p=>({...p,[E]:b}));try{await d()}finally{w(p=>({...p,[E]:null}))}},[]),h=F.useCallback(async()=>{try{const E=await SE();let b={};try{const d=await wE(),p=new Set(E.sessions.map(f=>f.id));for(const[f,v]of Object.entries(d))p.has(f)&&(b[f]={alive:v.alive,loading:!1})}catch{}a(E.sessions,b)}catch(E){o("error","Failed to fetch sessions",E instanceof Error?E.message:void 0)}},[o,a]);F.useEffect(()=>{h();const E=setInterval(h,5e3);return()=>clearInterval(E)},[h]);const u=async(E,b)=>{E.preventDefault(),await c(b,"approve",async()=>{try{await mv(b)}catch(d){o("error","Approve failed",d instanceof Error?d.message:void 0)}})},y=async(E,b)=>{E.preventDefault(),await c(b,"interrupt",async()=>{try{await pv(b)}catch(d){o("error","Interrupt failed",d instanceof Error?d.message:void 0)}})},m=async(E,b)=>{E.preventDefault(),confirm("Kill this session?")&&await c(b,"kill",async()=>{try{await _v(b)}catch(d){o("error","Failed to kill session",d instanceof Error?d.message:void 0)}})};if(i.length===0)return O.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:O.jsx("p",{className:"text-gray-500",children:"No active sessions"})});const C=E=>E.status==="permission_prompt"||E.status==="bash_approval",x=(E,b=40)=>E.length>b?`…${E.slice(E.length-b+1)}`:E;return O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"md:hidden space-y-3",children:i.map(E=>{const b=r[E.id],d=b?b.alive:!0;return O.jsxs(Hi,{to:`/sessions/${encodeURIComponent(E.id)}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 active:bg-[#1a1a2e]/50 transition-colors",children:[O.jsxs("div",{className:"flex items-center justify-between mb-2",children:[O.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[O.jsx(ll,{status:E.status}),O.jsx("span",{className:"font-medium text-gray-200 truncate",children:E.windowName||E.id}),!d&&O.jsx(Fo,{className:"h-3.5 w-3.5 text-red-400 shrink-0"})]}),O.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[C(E)&&O.jsx("button",{onClick:p=>u(p,E.id),disabled:T(E.id,"approve"),className:"min-h-[44px] min-w-[44px] flex items-center justify-center rounded-md bg-green-900/30 p-2 text-green-400 transition-colors hover:bg-green-900/50 disabled:opacity-40 disabled:pointer-events-none",title:"Approve",children:O.jsx(Em,{className:"h-4 w-4"})}),O.jsx("button",{onClick:p=>y(p,E.id),disabled:T(E.id,"interrupt")||T(E.id,"kill"),className:"min-h-[44px] min-w-[44px] flex items-center justify-center rounded-md bg-yellow-900/30 p-2 text-yellow-400 transition-colors hover:bg-yellow-900/50 disabled:opacity-40 disabled:pointer-events-none",title:"Interrupt",children:O.jsx(xm,{className:"h-4 w-4"})}),O.jsx("button",{onClick:p=>m(p,E.id),disabled:T(E.id,"kill"),className:"min-h-[44px] min-w-[44px] flex items-center justify-center rounded-md bg-red-900/30 p-2 text-red-400 transition-colors hover:bg-red-900/50 disabled:opacity-40 disabled:pointer-events-none",title:"Kill",children:O.jsx(Fo,{className:"h-4 w-4"})})]})]}),O.jsx("div",{className:"font-mono text-xs text-gray-500 truncate mb-1.5",children:x(E.workDir,50)}),O.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500",children:[O.jsxs("span",{children:["Age: ",sn(E.createdAt)]}),O.jsxs("span",{children:["Active: ",sn(E.lastActivity)]}),E.permissionMode&&E.permissionMode!=="default"?O.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-green-400",children:[O.jsx(wm,{className:"h-3 w-3"})," ",E.permissionMode]}):null]})]},E.id)})}),O.jsx("div",{className:"hidden md:block overflow-x-auto rounded-lg border border-void-lighter bg-[#111118]",children:O.jsxs("table",{className:"w-full text-left text-sm",children:[O.jsx("thead",{children:O.jsxs("tr",{className:"border-b border-void-lighter text-[#666]",children:[O.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"WorkDir"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Age"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Last Activity"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Permission"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Actions"})]})}),O.jsx("tbody",{children:i.map(E=>{const b=r[E.id],d=b?b.alive:!0;return O.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[O.jsx("td",{className:"px-4 py-3",children:O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(ll,{status:E.status}),!d&&O.jsx(Fo,{className:"h-3.5 w-3.5 text-red-400"})]})}),O.jsx("td",{className:"px-4 py-3",children:O.jsx(Hi,{to:`/sessions/${encodeURIComponent(E.id)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:E.windowName||E.id})}),O.jsx("td",{className:"px-4 py-3 max-w-[200px] truncate font-mono text-xs text-gray-400",title:E.workDir,children:x(E.workDir)}),O.jsx("td",{className:"px-4 py-3 whitespace-nowrap text-gray-400",children:sn(E.createdAt)}),O.jsx("td",{className:"px-4 py-3 whitespace-nowrap text-gray-400",children:sn(E.lastActivity)}),O.jsx("td",{className:"px-4 py-3",children:E.permissionMode&&E.permissionMode!=="default"?O.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:[O.jsx(wm,{className:"h-3 w-3"}),E.permissionMode]}):O.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"})}),O.jsx("td",{className:"px-4 py-3",children:O.jsxs("div",{className:"flex items-center gap-1.5",children:[C(E)&&O.jsx("button",{onClick:p=>u(p,E.id),disabled:T(E.id,"approve"),className:"min-h-[44px] min-w-[44px] flex 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:opacity-40 disabled:pointer-events-none",title:"Approve",children:O.jsx(Em,{className:"h-3 w-3"})}),O.jsx("button",{onClick:p=>y(p,E.id),disabled:T(E.id,"interrupt")||T(E.id,"kill"),className:"min-h-[44px] min-w-[44px] flex 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:opacity-40 disabled:pointer-events-none",title:"Interrupt",children:O.jsx(xm,{className:"h-3 w-3"})}),O.jsx("button",{onClick:p=>m(p,E.id),disabled:T(E.id,"kill"),className:"min-h-[44px] min-w-[44px] flex 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:opacity-40 disabled:pointer-events-none",title:"Kill",children:O.jsx(Fo,{className:"h-3 w-3"})})]})})]},E.id)})})]})})]})}const Uu={session_status_change:{icon:JS,label:"Status",color:"#00e5ff"},session_message:{icon:ZS,label:"Message",color:"#00ff88"},session_approval:{icon:ib,label:"Approval",color:"#ffaa00"},session_ended:{icon:KS,label:"Ended",color:"#ff3366"},session_created:{icon:MS,label:"Created",color:"#a78bfa"},session_stall:{icon:Bp,label:"Stall",color:"#ff6600"},session_dead:{icon:ab,label:"Dead",color:"#ff0044"},session_subagent_start:{icon:_b,label:"Subagent",color:"#38bdf8"},session_subagent_stop:{icon:fb,label:"Subagent Done",color:"#34d399"}};function mr(i,r="unknown"){return typeof i=="string"?i:r}function XE(i){const r=i.data;switch(i.event){case"session_status_change":{const a=mr(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}: ${Xm(o,80)}`}case"session_approval":{const a=typeof r.prompt=="string"?r.prompt:JSON.stringify(r.prompt??"");return`Approval needed: ${Xm(a,80)}`}case"session_ended":return`Session ended: ${mr(r.reason)}`;case"session_created":return`Created in ${mr(r.workDir,"unknown dir")}`;case"session_stall":return`Session stalled: ${mr(r.stallType)}`;case"session_dead":return`Session dead: ${mr(r.stallType)}`;case"session_subagent_start":return`Subagent started: ${mr(r.name)}`;case"session_subagent_stop":return`Subagent finished: ${mr(r.name)}`;default:return JSON.stringify(r)}}function Xm(i,r){return i.length>r?i.slice(0,r)+"...":i}function JE(i){try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function QE(){const i=Et(u=>u.activities),r=Et(u=>u.activityFilterSession),a=Et(u=>u.activityFilterType),o=Et(u=>u.setActivityFilterSession),g=Et(u=>u.setActivityFilterType),w=Et(u=>u.sessions),T=F.useMemo(()=>i.filter(u=>!(r&&u.sessionId!==r||a&&u.event!==a)),[i,r,a]),c=F.useMemo(()=>{const u=new Map;for(const y of w)u.set(y.id,y.windowName??y.id.slice(0,8));return u},[w]),h=u=>c.get(u)??(u??"unknown").slice(0,8);return O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg w-full",children:[O.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:[O.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Activity Stream"}),O.jsxs("div",{className:"flex items-center gap-2",children:[O.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-[#00e5ff]",children:[O.jsx("option",{value:"",children:"All sessions"}),w.map(u=>O.jsx("option",{value:u.id,children:u.windowName||u.id.slice(0,8)},u.id))]}),O.jsxs("select",{value:a??"",onChange:u=>g(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-[#00e5ff]",children:[O.jsx("option",{value:"",children:"All types"}),Object.entries(Uu).map(([u,y])=>O.jsx("option",{value:u,children:y.label},u))]}),(r||a)&&O.jsx("button",{onClick:()=>{o(null),g(null)},className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300",children:O.jsx(dl,{className:"h-4 w-4"})})]})]}),O.jsxs("div",{className:"max-h-[360px] overflow-y-auto divide-y divide-[#1a1a2e]/50",children:[T.length===0&&O.jsx("div",{className:"px-4 py-8 text-center text-sm text-[#555]",children:"No activity yet"}),T.map((u,y)=>{const m=Uu[u.event]??Uu.session_status_change,C=m.icon;return O.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:[O.jsx(C,{className:"h-4 w-4 mt-0.5 shrink-0",style:{color:m.color}}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[O.jsx("span",{className:"text-xs font-medium text-gray-300 truncate",children:h(u.sessionId)}),O.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded hidden sm:inline-block",style:{backgroundColor:`${m.color}15`,color:m.color},children:m.label})]}),O.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:XE(u)})]}),O.jsx("span",{className:"text-[10px] text-[#444] shrink-0 tabular-nums mt-0.5",children:JE(u.timestamp)})]},`${u.sessionId}-${u.timestamp}-${y}`)})]})]})}let e2=0;function ua(){return{workDir:"",name:"",prompt:"",_key:e2++}}function t2({open:i,onClose:r}){const a=ul(),o=F.useRef(null),g=F.useRef(null),w=F.useCallback(()=>{I(),r()},[r]),T=F.useRef(null);F.useEffect(()=>{if(!i)return;const K=ee=>{var N;ee.key==="Escape"&&((N=g.current)==null||N.abort(),w())};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[i,w]),F.useEffect(()=>{if(!i)return;const K=T.current;if(!K)return;const ee='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',N=U=>{if(U.key!=="Tab")return;const L=Array.from(K.querySelectorAll(ee));if(L.length===0)return;const H=L[0],X=L[L.length-1];U.shiftKey?document.activeElement===H&&(U.preventDefault(),X.focus()):document.activeElement===X&&(U.preventDefault(),H.focus())};return K.addEventListener("keydown",N),()=>K.removeEventListener("keydown",N)},[i]),F.useEffect(()=>{if(i){const K=setTimeout(()=>{var ee;return(ee=o.current)==null?void 0:ee.focus()},50);return()=>clearTimeout(K)}},[i]);const[c,h]=F.useState(""),[u,y]=F.useState(""),[m,C]=F.useState(""),[x,E]=F.useState("default"),[b,d]=F.useState(!1),[p,f]=F.useState(null),[v,S]=F.useState("single"),[R,D]=F.useState([ua(),ua()]),[M,A]=F.useState(""),[B,$]=F.useState(null);function I(){h(""),y(""),C(""),E("default"),d(!1),f(null),D([ua(),ua()]),A(""),$(null),S("single")}function q(){R.length>=10||D([...R,ua()])}function P(K){R.length<=1||D(R.filter((ee,N)=>N!==K))}function Q(K,ee,N){D(R.map((U,L)=>L===K?{...U,[ee]:N}:U))}async function se(K){var U;K.preventDefault(),f(null),$(null);const ee=R.filter(L=>L.workDir.trim());if(ee.length===0){f("At least one working directory is required");return}d(!0),(U=g.current)==null||U.abort();const N=new AbortController;g.current=N;try{const L=await LE({sessions:ee.map(H=>({workDir:H.workDir.trim(),name:H.name.trim()||void 0,prompt:H.prompt.trim()||M.trim()||void 0,permissionMode:x})),signal:N.signal});$(L)}catch(L){if(N.signal.aborted)return;f(L instanceof Error?L.message:"Failed to create sessions")}finally{g.current===N&&(g.current=null,d(!1))}}if(!i)return null;async function G(K){var N;if(K.preventDefault(),f(null),!c.trim()){f("Working directory is required");return}d(!0),(N=g.current)==null||N.abort();const ee=new AbortController;g.current=ee;try{const U=await CE({workDir:c.trim(),name:u.trim()||void 0,prompt:m.trim()||void 0,permissionMode:x,signal:ee.signal});I(),r(),a(`/sessions/${U.id}`)}catch(U){if(ee.signal.aborted)return;f(U instanceof Error?U.message:"Failed to create session")}finally{g.current===ee&&(g.current=null,d(!1))}}return O.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[O.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:w}),O.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-label":"Create new session",className:`relative w-full ${v==="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:[O.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[O.jsxs("div",{className:"flex items-center gap-4",children:[O.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Session"}),O.jsxs("div",{className:"flex rounded bg-[#0a0a0f] p-0.5",children:[O.jsx("button",{type:"button",onClick:()=>S("single"),className:`px-3 py-1 text-xs rounded transition-colors ${v==="single"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Single"}),O.jsx("button",{type:"button",onClick:()=>S("batch"),className:`px-3 py-1 text-xs rounded transition-colors ${v==="batch"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Batch"})]})]}),O.jsx("button",{onClick:w,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:O.jsx(dl,{className:"h-4 w-4"})})]}),v==="single"&&O.jsxs("form",{onSubmit:G,className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{children:[O.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Working Directory ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("input",{type:"text",ref:o,value:c,onChange:K=>h(K.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-[#00e5ff] font-mono"})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Session Name"}),O.jsx("input",{type:"text",value:u,onChange:K=>y(K.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-[#00e5ff]"})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Initial Prompt"}),O.jsx("textarea",{value:m,onChange:K=>C(K.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-[#00e5ff] resize-none"})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),O.jsxs("select",{value:x,onChange:K=>E(K.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:[O.jsx("option",{value:"default",children:"default — asks for everything"}),O.jsx("option",{value:"plan",children:"plan — auto-reads, asks for writes"}),O.jsx("option",{value:"acceptEdits",children:"acceptEdits — auto-edits, asks for bash"}),O.jsx("option",{value:"bypassPermissions",children:"bypassPermissions — never asks"}),O.jsx("option",{value:"auto",children:"auto — auto-approve in sandbox"})]})]}),p&&O.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:p}),O.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[O.jsx("button",{type:"button",onClick:w,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"}),O.jsxs("button",{type:"submit",disabled:b||!c.trim(),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:[b&&O.jsx(Ju,{className:"h-3 w-3 animate-spin"}),"Create Session"]})]})]}),v==="batch"&&!B&&O.jsxs("form",{onSubmit:se,className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Shared Prompt"}),O.jsx("textarea",{value:M,onChange:K=>A(K.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-[#00e5ff] resize-none"})]}),O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[O.jsxs("span",{children:["Working Directory ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("span",{children:"Name"}),O.jsx("span",{children:"Prompt (override)"}),O.jsx("span",{})]}),O.jsx("div",{className:"space-y-2",children:R.map((K,ee)=>O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[O.jsx("input",{type:"text",value:K.workDir,onChange:N=>Q(ee,"workDir",N.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-[#00e5ff] font-mono"}),O.jsx("input",{type:"text",value:K.name,onChange:N=>Q(ee,"name",N.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-[#00e5ff]"}),O.jsx("input",{type:"text",value:K.prompt,onChange:N=>Q(ee,"prompt",N.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-[#00e5ff]"}),O.jsx("button",{type:"button",onClick:()=>P(ee),disabled:R.length<=1,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ff3366] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:O.jsx(Np,{className:"h-3.5 w-3.5"})})]},K._key))}),R.length<10&&O.jsxs("button",{type:"button",onClick:q,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[O.jsx(fl,{className:"h-3.5 w-3.5"}),"Add session"]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),O.jsxs("select",{value:x,onChange:K=>E(K.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:[O.jsx("option",{value:"default",children:"default — asks for everything"}),O.jsx("option",{value:"plan",children:"plan — auto-reads, asks for writes"}),O.jsx("option",{value:"acceptEdits",children:"acceptEdits — auto-edits, asks for bash"}),O.jsx("option",{value:"bypassPermissions",children:"bypassPermissions — never asks"}),O.jsx("option",{value:"auto",children:"auto — auto-approve in sandbox"})]})]}),p&&O.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:p}),O.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[O.jsx("button",{type:"button",onClick:w,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"}),O.jsxs("button",{type:"submit",disabled:b||!R.some(K=>K.workDir.trim()),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:[b&&O.jsx(Ju,{className:"h-3 w-3 animate-spin"}),"Create ",R.filter(K=>K.workDir.trim()).length," Session(s)"]})]})]}),B&&O.jsxs("div",{className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[B.created>0&&O.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:[B.created," created"]}),B.failed>0&&O.jsxs("span",{className:"text-xs font-medium text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-1.5",children:[B.failed," failed"]})]}),B.sessions.length>0&&O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Created sessions"}),O.jsx("ul",{className:"space-y-1",children:B.sessions.map(K=>O.jsx("li",{children:O.jsxs("button",{type:"button",onClick:()=>{w(),a(`/sessions/${K.id}`)},className:"text-xs text-[#00e5ff] hover:underline font-mono",children:[K.id.slice(0,8),"...",K.name?` — ${K.name}`:""]})},K.id))})]}),B.errors.length>0&&O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Errors"}),O.jsx("ul",{className:"space-y-1",children:B.errors.map((K,ee)=>O.jsx("li",{className:"text-xs text-[#ff3366]",children:K},ee))})]}),O.jsx("div",{className:"flex justify-end pt-2",children:O.jsx("button",{type:"button",onClick:w,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 i2(){const[i,r]=F.useState(!1);return O.jsxs("div",{className:"flex flex-col gap-6",children:[O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{children:[O.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Overview"}),O.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Aegis session monitoring and metrics"})]}),O.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:[O.jsx(fl,{className:"h-3.5 w-3.5"}),"New Session"]})]}),O.jsx(YE,{}),O.jsxs("div",{children:[O.jsx("h3",{className:"mb-3 text-lg font-semibold text-gray-200",children:"Sessions"}),O.jsx(KE,{})]}),O.jsx(QE,{}),O.jsx(t2,{open:i,onClose:()=>r(!1)})]})}function Jm(i){return i instanceof Error&&"statusCode"in i}function s2(i){const r=Et(Q=>Q.token),a=Xs(Q=>Q.addToast),[o,g]=F.useState(null),[w,T]=F.useState(null),[c,h]=F.useState(!1),[u,y]=F.useState(!0),[m,C]=F.useState(""),[x,E]=F.useState(!0),[b,d]=F.useState(null),[p,f]=F.useState(!0),v=F.useRef(i);v.current=i;const S=F.useRef(!1),R=F.useRef(0),D=F.useRef(void 0),M=F.useRef(void 0),A=F.useCallback(async()=>{try{const[Q,se]=await Promise.allSettled([bE(v.current),xE(v.current)]);if(Q.status==="rejected"&&Jm(Q.reason)&&Q.reason.statusCode===404||se.status==="rejected"&&Jm(se.reason)&&se.reason.statusCode===404){h(!0);return}Q.status==="fulfilled"&&g(Q.value),se.status==="fulfilled"&&T(se.value)}catch(Q){a("error","Failed to load session",Q instanceof Error?Q.message:void 0)}finally{y(!1)}},[a]);D.current=A;const B=F.useCallback(async()=>{if(S.current)return;const Q=v.current;try{const se=await AE(Q);S.current||C(se.pane??"")}catch(se){a("warning","Failed to load terminal pane",se instanceof Error?se.message:void 0)}finally{S.current||E(!1)}try{const se=await TE(Q);S.current||d(se)}catch(se){a("warning","Failed to load session metrics",se instanceof Error?se.message:void 0)}finally{S.current||f(!1)}},[a]);M.current=B,F.useEffect(()=>(S.current=!1,R.current++,y(!0),E(!0),f(!0),A(),B(),()=>{S.current=!0,$.current&&clearTimeout($.current),I.current&&clearTimeout(I.current)}),[i,A,B]);const $=F.useRef(void 0),I=F.useRef(void 0),q=F.useCallback(()=>{$.current&&clearTimeout($.current);const Q=R.current;$.current=setTimeout(()=>{var se;R.current===Q&&((se=M.current)==null||se.call(M))},1e3)},[]),P=F.useCallback(()=>{I.current&&clearTimeout(I.current);const Q=R.current;I.current=setTimeout(()=>{var se;R.current===Q&&((se=D.current)==null||se.call(D))},1e3)},[]);return F.useEffect(()=>{if(!i)return;const Q=gv(i,se=>{var G,K;try{const ee=cE.safeParse(JSON.parse(se.data));if(!ee.success){console.warn("SSE event failed validation",ee.error.message);return}switch(ee.data.event){case"status":case"approval":case"stall":case"dead":P(),q();break;case"message":q();break;case"ended":(G=D.current)==null||G.call(D),(K=M.current)==null||K.call(M);break}}catch{}},r);return()=>Q()},[i,r,P,q]),{session:o,health:w,notFound:c,loading:u,paneContent:m,paneLoading:x,metrics:b,metricsLoading:p,refetchPaneAndMetrics:B}}const r2={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 Qm(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 ep(i){return new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function n2({session:i,health:r,onApprove:a,onReject:o,onInterrupt:g,onKill:w}){const[T,c]=F.useState(!1),h=r.status==="permission_prompt"||r.status==="bash_approval";return O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3 sm:p-4",children:[O.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[O.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[O.jsx(ll,{status:r.status}),O.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:r2[r.status]})]}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("h1",{className:"text-base sm:text-lg font-semibold text-[#e0e0e0] truncate",children:i.windowName||"Untitled Session"}),O.jsx("div",{className:"text-xs text-[#555] font-mono truncate mt-0.5",children:Qm(i.workDir,40)})]}),O.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[i.permissionMode&&i.permissionMode!=="default"&&O.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#003322] text-[#00ff88] border border-[#00ff88]/30",children:i.permissionMode}),r.alive?O.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"}):O.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#331111] text-[#ff3366] border border-[#ff3366]/30",children:"Dead"})]})]}),O.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 text-[11px] text-[#555] mb-3 flex-wrap",children:[O.jsxs("span",{children:["Created: ",ep(i.createdAt)]}),O.jsxs("span",{className:"hidden sm:inline",children:["Last activity: ",ep(i.lastActivity)]}),O.jsxs("span",{className:"font-mono hidden sm:inline",children:["ID: ",Qm(i.id,16)]}),r.details&&O.jsx("span",{className:"text-[#888] italic",children:r.details})]}),O.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h&&O.jsxs(O.Fragment,{children:[O.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#00ff88] border border-[#00ff88]/30 transition-colors",children:"Approve"}),O.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ff3366] border border-[#ff3366]/30 transition-colors",children:"Reject"})]}),O.jsx("button",{onClick:g,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"}),T?O.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[O.jsx("span",{className:"text-xs text-[#ff3366]",children:"Confirm kill?"}),O.jsx("button",{onClick:()=>{w==null||w(),c(!1)},className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] text-[#ff3366] border border-[#ff3366]/30 transition-colors",children:"Yes, Kill"}),O.jsx("button",{onClick:()=>c(!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"})]}):O.jsx("button",{onClick:()=>c(!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"})]})]})}/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:yv,setPrototypeOf:tp,isFrozen:a2,getPrototypeOf:o2,getOwnPropertyDescriptor:l2}=Object;let{freeze:Yt,seal:ki,create:Qo}=Object,{apply:ih,construct:sh}=typeof Reflect<"u"&&Reflect;Yt||(Yt=function(r){return r});ki||(ki=function(r){return r});ih||(ih=function(r,a){for(var o=arguments.length,g=new Array(o>2?o-2:0),w=2;w<o;w++)g[w-2]=arguments[w];return r.apply(a,g)});sh||(sh=function(r){for(var a=arguments.length,o=new Array(a>1?a-1:0),g=1;g<a;g++)o[g-1]=arguments[g];return new r(...o)});const Yo=Vt(Array.prototype.forEach),c2=Vt(Array.prototype.lastIndexOf),ip=Vt(Array.prototype.pop),ha=Vt(Array.prototype.push),u2=Vt(Array.prototype.splice),el=Vt(String.prototype.toLowerCase),Iu=Vt(String.prototype.toString),Pu=Vt(String.prototype.match),fa=Vt(String.prototype.replace),h2=Vt(String.prototype.indexOf),f2=Vt(String.prototype.trim),_i=Vt(Object.prototype.hasOwnProperty),Gt=Vt(RegExp.prototype.test),da=d2(TypeError);function Vt(i){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var a=arguments.length,o=new Array(a>1?a-1:0),g=1;g<a;g++)o[g-1]=arguments[g];return ih(i,r,o)}}function d2(i){return function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return sh(i,a)}}function Me(i,r){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:el;tp&&tp(i,null);let o=r.length;for(;o--;){let g=r[o];if(typeof g=="string"){const w=a(g);w!==g&&(a2(r)||(r[o]=w),g=w)}i[g]=!0}return i}function _2(i){for(let r=0;r<i.length;r++)_i(i,r)||(i[r]=null);return i}function Gi(i){const r=Qo(null);for(const[a,o]of yv(i))_i(i,a)&&(Array.isArray(o)?r[a]=_2(o):o&&typeof o=="object"&&o.constructor===Object?r[a]=Gi(o):r[a]=o);return r}function _a(i,r){for(;i!==null;){const o=l2(i,r);if(o){if(o.get)return Vt(o.get);if(typeof o.value=="function")return Vt(o.value)}i=o2(i)}function a(){return null}return a}const sp=Yt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$u=Yt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Fu=Yt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),m2=Yt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Zu=Yt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),p2=Yt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),rp=Yt(["#text"]),np=Yt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),qu=Yt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ap=Yt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Vo=Yt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),v2=ki(/\{\{[\w\W]*|[\w\W]*\}\}/gm),g2=ki(/<%[\w\W]*|[\w\W]*%>/gm),y2=ki(/\$\{[\w\W]*/gm),S2=ki(/^data-[\-\w.\u00B7-\uFFFF]+$/),b2=ki(/^aria-[\-\w]+$/),Sv=ki(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),C2=ki(/^(?:\w+script|data):/i),x2=ki(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bv=ki(/^html$/i),w2=ki(/^[a-z][.\w]*(-[.\w]+)+$/i);var op=Object.freeze({__proto__:null,ARIA_ATTR:b2,ATTR_WHITESPACE:x2,CUSTOM_ELEMENT:w2,DATA_ATTR:S2,DOCTYPE_NAME:bv,ERB_EXPR:g2,IS_ALLOWED_URI:Sv,IS_SCRIPT_OR_DATA:C2,MUSTACHE_EXPR:v2,TMPLIT_EXPR:y2});const ma={element:1,text:3,progressingInstruction:7,comment:8,document:9},E2=function(){return typeof window>"u"?null:window},T2=function(r,a){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let o=null;const g="data-tt-policy-suffix";a&&a.hasAttribute(g)&&(o=a.getAttribute(g));const w="dompurify"+(o?"#"+o:"");try{return r.createPolicy(w,{createHTML(T){return T},createScriptURL(T){return T}})}catch{return console.warn("TrustedTypes policy "+w+" could not be created."),null}},lp=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Cv(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E2();const r=Se=>Cv(Se);if(r.version="3.3.3",r.removed=[],!i||!i.document||i.document.nodeType!==ma.document||!i.Element)return r.isSupported=!1,r;let{document:a}=i;const o=a,g=o.currentScript,{DocumentFragment:w,HTMLTemplateElement:T,Node:c,Element:h,NodeFilter:u,NamedNodeMap:y=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:m,DOMParser:C,trustedTypes:x}=i,E=h.prototype,b=_a(E,"cloneNode"),d=_a(E,"remove"),p=_a(E,"nextSibling"),f=_a(E,"childNodes"),v=_a(E,"parentNode");if(typeof T=="function"){const Se=a.createElement("template");Se.content&&Se.content.ownerDocument&&(a=Se.content.ownerDocument)}let S,R="";const{implementation:D,createNodeIterator:M,createDocumentFragment:A,getElementsByTagName:B}=a,{importNode:$}=o;let I=lp();r.isSupported=typeof yv=="function"&&typeof v=="function"&&D&&D.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:q,ERB_EXPR:P,TMPLIT_EXPR:Q,DATA_ATTR:se,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:K,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:N}=op;let{IS_ALLOWED_URI:U}=op,L=null;const H=Me({},[...sp,...$u,...Fu,...Zu,...rp]);let X=null;const ne=Me({},[...np,...qu,...ap,...Vo]);let he=Object.seal(Qo(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),me=null,Y=null;const j=Object.seal(Qo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ce=!0,oe=!0,ve=!1,pe=!0,Te=!1,je=!0,Ue=!1,ct=!1,Ee=!1,Ft=!1,mi=!1,pi=!1,Ii=!0,Vi=!1;const Pt="user-content-";let nt=!0,Dt=!1,Zt={},Nt=null;const Bt=Me({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ki=null;const Kt=Me({},["audio","video","img","source","image","track"]);let Li=null;const Ye=Me({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vi="http://www.w3.org/1998/Math/MathML",kt="http://www.w3.org/2000/svg",Ot="http://www.w3.org/1999/xhtml";let gt=Ot,un=!1,hn=null;const Sl=Me({},[vi,kt,Ot],Iu);let Xi=Me({},["mi","mo","mn","ms","mtext"]),Ji=Me({},["annotation-xml"]);const gr=Me({},["title","style","font","a","script"]);let ai=null;const yr=["application/xhtml+xml","text/html"],Js="text/html";let _t=null,Qi=null;const fn=a.createElement("form"),bs=function(W){return W instanceof RegExp||W instanceof Function},dn=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Qi&&Qi===W)){if((!W||typeof W!="object")&&(W={}),W=Gi(W),ai=yr.indexOf(W.PARSER_MEDIA_TYPE)===-1?Js:W.PARSER_MEDIA_TYPE,_t=ai==="application/xhtml+xml"?Iu:el,L=_i(W,"ALLOWED_TAGS")?Me({},W.ALLOWED_TAGS,_t):H,X=_i(W,"ALLOWED_ATTR")?Me({},W.ALLOWED_ATTR,_t):ne,hn=_i(W,"ALLOWED_NAMESPACES")?Me({},W.ALLOWED_NAMESPACES,Iu):Sl,Li=_i(W,"ADD_URI_SAFE_ATTR")?Me(Gi(Ye),W.ADD_URI_SAFE_ATTR,_t):Ye,Ki=_i(W,"ADD_DATA_URI_TAGS")?Me(Gi(Kt),W.ADD_DATA_URI_TAGS,_t):Kt,Nt=_i(W,"FORBID_CONTENTS")?Me({},W.FORBID_CONTENTS,_t):Bt,me=_i(W,"FORBID_TAGS")?Me({},W.FORBID_TAGS,_t):Gi({}),Y=_i(W,"FORBID_ATTR")?Me({},W.FORBID_ATTR,_t):Gi({}),Zt=_i(W,"USE_PROFILES")?W.USE_PROFILES:!1,ce=W.ALLOW_ARIA_ATTR!==!1,oe=W.ALLOW_DATA_ATTR!==!1,ve=W.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=W.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Te=W.SAFE_FOR_TEMPLATES||!1,je=W.SAFE_FOR_XML!==!1,Ue=W.WHOLE_DOCUMENT||!1,Ft=W.RETURN_DOM||!1,mi=W.RETURN_DOM_FRAGMENT||!1,pi=W.RETURN_TRUSTED_TYPE||!1,Ee=W.FORCE_BODY||!1,Ii=W.SANITIZE_DOM!==!1,Vi=W.SANITIZE_NAMED_PROPS||!1,nt=W.KEEP_CONTENT!==!1,Dt=W.IN_PLACE||!1,U=W.ALLOWED_URI_REGEXP||Sv,gt=W.NAMESPACE||Ot,Xi=W.MATHML_TEXT_INTEGRATION_POINTS||Xi,Ji=W.HTML_INTEGRATION_POINTS||Ji,he=W.CUSTOM_ELEMENT_HANDLING||{},W.CUSTOM_ELEMENT_HANDLING&&bs(W.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(he.tagNameCheck=W.CUSTOM_ELEMENT_HANDLING.tagNameCheck),W.CUSTOM_ELEMENT_HANDLING&&bs(W.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(he.attributeNameCheck=W.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),W.CUSTOM_ELEMENT_HANDLING&&typeof W.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=W.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Te&&(oe=!1),mi&&(Ft=!0),Zt&&(L=Me({},rp),X=Qo(null),Zt.html===!0&&(Me(L,sp),Me(X,np)),Zt.svg===!0&&(Me(L,$u),Me(X,qu),Me(X,Vo)),Zt.svgFilters===!0&&(Me(L,Fu),Me(X,qu),Me(X,Vo)),Zt.mathMl===!0&&(Me(L,Zu),Me(X,ap),Me(X,Vo))),_i(W,"ADD_TAGS")||(j.tagCheck=null),_i(W,"ADD_ATTR")||(j.attributeCheck=null),W.ADD_TAGS&&(typeof W.ADD_TAGS=="function"?j.tagCheck=W.ADD_TAGS:(L===H&&(L=Gi(L)),Me(L,W.ADD_TAGS,_t))),W.ADD_ATTR&&(typeof W.ADD_ATTR=="function"?j.attributeCheck=W.ADD_ATTR:(X===ne&&(X=Gi(X)),Me(X,W.ADD_ATTR,_t))),W.ADD_URI_SAFE_ATTR&&Me(Li,W.ADD_URI_SAFE_ATTR,_t),W.FORBID_CONTENTS&&(Nt===Bt&&(Nt=Gi(Nt)),Me(Nt,W.FORBID_CONTENTS,_t)),W.ADD_FORBID_CONTENTS&&(Nt===Bt&&(Nt=Gi(Nt)),Me(Nt,W.ADD_FORBID_CONTENTS,_t)),nt&&(L["#text"]=!0),Ue&&Me(L,["html","head","body"]),L.table&&(Me(L,["tbody"]),delete me.tbody),W.TRUSTED_TYPES_POLICY){if(typeof W.TRUSTED_TYPES_POLICY.createHTML!="function")throw da('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof W.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw da('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=W.TRUSTED_TYPES_POLICY,R=S.createHTML("")}else S===void 0&&(S=T2(x,g)),S!==null&&typeof R=="string"&&(R=S.createHTML(""));Yt&&Yt(W),Qi=W}},_n=Me({},[...$u,...Fu,...m2]),mn=Me({},[...Zu,...p2]),Ea=function(W){let _e=v(W);(!_e||!_e.tagName)&&(_e={namespaceURI:gt,tagName:"template"});const ge=el(W.tagName),Ze=el(_e.tagName);return hn[W.namespaceURI]?W.namespaceURI===kt?_e.namespaceURI===Ot?ge==="svg":_e.namespaceURI===vi?ge==="svg"&&(Ze==="annotation-xml"||Xi[Ze]):!!_n[ge]:W.namespaceURI===vi?_e.namespaceURI===Ot?ge==="math":_e.namespaceURI===kt?ge==="math"&&Ji[Ze]:!!mn[ge]:W.namespaceURI===Ot?_e.namespaceURI===kt&&!Ji[Ze]||_e.namespaceURI===vi&&!Xi[Ze]?!1:!mn[ge]&&(gr[ge]||!_n[ge]):!!(ai==="application/xhtml+xml"&&hn[W.namespaceURI]):!1},Xt=function(W){ha(r.removed,{element:W});try{v(W).removeChild(W)}catch{d(W)}},Ni=function(W,_e){try{ha(r.removed,{attribute:_e.getAttributeNode(W),from:_e})}catch{ha(r.removed,{attribute:null,from:_e})}if(_e.removeAttribute(W),W==="is")if(Ft||mi)try{Xt(_e)}catch{}else try{_e.setAttribute(W,"")}catch{}},pn=function(W){let _e=null,ge=null;if(Ee)W="<remove></remove>"+W;else{const ke=Pu(W,/^[\r\n\t ]+/);ge=ke&&ke[0]}ai==="application/xhtml+xml"&>===Ot&&(W='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+W+"</body></html>");const Ze=S?S.createHTML(W):W;if(gt===Ot)try{_e=new C().parseFromString(Ze,ai)}catch{}if(!_e||!_e.documentElement){_e=D.createDocument(gt,"template",null);try{_e.documentElement.innerHTML=un?R:Ze}catch{}}const at=_e.body||_e.documentElement;return W&&ge&&at.insertBefore(a.createTextNode(ge),at.childNodes[0]||null),gt===Ot?B.call(_e,Ue?"html":"body")[0]:Ue?_e.documentElement:at},vn=function(W){return M.call(W.ownerDocument||W,W,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},gi=function(W){return W instanceof m&&(typeof W.nodeName!="string"||typeof W.textContent!="string"||typeof W.removeChild!="function"||!(W.attributes instanceof y)||typeof W.removeAttribute!="function"||typeof W.setAttribute!="function"||typeof W.namespaceURI!="string"||typeof W.insertBefore!="function"||typeof W.hasChildNodes!="function")},yt=function(W){return typeof c=="function"&&W instanceof c};function it(Se,W,_e){Yo(Se,ge=>{ge.call(r,W,_e,Qi)})}const es=function(W){let _e=null;if(it(I.beforeSanitizeElements,W,null),gi(W))return Xt(W),!0;const ge=_t(W.nodeName);if(it(I.uponSanitizeElement,W,{tagName:ge,allowedTags:L}),je&&W.hasChildNodes()&&!yt(W.firstElementChild)&&Gt(/<[/\w!]/g,W.innerHTML)&&Gt(/<[/\w!]/g,W.textContent)||W.nodeType===ma.progressingInstruction||je&&W.nodeType===ma.comment&&Gt(/<[/\w]/g,W.data))return Xt(W),!0;if(!(j.tagCheck instanceof Function&&j.tagCheck(ge))&&(!L[ge]||me[ge])){if(!me[ge]&&Ta(ge)&&(he.tagNameCheck instanceof RegExp&&Gt(he.tagNameCheck,ge)||he.tagNameCheck instanceof Function&&he.tagNameCheck(ge)))return!1;if(nt&&!Nt[ge]){const Ze=v(W)||W.parentNode,at=f(W)||W.childNodes;if(at&&Ze){const ke=at.length;for(let zt=ke-1;zt>=0;--zt){const yi=b(at[zt],!0);yi.__removalCount=(W.__removalCount||0)+1,Ze.insertBefore(yi,p(W))}}}return Xt(W),!0}return W instanceof h&&!Ea(W)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&Gt(/<\/no(script|embed|frames)/i,W.innerHTML)?(Xt(W),!0):(Te&&W.nodeType===ma.text&&(_e=W.textContent,Yo([q,P,Q],Ze=>{_e=fa(_e,Ze," ")}),W.textContent!==_e&&(ha(r.removed,{element:W.cloneNode()}),W.textContent=_e)),it(I.afterSanitizeElements,W,null),!1)},Sr=function(W,_e,ge){if(Y[_e]||Ii&&(_e==="id"||_e==="name")&&(ge in a||ge in fn))return!1;if(!(oe&&!Y[_e]&&Gt(se,_e))){if(!(ce&&Gt(G,_e))){if(!(j.attributeCheck instanceof Function&&j.attributeCheck(_e,W))){if(!X[_e]||Y[_e]){if(!(Ta(W)&&(he.tagNameCheck instanceof RegExp&&Gt(he.tagNameCheck,W)||he.tagNameCheck instanceof Function&&he.tagNameCheck(W))&&(he.attributeNameCheck instanceof RegExp&&Gt(he.attributeNameCheck,_e)||he.attributeNameCheck instanceof Function&&he.attributeNameCheck(_e,W))||_e==="is"&&he.allowCustomizedBuiltInElements&&(he.tagNameCheck instanceof RegExp&&Gt(he.tagNameCheck,ge)||he.tagNameCheck instanceof Function&&he.tagNameCheck(ge))))return!1}else if(!Li[_e]){if(!Gt(U,fa(ge,ee,""))){if(!((_e==="src"||_e==="xlink:href"||_e==="href")&&W!=="script"&&h2(ge,"data:")===0&&Ki[W])){if(!(ve&&!Gt(K,fa(ge,ee,"")))){if(ge)return!1}}}}}}}return!0},Ta=function(W){return W!=="annotation-xml"&&Pu(W,N)},Aa=function(W){it(I.beforeSanitizeAttributes,W,null);const{attributes:_e}=W;if(!_e||gi(W))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let Ze=_e.length;for(;Ze--;){const at=_e[Ze],{name:ke,namespaceURI:zt,value:yi}=at,Jt=_t(ke),Pi=yi;let At=ke==="value"?Pi:f2(Pi);if(ge.attrName=Jt,ge.attrValue=At,ge.keepAttr=!0,ge.forceKeepAttr=void 0,it(I.uponSanitizeAttribute,W,ge),At=ge.attrValue,Vi&&(Jt==="id"||Jt==="name")&&(Ni(ke,W),At=Pt+At),je&&Gt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,At)){Ni(ke,W);continue}if(Jt==="attributename"&&Pu(At,"href")){Ni(ke,W);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){Ni(ke,W);continue}if(!pe&&Gt(/\/>/i,At)){Ni(ke,W);continue}Te&&Yo([q,P,Q],yn=>{At=fa(At,yn," ")});const gn=_t(W.nodeName);if(!Sr(gn,Jt,At)){Ni(ke,W);continue}if(S&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!zt)switch(x.getAttributeType(gn,Jt)){case"TrustedHTML":{At=S.createHTML(At);break}case"TrustedScriptURL":{At=S.createScriptURL(At);break}}if(At!==Pi)try{zt?W.setAttributeNS(zt,ke,At):W.setAttribute(ke,At),gi(W)?Xt(W):ip(r.removed)}catch{Ni(ke,W)}}it(I.afterSanitizeAttributes,W,null)},Ra=function Se(W){let _e=null;const ge=vn(W);for(it(I.beforeSanitizeShadowDOM,W,null);_e=ge.nextNode();)it(I.uponSanitizeShadowNode,_e,null),es(_e),Aa(_e),_e.content instanceof w&&Se(_e.content);it(I.afterSanitizeShadowDOM,W,null)};return r.sanitize=function(Se){let W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=null,ge=null,Ze=null,at=null;if(un=!Se,un&&(Se="<!-->"),typeof Se!="string"&&!yt(Se))if(typeof Se.toString=="function"){if(Se=Se.toString(),typeof Se!="string")throw da("dirty is not a string, aborting")}else throw da("toString is not a function");if(!r.isSupported)return Se;if(ct||dn(W),r.removed=[],typeof Se=="string"&&(Dt=!1),Dt){if(Se.nodeName){const yi=_t(Se.nodeName);if(!L[yi]||me[yi])throw da("root node is forbidden and cannot be sanitized in-place")}}else if(Se instanceof c)_e=pn("<!---->"),ge=_e.ownerDocument.importNode(Se,!0),ge.nodeType===ma.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?_e=ge:_e.appendChild(ge);else{if(!Ft&&!Te&&!Ue&&Se.indexOf("<")===-1)return S&&pi?S.createHTML(Se):Se;if(_e=pn(Se),!_e)return Ft?null:pi?R:""}_e&&Ee&&Xt(_e.firstChild);const ke=vn(Dt?Se:_e);for(;Ze=ke.nextNode();)es(Ze),Aa(Ze),Ze.content instanceof w&&Ra(Ze.content);if(Dt)return Se;if(Ft){if(mi)for(at=A.call(_e.ownerDocument);_e.firstChild;)at.appendChild(_e.firstChild);else at=_e;return(X.shadowroot||X.shadowrootmode)&&(at=$.call(o,at,!0)),at}let zt=Ue?_e.outerHTML:_e.innerHTML;return Ue&&L["!doctype"]&&_e.ownerDocument&&_e.ownerDocument.doctype&&_e.ownerDocument.doctype.name&&Gt(bv,_e.ownerDocument.doctype.name)&&(zt="<!DOCTYPE "+_e.ownerDocument.doctype.name+`>
|
|
254
|
-
`+zt),Te&&Yo([q,P,Q],yi=>{zt=fa(zt,yi," ")}),S&&pi?S.createHTML(zt):zt},r.setConfig=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dn(Se),ct=!0},r.clearConfig=function(){Qi=null,ct=!1},r.isValidAttribute=function(Se,W,_e){Qi||dn({});const ge=_t(Se),Ze=_t(W);return Sr(ge,Ze,_e)},r.addHook=function(Se,W){typeof W=="function"&&ha(I[Se],W)},r.removeHook=function(Se,W){if(W!==void 0){const _e=c2(I[Se],W);return _e===-1?void 0:u2(I[Se],_e,1)[0]}return ip(I[Se])},r.removeHooks=function(Se){I[Se]=[]},r.removeAllHooks=function(){I=lp()},r}var A2=Cv();function wa(i){return A2.sanitize(i,{ALLOWED_TAGS:[]})}const R2={Read:"📖",Edit:"✏️",Write:"📝",Bash:"💻",Search:"🔍"};function D2(i){return i?R2[i]??"❓":"❓"}function k2(i){if(!i)return"";try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function Gu({entry:i}){const r=i.role==="user";return O.jsx("div",{className:`flex ${r?"justify-end":"justify-start"} mb-3`,children:O.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2.5 text-sm leading-relaxed ${r?"bg-[#1a1a3e] text-[#e0e0e0] rounded-br-sm":"bg-[#111118] text-[#e0e0e0] rounded-bl-sm border border-[#1a1a2e]"}`,children:[O.jsx("div",{className:"whitespace-pre-wrap break-words",children:wa(i.text)}),i.timestamp&&O.jsx("div",{className:`text-[10px] mt-1 ${r?"text-[#555]":"text-[#444]"}`,children:k2(i.timestamp)})]})})}function O2({entry:i}){const[r,a]=F.useState(!1);return O.jsx("div",{className:"flex justify-start mb-3",children:O.jsxs("div",{className:"max-w-[80%] w-full",children:[O.jsxs("button",{onClick:()=>a(o=>!o),className:"flex items-center gap-2 text-xs text-[#555] hover:text-[#777] transition-colors py-1 group",children:[O.jsx("span",{className:"inline-block transition-transform duration-200",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),O.jsx("span",{className:"italic",children:"Thinking…"})]}),r&&O.jsx("div",{className:"bg-[#0d0d12] border border-[#1a1a2e] rounded-lg px-4 py-3 mt-1 text-sm text-[#555] italic leading-relaxed whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:wa(i.text)})]})})}function M2({entry:i}){const r=wa(i.text),a=r.length>100?r.slice(0,100)+"…":r;return O.jsx("div",{className:"flex justify-start mb-3",children:O.jsxs("div",{className:"max-w-[80%] w-full bg-[#0d0d12] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[O.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-[#1a1a2e]",children:[O.jsx("span",{className:"text-base",children:D2(i.toolName)}),O.jsx("span",{className:"text-xs font-semibold text-[#00e5ff] font-mono",children:i.toolName??"Tool"}),O.jsx("span",{className:"text-[10px] text-[#555] ml-auto",children:"tool_use"})]}),O.jsx("div",{className:"px-3 py-2 text-xs text-[#888] font-mono whitespace-pre-wrap break-all max-h-32 overflow-y-auto",children:a})]})})}function L2({entry:i}){const r=i.text.toLowerCase().startsWith("error");return O.jsx("div",{className:"flex justify-start mb-3",children:O.jsxs("div",{className:`max-w-[80%] w-full bg-[#0d0d12] rounded-lg overflow-hidden ${r?"border border-[#ff3366]/40":"border border-[#00ff88]/30"}`,children:[O.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-[#1a1a2e]",children:[O.jsx("span",{className:"text-xs font-semibold text-[#888]",children:r?"✗ Result":"✓ Result"}),i.toolName&&O.jsx("span",{className:"text-[10px] text-[#555] font-mono",children:i.toolName})]}),O.jsx("div",{className:"px-3 py-2 text-xs text-[#666] font-mono whitespace-pre-wrap break-all max-h-32 overflow-y-auto",children:wa(i.text)||"(empty)"})]})})}function N2({entry:i}){if(i.role==="user")return O.jsx(Gu,{entry:i});switch(i.contentType){case"text":return O.jsx(Gu,{entry:i});case"thinking":return O.jsx(O2,{entry:i});case"tool_use":return O.jsx(M2,{entry:i});case"tool_result":return O.jsx(L2,{entry:i});case"permission_request":return O.jsxs("div",{className:"text-red-400 text-sm font-semibold px-3 py-2",children:["Permission Request: ",wa(i.text)]});default:return O.jsx(Gu,{entry:i})}}const Ko=1e3;function Wu(i){return`${i.timestamp??""}:${i.role}:${i.contentType}:${i.text.length}:${i.text.slice(0,80)}`}function B2({sessionId:i}){const[r,a]=F.useState([]),[o,g]=F.useState(!0),[
|
|
255
|
-
`)))),this.register(this._terminal.onA11yTab((D=>this._handleTab(D)))),this.register(this._terminal.onKey((D=>this._handleKey(D.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,d.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,
|
|
256
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=m.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(f){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(f)||this._charsToConsume.push(f)}_refreshRows(f,v){this._liveRegionDebouncer.refresh(f,v,this._terminal.rows)}_renderRows(f,v){const S=this._terminal.buffer,R=S.lines.length.toString();for(let D=f;D<=v;D++){const M=S.lines.get(S.ydisp+D),A=[],B=(M==null?void 0:M.translateToString(!0,void 0,void 0,A))||"",$=(S.ydisp+D+1).toString(),I=this._rowElements[D];I&&(B.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=B,this._rowColumns.set(I,A)),I.setAttribute("aria-posinset",$),I.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,v){const S=f.target,R=this._rowElements[v===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==R)return;let D,M;if(v===0?(D=S,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(D=this._rowElements.shift(),M=S,this._rowContainer.removeChild(D)),D.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),v===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(v===0?-1:1),this._rowElements[v===0?1:this._rowElements.length-2].focus(),f.preventDefault(),f.stopImmediatePropagation()}_handleSelectionChange(){var B;if(this._rowElements.length===0)return;const f=document.getSelection();if(!f)return;if(f.isCollapsed)return void(this._rowContainer.contains(f.anchorNode)&&this._terminal.clearSelection());if(!f.anchorNode||!f.focusNode)return void console.error("anchorNode and/or focusNode are null");let v={node:f.anchorNode,offset:f.anchorOffset},S={node:f.focusNode,offset:f.focusOffset};if((v.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===S.node&&v.offset>S.offset)&&([v,S]=[S,v]),v.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(v={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(v.node))return;const R=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:R,offset:((B=R.textContent)==null?void 0:B.length)??0}),!this._rowContainer.contains(S.node))return;const D=({node:$,offset:I})=>{const q=$ instanceof Text?$.parentNode:$;let P=parseInt(q==null?void 0:q.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const Q=this._rowColumns.get(q);if(!Q)return console.warn("columns is null. Race condition?"),null;let se=I<Q.length?Q[I]:Q.slice(-1)[0]+1;return se>=this._terminal.cols&&(++P,se=0),{row:P,column:se}},M=D(v),A=D(S);if(M&&A){if(M.row>A.row||M.row===A.row&&M.column>=A.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(A.row-M.row)*this._terminal.cols-M.column+A.column)}}_handleResize(f){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let v=this._rowContainer.children.length;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);for(;this._rowElements.length>f;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const f=this._coreBrowserService.mainDocument.createElement("div");return f.setAttribute("role","listitem"),f.tabIndex=-1,this._refreshRowDimensions(f),f}_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 f=0;f<this._terminal.rows;f++)this._refreshRowDimensions(this._rowElements[f])}}_refreshRowDimensions(f){f.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=p=u([y(1,b.IInstantiationService),y(2,E.ICoreBrowserService),y(3,E.IRenderService)],p)},3614:(T,c)=>{function h(C){return C.replace(/\r?\n/g,"\r")}function u(C,x){return x?"\x1B[200~"+C+"\x1B[201~":C}function y(C,x,E,b){C=u(C=h(C),E.decPrivateModes.bracketedPasteMode&&b.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(C,!0),x.value=""}function m(C,x,E){const b=E.getBoundingClientRect(),d=C.clientX-b.left-10,p=C.clientY-b.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${d}px`,x.style.top=`${p}px`,x.style.zIndex="1000",x.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(C,x){C.clipboardData&&C.clipboardData.setData("text/plain",x.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,x,E,b){C.stopPropagation(),C.clipboardData&&y(C.clipboardData.getData("text/plain"),x,E,b)},c.paste=y,c.moveTextAreaUnderMouseCursor=m,c.rightClickHandler=function(C,x,E,b,d){m(C,x,E),d&&b.rightClickSelect(C),x.value=b.selectionText,x.select()}},7239:(T,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,m,C){this._css.set(y,m,C)}getCss(y,m){return this._css.get(y,m)}setColor(y,m,C){this._color.set(y,m,C)}getColor(y,m){return this._color.get(y,m)}clear(){this._color.clear(),this._css.clear()}}},3656:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(h,u,y,m){h.addEventListener(u,y,m);let C=!1;return{dispose:()=>{C||(C=!0,h.removeEventListener(u,y,m))}}}},3551:function(T,c,h){var u=this&&this.__decorate||function(p,f,v,S){var R,D=arguments.length,M=D<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(p,f,v,S);else for(var A=p.length-1;A>=0;A--)(R=p[A])&&(M=(D<3?R(M):D>3?R(f,v,M):R(f,v))||M);return D>3&&M&&Object.defineProperty(f,v,M),M},y=this&&this.__param||function(p,f){return function(v,S){f(v,S,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const m=h(3656),C=h(8460),x=h(844),E=h(2585),b=h(4725);let d=c.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(p,f,v,S,R){super(),this._element=p,this._mouseService=f,this._renderService=v,this._bufferService=S,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new C.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new C.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{var D;this._lastMouseEvent=void 0,(D=this._activeProviderReplies)==null||D.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,m.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,m.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(p){this._lastMouseEvent=p;const f=this._positionFromMouseEvent(p,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const v=p.composedPath();for(let S=0;S<v.length;S++){const R=v[S];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(p){if(this._activeLine!==p.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(p,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,p)||(this._clearCurrentLink(),this._askForLink(p,!0))}_askForLink(p,f){var S,R;this._activeProviderReplies&&f||((S=this._activeProviderReplies)==null||S.forEach((D=>{D==null||D.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=p.y);let v=!1;for(const[D,M]of this._linkProviderService.linkProviders.entries())f?(R=this._activeProviderReplies)!=null&&R.get(D)&&(v=this._checkLinkProviderResult(D,p,v)):M.provideLinks(p.y,(A=>{var $,I;if(this._isMouseOut)return;const B=A==null?void 0:A.map((q=>({link:q})));($=this._activeProviderReplies)==null||$.set(D,B),v=this._checkLinkProviderResult(D,p,v),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)}))}_removeIntersectingLinks(p,f){const v=new Set;for(let S=0;S<f.size;S++){const R=f.get(S);if(R)for(let D=0;D<R.length;D++){const M=R[D],A=M.link.range.start.y<p?0:M.link.range.start.x,B=M.link.range.end.y>p?this._bufferService.cols:M.link.range.end.x;for(let $=A;$<=B;$++){if(v.has($)){R.splice(D--,1);break}v.add($)}}}}_checkLinkProviderResult(p,f,v){var D;if(!this._activeProviderReplies)return v;const S=this._activeProviderReplies.get(p);let R=!1;for(let M=0;M<p;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(R=!0);if(!R&&S){const M=S.find((A=>this._linkAtPosition(A.link,f)));M&&(v=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!v)for(let M=0;M<this._activeProviderReplies.size;M++){const A=(D=this._activeProviderReplies.get(M))==null?void 0:D.find((B=>this._linkAtPosition(B.link,f)));if(A){v=!0,this._handleNewLink(A);break}}return v}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(p){if(!this._currentLink)return;const f=this._positionFromMouseEvent(p,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(p,this._currentLink.link.text)}_clearCurrentLink(p,f){this._currentLink&&this._lastMouseEvent&&(!p||!f||this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(p){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(p.link,f)&&(this._currentLink=p,this._currentLink.state={decorations:{underline:p.link.decorations===void 0||p.link.decorations.underline,pointerCursor:p.link.decorations===void 0||p.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,p.link,this._lastMouseEvent),p.link.decorations={},Object.defineProperties(p.link.decorations,{pointerCursor:{get:()=>{var v,S;return(S=(v=this._currentLink)==null?void 0:v.state)==null?void 0:S.decorations.pointerCursor},set:v=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==v&&(this._currentLink.state.decorations.pointerCursor=v,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",v))}},underline:{get:()=>{var v,S;return(S=(v=this._currentLink)==null?void 0:v.state)==null?void 0:S.decorations.underline},set:v=>{var S,R,D;(S=this._currentLink)!=null&&S.state&&((D=(R=this._currentLink)==null?void 0:R.state)==null?void 0:D.decorations.underline)!==v&&(this._currentLink.state.decorations.underline=v,this._currentLink.state.isHovered&&this._fireUnderlineEvent(p.link,v))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((v=>{if(!this._currentLink)return;const S=v.start===0?0:v.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+v.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(S,R),this._lastMouseEvent)){const D=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);D&&this._askForLink(D,!1)}}))))}_linkHover(p,f,v){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&p.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(v,f.text)}_fireUnderlineEvent(p,f){const v=p.range,S=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(v.start.x-1,v.start.y-S-1,v.end.x,v.end.y-S-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(p,f,v){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&p.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(v,f.text)}_linkAtPosition(p,f){const v=p.range.start.y*this._bufferService.cols+p.range.start.x,S=p.range.end.y*this._bufferService.cols+p.range.end.x,R=f.y*this._bufferService.cols+f.x;return v<=R&&R<=S}_positionFromMouseEvent(p,f,v){const S=v.getCoords(p,f,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,f,v,S,R){return{x1:p,y1:f,x2:v,y2:S,cols:this._bufferService.cols,fg:R}}};c.Linkifier=d=u([y(1,b.IMouseService),y(2,b.IRenderService),y(3,E.IBufferService),y(4,b.ILinkProviderService)],d)},9042:(T,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(T,c,h){var u=this&&this.__decorate||function(b,d,p,f){var v,S=arguments.length,R=S<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,d,p,f);else for(var D=b.length-1;D>=0;D--)(v=b[D])&&(R=(S<3?v(R):S>3?v(d,p,R):v(d,p))||R);return S>3&&R&&Object.defineProperty(d,p,R),R},y=this&&this.__param||function(b,d){return function(p,f){d(p,f,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const m=h(511),C=h(2585);let x=c.OscLinkProvider=class{constructor(b,d,p){this._bufferService=b,this._optionsService=d,this._oscLinkService=p}provideLinks(b,d){var B;const p=this._bufferService.buffer.lines.get(b-1);if(!p)return void d(void 0);const f=[],v=this._optionsService.rawOptions.linkHandler,S=new m.CellData,R=p.getTrimmedLength();let D=-1,M=-1,A=!1;for(let $=0;$<R;$++)if(M!==-1||p.hasContent($)){if(p.loadCell($,S),S.hasExtendedAttrs()&&S.extended.urlId){if(M===-1){M=$,D=S.extended.urlId;continue}A=S.extended.urlId!==D}else M!==-1&&(A=!0);if(A||M!==-1&&$===R-1){const I=(B=this._oscLinkService.getLinkData(D))==null?void 0:B.uri;if(I){const q={start:{x:M+1,y:b},end:{x:$+(A||$!==R-1?0:1),y:b}};let P=!1;if(!(v!=null&&v.allowNonHttpProtocols))try{const Q=new URL(I);["http:","https:"].includes(Q.protocol)||(P=!0)}catch{P=!0}P||f.push({text:I,range:q,activate:(Q,se)=>v?v.activate(Q,se,q):E(0,se),hover:(Q,se)=>{var G;return(G=v==null?void 0:v.hover)==null?void 0:G.call(v,Q,se,q)},leave:(Q,se)=>{var G;return(G=v==null?void 0:v.leave)==null?void 0:G.call(v,Q,se,q)}})}A=!1,S.hasExtendedAttrs()&&S.extended.urlId?(M=$,D=S.extended.urlId):(M=-1,D=-1)}}d(f)}};function E(b,d){if(confirm(`Do you want to navigate to ${d}?
|
|
253
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of i.seen.entries()){const m=y[1];if(r===y[0]){x(y);continue}if(i.external){const w=(h=i.external.registry.get(y[0]))==null?void 0:h.id;if(r!==y[0]&&w){x(y);continue}}if((u=i.metadataRegistry.get(y[0]))==null?void 0:u.id){x(y);continue}if(m.cycle){x(y);continue}if(m.count>1&&i.reused==="ref"){x(y);continue}}}function ov(i,r){var T,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 m=y.def??y.schema,C={...m},w=y.ref;if(y.ref=null,w){o(w);const b=i.seen.get(w),d=b.schema;if(d.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(d)):Object.assign(m,d),Object.assign(m,C),u._zod.parent===w)for(const f in m)f==="$ref"||f==="allOf"||f in C||delete m[f];if(d.$ref&&b.def)for(const f in m)f==="$ref"||f==="allOf"||f in b.def&&JSON.stringify(m[f])===JSON.stringify(b.def[f])&&delete m[f]}const E=u._zod.parent;if(E&&E!==w){o(E);const b=i.seen.get(E);if(b!=null&&b.schema.$ref&&(m.$ref=b.schema.$ref,b.def))for(const d in m)d==="$ref"||d==="allOf"||d in b.def&&JSON.stringify(m[d])===JSON.stringify(b.def[d])&&delete m[d]}i.override({zodSchema:u,jsonSchema:m,path:y.path??[]})};for(const u of[...i.seen.entries()].reverse())o(u[0]);const g={};if(i.target==="draft-2020-12"?g.$schema="https://json-schema.org/draft/2020-12/schema":i.target==="draft-07"?g.$schema="http://json-schema.org/draft-07/schema#":i.target==="draft-04"?g.$schema="http://json-schema.org/draft-04/schema#":i.target,(T=i.external)!=null&&T.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");g.$id=i.external.uri(u)}Object.assign(g,a.def??a.schema);const x=((h=i.external)==null?void 0:h.defs)??{};for(const u of i.seen.entries()){const y=u[1];y.def&&y.defId&&(x[y.defId]=y.def)}i.external||Object.keys(x).length>0&&(i.target==="draft-2020-12"?g.$defs=x:g.definitions=x);try{const u=JSON.parse(JSON.stringify(g));return Object.defineProperty(u,"~standard",{value:{...r["~standard"],jsonSchema:{input:nl(r,"input",i.processors),output:nl(r,"output",i.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Wt(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 Wt(o.element,a);if(o.type==="set")return Wt(o.valueType,a);if(o.type==="lazy")return Wt(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 Wt(o.innerType,a);if(o.type==="intersection")return Wt(o.left,a)||Wt(o.right,a);if(o.type==="record"||o.type==="map")return Wt(o.keyType,a)||Wt(o.valueType,a);if(o.type==="pipe")return Wt(o.in,a)||Wt(o.out,a);if(o.type==="object"){for(const g in o.shape)if(Wt(o.shape[g],a))return!0;return!1}if(o.type==="union"){for(const g of o.options)if(Wt(g,a))return!0;return!1}if(o.type==="tuple"){for(const g of o.items)if(Wt(g,a))return!0;return!!(o.rest&&Wt(o.rest,a))}return!1}const vx=(i,r={})=>a=>{const o=nv({...a,processors:r});return Tt(i,o),av(o,i),ov(o,i)},nl=(i,r,a={})=>o=>{const{libraryOptions:g,target:x}=o??{},T=nv({...g??{},target:x,io:r,processors:a});return Tt(i,T),av(T,i),ov(T,i)},gx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},yx=(i,r,a,o)=>{const g=a;g.type="string";const{minimum:x,maximum:T,format:c,patterns:h,contentEncoding:u}=i._zod.bag;if(typeof x=="number"&&(g.minLength=x),typeof T=="number"&&(g.maxLength=T),c&&(g.format=gx[c]??c,g.format===""&&delete g.format,c==="time"&&delete g.format),u&&(g.contentEncoding=u),h&&h.size>0){const y=[...h];y.length===1?g.pattern=y[0].source:y.length>1&&(g.allOf=[...y.map(m=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},Sx=(i,r,a,o)=>{const g=a,{minimum:x,maximum:T,format:c,multipleOf:h,exclusiveMaximum:u,exclusiveMinimum:y}=i._zod.bag;typeof c=="string"&&c.includes("int")?g.type="integer":g.type="number",typeof y=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(g.minimum=y,g.exclusiveMinimum=!0):g.exclusiveMinimum=y),typeof x=="number"&&(g.minimum=x,typeof y=="number"&&r.target!=="draft-04"&&(y>=x?delete g.minimum:delete g.exclusiveMinimum)),typeof u=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(g.maximum=u,g.exclusiveMaximum=!0):g.exclusiveMaximum=u),typeof T=="number"&&(g.maximum=T,typeof u=="number"&&r.target!=="draft-04"&&(u<=T?delete g.maximum:delete g.exclusiveMaximum)),typeof h=="number"&&(g.multipleOf=h)},bx=(i,r,a,o)=>{a.type="boolean"},Cx=(i,r,a,o)=>{a.not={}},xx=(i,r,a,o)=>{},wx=(i,r,a,o)=>{const g=i._zod.def,x=Up(g.entries);x.every(T=>typeof T=="number")&&(a.type="number"),x.every(T=>typeof T=="string")&&(a.type="string"),a.enum=x},Ex=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Tx=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Ax=(i,r,a,o)=>{const g=a,x=i._zod.def,{minimum:T,maximum:c}=i._zod.bag;typeof T=="number"&&(g.minItems=T),typeof c=="number"&&(g.maxItems=c),g.type="array",g.items=Tt(x.element,r,{...o,path:[...o.path,"items"]})},Rx=(i,r,a,o)=>{var u;const g=a,x=i._zod.def;g.type="object",g.properties={};const T=x.shape;for(const y in T)g.properties[y]=Tt(T[y],r,{...o,path:[...o.path,"properties",y]});const c=new Set(Object.keys(T)),h=new Set([...c].filter(y=>{const m=x.shape[y]._zod;return r.io==="input"?m.optin===void 0:m.optout===void 0}));h.size>0&&(g.required=Array.from(h)),((u=x.catchall)==null?void 0:u._zod.def.type)==="never"?g.additionalProperties=!1:x.catchall?x.catchall&&(g.additionalProperties=Tt(x.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(g.additionalProperties=!1)},Dx=(i,r,a,o)=>{const g=i._zod.def,x=g.inclusive===!1,T=g.options.map((c,h)=>Tt(c,r,{...o,path:[...o.path,x?"oneOf":"anyOf",h]}));x?a.oneOf=T:a.anyOf=T},kx=(i,r,a,o)=>{const g=i._zod.def,x=Tt(g.left,r,{...o,path:[...o.path,"allOf",0]}),T=Tt(g.right,r,{...o,path:[...o.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,h=[...c(x)?x.allOf:[x],...c(T)?T.allOf:[T]];a.allOf=h},Ox=(i,r,a,o)=>{const g=a,x=i._zod.def;g.type="object";const T=x.keyType,c=T._zod.bag,h=c==null?void 0:c.patterns;if(x.mode==="loose"&&h&&h.size>0){const y=Tt(x.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});g.patternProperties={};for(const m of h)g.patternProperties[m.source]=y}else(r.target==="draft-07"||r.target==="draft-2020-12")&&(g.propertyNames=Tt(x.keyType,r,{...o,path:[...o.path,"propertyNames"]})),g.additionalProperties=Tt(x.valueType,r,{...o,path:[...o.path,"additionalProperties"]});const u=T._zod.values;if(u){const y=[...u].filter(m=>typeof m=="string"||typeof m=="number");y.length>0&&(g.required=y)}},Mx=(i,r,a,o)=>{const g=i._zod.def,x=Tt(g.innerType,r,o),T=r.seen.get(i);r.target==="openapi-3.0"?(T.ref=g.innerType,a.nullable=!0):a.anyOf=[x,{type:"null"}]},Lx=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const x=r.seen.get(i);x.ref=g.innerType},Nx=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const x=r.seen.get(i);x.ref=g.innerType,a.default=JSON.parse(JSON.stringify(g.defaultValue))},Bx=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const x=r.seen.get(i);x.ref=g.innerType,r.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(g.defaultValue)))},zx=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const x=r.seen.get(i);x.ref=g.innerType;let T;try{T=g.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=T},jx=(i,r,a,o)=>{const g=i._zod.def,x=r.io==="input"?g.in._zod.def.type==="transform"?g.out:g.in:g.out;Tt(x,r,o);const T=r.seen.get(i);T.ref=x},Hx=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const x=r.seen.get(i);x.ref=g.innerType,a.readOnly=!0},lv=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const x=r.seen.get(i);x.ref=g.innerType},Ux=fe("ZodISODateTime",(i,r)=>{$1.init(i,r),lt.init(i,r)});function Ix(i){return WC(Ux,i)}const Px=fe("ZodISODate",(i,r)=>{F1.init(i,r),lt.init(i,r)});function $x(i){return YC(Px,i)}const Fx=fe("ZodISOTime",(i,r)=>{Z1.init(i,r),lt.init(i,r)});function Zx(i){return VC(Fx,i)}const qx=fe("ZodISODuration",(i,r)=>{q1.init(i,r),lt.init(i,r)});function Gx(i){return KC(qx,i)}const Wx=(i,r)=>{Fp.init(i,r),i.name="ZodError",Object.defineProperties(i,{format:{value:a=>Bb(i,a)},flatten:{value:a=>Nb(i,a)},addIssue:{value:a=>{i.issues.push(a),i.message=JSON.stringify(i.issues,Qu,2)}},addIssues:{value:a=>{i.issues.push(...a),i.message=JSON.stringify(i.issues,Qu,2)}},isEmpty:{get(){return i.issues.length===0}}})},Mi=fe("ZodError",Wx,{Parent:Error}),Yx=mh(Mi),Vx=ph(Mi),Kx=ml(Mi),Xx=pl(Mi),Jx=Hb(Mi),Qx=Ub(Mi),ew=Ib(Mi),tw=Pb(Mi),iw=$b(Mi),sw=Fb(Mi),rw=Zb(Mi),nw=qb(Mi),dt=fe("ZodType",(i,r)=>(ft.init(i,r),Object.assign(i["~standard"],{jsonSchema:{input:nl(i,"input"),output:nl(i,"output")}}),i.toJSONSchema=vx(i,{}),i.def=r,i.type=r.type,Object.defineProperty(i,"_def",{value:r}),i.check=(...a)=>i.clone(Vs(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)=>Ks(i,a,o),i.brand=()=>i,i.register=((a,o)=>(a.add(i,o),i)),i.parse=(a,o)=>Yx(i,a,o,{callee:i.parse}),i.safeParse=(a,o)=>Kx(i,a,o),i.parseAsync=async(a,o)=>Vx(i,a,o,{callee:i.parseAsync}),i.safeParseAsync=async(a,o)=>Xx(i,a,o),i.spa=i.safeParseAsync,i.encode=(a,o)=>Jx(i,a,o),i.decode=(a,o)=>Qx(i,a,o),i.encodeAsync=async(a,o)=>ew(i,a,o),i.decodeAsync=async(a,o)=>tw(i,a,o),i.safeEncode=(a,o)=>iw(i,a,o),i.safeDecode=(a,o)=>sw(i,a,o),i.safeEncodeAsync=async(a,o)=>rw(i,a,o),i.safeDecodeAsync=async(a,o)=>nw(i,a,o),i.refine=(a,o)=>i.check(Jw(a,o)),i.superRefine=a=>i.check(Qw(a)),i.overwrite=a=>i.check(cn(a)),i.optional=()=>Gm(i),i.exactOptional=()=>Uw(i),i.nullable=()=>Wm(i),i.nullish=()=>Gm(Wm(i)),i.nonoptional=a=>qw(i,a),i.array=()=>gl(i),i.or=a=>Mw([i,a]),i.and=a=>Nw(i,a),i.transform=a=>Ym(i,jw(a)),i.default=a=>$w(i,a),i.prefault=a=>Zw(i,a),i.catch=a=>Ww(i,a),i.pipe=a=>Ym(i,a),i.readonly=()=>Kw(i),i.describe=a=>{const o=i.clone();return ga.add(o,{description:a}),o},Object.defineProperty(i,"description",{get(){var a;return(a=ga.get(i))==null?void 0:a.description},configurable:!0}),i.meta=(...a)=>{if(a.length===0)return ga.get(i);const o=i.clone();return ga.add(o,a[0]),o},i.isOptional=()=>i.safeParse(void 0).success,i.isNullable=()=>i.safeParse(null).success,i.apply=a=>a(i),i)),cv=fe("_ZodString",(i,r)=>{vh.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(o,g,x)=>yx(i,o,g);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(ix(...o)),i.includes=(...o)=>i.check(nx(...o)),i.startsWith=(...o)=>i.check(ax(...o)),i.endsWith=(...o)=>i.check(ox(...o)),i.min=(...o)=>i.check(rl(...o)),i.max=(...o)=>i.check(sv(...o)),i.length=(...o)=>i.check(rv(...o)),i.nonempty=(...o)=>i.check(rl(1,...o)),i.lowercase=o=>i.check(sx(o)),i.uppercase=o=>i.check(rx(o)),i.trim=()=>i.check(cx()),i.normalize=(...o)=>i.check(lx(...o)),i.toLowerCase=()=>i.check(ux()),i.toUpperCase=()=>i.check(hx()),i.slugify=()=>i.check(fx())}),aw=fe("ZodString",(i,r)=>{vh.init(i,r),cv.init(i,r),i.email=a=>i.check(TC(ow,a)),i.url=a=>i.check(OC(lw,a)),i.jwt=a=>i.check(GC(xw,a)),i.emoji=a=>i.check(MC(cw,a)),i.guid=a=>i.check(Im(Zm,a)),i.uuid=a=>i.check(AC(Go,a)),i.uuidv4=a=>i.check(RC(Go,a)),i.uuidv6=a=>i.check(DC(Go,a)),i.uuidv7=a=>i.check(kC(Go,a)),i.nanoid=a=>i.check(LC(uw,a)),i.guid=a=>i.check(Im(Zm,a)),i.cuid=a=>i.check(NC(hw,a)),i.cuid2=a=>i.check(BC(fw,a)),i.ulid=a=>i.check(zC(dw,a)),i.base64=a=>i.check(FC(Sw,a)),i.base64url=a=>i.check(ZC(bw,a)),i.xid=a=>i.check(jC(_w,a)),i.ksuid=a=>i.check(HC(mw,a)),i.ipv4=a=>i.check(UC(pw,a)),i.ipv6=a=>i.check(IC(vw,a)),i.cidrv4=a=>i.check(PC(gw,a)),i.cidrv6=a=>i.check($C(yw,a)),i.e164=a=>i.check(qC(Cw,a)),i.datetime=a=>i.check(Ix(a)),i.date=a=>i.check($x(a)),i.time=a=>i.check(Zx(a)),i.duration=a=>i.check(Gx(a))});function Ie(i){return EC(aw,i)}const lt=fe("ZodStringFormat",(i,r)=>{rt.init(i,r),cv.init(i,r)}),ow=fe("ZodEmail",(i,r)=>{L1.init(i,r),lt.init(i,r)}),Zm=fe("ZodGUID",(i,r)=>{O1.init(i,r),lt.init(i,r)}),Go=fe("ZodUUID",(i,r)=>{M1.init(i,r),lt.init(i,r)}),lw=fe("ZodURL",(i,r)=>{N1.init(i,r),lt.init(i,r)}),cw=fe("ZodEmoji",(i,r)=>{B1.init(i,r),lt.init(i,r)}),uw=fe("ZodNanoID",(i,r)=>{z1.init(i,r),lt.init(i,r)}),hw=fe("ZodCUID",(i,r)=>{j1.init(i,r),lt.init(i,r)}),fw=fe("ZodCUID2",(i,r)=>{H1.init(i,r),lt.init(i,r)}),dw=fe("ZodULID",(i,r)=>{U1.init(i,r),lt.init(i,r)}),_w=fe("ZodXID",(i,r)=>{I1.init(i,r),lt.init(i,r)}),mw=fe("ZodKSUID",(i,r)=>{P1.init(i,r),lt.init(i,r)}),pw=fe("ZodIPv4",(i,r)=>{G1.init(i,r),lt.init(i,r)}),vw=fe("ZodIPv6",(i,r)=>{W1.init(i,r),lt.init(i,r)}),gw=fe("ZodCIDRv4",(i,r)=>{Y1.init(i,r),lt.init(i,r)}),yw=fe("ZodCIDRv6",(i,r)=>{V1.init(i,r),lt.init(i,r)}),Sw=fe("ZodBase64",(i,r)=>{K1.init(i,r),lt.init(i,r)}),bw=fe("ZodBase64URL",(i,r)=>{J1.init(i,r),lt.init(i,r)}),Cw=fe("ZodE164",(i,r)=>{Q1.init(i,r),lt.init(i,r)}),xw=fe("ZodJWT",(i,r)=>{tC.init(i,r),lt.init(i,r)}),uv=fe("ZodNumber",(i,r)=>{Qp.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(o,g,x)=>Sx(i,o,g),i.gt=(o,g)=>i.check($m(o,g)),i.gte=(o,g)=>i.check(Hu(o,g)),i.min=(o,g)=>i.check(Hu(o,g)),i.lt=(o,g)=>i.check(Pm(o,g)),i.lte=(o,g)=>i.check(ju(o,g)),i.max=(o,g)=>i.check(ju(o,g)),i.int=o=>i.check(qm(o)),i.safe=o=>i.check(qm(o)),i.positive=o=>i.check($m(0,o)),i.nonnegative=o=>i.check(Hu(0,o)),i.negative=o=>i.check(Pm(0,o)),i.nonpositive=o=>i.check(ju(0,o)),i.multipleOf=(o,g)=>i.check(Fm(o,g)),i.step=(o,g)=>i.check(Fm(o,g)),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 Oe(i){return XC(uv,i)}const ww=fe("ZodNumberFormat",(i,r)=>{iC.init(i,r),uv.init(i,r)});function qm(i){return JC(ww,i)}const Ew=fe("ZodBoolean",(i,r)=>{sC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>bx(i,a,o)});function ys(i){return QC(Ew,i)}const Tw=fe("ZodUnknown",(i,r)=>{rC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>xx()});function al(){return ex(Tw)}const Aw=fe("ZodNever",(i,r)=>{nC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Cx(i,a,o)});function Rw(i){return tx(Aw,i)}const Dw=fe("ZodArray",(i,r)=>{aC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Ax(i,a,o,g),i.element=r.element,i.min=(a,o)=>i.check(rl(a,o)),i.nonempty=a=>i.check(rl(1,a)),i.max=(a,o)=>i.check(sv(a,o)),i.length=(a,o)=>i.check(rv(a,o)),i.unwrap=()=>i.element});function gl(i,r){return dx(Dw,i,r)}const kw=fe("ZodObject",(i,r)=>{lC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Rx(i,a,o,g),We(i,"shape",()=>r.shape),i.keyof=()=>an(Object.keys(i._zod.def.shape)),i.catchall=a=>i.clone({...i._zod.def,catchall:a}),i.passthrough=()=>i.clone({...i._zod.def,catchall:al()}),i.loose=()=>i.clone({...i._zod.def,catchall:al()}),i.strict=()=>i.clone({...i._zod.def,catchall:Rw()}),i.strip=()=>i.clone({...i._zod.def,catchall:void 0}),i.extend=a=>Db(i,a),i.safeExtend=a=>kb(i,a),i.merge=a=>Ob(i,a),i.pick=a=>Ab(i,a),i.omit=a=>Rb(i,a),i.partial=(...a)=>Mb(hv,i,a[0]),i.required=(...a)=>Lb(fv,i,a[0])});function Lt(i,r){const a={type:"object",shape:i??{},...xe(r)};return new kw(a)}const Ow=fe("ZodUnion",(i,r)=>{cC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Dx(i,a,o,g),i.options=r.options});function Mw(i,r){return new Ow({type:"union",options:i,...xe(r)})}const Lw=fe("ZodIntersection",(i,r)=>{uC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>kx(i,a,o,g)});function Nw(i,r){return new Lw({type:"intersection",left:i,right:r})}const Bw=fe("ZodRecord",(i,r)=>{hC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Ox(i,a,o,g),i.keyType=r.keyType,i.valueType=r.valueType});function yl(i,r,a){return new Bw({type:"record",keyType:i,valueType:r,...xe(a)})}const th=fe("ZodEnum",(i,r)=>{fC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(o,g,x)=>wx(i,o,g),i.enum=r.entries,i.options=Object.values(r.entries);const a=new Set(Object.keys(r.entries));i.extract=(o,g)=>{const x={};for(const T of o)if(a.has(T))x[T]=r.entries[T];else throw new Error(`Key ${T} not found in enum`);return new th({...r,checks:[],...xe(g),entries:x})},i.exclude=(o,g)=>{const x={...r.entries};for(const T of o)if(a.has(T))delete x[T];else throw new Error(`Key ${T} not found in enum`);return new th({...r,checks:[],...xe(g),entries:x})}});function an(i,r){const a=Array.isArray(i)?Object.fromEntries(i.map(o=>[o,o])):i;return new th({type:"enum",entries:a,...xe(r)})}const zw=fe("ZodTransform",(i,r)=>{dC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Tx(i,a),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new jp(i.constructor.name);a.addIssue=x=>{if(typeof x=="string")a.issues.push(Sa(x,a.value,r));else{const T=x;T.fatal&&(T.continue=!1),T.code??(T.code="custom"),T.input??(T.input=a.value),T.inst??(T.inst=i),a.issues.push(Sa(T))}};const g=r.transform(a.value,a);return g instanceof Promise?g.then(x=>(a.value=x,a)):(a.value=g,a)}});function jw(i){return new zw({type:"transform",transform:i})}const hv=fe("ZodOptional",(i,r)=>{iv.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>lv(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Gm(i){return new hv({type:"optional",innerType:i})}const Hw=fe("ZodExactOptional",(i,r)=>{_C.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>lv(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Uw(i){return new Hw({type:"optional",innerType:i})}const Iw=fe("ZodNullable",(i,r)=>{mC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Mx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Wm(i){return new Iw({type:"nullable",innerType:i})}const Pw=fe("ZodDefault",(i,r)=>{pC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Nx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function $w(i,r){return new Pw({type:"default",innerType:i,get defaultValue(){return typeof r=="function"?r():Pp(r)}})}const Fw=fe("ZodPrefault",(i,r)=>{vC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Bx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Zw(i,r){return new Fw({type:"prefault",innerType:i,get defaultValue(){return typeof r=="function"?r():Pp(r)}})}const fv=fe("ZodNonOptional",(i,r)=>{gC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Lx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function qw(i,r){return new fv({type:"nonoptional",innerType:i,...xe(r)})}const Gw=fe("ZodCatch",(i,r)=>{yC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>zx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function Ww(i,r){return new Gw({type:"catch",innerType:i,catchValue:typeof r=="function"?r:()=>r})}const Yw=fe("ZodPipe",(i,r)=>{SC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>jx(i,a,o,g),i.in=r.in,i.out=r.out});function Ym(i,r){return new Yw({type:"pipe",in:i,out:r})}const Vw=fe("ZodReadonly",(i,r)=>{bC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Hx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Kw(i){return new Vw({type:"readonly",innerType:i})}const Xw=fe("ZodCustom",(i,r)=>{CC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Ex(i,a)});function Jw(i,r={}){return _x(Xw,i,r)}function Qw(i){return mx(i)}const gh=an(["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"]),dv=Lt({ok:ys()}),eE=dv.extend({delivered:ys(),attempts:Oe()}),tE=Lt({status:Ie(),version:Ie(),uptime:Oe(),sessions:Lt({active:Oe(),total:Oe()}),timestamp:Ie()}),yh=Lt({id:Ie(),windowId:Ie(),windowName:Ie(),workDir:Ie(),claudeSessionId:Ie().optional(),jsonlPath:Ie().optional(),byteOffset:Oe(),monitorOffset:Oe(),status:gh,createdAt:Oe(),lastActivity:Oe(),stallThresholdMs:Oe(),permissionMode:Ie(),autoApprove:ys().optional(),settingsPatched:ys().optional(),promptDelivery:Lt({delivered:ys(),attempts:Oe()}).optional(),actionHints:yl(Ie(),Lt({method:Ie(),url:Ie(),description:Ie()})).optional()}),iE=Lt({sessions:gl(yh),pagination:Lt({page:Oe(),limit:Oe(),total:Oe(),totalPages:Oe()})}),sE=Lt({alive:ys(),windowExists:ys(),claudeRunning:ys(),paneCommand:Ie().nullable(),status:gh,hasTranscript:ys(),lastActivity:Oe(),lastActivityAgo:Oe(),sessionAge:Oe(),details:Ie(),actionHints:yl(Ie(),Lt({method:Ie(),url:Ie(),description:Ie()})).optional()}),rE=Lt({durationSec:Oe(),messages:Oe(),toolCalls:Oe(),approvals:Oe(),autoApprovals:Oe(),statusChanges:gl(Ie())}),nE=Lt({role:an(["user","assistant","system"]),contentType:an(["text","thinking","tool_use","tool_result","permission_request"]),text:Ie(),toolName:Ie().optional(),toolUseId:Ie().optional(),timestamp:Ie().optional()}),aE=Lt({messages:gl(nE),status:gh,statusText:Ie().nullable(),interactiveContent:Ie().nullable()}),oE=Lt({uptime:Oe(),sessions:Lt({total_created:Oe(),currently_active:Oe(),completed:Oe(),failed:Oe(),avg_duration_sec:Oe(),avg_messages_per_session:Oe()}),auto_approvals:Oe(),webhooks_sent:Oe(),webhooks_failed:Oe(),screenshots_taken:Oe(),pipelines_created:Oe(),batches_created:Oe(),prompt_delivery:Lt({sent:Oe(),delivered:Oe(),failed:Oe(),success_rate:Oe().nullable()})}),lE=an(["status","message","approval","ended","heartbeat","stall","dead","system","hook","subagent_start","subagent_stop"]),cE=Lt({event:lE,sessionId:Ie(),timestamp:Ie(),data:yl(Ie(),al()).optional()}),uE=an(["session_status_change","session_message","session_approval","session_ended","session_created","session_stall","session_dead","session_subagent_start","session_subagent_stop"]),hE=Lt({event:uE,sessionId:Ie(),timestamp:Ie(),data:yl(Ie(),al())}),fE=3e4,dE=300*1e3;class ol{constructor(r,a,o={}){wt(this,"eventSource",null);wt(this,"consecutiveFailures",0);wt(this,"failStartTime",null);wt(this,"destroyed",!1);wt(this,"gaveUp",!1);wt(this,"reconnectTimer",null);wt(this,"url");wt(this,"callbacks");wt(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,g,x,T,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>=dE){this.gaveUp||(this.gaveUp=!0,(g=(o=this.callbacks).onGiveUp)==null||g.call(o),(T=(x=this.callbacks).onClose)==null||T.call(x));return}this.consecutiveFailures++;const r=Math.min(fE,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 _E="";function mE(i){if(!i)return{};if(i instanceof Headers){const r={};return i.forEach((a,o)=>{r[o]=a}),r}return i}function pE(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(g=>g.message).join(", ")}`)}function vE(i){return!(i.name==="AbortError"||!i.message||i.message.includes("HTTP "))}async function vt(i,r={}){const a=localStorage.getItem("aegis_token"),o={"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...mE(r.headers)},{retries:g=0,schema:x,schemaContext:T,...c}=r;let h=null;for(let u=0;u<=g;u++)try{const y=await fetch(`${_E}${i}`,{...c,headers:o});if(!y.ok){const C=await y.json().catch(()=>({error:y.statusText})),w=new Error(C.error??`HTTP ${y.status}`);throw w.statusCode=y.status,w}const m=await y.json();return x?pE(m,x,T??i):m}catch(y){if(h=y,u<g&&vE(h))await new Promise(m=>setTimeout(m,1e3*Math.pow(2,u)));else throw h}throw h}function gE(){return vt("/v1/health",{schema:tE,schemaContext:"getHealth"})}function yE(){return vt("/v1/metrics",{schema:oE,schemaContext:"getMetrics"})}function SE(){return vt("/v1/sessions",{schema:iE,schemaContext:"getSessions"})}function bE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}`,{schema:yh,schemaContext:"getSession"})}function CE(i){const{signal:r,...a}=i;return vt("/v1/sessions",{method:"POST",body:JSON.stringify(a),signal:r,schema:yh,schemaContext:"createSession"})}function _v(i){return vt(`/v1/sessions/${encodeURIComponent(i)}`,{method:"DELETE",schema:dv,schemaContext:"killSession"})}function xE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/health`,{schema:sE,schemaContext:"getSessionHealth"})}function wE(){return vt("/v1/sessions/health")}function EE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/read`,{schema:aE,schemaContext:"getSessionMessages"})}function TE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/metrics`,{schema:rE,schemaContext:"getSessionMetrics"})}function AE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/pane`)}function RE(i,r){return vt(`/v1/sessions/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({text:r}),schema:eE,schemaContext:"sendMessage"})}function mv(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/approve`,{method:"POST"})}function DE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/reject`,{method:"POST"})}function pv(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/interrupt`,{method:"POST"})}function kE(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/escape`,{method:"POST"})}const Vm=3,OE=1e3;async function vv(i,r){for(let a=0;a<Vm;a++){if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");try{return await jE(r)}catch{if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");if(a<Vm-1){const o=OE*Math.pow(2,a);await new Promise(g=>{const x=setTimeout(g,o);r==null||r.addEventListener("abort",()=>{clearTimeout(x),g(void 0)},{once:!0})})}}}throw i==null||i(),new Error("Real-time updates unavailable")}function gv(i,r,a,o){const g=`/v1/sessions/${encodeURIComponent(i)}/events`;let x=null,T=!1;const c=new AbortController;return a?vv(o==null?void 0:o.onGiveUp,c.signal).then(h=>{if(T)return;const u=`${g}?token=${encodeURIComponent(h.token)}`;x=new ol(u,r,o)}).catch(()=>{}):x=new ol(g,r,o),()=>{T=!0,c.abort(),x==null||x.close()}}function ME(i,r,a){const o="/v1/events";let g=null,x=!1;const T=new AbortController,c=h=>{try{const u=hE.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?vv(a==null?void 0:a.onGiveUp,T.signal).then(h=>{if(x)return;const u=`${o}?token=${encodeURIComponent(h.token)}`;g=new ol(u,c,a)}).catch(()=>{}):g=new ol(o,c,a),()=>{var h;x=!0,T.abort(),(h=a==null?void 0:a.onClose)==null||h.call(a),g==null||g.close()}}function LE(i){const{signal:r,...a}=i;return vt("/v1/sessions/batch",{method:"POST",signal:r,body:JSON.stringify(a)})}function NE(i){return vt("/v1/pipelines",{method:"POST",body:JSON.stringify(i)})}function BE(){return vt("/v1/pipelines")}function zE(i){return vt(`/v1/pipelines/${encodeURIComponent(i)}`)}function jE(i){return vt("/v1/auth/sse-token",{method:"POST",signal:i})}const Wo=new Map;let HE=0;const Xs=zp(i=>({toasts:[],addToast:(r,a,o)=>{const g=`toast-${++HE}`,x=setTimeout(()=>{Wo.delete(g),i(T=>({toasts:T.toasts.filter(c=>c.id!==g)}))},4e3);return Wo.set(g,x),i(T=>({toasts:[...T.toasts,{id:g,type:r,title:a,description:o}]})),g},removeToast:r=>{const a=Wo.get(r);a&&(clearTimeout(a),Wo.delete(r)),i(o=>({toasts:o.toasts.filter(g=>g.id!==r)}))}})),UE={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 IE({id:i,type:r,title:a,description:o}){const g=Xs(x=>x.removeToast);return O.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 ${UE[r]}`,children:[O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("p",{className:"text-sm font-medium",children:a}),o&&O.jsx("p",{className:"mt-0.5 text-xs opacity-80",children:o})]}),O.jsx("button",{onClick:()=>g(i),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:O.jsx(dl,{className:"h-3.5 w-3.5"})})]})}function PE(){const i=Xs(r=>r.toasts);return i.length===0?null:O.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=>O.jsx("div",{className:"pointer-events-auto",children:O.jsx(IE,{id:r.id,type:r.type,title:r.title,description:r.description})},r.id))})}const $E=[{to:"/",label:"Overview",icon:PS},{to:"/pipelines",label:"Pipelines",icon:Lp}],FE=5,ZE=1e3;function qE(){const i=Et(u=>u.sseConnected),r=Et(u=>u.setSseConnected),a=Et(u=>u.sseError),o=Et(u=>u.setSseError),g=Et(u=>u.addActivity),x=Et(u=>u.token),T=F.useRef(null),[c,h]=F.useState(0);return F.useEffect(()=>{let u=!1,y,m=null;function C(w){if(!u)try{y=ME(E=>{E.sessionId&&g(E)},x,{onOpen:()=>{T.current&&(clearTimeout(T.current),T.current=null),r(!0),o(null),h(0)},onClose:()=>{T.current=setTimeout(()=>{r(!1)},2e3)},onGiveUp:()=>{o("SSE connection failed — real-time updates unavailable"),r(!1)}})}catch(E){if(console.error("Failed to subscribe to global SSE (attempt %d):",w+1,E),w<FE){const b=ZE*Math.pow(2,w);h(w+1),m=setTimeout(()=>C(w+1),b)}else o("SSE subscription failed after retries — real-time updates unavailable"),r(!1)}}return C(0),()=>{u=!0,T.current&&clearTimeout(T.current),m&&clearTimeout(m),y==null||y()}},[r,o,g,x]),O.jsxs("div",{className:"flex h-screen overflow-hidden bg-void",children:[O.jsxs("aside",{className:"flex w-56 flex-col border-r border-void-lighter bg-void-light shrink-0",children:[O.jsxs("div",{className:"flex items-center gap-2 px-4 py-5 border-b border-void-lighter",children:[O.jsx(rb,{className:"h-6 w-6 text-cyan glow-text-cyan"}),O.jsx("span",{className:"text-lg font-semibold tracking-tight text-gray-100",children:"Aegis"})]}),O.jsxs("nav",{className:"flex flex-col gap-1 px-2 py-4 flex-1",children:[$E.map(({to:u,label:y,icon:m})=>O.jsxs(kp,{to:u,end:u==="/",className:({isActive:C})=>`flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${C?"bg-cyan/10 text-cyan":"text-gray-400 hover:bg-void-lighter hover:text-gray-200"}`,children:[O.jsx(m,{className:"h-4 w-4"}),y]},u)),O.jsx("div",{className:"mt-4 border-t border-void-lighter pt-4 opacity-40",children:O.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 text-sm text-gray-500",children:[O.jsx(lb,{className:"h-4 w-4"}),"Sessions"]})})]})]}),O.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[O.jsxs("header",{className:"flex items-center justify-between border-b border-void-lighter bg-void-light px-6 py-3 shrink-0",children:[O.jsx("h1",{className:"text-sm font-medium text-gray-300",children:"Aegis Dashboard"}),O.jsx("div",{className:"flex items-center gap-3",children:O.jsx("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",title:a??void 0,children:a?O.jsxs(O.Fragment,{children:[O.jsx(Bp,{className:"h-3 w-3 text-amber-500"}),O.jsxs("span",{className:"text-amber-500",children:["SSE Error",c>0?` (retry ${c})`:""]})]}):O.jsxs(O.Fragment,{children:[O.jsx("span",{className:`status-dot ${i?"status-dot--idle":""}`,style:i?void 0:{backgroundColor:"#666"}}),i?"SSE Live":"SSE Off"]})})})]}),O.jsx("main",{className:"flex-1 overflow-auto p-6",children:O.jsx(Fy,{})})]}),O.jsx(PE,{})]})}function GE(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 sn(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 g=Math.floor(o/60);return g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`}function WE(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 g=Math.floor(a/60),x=a%60;return`${g}h ${x.toString().padStart(2,"0")}m`}function qs({label:i,value:r,icon:a,suffix:o}){return O.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[O.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm text-[#888]",children:[a,i]}),O.jsxs("div",{className:"font-mono text-2xl text-[#00e5ff]",children:[r,o&&O.jsx("span",{className:"ml-1 text-base text-[#666]",children:o})]})]})}function YE(){const i=Et(u=>u.metrics),r=Et(u=>u.setMetrics),[a,o]=F.useState(null),g=F.useCallback(async()=>{try{const[u,y]=await Promise.all([yE(),gE()]);r(u),o(y)}catch(u){Xs.getState().addToast("error","Failed to load metrics",u instanceof Error?u.message:void 0)}},[r,o]);F.useEffect(()=>{g();const u=setInterval(g,1e4);return()=>clearInterval(u)},[g]);const x=(i==null?void 0:i.sessions.currently_active)??(a==null?void 0:a.sessions.active)??0,T=(i==null?void 0:i.sessions.total_created)??(a==null?void 0:a.sessions.total)??0,c=i==null?void 0:i.prompt_delivery.success_rate,h=(a==null?void 0:a.uptime)??(i==null?void 0:i.uptime)??0;return O.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[O.jsx(qs,{label:"Active Sessions",value:x,icon:O.jsx(Lp,{className:"h-4 w-4"})}),O.jsx(qs,{label:"Total Created",value:T,icon:O.jsx(US,{className:"h-4 w-4"})}),O.jsx(qs,{label:"Delivery Rate",value:c!=null?c.toFixed(1):"—",suffix:"%",icon:O.jsx(vb,{className:"h-4 w-4"})}),O.jsx(qs,{label:"Uptime",value:GE(h),icon:O.jsx(BS,{className:"h-4 w-4"})})]})}const Km={idle:"#00ff88",working:"#00e5ff",permission_prompt:"#ffaa00",bash_approval:"#ffaa00",plan_mode:"#ff8800",ask_question:"#ff3366",settings:"#00e5ff",error:"#ff0000",compacting:"#ffaa00",context_warning:"#ffaa00",waiting_for_input:"#ffaa00",unknown:"#666666"},VE=new Set(["working","permission_prompt","bash_approval","ask_question"]);function ll({status:i}){const r=Km[i]??Km.unknown,a=VE.has(i);return O.jsx("span",{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}})}function KE(){const i=Et(E=>E.sessions),r=Et(E=>E.healthMap),a=Et(E=>E.setSessionsAndHealth),o=Xs(E=>E.addToast),[g,x]=F.useState({}),T=F.useCallback((E,b)=>g[E]===b,[g]),c=F.useCallback(async(E,b,d)=>{x(p=>({...p,[E]:b}));try{await d()}finally{x(p=>({...p,[E]:null}))}},[]),h=F.useCallback(async()=>{try{const E=await SE();let b={};try{const d=await wE(),p=new Set(E.sessions.map(f=>f.id));for(const[f,v]of Object.entries(d))p.has(f)&&(b[f]={alive:v.alive,loading:!1})}catch{}a(E.sessions,b)}catch(E){o("error","Failed to fetch sessions",E instanceof Error?E.message:void 0)}},[o,a]);F.useEffect(()=>{h();const E=setInterval(h,5e3);return()=>clearInterval(E)},[h]);const u=async(E,b)=>{E.preventDefault(),await c(b,"approve",async()=>{try{await mv(b)}catch(d){o("error","Approve failed",d instanceof Error?d.message:void 0)}})},y=async(E,b)=>{E.preventDefault(),await c(b,"interrupt",async()=>{try{await pv(b)}catch(d){o("error","Interrupt failed",d instanceof Error?d.message:void 0)}})},m=async(E,b)=>{E.preventDefault(),confirm("Kill this session?")&&await c(b,"kill",async()=>{try{await _v(b)}catch(d){o("error","Failed to kill session",d instanceof Error?d.message:void 0)}})};if(i.length===0)return O.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:O.jsx("p",{className:"text-gray-500",children:"No active sessions"})});const C=E=>E.status==="permission_prompt"||E.status==="bash_approval",w=(E,b=40)=>E.length>b?`…${E.slice(E.length-b+1)}`:E;return O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"md:hidden space-y-3",children:i.map(E=>{const b=r[E.id],d=b?b.alive:!0;return O.jsxs(Hi,{to:`/sessions/${encodeURIComponent(E.id)}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 active:bg-[#1a1a2e]/50 transition-colors",children:[O.jsxs("div",{className:"flex items-center justify-between mb-2",children:[O.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[O.jsx(ll,{status:E.status}),O.jsx("span",{className:"font-medium text-gray-200 truncate",children:E.windowName||E.id}),!d&&O.jsx(Fo,{className:"h-3.5 w-3.5 text-red-400 shrink-0"})]}),O.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[C(E)&&O.jsx("button",{onClick:p=>u(p,E.id),disabled:T(E.id,"approve"),className:"min-h-[44px] min-w-[44px] flex items-center justify-center rounded-md bg-green-900/30 p-2 text-green-400 transition-colors hover:bg-green-900/50 disabled:opacity-40 disabled:pointer-events-none",title:"Approve",children:O.jsx(Em,{className:"h-4 w-4"})}),O.jsx("button",{onClick:p=>y(p,E.id),disabled:T(E.id,"interrupt")||T(E.id,"kill"),className:"min-h-[44px] min-w-[44px] flex items-center justify-center rounded-md bg-yellow-900/30 p-2 text-yellow-400 transition-colors hover:bg-yellow-900/50 disabled:opacity-40 disabled:pointer-events-none",title:"Interrupt",children:O.jsx(xm,{className:"h-4 w-4"})}),O.jsx("button",{onClick:p=>m(p,E.id),disabled:T(E.id,"kill"),className:"min-h-[44px] min-w-[44px] flex items-center justify-center rounded-md bg-red-900/30 p-2 text-red-400 transition-colors hover:bg-red-900/50 disabled:opacity-40 disabled:pointer-events-none",title:"Kill",children:O.jsx(Fo,{className:"h-4 w-4"})})]})]}),O.jsx("div",{className:"font-mono text-xs text-gray-500 truncate mb-1.5",children:w(E.workDir,50)}),O.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500",children:[O.jsxs("span",{children:["Age: ",sn(E.createdAt)]}),O.jsxs("span",{children:["Active: ",sn(E.lastActivity)]}),E.permissionMode&&E.permissionMode!=="default"?O.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-green-400",children:[O.jsx(wm,{className:"h-3 w-3"})," ",E.permissionMode]}):null]})]},E.id)})}),O.jsx("div",{className:"hidden md:block overflow-x-auto rounded-lg border border-void-lighter bg-[#111118]",children:O.jsxs("table",{className:"w-full text-left text-sm",children:[O.jsx("thead",{children:O.jsxs("tr",{className:"border-b border-void-lighter text-[#666]",children:[O.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"WorkDir"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Age"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Last Activity"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Permission"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Actions"})]})}),O.jsx("tbody",{children:i.map(E=>{const b=r[E.id],d=b?b.alive:!0;return O.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[O.jsx("td",{className:"px-4 py-3",children:O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(ll,{status:E.status}),!d&&O.jsx(Fo,{className:"h-3.5 w-3.5 text-red-400"})]})}),O.jsx("td",{className:"px-4 py-3",children:O.jsx(Hi,{to:`/sessions/${encodeURIComponent(E.id)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:E.windowName||E.id})}),O.jsx("td",{className:"px-4 py-3 max-w-[200px] truncate font-mono text-xs text-gray-400",title:E.workDir,children:w(E.workDir)}),O.jsx("td",{className:"px-4 py-3 whitespace-nowrap text-gray-400",children:sn(E.createdAt)}),O.jsx("td",{className:"px-4 py-3 whitespace-nowrap text-gray-400",children:sn(E.lastActivity)}),O.jsx("td",{className:"px-4 py-3",children:E.permissionMode&&E.permissionMode!=="default"?O.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:[O.jsx(wm,{className:"h-3 w-3"}),E.permissionMode]}):O.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"})}),O.jsx("td",{className:"px-4 py-3",children:O.jsxs("div",{className:"flex items-center gap-1.5",children:[C(E)&&O.jsx("button",{onClick:p=>u(p,E.id),disabled:T(E.id,"approve"),className:"min-h-[44px] min-w-[44px] flex 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:opacity-40 disabled:pointer-events-none",title:"Approve",children:O.jsx(Em,{className:"h-3 w-3"})}),O.jsx("button",{onClick:p=>y(p,E.id),disabled:T(E.id,"interrupt")||T(E.id,"kill"),className:"min-h-[44px] min-w-[44px] flex 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:opacity-40 disabled:pointer-events-none",title:"Interrupt",children:O.jsx(xm,{className:"h-3 w-3"})}),O.jsx("button",{onClick:p=>m(p,E.id),disabled:T(E.id,"kill"),className:"min-h-[44px] min-w-[44px] flex 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:opacity-40 disabled:pointer-events-none",title:"Kill",children:O.jsx(Fo,{className:"h-3 w-3"})})]})})]},E.id)})})]})})]})}const Uu={session_status_change:{icon:JS,label:"Status",color:"#00e5ff"},session_message:{icon:ZS,label:"Message",color:"#00ff88"},session_approval:{icon:ib,label:"Approval",color:"#ffaa00"},session_ended:{icon:KS,label:"Ended",color:"#ff3366"},session_created:{icon:MS,label:"Created",color:"#a78bfa"},session_stall:{icon:Bp,label:"Stall",color:"#ff6600"},session_dead:{icon:ab,label:"Dead",color:"#ff0044"},session_subagent_start:{icon:_b,label:"Subagent",color:"#38bdf8"},session_subagent_stop:{icon:fb,label:"Subagent Done",color:"#34d399"}};function mr(i,r="unknown"){return typeof i=="string"?i:r}function XE(i){const r=i.data;switch(i.event){case"session_status_change":{const a=mr(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}: ${Xm(o,80)}`}case"session_approval":{const a=typeof r.prompt=="string"?r.prompt:JSON.stringify(r.prompt??"");return`Approval needed: ${Xm(a,80)}`}case"session_ended":return`Session ended: ${mr(r.reason)}`;case"session_created":return`Created in ${mr(r.workDir,"unknown dir")}`;case"session_stall":return`Session stalled: ${mr(r.stallType)}`;case"session_dead":return`Session dead: ${mr(r.stallType)}`;case"session_subagent_start":return`Subagent started: ${mr(r.name)}`;case"session_subagent_stop":return`Subagent finished: ${mr(r.name)}`;default:return JSON.stringify(r)}}function Xm(i,r){return i.length>r?i.slice(0,r)+"...":i}function JE(i){try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function QE(){const i=Et(u=>u.activities),r=Et(u=>u.activityFilterSession),a=Et(u=>u.activityFilterType),o=Et(u=>u.setActivityFilterSession),g=Et(u=>u.setActivityFilterType),x=Et(u=>u.sessions),T=F.useMemo(()=>i.filter(u=>!(r&&u.sessionId!==r||a&&u.event!==a)),[i,r,a]),c=F.useMemo(()=>{const u=new Map;for(const y of x)u.set(y.id,y.windowName??y.id.slice(0,8));return u},[x]),h=u=>c.get(u)??(u??"unknown").slice(0,8);return O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg w-full",children:[O.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:[O.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Activity Stream"}),O.jsxs("div",{className:"flex items-center gap-2",children:[O.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-[#00e5ff]",children:[O.jsx("option",{value:"",children:"All sessions"}),x.map(u=>O.jsx("option",{value:u.id,children:u.windowName||u.id.slice(0,8)},u.id))]}),O.jsxs("select",{value:a??"",onChange:u=>g(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-[#00e5ff]",children:[O.jsx("option",{value:"",children:"All types"}),Object.entries(Uu).map(([u,y])=>O.jsx("option",{value:u,children:y.label},u))]}),(r||a)&&O.jsx("button",{onClick:()=>{o(null),g(null)},className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300",children:O.jsx(dl,{className:"h-4 w-4"})})]})]}),O.jsxs("div",{className:"max-h-[360px] overflow-y-auto divide-y divide-[#1a1a2e]/50",children:[T.length===0&&O.jsx("div",{className:"px-4 py-8 text-center text-sm text-[#555]",children:"No activity yet"}),T.map((u,y)=>{const m=Uu[u.event]??Uu.session_status_change,C=m.icon;return O.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:[O.jsx(C,{className:"h-4 w-4 mt-0.5 shrink-0",style:{color:m.color}}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[O.jsx("span",{className:"text-xs font-medium text-gray-300 truncate",children:h(u.sessionId)}),O.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded hidden sm:inline-block",style:{backgroundColor:`${m.color}15`,color:m.color},children:m.label})]}),O.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:XE(u)})]}),O.jsx("span",{className:"text-[10px] text-[#444] shrink-0 tabular-nums mt-0.5",children:JE(u.timestamp)})]},`${u.sessionId}-${u.timestamp}-${y}`)})]})]})}let e2=0;function ua(){return{workDir:"",name:"",prompt:"",_key:e2++}}function t2({open:i,onClose:r}){const a=ul(),o=F.useRef(null),g=F.useRef(null),x=F.useCallback(()=>{I(),r()},[r]),T=F.useRef(null);F.useEffect(()=>{if(!i)return;const K=ee=>{var N;ee.key==="Escape"&&((N=g.current)==null||N.abort(),x())};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[i,x]),F.useEffect(()=>{if(!i)return;const K=T.current;if(!K)return;const ee='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',N=U=>{if(U.key!=="Tab")return;const L=Array.from(K.querySelectorAll(ee));if(L.length===0)return;const H=L[0],X=L[L.length-1];U.shiftKey?document.activeElement===H&&(U.preventDefault(),X.focus()):document.activeElement===X&&(U.preventDefault(),H.focus())};return K.addEventListener("keydown",N),()=>K.removeEventListener("keydown",N)},[i]),F.useEffect(()=>{if(i){const K=setTimeout(()=>{var ee;return(ee=o.current)==null?void 0:ee.focus()},50);return()=>clearTimeout(K)}},[i]);const[c,h]=F.useState(""),[u,y]=F.useState(""),[m,C]=F.useState(""),[w,E]=F.useState("default"),[b,d]=F.useState(!1),[p,f]=F.useState(null),[v,S]=F.useState("single"),[R,D]=F.useState([ua(),ua()]),[M,A]=F.useState(""),[B,$]=F.useState(null);function I(){h(""),y(""),C(""),E("default"),d(!1),f(null),D([ua(),ua()]),A(""),$(null),S("single")}function q(){R.length>=10||D([...R,ua()])}function P(K){R.length<=1||D(R.filter((ee,N)=>N!==K))}function Q(K,ee,N){D(R.map((U,L)=>L===K?{...U,[ee]:N}:U))}async function se(K){var U;K.preventDefault(),f(null),$(null);const ee=R.filter(L=>L.workDir.trim());if(ee.length===0){f("At least one working directory is required");return}d(!0),(U=g.current)==null||U.abort();const N=new AbortController;g.current=N;try{const L=await LE({sessions:ee.map(H=>({workDir:H.workDir.trim(),name:H.name.trim()||void 0,prompt:H.prompt.trim()||M.trim()||void 0,permissionMode:w})),signal:N.signal});$(L)}catch(L){if(N.signal.aborted)return;f(L instanceof Error?L.message:"Failed to create sessions")}finally{g.current===N&&(g.current=null,d(!1))}}if(!i)return null;async function G(K){var N;if(K.preventDefault(),f(null),!c.trim()){f("Working directory is required");return}d(!0),(N=g.current)==null||N.abort();const ee=new AbortController;g.current=ee;try{const U=await CE({workDir:c.trim(),name:u.trim()||void 0,prompt:m.trim()||void 0,permissionMode:w,signal:ee.signal});I(),r(),a(`/sessions/${U.id}`)}catch(U){if(ee.signal.aborted)return;f(U instanceof Error?U.message:"Failed to create session")}finally{g.current===ee&&(g.current=null,d(!1))}}return O.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[O.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:x}),O.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-label":"Create new session",className:`relative w-full ${v==="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:[O.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[O.jsxs("div",{className:"flex items-center gap-4",children:[O.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Session"}),O.jsxs("div",{className:"flex rounded bg-[#0a0a0f] p-0.5",children:[O.jsx("button",{type:"button",onClick:()=>S("single"),className:`px-3 py-1 text-xs rounded transition-colors ${v==="single"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Single"}),O.jsx("button",{type:"button",onClick:()=>S("batch"),className:`px-3 py-1 text-xs rounded transition-colors ${v==="batch"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Batch"})]})]}),O.jsx("button",{onClick:x,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:O.jsx(dl,{className:"h-4 w-4"})})]}),v==="single"&&O.jsxs("form",{onSubmit:G,className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{children:[O.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Working Directory ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("input",{type:"text",ref:o,value:c,onChange:K=>h(K.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-[#00e5ff] font-mono"})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Session Name"}),O.jsx("input",{type:"text",value:u,onChange:K=>y(K.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-[#00e5ff]"})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Initial Prompt"}),O.jsx("textarea",{value:m,onChange:K=>C(K.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-[#00e5ff] resize-none"})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),O.jsxs("select",{value:w,onChange:K=>E(K.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:[O.jsx("option",{value:"default",children:"default — asks for everything"}),O.jsx("option",{value:"plan",children:"plan — auto-reads, asks for writes"}),O.jsx("option",{value:"acceptEdits",children:"acceptEdits — auto-edits, asks for bash"}),O.jsx("option",{value:"bypassPermissions",children:"bypassPermissions — never asks"}),O.jsx("option",{value:"auto",children:"auto — auto-approve in sandbox"})]})]}),p&&O.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:p}),O.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[O.jsx("button",{type:"button",onClick:x,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"}),O.jsxs("button",{type:"submit",disabled:b||!c.trim(),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:[b&&O.jsx(Ju,{className:"h-3 w-3 animate-spin"}),"Create Session"]})]})]}),v==="batch"&&!B&&O.jsxs("form",{onSubmit:se,className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Shared Prompt"}),O.jsx("textarea",{value:M,onChange:K=>A(K.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-[#00e5ff] resize-none"})]}),O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[O.jsxs("span",{children:["Working Directory ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("span",{children:"Name"}),O.jsx("span",{children:"Prompt (override)"}),O.jsx("span",{})]}),O.jsx("div",{className:"space-y-2",children:R.map((K,ee)=>O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[O.jsx("input",{type:"text",value:K.workDir,onChange:N=>Q(ee,"workDir",N.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-[#00e5ff] font-mono"}),O.jsx("input",{type:"text",value:K.name,onChange:N=>Q(ee,"name",N.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-[#00e5ff]"}),O.jsx("input",{type:"text",value:K.prompt,onChange:N=>Q(ee,"prompt",N.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-[#00e5ff]"}),O.jsx("button",{type:"button",onClick:()=>P(ee),disabled:R.length<=1,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ff3366] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:O.jsx(Np,{className:"h-3.5 w-3.5"})})]},K._key))}),R.length<10&&O.jsxs("button",{type:"button",onClick:q,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[O.jsx(fl,{className:"h-3.5 w-3.5"}),"Add session"]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),O.jsxs("select",{value:w,onChange:K=>E(K.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:[O.jsx("option",{value:"default",children:"default — asks for everything"}),O.jsx("option",{value:"plan",children:"plan — auto-reads, asks for writes"}),O.jsx("option",{value:"acceptEdits",children:"acceptEdits — auto-edits, asks for bash"}),O.jsx("option",{value:"bypassPermissions",children:"bypassPermissions — never asks"}),O.jsx("option",{value:"auto",children:"auto — auto-approve in sandbox"})]})]}),p&&O.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:p}),O.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[O.jsx("button",{type:"button",onClick:x,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"}),O.jsxs("button",{type:"submit",disabled:b||!R.some(K=>K.workDir.trim()),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:[b&&O.jsx(Ju,{className:"h-3 w-3 animate-spin"}),"Create ",R.filter(K=>K.workDir.trim()).length," Session(s)"]})]})]}),B&&O.jsxs("div",{className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[B.created>0&&O.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:[B.created," created"]}),B.failed>0&&O.jsxs("span",{className:"text-xs font-medium text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-1.5",children:[B.failed," failed"]})]}),B.sessions.length>0&&O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Created sessions"}),O.jsx("ul",{className:"space-y-1",children:B.sessions.map(K=>O.jsx("li",{children:O.jsxs("button",{type:"button",onClick:()=>{x(),a(`/sessions/${K.id}`)},className:"text-xs text-[#00e5ff] hover:underline font-mono",children:[K.id.slice(0,8),"...",K.name?` — ${K.name}`:""]})},K.id))})]}),B.errors.length>0&&O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Errors"}),O.jsx("ul",{className:"space-y-1",children:B.errors.map((K,ee)=>O.jsx("li",{className:"text-xs text-[#ff3366]",children:K},ee))})]}),O.jsx("div",{className:"flex justify-end pt-2",children:O.jsx("button",{type:"button",onClick:x,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 i2(){const[i,r]=F.useState(!1);return O.jsxs("div",{className:"flex flex-col gap-6",children:[O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{children:[O.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Overview"}),O.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Aegis session monitoring and metrics"})]}),O.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:[O.jsx(fl,{className:"h-3.5 w-3.5"}),"New Session"]})]}),O.jsx(YE,{}),O.jsxs("div",{children:[O.jsx("h3",{className:"mb-3 text-lg font-semibold text-gray-200",children:"Sessions"}),O.jsx(KE,{})]}),O.jsx(QE,{}),O.jsx(t2,{open:i,onClose:()=>r(!1)})]})}function Jm(i){return i instanceof Error&&"statusCode"in i}function s2(i){const r=Et(Q=>Q.token),a=Xs(Q=>Q.addToast),[o,g]=F.useState(null),[x,T]=F.useState(null),[c,h]=F.useState(!1),[u,y]=F.useState(!0),[m,C]=F.useState(""),[w,E]=F.useState(!0),[b,d]=F.useState(null),[p,f]=F.useState(!0),v=F.useRef(i);v.current=i;const S=F.useRef(!1),R=F.useRef(0),D=F.useRef(void 0),M=F.useRef(void 0),A=F.useCallback(async()=>{try{const[Q,se]=await Promise.allSettled([bE(v.current),xE(v.current)]);if(Q.status==="rejected"&&Jm(Q.reason)&&Q.reason.statusCode===404||se.status==="rejected"&&Jm(se.reason)&&se.reason.statusCode===404){h(!0);return}Q.status==="fulfilled"&&g(Q.value),se.status==="fulfilled"&&T(se.value)}catch(Q){a("error","Failed to load session",Q instanceof Error?Q.message:void 0)}finally{y(!1)}},[a]);D.current=A;const B=F.useCallback(async()=>{if(S.current)return;const Q=v.current;try{const se=await AE(Q);S.current||C(se.pane??"")}catch(se){a("warning","Failed to load terminal pane",se instanceof Error?se.message:void 0)}finally{S.current||E(!1)}try{const se=await TE(Q);S.current||d(se)}catch(se){a("warning","Failed to load session metrics",se instanceof Error?se.message:void 0)}finally{S.current||f(!1)}},[a]);M.current=B,F.useEffect(()=>(S.current=!1,R.current++,y(!0),E(!0),f(!0),A(),B(),()=>{S.current=!0,$.current&&clearTimeout($.current),I.current&&clearTimeout(I.current)}),[i,A,B]);const $=F.useRef(void 0),I=F.useRef(void 0),q=F.useCallback(()=>{$.current&&clearTimeout($.current);const Q=R.current;$.current=setTimeout(()=>{var se;R.current===Q&&((se=M.current)==null||se.call(M))},1e3)},[]),P=F.useCallback(()=>{I.current&&clearTimeout(I.current);const Q=R.current;I.current=setTimeout(()=>{var se;R.current===Q&&((se=D.current)==null||se.call(D))},1e3)},[]);return F.useEffect(()=>{if(!i)return;const Q=gv(i,se=>{var G,K;try{const ee=cE.safeParse(JSON.parse(se.data));if(!ee.success){console.warn("SSE event failed validation",ee.error.message);return}switch(ee.data.event){case"status":case"approval":case"stall":case"dead":P(),q();break;case"message":q();break;case"ended":(G=D.current)==null||G.call(D),(K=M.current)==null||K.call(M);break}}catch{}},r);return()=>Q()},[i,r,P,q]),{session:o,health:x,notFound:c,loading:u,paneContent:m,paneLoading:w,metrics:b,metricsLoading:p,refetchPaneAndMetrics:B}}const r2={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 Qm(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 ep(i){return new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function n2({session:i,health:r,onApprove:a,onReject:o,onInterrupt:g,onKill:x}){const[T,c]=F.useState(!1),h=r.status==="permission_prompt"||r.status==="bash_approval";return O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3 sm:p-4",children:[O.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[O.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[O.jsx(ll,{status:r.status}),O.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:r2[r.status]})]}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("h1",{className:"text-base sm:text-lg font-semibold text-[#e0e0e0] truncate",children:i.windowName||"Untitled Session"}),O.jsx("div",{className:"text-xs text-[#555] font-mono truncate mt-0.5",children:Qm(i.workDir,40)})]}),O.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[i.permissionMode&&i.permissionMode!=="default"&&O.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#003322] text-[#00ff88] border border-[#00ff88]/30",children:i.permissionMode}),r.alive?O.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"}):O.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#331111] text-[#ff3366] border border-[#ff3366]/30",children:"Dead"})]})]}),O.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 text-[11px] text-[#555] mb-3 flex-wrap",children:[O.jsxs("span",{children:["Created: ",ep(i.createdAt)]}),O.jsxs("span",{className:"hidden sm:inline",children:["Last activity: ",ep(i.lastActivity)]}),O.jsxs("span",{className:"font-mono hidden sm:inline",children:["ID: ",Qm(i.id,16)]}),r.details&&O.jsx("span",{className:"text-[#888] italic",children:r.details})]}),O.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h&&O.jsxs(O.Fragment,{children:[O.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#00ff88] border border-[#00ff88]/30 transition-colors",children:"Approve"}),O.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ff3366] border border-[#ff3366]/30 transition-colors",children:"Reject"})]}),O.jsx("button",{onClick:g,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"}),T?O.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[O.jsx("span",{className:"text-xs text-[#ff3366]",children:"Confirm kill?"}),O.jsx("button",{onClick:()=>{x==null||x(),c(!1)},className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] text-[#ff3366] border border-[#ff3366]/30 transition-colors",children:"Yes, Kill"}),O.jsx("button",{onClick:()=>c(!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"})]}):O.jsx("button",{onClick:()=>c(!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"})]})]})}/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:yv,setPrototypeOf:tp,isFrozen:a2,getPrototypeOf:o2,getOwnPropertyDescriptor:l2}=Object;let{freeze:Yt,seal:ki,create:Qo}=Object,{apply:ih,construct:sh}=typeof Reflect<"u"&&Reflect;Yt||(Yt=function(r){return r});ki||(ki=function(r){return r});ih||(ih=function(r,a){for(var o=arguments.length,g=new Array(o>2?o-2:0),x=2;x<o;x++)g[x-2]=arguments[x];return r.apply(a,g)});sh||(sh=function(r){for(var a=arguments.length,o=new Array(a>1?a-1:0),g=1;g<a;g++)o[g-1]=arguments[g];return new r(...o)});const Yo=Vt(Array.prototype.forEach),c2=Vt(Array.prototype.lastIndexOf),ip=Vt(Array.prototype.pop),ha=Vt(Array.prototype.push),u2=Vt(Array.prototype.splice),el=Vt(String.prototype.toLowerCase),Iu=Vt(String.prototype.toString),Pu=Vt(String.prototype.match),fa=Vt(String.prototype.replace),h2=Vt(String.prototype.indexOf),f2=Vt(String.prototype.trim),_i=Vt(Object.prototype.hasOwnProperty),Gt=Vt(RegExp.prototype.test),da=d2(TypeError);function Vt(i){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var a=arguments.length,o=new Array(a>1?a-1:0),g=1;g<a;g++)o[g-1]=arguments[g];return ih(i,r,o)}}function d2(i){return function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return sh(i,a)}}function Me(i,r){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:el;tp&&tp(i,null);let o=r.length;for(;o--;){let g=r[o];if(typeof g=="string"){const x=a(g);x!==g&&(a2(r)||(r[o]=x),g=x)}i[g]=!0}return i}function _2(i){for(let r=0;r<i.length;r++)_i(i,r)||(i[r]=null);return i}function Gi(i){const r=Qo(null);for(const[a,o]of yv(i))_i(i,a)&&(Array.isArray(o)?r[a]=_2(o):o&&typeof o=="object"&&o.constructor===Object?r[a]=Gi(o):r[a]=o);return r}function _a(i,r){for(;i!==null;){const o=l2(i,r);if(o){if(o.get)return Vt(o.get);if(typeof o.value=="function")return Vt(o.value)}i=o2(i)}function a(){return null}return a}const sp=Yt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$u=Yt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Fu=Yt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),m2=Yt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Zu=Yt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),p2=Yt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),rp=Yt(["#text"]),np=Yt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),qu=Yt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ap=Yt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Vo=Yt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),v2=ki(/\{\{[\w\W]*|[\w\W]*\}\}/gm),g2=ki(/<%[\w\W]*|[\w\W]*%>/gm),y2=ki(/\$\{[\w\W]*/gm),S2=ki(/^data-[\-\w.\u00B7-\uFFFF]+$/),b2=ki(/^aria-[\-\w]+$/),Sv=ki(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),C2=ki(/^(?:\w+script|data):/i),x2=ki(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bv=ki(/^html$/i),w2=ki(/^[a-z][.\w]*(-[.\w]+)+$/i);var op=Object.freeze({__proto__:null,ARIA_ATTR:b2,ATTR_WHITESPACE:x2,CUSTOM_ELEMENT:w2,DATA_ATTR:S2,DOCTYPE_NAME:bv,ERB_EXPR:g2,IS_ALLOWED_URI:Sv,IS_SCRIPT_OR_DATA:C2,MUSTACHE_EXPR:v2,TMPLIT_EXPR:y2});const ma={element:1,text:3,progressingInstruction:7,comment:8,document:9},E2=function(){return typeof window>"u"?null:window},T2=function(r,a){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let o=null;const g="data-tt-policy-suffix";a&&a.hasAttribute(g)&&(o=a.getAttribute(g));const x="dompurify"+(o?"#"+o:"");try{return r.createPolicy(x,{createHTML(T){return T},createScriptURL(T){return T}})}catch{return console.warn("TrustedTypes policy "+x+" could not be created."),null}},lp=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Cv(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E2();const r=Se=>Cv(Se);if(r.version="3.3.3",r.removed=[],!i||!i.document||i.document.nodeType!==ma.document||!i.Element)return r.isSupported=!1,r;let{document:a}=i;const o=a,g=o.currentScript,{DocumentFragment:x,HTMLTemplateElement:T,Node:c,Element:h,NodeFilter:u,NamedNodeMap:y=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:m,DOMParser:C,trustedTypes:w}=i,E=h.prototype,b=_a(E,"cloneNode"),d=_a(E,"remove"),p=_a(E,"nextSibling"),f=_a(E,"childNodes"),v=_a(E,"parentNode");if(typeof T=="function"){const Se=a.createElement("template");Se.content&&Se.content.ownerDocument&&(a=Se.content.ownerDocument)}let S,R="";const{implementation:D,createNodeIterator:M,createDocumentFragment:A,getElementsByTagName:B}=a,{importNode:$}=o;let I=lp();r.isSupported=typeof yv=="function"&&typeof v=="function"&&D&&D.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:q,ERB_EXPR:P,TMPLIT_EXPR:Q,DATA_ATTR:se,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:K,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:N}=op;let{IS_ALLOWED_URI:U}=op,L=null;const H=Me({},[...sp,...$u,...Fu,...Zu,...rp]);let X=null;const ne=Me({},[...np,...qu,...ap,...Vo]);let he=Object.seal(Qo(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),me=null,Y=null;const j=Object.seal(Qo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ce=!0,oe=!0,ve=!1,pe=!0,Te=!1,je=!0,Ue=!1,ct=!1,Ee=!1,Ft=!1,mi=!1,pi=!1,Ii=!0,Vi=!1;const Pt="user-content-";let nt=!0,Dt=!1,Zt={},Nt=null;const Bt=Me({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ki=null;const Kt=Me({},["audio","video","img","source","image","track"]);let Li=null;const Ye=Me({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vi="http://www.w3.org/1998/Math/MathML",kt="http://www.w3.org/2000/svg",Ot="http://www.w3.org/1999/xhtml";let gt=Ot,un=!1,hn=null;const Sl=Me({},[vi,kt,Ot],Iu);let Xi=Me({},["mi","mo","mn","ms","mtext"]),Ji=Me({},["annotation-xml"]);const gr=Me({},["title","style","font","a","script"]);let ai=null;const yr=["application/xhtml+xml","text/html"],Js="text/html";let _t=null,Qi=null;const fn=a.createElement("form"),bs=function(W){return W instanceof RegExp||W instanceof Function},dn=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Qi&&Qi===W)){if((!W||typeof W!="object")&&(W={}),W=Gi(W),ai=yr.indexOf(W.PARSER_MEDIA_TYPE)===-1?Js:W.PARSER_MEDIA_TYPE,_t=ai==="application/xhtml+xml"?Iu:el,L=_i(W,"ALLOWED_TAGS")?Me({},W.ALLOWED_TAGS,_t):H,X=_i(W,"ALLOWED_ATTR")?Me({},W.ALLOWED_ATTR,_t):ne,hn=_i(W,"ALLOWED_NAMESPACES")?Me({},W.ALLOWED_NAMESPACES,Iu):Sl,Li=_i(W,"ADD_URI_SAFE_ATTR")?Me(Gi(Ye),W.ADD_URI_SAFE_ATTR,_t):Ye,Ki=_i(W,"ADD_DATA_URI_TAGS")?Me(Gi(Kt),W.ADD_DATA_URI_TAGS,_t):Kt,Nt=_i(W,"FORBID_CONTENTS")?Me({},W.FORBID_CONTENTS,_t):Bt,me=_i(W,"FORBID_TAGS")?Me({},W.FORBID_TAGS,_t):Gi({}),Y=_i(W,"FORBID_ATTR")?Me({},W.FORBID_ATTR,_t):Gi({}),Zt=_i(W,"USE_PROFILES")?W.USE_PROFILES:!1,ce=W.ALLOW_ARIA_ATTR!==!1,oe=W.ALLOW_DATA_ATTR!==!1,ve=W.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=W.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Te=W.SAFE_FOR_TEMPLATES||!1,je=W.SAFE_FOR_XML!==!1,Ue=W.WHOLE_DOCUMENT||!1,Ft=W.RETURN_DOM||!1,mi=W.RETURN_DOM_FRAGMENT||!1,pi=W.RETURN_TRUSTED_TYPE||!1,Ee=W.FORCE_BODY||!1,Ii=W.SANITIZE_DOM!==!1,Vi=W.SANITIZE_NAMED_PROPS||!1,nt=W.KEEP_CONTENT!==!1,Dt=W.IN_PLACE||!1,U=W.ALLOWED_URI_REGEXP||Sv,gt=W.NAMESPACE||Ot,Xi=W.MATHML_TEXT_INTEGRATION_POINTS||Xi,Ji=W.HTML_INTEGRATION_POINTS||Ji,he=W.CUSTOM_ELEMENT_HANDLING||{},W.CUSTOM_ELEMENT_HANDLING&&bs(W.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(he.tagNameCheck=W.CUSTOM_ELEMENT_HANDLING.tagNameCheck),W.CUSTOM_ELEMENT_HANDLING&&bs(W.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(he.attributeNameCheck=W.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),W.CUSTOM_ELEMENT_HANDLING&&typeof W.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=W.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Te&&(oe=!1),mi&&(Ft=!0),Zt&&(L=Me({},rp),X=Qo(null),Zt.html===!0&&(Me(L,sp),Me(X,np)),Zt.svg===!0&&(Me(L,$u),Me(X,qu),Me(X,Vo)),Zt.svgFilters===!0&&(Me(L,Fu),Me(X,qu),Me(X,Vo)),Zt.mathMl===!0&&(Me(L,Zu),Me(X,ap),Me(X,Vo))),_i(W,"ADD_TAGS")||(j.tagCheck=null),_i(W,"ADD_ATTR")||(j.attributeCheck=null),W.ADD_TAGS&&(typeof W.ADD_TAGS=="function"?j.tagCheck=W.ADD_TAGS:(L===H&&(L=Gi(L)),Me(L,W.ADD_TAGS,_t))),W.ADD_ATTR&&(typeof W.ADD_ATTR=="function"?j.attributeCheck=W.ADD_ATTR:(X===ne&&(X=Gi(X)),Me(X,W.ADD_ATTR,_t))),W.ADD_URI_SAFE_ATTR&&Me(Li,W.ADD_URI_SAFE_ATTR,_t),W.FORBID_CONTENTS&&(Nt===Bt&&(Nt=Gi(Nt)),Me(Nt,W.FORBID_CONTENTS,_t)),W.ADD_FORBID_CONTENTS&&(Nt===Bt&&(Nt=Gi(Nt)),Me(Nt,W.ADD_FORBID_CONTENTS,_t)),nt&&(L["#text"]=!0),Ue&&Me(L,["html","head","body"]),L.table&&(Me(L,["tbody"]),delete me.tbody),W.TRUSTED_TYPES_POLICY){if(typeof W.TRUSTED_TYPES_POLICY.createHTML!="function")throw da('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof W.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw da('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=W.TRUSTED_TYPES_POLICY,R=S.createHTML("")}else S===void 0&&(S=T2(w,g)),S!==null&&typeof R=="string"&&(R=S.createHTML(""));Yt&&Yt(W),Qi=W}},_n=Me({},[...$u,...Fu,...m2]),mn=Me({},[...Zu,...p2]),Ea=function(W){let _e=v(W);(!_e||!_e.tagName)&&(_e={namespaceURI:gt,tagName:"template"});const ge=el(W.tagName),Ze=el(_e.tagName);return hn[W.namespaceURI]?W.namespaceURI===kt?_e.namespaceURI===Ot?ge==="svg":_e.namespaceURI===vi?ge==="svg"&&(Ze==="annotation-xml"||Xi[Ze]):!!_n[ge]:W.namespaceURI===vi?_e.namespaceURI===Ot?ge==="math":_e.namespaceURI===kt?ge==="math"&&Ji[Ze]:!!mn[ge]:W.namespaceURI===Ot?_e.namespaceURI===kt&&!Ji[Ze]||_e.namespaceURI===vi&&!Xi[Ze]?!1:!mn[ge]&&(gr[ge]||!_n[ge]):!!(ai==="application/xhtml+xml"&&hn[W.namespaceURI]):!1},Xt=function(W){ha(r.removed,{element:W});try{v(W).removeChild(W)}catch{d(W)}},Ni=function(W,_e){try{ha(r.removed,{attribute:_e.getAttributeNode(W),from:_e})}catch{ha(r.removed,{attribute:null,from:_e})}if(_e.removeAttribute(W),W==="is")if(Ft||mi)try{Xt(_e)}catch{}else try{_e.setAttribute(W,"")}catch{}},pn=function(W){let _e=null,ge=null;if(Ee)W="<remove></remove>"+W;else{const ke=Pu(W,/^[\r\n\t ]+/);ge=ke&&ke[0]}ai==="application/xhtml+xml"&>===Ot&&(W='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+W+"</body></html>");const Ze=S?S.createHTML(W):W;if(gt===Ot)try{_e=new C().parseFromString(Ze,ai)}catch{}if(!_e||!_e.documentElement){_e=D.createDocument(gt,"template",null);try{_e.documentElement.innerHTML=un?R:Ze}catch{}}const at=_e.body||_e.documentElement;return W&&ge&&at.insertBefore(a.createTextNode(ge),at.childNodes[0]||null),gt===Ot?B.call(_e,Ue?"html":"body")[0]:Ue?_e.documentElement:at},vn=function(W){return M.call(W.ownerDocument||W,W,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},gi=function(W){return W instanceof m&&(typeof W.nodeName!="string"||typeof W.textContent!="string"||typeof W.removeChild!="function"||!(W.attributes instanceof y)||typeof W.removeAttribute!="function"||typeof W.setAttribute!="function"||typeof W.namespaceURI!="string"||typeof W.insertBefore!="function"||typeof W.hasChildNodes!="function")},yt=function(W){return typeof c=="function"&&W instanceof c};function it(Se,W,_e){Yo(Se,ge=>{ge.call(r,W,_e,Qi)})}const es=function(W){let _e=null;if(it(I.beforeSanitizeElements,W,null),gi(W))return Xt(W),!0;const ge=_t(W.nodeName);if(it(I.uponSanitizeElement,W,{tagName:ge,allowedTags:L}),je&&W.hasChildNodes()&&!yt(W.firstElementChild)&&Gt(/<[/\w!]/g,W.innerHTML)&&Gt(/<[/\w!]/g,W.textContent)||W.nodeType===ma.progressingInstruction||je&&W.nodeType===ma.comment&&Gt(/<[/\w]/g,W.data))return Xt(W),!0;if(!(j.tagCheck instanceof Function&&j.tagCheck(ge))&&(!L[ge]||me[ge])){if(!me[ge]&&Ta(ge)&&(he.tagNameCheck instanceof RegExp&&Gt(he.tagNameCheck,ge)||he.tagNameCheck instanceof Function&&he.tagNameCheck(ge)))return!1;if(nt&&!Nt[ge]){const Ze=v(W)||W.parentNode,at=f(W)||W.childNodes;if(at&&Ze){const ke=at.length;for(let zt=ke-1;zt>=0;--zt){const yi=b(at[zt],!0);yi.__removalCount=(W.__removalCount||0)+1,Ze.insertBefore(yi,p(W))}}}return Xt(W),!0}return W instanceof h&&!Ea(W)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&Gt(/<\/no(script|embed|frames)/i,W.innerHTML)?(Xt(W),!0):(Te&&W.nodeType===ma.text&&(_e=W.textContent,Yo([q,P,Q],Ze=>{_e=fa(_e,Ze," ")}),W.textContent!==_e&&(ha(r.removed,{element:W.cloneNode()}),W.textContent=_e)),it(I.afterSanitizeElements,W,null),!1)},Sr=function(W,_e,ge){if(Y[_e]||Ii&&(_e==="id"||_e==="name")&&(ge in a||ge in fn))return!1;if(!(oe&&!Y[_e]&&Gt(se,_e))){if(!(ce&&Gt(G,_e))){if(!(j.attributeCheck instanceof Function&&j.attributeCheck(_e,W))){if(!X[_e]||Y[_e]){if(!(Ta(W)&&(he.tagNameCheck instanceof RegExp&&Gt(he.tagNameCheck,W)||he.tagNameCheck instanceof Function&&he.tagNameCheck(W))&&(he.attributeNameCheck instanceof RegExp&&Gt(he.attributeNameCheck,_e)||he.attributeNameCheck instanceof Function&&he.attributeNameCheck(_e,W))||_e==="is"&&he.allowCustomizedBuiltInElements&&(he.tagNameCheck instanceof RegExp&&Gt(he.tagNameCheck,ge)||he.tagNameCheck instanceof Function&&he.tagNameCheck(ge))))return!1}else if(!Li[_e]){if(!Gt(U,fa(ge,ee,""))){if(!((_e==="src"||_e==="xlink:href"||_e==="href")&&W!=="script"&&h2(ge,"data:")===0&&Ki[W])){if(!(ve&&!Gt(K,fa(ge,ee,"")))){if(ge)return!1}}}}}}}return!0},Ta=function(W){return W!=="annotation-xml"&&Pu(W,N)},Aa=function(W){it(I.beforeSanitizeAttributes,W,null);const{attributes:_e}=W;if(!_e||gi(W))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let Ze=_e.length;for(;Ze--;){const at=_e[Ze],{name:ke,namespaceURI:zt,value:yi}=at,Jt=_t(ke),Pi=yi;let At=ke==="value"?Pi:f2(Pi);if(ge.attrName=Jt,ge.attrValue=At,ge.keepAttr=!0,ge.forceKeepAttr=void 0,it(I.uponSanitizeAttribute,W,ge),At=ge.attrValue,Vi&&(Jt==="id"||Jt==="name")&&(Ni(ke,W),At=Pt+At),je&&Gt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,At)){Ni(ke,W);continue}if(Jt==="attributename"&&Pu(At,"href")){Ni(ke,W);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){Ni(ke,W);continue}if(!pe&&Gt(/\/>/i,At)){Ni(ke,W);continue}Te&&Yo([q,P,Q],yn=>{At=fa(At,yn," ")});const gn=_t(W.nodeName);if(!Sr(gn,Jt,At)){Ni(ke,W);continue}if(S&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!zt)switch(w.getAttributeType(gn,Jt)){case"TrustedHTML":{At=S.createHTML(At);break}case"TrustedScriptURL":{At=S.createScriptURL(At);break}}if(At!==Pi)try{zt?W.setAttributeNS(zt,ke,At):W.setAttribute(ke,At),gi(W)?Xt(W):ip(r.removed)}catch{Ni(ke,W)}}it(I.afterSanitizeAttributes,W,null)},Ra=function Se(W){let _e=null;const ge=vn(W);for(it(I.beforeSanitizeShadowDOM,W,null);_e=ge.nextNode();)it(I.uponSanitizeShadowNode,_e,null),es(_e),Aa(_e),_e.content instanceof x&&Se(_e.content);it(I.afterSanitizeShadowDOM,W,null)};return r.sanitize=function(Se){let W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=null,ge=null,Ze=null,at=null;if(un=!Se,un&&(Se="<!-->"),typeof Se!="string"&&!yt(Se))if(typeof Se.toString=="function"){if(Se=Se.toString(),typeof Se!="string")throw da("dirty is not a string, aborting")}else throw da("toString is not a function");if(!r.isSupported)return Se;if(ct||dn(W),r.removed=[],typeof Se=="string"&&(Dt=!1),Dt){if(Se.nodeName){const yi=_t(Se.nodeName);if(!L[yi]||me[yi])throw da("root node is forbidden and cannot be sanitized in-place")}}else if(Se instanceof c)_e=pn("<!---->"),ge=_e.ownerDocument.importNode(Se,!0),ge.nodeType===ma.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?_e=ge:_e.appendChild(ge);else{if(!Ft&&!Te&&!Ue&&Se.indexOf("<")===-1)return S&&pi?S.createHTML(Se):Se;if(_e=pn(Se),!_e)return Ft?null:pi?R:""}_e&&Ee&&Xt(_e.firstChild);const ke=vn(Dt?Se:_e);for(;Ze=ke.nextNode();)es(Ze),Aa(Ze),Ze.content instanceof x&&Ra(Ze.content);if(Dt)return Se;if(Ft){if(mi)for(at=A.call(_e.ownerDocument);_e.firstChild;)at.appendChild(_e.firstChild);else at=_e;return(X.shadowroot||X.shadowrootmode)&&(at=$.call(o,at,!0)),at}let zt=Ue?_e.outerHTML:_e.innerHTML;return Ue&&L["!doctype"]&&_e.ownerDocument&&_e.ownerDocument.doctype&&_e.ownerDocument.doctype.name&&Gt(bv,_e.ownerDocument.doctype.name)&&(zt="<!DOCTYPE "+_e.ownerDocument.doctype.name+`>
|
|
254
|
+
`+zt),Te&&Yo([q,P,Q],yi=>{zt=fa(zt,yi," ")}),S&&pi?S.createHTML(zt):zt},r.setConfig=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dn(Se),ct=!0},r.clearConfig=function(){Qi=null,ct=!1},r.isValidAttribute=function(Se,W,_e){Qi||dn({});const ge=_t(Se),Ze=_t(W);return Sr(ge,Ze,_e)},r.addHook=function(Se,W){typeof W=="function"&&ha(I[Se],W)},r.removeHook=function(Se,W){if(W!==void 0){const _e=c2(I[Se],W);return _e===-1?void 0:u2(I[Se],_e,1)[0]}return ip(I[Se])},r.removeHooks=function(Se){I[Se]=[]},r.removeAllHooks=function(){I=lp()},r}var A2=Cv();function wa(i){return A2.sanitize(i,{ALLOWED_TAGS:[]})}const R2={Read:"📖",Edit:"✏️",Write:"📝",Bash:"💻",Search:"🔍"};function D2(i){return i?R2[i]??"❓":"❓"}function k2(i){if(!i)return"";try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function Gu({entry:i}){const r=i.role==="user";return O.jsx("div",{className:`flex ${r?"justify-end":"justify-start"} mb-3`,children:O.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2.5 text-sm leading-relaxed ${r?"bg-[#1a1a3e] text-[#e0e0e0] rounded-br-sm":"bg-[#111118] text-[#e0e0e0] rounded-bl-sm border border-[#1a1a2e]"}`,children:[O.jsx("div",{className:"whitespace-pre-wrap break-words",children:wa(i.text)}),i.timestamp&&O.jsx("div",{className:`text-[10px] mt-1 ${r?"text-[#555]":"text-[#444]"}`,children:k2(i.timestamp)})]})})}function O2({entry:i}){const[r,a]=F.useState(!1);return O.jsx("div",{className:"flex justify-start mb-3",children:O.jsxs("div",{className:"max-w-[80%] w-full",children:[O.jsxs("button",{onClick:()=>a(o=>!o),className:"flex items-center gap-2 text-xs text-[#555] hover:text-[#777] transition-colors py-1 group",children:[O.jsx("span",{className:"inline-block transition-transform duration-200",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),O.jsx("span",{className:"italic",children:"Thinking…"})]}),r&&O.jsx("div",{className:"bg-[#0d0d12] border border-[#1a1a2e] rounded-lg px-4 py-3 mt-1 text-sm text-[#555] italic leading-relaxed whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:wa(i.text)})]})})}function M2({entry:i}){const r=wa(i.text),a=r.length>100?r.slice(0,100)+"…":r;return O.jsx("div",{className:"flex justify-start mb-3",children:O.jsxs("div",{className:"max-w-[80%] w-full bg-[#0d0d12] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[O.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-[#1a1a2e]",children:[O.jsx("span",{className:"text-base",children:D2(i.toolName)}),O.jsx("span",{className:"text-xs font-semibold text-[#00e5ff] font-mono",children:i.toolName??"Tool"}),O.jsx("span",{className:"text-[10px] text-[#555] ml-auto",children:"tool_use"})]}),O.jsx("div",{className:"px-3 py-2 text-xs text-[#888] font-mono whitespace-pre-wrap break-all max-h-32 overflow-y-auto",children:a})]})})}function L2({entry:i}){const r=i.text.toLowerCase().startsWith("error");return O.jsx("div",{className:"flex justify-start mb-3",children:O.jsxs("div",{className:`max-w-[80%] w-full bg-[#0d0d12] rounded-lg overflow-hidden ${r?"border border-[#ff3366]/40":"border border-[#00ff88]/30"}`,children:[O.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-[#1a1a2e]",children:[O.jsx("span",{className:"text-xs font-semibold text-[#888]",children:r?"✗ Result":"✓ Result"}),i.toolName&&O.jsx("span",{className:"text-[10px] text-[#555] font-mono",children:i.toolName})]}),O.jsx("div",{className:"px-3 py-2 text-xs text-[#666] font-mono whitespace-pre-wrap break-all max-h-32 overflow-y-auto",children:wa(i.text)||"(empty)"})]})})}function N2({entry:i}){if(i.role==="user")return O.jsx(Gu,{entry:i});switch(i.contentType){case"text":return O.jsx(Gu,{entry:i});case"thinking":return O.jsx(O2,{entry:i});case"tool_use":return O.jsx(M2,{entry:i});case"tool_result":return O.jsx(L2,{entry:i});case"permission_request":return O.jsxs("div",{className:"text-red-400 text-sm font-semibold px-3 py-2",children:["Permission Request: ",wa(i.text)]});default:return O.jsx(Gu,{entry:i})}}const Ko=1e3;function Wu(i){return`${i.timestamp??""}:${i.role}:${i.contentType}:${i.text.length}:${i.text.slice(0,80)}`}function B2({sessionId:i}){const[r,a]=F.useState([]),[o,g]=F.useState(!0),[x,T]=F.useState(null),c=Et(S=>S.token),[h,u]=F.useState({thinking:!1,tool_use:!0,tool_result:!0}),[y,m]=F.useState(!1),C=F.useRef(null),w=F.useRef(null),E=F.useRef(!1),b=F.useRef(new Set);F.useEffect(()=>{let S=!1;return EE(i).then(R=>{if(!S){const D=R.messages??[],M=D.length>Ko?D.slice(D.length-Ko):D;a(M),b.current=new Set(M.map(Wu))}}).catch(R=>{S||T(R instanceof Error?R.message:"Failed to load")}).finally(()=>{S||g(!1)}),()=>{S=!0}},[i]),F.useEffect(()=>{const S=gv(i,R=>{try{const D=JSON.parse(R.data);if(D.event!=="message")return;const M=D.data;a(A=>{const B=Wu(M);if(b.current.has(B))return A;b.current.add(B);const $=[...A,M];if($.length>Ko){const I=$.length-Ko,q=$.slice(I);for(let P=0;P<I;P++)b.current.delete(Wu($[P]));return q}return $})}catch{}},c);return()=>S()},[i,c]),F.useEffect(()=>{var S;E.current||(S=C.current)==null||S.scrollIntoView({behavior:"smooth"})},[r]);const d=F.useCallback(()=>{const S=w.current;if(!S)return;const R=S.scrollHeight-S.scrollTop-S.clientHeight<60;E.current=!R,m(!R)},[]),p=F.useCallback(()=>{var S;E.current=!1,(S=C.current)==null||S.scrollIntoView({behavior:"smooth"})},[]),f=F.useCallback(S=>{u(R=>({...R,[S]:!R[S]}))},[]),v=F.useMemo(()=>r.filter(S=>S.role==="user"?!0:!(S.contentType==="thinking"&&!h.thinking||S.contentType==="tool_use"&&!h.tool_use||S.contentType==="tool_result"&&!h.tool_result)),[r,h]);return o?O.jsx("div",{className:"flex items-center justify-center h-full text-[#555] text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading transcript…"})}):x?O.jsxs("div",{className:"flex items-center justify-center h-full text-[#ff3366] text-sm",children:["⚠ ",x]}):O.jsxs("div",{className:"flex flex-col h-full relative",children:[O.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-[#1a1a2e] bg-[#0a0a0f] shrink-0",children:[O.jsx("span",{className:"text-[10px] text-[#555] uppercase tracking-wider",children:"Filter:"}),["thinking","tool_use","tool_result"].map(S=>O.jsx("button",{onClick:()=>f(S),"aria-pressed":h[S],className:`text-xs px-2 py-0.5 rounded border transition-colors ${h[S]?"border-[#00e5ff]/40 text-[#00e5ff] bg-[#00e5ff]/10":"border-[#1a1a2e] text-[#555] hover:text-[#888]"}`,children:S==="tool_use"?"Tools":S==="tool_result"?"Results":S},S)),O.jsxs("span",{className:"text-[10px] text-[#444] ml-auto",children:[v.length," / ",r.length]})]}),O.jsxs("div",{ref:w,onScroll:d,className:"flex-1 overflow-y-auto px-4 py-3",children:[v.length===0&&O.jsx("div",{className:"flex items-center justify-center h-full text-[#555] text-sm",children:"No messages yet"}),v.map((S,R)=>O.jsx(N2,{entry:S},S.toolUseId??`${S.role}-${S.timestamp??R}`)),O.jsx("div",{ref:C})]}),y&&O.jsx("button",{onClick:p,className:"absolute bottom-4 right-4 bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#00e5ff] rounded-full w-10 h-10 flex items-center justify-center shadow-lg border border-[#1a1a2e] transition-colors z-10",title:"Scroll to bottom",children:"↓"})]})}var Yu={exports:{}},cp;function z2(){return cp||(cp=1,(function(i,r){(function(a,o){i.exports=o()})(globalThis,(()=>(()=>{var a={4567:function(T,c,h){var u=this&&this.__decorate||function(f,v,S,R){var D,M=arguments.length,A=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(f,v,S,R);else for(var B=f.length-1;B>=0;B--)(D=f[B])&&(A=(M<3?D(A):M>3?D(v,S,A):D(v,S))||A);return M>3&&A&&Object.defineProperty(v,S,A),A},y=this&&this.__param||function(f,v){return function(S,R){v(S,R,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const m=h(9042),C=h(9924),w=h(844),E=h(4725),b=h(2585),d=h(3656);let p=c.AccessibilityManager=class extends w.Disposable{constructor(f,v,S,R){super(),this._terminal=f,this._coreBrowserService=S,this._renderService=R,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 D=0;D<this._terminal.rows;D++)this._rowElements[D]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[D]);if(this._topBoundaryFocusListener=D=>this._handleBoundaryFocus(D,0),this._bottomBoundaryFocusListener=D=>this._handleBoundaryFocus(D,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 C.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((D=>this._handleResize(D.rows)))),this.register(this._terminal.onRender((D=>this._refreshRows(D.start,D.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((D=>this._handleChar(D)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
255
|
+
`)))),this.register(this._terminal.onA11yTab((D=>this._handleTab(D)))),this.register(this._terminal.onKey((D=>this._handleKey(D.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,d.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(f){for(let v=0;v<f;v++)this._handleChar(" ")}_handleChar(f){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==f&&(this._charsToAnnounce+=f):this._charsToAnnounce+=f,f===`
|
|
256
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=m.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(f){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(f)||this._charsToConsume.push(f)}_refreshRows(f,v){this._liveRegionDebouncer.refresh(f,v,this._terminal.rows)}_renderRows(f,v){const S=this._terminal.buffer,R=S.lines.length.toString();for(let D=f;D<=v;D++){const M=S.lines.get(S.ydisp+D),A=[],B=(M==null?void 0:M.translateToString(!0,void 0,void 0,A))||"",$=(S.ydisp+D+1).toString(),I=this._rowElements[D];I&&(B.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=B,this._rowColumns.set(I,A)),I.setAttribute("aria-posinset",$),I.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,v){const S=f.target,R=this._rowElements[v===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==R)return;let D,M;if(v===0?(D=S,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(D=this._rowElements.shift(),M=S,this._rowContainer.removeChild(D)),D.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),v===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(v===0?-1:1),this._rowElements[v===0?1:this._rowElements.length-2].focus(),f.preventDefault(),f.stopImmediatePropagation()}_handleSelectionChange(){var B;if(this._rowElements.length===0)return;const f=document.getSelection();if(!f)return;if(f.isCollapsed)return void(this._rowContainer.contains(f.anchorNode)&&this._terminal.clearSelection());if(!f.anchorNode||!f.focusNode)return void console.error("anchorNode and/or focusNode are null");let v={node:f.anchorNode,offset:f.anchorOffset},S={node:f.focusNode,offset:f.focusOffset};if((v.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===S.node&&v.offset>S.offset)&&([v,S]=[S,v]),v.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(v={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(v.node))return;const R=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:R,offset:((B=R.textContent)==null?void 0:B.length)??0}),!this._rowContainer.contains(S.node))return;const D=({node:$,offset:I})=>{const q=$ instanceof Text?$.parentNode:$;let P=parseInt(q==null?void 0:q.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const Q=this._rowColumns.get(q);if(!Q)return console.warn("columns is null. Race condition?"),null;let se=I<Q.length?Q[I]:Q.slice(-1)[0]+1;return se>=this._terminal.cols&&(++P,se=0),{row:P,column:se}},M=D(v),A=D(S);if(M&&A){if(M.row>A.row||M.row===A.row&&M.column>=A.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(A.row-M.row)*this._terminal.cols-M.column+A.column)}}_handleResize(f){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let v=this._rowContainer.children.length;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);for(;this._rowElements.length>f;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const f=this._coreBrowserService.mainDocument.createElement("div");return f.setAttribute("role","listitem"),f.tabIndex=-1,this._refreshRowDimensions(f),f}_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 f=0;f<this._terminal.rows;f++)this._refreshRowDimensions(this._rowElements[f])}}_refreshRowDimensions(f){f.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=p=u([y(1,b.IInstantiationService),y(2,E.ICoreBrowserService),y(3,E.IRenderService)],p)},3614:(T,c)=>{function h(C){return C.replace(/\r?\n/g,"\r")}function u(C,w){return w?"\x1B[200~"+C+"\x1B[201~":C}function y(C,w,E,b){C=u(C=h(C),E.decPrivateModes.bracketedPasteMode&&b.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(C,!0),w.value=""}function m(C,w,E){const b=E.getBoundingClientRect(),d=C.clientX-b.left-10,p=C.clientY-b.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${d}px`,w.style.top=`${p}px`,w.style.zIndex="1000",w.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(C,w){C.clipboardData&&C.clipboardData.setData("text/plain",w.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,w,E,b){C.stopPropagation(),C.clipboardData&&y(C.clipboardData.getData("text/plain"),w,E,b)},c.paste=y,c.moveTextAreaUnderMouseCursor=m,c.rightClickHandler=function(C,w,E,b,d){m(C,w,E),d&&b.rightClickSelect(C),w.value=b.selectionText,w.select()}},7239:(T,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,m,C){this._css.set(y,m,C)}getCss(y,m){return this._css.get(y,m)}setColor(y,m,C){this._color.set(y,m,C)}getColor(y,m){return this._color.get(y,m)}clear(){this._color.clear(),this._css.clear()}}},3656:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(h,u,y,m){h.addEventListener(u,y,m);let C=!1;return{dispose:()=>{C||(C=!0,h.removeEventListener(u,y,m))}}}},3551:function(T,c,h){var u=this&&this.__decorate||function(p,f,v,S){var R,D=arguments.length,M=D<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(p,f,v,S);else for(var A=p.length-1;A>=0;A--)(R=p[A])&&(M=(D<3?R(M):D>3?R(f,v,M):R(f,v))||M);return D>3&&M&&Object.defineProperty(f,v,M),M},y=this&&this.__param||function(p,f){return function(v,S){f(v,S,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const m=h(3656),C=h(8460),w=h(844),E=h(2585),b=h(4725);let d=c.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(p,f,v,S,R){super(),this._element=p,this._mouseService=f,this._renderService=v,this._bufferService=S,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new C.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new C.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{var D;this._lastMouseEvent=void 0,(D=this._activeProviderReplies)==null||D.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,m.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,m.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(p){this._lastMouseEvent=p;const f=this._positionFromMouseEvent(p,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const v=p.composedPath();for(let S=0;S<v.length;S++){const R=v[S];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(p){if(this._activeLine!==p.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(p,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,p)||(this._clearCurrentLink(),this._askForLink(p,!0))}_askForLink(p,f){var S,R;this._activeProviderReplies&&f||((S=this._activeProviderReplies)==null||S.forEach((D=>{D==null||D.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=p.y);let v=!1;for(const[D,M]of this._linkProviderService.linkProviders.entries())f?(R=this._activeProviderReplies)!=null&&R.get(D)&&(v=this._checkLinkProviderResult(D,p,v)):M.provideLinks(p.y,(A=>{var $,I;if(this._isMouseOut)return;const B=A==null?void 0:A.map((q=>({link:q})));($=this._activeProviderReplies)==null||$.set(D,B),v=this._checkLinkProviderResult(D,p,v),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)}))}_removeIntersectingLinks(p,f){const v=new Set;for(let S=0;S<f.size;S++){const R=f.get(S);if(R)for(let D=0;D<R.length;D++){const M=R[D],A=M.link.range.start.y<p?0:M.link.range.start.x,B=M.link.range.end.y>p?this._bufferService.cols:M.link.range.end.x;for(let $=A;$<=B;$++){if(v.has($)){R.splice(D--,1);break}v.add($)}}}}_checkLinkProviderResult(p,f,v){var D;if(!this._activeProviderReplies)return v;const S=this._activeProviderReplies.get(p);let R=!1;for(let M=0;M<p;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(R=!0);if(!R&&S){const M=S.find((A=>this._linkAtPosition(A.link,f)));M&&(v=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!v)for(let M=0;M<this._activeProviderReplies.size;M++){const A=(D=this._activeProviderReplies.get(M))==null?void 0:D.find((B=>this._linkAtPosition(B.link,f)));if(A){v=!0,this._handleNewLink(A);break}}return v}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(p){if(!this._currentLink)return;const f=this._positionFromMouseEvent(p,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(p,this._currentLink.link.text)}_clearCurrentLink(p,f){this._currentLink&&this._lastMouseEvent&&(!p||!f||this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(p){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(p.link,f)&&(this._currentLink=p,this._currentLink.state={decorations:{underline:p.link.decorations===void 0||p.link.decorations.underline,pointerCursor:p.link.decorations===void 0||p.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,p.link,this._lastMouseEvent),p.link.decorations={},Object.defineProperties(p.link.decorations,{pointerCursor:{get:()=>{var v,S;return(S=(v=this._currentLink)==null?void 0:v.state)==null?void 0:S.decorations.pointerCursor},set:v=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==v&&(this._currentLink.state.decorations.pointerCursor=v,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",v))}},underline:{get:()=>{var v,S;return(S=(v=this._currentLink)==null?void 0:v.state)==null?void 0:S.decorations.underline},set:v=>{var S,R,D;(S=this._currentLink)!=null&&S.state&&((D=(R=this._currentLink)==null?void 0:R.state)==null?void 0:D.decorations.underline)!==v&&(this._currentLink.state.decorations.underline=v,this._currentLink.state.isHovered&&this._fireUnderlineEvent(p.link,v))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((v=>{if(!this._currentLink)return;const S=v.start===0?0:v.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+v.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(S,R),this._lastMouseEvent)){const D=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);D&&this._askForLink(D,!1)}}))))}_linkHover(p,f,v){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&p.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(v,f.text)}_fireUnderlineEvent(p,f){const v=p.range,S=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(v.start.x-1,v.start.y-S-1,v.end.x,v.end.y-S-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(p,f,v){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&p.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(v,f.text)}_linkAtPosition(p,f){const v=p.range.start.y*this._bufferService.cols+p.range.start.x,S=p.range.end.y*this._bufferService.cols+p.range.end.x,R=f.y*this._bufferService.cols+f.x;return v<=R&&R<=S}_positionFromMouseEvent(p,f,v){const S=v.getCoords(p,f,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,f,v,S,R){return{x1:p,y1:f,x2:v,y2:S,cols:this._bufferService.cols,fg:R}}};c.Linkifier=d=u([y(1,b.IMouseService),y(2,b.IRenderService),y(3,E.IBufferService),y(4,b.ILinkProviderService)],d)},9042:(T,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(T,c,h){var u=this&&this.__decorate||function(b,d,p,f){var v,S=arguments.length,R=S<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,d,p,f);else for(var D=b.length-1;D>=0;D--)(v=b[D])&&(R=(S<3?v(R):S>3?v(d,p,R):v(d,p))||R);return S>3&&R&&Object.defineProperty(d,p,R),R},y=this&&this.__param||function(b,d){return function(p,f){d(p,f,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const m=h(511),C=h(2585);let w=c.OscLinkProvider=class{constructor(b,d,p){this._bufferService=b,this._optionsService=d,this._oscLinkService=p}provideLinks(b,d){var B;const p=this._bufferService.buffer.lines.get(b-1);if(!p)return void d(void 0);const f=[],v=this._optionsService.rawOptions.linkHandler,S=new m.CellData,R=p.getTrimmedLength();let D=-1,M=-1,A=!1;for(let $=0;$<R;$++)if(M!==-1||p.hasContent($)){if(p.loadCell($,S),S.hasExtendedAttrs()&&S.extended.urlId){if(M===-1){M=$,D=S.extended.urlId;continue}A=S.extended.urlId!==D}else M!==-1&&(A=!0);if(A||M!==-1&&$===R-1){const I=(B=this._oscLinkService.getLinkData(D))==null?void 0:B.uri;if(I){const q={start:{x:M+1,y:b},end:{x:$+(A||$!==R-1?0:1),y:b}};let P=!1;if(!(v!=null&&v.allowNonHttpProtocols))try{const Q=new URL(I);["http:","https:"].includes(Q.protocol)||(P=!0)}catch{P=!0}P||f.push({text:I,range:q,activate:(Q,se)=>v?v.activate(Q,se,q):E(0,se),hover:(Q,se)=>{var G;return(G=v==null?void 0:v.hover)==null?void 0:G.call(v,Q,se,q)},leave:(Q,se)=>{var G;return(G=v==null?void 0:v.leave)==null?void 0:G.call(v,Q,se,q)}})}A=!1,S.hasExtendedAttrs()&&S.extended.urlId?(M=$,D=S.extended.urlId):(M=-1,D=-1)}}d(f)}};function E(b,d){if(confirm(`Do you want to navigate to ${d}?
|
|
257
257
|
|
|
258
|
-
WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=x=u([y(0,C.IBufferService),y(1,C.IOptionsService),y(2,C.IOscLinkService)],x)},6193:(T,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:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const u=h(3614),y=h(3656),m=h(3551),C=h(9042),x=h(3730),E=h(1680),b=h(3107),d=h(5744),p=h(2950),f=h(1296),v=h(428),S=h(4269),R=h(5114),D=h(8934),M=h(3230),A=h(9312),B=h(4725),$=h(6731),I=h(8055),q=h(8969),P=h(8460),Q=h(844),se=h(6114),G=h(8437),K=h(2584),ee=h(7399),N=h(5941),U=h(9074),L=h(2585),H=h(5435),X=h(4567),ne=h(779);class he extends q.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(Y={}){super(Y),this.browser=se,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Q.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(U.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(B.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((j,ce)=>this.refresh(j,ce)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((j=>this._reportWindowsOptions(j)))),this.register(this._inputHandler.onColor((j=>this._handleColorEvent(j)))),this.register((0,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((j=>this._afterResize(j.cols,j.rows)))),this.register((0,Q.toDisposable)((()=>{var j,ce;this._customKeyEventHandler=void 0,(ce=(j=this.element)==null?void 0:j.parentNode)==null||ce.removeChild(this.element)})))}_handleColorEvent(Y){if(this._themeService)for(const j of Y){let ce,oe="";switch(j.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;"+j.index}switch(j.type){case 0:const ve=I.color.toColorRGB(ce==="ansi"?this._themeService.colors.ansi[j.index]:this._themeService.colors[ce]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${oe};${(0,N.toRgbString)(ve)}${K.C1_ESCAPED.ST}`);break;case 1:if(ce==="ansi")this._themeService.modifyColors((pe=>pe.ansi[j.index]=I.channels.toColor(...j.color)));else{const pe=ce;this._themeService.modifyColors((Te=>Te[pe]=I.channels.toColor(...j.color)))}break;case 2:this._themeService.restoreColor(j.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Y){Y?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(X.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Y){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Y;return(Y=this.textarea)==null?void 0:Y.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.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 Y=this.buffer.ybase+this.buffer.y,j=this.buffer.lines.get(Y);if(!j)return;const ce=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,ve=j.getWidth(ce),pe=this._renderService.dimensions.css.cell.width*ve,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=pe+"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",(j=>{this.hasSelection()&&(0,u.copyHandler)(j,this._selectionService)})));const Y=j=>(0,u.handlePasteEvent)(j,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",Y)),this.register((0,y.addDisposableDomListener)(this.element,"paste",Y)),se.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(j=>{j.button===2&&(0,u.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(j=>{(0,u.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),se.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(j=>{j.button===1&&(0,u.moveTextAreaUnderMouseCursor)(j,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(Y=>this._keyUp(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(Y=>this._keyDown(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(Y=>this._keyPress(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(Y=>this._compositionHelper.compositionupdate(Y)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(Y=>this._inputEvent(Y)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Y){var ce;if(!Y)throw new Error("Terminal requires a parent element.");if(Y.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=Y.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"),Y.appendChild(this.element);const j=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),j.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),j.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.promptLabel),se.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(R.CoreBrowserService,this.textarea,Y.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(B.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(v.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(B.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance($.ThemeService),this._instantiationService.setService(B.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(B.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(B.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(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(D.MouseService),this._instantiationService.setService(B.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(m.Linkifier,this.screenElement)),this.element.appendChild(j);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(E.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(A.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(B.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(b.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(X.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Y=this,j=this.element;function ce(pe){const Te=Y._mouseService.getMouseReportCoords(pe,Y.screenElement);if(!Te)return!1;let je,Ue;switch(pe.overrideType||pe.type){case"mousemove":Ue=32,pe.buttons===void 0?(je=3,pe.button!==void 0&&(je=pe.button<3?pe.button:3)):je=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":Ue=0,je=pe.button<3?pe.button:3;break;case"mousedown":Ue=1,je=pe.button<3?pe.button:3;break;case"wheel":if(Y._customWheelEventHandler&&Y._customWheelEventHandler(pe)===!1||Y.viewport.getLinesScrolled(pe)===0)return!1;Ue=pe.deltaY<0?0:1,je=4;break;default:return!1}return!(Ue===void 0||je===void 0||je>4)&&Y.coreMouseService.triggerMouseEvent({col:Te.col,row:Te.row,x:Te.x,y:Te.y,button:je,action:Ue,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ve={mouseup:pe=>(ce(pe),pe.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(pe)),wheel:pe=>(ce(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&ce(pe)},mousemove:pe=>{pe.buttons||ce(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),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&pe?oe.mousemove||(j.addEventListener("mousemove",ve.mousemove),oe.mousemove=ve.mousemove):(j.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&pe?oe.wheel||(j.addEventListener("wheel",ve.wheel,{passive:!1}),oe.wheel=ve.wheel):(j.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&pe?oe.mouseup||(oe.mouseup=ve.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&pe?oe.mousedrag||(oe.mousedrag=ve.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(j,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return ce(pe),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(pe)}))),this.register((0,y.addDisposableDomListener)(j,"wheel",(pe=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Te=this.viewport.getLinesScrolled(pe);if(Te===0)return;const je=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let Ue="";for(let ct=0;ct<Math.abs(Te);ct++)Ue+=je;return this.coreService.triggerDataEvent(Ue,!0),this.cancel(pe,!0)}return this.viewport.handleWheel(pe)?this.cancel(pe):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(j,"touchstart",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(j,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(Y,j){var ce;(ce=this._renderService)==null||ce.refreshRows(Y,j)}updateCursorStyle(Y){var j;(j=this._selectionService)!=null&&j.shouldColumnSelect(Y)?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(Y,j,ce=0){var oe;ce===1?(super.scrollLines(Y,j,ce),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(Y)}paste(Y){(0,u.paste)(Y,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Y){this._customKeyEventHandler=Y}attachCustomWheelEventHandler(Y){this._customWheelEventHandler=Y}registerLinkProvider(Y){return this._linkProviderService.registerLinkProvider(Y)}registerCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const j=this._characterJoinerService.register(Y);return this.refresh(0,this.rows-1),j}deregisterCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Y)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Y){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Y)}registerDecoration(Y){return this._decorationService.registerDecoration(Y)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Y,j,ce){this._selectionService.setSelection(Y,j,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 Y;(Y=this._selectionService)==null||Y.clearSelection()}selectAll(){var Y;(Y=this._selectionService)==null||Y.selectAll()}selectLines(Y,j){var ce;(ce=this._selectionService)==null||ce.selectLines(Y,j)}_keyDown(Y){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;const j=this.browser.isMac&&this.options.macOptionIsMeta&&Y.altKey;if(!j&&!this._compositionHelper.keydown(Y))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;j||Y.key!=="Dead"&&Y.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ce=(0,ee.evaluateKeyboardEvent)(Y,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Y),ce.type===3||ce.type===2){const oe=this.rows-1;return this.scrollLines(ce.type===2?-oe:oe),this.cancel(Y,!0)}return ce.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Y)||(ce.cancel&&this.cancel(Y,!0),!ce.key||!!(Y.key&&!Y.ctrlKey&&!Y.altKey&&!Y.metaKey&&Y.key.length===1&&Y.key.charCodeAt(0)>=65&&Y.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ce.key!==K.C0.ETX&&ce.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ce.key,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(ce.key,!0),!this.optionsService.rawOptions.screenReaderMode||Y.altKey||Y.ctrlKey?this.cancel(Y,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Y,j){const ce=Y.isMac&&!this.options.macOptionIsMeta&&j.altKey&&!j.ctrlKey&&!j.metaKey||Y.isWindows&&j.altKey&&j.ctrlKey&&!j.metaKey||Y.isWindows&&j.getModifierState("AltGraph");return j.type==="keypress"?ce:ce&&(!j.keyCode||j.keyCode>47)}_keyUp(Y){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1||((function(j){return j.keyCode===16||j.keyCode===17||j.keyCode===18})(Y)||this.focus(),this.updateCursorStyle(Y),this._keyPressHandled=!1)}_keyPress(Y){let j;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;if(this.cancel(Y),Y.charCode)j=Y.charCode;else if(Y.which===null||Y.which===void 0)j=Y.keyCode;else{if(Y.which===0||Y.charCode===0)return!1;j=Y.which}return!(!j||(Y.altKey||Y.ctrlKey||Y.metaKey)&&!this._isThirdLevelShift(this.browser,Y)||(j=String.fromCharCode(j),this._onKey.fire({key:j,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(j,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Y){if(Y.data&&Y.inputType==="insertText"&&(!Y.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const j=Y.data;return this.coreService.triggerDataEvent(j,!0),this.cancel(Y),!0}return!1}resize(Y,j){Y!==this.cols||j!==this.rows?super.resize(Y,j):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Y,j){var ce,oe;(ce=this._charSizeService)==null||ce.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var Y;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 j=1;j<this.rows;j++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Y=this.viewport)==null||Y.reset(),this.refresh(0,this.rows-1)}}reset(){var j,ce;this.options.rows=this.rows,this.options.cols=this.cols;const Y=this._customKeyEventHandler;this._setup(),super.reset(),(j=this._selectionService)==null||j.reset(),this._decorationService.reset(),(ce=this.viewport)==null||ce.reset(),this._customKeyEventHandler=Y,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Y;(Y=this._renderService)==null||Y.clearTextureAtlas()}_reportFocus(){var Y;(Y=this.element)!=null&&Y.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(Y){if(this._renderService)switch(Y){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const j=this._renderService.dimensions.css.canvas.width.toFixed(0),ce=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${ce};${j}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const oe=this._renderService.dimensions.css.cell.width.toFixed(0),ve=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${ve};${oe}t`)}}cancel(Y,j){if(this.options.cancelEvents||j)return Y.preventDefault(),Y.stopPropagation(),!1}}c.Terminal=he},9924:(T,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 m=Date.now();if(m-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=m,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=m-this._lastRefreshMs,x=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_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(T,c,h){var u=this&&this.__decorate||function(p,f,v,S){var R,D=arguments.length,M=D<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(p,f,v,S);else for(var A=p.length-1;A>=0;A--)(R=p[A])&&(M=(D<3?R(M):D>3?R(f,v,M):R(f,v))||M);return D>3&&M&&Object.defineProperty(f,v,M),M},y=this&&this.__param||function(p,f){return function(v,S){f(v,S,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const m=h(3656),C=h(4725),x=h(8460),E=h(844),b=h(2585);let d=c.Viewport=class extends E.Disposable{constructor(p,f,v,S,R,D,M,A){super(),this._viewportElement=p,this._scrollArea=f,this._bufferService=v,this._optionsService=S,this._charSizeService=R,this._renderService=D,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 x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((B=>this._renderDimensions=B))),this._handleThemeChange(A.colors),this.register(A.onChangeColors((B=>this._handleThemeChange(B)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.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(p){if(p)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 f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){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 f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<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(p,f){const v=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&v<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const f=this._getPixelsScrolled(p);return f!==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+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=p*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(p,f){var A;let v,S="";const R=[],D=f??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let B=p;B<D;B++){const $=M.get(B);if(!$)continue;const I=(A=M.get(B+1))==null?void 0:A.isWrapped;if(S+=$.translateToString(!I),!I||B===M.length-1){const q=document.createElement("div");q.textContent=S,R.push(q),S.length>0&&(v=q),S=""}}return{bufferElements:R,cursorElement:v}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(p,f){const v=this._optionsService.rawOptions.fastScrollModifier;return v==="alt"&&f.altKey||v==="ctrl"&&f.ctrlKey||v==="shift"&&f.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const f=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}};c.Viewport=d=u([y(2,b.IBufferService),y(3,b.IOptionsService),y(4,C.ICharSizeService),y(5,C.IRenderService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],d)},3107:function(T,c,h){var u=this&&this.__decorate||function(b,d,p,f){var v,S=arguments.length,R=S<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,d,p,f);else for(var D=b.length-1;D>=0;D--)(v=b[D])&&(R=(S<3?v(R):S>3?v(d,p,R):v(d,p))||R);return S>3&&R&&Object.defineProperty(d,p,R),R},y=this&&this.__param||function(b,d){return function(p,f){d(p,f,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const m=h(4725),C=h(844),x=h(2585);let E=c.BufferDecorationRenderer=class extends C.Disposable{constructor(b,d,p,f,v){super(),this._screenElement=b,this._bufferService=d,this._coreBrowserService=p,this._decorationService=f,this._renderService=v,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,C.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 b of this._decorationService.decorations)this._renderDecoration(b);this._dimensionsChanged=!1}_renderDecoration(b){this._refreshStyle(b),this._dimensionsChanged&&this._refreshXPosition(b)}_createElement(b){var f;const d=this._coreBrowserService.mainDocument.createElement("div");d.classList.add("xterm-decoration"),d.classList.toggle("xterm-decoration-top-layer",((f=b==null?void 0:b.options)==null?void 0:f.layer)==="top"),d.style.width=`${Math.round((b.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,d.style.height=(b.options.height||1)*this._renderService.dimensions.css.cell.height+"px",d.style.top=(b.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",d.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const p=b.options.x??0;return p&&p>this._bufferService.cols&&(d.style.display="none"),this._refreshXPosition(b,d),d}_refreshStyle(b){const d=b.marker.line-this._bufferService.buffers.active.ydisp;if(d<0||d>=this._bufferService.rows)b.element&&(b.element.style.display="none",b.onRenderEmitter.fire(b.element));else{let p=this._decorationElements.get(b);p||(p=this._createElement(b),b.element=p,this._decorationElements.set(b,p),this._container.appendChild(p),b.onDispose((()=>{this._decorationElements.delete(b),p.remove()}))),p.style.top=d*this._renderService.dimensions.css.cell.height+"px",p.style.display=this._altBufferIsActive?"none":"block",b.onRenderEmitter.fire(p)}}_refreshXPosition(b,d=b.element){if(!d)return;const p=b.options.x??0;(b.options.anchor||"left")==="right"?d.style.right=p?p*this._renderService.dimensions.css.cell.width+"px":"":d.style.left=p?p*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(b){var d;(d=this._decorationElements.get(b))==null||d.remove(),this._decorationElements.delete(b),b.dispose()}};c.BufferDecorationRenderer=E=u([y(1,x.IBufferService),y(2,m.ICoreBrowserService),y(3,x.IDecorationService),y(4,m.IRenderService)],E)},5871:(T,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(T,c,h){var u=this&&this.__decorate||function(v,S,R,D){var M,A=arguments.length,B=A<3?S:D===null?D=Object.getOwnPropertyDescriptor(S,R):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(v,S,R,D);else for(var $=v.length-1;$>=0;$--)(M=v[$])&&(B=(A<3?M(B):A>3?M(S,R,B):M(S,R))||B);return A>3&&B&&Object.defineProperty(S,R,B),B},y=this&&this.__param||function(v,S){return function(R,D){S(R,D,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const m=h(5871),C=h(4725),x=h(844),E=h(2585),b={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0};let f=c.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(v,S,R,D,M,A,B){var I;super(),this._viewportElement=v,this._screenElement=S,this._bufferService=R,this._decorationService=D,this._renderService=M,this._optionsService=A,this._coreBrowserService=B,this._colorZoneStore=new m.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const $=this._canvas.getContext("2d");if(!$)throw new Error("Ctx cannot be null");this._ctx=$,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{var q;(q=this._canvas)==null||q.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 v=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=v,d.center=S,d.right=v,this._refreshDrawHeightConstants(),p.full=0,p.left=0,p.center=d.left,p.right=d.left+d.center}_refreshDrawHeightConstants(){b.full=Math.round(2*this._coreBrowserService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowserService.dpr);b.left=S,b.center=S,b.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.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 v=this._colorZoneStore.zones;for(const S of v)S.position!=="full"&&this._renderColorZone(S);for(const S of v)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(v){this._ctx.fillStyle=v.color,this._ctx.fillRect(p[v.position||"full"],Math.round((this._canvas.height-1)*(v.startBufferLine/this._bufferService.buffers.active.lines.length)-b[v.position||"full"]/2),d[v.position||"full"],Math.round((this._canvas.height-1)*((v.endBufferLine-v.startBufferLine)/this._bufferService.buffers.active.lines.length)+b[v.position||"full"]))}_queueRefresh(v,S){this._shouldUpdateDimensions=v||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=f=u([y(2,E.IBufferService),y(3,E.IDecorationService),y(4,C.IRenderService),y(5,E.IOptionsService),y(6,C.ICoreBrowserService)],f)},2950:function(T,c,h){var u=this&&this.__decorate||function(b,d,p,f){var v,S=arguments.length,R=S<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,d,p,f);else for(var D=b.length-1;D>=0;D--)(v=b[D])&&(R=(S<3?v(R):S>3?v(d,p,R):v(d,p))||R);return S>3&&R&&Object.defineProperty(d,p,R),R},y=this&&this.__param||function(b,d){return function(p,f){d(p,f,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const m=h(4725),C=h(2585),x=h(2584);let E=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(b,d,p,f,v,S){this._textarea=b,this._compositionView=d,this._bufferService=p,this._optionsService=f,this._coreService=v,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(b){this._compositionView.textContent=b.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(b){if(this._isComposing||this._isSendingComposition){if(b.keyCode===229||b.keyCode===16||b.keyCode===17||b.keyCode===18)return!1;this._finalizeComposition(!1)}return b.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(b){if(this._compositionView.classList.remove("active"),this._isComposing=!1,b){const d={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,d.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(d.start,d.end):this._textarea.value.substring(d.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}}),0)}else{this._isSendingComposition=!1;const d=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(d,!0)}}_handleAnyTextareaChanges(){const b=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const d=this._textarea.value,p=d.replace(b,"");this._dataAlreadySent=p,d.length>b.length?this._coreService.triggerDataEvent(p,!0):d.length<b.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):d.length===b.length&&d!==b&&this._coreService.triggerDataEvent(d,!0)}}),0)}updateCompositionElements(b){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const d=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,v=d*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=v+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"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=v+"px",this._textarea.style.top=f+"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"}b||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=E=u([y(2,C.IBufferService),y(3,C.IOptionsService),y(4,C.ICoreService),y(5,m.IRenderService)],E)},9806:(T,c)=>{function h(u,y,m){const C=m.getBoundingClientRect(),x=u.getComputedStyle(m),E=parseInt(x.getPropertyValue("padding-left")),b=parseInt(x.getPropertyValue("padding-top"));return[y.clientX-C.left-E,y.clientY-C.top-b]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=h,c.getCoords=function(u,y,m,C,x,E,b,d,p){if(!E)return;const f=h(u,y,m);return f?(f[0]=Math.ceil((f[0]+(p?b/2:0))/b),f[1]=Math.ceil(f[1]/d),f[0]=Math.min(Math.max(f[0],1),C+(p?1:0)),f[1]=Math.min(Math.max(f[1],1),x),f):void 0}},9504:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const u=h(2584);function y(d,p,f,v){const S=d-m(d,f),R=p-m(p,f),D=Math.abs(S-R)-(function(M,A,B){let $=0;const I=M-m(M,B),q=A-m(A,B);for(let P=0;P<Math.abs(I-q);P++){const Q=C(M,A)==="A"?-1:1,se=B.buffer.lines.get(I+Q*P);se!=null&&se.isWrapped&&$++}return $})(d,p,f);return b(D,E(C(d,p),v))}function m(d,p){let f=0,v=p.buffer.lines.get(d),S=v==null?void 0:v.isWrapped;for(;S&&d>=0&&d<p.rows;)f++,v=p.buffer.lines.get(--d),S=v==null?void 0:v.isWrapped;return f}function C(d,p){return d>p?"A":"B"}function x(d,p,f,v,S,R){let D=d,M=p,A="";for(;D!==f||M!==v;)D+=S?1:-1,S&&D>R.cols-1?(A+=R.buffer.translateBufferLineToString(M,!1,d,D),D=0,d=0,M++):!S&&D<0&&(A+=R.buffer.translateBufferLineToString(M,!1,0,d+1),D=R.cols-1,d=D,M--);return A+R.buffer.translateBufferLineToString(M,!1,d,D)}function E(d,p){const f=p?"O":"[";return u.C0.ESC+f+d}function b(d,p){d=Math.floor(d);let f="";for(let v=0;v<d;v++)f+=p;return f}c.moveToCellSequence=function(d,p,f,v){const S=f.buffer.x,R=f.buffer.y;if(!f.buffer.hasScrollback)return(function(A,B,$,I,q,P){return y(B,I,q,P).length===0?"":b(x(A,B,A,B-m(B,q),!1,q).length,E("D",P))})(S,R,0,p,f,v)+y(R,p,f,v)+(function(A,B,$,I,q,P){let Q;Q=y(B,I,q,P).length>0?I-m(I,q):B;const se=I,G=(function(K,ee,N,U,L,H){let X;return X=y(N,U,L,H).length>0?U-m(U,L):ee,K<N&&X<=U||K>=N&&X<U?"C":"D"})(A,B,$,I,q,P);return b(x(A,Q,$,se,G==="C",q).length,E(G,P))})(S,R,d,p,f,v);let D;if(R===p)return D=S>d?"D":"C",b(Math.abs(S-d),E(D,v));D=R>p?"D":"C";const M=Math.abs(R-p);return b((function(A,B){return B.cols-A})(R>p?d:S,f)+(M-1)*f.cols+1+((R>p?S:d)-1),E(D,v))}},1296:function(T,c,h){var u=this&&this.__decorate||function(P,Q,se,G){var K,ee=arguments.length,N=ee<3?Q:G===null?G=Object.getOwnPropertyDescriptor(Q,se):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(P,Q,se,G);else for(var U=P.length-1;U>=0;U--)(K=P[U])&&(N=(ee<3?K(N):ee>3?K(Q,se,N):K(Q,se))||N);return ee>3&&N&&Object.defineProperty(Q,se,N),N},y=this&&this.__param||function(P,Q){return function(se,G){Q(se,G,P)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const m=h(3787),C=h(2550),x=h(2223),E=h(6171),b=h(6052),d=h(4725),p=h(8055),f=h(8460),v=h(844),S=h(2585),R="xterm-dom-renderer-owner-",D="xterm-rows",M="xterm-fg-",A="xterm-bg-",B="xterm-focus",$="xterm-selection";let I=1,q=c.DomRenderer=class extends v.Disposable{constructor(P,Q,se,G,K,ee,N,U,L,H,X,ne,he){super(),this._terminal=P,this._document=Q,this._element=se,this._screenElement=G,this._viewportElement=K,this._helperContainer=ee,this._linkifier2=N,this._charSizeService=L,this._optionsService=H,this._bufferService=X,this._coreBrowserService=ne,this._themeService=he,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,b.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(D),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,E.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((me=>this._injectCss(me)))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(m.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((me=>this._handleLinkHover(me)))),this.register(this._linkifier2.onHideLinkUnderline((me=>this._handleLinkLeave(me)))),this.register((0,v.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new C.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 P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),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/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),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 se of this._rowElements)se.style.width=`${this.dimensions.css.canvas.width}px`,se.style.height=`${this.dimensions.css.cell.height}px`,se.style.lineHeight=`${this.dimensions.css.cell.height}px`,se.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Q=`${this._terminalSelector} .${D} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Q,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(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Q=`${this._terminalSelector} .${D} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Q+=`${this._terminalSelector} .${D} .xterm-dim { color: ${p.color.multiplyOpacity(P.foreground,.5).css};}`,Q+=`${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 se=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;Q+=`@keyframes ${se} { 50% { border-bottom-style: hidden; }}`,Q+=`@keyframes ${G} { 50% { box-shadow: none; }}`,Q+=`@keyframes ${K} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,Q+=`${this._terminalSelector} .${D}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${se} 1s step-end infinite;}${this._terminalSelector} .${D}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${D}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Q+=`${this._terminalSelector} .${$} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${$} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${$} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,N]of P.ansi.entries())Q+=`${this._terminalSelector} .${M}${ee} { color: ${N.css}; }${this._terminalSelector} .${M}${ee}.xterm-dim { color: ${p.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${A}${ee} { background-color: ${N.css}; }`;Q+=`${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque(P.background).css}; }${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${A}${x.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=Q}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,Q){for(let se=this._rowElements.length;se<=Q;se++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>Q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,Q){this._refreshRowElements(P,Q),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(B),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(B),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,Q,se){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,Q,se),this.renderRows(0,this._bufferService.rows-1),!P||!Q)return;this._selectionRenderModel.update(this._terminal,P,Q,se);const G=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,N=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||N<0)return;const U=this._document.createDocumentFragment();if(se){const L=P[0]>Q[0];U.appendChild(this._createSelectionElement(ee,L?Q[0]:P[0],L?P[0]:Q[0],N-ee+1))}else{const L=G===ee?P[0]:0,H=ee===K?Q[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(ee,L,H));const X=N-ee-1;if(U.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,X)),ee!==N){const ne=K===N?Q[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(N,0,ne))}}this._selectionContainer.appendChild(U)}_createSelectionElement(P,Q,se,G=1){const K=this._document.createElement("div"),ee=Q*this.dimensions.css.cell.width;let N=this.dimensions.css.cell.width*(se-Q);return ee+N>this.dimensions.css.canvas.width&&(N=this.dimensions.css.canvas.width-ee),K.style.height=G*this.dimensions.css.cell.height+"px",K.style.top=P*this.dimensions.css.cell.height+"px",K.style.left=`${ee}px`,K.style.width=`${N}px`,K}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 P of this._rowElements)P.replaceChildren()}renderRows(P,Q){const se=this._bufferService.buffer,G=se.ybase+se.y,K=Math.min(se.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=P;L<=Q;L++){const H=L+se.ydisp,X=this._rowElements[L],ne=se.lines.get(H);if(!X||!ne)break;X.replaceChildren(...this._rowFactory.createRow(ne,H,H===G,N,U,K,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,Q,se,G,K,ee){se<0&&(P=0),G<0&&(Q=0);const N=this._bufferService.rows-1;se=Math.max(Math.min(se,N),0),G=Math.max(Math.min(G,N),0),K=Math.min(K,this._bufferService.cols);const U=this._bufferService.buffer,L=U.ybase+U.y,H=Math.min(U.x,K-1),X=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=se;me<=G;++me){const Y=me+U.ydisp,j=this._rowElements[me],ce=U.lines.get(Y);if(!j||!ce)break;j.replaceChildren(...this._rowFactory.createRow(ce,Y,Y===L,ne,he,H,X,this.dimensions.css.cell.width,this._widthCache,ee?me===se?P:0:-1,ee?(me===G?Q:K)-1:-1))}}};c.DomRenderer=q=u([y(7,S.IInstantiationService),y(8,d.ICharSizeService),y(9,S.IOptionsService),y(10,S.IBufferService),y(11,d.ICoreBrowserService),y(12,d.IThemeService)],q)},3787:function(T,c,h){var u=this&&this.__decorate||function(D,M,A,B){var $,I=arguments.length,q=I<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,A):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(D,M,A,B);else for(var P=D.length-1;P>=0;P--)($=D[P])&&(q=(I<3?$(q):I>3?$(M,A,q):$(M,A))||q);return I>3&&q&&Object.defineProperty(M,A,q),q},y=this&&this.__param||function(D,M){return function(A,B){M(A,B,D)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const m=h(2223),C=h(643),x=h(511),E=h(2585),b=h(8055),d=h(4725),p=h(4269),f=h(6171),v=h(3734);let S=c.DomRendererRowFactory=class{constructor(D,M,A,B,$,I,q){this._document=D,this._characterJoinerService=M,this._optionsService=A,this._coreBrowserService=B,this._coreService=$,this._decorationService=I,this._themeService=q,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(D,M,A){this._selectionStart=D,this._selectionEnd=M,this._columnSelectMode=A}createRow(D,M,A,B,$,I,q,P,Q,se,G){const K=[],ee=this._characterJoinerService.getJoinedCharacters(M),N=this._themeService.colors;let U,L=D.getNoBgTrimmedLength();A&&L<I+1&&(L=I+1);let H=0,X="",ne=0,he=0,me=0,Y=!1,j=0,ce=!1,oe=0;const ve=[],pe=se!==-1&&G!==-1;for(let Te=0;Te<L;Te++){D.loadCell(Te,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let Ue=!1,ct=Te,Ee=this._workCell;if(ee.length>0&&Te===ee[0][0]){Ue=!0;const Ye=ee.shift();Ee=new p.JoinedCellData(this._workCell,D.translateToString(!0,Ye[0],Ye[1]),Ye[1]-Ye[0]),ct=Ye[1]-1,je=Ee.getWidth()}const Ft=this._isCellInSelection(Te,M),mi=A&&Te===I,pi=pe&&Te>=se&&Te<=G;let Ii=!1;this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ye=>{Ii=!0}));let Vi=Ee.getChars()||C.WHITESPACE_CELL_CHAR;if(Vi===" "&&(Ee.isUnderline()||Ee.isOverline())&&(Vi=" "),oe=je*P-Q.get(Vi,Ee.isBold(),Ee.isItalic()),U){if(H&&(Ft&&ce||!Ft&&!ce&&Ee.bg===ne)&&(Ft&&ce&&N.selectionForeground||Ee.fg===he)&&Ee.extended.ext===me&&pi===Y&&oe===j&&!mi&&!Ue&&!Ii){Ee.isInvisible()?X+=C.WHITESPACE_CELL_CHAR:X+=Vi,H++;continue}H&&(U.textContent=X),U=this._document.createElement("span"),H=0,X=""}else U=this._document.createElement("span");if(ne=Ee.bg,he=Ee.fg,me=Ee.extended.ext,Y=pi,j=oe,ce=Ft,Ue&&I>=Te&&I<=ct&&(I=Te),!this._coreService.isCursorHidden&&mi&&this._coreService.isCursorInitialized){if(ve.push("xterm-cursor"),this._coreBrowserService.isFocused)q&&ve.push("xterm-cursor-blink"),ve.push(B==="bar"?"xterm-cursor-bar":B==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){case"outline":ve.push("xterm-cursor-outline");break;case"block":ve.push("xterm-cursor-block");break;case"bar":ve.push("xterm-cursor-bar");break;case"underline":ve.push("xterm-cursor-underline")}}if(Ee.isBold()&&ve.push("xterm-bold"),Ee.isItalic()&&ve.push("xterm-italic"),Ee.isDim()&&ve.push("xterm-dim"),X=Ee.isInvisible()?C.WHITESPACE_CELL_CHAR:Ee.getChars()||C.WHITESPACE_CELL_CHAR,Ee.isUnderline()&&(ve.push(`xterm-underline-${Ee.extended.underlineStyle}`),X===" "&&(X=" "),!Ee.isUnderlineColorDefault()))if(Ee.isUnderlineColorRGB())U.style.textDecorationColor=`rgb(${v.AttributeData.toColorRGB(Ee.getUnderlineColor()).join(",")})`;else{let Ye=Ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ee.isBold()&&Ye<8&&(Ye+=8),U.style.textDecorationColor=N.ansi[Ye].css}Ee.isOverline()&&(ve.push("xterm-overline"),X===" "&&(X=" ")),Ee.isStrikethrough()&&ve.push("xterm-strikethrough"),pi&&(U.style.textDecoration="underline");let Pt=Ee.getFgColor(),nt=Ee.getFgColorMode(),Dt=Ee.getBgColor(),Zt=Ee.getBgColorMode();const Nt=!!Ee.isInverse();if(Nt){const Ye=Pt;Pt=Dt,Dt=Ye;const vi=nt;nt=Zt,Zt=vi}let Bt,Ki,Kt,Li=!1;switch(this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ye=>{Ye.options.layer!=="top"&&Li||(Ye.backgroundColorRGB&&(Zt=50331648,Dt=Ye.backgroundColorRGB.rgba>>8&16777215,Bt=Ye.backgroundColorRGB),Ye.foregroundColorRGB&&(nt=50331648,Pt=Ye.foregroundColorRGB.rgba>>8&16777215,Ki=Ye.foregroundColorRGB),Li=Ye.options.layer==="top")})),!Li&&Ft&&(Bt=this._coreBrowserService.isFocused?N.selectionBackgroundOpaque:N.selectionInactiveBackgroundOpaque,Dt=Bt.rgba>>8&16777215,Zt=50331648,Li=!0,N.selectionForeground&&(nt=50331648,Pt=N.selectionForeground.rgba>>8&16777215,Ki=N.selectionForeground)),Li&&ve.push("xterm-decoration-top"),Zt){case 16777216:case 33554432:Kt=N.ansi[Dt],ve.push(`xterm-bg-${Dt}`);break;case 50331648:Kt=b.channels.toColor(Dt>>16,Dt>>8&255,255&Dt),this._addStyle(U,`background-color:#${R((Dt>>>0).toString(16),"0",6)}`);break;default:Nt?(Kt=N.foreground,ve.push(`xterm-bg-${m.INVERTED_DEFAULT_COLOR}`)):Kt=N.background}switch(Bt||Ee.isDim()&&(Bt=b.color.multiplyOpacity(Kt,.5)),nt){case 16777216:case 33554432:Ee.isBold()&&Pt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Pt+=8),this._applyMinimumContrast(U,Kt,N.ansi[Pt],Ee,Bt,void 0)||ve.push(`xterm-fg-${Pt}`);break;case 50331648:const Ye=b.channels.toColor(Pt>>16&255,Pt>>8&255,255&Pt);this._applyMinimumContrast(U,Kt,Ye,Ee,Bt,Ki)||this._addStyle(U,`color:#${R(Pt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(U,Kt,N.foreground,Ee,Bt,Ki)||Nt&&ve.push(`xterm-fg-${m.INVERTED_DEFAULT_COLOR}`)}ve.length&&(U.className=ve.join(" "),ve.length=0),mi||Ue||Ii?U.textContent=X:H++,oe!==this.defaultSpacing&&(U.style.letterSpacing=`${oe}px`),K.push(U),Te=ct}return U&&H&&(U.textContent=X),K}_applyMinimumContrast(D,M,A,B,$,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const q=this._getContrastCache(B);let P;if($||I||(P=q.getColor(M.rgba,A.rgba)),P===void 0){const Q=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);P=b.color.ensureContrastRatio($||M,I||A,Q),q.setColor(($||M).rgba,(I||A).rgba,P??null)}return!!P&&(this._addStyle(D,`color:${P.css}`),!0)}_getContrastCache(D){return D.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(D,M){D.setAttribute("style",`${D.getAttribute("style")||""}${M};`)}_isCellInSelection(D,M){const A=this._selectionStart,B=this._selectionEnd;return!(!A||!B)&&(this._columnSelectMode?A[0]<=B[0]?D>=A[0]&&M>=A[1]&&D<B[0]&&M<=B[1]:D<A[0]&&M>=A[1]&&D>=B[0]&&M<=B[1]:M>A[1]&&M<B[1]||A[1]===B[1]&&M===A[1]&&D>=A[0]&&D<B[0]||A[1]<B[1]&&M===B[1]&&D<B[0]||A[1]<B[1]&&M===A[1]&&D>=A[0])}};function R(D,M,A){for(;D.length<A;)D=M+D;return D}c.DomRendererRowFactory=S=u([y(1,d.ICharacterJoinerService),y(2,E.IOptionsService),y(3,d.ICoreBrowserService),y(4,E.ICoreService),y(5,E.IDecorationService),y(6,d.IThemeService)],S)},2550:(T,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 m=h.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold";const C=h.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const x=h.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[y,m,C,x],this._container.appendChild(y),this._container.appendChild(m),this._container.appendChild(C),this._container.appendChild(x),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,m){h===this._font&&u===this._fontSize&&y===this._weight&&m===this._weightBold||(this._font=h,this._fontSize=u,this._weight=y,this._weightBold=m,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${m}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${m}`,this.clear())}get(h,u,y){let m=0;if(!u&&!y&&h.length===1&&(m=h.charCodeAt(0))<256){if(this._flat[m]!==-9999)return this._flat[m];const E=this._measure(h,0);return E>0&&(this._flat[m]=E),E}let C=h;u&&(C+="B"),y&&(C+="I");let x=this._holey.get(C);if(x===void 0){let E=0;u&&(E|=1),y&&(E|=2),x=this._measure(h,E),x>0&&this._holey.set(C,x)}return x}_measure(h,u){const y=this._measureElements[u];return y.textContent=h.repeat(32),y.offsetWidth/32}}},2223:(T,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:(T,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,m,C,x){return m===1&&C>Math.ceil(1.5*x)&&y!==void 0&&y>255&&!u(y)&&!h(y)&&!(function(E){return 57344<=E&&E<=63743})(y)},c.treatGlyphAsBackgroundColor=function(y){return h(y)||(function(m){return 9472<=m&&m<=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,m,C=0){return(y-(2*Math.round(m)-C))%(2*Math.round(m))}},6052:(T,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,m,C,x=!1){if(this.selectionStart=m,this.selectionEnd=C,!m||!C||m[0]===C[0]&&m[1]===C[1])return void this.clear();const E=y.buffers.active.ydisp,b=m[1]-E,d=C[1]-E,p=Math.max(b,0),f=Math.min(d,y.rows-1);p>=y.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=b,this.viewportEndRow=d,this.viewportCappedStartRow=p,this.viewportCappedEndRow=f,this.startCol=m[0],this.endCol=C[0])}isCellSelected(y,m,C){return!!this.hasSelection&&(C-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?m>=this.startCol&&C>=this.viewportCappedStartRow&&m<this.endCol&&C<=this.viewportCappedEndRow:m<this.startCol&&C>=this.viewportCappedStartRow&&m>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&m>=this.startCol&&m<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&m<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&m>=this.startCol)}}c.createSelectionRenderModel=function(){return new h}},456:(T,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(T,c,h){var u=this&&this.__decorate||function(f,v,S,R){var D,M=arguments.length,A=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(f,v,S,R);else for(var B=f.length-1;B>=0;B--)(D=f[B])&&(A=(M<3?D(A):M>3?D(v,S,A):D(v,S))||A);return M>3&&A&&Object.defineProperty(v,S,A),A},y=this&&this.__param||function(f,v){return function(S,R){v(S,R,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const m=h(2585),C=h(8460),x=h(844);let E=c.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,v,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new p(this._optionsService))}catch{this._measureStrategy=this.register(new d(f,v,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};c.CharSizeService=E=u([y(2,m.IOptionsService)],E);class b extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(v,S){v!==void 0&&v>0&&S!==void 0&&S>0&&(this._result.width=v,this._result.height=S)}}class d extends b{constructor(v,S,R){super(),this._document=v,this._parentElement=S,this._optionsService=R,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 p extends b{constructor(v){super(),this._optionsService=v,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 v=this._ctx.measureText("W");return this._validateAndSet(v.width,v.fontBoundingBoxAscent+v.fontBoundingBoxDescent),this._result}}},4269:function(T,c,h){var u=this&&this.__decorate||function(p,f,v,S){var R,D=arguments.length,M=D<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(p,f,v,S);else for(var A=p.length-1;A>=0;A--)(R=p[A])&&(M=(D<3?R(M):D>3?R(f,v,M):R(f,v))||M);return D>3&&M&&Object.defineProperty(f,v,M),M},y=this&&this.__param||function(p,f){return function(v,S){f(v,S,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const m=h(3734),C=h(643),x=h(511),E=h(2585);class b extends m.AttributeData{constructor(f,v,S){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=v,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=b;let d=c.CharacterJoinerService=class xv{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(f){const v={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(v),v.id}deregister(f){for(let v=0;v<this._characterJoiners.length;v++)if(this._characterJoiners[v].id===f)return this._characterJoiners.splice(v,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const v=this._bufferService.buffer.lines.get(f);if(!v||v.length===0)return[];const S=[],R=v.translateToString(!0);let D=0,M=0,A=0,B=v.getFg(0),$=v.getBg(0);for(let I=0;I<v.getTrimmedLength();I++)if(v.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==$){if(I-D>1){const q=this._getJoinedRanges(R,A,M,v,D);for(let P=0;P<q.length;P++)S.push(q[P])}D=I,A=M,B=this._workCell.fg,$=this._workCell.bg}M+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){const I=this._getJoinedRanges(R,A,M,v,D);for(let q=0;q<I.length;q++)S.push(I[q])}return S}_getJoinedRanges(f,v,S,R,D){const M=f.substring(v,S);let A=[];try{A=this._characterJoiners[0].handler(M)}catch(B){console.error(B)}for(let B=1;B<this._characterJoiners.length;B++)try{const $=this._characterJoiners[B].handler(M);for(let I=0;I<$.length;I++)xv._mergeRanges(A,$[I])}catch($){console.error($)}return this._stringRangesToCellRanges(A,R,D),A}_stringRangesToCellRanges(f,v,S){let R=0,D=!1,M=0,A=f[R];if(A){for(let B=S;B<this._bufferService.cols;B++){const $=v.getWidth(B),I=v.getString(B).length||C.WHITESPACE_CELL_CHAR.length;if($!==0){if(!D&&A[0]<=M&&(A[0]=B,D=!0),A[1]<=M){if(A[1]=B,A=f[++R],!A)break;A[0]<=M?(A[0]=B,D=!0):D=!1}M+=I}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(f,v){let S=!1;for(let R=0;R<f.length;R++){const D=f[R];if(S){if(v[1]<=D[0])return f[R-1][1]=v[1],f;if(v[1]<=D[1])return f[R-1][1]=Math.max(v[1],D[1]),f.splice(R,1),f;f.splice(R,1),R--}else{if(v[1]<=D[0])return f.splice(R,0,v),f;if(v[1]<=D[1])return D[0]=Math.min(v[0],D[0]),f;v[0]<D[1]&&(D[0]=Math.min(v[0],D[0]),S=!0)}}return S?f[f.length-1][1]=v[1]:f.push(v),f}};c.CharacterJoinerService=d=u([y(0,E.IBufferService)],d)},5114:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const u=h(844),y=h(8460),m=h(3656);class C extends u.Disposable{constructor(b,d,p){super(),this._textarea=b,this._window=d,this.mainDocument=p,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(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((f=>this._screenDprMonitor.setWindow(f)))),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(b){this._window!==b&&(this._window=b,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=C;class x extends u.Disposable{constructor(b){super(),this._parentWindow=b,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(b){this._parentWindow=b,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,m.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var b;this._outerListener&&((b=this._resolutionMediaMatchList)==null||b.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:(T,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(C){return this.linkProviders.push(C),{dispose:()=>{const x=this.linkProviders.indexOf(C);x!==-1&&this.linkProviders.splice(x,1)}}}}c.LinkProviderService=y},8934:function(T,c,h){var u=this&&this.__decorate||function(E,b,d,p){var f,v=arguments.length,S=v<3?b:p===null?p=Object.getOwnPropertyDescriptor(b,d):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(E,b,d,p);else for(var R=E.length-1;R>=0;R--)(f=E[R])&&(S=(v<3?f(S):v>3?f(b,d,S):f(b,d))||S);return v>3&&S&&Object.defineProperty(b,d,S),S},y=this&&this.__param||function(E,b){return function(d,p){b(d,p,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const m=h(4725),C=h(9806);let x=c.MouseService=class{constructor(E,b){this._renderService=E,this._charSizeService=b}getCoords(E,b,d,p,f){return(0,C.getCoords)(window,E,b,d,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(E,b){const d=(0,C.getCoordsRelativeToElement)(window,E,b);if(this._charSizeService.hasValidSize)return d[0]=Math.min(Math.max(d[0],0),this._renderService.dimensions.css.canvas.width-1),d[1]=Math.min(Math.max(d[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(d[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(d[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(d[0]),y:Math.floor(d[1])}}};c.MouseService=x=u([y(0,m.IRenderService),y(1,m.ICharSizeService)],x)},3230:function(T,c,h){var u=this&&this.__decorate||function(f,v,S,R){var D,M=arguments.length,A=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(f,v,S,R);else for(var B=f.length-1;B>=0;B--)(D=f[B])&&(A=(M<3?D(A):M>3?D(v,S,A):D(v,S))||A);return M>3&&A&&Object.defineProperty(v,S,A),A},y=this&&this.__param||function(f,v){return function(S,R){v(S,R,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const m=h(6193),C=h(4725),x=h(8460),E=h(844),b=h(7226),d=h(2585);let p=c.RenderService=class extends E.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,v,S,R,D,M,A,B){super(),this._rowCount=f,this._charSizeService=R,this._renderer=this.register(new E.MutableDisposable),this._pausedResizeTask=new b.DebouncedIdleTask,this._observerDisposable=this.register(new E.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 x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new m.RenderDebouncer((($,I)=>this._renderRows($,I)),A),this.register(this._renderDebouncer),this.register(A.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(D.onDecorationRegistered((()=>this._fullRefresh()))),this.register(D.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(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(A.window,v),this.register(A.onWindowChange(($=>this._registerIntersectionObserver($,v))))}_registerIntersectionObserver(f,v){if("IntersectionObserver"in f){const S=new f.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});S.observe(v),this._observerDisposable.value=(0,E.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(f){this._isPaused=f.isIntersecting===void 0?f.intersectionRatio===0:!f.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(f,v,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,v,this._rowCount))}_renderRows(f,v){this._renderer.value&&(f=Math.min(f,this._rowCount-1),v=Math.min(v,this._rowCount-1),this._renderer.value.renderRows(f,v),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:f,end:v}),this._onRender.fire({start:f,end:v}),this._isNextRenderRedrawOnly=!0)}resize(f,v){this._rowCount=v,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(f){this._renderer.value=f,this._renderer.value&&(this._renderer.value.onRequestRedraw((v=>this.refreshRows(v.start,v.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(f){return this._renderDebouncer.addRefreshCallback(f)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var f,v;this._renderer.value&&((v=(f=this._renderer.value).clearTextureAtlas)==null||v.call(f),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(f,v){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(f,v)})):this._renderer.value.handleResize(f,v),this._fullRefresh())}handleCharSizeChanged(){var f;(f=this._renderer.value)==null||f.handleCharSizeChanged()}handleBlur(){var f;(f=this._renderer.value)==null||f.handleBlur()}handleFocus(){var f;(f=this._renderer.value)==null||f.handleFocus()}handleSelectionChanged(f,v,S){var R;this._selectionState.start=f,this._selectionState.end=v,this._selectionState.columnSelectMode=S,(R=this._renderer.value)==null||R.handleSelectionChanged(f,v,S)}handleCursorMove(){var f;(f=this._renderer.value)==null||f.handleCursorMove()}clear(){var f;(f=this._renderer.value)==null||f.clear()}};c.RenderService=p=u([y(2,d.IOptionsService),y(3,C.ICharSizeService),y(4,d.IDecorationService),y(5,d.IBufferService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],p)},9312:function(T,c,h){var u=this&&this.__decorate||function(A,B,$,I){var q,P=arguments.length,Q=P<3?B:I===null?I=Object.getOwnPropertyDescriptor(B,$):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(A,B,$,I);else for(var se=A.length-1;se>=0;se--)(q=A[se])&&(Q=(P<3?q(Q):P>3?q(B,$,Q):q(B,$))||Q);return P>3&&Q&&Object.defineProperty(B,$,Q),Q},y=this&&this.__param||function(A,B){return function($,I){B($,I,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const m=h(9806),C=h(9504),x=h(456),E=h(4725),b=h(8460),d=h(844),p=h(6114),f=h(4841),v=h(511),S=h(2585),R=" ",D=new RegExp(R,"g");let M=c.SelectionService=class extends d.Disposable{constructor(A,B,$,I,q,P,Q,se,G){super(),this._element=A,this._screenElement=B,this._linkifier=$,this._bufferService=I,this._coreService=q,this._mouseService=P,this._optionsService=Q,this._renderService=se,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new v.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new b.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new b.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((K=>this._handleTrim(K))),this.register(this._bufferService.buffers.onBufferActivate((K=>this._handleBufferActivate(K)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,d.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 A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!A||!B||A[0]===B[0]&&A[1]===B[1])}get selectionText(){const A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!A||!B)return"";const $=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(A[0]===B[0])return"";const q=A[0]<B[0]?A[0]:B[0],P=A[0]<B[0]?B[0]:A[0];for(let Q=A[1];Q<=B[1];Q++){const se=$.translateBufferLineToString(Q,!0,q,P);I.push(se)}}else{const q=A[1]===B[1]?B[0]:void 0;I.push($.translateBufferLineToString(A[1],!0,A[0],q));for(let P=A[1]+1;P<=B[1]-1;P++){const Q=$.lines.get(P),se=$.translateBufferLineToString(P,!0);Q!=null&&Q.isWrapped?I[I.length-1]+=se:I.push(se)}if(A[1]!==B[1]){const P=$.lines.get(B[1]),Q=$.translateBufferLineToString(B[1],!0,0,B[0]);P&&P.isWrapped?I[I.length-1]+=Q:I.push(Q)}}return I.map((q=>q.replace(D," "))).join(p.isWindows?`\r
|
|
258
|
+
WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=w=u([y(0,C.IBufferService),y(1,C.IOptionsService),y(2,C.IOscLinkService)],w)},6193:(T,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:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const u=h(3614),y=h(3656),m=h(3551),C=h(9042),w=h(3730),E=h(1680),b=h(3107),d=h(5744),p=h(2950),f=h(1296),v=h(428),S=h(4269),R=h(5114),D=h(8934),M=h(3230),A=h(9312),B=h(4725),$=h(6731),I=h(8055),q=h(8969),P=h(8460),Q=h(844),se=h(6114),G=h(8437),K=h(2584),ee=h(7399),N=h(5941),U=h(9074),L=h(2585),H=h(5435),X=h(4567),ne=h(779);class he extends q.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(Y={}){super(Y),this.browser=se,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Q.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(U.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(B.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((j,ce)=>this.refresh(j,ce)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((j=>this._reportWindowsOptions(j)))),this.register(this._inputHandler.onColor((j=>this._handleColorEvent(j)))),this.register((0,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((j=>this._afterResize(j.cols,j.rows)))),this.register((0,Q.toDisposable)((()=>{var j,ce;this._customKeyEventHandler=void 0,(ce=(j=this.element)==null?void 0:j.parentNode)==null||ce.removeChild(this.element)})))}_handleColorEvent(Y){if(this._themeService)for(const j of Y){let ce,oe="";switch(j.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;"+j.index}switch(j.type){case 0:const ve=I.color.toColorRGB(ce==="ansi"?this._themeService.colors.ansi[j.index]:this._themeService.colors[ce]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${oe};${(0,N.toRgbString)(ve)}${K.C1_ESCAPED.ST}`);break;case 1:if(ce==="ansi")this._themeService.modifyColors((pe=>pe.ansi[j.index]=I.channels.toColor(...j.color)));else{const pe=ce;this._themeService.modifyColors((Te=>Te[pe]=I.channels.toColor(...j.color)))}break;case 2:this._themeService.restoreColor(j.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Y){Y?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(X.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Y){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Y;return(Y=this.textarea)==null?void 0:Y.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.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 Y=this.buffer.ybase+this.buffer.y,j=this.buffer.lines.get(Y);if(!j)return;const ce=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,ve=j.getWidth(ce),pe=this._renderService.dimensions.css.cell.width*ve,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=pe+"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",(j=>{this.hasSelection()&&(0,u.copyHandler)(j,this._selectionService)})));const Y=j=>(0,u.handlePasteEvent)(j,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",Y)),this.register((0,y.addDisposableDomListener)(this.element,"paste",Y)),se.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(j=>{j.button===2&&(0,u.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(j=>{(0,u.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),se.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(j=>{j.button===1&&(0,u.moveTextAreaUnderMouseCursor)(j,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(Y=>this._keyUp(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(Y=>this._keyDown(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(Y=>this._keyPress(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(Y=>this._compositionHelper.compositionupdate(Y)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(Y=>this._inputEvent(Y)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Y){var ce;if(!Y)throw new Error("Terminal requires a parent element.");if(Y.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=Y.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"),Y.appendChild(this.element);const j=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),j.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),j.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.promptLabel),se.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(R.CoreBrowserService,this.textarea,Y.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(B.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(v.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(B.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance($.ThemeService),this._instantiationService.setService(B.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(B.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(B.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(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(D.MouseService),this._instantiationService.setService(B.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(m.Linkifier,this.screenElement)),this.element.appendChild(j);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(E.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(A.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(B.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(b.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(X.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Y=this,j=this.element;function ce(pe){const Te=Y._mouseService.getMouseReportCoords(pe,Y.screenElement);if(!Te)return!1;let je,Ue;switch(pe.overrideType||pe.type){case"mousemove":Ue=32,pe.buttons===void 0?(je=3,pe.button!==void 0&&(je=pe.button<3?pe.button:3)):je=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":Ue=0,je=pe.button<3?pe.button:3;break;case"mousedown":Ue=1,je=pe.button<3?pe.button:3;break;case"wheel":if(Y._customWheelEventHandler&&Y._customWheelEventHandler(pe)===!1||Y.viewport.getLinesScrolled(pe)===0)return!1;Ue=pe.deltaY<0?0:1,je=4;break;default:return!1}return!(Ue===void 0||je===void 0||je>4)&&Y.coreMouseService.triggerMouseEvent({col:Te.col,row:Te.row,x:Te.x,y:Te.y,button:je,action:Ue,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ve={mouseup:pe=>(ce(pe),pe.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(pe)),wheel:pe=>(ce(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&ce(pe)},mousemove:pe=>{pe.buttons||ce(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),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&pe?oe.mousemove||(j.addEventListener("mousemove",ve.mousemove),oe.mousemove=ve.mousemove):(j.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&pe?oe.wheel||(j.addEventListener("wheel",ve.wheel,{passive:!1}),oe.wheel=ve.wheel):(j.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&pe?oe.mouseup||(oe.mouseup=ve.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&pe?oe.mousedrag||(oe.mousedrag=ve.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(j,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return ce(pe),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(pe)}))),this.register((0,y.addDisposableDomListener)(j,"wheel",(pe=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Te=this.viewport.getLinesScrolled(pe);if(Te===0)return;const je=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let Ue="";for(let ct=0;ct<Math.abs(Te);ct++)Ue+=je;return this.coreService.triggerDataEvent(Ue,!0),this.cancel(pe,!0)}return this.viewport.handleWheel(pe)?this.cancel(pe):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(j,"touchstart",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(j,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(Y,j){var ce;(ce=this._renderService)==null||ce.refreshRows(Y,j)}updateCursorStyle(Y){var j;(j=this._selectionService)!=null&&j.shouldColumnSelect(Y)?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(Y,j,ce=0){var oe;ce===1?(super.scrollLines(Y,j,ce),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(Y)}paste(Y){(0,u.paste)(Y,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Y){this._customKeyEventHandler=Y}attachCustomWheelEventHandler(Y){this._customWheelEventHandler=Y}registerLinkProvider(Y){return this._linkProviderService.registerLinkProvider(Y)}registerCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const j=this._characterJoinerService.register(Y);return this.refresh(0,this.rows-1),j}deregisterCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Y)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Y){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Y)}registerDecoration(Y){return this._decorationService.registerDecoration(Y)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Y,j,ce){this._selectionService.setSelection(Y,j,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 Y;(Y=this._selectionService)==null||Y.clearSelection()}selectAll(){var Y;(Y=this._selectionService)==null||Y.selectAll()}selectLines(Y,j){var ce;(ce=this._selectionService)==null||ce.selectLines(Y,j)}_keyDown(Y){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;const j=this.browser.isMac&&this.options.macOptionIsMeta&&Y.altKey;if(!j&&!this._compositionHelper.keydown(Y))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;j||Y.key!=="Dead"&&Y.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ce=(0,ee.evaluateKeyboardEvent)(Y,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Y),ce.type===3||ce.type===2){const oe=this.rows-1;return this.scrollLines(ce.type===2?-oe:oe),this.cancel(Y,!0)}return ce.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Y)||(ce.cancel&&this.cancel(Y,!0),!ce.key||!!(Y.key&&!Y.ctrlKey&&!Y.altKey&&!Y.metaKey&&Y.key.length===1&&Y.key.charCodeAt(0)>=65&&Y.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ce.key!==K.C0.ETX&&ce.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ce.key,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(ce.key,!0),!this.optionsService.rawOptions.screenReaderMode||Y.altKey||Y.ctrlKey?this.cancel(Y,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Y,j){const ce=Y.isMac&&!this.options.macOptionIsMeta&&j.altKey&&!j.ctrlKey&&!j.metaKey||Y.isWindows&&j.altKey&&j.ctrlKey&&!j.metaKey||Y.isWindows&&j.getModifierState("AltGraph");return j.type==="keypress"?ce:ce&&(!j.keyCode||j.keyCode>47)}_keyUp(Y){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1||((function(j){return j.keyCode===16||j.keyCode===17||j.keyCode===18})(Y)||this.focus(),this.updateCursorStyle(Y),this._keyPressHandled=!1)}_keyPress(Y){let j;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;if(this.cancel(Y),Y.charCode)j=Y.charCode;else if(Y.which===null||Y.which===void 0)j=Y.keyCode;else{if(Y.which===0||Y.charCode===0)return!1;j=Y.which}return!(!j||(Y.altKey||Y.ctrlKey||Y.metaKey)&&!this._isThirdLevelShift(this.browser,Y)||(j=String.fromCharCode(j),this._onKey.fire({key:j,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(j,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Y){if(Y.data&&Y.inputType==="insertText"&&(!Y.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const j=Y.data;return this.coreService.triggerDataEvent(j,!0),this.cancel(Y),!0}return!1}resize(Y,j){Y!==this.cols||j!==this.rows?super.resize(Y,j):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Y,j){var ce,oe;(ce=this._charSizeService)==null||ce.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var Y;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 j=1;j<this.rows;j++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Y=this.viewport)==null||Y.reset(),this.refresh(0,this.rows-1)}}reset(){var j,ce;this.options.rows=this.rows,this.options.cols=this.cols;const Y=this._customKeyEventHandler;this._setup(),super.reset(),(j=this._selectionService)==null||j.reset(),this._decorationService.reset(),(ce=this.viewport)==null||ce.reset(),this._customKeyEventHandler=Y,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Y;(Y=this._renderService)==null||Y.clearTextureAtlas()}_reportFocus(){var Y;(Y=this.element)!=null&&Y.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(Y){if(this._renderService)switch(Y){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const j=this._renderService.dimensions.css.canvas.width.toFixed(0),ce=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${ce};${j}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const oe=this._renderService.dimensions.css.cell.width.toFixed(0),ve=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${ve};${oe}t`)}}cancel(Y,j){if(this.options.cancelEvents||j)return Y.preventDefault(),Y.stopPropagation(),!1}}c.Terminal=he},9924:(T,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 m=Date.now();if(m-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=m,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=m-this._lastRefreshMs,w=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const h=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,u)}}},1680:function(T,c,h){var u=this&&this.__decorate||function(p,f,v,S){var R,D=arguments.length,M=D<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(p,f,v,S);else for(var A=p.length-1;A>=0;A--)(R=p[A])&&(M=(D<3?R(M):D>3?R(f,v,M):R(f,v))||M);return D>3&&M&&Object.defineProperty(f,v,M),M},y=this&&this.__param||function(p,f){return function(v,S){f(v,S,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const m=h(3656),C=h(4725),w=h(8460),E=h(844),b=h(2585);let d=c.Viewport=class extends E.Disposable{constructor(p,f,v,S,R,D,M,A){super(),this._viewportElement=p,this._scrollArea=f,this._bufferService=v,this._optionsService=S,this._charSizeService=R,this._renderService=D,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 w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((B=>this._renderDimensions=B))),this._handleThemeChange(A.colors),this.register(A.onChangeColors((B=>this._handleThemeChange(B)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.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(p){if(p)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 f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){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 f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<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(p,f){const v=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&v<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const f=this._getPixelsScrolled(p);return f!==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+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=p*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(p,f){var A;let v,S="";const R=[],D=f??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let B=p;B<D;B++){const $=M.get(B);if(!$)continue;const I=(A=M.get(B+1))==null?void 0:A.isWrapped;if(S+=$.translateToString(!I),!I||B===M.length-1){const q=document.createElement("div");q.textContent=S,R.push(q),S.length>0&&(v=q),S=""}}return{bufferElements:R,cursorElement:v}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(p,f){const v=this._optionsService.rawOptions.fastScrollModifier;return v==="alt"&&f.altKey||v==="ctrl"&&f.ctrlKey||v==="shift"&&f.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const f=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}};c.Viewport=d=u([y(2,b.IBufferService),y(3,b.IOptionsService),y(4,C.ICharSizeService),y(5,C.IRenderService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],d)},3107:function(T,c,h){var u=this&&this.__decorate||function(b,d,p,f){var v,S=arguments.length,R=S<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,d,p,f);else for(var D=b.length-1;D>=0;D--)(v=b[D])&&(R=(S<3?v(R):S>3?v(d,p,R):v(d,p))||R);return S>3&&R&&Object.defineProperty(d,p,R),R},y=this&&this.__param||function(b,d){return function(p,f){d(p,f,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const m=h(4725),C=h(844),w=h(2585);let E=c.BufferDecorationRenderer=class extends C.Disposable{constructor(b,d,p,f,v){super(),this._screenElement=b,this._bufferService=d,this._coreBrowserService=p,this._decorationService=f,this._renderService=v,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,C.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 b of this._decorationService.decorations)this._renderDecoration(b);this._dimensionsChanged=!1}_renderDecoration(b){this._refreshStyle(b),this._dimensionsChanged&&this._refreshXPosition(b)}_createElement(b){var f;const d=this._coreBrowserService.mainDocument.createElement("div");d.classList.add("xterm-decoration"),d.classList.toggle("xterm-decoration-top-layer",((f=b==null?void 0:b.options)==null?void 0:f.layer)==="top"),d.style.width=`${Math.round((b.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,d.style.height=(b.options.height||1)*this._renderService.dimensions.css.cell.height+"px",d.style.top=(b.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",d.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const p=b.options.x??0;return p&&p>this._bufferService.cols&&(d.style.display="none"),this._refreshXPosition(b,d),d}_refreshStyle(b){const d=b.marker.line-this._bufferService.buffers.active.ydisp;if(d<0||d>=this._bufferService.rows)b.element&&(b.element.style.display="none",b.onRenderEmitter.fire(b.element));else{let p=this._decorationElements.get(b);p||(p=this._createElement(b),b.element=p,this._decorationElements.set(b,p),this._container.appendChild(p),b.onDispose((()=>{this._decorationElements.delete(b),p.remove()}))),p.style.top=d*this._renderService.dimensions.css.cell.height+"px",p.style.display=this._altBufferIsActive?"none":"block",b.onRenderEmitter.fire(p)}}_refreshXPosition(b,d=b.element){if(!d)return;const p=b.options.x??0;(b.options.anchor||"left")==="right"?d.style.right=p?p*this._renderService.dimensions.css.cell.width+"px":"":d.style.left=p?p*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(b){var d;(d=this._decorationElements.get(b))==null||d.remove(),this._decorationElements.delete(b),b.dispose()}};c.BufferDecorationRenderer=E=u([y(1,w.IBufferService),y(2,m.ICoreBrowserService),y(3,w.IDecorationService),y(4,m.IRenderService)],E)},5871:(T,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(T,c,h){var u=this&&this.__decorate||function(v,S,R,D){var M,A=arguments.length,B=A<3?S:D===null?D=Object.getOwnPropertyDescriptor(S,R):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(v,S,R,D);else for(var $=v.length-1;$>=0;$--)(M=v[$])&&(B=(A<3?M(B):A>3?M(S,R,B):M(S,R))||B);return A>3&&B&&Object.defineProperty(S,R,B),B},y=this&&this.__param||function(v,S){return function(R,D){S(R,D,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const m=h(5871),C=h(4725),w=h(844),E=h(2585),b={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0};let f=c.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(v,S,R,D,M,A,B){var I;super(),this._viewportElement=v,this._screenElement=S,this._bufferService=R,this._decorationService=D,this._renderService=M,this._optionsService=A,this._coreBrowserService=B,this._colorZoneStore=new m.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const $=this._canvas.getContext("2d");if(!$)throw new Error("Ctx cannot be null");this._ctx=$,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,w.toDisposable)((()=>{var q;(q=this._canvas)==null||q.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 v=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=v,d.center=S,d.right=v,this._refreshDrawHeightConstants(),p.full=0,p.left=0,p.center=d.left,p.right=d.left+d.center}_refreshDrawHeightConstants(){b.full=Math.round(2*this._coreBrowserService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowserService.dpr);b.left=S,b.center=S,b.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.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 v=this._colorZoneStore.zones;for(const S of v)S.position!=="full"&&this._renderColorZone(S);for(const S of v)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(v){this._ctx.fillStyle=v.color,this._ctx.fillRect(p[v.position||"full"],Math.round((this._canvas.height-1)*(v.startBufferLine/this._bufferService.buffers.active.lines.length)-b[v.position||"full"]/2),d[v.position||"full"],Math.round((this._canvas.height-1)*((v.endBufferLine-v.startBufferLine)/this._bufferService.buffers.active.lines.length)+b[v.position||"full"]))}_queueRefresh(v,S){this._shouldUpdateDimensions=v||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=f=u([y(2,E.IBufferService),y(3,E.IDecorationService),y(4,C.IRenderService),y(5,E.IOptionsService),y(6,C.ICoreBrowserService)],f)},2950:function(T,c,h){var u=this&&this.__decorate||function(b,d,p,f){var v,S=arguments.length,R=S<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,d,p,f);else for(var D=b.length-1;D>=0;D--)(v=b[D])&&(R=(S<3?v(R):S>3?v(d,p,R):v(d,p))||R);return S>3&&R&&Object.defineProperty(d,p,R),R},y=this&&this.__param||function(b,d){return function(p,f){d(p,f,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const m=h(4725),C=h(2585),w=h(2584);let E=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(b,d,p,f,v,S){this._textarea=b,this._compositionView=d,this._bufferService=p,this._optionsService=f,this._coreService=v,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(b){this._compositionView.textContent=b.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(b){if(this._isComposing||this._isSendingComposition){if(b.keyCode===229||b.keyCode===16||b.keyCode===17||b.keyCode===18)return!1;this._finalizeComposition(!1)}return b.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(b){if(this._compositionView.classList.remove("active"),this._isComposing=!1,b){const d={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,d.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(d.start,d.end):this._textarea.value.substring(d.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}}),0)}else{this._isSendingComposition=!1;const d=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(d,!0)}}_handleAnyTextareaChanges(){const b=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const d=this._textarea.value,p=d.replace(b,"");this._dataAlreadySent=p,d.length>b.length?this._coreService.triggerDataEvent(p,!0):d.length<b.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):d.length===b.length&&d!==b&&this._coreService.triggerDataEvent(d,!0)}}),0)}updateCompositionElements(b){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const d=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,v=d*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=v+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"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=v+"px",this._textarea.style.top=f+"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"}b||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=E=u([y(2,C.IBufferService),y(3,C.IOptionsService),y(4,C.ICoreService),y(5,m.IRenderService)],E)},9806:(T,c)=>{function h(u,y,m){const C=m.getBoundingClientRect(),w=u.getComputedStyle(m),E=parseInt(w.getPropertyValue("padding-left")),b=parseInt(w.getPropertyValue("padding-top"));return[y.clientX-C.left-E,y.clientY-C.top-b]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=h,c.getCoords=function(u,y,m,C,w,E,b,d,p){if(!E)return;const f=h(u,y,m);return f?(f[0]=Math.ceil((f[0]+(p?b/2:0))/b),f[1]=Math.ceil(f[1]/d),f[0]=Math.min(Math.max(f[0],1),C+(p?1:0)),f[1]=Math.min(Math.max(f[1],1),w),f):void 0}},9504:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const u=h(2584);function y(d,p,f,v){const S=d-m(d,f),R=p-m(p,f),D=Math.abs(S-R)-(function(M,A,B){let $=0;const I=M-m(M,B),q=A-m(A,B);for(let P=0;P<Math.abs(I-q);P++){const Q=C(M,A)==="A"?-1:1,se=B.buffer.lines.get(I+Q*P);se!=null&&se.isWrapped&&$++}return $})(d,p,f);return b(D,E(C(d,p),v))}function m(d,p){let f=0,v=p.buffer.lines.get(d),S=v==null?void 0:v.isWrapped;for(;S&&d>=0&&d<p.rows;)f++,v=p.buffer.lines.get(--d),S=v==null?void 0:v.isWrapped;return f}function C(d,p){return d>p?"A":"B"}function w(d,p,f,v,S,R){let D=d,M=p,A="";for(;D!==f||M!==v;)D+=S?1:-1,S&&D>R.cols-1?(A+=R.buffer.translateBufferLineToString(M,!1,d,D),D=0,d=0,M++):!S&&D<0&&(A+=R.buffer.translateBufferLineToString(M,!1,0,d+1),D=R.cols-1,d=D,M--);return A+R.buffer.translateBufferLineToString(M,!1,d,D)}function E(d,p){const f=p?"O":"[";return u.C0.ESC+f+d}function b(d,p){d=Math.floor(d);let f="";for(let v=0;v<d;v++)f+=p;return f}c.moveToCellSequence=function(d,p,f,v){const S=f.buffer.x,R=f.buffer.y;if(!f.buffer.hasScrollback)return(function(A,B,$,I,q,P){return y(B,I,q,P).length===0?"":b(w(A,B,A,B-m(B,q),!1,q).length,E("D",P))})(S,R,0,p,f,v)+y(R,p,f,v)+(function(A,B,$,I,q,P){let Q;Q=y(B,I,q,P).length>0?I-m(I,q):B;const se=I,G=(function(K,ee,N,U,L,H){let X;return X=y(N,U,L,H).length>0?U-m(U,L):ee,K<N&&X<=U||K>=N&&X<U?"C":"D"})(A,B,$,I,q,P);return b(w(A,Q,$,se,G==="C",q).length,E(G,P))})(S,R,d,p,f,v);let D;if(R===p)return D=S>d?"D":"C",b(Math.abs(S-d),E(D,v));D=R>p?"D":"C";const M=Math.abs(R-p);return b((function(A,B){return B.cols-A})(R>p?d:S,f)+(M-1)*f.cols+1+((R>p?S:d)-1),E(D,v))}},1296:function(T,c,h){var u=this&&this.__decorate||function(P,Q,se,G){var K,ee=arguments.length,N=ee<3?Q:G===null?G=Object.getOwnPropertyDescriptor(Q,se):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(P,Q,se,G);else for(var U=P.length-1;U>=0;U--)(K=P[U])&&(N=(ee<3?K(N):ee>3?K(Q,se,N):K(Q,se))||N);return ee>3&&N&&Object.defineProperty(Q,se,N),N},y=this&&this.__param||function(P,Q){return function(se,G){Q(se,G,P)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const m=h(3787),C=h(2550),w=h(2223),E=h(6171),b=h(6052),d=h(4725),p=h(8055),f=h(8460),v=h(844),S=h(2585),R="xterm-dom-renderer-owner-",D="xterm-rows",M="xterm-fg-",A="xterm-bg-",B="xterm-focus",$="xterm-selection";let I=1,q=c.DomRenderer=class extends v.Disposable{constructor(P,Q,se,G,K,ee,N,U,L,H,X,ne,he){super(),this._terminal=P,this._document=Q,this._element=se,this._screenElement=G,this._viewportElement=K,this._helperContainer=ee,this._linkifier2=N,this._charSizeService=L,this._optionsService=H,this._bufferService=X,this._coreBrowserService=ne,this._themeService=he,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,b.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(D),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,E.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((me=>this._injectCss(me)))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(m.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((me=>this._handleLinkHover(me)))),this.register(this._linkifier2.onHideLinkUnderline((me=>this._handleLinkLeave(me)))),this.register((0,v.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new C.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 P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),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/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),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 se of this._rowElements)se.style.width=`${this.dimensions.css.canvas.width}px`,se.style.height=`${this.dimensions.css.cell.height}px`,se.style.lineHeight=`${this.dimensions.css.cell.height}px`,se.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Q=`${this._terminalSelector} .${D} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Q,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(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Q=`${this._terminalSelector} .${D} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Q+=`${this._terminalSelector} .${D} .xterm-dim { color: ${p.color.multiplyOpacity(P.foreground,.5).css};}`,Q+=`${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 se=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;Q+=`@keyframes ${se} { 50% { border-bottom-style: hidden; }}`,Q+=`@keyframes ${G} { 50% { box-shadow: none; }}`,Q+=`@keyframes ${K} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,Q+=`${this._terminalSelector} .${D}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${se} 1s step-end infinite;}${this._terminalSelector} .${D}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${D}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Q+=`${this._terminalSelector} .${$} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${$} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${$} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,N]of P.ansi.entries())Q+=`${this._terminalSelector} .${M}${ee} { color: ${N.css}; }${this._terminalSelector} .${M}${ee}.xterm-dim { color: ${p.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${A}${ee} { background-color: ${N.css}; }`;Q+=`${this._terminalSelector} .${M}${w.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque(P.background).css}; }${this._terminalSelector} .${M}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${A}${w.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=Q}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,Q){for(let se=this._rowElements.length;se<=Q;se++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>Q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,Q){this._refreshRowElements(P,Q),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(B),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(B),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,Q,se){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,Q,se),this.renderRows(0,this._bufferService.rows-1),!P||!Q)return;this._selectionRenderModel.update(this._terminal,P,Q,se);const G=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,N=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||N<0)return;const U=this._document.createDocumentFragment();if(se){const L=P[0]>Q[0];U.appendChild(this._createSelectionElement(ee,L?Q[0]:P[0],L?P[0]:Q[0],N-ee+1))}else{const L=G===ee?P[0]:0,H=ee===K?Q[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(ee,L,H));const X=N-ee-1;if(U.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,X)),ee!==N){const ne=K===N?Q[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(N,0,ne))}}this._selectionContainer.appendChild(U)}_createSelectionElement(P,Q,se,G=1){const K=this._document.createElement("div"),ee=Q*this.dimensions.css.cell.width;let N=this.dimensions.css.cell.width*(se-Q);return ee+N>this.dimensions.css.canvas.width&&(N=this.dimensions.css.canvas.width-ee),K.style.height=G*this.dimensions.css.cell.height+"px",K.style.top=P*this.dimensions.css.cell.height+"px",K.style.left=`${ee}px`,K.style.width=`${N}px`,K}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 P of this._rowElements)P.replaceChildren()}renderRows(P,Q){const se=this._bufferService.buffer,G=se.ybase+se.y,K=Math.min(se.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=P;L<=Q;L++){const H=L+se.ydisp,X=this._rowElements[L],ne=se.lines.get(H);if(!X||!ne)break;X.replaceChildren(...this._rowFactory.createRow(ne,H,H===G,N,U,K,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,Q,se,G,K,ee){se<0&&(P=0),G<0&&(Q=0);const N=this._bufferService.rows-1;se=Math.max(Math.min(se,N),0),G=Math.max(Math.min(G,N),0),K=Math.min(K,this._bufferService.cols);const U=this._bufferService.buffer,L=U.ybase+U.y,H=Math.min(U.x,K-1),X=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=se;me<=G;++me){const Y=me+U.ydisp,j=this._rowElements[me],ce=U.lines.get(Y);if(!j||!ce)break;j.replaceChildren(...this._rowFactory.createRow(ce,Y,Y===L,ne,he,H,X,this.dimensions.css.cell.width,this._widthCache,ee?me===se?P:0:-1,ee?(me===G?Q:K)-1:-1))}}};c.DomRenderer=q=u([y(7,S.IInstantiationService),y(8,d.ICharSizeService),y(9,S.IOptionsService),y(10,S.IBufferService),y(11,d.ICoreBrowserService),y(12,d.IThemeService)],q)},3787:function(T,c,h){var u=this&&this.__decorate||function(D,M,A,B){var $,I=arguments.length,q=I<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,A):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(D,M,A,B);else for(var P=D.length-1;P>=0;P--)($=D[P])&&(q=(I<3?$(q):I>3?$(M,A,q):$(M,A))||q);return I>3&&q&&Object.defineProperty(M,A,q),q},y=this&&this.__param||function(D,M){return function(A,B){M(A,B,D)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const m=h(2223),C=h(643),w=h(511),E=h(2585),b=h(8055),d=h(4725),p=h(4269),f=h(6171),v=h(3734);let S=c.DomRendererRowFactory=class{constructor(D,M,A,B,$,I,q){this._document=D,this._characterJoinerService=M,this._optionsService=A,this._coreBrowserService=B,this._coreService=$,this._decorationService=I,this._themeService=q,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(D,M,A){this._selectionStart=D,this._selectionEnd=M,this._columnSelectMode=A}createRow(D,M,A,B,$,I,q,P,Q,se,G){const K=[],ee=this._characterJoinerService.getJoinedCharacters(M),N=this._themeService.colors;let U,L=D.getNoBgTrimmedLength();A&&L<I+1&&(L=I+1);let H=0,X="",ne=0,he=0,me=0,Y=!1,j=0,ce=!1,oe=0;const ve=[],pe=se!==-1&&G!==-1;for(let Te=0;Te<L;Te++){D.loadCell(Te,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let Ue=!1,ct=Te,Ee=this._workCell;if(ee.length>0&&Te===ee[0][0]){Ue=!0;const Ye=ee.shift();Ee=new p.JoinedCellData(this._workCell,D.translateToString(!0,Ye[0],Ye[1]),Ye[1]-Ye[0]),ct=Ye[1]-1,je=Ee.getWidth()}const Ft=this._isCellInSelection(Te,M),mi=A&&Te===I,pi=pe&&Te>=se&&Te<=G;let Ii=!1;this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ye=>{Ii=!0}));let Vi=Ee.getChars()||C.WHITESPACE_CELL_CHAR;if(Vi===" "&&(Ee.isUnderline()||Ee.isOverline())&&(Vi=" "),oe=je*P-Q.get(Vi,Ee.isBold(),Ee.isItalic()),U){if(H&&(Ft&&ce||!Ft&&!ce&&Ee.bg===ne)&&(Ft&&ce&&N.selectionForeground||Ee.fg===he)&&Ee.extended.ext===me&&pi===Y&&oe===j&&!mi&&!Ue&&!Ii){Ee.isInvisible()?X+=C.WHITESPACE_CELL_CHAR:X+=Vi,H++;continue}H&&(U.textContent=X),U=this._document.createElement("span"),H=0,X=""}else U=this._document.createElement("span");if(ne=Ee.bg,he=Ee.fg,me=Ee.extended.ext,Y=pi,j=oe,ce=Ft,Ue&&I>=Te&&I<=ct&&(I=Te),!this._coreService.isCursorHidden&&mi&&this._coreService.isCursorInitialized){if(ve.push("xterm-cursor"),this._coreBrowserService.isFocused)q&&ve.push("xterm-cursor-blink"),ve.push(B==="bar"?"xterm-cursor-bar":B==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){case"outline":ve.push("xterm-cursor-outline");break;case"block":ve.push("xterm-cursor-block");break;case"bar":ve.push("xterm-cursor-bar");break;case"underline":ve.push("xterm-cursor-underline")}}if(Ee.isBold()&&ve.push("xterm-bold"),Ee.isItalic()&&ve.push("xterm-italic"),Ee.isDim()&&ve.push("xterm-dim"),X=Ee.isInvisible()?C.WHITESPACE_CELL_CHAR:Ee.getChars()||C.WHITESPACE_CELL_CHAR,Ee.isUnderline()&&(ve.push(`xterm-underline-${Ee.extended.underlineStyle}`),X===" "&&(X=" "),!Ee.isUnderlineColorDefault()))if(Ee.isUnderlineColorRGB())U.style.textDecorationColor=`rgb(${v.AttributeData.toColorRGB(Ee.getUnderlineColor()).join(",")})`;else{let Ye=Ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ee.isBold()&&Ye<8&&(Ye+=8),U.style.textDecorationColor=N.ansi[Ye].css}Ee.isOverline()&&(ve.push("xterm-overline"),X===" "&&(X=" ")),Ee.isStrikethrough()&&ve.push("xterm-strikethrough"),pi&&(U.style.textDecoration="underline");let Pt=Ee.getFgColor(),nt=Ee.getFgColorMode(),Dt=Ee.getBgColor(),Zt=Ee.getBgColorMode();const Nt=!!Ee.isInverse();if(Nt){const Ye=Pt;Pt=Dt,Dt=Ye;const vi=nt;nt=Zt,Zt=vi}let Bt,Ki,Kt,Li=!1;switch(this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ye=>{Ye.options.layer!=="top"&&Li||(Ye.backgroundColorRGB&&(Zt=50331648,Dt=Ye.backgroundColorRGB.rgba>>8&16777215,Bt=Ye.backgroundColorRGB),Ye.foregroundColorRGB&&(nt=50331648,Pt=Ye.foregroundColorRGB.rgba>>8&16777215,Ki=Ye.foregroundColorRGB),Li=Ye.options.layer==="top")})),!Li&&Ft&&(Bt=this._coreBrowserService.isFocused?N.selectionBackgroundOpaque:N.selectionInactiveBackgroundOpaque,Dt=Bt.rgba>>8&16777215,Zt=50331648,Li=!0,N.selectionForeground&&(nt=50331648,Pt=N.selectionForeground.rgba>>8&16777215,Ki=N.selectionForeground)),Li&&ve.push("xterm-decoration-top"),Zt){case 16777216:case 33554432:Kt=N.ansi[Dt],ve.push(`xterm-bg-${Dt}`);break;case 50331648:Kt=b.channels.toColor(Dt>>16,Dt>>8&255,255&Dt),this._addStyle(U,`background-color:#${R((Dt>>>0).toString(16),"0",6)}`);break;default:Nt?(Kt=N.foreground,ve.push(`xterm-bg-${m.INVERTED_DEFAULT_COLOR}`)):Kt=N.background}switch(Bt||Ee.isDim()&&(Bt=b.color.multiplyOpacity(Kt,.5)),nt){case 16777216:case 33554432:Ee.isBold()&&Pt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Pt+=8),this._applyMinimumContrast(U,Kt,N.ansi[Pt],Ee,Bt,void 0)||ve.push(`xterm-fg-${Pt}`);break;case 50331648:const Ye=b.channels.toColor(Pt>>16&255,Pt>>8&255,255&Pt);this._applyMinimumContrast(U,Kt,Ye,Ee,Bt,Ki)||this._addStyle(U,`color:#${R(Pt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(U,Kt,N.foreground,Ee,Bt,Ki)||Nt&&ve.push(`xterm-fg-${m.INVERTED_DEFAULT_COLOR}`)}ve.length&&(U.className=ve.join(" "),ve.length=0),mi||Ue||Ii?U.textContent=X:H++,oe!==this.defaultSpacing&&(U.style.letterSpacing=`${oe}px`),K.push(U),Te=ct}return U&&H&&(U.textContent=X),K}_applyMinimumContrast(D,M,A,B,$,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const q=this._getContrastCache(B);let P;if($||I||(P=q.getColor(M.rgba,A.rgba)),P===void 0){const Q=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);P=b.color.ensureContrastRatio($||M,I||A,Q),q.setColor(($||M).rgba,(I||A).rgba,P??null)}return!!P&&(this._addStyle(D,`color:${P.css}`),!0)}_getContrastCache(D){return D.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(D,M){D.setAttribute("style",`${D.getAttribute("style")||""}${M};`)}_isCellInSelection(D,M){const A=this._selectionStart,B=this._selectionEnd;return!(!A||!B)&&(this._columnSelectMode?A[0]<=B[0]?D>=A[0]&&M>=A[1]&&D<B[0]&&M<=B[1]:D<A[0]&&M>=A[1]&&D>=B[0]&&M<=B[1]:M>A[1]&&M<B[1]||A[1]===B[1]&&M===A[1]&&D>=A[0]&&D<B[0]||A[1]<B[1]&&M===B[1]&&D<B[0]||A[1]<B[1]&&M===A[1]&&D>=A[0])}};function R(D,M,A){for(;D.length<A;)D=M+D;return D}c.DomRendererRowFactory=S=u([y(1,d.ICharacterJoinerService),y(2,E.IOptionsService),y(3,d.ICoreBrowserService),y(4,E.ICoreService),y(5,E.IDecorationService),y(6,d.IThemeService)],S)},2550:(T,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 m=h.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold";const C=h.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const w=h.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[y,m,C,w],this._container.appendChild(y),this._container.appendChild(m),this._container.appendChild(C),this._container.appendChild(w),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,m){h===this._font&&u===this._fontSize&&y===this._weight&&m===this._weightBold||(this._font=h,this._fontSize=u,this._weight=y,this._weightBold=m,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${m}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${m}`,this.clear())}get(h,u,y){let m=0;if(!u&&!y&&h.length===1&&(m=h.charCodeAt(0))<256){if(this._flat[m]!==-9999)return this._flat[m];const E=this._measure(h,0);return E>0&&(this._flat[m]=E),E}let C=h;u&&(C+="B"),y&&(C+="I");let w=this._holey.get(C);if(w===void 0){let E=0;u&&(E|=1),y&&(E|=2),w=this._measure(h,E),w>0&&this._holey.set(C,w)}return w}_measure(h,u){const y=this._measureElements[u];return y.textContent=h.repeat(32),y.offsetWidth/32}}},2223:(T,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:(T,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,m,C,w){return m===1&&C>Math.ceil(1.5*w)&&y!==void 0&&y>255&&!u(y)&&!h(y)&&!(function(E){return 57344<=E&&E<=63743})(y)},c.treatGlyphAsBackgroundColor=function(y){return h(y)||(function(m){return 9472<=m&&m<=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,m,C=0){return(y-(2*Math.round(m)-C))%(2*Math.round(m))}},6052:(T,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,m,C,w=!1){if(this.selectionStart=m,this.selectionEnd=C,!m||!C||m[0]===C[0]&&m[1]===C[1])return void this.clear();const E=y.buffers.active.ydisp,b=m[1]-E,d=C[1]-E,p=Math.max(b,0),f=Math.min(d,y.rows-1);p>=y.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=b,this.viewportEndRow=d,this.viewportCappedStartRow=p,this.viewportCappedEndRow=f,this.startCol=m[0],this.endCol=C[0])}isCellSelected(y,m,C){return!!this.hasSelection&&(C-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?m>=this.startCol&&C>=this.viewportCappedStartRow&&m<this.endCol&&C<=this.viewportCappedEndRow:m<this.startCol&&C>=this.viewportCappedStartRow&&m>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&m>=this.startCol&&m<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&m<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&m>=this.startCol)}}c.createSelectionRenderModel=function(){return new h}},456:(T,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(T,c,h){var u=this&&this.__decorate||function(f,v,S,R){var D,M=arguments.length,A=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(f,v,S,R);else for(var B=f.length-1;B>=0;B--)(D=f[B])&&(A=(M<3?D(A):M>3?D(v,S,A):D(v,S))||A);return M>3&&A&&Object.defineProperty(v,S,A),A},y=this&&this.__param||function(f,v){return function(S,R){v(S,R,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const m=h(2585),C=h(8460),w=h(844);let E=c.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,v,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new p(this._optionsService))}catch{this._measureStrategy=this.register(new d(f,v,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};c.CharSizeService=E=u([y(2,m.IOptionsService)],E);class b extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(v,S){v!==void 0&&v>0&&S!==void 0&&S>0&&(this._result.width=v,this._result.height=S)}}class d extends b{constructor(v,S,R){super(),this._document=v,this._parentElement=S,this._optionsService=R,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 p extends b{constructor(v){super(),this._optionsService=v,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 v=this._ctx.measureText("W");return this._validateAndSet(v.width,v.fontBoundingBoxAscent+v.fontBoundingBoxDescent),this._result}}},4269:function(T,c,h){var u=this&&this.__decorate||function(p,f,v,S){var R,D=arguments.length,M=D<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(p,f,v,S);else for(var A=p.length-1;A>=0;A--)(R=p[A])&&(M=(D<3?R(M):D>3?R(f,v,M):R(f,v))||M);return D>3&&M&&Object.defineProperty(f,v,M),M},y=this&&this.__param||function(p,f){return function(v,S){f(v,S,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const m=h(3734),C=h(643),w=h(511),E=h(2585);class b extends m.AttributeData{constructor(f,v,S){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=v,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=b;let d=c.CharacterJoinerService=class xv{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(f){const v={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(v),v.id}deregister(f){for(let v=0;v<this._characterJoiners.length;v++)if(this._characterJoiners[v].id===f)return this._characterJoiners.splice(v,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const v=this._bufferService.buffer.lines.get(f);if(!v||v.length===0)return[];const S=[],R=v.translateToString(!0);let D=0,M=0,A=0,B=v.getFg(0),$=v.getBg(0);for(let I=0;I<v.getTrimmedLength();I++)if(v.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==$){if(I-D>1){const q=this._getJoinedRanges(R,A,M,v,D);for(let P=0;P<q.length;P++)S.push(q[P])}D=I,A=M,B=this._workCell.fg,$=this._workCell.bg}M+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){const I=this._getJoinedRanges(R,A,M,v,D);for(let q=0;q<I.length;q++)S.push(I[q])}return S}_getJoinedRanges(f,v,S,R,D){const M=f.substring(v,S);let A=[];try{A=this._characterJoiners[0].handler(M)}catch(B){console.error(B)}for(let B=1;B<this._characterJoiners.length;B++)try{const $=this._characterJoiners[B].handler(M);for(let I=0;I<$.length;I++)xv._mergeRanges(A,$[I])}catch($){console.error($)}return this._stringRangesToCellRanges(A,R,D),A}_stringRangesToCellRanges(f,v,S){let R=0,D=!1,M=0,A=f[R];if(A){for(let B=S;B<this._bufferService.cols;B++){const $=v.getWidth(B),I=v.getString(B).length||C.WHITESPACE_CELL_CHAR.length;if($!==0){if(!D&&A[0]<=M&&(A[0]=B,D=!0),A[1]<=M){if(A[1]=B,A=f[++R],!A)break;A[0]<=M?(A[0]=B,D=!0):D=!1}M+=I}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(f,v){let S=!1;for(let R=0;R<f.length;R++){const D=f[R];if(S){if(v[1]<=D[0])return f[R-1][1]=v[1],f;if(v[1]<=D[1])return f[R-1][1]=Math.max(v[1],D[1]),f.splice(R,1),f;f.splice(R,1),R--}else{if(v[1]<=D[0])return f.splice(R,0,v),f;if(v[1]<=D[1])return D[0]=Math.min(v[0],D[0]),f;v[0]<D[1]&&(D[0]=Math.min(v[0],D[0]),S=!0)}}return S?f[f.length-1][1]=v[1]:f.push(v),f}};c.CharacterJoinerService=d=u([y(0,E.IBufferService)],d)},5114:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const u=h(844),y=h(8460),m=h(3656);class C extends u.Disposable{constructor(b,d,p){super(),this._textarea=b,this._window=d,this.mainDocument=p,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(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((f=>this._screenDprMonitor.setWindow(f)))),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(b){this._window!==b&&(this._window=b,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=C;class w extends u.Disposable{constructor(b){super(),this._parentWindow=b,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(b){this._parentWindow=b,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,m.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var b;this._outerListener&&((b=this._resolutionMediaMatchList)==null||b.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:(T,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(C){return this.linkProviders.push(C),{dispose:()=>{const w=this.linkProviders.indexOf(C);w!==-1&&this.linkProviders.splice(w,1)}}}}c.LinkProviderService=y},8934:function(T,c,h){var u=this&&this.__decorate||function(E,b,d,p){var f,v=arguments.length,S=v<3?b:p===null?p=Object.getOwnPropertyDescriptor(b,d):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(E,b,d,p);else for(var R=E.length-1;R>=0;R--)(f=E[R])&&(S=(v<3?f(S):v>3?f(b,d,S):f(b,d))||S);return v>3&&S&&Object.defineProperty(b,d,S),S},y=this&&this.__param||function(E,b){return function(d,p){b(d,p,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const m=h(4725),C=h(9806);let w=c.MouseService=class{constructor(E,b){this._renderService=E,this._charSizeService=b}getCoords(E,b,d,p,f){return(0,C.getCoords)(window,E,b,d,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(E,b){const d=(0,C.getCoordsRelativeToElement)(window,E,b);if(this._charSizeService.hasValidSize)return d[0]=Math.min(Math.max(d[0],0),this._renderService.dimensions.css.canvas.width-1),d[1]=Math.min(Math.max(d[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(d[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(d[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(d[0]),y:Math.floor(d[1])}}};c.MouseService=w=u([y(0,m.IRenderService),y(1,m.ICharSizeService)],w)},3230:function(T,c,h){var u=this&&this.__decorate||function(f,v,S,R){var D,M=arguments.length,A=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(f,v,S,R);else for(var B=f.length-1;B>=0;B--)(D=f[B])&&(A=(M<3?D(A):M>3?D(v,S,A):D(v,S))||A);return M>3&&A&&Object.defineProperty(v,S,A),A},y=this&&this.__param||function(f,v){return function(S,R){v(S,R,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const m=h(6193),C=h(4725),w=h(8460),E=h(844),b=h(7226),d=h(2585);let p=c.RenderService=class extends E.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,v,S,R,D,M,A,B){super(),this._rowCount=f,this._charSizeService=R,this._renderer=this.register(new E.MutableDisposable),this._pausedResizeTask=new b.DebouncedIdleTask,this._observerDisposable=this.register(new E.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 w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new m.RenderDebouncer((($,I)=>this._renderRows($,I)),A),this.register(this._renderDebouncer),this.register(A.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(D.onDecorationRegistered((()=>this._fullRefresh()))),this.register(D.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(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(A.window,v),this.register(A.onWindowChange(($=>this._registerIntersectionObserver($,v))))}_registerIntersectionObserver(f,v){if("IntersectionObserver"in f){const S=new f.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});S.observe(v),this._observerDisposable.value=(0,E.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(f){this._isPaused=f.isIntersecting===void 0?f.intersectionRatio===0:!f.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(f,v,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,v,this._rowCount))}_renderRows(f,v){this._renderer.value&&(f=Math.min(f,this._rowCount-1),v=Math.min(v,this._rowCount-1),this._renderer.value.renderRows(f,v),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:f,end:v}),this._onRender.fire({start:f,end:v}),this._isNextRenderRedrawOnly=!0)}resize(f,v){this._rowCount=v,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(f){this._renderer.value=f,this._renderer.value&&(this._renderer.value.onRequestRedraw((v=>this.refreshRows(v.start,v.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(f){return this._renderDebouncer.addRefreshCallback(f)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var f,v;this._renderer.value&&((v=(f=this._renderer.value).clearTextureAtlas)==null||v.call(f),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(f,v){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(f,v)})):this._renderer.value.handleResize(f,v),this._fullRefresh())}handleCharSizeChanged(){var f;(f=this._renderer.value)==null||f.handleCharSizeChanged()}handleBlur(){var f;(f=this._renderer.value)==null||f.handleBlur()}handleFocus(){var f;(f=this._renderer.value)==null||f.handleFocus()}handleSelectionChanged(f,v,S){var R;this._selectionState.start=f,this._selectionState.end=v,this._selectionState.columnSelectMode=S,(R=this._renderer.value)==null||R.handleSelectionChanged(f,v,S)}handleCursorMove(){var f;(f=this._renderer.value)==null||f.handleCursorMove()}clear(){var f;(f=this._renderer.value)==null||f.clear()}};c.RenderService=p=u([y(2,d.IOptionsService),y(3,C.ICharSizeService),y(4,d.IDecorationService),y(5,d.IBufferService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],p)},9312:function(T,c,h){var u=this&&this.__decorate||function(A,B,$,I){var q,P=arguments.length,Q=P<3?B:I===null?I=Object.getOwnPropertyDescriptor(B,$):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(A,B,$,I);else for(var se=A.length-1;se>=0;se--)(q=A[se])&&(Q=(P<3?q(Q):P>3?q(B,$,Q):q(B,$))||Q);return P>3&&Q&&Object.defineProperty(B,$,Q),Q},y=this&&this.__param||function(A,B){return function($,I){B($,I,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const m=h(9806),C=h(9504),w=h(456),E=h(4725),b=h(8460),d=h(844),p=h(6114),f=h(4841),v=h(511),S=h(2585),R=" ",D=new RegExp(R,"g");let M=c.SelectionService=class extends d.Disposable{constructor(A,B,$,I,q,P,Q,se,G){super(),this._element=A,this._screenElement=B,this._linkifier=$,this._bufferService=I,this._coreService=q,this._mouseService=P,this._optionsService=Q,this._renderService=se,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new v.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new b.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new b.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((K=>this._handleTrim(K))),this.register(this._bufferService.buffers.onBufferActivate((K=>this._handleBufferActivate(K)))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,d.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 A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!A||!B||A[0]===B[0]&&A[1]===B[1])}get selectionText(){const A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!A||!B)return"";const $=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(A[0]===B[0])return"";const q=A[0]<B[0]?A[0]:B[0],P=A[0]<B[0]?B[0]:A[0];for(let Q=A[1];Q<=B[1];Q++){const se=$.translateBufferLineToString(Q,!0,q,P);I.push(se)}}else{const q=A[1]===B[1]?B[0]:void 0;I.push($.translateBufferLineToString(A[1],!0,A[0],q));for(let P=A[1]+1;P<=B[1]-1;P++){const Q=$.lines.get(P),se=$.translateBufferLineToString(P,!0);Q!=null&&Q.isWrapped?I[I.length-1]+=se:I.push(se)}if(A[1]!==B[1]){const P=$.lines.get(B[1]),Q=$.translateBufferLineToString(B[1],!0,0,B[0]);P&&P.isWrapped?I[I.length-1]+=Q:I.push(Q)}}return I.map((q=>q.replace(D," "))).join(p.isWindows?`\r
|
|
259
259
|
`:`
|
|
260
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),p.isLinux&&A&&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(A){const B=this._getMouseBufferCoords(A),$=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!($&&I&&B)&&this._areCoordsInSelection(B,$,I)}isCellInSelection(A,B){const $=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!$||!I)&&this._areCoordsInSelection([A,B],$,I)}_areCoordsInSelection(A,B,$){return A[1]>B[1]&&A[1]<$[1]||B[1]===$[1]&&A[1]===B[1]&&A[0]>=B[0]&&A[0]<$[0]||B[1]<$[1]&&A[1]===$[1]&&A[0]<$[0]||B[1]<$[1]&&A[1]===B[1]&&A[0]>=B[0]}_selectWordAtCursor(A,B){var q,P;const $=(P=(q=this._linkifier.currentLink)==null?void 0:q.link)==null?void 0:P.range;if($)return this._model.selectionStart=[$.start.x-1,$.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)($,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(A);return!!I&&(this._selectWordAt(I,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,B){this._model.clearSelection(),A=Math.max(A,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const B=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(A){let B=(0,m.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const $=this._renderService.dimensions.css.canvas.height;return B>=0&&B<=$?0:(B>$&&(B-=$),B=Math.min(Math.max(B,-50),50),B/=50,B/Math.abs(B)+Math.round(14*B))}shouldForceSelection(A){return p.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),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(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const B=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);B&&B.length!==this._model.selectionStart[0]&&B.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const B=this._getMouseBufferCoords(A);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(A){return A.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.stopImmediatePropagation(),!this._model.selectionStart)return;const B=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),!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(A),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 I=$.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}B&&B[0]===this._model.selectionEnd[0]&&B[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const B=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const $=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if($&&$[0]!==void 0&&$[1]!==void 0){const I=(0,C.moveToCellSequence)($[0]-1,$[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,$=!(!A||!B||A[0]===B[0]&&A[1]===B[1]);$?A&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,B,$)):this._oldHasSelection&&this._fireOnSelectionChange(A,B,$)}_fireOnSelectionChange(A,B,$){this._oldSelectionStart=A,this._oldSelectionEnd=B,this._oldHasSelection=$,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(A,B){let $=B;for(let I=0;B>=I;I++){const q=A.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?$--:q>1&&B!==I&&($+=q-1)}return $}setSelection(A,B,$){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,B],this._model.selectionStartLength=$,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,B,$=!0,I=!0){if(A[0]>=this._bufferService.cols)return;const q=this._bufferService.buffer,P=q.lines.get(A[1]);if(!P)return;const Q=q.translateBufferLineToString(A[1],!1);let se=this._convertViewportColToCharacterIndex(P,A[0]),G=se;const K=A[0]-se;let ee=0,N=0,U=0,L=0;if(Q.charAt(se)===" "){for(;se>0&&Q.charAt(se-1)===" ";)se--;for(;G<Q.length&&Q.charAt(G+1)===" ";)G++}else{let ne=A[0],he=A[0];P.getWidth(ne)===0&&(ee++,ne--),P.getWidth(he)===2&&(N++,he++);const me=P.getString(he).length;for(me>1&&(L+=me-1,G+=me-1);ne>0&&se>0&&!this._isCharWordSeparator(P.loadCell(ne-1,this._workCell));){P.loadCell(ne-1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,ne--):Y>1&&(U+=Y-1,se-=Y-1),se--,ne--}for(;he<P.length&&G+1<Q.length&&!this._isCharWordSeparator(P.loadCell(he+1,this._workCell));){P.loadCell(he+1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===2?(N++,he++):Y>1&&(L+=Y-1,G+=Y-1),G++,he++}}G++;let H=se+K-ee+U,X=Math.min(this._bufferService.cols,G-se+ee+N-U-L);if(B||Q.slice(se,G).trim()!==""){if($&&H===0&&P.getCodePoint(0)!==32){const ne=q.lines.get(A[1]-1);if(ne&&P.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const he=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(he){const me=this._bufferService.cols-he.start;H-=me,X+=me}}}if(I&&H+X===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const ne=q.lines.get(A[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const he=this._getWordAt([0,A[1]+1],!1,!1,!0);he&&(X+=he.length)}}return{start:H,length:X}}}_selectWordAt(A,B){const $=this._getWordAt(A,B);if($){for(;$.start<0;)$.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[$.start,A[1]],this._model.selectionStartLength=$.length}}_selectToWordAt(A){const B=this._getWordAt(A,!0);if(B){let $=A[1];for(;B.start<0;)B.start+=this._bufferService.cols,$--;if(!this._model.areSelectionValuesReversed())for(;B.start+B.length>this._bufferService.cols;)B.length-=this._bufferService.cols,$++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?B.start:B.start+B.length,$]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const B=this._bufferService.buffer.getWrappedRangeForLine(A),$={start:{x:0,y:B.first},end:{x:this._bufferService.cols-1,y:B.last}};this._model.selectionStart=[0,B.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)($,this._bufferService.cols)}};c.SelectionService=M=u([y(3,S.IBufferService),y(4,S.ICoreService),y(5,E.IMouseService),y(6,S.IOptionsService),y(7,E.IRenderService),y(8,E.ICoreBrowserService)],M)},4725:(T,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(T,c,h){var u=this&&this.__decorate||function(M,A,B,$){var I,q=arguments.length,P=q<3?A:$===null?$=Object.getOwnPropertyDescriptor(A,B):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,A,B,$);else for(var Q=M.length-1;Q>=0;Q--)(I=M[Q])&&(P=(q<3?I(P):q>3?I(A,B,P):I(A,B))||P);return q>3&&P&&Object.defineProperty(A,B,P),P},y=this&&this.__param||function(M,A){return function(B,$){A(B,$,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const m=h(7239),C=h(8055),x=h(8460),E=h(844),b=h(2585),d=C.css.toColor("#ffffff"),p=C.css.toColor("#000000"),f=C.css.toColor("#ffffff"),v=C.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[C.css.toColor("#2e3436"),C.css.toColor("#cc0000"),C.css.toColor("#4e9a06"),C.css.toColor("#c4a000"),C.css.toColor("#3465a4"),C.css.toColor("#75507b"),C.css.toColor("#06989a"),C.css.toColor("#d3d7cf"),C.css.toColor("#555753"),C.css.toColor("#ef2929"),C.css.toColor("#8ae234"),C.css.toColor("#fce94f"),C.css.toColor("#729fcf"),C.css.toColor("#ad7fa8"),C.css.toColor("#34e2e2"),C.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let B=0;B<216;B++){const $=A[B/36%6|0],I=A[B/6%6|0],q=A[B%6];M.push({css:C.channels.toCss($,I,q),rgba:C.channels.toRgba($,I,q)})}for(let B=0;B<24;B++){const $=8+10*B;M.push({css:C.channels.toCss($,$,$),rgba:C.channels.toRgba($,$,$)})}return M})());let R=c.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new m.ColorContrastCache,this._halfContrastCache=new m.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:p,cursor:f,cursorAccent:v,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:C.color.blend(p,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:C.color.blend(p,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 A=this._colors;if(A.foreground=D(M.foreground,d),A.background=D(M.background,p),A.cursor=D(M.cursor,f),A.cursorAccent=D(M.cursorAccent,v),A.selectionBackgroundTransparent=D(M.selectionBackground,S),A.selectionBackgroundOpaque=C.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=D(M.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=C.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=M.selectionForeground?D(M.selectionForeground,C.NULL_COLOR):void 0,A.selectionForeground===C.NULL_COLOR&&(A.selectionForeground=void 0),C.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=C.color.opacity(A.selectionBackgroundTransparent,.3)),C.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=C.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=c.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=D(M.black,c.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=D(M.red,c.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=D(M.green,c.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=D(M.yellow,c.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=D(M.blue,c.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=D(M.magenta,c.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=D(M.cyan,c.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=D(M.white,c.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=D(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=D(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=D(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=D(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=D(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=D(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=D(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=D(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const B=Math.min(A.ansi.length-16,M.extendedAnsi.length);for(let $=0;$<B;$++)A.ansi[$+16]=D(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 A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}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 D(M,A){if(M!==void 0)try{return C.css.toColor(M)}catch{}return A}c.ThemeService=R=u([y(0,b.IOptionsService)],R)},6349:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const u=h(8460),y=h(844);class m extends y.Disposable{constructor(x){super(),this._maxLength=x,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(x){if(this._maxLength===x)return;const E=new Array(x);for(let b=0;b<Math.min(x,this.length);b++)E[b]=this._array[this._getCyclicIndex(b)];this._array=E,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let E=this._length;E<x;E++)this._array[E]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,E){this._array[this._getCyclicIndex(x)]=E}push(x){this._array[this._getCyclicIndex(this._length)]=x,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(x,E,...b){if(E){for(let d=x;d<this._length-E;d++)this._array[this._getCyclicIndex(d)]=this._array[this._getCyclicIndex(d+E)];this._length-=E,this.onDeleteEmitter.fire({index:x,amount:E})}for(let d=this._length-1;d>=x;d--)this._array[this._getCyclicIndex(d+b.length)]=this._array[this._getCyclicIndex(d)];for(let d=0;d<b.length;d++)this._array[this._getCyclicIndex(x+d)]=b[d];if(b.length&&this.onInsertEmitter.fire({index:x,amount:b.length}),this._length+b.length>this._maxLength){const d=this._length+b.length-this._maxLength;this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)}else this._length+=b.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,E,b){if(!(E<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+b<0)throw new Error("Cannot shift elements in list beyond index 0");if(b>0){for(let p=E-1;p>=0;p--)this.set(x+p+b,this.get(x+p));const d=x+E+b-this._length;if(d>0)for(this._length+=d;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let d=0;d<E;d++)this.set(x+d+b,this.get(x+d))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}c.CircularList=m},1439:(T,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 m=Array.isArray(u)?[]:{};for(const C in u)m[C]=y<=1?u[C]:u[C]&&h(u[C],y-1);return m}},8055:(T,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,m=0;var C,x,E,b,d;function p(v){const S=v.toString(16);return S.length<2?"0"+S:S}function f(v,S){return v<S?(S+.05)/(v+.05):(v+.05)/(S+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(v){v.toCss=function(S,R,D,M){return M!==void 0?`#${p(S)}${p(R)}${p(D)}${p(M)}`:`#${p(S)}${p(R)}${p(D)}`},v.toRgba=function(S,R,D,M=255){return(S<<24|R<<16|D<<8|M)>>>0},v.toColor=function(S,R,D,M){return{css:v.toCss(S,R,D,M),rgba:v.toRgba(S,R,D,M)}}})(C||(c.channels=C={})),(function(v){function S(R,D){return m=Math.round(255*D),[h,u,y]=d.toChannels(R.rgba),{css:C.toCss(h,u,y,m),rgba:C.toRgba(h,u,y,m)}}v.blend=function(R,D){if(m=(255&D.rgba)/255,m===1)return{css:D.css,rgba:D.rgba};const M=D.rgba>>24&255,A=D.rgba>>16&255,B=D.rgba>>8&255,$=R.rgba>>24&255,I=R.rgba>>16&255,q=R.rgba>>8&255;return h=$+Math.round((M-$)*m),u=I+Math.round((A-I)*m),y=q+Math.round((B-q)*m),{css:C.toCss(h,u,y),rgba:C.toRgba(h,u,y)}},v.isOpaque=function(R){return(255&R.rgba)==255},v.ensureContrastRatio=function(R,D,M){const A=d.ensureContrastRatio(R.rgba,D.rgba,M);if(A)return C.toColor(A>>24&255,A>>16&255,A>>8&255)},v.opaque=function(R){const D=(255|R.rgba)>>>0;return[h,u,y]=d.toChannels(D),{css:C.toCss(h,u,y),rgba:D}},v.opacity=S,v.multiplyOpacity=function(R,D){return m=255&R.rgba,S(R,m*D/255)},v.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(x||(c.color=x={})),(function(v){let S,R;try{const D=document.createElement("canvas");D.width=1,D.height=1;const M=D.getContext("2d",{willReadFrequently:!0});M&&(S=M,S.globalCompositeOperation="copy",R=S.createLinearGradient(0,0,1,1))}catch{}v.toColor=function(D){if(D.match(/#[\da-f]{3,8}/i))switch(D.length){case 4:return h=parseInt(D.slice(1,2).repeat(2),16),u=parseInt(D.slice(2,3).repeat(2),16),y=parseInt(D.slice(3,4).repeat(2),16),C.toColor(h,u,y);case 5:return h=parseInt(D.slice(1,2).repeat(2),16),u=parseInt(D.slice(2,3).repeat(2),16),y=parseInt(D.slice(3,4).repeat(2),16),m=parseInt(D.slice(4,5).repeat(2),16),C.toColor(h,u,y,m);case 7:return{css:D,rgba:(parseInt(D.slice(1),16)<<8|255)>>>0};case 9:return{css:D,rgba:parseInt(D.slice(1),16)>>>0}}const M=D.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]),m=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),C.toColor(h,u,y,m);if(!S||!R)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=R,S.fillStyle=D,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[h,u,y,m]=S.getImageData(0,0,1,1).data,m!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(h,u,y,m),css:D}}})(E||(c.css=E={})),(function(v){function S(R,D,M){const A=R/255,B=D/255,$=M/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*($<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4))}v.relativeLuminance=function(R){return S(R>>16&255,R>>8&255,255&R)},v.relativeLuminance2=S})(b||(c.rgb=b={})),(function(v){function S(D,M,A){const B=D>>24&255,$=D>>16&255,I=D>>8&255;let q=M>>24&255,P=M>>16&255,Q=M>>8&255,se=f(b.relativeLuminance2(q,P,Q),b.relativeLuminance2(B,$,I));for(;se<A&&(q>0||P>0||Q>0);)q-=Math.max(0,Math.ceil(.1*q)),P-=Math.max(0,Math.ceil(.1*P)),Q-=Math.max(0,Math.ceil(.1*Q)),se=f(b.relativeLuminance2(q,P,Q),b.relativeLuminance2(B,$,I));return(q<<24|P<<16|Q<<8|255)>>>0}function R(D,M,A){const B=D>>24&255,$=D>>16&255,I=D>>8&255;let q=M>>24&255,P=M>>16&255,Q=M>>8&255,se=f(b.relativeLuminance2(q,P,Q),b.relativeLuminance2(B,$,I));for(;se<A&&(q<255||P<255||Q<255);)q=Math.min(255,q+Math.ceil(.1*(255-q))),P=Math.min(255,P+Math.ceil(.1*(255-P))),Q=Math.min(255,Q+Math.ceil(.1*(255-Q))),se=f(b.relativeLuminance2(q,P,Q),b.relativeLuminance2(B,$,I));return(q<<24|P<<16|Q<<8|255)>>>0}v.blend=function(D,M){if(m=(255&M)/255,m===1)return M;const A=M>>24&255,B=M>>16&255,$=M>>8&255,I=D>>24&255,q=D>>16&255,P=D>>8&255;return h=I+Math.round((A-I)*m),u=q+Math.round((B-q)*m),y=P+Math.round(($-P)*m),C.toRgba(h,u,y)},v.ensureContrastRatio=function(D,M,A){const B=b.relativeLuminance(D>>8),$=b.relativeLuminance(M>>8);if(f(B,$)<A){if($<B){const P=S(D,M,A),Q=f(B,b.relativeLuminance(P>>8));if(Q<A){const se=R(D,M,A);return Q>f(B,b.relativeLuminance(se>>8))?P:se}return P}const I=R(D,M,A),q=f(B,b.relativeLuminance(I>>8));if(q<A){const P=S(D,M,A);return q>f(B,b.relativeLuminance(P>>8))?I:P}return I}},v.reduceLuminance=S,v.increaseLuminance=R,v.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(d||(c.rgba=d={})),c.toPaddedHex=p,c.contrastRatio=f},8969:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const u=h(844),y=h(2585),m=h(4348),C=h(7866),x=h(744),E=h(7302),b=h(6975),d=h(8460),p=h(1753),f=h(1480),v=h(7994),S=h(9282),R=h(5435),D=h(5981),M=h(2660);let A=!1;class B extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new d.EventEmitter),this._onScroll.event((I=>{var q;(q=this._onScrollApi)==null||q.fire(I.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(I){for(const q in I)this.optionsService.options[q]=I[q]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new d.EventEmitter),this._instantiationService=new m.InstantiationService,this.optionsService=this.register(new E.OptionsService(I)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(b.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(v.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 R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,d.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,d.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,d.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,d.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((q=>{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((q=>{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 D.WriteBuffer(((q,P)=>this._inputHandler.parse(q,P)))),this.register((0,d.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,q){this._writeBuffer.write(I,q)}writeSync(I,q){this._logService.logLevel<=y.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(I,q)}input(I,q=!0){this.coreService.triggerDataEvent(I,q)}resize(I,q){isNaN(I)||isNaN(q)||(I=Math.max(I,x.MINIMUM_COLS),q=Math.max(q,x.MINIMUM_ROWS),this._bufferService.resize(I,q))}scroll(I,q=!1){this._bufferService.scroll(I,q)}scrollLines(I,q,P){this._bufferService.scrollLines(I,q,P)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const q=I-this._bufferService.buffer.ydisp;q!==0&&this.scrollLines(q)}registerEscHandler(I,q){return this._inputHandler.registerEscHandler(I,q)}registerDcsHandler(I,q){return this._inputHandler.registerDcsHandler(I,q)}registerCsiHandler(I,q){return this._inputHandler.registerCsiHandler(I,q)}registerOscHandler(I,q){return this._inputHandler.registerOscHandler(I,q)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const q=this.optionsService.rawOptions.windowsPty;q&&q.buildNumber!==void 0&&q.buildNumber!==void 0?I=q.backend==="conpty"&&q.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const q of I)q.dispose()}))}}}c.CoreTerminal=B},8460:(T,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 m=0;m<this._listeners.length;m++)y.push(this._listeners[m]);for(let m=0;m<y.length;m++)y[m].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(T,c,h){var u=this&&this.__decorate||function(ee,N,U,L){var H,X=arguments.length,ne=X<3?N:L===null?L=Object.getOwnPropertyDescriptor(N,U):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(ee,N,U,L);else for(var he=ee.length-1;he>=0;he--)(H=ee[he])&&(ne=(X<3?H(ne):X>3?H(N,U,ne):H(N,U))||ne);return X>3&&ne&&Object.defineProperty(N,U,ne),ne},y=this&&this.__param||function(ee,N){return function(U,L){N(U,L,ee)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const m=h(2584),C=h(7116),x=h(2015),E=h(844),b=h(482),d=h(8437),p=h(8460),f=h(643),v=h(511),S=h(3734),R=h(2585),D=h(1480),M=h(6242),A=h(6351),B=h(5941),$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function q(ee,N){if(ee>24)return N.setWinLines||!1;switch(ee){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var P;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(c.WindowsOptionsReportType=P={}));let Q=0;class se extends E.Disposable{getAttrData(){return this._curAttrData}constructor(N,U,L,H,X,ne,he,me,Y=new x.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=U,this._coreService=L,this._logService=H,this._optionsService=X,this._oscLinkService=ne,this._coreMouseService=he,this._unicodeService=me,this._parser=Y,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new b.StringToUtf32,this._utf8Decoder=new b.Utf8ToUtf32,this._workCell=new v.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.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 G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._parser.setCsiHandlerFallback(((j,ce)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(j),params:ce.toArray()})})),this._parser.setEscHandlerFallback((j=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(j)})})),this._parser.setExecuteHandlerFallback((j=>{this._logService.debug("Unknown EXECUTE code: ",{code:j})})),this._parser.setOscHandlerFallback(((j,ce,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:j,action:ce,data:oe})})),this._parser.setDcsHandlerFallback(((j,ce,oe)=>{ce==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(j),action:ce,payload:oe})})),this._parser.setPrintHandler(((j,ce,oe)=>this.print(j,ce,oe))),this._parser.registerCsiHandler({final:"@"},(j=>this.insertChars(j))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(j=>this.scrollLeft(j))),this._parser.registerCsiHandler({final:"A"},(j=>this.cursorUp(j))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(j=>this.scrollRight(j))),this._parser.registerCsiHandler({final:"B"},(j=>this.cursorDown(j))),this._parser.registerCsiHandler({final:"C"},(j=>this.cursorForward(j))),this._parser.registerCsiHandler({final:"D"},(j=>this.cursorBackward(j))),this._parser.registerCsiHandler({final:"E"},(j=>this.cursorNextLine(j))),this._parser.registerCsiHandler({final:"F"},(j=>this.cursorPrecedingLine(j))),this._parser.registerCsiHandler({final:"G"},(j=>this.cursorCharAbsolute(j))),this._parser.registerCsiHandler({final:"H"},(j=>this.cursorPosition(j))),this._parser.registerCsiHandler({final:"I"},(j=>this.cursorForwardTab(j))),this._parser.registerCsiHandler({final:"J"},(j=>this.eraseInDisplay(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(j=>this.eraseInDisplay(j,!0))),this._parser.registerCsiHandler({final:"K"},(j=>this.eraseInLine(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(j=>this.eraseInLine(j,!0))),this._parser.registerCsiHandler({final:"L"},(j=>this.insertLines(j))),this._parser.registerCsiHandler({final:"M"},(j=>this.deleteLines(j))),this._parser.registerCsiHandler({final:"P"},(j=>this.deleteChars(j))),this._parser.registerCsiHandler({final:"S"},(j=>this.scrollUp(j))),this._parser.registerCsiHandler({final:"T"},(j=>this.scrollDown(j))),this._parser.registerCsiHandler({final:"X"},(j=>this.eraseChars(j))),this._parser.registerCsiHandler({final:"Z"},(j=>this.cursorBackwardTab(j))),this._parser.registerCsiHandler({final:"`"},(j=>this.charPosAbsolute(j))),this._parser.registerCsiHandler({final:"a"},(j=>this.hPositionRelative(j))),this._parser.registerCsiHandler({final:"b"},(j=>this.repeatPrecedingCharacter(j))),this._parser.registerCsiHandler({final:"c"},(j=>this.sendDeviceAttributesPrimary(j))),this._parser.registerCsiHandler({prefix:">",final:"c"},(j=>this.sendDeviceAttributesSecondary(j))),this._parser.registerCsiHandler({final:"d"},(j=>this.linePosAbsolute(j))),this._parser.registerCsiHandler({final:"e"},(j=>this.vPositionRelative(j))),this._parser.registerCsiHandler({final:"f"},(j=>this.hVPosition(j))),this._parser.registerCsiHandler({final:"g"},(j=>this.tabClear(j))),this._parser.registerCsiHandler({final:"h"},(j=>this.setMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(j=>this.setModePrivate(j))),this._parser.registerCsiHandler({final:"l"},(j=>this.resetMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(j=>this.resetModePrivate(j))),this._parser.registerCsiHandler({final:"m"},(j=>this.charAttributes(j))),this._parser.registerCsiHandler({final:"n"},(j=>this.deviceStatus(j))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(j=>this.deviceStatusPrivate(j))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(j=>this.softReset(j))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(j=>this.setCursorStyle(j))),this._parser.registerCsiHandler({final:"r"},(j=>this.setScrollRegion(j))),this._parser.registerCsiHandler({final:"s"},(j=>this.saveCursor(j))),this._parser.registerCsiHandler({final:"t"},(j=>this.windowOptions(j))),this._parser.registerCsiHandler({final:"u"},(j=>this.restoreCursor(j))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(j=>this.insertColumns(j))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(j=>this.deleteColumns(j))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(j=>this.selectProtected(j))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(j=>this.requestMode(j,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(j=>this.requestMode(j,!1))),this._parser.setExecuteHandler(m.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(m.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(m.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(m.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(m.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(m.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(m.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(m.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(m.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((j=>(this.setTitle(j),this.setIconName(j),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((j=>this.setIconName(j)))),this._parser.registerOscHandler(2,new M.OscHandler((j=>this.setTitle(j)))),this._parser.registerOscHandler(4,new M.OscHandler((j=>this.setOrReportIndexedColor(j)))),this._parser.registerOscHandler(8,new M.OscHandler((j=>this.setHyperlink(j)))),this._parser.registerOscHandler(10,new M.OscHandler((j=>this.setOrReportFgColor(j)))),this._parser.registerOscHandler(11,new M.OscHandler((j=>this.setOrReportBgColor(j)))),this._parser.registerOscHandler(12,new M.OscHandler((j=>this.setOrReportCursorColor(j)))),this._parser.registerOscHandler(104,new M.OscHandler((j=>this.restoreIndexedColor(j)))),this._parser.registerOscHandler(110,new M.OscHandler((j=>this.restoreFgColor(j)))),this._parser.registerOscHandler(111,new M.OscHandler((j=>this.restoreBgColor(j)))),this._parser.registerOscHandler(112,new M.OscHandler((j=>this.restoreCursorColor(j)))),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 j in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:j},(()=>this.selectCharset("("+j))),this._parser.registerEscHandler({intermediates:")",final:j},(()=>this.selectCharset(")"+j))),this._parser.registerEscHandler({intermediates:"*",final:j},(()=>this.selectCharset("*"+j))),this._parser.registerEscHandler({intermediates:"+",final:j},(()=>this.selectCharset("+"+j))),this._parser.registerEscHandler({intermediates:"-",final:j},(()=>this.selectCharset("-"+j))),this._parser.registerEscHandler({intermediates:".",final:j},(()=>this.selectCharset("."+j))),this._parser.registerEscHandler({intermediates:"/",final:j},(()=>this.selectCharset("/"+j)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((j=>(this._logService.error("Parsing error: ",j),j))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler(((j,ce)=>this.requestStatusString(j,ce))))}_preserveStack(N,U,L,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=U,this._parseStack.decodedLength=L,this._parseStack.position=H}_logSlowResolvingAsync(N){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([N,new Promise(((U,L)=>setTimeout((()=>L("#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(N,U){let L,H=this._activeBuffer.x,X=this._activeBuffer.y,ne=0;const he=this._parseStack.paused;if(he){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,U))return this._logSlowResolvingAsync(L),L;H=this._parseStack.cursorStartX,X=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>I&&(ne=this._parseStack.position+I)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,(j=>String.fromCharCode(j))).join("")}"`),typeof N=="string"?N.split("").map((j=>j.charCodeAt(0))):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(N.length,I))),he||this._dirtyRowTracker.clearRange(),N.length>I)for(let j=ne;j<N.length;j+=I){const ce=j+I<N.length?j+I:N.length,oe=typeof N=="string"?this._stringDecoder.decode(N.substring(j,ce),this._parseBuffer):this._utf8Decoder.decode(N.subarray(j,ce),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,oe))return this._preserveStack(H,X,oe,j),this._logSlowResolvingAsync(L),L}else if(!he){const j=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,j))return this._preserveStack(H,X,j,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===H&&this._activeBuffer.y===X||this._onCursorMove.fire();const me=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Y=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Y<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Y,this._bufferService.rows-1),Math.min(me,this._bufferService.rows-1))}print(N,U,L){let H,X;const ne=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,me=this._bufferService.cols,Y=this._coreService.decPrivateModes.wraparound,j=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&&L-U>0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ce);let ve=this._parser.precedingJoinState;for(let pe=U;pe<L;++pe){if(H=N[pe],H<127&&ne){const ct=ne[String.fromCharCode(H)];ct&&(H=ct.charCodeAt(0))}const Te=this._unicodeService.charProperties(H,ve);X=D.UnicodeService.extractWidth(Te);const je=D.UnicodeService.extractShouldJoin(Te),Ue=je?D.UnicodeService.extractWidth(ve):0;if(ve=Te,he&&this._onA11yChar.fire((0,b.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+X-Ue>me){if(Y){const ct=oe;let Ee=this._activeBuffer.x-Ue;for(this._activeBuffer.x=Ue,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),Ue>0&&oe instanceof d.BufferLine&&oe.copyCellsFrom(ct,Ee,0,Ue,!1);Ee<me;)ct.setCellFromCodepoint(Ee++,0,1,ce)}else if(this._activeBuffer.x=me-1,X===2)continue}if(je&&this._activeBuffer.x){const ct=oe.getWidth(this._activeBuffer.x-1)?1:2;oe.addCodepointToCell(this._activeBuffer.x-ct,H,X);for(let Ee=X-Ue;--Ee>=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}else if(j&&(oe.insertCells(this._activeBuffer.x,X-Ue,this._activeBuffer.getNullCell(ce)),oe.getWidth(me-1)===2&&oe.setCellFromCodepoint(me-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,ce)),oe.setCellFromCodepoint(this._activeBuffer.x++,H,X,ce),X>0)for(;--X;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}this._parser.precedingJoinState=ve,this._activeBuffer.x<me&&L-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(N,U){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,U):this._parser.registerCsiHandler(N,(L=>!q(L.params[0],this._optionsService.rawOptions.windowOptions)||U(L)))}registerDcsHandler(N,U){return this._parser.registerDcsHandler(N,new A.DcsHandler(U))}registerEscHandler(N,U){return this._parser.registerEscHandler(N,U)}registerOscHandler(N,U){return this._parser.registerOscHandler(N,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 N;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&&((N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&N.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 N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,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(N,U){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+U):(this._activeBuffer.x=N,this._activeBuffer.y=U),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,U){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+U)}cursorUp(N){const U=this._activeBuffer.y-this._activeBuffer.scrollTop;return U>=0?this._moveCursor(0,-Math.min(U,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const U=this._activeBuffer.scrollBottom-this._activeBuffer.y;return U>=0?this._moveCursor(0,Math.min(U,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const U=N.params[0];return U===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:U===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=N.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=N.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const U=N.params[0];return U===1&&(this._curAttrData.bg|=536870912),U!==2&&U!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,U,L,H=!1,X=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);ne.replaceCells(U,L,this._activeBuffer.getNullCell(this._eraseAttrData()),X),H&&(ne.isWrapped=!1)}_resetBufferLine(N,U=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),U),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),L.isWrapped=!1)}eraseInDisplay(N,U=!1){let L;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);L<this._bufferService.rows;L++)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,U),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(N,U=!1){switch(this._restrictCursor(this._bufferService.cols),N.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(N){this._restrictCursor();let U=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,X=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;U--;)this._activeBuffer.lines.splice(X-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(N){this._restrictCursor();let U=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;U--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(N){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let U=N.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(N){let U=N.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(d.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.deleteCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.insertCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.insertCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.deleteCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(N){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){const U=this._parser.precedingJoinState;if(!U)return!0;const L=N.params[0]||1,H=D.UnicodeService.extractWidth(U),X=this._activeBuffer.x-H,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(X),he=new Uint32Array(ne.length*L);let me=0;for(let j=0;j<ne.length;){const ce=ne.codePointAt(j)||0;he[me++]=ce,j+=ce>65535?2:1}let Y=me;for(let j=1;j<L;++j)he.copyWithin(Y,0,me),Y+=me;return this.print(he,0,Y),!0}sendDeviceAttributesPrimary(N){return N.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(m.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(m.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(N){return N.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(m.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(m.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(m.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let U=0;U<N.length;U++)switch(N.params[U]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let U=0;U<N.length;U++)switch(N.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),this._charsetService.setgCharset(1,C.DEFAULT_CHARSET),this._charsetService.setgCharset(2,C.DEFAULT_CHARSET),this._charsetService.setgCharset(3,C.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(N){for(let U=0;U<N.length;U++)switch(N.params[U]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let U=0;U<N.length;U++)switch(N.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(),N.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(N,U){const L=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:X}=this._coreMouseService,ne=this._coreService,{buffers:he,cols:me}=this._bufferService,{active:Y,alt:j}=he,ce=this._optionsService.rawOptions,oe=je=>je?1:2,ve=N.params[0];return pe=ve,Te=U?ve===2?4:ve===4?oe(ne.modes.insertMode):ve===12?3:ve===20?oe(ce.convertEol):0:ve===1?oe(L.applicationCursorKeys):ve===3?ce.windowOptions.setWinLines?me===80?2:me===132?1:0:0:ve===6?oe(L.origin):ve===7?oe(L.wraparound):ve===8?3:ve===9?oe(H==="X10"):ve===12?oe(ce.cursorBlink):ve===25?oe(!ne.isCursorHidden):ve===45?oe(L.reverseWraparound):ve===66?oe(L.applicationKeypad):ve===67?4:ve===1e3?oe(H==="VT200"):ve===1002?oe(H==="DRAG"):ve===1003?oe(H==="ANY"):ve===1004?oe(L.sendFocus):ve===1005?4:ve===1006?oe(X==="SGR"):ve===1015?4:ve===1016?oe(X==="SGR_PIXELS"):ve===1048?1:ve===47||ve===1047||ve===1049?oe(Y===j):ve===2004?oe(L.bracketedPasteMode):0,ne.triggerDataEvent(`${m.C0.ESC}[${U?"":"?"}${pe};${Te}$y`),!0;var pe,Te}_updateAttrColor(N,U,L,H,X){return U===2?(N|=50331648,N&=-16777216,N|=S.AttributeData.fromColorRGB([L,H,X])):U===5&&(N&=-50331904,N|=33554432|255&L),N}_extractColor(N,U,L){const H=[0,0,-1,0,0,0];let X=0,ne=0;do{if(H[ne+X]=N.params[U+ne],N.hasSubParams(U+ne)){const he=N.getSubParams(U+ne);let me=0;do H[1]===5&&(X=1),H[ne+me+1+X]=he[me];while(++me<he.length&&me+ne+1+X<H.length);break}if(H[1]===5&&ne+X>=2||H[1]===2&&ne+X>=5)break;H[1]&&(X=1)}while(++ne+U<N.length&&ne+X<H.length);for(let he=2;he<H.length;++he)H[he]===-1&&(H[he]=0);switch(H[0]){case 38:L.fg=this._updateAttrColor(L.fg,H[1],H[3],H[4],H[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,H[1],H[3],H[4],H[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,H[1],H[3],H[4],H[5])}return ne}_processUnderline(N,U){U.extended=U.extended.clone(),(!~N||N>5)&&(N=1),U.extended.underlineStyle=N,U.fg|=268435456,N===0&&(U.fg&=-268435457),U.updateExtended()}_processSGR0(N){N.fg=d.DEFAULT_ATTR_DATA.fg,N.bg=d.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const U=N.length;let L;const H=this._curAttrData;for(let X=0;X<U;X++)L=N.params[X],L>=30&&L<=37?(H.fg&=-50331904,H.fg|=16777216|L-30):L>=40&&L<=47?(H.bg&=-50331904,H.bg|=16777216|L-40):L>=90&&L<=97?(H.fg&=-50331904,H.fg|=16777224|L-90):L>=100&&L<=107?(H.bg&=-50331904,H.bg|=16777224|L-100):L===0?this._processSGR0(H):L===1?H.fg|=134217728:L===3?H.bg|=67108864:L===4?(H.fg|=268435456,this._processUnderline(N.hasSubParams(X)?N.getSubParams(X)[0]:1,H)):L===5?H.fg|=536870912:L===7?H.fg|=67108864:L===8?H.fg|=1073741824:L===9?H.fg|=2147483648:L===2?H.bg|=134217728:L===21?this._processUnderline(2,H):L===22?(H.fg&=-134217729,H.bg&=-134217729):L===23?H.bg&=-67108865:L===24?(H.fg&=-268435457,this._processUnderline(0,H)):L===25?H.fg&=-536870913:L===27?H.fg&=-67108865:L===28?H.fg&=-1073741825:L===29?H.fg&=2147483647:L===39?(H.fg&=-67108864,H.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):L===49?(H.bg&=-67108864,H.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?X+=this._extractColor(N,X,H):L===53?H.bg|=1073741824:L===55?H.bg&=-1073741825:L===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):L===100?(H.fg&=-67108864,H.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${m.C0.ESC}[0n`);break;case 6:const U=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[${U};${L}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const U=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[?${U};${L}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.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(N){const U=N.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 L=U%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(N){const U=N.params[0]||1;let L;return(N.length<2||(L=N.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>U&&(this._activeBuffer.scrollTop=U-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(N){if(!q(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const U=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:U!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${m.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(N){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(N){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(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const U=[],L=N.split(";");for(;L.length>1;){const H=L.shift(),X=L.shift();if(/^\d+$/.exec(H)){const ne=parseInt(H);if(K(ne))if(X==="?")U.push({type:0,index:ne});else{const he=(0,B.parseColor)(X);he&&U.push({type:1,index:ne,color:he})}}}return U.length&&this._onColor.fire(U),!0}setHyperlink(N){const U=N.split(";");return!(U.length<2)&&(U[1]?this._createHyperlink(U[0],U[1]):!U[0]&&this._finishHyperlink())}_createHyperlink(N,U){this._getCurrentLinkId()&&this._finishHyperlink();const L=N.split(":");let H;const X=L.findIndex((ne=>ne.startsWith("id=")));return X!==-1&&(H=L[X].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,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(N,U){const L=N.split(";");for(let H=0;H<L.length&&!(U>=this._specialColors.length);++H,++U)if(L[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[U]}]);else{const X=(0,B.parseColor)(L[H]);X&&this._onColor.fire([{type:1,index:this._specialColors[U],color:X}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const U=[],L=N.split(";");for(let H=0;H<L.length;++H)if(/^\d+$/.exec(L[H])){const X=parseInt(L[H]);K(X)&&U.push({type:2,index:X})}return U.length&&this._onColor.fire(U),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){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,C.DEFAULT_CHARSET),!0}selectCharset(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset($[N[0]],C.CHARSETS[N[1]]||C.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 N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,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=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new v.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let U=0;U<this._bufferService.rows;++U){const L=this._activeBuffer.ybase+this._activeBuffer.y+U,H=this._activeBuffer.lines.get(L);H&&(H.fill(N),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,U){const L=this._bufferService.buffer,H=this._optionsService.rawOptions;return(X=>(this._coreService.triggerDataEvent(`${m.C0.ESC}${X}${m.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,U){this._dirtyRowTracker.markRangeDirty(N,U)}}c.InputHandler=se;let G=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){ee<this.start?this.start=ee:ee>this.end&&(this.end=ee)}markRangeDirty(ee,N){ee>N&&(Q=ee,ee=N,N=Q),ee<this.start&&(this.start=ee),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(ee){return 0<=ee&&ee<256}G=u([y(0,R.IBufferService)],G)},844:(T,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:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(y,m,C){this._data[y]||(this._data[y]={}),this._data[y][m]=C}get(y,m){return this._data[y]?this._data[y][m]:void 0}clear(){this._data={}}}c.TwoKeyMap=h,c.FourKeyMap=class{constructor(){this._data=new h}set(u,y,m,C,x){this._data.get(u,y)||this._data.set(u,y,new h),this._data.get(u,y).set(m,C,x)}get(u,y,m,C){var x;return(x=this._data.get(u,y))==null?void 0:x.get(m,C)}clear(){this._data.clear()}}},6114:(T,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:(T,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,m=this._array.length-1;for(;m>=y;){let C=y+m>>1;const x=this._getKey(this._array[C]);if(x>u)m=C-1;else{if(!(x<u)){for(;C>0&&this._getKey(this._array[C-1])===u;)C--;return C}y=C+1}}return y}}},7226:(T,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(x){this._tasks.push(x),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(x){this._idleCallback=void 0;let E=0,b=0,d=x.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),b=Math.max(E,b),p=x.timeRemaining(),1.5*b>p)return d-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(d-E))}ms`),void this._start();d=p}this.clear()}}class m extends y{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const E=Date.now()+x;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}c.PriorityTaskQueue=m,c.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:m,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9282:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const u=h(643);c.updateWindowsModeWrappedState=function(y){const m=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),C=m==null?void 0:m.get(y.cols-1),x=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);x&&C&&(x.isWrapped=C[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&C[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(T,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(m){return[m>>>16&255,m>>>8&255,255&m]}static fromColorRGB(m){return(255&m[0])<<16|(255&m[1])<<8|255&m[2]}clone(){const m=new h;return m.fg=this.fg,m.bg=this.bg,m.extended=this.extended.clone(),m}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(m){this._ext=m}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(m){this._ext&=-469762049,this._ext|=m<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(m){this._ext&=-67108864,this._ext|=67108863&m}get urlId(){return this._urlId}set urlId(m){this._urlId=m}get underlineVariantOffset(){const m=(3758096384&this._ext)>>29;return m<0?4294967288^m:m}set underlineVariantOffset(m){this._ext&=536870911,this._ext|=m<<29&3758096384}constructor(m=0,C=0){this._ext=0,this._urlId=0,this._ext=m,this._urlId=C}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=u},9092:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const u=h(6349),y=h(7226),m=h(3734),C=h(8437),x=h(4634),E=h(511),b=h(643),d=h(4863),p=h(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(f,v,S){this._hasScrollback=f,this._optionsService=v,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=C.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=E.CellData.fromCharData([0,b.NULL_CELL_CHAR,b.NULL_CELL_WIDTH,b.NULL_CELL_CODE]),this._whitespaceCell=E.CellData.fromCharData([0,b.WHITESPACE_CELL_CHAR,b.WHITESPACE_CELL_WIDTH,b.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(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new m.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new m.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,v){return new C.BufferLine(this._bufferService.cols,this.getNullCell(f),v)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const v=f+this._optionsService.rawOptions.scrollback;return v>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:v}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=C.DEFAULT_ATTR_DATA);let v=this._rows;for(;v--;)this.lines.push(this.getBlankLine(f))}}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(f,v){const S=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=0;const D=this._getCorrectBufferLength(v);if(D>this.lines.maxLength&&(this.lines.maxLength=D),this.lines.length>0){if(this._cols<f)for(let A=0;A<this.lines.length;A++)R+=+this.lines.get(A).resize(f,S);let M=0;if(this._rows<v)for(let A=this._rows;A<v;A++)this.lines.length<v+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new C.BufferLine(f,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 C.BufferLine(f,S)));else for(let A=this._rows;A>v;A--)this.lines.length>v+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(D<this.lines.maxLength){const A=this.lines.length-D;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=D}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,v-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=v-1,this._isReflowEnabled&&(this._reflow(f,v),this._cols>f))for(let M=0;M<this.lines.length;M++)R+=+this.lines.get(M).resize(f,S);this._cols=f,this._rows=v,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let v=0;for(;this._memoryCleanupPosition<this.lines.length;)if(v+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),v>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,v){this._cols!==f&&(f>this._cols?this._reflowLarger(f,v):this._reflowSmaller(f,v))}_reflowLarger(f,v){const S=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(S.length>0){const R=(0,x.reflowLargerCreateNewLayout)(this.lines,S);(0,x.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(f,v,R.countRemoved)}}_reflowLargerAdjustViewport(f,v,S){const R=this.getNullCell(C.DEFAULT_ATTR_DATA);let D=S;for(;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<v&&this.lines.push(new C.BufferLine(f,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(f,v){const S=this.getNullCell(C.DEFAULT_ATTR_DATA),R=[];let D=0;for(let M=this.lines.length-1;M>=0;M--){let A=this.lines.get(M);if(!A||!A.isWrapped&&A.getTrimmedLength()<=f)continue;const B=[A];for(;A.isWrapped&&M>0;)A=this.lines.get(--M),B.unshift(A);const $=this.ybase+this.y;if($>=M&&$<M+B.length)continue;const I=B[B.length-1].getTrimmedLength(),q=(0,x.reflowSmallerGetNewLineLengths)(B,this._cols,f),P=q.length-B.length;let Q;Q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const se=[];for(let L=0;L<P;L++){const H=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);se.push(H)}se.length>0&&(R.push({start:M+B.length+D,newLines:se}),D+=se.length),B.push(...se);let G=q.length-1,K=q[G];K===0&&(G--,K=q[G]);let ee=B.length-P-1,N=I;for(;ee>=0;){const L=Math.min(N,K);if(B[G]===void 0)break;if(B[G].copyCellsFrom(B[ee],N-L,K-L,L,!0),K-=L,K===0&&(G--,K=q[G]),N-=L,N===0){ee--;const H=Math.max(ee,0);N=(0,x.getWrappedLineTrimmedLength)(B,H,this._cols)}}for(let L=0;L<B.length;L++)q[L]<f&&B[L].setCell(q[L],S);let U=P-Q;for(;U-- >0;)this.ybase===0?this.y<v-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-v&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+v-1)}if(R.length>0){const M=[],A=[];for(let G=0;G<this.lines.length;G++)A.push(this.lines.get(G));const B=this.lines.length;let $=B-1,I=0,q=R[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+D);let P=0;for(let G=Math.min(this.lines.maxLength-1,B+D-1);G>=0;G--)if(q&&q.start>$+P){for(let K=q.newLines.length-1;K>=0;K--)this.lines.set(G--,q.newLines[K]);G++,M.push({index:$+1,amount:q.newLines.length}),P+=q.newLines.length,q=R[++I]}else this.lines.set(G,A[$--]);let Q=0;for(let G=M.length-1;G>=0;G--)M[G].index+=Q,this.lines.onInsertEmitter.fire(M[G]),Q+=M[G].amount;const se=Math.max(0,B+D-this.lines.maxLength);se>0&&this.lines.onTrimEmitter.fire(se)}}translateBufferLineToString(f,v,S=0,R){const D=this.lines.get(f);return D?D.translateToString(v,S,R):""}getWrappedRangeForLine(f){let v=f,S=f;for(;v>0&&this.lines.get(v).isWrapped;)v--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:v,last:S}}setupTabStops(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].line===f&&(this.markers[v].dispose(),this.markers.splice(v--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const v=new d.Marker(f);return this.markers.push(v),v.register(this.lines.onTrim((S=>{v.line-=S,v.line<0&&v.dispose()}))),v.register(this.lines.onInsert((S=>{v.line>=S.index&&(v.line+=S.amount)}))),v.register(this.lines.onDelete((S=>{v.line>=S.index&&v.line<S.index+S.amount&&v.dispose(),v.line>S.index&&(v.line-=S.amount)}))),v.register(v.onDispose((()=>this._removeMarker(v)))),v}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const u=h(3734),y=h(511),m=h(643),C=h(482);c.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let x=0;class E{constructor(d,p,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*d);const v=p||y.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]);for(let S=0;S<d;++S)this.setCell(S,v);this.length=d}get(d){const p=this._data[3*d+0],f=2097151&p;return[this._data[3*d+1],2097152&p?this._combined[d]:f?(0,C.stringFromCodePoint)(f):"",p>>22,2097152&p?this._combined[d].charCodeAt(this._combined[d].length-1):f]}set(d,p){this._data[3*d+1]=p[m.CHAR_DATA_ATTR_INDEX],p[m.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[d]=p[1],this._data[3*d+0]=2097152|d|p[m.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*d+0]=p[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[m.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(d){return this._data[3*d+0]>>22}hasWidth(d){return 12582912&this._data[3*d+0]}getFg(d){return this._data[3*d+1]}getBg(d){return this._data[3*d+2]}hasContent(d){return 4194303&this._data[3*d+0]}getCodePoint(d){const p=this._data[3*d+0];return 2097152&p?this._combined[d].charCodeAt(this._combined[d].length-1):2097151&p}isCombined(d){return 2097152&this._data[3*d+0]}getString(d){const p=this._data[3*d+0];return 2097152&p?this._combined[d]:2097151&p?(0,C.stringFromCodePoint)(2097151&p):""}isProtected(d){return 536870912&this._data[3*d+2]}loadCell(d,p){return x=3*d,p.content=this._data[x+0],p.fg=this._data[x+1],p.bg=this._data[x+2],2097152&p.content&&(p.combinedData=this._combined[d]),268435456&p.bg&&(p.extended=this._extendedAttrs[d]),p}setCell(d,p){2097152&p.content&&(this._combined[d]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[d]=p.extended),this._data[3*d+0]=p.content,this._data[3*d+1]=p.fg,this._data[3*d+2]=p.bg}setCellFromCodepoint(d,p,f,v){268435456&v.bg&&(this._extendedAttrs[d]=v.extended),this._data[3*d+0]=p|f<<22,this._data[3*d+1]=v.fg,this._data[3*d+2]=v.bg}addCodepointToCell(d,p,f){let v=this._data[3*d+0];2097152&v?this._combined[d]+=(0,C.stringFromCodePoint)(p):2097151&v?(this._combined[d]=(0,C.stringFromCodePoint)(2097151&v)+(0,C.stringFromCodePoint)(p),v&=-2097152,v|=2097152):v=p|4194304,f&&(v&=-12582913,v|=f<<22),this._data[3*d+0]=v}insertCells(d,p,f){if((d%=this.length)&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),p<this.length-d){const v=new y.CellData;for(let S=this.length-d-p-1;S>=0;--S)this.setCell(d+p+S,this.loadCell(d+S,v));for(let S=0;S<p;++S)this.setCell(d+S,f)}else for(let v=d;v<this.length;++v)this.setCell(v,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(d,p,f){if(d%=this.length,p<this.length-d){const v=new y.CellData;for(let S=0;S<this.length-d-p;++S)this.setCell(d+S,this.loadCell(d+p+S,v));for(let S=this.length-p;S<this.length;++S)this.setCell(S,f)}else for(let v=d;v<this.length;++v)this.setCell(v,f);d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),this.getWidth(d)!==0||this.hasContent(d)||this.setCellFromCodepoint(d,0,1,f)}replaceCells(d,p,f,v=!1){if(v)for(d&&this.getWidth(d-1)===2&&!this.isProtected(d-1)&&this.setCellFromCodepoint(d-1,0,1,f),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodepoint(p,0,1,f);d<p&&d<this.length;)this.isProtected(d)||this.setCell(d,f),d++;else for(d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p,0,1,f);d<p&&d<this.length;)this.setCell(d++,f)}resize(d,p){if(d===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*d;if(d>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const v=new Uint32Array(f);v.set(this._data),this._data=v}for(let v=this.length;v<d;++v)this.setCell(v,p)}else{this._data=this._data.subarray(0,f);const v=Object.keys(this._combined);for(let R=0;R<v.length;R++){const D=parseInt(v[R],10);D>=d&&delete this._combined[D]}const S=Object.keys(this._extendedAttrs);for(let R=0;R<S.length;R++){const D=parseInt(S[R],10);D>=d&&delete this._extendedAttrs[D]}}return this.length=d,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const d=new Uint32Array(this._data.length);return d.set(this._data),this._data=d,1}return 0}fill(d,p=!1){if(p)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,d);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,d)}}copyFrom(d){this.length!==d.length?this._data=new Uint32Array(d._data):this._data.set(d._data),this.length=d.length,this._combined={};for(const p in d._combined)this._combined[p]=d._combined[p];this._extendedAttrs={};for(const p in d._extendedAttrs)this._extendedAttrs[p]=d._extendedAttrs[p];this.isWrapped=d.isWrapped}clone(){const d=new E(0);d._data=new Uint32Array(this._data),d.length=this.length;for(const p in this._combined)d._combined[p]=this._combined[p];for(const p in this._extendedAttrs)d._extendedAttrs[p]=this._extendedAttrs[p];return d.isWrapped=this.isWrapped,d}getTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0])return d+(this._data[3*d+0]>>22);return 0}getNoBgTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0]||50331648&this._data[3*d+2])return d+(this._data[3*d+0]>>22);return 0}copyCellsFrom(d,p,f,v,S){const R=d._data;if(S)for(let M=v-1;M>=0;M--){for(let A=0;A<3;A++)this._data[3*(f+M)+A]=R[3*(p+M)+A];268435456&R[3*(p+M)+2]&&(this._extendedAttrs[f+M]=d._extendedAttrs[p+M])}else for(let M=0;M<v;M++){for(let A=0;A<3;A++)this._data[3*(f+M)+A]=R[3*(p+M)+A];268435456&R[3*(p+M)+2]&&(this._extendedAttrs[f+M]=d._extendedAttrs[p+M])}const D=Object.keys(d._combined);for(let M=0;M<D.length;M++){const A=parseInt(D[M],10);A>=p&&(this._combined[A-p+f]=d._combined[A])}}translateToString(d,p,f,v){p=p??0,f=f??this.length,d&&(f=Math.min(f,this.getTrimmedLength())),v&&(v.length=0);let S="";for(;p<f;){const R=this._data[3*p+0],D=2097151&R,M=2097152&R?this._combined[p]:D?(0,C.stringFromCodePoint)(D):m.WHITESPACE_CELL_CHAR;if(S+=M,v)for(let A=0;A<M.length;++A)v.push(p);p+=R>>22||1}return v&&v.push(p),S}}c.BufferLine=E},4841:(T,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:(T,c)=>{function h(u,y,m){if(y===u.length-1)return u[y].getTrimmedLength();const C=!u[y].hasContent(m-1)&&u[y].getWidth(m-1)===1,x=u[y+1].getWidth(0)===2;return C&&x?m-1:m}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(u,y,m,C,x){const E=[];for(let b=0;b<u.length-1;b++){let d=b,p=u.get(++d);if(!p.isWrapped)continue;const f=[u.get(b)];for(;d<u.length&&p.isWrapped;)f.push(p),p=u.get(++d);if(C>=b&&C<d){b+=f.length-1;continue}let v=0,S=h(f,v,y),R=1,D=0;for(;R<f.length;){const A=h(f,R,y),B=A-D,$=m-S,I=Math.min(B,$);f[v].copyCellsFrom(f[R],D,S,I,!1),S+=I,S===m&&(v++,S=0),D+=I,D===A&&(R++,D=0),S===0&&v!==0&&f[v-1].getWidth(m-1)===2&&(f[v].copyCellsFrom(f[v-1],m-1,S++,1,!1),f[v-1].setCell(m-1,x))}f[v].replaceCells(S,m,x);let M=0;for(let A=f.length-1;A>0&&(A>v||f[A].getTrimmedLength()===0);A--)M++;M>0&&(E.push(b+f.length-M),E.push(M)),b+=f.length-1}return E},c.reflowLargerCreateNewLayout=function(u,y){const m=[];let C=0,x=y[C],E=0;for(let b=0;b<u.length;b++)if(x===b){const d=y[++C];u.onDeleteEmitter.fire({index:b-E,amount:d}),b+=d-1,E+=d,x=y[++C]}else m.push(b);return{layout:m,countRemoved:E}},c.reflowLargerApplyNewLayout=function(u,y){const m=[];for(let C=0;C<y.length;C++)m.push(u.get(y[C]));for(let C=0;C<m.length;C++)u.set(C,m[C]);u.length=y.length},c.reflowSmallerGetNewLineLengths=function(u,y,m){const C=[],x=u.map(((p,f)=>h(u,f,y))).reduce(((p,f)=>p+f));let E=0,b=0,d=0;for(;d<x;){if(x-d<m){C.push(x-d);break}E+=m;const p=h(u,b,y);E>p&&(E-=p,b++);const f=u[b].getWidth(E-1)===2;f&&E--;const v=f?m-1:m;C.push(v),d+=v}return C},c.getWrappedLineTrimmedLength=h},5295:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const u=h(8460),y=h(844),m=h(9092);class C extends y.Disposable{constructor(E,b){super(),this._optionsService=E,this._bufferService=b,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 m.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new m.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(E){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(E),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(E,b){this._normal.resize(E,b),this._alt.resize(E,b),this.setupTabStops(E)}setupTabStops(E){this._normal.setupTabStops(E),this._alt.setupTabStops(E)}}c.BufferSet=C},511:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const u=h(482),y=h(643),m=h(3734);class C extends m.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new m.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const b=new C;return b.setFromCharData(E),b}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(E){this.fg=E[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let b=!1;if(E[y.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(E[y.CHAR_DATA_CHAR_INDEX].length===2){const d=E[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=d&&d<=56319){const p=E[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(d-55296)+p-56320+65536|E[y.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=E[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[y.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=E[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=C},643:(T,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:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const u=h(8460),y=h(844);class m{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=m._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(x){return this._disposables.push(x),x}}c.Marker=m,m._nextId=1},7116:(T,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:(T,c)=>{var h,u,y;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(m){m.NUL="\0",m.SOH="",m.STX="",m.ETX="",m.EOT="",m.ENQ="",m.ACK="",m.BEL="\x07",m.BS="\b",m.HT=" ",m.LF=`
|
|
261
|
-
`,m.VT="\v",m.FF="\f",m.CR="\r",m.SO="",m.SI="",m.DLE="",m.DC1="",m.DC2="",m.DC3="",m.DC4="",m.NAK="",m.SYN="",m.ETB="",m.CAN="",m.EM="",m.SUB="",m.ESC="\x1B",m.FS="",m.GS="",m.RS="",m.US="",m.SP=" ",m.DEL=""})(h||(c.C0=h={})),(function(m){m.PAD="",m.HOP="",m.BPH="",m.NBH="",m.IND="",m.NEL="
",m.SSA="",m.ESA="",m.HTS="",m.HTJ="",m.VTS="",m.PLD="",m.PLU="",m.RI="",m.SS2="",m.SS3="",m.DCS="",m.PU1="",m.PU2="",m.STS="",m.CCH="",m.MW="",m.SPA="",m.EPA="",m.SOS="",m.SGCI="",m.SCI="",m.CSI="",m.ST="",m.OSC="",m.PM="",m.APC=""})(u||(c.C1=u={})),(function(m){m.ST=`${h.ESC}\\`})(y||(c.C1_ESCAPED=y={}))},7399:(T,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(m,C,x,E){const b={type:0,cancel:!1,key:void 0},d=(m.shiftKey?1:0)|(m.altKey?2:0)|(m.ctrlKey?4:0)|(m.metaKey?8:0);switch(m.keyCode){case 0:m.key==="UIKeyInputUpArrow"?b.key=C?u.C0.ESC+"OA":u.C0.ESC+"[A":m.key==="UIKeyInputLeftArrow"?b.key=C?u.C0.ESC+"OD":u.C0.ESC+"[D":m.key==="UIKeyInputRightArrow"?b.key=C?u.C0.ESC+"OC":u.C0.ESC+"[C":m.key==="UIKeyInputDownArrow"&&(b.key=C?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:b.key=m.ctrlKey?"\b":u.C0.DEL,m.altKey&&(b.key=u.C0.ESC+b.key);break;case 9:if(m.shiftKey){b.key=u.C0.ESC+"[Z";break}b.key=u.C0.HT,b.cancel=!0;break;case 13:b.key=m.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,b.cancel=!0;break;case 27:b.key=u.C0.ESC,m.altKey&&(b.key=u.C0.ESC+u.C0.ESC),b.cancel=!0;break;case 37:if(m.metaKey)break;d?(b.key=u.C0.ESC+"[1;"+(d+1)+"D",b.key===u.C0.ESC+"[1;3D"&&(b.key=u.C0.ESC+(x?"b":"[1;5D"))):b.key=C?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(m.metaKey)break;d?(b.key=u.C0.ESC+"[1;"+(d+1)+"C",b.key===u.C0.ESC+"[1;3C"&&(b.key=u.C0.ESC+(x?"f":"[1;5C"))):b.key=C?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(m.metaKey)break;d?(b.key=u.C0.ESC+"[1;"+(d+1)+"A",x||b.key!==u.C0.ESC+"[1;3A"||(b.key=u.C0.ESC+"[1;5A")):b.key=C?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(m.metaKey)break;d?(b.key=u.C0.ESC+"[1;"+(d+1)+"B",x||b.key!==u.C0.ESC+"[1;3B"||(b.key=u.C0.ESC+"[1;5B")):b.key=C?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:m.shiftKey||m.ctrlKey||(b.key=u.C0.ESC+"[2~");break;case 46:b.key=d?u.C0.ESC+"[3;"+(d+1)+"~":u.C0.ESC+"[3~";break;case 36:b.key=d?u.C0.ESC+"[1;"+(d+1)+"H":C?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:b.key=d?u.C0.ESC+"[1;"+(d+1)+"F":C?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:m.shiftKey?b.type=2:m.ctrlKey?b.key=u.C0.ESC+"[5;"+(d+1)+"~":b.key=u.C0.ESC+"[5~";break;case 34:m.shiftKey?b.type=3:m.ctrlKey?b.key=u.C0.ESC+"[6;"+(d+1)+"~":b.key=u.C0.ESC+"[6~";break;case 112:b.key=d?u.C0.ESC+"[1;"+(d+1)+"P":u.C0.ESC+"OP";break;case 113:b.key=d?u.C0.ESC+"[1;"+(d+1)+"Q":u.C0.ESC+"OQ";break;case 114:b.key=d?u.C0.ESC+"[1;"+(d+1)+"R":u.C0.ESC+"OR";break;case 115:b.key=d?u.C0.ESC+"[1;"+(d+1)+"S":u.C0.ESC+"OS";break;case 116:b.key=d?u.C0.ESC+"[15;"+(d+1)+"~":u.C0.ESC+"[15~";break;case 117:b.key=d?u.C0.ESC+"[17;"+(d+1)+"~":u.C0.ESC+"[17~";break;case 118:b.key=d?u.C0.ESC+"[18;"+(d+1)+"~":u.C0.ESC+"[18~";break;case 119:b.key=d?u.C0.ESC+"[19;"+(d+1)+"~":u.C0.ESC+"[19~";break;case 120:b.key=d?u.C0.ESC+"[20;"+(d+1)+"~":u.C0.ESC+"[20~";break;case 121:b.key=d?u.C0.ESC+"[21;"+(d+1)+"~":u.C0.ESC+"[21~";break;case 122:b.key=d?u.C0.ESC+"[23;"+(d+1)+"~":u.C0.ESC+"[23~";break;case 123:b.key=d?u.C0.ESC+"[24;"+(d+1)+"~":u.C0.ESC+"[24~";break;default:if(!m.ctrlKey||m.shiftKey||m.altKey||m.metaKey)if(x&&!E||!m.altKey||m.metaKey)!x||m.altKey||m.ctrlKey||m.shiftKey||!m.metaKey?m.key&&!m.ctrlKey&&!m.altKey&&!m.metaKey&&m.keyCode>=48&&m.key.length===1?b.key=m.key:m.key&&m.ctrlKey&&(m.key==="_"&&(b.key=u.C0.US),m.key==="@"&&(b.key=u.C0.NUL)):m.keyCode===65&&(b.type=1);else{const p=y[m.keyCode],f=p==null?void 0:p[m.shiftKey?1:0];if(f)b.key=u.C0.ESC+f;else if(m.keyCode>=65&&m.keyCode<=90){const v=m.ctrlKey?m.keyCode-64:m.keyCode+32;let S=String.fromCharCode(v);m.shiftKey&&(S=S.toUpperCase()),b.key=u.C0.ESC+S}else if(m.keyCode===32)b.key=u.C0.ESC+(m.ctrlKey?u.C0.NUL:" ");else if(m.key==="Dead"&&m.code.startsWith("Key")){let v=m.code.slice(3,4);m.shiftKey||(v=v.toLowerCase()),b.key=u.C0.ESC+v,b.cancel=!0}}else m.keyCode>=65&&m.keyCode<=90?b.key=String.fromCharCode(m.keyCode-64):m.keyCode===32?b.key=u.C0.NUL:m.keyCode>=51&&m.keyCode<=55?b.key=String.fromCharCode(m.keyCode-51+27):m.keyCode===56?b.key=u.C0.DEL:m.keyCode===219?b.key=u.C0.ESC:m.keyCode===220?b.key=u.C0.FS:m.keyCode===221&&(b.key=u.C0.GS)}return b}},482:(T,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 m="";for(let C=u;C<y;++C){let x=h[C];x>65535?(x-=65536,m+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):m+=String.fromCharCode(x)}return m},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,u){const y=h.length;if(!y)return 0;let m=0,C=0;if(this._interim){const x=h.charCodeAt(C++);56320<=x&&x<=57343?u[m++]=1024*(this._interim-55296)+x-56320+65536:(u[m++]=this._interim,u[m++]=x),this._interim=0}for(let x=C;x<y;++x){const E=h.charCodeAt(x);if(55296<=E&&E<=56319){if(++x>=y)return this._interim=E,m;const b=h.charCodeAt(x);56320<=b&&b<=57343?u[m++]=1024*(E-55296)+b-56320+65536:(u[m++]=E,u[m++]=b)}else E!==65279&&(u[m++]=E)}return m}},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 m,C,x,E,b=0,d=0,p=0;if(this.interim[0]){let S=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let D,M=0;for(;(D=63&this.interim[++M])&&M<4;)R<<=6,R|=D;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=A-M;for(;p<B;){if(p>=y)return 0;if(D=h[p++],(192&D)!=128){p--,S=!0;break}this.interim[M++]=D,R<<=6,R|=63&D}S||(A===2?R<128?p--:u[b++]=R:A===3?R<2048||R>=55296&&R<=57343||R===65279||(u[b++]=R):R<65536||R>1114111||(u[b++]=R)),this.interim.fill(0)}const f=y-4;let v=p;for(;v<y;){for(;!(!(v<f)||128&(m=h[v])||128&(C=h[v+1])||128&(x=h[v+2])||128&(E=h[v+3]));)u[b++]=m,u[b++]=C,u[b++]=x,u[b++]=E,v+=4;if(m=h[v++],m<128)u[b++]=m;else if((224&m)==192){if(v>=y)return this.interim[0]=m,b;if(C=h[v++],(192&C)!=128){v--;continue}if(d=(31&m)<<6|63&C,d<128){v--;continue}u[b++]=d}else if((240&m)==224){if(v>=y)return this.interim[0]=m,b;if(C=h[v++],(192&C)!=128){v--;continue}if(v>=y)return this.interim[0]=m,this.interim[1]=C,b;if(x=h[v++],(192&x)!=128){v--;continue}if(d=(15&m)<<12|(63&C)<<6|63&x,d<2048||d>=55296&&d<=57343||d===65279)continue;u[b++]=d}else if((248&m)==240){if(v>=y)return this.interim[0]=m,b;if(C=h[v++],(192&C)!=128){v--;continue}if(v>=y)return this.interim[0]=m,this.interim[1]=C,b;if(x=h[v++],(192&x)!=128){v--;continue}if(v>=y)return this.interim[0]=m,this.interim[1]=C,this.interim[2]=x,b;if(E=h[v++],(192&E)!=128){v--;continue}if(d=(7&m)<<18|(63&C)<<12|(63&x)<<6|63&E,d<65536||d>1114111)continue;u[b++]=d}}return b}}},225:(T,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]],m=[[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 C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let x=0;x<y.length;++x)C.fill(0,y[x][0],y[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?C[x]:(function(E,b){let d,p=0,f=b.length-1;if(E<b[0][0]||E>b[f][1])return!1;for(;f>=p;)if(d=p+f>>1,E>b[d][1])p=d+1;else{if(!(E<b[d][0]))return!0;f=d-1}return!1})(x,m)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,E){let b=this.wcwidth(x),d=b===0&&E!==0;if(d){const p=u.UnicodeService.extractWidth(E);p===0?d=!1:p>b&&(b=p)}return u.UnicodeService.createPropertyValue(0,b,d)}}},5981:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const u=h(8460),y=h(844);class m extends y.Disposable{constructor(x){super(),this._action=x,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(x,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let b;for(this._isSyncWriting=!0;b=this._writeBuffer.shift();){this._action(b);const d=this._callbacks.shift();d&&d()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,E){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+=x.length,this._writeBuffer.push(x),this._callbacks.push(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(E)}_innerWrite(x=0,E=!0){const b=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const d=this._writeBuffer[this._bufferOffset],p=this._action(d,E);if(p){const v=S=>Date.now()-b>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(b,S);return void p.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(v)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=d.length,Date.now()-b>=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=m},5941:(T,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(m,C){const x=m.toString(16),E=x.length<2?"0"+x:x;switch(C){case 4:return x[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}c.parseColor=function(m){if(!m)return;let C=m.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const x=h.exec(C);if(x){const E=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/E*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/E*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/E*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),u.exec(C)&&[3,6,9,12].includes(C.length))){const x=C.length/3,E=[0,0,0];for(let b=0;b<3;++b){const d=parseInt(C.slice(x*b,x*b+x),16);E[b]=x===1?d<<4:x===2?d:x===3?d>>4:d>>8}return E}},c.toRgbString=function(m,C=16){const[x,E,b]=m;return`rgb:${y(x,C)}/${y(E,C)}/${y(b,C)}`}},5770:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const u=h(482),y=h(8742),m=h(5770),C=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=C,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=C}registerHandler(E,b){this._handlers[E]===void 0&&(this._handlers[E]=[]);const d=this._handlers[E];return d.push(b),{dispose:()=>{const p=d.indexOf(b);p!==-1&&d.splice(p,1)}}}clearHandler(E){this._handlers[E]&&delete this._handlers[E]}setHandlerFallback(E){this._handlerFb=E}reset(){if(this._active.length)for(let E=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;E>=0;--E)this._active[E].unhook(!1);this._stack.paused=!1,this._active=C,this._ident=0}hook(E,b){if(this.reset(),this._ident=E,this._active=this._handlers[E]||C,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].hook(b);else this._handlerFb(this._ident,"HOOK",b)}put(E,b,d){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(E,b,d);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(E,b,d))}unhook(E,b=!0){if(this._active.length){let d=!1,p=this._active.length-1,f=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,d=b,f=this._stack.fallThrough,this._stack.paused=!1),!f&&d===!1){for(;p>=0&&(d=this._active[p].unhook(E),d!==!0);p--)if(d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,d;p--}for(;p>=0;p--)if(d=this._active[p].unhook(!1),d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,d}else this._handlerFb(this._ident,"UNHOOK",E);this._active=C,this._ident=0}};const x=new y.Params;x.addParam(0),c.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=x,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():x,this._data="",this._hitLimit=!1}put(E,b,d){this._hitLimit||(this._data+=(0,u.utf32ToString)(E,b,d),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let b=!1;if(this._hitLimit)b=!1;else if(E&&(b=this._handler(this._data,this._params),b instanceof Promise))return b.then((d=>(this._params=x,this._data="",this._hitLimit=!1,d)));return this._params=x,this._data="",this._hitLimit=!1,b}}},2015:(T,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),m=h(6242),C=h(6351);class x{constructor(p){this.table=new Uint8Array(p)}setDefault(p,f){this.table.fill(p<<4|f)}add(p,f,v,S){this.table[f<<8|p]=v<<4|S}addMany(p,f,v,S){for(let R=0;R<p.length;R++)this.table[f<<8|p[R]]=v<<4|S}}c.TransitionTable=x;const E=160;c.VT500_TRANSITION_TABLE=(function(){const d=new x(4095),p=Array.apply(null,Array(256)).map(((M,A)=>A)),f=(M,A)=>p.slice(M,A),v=f(32,127),S=f(0,24);S.push(25),S.push.apply(S,f(28,32));const R=f(0,14);let D;for(D in d.setDefault(1,0),d.addMany(v,0,2,0),R)d.addMany([24,26,153,154],D,3,0),d.addMany(f(128,144),D,3,0),d.addMany(f(144,152),D,3,0),d.add(156,D,0,0),d.add(27,D,11,1),d.add(157,D,4,8),d.addMany([152,158,159],D,0,7),d.add(155,D,11,3),d.add(144,D,11,9);return d.addMany(S,0,3,0),d.addMany(S,1,3,1),d.add(127,1,0,1),d.addMany(S,8,0,8),d.addMany(S,3,3,3),d.add(127,3,0,3),d.addMany(S,4,3,4),d.add(127,4,0,4),d.addMany(S,6,3,6),d.addMany(S,5,3,5),d.add(127,5,0,5),d.addMany(S,2,3,2),d.add(127,2,0,2),d.add(93,1,4,8),d.addMany(v,8,5,8),d.add(127,8,5,8),d.addMany([156,27,24,26,7],8,6,0),d.addMany(f(28,32),8,0,8),d.addMany([88,94,95],1,0,7),d.addMany(v,7,0,7),d.addMany(S,7,0,7),d.add(156,7,0,0),d.add(127,7,0,7),d.add(91,1,11,3),d.addMany(f(64,127),3,7,0),d.addMany(f(48,60),3,8,4),d.addMany([60,61,62,63],3,9,4),d.addMany(f(48,60),4,8,4),d.addMany(f(64,127),4,7,0),d.addMany([60,61,62,63],4,0,6),d.addMany(f(32,64),6,0,6),d.add(127,6,0,6),d.addMany(f(64,127),6,0,0),d.addMany(f(32,48),3,9,5),d.addMany(f(32,48),5,9,5),d.addMany(f(48,64),5,0,6),d.addMany(f(64,127),5,7,0),d.addMany(f(32,48),4,9,5),d.addMany(f(32,48),1,9,2),d.addMany(f(32,48),2,9,2),d.addMany(f(48,127),2,10,0),d.addMany(f(48,80),1,10,0),d.addMany(f(81,88),1,10,0),d.addMany([89,90,92],1,10,0),d.addMany(f(96,127),1,10,0),d.add(80,1,11,9),d.addMany(S,9,0,9),d.add(127,9,0,9),d.addMany(f(28,32),9,0,9),d.addMany(f(32,48),9,9,12),d.addMany(f(48,60),9,8,10),d.addMany([60,61,62,63],9,9,10),d.addMany(S,11,0,11),d.addMany(f(32,128),11,0,11),d.addMany(f(28,32),11,0,11),d.addMany(S,10,0,10),d.add(127,10,0,10),d.addMany(f(28,32),10,0,10),d.addMany(f(48,60),10,8,10),d.addMany([60,61,62,63],10,0,11),d.addMany(f(32,48),10,9,12),d.addMany(S,12,0,12),d.add(127,12,0,12),d.addMany(f(28,32),12,0,12),d.addMany(f(32,48),12,9,12),d.addMany(f(48,64),12,0,11),d.addMany(f(64,127),12,12,13),d.addMany(f(64,127),10,12,13),d.addMany(f(64,127),9,12,13),d.addMany(S,13,13,13),d.addMany(v,13,13,13),d.add(127,13,0,13),d.addMany([27,156,24,26],13,14,0),d.add(E,0,2,0),d.add(E,8,5,8),d.add(E,6,0,6),d.add(E,11,0,11),d.add(E,13,13,13),d})();class b extends u.Disposable{constructor(p=c.VT500_TRANSITION_TABLE){super(),this._transitions=p,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=(f,v,S)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,v)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,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 m.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(p,f=[64,126]){let v=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(v=p.prefix.charCodeAt(0),v&&60>v||v>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<p.intermediates.length;++R){const D=p.intermediates.charCodeAt(R);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");v<<=8,v|=D}}if(p.final.length!==1)throw new Error("final must be a single byte");const S=p.final.charCodeAt(0);if(f[0]>S||S>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return v<<=8,v|=S,v}identToString(p){const f=[];for(;p;)f.push(String.fromCharCode(255&p)),p>>=8;return f.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,f){const v=this._identifier(p,[48,126]);this._escHandlers[v]===void 0&&(this._escHandlers[v]=[]);const S=this._escHandlers[v];return S.push(f),{dispose:()=>{const R=S.indexOf(f);R!==-1&&S.splice(R,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,f){this._executeHandlers[p.charCodeAt(0)]=f}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,f){const v=this._identifier(p);this._csiHandlers[v]===void 0&&(this._csiHandlers[v]=[]);const S=this._csiHandlers[v];return S.push(f),{dispose:()=>{const R=S.indexOf(f);R!==-1&&S.splice(R,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,f){return this._dcsParser.registerHandler(this._identifier(p),f)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,f){return this._oscParser.registerHandler(p,f)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}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(p,f,v,S,R){this._parseStack.state=p,this._parseStack.handlers=f,this._parseStack.handlerPos=v,this._parseStack.transition=S,this._parseStack.chunkPos=R}parse(p,f,v){let S,R=0,D=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(v===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(v===!1&&B>-1){for(;B>=0&&(S=A[B](this._params),S!==!0);B--)if(S instanceof Promise)return this._parseStack.handlerPos=B,S}this._parseStack.handlers=[];break;case 4:if(v===!1&&B>-1){for(;B>=0&&(S=A[B](),S!==!0);B--)if(S instanceof Promise)return this._parseStack.handlerPos=B,S}this._parseStack.handlers=[];break;case 6:if(R=p[this._parseStack.chunkPos],S=this._dcsParser.unhook(R!==24&&R!==26,v),S)return S;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=p[this._parseStack.chunkPos],S=this._oscParser.end(R!==24&&R!==26,v),S)return S;R===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 A=M;A<f;++A){switch(R=p[A],D=this._transitions.table[this.currentState<<8|(R<160?R:E)],D>>4){case 2:for(let P=A+1;;++P){if(P>=f||(R=p[P])<32||R>126&&R<E){this._printHandler(p,A,P),A=P-1;break}if(++P>=f||(R=p[P])<32||R>126&&R<E){this._printHandler(p,A,P),A=P-1;break}if(++P>=f||(R=p[P])<32||R>126&&R<E){this._printHandler(p,A,P),A=P-1;break}if(++P>=f||(R=p[P])<32||R>126&&R<E){this._printHandler(p,A,P),A=P-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const B=this._csiHandlers[this._collect<<8|R];let $=B?B.length-1:-1;for(;$>=0&&(S=B[$](this._params),S!==!0);$--)if(S instanceof Promise)return this._preserveStack(3,B,$,D,A),S;$<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++A<f&&(R=p[A])>47&&R<60);A--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const I=this._escHandlers[this._collect<<8|R];let q=I?I.length-1:-1;for(;q>=0&&(S=I[q](),S!==!0);q--)if(S instanceof Promise)return this._preserveStack(4,I,q,D,A),S;q<0&&this._escHandlerFb(this._collect<<8|R),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|R,this._params);break;case 13:for(let P=A+1;;++P)if(P>=f||(R=p[P])===24||R===26||R===27||R>127&&R<E){this._dcsParser.put(p,A,P),A=P-1;break}break;case 14:if(S=this._dcsParser.unhook(R!==24&&R!==26),S)return this._preserveStack(6,[],0,D,A),S;R===27&&(D|=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 P=A+1;;P++)if(P>=f||(R=p[P])<32||R>127&&R<E){this._oscParser.put(p,A,P),A=P-1;break}break;case 6:if(S=this._oscParser.end(R!==24&&R!==26),S)return this._preserveStack(5,[],0,D,A),S;R===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&D}}}c.EscapeSequenceParser=b},6242:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const u=h(5770),y=h(482),m=[];c.OscParser=class{constructor(){this._state=0,this._active=m,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,x){this._handlers[C]===void 0&&(this._handlers[C]=[]);const E=this._handlers[C];return E.push(x),{dispose:()=>{const b=E.indexOf(x);b!==-1&&E.splice(b,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}reset(){if(this._state===2)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].end(!1);this._stack.paused=!1,this._active=m,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||m,this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].start();else this._handlerFb(this._id,"START")}_put(C,x,E){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(C,x,E);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(C,x,E))}start(){this.reset(),this._state=1}put(C,x,E){if(this._state!==3){if(this._state===1)for(;x<E;){const b=C[x++];if(b===59){this._state=2,this._start();break}if(b<48||57<b)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+b-48}this._state===2&&E-x>0&&this._put(C,x,E)}}end(C,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,b=this._active.length-1,d=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,E=x,d=this._stack.fallThrough,this._stack.paused=!1),!d&&E===!1){for(;b>=0&&(E=this._active[b].end(C),E!==!0);b--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,E;b--}for(;b>=0;b--)if(E=this._active[b].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",C);this._active=m,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(C){this._handler=C,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(C,x,E){this._hitLimit||(this._data+=(0,y.utf32ToString)(C,x,E),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let x=!1;if(this._hitLimit)x=!1;else if(C&&(x=this._handler(this._data),x instanceof Promise))return x.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,x}}},8742:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const h=2147483647;class u{static fromArray(m){const C=new u;if(!m.length)return C;for(let x=Array.isArray(m[0])?1:0;x<m.length;++x){const E=m[x];if(Array.isArray(E))for(let b=0;b<E.length;++b)C.addSubParam(E[b]);else C.addParam(E)}return C}constructor(m=32,C=32){if(this.maxLength=m,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(m),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(m),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const m=new u(this.maxLength,this.maxSubParamsLength);return m.params.set(this.params),m.length=this.length,m._subParams.set(this._subParams),m._subParamsLength=this._subParamsLength,m._subParamsIdx.set(this._subParamsIdx),m._rejectDigits=this._rejectDigits,m._rejectSubDigits=this._rejectSubDigits,m._digitIsSub=this._digitIsSub,m}toArray(){const m=[];for(let C=0;C<this.length;++C){m.push(this.params[C]);const x=this._subParamsIdx[C]>>8,E=255&this._subParamsIdx[C];E-x>0&&m.push(Array.prototype.slice.call(this._subParams,x,E))}return m}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(m){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=m>h?h:m}}addSubParam(m){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=m>h?h:m,this._subParamsIdx[this.length-1]++}}hasSubParams(m){return(255&this._subParamsIdx[m])-(this._subParamsIdx[m]>>8)>0}getSubParams(m){const C=this._subParamsIdx[m]>>8,x=255&this._subParamsIdx[m];return x-C>0?this._subParams.subarray(C,x):null}getSubParamsAll(){const m={};for(let C=0;C<this.length;++C){const x=this._subParamsIdx[C]>>8,E=255&this._subParamsIdx[C];E-x>0&&(m[C]=this._subParams.slice(x,E))}return m}addDigit(m){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,E=x[C-1];x[C-1]=~E?Math.min(10*E+m,h):m}}c.Params=u},5741:(T,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:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const u=h(3785),y=h(511);c.BufferApiView=class{constructor(m,C){this._buffer=m,this.type=C}init(m){return this._buffer=m,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(m){const C=this._buffer.lines.get(m);if(C)return new u.BufferLineApiView(C)}getNullCell(){return new y.CellData}}},3785:(T,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,m){if(!(y<0||y>=this._line.length))return m?(this._line.loadCell(y,m),m):this._line.loadCell(y,new u.CellData)}translateToString(y,m,C){return this._line.translateToString(y,m,C)}}},8285:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const u=h(8771),y=h(8460),m=h(844);class C extends m.Disposable{constructor(E){super(),this._core=E,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=C},7975:(T,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,m)=>u(y,m.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:(T,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(T,c,h){var u=this&&this.__decorate||function(d,p,f,v){var S,R=arguments.length,D=R<3?p:v===null?v=Object.getOwnPropertyDescriptor(p,f):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(d,p,f,v);else for(var M=d.length-1;M>=0;M--)(S=d[M])&&(D=(R<3?S(D):R>3?S(p,f,D):S(p,f))||D);return R>3&&D&&Object.defineProperty(p,f,D),D},y=this&&this.__param||function(d,p){return function(f,v){p(f,v,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const m=h(8460),C=h(844),x=h(5295),E=h(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let b=c.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(d){super(),this.isUserScrolling=!1,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new m.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(d.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(d.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(d,this))}resize(d,p){this.cols=d,this.rows=p,this.buffers.resize(d,p),this._onResize.fire({cols:d,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(d,p=!1){const f=this.buffer;let v;v=this._cachedBlankLine,v&&v.length===this.cols&&v.getFg(0)===d.fg&&v.getBg(0)===d.bg||(v=f.getBlankLine(d,p),this._cachedBlankLine=v),v.isWrapped=p;const S=f.ybase+f.scrollTop,R=f.ybase+f.scrollBottom;if(f.scrollTop===0){const D=f.lines.isFull;R===f.lines.length-1?D?f.lines.recycle().copyFrom(v):f.lines.push(v.clone()):f.lines.splice(R+1,0,v.clone()),D?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const D=R-S+1;f.lines.shiftElements(S+1,D-1,-1),f.lines.set(R,v.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(d,p,f){const v=this.buffer;if(d<0){if(v.ydisp===0)return;this.isUserScrolling=!0}else d+v.ydisp>=v.ybase&&(this.isUserScrolling=!1);const S=v.ydisp;v.ydisp=Math.max(Math.min(v.ydisp+d,v.ybase),0),S!==v.ydisp&&(p||this._onScroll.fire(v.ydisp))}};c.BufferService=b=u([y(0,E.IOptionsService)],b)},7994:(T,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(T,c,h){var u=this&&this.__decorate||function(v,S,R,D){var M,A=arguments.length,B=A<3?S:D===null?D=Object.getOwnPropertyDescriptor(S,R):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(v,S,R,D);else for(var $=v.length-1;$>=0;$--)(M=v[$])&&(B=(A<3?M(B):A>3?M(S,R,B):M(S,R))||B);return A>3&&B&&Object.defineProperty(S,R,B),B},y=this&&this.__param||function(v,S){return function(R,D){S(R,D,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const m=h(2585),C=h(8460),x=h(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:v=>v.button!==4&&v.action===1&&(v.ctrl=!1,v.alt=!1,v.shift=!1,!0)},VT200:{events:19,restrict:v=>v.action!==32},DRAG:{events:23,restrict:v=>v.action!==32||v.button!==3},ANY:{events:31,restrict:v=>!0}};function b(v,S){let R=(v.ctrl?16:0)|(v.shift?4:0)|(v.alt?8:0);return v.button===4?(R|=64,R|=v.action):(R|=3&v.button,4&v.button&&(R|=64),8&v.button&&(R|=128),v.action===32?R|=32:v.action!==0||S||(R|=3)),R}const d=String.fromCharCode,p={DEFAULT:v=>{const S=[b(v,!1)+32,v.col+32,v.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${d(S[0])}${d(S[1])}${d(S[2])}`},SGR:v=>{const S=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${b(v,!0)};${v.col};${v.row}${S}`},SGR_PIXELS:v=>{const S=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${b(v,!0)};${v.x};${v.y}${S}`}};let f=c.CoreMouseService=class extends x.Disposable{constructor(v,S){super(),this._bufferService=v,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new C.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(E))this.addProtocol(R,E[R]);for(const R of Object.keys(p))this.addEncoding(R,p[R]);this.reset()}addProtocol(v,S){this._protocols[v]=S}addEncoding(v,S){this._encodings[v]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(v){if(!this._protocols[v])throw new Error(`unknown protocol "${v}"`);this._activeProtocol=v,this._onProtocolChange.fire(this._protocols[v].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(v){if(!this._encodings[v])throw new Error(`unknown encoding "${v}"`);this._activeEncoding=v}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(v){if(v.col<0||v.col>=this._bufferService.cols||v.row<0||v.row>=this._bufferService.rows||v.button===4&&v.action===32||v.button===3&&v.action!==32||v.button!==4&&(v.action===2||v.action===3)||(v.col++,v.row++,v.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,v,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(v))return!1;const S=this._encodings[this._activeEncoding](v);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=v,!0}explainEvents(v){return{down:!!(1&v),up:!!(2&v),drag:!!(4&v),move:!!(8&v),wheel:!!(16&v)}}_equalEvents(v,S,R){if(R){if(v.x!==S.x||v.y!==S.y)return!1}else if(v.col!==S.col||v.row!==S.row)return!1;return v.button===S.button&&v.action===S.action&&v.ctrl===S.ctrl&&v.alt===S.alt&&v.shift===S.shift}};c.CoreMouseService=f=u([y(0,m.IBufferService),y(1,m.ICoreService)],f)},6975:function(T,c,h){var u=this&&this.__decorate||function(f,v,S,R){var D,M=arguments.length,A=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(f,v,S,R);else for(var B=f.length-1;B>=0;B--)(D=f[B])&&(A=(M<3?D(A):M>3?D(v,S,A):D(v,S))||A);return M>3&&A&&Object.defineProperty(v,S,A),A},y=this&&this.__param||function(f,v){return function(S,R){v(S,R,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const m=h(1439),C=h(8460),x=h(844),E=h(2585),b=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=c.CoreService=class extends x.Disposable{constructor(f,v,S){super(),this._bufferService=f,this._logService=v,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new C.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new C.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new C.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new C.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,m.clone)(b),this.decPrivateModes=(0,m.clone)(d)}reset(){this.modes=(0,m.clone)(b),this.decPrivateModes=(0,m.clone)(d)}triggerDataEvent(f,v=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;v&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),v&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,(()=>f.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,(()=>f.split("").map((v=>v.charCodeAt(0))))),this._onBinary.fire(f))}};c.CoreService=p=u([y(0,E.IBufferService),y(1,E.ILogService),y(2,E.IOptionsService)],p)},9074:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const u=h(8055),y=h(8460),m=h(844),C=h(6106);let x=0,E=0;class b extends m.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((f=>f==null?void 0:f.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,m.toDisposable)((()=>this.reset())))}registerDecoration(f){if(f.marker.isDisposed)return;const v=new d(f);if(v){const S=v.marker.onDispose((()=>v.dispose()));v.onDispose((()=>{v&&(this._decorations.delete(v)&&this._onDecorationRemoved.fire(v),S.dispose())})),this._decorations.insert(v),this._onDecorationRegistered.fire(v)}return v}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,v,S){let R=0,D=0;for(const M of this._decorations.getKeyIterator(v))R=M.options.x??0,D=R+(M.options.width??1),f>=R&&f<D&&(!S||(M.options.layer??"bottom")===S)&&(yield M)}forEachDecorationAtCell(f,v,S,R){this._decorations.forEachByKey(v,(D=>{x=D.options.x??0,E=x+(D.options.width??1),f>=x&&f<E&&(!S||(D.options.layer??"bottom")===S)&&R(D)}))}}c.DecorationService=b;class d extends m.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(f){super(),this.options=f,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=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const u=h(2585),y=h(8343);class m{constructor(...x){this._entries=new Map;for(const[E,b]of x)this.set(E,b)}set(x,E){const b=this._entries.get(x);return this._entries.set(x,E),b}forEach(x){for(const[E,b]of this._entries.entries())x(E,b)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}c.ServiceCollection=m,c.InstantiationService=class{constructor(){this._services=new m,this._services.set(u.IInstantiationService,this)}setService(C,x){this._services.set(C,x)}getService(C){return this._services.get(C)}createInstance(C,...x){const E=(0,y.getServiceDependencies)(C).sort(((p,f)=>p.index-f.index)),b=[];for(const p of E){const f=this._services.get(p.id);if(!f)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${p.id}.`);b.push(f)}const d=E.length>0?E[0].index:x.length;if(x.length!==d)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${d+1} conflicts with ${x.length} static arguments`);return new C(...x,...b)}}},7866:function(T,c,h){var u=this&&this.__decorate||function(d,p,f,v){var S,R=arguments.length,D=R<3?p:v===null?v=Object.getOwnPropertyDescriptor(p,f):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(d,p,f,v);else for(var M=d.length-1;M>=0;M--)(S=d[M])&&(D=(R<3?S(D):R>3?S(p,f,D):S(p,f))||D);return R>3&&D&&Object.defineProperty(p,f,D),D},y=this&&this.__param||function(d,p){return function(f,v){p(f,v,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const m=h(844),C=h(2585),x={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let E,b=c.LogService=class extends m.Disposable{get logLevel(){return this._logLevel}constructor(d){super(),this._optionsService=d,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(d){for(let p=0;p<d.length;p++)typeof d[p]=="function"&&(d[p]=d[p]())}_log(d,p,f){this._evalLazyOptionalParams(f),d.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...f)}trace(d,...p){var f;this._logLevel<=C.LogLevelEnum.TRACE&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.trace.bind(this._optionsService.options.logger))??console.log,d,p)}debug(d,...p){var f;this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.debug.bind(this._optionsService.options.logger))??console.log,d,p)}info(d,...p){var f;this._logLevel<=C.LogLevelEnum.INFO&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.info.bind(this._optionsService.options.logger))??console.info,d,p)}warn(d,...p){var f;this._logLevel<=C.LogLevelEnum.WARN&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.warn.bind(this._optionsService.options.logger))??console.warn,d,p)}error(d,...p){var f;this._logLevel<=C.LogLevelEnum.ERROR&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.error.bind(this._optionsService.options.logger))??console.error,d,p)}};c.LogService=b=u([y(0,C.IOptionsService)],b),c.setTraceLogger=function(d){E=d},c.traceCall=function(d,p,f){if(typeof f.value!="function")throw new Error("not supported");const v=f.value;f.value=function(...S){if(E.logLevel!==C.LogLevelEnum.TRACE)return v.apply(this,S);E.trace(`GlyphRenderer#${v.name}(${S.map((D=>JSON.stringify(D))).join(", ")})`);const R=v.apply(this,S);return E.trace(`GlyphRenderer#${v.name} return`,R),R}}},7302:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const u=h(8460),y=h(844),m=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:m.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const C=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends y.Disposable{constructor(b){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const d={...c.DEFAULT_OPTIONS};for(const p in b)if(p in d)try{const f=b[p];d[p]=this._sanitizeAndValidateOption(p,f)}catch(f){console.error(f)}this.rawOptions=d,this.options={...d},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(b,d){return this.onOptionChange((p=>{p===b&&d(this.rawOptions[b])}))}onMultipleOptionChange(b,d){return this.onOptionChange((p=>{b.indexOf(p)!==-1&&d()}))}_setupOptions(){const b=p=>{if(!(p in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},d=(p,f)=>{if(!(p in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);f=this._sanitizeAndValidateOption(p,f),this.rawOptions[p]!==f&&(this.rawOptions[p]=f,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const f={get:b.bind(this,p),set:d.bind(this,p)};Object.defineProperty(this.options,p,f)}}_sanitizeAndValidateOption(b,d){switch(b){case"cursorStyle":if(d||(d=c.DEFAULT_OPTIONS[b]),!(function(p){return p==="block"||p==="underline"||p==="bar"})(d))throw new Error(`"${d}" is not a valid value for ${b}`);break;case"wordSeparator":d||(d=c.DEFAULT_OPTIONS[b]);break;case"fontWeight":case"fontWeightBold":if(typeof d=="number"&&1<=d&&d<=1e3)break;d=C.includes(d)?d:c.DEFAULT_OPTIONS[b];break;case"cursorWidth":d=Math.floor(d);case"lineHeight":case"tabStopWidth":if(d<1)throw new Error(`${b} cannot be less than 1, value: ${d}`);break;case"minimumContrastRatio":d=Math.max(1,Math.min(21,Math.round(10*d)/10));break;case"scrollback":if((d=Math.min(d,4294967295))<0)throw new Error(`${b} cannot be less than 0, value: ${d}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(d<=0)throw new Error(`${b} cannot be less than or equal to 0, value: ${d}`);break;case"rows":case"cols":if(!d&&d!==0)throw new Error(`${b} must be numeric, value: ${d}`);break;case"windowsPty":d=d??{}}return d}}c.OptionsService=x},2660:function(T,c,h){var u=this&&this.__decorate||function(x,E,b,d){var p,f=arguments.length,v=f<3?E:d===null?d=Object.getOwnPropertyDescriptor(E,b):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(x,E,b,d);else for(var S=x.length-1;S>=0;S--)(p=x[S])&&(v=(f<3?p(v):f>3?p(E,b,v):p(E,b))||v);return f>3&&v&&Object.defineProperty(E,b,v),v},y=this&&this.__param||function(x,E){return function(b,d){E(b,d,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const m=h(2585);let C=c.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const E=this._bufferService.buffer;if(x.id===void 0){const S=E.addMarker(E.ybase+E.y),R={data:x,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(R,S))),this._dataByLinkId.set(R.id,R),R.id}const b=x,d=this._getEntryIdKey(b),p=this._entriesWithId.get(d);if(p)return this.addLineToLink(p.id,E.ybase+E.y),p.id;const f=E.addMarker(E.ybase+E.y),v={id:this._nextId++,key:this._getEntryIdKey(b),data:b,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(v,f))),this._entriesWithId.set(v.key,v),this._dataByLinkId.set(v.id,v),v.id}addLineToLink(x,E){const b=this._dataByLinkId.get(x);if(b&&b.lines.every((d=>d.line!==E))){const d=this._bufferService.buffer.addMarker(E);b.lines.push(d),d.onDispose((()=>this._removeMarkerFromLink(b,d)))}}getLinkData(x){var E;return(E=this._dataByLinkId.get(x))==null?void 0:E.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,E){const b=x.lines.indexOf(E);b!==-1&&(x.lines.splice(b,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};c.OscLinkService=C=u([y(0,m.IBufferService)],C)},8343:(T,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 m=function(C,x,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,d,p){d[h]===d?d[u].push({id:b,index:p}):(d[u]=[{id:b,index:p}],d[h]=d)})(m,C,E)};return m.toString=()=>y,c.serviceRegistry.set(y,m),m}},2585:(T,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(m){m[m.TRACE=0]="TRACE",m[m.DEBUG=1]="DEBUG",m[m.INFO=2]="INFO",m[m.WARN=3]="WARN",m[m.ERROR=4]="ERROR",m[m.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:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const u=h(8460),y=h(225);class m{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,E,b=!1){return(16777215&x)<<3|(3&E)<<1|(b?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const x=new y.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let E=0,b=0;const d=x.length;for(let p=0;p<d;++p){let f=x.charCodeAt(p);if(55296<=f&&f<=56319){if(++p>=d)return E+this.wcwidth(f);const R=x.charCodeAt(p);56320<=R&&R<=57343?f=1024*(f-55296)+R-56320+65536:E+=this.wcwidth(R)}const v=this.charProperties(f,b);let S=m.extractWidth(v);m.extractShouldJoin(v)&&(S-=m.extractWidth(b)),E+=S,b=v}return E}charProperties(x,E){return this._activeProvider.charProperties(x,E)}}c.UnicodeService=m}},o={};function g(T){var c=o[T];if(c!==void 0)return c.exports;var h=o[T]={exports:{}};return a[T].call(h.exports,h,h.exports,g),h.exports}var w={};return(()=>{var T=w;Object.defineProperty(T,"__esModule",{value:!0}),T.Terminal=void 0;const c=g(9042),h=g(3236),u=g(844),y=g(5741),m=g(8285),C=g(7975),x=g(7090),E=["cols","rows"];class b extends u.Disposable{constructor(p){super(),this._core=this.register(new h.Terminal(p)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const f=S=>this._core.options[S],v=(S,R)=>{this._checkReadonlyOptions(S),this._core.options[S]=R};for(const S in this._core.options){const R={get:f.bind(this,S),set:v.bind(this,S)};Object.defineProperty(this._publicOptions,S,R)}}_checkReadonlyOptions(p){if(E.includes(p))throw new Error(`Option "${p}" 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 C.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.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 m.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const f in p)this._publicOptions[f]=p[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(p,f=!0){this._core.input(p,f)}resize(p,f){this._verifyIntegers(p,f),this._core.resize(p,f)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}attachCustomWheelEventHandler(p){this._core.attachCustomWheelEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){return this._checkProposedApi(),this._verifyPositiveIntegers(p.x??0,p.width??0,p.height??0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,f,v){this._verifyIntegers(p,f,v),this._core.select(p,f,v)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,f){this._verifyIntegers(p,f),this._core.selectLines(p,f)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,f){this._core.write(p,f)}writeln(p,f){this._core.write(p),this._core.write(`\r
|
|
262
|
-
`,f)}paste(p){this._core.paste(p)}refresh(p,f){this._verifyIntegers(p,f),this._core.refresh(p,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return c}_verifyIntegers(...p){for(const f of p)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const f of p)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}T.Terminal=b})(),w})()))})(Yu)),Yu.exports}var j2=z2(),Vu={exports:{}},up;function H2(){return up||(up=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(g){this._terminal=g}dispose(){}fit(){const g=this.proposeDimensions();if(!g||!this._terminal||isNaN(g.cols)||isNaN(g.rows))return;const w=this._terminal._core;this._terminal.rows===g.rows&&this._terminal.cols===g.cols||(w._renderService.clear(),this._terminal.resize(g.cols,g.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const g=this._terminal._core,w=g._renderService.dimensions;if(w.css.cell.width===0||w.css.cell.height===0)return;const T=this._terminal.options.scrollback===0?0:g.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),m=h-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),C=u-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-T;return{cols:Math.max(2,Math.floor(C/w.css.cell.width)),rows:Math.max(1,Math.floor(m/w.css.cell.height))}}}})(),a})()))})(Vu)),Vu.exports}var U2=H2();const I2=3e4,P2=300*1e3;class $2{constructor(r,a,o){wt(this,"ws",null);wt(this,"consecutiveFailures",0);wt(this,"failStartTime",null);wt(this,"destroyed",!1);wt(this,"reconnectTimer",null);wt(this,"url");wt(this,"authToken");wt(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,g,w,T,c;if(this.destroyed)return;if(this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=P2){(o=(a=this.callbacks).onGiveUp)==null||o.call(a),(w=(g=this.callbacks).onClose)==null||w.call(g);return}this.consecutiveFailures++;const r=Math.min(I2,1e3*Math.pow(2,this.consecutiveFailures-1));(c=(T=this.callbacks).onReconnecting)==null||c.call(T,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}}function F2({sessionId:i,status:r}){const a=Et(b=>b.token),o=F.useRef(null),g=F.useRef(null),w=F.useRef(null),T=F.useRef(null),c=F.useRef(r);F.useEffect(()=>{c.current=r},[r]);const[h,u]=F.useState("connecting"),[y,m]=F.useState(null),C=F.useCallback(()=>{const b=window.location.origin,d=`/v1/sessions/${encodeURIComponent(i)}/terminal`;return`${b.replace(/^http/,"ws")}${d}`},[i]);F.useEffect(()=>{if(!o.current)return;const b=new j2.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:1e3}),d=new U2.FitAddon;b.loadAddon(d),b.open(o.current),d.fit(),g.current=b,w.current=d;const p=new ResizeObserver(()=>{var S;d.fit();const{cols:f,rows:v}=b;(S=T.current)==null||S.send({type:"resize",cols:f,rows:v})});return p.observe(o.current),()=>{p.disconnect(),b.dispose(),g.current=null,w.current=null}},[]),F.useEffect(()=>{const b=C(),d=new $2(b,{onMessage:p=>{const f=p,v=g.current;if(v)switch(f.type){case"pane":v.reset(),v.write(f.content),m(null);break;case"status":break;case"error":m(f.message);break}},onOpen:()=>{var f;u("connected"),m(null);const p=g.current;w.current&&p&&((f=T.current)==null||f.send({type:"resize",cols:p.cols,rows:p.rows}))},onReconnecting:()=>{u("reconnecting")},onGiveUp:()=>{u("disconnected")},onClose:()=>{u("disconnected")}},a??void 0);return T.current=d,()=>{T.current=null,d.close()}},[C,a]),F.useEffect(()=>{const b=g.current;if(!b)return;const d=b.onData(p=>{var f;(f=T.current)==null||f.send({type:"input",text:p})});return()=>{d.dispose()}},[]);const x=r==="working",E=h==="connected";return O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[O.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-xs border-b border-[#1a1a2e]",children:[O.jsx("div",{className:"flex items-center gap-2",children:O.jsx("span",{className:"font-mono text-[#888]",children:"Terminal"})}),O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:E?"#00e5ff":h==="reconnecting"?"#ffaa00":"#666",boxShadow:E?"0 0 4px #00e5ff40":"none",animation:h==="reconnecting"?"pulse 1s ease-in-out infinite":"none"}}),O.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:h==="connecting"?"connecting…":h==="reconnecting"?"reconnecting…":h==="connected"?"ws live":"disconnected"})]}),O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:x?"#00ff88":"#888",boxShadow:x?"0 0 4px #00ff88":"none"}}),O.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:x?"active":"idle"})]})]})]}),y&&O.jsx("div",{className:"px-4 py-2 text-xs text-[#ff3366] bg-[#ff336610] border-b border-[#ff336620]",children:y}),O.jsx("div",{ref:o,className:"h-[calc(100vh-420px)] sm:h-[calc(100vh-460px)] min-h-[250px] sm:min-h-[300px]"})]})}function Z2({metrics:i,loading:r}){if(r||!i)return O.jsx("div",{className:"flex items-center justify-center h-48 text-[#555] text-sm animate-pulse",children:"Loading metrics…"});const a=[{label:"Duration",value:WE(i.durationSec*1e3),icon:"⏱",color:"#00e5ff"},{label:"Messages",value:i.messages.toString(),icon:"💬",color:"#00e5ff"},{label:"Tool Calls",value:i.toolCalls.toString(),icon:"🔧",color:"#00e5ff"},{label:"Approvals",value:i.approvals.toString(),icon:"✅",color:"#00ff88"},{label:"Auto-approvals",value:i.autoApprovals.toString(),icon:"⚡",color:"#ffaa00"},{label:"Status Changes",value:i.statusChanges.length.toString(),icon:"🔄",color:"#8888ff"}];return O.jsxs("div",{className:"space-y-4",children:[O.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:a.map(o=>O.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors duration-150 hover:border-[#00e5ff]/30",children:[O.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[O.jsx("span",{className:"text-base",children:o.icon}),O.jsx("span",{className:"text-[10px] text-[#888] uppercase tracking-wider",children:o.label})]}),O.jsx("div",{className:"text-2xl font-semibold font-mono tabular-nums",style:{color:o.color},children:o.value})]},o.label))}),i.statusChanges.length>0&&O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[O.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Status Changes"}),O.jsx("div",{className:"flex flex-wrap gap-2",children:i.statusChanges.map((o,g)=>O.jsx("div",{className:"text-xs font-mono text-[#555] bg-[#0a0a0f] px-2 py-1 rounded border border-[#1a1a2e]",children:o},g))})]})]})}const q2=new Set(["bypassPermissions","dontAsk","acceptEdits","plan","auto"]);function G2({prompt:i,permissionMode:r,onApprove:a,onReject:o}){const[g,w]=F.useState(!1);return r&&r!=="default"&&q2.has(r)?O.jsx("div",{className:"flex items-center gap-2 px-4 py-2 bg-[#003322]/50 border border-[#00ff88]/30 rounded-lg text-sm",children:O.jsxs("span",{className:"text-[#00ff88] font-semibold text-xs uppercase tracking-wider",children:["AUTO-APPROVED (",r,")"]})}):O.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-[#ffaa00]/40 rounded-lg",children:[O.jsxs("div",{className:"flex items-center gap-3 sm:gap-2 min-w-0",children:[O.jsx("span",{className:"text-[#ffaa00] text-lg shrink-0",children:"⚠"}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("div",{className:"text-xs text-[#ffaa00] font-semibold uppercase tracking-wider mb-0.5",children:"Permission Required"}),O.jsxs("div",{className:`text-sm text-[#e0e0e0] font-mono cursor-pointer ${g?"":"truncate"}`,onClick:()=>w(!g),title:g?void 0:"Click to expand",children:[i,!g&&i.length>60&&O.jsx("span",{className:"text-[#888] ml-1",children:"..."})]})]})]}),O.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[O.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#00ff88] border border-[#00ff88]/30 transition-colors",children:"Approve"}),O.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ff3366] border border-[#ff3366]/30 transition-colors",children:"Reject"})]})]})}const W2=[{id:"transcript",label:"Transcript"},{id:"terminal",label:"Terminal"},{id:"metrics",label:"Metrics"}];function Y2(){const{id:i}=xp(),r=ul(),[a,o]=F.useState("transcript"),{session:g,health:w,notFound:T,loading:c,metrics:h,metricsLoading:u}=s2(i??""),[y,m]=F.useState(""),[C,x]=F.useState(!1),E=F.useRef(null),b=F.useRef(!1),d=Xs(I=>I.addToast);if(c)return O.jsx("div",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center text-[#555] text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading session…"})});if(T||!g||!w)return O.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-[#555]",children:[O.jsx("div",{className:"text-6xl mb-4",children:"404"}),O.jsx("div",{className:"text-lg mb-6 text-[#e0e0e0]",children:"Session not found"}),O.jsx(Hi,{to:"/",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Overview"})]});const p=g,f=w,v=f.status==="permission_prompt"||f.status==="bash_approval";function S(){mv(p.id).catch(I=>d("error","Approve failed",I instanceof Error?I.message:void 0))}function R(){DE(p.id).catch(I=>d("error","Reject failed",I instanceof Error?I.message:void 0))}function D(){pv(p.id).catch(I=>d("error","Interrupt failed",I instanceof Error?I.message:void 0))}function M(){kE(p.id).catch(I=>d("error","Escape failed",I instanceof Error?I.message:void 0))}async function A(){try{await _v(p.id),r("/")}catch(I){d("error","Failed to kill session",I instanceof Error?I.message:void 0)}}async function B(){var q;const I=y.trim();if(I&&!b.current){b.current=!0,x(!0);try{await RE(p.id,I),m("")}catch(P){d("error","Failed to send message",P instanceof Error?P.message:void 0)}finally{x(!1),b.current=!1,(q=E.current)==null||q.focus()}}}function $(I){I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),B())}return O.jsx("div",{className:"min-h-screen bg-[#0a0a0f]",children:O.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:[O.jsxs("nav",{className:"text-xs text-[#555] flex items-center gap-1",children:[O.jsx(Hi,{to:"/",className:"hover:text-[#00e5ff] transition-colors",children:"Overview"}),O.jsx("span",{className:"text-[#333]",children:"/"}),O.jsx("span",{className:"text-[#e0e0e0] truncate max-w-[160px] sm:max-w-xs",children:p.windowName||p.id})]}),O.jsx(n2,{session:p,health:f,onApprove:S,onReject:R,onInterrupt:D,onKill:A}),O.jsx("div",{className:"flex border-b border-[#1a1a2e]",role:"tablist",children:W2.map(I=>O.jsxs("button",{id:`tab-${I.id}`,onClick:()=>o(I.id),role:"tab","aria-selected":a===I.id,"aria-controls":`panel-${I.id}`,tabIndex:a===I.id?0:-1,className:`flex-1 min-h-[44px] text-sm font-medium transition-colors relative ${a===I.id?"text-[#00e5ff]":"text-[#555] hover:text-[#888]"}`,children:[I.label,a===I.id&&O.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-[#00e5ff]"})]},I.id))}),O.jsxs("div",{className:"bg-[#0a0a0f] rounded-lg min-h-[300px] sm:min-h-[400px]",children:[v&&O.jsx("div",{className:"p-3 sm:p-4 pb-0",children:O.jsx(G2,{sessionId:p.id,prompt:f.details,permissionMode:p.permissionMode,onApprove:S,onReject:R})}),a==="transcript"&&O.jsx("div",{id:"panel-transcript",role:"tabpanel","aria-labelledby":"tab-transcript",tabIndex:0,className:"h-[calc(100vh-380px)] sm:h-[calc(100vh-420px)] min-h-[250px] sm:min-h-[300px]",children:O.jsx(B2,{sessionId:p.id})}),a==="terminal"&&O.jsx("div",{id:"panel-terminal",role:"tabpanel","aria-labelledby":"tab-terminal",tabIndex:0,children:O.jsx(F2,{sessionId:p.id,status:f.status})}),a==="metrics"&&O.jsx("div",{id:"panel-metrics",role:"tabpanel","aria-labelledby":"tab-metrics",tabIndex:0,className:"p-3 sm:p-4",children:O.jsx(Z2,{metrics:h,loading:u})})]}),O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx("input",{ref:E,type:"text",value:y,onChange:I=>m(I.target.value),onKeyDown:$,placeholder:"Send a message to Claude…",disabled:C||!f.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"}),O.jsx("button",{onClick:B,disabled:C||!y.trim()||!f.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:O.jsx(eb,{className:"h-4 w-4"})})]}),O.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#1a1a2e]/50",children:[O.jsxs("button",{onClick:D,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:[O.jsx(GS,{className:"h-3.5 w-3.5"}),"Interrupt"]}),O.jsxs("button",{onClick:M,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:[O.jsx(jS,{className:"h-3.5 w-3.5"}),"Escape"]})]})]})]})})}const V2={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"},K2=new Set(["running"]);function wv({status:i}){const r=V2[i]??"bg-gray-500/10 text-gray-500 border-gray-500/30",a=K2.has(i);return O.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&&O.jsxs("span",{className:"relative flex h-2 w-2",children:[O.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 bg-current"}),O.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]}),i]})}let X2=0;function pa(){return{workDir:"",name:"",prompt:"",_key:X2++}}function J2({open:i,onClose:r}){const a=ul(),o=F.useRef(null),g=F.useRef(null),[w,T]=F.useState(""),[c,h]=F.useState([pa(),pa()]),[u,y]=F.useState(!1),[m,C]=F.useState(null),x=F.useCallback(()=>{E(),r()},[r]);function E(){T(""),h([pa(),pa()]),y(!1),C(null)}F.useEffect(()=>{if(!i)return;const S=R=>{R.key==="Escape"&&x()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[i,x]),F.useEffect(()=>{if(!i)return;const S=o.current;if(!S)return;const R='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',D=M=>{if(M.key!=="Tab")return;const A=Array.from(S.querySelectorAll(R));if(A.length===0)return;const B=A[0],$=A[A.length-1];M.shiftKey?document.activeElement===B&&(M.preventDefault(),$.focus()):document.activeElement===$&&(M.preventDefault(),B.focus())};return S.addEventListener("keydown",D),()=>S.removeEventListener("keydown",D)},[i]),F.useEffect(()=>{if(i){const S=setTimeout(()=>{var R;return(R=g.current)==null?void 0:R.focus()},50);return()=>clearTimeout(S)}},[i]);function b(){c.length>=10||h([...c,pa()])}function d(S){c.length<=1||h(c.filter((R,D)=>D!==S))}function p(S,R,D){h(c.map((M,A)=>A===S?{...M,[R]:D}:M))}async function f(S){S.preventDefault(),C(null);const R=c.filter(D=>D.workDir.trim());if(!w.trim()){C("Pipeline name is required");return}if(R.length===0){C("At least one step with a working directory is required");return}y(!0);try{const D=await NE({name:w.trim(),workDir:R[0].workDir.trim(),stages:R.map(M=>({workDir:M.workDir.trim(),name:M.name.trim()||void 0,prompt:M.prompt.trim()||void 0}))});E(),r(),a(`/pipelines/${D.id}`)}catch(D){C(D instanceof Error?D.message:"Failed to create pipeline")}finally{y(!1)}}if(!i)return null;const v=w.trim()&&c.some(S=>S.workDir.trim());return O.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[O.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:x}),O.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:[O.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[O.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Pipeline"}),O.jsx("button",{onClick:x,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:O.jsx(dl,{className:"h-4 w-4"})})]}),O.jsxs("form",{onSubmit:f,className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{children:[O.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Pipeline Name ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("input",{type:"text",ref:g,value:w,onChange:S=>T(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-[#00e5ff]"})]}),O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[O.jsxs("span",{children:["Working Directory ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("span",{children:"Name"}),O.jsx("span",{children:"Prompt"}),O.jsx("span",{})]}),O.jsx("div",{className:"space-y-2",children:c.map((S,R)=>O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[O.jsx("input",{type:"text",value:S.workDir,onChange:D=>p(R,"workDir",D.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-[#00e5ff] font-mono"}),O.jsx("input",{type:"text",value:S.name,onChange:D=>p(R,"name",D.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-[#00e5ff]"}),O.jsx("input",{type:"text",value:S.prompt,onChange:D=>p(R,"prompt",D.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-[#00e5ff]"}),O.jsx("button",{type:"button",onClick:()=>d(R),disabled:c.length<=1,"aria-label":`Remove step ${R+1}`,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ff3366] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:O.jsx(Np,{className:"h-3.5 w-3.5"})})]},S._key))}),c.length<10&&O.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[O.jsx(fl,{className:"h-3.5 w-3.5"}),"Add Step"]}),m&&O.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:m}),O.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[O.jsx("button",{type:"button",onClick:x,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"}),O.jsxs("button",{type:"submit",disabled:u||!v,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:[u&&O.jsx(Ju,{className:"h-3 w-3 animate-spin"}),"Create Pipeline"]})]})]})]})]})}function Q2(){const[i,r]=F.useState([]),[a,o]=F.useState(!0),[g,w]=F.useState(!1),T=Xs(u=>u.addToast),c=F.useCallback(async()=>{try{const u=await BE();r(u)}catch(u){T("error","Failed to fetch pipelines",u instanceof Error?u.message:void 0)}finally{o(!1)}},[T]);F.useEffect(()=>{c();const u=setInterval(c,5e3);return()=>clearInterval(u)},[c]);const h={total:i.length,running:i.filter(u=>u.status==="running").length,completed:i.filter(u=>u.status==="completed").length,failed:i.filter(u=>u.status==="failed").length};return a?O.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading pipelines…"})}):O.jsxs("div",{className:"flex flex-col gap-6",children:[O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{children:[O.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Pipelines"}),O.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage and monitor session pipelines"})]}),O.jsxs("button",{onClick:()=>w(!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:[O.jsx(fl,{className:"h-3.5 w-3.5"}),"New Pipeline"]})]}),O.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[O.jsx(qs,{label:"Total",value:h.total}),O.jsx(qs,{label:"Running",value:h.running}),O.jsx(qs,{label:"Completed",value:h.completed}),O.jsx(qs,{label:"Failed",value:h.failed})]}),i.length===0?O.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:[O.jsx("p",{className:"text-gray-500",children:"No pipelines yet"}),O.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"Create a pipeline to run sessions in sequence"})]}):O.jsx("div",{className:"space-y-3",children:i.map(u=>O.jsx(Hi,{to:`/pipelines/${u.id}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 hover:border-[#00e5ff]/30 transition-colors",children:O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[O.jsx("span",{className:"font-medium text-gray-200 truncate",children:u.name}),O.jsx(wv,{status:u.status})]}),O.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 shrink-0 ml-4",children:[O.jsxs("span",{children:[u.stages.length," step",u.stages.length!==1?"s":""]}),O.jsx("span",{children:sn(u.createdAt)})]})]})},u.id))}),O.jsx(J2,{open:g,onClose:()=>w(!1)})]})}function eT(){const{id:i}=xp(),[r,a]=F.useState(null),[o,g]=F.useState(!0),[w,T]=F.useState(!1),c=Xs(u=>u.addToast),h=F.useCallback(async()=>{if(i)try{const u=await zE(i);a(u),T(!1)}catch(u){const y=u;y.statusCode===404?T(!0):c("error","Failed to fetch pipeline",y.message)}finally{g(!1)}},[i,c]);return F.useEffect(()=>{h();const u=setInterval(h,3e3);return()=>clearInterval(u)},[h]),o?O.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading pipeline…"})}):w||!r?O.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] text-gray-500",children:[O.jsx("div",{className:"text-6xl mb-4",children:"404"}),O.jsx("div",{className:"text-lg mb-6 text-gray-200",children:"Pipeline not found"}),O.jsx(Hi,{to:"/pipelines",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Pipelines"})]}):O.jsxs("div",{className:"flex flex-col gap-6",children:[O.jsxs("nav",{className:"text-xs text-gray-500 flex items-center gap-1",children:[O.jsx(Hi,{to:"/pipelines",className:"hover:text-[#00e5ff] transition-colors",children:"Pipelines"}),O.jsx("span",{className:"text-gray-700",children:"/"}),O.jsx("span",{className:"text-gray-200 truncate max-w-xs",children:r.name})]}),O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:r.name}),O.jsx(wv,{status:r.status})]}),O.jsxs("div",{className:"text-xs text-gray-500",children:["Created ",sn(r.createdAt)]})]}),O.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118]",children:[O.jsx("div",{className:"px-4 py-3 border-b border-void-lighter",children:O.jsxs("h3",{className:"text-sm font-semibold text-gray-200",children:["Steps (",r.stages.length,")"]})}),r.stages.length===0?O.jsx("div",{className:"p-8 text-center text-gray-500 text-sm",children:"No steps yet"}):O.jsxs("table",{className:"w-full text-left text-sm",children:[O.jsx("thead",{children:O.jsxs("tr",{className:"border-b border-void-lighter text-gray-600",children:[O.jsx("th",{className:"px-4 py-3 font-medium w-16",children:"#"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Session"})]})}),O.jsx("tbody",{children:r.stages.map((u,y)=>O.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[O.jsxs("td",{className:"px-4 py-3 text-gray-500 font-mono text-xs",children:["#",y+1]}),O.jsx("td",{className:"px-4 py-3",children:O.jsx(ll,{status:u.status})}),O.jsx("td",{className:"px-4 py-3",children:u.sessionId?O.jsx(Hi,{to:`/sessions/${encodeURIComponent(u.sessionId)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:u.name}):O.jsx("span",{className:"font-medium text-gray-200",children:u.name})}),O.jsx("td",{className:"px-4 py-3 font-mono text-xs text-gray-400",children:u.sessionId??"—"})]},u.name))})]})]})]})}function tT(){return O.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 text-center",children:[O.jsx("h1",{className:"text-6xl font-bold text-gray-500",children:"404"}),O.jsx("p",{className:"text-lg text-gray-400",children:"Page not found"}),O.jsx(Hi,{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 iT(){return O.jsx(wS,{children:O.jsx(qy,{children:O.jsxs(pr,{element:O.jsx(qE,{}),children:[O.jsx(pr,{path:"/",element:O.jsx(i2,{})}),O.jsx(pr,{path:"/sessions/:id",element:O.jsx(Y2,{})}),O.jsx(pr,{path:"/pipelines",element:O.jsx(Q2,{})}),O.jsx(pr,{path:"/pipelines/:id",element:O.jsx(eT,{})}),O.jsx(pr,{path:"*",element:O.jsx(tT,{})})]})})})}q0.createRoot(document.getElementById("root")).render(O.jsx(va.StrictMode,{children:O.jsx(mS,{basename:"/dashboard",children:O.jsx(iT,{})})}));
|
|
260
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),p.isLinux&&A&&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(A){const B=this._getMouseBufferCoords(A),$=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!($&&I&&B)&&this._areCoordsInSelection(B,$,I)}isCellInSelection(A,B){const $=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!$||!I)&&this._areCoordsInSelection([A,B],$,I)}_areCoordsInSelection(A,B,$){return A[1]>B[1]&&A[1]<$[1]||B[1]===$[1]&&A[1]===B[1]&&A[0]>=B[0]&&A[0]<$[0]||B[1]<$[1]&&A[1]===$[1]&&A[0]<$[0]||B[1]<$[1]&&A[1]===B[1]&&A[0]>=B[0]}_selectWordAtCursor(A,B){var q,P;const $=(P=(q=this._linkifier.currentLink)==null?void 0:q.link)==null?void 0:P.range;if($)return this._model.selectionStart=[$.start.x-1,$.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)($,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(A);return!!I&&(this._selectWordAt(I,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,B){this._model.clearSelection(),A=Math.max(A,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const B=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(A){let B=(0,m.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const $=this._renderService.dimensions.css.canvas.height;return B>=0&&B<=$?0:(B>$&&(B-=$),B=Math.min(Math.max(B,-50),50),B/=50,B/Math.abs(B)+Math.round(14*B))}shouldForceSelection(A){return p.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),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(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const B=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);B&&B.length!==this._model.selectionStart[0]&&B.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const B=this._getMouseBufferCoords(A);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(A){return A.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.stopImmediatePropagation(),!this._model.selectionStart)return;const B=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),!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(A),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 I=$.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}B&&B[0]===this._model.selectionEnd[0]&&B[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const B=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const $=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if($&&$[0]!==void 0&&$[1]!==void 0){const I=(0,C.moveToCellSequence)($[0]-1,$[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,$=!(!A||!B||A[0]===B[0]&&A[1]===B[1]);$?A&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,B,$)):this._oldHasSelection&&this._fireOnSelectionChange(A,B,$)}_fireOnSelectionChange(A,B,$){this._oldSelectionStart=A,this._oldSelectionEnd=B,this._oldHasSelection=$,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(A,B){let $=B;for(let I=0;B>=I;I++){const q=A.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?$--:q>1&&B!==I&&($+=q-1)}return $}setSelection(A,B,$){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,B],this._model.selectionStartLength=$,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,B,$=!0,I=!0){if(A[0]>=this._bufferService.cols)return;const q=this._bufferService.buffer,P=q.lines.get(A[1]);if(!P)return;const Q=q.translateBufferLineToString(A[1],!1);let se=this._convertViewportColToCharacterIndex(P,A[0]),G=se;const K=A[0]-se;let ee=0,N=0,U=0,L=0;if(Q.charAt(se)===" "){for(;se>0&&Q.charAt(se-1)===" ";)se--;for(;G<Q.length&&Q.charAt(G+1)===" ";)G++}else{let ne=A[0],he=A[0];P.getWidth(ne)===0&&(ee++,ne--),P.getWidth(he)===2&&(N++,he++);const me=P.getString(he).length;for(me>1&&(L+=me-1,G+=me-1);ne>0&&se>0&&!this._isCharWordSeparator(P.loadCell(ne-1,this._workCell));){P.loadCell(ne-1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,ne--):Y>1&&(U+=Y-1,se-=Y-1),se--,ne--}for(;he<P.length&&G+1<Q.length&&!this._isCharWordSeparator(P.loadCell(he+1,this._workCell));){P.loadCell(he+1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===2?(N++,he++):Y>1&&(L+=Y-1,G+=Y-1),G++,he++}}G++;let H=se+K-ee+U,X=Math.min(this._bufferService.cols,G-se+ee+N-U-L);if(B||Q.slice(se,G).trim()!==""){if($&&H===0&&P.getCodePoint(0)!==32){const ne=q.lines.get(A[1]-1);if(ne&&P.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const he=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(he){const me=this._bufferService.cols-he.start;H-=me,X+=me}}}if(I&&H+X===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const ne=q.lines.get(A[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const he=this._getWordAt([0,A[1]+1],!1,!1,!0);he&&(X+=he.length)}}return{start:H,length:X}}}_selectWordAt(A,B){const $=this._getWordAt(A,B);if($){for(;$.start<0;)$.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[$.start,A[1]],this._model.selectionStartLength=$.length}}_selectToWordAt(A){const B=this._getWordAt(A,!0);if(B){let $=A[1];for(;B.start<0;)B.start+=this._bufferService.cols,$--;if(!this._model.areSelectionValuesReversed())for(;B.start+B.length>this._bufferService.cols;)B.length-=this._bufferService.cols,$++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?B.start:B.start+B.length,$]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const B=this._bufferService.buffer.getWrappedRangeForLine(A),$={start:{x:0,y:B.first},end:{x:this._bufferService.cols-1,y:B.last}};this._model.selectionStart=[0,B.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)($,this._bufferService.cols)}};c.SelectionService=M=u([y(3,S.IBufferService),y(4,S.ICoreService),y(5,E.IMouseService),y(6,S.IOptionsService),y(7,E.IRenderService),y(8,E.ICoreBrowserService)],M)},4725:(T,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(T,c,h){var u=this&&this.__decorate||function(M,A,B,$){var I,q=arguments.length,P=q<3?A:$===null?$=Object.getOwnPropertyDescriptor(A,B):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,A,B,$);else for(var Q=M.length-1;Q>=0;Q--)(I=M[Q])&&(P=(q<3?I(P):q>3?I(A,B,P):I(A,B))||P);return q>3&&P&&Object.defineProperty(A,B,P),P},y=this&&this.__param||function(M,A){return function(B,$){A(B,$,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const m=h(7239),C=h(8055),w=h(8460),E=h(844),b=h(2585),d=C.css.toColor("#ffffff"),p=C.css.toColor("#000000"),f=C.css.toColor("#ffffff"),v=C.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[C.css.toColor("#2e3436"),C.css.toColor("#cc0000"),C.css.toColor("#4e9a06"),C.css.toColor("#c4a000"),C.css.toColor("#3465a4"),C.css.toColor("#75507b"),C.css.toColor("#06989a"),C.css.toColor("#d3d7cf"),C.css.toColor("#555753"),C.css.toColor("#ef2929"),C.css.toColor("#8ae234"),C.css.toColor("#fce94f"),C.css.toColor("#729fcf"),C.css.toColor("#ad7fa8"),C.css.toColor("#34e2e2"),C.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let B=0;B<216;B++){const $=A[B/36%6|0],I=A[B/6%6|0],q=A[B%6];M.push({css:C.channels.toCss($,I,q),rgba:C.channels.toRgba($,I,q)})}for(let B=0;B<24;B++){const $=8+10*B;M.push({css:C.channels.toCss($,$,$),rgba:C.channels.toRgba($,$,$)})}return M})());let R=c.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new m.ColorContrastCache,this._halfContrastCache=new m.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:p,cursor:f,cursorAccent:v,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:C.color.blend(p,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:C.color.blend(p,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 A=this._colors;if(A.foreground=D(M.foreground,d),A.background=D(M.background,p),A.cursor=D(M.cursor,f),A.cursorAccent=D(M.cursorAccent,v),A.selectionBackgroundTransparent=D(M.selectionBackground,S),A.selectionBackgroundOpaque=C.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=D(M.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=C.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=M.selectionForeground?D(M.selectionForeground,C.NULL_COLOR):void 0,A.selectionForeground===C.NULL_COLOR&&(A.selectionForeground=void 0),C.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=C.color.opacity(A.selectionBackgroundTransparent,.3)),C.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=C.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=c.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=D(M.black,c.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=D(M.red,c.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=D(M.green,c.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=D(M.yellow,c.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=D(M.blue,c.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=D(M.magenta,c.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=D(M.cyan,c.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=D(M.white,c.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=D(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=D(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=D(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=D(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=D(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=D(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=D(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=D(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const B=Math.min(A.ansi.length-16,M.extendedAnsi.length);for(let $=0;$<B;$++)A.ansi[$+16]=D(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 A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}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 D(M,A){if(M!==void 0)try{return C.css.toColor(M)}catch{}return A}c.ThemeService=R=u([y(0,b.IOptionsService)],R)},6349:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const u=h(8460),y=h(844);class m extends y.Disposable{constructor(w){super(),this._maxLength=w,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(w){if(this._maxLength===w)return;const E=new Array(w);for(let b=0;b<Math.min(w,this.length);b++)E[b]=this._array[this._getCyclicIndex(b)];this._array=E,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let E=this._length;E<w;E++)this._array[E]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,E){this._array[this._getCyclicIndex(w)]=E}push(w){this._array[this._getCyclicIndex(this._length)]=w,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(w,E,...b){if(E){for(let d=w;d<this._length-E;d++)this._array[this._getCyclicIndex(d)]=this._array[this._getCyclicIndex(d+E)];this._length-=E,this.onDeleteEmitter.fire({index:w,amount:E})}for(let d=this._length-1;d>=w;d--)this._array[this._getCyclicIndex(d+b.length)]=this._array[this._getCyclicIndex(d)];for(let d=0;d<b.length;d++)this._array[this._getCyclicIndex(w+d)]=b[d];if(b.length&&this.onInsertEmitter.fire({index:w,amount:b.length}),this._length+b.length>this._maxLength){const d=this._length+b.length-this._maxLength;this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)}else this._length+=b.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,E,b){if(!(E<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+b<0)throw new Error("Cannot shift elements in list beyond index 0");if(b>0){for(let p=E-1;p>=0;p--)this.set(w+p+b,this.get(w+p));const d=w+E+b-this._length;if(d>0)for(this._length+=d;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let d=0;d<E;d++)this.set(w+d+b,this.get(w+d))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}c.CircularList=m},1439:(T,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 m=Array.isArray(u)?[]:{};for(const C in u)m[C]=y<=1?u[C]:u[C]&&h(u[C],y-1);return m}},8055:(T,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,m=0;var C,w,E,b,d;function p(v){const S=v.toString(16);return S.length<2?"0"+S:S}function f(v,S){return v<S?(S+.05)/(v+.05):(v+.05)/(S+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(v){v.toCss=function(S,R,D,M){return M!==void 0?`#${p(S)}${p(R)}${p(D)}${p(M)}`:`#${p(S)}${p(R)}${p(D)}`},v.toRgba=function(S,R,D,M=255){return(S<<24|R<<16|D<<8|M)>>>0},v.toColor=function(S,R,D,M){return{css:v.toCss(S,R,D,M),rgba:v.toRgba(S,R,D,M)}}})(C||(c.channels=C={})),(function(v){function S(R,D){return m=Math.round(255*D),[h,u,y]=d.toChannels(R.rgba),{css:C.toCss(h,u,y,m),rgba:C.toRgba(h,u,y,m)}}v.blend=function(R,D){if(m=(255&D.rgba)/255,m===1)return{css:D.css,rgba:D.rgba};const M=D.rgba>>24&255,A=D.rgba>>16&255,B=D.rgba>>8&255,$=R.rgba>>24&255,I=R.rgba>>16&255,q=R.rgba>>8&255;return h=$+Math.round((M-$)*m),u=I+Math.round((A-I)*m),y=q+Math.round((B-q)*m),{css:C.toCss(h,u,y),rgba:C.toRgba(h,u,y)}},v.isOpaque=function(R){return(255&R.rgba)==255},v.ensureContrastRatio=function(R,D,M){const A=d.ensureContrastRatio(R.rgba,D.rgba,M);if(A)return C.toColor(A>>24&255,A>>16&255,A>>8&255)},v.opaque=function(R){const D=(255|R.rgba)>>>0;return[h,u,y]=d.toChannels(D),{css:C.toCss(h,u,y),rgba:D}},v.opacity=S,v.multiplyOpacity=function(R,D){return m=255&R.rgba,S(R,m*D/255)},v.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(w||(c.color=w={})),(function(v){let S,R;try{const D=document.createElement("canvas");D.width=1,D.height=1;const M=D.getContext("2d",{willReadFrequently:!0});M&&(S=M,S.globalCompositeOperation="copy",R=S.createLinearGradient(0,0,1,1))}catch{}v.toColor=function(D){if(D.match(/#[\da-f]{3,8}/i))switch(D.length){case 4:return h=parseInt(D.slice(1,2).repeat(2),16),u=parseInt(D.slice(2,3).repeat(2),16),y=parseInt(D.slice(3,4).repeat(2),16),C.toColor(h,u,y);case 5:return h=parseInt(D.slice(1,2).repeat(2),16),u=parseInt(D.slice(2,3).repeat(2),16),y=parseInt(D.slice(3,4).repeat(2),16),m=parseInt(D.slice(4,5).repeat(2),16),C.toColor(h,u,y,m);case 7:return{css:D,rgba:(parseInt(D.slice(1),16)<<8|255)>>>0};case 9:return{css:D,rgba:parseInt(D.slice(1),16)>>>0}}const M=D.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]),m=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),C.toColor(h,u,y,m);if(!S||!R)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=R,S.fillStyle=D,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[h,u,y,m]=S.getImageData(0,0,1,1).data,m!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(h,u,y,m),css:D}}})(E||(c.css=E={})),(function(v){function S(R,D,M){const A=R/255,B=D/255,$=M/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*($<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4))}v.relativeLuminance=function(R){return S(R>>16&255,R>>8&255,255&R)},v.relativeLuminance2=S})(b||(c.rgb=b={})),(function(v){function S(D,M,A){const B=D>>24&255,$=D>>16&255,I=D>>8&255;let q=M>>24&255,P=M>>16&255,Q=M>>8&255,se=f(b.relativeLuminance2(q,P,Q),b.relativeLuminance2(B,$,I));for(;se<A&&(q>0||P>0||Q>0);)q-=Math.max(0,Math.ceil(.1*q)),P-=Math.max(0,Math.ceil(.1*P)),Q-=Math.max(0,Math.ceil(.1*Q)),se=f(b.relativeLuminance2(q,P,Q),b.relativeLuminance2(B,$,I));return(q<<24|P<<16|Q<<8|255)>>>0}function R(D,M,A){const B=D>>24&255,$=D>>16&255,I=D>>8&255;let q=M>>24&255,P=M>>16&255,Q=M>>8&255,se=f(b.relativeLuminance2(q,P,Q),b.relativeLuminance2(B,$,I));for(;se<A&&(q<255||P<255||Q<255);)q=Math.min(255,q+Math.ceil(.1*(255-q))),P=Math.min(255,P+Math.ceil(.1*(255-P))),Q=Math.min(255,Q+Math.ceil(.1*(255-Q))),se=f(b.relativeLuminance2(q,P,Q),b.relativeLuminance2(B,$,I));return(q<<24|P<<16|Q<<8|255)>>>0}v.blend=function(D,M){if(m=(255&M)/255,m===1)return M;const A=M>>24&255,B=M>>16&255,$=M>>8&255,I=D>>24&255,q=D>>16&255,P=D>>8&255;return h=I+Math.round((A-I)*m),u=q+Math.round((B-q)*m),y=P+Math.round(($-P)*m),C.toRgba(h,u,y)},v.ensureContrastRatio=function(D,M,A){const B=b.relativeLuminance(D>>8),$=b.relativeLuminance(M>>8);if(f(B,$)<A){if($<B){const P=S(D,M,A),Q=f(B,b.relativeLuminance(P>>8));if(Q<A){const se=R(D,M,A);return Q>f(B,b.relativeLuminance(se>>8))?P:se}return P}const I=R(D,M,A),q=f(B,b.relativeLuminance(I>>8));if(q<A){const P=S(D,M,A);return q>f(B,b.relativeLuminance(P>>8))?I:P}return I}},v.reduceLuminance=S,v.increaseLuminance=R,v.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(d||(c.rgba=d={})),c.toPaddedHex=p,c.contrastRatio=f},8969:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const u=h(844),y=h(2585),m=h(4348),C=h(7866),w=h(744),E=h(7302),b=h(6975),d=h(8460),p=h(1753),f=h(1480),v=h(7994),S=h(9282),R=h(5435),D=h(5981),M=h(2660);let A=!1;class B extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new d.EventEmitter),this._onScroll.event((I=>{var q;(q=this._onScrollApi)==null||q.fire(I.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(I){for(const q in I)this.optionsService.options[q]=I[q]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new d.EventEmitter),this._instantiationService=new m.InstantiationService,this.optionsService=this.register(new E.OptionsService(I)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(b.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(v.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 R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,d.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,d.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,d.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,d.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((q=>{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((q=>{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 D.WriteBuffer(((q,P)=>this._inputHandler.parse(q,P)))),this.register((0,d.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,q){this._writeBuffer.write(I,q)}writeSync(I,q){this._logService.logLevel<=y.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(I,q)}input(I,q=!0){this.coreService.triggerDataEvent(I,q)}resize(I,q){isNaN(I)||isNaN(q)||(I=Math.max(I,w.MINIMUM_COLS),q=Math.max(q,w.MINIMUM_ROWS),this._bufferService.resize(I,q))}scroll(I,q=!1){this._bufferService.scroll(I,q)}scrollLines(I,q,P){this._bufferService.scrollLines(I,q,P)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const q=I-this._bufferService.buffer.ydisp;q!==0&&this.scrollLines(q)}registerEscHandler(I,q){return this._inputHandler.registerEscHandler(I,q)}registerDcsHandler(I,q){return this._inputHandler.registerDcsHandler(I,q)}registerCsiHandler(I,q){return this._inputHandler.registerCsiHandler(I,q)}registerOscHandler(I,q){return this._inputHandler.registerOscHandler(I,q)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const q=this.optionsService.rawOptions.windowsPty;q&&q.buildNumber!==void 0&&q.buildNumber!==void 0?I=q.backend==="conpty"&&q.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const q of I)q.dispose()}))}}}c.CoreTerminal=B},8460:(T,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 m=0;m<this._listeners.length;m++)y.push(this._listeners[m]);for(let m=0;m<y.length;m++)y[m].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(T,c,h){var u=this&&this.__decorate||function(ee,N,U,L){var H,X=arguments.length,ne=X<3?N:L===null?L=Object.getOwnPropertyDescriptor(N,U):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(ee,N,U,L);else for(var he=ee.length-1;he>=0;he--)(H=ee[he])&&(ne=(X<3?H(ne):X>3?H(N,U,ne):H(N,U))||ne);return X>3&&ne&&Object.defineProperty(N,U,ne),ne},y=this&&this.__param||function(ee,N){return function(U,L){N(U,L,ee)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const m=h(2584),C=h(7116),w=h(2015),E=h(844),b=h(482),d=h(8437),p=h(8460),f=h(643),v=h(511),S=h(3734),R=h(2585),D=h(1480),M=h(6242),A=h(6351),B=h(5941),$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function q(ee,N){if(ee>24)return N.setWinLines||!1;switch(ee){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var P;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(c.WindowsOptionsReportType=P={}));let Q=0;class se extends E.Disposable{getAttrData(){return this._curAttrData}constructor(N,U,L,H,X,ne,he,me,Y=new w.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=U,this._coreService=L,this._logService=H,this._optionsService=X,this._oscLinkService=ne,this._coreMouseService=he,this._unicodeService=me,this._parser=Y,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new b.StringToUtf32,this._utf8Decoder=new b.Utf8ToUtf32,this._workCell=new v.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.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 G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._parser.setCsiHandlerFallback(((j,ce)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(j),params:ce.toArray()})})),this._parser.setEscHandlerFallback((j=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(j)})})),this._parser.setExecuteHandlerFallback((j=>{this._logService.debug("Unknown EXECUTE code: ",{code:j})})),this._parser.setOscHandlerFallback(((j,ce,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:j,action:ce,data:oe})})),this._parser.setDcsHandlerFallback(((j,ce,oe)=>{ce==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(j),action:ce,payload:oe})})),this._parser.setPrintHandler(((j,ce,oe)=>this.print(j,ce,oe))),this._parser.registerCsiHandler({final:"@"},(j=>this.insertChars(j))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(j=>this.scrollLeft(j))),this._parser.registerCsiHandler({final:"A"},(j=>this.cursorUp(j))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(j=>this.scrollRight(j))),this._parser.registerCsiHandler({final:"B"},(j=>this.cursorDown(j))),this._parser.registerCsiHandler({final:"C"},(j=>this.cursorForward(j))),this._parser.registerCsiHandler({final:"D"},(j=>this.cursorBackward(j))),this._parser.registerCsiHandler({final:"E"},(j=>this.cursorNextLine(j))),this._parser.registerCsiHandler({final:"F"},(j=>this.cursorPrecedingLine(j))),this._parser.registerCsiHandler({final:"G"},(j=>this.cursorCharAbsolute(j))),this._parser.registerCsiHandler({final:"H"},(j=>this.cursorPosition(j))),this._parser.registerCsiHandler({final:"I"},(j=>this.cursorForwardTab(j))),this._parser.registerCsiHandler({final:"J"},(j=>this.eraseInDisplay(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(j=>this.eraseInDisplay(j,!0))),this._parser.registerCsiHandler({final:"K"},(j=>this.eraseInLine(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(j=>this.eraseInLine(j,!0))),this._parser.registerCsiHandler({final:"L"},(j=>this.insertLines(j))),this._parser.registerCsiHandler({final:"M"},(j=>this.deleteLines(j))),this._parser.registerCsiHandler({final:"P"},(j=>this.deleteChars(j))),this._parser.registerCsiHandler({final:"S"},(j=>this.scrollUp(j))),this._parser.registerCsiHandler({final:"T"},(j=>this.scrollDown(j))),this._parser.registerCsiHandler({final:"X"},(j=>this.eraseChars(j))),this._parser.registerCsiHandler({final:"Z"},(j=>this.cursorBackwardTab(j))),this._parser.registerCsiHandler({final:"`"},(j=>this.charPosAbsolute(j))),this._parser.registerCsiHandler({final:"a"},(j=>this.hPositionRelative(j))),this._parser.registerCsiHandler({final:"b"},(j=>this.repeatPrecedingCharacter(j))),this._parser.registerCsiHandler({final:"c"},(j=>this.sendDeviceAttributesPrimary(j))),this._parser.registerCsiHandler({prefix:">",final:"c"},(j=>this.sendDeviceAttributesSecondary(j))),this._parser.registerCsiHandler({final:"d"},(j=>this.linePosAbsolute(j))),this._parser.registerCsiHandler({final:"e"},(j=>this.vPositionRelative(j))),this._parser.registerCsiHandler({final:"f"},(j=>this.hVPosition(j))),this._parser.registerCsiHandler({final:"g"},(j=>this.tabClear(j))),this._parser.registerCsiHandler({final:"h"},(j=>this.setMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(j=>this.setModePrivate(j))),this._parser.registerCsiHandler({final:"l"},(j=>this.resetMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(j=>this.resetModePrivate(j))),this._parser.registerCsiHandler({final:"m"},(j=>this.charAttributes(j))),this._parser.registerCsiHandler({final:"n"},(j=>this.deviceStatus(j))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(j=>this.deviceStatusPrivate(j))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(j=>this.softReset(j))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(j=>this.setCursorStyle(j))),this._parser.registerCsiHandler({final:"r"},(j=>this.setScrollRegion(j))),this._parser.registerCsiHandler({final:"s"},(j=>this.saveCursor(j))),this._parser.registerCsiHandler({final:"t"},(j=>this.windowOptions(j))),this._parser.registerCsiHandler({final:"u"},(j=>this.restoreCursor(j))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(j=>this.insertColumns(j))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(j=>this.deleteColumns(j))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(j=>this.selectProtected(j))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(j=>this.requestMode(j,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(j=>this.requestMode(j,!1))),this._parser.setExecuteHandler(m.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(m.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(m.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(m.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(m.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(m.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(m.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(m.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(m.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((j=>(this.setTitle(j),this.setIconName(j),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((j=>this.setIconName(j)))),this._parser.registerOscHandler(2,new M.OscHandler((j=>this.setTitle(j)))),this._parser.registerOscHandler(4,new M.OscHandler((j=>this.setOrReportIndexedColor(j)))),this._parser.registerOscHandler(8,new M.OscHandler((j=>this.setHyperlink(j)))),this._parser.registerOscHandler(10,new M.OscHandler((j=>this.setOrReportFgColor(j)))),this._parser.registerOscHandler(11,new M.OscHandler((j=>this.setOrReportBgColor(j)))),this._parser.registerOscHandler(12,new M.OscHandler((j=>this.setOrReportCursorColor(j)))),this._parser.registerOscHandler(104,new M.OscHandler((j=>this.restoreIndexedColor(j)))),this._parser.registerOscHandler(110,new M.OscHandler((j=>this.restoreFgColor(j)))),this._parser.registerOscHandler(111,new M.OscHandler((j=>this.restoreBgColor(j)))),this._parser.registerOscHandler(112,new M.OscHandler((j=>this.restoreCursorColor(j)))),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 j in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:j},(()=>this.selectCharset("("+j))),this._parser.registerEscHandler({intermediates:")",final:j},(()=>this.selectCharset(")"+j))),this._parser.registerEscHandler({intermediates:"*",final:j},(()=>this.selectCharset("*"+j))),this._parser.registerEscHandler({intermediates:"+",final:j},(()=>this.selectCharset("+"+j))),this._parser.registerEscHandler({intermediates:"-",final:j},(()=>this.selectCharset("-"+j))),this._parser.registerEscHandler({intermediates:".",final:j},(()=>this.selectCharset("."+j))),this._parser.registerEscHandler({intermediates:"/",final:j},(()=>this.selectCharset("/"+j)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((j=>(this._logService.error("Parsing error: ",j),j))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler(((j,ce)=>this.requestStatusString(j,ce))))}_preserveStack(N,U,L,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=U,this._parseStack.decodedLength=L,this._parseStack.position=H}_logSlowResolvingAsync(N){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([N,new Promise(((U,L)=>setTimeout((()=>L("#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(N,U){let L,H=this._activeBuffer.x,X=this._activeBuffer.y,ne=0;const he=this._parseStack.paused;if(he){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,U))return this._logSlowResolvingAsync(L),L;H=this._parseStack.cursorStartX,X=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>I&&(ne=this._parseStack.position+I)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,(j=>String.fromCharCode(j))).join("")}"`),typeof N=="string"?N.split("").map((j=>j.charCodeAt(0))):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(N.length,I))),he||this._dirtyRowTracker.clearRange(),N.length>I)for(let j=ne;j<N.length;j+=I){const ce=j+I<N.length?j+I:N.length,oe=typeof N=="string"?this._stringDecoder.decode(N.substring(j,ce),this._parseBuffer):this._utf8Decoder.decode(N.subarray(j,ce),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,oe))return this._preserveStack(H,X,oe,j),this._logSlowResolvingAsync(L),L}else if(!he){const j=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,j))return this._preserveStack(H,X,j,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===H&&this._activeBuffer.y===X||this._onCursorMove.fire();const me=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Y=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Y<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Y,this._bufferService.rows-1),Math.min(me,this._bufferService.rows-1))}print(N,U,L){let H,X;const ne=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,me=this._bufferService.cols,Y=this._coreService.decPrivateModes.wraparound,j=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&&L-U>0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ce);let ve=this._parser.precedingJoinState;for(let pe=U;pe<L;++pe){if(H=N[pe],H<127&&ne){const ct=ne[String.fromCharCode(H)];ct&&(H=ct.charCodeAt(0))}const Te=this._unicodeService.charProperties(H,ve);X=D.UnicodeService.extractWidth(Te);const je=D.UnicodeService.extractShouldJoin(Te),Ue=je?D.UnicodeService.extractWidth(ve):0;if(ve=Te,he&&this._onA11yChar.fire((0,b.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+X-Ue>me){if(Y){const ct=oe;let Ee=this._activeBuffer.x-Ue;for(this._activeBuffer.x=Ue,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),Ue>0&&oe instanceof d.BufferLine&&oe.copyCellsFrom(ct,Ee,0,Ue,!1);Ee<me;)ct.setCellFromCodepoint(Ee++,0,1,ce)}else if(this._activeBuffer.x=me-1,X===2)continue}if(je&&this._activeBuffer.x){const ct=oe.getWidth(this._activeBuffer.x-1)?1:2;oe.addCodepointToCell(this._activeBuffer.x-ct,H,X);for(let Ee=X-Ue;--Ee>=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}else if(j&&(oe.insertCells(this._activeBuffer.x,X-Ue,this._activeBuffer.getNullCell(ce)),oe.getWidth(me-1)===2&&oe.setCellFromCodepoint(me-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,ce)),oe.setCellFromCodepoint(this._activeBuffer.x++,H,X,ce),X>0)for(;--X;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}this._parser.precedingJoinState=ve,this._activeBuffer.x<me&&L-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(N,U){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,U):this._parser.registerCsiHandler(N,(L=>!q(L.params[0],this._optionsService.rawOptions.windowOptions)||U(L)))}registerDcsHandler(N,U){return this._parser.registerDcsHandler(N,new A.DcsHandler(U))}registerEscHandler(N,U){return this._parser.registerEscHandler(N,U)}registerOscHandler(N,U){return this._parser.registerOscHandler(N,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 N;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&&((N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&N.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 N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,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(N,U){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+U):(this._activeBuffer.x=N,this._activeBuffer.y=U),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,U){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+U)}cursorUp(N){const U=this._activeBuffer.y-this._activeBuffer.scrollTop;return U>=0?this._moveCursor(0,-Math.min(U,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const U=this._activeBuffer.scrollBottom-this._activeBuffer.y;return U>=0?this._moveCursor(0,Math.min(U,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const U=N.params[0];return U===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:U===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=N.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=N.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const U=N.params[0];return U===1&&(this._curAttrData.bg|=536870912),U!==2&&U!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,U,L,H=!1,X=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);ne.replaceCells(U,L,this._activeBuffer.getNullCell(this._eraseAttrData()),X),H&&(ne.isWrapped=!1)}_resetBufferLine(N,U=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),U),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),L.isWrapped=!1)}eraseInDisplay(N,U=!1){let L;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);L<this._bufferService.rows;L++)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,U),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(N,U=!1){switch(this._restrictCursor(this._bufferService.cols),N.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(N){this._restrictCursor();let U=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,X=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;U--;)this._activeBuffer.lines.splice(X-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(N){this._restrictCursor();let U=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;U--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(N){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let U=N.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(N){let U=N.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(d.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.deleteCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.insertCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.insertCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.deleteCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(N){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){const U=this._parser.precedingJoinState;if(!U)return!0;const L=N.params[0]||1,H=D.UnicodeService.extractWidth(U),X=this._activeBuffer.x-H,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(X),he=new Uint32Array(ne.length*L);let me=0;for(let j=0;j<ne.length;){const ce=ne.codePointAt(j)||0;he[me++]=ce,j+=ce>65535?2:1}let Y=me;for(let j=1;j<L;++j)he.copyWithin(Y,0,me),Y+=me;return this.print(he,0,Y),!0}sendDeviceAttributesPrimary(N){return N.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(m.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(m.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(N){return N.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(m.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(m.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(m.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let U=0;U<N.length;U++)switch(N.params[U]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let U=0;U<N.length;U++)switch(N.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),this._charsetService.setgCharset(1,C.DEFAULT_CHARSET),this._charsetService.setgCharset(2,C.DEFAULT_CHARSET),this._charsetService.setgCharset(3,C.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(N){for(let U=0;U<N.length;U++)switch(N.params[U]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let U=0;U<N.length;U++)switch(N.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(),N.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(N,U){const L=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:X}=this._coreMouseService,ne=this._coreService,{buffers:he,cols:me}=this._bufferService,{active:Y,alt:j}=he,ce=this._optionsService.rawOptions,oe=je=>je?1:2,ve=N.params[0];return pe=ve,Te=U?ve===2?4:ve===4?oe(ne.modes.insertMode):ve===12?3:ve===20?oe(ce.convertEol):0:ve===1?oe(L.applicationCursorKeys):ve===3?ce.windowOptions.setWinLines?me===80?2:me===132?1:0:0:ve===6?oe(L.origin):ve===7?oe(L.wraparound):ve===8?3:ve===9?oe(H==="X10"):ve===12?oe(ce.cursorBlink):ve===25?oe(!ne.isCursorHidden):ve===45?oe(L.reverseWraparound):ve===66?oe(L.applicationKeypad):ve===67?4:ve===1e3?oe(H==="VT200"):ve===1002?oe(H==="DRAG"):ve===1003?oe(H==="ANY"):ve===1004?oe(L.sendFocus):ve===1005?4:ve===1006?oe(X==="SGR"):ve===1015?4:ve===1016?oe(X==="SGR_PIXELS"):ve===1048?1:ve===47||ve===1047||ve===1049?oe(Y===j):ve===2004?oe(L.bracketedPasteMode):0,ne.triggerDataEvent(`${m.C0.ESC}[${U?"":"?"}${pe};${Te}$y`),!0;var pe,Te}_updateAttrColor(N,U,L,H,X){return U===2?(N|=50331648,N&=-16777216,N|=S.AttributeData.fromColorRGB([L,H,X])):U===5&&(N&=-50331904,N|=33554432|255&L),N}_extractColor(N,U,L){const H=[0,0,-1,0,0,0];let X=0,ne=0;do{if(H[ne+X]=N.params[U+ne],N.hasSubParams(U+ne)){const he=N.getSubParams(U+ne);let me=0;do H[1]===5&&(X=1),H[ne+me+1+X]=he[me];while(++me<he.length&&me+ne+1+X<H.length);break}if(H[1]===5&&ne+X>=2||H[1]===2&&ne+X>=5)break;H[1]&&(X=1)}while(++ne+U<N.length&&ne+X<H.length);for(let he=2;he<H.length;++he)H[he]===-1&&(H[he]=0);switch(H[0]){case 38:L.fg=this._updateAttrColor(L.fg,H[1],H[3],H[4],H[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,H[1],H[3],H[4],H[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,H[1],H[3],H[4],H[5])}return ne}_processUnderline(N,U){U.extended=U.extended.clone(),(!~N||N>5)&&(N=1),U.extended.underlineStyle=N,U.fg|=268435456,N===0&&(U.fg&=-268435457),U.updateExtended()}_processSGR0(N){N.fg=d.DEFAULT_ATTR_DATA.fg,N.bg=d.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const U=N.length;let L;const H=this._curAttrData;for(let X=0;X<U;X++)L=N.params[X],L>=30&&L<=37?(H.fg&=-50331904,H.fg|=16777216|L-30):L>=40&&L<=47?(H.bg&=-50331904,H.bg|=16777216|L-40):L>=90&&L<=97?(H.fg&=-50331904,H.fg|=16777224|L-90):L>=100&&L<=107?(H.bg&=-50331904,H.bg|=16777224|L-100):L===0?this._processSGR0(H):L===1?H.fg|=134217728:L===3?H.bg|=67108864:L===4?(H.fg|=268435456,this._processUnderline(N.hasSubParams(X)?N.getSubParams(X)[0]:1,H)):L===5?H.fg|=536870912:L===7?H.fg|=67108864:L===8?H.fg|=1073741824:L===9?H.fg|=2147483648:L===2?H.bg|=134217728:L===21?this._processUnderline(2,H):L===22?(H.fg&=-134217729,H.bg&=-134217729):L===23?H.bg&=-67108865:L===24?(H.fg&=-268435457,this._processUnderline(0,H)):L===25?H.fg&=-536870913:L===27?H.fg&=-67108865:L===28?H.fg&=-1073741825:L===29?H.fg&=2147483647:L===39?(H.fg&=-67108864,H.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):L===49?(H.bg&=-67108864,H.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?X+=this._extractColor(N,X,H):L===53?H.bg|=1073741824:L===55?H.bg&=-1073741825:L===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):L===100?(H.fg&=-67108864,H.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${m.C0.ESC}[0n`);break;case 6:const U=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[${U};${L}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const U=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[?${U};${L}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.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(N){const U=N.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 L=U%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(N){const U=N.params[0]||1;let L;return(N.length<2||(L=N.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>U&&(this._activeBuffer.scrollTop=U-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(N){if(!q(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const U=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:U!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${m.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(N){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(N){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(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const U=[],L=N.split(";");for(;L.length>1;){const H=L.shift(),X=L.shift();if(/^\d+$/.exec(H)){const ne=parseInt(H);if(K(ne))if(X==="?")U.push({type:0,index:ne});else{const he=(0,B.parseColor)(X);he&&U.push({type:1,index:ne,color:he})}}}return U.length&&this._onColor.fire(U),!0}setHyperlink(N){const U=N.split(";");return!(U.length<2)&&(U[1]?this._createHyperlink(U[0],U[1]):!U[0]&&this._finishHyperlink())}_createHyperlink(N,U){this._getCurrentLinkId()&&this._finishHyperlink();const L=N.split(":");let H;const X=L.findIndex((ne=>ne.startsWith("id=")));return X!==-1&&(H=L[X].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,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(N,U){const L=N.split(";");for(let H=0;H<L.length&&!(U>=this._specialColors.length);++H,++U)if(L[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[U]}]);else{const X=(0,B.parseColor)(L[H]);X&&this._onColor.fire([{type:1,index:this._specialColors[U],color:X}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const U=[],L=N.split(";");for(let H=0;H<L.length;++H)if(/^\d+$/.exec(L[H])){const X=parseInt(L[H]);K(X)&&U.push({type:2,index:X})}return U.length&&this._onColor.fire(U),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){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,C.DEFAULT_CHARSET),!0}selectCharset(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset($[N[0]],C.CHARSETS[N[1]]||C.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 N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,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=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new v.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let U=0;U<this._bufferService.rows;++U){const L=this._activeBuffer.ybase+this._activeBuffer.y+U,H=this._activeBuffer.lines.get(L);H&&(H.fill(N),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,U){const L=this._bufferService.buffer,H=this._optionsService.rawOptions;return(X=>(this._coreService.triggerDataEvent(`${m.C0.ESC}${X}${m.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,U){this._dirtyRowTracker.markRangeDirty(N,U)}}c.InputHandler=se;let G=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){ee<this.start?this.start=ee:ee>this.end&&(this.end=ee)}markRangeDirty(ee,N){ee>N&&(Q=ee,ee=N,N=Q),ee<this.start&&(this.start=ee),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(ee){return 0<=ee&&ee<256}G=u([y(0,R.IBufferService)],G)},844:(T,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:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(y,m,C){this._data[y]||(this._data[y]={}),this._data[y][m]=C}get(y,m){return this._data[y]?this._data[y][m]:void 0}clear(){this._data={}}}c.TwoKeyMap=h,c.FourKeyMap=class{constructor(){this._data=new h}set(u,y,m,C,w){this._data.get(u,y)||this._data.set(u,y,new h),this._data.get(u,y).set(m,C,w)}get(u,y,m,C){var w;return(w=this._data.get(u,y))==null?void 0:w.get(m,C)}clear(){this._data.clear()}}},6114:(T,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:(T,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,m=this._array.length-1;for(;m>=y;){let C=y+m>>1;const w=this._getKey(this._array[C]);if(w>u)m=C-1;else{if(!(w<u)){for(;C>0&&this._getKey(this._array[C-1])===u;)C--;return C}y=C+1}}return y}}},7226:(T,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(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let E=0,b=0,d=w.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),b=Math.max(E,b),p=w.timeRemaining(),1.5*b>p)return d-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(d-E))}ms`),void this._start();d=p}this.clear()}}class m extends y{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const E=Date.now()+w;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}c.PriorityTaskQueue=m,c.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:m,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9282:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const u=h(643);c.updateWindowsModeWrappedState=function(y){const m=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),C=m==null?void 0:m.get(y.cols-1),w=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);w&&C&&(w.isWrapped=C[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&C[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(T,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(m){return[m>>>16&255,m>>>8&255,255&m]}static fromColorRGB(m){return(255&m[0])<<16|(255&m[1])<<8|255&m[2]}clone(){const m=new h;return m.fg=this.fg,m.bg=this.bg,m.extended=this.extended.clone(),m}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(m){this._ext=m}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(m){this._ext&=-469762049,this._ext|=m<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(m){this._ext&=-67108864,this._ext|=67108863&m}get urlId(){return this._urlId}set urlId(m){this._urlId=m}get underlineVariantOffset(){const m=(3758096384&this._ext)>>29;return m<0?4294967288^m:m}set underlineVariantOffset(m){this._ext&=536870911,this._ext|=m<<29&3758096384}constructor(m=0,C=0){this._ext=0,this._urlId=0,this._ext=m,this._urlId=C}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=u},9092:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const u=h(6349),y=h(7226),m=h(3734),C=h(8437),w=h(4634),E=h(511),b=h(643),d=h(4863),p=h(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(f,v,S){this._hasScrollback=f,this._optionsService=v,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=C.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=E.CellData.fromCharData([0,b.NULL_CELL_CHAR,b.NULL_CELL_WIDTH,b.NULL_CELL_CODE]),this._whitespaceCell=E.CellData.fromCharData([0,b.WHITESPACE_CELL_CHAR,b.WHITESPACE_CELL_WIDTH,b.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(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new m.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new m.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,v){return new C.BufferLine(this._bufferService.cols,this.getNullCell(f),v)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const v=f+this._optionsService.rawOptions.scrollback;return v>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:v}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=C.DEFAULT_ATTR_DATA);let v=this._rows;for(;v--;)this.lines.push(this.getBlankLine(f))}}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(f,v){const S=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=0;const D=this._getCorrectBufferLength(v);if(D>this.lines.maxLength&&(this.lines.maxLength=D),this.lines.length>0){if(this._cols<f)for(let A=0;A<this.lines.length;A++)R+=+this.lines.get(A).resize(f,S);let M=0;if(this._rows<v)for(let A=this._rows;A<v;A++)this.lines.length<v+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new C.BufferLine(f,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 C.BufferLine(f,S)));else for(let A=this._rows;A>v;A--)this.lines.length>v+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(D<this.lines.maxLength){const A=this.lines.length-D;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=D}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,v-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=v-1,this._isReflowEnabled&&(this._reflow(f,v),this._cols>f))for(let M=0;M<this.lines.length;M++)R+=+this.lines.get(M).resize(f,S);this._cols=f,this._rows=v,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let v=0;for(;this._memoryCleanupPosition<this.lines.length;)if(v+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),v>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,v){this._cols!==f&&(f>this._cols?this._reflowLarger(f,v):this._reflowSmaller(f,v))}_reflowLarger(f,v){const S=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(S.length>0){const R=(0,w.reflowLargerCreateNewLayout)(this.lines,S);(0,w.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(f,v,R.countRemoved)}}_reflowLargerAdjustViewport(f,v,S){const R=this.getNullCell(C.DEFAULT_ATTR_DATA);let D=S;for(;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<v&&this.lines.push(new C.BufferLine(f,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(f,v){const S=this.getNullCell(C.DEFAULT_ATTR_DATA),R=[];let D=0;for(let M=this.lines.length-1;M>=0;M--){let A=this.lines.get(M);if(!A||!A.isWrapped&&A.getTrimmedLength()<=f)continue;const B=[A];for(;A.isWrapped&&M>0;)A=this.lines.get(--M),B.unshift(A);const $=this.ybase+this.y;if($>=M&&$<M+B.length)continue;const I=B[B.length-1].getTrimmedLength(),q=(0,w.reflowSmallerGetNewLineLengths)(B,this._cols,f),P=q.length-B.length;let Q;Q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const se=[];for(let L=0;L<P;L++){const H=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);se.push(H)}se.length>0&&(R.push({start:M+B.length+D,newLines:se}),D+=se.length),B.push(...se);let G=q.length-1,K=q[G];K===0&&(G--,K=q[G]);let ee=B.length-P-1,N=I;for(;ee>=0;){const L=Math.min(N,K);if(B[G]===void 0)break;if(B[G].copyCellsFrom(B[ee],N-L,K-L,L,!0),K-=L,K===0&&(G--,K=q[G]),N-=L,N===0){ee--;const H=Math.max(ee,0);N=(0,w.getWrappedLineTrimmedLength)(B,H,this._cols)}}for(let L=0;L<B.length;L++)q[L]<f&&B[L].setCell(q[L],S);let U=P-Q;for(;U-- >0;)this.ybase===0?this.y<v-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-v&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+v-1)}if(R.length>0){const M=[],A=[];for(let G=0;G<this.lines.length;G++)A.push(this.lines.get(G));const B=this.lines.length;let $=B-1,I=0,q=R[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+D);let P=0;for(let G=Math.min(this.lines.maxLength-1,B+D-1);G>=0;G--)if(q&&q.start>$+P){for(let K=q.newLines.length-1;K>=0;K--)this.lines.set(G--,q.newLines[K]);G++,M.push({index:$+1,amount:q.newLines.length}),P+=q.newLines.length,q=R[++I]}else this.lines.set(G,A[$--]);let Q=0;for(let G=M.length-1;G>=0;G--)M[G].index+=Q,this.lines.onInsertEmitter.fire(M[G]),Q+=M[G].amount;const se=Math.max(0,B+D-this.lines.maxLength);se>0&&this.lines.onTrimEmitter.fire(se)}}translateBufferLineToString(f,v,S=0,R){const D=this.lines.get(f);return D?D.translateToString(v,S,R):""}getWrappedRangeForLine(f){let v=f,S=f;for(;v>0&&this.lines.get(v).isWrapped;)v--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:v,last:S}}setupTabStops(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].line===f&&(this.markers[v].dispose(),this.markers.splice(v--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const v=new d.Marker(f);return this.markers.push(v),v.register(this.lines.onTrim((S=>{v.line-=S,v.line<0&&v.dispose()}))),v.register(this.lines.onInsert((S=>{v.line>=S.index&&(v.line+=S.amount)}))),v.register(this.lines.onDelete((S=>{v.line>=S.index&&v.line<S.index+S.amount&&v.dispose(),v.line>S.index&&(v.line-=S.amount)}))),v.register(v.onDispose((()=>this._removeMarker(v)))),v}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const u=h(3734),y=h(511),m=h(643),C=h(482);c.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let w=0;class E{constructor(d,p,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*d);const v=p||y.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]);for(let S=0;S<d;++S)this.setCell(S,v);this.length=d}get(d){const p=this._data[3*d+0],f=2097151&p;return[this._data[3*d+1],2097152&p?this._combined[d]:f?(0,C.stringFromCodePoint)(f):"",p>>22,2097152&p?this._combined[d].charCodeAt(this._combined[d].length-1):f]}set(d,p){this._data[3*d+1]=p[m.CHAR_DATA_ATTR_INDEX],p[m.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[d]=p[1],this._data[3*d+0]=2097152|d|p[m.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*d+0]=p[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[m.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(d){return this._data[3*d+0]>>22}hasWidth(d){return 12582912&this._data[3*d+0]}getFg(d){return this._data[3*d+1]}getBg(d){return this._data[3*d+2]}hasContent(d){return 4194303&this._data[3*d+0]}getCodePoint(d){const p=this._data[3*d+0];return 2097152&p?this._combined[d].charCodeAt(this._combined[d].length-1):2097151&p}isCombined(d){return 2097152&this._data[3*d+0]}getString(d){const p=this._data[3*d+0];return 2097152&p?this._combined[d]:2097151&p?(0,C.stringFromCodePoint)(2097151&p):""}isProtected(d){return 536870912&this._data[3*d+2]}loadCell(d,p){return w=3*d,p.content=this._data[w+0],p.fg=this._data[w+1],p.bg=this._data[w+2],2097152&p.content&&(p.combinedData=this._combined[d]),268435456&p.bg&&(p.extended=this._extendedAttrs[d]),p}setCell(d,p){2097152&p.content&&(this._combined[d]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[d]=p.extended),this._data[3*d+0]=p.content,this._data[3*d+1]=p.fg,this._data[3*d+2]=p.bg}setCellFromCodepoint(d,p,f,v){268435456&v.bg&&(this._extendedAttrs[d]=v.extended),this._data[3*d+0]=p|f<<22,this._data[3*d+1]=v.fg,this._data[3*d+2]=v.bg}addCodepointToCell(d,p,f){let v=this._data[3*d+0];2097152&v?this._combined[d]+=(0,C.stringFromCodePoint)(p):2097151&v?(this._combined[d]=(0,C.stringFromCodePoint)(2097151&v)+(0,C.stringFromCodePoint)(p),v&=-2097152,v|=2097152):v=p|4194304,f&&(v&=-12582913,v|=f<<22),this._data[3*d+0]=v}insertCells(d,p,f){if((d%=this.length)&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),p<this.length-d){const v=new y.CellData;for(let S=this.length-d-p-1;S>=0;--S)this.setCell(d+p+S,this.loadCell(d+S,v));for(let S=0;S<p;++S)this.setCell(d+S,f)}else for(let v=d;v<this.length;++v)this.setCell(v,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(d,p,f){if(d%=this.length,p<this.length-d){const v=new y.CellData;for(let S=0;S<this.length-d-p;++S)this.setCell(d+S,this.loadCell(d+p+S,v));for(let S=this.length-p;S<this.length;++S)this.setCell(S,f)}else for(let v=d;v<this.length;++v)this.setCell(v,f);d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),this.getWidth(d)!==0||this.hasContent(d)||this.setCellFromCodepoint(d,0,1,f)}replaceCells(d,p,f,v=!1){if(v)for(d&&this.getWidth(d-1)===2&&!this.isProtected(d-1)&&this.setCellFromCodepoint(d-1,0,1,f),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodepoint(p,0,1,f);d<p&&d<this.length;)this.isProtected(d)||this.setCell(d,f),d++;else for(d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p,0,1,f);d<p&&d<this.length;)this.setCell(d++,f)}resize(d,p){if(d===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*d;if(d>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const v=new Uint32Array(f);v.set(this._data),this._data=v}for(let v=this.length;v<d;++v)this.setCell(v,p)}else{this._data=this._data.subarray(0,f);const v=Object.keys(this._combined);for(let R=0;R<v.length;R++){const D=parseInt(v[R],10);D>=d&&delete this._combined[D]}const S=Object.keys(this._extendedAttrs);for(let R=0;R<S.length;R++){const D=parseInt(S[R],10);D>=d&&delete this._extendedAttrs[D]}}return this.length=d,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const d=new Uint32Array(this._data.length);return d.set(this._data),this._data=d,1}return 0}fill(d,p=!1){if(p)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,d);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,d)}}copyFrom(d){this.length!==d.length?this._data=new Uint32Array(d._data):this._data.set(d._data),this.length=d.length,this._combined={};for(const p in d._combined)this._combined[p]=d._combined[p];this._extendedAttrs={};for(const p in d._extendedAttrs)this._extendedAttrs[p]=d._extendedAttrs[p];this.isWrapped=d.isWrapped}clone(){const d=new E(0);d._data=new Uint32Array(this._data),d.length=this.length;for(const p in this._combined)d._combined[p]=this._combined[p];for(const p in this._extendedAttrs)d._extendedAttrs[p]=this._extendedAttrs[p];return d.isWrapped=this.isWrapped,d}getTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0])return d+(this._data[3*d+0]>>22);return 0}getNoBgTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0]||50331648&this._data[3*d+2])return d+(this._data[3*d+0]>>22);return 0}copyCellsFrom(d,p,f,v,S){const R=d._data;if(S)for(let M=v-1;M>=0;M--){for(let A=0;A<3;A++)this._data[3*(f+M)+A]=R[3*(p+M)+A];268435456&R[3*(p+M)+2]&&(this._extendedAttrs[f+M]=d._extendedAttrs[p+M])}else for(let M=0;M<v;M++){for(let A=0;A<3;A++)this._data[3*(f+M)+A]=R[3*(p+M)+A];268435456&R[3*(p+M)+2]&&(this._extendedAttrs[f+M]=d._extendedAttrs[p+M])}const D=Object.keys(d._combined);for(let M=0;M<D.length;M++){const A=parseInt(D[M],10);A>=p&&(this._combined[A-p+f]=d._combined[A])}}translateToString(d,p,f,v){p=p??0,f=f??this.length,d&&(f=Math.min(f,this.getTrimmedLength())),v&&(v.length=0);let S="";for(;p<f;){const R=this._data[3*p+0],D=2097151&R,M=2097152&R?this._combined[p]:D?(0,C.stringFromCodePoint)(D):m.WHITESPACE_CELL_CHAR;if(S+=M,v)for(let A=0;A<M.length;++A)v.push(p);p+=R>>22||1}return v&&v.push(p),S}}c.BufferLine=E},4841:(T,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:(T,c)=>{function h(u,y,m){if(y===u.length-1)return u[y].getTrimmedLength();const C=!u[y].hasContent(m-1)&&u[y].getWidth(m-1)===1,w=u[y+1].getWidth(0)===2;return C&&w?m-1:m}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(u,y,m,C,w){const E=[];for(let b=0;b<u.length-1;b++){let d=b,p=u.get(++d);if(!p.isWrapped)continue;const f=[u.get(b)];for(;d<u.length&&p.isWrapped;)f.push(p),p=u.get(++d);if(C>=b&&C<d){b+=f.length-1;continue}let v=0,S=h(f,v,y),R=1,D=0;for(;R<f.length;){const A=h(f,R,y),B=A-D,$=m-S,I=Math.min(B,$);f[v].copyCellsFrom(f[R],D,S,I,!1),S+=I,S===m&&(v++,S=0),D+=I,D===A&&(R++,D=0),S===0&&v!==0&&f[v-1].getWidth(m-1)===2&&(f[v].copyCellsFrom(f[v-1],m-1,S++,1,!1),f[v-1].setCell(m-1,w))}f[v].replaceCells(S,m,w);let M=0;for(let A=f.length-1;A>0&&(A>v||f[A].getTrimmedLength()===0);A--)M++;M>0&&(E.push(b+f.length-M),E.push(M)),b+=f.length-1}return E},c.reflowLargerCreateNewLayout=function(u,y){const m=[];let C=0,w=y[C],E=0;for(let b=0;b<u.length;b++)if(w===b){const d=y[++C];u.onDeleteEmitter.fire({index:b-E,amount:d}),b+=d-1,E+=d,w=y[++C]}else m.push(b);return{layout:m,countRemoved:E}},c.reflowLargerApplyNewLayout=function(u,y){const m=[];for(let C=0;C<y.length;C++)m.push(u.get(y[C]));for(let C=0;C<m.length;C++)u.set(C,m[C]);u.length=y.length},c.reflowSmallerGetNewLineLengths=function(u,y,m){const C=[],w=u.map(((p,f)=>h(u,f,y))).reduce(((p,f)=>p+f));let E=0,b=0,d=0;for(;d<w;){if(w-d<m){C.push(w-d);break}E+=m;const p=h(u,b,y);E>p&&(E-=p,b++);const f=u[b].getWidth(E-1)===2;f&&E--;const v=f?m-1:m;C.push(v),d+=v}return C},c.getWrappedLineTrimmedLength=h},5295:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const u=h(8460),y=h(844),m=h(9092);class C extends y.Disposable{constructor(E,b){super(),this._optionsService=E,this._bufferService=b,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 m.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new m.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(E){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(E),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(E,b){this._normal.resize(E,b),this._alt.resize(E,b),this.setupTabStops(E)}setupTabStops(E){this._normal.setupTabStops(E),this._alt.setupTabStops(E)}}c.BufferSet=C},511:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const u=h(482),y=h(643),m=h(3734);class C extends m.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new m.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const b=new C;return b.setFromCharData(E),b}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(E){this.fg=E[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let b=!1;if(E[y.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(E[y.CHAR_DATA_CHAR_INDEX].length===2){const d=E[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=d&&d<=56319){const p=E[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(d-55296)+p-56320+65536|E[y.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=E[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[y.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=E[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=C},643:(T,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:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const u=h(8460),y=h(844);class m{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=m._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(w){return this._disposables.push(w),w}}c.Marker=m,m._nextId=1},7116:(T,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:(T,c)=>{var h,u,y;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(m){m.NUL="\0",m.SOH="",m.STX="",m.ETX="",m.EOT="",m.ENQ="",m.ACK="",m.BEL="\x07",m.BS="\b",m.HT=" ",m.LF=`
|
|
261
|
+
`,m.VT="\v",m.FF="\f",m.CR="\r",m.SO="",m.SI="",m.DLE="",m.DC1="",m.DC2="",m.DC3="",m.DC4="",m.NAK="",m.SYN="",m.ETB="",m.CAN="",m.EM="",m.SUB="",m.ESC="\x1B",m.FS="",m.GS="",m.RS="",m.US="",m.SP=" ",m.DEL=""})(h||(c.C0=h={})),(function(m){m.PAD="",m.HOP="",m.BPH="",m.NBH="",m.IND="",m.NEL="
",m.SSA="",m.ESA="",m.HTS="",m.HTJ="",m.VTS="",m.PLD="",m.PLU="",m.RI="",m.SS2="",m.SS3="",m.DCS="",m.PU1="",m.PU2="",m.STS="",m.CCH="",m.MW="",m.SPA="",m.EPA="",m.SOS="",m.SGCI="",m.SCI="",m.CSI="",m.ST="",m.OSC="",m.PM="",m.APC=""})(u||(c.C1=u={})),(function(m){m.ST=`${h.ESC}\\`})(y||(c.C1_ESCAPED=y={}))},7399:(T,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(m,C,w,E){const b={type:0,cancel:!1,key:void 0},d=(m.shiftKey?1:0)|(m.altKey?2:0)|(m.ctrlKey?4:0)|(m.metaKey?8:0);switch(m.keyCode){case 0:m.key==="UIKeyInputUpArrow"?b.key=C?u.C0.ESC+"OA":u.C0.ESC+"[A":m.key==="UIKeyInputLeftArrow"?b.key=C?u.C0.ESC+"OD":u.C0.ESC+"[D":m.key==="UIKeyInputRightArrow"?b.key=C?u.C0.ESC+"OC":u.C0.ESC+"[C":m.key==="UIKeyInputDownArrow"&&(b.key=C?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:b.key=m.ctrlKey?"\b":u.C0.DEL,m.altKey&&(b.key=u.C0.ESC+b.key);break;case 9:if(m.shiftKey){b.key=u.C0.ESC+"[Z";break}b.key=u.C0.HT,b.cancel=!0;break;case 13:b.key=m.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,b.cancel=!0;break;case 27:b.key=u.C0.ESC,m.altKey&&(b.key=u.C0.ESC+u.C0.ESC),b.cancel=!0;break;case 37:if(m.metaKey)break;d?(b.key=u.C0.ESC+"[1;"+(d+1)+"D",b.key===u.C0.ESC+"[1;3D"&&(b.key=u.C0.ESC+(w?"b":"[1;5D"))):b.key=C?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(m.metaKey)break;d?(b.key=u.C0.ESC+"[1;"+(d+1)+"C",b.key===u.C0.ESC+"[1;3C"&&(b.key=u.C0.ESC+(w?"f":"[1;5C"))):b.key=C?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(m.metaKey)break;d?(b.key=u.C0.ESC+"[1;"+(d+1)+"A",w||b.key!==u.C0.ESC+"[1;3A"||(b.key=u.C0.ESC+"[1;5A")):b.key=C?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(m.metaKey)break;d?(b.key=u.C0.ESC+"[1;"+(d+1)+"B",w||b.key!==u.C0.ESC+"[1;3B"||(b.key=u.C0.ESC+"[1;5B")):b.key=C?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:m.shiftKey||m.ctrlKey||(b.key=u.C0.ESC+"[2~");break;case 46:b.key=d?u.C0.ESC+"[3;"+(d+1)+"~":u.C0.ESC+"[3~";break;case 36:b.key=d?u.C0.ESC+"[1;"+(d+1)+"H":C?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:b.key=d?u.C0.ESC+"[1;"+(d+1)+"F":C?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:m.shiftKey?b.type=2:m.ctrlKey?b.key=u.C0.ESC+"[5;"+(d+1)+"~":b.key=u.C0.ESC+"[5~";break;case 34:m.shiftKey?b.type=3:m.ctrlKey?b.key=u.C0.ESC+"[6;"+(d+1)+"~":b.key=u.C0.ESC+"[6~";break;case 112:b.key=d?u.C0.ESC+"[1;"+(d+1)+"P":u.C0.ESC+"OP";break;case 113:b.key=d?u.C0.ESC+"[1;"+(d+1)+"Q":u.C0.ESC+"OQ";break;case 114:b.key=d?u.C0.ESC+"[1;"+(d+1)+"R":u.C0.ESC+"OR";break;case 115:b.key=d?u.C0.ESC+"[1;"+(d+1)+"S":u.C0.ESC+"OS";break;case 116:b.key=d?u.C0.ESC+"[15;"+(d+1)+"~":u.C0.ESC+"[15~";break;case 117:b.key=d?u.C0.ESC+"[17;"+(d+1)+"~":u.C0.ESC+"[17~";break;case 118:b.key=d?u.C0.ESC+"[18;"+(d+1)+"~":u.C0.ESC+"[18~";break;case 119:b.key=d?u.C0.ESC+"[19;"+(d+1)+"~":u.C0.ESC+"[19~";break;case 120:b.key=d?u.C0.ESC+"[20;"+(d+1)+"~":u.C0.ESC+"[20~";break;case 121:b.key=d?u.C0.ESC+"[21;"+(d+1)+"~":u.C0.ESC+"[21~";break;case 122:b.key=d?u.C0.ESC+"[23;"+(d+1)+"~":u.C0.ESC+"[23~";break;case 123:b.key=d?u.C0.ESC+"[24;"+(d+1)+"~":u.C0.ESC+"[24~";break;default:if(!m.ctrlKey||m.shiftKey||m.altKey||m.metaKey)if(w&&!E||!m.altKey||m.metaKey)!w||m.altKey||m.ctrlKey||m.shiftKey||!m.metaKey?m.key&&!m.ctrlKey&&!m.altKey&&!m.metaKey&&m.keyCode>=48&&m.key.length===1?b.key=m.key:m.key&&m.ctrlKey&&(m.key==="_"&&(b.key=u.C0.US),m.key==="@"&&(b.key=u.C0.NUL)):m.keyCode===65&&(b.type=1);else{const p=y[m.keyCode],f=p==null?void 0:p[m.shiftKey?1:0];if(f)b.key=u.C0.ESC+f;else if(m.keyCode>=65&&m.keyCode<=90){const v=m.ctrlKey?m.keyCode-64:m.keyCode+32;let S=String.fromCharCode(v);m.shiftKey&&(S=S.toUpperCase()),b.key=u.C0.ESC+S}else if(m.keyCode===32)b.key=u.C0.ESC+(m.ctrlKey?u.C0.NUL:" ");else if(m.key==="Dead"&&m.code.startsWith("Key")){let v=m.code.slice(3,4);m.shiftKey||(v=v.toLowerCase()),b.key=u.C0.ESC+v,b.cancel=!0}}else m.keyCode>=65&&m.keyCode<=90?b.key=String.fromCharCode(m.keyCode-64):m.keyCode===32?b.key=u.C0.NUL:m.keyCode>=51&&m.keyCode<=55?b.key=String.fromCharCode(m.keyCode-51+27):m.keyCode===56?b.key=u.C0.DEL:m.keyCode===219?b.key=u.C0.ESC:m.keyCode===220?b.key=u.C0.FS:m.keyCode===221&&(b.key=u.C0.GS)}return b}},482:(T,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 m="";for(let C=u;C<y;++C){let w=h[C];w>65535?(w-=65536,m+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):m+=String.fromCharCode(w)}return m},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,u){const y=h.length;if(!y)return 0;let m=0,C=0;if(this._interim){const w=h.charCodeAt(C++);56320<=w&&w<=57343?u[m++]=1024*(this._interim-55296)+w-56320+65536:(u[m++]=this._interim,u[m++]=w),this._interim=0}for(let w=C;w<y;++w){const E=h.charCodeAt(w);if(55296<=E&&E<=56319){if(++w>=y)return this._interim=E,m;const b=h.charCodeAt(w);56320<=b&&b<=57343?u[m++]=1024*(E-55296)+b-56320+65536:(u[m++]=E,u[m++]=b)}else E!==65279&&(u[m++]=E)}return m}},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 m,C,w,E,b=0,d=0,p=0;if(this.interim[0]){let S=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let D,M=0;for(;(D=63&this.interim[++M])&&M<4;)R<<=6,R|=D;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=A-M;for(;p<B;){if(p>=y)return 0;if(D=h[p++],(192&D)!=128){p--,S=!0;break}this.interim[M++]=D,R<<=6,R|=63&D}S||(A===2?R<128?p--:u[b++]=R:A===3?R<2048||R>=55296&&R<=57343||R===65279||(u[b++]=R):R<65536||R>1114111||(u[b++]=R)),this.interim.fill(0)}const f=y-4;let v=p;for(;v<y;){for(;!(!(v<f)||128&(m=h[v])||128&(C=h[v+1])||128&(w=h[v+2])||128&(E=h[v+3]));)u[b++]=m,u[b++]=C,u[b++]=w,u[b++]=E,v+=4;if(m=h[v++],m<128)u[b++]=m;else if((224&m)==192){if(v>=y)return this.interim[0]=m,b;if(C=h[v++],(192&C)!=128){v--;continue}if(d=(31&m)<<6|63&C,d<128){v--;continue}u[b++]=d}else if((240&m)==224){if(v>=y)return this.interim[0]=m,b;if(C=h[v++],(192&C)!=128){v--;continue}if(v>=y)return this.interim[0]=m,this.interim[1]=C,b;if(w=h[v++],(192&w)!=128){v--;continue}if(d=(15&m)<<12|(63&C)<<6|63&w,d<2048||d>=55296&&d<=57343||d===65279)continue;u[b++]=d}else if((248&m)==240){if(v>=y)return this.interim[0]=m,b;if(C=h[v++],(192&C)!=128){v--;continue}if(v>=y)return this.interim[0]=m,this.interim[1]=C,b;if(w=h[v++],(192&w)!=128){v--;continue}if(v>=y)return this.interim[0]=m,this.interim[1]=C,this.interim[2]=w,b;if(E=h[v++],(192&E)!=128){v--;continue}if(d=(7&m)<<18|(63&C)<<12|(63&w)<<6|63&E,d<65536||d>1114111)continue;u[b++]=d}}return b}}},225:(T,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]],m=[[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 C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let w=0;w<y.length;++w)C.fill(0,y[w][0],y[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?C[w]:(function(E,b){let d,p=0,f=b.length-1;if(E<b[0][0]||E>b[f][1])return!1;for(;f>=p;)if(d=p+f>>1,E>b[d][1])p=d+1;else{if(!(E<b[d][0]))return!0;f=d-1}return!1})(w,m)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,E){let b=this.wcwidth(w),d=b===0&&E!==0;if(d){const p=u.UnicodeService.extractWidth(E);p===0?d=!1:p>b&&(b=p)}return u.UnicodeService.createPropertyValue(0,b,d)}}},5981:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const u=h(8460),y=h(844);class m extends y.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let b;for(this._isSyncWriting=!0;b=this._writeBuffer.shift();){this._action(b);const d=this._callbacks.shift();d&&d()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,E){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(E)}_innerWrite(w=0,E=!0){const b=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const d=this._writeBuffer[this._bufferOffset],p=this._action(d,E);if(p){const v=S=>Date.now()-b>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(b,S);return void p.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(v)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=d.length,Date.now()-b>=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=m},5941:(T,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(m,C){const w=m.toString(16),E=w.length<2?"0"+w:w;switch(C){case 4:return w[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}c.parseColor=function(m){if(!m)return;let C=m.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const w=h.exec(C);if(w){const E=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/E*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/E*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/E*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),u.exec(C)&&[3,6,9,12].includes(C.length))){const w=C.length/3,E=[0,0,0];for(let b=0;b<3;++b){const d=parseInt(C.slice(w*b,w*b+w),16);E[b]=w===1?d<<4:w===2?d:w===3?d>>4:d>>8}return E}},c.toRgbString=function(m,C=16){const[w,E,b]=m;return`rgb:${y(w,C)}/${y(E,C)}/${y(b,C)}`}},5770:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const u=h(482),y=h(8742),m=h(5770),C=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=C,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=C}registerHandler(E,b){this._handlers[E]===void 0&&(this._handlers[E]=[]);const d=this._handlers[E];return d.push(b),{dispose:()=>{const p=d.indexOf(b);p!==-1&&d.splice(p,1)}}}clearHandler(E){this._handlers[E]&&delete this._handlers[E]}setHandlerFallback(E){this._handlerFb=E}reset(){if(this._active.length)for(let E=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;E>=0;--E)this._active[E].unhook(!1);this._stack.paused=!1,this._active=C,this._ident=0}hook(E,b){if(this.reset(),this._ident=E,this._active=this._handlers[E]||C,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].hook(b);else this._handlerFb(this._ident,"HOOK",b)}put(E,b,d){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(E,b,d);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(E,b,d))}unhook(E,b=!0){if(this._active.length){let d=!1,p=this._active.length-1,f=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,d=b,f=this._stack.fallThrough,this._stack.paused=!1),!f&&d===!1){for(;p>=0&&(d=this._active[p].unhook(E),d!==!0);p--)if(d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,d;p--}for(;p>=0;p--)if(d=this._active[p].unhook(!1),d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,d}else this._handlerFb(this._ident,"UNHOOK",E);this._active=C,this._ident=0}};const w=new y.Params;w.addParam(0),c.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=w,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():w,this._data="",this._hitLimit=!1}put(E,b,d){this._hitLimit||(this._data+=(0,u.utf32ToString)(E,b,d),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let b=!1;if(this._hitLimit)b=!1;else if(E&&(b=this._handler(this._data,this._params),b instanceof Promise))return b.then((d=>(this._params=w,this._data="",this._hitLimit=!1,d)));return this._params=w,this._data="",this._hitLimit=!1,b}}},2015:(T,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),m=h(6242),C=h(6351);class w{constructor(p){this.table=new Uint8Array(p)}setDefault(p,f){this.table.fill(p<<4|f)}add(p,f,v,S){this.table[f<<8|p]=v<<4|S}addMany(p,f,v,S){for(let R=0;R<p.length;R++)this.table[f<<8|p[R]]=v<<4|S}}c.TransitionTable=w;const E=160;c.VT500_TRANSITION_TABLE=(function(){const d=new w(4095),p=Array.apply(null,Array(256)).map(((M,A)=>A)),f=(M,A)=>p.slice(M,A),v=f(32,127),S=f(0,24);S.push(25),S.push.apply(S,f(28,32));const R=f(0,14);let D;for(D in d.setDefault(1,0),d.addMany(v,0,2,0),R)d.addMany([24,26,153,154],D,3,0),d.addMany(f(128,144),D,3,0),d.addMany(f(144,152),D,3,0),d.add(156,D,0,0),d.add(27,D,11,1),d.add(157,D,4,8),d.addMany([152,158,159],D,0,7),d.add(155,D,11,3),d.add(144,D,11,9);return d.addMany(S,0,3,0),d.addMany(S,1,3,1),d.add(127,1,0,1),d.addMany(S,8,0,8),d.addMany(S,3,3,3),d.add(127,3,0,3),d.addMany(S,4,3,4),d.add(127,4,0,4),d.addMany(S,6,3,6),d.addMany(S,5,3,5),d.add(127,5,0,5),d.addMany(S,2,3,2),d.add(127,2,0,2),d.add(93,1,4,8),d.addMany(v,8,5,8),d.add(127,8,5,8),d.addMany([156,27,24,26,7],8,6,0),d.addMany(f(28,32),8,0,8),d.addMany([88,94,95],1,0,7),d.addMany(v,7,0,7),d.addMany(S,7,0,7),d.add(156,7,0,0),d.add(127,7,0,7),d.add(91,1,11,3),d.addMany(f(64,127),3,7,0),d.addMany(f(48,60),3,8,4),d.addMany([60,61,62,63],3,9,4),d.addMany(f(48,60),4,8,4),d.addMany(f(64,127),4,7,0),d.addMany([60,61,62,63],4,0,6),d.addMany(f(32,64),6,0,6),d.add(127,6,0,6),d.addMany(f(64,127),6,0,0),d.addMany(f(32,48),3,9,5),d.addMany(f(32,48),5,9,5),d.addMany(f(48,64),5,0,6),d.addMany(f(64,127),5,7,0),d.addMany(f(32,48),4,9,5),d.addMany(f(32,48),1,9,2),d.addMany(f(32,48),2,9,2),d.addMany(f(48,127),2,10,0),d.addMany(f(48,80),1,10,0),d.addMany(f(81,88),1,10,0),d.addMany([89,90,92],1,10,0),d.addMany(f(96,127),1,10,0),d.add(80,1,11,9),d.addMany(S,9,0,9),d.add(127,9,0,9),d.addMany(f(28,32),9,0,9),d.addMany(f(32,48),9,9,12),d.addMany(f(48,60),9,8,10),d.addMany([60,61,62,63],9,9,10),d.addMany(S,11,0,11),d.addMany(f(32,128),11,0,11),d.addMany(f(28,32),11,0,11),d.addMany(S,10,0,10),d.add(127,10,0,10),d.addMany(f(28,32),10,0,10),d.addMany(f(48,60),10,8,10),d.addMany([60,61,62,63],10,0,11),d.addMany(f(32,48),10,9,12),d.addMany(S,12,0,12),d.add(127,12,0,12),d.addMany(f(28,32),12,0,12),d.addMany(f(32,48),12,9,12),d.addMany(f(48,64),12,0,11),d.addMany(f(64,127),12,12,13),d.addMany(f(64,127),10,12,13),d.addMany(f(64,127),9,12,13),d.addMany(S,13,13,13),d.addMany(v,13,13,13),d.add(127,13,0,13),d.addMany([27,156,24,26],13,14,0),d.add(E,0,2,0),d.add(E,8,5,8),d.add(E,6,0,6),d.add(E,11,0,11),d.add(E,13,13,13),d})();class b extends u.Disposable{constructor(p=c.VT500_TRANSITION_TABLE){super(),this._transitions=p,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=(f,v,S)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,v)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,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 m.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(p,f=[64,126]){let v=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(v=p.prefix.charCodeAt(0),v&&60>v||v>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<p.intermediates.length;++R){const D=p.intermediates.charCodeAt(R);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");v<<=8,v|=D}}if(p.final.length!==1)throw new Error("final must be a single byte");const S=p.final.charCodeAt(0);if(f[0]>S||S>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return v<<=8,v|=S,v}identToString(p){const f=[];for(;p;)f.push(String.fromCharCode(255&p)),p>>=8;return f.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,f){const v=this._identifier(p,[48,126]);this._escHandlers[v]===void 0&&(this._escHandlers[v]=[]);const S=this._escHandlers[v];return S.push(f),{dispose:()=>{const R=S.indexOf(f);R!==-1&&S.splice(R,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,f){this._executeHandlers[p.charCodeAt(0)]=f}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,f){const v=this._identifier(p);this._csiHandlers[v]===void 0&&(this._csiHandlers[v]=[]);const S=this._csiHandlers[v];return S.push(f),{dispose:()=>{const R=S.indexOf(f);R!==-1&&S.splice(R,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,f){return this._dcsParser.registerHandler(this._identifier(p),f)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,f){return this._oscParser.registerHandler(p,f)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}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(p,f,v,S,R){this._parseStack.state=p,this._parseStack.handlers=f,this._parseStack.handlerPos=v,this._parseStack.transition=S,this._parseStack.chunkPos=R}parse(p,f,v){let S,R=0,D=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(v===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(v===!1&&B>-1){for(;B>=0&&(S=A[B](this._params),S!==!0);B--)if(S instanceof Promise)return this._parseStack.handlerPos=B,S}this._parseStack.handlers=[];break;case 4:if(v===!1&&B>-1){for(;B>=0&&(S=A[B](),S!==!0);B--)if(S instanceof Promise)return this._parseStack.handlerPos=B,S}this._parseStack.handlers=[];break;case 6:if(R=p[this._parseStack.chunkPos],S=this._dcsParser.unhook(R!==24&&R!==26,v),S)return S;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=p[this._parseStack.chunkPos],S=this._oscParser.end(R!==24&&R!==26,v),S)return S;R===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 A=M;A<f;++A){switch(R=p[A],D=this._transitions.table[this.currentState<<8|(R<160?R:E)],D>>4){case 2:for(let P=A+1;;++P){if(P>=f||(R=p[P])<32||R>126&&R<E){this._printHandler(p,A,P),A=P-1;break}if(++P>=f||(R=p[P])<32||R>126&&R<E){this._printHandler(p,A,P),A=P-1;break}if(++P>=f||(R=p[P])<32||R>126&&R<E){this._printHandler(p,A,P),A=P-1;break}if(++P>=f||(R=p[P])<32||R>126&&R<E){this._printHandler(p,A,P),A=P-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const B=this._csiHandlers[this._collect<<8|R];let $=B?B.length-1:-1;for(;$>=0&&(S=B[$](this._params),S!==!0);$--)if(S instanceof Promise)return this._preserveStack(3,B,$,D,A),S;$<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++A<f&&(R=p[A])>47&&R<60);A--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const I=this._escHandlers[this._collect<<8|R];let q=I?I.length-1:-1;for(;q>=0&&(S=I[q](),S!==!0);q--)if(S instanceof Promise)return this._preserveStack(4,I,q,D,A),S;q<0&&this._escHandlerFb(this._collect<<8|R),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|R,this._params);break;case 13:for(let P=A+1;;++P)if(P>=f||(R=p[P])===24||R===26||R===27||R>127&&R<E){this._dcsParser.put(p,A,P),A=P-1;break}break;case 14:if(S=this._dcsParser.unhook(R!==24&&R!==26),S)return this._preserveStack(6,[],0,D,A),S;R===27&&(D|=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 P=A+1;;P++)if(P>=f||(R=p[P])<32||R>127&&R<E){this._oscParser.put(p,A,P),A=P-1;break}break;case 6:if(S=this._oscParser.end(R!==24&&R!==26),S)return this._preserveStack(5,[],0,D,A),S;R===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&D}}}c.EscapeSequenceParser=b},6242:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const u=h(5770),y=h(482),m=[];c.OscParser=class{constructor(){this._state=0,this._active=m,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,w){this._handlers[C]===void 0&&(this._handlers[C]=[]);const E=this._handlers[C];return E.push(w),{dispose:()=>{const b=E.indexOf(w);b!==-1&&E.splice(b,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}reset(){if(this._state===2)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].end(!1);this._stack.paused=!1,this._active=m,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||m,this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].start();else this._handlerFb(this._id,"START")}_put(C,w,E){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(C,w,E);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(C,w,E))}start(){this.reset(),this._state=1}put(C,w,E){if(this._state!==3){if(this._state===1)for(;w<E;){const b=C[w++];if(b===59){this._state=2,this._start();break}if(b<48||57<b)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+b-48}this._state===2&&E-w>0&&this._put(C,w,E)}}end(C,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,b=this._active.length-1,d=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,E=w,d=this._stack.fallThrough,this._stack.paused=!1),!d&&E===!1){for(;b>=0&&(E=this._active[b].end(C),E!==!0);b--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,E;b--}for(;b>=0;b--)if(E=this._active[b].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",C);this._active=m,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(C){this._handler=C,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(C,w,E){this._hitLimit||(this._data+=(0,y.utf32ToString)(C,w,E),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let w=!1;if(this._hitLimit)w=!1;else if(C&&(w=this._handler(this._data),w instanceof Promise))return w.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,w}}},8742:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const h=2147483647;class u{static fromArray(m){const C=new u;if(!m.length)return C;for(let w=Array.isArray(m[0])?1:0;w<m.length;++w){const E=m[w];if(Array.isArray(E))for(let b=0;b<E.length;++b)C.addSubParam(E[b]);else C.addParam(E)}return C}constructor(m=32,C=32){if(this.maxLength=m,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(m),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(m),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const m=new u(this.maxLength,this.maxSubParamsLength);return m.params.set(this.params),m.length=this.length,m._subParams.set(this._subParams),m._subParamsLength=this._subParamsLength,m._subParamsIdx.set(this._subParamsIdx),m._rejectDigits=this._rejectDigits,m._rejectSubDigits=this._rejectSubDigits,m._digitIsSub=this._digitIsSub,m}toArray(){const m=[];for(let C=0;C<this.length;++C){m.push(this.params[C]);const w=this._subParamsIdx[C]>>8,E=255&this._subParamsIdx[C];E-w>0&&m.push(Array.prototype.slice.call(this._subParams,w,E))}return m}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(m){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=m>h?h:m}}addSubParam(m){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=m>h?h:m,this._subParamsIdx[this.length-1]++}}hasSubParams(m){return(255&this._subParamsIdx[m])-(this._subParamsIdx[m]>>8)>0}getSubParams(m){const C=this._subParamsIdx[m]>>8,w=255&this._subParamsIdx[m];return w-C>0?this._subParams.subarray(C,w):null}getSubParamsAll(){const m={};for(let C=0;C<this.length;++C){const w=this._subParamsIdx[C]>>8,E=255&this._subParamsIdx[C];E-w>0&&(m[C]=this._subParams.slice(w,E))}return m}addDigit(m){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,E=w[C-1];w[C-1]=~E?Math.min(10*E+m,h):m}}c.Params=u},5741:(T,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:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const u=h(3785),y=h(511);c.BufferApiView=class{constructor(m,C){this._buffer=m,this.type=C}init(m){return this._buffer=m,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(m){const C=this._buffer.lines.get(m);if(C)return new u.BufferLineApiView(C)}getNullCell(){return new y.CellData}}},3785:(T,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,m){if(!(y<0||y>=this._line.length))return m?(this._line.loadCell(y,m),m):this._line.loadCell(y,new u.CellData)}translateToString(y,m,C){return this._line.translateToString(y,m,C)}}},8285:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const u=h(8771),y=h(8460),m=h(844);class C extends m.Disposable{constructor(E){super(),this._core=E,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=C},7975:(T,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,m)=>u(y,m.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:(T,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(T,c,h){var u=this&&this.__decorate||function(d,p,f,v){var S,R=arguments.length,D=R<3?p:v===null?v=Object.getOwnPropertyDescriptor(p,f):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(d,p,f,v);else for(var M=d.length-1;M>=0;M--)(S=d[M])&&(D=(R<3?S(D):R>3?S(p,f,D):S(p,f))||D);return R>3&&D&&Object.defineProperty(p,f,D),D},y=this&&this.__param||function(d,p){return function(f,v){p(f,v,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const m=h(8460),C=h(844),w=h(5295),E=h(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let b=c.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(d){super(),this.isUserScrolling=!1,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new m.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(d.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(d.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(d,this))}resize(d,p){this.cols=d,this.rows=p,this.buffers.resize(d,p),this._onResize.fire({cols:d,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(d,p=!1){const f=this.buffer;let v;v=this._cachedBlankLine,v&&v.length===this.cols&&v.getFg(0)===d.fg&&v.getBg(0)===d.bg||(v=f.getBlankLine(d,p),this._cachedBlankLine=v),v.isWrapped=p;const S=f.ybase+f.scrollTop,R=f.ybase+f.scrollBottom;if(f.scrollTop===0){const D=f.lines.isFull;R===f.lines.length-1?D?f.lines.recycle().copyFrom(v):f.lines.push(v.clone()):f.lines.splice(R+1,0,v.clone()),D?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const D=R-S+1;f.lines.shiftElements(S+1,D-1,-1),f.lines.set(R,v.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(d,p,f){const v=this.buffer;if(d<0){if(v.ydisp===0)return;this.isUserScrolling=!0}else d+v.ydisp>=v.ybase&&(this.isUserScrolling=!1);const S=v.ydisp;v.ydisp=Math.max(Math.min(v.ydisp+d,v.ybase),0),S!==v.ydisp&&(p||this._onScroll.fire(v.ydisp))}};c.BufferService=b=u([y(0,E.IOptionsService)],b)},7994:(T,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(T,c,h){var u=this&&this.__decorate||function(v,S,R,D){var M,A=arguments.length,B=A<3?S:D===null?D=Object.getOwnPropertyDescriptor(S,R):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(v,S,R,D);else for(var $=v.length-1;$>=0;$--)(M=v[$])&&(B=(A<3?M(B):A>3?M(S,R,B):M(S,R))||B);return A>3&&B&&Object.defineProperty(S,R,B),B},y=this&&this.__param||function(v,S){return function(R,D){S(R,D,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const m=h(2585),C=h(8460),w=h(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:v=>v.button!==4&&v.action===1&&(v.ctrl=!1,v.alt=!1,v.shift=!1,!0)},VT200:{events:19,restrict:v=>v.action!==32},DRAG:{events:23,restrict:v=>v.action!==32||v.button!==3},ANY:{events:31,restrict:v=>!0}};function b(v,S){let R=(v.ctrl?16:0)|(v.shift?4:0)|(v.alt?8:0);return v.button===4?(R|=64,R|=v.action):(R|=3&v.button,4&v.button&&(R|=64),8&v.button&&(R|=128),v.action===32?R|=32:v.action!==0||S||(R|=3)),R}const d=String.fromCharCode,p={DEFAULT:v=>{const S=[b(v,!1)+32,v.col+32,v.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${d(S[0])}${d(S[1])}${d(S[2])}`},SGR:v=>{const S=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${b(v,!0)};${v.col};${v.row}${S}`},SGR_PIXELS:v=>{const S=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${b(v,!0)};${v.x};${v.y}${S}`}};let f=c.CoreMouseService=class extends w.Disposable{constructor(v,S){super(),this._bufferService=v,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new C.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(E))this.addProtocol(R,E[R]);for(const R of Object.keys(p))this.addEncoding(R,p[R]);this.reset()}addProtocol(v,S){this._protocols[v]=S}addEncoding(v,S){this._encodings[v]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(v){if(!this._protocols[v])throw new Error(`unknown protocol "${v}"`);this._activeProtocol=v,this._onProtocolChange.fire(this._protocols[v].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(v){if(!this._encodings[v])throw new Error(`unknown encoding "${v}"`);this._activeEncoding=v}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(v){if(v.col<0||v.col>=this._bufferService.cols||v.row<0||v.row>=this._bufferService.rows||v.button===4&&v.action===32||v.button===3&&v.action!==32||v.button!==4&&(v.action===2||v.action===3)||(v.col++,v.row++,v.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,v,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(v))return!1;const S=this._encodings[this._activeEncoding](v);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=v,!0}explainEvents(v){return{down:!!(1&v),up:!!(2&v),drag:!!(4&v),move:!!(8&v),wheel:!!(16&v)}}_equalEvents(v,S,R){if(R){if(v.x!==S.x||v.y!==S.y)return!1}else if(v.col!==S.col||v.row!==S.row)return!1;return v.button===S.button&&v.action===S.action&&v.ctrl===S.ctrl&&v.alt===S.alt&&v.shift===S.shift}};c.CoreMouseService=f=u([y(0,m.IBufferService),y(1,m.ICoreService)],f)},6975:function(T,c,h){var u=this&&this.__decorate||function(f,v,S,R){var D,M=arguments.length,A=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(f,v,S,R);else for(var B=f.length-1;B>=0;B--)(D=f[B])&&(A=(M<3?D(A):M>3?D(v,S,A):D(v,S))||A);return M>3&&A&&Object.defineProperty(v,S,A),A},y=this&&this.__param||function(f,v){return function(S,R){v(S,R,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const m=h(1439),C=h(8460),w=h(844),E=h(2585),b=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=c.CoreService=class extends w.Disposable{constructor(f,v,S){super(),this._bufferService=f,this._logService=v,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new C.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new C.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new C.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new C.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,m.clone)(b),this.decPrivateModes=(0,m.clone)(d)}reset(){this.modes=(0,m.clone)(b),this.decPrivateModes=(0,m.clone)(d)}triggerDataEvent(f,v=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;v&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),v&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,(()=>f.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,(()=>f.split("").map((v=>v.charCodeAt(0))))),this._onBinary.fire(f))}};c.CoreService=p=u([y(0,E.IBufferService),y(1,E.ILogService),y(2,E.IOptionsService)],p)},9074:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const u=h(8055),y=h(8460),m=h(844),C=h(6106);let w=0,E=0;class b extends m.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((f=>f==null?void 0:f.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,m.toDisposable)((()=>this.reset())))}registerDecoration(f){if(f.marker.isDisposed)return;const v=new d(f);if(v){const S=v.marker.onDispose((()=>v.dispose()));v.onDispose((()=>{v&&(this._decorations.delete(v)&&this._onDecorationRemoved.fire(v),S.dispose())})),this._decorations.insert(v),this._onDecorationRegistered.fire(v)}return v}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,v,S){let R=0,D=0;for(const M of this._decorations.getKeyIterator(v))R=M.options.x??0,D=R+(M.options.width??1),f>=R&&f<D&&(!S||(M.options.layer??"bottom")===S)&&(yield M)}forEachDecorationAtCell(f,v,S,R){this._decorations.forEachByKey(v,(D=>{w=D.options.x??0,E=w+(D.options.width??1),f>=w&&f<E&&(!S||(D.options.layer??"bottom")===S)&&R(D)}))}}c.DecorationService=b;class d extends m.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(f){super(),this.options=f,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=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const u=h(2585),y=h(8343);class m{constructor(...w){this._entries=new Map;for(const[E,b]of w)this.set(E,b)}set(w,E){const b=this._entries.get(w);return this._entries.set(w,E),b}forEach(w){for(const[E,b]of this._entries.entries())w(E,b)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}c.ServiceCollection=m,c.InstantiationService=class{constructor(){this._services=new m,this._services.set(u.IInstantiationService,this)}setService(C,w){this._services.set(C,w)}getService(C){return this._services.get(C)}createInstance(C,...w){const E=(0,y.getServiceDependencies)(C).sort(((p,f)=>p.index-f.index)),b=[];for(const p of E){const f=this._services.get(p.id);if(!f)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${p.id}.`);b.push(f)}const d=E.length>0?E[0].index:w.length;if(w.length!==d)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${d+1} conflicts with ${w.length} static arguments`);return new C(...w,...b)}}},7866:function(T,c,h){var u=this&&this.__decorate||function(d,p,f,v){var S,R=arguments.length,D=R<3?p:v===null?v=Object.getOwnPropertyDescriptor(p,f):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(d,p,f,v);else for(var M=d.length-1;M>=0;M--)(S=d[M])&&(D=(R<3?S(D):R>3?S(p,f,D):S(p,f))||D);return R>3&&D&&Object.defineProperty(p,f,D),D},y=this&&this.__param||function(d,p){return function(f,v){p(f,v,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const m=h(844),C=h(2585),w={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let E,b=c.LogService=class extends m.Disposable{get logLevel(){return this._logLevel}constructor(d){super(),this._optionsService=d,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(d){for(let p=0;p<d.length;p++)typeof d[p]=="function"&&(d[p]=d[p]())}_log(d,p,f){this._evalLazyOptionalParams(f),d.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...f)}trace(d,...p){var f;this._logLevel<=C.LogLevelEnum.TRACE&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.trace.bind(this._optionsService.options.logger))??console.log,d,p)}debug(d,...p){var f;this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.debug.bind(this._optionsService.options.logger))??console.log,d,p)}info(d,...p){var f;this._logLevel<=C.LogLevelEnum.INFO&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.info.bind(this._optionsService.options.logger))??console.info,d,p)}warn(d,...p){var f;this._logLevel<=C.LogLevelEnum.WARN&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.warn.bind(this._optionsService.options.logger))??console.warn,d,p)}error(d,...p){var f;this._logLevel<=C.LogLevelEnum.ERROR&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.error.bind(this._optionsService.options.logger))??console.error,d,p)}};c.LogService=b=u([y(0,C.IOptionsService)],b),c.setTraceLogger=function(d){E=d},c.traceCall=function(d,p,f){if(typeof f.value!="function")throw new Error("not supported");const v=f.value;f.value=function(...S){if(E.logLevel!==C.LogLevelEnum.TRACE)return v.apply(this,S);E.trace(`GlyphRenderer#${v.name}(${S.map((D=>JSON.stringify(D))).join(", ")})`);const R=v.apply(this,S);return E.trace(`GlyphRenderer#${v.name} return`,R),R}}},7302:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const u=h(8460),y=h(844),m=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:m.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const C=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends y.Disposable{constructor(b){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const d={...c.DEFAULT_OPTIONS};for(const p in b)if(p in d)try{const f=b[p];d[p]=this._sanitizeAndValidateOption(p,f)}catch(f){console.error(f)}this.rawOptions=d,this.options={...d},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(b,d){return this.onOptionChange((p=>{p===b&&d(this.rawOptions[b])}))}onMultipleOptionChange(b,d){return this.onOptionChange((p=>{b.indexOf(p)!==-1&&d()}))}_setupOptions(){const b=p=>{if(!(p in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},d=(p,f)=>{if(!(p in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);f=this._sanitizeAndValidateOption(p,f),this.rawOptions[p]!==f&&(this.rawOptions[p]=f,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const f={get:b.bind(this,p),set:d.bind(this,p)};Object.defineProperty(this.options,p,f)}}_sanitizeAndValidateOption(b,d){switch(b){case"cursorStyle":if(d||(d=c.DEFAULT_OPTIONS[b]),!(function(p){return p==="block"||p==="underline"||p==="bar"})(d))throw new Error(`"${d}" is not a valid value for ${b}`);break;case"wordSeparator":d||(d=c.DEFAULT_OPTIONS[b]);break;case"fontWeight":case"fontWeightBold":if(typeof d=="number"&&1<=d&&d<=1e3)break;d=C.includes(d)?d:c.DEFAULT_OPTIONS[b];break;case"cursorWidth":d=Math.floor(d);case"lineHeight":case"tabStopWidth":if(d<1)throw new Error(`${b} cannot be less than 1, value: ${d}`);break;case"minimumContrastRatio":d=Math.max(1,Math.min(21,Math.round(10*d)/10));break;case"scrollback":if((d=Math.min(d,4294967295))<0)throw new Error(`${b} cannot be less than 0, value: ${d}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(d<=0)throw new Error(`${b} cannot be less than or equal to 0, value: ${d}`);break;case"rows":case"cols":if(!d&&d!==0)throw new Error(`${b} must be numeric, value: ${d}`);break;case"windowsPty":d=d??{}}return d}}c.OptionsService=w},2660:function(T,c,h){var u=this&&this.__decorate||function(w,E,b,d){var p,f=arguments.length,v=f<3?E:d===null?d=Object.getOwnPropertyDescriptor(E,b):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(w,E,b,d);else for(var S=w.length-1;S>=0;S--)(p=w[S])&&(v=(f<3?p(v):f>3?p(E,b,v):p(E,b))||v);return f>3&&v&&Object.defineProperty(E,b,v),v},y=this&&this.__param||function(w,E){return function(b,d){E(b,d,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const m=h(2585);let C=c.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const E=this._bufferService.buffer;if(w.id===void 0){const S=E.addMarker(E.ybase+E.y),R={data:w,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(R,S))),this._dataByLinkId.set(R.id,R),R.id}const b=w,d=this._getEntryIdKey(b),p=this._entriesWithId.get(d);if(p)return this.addLineToLink(p.id,E.ybase+E.y),p.id;const f=E.addMarker(E.ybase+E.y),v={id:this._nextId++,key:this._getEntryIdKey(b),data:b,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(v,f))),this._entriesWithId.set(v.key,v),this._dataByLinkId.set(v.id,v),v.id}addLineToLink(w,E){const b=this._dataByLinkId.get(w);if(b&&b.lines.every((d=>d.line!==E))){const d=this._bufferService.buffer.addMarker(E);b.lines.push(d),d.onDispose((()=>this._removeMarkerFromLink(b,d)))}}getLinkData(w){var E;return(E=this._dataByLinkId.get(w))==null?void 0:E.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,E){const b=w.lines.indexOf(E);b!==-1&&(w.lines.splice(b,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};c.OscLinkService=C=u([y(0,m.IBufferService)],C)},8343:(T,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 m=function(C,w,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,d,p){d[h]===d?d[u].push({id:b,index:p}):(d[u]=[{id:b,index:p}],d[h]=d)})(m,C,E)};return m.toString=()=>y,c.serviceRegistry.set(y,m),m}},2585:(T,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(m){m[m.TRACE=0]="TRACE",m[m.DEBUG=1]="DEBUG",m[m.INFO=2]="INFO",m[m.WARN=3]="WARN",m[m.ERROR=4]="ERROR",m[m.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:(T,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const u=h(8460),y=h(225);class m{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,E,b=!1){return(16777215&w)<<3|(3&E)<<1|(b?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const w=new y.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let E=0,b=0;const d=w.length;for(let p=0;p<d;++p){let f=w.charCodeAt(p);if(55296<=f&&f<=56319){if(++p>=d)return E+this.wcwidth(f);const R=w.charCodeAt(p);56320<=R&&R<=57343?f=1024*(f-55296)+R-56320+65536:E+=this.wcwidth(R)}const v=this.charProperties(f,b);let S=m.extractWidth(v);m.extractShouldJoin(v)&&(S-=m.extractWidth(b)),E+=S,b=v}return E}charProperties(w,E){return this._activeProvider.charProperties(w,E)}}c.UnicodeService=m}},o={};function g(T){var c=o[T];if(c!==void 0)return c.exports;var h=o[T]={exports:{}};return a[T].call(h.exports,h,h.exports,g),h.exports}var x={};return(()=>{var T=x;Object.defineProperty(T,"__esModule",{value:!0}),T.Terminal=void 0;const c=g(9042),h=g(3236),u=g(844),y=g(5741),m=g(8285),C=g(7975),w=g(7090),E=["cols","rows"];class b extends u.Disposable{constructor(p){super(),this._core=this.register(new h.Terminal(p)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const f=S=>this._core.options[S],v=(S,R)=>{this._checkReadonlyOptions(S),this._core.options[S]=R};for(const S in this._core.options){const R={get:f.bind(this,S),set:v.bind(this,S)};Object.defineProperty(this._publicOptions,S,R)}}_checkReadonlyOptions(p){if(E.includes(p))throw new Error(`Option "${p}" 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 C.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new m.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const f in p)this._publicOptions[f]=p[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(p,f=!0){this._core.input(p,f)}resize(p,f){this._verifyIntegers(p,f),this._core.resize(p,f)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}attachCustomWheelEventHandler(p){this._core.attachCustomWheelEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){return this._checkProposedApi(),this._verifyPositiveIntegers(p.x??0,p.width??0,p.height??0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,f,v){this._verifyIntegers(p,f,v),this._core.select(p,f,v)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,f){this._verifyIntegers(p,f),this._core.selectLines(p,f)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,f){this._core.write(p,f)}writeln(p,f){this._core.write(p),this._core.write(`\r
|
|
262
|
+
`,f)}paste(p){this._core.paste(p)}refresh(p,f){this._verifyIntegers(p,f),this._core.refresh(p,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return c}_verifyIntegers(...p){for(const f of p)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const f of p)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}T.Terminal=b})(),x})()))})(Yu)),Yu.exports}var j2=z2(),Vu={exports:{}},up;function H2(){return up||(up=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(g){this._terminal=g}dispose(){}fit(){const g=this.proposeDimensions();if(!g||!this._terminal||isNaN(g.cols)||isNaN(g.rows))return;const x=this._terminal._core;this._terminal.rows===g.rows&&this._terminal.cols===g.cols||(x._renderService.clear(),this._terminal.resize(g.cols,g.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const g=this._terminal._core,x=g._renderService.dimensions;if(x.css.cell.width===0||x.css.cell.height===0)return;const T=this._terminal.options.scrollback===0?0:g.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),m=h-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),C=u-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-T;return{cols:Math.max(2,Math.floor(C/x.css.cell.width)),rows:Math.max(1,Math.floor(m/x.css.cell.height))}}}})(),a})()))})(Vu)),Vu.exports}var U2=H2();const I2=3e4,P2=300*1e3;class $2{constructor(r,a,o){wt(this,"ws",null);wt(this,"consecutiveFailures",0);wt(this,"failStartTime",null);wt(this,"destroyed",!1);wt(this,"reconnectTimer",null);wt(this,"url");wt(this,"authToken");wt(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,g,x,T,c;if(this.destroyed)return;if(this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=P2){(o=(a=this.callbacks).onGiveUp)==null||o.call(a),(x=(g=this.callbacks).onClose)==null||x.call(g);return}this.consecutiveFailures++;const r=Math.min(I2,1e3*Math.pow(2,this.consecutiveFailures-1));(c=(T=this.callbacks).onReconnecting)==null||c.call(T,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}}function F2({sessionId:i,status:r}){const a=Et(d=>d.token),o=F.useRef(null),g=F.useRef(null),x=F.useRef(null),T=F.useRef(null),c=F.useRef(r),h=F.useRef("");F.useEffect(()=>{c.current=r},[r]);const[u,y]=F.useState("connecting"),[m,C]=F.useState(null),w=F.useCallback(()=>{const d=window.location.origin,p=`/v1/sessions/${encodeURIComponent(i)}/terminal`;return`${d.replace(/^http/,"ws")}${p}`},[i]);F.useEffect(()=>{if(!o.current)return;const d=new j2.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:1e3}),p=new U2.FitAddon;d.loadAddon(p),d.open(o.current),p.fit(),g.current=d,x.current=p;const f=new ResizeObserver(()=>{var R;p.fit();const{cols:v,rows:S}=d;(R=T.current)==null||R.send({type:"resize",cols:v,rows:S})});return f.observe(o.current),()=>{f.disconnect(),d.dispose(),g.current=null,x.current=null}},[]),F.useEffect(()=>{const d=w(),p=new $2(d,{onMessage:f=>{const v=f,S=g.current;if(S)switch(v.type){case"pane":{const R=h.current,D=v.content;R&&D.startsWith(R)?S.write(D.slice(R.length)):(S.reset(),S.write(D)),h.current=D,C(null);break}case"status":break;case"error":C(v.message);break}},onOpen:()=>{var v;y("connected"),C(null);const f=g.current;x.current&&f&&((v=T.current)==null||v.send({type:"resize",cols:f.cols,rows:f.rows}))},onReconnecting:()=>{y("reconnecting")},onGiveUp:()=>{y("disconnected")},onClose:()=>{y("disconnected")}},a??void 0);return T.current=p,()=>{T.current=null,p.close()}},[w,a]),F.useEffect(()=>{const d=g.current;if(!d)return;const p=d.onData(f=>{var v;(v=T.current)==null||v.send({type:"input",text:f})});return()=>{p.dispose()}},[]);const E=r==="working",b=u==="connected";return O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[O.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-xs border-b border-[#1a1a2e]",children:[O.jsx("div",{className:"flex items-center gap-2",children:O.jsx("span",{className:"font-mono text-[#888]",children:"Terminal"})}),O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:b?"#00e5ff":u==="reconnecting"?"#ffaa00":"#666",boxShadow:b?"0 0 4px #00e5ff40":"none",animation:u==="reconnecting"?"pulse 1s ease-in-out infinite":"none"}}),O.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:u==="connecting"?"connecting…":u==="reconnecting"?"reconnecting…":u==="connected"?"ws live":"disconnected"})]}),O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:E?"#00ff88":"#888",boxShadow:E?"0 0 4px #00ff88":"none"}}),O.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:E?"active":"idle"})]})]})]}),m&&O.jsx("div",{className:"px-4 py-2 text-xs text-[#ff3366] bg-[#ff336610] border-b border-[#ff336620]",children:m}),O.jsx("div",{ref:o,className:"h-[calc(100vh-420px)] sm:h-[calc(100vh-460px)] min-h-[250px] sm:min-h-[300px]"})]})}function Z2({metrics:i,loading:r}){if(r||!i)return O.jsx("div",{className:"flex items-center justify-center h-48 text-[#555] text-sm animate-pulse",children:"Loading metrics…"});const a=[{label:"Duration",value:WE(i.durationSec*1e3),icon:"⏱",color:"#00e5ff"},{label:"Messages",value:i.messages.toString(),icon:"💬",color:"#00e5ff"},{label:"Tool Calls",value:i.toolCalls.toString(),icon:"🔧",color:"#00e5ff"},{label:"Approvals",value:i.approvals.toString(),icon:"✅",color:"#00ff88"},{label:"Auto-approvals",value:i.autoApprovals.toString(),icon:"⚡",color:"#ffaa00"},{label:"Status Changes",value:i.statusChanges.length.toString(),icon:"🔄",color:"#8888ff"}];return O.jsxs("div",{className:"space-y-4",children:[O.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:a.map(o=>O.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors duration-150 hover:border-[#00e5ff]/30",children:[O.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[O.jsx("span",{className:"text-base",children:o.icon}),O.jsx("span",{className:"text-[10px] text-[#888] uppercase tracking-wider",children:o.label})]}),O.jsx("div",{className:"text-2xl font-semibold font-mono tabular-nums",style:{color:o.color},children:o.value})]},o.label))}),i.statusChanges.length>0&&O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[O.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Status Changes"}),O.jsx("div",{className:"flex flex-wrap gap-2",children:i.statusChanges.map((o,g)=>O.jsx("div",{className:"text-xs font-mono text-[#555] bg-[#0a0a0f] px-2 py-1 rounded border border-[#1a1a2e]",children:o},g))})]})]})}const q2=new Set(["bypassPermissions","dontAsk","acceptEdits","plan","auto"]);function G2({prompt:i,permissionMode:r,onApprove:a,onReject:o}){const[g,x]=F.useState(!1);return r&&r!=="default"&&q2.has(r)?O.jsx("div",{className:"flex items-center gap-2 px-4 py-2 bg-[#003322]/50 border border-[#00ff88]/30 rounded-lg text-sm",children:O.jsxs("span",{className:"text-[#00ff88] font-semibold text-xs uppercase tracking-wider",children:["AUTO-APPROVED (",r,")"]})}):O.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-[#ffaa00]/40 rounded-lg",children:[O.jsxs("div",{className:"flex items-center gap-3 sm:gap-2 min-w-0",children:[O.jsx("span",{className:"text-[#ffaa00] text-lg shrink-0",children:"⚠"}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("div",{className:"text-xs text-[#ffaa00] font-semibold uppercase tracking-wider mb-0.5",children:"Permission Required"}),O.jsxs("div",{className:`text-sm text-[#e0e0e0] font-mono cursor-pointer ${g?"":"truncate"}`,onClick:()=>x(!g),title:g?void 0:"Click to expand",children:[i,!g&&i.length>60&&O.jsx("span",{className:"text-[#888] ml-1",children:"..."})]})]})]}),O.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[O.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#00ff88] border border-[#00ff88]/30 transition-colors",children:"Approve"}),O.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ff3366] border border-[#ff3366]/30 transition-colors",children:"Reject"})]})]})}const W2=[{id:"transcript",label:"Transcript"},{id:"terminal",label:"Terminal"},{id:"metrics",label:"Metrics"}];function Y2(){const{id:i}=xp(),r=ul(),[a,o]=F.useState("transcript"),{session:g,health:x,notFound:T,loading:c,metrics:h,metricsLoading:u}=s2(i??""),[y,m]=F.useState(""),[C,w]=F.useState(!1),E=F.useRef(null),b=F.useRef(!1),d=Xs(I=>I.addToast);if(c)return O.jsx("div",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center text-[#555] text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading session…"})});if(T||!g||!x)return O.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-[#555]",children:[O.jsx("div",{className:"text-6xl mb-4",children:"404"}),O.jsx("div",{className:"text-lg mb-6 text-[#e0e0e0]",children:"Session not found"}),O.jsx(Hi,{to:"/",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Overview"})]});const p=g,f=x,v=f.status==="permission_prompt"||f.status==="bash_approval";function S(){mv(p.id).catch(I=>d("error","Approve failed",I instanceof Error?I.message:void 0))}function R(){DE(p.id).catch(I=>d("error","Reject failed",I instanceof Error?I.message:void 0))}function D(){pv(p.id).catch(I=>d("error","Interrupt failed",I instanceof Error?I.message:void 0))}function M(){kE(p.id).catch(I=>d("error","Escape failed",I instanceof Error?I.message:void 0))}async function A(){try{await _v(p.id),r("/")}catch(I){d("error","Failed to kill session",I instanceof Error?I.message:void 0)}}async function B(){var q;const I=y.trim();if(I&&!b.current){b.current=!0,w(!0);try{await RE(p.id,I),m("")}catch(P){d("error","Failed to send message",P instanceof Error?P.message:void 0)}finally{w(!1),b.current=!1,(q=E.current)==null||q.focus()}}}function $(I){I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),B())}return O.jsx("div",{className:"min-h-screen bg-[#0a0a0f]",children:O.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:[O.jsxs("nav",{className:"text-xs text-[#555] flex items-center gap-1",children:[O.jsx(Hi,{to:"/",className:"hover:text-[#00e5ff] transition-colors",children:"Overview"}),O.jsx("span",{className:"text-[#333]",children:"/"}),O.jsx("span",{className:"text-[#e0e0e0] truncate max-w-[160px] sm:max-w-xs",children:p.windowName||p.id})]}),O.jsx(n2,{session:p,health:f,onApprove:S,onReject:R,onInterrupt:D,onKill:A}),O.jsx("div",{className:"flex border-b border-[#1a1a2e]",role:"tablist",children:W2.map(I=>O.jsxs("button",{id:`tab-${I.id}`,onClick:()=>o(I.id),role:"tab","aria-selected":a===I.id,"aria-controls":`panel-${I.id}`,tabIndex:a===I.id?0:-1,className:`flex-1 min-h-[44px] text-sm font-medium transition-colors relative ${a===I.id?"text-[#00e5ff]":"text-[#555] hover:text-[#888]"}`,children:[I.label,a===I.id&&O.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-[#00e5ff]"})]},I.id))}),O.jsxs("div",{className:"bg-[#0a0a0f] rounded-lg min-h-[300px] sm:min-h-[400px]",children:[v&&O.jsx("div",{className:"p-3 sm:p-4 pb-0",children:O.jsx(G2,{sessionId:p.id,prompt:f.details,permissionMode:p.permissionMode,onApprove:S,onReject:R})}),a==="transcript"&&O.jsx("div",{id:"panel-transcript",role:"tabpanel","aria-labelledby":"tab-transcript",tabIndex:0,className:"h-[calc(100vh-380px)] sm:h-[calc(100vh-420px)] min-h-[250px] sm:min-h-[300px]",children:O.jsx(B2,{sessionId:p.id})}),a==="terminal"&&O.jsx("div",{id:"panel-terminal",role:"tabpanel","aria-labelledby":"tab-terminal",tabIndex:0,children:O.jsx(F2,{sessionId:p.id,status:f.status})}),a==="metrics"&&O.jsx("div",{id:"panel-metrics",role:"tabpanel","aria-labelledby":"tab-metrics",tabIndex:0,className:"p-3 sm:p-4",children:O.jsx(Z2,{metrics:h,loading:u})})]}),O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx("input",{ref:E,type:"text",value:y,onChange:I=>m(I.target.value),onKeyDown:$,placeholder:"Send a message to Claude…",disabled:C||!f.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"}),O.jsx("button",{onClick:B,disabled:C||!y.trim()||!f.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:O.jsx(eb,{className:"h-4 w-4"})})]}),O.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#1a1a2e]/50",children:[O.jsxs("button",{onClick:D,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:[O.jsx(GS,{className:"h-3.5 w-3.5"}),"Interrupt"]}),O.jsxs("button",{onClick:M,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:[O.jsx(jS,{className:"h-3.5 w-3.5"}),"Escape"]})]})]})]})})}const V2={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"},K2=new Set(["running"]);function wv({status:i}){const r=V2[i]??"bg-gray-500/10 text-gray-500 border-gray-500/30",a=K2.has(i);return O.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&&O.jsxs("span",{className:"relative flex h-2 w-2",children:[O.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 bg-current"}),O.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]}),i]})}let X2=0;function pa(){return{workDir:"",name:"",prompt:"",_key:X2++}}function J2({open:i,onClose:r}){const a=ul(),o=F.useRef(null),g=F.useRef(null),[x,T]=F.useState(""),[c,h]=F.useState([pa(),pa()]),[u,y]=F.useState(!1),[m,C]=F.useState(null),w=F.useCallback(()=>{E(),r()},[r]);function E(){T(""),h([pa(),pa()]),y(!1),C(null)}F.useEffect(()=>{if(!i)return;const S=R=>{R.key==="Escape"&&w()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[i,w]),F.useEffect(()=>{if(!i)return;const S=o.current;if(!S)return;const R='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',D=M=>{if(M.key!=="Tab")return;const A=Array.from(S.querySelectorAll(R));if(A.length===0)return;const B=A[0],$=A[A.length-1];M.shiftKey?document.activeElement===B&&(M.preventDefault(),$.focus()):document.activeElement===$&&(M.preventDefault(),B.focus())};return S.addEventListener("keydown",D),()=>S.removeEventListener("keydown",D)},[i]),F.useEffect(()=>{if(i){const S=setTimeout(()=>{var R;return(R=g.current)==null?void 0:R.focus()},50);return()=>clearTimeout(S)}},[i]);function b(){c.length>=10||h([...c,pa()])}function d(S){c.length<=1||h(c.filter((R,D)=>D!==S))}function p(S,R,D){h(c.map((M,A)=>A===S?{...M,[R]:D}:M))}async function f(S){S.preventDefault(),C(null);const R=c.filter(D=>D.workDir.trim());if(!x.trim()){C("Pipeline name is required");return}if(R.length===0){C("At least one step with a working directory is required");return}y(!0);try{const D=await NE({name:x.trim(),workDir:R[0].workDir.trim(),stages:R.map(M=>({workDir:M.workDir.trim(),name:M.name.trim()||void 0,prompt:M.prompt.trim()||void 0}))});E(),r(),a(`/pipelines/${D.id}`)}catch(D){C(D instanceof Error?D.message:"Failed to create pipeline")}finally{y(!1)}}if(!i)return null;const v=x.trim()&&c.some(S=>S.workDir.trim());return O.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[O.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:w}),O.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:[O.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[O.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Pipeline"}),O.jsx("button",{onClick:w,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:O.jsx(dl,{className:"h-4 w-4"})})]}),O.jsxs("form",{onSubmit:f,className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{children:[O.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Pipeline Name ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("input",{type:"text",ref:g,value:x,onChange:S=>T(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-[#00e5ff]"})]}),O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[O.jsxs("span",{children:["Working Directory ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("span",{children:"Name"}),O.jsx("span",{children:"Prompt"}),O.jsx("span",{})]}),O.jsx("div",{className:"space-y-2",children:c.map((S,R)=>O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[O.jsx("input",{type:"text",value:S.workDir,onChange:D=>p(R,"workDir",D.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-[#00e5ff] font-mono"}),O.jsx("input",{type:"text",value:S.name,onChange:D=>p(R,"name",D.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-[#00e5ff]"}),O.jsx("input",{type:"text",value:S.prompt,onChange:D=>p(R,"prompt",D.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-[#00e5ff]"}),O.jsx("button",{type:"button",onClick:()=>d(R),disabled:c.length<=1,"aria-label":`Remove step ${R+1}`,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ff3366] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:O.jsx(Np,{className:"h-3.5 w-3.5"})})]},S._key))}),c.length<10&&O.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[O.jsx(fl,{className:"h-3.5 w-3.5"}),"Add Step"]}),m&&O.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:m}),O.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[O.jsx("button",{type:"button",onClick:w,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"}),O.jsxs("button",{type:"submit",disabled:u||!v,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:[u&&O.jsx(Ju,{className:"h-3 w-3 animate-spin"}),"Create Pipeline"]})]})]})]})]})}function Q2(){const[i,r]=F.useState([]),[a,o]=F.useState(!0),[g,x]=F.useState(!1),T=Xs(u=>u.addToast),c=F.useCallback(async()=>{try{const u=await BE();r(u)}catch(u){T("error","Failed to fetch pipelines",u instanceof Error?u.message:void 0)}finally{o(!1)}},[T]);F.useEffect(()=>{c();const u=setInterval(c,5e3);return()=>clearInterval(u)},[c]);const h={total:i.length,running:i.filter(u=>u.status==="running").length,completed:i.filter(u=>u.status==="completed").length,failed:i.filter(u=>u.status==="failed").length};return a?O.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading pipelines…"})}):O.jsxs("div",{className:"flex flex-col gap-6",children:[O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{children:[O.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Pipelines"}),O.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage and monitor session pipelines"})]}),O.jsxs("button",{onClick:()=>x(!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:[O.jsx(fl,{className:"h-3.5 w-3.5"}),"New Pipeline"]})]}),O.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[O.jsx(qs,{label:"Total",value:h.total}),O.jsx(qs,{label:"Running",value:h.running}),O.jsx(qs,{label:"Completed",value:h.completed}),O.jsx(qs,{label:"Failed",value:h.failed})]}),i.length===0?O.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:[O.jsx("p",{className:"text-gray-500",children:"No pipelines yet"}),O.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"Create a pipeline to run sessions in sequence"})]}):O.jsx("div",{className:"space-y-3",children:i.map(u=>O.jsx(Hi,{to:`/pipelines/${u.id}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 hover:border-[#00e5ff]/30 transition-colors",children:O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[O.jsx("span",{className:"font-medium text-gray-200 truncate",children:u.name}),O.jsx(wv,{status:u.status})]}),O.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 shrink-0 ml-4",children:[O.jsxs("span",{children:[u.stages.length," step",u.stages.length!==1?"s":""]}),O.jsx("span",{children:sn(u.createdAt)})]})]})},u.id))}),O.jsx(J2,{open:g,onClose:()=>x(!1)})]})}function eT(){const{id:i}=xp(),[r,a]=F.useState(null),[o,g]=F.useState(!0),[x,T]=F.useState(!1),c=Xs(u=>u.addToast),h=F.useCallback(async()=>{if(i)try{const u=await zE(i);a(u),T(!1)}catch(u){const y=u;y.statusCode===404?T(!0):c("error","Failed to fetch pipeline",y.message)}finally{g(!1)}},[i,c]);return F.useEffect(()=>{h();const u=setInterval(h,3e3);return()=>clearInterval(u)},[h]),o?O.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading pipeline…"})}):x||!r?O.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] text-gray-500",children:[O.jsx("div",{className:"text-6xl mb-4",children:"404"}),O.jsx("div",{className:"text-lg mb-6 text-gray-200",children:"Pipeline not found"}),O.jsx(Hi,{to:"/pipelines",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Pipelines"})]}):O.jsxs("div",{className:"flex flex-col gap-6",children:[O.jsxs("nav",{className:"text-xs text-gray-500 flex items-center gap-1",children:[O.jsx(Hi,{to:"/pipelines",className:"hover:text-[#00e5ff] transition-colors",children:"Pipelines"}),O.jsx("span",{className:"text-gray-700",children:"/"}),O.jsx("span",{className:"text-gray-200 truncate max-w-xs",children:r.name})]}),O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:r.name}),O.jsx(wv,{status:r.status})]}),O.jsxs("div",{className:"text-xs text-gray-500",children:["Created ",sn(r.createdAt)]})]}),O.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118]",children:[O.jsx("div",{className:"px-4 py-3 border-b border-void-lighter",children:O.jsxs("h3",{className:"text-sm font-semibold text-gray-200",children:["Steps (",r.stages.length,")"]})}),r.stages.length===0?O.jsx("div",{className:"p-8 text-center text-gray-500 text-sm",children:"No steps yet"}):O.jsxs("table",{className:"w-full text-left text-sm",children:[O.jsx("thead",{children:O.jsxs("tr",{className:"border-b border-void-lighter text-gray-600",children:[O.jsx("th",{className:"px-4 py-3 font-medium w-16",children:"#"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Session"})]})}),O.jsx("tbody",{children:r.stages.map((u,y)=>O.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[O.jsxs("td",{className:"px-4 py-3 text-gray-500 font-mono text-xs",children:["#",y+1]}),O.jsx("td",{className:"px-4 py-3",children:O.jsx(ll,{status:u.status})}),O.jsx("td",{className:"px-4 py-3",children:u.sessionId?O.jsx(Hi,{to:`/sessions/${encodeURIComponent(u.sessionId)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:u.name}):O.jsx("span",{className:"font-medium text-gray-200",children:u.name})}),O.jsx("td",{className:"px-4 py-3 font-mono text-xs text-gray-400",children:u.sessionId??"—"})]},u.name))})]})]})]})}function tT(){return O.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 text-center",children:[O.jsx("h1",{className:"text-6xl font-bold text-gray-500",children:"404"}),O.jsx("p",{className:"text-lg text-gray-400",children:"Page not found"}),O.jsx(Hi,{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 iT(){return O.jsx(wS,{children:O.jsx(qy,{children:O.jsxs(pr,{element:O.jsx(qE,{}),children:[O.jsx(pr,{path:"/",element:O.jsx(i2,{})}),O.jsx(pr,{path:"/sessions/:id",element:O.jsx(Y2,{})}),O.jsx(pr,{path:"/pipelines",element:O.jsx(Q2,{})}),O.jsx(pr,{path:"/pipelines/:id",element:O.jsx(eT,{})}),O.jsx(pr,{path:"*",element:O.jsx(tT,{})})]})})})}q0.createRoot(document.getElementById("root")).render(O.jsx(va.StrictMode,{children:O.jsx(mS,{basename:"/dashboard",children:O.jsx(iT,{})})}));
|