@qodalis/cli-server-plugin-admin 1.0.0-beta.6 → 1.0.0-beta.7
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/README.md +3 -1
- package/dashboard/assets/index-BAmUWZCS.js +242 -0
- package/dashboard/assets/index-BF7ofZj2.css +32 -0
- package/dashboard/assets/wasm/qodalis_cli_wasm_bg.wasm +0 -0
- package/dashboard/index.html +2 -2
- package/dist/cli-admin-builder.d.ts +0 -7
- package/dist/cli-admin-builder.d.ts.map +1 -1
- package/dist/cli-admin-builder.js +2 -37
- package/dist/cli-admin-builder.js.map +1 -1
- package/dist/services/dashboard-dir.d.ts +10 -0
- package/dist/services/dashboard-dir.d.ts.map +1 -0
- package/dist/services/dashboard-dir.js +51 -0
- package/dist/services/dashboard-dir.js.map +1 -0
- package/dist/services/log-ring-buffer.d.ts +2 -0
- package/dist/services/log-ring-buffer.d.ts.map +1 -1
- package/dist/services/log-ring-buffer.js +12 -0
- package/dist/services/log-ring-buffer.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -3
- package/dashboard/assets/index-B5szolha.js +0 -200
- package/dashboard/assets/index-Co1BkfeM.css +0 -32
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
var Wd=Object.defineProperty;var qd=(e,t,r)=>t in e?Wd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ua=(e,t,r)=>qd(e,typeof t!="symbol"?t+"":t,r);function _mergeNamespaces(e,t){for(var r=0;r<t.length;r++){const s=t[r];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const u=Object.getOwnPropertyDescriptor(s,o);u&&Object.defineProperty(e,o,u.get?u:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function r(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=r(o);fetch(o.href,u)}})();function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var hasRequiredReact_production_min;function requireReact_production_min(){if(hasRequiredReact_production_min)return react_production_min;hasRequiredReact_production_min=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),d=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),h=Symbol.iterator;function j(Q){return Q===null||typeof Q!="object"?null:(Q=h&&Q[h]||Q["@@iterator"],typeof Q=="function"?Q:null)}var U={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},W=Object.assign,H={};function x(Q,se,Ce){this.props=Q,this.context=se,this.refs=H,this.updater=Ce||U}x.prototype.isReactComponent={},x.prototype.setState=function(Q,se){if(typeof Q!="object"&&typeof Q!="function"&&Q!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Q,se,"setState")},x.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")};function L(){}L.prototype=x.prototype;function R(Q,se,Ce){this.props=Q,this.context=se,this.refs=H,this.updater=Ce||U}var N=R.prototype=new L;N.constructor=R,W(N,x.prototype),N.isPureReactComponent=!0;var V=Array.isArray,J=Object.prototype.hasOwnProperty,Y={current:null},Z={key:!0,ref:!0,__self:!0,__source:!0};function K(Q,se,Ce){var we,Be={},Re=null,de=null;if(se!=null)for(we in se.ref!==void 0&&(de=se.ref),se.key!==void 0&&(Re=""+se.key),se)J.call(se,we)&&!Z.hasOwnProperty(we)&&(Be[we]=se[we]);var ie=arguments.length-2;if(ie===1)Be.children=Ce;else if(1<ie){for(var De=Array(ie),be=0;be<ie;be++)De[be]=arguments[be+2];Be.children=De}if(Q&&Q.defaultProps)for(we in ie=Q.defaultProps,ie)Be[we]===void 0&&(Be[we]=ie[we]);return{$$typeof:e,type:Q,key:Re,ref:de,props:Be,_owner:Y.current}}function ee(Q,se){return{$$typeof:e,type:Q.type,key:se,ref:Q.ref,props:Q.props,_owner:Q._owner}}function oe(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===e}function ce(Q){var se={"=":"=0",":":"=2"};return"$"+Q.replace(/[=:]/g,function(Ce){return se[Ce]})}var le=/\/+/g;function ne(Q,se){return typeof Q=="object"&&Q!==null&&Q.key!=null?ce(""+Q.key):se.toString(36)}function ae(Q,se,Ce,we,Be){var Re=typeof Q;(Re==="undefined"||Re==="boolean")&&(Q=null);var de=!1;if(Q===null)de=!0;else switch(Re){case"string":case"number":de=!0;break;case"object":switch(Q.$$typeof){case e:case t:de=!0}}if(de)return de=Q,Be=Be(de),Q=we===""?"."+ne(de,0):we,V(Be)?(Ce="",Q!=null&&(Ce=Q.replace(le,"$&/")+"/"),ae(Be,se,Ce,"",function(be){return be})):Be!=null&&(oe(Be)&&(Be=ee(Be,Ce+(!Be.key||de&&de.key===Be.key?"":(""+Be.key).replace(le,"$&/")+"/")+Q)),se.push(Be)),1;if(de=0,we=we===""?".":we+":",V(Q))for(var ie=0;ie<Q.length;ie++){Re=Q[ie];var De=we+ne(Re,ie);de+=ae(Re,se,Ce,De,Be)}else if(De=j(Q),typeof De=="function")for(Q=De.call(Q),ie=0;!(Re=Q.next()).done;)Re=Re.value,De=we+ne(Re,ie++),de+=ae(Re,se,Ce,De,Be);else if(Re==="object")throw se=String(Q),Error("Objects are not valid as a React child (found: "+(se==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":se)+"). If you meant to render a collection of children, use an array instead.");return de}function _e(Q,se,Ce){if(Q==null)return Q;var we=[],Be=0;return ae(Q,we,"","",function(Re){return se.call(Ce,Re,Be++)}),we}function fe(Q){if(Q._status===-1){var se=Q._result;se=se(),se.then(function(Ce){(Q._status===0||Q._status===-1)&&(Q._status=1,Q._result=Ce)},function(Ce){(Q._status===0||Q._status===-1)&&(Q._status=2,Q._result=Ce)}),Q._status===-1&&(Q._status=0,Q._result=se)}if(Q._status===1)return Q._result.default;throw Q._result}var ge={current:null},he={transition:null},X={ReactCurrentDispatcher:ge,ReactCurrentBatchConfig:he,ReactCurrentOwner:Y};function re(){throw Error("act(...) is not supported in production builds of React.")}return react_production_min.Children={map:_e,forEach:function(Q,se,Ce){_e(Q,function(){se.apply(this,arguments)},Ce)},count:function(Q){var se=0;return _e(Q,function(){se++}),se},toArray:function(Q){return _e(Q,function(se){return se})||[]},only:function(Q){if(!oe(Q))throw Error("React.Children.only expected to receive a single React element child.");return Q}},react_production_min.Component=x,react_production_min.Fragment=r,react_production_min.Profiler=o,react_production_min.PureComponent=R,react_production_min.StrictMode=s,react_production_min.Suspense=l,react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,react_production_min.act=re,react_production_min.cloneElement=function(Q,se,Ce){if(Q==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Q+".");var we=W({},Q.props),Be=Q.key,Re=Q.ref,de=Q._owner;if(se!=null){if(se.ref!==void 0&&(Re=se.ref,de=Y.current),se.key!==void 0&&(Be=""+se.key),Q.type&&Q.type.defaultProps)var ie=Q.type.defaultProps;for(De in se)J.call(se,De)&&!Z.hasOwnProperty(De)&&(we[De]=se[De]===void 0&&ie!==void 0?ie[De]:se[De])}var De=arguments.length-2;if(De===1)we.children=Ce;else if(1<De){ie=Array(De);for(var be=0;be<De;be++)ie[be]=arguments[be+2];we.children=ie}return{$$typeof:e,type:Q.type,key:Be,ref:Re,props:we,_owner:de}},react_production_min.createContext=function(Q){return Q={$$typeof:d,_currentValue:Q,_currentValue2:Q,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Q.Provider={$$typeof:u,_context:Q},Q.Consumer=Q},react_production_min.createElement=K,react_production_min.createFactory=function(Q){var se=K.bind(null,Q);return se.type=Q,se},react_production_min.createRef=function(){return{current:null}},react_production_min.forwardRef=function(Q){return{$$typeof:a,render:Q}},react_production_min.isValidElement=oe,react_production_min.lazy=function(Q){return{$$typeof:C,_payload:{_status:-1,_result:Q},_init:fe}},react_production_min.memo=function(Q,se){return{$$typeof:f,type:Q,compare:se===void 0?null:se}},react_production_min.startTransition=function(Q){var se=he.transition;he.transition={};try{Q()}finally{he.transition=se}},react_production_min.unstable_act=re,react_production_min.useCallback=function(Q,se){return ge.current.useCallback(Q,se)},react_production_min.useContext=function(Q){return ge.current.useContext(Q)},react_production_min.useDebugValue=function(){},react_production_min.useDeferredValue=function(Q){return ge.current.useDeferredValue(Q)},react_production_min.useEffect=function(Q,se){return ge.current.useEffect(Q,se)},react_production_min.useId=function(){return ge.current.useId()},react_production_min.useImperativeHandle=function(Q,se,Ce){return ge.current.useImperativeHandle(Q,se,Ce)},react_production_min.useInsertionEffect=function(Q,se){return ge.current.useInsertionEffect(Q,se)},react_production_min.useLayoutEffect=function(Q,se){return ge.current.useLayoutEffect(Q,se)},react_production_min.useMemo=function(Q,se){return ge.current.useMemo(Q,se)},react_production_min.useReducer=function(Q,se,Ce){return ge.current.useReducer(Q,se,Ce)},react_production_min.useRef=function(Q){return ge.current.useRef(Q)},react_production_min.useState=function(Q){return ge.current.useState(Q)},react_production_min.useSyncExternalStore=function(Q,se,Ce){return ge.current.useSyncExternalStore(Q,se,Ce)},react_production_min.useTransition=function(){return ge.current.useTransition()},react_production_min.version="18.3.1",react_production_min}var hasRequiredReact;function requireReact(){return hasRequiredReact||(hasRequiredReact=1,react.exports=requireReact_production_min()),react.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var hasRequiredReactJsxRuntime_production_min;function requireReactJsxRuntime_production_min(){if(hasRequiredReactJsxRuntime_production_min)return reactJsxRuntime_production_min;hasRequiredReactJsxRuntime_production_min=1;var e=requireReact(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function d(a,l,f){var C,h={},j=null,U=null;f!==void 0&&(j=""+f),l.key!==void 0&&(j=""+l.key),l.ref!==void 0&&(U=l.ref);for(C in l)s.call(l,C)&&!u.hasOwnProperty(C)&&(h[C]=l[C]);if(a&&a.defaultProps)for(C in l=a.defaultProps,l)h[C]===void 0&&(h[C]=l[C]);return{$$typeof:t,type:a,key:j,ref:U,props:h,_owner:o.current}}return reactJsxRuntime_production_min.Fragment=r,reactJsxRuntime_production_min.jsx=d,reactJsxRuntime_production_min.jsxs=d,reactJsxRuntime_production_min}var hasRequiredJsxRuntime;function requireJsxRuntime(){return hasRequiredJsxRuntime||(hasRequiredJsxRuntime=1,jsxRuntime.exports=requireReactJsxRuntime_production_min()),jsxRuntime.exports}var jsxRuntimeExports=requireJsxRuntime(),reactExports=requireReact();const React3=getDefaultExportFromCjs(reactExports),React=_mergeNamespaces({__proto__:null,default:React3},[reactExports]);var client={},reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var hasRequiredScheduler_production_min;function requireScheduler_production_min(){return hasRequiredScheduler_production_min||(hasRequiredScheduler_production_min=1,(function(e){function t(he,X){var re=he.length;he.push(X);e:for(;0<re;){var Q=re-1>>>1,se=he[Q];if(0<o(se,X))he[Q]=X,he[re]=se,re=Q;else break e}}function r(he){return he.length===0?null:he[0]}function s(he){if(he.length===0)return null;var X=he[0],re=he.pop();if(re!==X){he[0]=re;e:for(var Q=0,se=he.length,Ce=se>>>1;Q<Ce;){var we=2*(Q+1)-1,Be=he[we],Re=we+1,de=he[Re];if(0>o(Be,re))Re<se&&0>o(de,Be)?(he[Q]=de,he[Re]=re,Q=Re):(he[Q]=Be,he[we]=re,Q=we);else if(Re<se&&0>o(de,re))he[Q]=de,he[Re]=re,Q=Re;else break e}}return X}function o(he,X){var re=he.sortIndex-X.sortIndex;return re!==0?re:he.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,a=d.now();e.unstable_now=function(){return d.now()-a}}var l=[],f=[],C=1,h=null,j=3,U=!1,W=!1,H=!1,x=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(he){for(var X=r(f);X!==null;){if(X.callback===null)s(f);else if(X.startTime<=he)s(f),X.sortIndex=X.expirationTime,t(l,X);else break;X=r(f)}}function V(he){if(H=!1,N(he),!W)if(r(l)!==null)W=!0,fe(J);else{var X=r(f);X!==null&&ge(V,X.startTime-he)}}function J(he,X){W=!1,H&&(H=!1,L(K),K=-1),U=!0;var re=j;try{for(N(X),h=r(l);h!==null&&(!(h.expirationTime>X)||he&&!ce());){var Q=h.callback;if(typeof Q=="function"){h.callback=null,j=h.priorityLevel;var se=Q(h.expirationTime<=X);X=e.unstable_now(),typeof se=="function"?h.callback=se:h===r(l)&&s(l),N(X)}else s(l);h=r(l)}if(h!==null)var Ce=!0;else{var we=r(f);we!==null&&ge(V,we.startTime-X),Ce=!1}return Ce}finally{h=null,j=re,U=!1}}var Y=!1,Z=null,K=-1,ee=5,oe=-1;function ce(){return!(e.unstable_now()-oe<ee)}function le(){if(Z!==null){var he=e.unstable_now();oe=he;var X=!0;try{X=Z(!0,he)}finally{X?ne():(Y=!1,Z=null)}}else Y=!1}var ne;if(typeof R=="function")ne=function(){R(le)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,_e=ae.port2;ae.port1.onmessage=le,ne=function(){_e.postMessage(null)}}else ne=function(){x(le,0)};function fe(he){Z=he,Y||(Y=!0,ne())}function ge(he,X){K=x(function(){he(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(he){he.callback=null},e.unstable_continueExecution=function(){W||U||(W=!0,fe(J))},e.unstable_forceFrameRate=function(he){0>he||125<he?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<he?Math.floor(1e3/he):5},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function(he){switch(j){case 1:case 2:case 3:var X=3;break;default:X=j}var re=j;j=X;try{return he()}finally{j=re}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(he,X){switch(he){case 1:case 2:case 3:case 4:case 5:break;default:he=3}var re=j;j=he;try{return X()}finally{j=re}},e.unstable_scheduleCallback=function(he,X,re){var Q=e.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?Q+re:Q):re=Q,he){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=re+se,he={id:C++,callback:X,priorityLevel:he,startTime:re,expirationTime:se,sortIndex:-1},re>Q?(he.sortIndex=re,t(f,he),r(l)===null&&he===r(f)&&(H?(L(K),K=-1):H=!0,ge(V,re-Q))):(he.sortIndex=se,t(l,he),W||U||(W=!0,fe(J))),he},e.unstable_shouldYield=ce,e.unstable_wrapCallback=function(he){var X=j;return function(){var re=j;j=X;try{return he.apply(this,arguments)}finally{j=re}}}})(scheduler_production_min)),scheduler_production_min}var hasRequiredScheduler;function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,scheduler.exports=requireScheduler_production_min()),scheduler.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var hasRequiredReactDom_production_min;function requireReactDom_production_min(){if(hasRequiredReactDom_production_min)return reactDom_production_min;hasRequiredReactDom_production_min=1;var e=requireReact(),t=requireScheduler();function r(i){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+i,c=1;c<arguments.length;c++)n+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+i+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function u(i,n){d(i,n),d(i+"Capture",n)}function d(i,n){for(o[i]=n,i=0;i<n.length;i++)s.add(n[i])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),l=Object.prototype.hasOwnProperty,f=/^[: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]*$/,C={},h={};function j(i){return l.call(h,i)?!0:l.call(C,i)?!1:f.test(i)?h[i]=!0:(C[i]=!0,!1)}function U(i,n,c,P){if(c!==null&&c.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return P?!1:c!==null?!c.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function W(i,n,c,P){if(n===null||typeof n>"u"||U(i,n,c,P))return!0;if(P)return!1;if(c!==null)switch(c.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function H(i,n,c,P,q,G,te){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=P,this.attributeNamespace=q,this.mustUseProperty=c,this.propertyName=i,this.type=n,this.sanitizeURL=G,this.removeEmptyString=te}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){x[i]=new H(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var n=i[0];x[n]=new H(n,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){x[i]=new H(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){x[i]=new H(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){x[i]=new H(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){x[i]=new H(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){x[i]=new H(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){x[i]=new H(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){x[i]=new H(i,5,!1,i.toLowerCase(),null,!1,!1)});var L=/[\-:]([a-z])/g;function R(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var n=i.replace(L,R);x[n]=new H(n,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var n=i.replace(L,R);x[n]=new H(n,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var n=i.replace(L,R);x[n]=new H(n,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){x[i]=new H(i,1,!1,i.toLowerCase(),null,!1,!1)}),x.xlinkHref=new H("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){x[i]=new H(i,1,!1,i.toLowerCase(),null,!0,!0)});function N(i,n,c,P){var q=x.hasOwnProperty(n)?x[n]:null;(q!==null?q.type!==0:P||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(W(n,c,q,P)&&(c=null),P||q===null?j(n)&&(c===null?i.removeAttribute(n):i.setAttribute(n,""+c)):q.mustUseProperty?i[q.propertyName]=c===null?q.type===3?!1:"":c:(n=q.attributeName,P=q.attributeNamespace,c===null?i.removeAttribute(n):(q=q.type,c=q===3||q===4&&c===!0?"":""+c,P?i.setAttributeNS(P,n,c):i.setAttribute(n,c))))}var V=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,J=Symbol.for("react.element"),Y=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),oe=Symbol.for("react.provider"),ce=Symbol.for("react.context"),le=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),_e=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),ge=Symbol.for("react.offscreen"),he=Symbol.iterator;function X(i){return i===null||typeof i!="object"?null:(i=he&&i[he]||i["@@iterator"],typeof i=="function"?i:null)}var re=Object.assign,Q;function se(i){if(Q===void 0)try{throw Error()}catch(c){var n=c.stack.trim().match(/\n( *(at )?)/);Q=n&&n[1]||""}return`
|
|
34
|
-
`+Q+i}var Ce=!1;function we(i,n){if(!i||Ce)return"";Ce=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(ye){var P=ye}Reflect.construct(i,[],n)}else{try{n.call()}catch(ye){P=ye}i.call(n.prototype)}else{try{throw Error()}catch(ye){P=ye}i()}}catch(ye){if(ye&&P&&typeof ye.stack=="string"){for(var q=ye.stack.split(`
|
|
35
|
-
`),G=P.stack.split(`
|
|
36
|
-
`),te=q.length-1,ue=G.length-1;1<=te&&0<=ue&&q[te]!==G[ue];)ue--;for(;1<=te&&0<=ue;te--,ue--)if(q[te]!==G[ue]){if(te!==1||ue!==1)do if(te--,ue--,0>ue||q[te]!==G[ue]){var pe=`
|
|
37
|
-
`+q[te].replace(" at new "," at ");return i.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",i.displayName)),pe}while(1<=te&&0<=ue);break}}}finally{Ce=!1,Error.prepareStackTrace=c}return(i=i?i.displayName||i.name:"")?se(i):""}function Be(i){switch(i.tag){case 5:return se(i.type);case 16:return se("Lazy");case 13:return se("Suspense");case 19:return se("SuspenseList");case 0:case 2:case 15:return i=we(i.type,!1),i;case 11:return i=we(i.type.render,!1),i;case 1:return i=we(i.type,!0),i;default:return""}}function Re(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case Z:return"Fragment";case Y:return"Portal";case ee:return"Profiler";case K:return"StrictMode";case ne:return"Suspense";case ae:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case ce:return(i.displayName||"Context")+".Consumer";case oe:return(i._context.displayName||"Context")+".Provider";case le:var n=i.render;return i=i.displayName,i||(i=n.displayName||n.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case _e:return n=i.displayName||null,n!==null?n:Re(i.type)||"Memo";case fe:n=i._payload,i=i._init;try{return Re(i(n))}catch{}}return null}function de(i){var n=i.type;switch(i.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=n.render,i=i.displayName||i.name||"",n.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Re(n);case 8:return n===K?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function ie(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function De(i){var n=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function be(i){var n=De(i)?"checked":"value",c=Object.getOwnPropertyDescriptor(i.constructor.prototype,n),P=""+i[n];if(!i.hasOwnProperty(n)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var q=c.get,G=c.set;return Object.defineProperty(i,n,{configurable:!0,get:function(){return q.call(this)},set:function(te){P=""+te,G.call(this,te)}}),Object.defineProperty(i,n,{enumerable:c.enumerable}),{getValue:function(){return P},setValue:function(te){P=""+te},stopTracking:function(){i._valueTracker=null,delete i[n]}}}}function Te(i){i._valueTracker||(i._valueTracker=be(i))}function Pe(i){if(!i)return!1;var n=i._valueTracker;if(!n)return!0;var c=n.getValue(),P="";return i&&(P=De(i)?i.checked?"true":"false":i.value),i=P,i!==c?(n.setValue(i),!0):!1}function Je(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Ie(i,n){var c=n.checked;return re({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:c??i._wrapperState.initialChecked})}function We(i,n){var c=n.defaultValue==null?"":n.defaultValue,P=n.checked!=null?n.checked:n.defaultChecked;c=ie(n.value!=null?n.value:c),i._wrapperState={initialChecked:P,initialValue:c,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Xe(i,n){n=n.checked,n!=null&&N(i,"checked",n,!1)}function ze(i,n){Xe(i,n);var c=ie(n.value),P=n.type;if(c!=null)P==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+c):i.value!==""+c&&(i.value=""+c);else if(P==="submit"||P==="reset"){i.removeAttribute("value");return}n.hasOwnProperty("value")?cr(i,n.type,c):n.hasOwnProperty("defaultValue")&&cr(i,n.type,ie(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(i.defaultChecked=!!n.defaultChecked)}function At(i,n,c){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var P=n.type;if(!(P!=="submit"&&P!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+i._wrapperState.initialValue,c||n===i.value||(i.value=n),i.defaultValue=n}c=i.name,c!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,c!==""&&(i.name=c)}function cr(i,n,c){(n!=="number"||Je(i.ownerDocument)!==i)&&(c==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+c&&(i.defaultValue=""+c))}var $t=Array.isArray;function nt(i,n,c,P){if(i=i.options,n){n={};for(var q=0;q<c.length;q++)n["$"+c[q]]=!0;for(c=0;c<i.length;c++)q=n.hasOwnProperty("$"+i[c].value),i[c].selected!==q&&(i[c].selected=q),q&&P&&(i[c].defaultSelected=!0)}else{for(c=""+ie(c),n=null,q=0;q<i.length;q++){if(i[q].value===c){i[q].selected=!0,P&&(i[q].defaultSelected=!0);return}n!==null||i[q].disabled||(n=i[q])}n!==null&&(n.selected=!0)}}function dt(i,n){if(n.dangerouslySetInnerHTML!=null)throw Error(r(91));return re({},n,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function gt(i,n){var c=n.value;if(c==null){if(c=n.children,n=n.defaultValue,c!=null){if(n!=null)throw Error(r(92));if($t(c)){if(1<c.length)throw Error(r(93));c=c[0]}n=c}n==null&&(n=""),c=n}i._wrapperState={initialValue:ie(c)}}function Ot(i,n){var c=ie(n.value),P=ie(n.defaultValue);c!=null&&(c=""+c,c!==i.value&&(i.value=c),n.defaultValue==null&&i.defaultValue!==c&&(i.defaultValue=c)),P!=null&&(i.defaultValue=""+P)}function wt(i){var n=i.textContent;n===i._wrapperState.initialValue&&n!==""&&n!==null&&(i.value=n)}function vt(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function wr(i,n){return i==null||i==="http://www.w3.org/1999/xhtml"?vt(n):i==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var ut,Jt=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,c,P,q){MSApp.execUnsafeLocalFunction(function(){return i(n,c,P,q)})}:i})(function(i,n){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=n;else{for(ut=ut||document.createElement("div"),ut.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=ut.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;n.firstChild;)i.appendChild(n.firstChild)}});function yt(i,n){if(n){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=n;return}}i.textContent=n}var Nt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},it=["Webkit","ms","Moz","O"];Object.keys(Nt).forEach(function(i){it.forEach(function(n){n=n+i.charAt(0).toUpperCase()+i.substring(1),Nt[n]=Nt[i]})});function pi(i,n,c){return n==null||typeof n=="boolean"||n===""?"":c||typeof n!="number"||n===0||Nt.hasOwnProperty(i)&&Nt[i]?(""+n).trim():n+"px"}function Pi(i,n){i=i.style;for(var c in n)if(n.hasOwnProperty(c)){var P=c.indexOf("--")===0,q=pi(c,n[c],P);c==="float"&&(c="cssFloat"),P?i.setProperty(c,q):i[c]=q}}var Qs=re({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function dr(i,n){if(n){if(Qs[i]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(r(137,i));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(r(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(r(61))}if(n.style!=null&&typeof n.style!="object")throw Error(r(62))}}function Ti(i,n){if(i.indexOf("-")===-1)return typeof n.is=="string";switch(i){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 ji=null;function hr(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var cs=null,bt=null,Mr=null;function xr(i){if(i=$s(i)){if(typeof cs!="function")throw Error(r(280));var n=i.stateNode;n&&(n=yn(n),cs(i.stateNode,i.type,n))}}function tn(i){bt?Mr?Mr.push(i):Mr=[i]:bt=i}function ds(){if(bt){var i=bt,n=Mr;if(Mr=bt=null,xr(i),n)for(i=0;i<n.length;i++)xr(n[i])}}function rn(i,n){return i(n)}function Ur(){}var fi=!1;function kr(i,n,c){if(fi)return i(n,c);fi=!0;try{return rn(i,n,c)}finally{fi=!1,(bt!==null||Mr!==null)&&(Ur(),ds())}}function mi(i,n){var c=i.stateNode;if(c===null)return null;var P=yn(c);if(P===null)return null;c=P[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(P=!P.disabled)||(i=i.type,P=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!P;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,n,typeof c));return c}var gi=!1;if(a)try{var vi={};Object.defineProperty(vi,"passive",{get:function(){gi=!0}}),window.addEventListener("test",vi,vi),window.removeEventListener("test",vi,vi)}catch{gi=!1}function zr(i,n,c,P,q,G,te,ue,pe){var ye=Array.prototype.slice.call(arguments,3);try{n.apply(c,ye)}catch(ke){this.onError(ke)}}var Ci=!1,Hr=null,Er=!1,_i=null,wi={onError:function(i){Ci=!0,Hr=i}};function hs(i,n,c,P,q,G,te,ue,pe){Ci=!1,Hr=null,zr.apply(wi,arguments)}function ps(i,n,c,P,q,G,te,ue,pe){if(hs.apply(this,arguments),Ci){if(Ci){var ye=Hr;Ci=!1,Hr=null}else throw Error(r(198));Er||(Er=!0,_i=ye)}}function tr(i){var n=i,c=i;if(i.alternate)for(;n.return;)n=n.return;else{i=n;do n=i,(n.flags&4098)!==0&&(c=n.return),i=n.return;while(i)}return n.tag===3?c:null}function yr(i){if(i.tag===13){var n=i.memoizedState;if(n===null&&(i=i.alternate,i!==null&&(n=i.memoizedState)),n!==null)return n.dehydrated}return null}function $i(i){if(tr(i)!==i)throw Error(r(188))}function Wr(i){var n=i.alternate;if(!n){if(n=tr(i),n===null)throw Error(r(188));return n!==i?null:i}for(var c=i,P=n;;){var q=c.return;if(q===null)break;var G=q.alternate;if(G===null){if(P=q.return,P!==null){c=P;continue}break}if(q.child===G.child){for(G=q.child;G;){if(G===c)return $i(q),i;if(G===P)return $i(q),n;G=G.sibling}throw Error(r(188))}if(c.return!==P.return)c=q,P=G;else{for(var te=!1,ue=q.child;ue;){if(ue===c){te=!0,c=q,P=G;break}if(ue===P){te=!0,P=q,c=G;break}ue=ue.sibling}if(!te){for(ue=G.child;ue;){if(ue===c){te=!0,c=G,P=q;break}if(ue===P){te=!0,P=G,c=q;break}ue=ue.sibling}if(!te)throw Error(r(189))}}if(c.alternate!==P)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:n}function Oi(i){return i=Wr(i),i!==null?fs(i):null}function fs(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var n=fs(i);if(n!==null)return n;i=i.sibling}return null}var ms=t.unstable_scheduleCallback,gs=t.unstable_cancelCallback,vs=t.unstable_shouldYield,Cs=t.unstable_requestPaint,rt=t.unstable_now,uo=t.unstable_getCurrentPriorityLevel,_s=t.unstable_ImmediatePriority,sn=t.unstable_UserBlockingPriority,qr=t.unstable_NormalPriority,co=t.unstable_LowPriority,nn=t.unstable_IdlePriority,Vr=null,Ht=null;function ws(i){if(Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(Vr,i,void 0,(i.current.flags&128)===128)}catch{}}var Yt=Math.clz32?Math.clz32:an,ho=Math.log,on=Math.LN2;function an(i){return i>>>=0,i===0?32:31-(ho(i)/on|0)|0}var xi=64,Ni=4194304;function ve(i){switch(i&-i){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: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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Se(i,n){var c=i.pendingLanes;if(c===0)return 0;var P=0,q=i.suspendedLanes,G=i.pingedLanes,te=c&268435455;if(te!==0){var ue=te&~q;ue!==0?P=ve(ue):(G&=te,G!==0&&(P=ve(G)))}else te=c&~q,te!==0?P=ve(te):G!==0&&(P=ve(G));if(P===0)return 0;if(n!==0&&n!==P&&(n&q)===0&&(q=P&-P,G=n&-n,q>=G||q===16&&(G&4194240)!==0))return n;if((P&4)!==0&&(P|=c&16),n=i.entangledLanes,n!==0)for(i=i.entanglements,n&=P;0<n;)c=31-Yt(n),q=1<<c,P|=i[c],n&=~q;return P}function je(i,n){switch(i){case 1:case 2:case 4:return n+250;case 8:case 16:case 32:case 64: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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $e(i,n){for(var c=i.suspendedLanes,P=i.pingedLanes,q=i.expirationTimes,G=i.pendingLanes;0<G;){var te=31-Yt(G),ue=1<<te,pe=q[te];pe===-1?((ue&c)===0||(ue&P)!==0)&&(q[te]=je(ue,n)):pe<=n&&(i.expiredLanes|=ue),G&=~ue}}function qe(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Ze(){var i=xi;return xi<<=1,(xi&4194240)===0&&(xi=64),i}function Qe(i){for(var n=[],c=0;31>c;c++)n.push(i);return n}function st(i,n,c){i.pendingLanes|=n,n!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,n=31-Yt(n),i[n]=c}function ft(i,n){var c=i.pendingLanes&~n;i.pendingLanes=n,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=n,i.mutableReadLanes&=n,i.entangledLanes&=n,n=i.entanglements;var P=i.eventTimes;for(i=i.expirationTimes;0<c;){var q=31-Yt(c),G=1<<q;n[q]=0,P[q]=-1,i[q]=-1,c&=~G}}function St(i,n){var c=i.entangledLanes|=n;for(i=i.entanglements;c;){var P=31-Yt(c),q=1<<P;q&n|i[P]&n&&(i[P]|=n),c&=~q}}var Ye=0;function rr(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var br,kt,ir,Fr,Gr,pr=!1,ln=[],Kr=null,Jr=null,Yr=null,xs=new Map,Es=new Map,Xr=[],hc="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 submit".split(" ");function Ha(i,n){switch(i){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Jr=null;break;case"mouseover":case"mouseout":Yr=null;break;case"pointerover":case"pointerout":xs.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Es.delete(n.pointerId)}}function ys(i,n,c,P,q,G){return i===null||i.nativeEvent!==G?(i={blockedOn:n,domEventName:c,eventSystemFlags:P,nativeEvent:G,targetContainers:[q]},n!==null&&(n=$s(n),n!==null&&kt(n)),i):(i.eventSystemFlags|=P,n=i.targetContainers,q!==null&&n.indexOf(q)===-1&&n.push(q),i)}function pc(i,n,c,P,q){switch(n){case"focusin":return Kr=ys(Kr,i,n,c,P,q),!0;case"dragenter":return Jr=ys(Jr,i,n,c,P,q),!0;case"mouseover":return Yr=ys(Yr,i,n,c,P,q),!0;case"pointerover":var G=q.pointerId;return xs.set(G,ys(xs.get(G)||null,i,n,c,P,q)),!0;case"gotpointercapture":return G=q.pointerId,Es.set(G,ys(Es.get(G)||null,i,n,c,P,q)),!0}return!1}function Wa(i){var n=Ei(i.target);if(n!==null){var c=tr(n);if(c!==null){if(n=c.tag,n===13){if(n=yr(c),n!==null){i.blockedOn=n,Gr(i.priority,function(){ir(c)});return}}else if(n===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function un(i){if(i.blockedOn!==null)return!1;for(var n=i.targetContainers;0<n.length;){var c=fo(i.domEventName,i.eventSystemFlags,n[0],i.nativeEvent);if(c===null){c=i.nativeEvent;var P=new c.constructor(c.type,c);ji=P,c.target.dispatchEvent(P),ji=null}else return n=$s(c),n!==null&&kt(n),i.blockedOn=c,!1;n.shift()}return!0}function qa(i,n,c){un(i)&&c.delete(n)}function fc(){pr=!1,Kr!==null&&un(Kr)&&(Kr=null),Jr!==null&&un(Jr)&&(Jr=null),Yr!==null&&un(Yr)&&(Yr=null),xs.forEach(qa),Es.forEach(qa)}function bs(i,n){i.blockedOn===n&&(i.blockedOn=null,pr||(pr=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,fc)))}function Ss(i){function n(q){return bs(q,i)}if(0<ln.length){bs(ln[0],i);for(var c=1;c<ln.length;c++){var P=ln[c];P.blockedOn===i&&(P.blockedOn=null)}}for(Kr!==null&&bs(Kr,i),Jr!==null&&bs(Jr,i),Yr!==null&&bs(Yr,i),xs.forEach(n),Es.forEach(n),c=0;c<Xr.length;c++)P=Xr[c],P.blockedOn===i&&(P.blockedOn=null);for(;0<Xr.length&&(c=Xr[0],c.blockedOn===null);)Wa(c),c.blockedOn===null&&Xr.shift()}var Mi=V.ReactCurrentBatchConfig,cn=!0;function mc(i,n,c,P){var q=Ye,G=Mi.transition;Mi.transition=null;try{Ye=1,po(i,n,c,P)}finally{Ye=q,Mi.transition=G}}function gc(i,n,c,P){var q=Ye,G=Mi.transition;Mi.transition=null;try{Ye=4,po(i,n,c,P)}finally{Ye=q,Mi.transition=G}}function po(i,n,c,P){if(cn){var q=fo(i,n,c,P);if(q===null)Fo(i,n,P,dn,c),Ha(i,P);else if(pc(q,i,n,c,P))P.stopPropagation();else if(Ha(i,P),n&4&&-1<hc.indexOf(i)){for(;q!==null;){var G=$s(q);if(G!==null&&br(G),G=fo(i,n,c,P),G===null&&Fo(i,n,P,dn,c),G===q)break;q=G}q!==null&&P.stopPropagation()}else Fo(i,n,P,null,c)}}var dn=null;function fo(i,n,c,P){if(dn=null,i=hr(P),i=Ei(i),i!==null)if(n=tr(i),n===null)i=null;else if(c=n.tag,c===13){if(i=yr(n),i!==null)return i;i=null}else if(c===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;i=null}else n!==i&&(i=null);return dn=i,null}function Va(i){switch(i){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(uo()){case _s:return 1;case sn:return 4;case qr:case co:return 16;case nn:return 536870912;default:return 16}default:return 16}}var Zr=null,mo=null,hn=null;function Ga(){if(hn)return hn;var i,n=mo,c=n.length,P,q="value"in Zr?Zr.value:Zr.textContent,G=q.length;for(i=0;i<c&&n[i]===q[i];i++);var te=c-i;for(P=1;P<=te&&n[c-P]===q[G-P];P++);return hn=q.slice(i,1<P?1-P:void 0)}function pn(i){var n=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&n===13&&(i=13)):i=n,i===10&&(i=13),32<=i||i===13?i:0}function fn(){return!0}function Ka(){return!1}function Xt(i){function n(c,P,q,G,te){this._reactName=c,this._targetInst=q,this.type=P,this.nativeEvent=G,this.target=te,this.currentTarget=null;for(var ue in i)i.hasOwnProperty(ue)&&(c=i[ue],this[ue]=c?c(G):G[ue]);return this.isDefaultPrevented=(G.defaultPrevented!=null?G.defaultPrevented:G.returnValue===!1)?fn:Ka,this.isPropagationStopped=Ka,this}return re(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=fn)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=fn)},persist:function(){},isPersistent:fn}),n}var Ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},go=Xt(Ui),Ds=re({},Ui,{view:0,detail:0}),vc=Xt(Ds),vo,Co,Bs,mn=re({},Ds,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wo,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Bs&&(Bs&&i.type==="mousemove"?(vo=i.screenX-Bs.screenX,Co=i.screenY-Bs.screenY):Co=vo=0,Bs=i),vo)},movementY:function(i){return"movementY"in i?i.movementY:Co}}),Ja=Xt(mn),Cc=re({},mn,{dataTransfer:0}),_c=Xt(Cc),wc=re({},Ds,{relatedTarget:0}),_o=Xt(wc),xc=re({},Ui,{animationName:0,elapsedTime:0,pseudoElement:0}),Ec=Xt(xc),yc=re({},Ui,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),bc=Xt(yc),Sc=re({},Ui,{data:0}),Ya=Xt(Sc),Dc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bc={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"},Rc={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ac(i){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(i):(i=Rc[i])?!!n[i]:!1}function wo(){return Ac}var kc=re({},Ds,{key:function(i){if(i.key){var n=Dc[i.key]||i.key;if(n!=="Unidentified")return n}return i.type==="keypress"?(i=pn(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Bc[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wo,charCode:function(i){return i.type==="keypress"?pn(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?pn(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Fc=Xt(kc),Lc=re({},mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xa=Xt(Lc),Ic=re({},Ds,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wo}),Pc=Xt(Ic),Tc=re({},Ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),jc=Xt(Tc),$c=re({},mn,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Oc=Xt($c),Nc=[9,13,27,32],xo=a&&"CompositionEvent"in window,Rs=null;a&&"documentMode"in document&&(Rs=document.documentMode);var Mc=a&&"TextEvent"in window&&!Rs,Za=a&&(!xo||Rs&&8<Rs&&11>=Rs),Qa=" ",el=!1;function tl(i,n){switch(i){case"keyup":return Nc.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rl(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var zi=!1;function Uc(i,n){switch(i){case"compositionend":return rl(n);case"keypress":return n.which!==32?null:(el=!0,Qa);case"textInput":return i=n.data,i===Qa&&el?null:i;default:return null}}function zc(i,n){if(zi)return i==="compositionend"||!xo&&tl(i,n)?(i=Ga(),hn=mo=Zr=null,zi=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Za&&n.locale!=="ko"?null:n.data;default:return null}}var Hc={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 il(i){var n=i&&i.nodeName&&i.nodeName.toLowerCase();return n==="input"?!!Hc[i.type]:n==="textarea"}function sl(i,n,c,P){tn(P),n=wn(n,"onChange"),0<n.length&&(c=new go("onChange","change",null,c,P),i.push({event:c,listeners:n}))}var As=null,ks=null;function Wc(i){El(i,0)}function gn(i){var n=Gi(i);if(Pe(n))return i}function qc(i,n){if(i==="change")return n}var nl=!1;if(a){var Eo;if(a){var yo="oninput"in document;if(!yo){var ol=document.createElement("div");ol.setAttribute("oninput","return;"),yo=typeof ol.oninput=="function"}Eo=yo}else Eo=!1;nl=Eo&&(!document.documentMode||9<document.documentMode)}function al(){As&&(As.detachEvent("onpropertychange",ll),ks=As=null)}function ll(i){if(i.propertyName==="value"&&gn(ks)){var n=[];sl(n,ks,i,hr(i)),kr(Wc,n)}}function Vc(i,n,c){i==="focusin"?(al(),As=n,ks=c,As.attachEvent("onpropertychange",ll)):i==="focusout"&&al()}function Gc(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return gn(ks)}function Kc(i,n){if(i==="click")return gn(n)}function Jc(i,n){if(i==="input"||i==="change")return gn(n)}function Yc(i,n){return i===n&&(i!==0||1/i===1/n)||i!==i&&n!==n}var fr=typeof Object.is=="function"?Object.is:Yc;function Fs(i,n){if(fr(i,n))return!0;if(typeof i!="object"||i===null||typeof n!="object"||n===null)return!1;var c=Object.keys(i),P=Object.keys(n);if(c.length!==P.length)return!1;for(P=0;P<c.length;P++){var q=c[P];if(!l.call(n,q)||!fr(i[q],n[q]))return!1}return!0}function ul(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function cl(i,n){var c=ul(i);i=0;for(var P;c;){if(c.nodeType===3){if(P=i+c.textContent.length,i<=n&&P>=n)return{node:c,offset:n-i};i=P}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=ul(c)}}function dl(i,n){return i&&n?i===n?!0:i&&i.nodeType===3?!1:n&&n.nodeType===3?dl(i,n.parentNode):"contains"in i?i.contains(n):i.compareDocumentPosition?!!(i.compareDocumentPosition(n)&16):!1:!1}function hl(){for(var i=window,n=Je();n instanceof i.HTMLIFrameElement;){try{var c=typeof n.contentWindow.location.href=="string"}catch{c=!1}if(c)i=n.contentWindow;else break;n=Je(i.document)}return n}function bo(i){var n=i&&i.nodeName&&i.nodeName.toLowerCase();return n&&(n==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||n==="textarea"||i.contentEditable==="true")}function Xc(i){var n=hl(),c=i.focusedElem,P=i.selectionRange;if(n!==c&&c&&c.ownerDocument&&dl(c.ownerDocument.documentElement,c)){if(P!==null&&bo(c)){if(n=P.start,i=P.end,i===void 0&&(i=n),"selectionStart"in c)c.selectionStart=n,c.selectionEnd=Math.min(i,c.value.length);else if(i=(n=c.ownerDocument||document)&&n.defaultView||window,i.getSelection){i=i.getSelection();var q=c.textContent.length,G=Math.min(P.start,q);P=P.end===void 0?G:Math.min(P.end,q),!i.extend&&G>P&&(q=P,P=G,G=q),q=cl(c,G);var te=cl(c,P);q&&te&&(i.rangeCount!==1||i.anchorNode!==q.node||i.anchorOffset!==q.offset||i.focusNode!==te.node||i.focusOffset!==te.offset)&&(n=n.createRange(),n.setStart(q.node,q.offset),i.removeAllRanges(),G>P?(i.addRange(n),i.extend(te.node,te.offset)):(n.setEnd(te.node,te.offset),i.addRange(n)))}}for(n=[],i=c;i=i.parentNode;)i.nodeType===1&&n.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;c<n.length;c++)i=n[c],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var Zc=a&&"documentMode"in document&&11>=document.documentMode,Hi=null,So=null,Ls=null,Do=!1;function pl(i,n,c){var P=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Do||Hi==null||Hi!==Je(P)||(P=Hi,"selectionStart"in P&&bo(P)?P={start:P.selectionStart,end:P.selectionEnd}:(P=(P.ownerDocument&&P.ownerDocument.defaultView||window).getSelection(),P={anchorNode:P.anchorNode,anchorOffset:P.anchorOffset,focusNode:P.focusNode,focusOffset:P.focusOffset}),Ls&&Fs(Ls,P)||(Ls=P,P=wn(So,"onSelect"),0<P.length&&(n=new go("onSelect","select",null,n,c),i.push({event:n,listeners:P}),n.target=Hi)))}function vn(i,n){var c={};return c[i.toLowerCase()]=n.toLowerCase(),c["Webkit"+i]="webkit"+n,c["Moz"+i]="moz"+n,c}var Wi={animationend:vn("Animation","AnimationEnd"),animationiteration:vn("Animation","AnimationIteration"),animationstart:vn("Animation","AnimationStart"),transitionend:vn("Transition","TransitionEnd")},Bo={},fl={};a&&(fl=document.createElement("div").style,"AnimationEvent"in window||(delete Wi.animationend.animation,delete Wi.animationiteration.animation,delete Wi.animationstart.animation),"TransitionEvent"in window||delete Wi.transitionend.transition);function Cn(i){if(Bo[i])return Bo[i];if(!Wi[i])return i;var n=Wi[i],c;for(c in n)if(n.hasOwnProperty(c)&&c in fl)return Bo[i]=n[c];return i}var ml=Cn("animationend"),gl=Cn("animationiteration"),vl=Cn("animationstart"),Cl=Cn("transitionend"),_l=new Map,wl="abort auxClick 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(" ");function Qr(i,n){_l.set(i,n),u(n,[i])}for(var Ro=0;Ro<wl.length;Ro++){var Ao=wl[Ro],Qc=Ao.toLowerCase(),ed=Ao[0].toUpperCase()+Ao.slice(1);Qr(Qc,"on"+ed)}Qr(ml,"onAnimationEnd"),Qr(gl,"onAnimationIteration"),Qr(vl,"onAnimationStart"),Qr("dblclick","onDoubleClick"),Qr("focusin","onFocus"),Qr("focusout","onBlur"),Qr(Cl,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Is="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(" "),td=new Set("cancel close invalid load scroll toggle".split(" ").concat(Is));function xl(i,n,c){var P=i.type||"unknown-event";i.currentTarget=c,ps(P,n,void 0,i),i.currentTarget=null}function El(i,n){n=(n&4)!==0;for(var c=0;c<i.length;c++){var P=i[c],q=P.event;P=P.listeners;e:{var G=void 0;if(n)for(var te=P.length-1;0<=te;te--){var ue=P[te],pe=ue.instance,ye=ue.currentTarget;if(ue=ue.listener,pe!==G&&q.isPropagationStopped())break e;xl(q,ue,ye),G=pe}else for(te=0;te<P.length;te++){if(ue=P[te],pe=ue.instance,ye=ue.currentTarget,ue=ue.listener,pe!==G&&q.isPropagationStopped())break e;xl(q,ue,ye),G=pe}}}if(Er)throw i=_i,Er=!1,_i=null,i}function at(i,n){var c=n[$o];c===void 0&&(c=n[$o]=new Set);var P=i+"__bubble";c.has(P)||(yl(n,i,2,!1),c.add(P))}function ko(i,n,c){var P=0;n&&(P|=4),yl(c,i,P,n)}var _n="_reactListening"+Math.random().toString(36).slice(2);function Ps(i){if(!i[_n]){i[_n]=!0,s.forEach(function(c){c!=="selectionchange"&&(td.has(c)||ko(c,!1,i),ko(c,!0,i))});var n=i.nodeType===9?i:i.ownerDocument;n===null||n[_n]||(n[_n]=!0,ko("selectionchange",!1,n))}}function yl(i,n,c,P){switch(Va(n)){case 1:var q=mc;break;case 4:q=gc;break;default:q=po}c=q.bind(null,n,c,i),q=void 0,!gi||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(q=!0),P?q!==void 0?i.addEventListener(n,c,{capture:!0,passive:q}):i.addEventListener(n,c,!0):q!==void 0?i.addEventListener(n,c,{passive:q}):i.addEventListener(n,c,!1)}function Fo(i,n,c,P,q){var G=P;if((n&1)===0&&(n&2)===0&&P!==null)e:for(;;){if(P===null)return;var te=P.tag;if(te===3||te===4){var ue=P.stateNode.containerInfo;if(ue===q||ue.nodeType===8&&ue.parentNode===q)break;if(te===4)for(te=P.return;te!==null;){var pe=te.tag;if((pe===3||pe===4)&&(pe=te.stateNode.containerInfo,pe===q||pe.nodeType===8&&pe.parentNode===q))return;te=te.return}for(;ue!==null;){if(te=Ei(ue),te===null)return;if(pe=te.tag,pe===5||pe===6){P=G=te;continue e}ue=ue.parentNode}}P=P.return}kr(function(){var ye=G,ke=hr(c),Fe=[];e:{var Ae=_l.get(i);if(Ae!==void 0){var Oe=go,Me=i;switch(i){case"keypress":if(pn(c)===0)break e;case"keydown":case"keyup":Oe=Fc;break;case"focusin":Me="focus",Oe=_o;break;case"focusout":Me="blur",Oe=_o;break;case"beforeblur":case"afterblur":Oe=_o;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Oe=Ja;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Oe=_c;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Oe=Pc;break;case ml:case gl:case vl:Oe=Ec;break;case Cl:Oe=jc;break;case"scroll":Oe=vc;break;case"wheel":Oe=Oc;break;case"copy":case"cut":case"paste":Oe=bc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Oe=Xa}var Ue=(n&4)!==0,Ct=!Ue&&i==="scroll",xe=Ue?Ae!==null?Ae+"Capture":null:Ae;Ue=[];for(var me=ye,Ee;me!==null;){Ee=me;var Le=Ee.stateNode;if(Ee.tag===5&&Le!==null&&(Ee=Le,xe!==null&&(Le=mi(me,xe),Le!=null&&Ue.push(Ts(me,Le,Ee)))),Ct)break;me=me.return}0<Ue.length&&(Ae=new Oe(Ae,Me,null,c,ke),Fe.push({event:Ae,listeners:Ue}))}}if((n&7)===0){e:{if(Ae=i==="mouseover"||i==="pointerover",Oe=i==="mouseout"||i==="pointerout",Ae&&c!==ji&&(Me=c.relatedTarget||c.fromElement)&&(Ei(Me)||Me[Lr]))break e;if((Oe||Ae)&&(Ae=ke.window===ke?ke:(Ae=ke.ownerDocument)?Ae.defaultView||Ae.parentWindow:window,Oe?(Me=c.relatedTarget||c.toElement,Oe=ye,Me=Me?Ei(Me):null,Me!==null&&(Ct=tr(Me),Me!==Ct||Me.tag!==5&&Me.tag!==6)&&(Me=null)):(Oe=null,Me=ye),Oe!==Me)){if(Ue=Ja,Le="onMouseLeave",xe="onMouseEnter",me="mouse",(i==="pointerout"||i==="pointerover")&&(Ue=Xa,Le="onPointerLeave",xe="onPointerEnter",me="pointer"),Ct=Oe==null?Ae:Gi(Oe),Ee=Me==null?Ae:Gi(Me),Ae=new Ue(Le,me+"leave",Oe,c,ke),Ae.target=Ct,Ae.relatedTarget=Ee,Le=null,Ei(ke)===ye&&(Ue=new Ue(xe,me+"enter",Me,c,ke),Ue.target=Ee,Ue.relatedTarget=Ct,Le=Ue),Ct=Le,Oe&&Me)t:{for(Ue=Oe,xe=Me,me=0,Ee=Ue;Ee;Ee=qi(Ee))me++;for(Ee=0,Le=xe;Le;Le=qi(Le))Ee++;for(;0<me-Ee;)Ue=qi(Ue),me--;for(;0<Ee-me;)xe=qi(xe),Ee--;for(;me--;){if(Ue===xe||xe!==null&&Ue===xe.alternate)break t;Ue=qi(Ue),xe=qi(xe)}Ue=null}else Ue=null;Oe!==null&&bl(Fe,Ae,Oe,Ue,!1),Me!==null&&Ct!==null&&bl(Fe,Ct,Me,Ue,!0)}}e:{if(Ae=ye?Gi(ye):window,Oe=Ae.nodeName&&Ae.nodeName.toLowerCase(),Oe==="select"||Oe==="input"&&Ae.type==="file")var He=qc;else if(il(Ae))if(nl)He=Jc;else{He=Gc;var Ve=Vc}else(Oe=Ae.nodeName)&&Oe.toLowerCase()==="input"&&(Ae.type==="checkbox"||Ae.type==="radio")&&(He=Kc);if(He&&(He=He(i,ye))){sl(Fe,He,c,ke);break e}Ve&&Ve(i,Ae,ye),i==="focusout"&&(Ve=Ae._wrapperState)&&Ve.controlled&&Ae.type==="number"&&cr(Ae,"number",Ae.value)}switch(Ve=ye?Gi(ye):window,i){case"focusin":(il(Ve)||Ve.contentEditable==="true")&&(Hi=Ve,So=ye,Ls=null);break;case"focusout":Ls=So=Hi=null;break;case"mousedown":Do=!0;break;case"contextmenu":case"mouseup":case"dragend":Do=!1,pl(Fe,c,ke);break;case"selectionchange":if(Zc)break;case"keydown":case"keyup":pl(Fe,c,ke)}var Ge;if(xo)e:{switch(i){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else zi?tl(i,c)&&(Ke="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Ke="onCompositionStart");Ke&&(Za&&c.locale!=="ko"&&(zi||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&zi&&(Ge=Ga()):(Zr=ke,mo="value"in Zr?Zr.value:Zr.textContent,zi=!0)),Ve=wn(ye,Ke),0<Ve.length&&(Ke=new Ya(Ke,i,null,c,ke),Fe.push({event:Ke,listeners:Ve}),Ge?Ke.data=Ge:(Ge=rl(c),Ge!==null&&(Ke.data=Ge)))),(Ge=Mc?Uc(i,c):zc(i,c))&&(ye=wn(ye,"onBeforeInput"),0<ye.length&&(ke=new Ya("onBeforeInput","beforeinput",null,c,ke),Fe.push({event:ke,listeners:ye}),ke.data=Ge))}El(Fe,n)})}function Ts(i,n,c){return{instance:i,listener:n,currentTarget:c}}function wn(i,n){for(var c=n+"Capture",P=[];i!==null;){var q=i,G=q.stateNode;q.tag===5&&G!==null&&(q=G,G=mi(i,c),G!=null&&P.unshift(Ts(i,G,q)),G=mi(i,n),G!=null&&P.push(Ts(i,G,q))),i=i.return}return P}function qi(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function bl(i,n,c,P,q){for(var G=n._reactName,te=[];c!==null&&c!==P;){var ue=c,pe=ue.alternate,ye=ue.stateNode;if(pe!==null&&pe===P)break;ue.tag===5&&ye!==null&&(ue=ye,q?(pe=mi(c,G),pe!=null&&te.unshift(Ts(c,pe,ue))):q||(pe=mi(c,G),pe!=null&&te.push(Ts(c,pe,ue)))),c=c.return}te.length!==0&&i.push({event:n,listeners:te})}var rd=/\r\n?/g,id=/\u0000|\uFFFD/g;function Sl(i){return(typeof i=="string"?i:""+i).replace(rd,`
|
|
38
|
-
`).replace(id,"")}function xn(i,n,c){if(n=Sl(n),Sl(i)!==n&&c)throw Error(r(425))}function En(){}var Lo=null,Io=null;function Po(i,n){return i==="textarea"||i==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var To=typeof setTimeout=="function"?setTimeout:void 0,sd=typeof clearTimeout=="function"?clearTimeout:void 0,Dl=typeof Promise=="function"?Promise:void 0,nd=typeof queueMicrotask=="function"?queueMicrotask:typeof Dl<"u"?function(i){return Dl.resolve(null).then(i).catch(od)}:To;function od(i){setTimeout(function(){throw i})}function jo(i,n){var c=n,P=0;do{var q=c.nextSibling;if(i.removeChild(c),q&&q.nodeType===8)if(c=q.data,c==="/$"){if(P===0){i.removeChild(q),Ss(n);return}P--}else c!=="$"&&c!=="$?"&&c!=="$!"||P++;c=q}while(c);Ss(n)}function ei(i){for(;i!=null;i=i.nextSibling){var n=i.nodeType;if(n===1||n===3)break;if(n===8){if(n=i.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return i}function Bl(i){i=i.previousSibling;for(var n=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"){if(n===0)return i;n--}else c==="/$"&&n++}i=i.previousSibling}return null}var Vi=Math.random().toString(36).slice(2),Sr="__reactFiber$"+Vi,js="__reactProps$"+Vi,Lr="__reactContainer$"+Vi,$o="__reactEvents$"+Vi,ad="__reactListeners$"+Vi,ld="__reactHandles$"+Vi;function Ei(i){var n=i[Sr];if(n)return n;for(var c=i.parentNode;c;){if(n=c[Lr]||c[Sr]){if(c=n.alternate,n.child!==null||c!==null&&c.child!==null)for(i=Bl(i);i!==null;){if(c=i[Sr])return c;i=Bl(i)}return n}i=c,c=i.parentNode}return null}function $s(i){return i=i[Sr]||i[Lr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Gi(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(r(33))}function yn(i){return i[js]||null}var Oo=[],Ki=-1;function ti(i){return{current:i}}function lt(i){0>Ki||(i.current=Oo[Ki],Oo[Ki]=null,Ki--)}function ot(i,n){Ki++,Oo[Ki]=i.current,i.current=n}var ri={},It=ti(ri),Wt=ti(!1),yi=ri;function Ji(i,n){var c=i.type.contextTypes;if(!c)return ri;var P=i.stateNode;if(P&&P.__reactInternalMemoizedUnmaskedChildContext===n)return P.__reactInternalMemoizedMaskedChildContext;var q={},G;for(G in c)q[G]=n[G];return P&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=n,i.__reactInternalMemoizedMaskedChildContext=q),q}function qt(i){return i=i.childContextTypes,i!=null}function bn(){lt(Wt),lt(It)}function Rl(i,n,c){if(It.current!==ri)throw Error(r(168));ot(It,n),ot(Wt,c)}function Al(i,n,c){var P=i.stateNode;if(n=n.childContextTypes,typeof P.getChildContext!="function")return c;P=P.getChildContext();for(var q in P)if(!(q in n))throw Error(r(108,de(i)||"Unknown",q));return re({},c,P)}function Sn(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||ri,yi=It.current,ot(It,i),ot(Wt,Wt.current),!0}function kl(i,n,c){var P=i.stateNode;if(!P)throw Error(r(169));c?(i=Al(i,n,yi),P.__reactInternalMemoizedMergedChildContext=i,lt(Wt),lt(It),ot(It,i)):lt(Wt),ot(Wt,c)}var Ir=null,Dn=!1,No=!1;function Fl(i){Ir===null?Ir=[i]:Ir.push(i)}function ud(i){Dn=!0,Fl(i)}function ii(){if(!No&&Ir!==null){No=!0;var i=0,n=Ye;try{var c=Ir;for(Ye=1;i<c.length;i++){var P=c[i];do P=P(!0);while(P!==null)}Ir=null,Dn=!1}catch(q){throw Ir!==null&&(Ir=Ir.slice(i+1)),ms(_s,ii),q}finally{Ye=n,No=!1}}return null}var Yi=[],Xi=0,Bn=null,Rn=0,sr=[],nr=0,bi=null,Pr=1,Tr="";function Si(i,n){Yi[Xi++]=Rn,Yi[Xi++]=Bn,Bn=i,Rn=n}function Ll(i,n,c){sr[nr++]=Pr,sr[nr++]=Tr,sr[nr++]=bi,bi=i;var P=Pr;i=Tr;var q=32-Yt(P)-1;P&=~(1<<q),c+=1;var G=32-Yt(n)+q;if(30<G){var te=q-q%5;G=(P&(1<<te)-1).toString(32),P>>=te,q-=te,Pr=1<<32-Yt(n)+q|c<<q|P,Tr=G+i}else Pr=1<<G|c<<q|P,Tr=i}function Mo(i){i.return!==null&&(Si(i,1),Ll(i,1,0))}function Uo(i){for(;i===Bn;)Bn=Yi[--Xi],Yi[Xi]=null,Rn=Yi[--Xi],Yi[Xi]=null;for(;i===bi;)bi=sr[--nr],sr[nr]=null,Tr=sr[--nr],sr[nr]=null,Pr=sr[--nr],sr[nr]=null}var Zt=null,Qt=null,ct=!1,mr=null;function Il(i,n){var c=ur(5,null,null,0);c.elementType="DELETED",c.stateNode=n,c.return=i,n=i.deletions,n===null?(i.deletions=[c],i.flags|=16):n.push(c)}function Pl(i,n){switch(i.tag){case 5:var c=i.type;return n=n.nodeType!==1||c.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(i.stateNode=n,Zt=i,Qt=ei(n.firstChild),!0):!1;case 6:return n=i.pendingProps===""||n.nodeType!==3?null:n,n!==null?(i.stateNode=n,Zt=i,Qt=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(c=bi!==null?{id:Pr,overflow:Tr}:null,i.memoizedState={dehydrated:n,treeContext:c,retryLane:1073741824},c=ur(18,null,null,0),c.stateNode=n,c.return=i,i.child=c,Zt=i,Qt=null,!0):!1;default:return!1}}function zo(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Ho(i){if(ct){var n=Qt;if(n){var c=n;if(!Pl(i,n)){if(zo(i))throw Error(r(418));n=ei(c.nextSibling);var P=Zt;n&&Pl(i,n)?Il(P,c):(i.flags=i.flags&-4097|2,ct=!1,Zt=i)}}else{if(zo(i))throw Error(r(418));i.flags=i.flags&-4097|2,ct=!1,Zt=i}}}function Tl(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Zt=i}function An(i){if(i!==Zt)return!1;if(!ct)return Tl(i),ct=!0,!1;var n;if((n=i.tag!==3)&&!(n=i.tag!==5)&&(n=i.type,n=n!=="head"&&n!=="body"&&!Po(i.type,i.memoizedProps)),n&&(n=Qt)){if(zo(i))throw jl(),Error(r(418));for(;n;)Il(i,n),n=ei(n.nextSibling)}if(Tl(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,n=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"){if(n===0){Qt=ei(i.nextSibling);break e}n--}else c!=="$"&&c!=="$!"&&c!=="$?"||n++}i=i.nextSibling}Qt=null}}else Qt=Zt?ei(i.stateNode.nextSibling):null;return!0}function jl(){for(var i=Qt;i;)i=ei(i.nextSibling)}function Zi(){Qt=Zt=null,ct=!1}function Wo(i){mr===null?mr=[i]:mr.push(i)}var cd=V.ReactCurrentBatchConfig;function Os(i,n,c){if(i=c.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(c._owner){if(c=c._owner,c){if(c.tag!==1)throw Error(r(309));var P=c.stateNode}if(!P)throw Error(r(147,i));var q=P,G=""+i;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===G?n.ref:(n=function(te){var ue=q.refs;te===null?delete ue[G]:ue[G]=te},n._stringRef=G,n)}if(typeof i!="string")throw Error(r(284));if(!c._owner)throw Error(r(290,i))}return i}function kn(i,n){throw i=Object.prototype.toString.call(n),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":i))}function $l(i){var n=i._init;return n(i._payload)}function Ol(i){function n(xe,me){if(i){var Ee=xe.deletions;Ee===null?(xe.deletions=[me],xe.flags|=16):Ee.push(me)}}function c(xe,me){if(!i)return null;for(;me!==null;)n(xe,me),me=me.sibling;return null}function P(xe,me){for(xe=new Map;me!==null;)me.key!==null?xe.set(me.key,me):xe.set(me.index,me),me=me.sibling;return xe}function q(xe,me){return xe=di(xe,me),xe.index=0,xe.sibling=null,xe}function G(xe,me,Ee){return xe.index=Ee,i?(Ee=xe.alternate,Ee!==null?(Ee=Ee.index,Ee<me?(xe.flags|=2,me):Ee):(xe.flags|=2,me)):(xe.flags|=1048576,me)}function te(xe){return i&&xe.alternate===null&&(xe.flags|=2),xe}function ue(xe,me,Ee,Le){return me===null||me.tag!==6?(me=Ta(Ee,xe.mode,Le),me.return=xe,me):(me=q(me,Ee),me.return=xe,me)}function pe(xe,me,Ee,Le){var He=Ee.type;return He===Z?ke(xe,me,Ee.props.children,Le,Ee.key):me!==null&&(me.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===fe&&$l(He)===me.type)?(Le=q(me,Ee.props),Le.ref=Os(xe,me,Ee),Le.return=xe,Le):(Le=eo(Ee.type,Ee.key,Ee.props,null,xe.mode,Le),Le.ref=Os(xe,me,Ee),Le.return=xe,Le)}function ye(xe,me,Ee,Le){return me===null||me.tag!==4||me.stateNode.containerInfo!==Ee.containerInfo||me.stateNode.implementation!==Ee.implementation?(me=ja(Ee,xe.mode,Le),me.return=xe,me):(me=q(me,Ee.children||[]),me.return=xe,me)}function ke(xe,me,Ee,Le,He){return me===null||me.tag!==7?(me=Ii(Ee,xe.mode,Le,He),me.return=xe,me):(me=q(me,Ee),me.return=xe,me)}function Fe(xe,me,Ee){if(typeof me=="string"&&me!==""||typeof me=="number")return me=Ta(""+me,xe.mode,Ee),me.return=xe,me;if(typeof me=="object"&&me!==null){switch(me.$$typeof){case J:return Ee=eo(me.type,me.key,me.props,null,xe.mode,Ee),Ee.ref=Os(xe,null,me),Ee.return=xe,Ee;case Y:return me=ja(me,xe.mode,Ee),me.return=xe,me;case fe:var Le=me._init;return Fe(xe,Le(me._payload),Ee)}if($t(me)||X(me))return me=Ii(me,xe.mode,Ee,null),me.return=xe,me;kn(xe,me)}return null}function Ae(xe,me,Ee,Le){var He=me!==null?me.key:null;if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number")return He!==null?null:ue(xe,me,""+Ee,Le);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case J:return Ee.key===He?pe(xe,me,Ee,Le):null;case Y:return Ee.key===He?ye(xe,me,Ee,Le):null;case fe:return He=Ee._init,Ae(xe,me,He(Ee._payload),Le)}if($t(Ee)||X(Ee))return He!==null?null:ke(xe,me,Ee,Le,null);kn(xe,Ee)}return null}function Oe(xe,me,Ee,Le,He){if(typeof Le=="string"&&Le!==""||typeof Le=="number")return xe=xe.get(Ee)||null,ue(me,xe,""+Le,He);if(typeof Le=="object"&&Le!==null){switch(Le.$$typeof){case J:return xe=xe.get(Le.key===null?Ee:Le.key)||null,pe(me,xe,Le,He);case Y:return xe=xe.get(Le.key===null?Ee:Le.key)||null,ye(me,xe,Le,He);case fe:var Ve=Le._init;return Oe(xe,me,Ee,Ve(Le._payload),He)}if($t(Le)||X(Le))return xe=xe.get(Ee)||null,ke(me,xe,Le,He,null);kn(me,Le)}return null}function Me(xe,me,Ee,Le){for(var He=null,Ve=null,Ge=me,Ke=me=0,Rt=null;Ge!==null&&Ke<Ee.length;Ke++){Ge.index>Ke?(Rt=Ge,Ge=null):Rt=Ge.sibling;var tt=Ae(xe,Ge,Ee[Ke],Le);if(tt===null){Ge===null&&(Ge=Rt);break}i&&Ge&&tt.alternate===null&&n(xe,Ge),me=G(tt,me,Ke),Ve===null?He=tt:Ve.sibling=tt,Ve=tt,Ge=Rt}if(Ke===Ee.length)return c(xe,Ge),ct&&Si(xe,Ke),He;if(Ge===null){for(;Ke<Ee.length;Ke++)Ge=Fe(xe,Ee[Ke],Le),Ge!==null&&(me=G(Ge,me,Ke),Ve===null?He=Ge:Ve.sibling=Ge,Ve=Ge);return ct&&Si(xe,Ke),He}for(Ge=P(xe,Ge);Ke<Ee.length;Ke++)Rt=Oe(Ge,xe,Ke,Ee[Ke],Le),Rt!==null&&(i&&Rt.alternate!==null&&Ge.delete(Rt.key===null?Ke:Rt.key),me=G(Rt,me,Ke),Ve===null?He=Rt:Ve.sibling=Rt,Ve=Rt);return i&&Ge.forEach(function(hi){return n(xe,hi)}),ct&&Si(xe,Ke),He}function Ue(xe,me,Ee,Le){var He=X(Ee);if(typeof He!="function")throw Error(r(150));if(Ee=He.call(Ee),Ee==null)throw Error(r(151));for(var Ve=He=null,Ge=me,Ke=me=0,Rt=null,tt=Ee.next();Ge!==null&&!tt.done;Ke++,tt=Ee.next()){Ge.index>Ke?(Rt=Ge,Ge=null):Rt=Ge.sibling;var hi=Ae(xe,Ge,tt.value,Le);if(hi===null){Ge===null&&(Ge=Rt);break}i&&Ge&&hi.alternate===null&&n(xe,Ge),me=G(hi,me,Ke),Ve===null?He=hi:Ve.sibling=hi,Ve=hi,Ge=Rt}if(tt.done)return c(xe,Ge),ct&&Si(xe,Ke),He;if(Ge===null){for(;!tt.done;Ke++,tt=Ee.next())tt=Fe(xe,tt.value,Le),tt!==null&&(me=G(tt,me,Ke),Ve===null?He=tt:Ve.sibling=tt,Ve=tt);return ct&&Si(xe,Ke),He}for(Ge=P(xe,Ge);!tt.done;Ke++,tt=Ee.next())tt=Oe(Ge,xe,Ke,tt.value,Le),tt!==null&&(i&&tt.alternate!==null&&Ge.delete(tt.key===null?Ke:tt.key),me=G(tt,me,Ke),Ve===null?He=tt:Ve.sibling=tt,Ve=tt);return i&&Ge.forEach(function(Hd){return n(xe,Hd)}),ct&&Si(xe,Ke),He}function Ct(xe,me,Ee,Le){if(typeof Ee=="object"&&Ee!==null&&Ee.type===Z&&Ee.key===null&&(Ee=Ee.props.children),typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case J:e:{for(var He=Ee.key,Ve=me;Ve!==null;){if(Ve.key===He){if(He=Ee.type,He===Z){if(Ve.tag===7){c(xe,Ve.sibling),me=q(Ve,Ee.props.children),me.return=xe,xe=me;break e}}else if(Ve.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===fe&&$l(He)===Ve.type){c(xe,Ve.sibling),me=q(Ve,Ee.props),me.ref=Os(xe,Ve,Ee),me.return=xe,xe=me;break e}c(xe,Ve);break}else n(xe,Ve);Ve=Ve.sibling}Ee.type===Z?(me=Ii(Ee.props.children,xe.mode,Le,Ee.key),me.return=xe,xe=me):(Le=eo(Ee.type,Ee.key,Ee.props,null,xe.mode,Le),Le.ref=Os(xe,me,Ee),Le.return=xe,xe=Le)}return te(xe);case Y:e:{for(Ve=Ee.key;me!==null;){if(me.key===Ve)if(me.tag===4&&me.stateNode.containerInfo===Ee.containerInfo&&me.stateNode.implementation===Ee.implementation){c(xe,me.sibling),me=q(me,Ee.children||[]),me.return=xe,xe=me;break e}else{c(xe,me);break}else n(xe,me);me=me.sibling}me=ja(Ee,xe.mode,Le),me.return=xe,xe=me}return te(xe);case fe:return Ve=Ee._init,Ct(xe,me,Ve(Ee._payload),Le)}if($t(Ee))return Me(xe,me,Ee,Le);if(X(Ee))return Ue(xe,me,Ee,Le);kn(xe,Ee)}return typeof Ee=="string"&&Ee!==""||typeof Ee=="number"?(Ee=""+Ee,me!==null&&me.tag===6?(c(xe,me.sibling),me=q(me,Ee),me.return=xe,xe=me):(c(xe,me),me=Ta(Ee,xe.mode,Le),me.return=xe,xe=me),te(xe)):c(xe,me)}return Ct}var Qi=Ol(!0),Nl=Ol(!1),Fn=ti(null),Ln=null,es=null,qo=null;function Vo(){qo=es=Ln=null}function Go(i){var n=Fn.current;lt(Fn),i._currentValue=n}function Ko(i,n,c){for(;i!==null;){var P=i.alternate;if((i.childLanes&n)!==n?(i.childLanes|=n,P!==null&&(P.childLanes|=n)):P!==null&&(P.childLanes&n)!==n&&(P.childLanes|=n),i===c)break;i=i.return}}function ts(i,n){Ln=i,qo=es=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&n)!==0&&(Vt=!0),i.firstContext=null)}function or(i){var n=i._currentValue;if(qo!==i)if(i={context:i,memoizedValue:n,next:null},es===null){if(Ln===null)throw Error(r(308));es=i,Ln.dependencies={lanes:0,firstContext:i}}else es=es.next=i;return n}var Di=null;function Jo(i){Di===null?Di=[i]:Di.push(i)}function Ml(i,n,c,P){var q=n.interleaved;return q===null?(c.next=c,Jo(n)):(c.next=q.next,q.next=c),n.interleaved=c,jr(i,P)}function jr(i,n){i.lanes|=n;var c=i.alternate;for(c!==null&&(c.lanes|=n),c=i,i=i.return;i!==null;)i.childLanes|=n,c=i.alternate,c!==null&&(c.childLanes|=n),c=i,i=i.return;return c.tag===3?c.stateNode:null}var si=!1;function Yo(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ul(i,n){i=i.updateQueue,n.updateQueue===i&&(n.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function $r(i,n){return{eventTime:i,lane:n,tag:0,payload:null,callback:null,next:null}}function ni(i,n,c){var P=i.updateQueue;if(P===null)return null;if(P=P.shared,(et&2)!==0){var q=P.pending;return q===null?n.next=n:(n.next=q.next,q.next=n),P.pending=n,jr(i,c)}return q=P.interleaved,q===null?(n.next=n,Jo(P)):(n.next=q.next,q.next=n),P.interleaved=n,jr(i,c)}function In(i,n,c){if(n=n.updateQueue,n!==null&&(n=n.shared,(c&4194240)!==0)){var P=n.lanes;P&=i.pendingLanes,c|=P,n.lanes=c,St(i,c)}}function zl(i,n){var c=i.updateQueue,P=i.alternate;if(P!==null&&(P=P.updateQueue,c===P)){var q=null,G=null;if(c=c.firstBaseUpdate,c!==null){do{var te={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};G===null?q=G=te:G=G.next=te,c=c.next}while(c!==null);G===null?q=G=n:G=G.next=n}else q=G=n;c={baseState:P.baseState,firstBaseUpdate:q,lastBaseUpdate:G,shared:P.shared,effects:P.effects},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=n:i.next=n,c.lastBaseUpdate=n}function Pn(i,n,c,P){var q=i.updateQueue;si=!1;var G=q.firstBaseUpdate,te=q.lastBaseUpdate,ue=q.shared.pending;if(ue!==null){q.shared.pending=null;var pe=ue,ye=pe.next;pe.next=null,te===null?G=ye:te.next=ye,te=pe;var ke=i.alternate;ke!==null&&(ke=ke.updateQueue,ue=ke.lastBaseUpdate,ue!==te&&(ue===null?ke.firstBaseUpdate=ye:ue.next=ye,ke.lastBaseUpdate=pe))}if(G!==null){var Fe=q.baseState;te=0,ke=ye=pe=null,ue=G;do{var Ae=ue.lane,Oe=ue.eventTime;if((P&Ae)===Ae){ke!==null&&(ke=ke.next={eventTime:Oe,lane:0,tag:ue.tag,payload:ue.payload,callback:ue.callback,next:null});e:{var Me=i,Ue=ue;switch(Ae=n,Oe=c,Ue.tag){case 1:if(Me=Ue.payload,typeof Me=="function"){Fe=Me.call(Oe,Fe,Ae);break e}Fe=Me;break e;case 3:Me.flags=Me.flags&-65537|128;case 0:if(Me=Ue.payload,Ae=typeof Me=="function"?Me.call(Oe,Fe,Ae):Me,Ae==null)break e;Fe=re({},Fe,Ae);break e;case 2:si=!0}}ue.callback!==null&&ue.lane!==0&&(i.flags|=64,Ae=q.effects,Ae===null?q.effects=[ue]:Ae.push(ue))}else Oe={eventTime:Oe,lane:Ae,tag:ue.tag,payload:ue.payload,callback:ue.callback,next:null},ke===null?(ye=ke=Oe,pe=Fe):ke=ke.next=Oe,te|=Ae;if(ue=ue.next,ue===null){if(ue=q.shared.pending,ue===null)break;Ae=ue,ue=Ae.next,Ae.next=null,q.lastBaseUpdate=Ae,q.shared.pending=null}}while(!0);if(ke===null&&(pe=Fe),q.baseState=pe,q.firstBaseUpdate=ye,q.lastBaseUpdate=ke,n=q.shared.interleaved,n!==null){q=n;do te|=q.lane,q=q.next;while(q!==n)}else G===null&&(q.shared.lanes=0);Ai|=te,i.lanes=te,i.memoizedState=Fe}}function Hl(i,n,c){if(i=n.effects,n.effects=null,i!==null)for(n=0;n<i.length;n++){var P=i[n],q=P.callback;if(q!==null){if(P.callback=null,P=c,typeof q!="function")throw Error(r(191,q));q.call(P)}}}var Ns={},Dr=ti(Ns),Ms=ti(Ns),Us=ti(Ns);function Bi(i){if(i===Ns)throw Error(r(174));return i}function Xo(i,n){switch(ot(Us,n),ot(Ms,i),ot(Dr,Ns),i=n.nodeType,i){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:wr(null,"");break;default:i=i===8?n.parentNode:n,n=i.namespaceURI||null,i=i.tagName,n=wr(n,i)}lt(Dr),ot(Dr,n)}function rs(){lt(Dr),lt(Ms),lt(Us)}function Wl(i){Bi(Us.current);var n=Bi(Dr.current),c=wr(n,i.type);n!==c&&(ot(Ms,i),ot(Dr,c))}function Zo(i){Ms.current===i&&(lt(Dr),lt(Ms))}var ht=ti(0);function Tn(i){for(var n=i;n!==null;){if(n.tag===13){var c=n.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break;for(;n.sibling===null;){if(n.return===null||n.return===i)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Qo=[];function ea(){for(var i=0;i<Qo.length;i++)Qo[i]._workInProgressVersionPrimary=null;Qo.length=0}var jn=V.ReactCurrentDispatcher,ta=V.ReactCurrentBatchConfig,Ri=0,pt=null,xt=null,Dt=null,$n=!1,zs=!1,Hs=0,dd=0;function Pt(){throw Error(r(321))}function ra(i,n){if(n===null)return!1;for(var c=0;c<n.length&&c<i.length;c++)if(!fr(i[c],n[c]))return!1;return!0}function ia(i,n,c,P,q,G){if(Ri=G,pt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,jn.current=i===null||i.memoizedState===null?md:gd,i=c(P,q),zs){G=0;do{if(zs=!1,Hs=0,25<=G)throw Error(r(301));G+=1,Dt=xt=null,n.updateQueue=null,jn.current=vd,i=c(P,q)}while(zs)}if(jn.current=Mn,n=xt!==null&&xt.next!==null,Ri=0,Dt=xt=pt=null,$n=!1,n)throw Error(r(300));return i}function sa(){var i=Hs!==0;return Hs=0,i}function Br(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?pt.memoizedState=Dt=i:Dt=Dt.next=i,Dt}function ar(){if(xt===null){var i=pt.alternate;i=i!==null?i.memoizedState:null}else i=xt.next;var n=Dt===null?pt.memoizedState:Dt.next;if(n!==null)Dt=n,xt=i;else{if(i===null)throw Error(r(310));xt=i,i={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},Dt===null?pt.memoizedState=Dt=i:Dt=Dt.next=i}return Dt}function Ws(i,n){return typeof n=="function"?n(i):n}function na(i){var n=ar(),c=n.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var P=xt,q=P.baseQueue,G=c.pending;if(G!==null){if(q!==null){var te=q.next;q.next=G.next,G.next=te}P.baseQueue=q=G,c.pending=null}if(q!==null){G=q.next,P=P.baseState;var ue=te=null,pe=null,ye=G;do{var ke=ye.lane;if((Ri&ke)===ke)pe!==null&&(pe=pe.next={lane:0,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),P=ye.hasEagerState?ye.eagerState:i(P,ye.action);else{var Fe={lane:ke,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};pe===null?(ue=pe=Fe,te=P):pe=pe.next=Fe,pt.lanes|=ke,Ai|=ke}ye=ye.next}while(ye!==null&&ye!==G);pe===null?te=P:pe.next=ue,fr(P,n.memoizedState)||(Vt=!0),n.memoizedState=P,n.baseState=te,n.baseQueue=pe,c.lastRenderedState=P}if(i=c.interleaved,i!==null){q=i;do G=q.lane,pt.lanes|=G,Ai|=G,q=q.next;while(q!==i)}else q===null&&(c.lanes=0);return[n.memoizedState,c.dispatch]}function oa(i){var n=ar(),c=n.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var P=c.dispatch,q=c.pending,G=n.memoizedState;if(q!==null){c.pending=null;var te=q=q.next;do G=i(G,te.action),te=te.next;while(te!==q);fr(G,n.memoizedState)||(Vt=!0),n.memoizedState=G,n.baseQueue===null&&(n.baseState=G),c.lastRenderedState=G}return[G,P]}function ql(){}function Vl(i,n){var c=pt,P=ar(),q=n(),G=!fr(P.memoizedState,q);if(G&&(P.memoizedState=q,Vt=!0),P=P.queue,aa(Jl.bind(null,c,P,i),[i]),P.getSnapshot!==n||G||Dt!==null&&Dt.memoizedState.tag&1){if(c.flags|=2048,qs(9,Kl.bind(null,c,P,q,n),void 0,null),Bt===null)throw Error(r(349));(Ri&30)!==0||Gl(c,n,q)}return q}function Gl(i,n,c){i.flags|=16384,i={getSnapshot:n,value:c},n=pt.updateQueue,n===null?(n={lastEffect:null,stores:null},pt.updateQueue=n,n.stores=[i]):(c=n.stores,c===null?n.stores=[i]:c.push(i))}function Kl(i,n,c,P){n.value=c,n.getSnapshot=P,Yl(n)&&Xl(i)}function Jl(i,n,c){return c(function(){Yl(n)&&Xl(i)})}function Yl(i){var n=i.getSnapshot;i=i.value;try{var c=n();return!fr(i,c)}catch{return!0}}function Xl(i){var n=jr(i,1);n!==null&&_r(n,i,1,-1)}function Zl(i){var n=Br();return typeof i=="function"&&(i=i()),n.memoizedState=n.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ws,lastRenderedState:i},n.queue=i,i=i.dispatch=fd.bind(null,pt,i),[n.memoizedState,i]}function qs(i,n,c,P){return i={tag:i,create:n,destroy:c,deps:P,next:null},n=pt.updateQueue,n===null?(n={lastEffect:null,stores:null},pt.updateQueue=n,n.lastEffect=i.next=i):(c=n.lastEffect,c===null?n.lastEffect=i.next=i:(P=c.next,c.next=i,i.next=P,n.lastEffect=i)),i}function Ql(){return ar().memoizedState}function On(i,n,c,P){var q=Br();pt.flags|=i,q.memoizedState=qs(1|n,c,void 0,P===void 0?null:P)}function Nn(i,n,c,P){var q=ar();P=P===void 0?null:P;var G=void 0;if(xt!==null){var te=xt.memoizedState;if(G=te.destroy,P!==null&&ra(P,te.deps)){q.memoizedState=qs(n,c,G,P);return}}pt.flags|=i,q.memoizedState=qs(1|n,c,G,P)}function eu(i,n){return On(8390656,8,i,n)}function aa(i,n){return Nn(2048,8,i,n)}function tu(i,n){return Nn(4,2,i,n)}function iu(i,n){return Nn(4,4,i,n)}function su(i,n){if(typeof n=="function")return i=i(),n(i),function(){n(null)};if(n!=null)return i=i(),n.current=i,function(){n.current=null}}function nu(i,n,c){return c=c!=null?c.concat([i]):null,Nn(4,4,su.bind(null,n,i),c)}function la(){}function ou(i,n){var c=ar();n=n===void 0?null:n;var P=c.memoizedState;return P!==null&&n!==null&&ra(n,P[1])?P[0]:(c.memoizedState=[i,n],i)}function au(i,n){var c=ar();n=n===void 0?null:n;var P=c.memoizedState;return P!==null&&n!==null&&ra(n,P[1])?P[0]:(i=i(),c.memoizedState=[i,n],i)}function lu(i,n,c){return(Ri&21)===0?(i.baseState&&(i.baseState=!1,Vt=!0),i.memoizedState=c):(fr(c,n)||(c=Ze(),pt.lanes|=c,Ai|=c,i.baseState=!0),n)}function hd(i,n){var c=Ye;Ye=c!==0&&4>c?c:4,i(!0);var P=ta.transition;ta.transition={};try{i(!1),n()}finally{Ye=c,ta.transition=P}}function uu(){return ar().memoizedState}function pd(i,n,c){var P=ui(i);if(c={lane:P,action:c,hasEagerState:!1,eagerState:null,next:null},cu(i))du(n,c);else if(c=Ml(i,n,c,P),c!==null){var q=Ut();_r(c,i,P,q),hu(c,n,P)}}function fd(i,n,c){var P=ui(i),q={lane:P,action:c,hasEagerState:!1,eagerState:null,next:null};if(cu(i))du(n,q);else{var G=i.alternate;if(i.lanes===0&&(G===null||G.lanes===0)&&(G=n.lastRenderedReducer,G!==null))try{var te=n.lastRenderedState,ue=G(te,c);if(q.hasEagerState=!0,q.eagerState=ue,fr(ue,te)){var pe=n.interleaved;pe===null?(q.next=q,Jo(n)):(q.next=pe.next,pe.next=q),n.interleaved=q;return}}catch{}finally{}c=Ml(i,n,q,P),c!==null&&(q=Ut(),_r(c,i,P,q),hu(c,n,P))}}function cu(i){var n=i.alternate;return i===pt||n!==null&&n===pt}function du(i,n){zs=$n=!0;var c=i.pending;c===null?n.next=n:(n.next=c.next,c.next=n),i.pending=n}function hu(i,n,c){if((c&4194240)!==0){var P=n.lanes;P&=i.pendingLanes,c|=P,n.lanes=c,St(i,c)}}var Mn={readContext:or,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useInsertionEffect:Pt,useLayoutEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useMutableSource:Pt,useSyncExternalStore:Pt,useId:Pt,unstable_isNewReconciler:!1},md={readContext:or,useCallback:function(i,n){return Br().memoizedState=[i,n===void 0?null:n],i},useContext:or,useEffect:eu,useImperativeHandle:function(i,n,c){return c=c!=null?c.concat([i]):null,On(4194308,4,su.bind(null,n,i),c)},useLayoutEffect:function(i,n){return On(4194308,4,i,n)},useInsertionEffect:function(i,n){return On(4,2,i,n)},useMemo:function(i,n){var c=Br();return n=n===void 0?null:n,i=i(),c.memoizedState=[i,n],i},useReducer:function(i,n,c){var P=Br();return n=c!==void 0?c(n):n,P.memoizedState=P.baseState=n,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:n},P.queue=i,i=i.dispatch=pd.bind(null,pt,i),[P.memoizedState,i]},useRef:function(i){var n=Br();return i={current:i},n.memoizedState=i},useState:Zl,useDebugValue:la,useDeferredValue:function(i){return Br().memoizedState=i},useTransition:function(){var i=Zl(!1),n=i[0];return i=hd.bind(null,i[1]),Br().memoizedState=i,[n,i]},useMutableSource:function(){},useSyncExternalStore:function(i,n,c){var P=pt,q=Br();if(ct){if(c===void 0)throw Error(r(407));c=c()}else{if(c=n(),Bt===null)throw Error(r(349));(Ri&30)!==0||Gl(P,n,c)}q.memoizedState=c;var G={value:c,getSnapshot:n};return q.queue=G,eu(Jl.bind(null,P,G,i),[i]),P.flags|=2048,qs(9,Kl.bind(null,P,G,c,n),void 0,null),c},useId:function(){var i=Br(),n=Bt.identifierPrefix;if(ct){var c=Tr,P=Pr;c=(P&~(1<<32-Yt(P)-1)).toString(32)+c,n=":"+n+"R"+c,c=Hs++,0<c&&(n+="H"+c.toString(32)),n+=":"}else c=dd++,n=":"+n+"r"+c.toString(32)+":";return i.memoizedState=n},unstable_isNewReconciler:!1},gd={readContext:or,useCallback:ou,useContext:or,useEffect:aa,useImperativeHandle:nu,useInsertionEffect:tu,useLayoutEffect:iu,useMemo:au,useReducer:na,useRef:Ql,useState:function(){return na(Ws)},useDebugValue:la,useDeferredValue:function(i){var n=ar();return lu(n,xt.memoizedState,i)},useTransition:function(){var i=na(Ws)[0],n=ar().memoizedState;return[i,n]},useMutableSource:ql,useSyncExternalStore:Vl,useId:uu,unstable_isNewReconciler:!1},vd={readContext:or,useCallback:ou,useContext:or,useEffect:aa,useImperativeHandle:nu,useInsertionEffect:tu,useLayoutEffect:iu,useMemo:au,useReducer:oa,useRef:Ql,useState:function(){return oa(Ws)},useDebugValue:la,useDeferredValue:function(i){var n=ar();return xt===null?n.memoizedState=i:lu(n,xt.memoizedState,i)},useTransition:function(){var i=oa(Ws)[0],n=ar().memoizedState;return[i,n]},useMutableSource:ql,useSyncExternalStore:Vl,useId:uu,unstable_isNewReconciler:!1};function gr(i,n){if(i&&i.defaultProps){n=re({},n),i=i.defaultProps;for(var c in i)n[c]===void 0&&(n[c]=i[c]);return n}return n}function ua(i,n,c,P){n=i.memoizedState,c=c(P,n),c=c==null?n:re({},n,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var Un={isMounted:function(i){return(i=i._reactInternals)?tr(i)===i:!1},enqueueSetState:function(i,n,c){i=i._reactInternals;var P=Ut(),q=ui(i),G=$r(P,q);G.payload=n,c!=null&&(G.callback=c),n=ni(i,G,q),n!==null&&(_r(n,i,q,P),In(n,i,q))},enqueueReplaceState:function(i,n,c){i=i._reactInternals;var P=Ut(),q=ui(i),G=$r(P,q);G.tag=1,G.payload=n,c!=null&&(G.callback=c),n=ni(i,G,q),n!==null&&(_r(n,i,q,P),In(n,i,q))},enqueueForceUpdate:function(i,n){i=i._reactInternals;var c=Ut(),P=ui(i),q=$r(c,P);q.tag=2,n!=null&&(q.callback=n),n=ni(i,q,P),n!==null&&(_r(n,i,P,c),In(n,i,P))}};function pu(i,n,c,P,q,G,te){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(P,G,te):n.prototype&&n.prototype.isPureReactComponent?!Fs(c,P)||!Fs(q,G):!0}function fu(i,n,c){var P=!1,q=ri,G=n.contextType;return typeof G=="object"&&G!==null?G=or(G):(q=qt(n)?yi:It.current,P=n.contextTypes,G=(P=P!=null)?Ji(i,q):ri),n=new n(c,G),i.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Un,i.stateNode=n,n._reactInternals=i,P&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=q,i.__reactInternalMemoizedMaskedChildContext=G),n}function mu(i,n,c,P){i=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(c,P),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(c,P),n.state!==i&&Un.enqueueReplaceState(n,n.state,null)}function ca(i,n,c,P){var q=i.stateNode;q.props=c,q.state=i.memoizedState,q.refs={},Yo(i);var G=n.contextType;typeof G=="object"&&G!==null?q.context=or(G):(G=qt(n)?yi:It.current,q.context=Ji(i,G)),q.state=i.memoizedState,G=n.getDerivedStateFromProps,typeof G=="function"&&(ua(i,n,G,c),q.state=i.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof q.getSnapshotBeforeUpdate=="function"||typeof q.UNSAFE_componentWillMount!="function"&&typeof q.componentWillMount!="function"||(n=q.state,typeof q.componentWillMount=="function"&&q.componentWillMount(),typeof q.UNSAFE_componentWillMount=="function"&&q.UNSAFE_componentWillMount(),n!==q.state&&Un.enqueueReplaceState(q,q.state,null),Pn(i,c,q,P),q.state=i.memoizedState),typeof q.componentDidMount=="function"&&(i.flags|=4194308)}function is(i,n){try{var c="",P=n;do c+=Be(P),P=P.return;while(P);var q=c}catch(G){q=`
|
|
39
|
-
Error generating stack: `+G.message+`
|
|
40
|
-
`+G.stack}return{value:i,source:n,stack:q,digest:null}}function da(i,n,c){return{value:i,source:null,stack:c??null,digest:n??null}}function ha(i,n){try{console.error(n.value)}catch(c){setTimeout(function(){throw c})}}var Cd=typeof WeakMap=="function"?WeakMap:Map;function gu(i,n,c){c=$r(-1,c),c.tag=3,c.payload={element:null};var P=n.value;return c.callback=function(){Kn||(Kn=!0,Ba=P),ha(i,n)},c}function vu(i,n,c){c=$r(-1,c),c.tag=3;var P=i.type.getDerivedStateFromError;if(typeof P=="function"){var q=n.value;c.payload=function(){return P(q)},c.callback=function(){ha(i,n)}}var G=i.stateNode;return G!==null&&typeof G.componentDidCatch=="function"&&(c.callback=function(){ha(i,n),typeof P!="function"&&(ai===null?ai=new Set([this]):ai.add(this));var te=n.stack;this.componentDidCatch(n.value,{componentStack:te!==null?te:""})}),c}function Cu(i,n,c){var P=i.pingCache;if(P===null){P=i.pingCache=new Cd;var q=new Set;P.set(n,q)}else q=P.get(n),q===void 0&&(q=new Set,P.set(n,q));q.has(c)||(q.add(c),i=Ld.bind(null,i,n,c),n.then(i,i))}function _u(i){do{var n;if((n=i.tag===13)&&(n=i.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return i;i=i.return}while(i!==null);return null}function wu(i,n,c,P,q){return(i.mode&1)===0?(i===n?i.flags|=65536:(i.flags|=128,c.flags|=131072,c.flags&=-52805,c.tag===1&&(c.alternate===null?c.tag=17:(n=$r(-1,1),n.tag=2,ni(c,n,1))),c.lanes|=1),i):(i.flags|=65536,i.lanes=q,i)}var _d=V.ReactCurrentOwner,Vt=!1;function Mt(i,n,c,P){n.child=i===null?Nl(n,null,c,P):Qi(n,i.child,c,P)}function xu(i,n,c,P,q){c=c.render;var G=n.ref;return ts(n,q),P=ia(i,n,c,P,G,q),c=sa(),i!==null&&!Vt?(n.updateQueue=i.updateQueue,n.flags&=-2053,i.lanes&=~q,Or(i,n,q)):(ct&&c&&Mo(n),n.flags|=1,Mt(i,n,P,q),n.child)}function Eu(i,n,c,P,q){if(i===null){var G=c.type;return typeof G=="function"&&!Pa(G)&&G.defaultProps===void 0&&c.compare===null&&c.defaultProps===void 0?(n.tag=15,n.type=G,yu(i,n,G,P,q)):(i=eo(c.type,null,P,n,n.mode,q),i.ref=n.ref,i.return=n,n.child=i)}if(G=i.child,(i.lanes&q)===0){var te=G.memoizedProps;if(c=c.compare,c=c!==null?c:Fs,c(te,P)&&i.ref===n.ref)return Or(i,n,q)}return n.flags|=1,i=di(G,P),i.ref=n.ref,i.return=n,n.child=i}function yu(i,n,c,P,q){if(i!==null){var G=i.memoizedProps;if(Fs(G,P)&&i.ref===n.ref)if(Vt=!1,n.pendingProps=P=G,(i.lanes&q)!==0)(i.flags&131072)!==0&&(Vt=!0);else return n.lanes=i.lanes,Or(i,n,q)}return pa(i,n,c,P,q)}function bu(i,n,c){var P=n.pendingProps,q=P.children,G=i!==null?i.memoizedState:null;if(P.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},ot(ns,er),er|=c;else{if((c&1073741824)===0)return i=G!==null?G.baseLanes|c:c,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:i,cachePool:null,transitions:null},n.updateQueue=null,ot(ns,er),er|=i,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},P=G!==null?G.baseLanes:c,ot(ns,er),er|=P}else G!==null?(P=G.baseLanes|c,n.memoizedState=null):P=c,ot(ns,er),er|=P;return Mt(i,n,q,c),n.child}function Su(i,n){var c=n.ref;(i===null&&c!==null||i!==null&&i.ref!==c)&&(n.flags|=512,n.flags|=2097152)}function pa(i,n,c,P,q){var G=qt(c)?yi:It.current;return G=Ji(n,G),ts(n,q),c=ia(i,n,c,P,G,q),P=sa(),i!==null&&!Vt?(n.updateQueue=i.updateQueue,n.flags&=-2053,i.lanes&=~q,Or(i,n,q)):(ct&&P&&Mo(n),n.flags|=1,Mt(i,n,c,q),n.child)}function Du(i,n,c,P,q){if(qt(c)){var G=!0;Sn(n)}else G=!1;if(ts(n,q),n.stateNode===null)Hn(i,n),fu(n,c,P),ca(n,c,P,q),P=!0;else if(i===null){var te=n.stateNode,ue=n.memoizedProps;te.props=ue;var pe=te.context,ye=c.contextType;typeof ye=="object"&&ye!==null?ye=or(ye):(ye=qt(c)?yi:It.current,ye=Ji(n,ye));var ke=c.getDerivedStateFromProps,Fe=typeof ke=="function"||typeof te.getSnapshotBeforeUpdate=="function";Fe||typeof te.UNSAFE_componentWillReceiveProps!="function"&&typeof te.componentWillReceiveProps!="function"||(ue!==P||pe!==ye)&&mu(n,te,P,ye),si=!1;var Ae=n.memoizedState;te.state=Ae,Pn(n,P,te,q),pe=n.memoizedState,ue!==P||Ae!==pe||Wt.current||si?(typeof ke=="function"&&(ua(n,c,ke,P),pe=n.memoizedState),(ue=si||pu(n,c,ue,P,Ae,pe,ye))?(Fe||typeof te.UNSAFE_componentWillMount!="function"&&typeof te.componentWillMount!="function"||(typeof te.componentWillMount=="function"&&te.componentWillMount(),typeof te.UNSAFE_componentWillMount=="function"&&te.UNSAFE_componentWillMount()),typeof te.componentDidMount=="function"&&(n.flags|=4194308)):(typeof te.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=P,n.memoizedState=pe),te.props=P,te.state=pe,te.context=ye,P=ue):(typeof te.componentDidMount=="function"&&(n.flags|=4194308),P=!1)}else{te=n.stateNode,Ul(i,n),ue=n.memoizedProps,ye=n.type===n.elementType?ue:gr(n.type,ue),te.props=ye,Fe=n.pendingProps,Ae=te.context,pe=c.contextType,typeof pe=="object"&&pe!==null?pe=or(pe):(pe=qt(c)?yi:It.current,pe=Ji(n,pe));var Oe=c.getDerivedStateFromProps;(ke=typeof Oe=="function"||typeof te.getSnapshotBeforeUpdate=="function")||typeof te.UNSAFE_componentWillReceiveProps!="function"&&typeof te.componentWillReceiveProps!="function"||(ue!==Fe||Ae!==pe)&&mu(n,te,P,pe),si=!1,Ae=n.memoizedState,te.state=Ae,Pn(n,P,te,q);var Me=n.memoizedState;ue!==Fe||Ae!==Me||Wt.current||si?(typeof Oe=="function"&&(ua(n,c,Oe,P),Me=n.memoizedState),(ye=si||pu(n,c,ye,P,Ae,Me,pe)||!1)?(ke||typeof te.UNSAFE_componentWillUpdate!="function"&&typeof te.componentWillUpdate!="function"||(typeof te.componentWillUpdate=="function"&&te.componentWillUpdate(P,Me,pe),typeof te.UNSAFE_componentWillUpdate=="function"&&te.UNSAFE_componentWillUpdate(P,Me,pe)),typeof te.componentDidUpdate=="function"&&(n.flags|=4),typeof te.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof te.componentDidUpdate!="function"||ue===i.memoizedProps&&Ae===i.memoizedState||(n.flags|=4),typeof te.getSnapshotBeforeUpdate!="function"||ue===i.memoizedProps&&Ae===i.memoizedState||(n.flags|=1024),n.memoizedProps=P,n.memoizedState=Me),te.props=P,te.state=Me,te.context=pe,P=ye):(typeof te.componentDidUpdate!="function"||ue===i.memoizedProps&&Ae===i.memoizedState||(n.flags|=4),typeof te.getSnapshotBeforeUpdate!="function"||ue===i.memoizedProps&&Ae===i.memoizedState||(n.flags|=1024),P=!1)}return fa(i,n,c,P,G,q)}function fa(i,n,c,P,q,G){Su(i,n);var te=(n.flags&128)!==0;if(!P&&!te)return q&&kl(n,c,!1),Or(i,n,G);P=n.stateNode,_d.current=n;var ue=te&&typeof c.getDerivedStateFromError!="function"?null:P.render();return n.flags|=1,i!==null&&te?(n.child=Qi(n,i.child,null,G),n.child=Qi(n,null,ue,G)):Mt(i,n,ue,G),n.memoizedState=P.state,q&&kl(n,c,!0),n.child}function Bu(i){var n=i.stateNode;n.pendingContext?Rl(i,n.pendingContext,n.pendingContext!==n.context):n.context&&Rl(i,n.context,!1),Xo(i,n.containerInfo)}function Ru(i,n,c,P,q){return Zi(),Wo(q),n.flags|=256,Mt(i,n,c,P),n.child}var ma={dehydrated:null,treeContext:null,retryLane:0};function ga(i){return{baseLanes:i,cachePool:null,transitions:null}}function Au(i,n,c){var P=n.pendingProps,q=ht.current,G=!1,te=(n.flags&128)!==0,ue;if((ue=te)||(ue=i!==null&&i.memoizedState===null?!1:(q&2)!==0),ue?(G=!0,n.flags&=-129):(i===null||i.memoizedState!==null)&&(q|=1),ot(ht,q&1),i===null)return Ho(n),i=n.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((n.mode&1)===0?n.lanes=1:i.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(te=P.children,i=P.fallback,G?(P=n.mode,G=n.child,te={mode:"hidden",children:te},(P&1)===0&&G!==null?(G.childLanes=0,G.pendingProps=te):G=to(te,P,0,null),i=Ii(i,P,c,null),G.return=n,i.return=n,G.sibling=i,n.child=G,n.child.memoizedState=ga(c),n.memoizedState=ma,i):va(n,te));if(q=i.memoizedState,q!==null&&(ue=q.dehydrated,ue!==null))return wd(i,n,te,P,ue,q,c);if(G){G=P.fallback,te=n.mode,q=i.child,ue=q.sibling;var pe={mode:"hidden",children:P.children};return(te&1)===0&&n.child!==q?(P=n.child,P.childLanes=0,P.pendingProps=pe,n.deletions=null):(P=di(q,pe),P.subtreeFlags=q.subtreeFlags&14680064),ue!==null?G=di(ue,G):(G=Ii(G,te,c,null),G.flags|=2),G.return=n,P.return=n,P.sibling=G,n.child=P,P=G,G=n.child,te=i.child.memoizedState,te=te===null?ga(c):{baseLanes:te.baseLanes|c,cachePool:null,transitions:te.transitions},G.memoizedState=te,G.childLanes=i.childLanes&~c,n.memoizedState=ma,P}return G=i.child,i=G.sibling,P=di(G,{mode:"visible",children:P.children}),(n.mode&1)===0&&(P.lanes=c),P.return=n,P.sibling=null,i!==null&&(c=n.deletions,c===null?(n.deletions=[i],n.flags|=16):c.push(i)),n.child=P,n.memoizedState=null,P}function va(i,n){return n=to({mode:"visible",children:n},i.mode,0,null),n.return=i,i.child=n}function zn(i,n,c,P){return P!==null&&Wo(P),Qi(n,i.child,null,c),i=va(n,n.pendingProps.children),i.flags|=2,n.memoizedState=null,i}function wd(i,n,c,P,q,G,te){if(c)return n.flags&256?(n.flags&=-257,P=da(Error(r(422))),zn(i,n,te,P)):n.memoizedState!==null?(n.child=i.child,n.flags|=128,null):(G=P.fallback,q=n.mode,P=to({mode:"visible",children:P.children},q,0,null),G=Ii(G,q,te,null),G.flags|=2,P.return=n,G.return=n,P.sibling=G,n.child=P,(n.mode&1)!==0&&Qi(n,i.child,null,te),n.child.memoizedState=ga(te),n.memoizedState=ma,G);if((n.mode&1)===0)return zn(i,n,te,null);if(q.data==="$!"){if(P=q.nextSibling&&q.nextSibling.dataset,P)var ue=P.dgst;return P=ue,G=Error(r(419)),P=da(G,P,void 0),zn(i,n,te,P)}if(ue=(te&i.childLanes)!==0,Vt||ue){if(P=Bt,P!==null){switch(te&-te){case 4:q=2;break;case 16:q=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:q=32;break;case 536870912:q=268435456;break;default:q=0}q=(q&(P.suspendedLanes|te))!==0?0:q,q!==0&&q!==G.retryLane&&(G.retryLane=q,jr(i,q),_r(P,i,q,-1))}return Ia(),P=da(Error(r(421))),zn(i,n,te,P)}return q.data==="$?"?(n.flags|=128,n.child=i.child,n=Id.bind(null,i),q._reactRetry=n,null):(i=G.treeContext,Qt=ei(q.nextSibling),Zt=n,ct=!0,mr=null,i!==null&&(sr[nr++]=Pr,sr[nr++]=Tr,sr[nr++]=bi,Pr=i.id,Tr=i.overflow,bi=n),n=va(n,P.children),n.flags|=4096,n)}function ku(i,n,c){i.lanes|=n;var P=i.alternate;P!==null&&(P.lanes|=n),Ko(i.return,n,c)}function Ca(i,n,c,P,q){var G=i.memoizedState;G===null?i.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:P,tail:c,tailMode:q}:(G.isBackwards=n,G.rendering=null,G.renderingStartTime=0,G.last=P,G.tail=c,G.tailMode=q)}function Fu(i,n,c){var P=n.pendingProps,q=P.revealOrder,G=P.tail;if(Mt(i,n,P.children,c),P=ht.current,(P&2)!==0)P=P&1|2,n.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=n.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&ku(i,c,n);else if(i.tag===19)ku(i,c,n);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}P&=1}if(ot(ht,P),(n.mode&1)===0)n.memoizedState=null;else switch(q){case"forwards":for(c=n.child,q=null;c!==null;)i=c.alternate,i!==null&&Tn(i)===null&&(q=c),c=c.sibling;c=q,c===null?(q=n.child,n.child=null):(q=c.sibling,c.sibling=null),Ca(n,!1,q,c,G);break;case"backwards":for(c=null,q=n.child,n.child=null;q!==null;){if(i=q.alternate,i!==null&&Tn(i)===null){n.child=q;break}i=q.sibling,q.sibling=c,c=q,q=i}Ca(n,!0,c,null,G);break;case"together":Ca(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Hn(i,n){(n.mode&1)===0&&i!==null&&(i.alternate=null,n.alternate=null,n.flags|=2)}function Or(i,n,c){if(i!==null&&(n.dependencies=i.dependencies),Ai|=n.lanes,(c&n.childLanes)===0)return null;if(i!==null&&n.child!==i.child)throw Error(r(153));if(n.child!==null){for(i=n.child,c=di(i,i.pendingProps),n.child=c,c.return=n;i.sibling!==null;)i=i.sibling,c=c.sibling=di(i,i.pendingProps),c.return=n;c.sibling=null}return n.child}function xd(i,n,c){switch(n.tag){case 3:Bu(n),Zi();break;case 5:Wl(n);break;case 1:qt(n.type)&&Sn(n);break;case 4:Xo(n,n.stateNode.containerInfo);break;case 10:var P=n.type._context,q=n.memoizedProps.value;ot(Fn,P._currentValue),P._currentValue=q;break;case 13:if(P=n.memoizedState,P!==null)return P.dehydrated!==null?(ot(ht,ht.current&1),n.flags|=128,null):(c&n.child.childLanes)!==0?Au(i,n,c):(ot(ht,ht.current&1),i=Or(i,n,c),i!==null?i.sibling:null);ot(ht,ht.current&1);break;case 19:if(P=(c&n.childLanes)!==0,(i.flags&128)!==0){if(P)return Fu(i,n,c);n.flags|=128}if(q=n.memoizedState,q!==null&&(q.rendering=null,q.tail=null,q.lastEffect=null),ot(ht,ht.current),P)break;return null;case 22:case 23:return n.lanes=0,bu(i,n,c)}return Or(i,n,c)}var Lu,_a,Iu,Pu;Lu=function(i,n){for(var c=n.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===n)break;for(;c.sibling===null;){if(c.return===null||c.return===n)return;c=c.return}c.sibling.return=c.return,c=c.sibling}},_a=function(){},Iu=function(i,n,c,P){var q=i.memoizedProps;if(q!==P){i=n.stateNode,Bi(Dr.current);var G=null;switch(c){case"input":q=Ie(i,q),P=Ie(i,P),G=[];break;case"select":q=re({},q,{value:void 0}),P=re({},P,{value:void 0}),G=[];break;case"textarea":q=dt(i,q),P=dt(i,P),G=[];break;default:typeof q.onClick!="function"&&typeof P.onClick=="function"&&(i.onclick=En)}dr(c,P);var te;c=null;for(ye in q)if(!P.hasOwnProperty(ye)&&q.hasOwnProperty(ye)&&q[ye]!=null)if(ye==="style"){var ue=q[ye];for(te in ue)ue.hasOwnProperty(te)&&(c||(c={}),c[te]="")}else ye!=="dangerouslySetInnerHTML"&&ye!=="children"&&ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&ye!=="autoFocus"&&(o.hasOwnProperty(ye)?G||(G=[]):(G=G||[]).push(ye,null));for(ye in P){var pe=P[ye];if(ue=q!=null?q[ye]:void 0,P.hasOwnProperty(ye)&&pe!==ue&&(pe!=null||ue!=null))if(ye==="style")if(ue){for(te in ue)!ue.hasOwnProperty(te)||pe&&pe.hasOwnProperty(te)||(c||(c={}),c[te]="");for(te in pe)pe.hasOwnProperty(te)&&ue[te]!==pe[te]&&(c||(c={}),c[te]=pe[te])}else c||(G||(G=[]),G.push(ye,c)),c=pe;else ye==="dangerouslySetInnerHTML"?(pe=pe?pe.__html:void 0,ue=ue?ue.__html:void 0,pe!=null&&ue!==pe&&(G=G||[]).push(ye,pe)):ye==="children"?typeof pe!="string"&&typeof pe!="number"||(G=G||[]).push(ye,""+pe):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(o.hasOwnProperty(ye)?(pe!=null&&ye==="onScroll"&&at("scroll",i),G||ue===pe||(G=[])):(G=G||[]).push(ye,pe))}c&&(G=G||[]).push("style",c);var ye=G;(n.updateQueue=ye)&&(n.flags|=4)}},Pu=function(i,n,c,P){c!==P&&(n.flags|=4)};function Vs(i,n){if(!ct)switch(i.tailMode){case"hidden":n=i.tail;for(var c=null;n!==null;)n.alternate!==null&&(c=n),n=n.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var P=null;c!==null;)c.alternate!==null&&(P=c),c=c.sibling;P===null?n||i.tail===null?i.tail=null:i.tail.sibling=null:P.sibling=null}}function Tt(i){var n=i.alternate!==null&&i.alternate.child===i.child,c=0,P=0;if(n)for(var q=i.child;q!==null;)c|=q.lanes|q.childLanes,P|=q.subtreeFlags&14680064,P|=q.flags&14680064,q.return=i,q=q.sibling;else for(q=i.child;q!==null;)c|=q.lanes|q.childLanes,P|=q.subtreeFlags,P|=q.flags,q.return=i,q=q.sibling;return i.subtreeFlags|=P,i.childLanes=c,n}function Ed(i,n,c){var P=n.pendingProps;switch(Uo(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(n),null;case 1:return qt(n.type)&&bn(),Tt(n),null;case 3:return P=n.stateNode,rs(),lt(Wt),lt(It),ea(),P.pendingContext&&(P.context=P.pendingContext,P.pendingContext=null),(i===null||i.child===null)&&(An(n)?n.flags|=4:i===null||i.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,mr!==null&&(ka(mr),mr=null))),_a(i,n),Tt(n),null;case 5:Zo(n);var q=Bi(Us.current);if(c=n.type,i!==null&&n.stateNode!=null)Iu(i,n,c,P,q),i.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!P){if(n.stateNode===null)throw Error(r(166));return Tt(n),null}if(i=Bi(Dr.current),An(n)){P=n.stateNode,c=n.type;var G=n.memoizedProps;switch(P[Sr]=n,P[js]=G,i=(n.mode&1)!==0,c){case"dialog":at("cancel",P),at("close",P);break;case"iframe":case"object":case"embed":at("load",P);break;case"video":case"audio":for(q=0;q<Is.length;q++)at(Is[q],P);break;case"source":at("error",P);break;case"img":case"image":case"link":at("error",P),at("load",P);break;case"details":at("toggle",P);break;case"input":We(P,G),at("invalid",P);break;case"select":P._wrapperState={wasMultiple:!!G.multiple},at("invalid",P);break;case"textarea":gt(P,G),at("invalid",P)}dr(c,G),q=null;for(var te in G)if(G.hasOwnProperty(te)){var ue=G[te];te==="children"?typeof ue=="string"?P.textContent!==ue&&(G.suppressHydrationWarning!==!0&&xn(P.textContent,ue,i),q=["children",ue]):typeof ue=="number"&&P.textContent!==""+ue&&(G.suppressHydrationWarning!==!0&&xn(P.textContent,ue,i),q=["children",""+ue]):o.hasOwnProperty(te)&&ue!=null&&te==="onScroll"&&at("scroll",P)}switch(c){case"input":Te(P),At(P,G,!0);break;case"textarea":Te(P),wt(P);break;case"select":case"option":break;default:typeof G.onClick=="function"&&(P.onclick=En)}P=q,n.updateQueue=P,P!==null&&(n.flags|=4)}else{te=q.nodeType===9?q:q.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=vt(c)),i==="http://www.w3.org/1999/xhtml"?c==="script"?(i=te.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof P.is=="string"?i=te.createElement(c,{is:P.is}):(i=te.createElement(c),c==="select"&&(te=i,P.multiple?te.multiple=!0:P.size&&(te.size=P.size))):i=te.createElementNS(i,c),i[Sr]=n,i[js]=P,Lu(i,n,!1,!1),n.stateNode=i;e:{switch(te=Ti(c,P),c){case"dialog":at("cancel",i),at("close",i),q=P;break;case"iframe":case"object":case"embed":at("load",i),q=P;break;case"video":case"audio":for(q=0;q<Is.length;q++)at(Is[q],i);q=P;break;case"source":at("error",i),q=P;break;case"img":case"image":case"link":at("error",i),at("load",i),q=P;break;case"details":at("toggle",i),q=P;break;case"input":We(i,P),q=Ie(i,P),at("invalid",i);break;case"option":q=P;break;case"select":i._wrapperState={wasMultiple:!!P.multiple},q=re({},P,{value:void 0}),at("invalid",i);break;case"textarea":gt(i,P),q=dt(i,P),at("invalid",i);break;default:q=P}dr(c,q),ue=q;for(G in ue)if(ue.hasOwnProperty(G)){var pe=ue[G];G==="style"?Pi(i,pe):G==="dangerouslySetInnerHTML"?(pe=pe?pe.__html:void 0,pe!=null&&Jt(i,pe)):G==="children"?typeof pe=="string"?(c!=="textarea"||pe!=="")&&yt(i,pe):typeof pe=="number"&&yt(i,""+pe):G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&G!=="autoFocus"&&(o.hasOwnProperty(G)?pe!=null&&G==="onScroll"&&at("scroll",i):pe!=null&&N(i,G,pe,te))}switch(c){case"input":Te(i),At(i,P,!1);break;case"textarea":Te(i),wt(i);break;case"option":P.value!=null&&i.setAttribute("value",""+ie(P.value));break;case"select":i.multiple=!!P.multiple,G=P.value,G!=null?nt(i,!!P.multiple,G,!1):P.defaultValue!=null&&nt(i,!!P.multiple,P.defaultValue,!0);break;default:typeof q.onClick=="function"&&(i.onclick=En)}switch(c){case"button":case"input":case"select":case"textarea":P=!!P.autoFocus;break e;case"img":P=!0;break e;default:P=!1}}P&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return Tt(n),null;case 6:if(i&&n.stateNode!=null)Pu(i,n,i.memoizedProps,P);else{if(typeof P!="string"&&n.stateNode===null)throw Error(r(166));if(c=Bi(Us.current),Bi(Dr.current),An(n)){if(P=n.stateNode,c=n.memoizedProps,P[Sr]=n,(G=P.nodeValue!==c)&&(i=Zt,i!==null))switch(i.tag){case 3:xn(P.nodeValue,c,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&xn(P.nodeValue,c,(i.mode&1)!==0)}G&&(n.flags|=4)}else P=(c.nodeType===9?c:c.ownerDocument).createTextNode(P),P[Sr]=n,n.stateNode=P}return Tt(n),null;case 13:if(lt(ht),P=n.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(ct&&Qt!==null&&(n.mode&1)!==0&&(n.flags&128)===0)jl(),Zi(),n.flags|=98560,G=!1;else if(G=An(n),P!==null&&P.dehydrated!==null){if(i===null){if(!G)throw Error(r(318));if(G=n.memoizedState,G=G!==null?G.dehydrated:null,!G)throw Error(r(317));G[Sr]=n}else Zi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Tt(n),G=!1}else mr!==null&&(ka(mr),mr=null),G=!0;if(!G)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=c,n):(P=P!==null,P!==(i!==null&&i.memoizedState!==null)&&P&&(n.child.flags|=8192,(n.mode&1)!==0&&(i===null||(ht.current&1)!==0?Et===0&&(Et=3):Ia())),n.updateQueue!==null&&(n.flags|=4),Tt(n),null);case 4:return rs(),_a(i,n),i===null&&Ps(n.stateNode.containerInfo),Tt(n),null;case 10:return Go(n.type._context),Tt(n),null;case 17:return qt(n.type)&&bn(),Tt(n),null;case 19:if(lt(ht),G=n.memoizedState,G===null)return Tt(n),null;if(P=(n.flags&128)!==0,te=G.rendering,te===null)if(P)Vs(G,!1);else{if(Et!==0||i!==null&&(i.flags&128)!==0)for(i=n.child;i!==null;){if(te=Tn(i),te!==null){for(n.flags|=128,Vs(G,!1),P=te.updateQueue,P!==null&&(n.updateQueue=P,n.flags|=4),n.subtreeFlags=0,P=c,c=n.child;c!==null;)G=c,i=P,G.flags&=14680066,te=G.alternate,te===null?(G.childLanes=0,G.lanes=i,G.child=null,G.subtreeFlags=0,G.memoizedProps=null,G.memoizedState=null,G.updateQueue=null,G.dependencies=null,G.stateNode=null):(G.childLanes=te.childLanes,G.lanes=te.lanes,G.child=te.child,G.subtreeFlags=0,G.deletions=null,G.memoizedProps=te.memoizedProps,G.memoizedState=te.memoizedState,G.updateQueue=te.updateQueue,G.type=te.type,i=te.dependencies,G.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),c=c.sibling;return ot(ht,ht.current&1|2),n.child}i=i.sibling}G.tail!==null&&rt()>os&&(n.flags|=128,P=!0,Vs(G,!1),n.lanes=4194304)}else{if(!P)if(i=Tn(te),i!==null){if(n.flags|=128,P=!0,c=i.updateQueue,c!==null&&(n.updateQueue=c,n.flags|=4),Vs(G,!0),G.tail===null&&G.tailMode==="hidden"&&!te.alternate&&!ct)return Tt(n),null}else 2*rt()-G.renderingStartTime>os&&c!==1073741824&&(n.flags|=128,P=!0,Vs(G,!1),n.lanes=4194304);G.isBackwards?(te.sibling=n.child,n.child=te):(c=G.last,c!==null?c.sibling=te:n.child=te,G.last=te)}return G.tail!==null?(n=G.tail,G.rendering=n,G.tail=n.sibling,G.renderingStartTime=rt(),n.sibling=null,c=ht.current,ot(ht,P?c&1|2:c&1),n):(Tt(n),null);case 22:case 23:return La(),P=n.memoizedState!==null,i!==null&&i.memoizedState!==null!==P&&(n.flags|=8192),P&&(n.mode&1)!==0?(er&1073741824)!==0&&(Tt(n),n.subtreeFlags&6&&(n.flags|=8192)):Tt(n),null;case 24:return null;case 25:return null}throw Error(r(156,n.tag))}function yd(i,n){switch(Uo(n),n.tag){case 1:return qt(n.type)&&bn(),i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 3:return rs(),lt(Wt),lt(It),ea(),i=n.flags,(i&65536)!==0&&(i&128)===0?(n.flags=i&-65537|128,n):null;case 5:return Zo(n),null;case 13:if(lt(ht),i=n.memoizedState,i!==null&&i.dehydrated!==null){if(n.alternate===null)throw Error(r(340));Zi()}return i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 19:return lt(ht),null;case 4:return rs(),null;case 10:return Go(n.type._context),null;case 22:case 23:return La(),null;case 24:return null;default:return null}}var Wn=!1,jt=!1,bd=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function ss(i,n){var c=i.ref;if(c!==null)if(typeof c=="function")try{c(null)}catch(P){mt(i,n,P)}else c.current=null}function wa(i,n,c){try{c()}catch(P){mt(i,n,P)}}var Tu=!1;function Sd(i,n){if(Lo=cn,i=hl(),bo(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var P=c.getSelection&&c.getSelection();if(P&&P.rangeCount!==0){c=P.anchorNode;var q=P.anchorOffset,G=P.focusNode;P=P.focusOffset;try{c.nodeType,G.nodeType}catch{c=null;break e}var te=0,ue=-1,pe=-1,ye=0,ke=0,Fe=i,Ae=null;t:for(;;){for(var Oe;Fe!==c||q!==0&&Fe.nodeType!==3||(ue=te+q),Fe!==G||P!==0&&Fe.nodeType!==3||(pe=te+P),Fe.nodeType===3&&(te+=Fe.nodeValue.length),(Oe=Fe.firstChild)!==null;)Ae=Fe,Fe=Oe;for(;;){if(Fe===i)break t;if(Ae===c&&++ye===q&&(ue=te),Ae===G&&++ke===P&&(pe=te),(Oe=Fe.nextSibling)!==null)break;Fe=Ae,Ae=Fe.parentNode}Fe=Oe}c=ue===-1||pe===-1?null:{start:ue,end:pe}}else c=null}c=c||{start:0,end:0}}else c=null;for(Io={focusedElem:i,selectionRange:c},cn=!1,Ne=n;Ne!==null;)if(n=Ne,i=n.child,(n.subtreeFlags&1028)!==0&&i!==null)i.return=n,Ne=i;else for(;Ne!==null;){n=Ne;try{var Me=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Me!==null){var Ue=Me.memoizedProps,Ct=Me.memoizedState,xe=n.stateNode,me=xe.getSnapshotBeforeUpdate(n.elementType===n.type?Ue:gr(n.type,Ue),Ct);xe.__reactInternalSnapshotBeforeUpdate=me}break;case 3:var Ee=n.stateNode.containerInfo;Ee.nodeType===1?Ee.textContent="":Ee.nodeType===9&&Ee.documentElement&&Ee.removeChild(Ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Le){mt(n,n.return,Le)}if(i=n.sibling,i!==null){i.return=n.return,Ne=i;break}Ne=n.return}return Me=Tu,Tu=!1,Me}function Gs(i,n,c){var P=n.updateQueue;if(P=P!==null?P.lastEffect:null,P!==null){var q=P=P.next;do{if((q.tag&i)===i){var G=q.destroy;q.destroy=void 0,G!==void 0&&wa(n,c,G)}q=q.next}while(q!==P)}}function qn(i,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var c=n=n.next;do{if((c.tag&i)===i){var P=c.create;c.destroy=P()}c=c.next}while(c!==n)}}function xa(i){var n=i.ref;if(n!==null){var c=i.stateNode;switch(i.tag){case 5:i=c;break;default:i=c}typeof n=="function"?n(i):n.current=i}}function ju(i){var n=i.alternate;n!==null&&(i.alternate=null,ju(n)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(n=i.stateNode,n!==null&&(delete n[Sr],delete n[js],delete n[$o],delete n[ad],delete n[ld])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function $u(i){return i.tag===5||i.tag===3||i.tag===4}function Ou(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||$u(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Ea(i,n,c){var P=i.tag;if(P===5||P===6)i=i.stateNode,n?c.nodeType===8?c.parentNode.insertBefore(i,n):c.insertBefore(i,n):(c.nodeType===8?(n=c.parentNode,n.insertBefore(i,c)):(n=c,n.appendChild(i)),c=c._reactRootContainer,c!=null||n.onclick!==null||(n.onclick=En));else if(P!==4&&(i=i.child,i!==null))for(Ea(i,n,c),i=i.sibling;i!==null;)Ea(i,n,c),i=i.sibling}function ya(i,n,c){var P=i.tag;if(P===5||P===6)i=i.stateNode,n?c.insertBefore(i,n):c.appendChild(i);else if(P!==4&&(i=i.child,i!==null))for(ya(i,n,c),i=i.sibling;i!==null;)ya(i,n,c),i=i.sibling}var Ft=null,vr=!1;function oi(i,n,c){for(c=c.child;c!==null;)Nu(i,n,c),c=c.sibling}function Nu(i,n,c){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(Vr,c)}catch{}switch(c.tag){case 5:jt||ss(c,n);case 6:var P=Ft,q=vr;Ft=null,oi(i,n,c),Ft=P,vr=q,Ft!==null&&(vr?(i=Ft,c=c.stateNode,i.nodeType===8?i.parentNode.removeChild(c):i.removeChild(c)):Ft.removeChild(c.stateNode));break;case 18:Ft!==null&&(vr?(i=Ft,c=c.stateNode,i.nodeType===8?jo(i.parentNode,c):i.nodeType===1&&jo(i,c),Ss(i)):jo(Ft,c.stateNode));break;case 4:P=Ft,q=vr,Ft=c.stateNode.containerInfo,vr=!0,oi(i,n,c),Ft=P,vr=q;break;case 0:case 11:case 14:case 15:if(!jt&&(P=c.updateQueue,P!==null&&(P=P.lastEffect,P!==null))){q=P=P.next;do{var G=q,te=G.destroy;G=G.tag,te!==void 0&&((G&2)!==0||(G&4)!==0)&&wa(c,n,te),q=q.next}while(q!==P)}oi(i,n,c);break;case 1:if(!jt&&(ss(c,n),P=c.stateNode,typeof P.componentWillUnmount=="function"))try{P.props=c.memoizedProps,P.state=c.memoizedState,P.componentWillUnmount()}catch(ue){mt(c,n,ue)}oi(i,n,c);break;case 21:oi(i,n,c);break;case 22:c.mode&1?(jt=(P=jt)||c.memoizedState!==null,oi(i,n,c),jt=P):oi(i,n,c);break;default:oi(i,n,c)}}function Mu(i){var n=i.updateQueue;if(n!==null){i.updateQueue=null;var c=i.stateNode;c===null&&(c=i.stateNode=new bd),n.forEach(function(P){var q=Pd.bind(null,i,P);c.has(P)||(c.add(P),P.then(q,q))})}}function Cr(i,n){var c=n.deletions;if(c!==null)for(var P=0;P<c.length;P++){var q=c[P];try{var G=i,te=n,ue=te;e:for(;ue!==null;){switch(ue.tag){case 5:Ft=ue.stateNode,vr=!1;break e;case 3:Ft=ue.stateNode.containerInfo,vr=!0;break e;case 4:Ft=ue.stateNode.containerInfo,vr=!0;break e}ue=ue.return}if(Ft===null)throw Error(r(160));Nu(G,te,q),Ft=null,vr=!1;var pe=q.alternate;pe!==null&&(pe.return=null),q.return=null}catch(ye){mt(q,n,ye)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Uu(n,i),n=n.sibling}function Uu(i,n){var c=i.alternate,P=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Cr(n,i),Rr(i),P&4){try{Gs(3,i,i.return),qn(3,i)}catch(Ue){mt(i,i.return,Ue)}try{Gs(5,i,i.return)}catch(Ue){mt(i,i.return,Ue)}}break;case 1:Cr(n,i),Rr(i),P&512&&c!==null&&ss(c,c.return);break;case 5:if(Cr(n,i),Rr(i),P&512&&c!==null&&ss(c,c.return),i.flags&32){var q=i.stateNode;try{yt(q,"")}catch(Ue){mt(i,i.return,Ue)}}if(P&4&&(q=i.stateNode,q!=null)){var G=i.memoizedProps,te=c!==null?c.memoizedProps:G,ue=i.type,pe=i.updateQueue;if(i.updateQueue=null,pe!==null)try{ue==="input"&&G.type==="radio"&&G.name!=null&&Xe(q,G),Ti(ue,te);var ye=Ti(ue,G);for(te=0;te<pe.length;te+=2){var ke=pe[te],Fe=pe[te+1];ke==="style"?Pi(q,Fe):ke==="dangerouslySetInnerHTML"?Jt(q,Fe):ke==="children"?yt(q,Fe):N(q,ke,Fe,ye)}switch(ue){case"input":ze(q,G);break;case"textarea":Ot(q,G);break;case"select":var Ae=q._wrapperState.wasMultiple;q._wrapperState.wasMultiple=!!G.multiple;var Oe=G.value;Oe!=null?nt(q,!!G.multiple,Oe,!1):Ae!==!!G.multiple&&(G.defaultValue!=null?nt(q,!!G.multiple,G.defaultValue,!0):nt(q,!!G.multiple,G.multiple?[]:"",!1))}q[js]=G}catch(Ue){mt(i,i.return,Ue)}}break;case 6:if(Cr(n,i),Rr(i),P&4){if(i.stateNode===null)throw Error(r(162));q=i.stateNode,G=i.memoizedProps;try{q.nodeValue=G}catch(Ue){mt(i,i.return,Ue)}}break;case 3:if(Cr(n,i),Rr(i),P&4&&c!==null&&c.memoizedState.isDehydrated)try{Ss(n.containerInfo)}catch(Ue){mt(i,i.return,Ue)}break;case 4:Cr(n,i),Rr(i);break;case 13:Cr(n,i),Rr(i),q=i.child,q.flags&8192&&(G=q.memoizedState!==null,q.stateNode.isHidden=G,!G||q.alternate!==null&&q.alternate.memoizedState!==null||(Da=rt())),P&4&&Mu(i);break;case 22:if(ke=c!==null&&c.memoizedState!==null,i.mode&1?(jt=(ye=jt)||ke,Cr(n,i),jt=ye):Cr(n,i),Rr(i),P&8192){if(ye=i.memoizedState!==null,(i.stateNode.isHidden=ye)&&!ke&&(i.mode&1)!==0)for(Ne=i,ke=i.child;ke!==null;){for(Fe=Ne=ke;Ne!==null;){switch(Ae=Ne,Oe=Ae.child,Ae.tag){case 0:case 11:case 14:case 15:Gs(4,Ae,Ae.return);break;case 1:ss(Ae,Ae.return);var Me=Ae.stateNode;if(typeof Me.componentWillUnmount=="function"){P=Ae,c=Ae.return;try{n=P,Me.props=n.memoizedProps,Me.state=n.memoizedState,Me.componentWillUnmount()}catch(Ue){mt(P,c,Ue)}}break;case 5:ss(Ae,Ae.return);break;case 22:if(Ae.memoizedState!==null){Wu(Fe);continue}}Oe!==null?(Oe.return=Ae,Ne=Oe):Wu(Fe)}ke=ke.sibling}e:for(ke=null,Fe=i;;){if(Fe.tag===5){if(ke===null){ke=Fe;try{q=Fe.stateNode,ye?(G=q.style,typeof G.setProperty=="function"?G.setProperty("display","none","important"):G.display="none"):(ue=Fe.stateNode,pe=Fe.memoizedProps.style,te=pe!=null&&pe.hasOwnProperty("display")?pe.display:null,ue.style.display=pi("display",te))}catch(Ue){mt(i,i.return,Ue)}}}else if(Fe.tag===6){if(ke===null)try{Fe.stateNode.nodeValue=ye?"":Fe.memoizedProps}catch(Ue){mt(i,i.return,Ue)}}else if((Fe.tag!==22&&Fe.tag!==23||Fe.memoizedState===null||Fe===i)&&Fe.child!==null){Fe.child.return=Fe,Fe=Fe.child;continue}if(Fe===i)break e;for(;Fe.sibling===null;){if(Fe.return===null||Fe.return===i)break e;ke===Fe&&(ke=null),Fe=Fe.return}ke===Fe&&(ke=null),Fe.sibling.return=Fe.return,Fe=Fe.sibling}}break;case 19:Cr(n,i),Rr(i),P&4&&Mu(i);break;case 21:break;default:Cr(n,i),Rr(i)}}function Rr(i){var n=i.flags;if(n&2){try{e:{for(var c=i.return;c!==null;){if($u(c)){var P=c;break e}c=c.return}throw Error(r(160))}switch(P.tag){case 5:var q=P.stateNode;P.flags&32&&(yt(q,""),P.flags&=-33);var G=Ou(i);ya(i,G,q);break;case 3:case 4:var te=P.stateNode.containerInfo,ue=Ou(i);Ea(i,ue,te);break;default:throw Error(r(161))}}catch(pe){mt(i,i.return,pe)}i.flags&=-3}n&4096&&(i.flags&=-4097)}function Dd(i,n,c){Ne=i,zu(i)}function zu(i,n,c){for(var P=(i.mode&1)!==0;Ne!==null;){var q=Ne,G=q.child;if(q.tag===22&&P){var te=q.memoizedState!==null||Wn;if(!te){var ue=q.alternate,pe=ue!==null&&ue.memoizedState!==null||jt;ue=Wn;var ye=jt;if(Wn=te,(jt=pe)&&!ye)for(Ne=q;Ne!==null;)te=Ne,pe=te.child,te.tag===22&&te.memoizedState!==null?qu(q):pe!==null?(pe.return=te,Ne=pe):qu(q);for(;G!==null;)Ne=G,zu(G),G=G.sibling;Ne=q,Wn=ue,jt=ye}Hu(i)}else(q.subtreeFlags&8772)!==0&&G!==null?(G.return=q,Ne=G):Hu(i)}}function Hu(i){for(;Ne!==null;){var n=Ne;if((n.flags&8772)!==0){var c=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:jt||qn(5,n);break;case 1:var P=n.stateNode;if(n.flags&4&&!jt)if(c===null)P.componentDidMount();else{var q=n.elementType===n.type?c.memoizedProps:gr(n.type,c.memoizedProps);P.componentDidUpdate(q,c.memoizedState,P.__reactInternalSnapshotBeforeUpdate)}var G=n.updateQueue;G!==null&&Hl(n,G,P);break;case 3:var te=n.updateQueue;if(te!==null){if(c=null,n.child!==null)switch(n.child.tag){case 5:c=n.child.stateNode;break;case 1:c=n.child.stateNode}Hl(n,te,c)}break;case 5:var ue=n.stateNode;if(c===null&&n.flags&4){c=ue;var pe=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":pe.autoFocus&&c.focus();break;case"img":pe.src&&(c.src=pe.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var ye=n.alternate;if(ye!==null){var ke=ye.memoizedState;if(ke!==null){var Fe=ke.dehydrated;Fe!==null&&Ss(Fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}jt||n.flags&512&&xa(n)}catch(Ae){mt(n,n.return,Ae)}}if(n===i){Ne=null;break}if(c=n.sibling,c!==null){c.return=n.return,Ne=c;break}Ne=n.return}}function Wu(i){for(;Ne!==null;){var n=Ne;if(n===i){Ne=null;break}var c=n.sibling;if(c!==null){c.return=n.return,Ne=c;break}Ne=n.return}}function qu(i){for(;Ne!==null;){var n=Ne;try{switch(n.tag){case 0:case 11:case 15:var c=n.return;try{qn(4,n)}catch(pe){mt(n,c,pe)}break;case 1:var P=n.stateNode;if(typeof P.componentDidMount=="function"){var q=n.return;try{P.componentDidMount()}catch(pe){mt(n,q,pe)}}var G=n.return;try{xa(n)}catch(pe){mt(n,G,pe)}break;case 5:var te=n.return;try{xa(n)}catch(pe){mt(n,te,pe)}}}catch(pe){mt(n,n.return,pe)}if(n===i){Ne=null;break}var ue=n.sibling;if(ue!==null){ue.return=n.return,Ne=ue;break}Ne=n.return}}var Bd=Math.ceil,Vn=V.ReactCurrentDispatcher,ba=V.ReactCurrentOwner,lr=V.ReactCurrentBatchConfig,et=0,Bt=null,_t=null,Lt=0,er=0,ns=ti(0),Et=0,Ks=null,Ai=0,Gn=0,Sa=0,Js=null,Gt=null,Da=0,os=1/0,Nr=null,Kn=!1,Ba=null,ai=null,Jn=!1,li=null,Yn=0,Ys=0,Ra=null,Xn=-1,Zn=0;function Ut(){return(et&6)!==0?rt():Xn!==-1?Xn:Xn=rt()}function ui(i){return(i.mode&1)===0?1:(et&2)!==0&&Lt!==0?Lt&-Lt:cd.transition!==null?(Zn===0&&(Zn=Ze()),Zn):(i=Ye,i!==0||(i=window.event,i=i===void 0?16:Va(i.type)),i)}function _r(i,n,c,P){if(50<Ys)throw Ys=0,Ra=null,Error(r(185));st(i,c,P),((et&2)===0||i!==Bt)&&(i===Bt&&((et&2)===0&&(Gn|=c),Et===4&&ci(i,Lt)),Kt(i,P),c===1&&et===0&&(n.mode&1)===0&&(os=rt()+500,Dn&&ii()))}function Kt(i,n){var c=i.callbackNode;$e(i,n);var P=Se(i,i===Bt?Lt:0);if(P===0)c!==null&&gs(c),i.callbackNode=null,i.callbackPriority=0;else if(n=P&-P,i.callbackPriority!==n){if(c!=null&&gs(c),n===1)i.tag===0?ud(Gu.bind(null,i)):Fl(Gu.bind(null,i)),nd(function(){(et&6)===0&&ii()}),c=null;else{switch(rr(P)){case 1:c=_s;break;case 4:c=sn;break;case 16:c=qr;break;case 536870912:c=nn;break;default:c=qr}c=tc(c,Vu.bind(null,i))}i.callbackPriority=n,i.callbackNode=c}}function Vu(i,n){if(Xn=-1,Zn=0,(et&6)!==0)throw Error(r(327));var c=i.callbackNode;if(as()&&i.callbackNode!==c)return null;var P=Se(i,i===Bt?Lt:0);if(P===0)return null;if((P&30)!==0||(P&i.expiredLanes)!==0||n)n=Qn(i,P);else{n=P;var q=et;et|=2;var G=Ju();(Bt!==i||Lt!==n)&&(Nr=null,os=rt()+500,Fi(i,n));do try{kd();break}catch(ue){Ku(i,ue)}while(!0);Vo(),Vn.current=G,et=q,_t!==null?n=0:(Bt=null,Lt=0,n=Et)}if(n!==0){if(n===2&&(q=qe(i),q!==0&&(P=q,n=Aa(i,q))),n===1)throw c=Ks,Fi(i,0),ci(i,P),Kt(i,rt()),c;if(n===6)ci(i,P);else{if(q=i.current.alternate,(P&30)===0&&!Rd(q)&&(n=Qn(i,P),n===2&&(G=qe(i),G!==0&&(P=G,n=Aa(i,G))),n===1))throw c=Ks,Fi(i,0),ci(i,P),Kt(i,rt()),c;switch(i.finishedWork=q,i.finishedLanes=P,n){case 0:case 1:throw Error(r(345));case 2:Li(i,Gt,Nr);break;case 3:if(ci(i,P),(P&130023424)===P&&(n=Da+500-rt(),10<n)){if(Se(i,0)!==0)break;if(q=i.suspendedLanes,(q&P)!==P){Ut(),i.pingedLanes|=i.suspendedLanes&q;break}i.timeoutHandle=To(Li.bind(null,i,Gt,Nr),n);break}Li(i,Gt,Nr);break;case 4:if(ci(i,P),(P&4194240)===P)break;for(n=i.eventTimes,q=-1;0<P;){var te=31-Yt(P);G=1<<te,te=n[te],te>q&&(q=te),P&=~G}if(P=q,P=rt()-P,P=(120>P?120:480>P?480:1080>P?1080:1920>P?1920:3e3>P?3e3:4320>P?4320:1960*Bd(P/1960))-P,10<P){i.timeoutHandle=To(Li.bind(null,i,Gt,Nr),P);break}Li(i,Gt,Nr);break;case 5:Li(i,Gt,Nr);break;default:throw Error(r(329))}}}return Kt(i,rt()),i.callbackNode===c?Vu.bind(null,i):null}function Aa(i,n){var c=Js;return i.current.memoizedState.isDehydrated&&(Fi(i,n).flags|=256),i=Qn(i,n),i!==2&&(n=Gt,Gt=c,n!==null&&ka(n)),i}function ka(i){Gt===null?Gt=i:Gt.push.apply(Gt,i)}function Rd(i){for(var n=i;;){if(n.flags&16384){var c=n.updateQueue;if(c!==null&&(c=c.stores,c!==null))for(var P=0;P<c.length;P++){var q=c[P],G=q.getSnapshot;q=q.value;try{if(!fr(G(),q))return!1}catch{return!1}}}if(c=n.child,n.subtreeFlags&16384&&c!==null)c.return=n,n=c;else{if(n===i)break;for(;n.sibling===null;){if(n.return===null||n.return===i)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ci(i,n){for(n&=~Sa,n&=~Gn,i.suspendedLanes|=n,i.pingedLanes&=~n,i=i.expirationTimes;0<n;){var c=31-Yt(n),P=1<<c;i[c]=-1,n&=~P}}function Gu(i){if((et&6)!==0)throw Error(r(327));as();var n=Se(i,0);if((n&1)===0)return Kt(i,rt()),null;var c=Qn(i,n);if(i.tag!==0&&c===2){var P=qe(i);P!==0&&(n=P,c=Aa(i,P))}if(c===1)throw c=Ks,Fi(i,0),ci(i,n),Kt(i,rt()),c;if(c===6)throw Error(r(345));return i.finishedWork=i.current.alternate,i.finishedLanes=n,Li(i,Gt,Nr),Kt(i,rt()),null}function Fa(i,n){var c=et;et|=1;try{return i(n)}finally{et=c,et===0&&(os=rt()+500,Dn&&ii())}}function ki(i){li!==null&&li.tag===0&&(et&6)===0&&as();var n=et;et|=1;var c=lr.transition,P=Ye;try{if(lr.transition=null,Ye=1,i)return i()}finally{Ye=P,lr.transition=c,et=n,(et&6)===0&&ii()}}function La(){er=ns.current,lt(ns)}function Fi(i,n){i.finishedWork=null,i.finishedLanes=0;var c=i.timeoutHandle;if(c!==-1&&(i.timeoutHandle=-1,sd(c)),_t!==null)for(c=_t.return;c!==null;){var P=c;switch(Uo(P),P.tag){case 1:P=P.type.childContextTypes,P!=null&&bn();break;case 3:rs(),lt(Wt),lt(It),ea();break;case 5:Zo(P);break;case 4:rs();break;case 13:lt(ht);break;case 19:lt(ht);break;case 10:Go(P.type._context);break;case 22:case 23:La()}c=c.return}if(Bt=i,_t=i=di(i.current,null),Lt=er=n,Et=0,Ks=null,Sa=Gn=Ai=0,Gt=Js=null,Di!==null){for(n=0;n<Di.length;n++)if(c=Di[n],P=c.interleaved,P!==null){c.interleaved=null;var q=P.next,G=c.pending;if(G!==null){var te=G.next;G.next=q,P.next=te}c.pending=P}Di=null}return i}function Ku(i,n){do{var c=_t;try{if(Vo(),jn.current=Mn,$n){for(var P=pt.memoizedState;P!==null;){var q=P.queue;q!==null&&(q.pending=null),P=P.next}$n=!1}if(Ri=0,Dt=xt=pt=null,zs=!1,Hs=0,ba.current=null,c===null||c.return===null){Et=1,Ks=n,_t=null;break}e:{var G=i,te=c.return,ue=c,pe=n;if(n=Lt,ue.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var ye=pe,ke=ue,Fe=ke.tag;if((ke.mode&1)===0&&(Fe===0||Fe===11||Fe===15)){var Ae=ke.alternate;Ae?(ke.updateQueue=Ae.updateQueue,ke.memoizedState=Ae.memoizedState,ke.lanes=Ae.lanes):(ke.updateQueue=null,ke.memoizedState=null)}var Oe=_u(te);if(Oe!==null){Oe.flags&=-257,wu(Oe,te,ue,G,n),Oe.mode&1&&Cu(G,ye,n),n=Oe,pe=ye;var Me=n.updateQueue;if(Me===null){var Ue=new Set;Ue.add(pe),n.updateQueue=Ue}else Me.add(pe);break e}else{if((n&1)===0){Cu(G,ye,n),Ia();break e}pe=Error(r(426))}}else if(ct&&ue.mode&1){var Ct=_u(te);if(Ct!==null){(Ct.flags&65536)===0&&(Ct.flags|=256),wu(Ct,te,ue,G,n),Wo(is(pe,ue));break e}}G=pe=is(pe,ue),Et!==4&&(Et=2),Js===null?Js=[G]:Js.push(G),G=te;do{switch(G.tag){case 3:G.flags|=65536,n&=-n,G.lanes|=n;var xe=gu(G,pe,n);zl(G,xe);break e;case 1:ue=pe;var me=G.type,Ee=G.stateNode;if((G.flags&128)===0&&(typeof me.getDerivedStateFromError=="function"||Ee!==null&&typeof Ee.componentDidCatch=="function"&&(ai===null||!ai.has(Ee)))){G.flags|=65536,n&=-n,G.lanes|=n;var Le=vu(G,ue,n);zl(G,Le);break e}}G=G.return}while(G!==null)}Xu(c)}catch(He){n=He,_t===c&&c!==null&&(_t=c=c.return);continue}break}while(!0)}function Ju(){var i=Vn.current;return Vn.current=Mn,i===null?Mn:i}function Ia(){(Et===0||Et===3||Et===2)&&(Et=4),Bt===null||(Ai&268435455)===0&&(Gn&268435455)===0||ci(Bt,Lt)}function Qn(i,n){var c=et;et|=2;var P=Ju();(Bt!==i||Lt!==n)&&(Nr=null,Fi(i,n));do try{Ad();break}catch(q){Ku(i,q)}while(!0);if(Vo(),et=c,Vn.current=P,_t!==null)throw Error(r(261));return Bt=null,Lt=0,Et}function Ad(){for(;_t!==null;)Yu(_t)}function kd(){for(;_t!==null&&!vs();)Yu(_t)}function Yu(i){var n=ec(i.alternate,i,er);i.memoizedProps=i.pendingProps,n===null?Xu(i):_t=n,ba.current=null}function Xu(i){var n=i;do{var c=n.alternate;if(i=n.return,(n.flags&32768)===0){if(c=Ed(c,n,er),c!==null){_t=c;return}}else{if(c=yd(c,n),c!==null){c.flags&=32767,_t=c;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Et=6,_t=null;return}}if(n=n.sibling,n!==null){_t=n;return}_t=n=i}while(n!==null);Et===0&&(Et=5)}function Li(i,n,c){var P=Ye,q=lr.transition;try{lr.transition=null,Ye=1,Fd(i,n,c,P)}finally{lr.transition=q,Ye=P}return null}function Fd(i,n,c,P){do as();while(li!==null);if((et&6)!==0)throw Error(r(327));c=i.finishedWork;var q=i.finishedLanes;if(c===null)return null;if(i.finishedWork=null,i.finishedLanes=0,c===i.current)throw Error(r(177));i.callbackNode=null,i.callbackPriority=0;var G=c.lanes|c.childLanes;if(ft(i,G),i===Bt&&(_t=Bt=null,Lt=0),(c.subtreeFlags&2064)===0&&(c.flags&2064)===0||Jn||(Jn=!0,tc(qr,function(){return as(),null})),G=(c.flags&15990)!==0,(c.subtreeFlags&15990)!==0||G){G=lr.transition,lr.transition=null;var te=Ye;Ye=1;var ue=et;et|=4,ba.current=null,Sd(i,c),Uu(c,i),Xc(Io),cn=!!Lo,Io=Lo=null,i.current=c,Dd(c),Cs(),et=ue,Ye=te,lr.transition=G}else i.current=c;if(Jn&&(Jn=!1,li=i,Yn=q),G=i.pendingLanes,G===0&&(ai=null),ws(c.stateNode),Kt(i,rt()),n!==null)for(P=i.onRecoverableError,c=0;c<n.length;c++)q=n[c],P(q.value,{componentStack:q.stack,digest:q.digest});if(Kn)throw Kn=!1,i=Ba,Ba=null,i;return(Yn&1)!==0&&i.tag!==0&&as(),G=i.pendingLanes,(G&1)!==0?i===Ra?Ys++:(Ys=0,Ra=i):Ys=0,ii(),null}function as(){if(li!==null){var i=rr(Yn),n=lr.transition,c=Ye;try{if(lr.transition=null,Ye=16>i?16:i,li===null)var P=!1;else{if(i=li,li=null,Yn=0,(et&6)!==0)throw Error(r(331));var q=et;for(et|=4,Ne=i.current;Ne!==null;){var G=Ne,te=G.child;if((Ne.flags&16)!==0){var ue=G.deletions;if(ue!==null){for(var pe=0;pe<ue.length;pe++){var ye=ue[pe];for(Ne=ye;Ne!==null;){var ke=Ne;switch(ke.tag){case 0:case 11:case 15:Gs(8,ke,G)}var Fe=ke.child;if(Fe!==null)Fe.return=ke,Ne=Fe;else for(;Ne!==null;){ke=Ne;var Ae=ke.sibling,Oe=ke.return;if(ju(ke),ke===ye){Ne=null;break}if(Ae!==null){Ae.return=Oe,Ne=Ae;break}Ne=Oe}}}var Me=G.alternate;if(Me!==null){var Ue=Me.child;if(Ue!==null){Me.child=null;do{var Ct=Ue.sibling;Ue.sibling=null,Ue=Ct}while(Ue!==null)}}Ne=G}}if((G.subtreeFlags&2064)!==0&&te!==null)te.return=G,Ne=te;else e:for(;Ne!==null;){if(G=Ne,(G.flags&2048)!==0)switch(G.tag){case 0:case 11:case 15:Gs(9,G,G.return)}var xe=G.sibling;if(xe!==null){xe.return=G.return,Ne=xe;break e}Ne=G.return}}var me=i.current;for(Ne=me;Ne!==null;){te=Ne;var Ee=te.child;if((te.subtreeFlags&2064)!==0&&Ee!==null)Ee.return=te,Ne=Ee;else e:for(te=me;Ne!==null;){if(ue=Ne,(ue.flags&2048)!==0)try{switch(ue.tag){case 0:case 11:case 15:qn(9,ue)}}catch(He){mt(ue,ue.return,He)}if(ue===te){Ne=null;break e}var Le=ue.sibling;if(Le!==null){Le.return=ue.return,Ne=Le;break e}Ne=ue.return}}if(et=q,ii(),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(Vr,i)}catch{}P=!0}return P}finally{Ye=c,lr.transition=n}}return!1}function Zu(i,n,c){n=is(c,n),n=gu(i,n,1),i=ni(i,n,1),n=Ut(),i!==null&&(st(i,1,n),Kt(i,n))}function mt(i,n,c){if(i.tag===3)Zu(i,i,c);else for(;n!==null;){if(n.tag===3){Zu(n,i,c);break}else if(n.tag===1){var P=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof P.componentDidCatch=="function"&&(ai===null||!ai.has(P))){i=is(c,i),i=vu(n,i,1),n=ni(n,i,1),i=Ut(),n!==null&&(st(n,1,i),Kt(n,i));break}}n=n.return}}function Ld(i,n,c){var P=i.pingCache;P!==null&&P.delete(n),n=Ut(),i.pingedLanes|=i.suspendedLanes&c,Bt===i&&(Lt&c)===c&&(Et===4||Et===3&&(Lt&130023424)===Lt&&500>rt()-Da?Fi(i,0):Sa|=c),Kt(i,n)}function Qu(i,n){n===0&&((i.mode&1)===0?n=1:(n=Ni,Ni<<=1,(Ni&130023424)===0&&(Ni=4194304)));var c=Ut();i=jr(i,n),i!==null&&(st(i,n,c),Kt(i,c))}function Id(i){var n=i.memoizedState,c=0;n!==null&&(c=n.retryLane),Qu(i,c)}function Pd(i,n){var c=0;switch(i.tag){case 13:var P=i.stateNode,q=i.memoizedState;q!==null&&(c=q.retryLane);break;case 19:P=i.stateNode;break;default:throw Error(r(314))}P!==null&&P.delete(n),Qu(i,c)}var ec;ec=function(i,n,c){if(i!==null)if(i.memoizedProps!==n.pendingProps||Wt.current)Vt=!0;else{if((i.lanes&c)===0&&(n.flags&128)===0)return Vt=!1,xd(i,n,c);Vt=(i.flags&131072)!==0}else Vt=!1,ct&&(n.flags&1048576)!==0&&Ll(n,Rn,n.index);switch(n.lanes=0,n.tag){case 2:var P=n.type;Hn(i,n),i=n.pendingProps;var q=Ji(n,It.current);ts(n,c),q=ia(null,n,P,i,q,c);var G=sa();return n.flags|=1,typeof q=="object"&&q!==null&&typeof q.render=="function"&&q.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,qt(P)?(G=!0,Sn(n)):G=!1,n.memoizedState=q.state!==null&&q.state!==void 0?q.state:null,Yo(n),q.updater=Un,n.stateNode=q,q._reactInternals=n,ca(n,P,i,c),n=fa(null,n,P,!0,G,c)):(n.tag=0,ct&&G&&Mo(n),Mt(null,n,q,c),n=n.child),n;case 16:P=n.elementType;e:{switch(Hn(i,n),i=n.pendingProps,q=P._init,P=q(P._payload),n.type=P,q=n.tag=jd(P),i=gr(P,i),q){case 0:n=pa(null,n,P,i,c);break e;case 1:n=Du(null,n,P,i,c);break e;case 11:n=xu(null,n,P,i,c);break e;case 14:n=Eu(null,n,P,gr(P.type,i),c);break e}throw Error(r(306,P,""))}return n;case 0:return P=n.type,q=n.pendingProps,q=n.elementType===P?q:gr(P,q),pa(i,n,P,q,c);case 1:return P=n.type,q=n.pendingProps,q=n.elementType===P?q:gr(P,q),Du(i,n,P,q,c);case 3:e:{if(Bu(n),i===null)throw Error(r(387));P=n.pendingProps,G=n.memoizedState,q=G.element,Ul(i,n),Pn(n,P,null,c);var te=n.memoizedState;if(P=te.element,G.isDehydrated)if(G={element:P,isDehydrated:!1,cache:te.cache,pendingSuspenseBoundaries:te.pendingSuspenseBoundaries,transitions:te.transitions},n.updateQueue.baseState=G,n.memoizedState=G,n.flags&256){q=is(Error(r(423)),n),n=Ru(i,n,P,c,q);break e}else if(P!==q){q=is(Error(r(424)),n),n=Ru(i,n,P,c,q);break e}else for(Qt=ei(n.stateNode.containerInfo.firstChild),Zt=n,ct=!0,mr=null,c=Nl(n,null,P,c),n.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Zi(),P===q){n=Or(i,n,c);break e}Mt(i,n,P,c)}n=n.child}return n;case 5:return Wl(n),i===null&&Ho(n),P=n.type,q=n.pendingProps,G=i!==null?i.memoizedProps:null,te=q.children,Po(P,q)?te=null:G!==null&&Po(P,G)&&(n.flags|=32),Su(i,n),Mt(i,n,te,c),n.child;case 6:return i===null&&Ho(n),null;case 13:return Au(i,n,c);case 4:return Xo(n,n.stateNode.containerInfo),P=n.pendingProps,i===null?n.child=Qi(n,null,P,c):Mt(i,n,P,c),n.child;case 11:return P=n.type,q=n.pendingProps,q=n.elementType===P?q:gr(P,q),xu(i,n,P,q,c);case 7:return Mt(i,n,n.pendingProps,c),n.child;case 8:return Mt(i,n,n.pendingProps.children,c),n.child;case 12:return Mt(i,n,n.pendingProps.children,c),n.child;case 10:e:{if(P=n.type._context,q=n.pendingProps,G=n.memoizedProps,te=q.value,ot(Fn,P._currentValue),P._currentValue=te,G!==null)if(fr(G.value,te)){if(G.children===q.children&&!Wt.current){n=Or(i,n,c);break e}}else for(G=n.child,G!==null&&(G.return=n);G!==null;){var ue=G.dependencies;if(ue!==null){te=G.child;for(var pe=ue.firstContext;pe!==null;){if(pe.context===P){if(G.tag===1){pe=$r(-1,c&-c),pe.tag=2;var ye=G.updateQueue;if(ye!==null){ye=ye.shared;var ke=ye.pending;ke===null?pe.next=pe:(pe.next=ke.next,ke.next=pe),ye.pending=pe}}G.lanes|=c,pe=G.alternate,pe!==null&&(pe.lanes|=c),Ko(G.return,c,n),ue.lanes|=c;break}pe=pe.next}}else if(G.tag===10)te=G.type===n.type?null:G.child;else if(G.tag===18){if(te=G.return,te===null)throw Error(r(341));te.lanes|=c,ue=te.alternate,ue!==null&&(ue.lanes|=c),Ko(te,c,n),te=G.sibling}else te=G.child;if(te!==null)te.return=G;else for(te=G;te!==null;){if(te===n){te=null;break}if(G=te.sibling,G!==null){G.return=te.return,te=G;break}te=te.return}G=te}Mt(i,n,q.children,c),n=n.child}return n;case 9:return q=n.type,P=n.pendingProps.children,ts(n,c),q=or(q),P=P(q),n.flags|=1,Mt(i,n,P,c),n.child;case 14:return P=n.type,q=gr(P,n.pendingProps),q=gr(P.type,q),Eu(i,n,P,q,c);case 15:return yu(i,n,n.type,n.pendingProps,c);case 17:return P=n.type,q=n.pendingProps,q=n.elementType===P?q:gr(P,q),Hn(i,n),n.tag=1,qt(P)?(i=!0,Sn(n)):i=!1,ts(n,c),fu(n,P,q),ca(n,P,q,c),fa(null,n,P,!0,i,c);case 19:return Fu(i,n,c);case 22:return bu(i,n,c)}throw Error(r(156,n.tag))};function tc(i,n){return ms(i,n)}function Td(i,n,c,P){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=P,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ur(i,n,c,P){return new Td(i,n,c,P)}function Pa(i){return i=i.prototype,!(!i||!i.isReactComponent)}function jd(i){if(typeof i=="function")return Pa(i)?1:0;if(i!=null){if(i=i.$$typeof,i===le)return 11;if(i===_e)return 14}return 2}function di(i,n){var c=i.alternate;return c===null?(c=ur(i.tag,n,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=n,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&14680064,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,n=i.dependencies,c.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c}function eo(i,n,c,P,q,G){var te=2;if(P=i,typeof i=="function")Pa(i)&&(te=1);else if(typeof i=="string")te=5;else e:switch(i){case Z:return Ii(c.children,q,G,n);case K:te=8,q|=8;break;case ee:return i=ur(12,c,n,q|2),i.elementType=ee,i.lanes=G,i;case ne:return i=ur(13,c,n,q),i.elementType=ne,i.lanes=G,i;case ae:return i=ur(19,c,n,q),i.elementType=ae,i.lanes=G,i;case ge:return to(c,q,G,n);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case oe:te=10;break e;case ce:te=9;break e;case le:te=11;break e;case _e:te=14;break e;case fe:te=16,P=null;break e}throw Error(r(130,i==null?i:typeof i,""))}return n=ur(te,c,n,q),n.elementType=i,n.type=P,n.lanes=G,n}function Ii(i,n,c,P){return i=ur(7,i,P,n),i.lanes=c,i}function to(i,n,c,P){return i=ur(22,i,P,n),i.elementType=ge,i.lanes=c,i.stateNode={isHidden:!1},i}function Ta(i,n,c){return i=ur(6,i,null,n),i.lanes=c,i}function ja(i,n,c){return n=ur(4,i.children!==null?i.children:[],i.key,n),n.lanes=c,n.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},n}function $d(i,n,c,P,q){this.tag=n,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qe(0),this.expirationTimes=Qe(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.identifierPrefix=P,this.onRecoverableError=q,this.mutableSourceEagerHydrationData=null}function $a(i,n,c,P,q,G,te,ue,pe){return i=new $d(i,n,c,ue,pe),n===1?(n=1,G===!0&&(n|=8)):n=0,G=ur(3,null,null,n),i.current=G,G.stateNode=i,G.memoizedState={element:P,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yo(G),i}function Od(i,n,c){var P=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Y,key:P==null?null:""+P,children:i,containerInfo:n,implementation:c}}function rc(i){if(!i)return ri;i=i._reactInternals;e:{if(tr(i)!==i||i.tag!==1)throw Error(r(170));var n=i;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(qt(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(r(171))}if(i.tag===1){var c=i.type;if(qt(c))return Al(i,c,n)}return n}function ic(i,n,c,P,q,G,te,ue,pe){return i=$a(c,P,!0,i,q,G,te,ue,pe),i.context=rc(null),c=i.current,P=Ut(),q=ui(c),G=$r(P,q),G.callback=n??null,ni(c,G,q),i.current.lanes=q,st(i,q,P),Kt(i,P),i}function ro(i,n,c,P){var q=n.current,G=Ut(),te=ui(q);return c=rc(c),n.context===null?n.context=c:n.pendingContext=c,n=$r(G,te),n.payload={element:i},P=P===void 0?null:P,P!==null&&(n.callback=P),i=ni(q,n,te),i!==null&&(_r(i,q,te,G),In(i,q,te)),te}function io(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function sc(i,n){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<n?c:n}}function Oa(i,n){sc(i,n),(i=i.alternate)&&sc(i,n)}function Nd(){return null}var nc=typeof reportError=="function"?reportError:function(i){console.error(i)};function Na(i){this._internalRoot=i}so.prototype.render=Na.prototype.render=function(i){var n=this._internalRoot;if(n===null)throw Error(r(409));ro(i,n,null,null)},so.prototype.unmount=Na.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var n=i.containerInfo;ki(function(){ro(null,i,null,null)}),n[Lr]=null}};function so(i){this._internalRoot=i}so.prototype.unstable_scheduleHydration=function(i){if(i){var n=Fr();i={blockedOn:null,target:i,priority:n};for(var c=0;c<Xr.length&&n!==0&&n<Xr[c].priority;c++);Xr.splice(c,0,i),c===0&&Wa(i)}};function Ma(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function no(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function oc(){}function Md(i,n,c,P,q){if(q){if(typeof P=="function"){var G=P;P=function(){var ye=io(te);G.call(ye)}}var te=ic(n,P,i,0,null,!1,!1,"",oc);return i._reactRootContainer=te,i[Lr]=te.current,Ps(i.nodeType===8?i.parentNode:i),ki(),te}for(;q=i.lastChild;)i.removeChild(q);if(typeof P=="function"){var ue=P;P=function(){var ye=io(pe);ue.call(ye)}}var pe=$a(i,0,!1,null,null,!1,!1,"",oc);return i._reactRootContainer=pe,i[Lr]=pe.current,Ps(i.nodeType===8?i.parentNode:i),ki(function(){ro(n,pe,c,P)}),pe}function oo(i,n,c,P,q){var G=c._reactRootContainer;if(G){var te=G;if(typeof q=="function"){var ue=q;q=function(){var pe=io(te);ue.call(pe)}}ro(n,te,i,q)}else te=Md(c,n,i,q,P);return io(te)}br=function(i){switch(i.tag){case 3:var n=i.stateNode;if(n.current.memoizedState.isDehydrated){var c=ve(n.pendingLanes);c!==0&&(St(n,c|1),Kt(n,rt()),(et&6)===0&&(os=rt()+500,ii()))}break;case 13:ki(function(){var P=jr(i,1);if(P!==null){var q=Ut();_r(P,i,1,q)}}),Oa(i,1)}},kt=function(i){if(i.tag===13){var n=jr(i,134217728);if(n!==null){var c=Ut();_r(n,i,134217728,c)}Oa(i,134217728)}},ir=function(i){if(i.tag===13){var n=ui(i),c=jr(i,n);if(c!==null){var P=Ut();_r(c,i,n,P)}Oa(i,n)}},Fr=function(){return Ye},Gr=function(i,n){var c=Ye;try{return Ye=i,n()}finally{Ye=c}},cs=function(i,n,c){switch(n){case"input":if(ze(i,c),n=c.name,c.type==="radio"&&n!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<c.length;n++){var P=c[n];if(P!==i&&P.form===i.form){var q=yn(P);if(!q)throw Error(r(90));Pe(P),ze(P,q)}}}break;case"textarea":Ot(i,c);break;case"select":n=c.value,n!=null&&nt(i,!!c.multiple,n,!1)}},rn=Fa,Ur=ki;var Ud={usingClientEntryPoint:!1,Events:[$s,Gi,yn,tn,ds,Fa]},Xs={findFiberByHostInstance:Ei,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zd={bundleType:Xs.bundleType,version:Xs.version,rendererPackageName:Xs.rendererPackageName,rendererConfig:Xs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:V.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Oi(i),i===null?null:i.stateNode},findFiberByHostInstance:Xs.findFiberByHostInstance||Nd,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ao=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ao.isDisabled&&ao.supportsFiber)try{Vr=ao.inject(zd),Ht=ao}catch{}}return reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ud,reactDom_production_min.createPortal=function(i,n){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ma(n))throw Error(r(200));return Od(i,n,null,c)},reactDom_production_min.createRoot=function(i,n){if(!Ma(i))throw Error(r(299));var c=!1,P="",q=nc;return n!=null&&(n.unstable_strictMode===!0&&(c=!0),n.identifierPrefix!==void 0&&(P=n.identifierPrefix),n.onRecoverableError!==void 0&&(q=n.onRecoverableError)),n=$a(i,1,!1,null,null,c,!1,P,q),i[Lr]=n.current,Ps(i.nodeType===8?i.parentNode:i),new Na(n)},reactDom_production_min.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var n=i._reactInternals;if(n===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=Oi(n),i=i===null?null:i.stateNode,i},reactDom_production_min.flushSync=function(i){return ki(i)},reactDom_production_min.hydrate=function(i,n,c){if(!no(n))throw Error(r(200));return oo(null,i,n,!0,c)},reactDom_production_min.hydrateRoot=function(i,n,c){if(!Ma(i))throw Error(r(405));var P=c!=null&&c.hydratedSources||null,q=!1,G="",te=nc;if(c!=null&&(c.unstable_strictMode===!0&&(q=!0),c.identifierPrefix!==void 0&&(G=c.identifierPrefix),c.onRecoverableError!==void 0&&(te=c.onRecoverableError)),n=ic(n,null,i,1,c??null,q,!1,G,te),i[Lr]=n.current,Ps(i),P)for(i=0;i<P.length;i++)c=P[i],q=c._getVersion,q=q(c._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[c,q]:n.mutableSourceEagerHydrationData.push(c,q);return new so(n)},reactDom_production_min.render=function(i,n,c){if(!no(n))throw Error(r(200));return oo(null,i,n,!1,c)},reactDom_production_min.unmountComponentAtNode=function(i){if(!no(i))throw Error(r(40));return i._reactRootContainer?(ki(function(){oo(null,null,i,!1,function(){i._reactRootContainer=null,i[Lr]=null})}),!0):!1},reactDom_production_min.unstable_batchedUpdates=Fa,reactDom_production_min.unstable_renderSubtreeIntoContainer=function(i,n,c,P){if(!no(c))throw Error(r(200));if(i==null||i._reactInternals===void 0)throw Error(r(38));return oo(i,n,c,!1,P)},reactDom_production_min.version="18.3.1-next-f1338f8080-20240426",reactDom_production_min}var hasRequiredReactDom;function requireReactDom(){if(hasRequiredReactDom)return reactDom.exports;hasRequiredReactDom=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),reactDom.exports=requireReactDom_production_min(),reactDom.exports}var hasRequiredClient;function requireClient(){if(hasRequiredClient)return client;hasRequiredClient=1;var e=requireReactDom();return client.createRoot=e.createRoot,client.hydrateRoot=e.hydrateRoot,client}var clientExports=requireClient();requireReactDom();/**
|
|
41
|
-
* @remix-run/router v1.23.2
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Remix Software Inc.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
-
*
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},_extends$2.apply(this,arguments)}var Action;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Action||(Action={}));const PopStateEventType="popstate";function createBrowserHistory(e){e===void 0&&(e={});function t(s,o){let{pathname:u,search:d,hash:a}=s.location;return createLocation("",{pathname:u,search:d,hash:a},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(s,o){return typeof o=="string"?o:createPath(o)}return getUrlBasedHistory(t,r,null,e)}function invariant(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function warning(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function createKey(){return Math.random().toString(36).substr(2,8)}function getHistoryState(e,t){return{usr:e.state,key:e.key,idx:t}}function createLocation(e,t,r,s){return r===void 0&&(r=null),_extends$2({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?parsePath(t):t,{state:r,key:t&&t.key||s||createKey()})}function createPath(e){let{pathname:t="/",search:r="",hash:s=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function parsePath(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function getUrlBasedHistory(e,t,r,s){s===void 0&&(s={});let{window:o=document.defaultView,v5Compat:u=!1}=s,d=o.history,a=Action.Pop,l=null,f=C();f==null&&(f=0,d.replaceState(_extends$2({},d.state,{idx:f}),""));function C(){return(d.state||{idx:null}).idx}function h(){a=Action.Pop;let x=C(),L=x==null?null:x-f;f=x,l&&l({action:a,location:H.location,delta:L})}function j(x,L){a=Action.Push;let R=createLocation(H.location,x,L);f=C()+1;let N=getHistoryState(R,f),V=H.createHref(R);try{d.pushState(N,"",V)}catch(J){if(J instanceof DOMException&&J.name==="DataCloneError")throw J;o.location.assign(V)}u&&l&&l({action:a,location:H.location,delta:1})}function U(x,L){a=Action.Replace;let R=createLocation(H.location,x,L);f=C();let N=getHistoryState(R,f),V=H.createHref(R);d.replaceState(N,"",V),u&&l&&l({action:a,location:H.location,delta:0})}function W(x){let L=o.location.origin!=="null"?o.location.origin:o.location.href,R=typeof x=="string"?x:createPath(x);return R=R.replace(/ $/,"%20"),invariant(L,"No window.location.(origin|href) available to create URL for href: "+R),new URL(R,L)}let H={get action(){return a},get location(){return e(o,d)},listen(x){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(PopStateEventType,h),l=x,()=>{o.removeEventListener(PopStateEventType,h),l=null}},createHref(x){return t(o,x)},createURL:W,encodeLocation(x){let L=W(x);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:j,replace:U,go(x){return d.go(x)}};return H}var ResultType;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ResultType||(ResultType={}));function matchRoutes(e,t,r){return r===void 0&&(r="/"),matchRoutesImpl(e,t,r)}function matchRoutesImpl(e,t,r,s){let o=typeof t=="string"?parsePath(t):t,u=stripBasename(o.pathname||"/",r);if(u==null)return null;let d=flattenRoutes(e);rankRouteBranches(d);let a=null;for(let l=0;a==null&&l<d.length;++l){let f=decodePath(u);a=matchRouteBranch(d[l],f)}return a}function flattenRoutes(e,t,r,s){t===void 0&&(t=[]),r===void 0&&(r=[]),s===void 0&&(s="");let o=(u,d,a)=>{let l={relativePath:a===void 0?u.path||"":a,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};l.relativePath.startsWith("/")&&(invariant(l.relativePath.startsWith(s),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(s.length));let f=joinPaths([s,l.relativePath]),C=r.concat(l);u.children&&u.children.length>0&&(invariant(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),flattenRoutes(u.children,t,C,f)),!(u.path==null&&!u.index)&&t.push({path:f,score:computeScore(f,u.index),routesMeta:C})};return e.forEach((u,d)=>{var a;if(u.path===""||!((a=u.path)!=null&&a.includes("?")))o(u,d);else for(let l of explodeOptionalSegments(u.path))o(u,d,l)}),t}function explodeOptionalSegments(e){let t=e.split("/");if(t.length===0)return[];let[r,...s]=t,o=r.endsWith("?"),u=r.replace(/\?$/,"");if(s.length===0)return o?[u,""]:[u];let d=explodeOptionalSegments(s.join("/")),a=[];return a.push(...d.map(l=>l===""?u:[u,l].join("/"))),o&&a.push(...d),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function rankRouteBranches(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:compareIndexes(t.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}const paramRe=/^:[\w-]+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=e=>e==="*";function computeScore(e,t){let r=e.split("/"),s=r.length;return r.some(isSplat)&&(s+=splatPenalty),t&&(s+=indexRouteValue),r.filter(o=>!isSplat(o)).reduce((o,u)=>o+(paramRe.test(u)?dynamicSegmentValue:u===""?emptySegmentValue:staticSegmentValue),s)}function compareIndexes(e,t){return e.length===t.length&&e.slice(0,-1).every((s,o)=>s===t[o])?e[e.length-1]-t[t.length-1]:0}function matchRouteBranch(e,t,r){let{routesMeta:s}=e,o={},u="/",d=[];for(let a=0;a<s.length;++a){let l=s[a],f=a===s.length-1,C=u==="/"?t:t.slice(u.length)||"/",h=matchPath({path:l.relativePath,caseSensitive:l.caseSensitive,end:f},C),j=l.route;if(!h)return null;Object.assign(o,h.params),d.push({params:o,pathname:joinPaths([u,h.pathname]),pathnameBase:normalizePathname(joinPaths([u,h.pathnameBase])),route:j}),h.pathnameBase!=="/"&&(u=joinPaths([u,h.pathnameBase]))}return d}function matchPath(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,s]=compilePath(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let u=o[0],d=u.replace(/(.)\/+$/,"$1"),a=o.slice(1);return{params:s.reduce((f,C,h)=>{let{paramName:j,isOptional:U}=C;if(j==="*"){let H=a[h]||"";d=u.slice(0,u.length-H.length).replace(/(.)\/+$/,"$1")}const W=a[h];return U&&!W?f[j]=void 0:f[j]=(W||"").replace(/%2F/g,"/"),f},{}),pathname:u,pathnameBase:d,pattern:e}}function compilePath(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),warning(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,a,l)=>(s.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),s]}function decodePath(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return warning(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function stripBasename(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,s=e.charAt(r);return s&&s!=="/"?null:e.slice(r)||"/"}const ABSOLUTE_URL_REGEX$1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,isAbsoluteUrl=e=>ABSOLUTE_URL_REGEX$1.test(e);function resolvePath(e,t){t===void 0&&(t="/");let{pathname:r,search:s="",hash:o=""}=typeof e=="string"?parsePath(e):e,u;if(r)if(isAbsoluteUrl(r))u=r;else{if(r.includes("//")){let d=r;r=r.replace(/\/\/+/g,"/"),warning(!1,"Pathnames cannot have embedded double slashes - normalizing "+(d+" -> "+r))}r.startsWith("/")?u=resolvePathname(r.substring(1),"/"):u=resolvePathname(r,t)}else u=t;return{pathname:u,search:normalizeSearch(s),hash:normalizeHash(o)}}function resolvePathname(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function getInvalidPathError(e,t,r,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function getPathContributingMatches(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function getResolveToMatches(e,t){let r=getPathContributingMatches(e);return t?r.map((s,o)=>o===r.length-1?s.pathname:s.pathnameBase):r.map(s=>s.pathnameBase)}function resolveTo(e,t,r,s){s===void 0&&(s=!1);let o;typeof e=="string"?o=parsePath(e):(o=_extends$2({},e),invariant(!o.pathname||!o.pathname.includes("?"),getInvalidPathError("?","pathname","search",o)),invariant(!o.pathname||!o.pathname.includes("#"),getInvalidPathError("#","pathname","hash",o)),invariant(!o.search||!o.search.includes("#"),getInvalidPathError("#","search","hash",o)));let u=e===""||o.pathname==="",d=u?"/":o.pathname,a;if(d==null)a=r;else{let h=t.length-1;if(!s&&d.startsWith("..")){let j=d.split("/");for(;j[0]==="..";)j.shift(),h-=1;o.pathname=j.join("/")}a=h>=0?t[h]:"/"}let l=resolvePath(o,a),f=d&&d!=="/"&&d.endsWith("/"),C=(u||d===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(f||C)&&(l.pathname+="/"),l}const joinPaths=e=>e.join("/").replace(/\/\/+/g,"/"),normalizePathname=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),normalizeSearch=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,normalizeHash=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function isRouteErrorResponse(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const validMutationMethodsArr=["post","put","patch","delete"];new Set(validMutationMethodsArr);const validRequestMethodsArr=["get",...validMutationMethodsArr];new Set(validRequestMethodsArr);/**
|
|
50
|
-
* React Router v6.30.3
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},_extends$1.apply(this,arguments)}const DataRouterContext=reactExports.createContext(null),DataRouterStateContext=reactExports.createContext(null),NavigationContext=reactExports.createContext(null),LocationContext=reactExports.createContext(null),RouteContext=reactExports.createContext({outlet:null,matches:[],isDataRoute:!1}),RouteErrorContext=reactExports.createContext(null);function useHref(e,t){let{relative:r}=t===void 0?{}:t;useInRouterContext()||invariant(!1);let{basename:s,navigator:o}=reactExports.useContext(NavigationContext),{hash:u,pathname:d,search:a}=useResolvedPath(e,{relative:r}),l=d;return s!=="/"&&(l=d==="/"?s:joinPaths([s,d])),o.createHref({pathname:l,search:a,hash:u})}function useInRouterContext(){return reactExports.useContext(LocationContext)!=null}function useLocation(){return useInRouterContext()||invariant(!1),reactExports.useContext(LocationContext).location}function useIsomorphicLayoutEffect(e){reactExports.useContext(NavigationContext).static||reactExports.useLayoutEffect(e)}function useNavigate(){let{isDataRoute:e}=reactExports.useContext(RouteContext);return e?useNavigateStable():useNavigateUnstable()}function useNavigateUnstable(){useInRouterContext()||invariant(!1);let e=reactExports.useContext(DataRouterContext),{basename:t,future:r,navigator:s}=reactExports.useContext(NavigationContext),{matches:o}=reactExports.useContext(RouteContext),{pathname:u}=useLocation(),d=JSON.stringify(getResolveToMatches(o,r.v7_relativeSplatPath)),a=reactExports.useRef(!1);return useIsomorphicLayoutEffect(()=>{a.current=!0}),reactExports.useCallback(function(f,C){if(C===void 0&&(C={}),!a.current)return;if(typeof f=="number"){s.go(f);return}let h=resolveTo(f,JSON.parse(d),u,C.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:joinPaths([t,h.pathname])),(C.replace?s.replace:s.push)(h,C.state,C)},[t,s,d,u,e])}const OutletContext=reactExports.createContext(null);function useOutlet(e){let t=reactExports.useContext(RouteContext).outlet;return t&&reactExports.createElement(OutletContext.Provider,{value:e},t)}function useParams(){let{matches:e}=reactExports.useContext(RouteContext),t=e[e.length-1];return t?t.params:{}}function useResolvedPath(e,t){let{relative:r}=t===void 0?{}:t,{future:s}=reactExports.useContext(NavigationContext),{matches:o}=reactExports.useContext(RouteContext),{pathname:u}=useLocation(),d=JSON.stringify(getResolveToMatches(o,s.v7_relativeSplatPath));return reactExports.useMemo(()=>resolveTo(e,JSON.parse(d),u,r==="path"),[e,d,u,r])}function useRoutes(e,t){return useRoutesImpl(e,t)}function useRoutesImpl(e,t,r,s){useInRouterContext()||invariant(!1);let{navigator:o}=reactExports.useContext(NavigationContext),{matches:u}=reactExports.useContext(RouteContext),d=u[u.length-1],a=d?d.params:{};d&&d.pathname;let l=d?d.pathnameBase:"/";d&&d.route;let f=useLocation(),C;if(t){var h;let x=typeof t=="string"?parsePath(t):t;l==="/"||(h=x.pathname)!=null&&h.startsWith(l)||invariant(!1),C=x}else C=f;let j=C.pathname||"/",U=j;if(l!=="/"){let x=l.replace(/^\//,"").split("/");U="/"+j.replace(/^\//,"").split("/").slice(x.length).join("/")}let W=matchRoutes(e,{pathname:U}),H=_renderMatches(W&&W.map(x=>Object.assign({},x,{params:Object.assign({},a,x.params),pathname:joinPaths([l,o.encodeLocation?o.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:joinPaths([l,o.encodeLocation?o.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),u,r,s);return t&&H?reactExports.createElement(LocationContext.Provider,{value:{location:_extends$1({pathname:"/",search:"",hash:"",state:null,key:"default"},C),navigationType:Action.Pop}},H):H}function DefaultErrorComponent(){let e=useRouteError(),t=isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("h2",null,"Unexpected Application Error!"),reactExports.createElement("h3",{style:{fontStyle:"italic"}},t),r?reactExports.createElement("pre",{style:o},r):null,null)}const defaultErrorElement=reactExports.createElement(DefaultErrorComponent,null);class RenderErrorBoundary extends reactExports.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?reactExports.createElement(RouteContext.Provider,{value:this.props.routeContext},reactExports.createElement(RouteErrorContext.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RenderedRoute(e){let{routeContext:t,match:r,children:s}=e,o=reactExports.useContext(DataRouterContext);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),reactExports.createElement(RouteContext.Provider,{value:t},s)}function _renderMatches(e,t,r,s){var o;if(t===void 0&&(t=[]),r===void 0&&(r=null),s===void 0&&(s=null),e==null){var u;if(!r)return null;if(r.errors)e=r.matches;else if((u=s)!=null&&u.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let d=e,a=(o=r)==null?void 0:o.errors;if(a!=null){let C=d.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);C>=0||invariant(!1),d=d.slice(0,Math.min(d.length,C+1))}let l=!1,f=-1;if(r&&s&&s.v7_partialHydration)for(let C=0;C<d.length;C++){let h=d[C];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(f=C),h.route.id){let{loaderData:j,errors:U}=r,W=h.route.loader&&j[h.route.id]===void 0&&(!U||U[h.route.id]===void 0);if(h.route.lazy||W){l=!0,f>=0?d=d.slice(0,f+1):d=[d[0]];break}}}return d.reduceRight((C,h,j)=>{let U,W=!1,H=null,x=null;r&&(U=a&&h.route.id?a[h.route.id]:void 0,H=h.route.errorElement||defaultErrorElement,l&&(f<0&&j===0?(warningOnce("route-fallback"),W=!0,x=null):f===j&&(W=!0,x=h.route.hydrateFallbackElement||null)));let L=t.concat(d.slice(0,j+1)),R=()=>{let N;return U?N=H:W?N=x:h.route.Component?N=reactExports.createElement(h.route.Component,null):h.route.element?N=h.route.element:N=C,reactExports.createElement(RenderedRoute,{match:h,routeContext:{outlet:C,matches:L,isDataRoute:r!=null},children:N})};return r&&(h.route.ErrorBoundary||h.route.errorElement||j===0)?reactExports.createElement(RenderErrorBoundary,{location:r.location,revalidation:r.revalidation,component:H,error:U,children:R(),routeContext:{outlet:null,matches:L,isDataRoute:!0}}):R()},null)}var DataRouterHook$1=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(DataRouterHook$1||{}),DataRouterStateHook$1=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(DataRouterStateHook$1||{});function useDataRouterContext$1(e){let t=reactExports.useContext(DataRouterContext);return t||invariant(!1),t}function useDataRouterState(e){let t=reactExports.useContext(DataRouterStateContext);return t||invariant(!1),t}function useRouteContext(e){let t=reactExports.useContext(RouteContext);return t||invariant(!1),t}function useCurrentRouteId(e){let t=useRouteContext(),r=t.matches[t.matches.length-1];return r.route.id||invariant(!1),r.route.id}function useRouteError(){var e;let t=reactExports.useContext(RouteErrorContext),r=useDataRouterState(),s=useCurrentRouteId();return t!==void 0?t:(e=r.errors)==null?void 0:e[s]}function useNavigateStable(){let{router:e}=useDataRouterContext$1(DataRouterHook$1.UseNavigateStable),t=useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable),r=reactExports.useRef(!1);return useIsomorphicLayoutEffect(()=>{r.current=!0}),reactExports.useCallback(function(o,u){u===void 0&&(u={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,_extends$1({fromRouteId:t},u)))},[e,t])}const alreadyWarned$1={};function warningOnce(e,t,r){alreadyWarned$1[e]||(alreadyWarned$1[e]=!0)}function logV6DeprecationWarnings(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Navigate(e){let{to:t,replace:r,state:s,relative:o}=e;useInRouterContext()||invariant(!1);let{future:u,static:d}=reactExports.useContext(NavigationContext),{matches:a}=reactExports.useContext(RouteContext),{pathname:l}=useLocation(),f=useNavigate(),C=resolveTo(t,getResolveToMatches(a,u.v7_relativeSplatPath),l,o==="path"),h=JSON.stringify(C);return reactExports.useEffect(()=>f(JSON.parse(h),{replace:r,state:s,relative:o}),[f,h,o,r,s]),null}function Outlet(e){return useOutlet(e.context)}function Route(e){invariant(!1)}function Router(e){let{basename:t="/",children:r=null,location:s,navigationType:o=Action.Pop,navigator:u,static:d=!1,future:a}=e;useInRouterContext()&&invariant(!1);let l=t.replace(/^\/*/,"/"),f=reactExports.useMemo(()=>({basename:l,navigator:u,static:d,future:_extends$1({v7_relativeSplatPath:!1},a)}),[l,a,u,d]);typeof s=="string"&&(s=parsePath(s));let{pathname:C="/",search:h="",hash:j="",state:U=null,key:W="default"}=s,H=reactExports.useMemo(()=>{let x=stripBasename(C,l);return x==null?null:{location:{pathname:x,search:h,hash:j,state:U,key:W},navigationType:o}},[l,C,h,j,U,W,o]);return H==null?null:reactExports.createElement(NavigationContext.Provider,{value:f},reactExports.createElement(LocationContext.Provider,{children:r,value:H}))}function Routes(e){let{children:t,location:r}=e;return useRoutes(createRoutesFromChildren(t),r)}new Promise(()=>{});function createRoutesFromChildren(e,t){t===void 0&&(t=[]);let r=[];return reactExports.Children.forEach(e,(s,o)=>{if(!reactExports.isValidElement(s))return;let u=[...t,o];if(s.type===reactExports.Fragment){r.push.apply(r,createRoutesFromChildren(s.props.children,u));return}s.type!==Route&&invariant(!1),!s.props.index||!s.props.children||invariant(!1);let d={id:s.props.id||u.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(d.children=createRoutesFromChildren(s.props.children,u)),r.push(d)}),r}/**
|
|
59
|
-
* React Router DOM v6.30.3
|
|
60
|
-
*
|
|
61
|
-
* Copyright (c) Remix Software Inc.
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the MIT license found in the
|
|
64
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
-
*
|
|
66
|
-
* @license MIT
|
|
67
|
-
*/function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(e,t){if(e==null)return{};var r={},s=Object.keys(e),o,u;for(u=0;u<s.length;u++)o=s[u],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function isModifiedEvent(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function shouldProcessLinkClick(e,t){return e.button===0&&(!t||t==="_self")&&!isModifiedEvent(e)}const _excluded=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],_excluded2=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],REACT_ROUTER_VERSION="6";try{window.__reactRouterVersion=REACT_ROUTER_VERSION}catch{}const ViewTransitionContext=reactExports.createContext({isTransitioning:!1}),START_TRANSITION="startTransition",startTransitionImpl=React[START_TRANSITION];function BrowserRouter(e){let{basename:t,children:r,future:s,window:o}=e,u=reactExports.useRef();u.current==null&&(u.current=createBrowserHistory({window:o,v5Compat:!0}));let d=u.current,[a,l]=reactExports.useState({action:d.action,location:d.location}),{v7_startTransition:f}=s||{},C=reactExports.useCallback(h=>{f&&startTransitionImpl?startTransitionImpl(()=>l(h)):l(h)},[l,f]);return reactExports.useLayoutEffect(()=>d.listen(C),[d,C]),reactExports.useEffect(()=>logV6DeprecationWarnings(s),[s]),reactExports.createElement(Router,{basename:t,children:r,location:a.location,navigationType:a.action,navigator:d,future:s})}const isBrowser=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ABSOLUTE_URL_REGEX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Link=reactExports.forwardRef(function(t,r){let{onClick:s,relative:o,reloadDocument:u,replace:d,state:a,target:l,to:f,preventScrollReset:C,viewTransition:h}=t,j=_objectWithoutPropertiesLoose(t,_excluded),{basename:U}=reactExports.useContext(NavigationContext),W,H=!1;if(typeof f=="string"&&ABSOLUTE_URL_REGEX.test(f)&&(W=f,isBrowser))try{let N=new URL(window.location.href),V=f.startsWith("//")?new URL(N.protocol+f):new URL(f),J=stripBasename(V.pathname,U);V.origin===N.origin&&J!=null?f=J+V.search+V.hash:H=!0}catch{}let x=useHref(f,{relative:o}),L=useLinkClickHandler(f,{replace:d,state:a,target:l,preventScrollReset:C,relative:o,viewTransition:h});function R(N){s&&s(N),N.defaultPrevented||L(N)}return reactExports.createElement("a",_extends({},j,{href:W||x,onClick:H||u?s:R,ref:r,target:l}))}),NavLink=reactExports.forwardRef(function(t,r){let{"aria-current":s="page",caseSensitive:o=!1,className:u="",end:d=!1,style:a,to:l,viewTransition:f,children:C}=t,h=_objectWithoutPropertiesLoose(t,_excluded2),j=useResolvedPath(l,{relative:h.relative}),U=useLocation(),W=reactExports.useContext(DataRouterStateContext),{navigator:H,basename:x}=reactExports.useContext(NavigationContext),L=W!=null&&useViewTransitionState(j)&&f===!0,R=H.encodeLocation?H.encodeLocation(j).pathname:j.pathname,N=U.pathname,V=W&&W.navigation&&W.navigation.location?W.navigation.location.pathname:null;o||(N=N.toLowerCase(),V=V?V.toLowerCase():null,R=R.toLowerCase()),V&&x&&(V=stripBasename(V,x)||V);const J=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let Y=N===R||!d&&N.startsWith(R)&&N.charAt(J)==="/",Z=V!=null&&(V===R||!d&&V.startsWith(R)&&V.charAt(R.length)==="/"),K={isActive:Y,isPending:Z,isTransitioning:L},ee=Y?s:void 0,oe;typeof u=="function"?oe=u(K):oe=[u,Y?"active":null,Z?"pending":null,L?"transitioning":null].filter(Boolean).join(" ");let ce=typeof a=="function"?a(K):a;return reactExports.createElement(Link,_extends({},h,{"aria-current":ee,className:oe,ref:r,style:ce,to:l,viewTransition:f}),typeof C=="function"?C(K):C)});var DataRouterHook;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));function useDataRouterContext(e){let t=reactExports.useContext(DataRouterContext);return t||invariant(!1),t}function useLinkClickHandler(e,t){let{target:r,replace:s,state:o,preventScrollReset:u,relative:d,viewTransition:a}=t===void 0?{}:t,l=useNavigate(),f=useLocation(),C=useResolvedPath(e,{relative:d});return reactExports.useCallback(h=>{if(shouldProcessLinkClick(h,r)){h.preventDefault();let j=s!==void 0?s:createPath(f)===createPath(C);l(e,{replace:j,state:o,preventScrollReset:u,relative:d,viewTransition:a})}},[f,l,C,s,o,r,e,u,d,a])}function useViewTransitionState(e,t){t===void 0&&(t={});let r=reactExports.useContext(ViewTransitionContext);r==null&&invariant(!1);let{basename:s}=useDataRouterContext(DataRouterHook.useViewTransitionState),o=useResolvedPath(e,{relative:t.relative});if(!r.isTransitioning)return!1;let u=stripBasename(r.currentLocation.pathname,s)||r.currentLocation.pathname,d=stripBasename(r.nextLocation.pathname,s)||r.nextLocation.pathname;return matchPath(o.pathname,d)!=null||matchPath(o.pathname,u)!=null}const LOCALES=[{code:"en",name:"English"},{code:"es",name:"Español"},{code:"fr",name:"Français"},{code:"de",name:"Deutsch"},{code:"pt",name:"Português"},{code:"it",name:"Italiano"},{code:"ja",name:"日本語"},{code:"ko",name:"한국어"},{code:"zh",name:"中文"},{code:"ru",name:"Русский"}];function defineMessages(e){return e}function isLocale(e){return LOCALES.some(t=>t.code===e)}const common={en:{refresh:"Refresh",retry:"Retry",cancel:"Cancel",save:"Save",delete:"Delete",close:"Close",loading:"Loading…",noData:"No data",enabled:"Enabled",disabled:"Disabled",language:"Language",sectionFailed:"{label} failed to render",thisSection:"This section",pageFailed:"This page failed to load",table:"Table",panel:"Panel"},es:{refresh:"Actualizar",retry:"Reintentar",cancel:"Cancelar",save:"Guardar",delete:"Eliminar",close:"Cerrar",loading:"Cargando…",noData:"Sin datos",enabled:"Activado",disabled:"Desactivado",language:"Idioma",sectionFailed:"No se pudo mostrar {label}",thisSection:"Esta sección",pageFailed:"No se pudo cargar esta página",table:"Tabla",panel:"Panel"},fr:{refresh:"Actualiser",retry:"Réessayer",cancel:"Annuler",save:"Enregistrer",delete:"Supprimer",close:"Fermer",loading:"Chargement…",noData:"Aucune donnée",enabled:"Activé",disabled:"Désactivé",language:"Langue",sectionFailed:"Impossible d’afficher {label}",thisSection:"Cette section",pageFailed:"Impossible de charger cette page",table:"Tableau",panel:"Panneau"},de:{refresh:"Aktualisieren",retry:"Erneut versuchen",cancel:"Abbrechen",save:"Speichern",delete:"Löschen",close:"Schließen",loading:"Wird geladen…",noData:"Keine Daten",enabled:"Aktiviert",disabled:"Deaktiviert",language:"Sprache",sectionFailed:"{label} konnte nicht angezeigt werden",thisSection:"Dieser Bereich",pageFailed:"Diese Seite konnte nicht geladen werden",table:"Tabelle",panel:"Bereich"},pt:{refresh:"Atualizar",retry:"Tentar novamente",cancel:"Cancelar",save:"Salvar",delete:"Excluir",close:"Fechar",loading:"Carregando…",noData:"Sem dados",enabled:"Ativado",disabled:"Desativado",language:"Idioma",sectionFailed:"Não foi possível exibir {label}",thisSection:"Esta seção",pageFailed:"Não foi possível carregar esta página",table:"Tabela",panel:"Painel"},it:{refresh:"Aggiorna",retry:"Riprova",cancel:"Annulla",save:"Salva",delete:"Elimina",close:"Chiudi",loading:"Caricamento…",noData:"Nessun dato",enabled:"Attivo",disabled:"Disattivato",language:"Lingua",sectionFailed:"Impossibile visualizzare {label}",thisSection:"Questa sezione",pageFailed:"Impossibile caricare questa pagina",table:"Tabella",panel:"Pannello"},ja:{refresh:"更新",retry:"再試行",cancel:"キャンセル",save:"保存",delete:"削除",close:"閉じる",loading:"読み込み中…",noData:"データがありません",enabled:"有効",disabled:"無効",language:"言語",sectionFailed:"{label}を表示できませんでした",thisSection:"このセクション",pageFailed:"このページを読み込めませんでした",table:"テーブル",panel:"パネル"},ko:{refresh:"새로 고침",retry:"다시 시도",cancel:"취소",save:"저장",delete:"삭제",close:"닫기",loading:"불러오는 중…",noData:"데이터 없음",enabled:"사용",disabled:"사용 안 함",language:"언어",sectionFailed:"{label}을(를) 표시하지 못했습니다",thisSection:"이 섹션",pageFailed:"이 페이지를 불러오지 못했습니다",table:"표",panel:"패널"},zh:{refresh:"刷新",retry:"重试",cancel:"取消",save:"保存",delete:"删除",close:"关闭",loading:"加载中…",noData:"暂无数据",enabled:"已启用",disabled:"已停用",language:"语言",sectionFailed:"无法显示{label}",thisSection:"此部分",pageFailed:"此页面加载失败",table:"表格",panel:"面板"},ru:{refresh:"Обновить",retry:"Повторить",cancel:"Отмена",save:"Сохранить",delete:"Удалить",close:"Закрыть",loading:"Загрузка…",noData:"Нет данных",enabled:"Включено",disabled:"Отключено",language:"Язык",sectionFailed:"Не удалось отобразить: {label}",thisSection:"Этот раздел",pageFailed:"Не удалось загрузить страницу",table:"Таблица",panel:"Панель"}},nav={en:{appName:"Qodalis Cli Admin",overview:"Overview",commands:"Commands",jobs:"Jobs",plugins:"Plugins",filesystem:"Filesystem",events:"Events",config:"Config",logs:"Logs",terminal:"Terminal",signOut:"Sign out",connected:"Connected",reconnecting:"Reconnecting",disconnected:"Disconnected"},es:{overview:"Resumen",commands:"Comandos",jobs:"Tareas",plugins:"Plugins",filesystem:"Archivos",events:"Eventos",config:"Configuración",logs:"Registros",terminal:"Terminal",signOut:"Cerrar sesión",connected:"Conectado",reconnecting:"Reconectando",disconnected:"Desconectado"},fr:{overview:"Aperçu",commands:"Commandes",jobs:"Tâches",plugins:"Plugins",filesystem:"Fichiers",events:"Événements",config:"Configuration",logs:"Journaux",terminal:"Terminal",signOut:"Se déconnecter",connected:"Connecté",reconnecting:"Reconnexion",disconnected:"Déconnecté"},de:{overview:"Übersicht",commands:"Befehle",jobs:"Jobs",plugins:"Plugins",filesystem:"Dateien",events:"Ereignisse",config:"Konfiguration",logs:"Protokolle",terminal:"Terminal",signOut:"Abmelden",connected:"Verbunden",reconnecting:"Verbindung wird wiederhergestellt",disconnected:"Getrennt"},pt:{overview:"Visão geral",commands:"Comandos",jobs:"Tarefas",plugins:"Plugins",filesystem:"Arquivos",events:"Eventos",config:"Configuração",logs:"Logs",terminal:"Terminal",signOut:"Sair",connected:"Conectado",reconnecting:"Reconectando",disconnected:"Desconectado"},it:{overview:"Panoramica",commands:"Comandi",jobs:"Job",plugins:"Plugin",filesystem:"File",events:"Eventi",config:"Configurazione",logs:"Log",terminal:"Terminale",signOut:"Esci",connected:"Connesso",reconnecting:"Riconnessione",disconnected:"Disconnesso"},ja:{overview:"概要",commands:"コマンド",jobs:"ジョブ",plugins:"プラグイン",filesystem:"ファイル",events:"イベント",config:"設定",logs:"ログ",terminal:"ターミナル",signOut:"サインアウト",connected:"接続済み",reconnecting:"再接続中",disconnected:"切断"},ko:{overview:"개요",commands:"명령",jobs:"작업",plugins:"플러그인",filesystem:"파일",events:"이벤트",config:"설정",logs:"로그",terminal:"터미널",signOut:"로그아웃",connected:"연결됨",reconnecting:"다시 연결 중",disconnected:"연결 끊김"},zh:{overview:"概览",commands:"命令",jobs:"任务",plugins:"插件",filesystem:"文件",events:"事件",config:"配置",logs:"日志",terminal:"终端",signOut:"退出登录",connected:"已连接",reconnecting:"正在重新连接",disconnected:"已断开"},ru:{overview:"Обзор",commands:"Команды",jobs:"Задания",plugins:"Плагины",filesystem:"Файлы",events:"События",config:"Настройки",logs:"Журналы",terminal:"Терминал",signOut:"Выйти",connected:"Подключено",reconnecting:"Переподключение",disconnected:"Отключено"}},login$1={en:{subtitle:"Server Administration",username:"Username",password:"Password",invalidCredentials:"Invalid credentials",signingIn:"Signing in…",signIn:"Sign in"},es:{subtitle:"Administración del servidor",username:"Usuario",password:"Contraseña",invalidCredentials:"Credenciales no válidas",signingIn:"Iniciando sesión…",signIn:"Iniciar sesión"},fr:{subtitle:"Administration du serveur",username:"Nom d’utilisateur",password:"Mot de passe",invalidCredentials:"Identifiants invalides",signingIn:"Connexion…",signIn:"Se connecter"},de:{subtitle:"Serververwaltung",username:"Benutzername",password:"Passwort",invalidCredentials:"Ungültige Anmeldedaten",signingIn:"Anmeldung läuft…",signIn:"Anmelden"},pt:{subtitle:"Administração do servidor",username:"Usuário",password:"Senha",invalidCredentials:"Credenciais inválidas",signingIn:"Entrando…",signIn:"Entrar"},it:{subtitle:"Amministrazione del server",username:"Nome utente",password:"Password",invalidCredentials:"Credenziali non valide",signingIn:"Accesso in corso…",signIn:"Accedi"},ja:{subtitle:"サーバー管理",username:"ユーザー名",password:"パスワード",invalidCredentials:"認証情報が正しくありません",signingIn:"サインイン中…",signIn:"サインイン"},ko:{subtitle:"서버 관리",username:"사용자 이름",password:"비밀번호",invalidCredentials:"자격 증명이 올바르지 않습니다",signingIn:"로그인 중…",signIn:"로그인"},zh:{subtitle:"服务器管理",username:"用户名",password:"密码",invalidCredentials:"凭据无效",signingIn:"正在登录…",signIn:"登录"},ru:{subtitle:"Администрирование сервера",username:"Имя пользователя",password:"Пароль",invalidCredentials:"Неверные учётные данные",signingIn:"Вход…",signIn:"Войти"}},overview={en:{subtitle:"Server health and activity at a glance",uptime:"Uptime",since:"Since {date}",uptimeDays:"{days}d {hours}h",uptimeHours:"{hours}h {minutes}m",uptimeMinutes:"{minutes}m",registeredProcessors:"Registered processors",activeJobs:"Active jobs",registeredJobs:"Registered jobs",wsClients:"WS clients",activeConnections:"Active connections",serverInfo:"Server information",os:"OS",platform:"Platform",shell:"Shell",version:"Version",memory:"Memory",shellSessions:"Shell sessions",serverInfoFailed:"Unable to load server info.",recentJobs:"Recent jobs",viewAll:"View all",noJobData:"No job data available.",noJobs:"No jobs registered.",colName:"Name",colGroup:"Group",colStatus:"Status",colLastRun:"Last run",colNextRun:"Next run",liveEvents:"Live events",waitingForEvents:"Waiting for events…"},es:{subtitle:"Estado y actividad del servidor de un vistazo",uptime:"Tiempo activo",since:"Desde {date}",uptimeDays:"{days} d {hours} h",uptimeHours:"{hours} h {minutes} min",uptimeMinutes:"{minutes} min",registeredProcessors:"Procesadores registrados",activeJobs:"Tareas activas",registeredJobs:"Tareas registradas",wsClients:"Clientes WS",activeConnections:"Conexiones activas",serverInfo:"Información del servidor",os:"SO",platform:"Plataforma",shell:"Shell",version:"Versión",memory:"Memoria",shellSessions:"Sesiones de shell",serverInfoFailed:"No se pudo cargar la información del servidor.",recentJobs:"Tareas recientes",viewAll:"Ver todas",noJobData:"No hay datos de tareas disponibles.",noJobs:"No hay tareas registradas.",colName:"Nombre",colGroup:"Grupo",colStatus:"Estado",colLastRun:"Última ejecución",colNextRun:"Próxima ejecución",liveEvents:"Eventos en vivo",waitingForEvents:"Esperando eventos…"},fr:{subtitle:"État et activité du serveur en un coup d’œil",uptime:"Disponibilité",since:"Depuis le {date}",uptimeDays:"{days} j {hours} h",uptimeHours:"{hours} h {minutes} min",uptimeMinutes:"{minutes} min",registeredProcessors:"Processeurs enregistrés",activeJobs:"Tâches actives",registeredJobs:"Tâches enregistrées",wsClients:"Clients WS",activeConnections:"Connexions actives",serverInfo:"Informations sur le serveur",os:"OS",platform:"Plateforme",shell:"Shell",version:"Version",memory:"Mémoire",shellSessions:"Sessions shell",serverInfoFailed:"Impossible de charger les informations du serveur.",recentJobs:"Tâches récentes",viewAll:"Tout voir",noJobData:"Aucune donnée de tâche disponible.",noJobs:"Aucune tâche enregistrée.",colName:"Nom",colGroup:"Groupe",colStatus:"Statut",colLastRun:"Dernière exécution",colNextRun:"Prochaine exécution",liveEvents:"Événements en direct",waitingForEvents:"En attente d’événements…"},de:{subtitle:"Serverzustand und Aktivität auf einen Blick",uptime:"Laufzeit",since:"Seit {date}",uptimeDays:"{days} T. {hours} Std.",uptimeHours:"{hours} Std. {minutes} Min.",uptimeMinutes:"{minutes} Min.",registeredProcessors:"Registrierte Prozessoren",activeJobs:"Aktive Jobs",registeredJobs:"Registrierte Jobs",wsClients:"WS-Clients",activeConnections:"Aktive Verbindungen",serverInfo:"Serverinformationen",os:"Betriebssystem",platform:"Plattform",shell:"Shell",version:"Version",memory:"Arbeitsspeicher",shellSessions:"Shell-Sitzungen",serverInfoFailed:"Serverinformationen konnten nicht geladen werden.",recentJobs:"Letzte Jobs",viewAll:"Alle anzeigen",noJobData:"Keine Job-Daten verfügbar.",noJobs:"Keine Jobs registriert.",colName:"Name",colGroup:"Gruppe",colStatus:"Status",colLastRun:"Letzte Ausführung",colNextRun:"Nächste Ausführung",liveEvents:"Live-Ereignisse",waitingForEvents:"Warte auf Ereignisse…"},pt:{subtitle:"Saúde e atividade do servidor em um relance",uptime:"Tempo ativo",since:"Desde {date}",uptimeDays:"{days} d {hours} h",uptimeHours:"{hours} h {minutes} min",uptimeMinutes:"{minutes} min",registeredProcessors:"Processadores registrados",activeJobs:"Tarefas ativas",registeredJobs:"Tarefas registradas",wsClients:"Clientes WS",activeConnections:"Conexões ativas",serverInfo:"Informações do servidor",os:"SO",platform:"Plataforma",shell:"Shell",version:"Versão",memory:"Memória",shellSessions:"Sessões de shell",serverInfoFailed:"Não foi possível carregar as informações do servidor.",recentJobs:"Tarefas recentes",viewAll:"Ver todas",noJobData:"Nenhum dado de tarefas disponível.",noJobs:"Nenhuma tarefa registrada.",colName:"Nome",colGroup:"Grupo",colStatus:"Status",colLastRun:"Última execução",colNextRun:"Próxima execução",liveEvents:"Eventos ao vivo",waitingForEvents:"Aguardando eventos…"},it:{subtitle:"Stato e attività del server a colpo d’occhio",uptime:"Tempo di attività",since:"Dal {date}",uptimeDays:"{days} g {hours} h",uptimeHours:"{hours} h {minutes} min",uptimeMinutes:"{minutes} min",registeredProcessors:"Processori registrati",activeJobs:"Job attivi",registeredJobs:"Job registrati",wsClients:"Client WS",activeConnections:"Connessioni attive",serverInfo:"Informazioni sul server",os:"SO",platform:"Piattaforma",shell:"Shell",version:"Versione",memory:"Memoria",shellSessions:"Sessioni shell",serverInfoFailed:"Impossibile caricare le informazioni sul server.",recentJobs:"Job recenti",viewAll:"Vedi tutti",noJobData:"Nessun dato sui job disponibile.",noJobs:"Nessun job registrato.",colName:"Nome",colGroup:"Gruppo",colStatus:"Stato",colLastRun:"Ultima esecuzione",colNextRun:"Prossima esecuzione",liveEvents:"Eventi in tempo reale",waitingForEvents:"In attesa di eventi…"},ja:{subtitle:"サーバーの状態とアクティビティをひと目で確認",uptime:"稼働時間",since:"{date} から",uptimeDays:"{days}日 {hours}時間",uptimeHours:"{hours}時間 {minutes}分",uptimeMinutes:"{minutes}分",registeredProcessors:"登録済みプロセッサ",activeJobs:"アクティブなジョブ",registeredJobs:"登録済みジョブ",wsClients:"WS クライアント",activeConnections:"アクティブな接続",serverInfo:"サーバー情報",os:"OS",platform:"プラットフォーム",shell:"シェル",version:"バージョン",memory:"メモリ",shellSessions:"シェルセッション",serverInfoFailed:"サーバー情報を読み込めませんでした。",recentJobs:"最近のジョブ",viewAll:"すべて表示",noJobData:"ジョブのデータがありません。",noJobs:"登録済みのジョブはありません。",colName:"名前",colGroup:"グループ",colStatus:"ステータス",colLastRun:"前回の実行",colNextRun:"次回の実行",liveEvents:"ライブイベント",waitingForEvents:"イベントを待機中…"},ko:{subtitle:"서버 상태와 활동을 한눈에 확인",uptime:"가동 시간",since:"{date}부터",uptimeDays:"{days}일 {hours}시간",uptimeHours:"{hours}시간 {minutes}분",uptimeMinutes:"{minutes}분",registeredProcessors:"등록된 프로세서",activeJobs:"활성 작업",registeredJobs:"등록된 작업",wsClients:"WS 클라이언트",activeConnections:"활성 연결",serverInfo:"서버 정보",os:"OS",platform:"플랫폼",shell:"셸",version:"버전",memory:"메모리",shellSessions:"셸 세션",serverInfoFailed:"서버 정보를 불러오지 못했습니다.",recentJobs:"최근 작업",viewAll:"모두 보기",noJobData:"사용 가능한 작업 데이터가 없습니다.",noJobs:"등록된 작업이 없습니다.",colName:"이름",colGroup:"그룹",colStatus:"상태",colLastRun:"마지막 실행",colNextRun:"다음 실행",liveEvents:"실시간 이벤트",waitingForEvents:"이벤트 대기 중…"},zh:{subtitle:"一览服务器运行状况与活动",uptime:"运行时间",since:"自 {date} 起",uptimeDays:"{days} 天 {hours} 小时",uptimeHours:"{hours} 小时 {minutes} 分钟",uptimeMinutes:"{minutes} 分钟",registeredProcessors:"已注册的处理器",activeJobs:"活动任务",registeredJobs:"已注册的任务",wsClients:"WS 客户端",activeConnections:"活动连接",serverInfo:"服务器信息",os:"操作系统",platform:"平台",shell:"Shell",version:"版本",memory:"内存",shellSessions:"Shell 会话",serverInfoFailed:"无法加载服务器信息。",recentJobs:"最近的任务",viewAll:"查看全部",noJobData:"暂无任务数据。",noJobs:"没有已注册的任务。",colName:"名称",colGroup:"分组",colStatus:"状态",colLastRun:"上次运行",colNextRun:"下次运行",liveEvents:"实时事件",waitingForEvents:"正在等待事件…"},ru:{subtitle:"Состояние и активность сервера с первого взгляда",uptime:"Время работы",since:"С {date}",uptimeDays:"{days} д {hours} ч",uptimeHours:"{hours} ч {minutes} мин",uptimeMinutes:"{minutes} мин",registeredProcessors:"Зарегистрированные процессоры",activeJobs:"Активные задания",registeredJobs:"Зарегистрированные задания",wsClients:"Клиенты WS",activeConnections:"Активные подключения",serverInfo:"Сведения о сервере",os:"ОС",platform:"Платформа",shell:"Оболочка",version:"Версия",memory:"Память",shellSessions:"Сеансы оболочки",serverInfoFailed:"Не удалось загрузить сведения о сервере.",recentJobs:"Последние задания",viewAll:"Показать все",noJobData:"Нет данных о заданиях.",noJobs:"Нет зарегистрированных заданий.",colName:"Имя",colGroup:"Группа",colStatus:"Статус",colLastRun:"Последний запуск",colNextRun:"Следующий запуск",liveEvents:"События в реальном времени",waitingForEvents:"Ожидание событий…"}},commands={en:{subtitle_one:"{count} registered processor",subtitle_other:"{count} registered processors",searchPlaceholder:"Search commands…",loadingCommands:"Loading commands…",error:"Error: {message}",noMatch:"No commands match your search.",noCommands:"No commands registered.",colCommand:"Command",colDescription:"Description",colModule:"Module",colParams:"Params",colName:"Name",colType:"Type",colRequired:"Required",parameters:"Parameters",subCommands:"Sub-commands",yes:"Yes",no:"No"},es:{subtitle_one:"{count} procesador registrado",subtitle_other:"{count} procesadores registrados",searchPlaceholder:"Buscar comandos…",loadingCommands:"Cargando comandos…",error:"Error: {message}",noMatch:"Ningún comando coincide con la búsqueda.",noCommands:"No hay comandos registrados.",colCommand:"Comando",colDescription:"Descripción",colModule:"Módulo",colParams:"Parám.",colName:"Nombre",colType:"Tipo",colRequired:"Obligatorio",parameters:"Parámetros",subCommands:"Subcomandos",yes:"Sí",no:"No"},fr:{subtitle_one:"{count} processeur enregistré",subtitle_other:"{count} processeurs enregistrés",searchPlaceholder:"Rechercher des commandes…",loadingCommands:"Chargement des commandes…",error:"Erreur : {message}",noMatch:"Aucune commande ne correspond à votre recherche.",noCommands:"Aucune commande enregistrée.",colCommand:"Commande",colDescription:"Description",colModule:"Module",colParams:"Param.",colName:"Nom",colType:"Type",colRequired:"Obligatoire",parameters:"Paramètres",subCommands:"Sous-commandes",yes:"Oui",no:"Non"},de:{subtitle_one:"{count} registrierter Prozessor",subtitle_other:"{count} registrierte Prozessoren",searchPlaceholder:"Befehle suchen…",loadingCommands:"Befehle werden geladen…",error:"Fehler: {message}",noMatch:"Keine Befehle entsprechen Ihrer Suche.",noCommands:"Keine Befehle registriert.",colCommand:"Befehl",colDescription:"Beschreibung",colModule:"Modul",colParams:"Param.",colName:"Name",colType:"Typ",colRequired:"Erforderlich",parameters:"Parameter",subCommands:"Unterbefehle",yes:"Ja",no:"Nein"},pt:{subtitle_one:"{count} processador registrado",subtitle_other:"{count} processadores registrados",searchPlaceholder:"Pesquisar comandos…",loadingCommands:"Carregando comandos…",error:"Erro: {message}",noMatch:"Nenhum comando corresponde à pesquisa.",noCommands:"Nenhum comando registrado.",colCommand:"Comando",colDescription:"Descrição",colModule:"Módulo",colParams:"Parâm.",colName:"Nome",colType:"Tipo",colRequired:"Obrigatório",parameters:"Parâmetros",subCommands:"Subcomandos",yes:"Sim",no:"Não"},it:{subtitle_one:"{count} processore registrato",subtitle_other:"{count} processori registrati",searchPlaceholder:"Cerca comandi…",loadingCommands:"Caricamento comandi…",error:"Errore: {message}",noMatch:"Nessun comando corrisponde alla ricerca.",noCommands:"Nessun comando registrato.",colCommand:"Comando",colDescription:"Descrizione",colModule:"Modulo",colParams:"Param.",colName:"Nome",colType:"Tipo",colRequired:"Obbligatorio",parameters:"Parametri",subCommands:"Sottocomandi",yes:"Sì",no:"No"},ja:{subtitle_other:"登録済みプロセッサ {count} 件",searchPlaceholder:"コマンドを検索…",loadingCommands:"コマンドを読み込み中…",error:"エラー: {message}",noMatch:"検索条件に一致するコマンドはありません。",noCommands:"登録済みのコマンドはありません。",colCommand:"コマンド",colDescription:"説明",colModule:"モジュール",colParams:"パラメーター",colName:"名前",colType:"型",colRequired:"必須",parameters:"パラメーター",subCommands:"サブコマンド",yes:"はい",no:"いいえ"},ko:{subtitle_other:"등록된 프로세서 {count}개",searchPlaceholder:"명령 검색…",loadingCommands:"명령을 불러오는 중…",error:"오류: {message}",noMatch:"검색과 일치하는 명령이 없습니다.",noCommands:"등록된 명령이 없습니다.",colCommand:"명령",colDescription:"설명",colModule:"모듈",colParams:"매개변수",colName:"이름",colType:"유형",colRequired:"필수",parameters:"매개변수",subCommands:"하위 명령",yes:"예",no:"아니요"},zh:{subtitle_other:"已注册 {count} 个处理器",searchPlaceholder:"搜索命令…",loadingCommands:"正在加载命令…",error:"错误:{message}",noMatch:"没有与搜索匹配的命令。",noCommands:"没有已注册的命令。",colCommand:"命令",colDescription:"描述",colModule:"模块",colParams:"参数",colName:"名称",colType:"类型",colRequired:"必填",parameters:"参数",subCommands:"子命令",yes:"是",no:"否"},ru:{subtitle_one:"{count} зарегистрированный процессор",subtitle_few:"{count} зарегистрированных процессора",subtitle_many:"{count} зарегистрированных процессоров",subtitle_other:"{count} зарегистрированного процессора",searchPlaceholder:"Поиск команд…",loadingCommands:"Загрузка команд…",error:"Ошибка: {message}",noMatch:"Нет команд, соответствующих запросу.",noCommands:"Нет зарегистрированных команд.",colCommand:"Команда",colDescription:"Описание",colModule:"Модуль",colParams:"Парам.",colName:"Имя",colType:"Тип",colRequired:"Обязательный",parameters:"Параметры",subCommands:"Подкоманды",yes:"Да",no:"Нет"}},JOB_STATUSES=["active","paused","stopped","scheduled","pending","running","completed","succeeded","failed","error","cancelled","timed_out"],JOB_TRIGGER_TYPES=["manual","schedule","scheduled","retry"],JOB_OVERLAP_POLICIES=["skip","queue","cancel"],jobs={en:{subtitle_one:"{count} registered job",subtitle_other:"{count} registered jobs",subtitleEmpty:"Job scheduler",loadingJobs:"Loading jobs…",error:"Error: {message}",actionFailed:"Action failed",name:"Name",group:"Group",status:"Status",schedule:"Schedule",interval:"Interval",lastRun:"Last Run",nextRun:"Next Run",every:"every {interval}",trigger:"Trigger",pause:"Pause",resume:"Resume",stop:"Stop",back:"← Back",detailTitle:"Job Detail",jobId:"Job {id}",loadingDetails:"Loading job details…",jobInfo:"Job Information",lastDuration:"Last Duration",maxRetries:"Max Retries",overlapPolicy:"Overlap Policy",timeout:"Timeout",history:"Execution History",totalExecutions_one:"{count} execution in total",totalExecutions_other:"{count} executions in total",loadingHistory:"Loading history…",previous:"Previous",next:"Next",pageOf:"Page {page} of {total}",id:"ID",started:"Started",duration:"Duration",errorColumn:"Error",logs:"Logs",executionLogs:"Execution Logs",loadingLogsFor:"Loading logs for execution {id}…",noLogs:"No logs available for this execution.",logsError:"Error loading logs: {message}",unknownError:"Unknown error",logsHint:"Click an execution row or its Logs button to view logs.",status_active:"active",status_paused:"paused",status_stopped:"stopped",status_scheduled:"scheduled",status_pending:"pending",status_running:"running",status_completed:"completed",status_succeeded:"succeeded",status_failed:"failed",status_error:"error",status_cancelled:"cancelled",status_timed_out:"timed out",trigger_manual:"manual",trigger_schedule:"schedule",trigger_scheduled:"scheduled",trigger_retry:"retry",overlap_skip:"skip",overlap_queue:"queue",overlap_cancel:"cancel"},es:{subtitle_one:"{count} tarea registrada",subtitle_other:"{count} tareas registradas",subtitleEmpty:"Planificador de tareas",loadingJobs:"Cargando tareas…",error:"Error: {message}",actionFailed:"La acción falló",name:"Nombre",group:"Grupo",status:"Estado",schedule:"Programación",interval:"Intervalo",lastRun:"Última ejecución",nextRun:"Próxima ejecución",every:"cada {interval}",trigger:"Ejecutar",pause:"Pausar",resume:"Reanudar",stop:"Detener",back:"← Volver",detailTitle:"Detalle de la tarea",jobId:"Tarea {id}",loadingDetails:"Cargando detalles de la tarea…",jobInfo:"Información de la tarea",lastDuration:"Última duración",maxRetries:"Reintentos máximos",overlapPolicy:"Política de solapamiento",timeout:"Tiempo límite",history:"Historial de ejecuciones",totalExecutions_one:"{count} ejecución en total",totalExecutions_other:"{count} ejecuciones en total",loadingHistory:"Cargando historial…",previous:"Anterior",next:"Siguiente",pageOf:"Página {page} de {total}",id:"ID",started:"Inicio",duration:"Duración",errorColumn:"Error",logs:"Registros",executionLogs:"Registros de ejecución",loadingLogsFor:"Cargando registros de la ejecución {id}…",noLogs:"No hay registros para esta ejecución.",logsError:"Error al cargar los registros: {message}",unknownError:"Error desconocido",logsHint:"Haz clic en una ejecución o en su botón Registros para ver los registros.",status_active:"activa",status_paused:"en pausa",status_stopped:"detenida",status_scheduled:"programada",status_pending:"pendiente",status_running:"en ejecución",status_completed:"completada",status_succeeded:"correcta",status_failed:"fallida",status_error:"error",status_cancelled:"cancelada",status_timed_out:"tiempo agotado",trigger_manual:"manual",trigger_schedule:"programación",trigger_scheduled:"programada",trigger_retry:"reintento",overlap_skip:"omitir",overlap_queue:"encolar",overlap_cancel:"cancelar"},fr:{subtitle_one:"{count} tâche enregistrée",subtitle_other:"{count} tâches enregistrées",subtitleEmpty:"Planificateur de tâches",loadingJobs:"Chargement des tâches…",error:"Erreur : {message}",actionFailed:"L’action a échoué",name:"Nom",group:"Groupe",status:"Statut",schedule:"Planification",interval:"Intervalle",lastRun:"Dernière exécution",nextRun:"Prochaine exécution",every:"toutes les {interval}",trigger:"Déclencher",pause:"Suspendre",resume:"Reprendre",stop:"Arrêter",back:"← Retour",detailTitle:"Détail de la tâche",jobId:"Tâche {id}",loadingDetails:"Chargement des détails de la tâche…",jobInfo:"Informations sur la tâche",lastDuration:"Dernière durée",maxRetries:"Nombre max. de tentatives",overlapPolicy:"Politique de chevauchement",timeout:"Délai d’expiration",history:"Historique des exécutions",totalExecutions_one:"{count} exécution au total",totalExecutions_other:"{count} exécutions au total",loadingHistory:"Chargement de l’historique…",previous:"Précédent",next:"Suivant",pageOf:"Page {page} sur {total}",id:"ID",started:"Début",duration:"Durée",errorColumn:"Erreur",logs:"Journaux",executionLogs:"Journaux d’exécution",loadingLogsFor:"Chargement des journaux de l’exécution {id}…",noLogs:"Aucun journal pour cette exécution.",logsError:"Erreur lors du chargement des journaux : {message}",unknownError:"Erreur inconnue",logsHint:"Cliquez sur une exécution ou sur son bouton Journaux pour afficher les journaux.",status_active:"active",status_paused:"suspendue",status_stopped:"arrêtée",status_scheduled:"planifiée",status_pending:"en attente",status_running:"en cours",status_completed:"terminée",status_succeeded:"réussie",status_failed:"échouée",status_error:"erreur",status_cancelled:"annulée",status_timed_out:"expirée",trigger_manual:"manuel",trigger_schedule:"planification",trigger_scheduled:"planifié",trigger_retry:"nouvelle tentative",overlap_skip:"ignorer",overlap_queue:"mettre en file",overlap_cancel:"annuler"},de:{subtitle_one:"{count} registrierter Job",subtitle_other:"{count} registrierte Jobs",subtitleEmpty:"Job-Planer",loadingJobs:"Jobs werden geladen…",error:"Fehler: {message}",actionFailed:"Aktion fehlgeschlagen",name:"Name",group:"Gruppe",status:"Status",schedule:"Zeitplan",interval:"Intervall",lastRun:"Letzte Ausführung",nextRun:"Nächste Ausführung",every:"alle {interval}",trigger:"Auslösen",pause:"Pausieren",resume:"Fortsetzen",stop:"Stoppen",back:"← Zurück",detailTitle:"Job-Details",jobId:"Job {id}",loadingDetails:"Job-Details werden geladen…",jobInfo:"Job-Informationen",lastDuration:"Letzte Dauer",maxRetries:"Max. Wiederholungen",overlapPolicy:"Überlappungsrichtlinie",timeout:"Zeitlimit",history:"Ausführungsverlauf",totalExecutions_one:"{count} Ausführung insgesamt",totalExecutions_other:"{count} Ausführungen insgesamt",loadingHistory:"Verlauf wird geladen…",previous:"Zurück",next:"Weiter",pageOf:"Seite {page} von {total}",id:"ID",started:"Gestartet",duration:"Dauer",errorColumn:"Fehler",logs:"Protokolle",executionLogs:"Ausführungsprotokolle",loadingLogsFor:"Protokolle der Ausführung {id} werden geladen…",noLogs:"Für diese Ausführung sind keine Protokolle vorhanden.",logsError:"Fehler beim Laden der Protokolle: {message}",unknownError:"Unbekannter Fehler",logsHint:"Klicken Sie auf eine Ausführung oder deren Schaltfläche „Protokolle“, um die Protokolle anzuzeigen.",status_active:"aktiv",status_paused:"pausiert",status_stopped:"gestoppt",status_scheduled:"geplant",status_pending:"ausstehend",status_running:"läuft",status_completed:"abgeschlossen",status_succeeded:"erfolgreich",status_failed:"fehlgeschlagen",status_error:"Fehler",status_cancelled:"abgebrochen",status_timed_out:"Zeitüberschreitung",trigger_manual:"manuell",trigger_schedule:"Zeitplan",trigger_scheduled:"geplant",trigger_retry:"Wiederholung",overlap_skip:"überspringen",overlap_queue:"einreihen",overlap_cancel:"abbrechen"},pt:{subtitle_one:"{count} tarefa registrada",subtitle_other:"{count} tarefas registradas",subtitleEmpty:"Agendador de tarefas",loadingJobs:"Carregando tarefas…",error:"Erro: {message}",actionFailed:"A ação falhou",name:"Nome",group:"Grupo",status:"Status",schedule:"Agendamento",interval:"Intervalo",lastRun:"Última execução",nextRun:"Próxima execução",every:"a cada {interval}",trigger:"Executar",pause:"Pausar",resume:"Retomar",stop:"Parar",back:"← Voltar",detailTitle:"Detalhes da tarefa",jobId:"Tarefa {id}",loadingDetails:"Carregando detalhes da tarefa…",jobInfo:"Informações da tarefa",lastDuration:"Última duração",maxRetries:"Máximo de tentativas",overlapPolicy:"Política de sobreposição",timeout:"Tempo limite",history:"Histórico de execuções",totalExecutions_one:"{count} execução no total",totalExecutions_other:"{count} execuções no total",loadingHistory:"Carregando histórico…",previous:"Anterior",next:"Próxima",pageOf:"Página {page} de {total}",id:"ID",started:"Início",duration:"Duração",errorColumn:"Erro",logs:"Logs",executionLogs:"Logs de execução",loadingLogsFor:"Carregando logs da execução {id}…",noLogs:"Nenhum log disponível para esta execução.",logsError:"Erro ao carregar logs: {message}",unknownError:"Erro desconhecido",logsHint:"Clique em uma execução ou no botão Logs para ver os logs.",status_active:"ativa",status_paused:"pausada",status_stopped:"parada",status_scheduled:"agendada",status_pending:"pendente",status_running:"em execução",status_completed:"concluída",status_succeeded:"bem-sucedida",status_failed:"falhou",status_error:"erro",status_cancelled:"cancelada",status_timed_out:"tempo esgotado",trigger_manual:"manual",trigger_schedule:"agendamento",trigger_scheduled:"agendada",trigger_retry:"nova tentativa",overlap_skip:"ignorar",overlap_queue:"enfileirar",overlap_cancel:"cancelar"},it:{subtitle_one:"{count} job registrato",subtitle_other:"{count} job registrati",subtitleEmpty:"Pianificatore dei job",loadingJobs:"Caricamento dei job…",error:"Errore: {message}",actionFailed:"Azione non riuscita",name:"Nome",group:"Gruppo",status:"Stato",schedule:"Pianificazione",interval:"Intervallo",lastRun:"Ultima esecuzione",nextRun:"Prossima esecuzione",every:"ogni {interval}",trigger:"Avvia",pause:"Sospendi",resume:"Riprendi",stop:"Arresta",back:"← Indietro",detailTitle:"Dettagli del job",jobId:"Job {id}",loadingDetails:"Caricamento dei dettagli del job…",jobInfo:"Informazioni sul job",lastDuration:"Ultima durata",maxRetries:"Tentativi massimi",overlapPolicy:"Criterio di sovrapposizione",timeout:"Timeout",history:"Cronologia esecuzioni",totalExecutions_one:"{count} esecuzione in totale",totalExecutions_other:"{count} esecuzioni in totale",loadingHistory:"Caricamento della cronologia…",previous:"Precedente",next:"Successiva",pageOf:"Pagina {page} di {total}",id:"ID",started:"Avvio",duration:"Durata",errorColumn:"Errore",logs:"Log",executionLogs:"Log di esecuzione",loadingLogsFor:"Caricamento dei log dell’esecuzione {id}…",noLogs:"Nessun log disponibile per questa esecuzione.",logsError:"Errore durante il caricamento dei log: {message}",unknownError:"Errore sconosciuto",logsHint:"Fai clic su un’esecuzione o sul relativo pulsante Log per visualizzare i log.",status_active:"attivo",status_paused:"in pausa",status_stopped:"arrestato",status_scheduled:"pianificato",status_pending:"in attesa",status_running:"in esecuzione",status_completed:"completato",status_succeeded:"riuscito",status_failed:"non riuscito",status_error:"errore",status_cancelled:"annullato",status_timed_out:"scaduto",trigger_manual:"manuale",trigger_schedule:"pianificazione",trigger_scheduled:"pianificato",trigger_retry:"nuovo tentativo",overlap_skip:"salta",overlap_queue:"accoda",overlap_cancel:"annulla"},ja:{subtitle_other:"{count} 件のジョブが登録済み",subtitleEmpty:"ジョブスケジューラー",loadingJobs:"ジョブを読み込み中…",error:"エラー: {message}",actionFailed:"操作に失敗しました",name:"名前",group:"グループ",status:"ステータス",schedule:"スケジュール",interval:"間隔",lastRun:"前回の実行",nextRun:"次回の実行",every:"{interval}ごと",trigger:"実行",pause:"一時停止",resume:"再開",stop:"停止",back:"← 戻る",detailTitle:"ジョブの詳細",jobId:"ジョブ {id}",loadingDetails:"ジョブの詳細を読み込み中…",jobInfo:"ジョブ情報",lastDuration:"前回の所要時間",maxRetries:"最大再試行回数",overlapPolicy:"重複時のポリシー",timeout:"タイムアウト",history:"実行履歴",totalExecutions_other:"合計 {count} 件の実行",loadingHistory:"履歴を読み込み中…",previous:"前へ",next:"次へ",pageOf:"{page} / {total} ページ",id:"ID",started:"開始",duration:"所要時間",errorColumn:"エラー",logs:"ログ",executionLogs:"実行ログ",loadingLogsFor:"実行 {id} のログを読み込み中…",noLogs:"この実行のログはありません。",logsError:"ログの読み込みエラー: {message}",unknownError:"不明なエラー",logsHint:"実行の行または「ログ」ボタンをクリックするとログが表示されます。",status_active:"有効",status_paused:"一時停止中",status_stopped:"停止",status_scheduled:"予定済み",status_pending:"保留中",status_running:"実行中",status_completed:"完了",status_succeeded:"成功",status_failed:"失敗",status_error:"エラー",status_cancelled:"キャンセル済み",status_timed_out:"タイムアウト",trigger_manual:"手動",trigger_schedule:"スケジュール",trigger_scheduled:"スケジュール",trigger_retry:"再試行",overlap_skip:"スキップ",overlap_queue:"キューに追加",overlap_cancel:"キャンセル"},ko:{subtitle_other:"등록된 작업 {count}개",subtitleEmpty:"작업 스케줄러",loadingJobs:"작업을 불러오는 중…",error:"오류: {message}",actionFailed:"작업을 수행하지 못했습니다",name:"이름",group:"그룹",status:"상태",schedule:"일정",interval:"간격",lastRun:"마지막 실행",nextRun:"다음 실행",every:"{interval}마다",trigger:"실행",pause:"일시 중지",resume:"재개",stop:"중지",back:"← 뒤로",detailTitle:"작업 상세",jobId:"작업 {id}",loadingDetails:"작업 상세 정보를 불러오는 중…",jobInfo:"작업 정보",lastDuration:"마지막 소요 시간",maxRetries:"최대 재시도 횟수",overlapPolicy:"중복 실행 정책",timeout:"시간 제한",history:"실행 기록",totalExecutions_other:"총 {count}회 실행",loadingHistory:"기록을 불러오는 중…",previous:"이전",next:"다음",pageOf:"{total}페이지 중 {page}페이지",id:"ID",started:"시작",duration:"소요 시간",errorColumn:"오류",logs:"로그",executionLogs:"실행 로그",loadingLogsFor:"실행 {id}의 로그를 불러오는 중…",noLogs:"이 실행에 대한 로그가 없습니다.",logsError:"로그를 불러오는 중 오류 발생: {message}",unknownError:"알 수 없는 오류",logsHint:"실행 행이나 로그 버튼을 클릭하면 로그가 표시됩니다.",status_active:"활성",status_paused:"일시 중지됨",status_stopped:"중지됨",status_scheduled:"예약됨",status_pending:"대기 중",status_running:"실행 중",status_completed:"완료",status_succeeded:"성공",status_failed:"실패",status_error:"오류",status_cancelled:"취소됨",status_timed_out:"시간 초과",trigger_manual:"수동",trigger_schedule:"일정",trigger_scheduled:"예약",trigger_retry:"재시도",overlap_skip:"건너뛰기",overlap_queue:"대기열",overlap_cancel:"취소"},zh:{subtitle_other:"已注册 {count} 个任务",subtitleEmpty:"任务调度器",loadingJobs:"正在加载任务…",error:"错误:{message}",actionFailed:"操作失败",name:"名称",group:"分组",status:"状态",schedule:"计划",interval:"间隔",lastRun:"上次运行",nextRun:"下次运行",every:"每 {interval}",trigger:"触发",pause:"暂停",resume:"恢复",stop:"停止",back:"← 返回",detailTitle:"任务详情",jobId:"任务 {id}",loadingDetails:"正在加载任务详情…",jobInfo:"任务信息",lastDuration:"上次耗时",maxRetries:"最大重试次数",overlapPolicy:"重叠策略",timeout:"超时",history:"执行历史",totalExecutions_other:"共 {count} 次执行",loadingHistory:"正在加载历史记录…",previous:"上一页",next:"下一页",pageOf:"第 {page} 页,共 {total} 页",id:"ID",started:"开始时间",duration:"耗时",errorColumn:"错误",logs:"日志",executionLogs:"执行日志",loadingLogsFor:"正在加载执行 {id} 的日志…",noLogs:"此次执行没有日志。",logsError:"加载日志出错:{message}",unknownError:"未知错误",logsHint:"点击执行记录行或其“日志”按钮以查看日志。",status_active:"活动",status_paused:"已暂停",status_stopped:"已停止",status_scheduled:"已计划",status_pending:"等待中",status_running:"运行中",status_completed:"已完成",status_succeeded:"成功",status_failed:"失败",status_error:"错误",status_cancelled:"已取消",status_timed_out:"已超时",trigger_manual:"手动",trigger_schedule:"计划",trigger_scheduled:"计划",trigger_retry:"重试",overlap_skip:"跳过",overlap_queue:"排队",overlap_cancel:"取消"},ru:{subtitle_one:"{count} зарегистрированное задание",subtitle_few:"{count} зарегистрированных задания",subtitle_many:"{count} зарегистрированных заданий",subtitle_other:"{count} зарегистрированного задания",subtitleEmpty:"Планировщик заданий",loadingJobs:"Загрузка заданий…",error:"Ошибка: {message}",actionFailed:"Не удалось выполнить действие",name:"Имя",group:"Группа",status:"Статус",schedule:"Расписание",interval:"Интервал",lastRun:"Последний запуск",nextRun:"Следующий запуск",every:"каждые {interval}",trigger:"Запустить",pause:"Приостановить",resume:"Возобновить",stop:"Остановить",back:"← Назад",detailTitle:"Сведения о задании",jobId:"Задание {id}",loadingDetails:"Загрузка сведений о задании…",jobInfo:"Информация о задании",lastDuration:"Последняя длительность",maxRetries:"Макс. повторов",overlapPolicy:"Политика перекрытия",timeout:"Тайм-аут",history:"История выполнений",totalExecutions_one:"Всего {count} выполнение",totalExecutions_few:"Всего {count} выполнения",totalExecutions_many:"Всего {count} выполнений",totalExecutions_other:"Всего {count} выполнения",loadingHistory:"Загрузка истории…",previous:"Назад",next:"Далее",pageOf:"Страница {page} из {total}",id:"ID",started:"Начало",duration:"Длительность",errorColumn:"Ошибка",logs:"Журналы",executionLogs:"Журналы выполнения",loadingLogsFor:"Загрузка журналов выполнения {id}…",noLogs:"Для этого выполнения журналов нет.",logsError:"Ошибка загрузки журналов: {message}",unknownError:"Неизвестная ошибка",logsHint:"Нажмите на строку выполнения или кнопку «Журналы», чтобы просмотреть журналы.",status_active:"активно",status_paused:"приостановлено",status_stopped:"остановлено",status_scheduled:"запланировано",status_pending:"ожидает",status_running:"выполняется",status_completed:"завершено",status_succeeded:"успешно",status_failed:"сбой",status_error:"ошибка",status_cancelled:"отменено",status_timed_out:"превышено время",trigger_manual:"вручную",trigger_schedule:"по расписанию",trigger_scheduled:"по расписанию",trigger_retry:"повтор",overlap_skip:"пропустить",overlap_queue:"в очередь",overlap_cancel:"отменить"}},plugins={en:{subtitle_one:"{count} installed plugin",subtitle_other:"{count} installed plugins",manager:"Plugin manager",loadingPlugins:"Loading plugins…",error:"Error: {message}",noPlugins:"No plugins installed.",noDescription:"No description",enablePlugin:"Enable plugin",disablePlugin:"Disable plugin",processorUnit_one:"processor",processorUnit_other:"processors",showCommands:"Show commands ▼",hideCommands:"Hide commands ▲",registeredCommands:"Registered commands"},es:{subtitle_one:"{count} plugin instalado",subtitle_other:"{count} plugins instalados",manager:"Gestor de plugins",loadingPlugins:"Cargando plugins…",error:"Error: {message}",noPlugins:"No hay plugins instalados.",noDescription:"Sin descripción",enablePlugin:"Activar plugin",disablePlugin:"Desactivar plugin",processorUnit_one:"procesador",processorUnit_other:"procesadores",showCommands:"Mostrar comandos ▼",hideCommands:"Ocultar comandos ▲",registeredCommands:"Comandos registrados"},fr:{subtitle_one:"{count} plugin installé",subtitle_other:"{count} plugins installés",manager:"Gestionnaire de plugins",loadingPlugins:"Chargement des plugins…",error:"Erreur : {message}",noPlugins:"Aucun plugin installé.",noDescription:"Aucune description",enablePlugin:"Activer le plugin",disablePlugin:"Désactiver le plugin",processorUnit_one:"processeur",processorUnit_other:"processeurs",showCommands:"Afficher les commandes ▼",hideCommands:"Masquer les commandes ▲",registeredCommands:"Commandes enregistrées"},de:{subtitle_one:"{count} installiertes Plugin",subtitle_other:"{count} installierte Plugins",manager:"Plugin-Verwaltung",loadingPlugins:"Plugins werden geladen…",error:"Fehler: {message}",noPlugins:"Keine Plugins installiert.",noDescription:"Keine Beschreibung",enablePlugin:"Plugin aktivieren",disablePlugin:"Plugin deaktivieren",processorUnit_one:"Prozessor",processorUnit_other:"Prozessoren",showCommands:"Befehle anzeigen ▼",hideCommands:"Befehle ausblenden ▲",registeredCommands:"Registrierte Befehle"},pt:{subtitle_one:"{count} plugin instalado",subtitle_other:"{count} plugins instalados",manager:"Gerenciador de plugins",loadingPlugins:"Carregando plugins…",error:"Erro: {message}",noPlugins:"Nenhum plugin instalado.",noDescription:"Sem descrição",enablePlugin:"Ativar plugin",disablePlugin:"Desativar plugin",processorUnit_one:"processador",processorUnit_other:"processadores",showCommands:"Mostrar comandos ▼",hideCommands:"Ocultar comandos ▲",registeredCommands:"Comandos registrados"},it:{subtitle_one:"{count} plugin installato",subtitle_other:"{count} plugin installati",manager:"Gestione plugin",loadingPlugins:"Caricamento plugin…",error:"Errore: {message}",noPlugins:"Nessun plugin installato.",noDescription:"Nessuna descrizione",enablePlugin:"Attiva plugin",disablePlugin:"Disattiva plugin",processorUnit_one:"processore",processorUnit_other:"processori",showCommands:"Mostra comandi ▼",hideCommands:"Nascondi comandi ▲",registeredCommands:"Comandi registrati"},ja:{subtitle_other:"インストール済みプラグイン {count} 件",manager:"プラグインマネージャー",loadingPlugins:"プラグインを読み込み中…",error:"エラー: {message}",noPlugins:"インストール済みのプラグインはありません。",noDescription:"説明なし",enablePlugin:"プラグインを有効にする",disablePlugin:"プラグインを無効にする",processorUnit_other:"プロセッサ",showCommands:"コマンドを表示 ▼",hideCommands:"コマンドを隠す ▲",registeredCommands:"登録済みコマンド"},ko:{subtitle_other:"설치된 플러그인 {count}개",manager:"플러그인 관리자",loadingPlugins:"플러그인을 불러오는 중…",error:"오류: {message}",noPlugins:"설치된 플러그인이 없습니다.",noDescription:"설명 없음",enablePlugin:"플러그인 사용",disablePlugin:"플러그인 사용 안 함",processorUnit_other:"프로세서",showCommands:"명령 표시 ▼",hideCommands:"명령 숨기기 ▲",registeredCommands:"등록된 명령"},zh:{subtitle_other:"已安装 {count} 个插件",manager:"插件管理器",loadingPlugins:"正在加载插件…",error:"错误:{message}",noPlugins:"未安装任何插件。",noDescription:"暂无描述",enablePlugin:"启用插件",disablePlugin:"停用插件",processorUnit_other:"个处理器",showCommands:"显示命令 ▼",hideCommands:"隐藏命令 ▲",registeredCommands:"已注册的命令"},ru:{subtitle_one:"{count} установленный плагин",subtitle_few:"{count} установленных плагина",subtitle_many:"{count} установленных плагинов",subtitle_other:"{count} установленного плагина",manager:"Менеджер плагинов",loadingPlugins:"Загрузка плагинов…",error:"Ошибка: {message}",noPlugins:"Нет установленных плагинов.",noDescription:"Нет описания",enablePlugin:"Включить плагин",disablePlugin:"Отключить плагин",processorUnit_one:"процессор",processorUnit_few:"процессора",processorUnit_many:"процессоров",processorUnit_other:"процессора",showCommands:"Показать команды ▼",hideCommands:"Скрыть команды ▲",registeredCommands:"Зарегистрированные команды"}},filesystem={en:{subtitle:"Browse and manage server files",upload:"Upload",uploading:"Uploading…",newFolder:"New Folder",colName:"Name",colSize:"Size",colModified:"Modified",download:"Download",uploadError:"Upload error: {message}",uploadFailed:"Upload failed",listFailed:"Failed to list directory",readError:"Error reading file: {message}",unknownError:"Unknown error",loadingFile:"Loading file content…",folderName:"Folder name",create:"Create",creating:"Creating…",createFailed:"Failed to create directory",confirmDeleteTitle:"Confirm Delete",confirmDelete:"Are you sure you want to delete {name}?",deleteDirNote:"This will remove the directory and all its contents.",deleting:"Deleting…",deleteFailed:"Delete failed",folder:"Folder",file:"File"},es:{subtitle:"Explora y administra los archivos del servidor",upload:"Subir",uploading:"Subiendo…",newFolder:"Nueva carpeta",colName:"Nombre",colSize:"Tamaño",colModified:"Modificado",download:"Descargar",uploadError:"Error al subir: {message}",uploadFailed:"Error al subir el archivo",listFailed:"No se pudo listar el directorio",readError:"Error al leer el archivo: {message}",unknownError:"Error desconocido",loadingFile:"Cargando contenido del archivo…",folderName:"Nombre de la carpeta",create:"Crear",creating:"Creando…",createFailed:"No se pudo crear el directorio",confirmDeleteTitle:"Confirmar eliminación",confirmDelete:"¿Seguro que quieres eliminar {name}?",deleteDirNote:"Se eliminarán el directorio y todo su contenido.",deleting:"Eliminando…",deleteFailed:"No se pudo eliminar",folder:"Carpeta",file:"Archivo"},fr:{subtitle:"Parcourir et gérer les fichiers du serveur",upload:"Téléverser",uploading:"Téléversement…",newFolder:"Nouveau dossier",colName:"Nom",colSize:"Taille",colModified:"Modifié",download:"Télécharger",uploadError:"Erreur de téléversement : {message}",uploadFailed:"Échec du téléversement",listFailed:"Impossible de lister le répertoire",readError:"Erreur de lecture du fichier : {message}",unknownError:"Erreur inconnue",loadingFile:"Chargement du contenu du fichier…",folderName:"Nom du dossier",create:"Créer",creating:"Création…",createFailed:"Impossible de créer le répertoire",confirmDeleteTitle:"Confirmer la suppression",confirmDelete:"Voulez-vous vraiment supprimer {name} ?",deleteDirNote:"Le répertoire et tout son contenu seront supprimés.",deleting:"Suppression…",deleteFailed:"Échec de la suppression",folder:"Dossier",file:"Fichier"},de:{subtitle:"Serverdateien durchsuchen und verwalten",upload:"Hochladen",uploading:"Wird hochgeladen…",newFolder:"Neuer Ordner",colName:"Name",colSize:"Größe",colModified:"Geändert",download:"Herunterladen",uploadError:"Fehler beim Hochladen: {message}",uploadFailed:"Hochladen fehlgeschlagen",listFailed:"Verzeichnis konnte nicht aufgelistet werden",readError:"Fehler beim Lesen der Datei: {message}",unknownError:"Unbekannter Fehler",loadingFile:"Dateiinhalt wird geladen…",folderName:"Ordnername",create:"Erstellen",creating:"Wird erstellt…",createFailed:"Verzeichnis konnte nicht erstellt werden",confirmDeleteTitle:"Löschen bestätigen",confirmDelete:"Möchten Sie {name} wirklich löschen?",deleteDirNote:"Das Verzeichnis und sein gesamter Inhalt werden entfernt.",deleting:"Wird gelöscht…",deleteFailed:"Löschen fehlgeschlagen",folder:"Ordner",file:"Datei"},pt:{subtitle:"Navegue e gerencie os arquivos do servidor",upload:"Enviar",uploading:"Enviando…",newFolder:"Nova pasta",colName:"Nome",colSize:"Tamanho",colModified:"Modificado",download:"Baixar",uploadError:"Erro no envio: {message}",uploadFailed:"Falha no envio",listFailed:"Não foi possível listar o diretório",readError:"Erro ao ler o arquivo: {message}",unknownError:"Erro desconhecido",loadingFile:"Carregando conteúdo do arquivo…",folderName:"Nome da pasta",create:"Criar",creating:"Criando…",createFailed:"Não foi possível criar o diretório",confirmDeleteTitle:"Confirmar exclusão",confirmDelete:"Tem certeza de que deseja excluir {name}?",deleteDirNote:"O diretório e todo o seu conteúdo serão removidos.",deleting:"Excluindo…",deleteFailed:"Falha ao excluir",folder:"Pasta",file:"Arquivo"},it:{subtitle:"Sfoglia e gestisci i file del server",upload:"Carica",uploading:"Caricamento…",newFolder:"Nuova cartella",colName:"Nome",colSize:"Dimensione",colModified:"Modificato",download:"Scarica",uploadError:"Errore di caricamento: {message}",uploadFailed:"Caricamento non riuscito",listFailed:"Impossibile elencare la directory",readError:"Errore durante la lettura del file: {message}",unknownError:"Errore sconosciuto",loadingFile:"Caricamento del contenuto del file…",folderName:"Nome cartella",create:"Crea",creating:"Creazione…",createFailed:"Impossibile creare la directory",confirmDeleteTitle:"Conferma eliminazione",confirmDelete:"Eliminare davvero {name}?",deleteDirNote:"Verranno rimossi la directory e tutto il suo contenuto.",deleting:"Eliminazione…",deleteFailed:"Eliminazione non riuscita",folder:"Cartella",file:"File"},ja:{subtitle:"サーバー上のファイルを参照・管理します",upload:"アップロード",uploading:"アップロード中…",newFolder:"新しいフォルダー",colName:"名前",colSize:"サイズ",colModified:"更新日時",download:"ダウンロード",uploadError:"アップロードエラー: {message}",uploadFailed:"アップロードに失敗しました",listFailed:"ディレクトリを一覧表示できませんでした",readError:"ファイルの読み込みエラー: {message}",unknownError:"不明なエラー",loadingFile:"ファイルの内容を読み込み中…",folderName:"フォルダー名",create:"作成",creating:"作成中…",createFailed:"ディレクトリを作成できませんでした",confirmDeleteTitle:"削除の確認",confirmDelete:"{name} を削除してもよろしいですか?",deleteDirNote:"ディレクトリとその中身がすべて削除されます。",deleting:"削除中…",deleteFailed:"削除に失敗しました",folder:"フォルダー",file:"ファイル"},ko:{subtitle:"서버 파일을 탐색하고 관리합니다",upload:"업로드",uploading:"업로드 중…",newFolder:"새 폴더",colName:"이름",colSize:"크기",colModified:"수정됨",download:"다운로드",uploadError:"업로드 오류: {message}",uploadFailed:"업로드하지 못했습니다",listFailed:"디렉터리 목록을 가져오지 못했습니다",readError:"파일 읽기 오류: {message}",unknownError:"알 수 없는 오류",loadingFile:"파일 내용을 불러오는 중…",folderName:"폴더 이름",create:"만들기",creating:"만드는 중…",createFailed:"디렉터리를 만들지 못했습니다",confirmDeleteTitle:"삭제 확인",confirmDelete:"{name}을(를) 삭제하시겠습니까?",deleteDirNote:"디렉터리와 그 안의 모든 내용이 삭제됩니다.",deleting:"삭제 중…",deleteFailed:"삭제하지 못했습니다",folder:"폴더",file:"파일"},zh:{subtitle:"浏览和管理服务器文件",upload:"上传",uploading:"正在上传…",newFolder:"新建文件夹",colName:"名称",colSize:"大小",colModified:"修改时间",download:"下载",uploadError:"上传出错:{message}",uploadFailed:"上传失败",listFailed:"无法列出目录",readError:"读取文件出错:{message}",unknownError:"未知错误",loadingFile:"正在加载文件内容…",folderName:"文件夹名称",create:"创建",creating:"正在创建…",createFailed:"无法创建目录",confirmDeleteTitle:"确认删除",confirmDelete:"确定要删除 {name} 吗?",deleteDirNote:"这将删除该目录及其所有内容。",deleting:"正在删除…",deleteFailed:"删除失败",folder:"文件夹",file:"文件"},ru:{subtitle:"Просмотр и управление файлами сервера",upload:"Загрузить",uploading:"Загрузка…",newFolder:"Новая папка",colName:"Имя",colSize:"Размер",colModified:"Изменён",download:"Скачать",uploadError:"Ошибка загрузки: {message}",uploadFailed:"Не удалось загрузить файл",listFailed:"Не удалось получить содержимое каталога",readError:"Ошибка чтения файла: {message}",unknownError:"Неизвестная ошибка",loadingFile:"Загрузка содержимого файла…",folderName:"Имя папки",create:"Создать",creating:"Создание…",createFailed:"Не удалось создать каталог",confirmDeleteTitle:"Подтверждение удаления",confirmDelete:"Вы уверены, что хотите удалить {name}?",deleteDirNote:"Каталог и всё его содержимое будут удалены.",deleting:"Удаление…",deleteFailed:"Не удалось удалить",folder:"Папка",file:"Файл"}},events={en:{subtitle:"Live event stream and connected clients",liveEvents:"Live Events",shown:"{shown} / {max}",allTypes:"All types",filterLabel:"Filter by event type",autoScrollOn:"Auto-scroll ON",autoScrollOff:"Auto-scroll OFF",clear:"Clear",waiting:"Waiting for events…",connectedClients:"Connected Clients",connectedCount_one:"{count} connected",connectedCount_other:"{count} connected",noClients:"No clients connected.",colId:"ID",colType:"Type",colConnected:"Connected",colRemote:"Remote"},es:{subtitle:"Flujo de eventos en vivo y clientes conectados",liveEvents:"Eventos en vivo",shown:"{shown} / {max}",allTypes:"Todos los tipos",filterLabel:"Filtrar por tipo de evento",autoScrollOn:"Desplazamiento automático: SÍ",autoScrollOff:"Desplazamiento automático: NO",clear:"Limpiar",waiting:"Esperando eventos…",connectedClients:"Clientes conectados",connectedCount_one:"{count} conectado",connectedCount_other:"{count} conectados",noClients:"No hay clientes conectados.",colId:"ID",colType:"Tipo",colConnected:"Conectado",colRemote:"Remoto"},fr:{subtitle:"Flux d’événements en direct et clients connectés",liveEvents:"Événements en direct",shown:"{shown} / {max}",allTypes:"Tous les types",filterLabel:"Filtrer par type d’événement",autoScrollOn:"Défilement auto : ACTIVÉ",autoScrollOff:"Défilement auto : DÉSACTIVÉ",clear:"Effacer",waiting:"En attente d’événements…",connectedClients:"Clients connectés",connectedCount_one:"{count} connecté",connectedCount_other:"{count} connectés",noClients:"Aucun client connecté.",colId:"ID",colType:"Type",colConnected:"Connecté",colRemote:"Distant"},de:{subtitle:"Live-Ereignisstrom und verbundene Clients",liveEvents:"Live-Ereignisse",shown:"{shown} / {max}",allTypes:"Alle Typen",filterLabel:"Nach Ereignistyp filtern",autoScrollOn:"Auto-Scroll AN",autoScrollOff:"Auto-Scroll AUS",clear:"Leeren",waiting:"Warte auf Ereignisse…",connectedClients:"Verbundene Clients",connectedCount_one:"{count} verbunden",connectedCount_other:"{count} verbunden",noClients:"Keine Clients verbunden.",colId:"ID",colType:"Typ",colConnected:"Verbunden",colRemote:"Remote"},pt:{subtitle:"Fluxo de eventos ao vivo e clientes conectados",liveEvents:"Eventos ao vivo",shown:"{shown} / {max}",allTypes:"Todos os tipos",filterLabel:"Filtrar por tipo de evento",autoScrollOn:"Rolagem automática: LIGADA",autoScrollOff:"Rolagem automática: DESLIGADA",clear:"Limpar",waiting:"Aguardando eventos…",connectedClients:"Clientes conectados",connectedCount_one:"{count} conectado",connectedCount_other:"{count} conectados",noClients:"Nenhum cliente conectado.",colId:"ID",colType:"Tipo",colConnected:"Conectado",colRemote:"Remoto"},it:{subtitle:"Flusso di eventi in tempo reale e client connessi",liveEvents:"Eventi in tempo reale",shown:"{shown} / {max}",allTypes:"Tutti i tipi",filterLabel:"Filtra per tipo di evento",autoScrollOn:"Scorrimento automatico: ON",autoScrollOff:"Scorrimento automatico: OFF",clear:"Svuota",waiting:"In attesa di eventi…",connectedClients:"Client connessi",connectedCount_one:"{count} connesso",connectedCount_other:"{count} connessi",noClients:"Nessun client connesso.",colId:"ID",colType:"Tipo",colConnected:"Connesso",colRemote:"Remoto"},ja:{subtitle:"ライブイベントストリームと接続中のクライアント",liveEvents:"ライブイベント",shown:"{shown} / {max}",allTypes:"すべての種類",filterLabel:"イベントの種類で絞り込む",autoScrollOn:"自動スクロール: オン",autoScrollOff:"自動スクロール: オフ",clear:"クリア",waiting:"イベントを待機中…",connectedClients:"接続中のクライアント",connectedCount_other:"{count} 件接続中",noClients:"接続中のクライアントはありません。",colId:"ID",colType:"種類",colConnected:"接続日時",colRemote:"リモート"},ko:{subtitle:"실시간 이벤트 스트림 및 연결된 클라이언트",liveEvents:"실시간 이벤트",shown:"{shown} / {max}",allTypes:"모든 유형",filterLabel:"이벤트 유형으로 필터링",autoScrollOn:"자동 스크롤 켜짐",autoScrollOff:"자동 스크롤 꺼짐",clear:"지우기",waiting:"이벤트를 기다리는 중…",connectedClients:"연결된 클라이언트",connectedCount_other:"{count}개 연결됨",noClients:"연결된 클라이언트가 없습니다.",colId:"ID",colType:"유형",colConnected:"연결 시각",colRemote:"원격"},zh:{subtitle:"实时事件流和已连接的客户端",liveEvents:"实时事件",shown:"{shown} / {max}",allTypes:"所有类型",filterLabel:"按事件类型筛选",autoScrollOn:"自动滚动:开",autoScrollOff:"自动滚动:关",clear:"清空",waiting:"正在等待事件…",connectedClients:"已连接的客户端",connectedCount_other:"已连接 {count} 个",noClients:"没有已连接的客户端。",colId:"ID",colType:"类型",colConnected:"连接时间",colRemote:"远程地址"},ru:{subtitle:"Поток событий в реальном времени и подключённые клиенты",liveEvents:"События в реальном времени",shown:"{shown} / {max}",allTypes:"Все типы",filterLabel:"Фильтр по типу события",autoScrollOn:"Автопрокрутка: ВКЛ",autoScrollOff:"Автопрокрутка: ВЫКЛ",clear:"Очистить",waiting:"Ожидание событий…",connectedClients:"Подключённые клиенты",connectedCount_one:"{count} подключён",connectedCount_few:"{count} подключено",connectedCount_many:"{count} подключено",connectedCount_other:"{count} подключено",noClients:"Нет подключённых клиентов.",colId:"ID",colType:"Тип",colConnected:"Подключён",colRemote:"Адрес"}},config$1={en:{title:"Configuration",subtitle:"Server settings and runtime configuration",saveChanges:"Save Changes",loading:"Loading configuration…",error:"Error: {message}",restartRequired:"Some settings require a server restart to take effect.",saveFailed:"Save failed",mutable:"Mutable",readOnly:"Read-only",readOnlyMarker:"read-only",saved:"Saved",confirmTitle:"Save Configuration",confirmSave:"Confirm Save",saving:"Saving…",confirmMessage:"Are you sure you want to save the configuration changes? Some settings may require a server restart.",addValue:"Add value…",removeValue:"Remove {value}"},es:{title:"Configuración",subtitle:"Ajustes del servidor y configuración en tiempo de ejecución",saveChanges:"Guardar cambios",loading:"Cargando configuración…",error:"Error: {message}",restartRequired:"Algunos ajustes requieren reiniciar el servidor para aplicarse.",saveFailed:"No se pudo guardar",mutable:"Editable",readOnly:"Solo lectura",readOnlyMarker:"solo lectura",saved:"Guardado",confirmTitle:"Guardar configuración",confirmSave:"Confirmar y guardar",saving:"Guardando…",confirmMessage:"¿Seguro que quieres guardar los cambios de configuración? Algunos ajustes pueden requerir reiniciar el servidor.",addValue:"Añadir valor…",removeValue:"Quitar {value}"},fr:{title:"Configuration",subtitle:"Paramètres du serveur et configuration d’exécution",saveChanges:"Enregistrer les modifications",loading:"Chargement de la configuration…",error:"Erreur : {message}",restartRequired:"Certains paramètres nécessitent un redémarrage du serveur pour prendre effet.",saveFailed:"Échec de l’enregistrement",mutable:"Modifiable",readOnly:"Lecture seule",readOnlyMarker:"lecture seule",saved:"Enregistré",confirmTitle:"Enregistrer la configuration",confirmSave:"Confirmer l’enregistrement",saving:"Enregistrement…",confirmMessage:"Voulez-vous vraiment enregistrer les modifications de configuration ? Certains paramètres peuvent nécessiter un redémarrage du serveur.",addValue:"Ajouter une valeur…",removeValue:"Retirer {value}"},de:{title:"Konfiguration",subtitle:"Servereinstellungen und Laufzeitkonfiguration",saveChanges:"Änderungen speichern",loading:"Konfiguration wird geladen…",error:"Fehler: {message}",restartRequired:"Einige Einstellungen werden erst nach einem Serverneustart wirksam.",saveFailed:"Speichern fehlgeschlagen",mutable:"Änderbar",readOnly:"Schreibgeschützt",readOnlyMarker:"schreibgeschützt",saved:"Gespeichert",confirmTitle:"Konfiguration speichern",confirmSave:"Speichern bestätigen",saving:"Wird gespeichert…",confirmMessage:"Möchten Sie die Konfigurationsänderungen wirklich speichern? Einige Einstellungen erfordern möglicherweise einen Serverneustart.",addValue:"Wert hinzufügen…",removeValue:"{value} entfernen"},pt:{title:"Configuração",subtitle:"Definições do servidor e configuração em tempo de execução",saveChanges:"Salvar alterações",loading:"Carregando configuração…",error:"Erro: {message}",restartRequired:"Algumas definições exigem reiniciar o servidor para entrar em vigor.",saveFailed:"Falha ao salvar",mutable:"Editável",readOnly:"Somente leitura",readOnlyMarker:"somente leitura",saved:"Salvo",confirmTitle:"Salvar configuração",confirmSave:"Confirmar e salvar",saving:"Salvando…",confirmMessage:"Tem certeza de que deseja salvar as alterações de configuração? Algumas definições podem exigir reiniciar o servidor.",addValue:"Adicionar valor…",removeValue:"Remover {value}"},it:{title:"Configurazione",subtitle:"Impostazioni del server e configurazione di runtime",saveChanges:"Salva modifiche",loading:"Caricamento configurazione…",error:"Errore: {message}",restartRequired:"Alcune impostazioni richiedono il riavvio del server per avere effetto.",saveFailed:"Salvataggio non riuscito",mutable:"Modificabile",readOnly:"Sola lettura",readOnlyMarker:"sola lettura",saved:"Salvato",confirmTitle:"Salva configurazione",confirmSave:"Conferma salvataggio",saving:"Salvataggio…",confirmMessage:"Vuoi davvero salvare le modifiche alla configurazione? Alcune impostazioni potrebbero richiedere il riavvio del server.",addValue:"Aggiungi valore…",removeValue:"Rimuovi {value}"},ja:{title:"設定",subtitle:"サーバー設定と実行時の構成",saveChanges:"変更を保存",loading:"設定を読み込み中…",error:"エラー: {message}",restartRequired:"一部の設定はサーバーの再起動後に反映されます。",saveFailed:"保存に失敗しました",mutable:"変更可能",readOnly:"読み取り専用",readOnlyMarker:"読み取り専用",saved:"保存しました",confirmTitle:"設定を保存",confirmSave:"保存する",saving:"保存中…",confirmMessage:"設定の変更を保存しますか?一部の設定はサーバーの再起動が必要になる場合があります。",addValue:"値を追加…",removeValue:"{value} を削除"},ko:{title:"설정",subtitle:"서버 설정 및 런타임 구성",saveChanges:"변경 사항 저장",loading:"설정을 불러오는 중…",error:"오류: {message}",restartRequired:"일부 설정은 서버를 다시 시작해야 적용됩니다.",saveFailed:"저장하지 못했습니다",mutable:"변경 가능",readOnly:"읽기 전용",readOnlyMarker:"읽기 전용",saved:"저장됨",confirmTitle:"설정 저장",confirmSave:"저장 확인",saving:"저장 중…",confirmMessage:"설정 변경 사항을 저장하시겠습니까? 일부 설정은 서버를 다시 시작해야 할 수 있습니다.",addValue:"값 추가…",removeValue:"{value} 제거"},zh:{title:"配置",subtitle:"服务器设置和运行时配置",saveChanges:"保存更改",loading:"正在加载配置…",error:"错误:{message}",restartRequired:"部分设置需要重启服务器后才能生效。",saveFailed:"保存失败",mutable:"可修改",readOnly:"只读",readOnlyMarker:"只读",saved:"已保存",confirmTitle:"保存配置",confirmSave:"确认保存",saving:"正在保存…",confirmMessage:"确定要保存配置更改吗?部分设置可能需要重启服务器。",addValue:"添加值…",removeValue:"移除 {value}"},ru:{title:"Настройки",subtitle:"Параметры сервера и конфигурация среды выполнения",saveChanges:"Сохранить изменения",loading:"Загрузка настроек…",error:"Ошибка: {message}",restartRequired:"Некоторые параметры вступят в силу только после перезапуска сервера.",saveFailed:"Не удалось сохранить",mutable:"Изменяемый",readOnly:"Только чтение",readOnlyMarker:"только чтение",saved:"Сохранено",confirmTitle:"Сохранение настроек",confirmSave:"Подтвердить сохранение",saving:"Сохранение…",confirmMessage:"Сохранить изменения настроек? Для применения некоторых параметров может потребоваться перезапуск сервера.",addValue:"Добавить значение…",removeValue:"Удалить {value}"}},en={shown_one:"{count} entry shown",shown_other:"{count} entries shown",export:"Export",exportTitle:"Download the shown entries as a text file",search:"Search logs…",levels:"Log levels",showLevel:"Show {level} entries",hideLevel:"Hide {level} entries",loadOlder:"Load older logs ({remaining} remaining)",loading:"Loading logs…",loadFailed:"Failed to load logs",loadMoreFailed:"Failed to load more logs",error:"Error: {message}",output:"Log Output",autoScrollOn:"Auto-scroll ON",autoScrollOff:"Auto-scroll OFF",autoScrollTitle:"Toggle automatic scrolling to the newest entry",noMatches:"No log entries match the current filters."},ru={shown_one:"Показана {count} запись",shown_few:"Показано {count} записи",shown_many:"Показано {count} записей",shown_other:"Показано {count} записи",export:"Экспорт",exportTitle:"Скачать показанные записи в виде текстового файла",search:"Поиск по журналам…",levels:"Уровни журнала",showLevel:"Показать записи {level}",hideLevel:"Скрыть записи {level}",loadOlder:"Загрузить более ранние записи (осталось {remaining})",loading:"Загрузка журналов…",loadFailed:"Не удалось загрузить журналы",loadMoreFailed:"Не удалось загрузить больше записей",error:"Ошибка: {message}",output:"Вывод журнала",autoScrollOn:"Автопрокрутка ВКЛ",autoScrollOff:"Автопрокрутка ВЫКЛ",autoScrollTitle:"Включить или выключить автопрокрутку к последней записи",noMatches:"Нет записей, соответствующих текущим фильтрам."},logs={en,es:{shown_one:"{count} entrada mostrada",shown_other:"{count} entradas mostradas",export:"Exportar",exportTitle:"Descargar las entradas mostradas como archivo de texto",search:"Buscar en los registros…",levels:"Niveles de registro",showLevel:"Mostrar entradas {level}",hideLevel:"Ocultar entradas {level}",loadOlder:"Cargar registros anteriores (quedan {remaining})",loading:"Cargando registros…",loadFailed:"No se pudieron cargar los registros",loadMoreFailed:"No se pudieron cargar más registros",error:"Error: {message}",output:"Salida de registros",autoScrollOn:"Desplazamiento automático: SÍ",autoScrollOff:"Desplazamiento automático: NO",autoScrollTitle:"Activar o desactivar el desplazamiento automático a la entrada más reciente",noMatches:"Ninguna entrada coincide con los filtros actuales."},fr:{shown_one:"{count} entrée affichée",shown_other:"{count} entrées affichées",export:"Exporter",exportTitle:"Télécharger les entrées affichées dans un fichier texte",search:"Rechercher dans les journaux…",levels:"Niveaux de journal",showLevel:"Afficher les entrées {level}",hideLevel:"Masquer les entrées {level}",loadOlder:"Charger les journaux plus anciens ({remaining} restantes)",loading:"Chargement des journaux…",loadFailed:"Impossible de charger les journaux",loadMoreFailed:"Impossible de charger plus de journaux",error:"Erreur : {message}",output:"Sortie des journaux",autoScrollOn:"Défilement auto : ACTIVÉ",autoScrollOff:"Défilement auto : DÉSACTIVÉ",autoScrollTitle:"Activer ou désactiver le défilement automatique vers l’entrée la plus récente",noMatches:"Aucune entrée ne correspond aux filtres actuels."},de:{shown_one:"{count} Eintrag angezeigt",shown_other:"{count} Einträge angezeigt",export:"Exportieren",exportTitle:"Angezeigte Einträge als Textdatei herunterladen",search:"Protokolle durchsuchen…",levels:"Protokollstufen",showLevel:"{level}-Einträge anzeigen",hideLevel:"{level}-Einträge ausblenden",loadOlder:"Ältere Protokolle laden ({remaining} verbleibend)",loading:"Protokolle werden geladen…",loadFailed:"Protokolle konnten nicht geladen werden",loadMoreFailed:"Weitere Protokolle konnten nicht geladen werden",error:"Fehler: {message}",output:"Protokollausgabe",autoScrollOn:"Auto-Scroll AN",autoScrollOff:"Auto-Scroll AUS",autoScrollTitle:"Automatisches Scrollen zum neuesten Eintrag umschalten",noMatches:"Keine Protokolleinträge entsprechen den aktuellen Filtern."},pt:{shown_one:"{count} entrada exibida",shown_other:"{count} entradas exibidas",export:"Exportar",exportTitle:"Baixar as entradas exibidas como arquivo de texto",search:"Pesquisar logs…",levels:"Níveis de log",showLevel:"Mostrar entradas {level}",hideLevel:"Ocultar entradas {level}",loadOlder:"Carregar logs mais antigos ({remaining} restantes)",loading:"Carregando logs…",loadFailed:"Falha ao carregar os logs",loadMoreFailed:"Falha ao carregar mais logs",error:"Erro: {message}",output:"Saída de logs",autoScrollOn:"Rolagem automática: LIGADA",autoScrollOff:"Rolagem automática: DESLIGADA",autoScrollTitle:"Ativar ou desativar a rolagem automática até a entrada mais recente",noMatches:"Nenhuma entrada de log corresponde aos filtros atuais."},it:{shown_one:"{count} voce visualizzata",shown_other:"{count} voci visualizzate",export:"Esporta",exportTitle:"Scarica le voci visualizzate come file di testo",search:"Cerca nei log…",levels:"Livelli di log",showLevel:"Mostra voci {level}",hideLevel:"Nascondi voci {level}",loadOlder:"Carica log precedenti ({remaining} rimanenti)",loading:"Caricamento log…",loadFailed:"Impossibile caricare i log",loadMoreFailed:"Impossibile caricare altri log",error:"Errore: {message}",output:"Output dei log",autoScrollOn:"Scorrimento automatico ON",autoScrollOff:"Scorrimento automatico OFF",autoScrollTitle:"Attiva o disattiva lo scorrimento automatico alla voce più recente",noMatches:"Nessuna voce di log corrisponde ai filtri attuali."},ja:{shown_other:"{count} 件を表示中",export:"エクスポート",exportTitle:"表示中のエントリをテキストファイルとしてダウンロード",search:"ログを検索…",levels:"ログレベル",showLevel:"{level} のエントリを表示",hideLevel:"{level} のエントリを非表示",loadOlder:"過去のログを読み込む (残り {remaining} 件)",loading:"ログを読み込み中…",loadFailed:"ログを読み込めませんでした",loadMoreFailed:"追加のログを読み込めませんでした",error:"エラー: {message}",output:"ログ出力",autoScrollOn:"自動スクロール ON",autoScrollOff:"自動スクロール OFF",autoScrollTitle:"最新のエントリへの自動スクロールを切り替え",noMatches:"現在のフィルターに一致するログはありません。"},ko:{shown_other:"{count}개 항목 표시 중",export:"내보내기",exportTitle:"표시된 항목을 텍스트 파일로 다운로드",search:"로그 검색…",levels:"로그 수준",showLevel:"{level} 항목 표시",hideLevel:"{level} 항목 숨기기",loadOlder:"이전 로그 불러오기 ({remaining}개 남음)",loading:"로그를 불러오는 중…",loadFailed:"로그를 불러오지 못했습니다",loadMoreFailed:"로그를 더 불러오지 못했습니다",error:"오류: {message}",output:"로그 출력",autoScrollOn:"자동 스크롤 켜짐",autoScrollOff:"자동 스크롤 꺼짐",autoScrollTitle:"최신 항목으로 자동 스크롤 전환",noMatches:"현재 필터와 일치하는 로그 항목이 없습니다."},zh:{shown_other:"显示 {count} 条记录",export:"导出",exportTitle:"将显示的记录下载为文本文件",search:"搜索日志…",levels:"日志级别",showLevel:"显示 {level} 记录",hideLevel:"隐藏 {level} 记录",loadOlder:"加载更早的日志(剩余 {remaining} 条)",loading:"正在加载日志…",loadFailed:"日志加载失败",loadMoreFailed:"无法加载更多日志",error:"错误:{message}",output:"日志输出",autoScrollOn:"自动滚动:开",autoScrollOff:"自动滚动:关",autoScrollTitle:"切换自动滚动到最新记录",noMatches:"没有符合当前筛选条件的日志记录。"},ru},terminal={en:{title:"Terminal",subtitle:"Execute CLI commands directly on the server"},es:{title:"Terminal",subtitle:"Ejecuta comandos de la CLI directamente en el servidor"},fr:{title:"Terminal",subtitle:"Exécutez des commandes CLI directement sur le serveur"},de:{title:"Terminal",subtitle:"CLI-Befehle direkt auf dem Server ausführen"},pt:{title:"Terminal",subtitle:"Execute comandos da CLI diretamente no servidor"},it:{title:"Terminale",subtitle:"Esegui comandi CLI direttamente sul server"},ja:{title:"ターミナル",subtitle:"サーバー上で CLI コマンドを直接実行します"},ko:{title:"터미널",subtitle:"서버에서 CLI 명령을 직접 실행합니다"},zh:{title:"终端",subtitle:"直接在服务器上执行 CLI 命令"},ru:{title:"Терминал",subtitle:"Выполняйте команды CLI прямо на сервере"}},components={en:{autoScrollOn:"Auto-scroll ON",autoScrollOff:"Auto-scroll OFF",breadcrumb:"Path",root:"Root directory"},es:{autoScrollOn:"Desplazamiento auto: SÍ",autoScrollOff:"Desplazamiento auto: NO",breadcrumb:"Ruta",root:"Directorio raíz"},fr:{autoScrollOn:"Défilement auto : ON",autoScrollOff:"Défilement auto : OFF",breadcrumb:"Chemin",root:"Répertoire racine"},de:{autoScrollOn:"Auto-Scroll AN",autoScrollOff:"Auto-Scroll AUS",breadcrumb:"Pfad",root:"Stammverzeichnis"},pt:{autoScrollOn:"Rolagem automática: SIM",autoScrollOff:"Rolagem automática: NÃO",breadcrumb:"Caminho",root:"Diretório raiz"},it:{autoScrollOn:"Scorrimento auto: ON",autoScrollOff:"Scorrimento auto: OFF",breadcrumb:"Percorso",root:"Directory radice"},ja:{autoScrollOn:"自動スクロール: オン",autoScrollOff:"自動スクロール: オフ",breadcrumb:"パス",root:"ルートディレクトリ"},ko:{autoScrollOn:"자동 스크롤 켜짐",autoScrollOff:"자동 스크롤 꺼짐",breadcrumb:"경로",root:"루트 디렉터리"},zh:{autoScrollOn:"自动滚动:开",autoScrollOff:"自动滚动:关",breadcrumb:"路径",root:"根目录"},ru:{autoScrollOn:"Автопрокрутка: ВКЛ",autoScrollOff:"Автопрокрутка: ВЫКЛ",breadcrumb:"Путь",root:"Корневой каталог"}},messages={common,nav,login:login$1,overview,commands,jobs,plugins,filesystem,events,config:config$1,logs,terminal,components},STORAGE_KEY$1="qcli_admin_locale";function initialLocale(){try{const e=localStorage.getItem(STORAGE_KEY$1);if(isLocale(e))return e}catch{}for(const e of navigator.languages??[navigator.language]){const t=e==null?void 0:e.toLowerCase().split("-")[0];if(isLocale(t))return t}return"en"}function lookup(e,t,r){var o,u;const s=messages[t];return((o=s==null?void 0:s[e])==null?void 0:o[r])??((u=s==null?void 0:s.en)==null?void 0:u[r])}const I18nCtx=reactExports.createContext(null);function I18nProvider({children:e}){const[t,r]=reactExports.useState(initialLocale),s=reactExports.useCallback(u=>{r(u);try{localStorage.setItem(STORAGE_KEY$1,u)}catch{}},[]);reactExports.useEffect(()=>{document.documentElement.lang=t},[t]);const o=reactExports.useMemo(()=>{const u=new Intl.PluralRules(t),d=new Intl.RelativeTimeFormat(t,{numeric:"auto"});return{locale:t,setLocale:s,t:(f,C)=>{const h=f.indexOf("."),j=f.slice(0,h),U=f.slice(h+1);if(C&&"count"in C&&typeof C.count!="number"){const H=Number(C.count);C={...C,count:Number.isFinite(H)?H:0}}let W;if(C&&typeof C.count=="number"){const H=u.select(C.count);W=lookup(t,j,`${U}_${H}`)??lookup(t,j,`${U}_other`)}return W??(W=lookup(t,j,U)??lookup(t,j,`${U}_other`)??f),C?W.replace(/\{(\w+)\}/g,(H,x)=>C[x]!=null?String(typeof C[x]=="number"?new Intl.NumberFormat(t).format(C[x]):C[x]):H):W},formatDate:(f,C)=>{const h=new Date(f);return Number.isNaN(h.getTime())?"—":h.toLocaleString(t,C)},formatNumber:(f,C)=>new Intl.NumberFormat(t,C).format(f),formatRelative:f=>{const C=new Date(f).getTime();if(Number.isNaN(C))return"—";const h=Math.round((C-Date.now())/1e3),j=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]];for(const[U,W]of j)if(Math.abs(h)>=W)return d.format(Math.round(h/W),U);return d.format(h,"second")}}},[t,s]);return jsxRuntimeExports.jsx(I18nCtx.Provider,{value:o,children:e})}function useOptionalI18n(){return reactExports.useContext(I18nCtx)}function useI18n(){const e=reactExports.useContext(I18nCtx);if(!e)throw new Error("useI18n must be used within I18nProvider");return e}function keysChanged(e=[],t=[]){return e.length!==t.length||e.some((r,s)=>!Object.is(r,t[s]))}class ErrorBoundary extends reactExports.Component{constructor(){super(...arguments);Ua(this,"state",{error:null});Ua(this,"retry",()=>this.setState({error:null}))}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,s){console.error(`[dashboard] ${this.props.label??"section"} failed to render`,r,s.componentStack)}componentDidUpdate(r,s){this.state.error&&s.error&&keysChanged(r.resetKeys,this.props.resetKeys)&&this.setState({error:null})}render(){const{error:r}=this.state;return r?jsxRuntimeExports.jsx(ErrorFallback,{error:r,label:this.props.label,page:this.props.variant==="page",onRetry:this.retry}):this.props.children}}function ErrorFallback({error:e,label:t,page:r,onRetry:s}){const o=useOptionalI18n(),u={page:(o==null?void 0:o.t("common.pageFailed"))??"This page failed to load",section:(o==null?void 0:o.t("common.sectionFailed",{label:t??o.t("common.thisSection")}))??`${t??"This section"} failed to render`,retry:(o==null?void 0:o.t("common.retry"))??"Retry"};return jsxRuntimeExports.jsxs("div",{role:"alert",className:r?"m-6 p-6 rounded-xl border border-red-500/30 bg-red-500/[0.06]":"p-4 rounded-lg border border-red-500/30 bg-red-500/[0.06]",children:[jsxRuntimeExports.jsx("div",{className:"text-sm font-medium text-red-300",children:r?u.page:u.section}),jsxRuntimeExports.jsx("div",{className:"mt-1 text-xs text-red-200/70 font-mono break-all",children:e.message||String(e)}),jsxRuntimeExports.jsx("button",{onClick:s,className:"mt-3 text-xs px-3 py-1 rounded-md border border-white/10 text-slate-300 hover:bg-white/[0.06]",children:u.retry})]})}const TOKEN_KEY="qcli_admin_token";function getToken(){return localStorage.getItem(TOKEN_KEY)}function setToken(e){localStorage.setItem(TOKEN_KEY,e)}function clearToken(){localStorage.removeItem(TOKEN_KEY)}const LOGIN_URL="/qcli/admin/login";async function apiFetch(e,{anonymous:t=!1,...r}={}){const s=t?null:getToken(),o={"Content-Type":"application/json",...r.headers??{}};s&&(o.Authorization=`Bearer ${s}`),r.body instanceof FormData&&delete o["Content-Type"];const u=await fetch(e,{...r,headers:o});if(u.status===401&&s)throw clearToken(),window.location.pathname!==LOGIN_URL&&(window.location.href=LOGIN_URL),new Error("Unauthorized");if(!u.ok){const a=await u.text();throw new Error(a||u.statusText)}const d=await u.text();if(d)try{return JSON.parse(d)}catch{return d}}async function buildWebSocketUrl(e){const t=getToken();if(!t)return null;const s=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${e}`,o=e.includes("?")?"&":"?";try{const u=await fetch("/api/v1/qcli/sessions/ws-ticket",{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:"{}"});if(u.ok){const{ticket:d}=await u.json();if(typeof d=="string")return`${s}${o}ticket=${encodeURIComponent(d)}`}if(u.status===401)return null}catch{}return`${s}${o}token=${encodeURIComponent(t)}`}async function login(e,t){const r=await apiFetch("/api/v1/qcli/auth/login",{method:"POST",body:JSON.stringify({username:e,password:t}),anonymous:!0});return setToken(r.token),r}async function getMe(){return apiFetch("/api/v1/qcli/auth/me")}async function logout(){const e=getToken();e&&await fetch("/api/v1/qcli/sessions/current",{method:"DELETE",headers:{Authorization:`Bearer ${e}`}}).catch(()=>{}),clearToken(),window.location.href=LOGIN_URL}const AuthContext=reactExports.createContext(null);function AuthProvider({children:e}){const[t,r]=reactExports.useState(null),[s,o]=reactExports.useState(!0),[u,d]=reactExports.useState(null);reactExports.useEffect(()=>{if(!getToken()){o(!1);return}getMe().then(r).catch(()=>r(null)).finally(()=>o(!1))},[]);const a=reactExports.useCallback(async(f,C)=>{d(null);try{const h=await login(f,C);r({username:h.username,authenticatedAt:new Date().toISOString()})}catch(h){throw d(h instanceof Error?h.message:"Login failed"),h}},[]),l=reactExports.useCallback(()=>{r(null),logout()},[]);return jsxRuntimeExports.jsx(AuthContext.Provider,{value:{user:t,loading:s,error:u,login:a,logout:l},children:e})}function useAuth(){const e=reactExports.useContext(AuthContext);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function getStatus(){return apiFetch("/api/v1/qcli/status")}function getCapabilities(){return apiFetch("/api/v1/qcli/capabilities")}const FeaturesContext=reactExports.createContext(null);function FeaturesProvider({children:e}){const[t,r]=reactExports.useState([]),[s,o]=reactExports.useState(!0);reactExports.useEffect(()=>{getStatus().then(d=>r(d.enabledFeatures??[])).catch(()=>r([])).finally(()=>o(!1))},[]);const u=d=>t.includes(d);return jsxRuntimeExports.jsx(FeaturesContext.Provider,{value:{features:t,loading:s,hasFeature:u},children:e})}function useFeatures(){const e=reactExports.useContext(FeaturesContext);if(!e)throw new Error("useFeatures must be used within FeaturesProvider");return e}const WsContext=reactExports.createContext(null);function WebSocketProvider({children:e}){const[t,r]=reactExports.useState("disconnected"),s=reactExports.useRef(null),o=reactExports.useRef(new Map),u=reactExports.useRef(0),d=reactExports.useRef();reactExports.useEffect(()=>{let l=!1;const f=async()=>{const C=await buildWebSocketUrl("/ws/v1/qcli/events");if(!C||l)return;const h=new WebSocket(C);s.current=h,h.onopen=()=>{r("connected"),u.current=0},h.onmessage=j=>{var U,W;try{const H=JSON.parse(j.data),x=H.type;(U=o.current.get(x))==null||U.forEach(L=>L(H)),o.current.forEach((L,R)=>{R!=="*"&&R.endsWith("*")&&x.startsWith(R.slice(0,-1))&&L.forEach(N=>N(H))}),(W=o.current.get("*"))==null||W.forEach(L=>L(H))}catch{}},h.onclose=()=>{if(l)return;r("reconnecting");const j=Math.min(1e3*2**u.current,3e4);u.current++,d.current=setTimeout(()=>void f(),j)},h.onerror=()=>h.close()};return f(),()=>{var C;l=!0,clearTimeout(d.current),(C=s.current)==null||C.close(),s.current=null}},[]);const a=reactExports.useCallback((l,f)=>(o.current.has(l)||o.current.set(l,new Set),o.current.get(l).add(f),()=>{var C;(C=o.current.get(l))==null||C.delete(f)}),[]);return jsxRuntimeExports.jsx(WsContext.Provider,{value:{status:t,subscribe:a},children:e})}function useWebSocket(){const e=reactExports.useContext(WsContext);if(!e)throw new Error("useWebSocket must be used within WebSocketProvider");return e}function LoginPage(){const[e,t]=reactExports.useState(""),[r,s]=reactExports.useState(""),[o,u]=reactExports.useState(!1),[d,a]=reactExports.useState(""),{login:l}=useAuth(),f=useNavigate(),{t:C}=useI18n(),h=async j=>{j.preventDefault(),u(!0),a("");try{await l(e,r),f("/")}catch{a(C("login.invalidCredentials"))}finally{u(!1)}};return jsxRuntimeExports.jsx("div",{className:"min-h-screen flex items-center justify-center",children:jsxRuntimeExports.jsxs("form",{onSubmit:h,className:"w-full max-w-sm bg-white/[0.04] border border-white/[0.08] rounded-xl p-8 backdrop-blur-sm",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[jsxRuntimeExports.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-primary-light to-primary flex items-center justify-center text-white font-bold text-lg",children:"Q"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h1",{className:"text-xl font-bold text-white",children:C("nav.appName")}),jsxRuntimeExports.jsx("p",{className:"text-xs text-slate-400",children:C("login.subtitle")})]})]}),d&&jsxRuntimeExports.jsx("div",{className:"mb-4 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:d}),jsxRuntimeExports.jsx("label",{className:"block text-sm text-slate-400 mb-1",children:C("login.username")}),jsxRuntimeExports.jsx("input",{type:"text",value:e,onChange:j=>t(j.target.value),className:"w-full mb-4 px-3 py-2 rounded-lg bg-white/[0.06] border border-white/[0.1] text-white placeholder-slate-500 focus:outline-none focus:border-primary-light",placeholder:"admin",autoFocus:!0}),jsxRuntimeExports.jsx("label",{className:"block text-sm text-slate-400 mb-1",children:C("login.password")}),jsxRuntimeExports.jsx("input",{type:"password",value:r,onChange:j=>s(j.target.value),className:"w-full mb-6 px-3 py-2 rounded-lg bg-white/[0.06] border border-white/[0.1] text-white placeholder-slate-500 focus:outline-none focus:border-primary-light",placeholder:"••••••••"}),jsxRuntimeExports.jsx("button",{type:"submit",disabled:o||!e||!r,className:"w-full py-2.5 rounded-lg bg-primary hover:bg-primary-dark text-white font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:C(o?"login.signingIn":"login.signIn")})]})})}function ConnectionStatus(){const{status:e}=useWebSocket(),{t}=useI18n(),r={connected:"bg-status-success",disconnected:"bg-status-error",reconnecting:"bg-status-warning"};return jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-1.5 mt-2 pl-9",children:[jsxRuntimeExports.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${r[e]}`}),jsxRuntimeExports.jsx("span",{className:"text-[11px] text-slate-500",children:t(`nav.${e}`)})]})}function LanguagePicker(){const{locale:e,setLocale:t,t:r}=useI18n();return jsxRuntimeExports.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-slate-500",children:[jsxRuntimeExports.jsx("span",{"aria-hidden":!0,children:"🌐"}),jsxRuntimeExports.jsx("span",{className:"sr-only",children:r("common.language")}),jsxRuntimeExports.jsx("select",{"aria-label":r("common.language"),value:e,onChange:s=>t(s.target.value),className:"bg-transparent text-slate-400 hover:text-slate-200 border-none outline-none cursor-pointer text-[11px]",children:LOCALES.map(s=>jsxRuntimeExports.jsx("option",{value:s.code,className:"bg-slate-900 text-slate-200",children:s.name},s.code))})]})}const navItems=[{path:"/",label:"nav.overview",icon:"▣"},{path:"/commands",label:"nav.commands",icon:"⌘"},{path:"/jobs",label:"nav.jobs",icon:"⏱",feature:"jobs"},{path:"/plugins",label:"nav.plugins",icon:"⚙"},{path:"/filesystem",label:"nav.filesystem",icon:"📁",feature:"filesystem"},{path:"/events",label:"nav.events",icon:"⚡"},{path:"/config",label:"nav.config",icon:"⚙"},{path:"/logs",label:"nav.logs",icon:"📜"},{path:"/terminal",label:"nav.terminal",icon:">"}];function Sidebar(){var d,a;const{user:e,logout:t}=useAuth(),{hasFeature:r,loading:s}=useFeatures(),{t:o}=useI18n(),u=s?navItems.filter(l=>!l.feature):navItems.filter(l=>!l.feature||r(l.feature));return jsxRuntimeExports.jsxs("aside",{className:"w-[220px] flex-shrink-0 bg-black/30 border-r border-white/[0.06] flex flex-col h-screen sticky top-0",children:[jsxRuntimeExports.jsxs("div",{className:"px-4 py-5 border-b border-white/[0.06]",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("div",{className:"w-7 h-7 rounded-lg bg-gradient-to-br from-primary-light to-primary flex items-center justify-center text-white font-bold text-sm",children:"Q"}),jsxRuntimeExports.jsx("span",{className:"font-bold text-white",children:o("nav.appName")})]}),jsxRuntimeExports.jsx(ConnectionStatus,{})]}),jsxRuntimeExports.jsx("nav",{className:"flex-1 px-2 py-3 overflow-y-auto",children:u.map(l=>jsxRuntimeExports.jsxs(NavLink,{to:l.path,end:l.path==="/",className:({isActive:f})=>`flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm mb-0.5 transition-colors ${f?"bg-primary/15 text-primary-light":"text-slate-400 hover:text-slate-200 hover:bg-white/[0.04]"}`,children:[jsxRuntimeExports.jsx("span",{className:"w-5 text-center",children:l.icon}),o(l.label)]},l.path))}),jsxRuntimeExports.jsxs("div",{className:"px-4 py-3 border-t border-white/[0.06] flex items-center gap-2",children:[jsxRuntimeExports.jsx("div",{className:"w-7 h-7 rounded-full bg-gradient-to-br from-primary to-purple-500 flex items-center justify-center text-xs text-white font-medium",children:((a=(d=e==null?void 0:e.username)==null?void 0:d[0])==null?void 0:a.toUpperCase())??"A"}),jsxRuntimeExports.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntimeExports.jsx("div",{className:"text-xs text-slate-200 truncate",children:e==null?void 0:e.username}),jsxRuntimeExports.jsx("button",{onClick:t,className:"text-[10px] text-slate-500 hover:text-slate-300",children:o("nav.signOut")})]})]}),jsxRuntimeExports.jsx("div",{className:"px-4 pb-3",children:jsxRuntimeExports.jsx(LanguagePicker,{})})]})}function DashboardLayout(){const e=useLocation();return jsxRuntimeExports.jsxs("div",{className:"flex min-h-screen",children:[jsxRuntimeExports.jsx(Sidebar,{}),jsxRuntimeExports.jsx("main",{className:"flex-1 min-w-0 overflow-y-auto",children:jsxRuntimeExports.jsx(ErrorBoundary,{variant:"page",children:jsxRuntimeExports.jsx(Outlet,{})},e.pathname)})]})}function StatCardContent({label:e,value:t,sub:r,subColor:s="text-slate-500"}){return jsxRuntimeExports.jsxs("div",{className:"flex-1 bg-white/[0.04] border border-white/[0.08] rounded-xl p-4",children:[jsxRuntimeExports.jsx("div",{className:"text-[11px] text-slate-500 uppercase tracking-wide",children:e}),jsxRuntimeExports.jsx("div",{className:"text-2xl font-semibold text-white mt-1",children:t}),r&&jsxRuntimeExports.jsx("div",{className:`text-[11px] mt-0.5 ${s}`,children:r})]})}function StatCard(e){return jsxRuntimeExports.jsx(ErrorBoundary,{label:e.label,resetKeys:[e.value],children:jsxRuntimeExports.jsx(StatCardContent,{...e})})}function PageHeader({title:e,subtitle:t,actions:r}){return jsxRuntimeExports.jsxs("div",{className:"px-6 py-4 border-b border-white/[0.06] flex items-center justify-between",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h2",{className:"text-lg font-semibold text-white",children:e}),t&&jsxRuntimeExports.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:t})]}),r&&jsxRuntimeExports.jsx("div",{className:"flex items-center gap-2",children:r})]})}function MonoPanelContent({lines:e,maxLines:t=500,title:r,className:s=""}){const{t:o}=useI18n(),u=reactExports.useRef(null),[d,a]=reactExports.useState(!0);reactExports.useEffect(()=>{d&&u.current&&(u.current.scrollTop=u.current.scrollHeight)},[e,d]);const l=()=>{if(!u.current)return;const{scrollTop:C,scrollHeight:h,clientHeight:j}=u.current;a(h-C-j<40)},f=e.slice(-t);return jsxRuntimeExports.jsxs("div",{className:`bg-white/[0.04] border border-white/[0.08] rounded-xl overflow-hidden ${s}`,children:[r&&jsxRuntimeExports.jsxs("div",{className:"px-4 py-3 border-b border-white/[0.06] flex items-center justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-sm font-medium text-white",children:r}),jsxRuntimeExports.jsx("button",{onClick:()=>a(!d),className:`text-[10px] px-2 py-0.5 rounded ${d?"bg-primary/20 text-primary-light":"bg-white/[0.06] text-slate-400"}`,children:o(d?"components.autoScrollOn":"components.autoScrollOff")})]}),jsxRuntimeExports.jsx("div",{ref:u,onScroll:l,className:"overflow-y-auto max-h-80 p-3 font-mono text-xs leading-5 text-slate-300",children:f.map((C,h)=>jsxRuntimeExports.jsx("div",{className:"whitespace-pre-wrap break-all",children:C},h))})]})}function MonoPanel(e){var r;const{t}=useI18n();return jsxRuntimeExports.jsx(ErrorBoundary,{label:e.title??t("common.panel"),resetKeys:[(r=e.lines)==null?void 0:r.length],children:jsxRuntimeExports.jsx(MonoPanelContent,{...e})})}function useApi(e,t=[]){const[r,s]=reactExports.useState(null),[o,u]=reactExports.useState(!0),[d,a]=reactExports.useState(null),l=reactExports.useRef(0),f=reactExports.useCallback(async()=>{const C=++l.current;u(!0),a(null);try{const h=await e();C===l.current&&s(h)}catch(h){C===l.current&&a(h instanceof Error?h.message:"Failed to fetch")}finally{C===l.current&&u(!1)}},t);return reactExports.useEffect(()=>{f()},[f]),{data:r,loading:o,error:d,refetch:f}}function getJobs(){return apiFetch("/api/v1/qcli/jobs")}function getJob(e){return apiFetch(`/api/v1/qcli/jobs/${e}`)}function triggerJob(e){return apiFetch(`/api/v1/qcli/jobs/${e}/trigger`,{method:"POST"})}function pauseJob(e){return apiFetch(`/api/v1/qcli/jobs/${e}/pause`,{method:"POST"})}function resumeJob(e){return apiFetch(`/api/v1/qcli/jobs/${e}/resume`,{method:"POST"})}function stopJob(e){return apiFetch(`/api/v1/qcli/jobs/${e}/stop`,{method:"POST"})}function getJobHistory(e,t={}){const r=new URLSearchParams;t.limit!==void 0&&r.set("limit",String(t.limit)),t.offset!==void 0&&r.set("offset",String(t.offset));const s=r.toString();return apiFetch(`/api/v1/qcli/jobs/${e}/history${s?`?${s}`:""}`)}function getJobExecution(e,t){return apiFetch(`/api/v1/qcli/jobs/${e}/history/${t}`)}function formatUptime$1(e,t){const r=Math.floor(e/86400),s=Math.floor(e%86400/3600),o=Math.floor(e%3600/60);return r>0?t("overview.uptimeDays",{days:r,hours:s}):s>0?t("overview.uptimeHours",{hours:s,minutes:o}):t("overview.uptimeMinutes",{minutes:o})}function formatTimestamp(){return new Date().toISOString().replace("T"," ").slice(0,19)}function OverviewPage(){const{t:e,formatDate:t,formatNumber:r}=useI18n(),{data:s,loading:o}=useApi(getStatus,[]),{data:u,loading:d}=useApi(getCapabilities,[]),{hasFeature:a}=useFeatures(),{data:l}=useApi(a("jobs")?getJobs:()=>Promise.resolve([]),[a("jobs")]),[f,C]=reactExports.useState([]),{subscribe:h}=useWebSocket();reactExports.useEffect(()=>h("*",R=>{const N=R.type??"unknown",V=JSON.stringify(R);C(J=>[...J.slice(-99),`[${formatTimestamp()}] ${N} ${V}`])}),[h]);const j=typeof(s==null?void 0:s.uptimeSeconds)=="number"?formatUptime$1(s.uptimeSeconds,e):"—",U=s?r(s.registeredCommands):"—",W=s?r(s.registeredJobs):"—",H=s?r(s.activeWsConnections):"—",x=l?l.slice(0,5):null;return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PageHeader,{title:e("nav.overview"),subtitle:e("overview.subtitle")}),jsxRuntimeExports.jsxs("div",{className:"p-6 space-y-6",children:[jsxRuntimeExports.jsxs("div",{className:"flex gap-4",children:[jsxRuntimeExports.jsx(StatCard,{label:e("overview.uptime"),value:j,sub:o?e("common.loading"):s?e("overview.since",{date:t(s.startedAt)}):void 0}),jsxRuntimeExports.jsx(StatCard,{label:e("nav.commands"),value:U,sub:e("overview.registeredProcessors")}),a("jobs")&&jsxRuntimeExports.jsx(StatCard,{label:e("overview.activeJobs"),value:W,sub:e("overview.registeredJobs")}),jsxRuntimeExports.jsx(StatCard,{label:e("overview.wsClients"),value:H,sub:e("overview.activeConnections")})]}),jsxRuntimeExports.jsx(ErrorBoundary,{label:e("overview.serverInfo"),resetKeys:[u],children:jsxRuntimeExports.jsxs("div",{className:"bg-white/[0.04] border border-white/[0.08] rounded-xl p-5",children:[jsxRuntimeExports.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:e("overview.serverInfo")}),d?jsxRuntimeExports.jsx("p",{className:"text-slate-400 text-sm",children:e("common.loading")}):u?jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-sm",children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:e("overview.os")}),jsxRuntimeExports.jsx("span",{className:"text-slate-200 font-mono text-xs",children:u.os??(s==null?void 0:s.os)??"—"})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:e("overview.platform")}),jsxRuntimeExports.jsx("span",{className:"text-slate-200 font-mono text-xs",children:u.platform??(s==null?void 0:s.platform)??"—"})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:e("overview.shell")}),jsxRuntimeExports.jsx("span",{className:"text-slate-200 font-mono text-xs",children:shellLabel(u,e)})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:e("overview.version")}),jsxRuntimeExports.jsx("span",{className:"text-slate-200 font-mono text-xs",children:u.version??(s==null?void 0:s.platformVersion)??"—"})]}),s&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:e("overview.memory")}),jsxRuntimeExports.jsxs("span",{className:"text-slate-200 font-mono text-xs",children:[r(s.memoryUsageMb,{minimumFractionDigits:1,maximumFractionDigits:1})," MB"]})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:e("overview.shellSessions")}),jsxRuntimeExports.jsx("span",{className:"text-slate-200 font-mono text-xs",children:r(s.activeShellSessions)})]})]})]}):jsxRuntimeExports.jsx("p",{className:"text-slate-400 text-sm",children:e("overview.serverInfoFailed")})]})}),jsxRuntimeExports.jsx(ErrorBoundary,{label:e("overview.recentJobs"),resetKeys:[l],children:a("jobs")&&jsxRuntimeExports.jsxs("div",{className:"bg-white/[0.04] border border-white/[0.08] rounded-xl overflow-hidden",children:[jsxRuntimeExports.jsxs("div",{className:"px-4 py-3 border-b border-white/[0.06] flex items-center justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-sm font-medium text-white",children:e("overview.recentJobs")}),jsxRuntimeExports.jsx(Link,{to:"/jobs",className:"text-xs text-indigo-400 hover:text-indigo-300 transition-colors",children:e("overview.viewAll")})]}),x===null?jsxRuntimeExports.jsx("div",{className:"px-4 py-4 text-sm text-slate-400",children:e("overview.noJobData")}):x.length===0?jsxRuntimeExports.jsx("div",{className:"px-4 py-4 text-sm text-slate-400",children:e("overview.noJobs")}):jsxRuntimeExports.jsxs("table",{className:"w-full text-sm",children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{className:"text-[11px] text-slate-500 uppercase tracking-wide border-b border-white/[0.04]",children:[jsxRuntimeExports.jsx("th",{className:"text-left px-4 py-2 font-medium",children:e("overview.colName")}),jsxRuntimeExports.jsx("th",{className:"text-left px-4 py-2 font-medium",children:e("overview.colGroup")}),jsxRuntimeExports.jsx("th",{className:"text-left px-4 py-2 font-medium",children:e("overview.colStatus")}),jsxRuntimeExports.jsx("th",{className:"text-left px-4 py-2 font-medium",children:e("overview.colLastRun")}),jsxRuntimeExports.jsx("th",{className:"text-left px-4 py-2 font-medium",children:e("overview.colNextRun")})]})}),jsxRuntimeExports.jsx("tbody",{children:x.map(L=>jsxRuntimeExports.jsxs("tr",{className:"border-b border-white/[0.03] hover:bg-white/[0.02] transition-colors",children:[jsxRuntimeExports.jsx("td",{className:"px-4 py-2 text-slate-200",children:L.name}),jsxRuntimeExports.jsx("td",{className:"px-4 py-2 text-slate-400",children:L.group}),jsxRuntimeExports.jsx("td",{className:"px-4 py-2",children:jsxRuntimeExports.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium ${L.status==="active"||L.status==="running"?"bg-green-500/20 text-green-400":L.status==="paused"?"bg-amber-500/20 text-amber-400":L.status==="stopped"||L.status==="failed"?"bg-red-500/20 text-red-400":"bg-slate-500/20 text-slate-400"}`,children:L.status})}),jsxRuntimeExports.jsx("td",{className:"px-4 py-2 text-slate-400 text-xs font-mono",children:L.lastRun?t(L.lastRun):"—"}),jsxRuntimeExports.jsx("td",{className:"px-4 py-2 text-slate-400 text-xs font-mono",children:L.nextRun?t(L.nextRun):"—"})]},L.id))})]})]})}),jsxRuntimeExports.jsx(MonoPanel,{title:e("overview.liveEvents"),lines:f.length>0?f:[e("overview.waitingForEvents")],maxLines:100})]})]})}function shellLabel(e,t){if(e.shell===!1||e.shell==null)return t("common.disabled");const r=typeof e.shell=="string"?e.shell:e.shellPath??t("common.enabled");return e.shellAuth?`${r} (${e.shellAuth})`:r}function getCommands(){return apiFetch("/api/v1/qcli/commands")}function ParamRow({param:e}){const{t}=useI18n();return jsxRuntimeExports.jsxs("tr",{className:"border-b border-white/[0.03] last:border-0",children:[jsxRuntimeExports.jsx("td",{className:"px-3 py-1.5 font-mono text-xs text-indigo-300",children:e.name}),jsxRuntimeExports.jsx("td",{className:"px-3 py-1.5 text-xs text-slate-400",children:e.type}),jsxRuntimeExports.jsx("td",{className:"px-3 py-1.5 text-xs text-slate-400",children:e.description}),jsxRuntimeExports.jsx("td",{className:"px-3 py-1.5 text-xs",children:e.required?jsxRuntimeExports.jsx("span",{className:"text-red-400 font-medium",children:t("commands.yes")}):jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:t("commands.no")})})]})}function CommandRow({cmd:e,depth:t=0}){var l,f;const{t:r,formatNumber:s}=useI18n(),[o,u]=reactExports.useState(!1),d=e.parameters&&e.parameters.length>0||e.processors&&e.processors.length>0,a=t*16;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("tr",{className:`border-b border-white/[0.04] last:border-0 ${d?"cursor-pointer hover:bg-white/[0.04]":""}`,onClick:()=>d&&u(!o),children:[jsxRuntimeExports.jsx("td",{className:"px-4 py-3",children:jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",style:{paddingLeft:`${a}px`},children:[d&&jsxRuntimeExports.jsx("span",{className:`text-slate-500 transition-transform text-xs ${o?"rotate-90":""}`,children:"▶"}),jsxRuntimeExports.jsx("span",{className:"font-mono text-sm text-indigo-300",children:e.command})]})}),jsxRuntimeExports.jsx("td",{className:"px-4 py-3 text-sm text-slate-400",children:e.description||"—"}),jsxRuntimeExports.jsx("td",{className:"px-4 py-3 text-xs text-slate-500 font-mono",children:((l=e.metadata)==null?void 0:l.module)??"—"}),jsxRuntimeExports.jsx("td",{className:"px-4 py-3 text-xs text-slate-500 text-center",children:s(((f=e.parameters)==null?void 0:f.length)??0)})]}),o&&d&&jsxRuntimeExports.jsx("tr",{className:"border-b border-white/[0.04]",children:jsxRuntimeExports.jsxs("td",{colSpan:4,className:"px-4 py-3 bg-white/[0.02]",children:[e.parameters&&e.parameters.length>0&&jsxRuntimeExports.jsxs("div",{className:"mb-3",children:[jsxRuntimeExports.jsx("div",{className:"text-[10px] text-slate-500 uppercase tracking-wider font-medium mb-1.5",children:r("commands.parameters")}),jsxRuntimeExports.jsx("div",{className:"bg-white/[0.03] border border-white/[0.06] rounded-lg overflow-hidden",children:jsxRuntimeExports.jsxs("table",{className:"w-full",children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{className:"border-b border-white/[0.06]",children:[jsxRuntimeExports.jsx("th",{className:"px-3 py-2 text-left text-[10px] text-slate-500 uppercase tracking-wide font-medium",children:r("commands.colName")}),jsxRuntimeExports.jsx("th",{className:"px-3 py-2 text-left text-[10px] text-slate-500 uppercase tracking-wide font-medium",children:r("commands.colType")}),jsxRuntimeExports.jsx("th",{className:"px-3 py-2 text-left text-[10px] text-slate-500 uppercase tracking-wide font-medium",children:r("commands.colDescription")}),jsxRuntimeExports.jsx("th",{className:"px-3 py-2 text-left text-[10px] text-slate-500 uppercase tracking-wide font-medium",children:r("commands.colRequired")})]})}),jsxRuntimeExports.jsx("tbody",{children:e.parameters.map(C=>jsxRuntimeExports.jsx(ParamRow,{param:C},C.name))})]})})]}),e.processors&&e.processors.length>0&&jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:"text-[10px] text-slate-500 uppercase tracking-wider font-medium mb-1.5",children:r("commands.subCommands")}),jsxRuntimeExports.jsx("div",{className:"bg-white/[0.03] border border-white/[0.06] rounded-lg overflow-hidden",children:jsxRuntimeExports.jsxs("table",{className:"w-full",children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{className:"border-b border-white/[0.06]",children:[jsxRuntimeExports.jsx("th",{className:"px-3 py-2 text-left text-[10px] text-slate-500 uppercase tracking-wide font-medium",children:r("commands.colCommand")}),jsxRuntimeExports.jsx("th",{className:"px-3 py-2 text-left text-[10px] text-slate-500 uppercase tracking-wide font-medium",children:r("commands.colDescription")}),jsxRuntimeExports.jsx("th",{className:"px-3 py-2 text-left text-[10px] text-slate-500 uppercase tracking-wide font-medium",children:r("commands.colModule")}),jsxRuntimeExports.jsx("th",{className:"px-3 py-2 text-left text-[10px] text-slate-500 uppercase tracking-wide font-medium text-center",children:r("commands.colParams")})]})}),jsxRuntimeExports.jsx("tbody",{children:e.processors.map(C=>jsxRuntimeExports.jsx(CommandRow,{cmd:C,depth:1},C.command))})]})})]})]})})]})}function CommandsPage(){const{data:e,loading:t,error:r,refetch:s}=useApi(getCommands,[]),[o,u]=reactExports.useState(""),{t:d}=useI18n(),a=e?e.filter(l=>l.command.toLowerCase().includes(o.toLowerCase())||(l.description??"").toLowerCase().includes(o.toLowerCase())):[];return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PageHeader,{title:d("nav.commands"),subtitle:e?d("commands.subtitle",{count:e.length}):d("common.loading"),actions:jsxRuntimeExports.jsx("button",{onClick:s,className:"px-3 py-1.5 text-xs bg-white/[0.06] hover:bg-white/[0.1] text-slate-300 rounded-lg transition-colors",children:d("common.refresh")})}),jsxRuntimeExports.jsxs("div",{className:"p-6 space-y-4",children:[jsxRuntimeExports.jsx("input",{type:"text",placeholder:d("commands.searchPlaceholder"),value:o,onChange:l=>u(l.target.value),className:"w-full max-w-sm px-3 py-2 text-sm bg-white/[0.06] border border-white/[0.1] rounded-lg text-slate-200 placeholder-slate-500 focus:outline-none focus:border-indigo-500/50"}),t&&jsxRuntimeExports.jsx("div",{className:"text-slate-400 text-sm",children:d("commands.loadingCommands")}),r&&jsxRuntimeExports.jsx("div",{className:"text-red-400 text-sm",children:d("commands.error",{message:r})}),!t&&!r&&jsxRuntimeExports.jsxs("div",{className:"bg-white/[0.04] border border-white/[0.08] rounded-xl overflow-hidden",children:[jsxRuntimeExports.jsxs("table",{className:"w-full text-sm",children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{className:"border-b border-white/[0.06]",children:[jsxRuntimeExports.jsx("th",{className:"px-4 py-3 text-left text-xs text-slate-500 font-medium uppercase tracking-wide",children:d("commands.colCommand")}),jsxRuntimeExports.jsx("th",{className:"px-4 py-3 text-left text-xs text-slate-500 font-medium uppercase tracking-wide",children:d("commands.colDescription")}),jsxRuntimeExports.jsx("th",{className:"px-4 py-3 text-left text-xs text-slate-500 font-medium uppercase tracking-wide",children:d("commands.colModule")}),jsxRuntimeExports.jsx("th",{className:"px-4 py-3 text-center text-xs text-slate-500 font-medium uppercase tracking-wide",children:d("commands.colParams")})]})}),jsxRuntimeExports.jsx("tbody",{children:a.map(l=>jsxRuntimeExports.jsx(CommandRow,{cmd:l},l.command))})]}),a.length===0&&jsxRuntimeExports.jsx("div",{className:"px-4 py-8 text-center text-slate-500 text-sm",children:d(o?"commands.noMatch":"commands.noCommands")})]})]})]})}const variants={success:"bg-status-success/15 text-status-success border-status-success/30",warning:"bg-status-warning/15 text-status-warning border-status-warning/30",error:"bg-status-error/15 text-status-error border-status-error/30",info:"bg-status-info/15 text-status-info border-status-info/30",neutral:"bg-slate-500/15 text-slate-400 border-slate-500/30"};function Badge({variant:e,children:t,dot:r}){return jsxRuntimeExports.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[11px] font-medium border ${variants[e]}`,children:[r&&jsxRuntimeExports.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current"}),t]})}function DataTableContent({columns:e,data:t,onRowClick:r,keyExtractor:s}){const{t:o}=useI18n();return jsxRuntimeExports.jsxs("div",{className:"bg-white/[0.04] border border-white/[0.08] rounded-xl overflow-hidden",children:[jsxRuntimeExports.jsxs("table",{className:"w-full text-sm",children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsx("tr",{className:"border-b border-white/[0.06]",children:e.map(u=>jsxRuntimeExports.jsx("th",{className:`px-4 py-3 text-left text-xs text-slate-500 font-medium uppercase tracking-wide ${u.className??""}`,children:u.header},u.key))})}),jsxRuntimeExports.jsx("tbody",{children:t.map(u=>jsxRuntimeExports.jsx("tr",{onClick:()=>r==null?void 0:r(u),className:`border-b border-white/[0.04] last:border-0 ${r?"cursor-pointer hover:bg-white/[0.04]":""}`,children:e.map(d=>jsxRuntimeExports.jsx("td",{className:`px-4 py-3 text-slate-300 ${d.className??""}`,children:d.render?d.render(u):String(u[d.key]??"")},d.key))},s(u)))})]}),t.length===0&&jsxRuntimeExports.jsx("div",{className:"px-4 py-8 text-center text-slate-500 text-sm",children:o("common.noData")})]})}function DataTable(e){const{t}=useI18n();return jsxRuntimeExports.jsx(ErrorBoundary,{label:t("common.table"),resetKeys:[e.data],children:jsxRuntimeExports.jsx(DataTableContent,{...e})})}const isKnownStatus=e=>JOB_STATUSES.includes(e);function jobStatusVariant$1(e){switch(e){case"active":case"running":return"success";case"paused":return"warning";case"stopped":case"failed":return"error";case"scheduled":return"info";default:return"neutral"}}function JobsPage(){const e=useNavigate(),{t,formatDate:r,formatRelative:s}=useI18n(),{data:o,loading:u,error:d,refetch:a}=useApi(getJobs,[]),[l,f]=reactExports.useState([]),[C,h]=reactExports.useState(null),{subscribe:j}=useWebSocket();reactExports.useEffect(()=>{o&&f(o)},[o]),reactExports.useEffect(()=>j("job:*",R=>{const N=R.jobId,V=R.status;N&&V&&f(J=>J.map(Y=>Y.id===N?{...Y,status:V}:Y))}),[j]);async function U(L,R,N){L.stopPropagation(),h(null);try{N==="trigger"?await triggerJob(R):N==="pause"?await pauseJob(R):N==="resume"?await resumeJob(R):N==="stop"&&await stopJob(R),a()}catch(V){h(V instanceof Error?V.message:t("jobs.actionFailed"))}}const W=L=>isKnownStatus(L)?t(`jobs.status_${L}`):L;function H(L){return L?jsxRuntimeExports.jsx("span",{className:"text-xs text-slate-400",title:r(L),children:s(L)}):jsxRuntimeExports.jsx("span",{className:"text-xs text-slate-400",children:"—"})}const x=[{key:"name",header:t("jobs.name"),render:L=>jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:"text-slate-200 font-medium",children:L.name}),L.description&&jsxRuntimeExports.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:L.description})]})},{key:"group",header:t("jobs.group"),render:L=>jsxRuntimeExports.jsx("span",{className:"text-slate-400 text-xs",children:L.group||"—"})},{key:"status",header:t("jobs.status"),render:L=>jsxRuntimeExports.jsx(Badge,{variant:jobStatusVariant$1(L.status),dot:!0,children:W(L.status)})},{key:"schedule",header:t("jobs.schedule"),render:L=>jsxRuntimeExports.jsx("span",{className:"text-xs font-mono text-slate-400",children:L.schedule??(L.interval?t("jobs.every",{interval:L.interval}):"—")})},{key:"lastRun",header:t("jobs.lastRun"),render:L=>H(L.lastRun)},{key:"nextRun",header:t("jobs.nextRun"),render:L=>H(L.nextRun)},{key:"actions",header:"",render:L=>jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-1",onClick:R=>R.stopPropagation(),children:[jsxRuntimeExports.jsx("button",{onClick:R=>U(R,L.id,"trigger"),className:"px-2 py-1 text-[11px] bg-indigo-500/20 hover:bg-indigo-500/30 text-indigo-300 rounded transition-colors",children:t("jobs.trigger")}),L.status==="active"||L.status==="running"||L.status==="scheduled"?jsxRuntimeExports.jsx("button",{onClick:R=>U(R,L.id,"pause"),className:"px-2 py-1 text-[11px] bg-amber-500/20 hover:bg-amber-500/30 text-amber-300 rounded transition-colors",children:t("jobs.pause")}):L.status==="paused"?jsxRuntimeExports.jsx("button",{onClick:R=>U(R,L.id,"resume"),className:"px-2 py-1 text-[11px] bg-green-500/20 hover:bg-green-500/30 text-green-300 rounded transition-colors",children:t("jobs.resume")}):null,jsxRuntimeExports.jsx("button",{onClick:R=>U(R,L.id,"stop"),className:"px-2 py-1 text-[11px] bg-red-500/20 hover:bg-red-500/30 text-red-300 rounded transition-colors",children:t("jobs.stop")})]})}];return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PageHeader,{title:t("nav.jobs"),subtitle:l.length?t("jobs.subtitle",{count:l.length}):t("jobs.subtitleEmpty"),actions:jsxRuntimeExports.jsx("button",{onClick:a,className:"px-3 py-1.5 text-xs bg-white/[0.06] hover:bg-white/[0.1] text-slate-300 rounded-lg transition-colors",children:t("common.refresh")})}),jsxRuntimeExports.jsxs("div",{className:"p-6",children:[u&&jsxRuntimeExports.jsx("div",{className:"text-slate-400 text-sm",children:t("jobs.loadingJobs")}),d&&jsxRuntimeExports.jsx("div",{className:"text-red-400 text-sm mb-4",children:t("jobs.error",{message:d})}),C&&jsxRuntimeExports.jsx("div",{className:"text-red-400 text-sm mb-4 p-3 bg-red-500/10 border border-red-500/20 rounded-lg",children:C}),!u&&jsxRuntimeExports.jsx(DataTable,{columns:x,data:l,keyExtractor:L=>L.id,onRowClick:L=>e(`/jobs/${L.id}`)})]})]})}const isOneOf=(e,t)=>e.includes(t);function jobStatusVariant(e){switch(e){case"active":case"running":case"completed":case"succeeded":return"success";case"paused":return"warning";case"stopped":case"failed":case"error":return"error";case"scheduled":return"info";default:return"neutral"}}function JobDetail(){var ne;const{id:e}=useParams(),t=useNavigate(),{t:r,formatDate:s,formatNumber:o}=useI18n(),[u,d]=reactExports.useState(0),a=20,[l,f]=reactExports.useState([]),[C,h]=reactExports.useState(!1),[j,U]=reactExports.useState(null),{data:W,loading:H,refetch:x}=useApi(()=>getJob(e),[e]),{data:L,loading:R,refetch:N}=useApi(()=>getJobHistory(e,{limit:a,offset:u*a}),[e,u]),V=ae=>ae?s(ae):"—",J=ae=>typeof ae!="number"||!Number.isFinite(ae)?"—":ae<1e3?o(ae,{style:"unit",unit:"millisecond",unitDisplay:"narrow"}):o(ae/1e3,{style:"unit",unit:"second",unitDisplay:"narrow",minimumFractionDigits:2,maximumFractionDigits:2}),Y=ae=>isOneOf(JOB_STATUSES,ae)?r(`jobs.status_${ae}`):ae,Z=ae=>isOneOf(JOB_TRIGGER_TYPES,ae)?r(`jobs.trigger_${ae}`):ae,K=ae=>isOneOf(JOB_OVERLAP_POLICIES,ae)?r(`jobs.overlap_${ae}`):ae;async function ee(ae){if(e){U(null);try{ae==="trigger"?await triggerJob(e):ae==="pause"?await pauseJob(e):ae==="resume"?await resumeJob(e):ae==="stop"&&await stopJob(e),x(),N()}catch(_e){U(_e instanceof Error?_e.message:r("jobs.actionFailed"))}}}const oe=reactExports.useRef(0);async function ce(ae){if(!e)return;const _e=++oe.current;h(!0),f([r("jobs.loadingLogsFor",{id:ae.id})]);try{const fe=await getJobExecution(e,ae.id);if(_e!==oe.current)return;fe.logs&&fe.logs.length>0?f(fe.logs.map(ge=>`[${ge.timestamp}] [${ge.level}] ${ge.message}`)):f([r("jobs.noLogs")])}catch(fe){if(_e!==oe.current)return;f([r("jobs.logsError",{message:fe instanceof Error?fe.message:r("jobs.unknownError")})])}finally{_e===oe.current&&h(!1)}}const le=[{key:"id",header:r("jobs.id"),render:ae=>jsxRuntimeExports.jsxs("span",{className:"font-mono text-xs text-slate-400",children:[ae.id.slice(0,8),"..."]})},{key:"status",header:r("jobs.status"),render:ae=>jsxRuntimeExports.jsx(Badge,{variant:jobStatusVariant(ae.status),dot:!0,children:Y(ae.status)})},{key:"startedAt",header:r("jobs.started"),render:ae=>jsxRuntimeExports.jsx("span",{className:"text-xs text-slate-400",children:V(ae.startedAt)})},{key:"duration",header:r("jobs.duration"),render:ae=>jsxRuntimeExports.jsx("span",{className:"text-xs font-mono text-slate-400",children:J(ae.duration)})},{key:"triggerType",header:r("jobs.trigger"),render:ae=>jsxRuntimeExports.jsx("span",{className:"text-xs text-slate-500",children:ae.triggerType?Z(ae.triggerType):"—"})},{key:"error",header:r("jobs.errorColumn"),render:ae=>ae.error?jsxRuntimeExports.jsx("span",{className:"text-xs text-red-400 truncate max-w-[200px] block",title:ae.error,children:ae.error}):jsxRuntimeExports.jsx("span",{className:"text-slate-600",children:"—"})},{key:"logs",header:"",render:ae=>jsxRuntimeExports.jsx("button",{onClick:_e=>{_e.stopPropagation(),ce(ae)},className:"px-2 py-1 text-[11px] bg-indigo-500/20 hover:bg-indigo-500/30 text-indigo-300 rounded transition-colors",children:r("jobs.logs")})}];return H?jsxRuntimeExports.jsx("div",{className:"p-6 text-slate-400",children:r("jobs.loadingDetails")}):jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PageHeader,{title:(W==null?void 0:W.name)??r("jobs.detailTitle"),subtitle:(W==null?void 0:W.description)??r("jobs.jobId",{id:e??""}),actions:jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("button",{onClick:()=>t("/jobs"),className:"px-3 py-1.5 text-xs bg-white/[0.06] hover:bg-white/[0.1] text-slate-300 rounded-lg transition-colors",children:r("jobs.back")}),jsxRuntimeExports.jsx("button",{onClick:()=>ee("trigger"),className:"px-3 py-1.5 text-xs bg-indigo-500/20 hover:bg-indigo-500/30 text-indigo-300 rounded-lg transition-colors",children:r("jobs.trigger")}),W&&(W.status==="active"||W.status==="running"||W.status==="scheduled")&&jsxRuntimeExports.jsx("button",{onClick:()=>ee("pause"),className:"px-3 py-1.5 text-xs bg-amber-500/20 hover:bg-amber-500/30 text-amber-300 rounded-lg transition-colors",children:r("jobs.pause")}),W&&W.status==="paused"&&jsxRuntimeExports.jsx("button",{onClick:()=>ee("resume"),className:"px-3 py-1.5 text-xs bg-green-500/20 hover:bg-green-500/30 text-green-300 rounded-lg transition-colors",children:r("jobs.resume")}),jsxRuntimeExports.jsx("button",{onClick:()=>ee("stop"),className:"px-3 py-1.5 text-xs bg-red-500/20 hover:bg-red-500/30 text-red-300 rounded-lg transition-colors",children:r("jobs.stop")})]})}),jsxRuntimeExports.jsxs("div",{className:"p-6 space-y-6",children:[j&&jsxRuntimeExports.jsx("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg",children:j}),W&&jsxRuntimeExports.jsxs("div",{className:"bg-white/[0.04] border border-white/[0.08] rounded-xl p-5",children:[jsxRuntimeExports.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:r("jobs.jobInfo")}),jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-sm",children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:r("jobs.status")}),jsxRuntimeExports.jsx(Badge,{variant:jobStatusVariant(W.status),dot:!0,children:Y(W.status)})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:r("jobs.group")}),jsxRuntimeExports.jsx("span",{className:"text-slate-300 text-xs font-mono",children:W.group||"—"})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:r("jobs.schedule")}),jsxRuntimeExports.jsx("span",{className:"text-slate-300 text-xs font-mono",children:W.schedule??"—"})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:r("jobs.interval")}),jsxRuntimeExports.jsx("span",{className:"text-slate-300 text-xs font-mono",children:W.interval?r("jobs.every",{interval:W.interval}):"—"})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:r("jobs.lastRun")}),jsxRuntimeExports.jsx("span",{className:"text-slate-300 text-xs",children:V(W.lastRun)})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:r("jobs.nextRun")}),jsxRuntimeExports.jsx("span",{className:"text-slate-300 text-xs",children:V(W.nextRun)})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:r("jobs.lastDuration")}),jsxRuntimeExports.jsx("span",{className:"text-slate-300 text-xs font-mono",children:J(W.lastDuration)})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:r("jobs.maxRetries")}),jsxRuntimeExports.jsx("span",{className:"text-slate-300 text-xs font-mono",children:W.maxRetries})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:r("jobs.overlapPolicy")}),jsxRuntimeExports.jsx("span",{className:"text-slate-300 text-xs font-mono",children:W.overlapPolicy?K(W.overlapPolicy):"—"})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-500",children:r("jobs.timeout")}),jsxRuntimeExports.jsx("span",{className:"text-slate-300 text-xs font-mono",children:W.timeout??"—"})]})]})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntimeExports.jsx("h3",{className:"text-sm font-semibold text-white",children:r("jobs.history")}),L&&jsxRuntimeExports.jsx("span",{className:"text-xs text-slate-500",children:r("jobs.totalExecutions",{count:L.total??((ne=L.items)==null?void 0:ne.length)??0})})]}),R&&jsxRuntimeExports.jsx("div",{className:"text-slate-400 text-sm",children:r("jobs.loadingHistory")}),!R&&L&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(DataTable,{columns:le,data:L.items,keyExtractor:ae=>ae.id,onRowClick:ce}),L.total>a&&jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mt-3",children:[jsxRuntimeExports.jsx("button",{onClick:()=>d(ae=>Math.max(0,ae-1)),disabled:u===0,className:"px-3 py-1.5 text-xs bg-white/[0.06] hover:bg-white/[0.1] text-slate-300 rounded-lg transition-colors disabled:opacity-40",children:r("jobs.previous")}),jsxRuntimeExports.jsx("span",{className:"text-xs text-slate-500",children:r("jobs.pageOf",{page:u+1,total:Math.ceil(L.total/a)})}),jsxRuntimeExports.jsx("button",{onClick:()=>d(ae=>ae+1),disabled:(u+1)*a>=L.total,className:"px-3 py-1.5 text-xs bg-white/[0.06] hover:bg-white/[0.1] text-slate-300 rounded-lg transition-colors disabled:opacity-40",children:r("jobs.next")})]})]})]}),jsxRuntimeExports.jsx(MonoPanel,{title:r("jobs.executionLogs"),lines:C?[r("common.loading")]:l.length>0?l:[r("jobs.logsHint")],maxLines:500})]})]})}function getPlugins(){return apiFetch("/api/v1/qcli/plugins")}function togglePlugin(e){return apiFetch(`/api/v1/qcli/plugins/${encodeURIComponent(e)}/toggle`,{method:"POST"})}function PluginCard({plugin:e,onToggle:t}){var C;const[r,s]=reactExports.useState(!1),o=e.processorCount??((C=e.processors)==null?void 0:C.length)??0,[u,d]=reactExports.useState(!1),{t:a,formatNumber:l}=useI18n();async function f(h){h.stopPropagation(),d(!0);try{await t(e.id)}finally{d(!1)}}return jsxRuntimeExports.jsxs("div",{className:`bg-white/[0.04] border rounded-xl overflow-hidden transition-colors cursor-pointer ${e.enabled?"border-white/[0.08] hover:border-white/[0.14]":"border-white/[0.04] opacity-60 hover:opacity-80"}`,onClick:()=>s(!r),children:[jsxRuntimeExports.jsxs("div",{className:"p-4",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-start justify-between gap-3",children:[jsxRuntimeExports.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[jsxRuntimeExports.jsx("span",{className:"font-semibold text-white text-sm truncate",children:e.name||e.id}),jsxRuntimeExports.jsxs("span",{className:"text-[10px] text-slate-500 font-mono bg-white/[0.06] px-1.5 py-0.5 rounded",children:["v",e.version]})]}),jsxRuntimeExports.jsx("p",{className:"text-xs text-slate-400 mt-1 line-clamp-2",children:e.description||a("plugins.noDescription")})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[jsxRuntimeExports.jsx(Badge,{variant:e.enabled?"success":"neutral",dot:!0,children:e.enabled?a("common.enabled"):a("common.disabled")}),jsxRuntimeExports.jsx("button",{onClick:f,disabled:u,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none disabled:opacity-50 ${e.enabled?"bg-indigo-500":"bg-slate-600"}`,title:e.enabled?a("plugins.disablePlugin"):a("plugins.enablePlugin"),children:jsxRuntimeExports.jsx("span",{className:`inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform ${e.enabled?"translate-x-4":"translate-x-0.5"}`})})]})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-4 mt-3",children:[jsxRuntimeExports.jsxs("div",{className:"text-[11px] text-slate-500",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-300 font-medium",children:l(o)})," ",a("plugins.processorUnit",{count:o})]}),e.processors.length>0&&jsxRuntimeExports.jsx("button",{onClick:h=>{h.stopPropagation(),s(!r)},className:"text-[11px] text-indigo-400 hover:text-indigo-300 transition-colors",children:a(r?"plugins.hideCommands":"plugins.showCommands")})]})]}),r&&e.processors.length>0&&jsxRuntimeExports.jsxs("div",{className:"border-t border-white/[0.06] px-4 py-3 bg-white/[0.02]",children:[jsxRuntimeExports.jsx("div",{className:"text-[10px] text-slate-500 uppercase tracking-wider font-medium mb-2",children:a("plugins.registeredCommands")}),jsxRuntimeExports.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.processors.map(h=>jsxRuntimeExports.jsx("span",{className:"font-mono text-[11px] text-indigo-300 bg-indigo-500/10 border border-indigo-500/20 px-2 py-0.5 rounded",children:h},h))})]})]})}function PluginsPage(){const{data:e,loading:t,error:r,refetch:s}=useApi(getPlugins,[]),{t:o}=useI18n();async function u(d){await togglePlugin(d),s()}return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PageHeader,{title:o("nav.plugins"),subtitle:e?o("plugins.subtitle",{count:e.length}):o("plugins.manager"),actions:jsxRuntimeExports.jsx("button",{onClick:s,className:"px-3 py-1.5 text-xs bg-white/[0.06] hover:bg-white/[0.1] text-slate-300 rounded-lg transition-colors",children:o("common.refresh")})}),jsxRuntimeExports.jsxs("div",{className:"p-6",children:[t&&jsxRuntimeExports.jsx("div",{className:"text-slate-400 text-sm",children:o("plugins.loadingPlugins")}),r&&jsxRuntimeExports.jsx("div",{className:"text-red-400 text-sm",children:o("plugins.error",{message:r})}),!t&&!r&&e&&jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:[e.map(d=>jsxRuntimeExports.jsx(PluginCard,{plugin:d,onToggle:u},d.id)),e.length===0&&jsxRuntimeExports.jsx("div",{className:"col-span-full text-slate-500 text-sm",children:o("plugins.noPlugins")})]})]})]})}function Breadcrumb({path:e,onNavigate:t}){const{t:r}=useI18n(),s=e==="/"?[]:e.split("/").filter(Boolean);function o(u){return u===-1?"/":"/"+s.slice(0,u+1).join("/")}return jsxRuntimeExports.jsxs("nav",{"aria-label":r("components.breadcrumb"),className:"flex items-center gap-1 text-sm text-slate-400 flex-wrap",children:[jsxRuntimeExports.jsx("button",{onClick:()=>t("/"),title:r("components.root"),className:"hover:text-white transition-colors font-mono px-1.5 py-0.5 rounded hover:bg-white/[0.06]",children:"/"}),s.map((u,d)=>jsxRuntimeExports.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntimeExports.jsx("span",{className:"text-slate-600",children:"/"}),jsxRuntimeExports.jsx("button",{onClick:()=>t(o(d)),className:`hover:text-white transition-colors font-mono px-1.5 py-0.5 rounded hover:bg-white/[0.06] ${d===s.length-1?"text-white":""}`,children:u})]},d))]})}function Modal({open:e,onClose:t,title:r,children:s,actions:o}){return reactExports.useEffect(()=>{if(!e)return;const u=d=>{d.key==="Escape"&&t()};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[e,t]),e?jsxRuntimeExports.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:t,children:jsxRuntimeExports.jsxs("div",{className:"bg-[#1e1b4b] border border-white/[0.1] rounded-xl w-full max-w-md mx-4 shadow-2xl",onClick:u=>u.stopPropagation(),children:[jsxRuntimeExports.jsx("div",{className:"px-5 py-4 border-b border-white/[0.06]",children:jsxRuntimeExports.jsx("h3",{className:"text-base font-semibold text-white",children:r})}),jsxRuntimeExports.jsx("div",{className:"px-5 py-4 text-sm text-slate-300",children:s}),o&&jsxRuntimeExports.jsx("div",{className:"px-5 py-3 border-t border-white/[0.06] flex justify-end gap-2",children:o})]})}):null}async function listDir(e){const t=await apiFetch(`/api/qcli/fs/ls?path=${encodeURIComponent(e)}`),r=Array.isArray(t)?t:(t==null?void 0:t.entries)??[],s=e.endsWith("/")?e:`${e}/`;return r.map(o=>({...o,path:o.path??`${s}${o.name}`}))}async function readFile(e){const t=await apiFetch(`/api/qcli/fs/cat?path=${encodeURIComponent(e)}`);return typeof t=="string"?t:(t==null?void 0:t.content)??""}function uploadFile(e,t){const r=new FormData;return r.append("file",t),r.append("path",e),apiFetch("/api/qcli/fs/upload",{method:"POST",body:r})}function createDir(e){return apiFetch("/api/qcli/fs/mkdir",{method:"POST",body:JSON.stringify({path:e})})}function deleteEntry(e){return apiFetch(`/api/qcli/fs/rm?path=${encodeURIComponent(e)}`,{method:"DELETE"})}function FilesystemPage(){const{t:e,formatNumber:t,formatRelative:r}=useI18n();function s(Ie){if(Ie===0)return"—";const We=[["GB",1024**3,2],["MB",1024**2,1],["KB",1024,1]];for(const[Xe,ze,At]of We)if(Ie>=ze)return`${t(Ie/ze,{minimumFractionDigits:At,maximumFractionDigits:At})} ${Xe}`;return`${t(Ie)} B`}const[o,u]=reactExports.useState("/"),[d,a]=reactExports.useState([]),[l,f]=reactExports.useState(!1),[C,h]=reactExports.useState(null),[j,U]=reactExports.useState(null),[W,H]=reactExports.useState(""),[x,L]=reactExports.useState(!1),[R,N]=reactExports.useState(!1),[V,J]=reactExports.useState(""),[Y,Z]=reactExports.useState(null),[K,ee]=reactExports.useState(!1),[oe,ce]=reactExports.useState(null),[le,ne]=reactExports.useState(!1),[ae,_e]=reactExports.useState(null),fe=reactExports.useRef(null),[ge,he]=reactExports.useState(!1),[X,re]=reactExports.useState(null),Q=reactExports.useRef(0),se=reactExports.useRef(0),Ce=reactExports.useRef(o);Ce.current=o,reactExports.useEffect(()=>{let Ie=!1;return se.current++,f(!0),h(null),U(null),Q.current++,L(!1),listDir(o).then(We=>{Ie||a(We)}).catch(We=>{Ie||h(We instanceof Error?We.message:e("filesystem.listFailed"))}).finally(()=>{Ie||f(!1)}),()=>{Ie=!0}},[o]);async function we(){const Ie=Ce.current,We=++se.current,Xe=await listDir(Ie);We===se.current&&Ie===Ce.current&&a(Xe)}function Be(Ie){u(Ie)}async function Re(Ie){if(Ie.type==="directory")Be(Ie.path);else{const We=++Q.current;L(!0),U(null),H(Ie.name);try{const Xe=await readFile(Ie.path);if(We!==Q.current)return;U(typeof Xe=="string"?Xe.split(`
|
|
68
|
-
`):[JSON.stringify(Xe)])}catch(Xe){if(We!==Q.current)return;U([e("filesystem.readError",{message:Xe instanceof Error?Xe.message:e("filesystem.unknownError")})])}finally{We===Q.current&&L(!1)}}}async function de(Ie){var Xe;const We=(Xe=Ie.target.files)==null?void 0:Xe[0];if(We){he(!0),re(null);try{await uploadFile(o,We),await we()}catch(ze){re(ze instanceof Error?ze.message:e("filesystem.uploadFailed"))}finally{he(!1),fe.current&&(fe.current.value="")}}}async function ie(){if(V.trim()){ee(!0),Z(null);try{const Ie=o==="/"?`/${V}`:`${o}/${V}`;await createDir(Ie),await we(),N(!1),J("")}catch(Ie){Z(Ie instanceof Error?Ie.message:e("filesystem.createFailed"))}finally{ee(!1)}}}async function De(){if(oe){ne(!0),_e(null);try{await deleteEntry(oe.path),await we(),ce(null),W===oe.name&&U(null)}catch(Ie){_e(Ie instanceof Error?Ie.message:e("filesystem.deleteFailed"))}finally{ne(!1)}}}async function be(Ie,We){try{const Xe=localStorage.getItem("qcli_admin_token"),ze={};Xe&&(ze.Authorization=`Bearer ${Xe}`);const At=await fetch(`/api/qcli/fs/download?path=${encodeURIComponent(Ie)}`,{headers:ze});if(!At.ok)return;const cr=await At.blob(),$t=URL.createObjectURL(cr),nt=document.createElement("a");nt.href=$t,nt.download=We,nt.click(),URL.revokeObjectURL($t)}catch{}}const Te=[{key:"name",header:e("filesystem.colName"),render:Ie=>jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("span",{className:"text-base",role:"img","aria-label":Ie.type==="directory"?e("filesystem.folder"):e("filesystem.file"),children:Ie.type==="directory"?"📁":"📄"}),jsxRuntimeExports.jsx("span",{className:`text-sm ${Ie.type==="directory"?"text-indigo-300 font-medium":"text-slate-300"}`,children:Ie.name})]})},{key:"size",header:e("filesystem.colSize"),render:Ie=>jsxRuntimeExports.jsx("span",{className:"text-xs text-slate-400 font-mono",children:Ie.type==="directory"?"—":s(Ie.size)})},{key:"modified",header:e("filesystem.colModified"),render:Ie=>jsxRuntimeExports.jsx("span",{className:"text-xs text-slate-400",children:r(Ie.modified)})},{key:"actions",header:"",render:Ie=>jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-1",onClick:We=>We.stopPropagation(),children:[Ie.type==="file"&&jsxRuntimeExports.jsx("button",{onClick:()=>be(Ie.path,Ie.name),className:"px-2 py-1 text-[11px] bg-indigo-500/20 hover:bg-indigo-500/30 text-indigo-300 rounded transition-colors",children:e("filesystem.download")}),jsxRuntimeExports.jsx("button",{onClick:()=>ce(Ie),className:"px-2 py-1 text-[11px] bg-red-500/20 hover:bg-red-500/30 text-red-300 rounded transition-colors",children:e("common.delete")})]})}],[Pe,Je=""]=e("filesystem.confirmDelete").split("{name}");return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PageHeader,{title:e("nav.filesystem"),subtitle:e("filesystem.subtitle"),actions:jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("input",{ref:fe,type:"file",className:"hidden",onChange:de}),jsxRuntimeExports.jsx("button",{onClick:()=>{var Ie;return(Ie=fe.current)==null?void 0:Ie.click()},disabled:ge,className:"px-3 py-1.5 text-xs bg-indigo-500/20 hover:bg-indigo-500/30 text-indigo-300 rounded-lg transition-colors disabled:opacity-50",children:e(ge?"filesystem.uploading":"filesystem.upload")}),jsxRuntimeExports.jsx("button",{onClick:()=>{N(!0),J(""),Z(null)},className:"px-3 py-1.5 text-xs bg-white/[0.06] hover:bg-white/[0.1] text-slate-300 rounded-lg transition-colors",children:e("filesystem.newFolder")})]})}),jsxRuntimeExports.jsxs("div",{className:"p-6 space-y-4",children:[jsxRuntimeExports.jsx("div",{className:"bg-white/[0.04] border border-white/[0.08] rounded-xl px-4 py-3",children:jsxRuntimeExports.jsx(Breadcrumb,{path:o,onNavigate:Be})}),X&&jsxRuntimeExports.jsx("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg",children:e("filesystem.uploadError",{message:X})}),l&&jsxRuntimeExports.jsx("div",{className:"text-slate-400 text-sm",children:e("common.loading")}),C&&jsxRuntimeExports.jsx("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg",children:C}),!l&&!C&&jsxRuntimeExports.jsx(DataTable,{columns:Te,data:d,keyExtractor:Ie=>Ie.path,onRowClick:Re}),(j!==null||x)&&jsxRuntimeExports.jsx(MonoPanel,{title:x?e("common.loading"):W,lines:x?[e("filesystem.loadingFile")]:j??[],maxLines:1e3})]}),jsxRuntimeExports.jsxs(Modal,{open:R,onClose:()=>N(!1),title:e("filesystem.newFolder"),actions:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("button",{onClick:()=>N(!1),className:"px-4 py-2 text-sm bg-white/[0.06] hover:bg-white/[0.1] text-slate-300 rounded-lg transition-colors",children:e("common.cancel")}),jsxRuntimeExports.jsx("button",{onClick:ie,disabled:K||!V.trim(),className:"px-4 py-2 text-sm bg-indigo-600 hover:bg-indigo-500 text-white rounded-lg transition-colors disabled:opacity-50",children:e(K?"filesystem.creating":"filesystem.create")})]}),children:[jsxRuntimeExports.jsx("input",{type:"text",placeholder:e("filesystem.folderName"),"aria-label":e("filesystem.folderName"),value:V,onChange:Ie=>J(Ie.target.value),onKeyDown:Ie=>{Ie.key==="Enter"&&ie()},autoFocus:!0,className:"w-full px-3 py-2 text-sm bg-white/[0.06] border border-white/[0.1] rounded-lg text-slate-200 placeholder-slate-500 focus:outline-none focus:border-indigo-500/50"}),Y&&jsxRuntimeExports.jsx("p",{className:"text-red-400 text-xs mt-2",children:Y})]}),jsxRuntimeExports.jsxs(Modal,{open:!!oe,onClose:()=>{ce(null),_e(null)},title:e("filesystem.confirmDeleteTitle"),actions:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("button",{onClick:()=>{ce(null),_e(null)},className:"px-4 py-2 text-sm bg-white/[0.06] hover:bg-white/[0.1] text-slate-300 rounded-lg transition-colors",children:e("common.cancel")}),jsxRuntimeExports.jsx("button",{onClick:De,disabled:le,className:"px-4 py-2 text-sm bg-red-600 hover:bg-red-500 text-white rounded-lg transition-colors disabled:opacity-50",children:e(le?"filesystem.deleting":"common.delete")})]}),children:[jsxRuntimeExports.jsxs("p",{children:[Pe,jsxRuntimeExports.jsx("span",{className:"font-mono text-white",children:oe==null?void 0:oe.name}),Je,(oe==null?void 0:oe.type)==="directory"&&` ${e("filesystem.deleteDirNote")}`]}),ae&&jsxRuntimeExports.jsx("p",{className:"text-red-400 text-xs mt-2",children:ae})]})]})}function getWsClients(){return apiFetch("/api/v1/qcli/ws/clients")}let eventCounter=0;function eventTypeBadgeVariant(e){return e.startsWith("job:")?"info":e.startsWith("log:")?"neutral":e.startsWith("error:")||e.includes("error")?"error":e.startsWith("warn:")||e.includes("warn")?"warning":e.startsWith("connect")||e.startsWith("session")?"success":"neutral"}function clientTypeBadgeVariant(e){return e==="events"?"info":e==="shell"?"success":"neutral"}const MAX_EVENTS=200;function EventsPage(){const{t:e,formatDate:t}=useI18n(),{subscribe:r}=useWebSocket(),[s,o]=reactExports.useState([]),[u,d]=reactExports.useState("all"),a=reactExports.useRef(null),[l,f]=reactExports.useState(!0),{data:C,loading:h,refetch:j}=useApi(getWsClients,[]);reactExports.useEffect(()=>{const x=setInterval(j,1e4);return()=>clearInterval(x)},[j]),reactExports.useEffect(()=>r("*",L=>{const R=L.type??"unknown",N={id:++eventCounter,time:new Date,type:R,payload:JSON.stringify(L)};o(V=>{const J=[...V,N];return J.length>MAX_EVENTS?J.slice(J.length-MAX_EVENTS):J})}),[r]),reactExports.useEffect(()=>{l&&a.current&&(a.current.scrollTop=a.current.scrollHeight)},[s,l]);const U=Array.from(new Set(s.map(x=>{const L=x.type.split(":");return L[0]+(L.length>1?":*":"")}))),W=s.filter(x=>u==="all"?!0:u.endsWith(":*")?x.type.startsWith(u.slice(0,-1)):x.type===u),H=[{key:"id",header:e("events.colId"),render:x=>jsxRuntimeExports.jsxs("span",{className:"font-mono text-xs text-slate-400",children:[x.id.slice(0,12),"..."]})},{key:"type",header:e("events.colType"),render:x=>jsxRuntimeExports.jsx(Badge,{variant:clientTypeBadgeVariant(x.type),children:x.type})},{key:"connectedAt",header:e("events.colConnected"),render:x=>jsxRuntimeExports.jsx("span",{className:"text-xs text-slate-400",children:t(x.connectedAt,{timeStyle:"medium"})})},{key:"remoteAddress",header:e("events.colRemote"),render:x=>jsxRuntimeExports.jsx("span",{className:"font-mono text-xs text-slate-400",children:x.remoteAddress})}];return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PageHeader,{title:e("nav.events"),subtitle:e("events.subtitle")}),jsxRuntimeExports.jsx("div",{className:"p-6",children:jsxRuntimeExports.jsxs("div",{className:"flex gap-4 h-[calc(100vh-12rem)]",children:[jsxRuntimeExports.jsx(ErrorBoundary,{label:e("events.liveEvents"),resetKeys:[s,u],children:jsxRuntimeExports.jsxs("div",{className:"flex-[2] flex flex-col bg-white/[0.04] border border-white/[0.08] rounded-xl overflow-hidden",children:[jsxRuntimeExports.jsxs("div",{className:"px-4 py-3 border-b border-white/[0.06] flex items-center gap-3 flex-wrap",children:[jsxRuntimeExports.jsx("span",{className:"text-sm font-medium text-white",children:e("events.liveEvents")}),jsxRuntimeExports.jsx("span",{className:"text-xs text-slate-500",children:e("events.shown",{shown:s.length,max:MAX_EVENTS})}),jsxRuntimeExports.jsxs("select",{value:u,onChange:x=>d(x.target.value),"aria-label":e("events.filterLabel"),title:e("events.filterLabel"),className:"ml-auto text-xs bg-white/[0.06] border border-white/[0.1] text-slate-300 rounded px-2 py-1 focus:outline-none",children:[jsxRuntimeExports.jsx("option",{value:"all",children:e("events.allTypes")}),U.map(x=>jsxRuntimeExports.jsx("option",{value:x,children:x},x))]}),jsxRuntimeExports.jsx("button",{onClick:()=>f(!l),className:`text-[10px] px-2 py-0.5 rounded ${l?"bg-indigo-500/20 text-indigo-300":"bg-white/[0.06] text-slate-400"}`,children:e(l?"events.autoScrollOn":"events.autoScrollOff")}),jsxRuntimeExports.jsx("button",{onClick:()=>o([]),className:"text-[10px] px-2 py-0.5 rounded bg-red-500/20 text-red-400 hover:bg-red-500/30 transition-colors",children:e("events.clear")})]}),jsxRuntimeExports.jsx("div",{ref:a,onScroll:()=>{if(!a.current)return;const{scrollTop:x,scrollHeight:L,clientHeight:R}=a.current;f(L-x-R<60)},className:"flex-1 overflow-y-auto p-3 font-mono text-xs space-y-0.5",children:W.length===0?jsxRuntimeExports.jsx("div",{className:"text-slate-500 py-4 text-center",children:e("events.waiting")}):W.map(x=>jsxRuntimeExports.jsxs("div",{className:"flex items-start gap-2 py-0.5 hover:bg-white/[0.03] rounded px-1",children:[jsxRuntimeExports.jsxs("span",{className:"text-slate-600 shrink-0",children:["[",t(x.time,{timeStyle:"medium"}),"]"]}),jsxRuntimeExports.jsx(Badge,{variant:eventTypeBadgeVariant(x.type),children:x.type}),jsxRuntimeExports.jsx("span",{className:"text-slate-400 truncate flex-1 text-[10px]",children:x.payload})]},x.id))})]})}),jsxRuntimeExports.jsx(ErrorBoundary,{label:e("events.connectedClients"),resetKeys:[C],children:jsxRuntimeExports.jsx("div",{className:"flex-1 flex flex-col",children:jsxRuntimeExports.jsxs("div",{className:"bg-white/[0.04] border border-white/[0.08] rounded-xl overflow-hidden flex flex-col h-full",children:[jsxRuntimeExports.jsxs("div",{className:"px-4 py-3 border-b border-white/[0.06] flex items-center justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-sm font-medium text-white",children:e("events.connectedClients")}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[C&&jsxRuntimeExports.jsx("span",{className:"text-xs text-slate-500",children:e("events.connectedCount",{count:C.length})}),jsxRuntimeExports.jsx("button",{onClick:j,className:"text-[10px] px-2 py-0.5 rounded bg-white/[0.06] text-slate-400 hover:bg-white/[0.1] transition-colors",children:e("common.refresh")})]})]}),jsxRuntimeExports.jsx("div",{className:"flex-1 overflow-auto",children:h?jsxRuntimeExports.jsx("div",{className:"p-4 text-slate-400 text-sm",children:e("common.loading")}):C&&C.length>0?jsxRuntimeExports.jsx(DataTable,{columns:H,data:C,keyExtractor:x=>x.id}):jsxRuntimeExports.jsx("div",{className:"p-4 text-slate-500 text-sm",children:e("events.noClients")})})]})})})]})})]})}function getConfig(){return apiFetch("/api/v1/qcli/config")}function updateConfig(e,t){return apiFetch("/api/v1/qcli/config",{method:"PUT",body:JSON.stringify({section:e,settings:t})})}function TagInput({value:e,onChange:t,disabled:r}){const{t:s}=useI18n(),[o,u]=reactExports.useState("");function d(){const l=o.trim();l&&!e.includes(l)&&t([...e,l]),u("")}function a(l){t(e.filter(f=>f!==l))}return jsxRuntimeExports.jsxs("div",{className:`flex flex-wrap gap-1.5 p-2 bg-white/[0.06] border border-white/[0.1] rounded-lg min-h-[38px] ${r?"opacity-50":""}`,children:[e.map(l=>jsxRuntimeExports.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-indigo-500/20 text-indigo-300 rounded text-xs font-mono",children:[l,!r&&jsxRuntimeExports.jsx("button",{onClick:()=>a(l),"aria-label":s("config.removeValue",{value:l}),title:s("config.removeValue",{value:l}),className:"text-indigo-400 hover:text-white ml-0.5",children:"×"})]},l)),!r&&jsxRuntimeExports.jsx("input",{type:"text",value:o,onChange:l=>u(l.target.value),onKeyDown:l=>{(l.key==="Enter"||l.key===",")&&(l.preventDefault(),d())},placeholder:s("config.addValue"),"aria-label":s("config.addValue"),className:"bg-transparent text-xs text-slate-300 placeholder-slate-600 focus:outline-none min-w-[80px]"})]})}function SettingField({entry:e,value:t,onChange:r}){const{t:s}=useI18n(),o=!e.mutable;if(e.type==="boolean"){const u=t;return jsxRuntimeExports.jsx("button",{onClick:()=>!o&&r(!u),disabled:o,role:"switch","aria-checked":u,"aria-label":e.key,title:s(u?"common.enabled":"common.disabled"),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed ${u?"bg-indigo-500":"bg-slate-600"}`,children:jsxRuntimeExports.jsx("span",{className:`inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform ${u?"translate-x-4":"translate-x-0.5"}`})})}return e.type==="string[]"?jsxRuntimeExports.jsx(TagInput,{value:t,onChange:r,disabled:o}):e.type==="number"?jsxRuntimeExports.jsx("input",{type:"number",value:t,disabled:o,onChange:u=>r(Number(u.target.value)),className:"w-full max-w-xs px-3 py-1.5 text-sm bg-white/[0.06] border border-white/[0.1] rounded-lg text-slate-200 focus:outline-none focus:border-indigo-500/50 disabled:opacity-50 disabled:cursor-not-allowed"}):jsxRuntimeExports.jsx("input",{type:"text",value:t,disabled:o,onChange:u=>r(u.target.value),className:"w-full max-w-sm px-3 py-1.5 text-sm bg-white/[0.06] border border-white/[0.1] rounded-lg text-slate-200 focus:outline-none focus:border-indigo-500/50 disabled:opacity-50 disabled:cursor-not-allowed"})}function ConfigPage(){const{t:e}=useI18n(),{data:t,loading:r,error:s,refetch:o}=useApi(getConfig,[]),[u,d]=reactExports.useState({}),[a,l]=reactExports.useState(!1),[f,C]=reactExports.useState(!1),[h,j]=reactExports.useState(null),[U,W]=reactExports.useState(!1),[H,x]=reactExports.useState(null);reactExports.useEffect(()=>{d({})},[t]);function L(J,Y){var Z;return((Z=u[J.name])==null?void 0:Z[Y.key])??Y.value}function R(J,Y,Z){d(K=>({...K,[J]:{...K[J],[Y]:Z}}))}const N=Object.keys(u).some(J=>Object.keys(u[J]??{}).length>0);async function V(){C(!0),j(null);let J=!1;try{for(const[Y,Z]of Object.entries(u)){if(Object.keys(Z).length===0)continue;(await updateConfig(Y,Z)).restartRequired&&(J=!0),x(Y)}W(J),d({}),o()}catch(Y){j(Y instanceof Error?Y.message:"")}finally{C(!1),l(!1)}}return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PageHeader,{title:e("config.title"),subtitle:e("config.subtitle"),actions:jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("button",{onClick:o,className:"px-3 py-1.5 text-xs bg-white/[0.06] hover:bg-white/[0.1] text-slate-300 rounded-lg transition-colors",children:e("common.refresh")}),jsxRuntimeExports.jsx("button",{onClick:()=>{l(!0),j(null)},disabled:!N||f,className:"px-3 py-1.5 text-xs bg-indigo-600 hover:bg-indigo-500 text-white rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:e("config.saveChanges")})]})}),jsxRuntimeExports.jsxs("div",{className:"p-6 space-y-6",children:[r&&jsxRuntimeExports.jsx("div",{className:"text-slate-400 text-sm",children:e("config.loading")}),s&&jsxRuntimeExports.jsx("div",{className:"text-red-400 text-sm",children:e("config.error",{message:s})}),U&&jsxRuntimeExports.jsxs("div",{className:"p-3 bg-amber-500/10 border border-amber-500/30 rounded-lg text-amber-300 text-sm flex items-center gap-2",children:[jsxRuntimeExports.jsx("span",{children:"⚠"}),jsxRuntimeExports.jsx("span",{children:e("config.restartRequired")})]}),h!==null&&jsxRuntimeExports.jsx("div",{className:"p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:h||e("config.saveFailed")}),!r&&t&&t.sections.length===0&&jsxRuntimeExports.jsx("div",{className:"text-slate-500 text-sm",children:e("common.noData")}),!r&&t&&t.sections.map(J=>jsxRuntimeExports.jsxs("div",{className:"bg-white/[0.04] border border-white/[0.08] rounded-xl overflow-hidden",children:[jsxRuntimeExports.jsxs("div",{className:"px-5 py-3 border-b border-white/[0.06] flex items-center gap-3",children:[jsxRuntimeExports.jsx("h3",{className:"text-sm font-semibold text-white capitalize",children:J.name}),jsxRuntimeExports.jsx(Badge,{variant:J.mutable?"success":"neutral",children:J.mutable?e("config.mutable"):e("config.readOnly")}),H===J.name&&jsxRuntimeExports.jsx("span",{className:"text-xs text-green-400 ml-auto",children:e("config.saved")})]}),jsxRuntimeExports.jsx("div",{className:"divide-y divide-white/[0.04]",children:J.settings.map(Y=>jsxRuntimeExports.jsxs("div",{className:`px-5 py-3 flex items-start gap-6 ${Y.mutable?"":"opacity-60"}`,children:[jsxRuntimeExports.jsxs("div",{className:"w-48 shrink-0",children:[jsxRuntimeExports.jsx("div",{className:"text-sm text-slate-300 font-mono",children:Y.key}),Y.description&&jsxRuntimeExports.jsx("div",{className:"text-[11px] text-slate-500 mt-0.5",children:Y.description}),!Y.mutable&&jsxRuntimeExports.jsx("span",{className:"text-[10px] text-slate-600",children:e("config.readOnlyMarker")})]}),jsxRuntimeExports.jsx("div",{className:"flex-1",children:jsxRuntimeExports.jsx(SettingField,{entry:Y,value:L(J,Y),onChange:Z=>R(J.name,Y.key,Z)})})]},Y.key))})]},J.name))]}),jsxRuntimeExports.jsxs(Modal,{open:a,onClose:()=>l(!1),title:e("config.confirmTitle"),actions:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("button",{onClick:()=>l(!1),className:"px-4 py-2 text-sm bg-white/[0.06] hover:bg-white/[0.1] text-slate-300 rounded-lg transition-colors",children:e("common.cancel")}),jsxRuntimeExports.jsx("button",{onClick:V,disabled:f,className:"px-4 py-2 text-sm bg-indigo-600 hover:bg-indigo-500 text-white rounded-lg transition-colors disabled:opacity-50",children:e(f?"config.saving":"config.confirmSave")})]}),children:[jsxRuntimeExports.jsx("p",{children:e("config.confirmMessage")}),h!==null&&jsxRuntimeExports.jsx("p",{className:"text-red-400 text-xs mt-2",children:h||e("config.saveFailed")})]})]})}function getLogs(e={}){const t=new URLSearchParams;e.level&&t.set("level",e.level),e.search&&t.set("search",e.search),e.limit!==void 0&&t.set("limit",String(e.limit)),e.offset!==void 0&&t.set("offset",String(e.offset));const r=t.toString();return apiFetch(`/api/v1/qcli/logs${r?`?${r}`:""}`)}const LEVEL_COLORS={DEBUG:"text-slate-400",INFO:"text-blue-400",WARN:"text-amber-400",ERROR:"text-red-400"},LEVEL_BG={DEBUG:"bg-slate-500/20",INFO:"bg-blue-500/20",WARN:"bg-amber-500/20",ERROR:"bg-red-500/20"},ALL_LEVELS=["DEBUG","INFO","WARN","ERROR"],TIMESTAMP_FORMAT={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function highlight(e,t){if(!t)return e;const r=e.toLowerCase().indexOf(t.toLowerCase());return r===-1?e:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[e.slice(0,r),jsxRuntimeExports.jsx("span",{className:"bg-yellow-400/30 text-yellow-200",children:e.slice(r,r+t.length)}),e.slice(r+t.length)]})}function LogsPage(){const{t:e,formatDate:t}=useI18n(),{subscribe:r}=useWebSocket(),[s,o]=reactExports.useState([]),[u,d]=reactExports.useState(0),[a,l]=reactExports.useState(0),[f,C]=reactExports.useState(!1),[h,j]=reactExports.useState(!0),[U,W]=reactExports.useState(null),[H,x]=reactExports.useState(new Set(ALL_LEVELS)),[L,R]=reactExports.useState(""),N=reactExports.useRef(null),[V,J]=reactExports.useState(!0),Y=100;reactExports.useEffect(()=>{j(!0),getLogs({limit:Y,offset:0}).then(le=>{o(le.entries),d(le.total),l(le.entries.length)}).catch(le=>W(le instanceof Error?{message:le.message}:{key:"logs.loadFailed"})).finally(()=>j(!1))},[]);async function Z(){C(!0);try{const le=await getLogs({limit:Y,offset:a});o(ne=>[...le.entries,...ne]),l(ne=>ne+le.entries.length)}catch(le){W(le instanceof Error?{message:le.message}:{key:"logs.loadMoreFailed"})}finally{C(!1)}}reactExports.useEffect(()=>r("log:entry",ne=>{const ae=ne;ae.timestamp&&ae.level&&ae.message&&(o(_e=>[..._e,ae]),d(_e=>_e+1))}),[r]),reactExports.useEffect(()=>{V&&N.current&&(N.current.scrollTop=N.current.scrollHeight)},[s,V]);function K(le){x(ne=>{const ae=new Set(ne);return ae.has(le)?ae.size>1&&ae.delete(le):ae.add(le),ae})}const ee=s.filter(le=>!(!H.has(le.level)||L&&!le.message.toLowerCase().includes(L.toLowerCase())&&!(le.source??"").toLowerCase().includes(L.toLowerCase())));function oe(){const le=ee.map(fe=>`[${fe.timestamp}] [${fe.level}] [${fe.source}] ${fe.message}`).join(`
|
|
69
|
-
`),ne=new Blob([le],{type:"text/plain"}),ae=URL.createObjectURL(ne),_e=document.createElement("a");_e.href=ae,_e.download=`server-logs-${new Date().toISOString().slice(0,19).replace(/[:.]/g,"-")}.txt`,_e.click(),URL.revokeObjectURL(ae)}const ce=a<u;return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PageHeader,{title:e("nav.logs"),subtitle:e("logs.shown",{count:ee.length}),actions:jsxRuntimeExports.jsx("div",{className:"flex items-center gap-2",children:jsxRuntimeExports.jsx("button",{onClick:oe,disabled:ee.length===0,title:e("logs.exportTitle"),className:"px-3 py-1.5 text-xs bg-white/[0.06] hover:bg-white/[0.1] text-slate-300 rounded-lg transition-colors disabled:opacity-40",children:e("logs.export")})})}),jsxRuntimeExports.jsxs("div",{className:"p-6 space-y-4",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[jsxRuntimeExports.jsx("div",{className:"flex items-center gap-2",role:"group","aria-label":e("logs.levels"),children:ALL_LEVELS.map(le=>jsxRuntimeExports.jsx("button",{onClick:()=>K(le),"aria-pressed":H.has(le),title:e(H.has(le)?"logs.hideLevel":"logs.showLevel",{level:le}),className:`px-2.5 py-1 text-xs font-medium rounded-lg border transition-colors ${H.has(le)?`${LEVEL_BG[le]} ${LEVEL_COLORS[le]} border-current/30`:"bg-white/[0.03] text-slate-600 border-white/[0.06]"}`,children:le},le))}),jsxRuntimeExports.jsx("input",{type:"text",placeholder:e("logs.search"),"aria-label":e("logs.search"),value:L,onChange:le=>R(le.target.value),className:"flex-1 max-w-sm px-3 py-1.5 text-sm bg-white/[0.06] border border-white/[0.1] rounded-lg text-slate-200 placeholder-slate-500 focus:outline-none focus:border-indigo-500/50"})]}),ce&&!h&&jsxRuntimeExports.jsx("button",{onClick:Z,disabled:f,className:"text-xs text-indigo-400 hover:text-indigo-300 transition-colors disabled:opacity-50",children:f?e("common.loading"):e("logs.loadOlder",{remaining:u-a})}),h&&jsxRuntimeExports.jsx("div",{className:"text-slate-400 text-sm",children:e("logs.loading")}),U&&jsxRuntimeExports.jsx("div",{className:"text-red-400 text-sm",children:e("logs.error",{message:"message"in U?U.message:e(U.key)})}),!h&&jsxRuntimeExports.jsxs("div",{className:"bg-white/[0.04] border border-white/[0.08] rounded-xl overflow-hidden",children:[jsxRuntimeExports.jsxs("div",{className:"px-4 py-3 border-b border-white/[0.06] flex items-center justify-between",children:[jsxRuntimeExports.jsx("span",{className:"text-sm font-medium text-white",children:e("logs.output")}),jsxRuntimeExports.jsx("button",{onClick:()=>J(!V),"aria-pressed":V,title:e("logs.autoScrollTitle"),className:`text-[10px] px-2 py-0.5 rounded ${V?"bg-indigo-500/20 text-indigo-300":"bg-white/[0.06] text-slate-400"}`,children:e(V?"logs.autoScrollOn":"logs.autoScrollOff")})]}),jsxRuntimeExports.jsx("div",{ref:N,onScroll:()=>{if(!N.current)return;const{scrollTop:le,scrollHeight:ne,clientHeight:ae}=N.current;J(ne-le-ae<60)},className:"overflow-y-auto max-h-[60vh] p-3 font-mono text-xs leading-5",children:ee.length===0?jsxRuntimeExports.jsx("div",{className:"text-slate-500 py-4 text-center",children:e("logs.noMatches")}):ee.map((le,ne)=>jsxRuntimeExports.jsxs("div",{className:"flex items-start gap-2 py-0.5 hover:bg-white/[0.03] rounded px-1",children:[jsxRuntimeExports.jsx("time",{dateTime:le.timestamp,className:"text-slate-600 shrink-0 text-[10px]",children:t(le.timestamp,TIMESTAMP_FORMAT)}),jsxRuntimeExports.jsx("span",{className:`shrink-0 font-bold w-12 text-[10px] ${LEVEL_COLORS[le.level]??"text-slate-400"}`,children:le.level}),le.source&&jsxRuntimeExports.jsxs("span",{className:"text-slate-600 shrink-0 text-[10px] max-w-[120px] truncate",title:le.source,children:["[",le.source,"]"]}),jsxRuntimeExports.jsx("span",{className:`flex-1 whitespace-pre-wrap break-all ${LEVEL_COLORS[le.level]??"text-slate-300"}`,children:highlight(le.message,L)})]},ne))})]})]})]})}var define_process_env_default={},__create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__commonJS=(e,t)=>function(){return t||(0,e[__getOwnPropNames(e)[0]])((t={exports:{}}).exports,t),t.exports},__copyProps=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of __getOwnPropNames(t))!__hasOwnProp.call(e,o)&&o!==r&&__defProp(e,o,{get:()=>t[o],enumerable:!(s=__getOwnPropDesc(t,o))||s.enumerable});return e},__toESM=(e,t,r)=>(r=e!=null?__create(__getProtoOf(e)):{},__copyProps(!e||!e.__esModule?__defProp(r,"default",{value:e,enumerable:!0}):r,e)),require_constants=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js"(e,t){var r="2.0.0",s=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,u=16,d=s-6,a=["major","premajor","minor","preminor","patch","prepatch","prerelease"];t.exports={MAX_LENGTH:s,MAX_SAFE_COMPONENT_LENGTH:u,MAX_SAFE_BUILD_LENGTH:d,MAX_SAFE_INTEGER:o,RELEASE_TYPES:a,SEMVER_SPEC_VERSION:r,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}}),require_debug=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js"(e,t){var r=typeof process=="object"&&define_process_env_default&&define_process_env_default.NODE_DEBUG&&/\bsemver\b/i.test(define_process_env_default.NODE_DEBUG)?(...s)=>console.error("SEMVER",...s):()=>{};t.exports=r}}),require_re=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js"(e,t){var{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:o}=require_constants(),u=require_debug();e=t.exports={};var d=e.re=[],a=e.safeRe=[],l=e.src=[],f=e.safeSrc=[],C=e.t={},h=0,j="[a-zA-Z0-9-]",U=[["\\s",1],["\\d",o],[j,s]],W=x=>{for(const[L,R]of U)x=x.split(`${L}*`).join(`${L}{0,${R}}`).split(`${L}+`).join(`${L}{1,${R}}`);return x},H=(x,L,R)=>{const N=W(L),V=h++;u(x,V,L),C[x]=V,l[V]=L,f[V]=N,d[V]=new RegExp(L,R?"g":void 0),a[V]=new RegExp(N,R?"g":void 0)};H("NUMERICIDENTIFIER","0|[1-9]\\d*"),H("NUMERICIDENTIFIERLOOSE","\\d+"),H("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${j}*`),H("MAINVERSION",`(${l[C.NUMERICIDENTIFIER]})\\.(${l[C.NUMERICIDENTIFIER]})\\.(${l[C.NUMERICIDENTIFIER]})`),H("MAINVERSIONLOOSE",`(${l[C.NUMERICIDENTIFIERLOOSE]})\\.(${l[C.NUMERICIDENTIFIERLOOSE]})\\.(${l[C.NUMERICIDENTIFIERLOOSE]})`),H("PRERELEASEIDENTIFIER",`(?:${l[C.NONNUMERICIDENTIFIER]}|${l[C.NUMERICIDENTIFIER]})`),H("PRERELEASEIDENTIFIERLOOSE",`(?:${l[C.NONNUMERICIDENTIFIER]}|${l[C.NUMERICIDENTIFIERLOOSE]})`),H("PRERELEASE",`(?:-(${l[C.PRERELEASEIDENTIFIER]}(?:\\.${l[C.PRERELEASEIDENTIFIER]})*))`),H("PRERELEASELOOSE",`(?:-?(${l[C.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[C.PRERELEASEIDENTIFIERLOOSE]})*))`),H("BUILDIDENTIFIER",`${j}+`),H("BUILD",`(?:\\+(${l[C.BUILDIDENTIFIER]}(?:\\.${l[C.BUILDIDENTIFIER]})*))`),H("FULLPLAIN",`v?${l[C.MAINVERSION]}${l[C.PRERELEASE]}?${l[C.BUILD]}?`),H("FULL",`^${l[C.FULLPLAIN]}$`),H("LOOSEPLAIN",`[v=\\s]*${l[C.MAINVERSIONLOOSE]}${l[C.PRERELEASELOOSE]}?${l[C.BUILD]}?`),H("LOOSE",`^${l[C.LOOSEPLAIN]}$`),H("GTLT","((?:<|>)?=?)"),H("XRANGEIDENTIFIERLOOSE",`${l[C.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),H("XRANGEIDENTIFIER",`${l[C.NUMERICIDENTIFIER]}|x|X|\\*`),H("XRANGEPLAIN",`[v=\\s]*(${l[C.XRANGEIDENTIFIER]})(?:\\.(${l[C.XRANGEIDENTIFIER]})(?:\\.(${l[C.XRANGEIDENTIFIER]})(?:${l[C.PRERELEASE]})?${l[C.BUILD]}?)?)?`),H("XRANGEPLAINLOOSE",`[v=\\s]*(${l[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[C.XRANGEIDENTIFIERLOOSE]})(?:${l[C.PRERELEASELOOSE]})?${l[C.BUILD]}?)?)?`),H("XRANGE",`^${l[C.GTLT]}\\s*${l[C.XRANGEPLAIN]}$`),H("XRANGELOOSE",`^${l[C.GTLT]}\\s*${l[C.XRANGEPLAINLOOSE]}$`),H("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),H("COERCE",`${l[C.COERCEPLAIN]}(?:$|[^\\d])`),H("COERCEFULL",l[C.COERCEPLAIN]+`(?:${l[C.PRERELEASE]})?(?:${l[C.BUILD]})?(?:$|[^\\d])`),H("COERCERTL",l[C.COERCE],!0),H("COERCERTLFULL",l[C.COERCEFULL],!0),H("LONETILDE","(?:~>?)"),H("TILDETRIM",`(\\s*)${l[C.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",H("TILDE",`^${l[C.LONETILDE]}${l[C.XRANGEPLAIN]}$`),H("TILDELOOSE",`^${l[C.LONETILDE]}${l[C.XRANGEPLAINLOOSE]}$`),H("LONECARET","(?:\\^)"),H("CARETTRIM",`(\\s*)${l[C.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",H("CARET",`^${l[C.LONECARET]}${l[C.XRANGEPLAIN]}$`),H("CARETLOOSE",`^${l[C.LONECARET]}${l[C.XRANGEPLAINLOOSE]}$`),H("COMPARATORLOOSE",`^${l[C.GTLT]}\\s*(${l[C.LOOSEPLAIN]})$|^$`),H("COMPARATOR",`^${l[C.GTLT]}\\s*(${l[C.FULLPLAIN]})$|^$`),H("COMPARATORTRIM",`(\\s*)${l[C.GTLT]}\\s*(${l[C.LOOSEPLAIN]}|${l[C.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",H("HYPHENRANGE",`^\\s*(${l[C.XRANGEPLAIN]})\\s+-\\s+(${l[C.XRANGEPLAIN]})\\s*$`),H("HYPHENRANGELOOSE",`^\\s*(${l[C.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[C.XRANGEPLAINLOOSE]})\\s*$`),H("STAR","(<|>)?=?\\s*\\*"),H("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),H("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}}),require_parse_options=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js"(e,t){var r=Object.freeze({loose:!0}),s=Object.freeze({}),o=u=>u?typeof u!="object"?r:u:s;t.exports=o}}),require_identifiers=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js"(e,t){var r=/^[0-9]+$/,s=(u,d)=>{if(typeof u=="number"&&typeof d=="number")return u===d?0:u<d?-1:1;const a=r.test(u),l=r.test(d);return a&&l&&(u=+u,d=+d),u===d?0:a&&!l?-1:l&&!a?1:u<d?-1:1},o=(u,d)=>s(d,u);t.exports={compareIdentifiers:s,rcompareIdentifiers:o}}}),require_semver=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js"(e,t){var r=require_debug(),{MAX_LENGTH:s,MAX_SAFE_INTEGER:o}=require_constants(),{safeRe:u,t:d}=require_re(),a=require_parse_options(),{compareIdentifiers:l}=require_identifiers(),f=class Ar{constructor(h,j){if(j=a(j),h instanceof Ar){if(h.loose===!!j.loose&&h.includePrerelease===!!j.includePrerelease)return h;h=h.version}else if(typeof h!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof h}".`);if(h.length>s)throw new TypeError(`version is longer than ${s} characters`);r("SemVer",h,j),this.options=j,this.loose=!!j.loose,this.includePrerelease=!!j.includePrerelease;const U=h.trim().match(j.loose?u[d.LOOSE]:u[d.FULL]);if(!U)throw new TypeError(`Invalid Version: ${h}`);if(this.raw=h,this.major=+U[1],this.minor=+U[2],this.patch=+U[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");U[4]?this.prerelease=U[4].split(".").map(W=>{if(/^[0-9]+$/.test(W)){const H=+W;if(H>=0&&H<o)return H}return W}):this.prerelease=[],this.build=U[5]?U[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(h){if(r("SemVer.compare",this.version,this.options,h),!(h instanceof Ar)){if(typeof h=="string"&&h===this.version)return 0;h=new Ar(h,this.options)}return h.version===this.version?0:this.compareMain(h)||this.comparePre(h)}compareMain(h){return h instanceof Ar||(h=new Ar(h,this.options)),this.major<h.major?-1:this.major>h.major?1:this.minor<h.minor?-1:this.minor>h.minor?1:this.patch<h.patch?-1:this.patch>h.patch?1:0}comparePre(h){if(h instanceof Ar||(h=new Ar(h,this.options)),this.prerelease.length&&!h.prerelease.length)return-1;if(!this.prerelease.length&&h.prerelease.length)return 1;if(!this.prerelease.length&&!h.prerelease.length)return 0;let j=0;do{const U=this.prerelease[j],W=h.prerelease[j];if(r("prerelease compare",j,U,W),U===void 0&&W===void 0)return 0;if(W===void 0)return 1;if(U===void 0)return-1;if(U===W)continue;return l(U,W)}while(++j)}compareBuild(h){h instanceof Ar||(h=new Ar(h,this.options));let j=0;do{const U=this.build[j],W=h.build[j];if(r("build compare",j,U,W),U===void 0&&W===void 0)return 0;if(W===void 0)return 1;if(U===void 0)return-1;if(U===W)continue;return l(U,W)}while(++j)}inc(h,j,U){if(h.startsWith("pre")){if(!j&&U===!1)throw new Error("invalid increment argument: identifier is empty");if(j){const W=`-${j}`.match(this.options.loose?u[d.PRERELEASELOOSE]:u[d.PRERELEASE]);if(!W||W[1]!==j)throw new Error(`invalid identifier: ${j}`)}}switch(h){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",j,U);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",j,U);break;case"prepatch":this.prerelease.length=0,this.inc("patch",j,U),this.inc("pre",j,U);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",j,U),this.inc("pre",j,U);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const W=Number(U)?1:0;if(this.prerelease.length===0)this.prerelease=[W];else{let H=this.prerelease.length;for(;--H>=0;)typeof this.prerelease[H]=="number"&&(this.prerelease[H]++,H=-2);if(H===-1){if(j===this.prerelease.join(".")&&U===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(W)}}if(j){let H=[j,W];U===!1&&(H=[j]),l(this.prerelease[0],j)===0?isNaN(this.prerelease[1])&&(this.prerelease=H):this.prerelease=H}break}default:throw new Error(`invalid increment argument: ${h}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};t.exports=f}}),require_parse=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js"(e,t){var r=require_semver(),s=(o,u,d=!1)=>{if(o instanceof r)return o;try{return new r(o,u)}catch(a){if(!d)return null;throw a}};t.exports=s}}),require_valid=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js"(e,t){var r=require_parse(),s=(o,u)=>{const d=r(o,u);return d?d.version:null};t.exports=s}}),require_clean=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js"(e,t){var r=require_parse(),s=(o,u)=>{const d=r(o.trim().replace(/^[=v]+/,""),u);return d?d.version:null};t.exports=s}}),require_inc=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js"(e,t){var r=require_semver(),s=(o,u,d,a,l)=>{typeof d=="string"&&(l=a,a=d,d=void 0);try{return new r(o instanceof r?o.version:o,d).inc(u,a,l).version}catch{return null}};t.exports=s}}),require_diff=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js"(e,t){var r=require_parse(),s=(o,u)=>{const d=r(o,null,!0),a=r(u,null,!0),l=d.compare(a);if(l===0)return null;const f=l>0,C=f?d:a,h=f?a:d,j=!!C.prerelease.length;if(!!h.prerelease.length&&!j){if(!h.patch&&!h.minor)return"major";if(h.compareMain(C)===0)return h.minor&&!h.patch?"minor":"patch"}const W=j?"pre":"";return d.major!==a.major?W+"major":d.minor!==a.minor?W+"minor":d.patch!==a.patch?W+"patch":"prerelease"};t.exports=s}}),require_major=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js"(e,t){var r=require_semver(),s=(o,u)=>new r(o,u).major;t.exports=s}}),require_minor=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js"(e,t){var r=require_semver(),s=(o,u)=>new r(o,u).minor;t.exports=s}}),require_patch=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js"(e,t){var r=require_semver(),s=(o,u)=>new r(o,u).patch;t.exports=s}}),require_prerelease=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js"(e,t){var r=require_parse(),s=(o,u)=>{const d=r(o,u);return d&&d.prerelease.length?d.prerelease:null};t.exports=s}}),require_compare=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js"(e,t){var r=require_semver(),s=(o,u,d)=>new r(o,d).compare(new r(u,d));t.exports=s}}),require_rcompare=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js"(e,t){var r=require_compare(),s=(o,u,d)=>r(u,o,d);t.exports=s}}),require_compare_loose=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js"(e,t){var r=require_compare(),s=(o,u)=>r(o,u,!0);t.exports=s}}),require_compare_build=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js"(e,t){var r=require_semver(),s=(o,u,d)=>{const a=new r(o,d),l=new r(u,d);return a.compare(l)||a.compareBuild(l)};t.exports=s}}),require_sort=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js"(e,t){var r=require_compare_build(),s=(o,u)=>o.sort((d,a)=>r(d,a,u));t.exports=s}}),require_rsort=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js"(e,t){var r=require_compare_build(),s=(o,u)=>o.sort((d,a)=>r(a,d,u));t.exports=s}}),require_gt=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js"(e,t){var r=require_compare(),s=(o,u,d)=>r(o,u,d)>0;t.exports=s}}),require_lt=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js"(e,t){var r=require_compare(),s=(o,u,d)=>r(o,u,d)<0;t.exports=s}}),require_eq=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js"(e,t){var r=require_compare(),s=(o,u,d)=>r(o,u,d)===0;t.exports=s}}),require_neq=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js"(e,t){var r=require_compare(),s=(o,u,d)=>r(o,u,d)!==0;t.exports=s}}),require_gte=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js"(e,t){var r=require_compare(),s=(o,u,d)=>r(o,u,d)>=0;t.exports=s}}),require_lte=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js"(e,t){var r=require_compare(),s=(o,u,d)=>r(o,u,d)<=0;t.exports=s}}),require_cmp=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js"(e,t){var r=require_eq(),s=require_neq(),o=require_gt(),u=require_gte(),d=require_lt(),a=require_lte(),l=(f,C,h,j)=>{switch(C){case"===":return typeof f=="object"&&(f=f.version),typeof h=="object"&&(h=h.version),f===h;case"!==":return typeof f=="object"&&(f=f.version),typeof h=="object"&&(h=h.version),f!==h;case"":case"=":case"==":return r(f,h,j);case"!=":return s(f,h,j);case">":return o(f,h,j);case">=":return u(f,h,j);case"<":return d(f,h,j);case"<=":return a(f,h,j);default:throw new TypeError(`Invalid operator: ${C}`)}};t.exports=l}}),require_coerce=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js"(e,t){var r=require_semver(),s=require_parse(),{safeRe:o,t:u}=require_re(),d=(a,l)=>{if(a instanceof r)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;l=l||{};let f=null;if(!l.rtl)f=a.match(l.includePrerelease?o[u.COERCEFULL]:o[u.COERCE]);else{const H=l.includePrerelease?o[u.COERCERTLFULL]:o[u.COERCERTL];let x;for(;(x=H.exec(a))&&(!f||f.index+f[0].length!==a.length);)(!f||x.index+x[0].length!==f.index+f[0].length)&&(f=x),H.lastIndex=x.index+x[1].length+x[2].length;H.lastIndex=-1}if(f===null)return null;const C=f[2],h=f[3]||"0",j=f[4]||"0",U=l.includePrerelease&&f[5]?`-${f[5]}`:"",W=l.includePrerelease&&f[6]?`+${f[6]}`:"";return s(`${C}.${h}.${j}${U}${W}`,l)};t.exports=d}}),require_lrucache=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js"(e,t){var r=class{constructor(){this.max=1e3,this.map=new Map}get(s){const o=this.map.get(s);if(o!==void 0)return this.map.delete(s),this.map.set(s,o),o}delete(s){return this.map.delete(s)}set(s,o){if(!this.delete(s)&&o!==void 0){if(this.map.size>=this.max){const d=this.map.keys().next().value;this.delete(d)}this.map.set(s,o)}return this}};t.exports=r}}),require_range=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js"(e,t){var r=/\s+/g,s=class lo{constructor(ge,he){if(he=d(he),ge instanceof lo)return ge.loose===!!he.loose&&ge.includePrerelease===!!he.includePrerelease?ge:new lo(ge.raw,he);if(ge instanceof a)return this.raw=ge.value,this.set=[[ge]],this.formatted=void 0,this;if(this.options=he,this.loose=!!he.loose,this.includePrerelease=!!he.includePrerelease,this.raw=ge.trim().replace(r," "),this.set=this.raw.split("||").map(X=>this.parseRange(X.trim())).filter(X=>X.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const X=this.set[0];if(this.set=this.set.filter(re=>!L(re[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(const re of this.set)if(re.length===1&&R(re[0])){this.set=[re];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let ge=0;ge<this.set.length;ge++){ge>0&&(this.formatted+="||");const he=this.set[ge];for(let X=0;X<he.length;X++)X>0&&(this.formatted+=" "),this.formatted+=he[X].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(ge){const X=((this.options.includePrerelease&&H)|(this.options.loose&&x))+":"+ge,re=u.get(X);if(re)return re;const Q=this.options.loose,se=Q?C[h.HYPHENRANGELOOSE]:C[h.HYPHENRANGE];ge=ge.replace(se,ae(this.options.includePrerelease)),l("hyphen replace",ge),ge=ge.replace(C[h.COMPARATORTRIM],j),l("comparator trim",ge),ge=ge.replace(C[h.TILDETRIM],U),l("tilde trim",ge),ge=ge.replace(C[h.CARETTRIM],W),l("caret trim",ge);let Ce=ge.split(" ").map(de=>V(de,this.options)).join(" ").split(/\s+/).map(de=>ne(de,this.options));Q&&(Ce=Ce.filter(de=>(l("loose invalid filter",de,this.options),!!de.match(C[h.COMPARATORLOOSE])))),l("range list",Ce);const we=new Map,Be=Ce.map(de=>new a(de,this.options));for(const de of Be){if(L(de))return[de];we.set(de.value,de)}we.size>1&&we.has("")&&we.delete("");const Re=[...we.values()];return u.set(X,Re),Re}intersects(ge,he){if(!(ge instanceof lo))throw new TypeError("a Range is required");return this.set.some(X=>N(X,he)&&ge.set.some(re=>N(re,he)&&X.every(Q=>re.every(se=>Q.intersects(se,he)))))}test(ge){if(!ge)return!1;if(typeof ge=="string")try{ge=new f(ge,this.options)}catch{return!1}for(let he=0;he<this.set.length;he++)if(_e(this.set[he],ge,this.options))return!0;return!1}};t.exports=s;var o=require_lrucache(),u=new o,d=require_parse_options(),a=require_comparator(),l=require_debug(),f=require_semver(),{safeRe:C,t:h,comparatorTrimReplace:j,tildeTrimReplace:U,caretTrimReplace:W}=require_re(),{FLAG_INCLUDE_PRERELEASE:H,FLAG_LOOSE:x}=require_constants(),L=fe=>fe.value==="<0.0.0-0",R=fe=>fe.value==="",N=(fe,ge)=>{let he=!0;const X=fe.slice();let re=X.pop();for(;he&&X.length;)he=X.every(Q=>re.intersects(Q,ge)),re=X.pop();return he},V=(fe,ge)=>(fe=fe.replace(C[h.BUILD],""),l("comp",fe,ge),fe=K(fe,ge),l("caret",fe),fe=Y(fe,ge),l("tildes",fe),fe=oe(fe,ge),l("xrange",fe),fe=le(fe,ge),l("stars",fe),fe),J=fe=>!fe||fe.toLowerCase()==="x"||fe==="*",Y=(fe,ge)=>fe.trim().split(/\s+/).map(he=>Z(he,ge)).join(" "),Z=(fe,ge)=>{const he=ge.loose?C[h.TILDELOOSE]:C[h.TILDE];return fe.replace(he,(X,re,Q,se,Ce)=>{l("tilde",fe,X,re,Q,se,Ce);let we;return J(re)?we="":J(Q)?we=`>=${re}.0.0 <${+re+1}.0.0-0`:J(se)?we=`>=${re}.${Q}.0 <${re}.${+Q+1}.0-0`:Ce?(l("replaceTilde pr",Ce),we=`>=${re}.${Q}.${se}-${Ce} <${re}.${+Q+1}.0-0`):we=`>=${re}.${Q}.${se} <${re}.${+Q+1}.0-0`,l("tilde return",we),we})},K=(fe,ge)=>fe.trim().split(/\s+/).map(he=>ee(he,ge)).join(" "),ee=(fe,ge)=>{l("caret",fe,ge);const he=ge.loose?C[h.CARETLOOSE]:C[h.CARET],X=ge.includePrerelease?"-0":"";return fe.replace(he,(re,Q,se,Ce,we)=>{l("caret",fe,re,Q,se,Ce,we);let Be;return J(Q)?Be="":J(se)?Be=`>=${Q}.0.0${X} <${+Q+1}.0.0-0`:J(Ce)?Q==="0"?Be=`>=${Q}.${se}.0${X} <${Q}.${+se+1}.0-0`:Be=`>=${Q}.${se}.0${X} <${+Q+1}.0.0-0`:we?(l("replaceCaret pr",we),Q==="0"?se==="0"?Be=`>=${Q}.${se}.${Ce}-${we} <${Q}.${se}.${+Ce+1}-0`:Be=`>=${Q}.${se}.${Ce}-${we} <${Q}.${+se+1}.0-0`:Be=`>=${Q}.${se}.${Ce}-${we} <${+Q+1}.0.0-0`):(l("no pr"),Q==="0"?se==="0"?Be=`>=${Q}.${se}.${Ce}${X} <${Q}.${se}.${+Ce+1}-0`:Be=`>=${Q}.${se}.${Ce}${X} <${Q}.${+se+1}.0-0`:Be=`>=${Q}.${se}.${Ce} <${+Q+1}.0.0-0`),l("caret return",Be),Be})},oe=(fe,ge)=>(l("replaceXRanges",fe,ge),fe.split(/\s+/).map(he=>ce(he,ge)).join(" ")),ce=(fe,ge)=>{fe=fe.trim();const he=ge.loose?C[h.XRANGELOOSE]:C[h.XRANGE];return fe.replace(he,(X,re,Q,se,Ce,we)=>{l("xRange",fe,X,re,Q,se,Ce,we);const Be=J(Q),Re=Be||J(se),de=Re||J(Ce),ie=de;return re==="="&&ie&&(re=""),we=ge.includePrerelease?"-0":"",Be?re===">"||re==="<"?X="<0.0.0-0":X="*":re&&ie?(Re&&(se=0),Ce=0,re===">"?(re=">=",Re?(Q=+Q+1,se=0,Ce=0):(se=+se+1,Ce=0)):re==="<="&&(re="<",Re?Q=+Q+1:se=+se+1),re==="<"&&(we="-0"),X=`${re+Q}.${se}.${Ce}${we}`):Re?X=`>=${Q}.0.0${we} <${+Q+1}.0.0-0`:de&&(X=`>=${Q}.${se}.0${we} <${Q}.${+se+1}.0-0`),l("xRange return",X),X})},le=(fe,ge)=>(l("replaceStars",fe,ge),fe.trim().replace(C[h.STAR],"")),ne=(fe,ge)=>(l("replaceGTE0",fe,ge),fe.trim().replace(C[ge.includePrerelease?h.GTE0PRE:h.GTE0],"")),ae=fe=>(ge,he,X,re,Q,se,Ce,we,Be,Re,de,ie)=>(J(X)?he="":J(re)?he=`>=${X}.0.0${fe?"-0":""}`:J(Q)?he=`>=${X}.${re}.0${fe?"-0":""}`:se?he=`>=${he}`:he=`>=${he}${fe?"-0":""}`,J(Be)?we="":J(Re)?we=`<${+Be+1}.0.0-0`:J(de)?we=`<${Be}.${+Re+1}.0-0`:ie?we=`<=${Be}.${Re}.${de}-${ie}`:fe?we=`<${Be}.${Re}.${+de+1}-0`:we=`<=${we}`,`${he} ${we}`.trim()),_e=(fe,ge,he)=>{for(let X=0;X<fe.length;X++)if(!fe[X].test(ge))return!1;if(ge.prerelease.length&&!he.includePrerelease){for(let X=0;X<fe.length;X++)if(l(fe[X].semver),fe[X].semver!==a.ANY&&fe[X].semver.prerelease.length>0){const re=fe[X].semver;if(re.major===ge.major&&re.minor===ge.minor&&re.patch===ge.patch)return!0}return!1}return!0}}}),require_comparator=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js"(e,t){var r=Symbol("SemVer ANY"),s=class za{static get ANY(){return r}constructor(j,U){if(U=o(U),j instanceof za){if(j.loose===!!U.loose)return j;j=j.value}j=j.trim().split(/\s+/).join(" "),l("comparator",j,U),this.options=U,this.loose=!!U.loose,this.parse(j),this.semver===r?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(j){const U=this.options.loose?u[d.COMPARATORLOOSE]:u[d.COMPARATOR],W=j.match(U);if(!W)throw new TypeError(`Invalid comparator: ${j}`);this.operator=W[1]!==void 0?W[1]:"",this.operator==="="&&(this.operator=""),W[2]?this.semver=new f(W[2],this.options.loose):this.semver=r}toString(){return this.value}test(j){if(l("Comparator.test",j,this.options.loose),this.semver===r||j===r)return!0;if(typeof j=="string")try{j=new f(j,this.options)}catch{return!1}return a(j,this.operator,this.semver,this.options)}intersects(j,U){if(!(j instanceof za))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new C(j.value,U).test(this.value):j.operator===""?j.value===""?!0:new C(this.value,U).test(j.semver):(U=o(U),U.includePrerelease&&(this.value==="<0.0.0-0"||j.value==="<0.0.0-0")||!U.includePrerelease&&(this.value.startsWith("<0.0.0")||j.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&j.operator.startsWith(">")||this.operator.startsWith("<")&&j.operator.startsWith("<")||this.semver.version===j.semver.version&&this.operator.includes("=")&&j.operator.includes("=")||a(this.semver,"<",j.semver,U)&&this.operator.startsWith(">")&&j.operator.startsWith("<")||a(this.semver,">",j.semver,U)&&this.operator.startsWith("<")&&j.operator.startsWith(">")))}};t.exports=s;var o=require_parse_options(),{safeRe:u,t:d}=require_re(),a=require_cmp(),l=require_debug(),f=require_semver(),C=require_range()}}),require_satisfies=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js"(e,t){var r=require_range(),s=(o,u,d)=>{try{u=new r(u,d)}catch{return!1}return u.test(o)};t.exports=s}}),require_to_comparators=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js"(e,t){var r=require_range(),s=(o,u)=>new r(o,u).set.map(d=>d.map(a=>a.value).join(" ").trim().split(" "));t.exports=s}}),require_max_satisfying=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js"(e,t){var r=require_semver(),s=require_range(),o=(u,d,a)=>{let l=null,f=null,C=null;try{C=new s(d,a)}catch{return null}return u.forEach(h=>{C.test(h)&&(!l||f.compare(h)===-1)&&(l=h,f=new r(l,a))}),l};t.exports=o}}),require_min_satisfying=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js"(e,t){var r=require_semver(),s=require_range(),o=(u,d,a)=>{let l=null,f=null,C=null;try{C=new s(d,a)}catch{return null}return u.forEach(h=>{C.test(h)&&(!l||f.compare(h)===1)&&(l=h,f=new r(l,a))}),l};t.exports=o}}),require_min_version=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js"(e,t){var r=require_semver(),s=require_range(),o=require_gt(),u=(d,a)=>{d=new s(d,a);let l=new r("0.0.0");if(d.test(l)||(l=new r("0.0.0-0"),d.test(l)))return l;l=null;for(let f=0;f<d.set.length;++f){const C=d.set[f];let h=null;C.forEach(j=>{const U=new r(j.semver.version);switch(j.operator){case">":U.prerelease.length===0?U.patch++:U.prerelease.push(0),U.raw=U.format();case"":case">=":(!h||o(U,h))&&(h=U);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${j.operator}`)}}),h&&(!l||o(l,h))&&(l=h)}return l&&d.test(l)?l:null};t.exports=u}}),require_valid2=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js"(e,t){var r=require_range(),s=(o,u)=>{try{return new r(o,u).range||"*"}catch{return null}};t.exports=s}}),require_outside=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js"(e,t){var r=require_semver(),s=require_comparator(),{ANY:o}=s,u=require_range(),d=require_satisfies(),a=require_gt(),l=require_lt(),f=require_lte(),C=require_gte(),h=(j,U,W,H)=>{j=new r(j,H),U=new u(U,H);let x,L,R,N,V;switch(W){case">":x=a,L=f,R=l,N=">",V=">=";break;case"<":x=l,L=C,R=a,N="<",V="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(d(j,U,H))return!1;for(let J=0;J<U.set.length;++J){const Y=U.set[J];let Z=null,K=null;if(Y.forEach(ee=>{ee.semver===o&&(ee=new s(">=0.0.0")),Z=Z||ee,K=K||ee,x(ee.semver,Z.semver,H)?Z=ee:R(ee.semver,K.semver,H)&&(K=ee)}),Z.operator===N||Z.operator===V||(!K.operator||K.operator===N)&&L(j,K.semver))return!1;if(K.operator===V&&R(j,K.semver))return!1}return!0};t.exports=h}}),require_gtr=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js"(e,t){var r=require_outside(),s=(o,u,d)=>r(o,u,">",d);t.exports=s}}),require_ltr=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js"(e,t){var r=require_outside(),s=(o,u,d)=>r(o,u,"<",d);t.exports=s}}),require_intersects=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js"(e,t){var r=require_range(),s=(o,u,d)=>(o=new r(o,d),u=new r(u,d),o.intersects(u,d));t.exports=s}}),require_simplify=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js"(e,t){var r=require_satisfies(),s=require_compare();t.exports=(o,u,d)=>{const a=[];let l=null,f=null;const C=o.sort((W,H)=>s(W,H,d));for(const W of C)r(W,u,d)?(f=W,l||(l=W)):(f&&a.push([l,f]),f=null,l=null);l&&a.push([l,null]);const h=[];for(const[W,H]of a)W===H?h.push(W):!H&&W===C[0]?h.push("*"):H?W===C[0]?h.push(`<=${H}`):h.push(`${W} - ${H}`):h.push(`>=${W}`);const j=h.join(" || "),U=typeof u.raw=="string"?u.raw:String(u);return j.length<U.length?j:u}}}),require_subset=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js"(e,t){var r=require_range(),s=require_comparator(),{ANY:o}=s,u=require_satisfies(),d=require_compare(),a=(U,W,H={})=>{if(U===W)return!0;U=new r(U,H),W=new r(W,H);let x=!1;e:for(const L of U.set){for(const R of W.set){const N=C(L,R,H);if(x=x||N!==null,N)continue e}if(x)return!1}return!0},l=[new s(">=0.0.0-0")],f=[new s(">=0.0.0")],C=(U,W,H)=>{if(U===W)return!0;if(U.length===1&&U[0].semver===o){if(W.length===1&&W[0].semver===o)return!0;H.includePrerelease?U=l:U=f}if(W.length===1&&W[0].semver===o){if(H.includePrerelease)return!0;W=f}const x=new Set;let L,R;for(const oe of U)oe.operator===">"||oe.operator===">="?L=h(L,oe,H):oe.operator==="<"||oe.operator==="<="?R=j(R,oe,H):x.add(oe.semver);if(x.size>1)return null;let N;if(L&&R){if(N=d(L.semver,R.semver,H),N>0)return null;if(N===0&&(L.operator!==">="||R.operator!=="<="))return null}for(const oe of x){if(L&&!u(oe,String(L),H)||R&&!u(oe,String(R),H))return null;for(const ce of W)if(!u(oe,String(ce),H))return!1;return!0}let V,J,Y,Z,K=R&&!H.includePrerelease&&R.semver.prerelease.length?R.semver:!1,ee=L&&!H.includePrerelease&&L.semver.prerelease.length?L.semver:!1;K&&K.prerelease.length===1&&R.operator==="<"&&K.prerelease[0]===0&&(K=!1);for(const oe of W){if(Z=Z||oe.operator===">"||oe.operator===">=",Y=Y||oe.operator==="<"||oe.operator==="<=",L){if(ee&&oe.semver.prerelease&&oe.semver.prerelease.length&&oe.semver.major===ee.major&&oe.semver.minor===ee.minor&&oe.semver.patch===ee.patch&&(ee=!1),oe.operator===">"||oe.operator===">="){if(V=h(L,oe,H),V===oe&&V!==L)return!1}else if(L.operator===">="&&!u(L.semver,String(oe),H))return!1}if(R){if(K&&oe.semver.prerelease&&oe.semver.prerelease.length&&oe.semver.major===K.major&&oe.semver.minor===K.minor&&oe.semver.patch===K.patch&&(K=!1),oe.operator==="<"||oe.operator==="<="){if(J=j(R,oe,H),J===oe&&J!==R)return!1}else if(R.operator==="<="&&!u(R.semver,String(oe),H))return!1}if(!oe.operator&&(R||L)&&N!==0)return!1}return!(L&&Y&&!R&&N!==0||R&&Z&&!L&&N!==0||ee||K)},h=(U,W,H)=>{if(!U)return W;const x=d(U.semver,W.semver,H);return x>0?U:x<0||W.operator===">"&&U.operator===">="?W:U},j=(U,W,H)=>{if(!U)return W;const x=d(U.semver,W.semver,H);return x<0?U:x>0||W.operator==="<"&&U.operator==="<="?W:U};t.exports=a}}),require_semver2=__commonJS({"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js"(e,t){var r=require_re(),s=require_constants(),o=require_semver(),u=require_identifiers(),d=require_parse(),a=require_valid(),l=require_clean(),f=require_inc(),C=require_diff(),h=require_major(),j=require_minor(),U=require_patch(),W=require_prerelease(),H=require_compare(),x=require_rcompare(),L=require_compare_loose(),R=require_compare_build(),N=require_sort(),V=require_rsort(),J=require_gt(),Y=require_lt(),Z=require_eq(),K=require_neq(),ee=require_gte(),oe=require_lte(),ce=require_cmp(),le=require_coerce(),ne=require_comparator(),ae=require_range(),_e=require_satisfies(),fe=require_to_comparators(),ge=require_max_satisfying(),he=require_min_satisfying(),X=require_min_version(),re=require_valid2(),Q=require_outside(),se=require_gtr(),Ce=require_ltr(),we=require_intersects(),Be=require_simplify(),Re=require_subset();t.exports={parse:d,valid:a,clean:l,inc:f,diff:C,major:h,minor:j,patch:U,prerelease:W,compare:H,rcompare:x,compareLoose:L,compareBuild:R,sort:N,rsort:V,gt:J,lt:Y,eq:Z,neq:K,gte:ee,lte:oe,cmp:ce,coerce:le,Comparator:ne,Range:ae,satisfies:_e,toComparators:fe,maxSatisfying:ge,minSatisfying:he,minVersion:X,validRange:re,outside:Q,gtr:se,ltr:Ce,intersects:we,simplifyRange:Be,subset:Re,SemVer:o,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:s.SEMVER_SPEC_VERSION,RELEASE_TYPES:s.RELEASE_TYPES,compareIdentifiers:u.compareIdentifiers,rcompareIdentifiers:u.rcompareIdentifiers}}}),CliForegroundColor=(e=>(e.Black="\x1B[30m",e.Red="\x1B[31m",e.Green="\x1B[32m",e.Yellow="\x1B[33m",e.Blue="\x1B[34m",e.Magenta="\x1B[35m",e.Cyan="\x1B[36m",e.White="\x1B[37m",e.Reset="\x1B[0m",e))(CliForegroundColor||{}),CliBackgroundColor=(e=>(e.Black="\x1B[40m",e.Red="\x1B[41m",e.Green="\x1B[42m",e.Yellow="\x1B[43m",e.Blue="\x1B[44m",e.Magenta="\x1B[45m",e.Cyan="\x1B[46m",e.White="\x1B[47m",e))(CliBackgroundColor||{}),CliIcon=(e=>(e.CheckIcon="✔",e.CrossIcon="✘",e.InfoIcon="ℹ",e.WarningIcon="⚠",e.QuestionMark="?",e.Exclamation="❗",e.Ellipsis="…",e.Dot="•",e.Bullet="‣",e.ArrowRight="→",e.ArrowLeft="←",e.ArrowUp="↑",e.ArrowDown="↓",e.ArrowRightFilled="▶",e.ArrowLeftFilled="◀",e.ArrowUpFilled="▲",e.ArrowDownFilled="▼",e.DoubleArrowRight="»",e.DoubleArrowLeft="«",e.Star="★",e.StarEmpty="☆",e.Plus="+",e.Minus="-",e.Progress="⏳",e.Success="✅",e.Failure="❌",e.Clock="⏰",e.Timer="⏱",e.Alarm="🔔",e.Calendar="📅",e.Folder="📁",e.FolderOpen="📂",e.File="📄",e.Archive="🗃",e.Link="🔗",e.Chain="⛓",e.Bookmark="🔖",e.Edit="✏",e.Trash="🗑",e.Add="➕",e.Remove="➖",e.Reload="🔄",e.Save="💾",e.Undo="↩",e.Redo="↪",e.Play="▶",e.Pause="⏸",e.Stop="⏹",e.Cancel="❎",e.User="👤",e.Group="👥",e.Lock="🔒",e.Unlock="🔓",e.Help="❓",e.Key="🔑",e.Shield="🛡",e.Gear="⚙",e.Settings="⚙️",e.Theme="🎨",e.Light="💡",e.Bug="🐞",e.Wrench="🔧",e.Hammer="🔨",e.Terminal="💻",e.Database="🗄",e.Server="🖥",e.Cloud="☁",e.Network="🌐",e.Monitor="📺",e.Printer="🖨",e.USB="🔌",e.Speaker="🔊",e.Microphone="🎙",e.Camera="📷",e.Video="🎥",e.Music="🎵",e.Phone="📞",e.Package="📦",e.Plugin="🧩",e.Extension="🔌",e.Module="🧱",e.Evaluate="🔍",e.Variable="𝑥",e.Script="📜",e.Code="📝",e.Logs="📋",e.Power="⏻",e.Heart="❤",e.Flame="🔥",e.Growth="📈",e.Decline="📉",e.WarningFilled="⚠️",e.Sun="☀",e.Moon="🌙",e.Rain="🌧",e.Snow="❄",e.Lightning="⚡",e.Tree="🌲",e.Smile="😊",e.Sad="😢",e.Angry="😡",e.Clap="👏",e.ThumbsUp="👍",e.ThumbsDown="👎",e.Rocket="🚀",e.Globe="🌍",e.Medal="🏅",e.Trophy="🏆",e.Flag="🚩",e.StarFilled="⭐",e.StarOutline="✩",e.Fireworks="🎆",e.Balloon="🎈",e.Gift="🎁",e))(CliIcon||{}),ICliCompletionProvider_TOKEN="cli-completion-provider",ICliDragDropService_TOKEN="cli-drag-drop-service",ICliTranslationService_TOKEN="cli-translation-service",ICliAuthorizationService_TOKEN="cli-authorization-service",ICliPermissionRegistry_TOKEN="cli-permission-registry",ICliServerAuthTokenProvider_TOKEN="cli-server-auth-token-provider",ICliServerAuthService_TOKEN="cli-server-auth-service";function resolveHeaders(e){return e?typeof e=="function"?e():e:{}}var CliLogLevel=(e=>(e[e.None=0]="None",e[e.DEBUG=1]="DEBUG",e[e.LOG=2]="LOG",e[e.INFO=3]="INFO",e[e.WARN=4]="WARN",e[e.ERROR=5]="ERROR",e))(CliLogLevel||{}),enums={CliForegroundColor,CliBackgroundColor,CliIcon,CliLogLevel},ICliCommandGuard_TOKEN="cli-command-guard";function cliPermissionMatches(e,t){const r=e.trim().toLowerCase().split(":"),s=t.trim().toLowerCase().split(":");for(let o=0;o<r.length;o++){if(r[o]==="*"&&o===r.length-1)return!0;if(o>=s.length||r[o]!=="*"&&r[o]!==s[o])return!1}return r.length===s.length}function cliHasPermission(e,t){return!!(e!=null&&e.some(r=>cliPermissionMatches(r,t)))}function cliMissingPermissions(e,t){return t.filter(r=>!cliHasPermission(e,r))}var CliServerPermissions={ShellExecute:"shell:execute"},CliAccessDeniedError=class ac extends Error{constructor(t="permission denied"){super(t),this.code="EACCES",this.name="CliAccessDeniedError",Object.setPrototypeOf(this,ac.prototype)}};function isCliAccessDeniedError(e){return e instanceof CliAccessDeniedError||!!e&&typeof e=="object"&&e.name==="CliAccessDeniedError"}var CliHttpError=class lc extends Error{constructor(t,r,s="",o){super(t),this.status=r,this.statusText=s,this.body=o,this.name="CliHttpError",Object.setPrototypeOf(this,lc.prototype)}},DefaultLibraryAuthor={name:"Nicolae Lupei",email:"nicolae.lupei@qodalis.com"},constants={DefaultLibraryAuthor},delay=e=>new Promise(t=>setTimeout(t,e)),ObjectDescriber=class{static describe(e,t){var d,a;const{filter:r}=t||{},s=[],u=Object.keys(e).filter(l=>typeof e[l]=="function");for(const l of u){const f=e[l],C=this.getFunctionArguments(f);if(r&&!r({funcName:l,func:f,args:C}))continue;const h=C.length>1,j=this.supportsDynamicArgs(f);if(C.length===0&&!j||C.length>0&&C.some(W=>W==="function"||W==="func"))continue;const U={command:l,description:`A command that executes the function ${l} with the provided arguments`,acceptsRawInput:!0,valueRequired:!0,parameters:[{name:"debug",description:"Debug",type:"boolean",required:!1}],processCommand:async(W,H)=>{const x=W.args.debug;x&&(H.writer.writeln("Executing command: "+l),H.writer.writeln("Arguments: "+JSON.stringify(W.args)),H.writer.writeln("Function: "+f.toString()));const L=[];if(h)for(const N of C.slice(1))L.push(W.args[N]);if(j&&W.value){const N=W.args.delimiter||",";L.push(...W.value.split(N))}x&&H.writer.writeln("Arguments after processing: "+JSON.stringify(L));const R=j&&C.length===0?f(...L):f(W.value,...L);H.writer.write(H.writer.wrapInColor("Result: ","\x1B[33m")),R===null?H.writer.writeln("null"):R===void 0?H.writer.writeln("undefined"):typeof R=="boolean"||typeof R=="number"?H.writer.writeln(R.toString()):Array.isArray(R)?H.writer.writeJson(R):typeof R=="string"?H.writer.writeln(R):typeof R=="object"?H.writer.writeJson(R):H.writer.writeln(R==null?void 0:R.toString()),H.process.output(R==null?void 0:R.toString())},writeDescription:W=>{W.writer.writeln(l)}};j&&((d=U.parameters)==null||d.push({name:"delimiter",description:"Delimiter",type:"string",required:!1})),h&&((a=U.parameters)==null||a.push(...C.slice(1).map(W=>({name:W,description:W,type:"string",required:!1})))),s.push(U)}return s}static supportsDynamicArgs(e){return e.toString().includes("arguments")}static getFunctionArguments(e){const r=e.toString().match(/\(([^)]*)\)/);return r?r[1].split(",").map(s=>s.trim()).filter(s=>s!==""):[]}},CLI_CONFIGURE_STORE_NAME="configure";function getConfigValue(e,t,r,s){var o;try{const u=e.getState(),d=t==="system"?u==null?void 0:u.system:(o=u==null?void 0:u.plugins)==null?void 0:o[t];if(d&&r in d)return d[r]}catch{}return s}function getPluginConfigValue(e,t,r,s){try{const o=e.services.getRequired("cli-state-store-manager");if(!o)return s;const u=o.getStateStore(CLI_CONFIGURE_STORE_NAME);return u?getConfigValue(u,t,r,s):s}catch{return s}}function resolveConfigurationCategories(e){const t=new Map;for(const r of e.processors)if(r.configurationOptions&&r.configurationOptions.length>0)for(const s of r.configurationOptions){const o=s.category||r.command;t.has(o)||t.set(o,{processorCommand:r.command,options:[]}),t.get(o).options.push(s)}return t}var clearTerminalLine=(e,t)=>{if(t<=0)return;const r=Math.ceil(t/e.cols);for(let s=0;s<r;s++)e.write("\x1B[2K"),s<r-1&&e.write("\x1B[A");e.write("\r")},semver=__toESM(require_semver2());function satisfiesVersionRange(e,t){if(!t)return!0;const r=semver.coerce(e);return r?semver.valid(t)?semver.gte(r,semver.coerce(t)):semver.satisfies(r,t):!1}var LIBRARY_VERSION$1="2.0.0-beta.14",API_VERSION$1=2,VERSIONS_ENDPOINT="/api/qcli/versions",ls,ServerVersionNegotiator=(ls=class{static negotiate(t){const r=this.CLIENT_SUPPORTED_VERSIONS.filter(s=>t.supportedVersions.includes(s));return r.length>0?Math.max(...r):null}static async discover(t,r){try{const s=resolveHeaders(r),o=await fetch(`${t}${VERSIONS_ENDPOINT}`,{headers:Object.keys(s).length>0?s:void 0});if(!o.ok)return null;const u=await o.json(),d=this.negotiate(u);return d===null?null:{apiVersion:d,basePath:`${t}/api/v${d}/qcli`}}catch{return null}}},ls.CLIENT_SUPPORTED_VERSIONS=[API_VERSION$1],ls);function buildAuthenticatedWebSocketUrl(e,t){const r=resolveHeaders(t);if(Object.keys(r).length===0)return e;const s=e.includes("?")?"&":"?",o=Object.entries(r).map(([u,d])=>`_header_${encodeURIComponent(u)}=${encodeURIComponent(d)}`).join("&");return`${e}${s}${o}`}function appendQueryParams(e,t){const r=Object.entries(t);if(!r.length)return e;const s=r.map(([o,u])=>`${encodeURIComponent(o)}=${encodeURIComponent(u)}`).join("&");return`${e}${e.includes("?")?"&":"?"}${s}`}function hexToRgb$1(e){const t=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/.exec(e);if(!t)return null;const r=parseInt(t[1],16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function shiftColor(e,t){const r=hexToRgb$1(e);if(!r)return e;const s=Math.min(255,Math.max(0,r.r+Math.round(t))),o=Math.min(255,Math.max(0,r.g+Math.round(t))),u=Math.min(255,Math.max(0,r.b+Math.round(t)));return`#${s.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}`}function hexToRgba(e,t){const r=hexToRgb$1(e);return r?`rgba(${r.r}, ${r.g}, ${r.b}, ${t})`:e}var DEFAULT_BG="#111827",DEFAULT_FG="#ffffff",DEFAULT_ACCENT="#818cf8";function derivePanelThemeStyles(e){const t=e.background||DEFAULT_BG,r=e.foreground||DEFAULT_FG,s=e.cyan||e.blue||e.magenta||DEFAULT_ACCENT;return{"--cli-panel-bg":t,"--cli-panel-header-bg":shiftColor(t,12),"--cli-panel-border":shiftColor(t,24),"--cli-panel-text":r,"--cli-panel-text-secondary":hexToRgba(r,.6),"--cli-panel-accent":s,"--cli-btn-hover-bg":hexToRgba(s,.12),"--cli-btn-active-bg":hexToRgba(s,.2)}}var STORAGE_KEY="cli-panel-position",POSITION_CYCLE=["bottom","right","top","left"];function loadPanelPosition(){try{const e=localStorage.getItem(STORAGE_KEY);if(e&&POSITION_CYCLE.includes(e))return e}catch{}return null}function savePanelPosition(e){try{localStorage.setItem(STORAGE_KEY,e)}catch{}}var ANSI_RE=/\x1b\[[0-9;]*m/g;function stripAnsi(e){return e.replace(ANSI_RE,"")}function visibleLength(e){const t=stripAnsi(e);let r=0;for(const s of t){const o=s.codePointAt(0);o>=65024&&o<=65039||o!==8205&&(o>=768&&o<=879||(r+=isWideCharacter(o)?2:1))}return r}function isWideCharacter(e){return e>=126976||e>=9728&&e<=10175||e>=9984&&e<=10175||e>=19968&&e<=40959||e>=63744&&e<=64255||e>=65281&&e<=65376||e>=65504&&e<=65510||e>=11904&&e<=12255||e>=12288&&e<=12543||e>=12800&&e<=13055||e>=13056&&e<=13311||e>=127232&&e<=127487||e>=8960&&e<=9215}var list=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim()):[],authorization=e=>{try{return e.services.get(ICliAuthorizationService_TOKEN)}catch{return}};function chain(e){const t=[];let r=e;for(;r&&t.length<32&&!t.includes(r);)t.push(r),r=r.parent;return t}var requiredPermissionsOf=e=>[...new Set(chain(e).flatMap(t=>{var r;return list((r=t.metadata)==null?void 0:r.requiredPermissions)}))],requiredGroupLevels=e=>chain(e).map(t=>{var r;return list((r=t.metadata)==null?void 0:r.requiredGroups)}).filter(t=>t.length>0),needsAuth=e=>chain(e).some(t=>{var r;return((r=t.metadata)==null?void 0:r.requireAuth)===!0})||requiredGroupLevels(e).length>0||requiredPermissionsOf(e).length>0,cliRequireAuthGuard={name:"access:require-auth",priority:-100,appliesTo:(e,t,r)=>needsAuth(e)&&!!authorization(r),canActivate:(e,t,r)=>authorization(r).getPrincipal()?!0:`${t.command}: login required`},cliRequiredGroupsGuard={name:"access:required-groups",priority:-90,appliesTo:(e,t,r)=>requiredGroupLevels(e).length>0&&!!authorization(r),canActivate:(e,t,r)=>{const s=authorization(r),o=s.getPrincipal();if(!o)return`${t.command}: login required`;if(s.can("*"))return!0;for(const u of requiredGroupLevels(t))if(!u.some(a=>o.groups.some(l=>l.toLowerCase()===a.toLowerCase())))return`${t.command}: permission denied (requires group: ${u.join(" or ")})`;return!0}},cliRequiredPermissionsGuard={name:"access:required-permissions",priority:-80,appliesTo:(e,t,r)=>requiredPermissionsOf(e).length>0&&!!authorization(r),canActivate:(e,t,r)=>{const s=authorization(r).getPrincipal();if(!s)return`${t.command}: login required`;const o=cliMissingPermissions(s.permissions,requiredPermissionsOf(t));return o.length===0?!0:`${t.command}: permission denied (requires ${o.join(", ")})`}},cliAccessMetadataGuards=[cliRequireAuthGuard,cliRequiredGroupsGuard,cliRequiredPermissionsGuard],getParameterValue=(e,t)=>{var s;if(t[e.name]!==void 0)return t[e.name];const r=(s=e.aliases)==null?void 0:s.find(o=>t[o]!==void 0);return r?t[r]:void 0},formatJson=e=>{const t=JSON.stringify(e,null,2);return colorizeJson(t.split(`
|
|
70
|
-
`).join(`\r
|
|
71
|
-
`))},colorizeJson=e=>{const t="\x1B[0m",r="\x1B[36m",s="\x1B[32m",o="\x1B[33m",u="\x1B[90m",d=/("(?:[^"\\]|\\.)*"?)(\s*:)?|(\btrue\b|\bfalse\b|\bnull\b)|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)|([{}[\],])/g;let a="",l=0,f;for(;(f=d.exec(e))!==null;)f.index>l&&(a+=e.slice(l,f.index)),f[1]!==void 0?f[2]!==void 0?a+=r+f[1]+t+f[2]:a+=s+f[1]+t:f[3]!==void 0?a+=o+f[3]+t:f[4]!==void 0?a+=o+f[4]+t:f[5]!==void 0&&(a+=u+f[5]+t),l=f.index+f[0].length;return l<e.length&&(a+=e.slice(l)),a},toQueryString=e=>{const t=new URLSearchParams;for(const[r,s]of Object.entries(e))Array.isArray(s)?s.forEach(o=>t.append(r,o.toString())):s!=null&&t.append(r,s.toString());return t.toString()},highlightTextWithBg=(e,t,r="\x1B[43m")=>e.replace(t,s=>`${r}${s}\x1B[0m`),getRightOfWord=(e,t)=>{const r=e.indexOf(t);if(r!==-1)return e.slice(r+t.length).trim()},colorFirstWord=(e,t)=>{if(!e)return e;const r=e.match(/^(\s*)(\S+)(.*)$/);if(!r)return e;const[,s,o,u]=r,d=t(o);return`${s}${d}${u}`},utils={getParameterValue,formatJson,colorizeJson,toQueryString,highlightTextWithBg,getRightOfWord,colorFirstWord,ObjectDescriber,delay,getConfigValue,getPluginConfigValue,resolveConfigurationCategories,CLI_CONFIGURE_STORE_NAME},CliModuleRegistry=class{constructor(){this.modules=new Map,this.bootHandlers=[]}onModuleBoot(e){this.bootHandlers.push(e)}async register(e){const t=e.apiVersion;if(typeof t!="number"||t<API_VERSION$1){const r=`[CLI] Plugin "${e.name}" targets API version ${t??"unknown"}, but this runtime requires API version ${API_VERSION$1}. Skipping.`;this.onWarn?this.onWarn(r):console.warn(r);return}this.modules.set(e.name,e);for(const r of this.bootHandlers)try{await r(e)}catch(s){const o=`[CLI] Boot handler failed for module "${e.name}": ${s instanceof Error?s.message:s}`;this.onWarn?this.onWarn(o):console.warn(o)}}getModule(e){return this.modules.get(e)}getAll(){return Array.from(this.modules.values())}track(e){this.modules.set(e.name,e)}has(e){return this.modules.has(e)}},initializeBrowserEnvironment=({context:e,registry:t})=>{window.__cliModuleRegistry=t,window.cliCore={...constants,...utils,...enums,bootCliModule,bootUmdModule},Object.defineProperty(window,"ngCore",{configurable:!0,get(){return console.warn("CLI: Angular decorators are not supported in UMD modules. Use plain classes instead."),{Injectable:()=>()=>{}}}})},bootCliModule=async e=>{typeof window<"u"&&window.__cliModuleRegistry&&await window.__cliModuleRegistry.register(e)},bootUmdModule=async e=>{await bootCliModule(e)},CANCELLATION_ERROR_MESSAGE="Promise cancelled",CancellablePromise=class{constructor(e){this.executor=e,this.hasCancelled=!1,this.abortController=new AbortController}execute(){return new Promise((e,t)=>{this.abortController.signal.onabort=()=>{t(new Error(CANCELLATION_ERROR_MESSAGE))},this.executor(r=>{this.hasCancelled||e(r)},r=>{this.hasCancelled||t(r)})})}cancel(){this.hasCancelled=!0,this.abortController.abort()}},DefaultThemes={default:{background:"#070b14",foreground:"#dee2ea",cursor:"#818cf8",selectionBackground:"#334155",selectionForeground:"#ffffff",black:"#0d1117",red:"#f87171",green:"#4ade80",yellow:"#fbbf24",blue:"#818cf8",magenta:"#c084fc",cyan:"#67e8f9",white:"#dee2ea",brightBlack:"#475569",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde68a",brightBlue:"#a5b4fc",brightMagenta:"#d8b4fe",brightCyan:"#a5f3fc",brightWhite:"#f1f5f9"},classic:{background:"#0c0c0c",foreground:"#cccccc",cursor:"#cccccc",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#0c0c0c",red:"#c50f1f",green:"#13a10e",yellow:"#c19c00",blue:"#0037da",magenta:"#881798",cyan:"#3a96dd",white:"#cccccc",brightBlack:"#767676",brightRed:"#e74856",brightGreen:"#16c60c",brightYellow:"#f9f1a5",brightBlue:"#3b78ff",brightMagenta:"#b4009e",brightCyan:"#61d6d6",brightWhite:"#f2f2f2"},dracula:{background:"#282A36",foreground:"#F8F8F2",cursor:"#50FA7B",black:"#21222C",red:"#FF5555",green:"#50FA7B",yellow:"#F1FA8C",blue:"#BD93F9",magenta:"#FF79C6",cyan:"#8BE9FD",white:"#F8F8F2",brightBlack:"#6272A4",brightRed:"#FF6E6E",brightGreen:"#69FF94",brightYellow:"#FFFFA5",brightBlue:"#D6ACFF",brightMagenta:"#FF92D0",brightCyan:"#A4FFFF",brightWhite:"#FFFFFF"},monokai:{background:"#272822",foreground:"#F8F8F2",cursor:"#F8F8F0",black:"#272822",red:"#F92672",green:"#A6E22E",yellow:"#F4BF75",blue:"#66D9EF",magenta:"#AE81FF",cyan:"#A1EFE4",white:"#F8F8F2",brightBlack:"#75715E",brightRed:"#F92672",brightGreen:"#A6E22E",brightYellow:"#F4BF75",brightBlue:"#66D9EF",brightMagenta:"#AE81FF",brightCyan:"#A1EFE4",brightWhite:"#F9F8F5"},solarizedDark:{background:"#002B36",foreground:"#839496",cursor:"#93A1A1",black:"#073642",red:"#DC322F",green:"#859900",yellow:"#B58900",blue:"#268BD2",magenta:"#D33682",cyan:"#2AA198",white:"#EEE8D5",brightBlack:"#002B36",brightRed:"#CB4B16",brightGreen:"#586E75",brightYellow:"#657B83",brightBlue:"#839496",brightMagenta:"#6C71C4",brightCyan:"#93A1A1",brightWhite:"#FDF6E3"},solarizedLight:{background:"#FDF6E3",foreground:"#657B83",cursor:"#586E75",black:"#073642",red:"#DC322F",green:"#859900",yellow:"#B58900",blue:"#268BD2",magenta:"#D33682",cyan:"#2AA198",white:"#EEE8D5",brightBlack:"#002B36",brightRed:"#CB4B16",brightGreen:"#586E75",brightYellow:"#657B83",brightBlue:"#839496",brightMagenta:"#6C71C4",brightCyan:"#93A1A1",brightWhite:"#FDF6E3"},gruvboxDark:{background:"#282828",foreground:"#EBDBB2",cursor:"#EBDBB2",black:"#282828",red:"#CC241D",green:"#98971A",yellow:"#D79921",blue:"#458588",magenta:"#B16286",cyan:"#689D6A",white:"#A89984",brightBlack:"#928374",brightRed:"#FB4934",brightGreen:"#B8BB26",brightYellow:"#FABD2F",brightBlue:"#83A598",brightMagenta:"#D3869B",brightCyan:"#8EC07C",brightWhite:"#EBDBB2"},gruvboxLight:{background:"#FBF1C7",foreground:"#3C3836",cursor:"#3C3836",black:"#FBF1C7",red:"#9D0006",green:"#79740E",yellow:"#B57614",blue:"#076678",magenta:"#8F3F71",cyan:"#427B58",white:"#3C3836",brightBlack:"#D5C4A1",brightRed:"#AF3A03",brightGreen:"#B8BB26",brightYellow:"#FABD2F",brightBlue:"#83A598",brightMagenta:"#D3869B",brightCyan:"#8EC07C",brightWhite:"#EBDBB2"},nord:{background:"#2E3440",foreground:"#D8DEE9",cursor:"#88C0D0",black:"#3B4252",red:"#BF616A",green:"#A3BE8C",yellow:"#EBCB8B",blue:"#81A1C1",magenta:"#B48EAD",cyan:"#88C0D0",white:"#E5E9F0",brightBlack:"#4C566A",brightRed:"#BF616A",brightGreen:"#A3BE8C",brightYellow:"#EBCB8B",brightBlue:"#81A1C1",brightMagenta:"#B48EAD",brightCyan:"#8FBCBB",brightWhite:"#ECEFF4"},oneDark:{background:"#282C34",foreground:"#ABB2BF",cursor:"#528BFF",black:"#282C34",red:"#E06C75",green:"#98C379",yellow:"#E5C07B",blue:"#61AFEF",magenta:"#C678DD",cyan:"#56B6C2",white:"#ABB2BF",brightBlack:"#5C6370",brightRed:"#E06C75",brightGreen:"#98C379",brightYellow:"#E5C07B",brightBlue:"#61AFEF",brightMagenta:"#C678DD",brightCyan:"#56B6C2",brightWhite:"#FFFFFF"},material:{background:"#263238",foreground:"#ECEFF1",cursor:"#FFCC00",black:"#263238",red:"#F07178",green:"#C3E88D",yellow:"#FFCB6B",blue:"#82AAFF",magenta:"#C792EA",cyan:"#89DDFF",white:"#EEFFFF",brightBlack:"#546E7A",brightRed:"#F07178",brightGreen:"#C3E88D",brightYellow:"#FFCB6B",brightBlue:"#82AAFF",brightMagenta:"#C792EA",brightCyan:"#89DDFF",brightWhite:"#FFFFFF"},highContrastLight:{background:"#FFFACD",foreground:"#000000",cursor:"#FFA500",selectionBackground:"#FFD700",black:"#3B3A32",red:"#D32F2F",green:"#388E3C",yellow:"#FBC02D",blue:"#1976D2",magenta:"#8E24AA",cyan:"#0097A7",white:"#FFFFFF",brightBlack:"#616161",brightRed:"#FF5252",brightGreen:"#69F0AE",brightYellow:"#FFEB3B",brightBlue:"#64B5F6",brightMagenta:"#BA68C8",brightCyan:"#4DD0E1",brightWhite:"#FAFAFA"},tokyoNight:{background:"#1a1b26",foreground:"#c0caf5",cursor:"#c0caf5",selectionBackground:"#33467c",black:"#15161e",red:"#f7768e",green:"#9ece6a",yellow:"#e0af68",blue:"#7aa2f7",magenta:"#bb9af7",cyan:"#7dcfff",white:"#a9b1d6",brightBlack:"#414868",brightRed:"#f7768e",brightGreen:"#9ece6a",brightYellow:"#e0af68",brightBlue:"#7aa2f7",brightMagenta:"#bb9af7",brightCyan:"#7dcfff",brightWhite:"#c0caf5"},catppuccinMocha:{background:"#1e1e2e",foreground:"#cdd6f4",cursor:"#f5e0dc",selectionBackground:"#45475a",black:"#45475a",red:"#f38ba8",green:"#a6e3a1",yellow:"#f9e2af",blue:"#89b4fa",magenta:"#f5c2e7",cyan:"#94e2d5",white:"#bac2de",brightBlack:"#585b70",brightRed:"#f38ba8",brightGreen:"#a6e3a1",brightYellow:"#f9e2af",brightBlue:"#89b4fa",brightMagenta:"#f5c2e7",brightCyan:"#94e2d5",brightWhite:"#a6adc8"},catppuccinFrappe:{background:"#303446",foreground:"#c6d0f5",cursor:"#f2d5cf",selectionBackground:"#51576d",black:"#51576d",red:"#e78284",green:"#a6d189",yellow:"#e5c890",blue:"#8caaee",magenta:"#f4b8e4",cyan:"#81c8be",white:"#b5bfe2",brightBlack:"#626880",brightRed:"#e78284",brightGreen:"#a6d189",brightYellow:"#e5c890",brightBlue:"#8caaee",brightMagenta:"#f4b8e4",brightCyan:"#81c8be",brightWhite:"#a5adce"},rosePine:{background:"#191724",foreground:"#e0def4",cursor:"#524f67",selectionBackground:"#2a283e",black:"#26233a",red:"#eb6f92",green:"#31748f",yellow:"#f6c177",blue:"#9ccfd8",magenta:"#c4a7e7",cyan:"#ebbcba",white:"#e0def4",brightBlack:"#6e6a86",brightRed:"#eb6f92",brightGreen:"#31748f",brightYellow:"#f6c177",brightBlue:"#9ccfd8",brightMagenta:"#c4a7e7",brightCyan:"#ebbcba",brightWhite:"#e0def4"},kanagawa:{background:"#1f1f28",foreground:"#dcd7ba",cursor:"#c8c093",selectionBackground:"#2d4f67",black:"#16161d",red:"#c34043",green:"#76946a",yellow:"#c0a36e",blue:"#7e9cd8",magenta:"#957fb8",cyan:"#6a9589",white:"#c8c093",brightBlack:"#727169",brightRed:"#e82424",brightGreen:"#98bb6c",brightYellow:"#e6c384",brightBlue:"#7fb4ca",brightMagenta:"#938aa9",brightCyan:"#7aa89f",brightWhite:"#dcd7ba"},everforestDark:{background:"#2d353b",foreground:"#d3c6aa",cursor:"#d3c6aa",selectionBackground:"#543a48",black:"#475258",red:"#e67e80",green:"#a7c080",yellow:"#dbbc7f",blue:"#7fbbb3",magenta:"#d699b6",cyan:"#83c092",white:"#d3c6aa",brightBlack:"#475258",brightRed:"#e67e80",brightGreen:"#a7c080",brightYellow:"#dbbc7f",brightBlue:"#7fbbb3",brightMagenta:"#d699b6",brightCyan:"#83c092",brightWhite:"#d3c6aa"},ayuDark:{background:"#0b0e14",foreground:"#bfbdb6",cursor:"#e6b450",selectionBackground:"#1b3a4b",black:"#01060e",red:"#ea6c73",green:"#91b362",yellow:"#f9af4f",blue:"#53bdfa",magenta:"#fae994",cyan:"#90e1c6",white:"#c7c7c7",brightBlack:"#686868",brightRed:"#f07178",brightGreen:"#c2d94c",brightYellow:"#ffb454",brightBlue:"#59c2ff",brightMagenta:"#ffee99",brightCyan:"#95e6cb",brightWhite:"#ffffff"},catppuccinLatte:{background:"#eff1f5",foreground:"#4c4f69",cursor:"#dc8a78",selectionBackground:"#acb0be",black:"#5c5f77",red:"#d20f39",green:"#40a02b",yellow:"#df8e1d",blue:"#1e66f5",magenta:"#ea76cb",cyan:"#179299",white:"#acb0be",brightBlack:"#6c6f85",brightRed:"#d20f39",brightGreen:"#40a02b",brightYellow:"#df8e1d",brightBlue:"#1e66f5",brightMagenta:"#ea76cb",brightCyan:"#179299",brightWhite:"#bcc0cc"},rosePineDawn:{background:"#faf4ed",foreground:"#575279",cursor:"#9893a5",selectionBackground:"#dfdad9",black:"#f2e9e1",red:"#b4637a",green:"#286983",yellow:"#ea9d34",blue:"#56949f",magenta:"#907aa9",cyan:"#d7827e",white:"#575279",brightBlack:"#9893a5",brightRed:"#b4637a",brightGreen:"#286983",brightYellow:"#ea9d34",brightBlue:"#56949f",brightMagenta:"#907aa9",brightCyan:"#d7827e",brightWhite:"#575279"},everforestLight:{background:"#fdf6e3",foreground:"#5c6a72",cursor:"#5c6a72",selectionBackground:"#e6e2cc",black:"#5c6a72",red:"#f85552",green:"#8da101",yellow:"#dfa000",blue:"#3a94c5",magenta:"#df69ba",cyan:"#35a77c",white:"#dfddc8",brightBlack:"#708089",brightRed:"#f85552",brightGreen:"#8da101",brightYellow:"#dfa000",brightBlue:"#3a94c5",brightMagenta:"#df69ba",brightCyan:"#35a77c",brightWhite:"#e8e5d0"},githubLight:{background:"#ffffff",foreground:"#24292f",cursor:"#044289",selectionBackground:"#0969da33",black:"#24292f",red:"#cf222e",green:"#116329",yellow:"#4d2d00",blue:"#0969da",magenta:"#8250df",cyan:"#1b7c83",white:"#6e7781",brightBlack:"#57606a",brightRed:"#a40e26",brightGreen:"#1a7f37",brightYellow:"#633c01",brightBlue:"#218bff",brightMagenta:"#a475f9",brightCyan:"#3192aa",brightWhite:"#8c959f"},cyberpunk:{background:"#0a0a1a",foreground:"#0abdc6",cursor:"#ff2079",selectionBackground:"#1a1a3a",black:"#000000",red:"#ff2079",green:"#00ff9c",yellow:"#fed230",blue:"#0abdc6",magenta:"#ea00d9",cyan:"#0abdc6",white:"#c7c7c7",brightBlack:"#686868",brightRed:"#ff4a9e",brightGreen:"#3df5b6",brightYellow:"#fef465",brightBlue:"#3ff1de",brightMagenta:"#ff79f0",brightCyan:"#3ff1de",brightWhite:"#ffffff"},retroGreen:{background:"#0a0a0a",foreground:"#33ff00",cursor:"#33ff00",selectionBackground:"#1a3a1a",black:"#0a0a0a",red:"#ff0000",green:"#33ff00",yellow:"#ffff00",blue:"#0066ff",magenta:"#cc00ff",cyan:"#00ffff",white:"#33ff00",brightBlack:"#1a5c1a",brightRed:"#ff3333",brightGreen:"#66ff33",brightYellow:"#ffff66",brightBlue:"#3399ff",brightMagenta:"#e550ff",brightCyan:"#66ffff",brightWhite:"#66ff33"},retroAmber:{background:"#0a0a00",foreground:"#ffb000",cursor:"#ffb000",selectionBackground:"#3a2a00",black:"#0a0a00",red:"#ff0000",green:"#ffb000",yellow:"#ffcc00",blue:"#cc8800",magenta:"#ff8800",cyan:"#ffcc66",white:"#ffb000",brightBlack:"#665500",brightRed:"#ff3333",brightGreen:"#ffc033",brightYellow:"#ffdd33",brightBlue:"#ddaa33",brightMagenta:"#ffaa33",brightCyan:"#ffdd99",brightWhite:"#ffc033"},matrix:{background:"#000000",foreground:"#00ff41",cursor:"#00ff41",selectionBackground:"#003300",black:"#000000",red:"#00ff41",green:"#00ff41",yellow:"#00ff41",blue:"#00cc33",magenta:"#009926",cyan:"#00ff41",white:"#00ff41",brightBlack:"#005500",brightRed:"#33ff66",brightGreen:"#33ff66",brightYellow:"#33ff66",brightBlue:"#00ff41",brightMagenta:"#00cc33",brightCyan:"#33ff66",brightWhite:"#66ff88"},synthwave:{background:"#2b213a",foreground:"#f0e4fc",cursor:"#72f1b8",selectionBackground:"#463465",black:"#2b213a",red:"#fe4450",green:"#72f1b8",yellow:"#fede5d",blue:"#2ee2fa",magenta:"#ff7edb",cyan:"#03edf9",white:"#f0e4fc",brightBlack:"#614d85",brightRed:"#fe4450",brightGreen:"#72f1b8",brightYellow:"#fede5d",brightBlue:"#2ee2fa",brightMagenta:"#ff7edb",brightCyan:"#03edf9",brightWhite:"#ffffff"},highContrastDark:{background:"#000000",foreground:"#ffffff",cursor:"#ffffff",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#000000",red:"#ff0000",green:"#00ff00",yellow:"#ffff00",blue:"#3b78ff",magenta:"#ff00ff",cyan:"#00ffff",white:"#ffffff",brightBlack:"#808080",brightRed:"#ff3333",brightGreen:"#33ff33",brightYellow:"#ffff33",brightBlue:"#6699ff",brightMagenta:"#ff33ff",brightCyan:"#33ffff",brightWhite:"#ffffff"}};DefaultThemes.yellow=DefaultThemes.highContrastLight;var DefaultThemeInfos={default:{theme:DefaultThemes.default,category:"dark",tags:["built-in"],description:"Dark indigo theme with soft pastels"},classic:{theme:DefaultThemes.classic,category:"dark",tags:["built-in"],description:"Classic Windows terminal palette"},dracula:{theme:DefaultThemes.dracula,category:"dark",tags:["popular"],description:"Popular dark theme with vibrant colors"},monokai:{theme:DefaultThemes.monokai,category:"dark",tags:["popular"],description:"Classic code editor dark theme"},solarizedDark:{theme:DefaultThemes.solarizedDark,category:"dark",tags:["popular"],description:"Ethan Schoonover's precision dark palette"},solarizedLight:{theme:DefaultThemes.solarizedLight,category:"light",tags:["popular"],description:"Ethan Schoonover's precision light palette"},gruvboxDark:{theme:DefaultThemes.gruvboxDark,category:"dark",tags:["popular"],description:"Retro groove dark color scheme"},gruvboxLight:{theme:DefaultThemes.gruvboxLight,category:"light",tags:["popular"],description:"Retro groove light color scheme"},nord:{theme:DefaultThemes.nord,category:"dark",tags:["popular"],description:"Arctic, north-bluish clean palette"},oneDark:{theme:DefaultThemes.oneDark,category:"dark",tags:["popular"],description:"Atom's iconic dark theme"},material:{theme:DefaultThemes.material,category:"dark",tags:["popular"],description:"Material Design inspired dark theme"},highContrastLight:{theme:DefaultThemes.highContrastLight,category:"light",tags:["accessibility"],description:"High contrast light theme for accessibility"},tokyoNight:{theme:DefaultThemes.tokyoNight,category:"dark",tags:["popular"],description:"Cool blue-purple dark theme"},catppuccinMocha:{theme:DefaultThemes.catppuccinMocha,category:"dark",tags:["popular","pastel"],description:"Soothing pastel dark theme (warmest)"},catppuccinFrappe:{theme:DefaultThemes.catppuccinFrappe,category:"dark",tags:["popular","pastel"],description:"Soothing pastel mid-dark theme"},catppuccinLatte:{theme:DefaultThemes.catppuccinLatte,category:"light",tags:["popular","pastel"],description:"Soothing pastel light theme"},rosePine:{theme:DefaultThemes.rosePine,category:"dark",tags:["popular"],description:"All natural pine, faux fur, and a bit of soho vibes"},rosePineDawn:{theme:DefaultThemes.rosePineDawn,category:"light",tags:["popular"],description:"Rose Pine light variant"},kanagawa:{theme:DefaultThemes.kanagawa,category:"dark",tags:["popular"],description:"Dark theme inspired by Katsushika Hokusai"},everforestDark:{theme:DefaultThemes.everforestDark,category:"dark",tags:["popular"],description:"Comfortable green-tinted dark theme"},everforestLight:{theme:DefaultThemes.everforestLight,category:"light",tags:["popular"],description:"Comfortable green-tinted light theme"},ayuDark:{theme:DefaultThemes.ayuDark,category:"dark",tags:["popular"],description:"Simple, bright and elegant dark theme"},githubLight:{theme:DefaultThemes.githubLight,category:"light",tags:["popular"],description:"GitHub's clean light interface theme"},cyberpunk:{theme:DefaultThemes.cyberpunk,category:"dark",tags:["retro","fun"],description:"Neon-lit cyberpunk aesthetic"},retroGreen:{theme:DefaultThemes.retroGreen,category:"dark",tags:["retro","fun"],description:"Classic green phosphor CRT monitor"},retroAmber:{theme:DefaultThemes.retroAmber,category:"dark",tags:["retro","fun"],description:"Warm amber CRT monitor"},matrix:{theme:DefaultThemes.matrix,category:"dark",tags:["retro","fun"],description:"Enter the Matrix - green on black"},synthwave:{theme:DefaultThemes.synthwave,category:"dark",tags:["retro","fun"],description:"80s synthwave purple/pink aesthetic"},highContrastDark:{theme:DefaultThemes.highContrastDark,category:"dark",tags:["accessibility"],description:"Maximum contrast dark theme"}},extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(r[o]=s[o])},extendStatics(e,t)};function __extends(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function __values(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],s=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&s>=e.length&&(e=void 0),{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var s=r.call(e),o,u=[],d;try{for(;(t===void 0||t-- >0)&&!(o=s.next()).done;)u.push(o.value)}catch(a){d={error:a}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(d)throw d.error}}return u}function __spreadArray(e,t,r){if(r||arguments.length===2)for(var s=0,o=t.length,u;s<o;s++)(u||!(s in t))&&(u||(u=Array.prototype.slice.call(t,0,s)),u[s]=t[s]);return e.concat(u||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function isFunction(e){return typeof e=="function"}function createErrorClass(e){var t=function(s){Error.call(s),s.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var UnsubscriptionError=createErrorClass(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
72
|
-
`+r.map(function(s,o){return o+1+") "+s.toString()}).join(`
|
|
73
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});function arrRemove(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Subscription=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,s,o,u;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var a=__values(d),l=a.next();!l.done;l=a.next()){var f=l.value;f.remove(this)}}catch(H){t={error:H}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}else d.remove(this);var C=this.initialTeardown;if(isFunction(C))try{C()}catch(H){u=H instanceof UnsubscriptionError?H.errors:[H]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var j=__values(h),U=j.next();!U.done;U=j.next()){var W=U.value;try{execFinalizer(W)}catch(H){u=u??[],H instanceof UnsubscriptionError?u=__spreadArray(__spreadArray([],__read(u)),__read(H.errors)):u.push(H)}}}catch(H){s={error:H}}finally{try{U&&!U.done&&(o=j.return)&&o.call(j)}finally{if(s)throw s.error}}}if(u)throw new UnsubscriptionError(u)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)execFinalizer(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&arrRemove(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&arrRemove(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),EMPTY_SUBSCRIPTION=Subscription.EMPTY;function isSubscription(e){return e instanceof Subscription||e&&"closed"in e&&isFunction(e.remove)&&isFunction(e.add)&&isFunction(e.unsubscribe)}function execFinalizer(e){isFunction(e)?e():e.unsubscribe()}var config={Promise:void 0},timeoutProvider={setTimeout:function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];return setTimeout.apply(void 0,__spreadArray([e,t],__read(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function reportUnhandledError(e){timeoutProvider.setTimeout(function(){throw e})}function noop(){}function errorContext(e){e()}var Subscriber=(function(e){__extends(t,e);function t(r){var s=e.call(this)||this;return s.isStopped=!1,r?(s.destination=r,isSubscription(r)&&r.add(s)):s.destination=EMPTY_OBSERVER,s}return t.create=function(r,s,o){return new SafeSubscriber(r,s,o)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Subscription),ConsumerObserver=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(s){handleUnhandledError(s)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(s){handleUnhandledError(s)}else handleUnhandledError(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){handleUnhandledError(r)}},e})(),SafeSubscriber=(function(e){__extends(t,e);function t(r,s,o){var u=e.call(this)||this,d;return isFunction(r)||!r?d={next:r??void 0,error:s??void 0,complete:o??void 0}:d=r,u.destination=new ConsumerObserver(d),u}return t})(Subscriber);function handleUnhandledError(e){reportUnhandledError(e)}function defaultErrorHandler(e){throw e}var EMPTY_OBSERVER={closed:!0,next:noop,error:defaultErrorHandler,complete:noop},observable=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function identity(e){return e}function pipeFromArray(e){return e.length===0?identity:e.length===1?e[0]:function(r){return e.reduce(function(s,o){return o(s)},r)}}var Observable=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,s){var o=this,u=isSubscriber(t)?t:new SafeSubscriber(t,r,s);return errorContext(function(){var d=o,a=d.operator,l=d.source;u.add(a?a.call(u,l):l?o._subscribe(u):o._trySubscribe(u))}),u},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var s=this;return r=getPromiseCtor(r),new r(function(o,u){var d=new SafeSubscriber({next:function(a){try{t(a)}catch(l){u(l),d.unsubscribe()}},error:u,complete:o});s.subscribe(d)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[observable]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return pipeFromArray(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=getPromiseCtor(t),new t(function(s,o){var u;r.subscribe(function(d){return u=d},function(d){return o(d)},function(){return s(u)})})},e.create=function(t){return new e(t)},e})();function getPromiseCtor(e){var t;return(t=e??config.Promise)!==null&&t!==void 0?t:Promise}function isObserver(e){return e&&isFunction(e.next)&&isFunction(e.error)&&isFunction(e.complete)}function isSubscriber(e){return e&&e instanceof Subscriber||isObserver(e)&&isSubscription(e)}function hasLift(e){return isFunction(e==null?void 0:e.lift)}function operate(e){return function(t){if(hasLift(t))return t.lift(function(r){try{return e(r,this)}catch(s){this.error(s)}});throw new TypeError("Unable to lift unknown Observable type")}}function createOperatorSubscriber(e,t,r,s,o){return new OperatorSubscriber(e,t,r,s,o)}var OperatorSubscriber=(function(e){__extends(t,e);function t(r,s,o,u,d,a){var l=e.call(this,r)||this;return l.onFinalize=d,l.shouldUnsubscribe=a,l._next=s?function(f){try{s(f)}catch(C){r.error(C)}}:e.prototype._next,l._error=u?function(f){try{u(f)}catch(C){r.error(C)}finally{this.unsubscribe()}}:e.prototype._error,l._complete=o?function(){try{o()}catch(f){r.error(f)}finally{this.unsubscribe()}}:e.prototype._complete,l}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var s=this.closed;e.prototype.unsubscribe.call(this),!s&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(Subscriber),ObjectUnsubscribedError=createErrorClass(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Subject=(function(e){__extends(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var s=new AnonymousSubject(this,this);return s.operator=r,s},t.prototype._throwIfClosed=function(){if(this.closed)throw new ObjectUnsubscribedError},t.prototype.next=function(r){var s=this;errorContext(function(){var o,u;if(s._throwIfClosed(),!s.isStopped){s.currentObservers||(s.currentObservers=Array.from(s.observers));try{for(var d=__values(s.currentObservers),a=d.next();!a.done;a=d.next()){var l=a.value;l.next(r)}}catch(f){o={error:f}}finally{try{a&&!a.done&&(u=d.return)&&u.call(d)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var s=this;errorContext(function(){if(s._throwIfClosed(),!s.isStopped){s.hasError=s.isStopped=!0,s.thrownError=r;for(var o=s.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;errorContext(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var s=r.observers;s.length;)s.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var s=this,o=this,u=o.hasError,d=o.isStopped,a=o.observers;return u||d?EMPTY_SUBSCRIPTION:(this.currentObservers=null,a.push(r),new Subscription(function(){s.currentObservers=null,arrRemove(a,r)}))},t.prototype._checkFinalizedStatuses=function(r){var s=this,o=s.hasError,u=s.thrownError,d=s.isStopped;o?r.error(u):d&&r.complete()},t.prototype.asObservable=function(){var r=new Observable;return r.source=this,r},t.create=function(r,s){return new AnonymousSubject(r,s)},t})(Observable),AnonymousSubject=(function(e){__extends(t,e);function t(r,s){var o=e.call(this)||this;return o.destination=r,o.source=s,o}return t.prototype.next=function(r){var s,o;(o=(s=this.destination)===null||s===void 0?void 0:s.next)===null||o===void 0||o.call(s,r)},t.prototype.error=function(r){var s,o;(o=(s=this.destination)===null||s===void 0?void 0:s.error)===null||o===void 0||o.call(s,r)},t.prototype.complete=function(){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||s===void 0||s.call(r)},t.prototype._subscribe=function(r){var s,o;return(o=(s=this.source)===null||s===void 0?void 0:s.subscribe(r))!==null&&o!==void 0?o:EMPTY_SUBSCRIPTION},t})(Subject),BehaviorSubject=(function(e){__extends(t,e);function t(r){var s=e.call(this)||this;return s._value=r,s}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var s=e.prototype._subscribe.call(this,r);return!s.closed&&r.next(this._value),s},t.prototype.getValue=function(){var r=this,s=r.hasError,o=r.thrownError,u=r._value;if(s)throw o;return this._throwIfClosed(),u},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(Subject);function map(e,t){return operate(function(r,s){var o=0;r.subscribe(createOperatorSubscriber(s,function(u){s.next(e.call(t,u,o++))}))})}function distinctUntilChanged(e,t){return t===void 0&&(t=identity),e=e??defaultCompare,operate(function(r,s){var o,u=!0;r.subscribe(createOperatorSubscriber(s,function(d){var a=t(d);(u||!e(o,a))&&(u=!1,o=a,s.next(d))}))})}function defaultCompare(e,t){return e===t}var xterm={exports:{}},hasRequiredXterm;function requireXterm(){return hasRequiredXterm||(hasRequiredXterm=1,(function(e,t){(function(r,s){e.exports=s()})(globalThis,(()=>(()=>{var r={4567:function(d,a,l){var f=this&&this.__decorate||function(R,N,V,J){var Y,Z=arguments.length,K=Z<3?N:J===null?J=Object.getOwnPropertyDescriptor(N,V):J;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(R,N,V,J);else for(var ee=R.length-1;ee>=0;ee--)(Y=R[ee])&&(K=(Z<3?Y(K):Z>3?Y(N,V,K):Y(N,V))||K);return Z>3&&K&&Object.defineProperty(N,V,K),K},C=this&&this.__param||function(R,N){return function(V,J){N(V,J,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const h=l(9042),j=l(9924),U=l(844),W=l(4725),H=l(2585),x=l(3656);let L=a.AccessibilityManager=class extends U.Disposable{constructor(R,N,V,J){super(),this._terminal=R,this._coreBrowserService=V,this._renderService=J,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let Y=0;Y<this._terminal.rows;Y++)this._rowElements[Y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[Y]);if(this._topBoundaryFocusListener=Y=>this._handleBoundaryFocus(Y,0),this._bottomBoundaryFocusListener=Y=>this._handleBoundaryFocus(Y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new j.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((Y=>this._handleResize(Y.rows)))),this.register(this._terminal.onRender((Y=>this._refreshRows(Y.start,Y.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((Y=>this._handleChar(Y)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
74
|
-
`)))),this.register(this._terminal.onA11yTab((Y=>this._handleTab(Y)))),this.register(this._terminal.onKey((Y=>this._handleKey(Y.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,x.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,U.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(R){for(let N=0;N<R;N++)this._handleChar(" ")}_handleChar(R){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==R&&(this._charsToAnnounce+=R):this._charsToAnnounce+=R,R===`
|
|
75
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(R){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(R)||this._charsToConsume.push(R)}_refreshRows(R,N){this._liveRegionDebouncer.refresh(R,N,this._terminal.rows)}_renderRows(R,N){const V=this._terminal.buffer,J=V.lines.length.toString();for(let Y=R;Y<=N;Y++){const Z=V.lines.get(V.ydisp+Y),K=[],ee=(Z==null?void 0:Z.translateToString(!0,void 0,void 0,K))||"",oe=(V.ydisp+Y+1).toString(),ce=this._rowElements[Y];ce&&(ee.length===0?(ce.innerText=" ",this._rowColumns.set(ce,[0,1])):(ce.textContent=ee,this._rowColumns.set(ce,K)),ce.setAttribute("aria-posinset",oe),ce.setAttribute("aria-setsize",J))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(R,N){const V=R.target,J=this._rowElements[N===0?1:this._rowElements.length-2];if(V.getAttribute("aria-posinset")===(N===0?"1":`${this._terminal.buffer.lines.length}`)||R.relatedTarget!==J)return;let Y,Z;if(N===0?(Y=V,Z=this._rowElements.pop(),this._rowContainer.removeChild(Z)):(Y=this._rowElements.shift(),Z=V,this._rowContainer.removeChild(Y)),Y.removeEventListener("focus",this._topBoundaryFocusListener),Z.removeEventListener("focus",this._bottomBoundaryFocusListener),N===0){const K=this._createAccessibilityTreeNode();this._rowElements.unshift(K),this._rowContainer.insertAdjacentElement("afterbegin",K)}else{const K=this._createAccessibilityTreeNode();this._rowElements.push(K),this._rowContainer.appendChild(K)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(N===0?-1:1),this._rowElements[N===0?1:this._rowElements.length-2].focus(),R.preventDefault(),R.stopImmediatePropagation()}_handleSelectionChange(){var ee;if(this._rowElements.length===0)return;const R=document.getSelection();if(!R)return;if(R.isCollapsed)return void(this._rowContainer.contains(R.anchorNode)&&this._terminal.clearSelection());if(!R.anchorNode||!R.focusNode)return void console.error("anchorNode and/or focusNode are null");let N={node:R.anchorNode,offset:R.anchorOffset},V={node:R.focusNode,offset:R.focusOffset};if((N.node.compareDocumentPosition(V.node)&Node.DOCUMENT_POSITION_PRECEDING||N.node===V.node&&N.offset>V.offset)&&([N,V]=[V,N]),N.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(N={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(N.node))return;const J=this._rowElements.slice(-1)[0];if(V.node.compareDocumentPosition(J)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(V={node:J,offset:((ee=J.textContent)==null?void 0:ee.length)??0}),!this._rowContainer.contains(V.node))return;const Y=({node:oe,offset:ce})=>{const le=oe instanceof Text?oe.parentNode:oe;let ne=parseInt(le==null?void 0:le.getAttribute("aria-posinset"),10)-1;if(isNaN(ne))return console.warn("row is invalid. Race condition?"),null;const ae=this._rowColumns.get(le);if(!ae)return console.warn("columns is null. Race condition?"),null;let _e=ce<ae.length?ae[ce]:ae.slice(-1)[0]+1;return _e>=this._terminal.cols&&(++ne,_e=0),{row:ne,column:_e}},Z=Y(N),K=Y(V);if(Z&&K){if(Z.row>K.row||Z.row===K.row&&Z.column>=K.column)throw new Error("invalid range");this._terminal.select(Z.column,Z.row,(K.row-Z.row)*this._terminal.cols-Z.column+K.column)}}_handleResize(R){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let N=this._rowContainer.children.length;N<this._terminal.rows;N++)this._rowElements[N]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[N]);for(;this._rowElements.length>R;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const R=this._coreBrowserService.mainDocument.createElement("div");return R.setAttribute("role","listitem"),R.tabIndex=-1,this._refreshRowDimensions(R),R}_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 R=0;R<this._terminal.rows;R++)this._refreshRowDimensions(this._rowElements[R])}}_refreshRowDimensions(R){R.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=L=f([C(1,H.IInstantiationService),C(2,W.ICoreBrowserService),C(3,W.IRenderService)],L)},3614:(d,a)=>{function l(j){return j.replace(/\r?\n/g,"\r")}function f(j,U){return U?"\x1B[200~"+j+"\x1B[201~":j}function C(j,U,W,H){j=f(j=l(j),W.decPrivateModes.bracketedPasteMode&&H.rawOptions.ignoreBracketedPasteMode!==!0),W.triggerDataEvent(j,!0),U.value=""}function h(j,U,W){const H=W.getBoundingClientRect(),x=j.clientX-H.left-10,L=j.clientY-H.top-10;U.style.width="20px",U.style.height="20px",U.style.left=`${x}px`,U.style.top=`${L}px`,U.style.zIndex="1000",U.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=l,a.bracketTextForPaste=f,a.copyHandler=function(j,U){j.clipboardData&&j.clipboardData.setData("text/plain",U.selectionText),j.preventDefault()},a.handlePasteEvent=function(j,U,W,H){j.stopPropagation(),j.clipboardData&&C(j.clipboardData.getData("text/plain"),U,W,H)},a.paste=C,a.moveTextAreaUnderMouseCursor=h,a.rightClickHandler=function(j,U,W,H,x){h(j,U,W),x&&H.rightClickSelect(j),U.value=H.selectionText,U.select()}},7239:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const f=l(1505);a.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(C,h,j){this._css.set(C,h,j)}getCss(C,h){return this._css.get(C,h)}setColor(C,h,j){this._color.set(C,h,j)}getColor(C,h){return this._color.get(C,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(l,f,C,h){l.addEventListener(f,C,h);let j=!1;return{dispose:()=>{j||(j=!0,l.removeEventListener(f,C,h))}}}},3551:function(d,a,l){var f=this&&this.__decorate||function(L,R,N,V){var J,Y=arguments.length,Z=Y<3?R:V===null?V=Object.getOwnPropertyDescriptor(R,N):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(L,R,N,V);else for(var K=L.length-1;K>=0;K--)(J=L[K])&&(Z=(Y<3?J(Z):Y>3?J(R,N,Z):J(R,N))||Z);return Y>3&&Z&&Object.defineProperty(R,N,Z),Z},C=this&&this.__param||function(L,R){return function(N,V){R(N,V,L)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const h=l(3656),j=l(8460),U=l(844),W=l(2585),H=l(4725);let x=a.Linkifier=class extends U.Disposable{get currentLink(){return this._currentLink}constructor(L,R,N,V,J){super(),this._element=L,this._mouseService=R,this._renderService=N,this._bufferService=V,this._linkProviderService=J,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new j.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new j.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,U.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,U.toDisposable)((()=>{var Y;this._lastMouseEvent=void 0,(Y=this._activeProviderReplies)==null||Y.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(L){this._lastMouseEvent=L;const R=this._positionFromMouseEvent(L,this._element,this._mouseService);if(!R)return;this._isMouseOut=!1;const N=L.composedPath();for(let V=0;V<N.length;V++){const J=N[V];if(J.classList.contains("xterm"))break;if(J.classList.contains("xterm-hover"))return}this._lastBufferCell&&R.x===this._lastBufferCell.x&&R.y===this._lastBufferCell.y||(this._handleHover(R),this._lastBufferCell=R)}_handleHover(L){if(this._activeLine!==L.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(L,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,L)||(this._clearCurrentLink(),this._askForLink(L,!0))}_askForLink(L,R){var V,J;this._activeProviderReplies&&R||((V=this._activeProviderReplies)==null||V.forEach((Y=>{Y==null||Y.forEach((Z=>{Z.link.dispose&&Z.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=L.y);let N=!1;for(const[Y,Z]of this._linkProviderService.linkProviders.entries())R?(J=this._activeProviderReplies)!=null&&J.get(Y)&&(N=this._checkLinkProviderResult(Y,L,N)):Z.provideLinks(L.y,(K=>{var oe,ce;if(this._isMouseOut)return;const ee=K==null?void 0:K.map((le=>({link:le})));(oe=this._activeProviderReplies)==null||oe.set(Y,ee),N=this._checkLinkProviderResult(Y,L,N),((ce=this._activeProviderReplies)==null?void 0:ce.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(L.y,this._activeProviderReplies)}))}_removeIntersectingLinks(L,R){const N=new Set;for(let V=0;V<R.size;V++){const J=R.get(V);if(J)for(let Y=0;Y<J.length;Y++){const Z=J[Y],K=Z.link.range.start.y<L?0:Z.link.range.start.x,ee=Z.link.range.end.y>L?this._bufferService.cols:Z.link.range.end.x;for(let oe=K;oe<=ee;oe++){if(N.has(oe)){J.splice(Y--,1);break}N.add(oe)}}}}_checkLinkProviderResult(L,R,N){var Y;if(!this._activeProviderReplies)return N;const V=this._activeProviderReplies.get(L);let J=!1;for(let Z=0;Z<L;Z++)this._activeProviderReplies.has(Z)&&!this._activeProviderReplies.get(Z)||(J=!0);if(!J&&V){const Z=V.find((K=>this._linkAtPosition(K.link,R)));Z&&(N=!0,this._handleNewLink(Z))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!N)for(let Z=0;Z<this._activeProviderReplies.size;Z++){const K=(Y=this._activeProviderReplies.get(Z))==null?void 0:Y.find((ee=>this._linkAtPosition(ee.link,R)));if(K){N=!0,this._handleNewLink(K);break}}return N}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(L){if(!this._currentLink)return;const R=this._positionFromMouseEvent(L,this._element,this._mouseService);R&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,R)&&this._currentLink.link.activate(L,this._currentLink.link.text)}_clearCurrentLink(L,R){this._currentLink&&this._lastMouseEvent&&(!L||!R||this._currentLink.link.range.start.y>=L&&this._currentLink.link.range.end.y<=R)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,U.disposeArray)(this._linkCacheDisposables))}_handleNewLink(L){if(!this._lastMouseEvent)return;const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._linkAtPosition(L.link,R)&&(this._currentLink=L,this._currentLink.state={decorations:{underline:L.link.decorations===void 0||L.link.decorations.underline,pointerCursor:L.link.decorations===void 0||L.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,L.link,this._lastMouseEvent),L.link.decorations={},Object.defineProperties(L.link.decorations,{pointerCursor:{get:()=>{var N,V;return(V=(N=this._currentLink)==null?void 0:N.state)==null?void 0:V.decorations.pointerCursor},set:N=>{var V;(V=this._currentLink)!=null&&V.state&&this._currentLink.state.decorations.pointerCursor!==N&&(this._currentLink.state.decorations.pointerCursor=N,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",N))}},underline:{get:()=>{var N,V;return(V=(N=this._currentLink)==null?void 0:N.state)==null?void 0:V.decorations.underline},set:N=>{var V,J,Y;(V=this._currentLink)!=null&&V.state&&((Y=(J=this._currentLink)==null?void 0:J.state)==null?void 0:Y.decorations.underline)!==N&&(this._currentLink.state.decorations.underline=N,this._currentLink.state.isHovered&&this._fireUnderlineEvent(L.link,N))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((N=>{if(!this._currentLink)return;const V=N.start===0?0:N.start+1+this._bufferService.buffer.ydisp,J=this._bufferService.buffer.ydisp+1+N.end;if(this._currentLink.link.range.start.y>=V&&this._currentLink.link.range.end.y<=J&&(this._clearCurrentLink(V,J),this._lastMouseEvent)){const Y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);Y&&this._askForLink(Y,!1)}}))))}_linkHover(L,R,N){var V;(V=this._currentLink)!=null&&V.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(R,!0),this._currentLink.state.decorations.pointerCursor&&L.classList.add("xterm-cursor-pointer")),R.hover&&R.hover(N,R.text)}_fireUnderlineEvent(L,R){const N=L.range,V=this._bufferService.buffer.ydisp,J=this._createLinkUnderlineEvent(N.start.x-1,N.start.y-V-1,N.end.x,N.end.y-V-1,void 0);(R?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(J)}_linkLeave(L,R,N){var V;(V=this._currentLink)!=null&&V.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(R,!1),this._currentLink.state.decorations.pointerCursor&&L.classList.remove("xterm-cursor-pointer")),R.leave&&R.leave(N,R.text)}_linkAtPosition(L,R){const N=L.range.start.y*this._bufferService.cols+L.range.start.x,V=L.range.end.y*this._bufferService.cols+L.range.end.x,J=R.y*this._bufferService.cols+R.x;return N<=J&&J<=V}_positionFromMouseEvent(L,R,N){const V=N.getCoords(L,R,this._bufferService.cols,this._bufferService.rows);if(V)return{x:V[0],y:V[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(L,R,N,V,J){return{x1:L,y1:R,x2:N,y2:V,cols:this._bufferService.cols,fg:J}}};a.Linkifier=x=f([C(1,H.IMouseService),C(2,H.IRenderService),C(3,W.IBufferService),C(4,H.ILinkProviderService)],x)},9042:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(d,a,l){var f=this&&this.__decorate||function(H,x,L,R){var N,V=arguments.length,J=V<3?x:R===null?R=Object.getOwnPropertyDescriptor(x,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(H,x,L,R);else for(var Y=H.length-1;Y>=0;Y--)(N=H[Y])&&(J=(V<3?N(J):V>3?N(x,L,J):N(x,L))||J);return V>3&&J&&Object.defineProperty(x,L,J),J},C=this&&this.__param||function(H,x){return function(L,R){x(L,R,H)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const h=l(511),j=l(2585);let U=a.OscLinkProvider=class{constructor(H,x,L){this._bufferService=H,this._optionsService=x,this._oscLinkService=L}provideLinks(H,x){var ee;const L=this._bufferService.buffer.lines.get(H-1);if(!L)return void x(void 0);const R=[],N=this._optionsService.rawOptions.linkHandler,V=new h.CellData,J=L.getTrimmedLength();let Y=-1,Z=-1,K=!1;for(let oe=0;oe<J;oe++)if(Z!==-1||L.hasContent(oe)){if(L.loadCell(oe,V),V.hasExtendedAttrs()&&V.extended.urlId){if(Z===-1){Z=oe,Y=V.extended.urlId;continue}K=V.extended.urlId!==Y}else Z!==-1&&(K=!0);if(K||Z!==-1&&oe===J-1){const ce=(ee=this._oscLinkService.getLinkData(Y))==null?void 0:ee.uri;if(ce){const le={start:{x:Z+1,y:H},end:{x:oe+(K||oe!==J-1?0:1),y:H}};let ne=!1;if(!(N!=null&&N.allowNonHttpProtocols))try{const ae=new URL(ce);["http:","https:"].includes(ae.protocol)||(ne=!0)}catch{ne=!0}ne||R.push({text:ce,range:le,activate:(ae,_e)=>N?N.activate(ae,_e,le):W(0,_e),hover:(ae,_e)=>{var fe;return(fe=N==null?void 0:N.hover)==null?void 0:fe.call(N,ae,_e,le)},leave:(ae,_e)=>{var fe;return(fe=N==null?void 0:N.leave)==null?void 0:fe.call(N,ae,_e,le)}})}K=!1,V.hasExtendedAttrs()&&V.extended.urlId?(Z=oe,Y=V.extended.urlId):(Z=-1,Y=-1)}}x(R)}};function W(H,x){if(confirm(`Do you want to navigate to ${x}?
|
|
76
|
-
|
|
77
|
-
WARNING: This link could potentially be dangerous`)){const L=window.open();if(L){try{L.opener=null}catch{}L.location.href=x}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=U=f([C(0,j.IBufferService),C(1,j.IOptionsService),C(2,j.IOscLinkService)],U)},6193:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(l,f){this._renderCallback=l,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,f,C){this._rowCount=C,l=l!==void 0?l:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,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 l=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const f=l(3614),C=l(3656),h=l(3551),j=l(9042),U=l(3730),W=l(1680),H=l(3107),x=l(5744),L=l(2950),R=l(1296),N=l(428),V=l(4269),J=l(5114),Y=l(8934),Z=l(3230),K=l(9312),ee=l(4725),oe=l(6731),ce=l(8055),le=l(8969),ne=l(8460),ae=l(844),_e=l(6114),fe=l(8437),ge=l(2584),he=l(7399),X=l(5941),re=l(9074),Q=l(2585),se=l(5435),Ce=l(4567),we=l(779);class Be extends le.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(de={}){super(de),this.browser=_e,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new ae.MutableDisposable),this._onCursorMove=this.register(new ne.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new ne.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new ne.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new ne.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new ne.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new ne.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new ne.EventEmitter),this._onBlur=this.register(new ne.EventEmitter),this._onA11yCharEmitter=this.register(new ne.EventEmitter),this._onA11yTabEmitter=this.register(new ne.EventEmitter),this._onWillOpen=this.register(new ne.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(re.DecorationService),this._instantiationService.setService(Q.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(we.LinkProviderService),this._instantiationService.setService(ee.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(U.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((ie,De)=>this.refresh(ie,De)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((ie=>this._reportWindowsOptions(ie)))),this.register(this._inputHandler.onColor((ie=>this._handleColorEvent(ie)))),this.register((0,ne.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,ne.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,ne.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,ne.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((ie=>this._afterResize(ie.cols,ie.rows)))),this.register((0,ae.toDisposable)((()=>{var ie,De;this._customKeyEventHandler=void 0,(De=(ie=this.element)==null?void 0:ie.parentNode)==null||De.removeChild(this.element)})))}_handleColorEvent(de){if(this._themeService)for(const ie of de){let De,be="";switch(ie.index){case 256:De="foreground",be="10";break;case 257:De="background",be="11";break;case 258:De="cursor",be="12";break;default:De="ansi",be="4;"+ie.index}switch(ie.type){case 0:const Te=ce.color.toColorRGB(De==="ansi"?this._themeService.colors.ansi[ie.index]:this._themeService.colors[De]);this.coreService.triggerDataEvent(`${ge.C0.ESC}]${be};${(0,X.toRgbString)(Te)}${ge.C1_ESCAPED.ST}`);break;case 1:if(De==="ansi")this._themeService.modifyColors((Pe=>Pe.ansi[ie.index]=ce.channels.toColor(...ie.color)));else{const Pe=De;this._themeService.modifyColors((Je=>Je[Pe]=ce.channels.toColor(...ie.color)))}break;case 2:this._themeService.restoreColor(ie.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(de){de?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Ce.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(de){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ge.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var de;return(de=this.textarea)==null?void 0:de.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ge.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 de=this.buffer.ybase+this.buffer.y,ie=this.buffer.lines.get(de);if(!ie)return;const De=Math.min(this.buffer.x,this.cols-1),be=this._renderService.dimensions.css.cell.height,Te=ie.getWidth(De),Pe=this._renderService.dimensions.css.cell.width*Te,Je=this.buffer.y*this._renderService.dimensions.css.cell.height,Ie=De*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ie+"px",this.textarea.style.top=Je+"px",this.textarea.style.width=Pe+"px",this.textarea.style.height=be+"px",this.textarea.style.lineHeight=be+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,C.addDisposableDomListener)(this.element,"copy",(ie=>{this.hasSelection()&&(0,f.copyHandler)(ie,this._selectionService)})));const de=ie=>(0,f.handlePasteEvent)(ie,this.textarea,this.coreService,this.optionsService);this.register((0,C.addDisposableDomListener)(this.textarea,"paste",de)),this.register((0,C.addDisposableDomListener)(this.element,"paste",de)),_e.isFirefox?this.register((0,C.addDisposableDomListener)(this.element,"mousedown",(ie=>{ie.button===2&&(0,f.rightClickHandler)(ie,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,C.addDisposableDomListener)(this.element,"contextmenu",(ie=>{(0,f.rightClickHandler)(ie,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),_e.isLinux&&this.register((0,C.addDisposableDomListener)(this.element,"auxclick",(ie=>{ie.button===1&&(0,f.moveTextAreaUnderMouseCursor)(ie,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,C.addDisposableDomListener)(this.textarea,"keyup",(de=>this._keyUp(de)),!0)),this.register((0,C.addDisposableDomListener)(this.textarea,"keydown",(de=>this._keyDown(de)),!0)),this.register((0,C.addDisposableDomListener)(this.textarea,"keypress",(de=>this._keyPress(de)),!0)),this.register((0,C.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,C.addDisposableDomListener)(this.textarea,"compositionupdate",(de=>this._compositionHelper.compositionupdate(de)))),this.register((0,C.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,C.addDisposableDomListener)(this.textarea,"input",(de=>this._inputEvent(de)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(de){var De;if(!de)throw new Error("Terminal requires a parent element.");if(de.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((De=this.element)==null?void 0:De.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=de.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"),de.appendChild(this.element);const ie=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),ie.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,C.addDisposableDomListener)(this.screenElement,"mousemove",(be=>this.updateCursorStyle(be)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),ie.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",j.promptLabel),_e.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(J.CoreBrowserService,this.textarea,de.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(ee.ICoreBrowserService,this._coreBrowserService),this.register((0,C.addDisposableDomListener)(this.textarea,"focus",(be=>this._handleTextAreaFocus(be)))),this.register((0,C.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(N.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(ee.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(oe.ThemeService),this._instantiationService.setService(ee.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(V.CharacterJoinerService),this._instantiationService.setService(ee.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(Z.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(ee.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((be=>this._onRender.fire(be)))),this.onResize((be=>this._renderService.resize(be.cols,be.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(L.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Y.MouseService),this._instantiationService.setService(ee.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(ie);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(W.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((be=>this.scrollLines(be.amount,be.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(K.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(ee.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((be=>this.scrollLines(be.amount,be.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((be=>this._renderService.handleSelectionChanged(be.start,be.end,be.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((be=>{this.textarea.value=be,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((be=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,C.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(H.BufferDecorationRenderer,this.screenElement)),this.register((0,C.addDisposableDomListener)(this.element,"mousedown",(be=>this._selectionService.handleMouseDown(be)))),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(Ce.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(be=>this._handleScreenReaderModeOptionChange(be)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(x.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(be=>{!this._overviewRulerRenderer&&be&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(x.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(R.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const de=this,ie=this.element;function De(Pe){const Je=de._mouseService.getMouseReportCoords(Pe,de.screenElement);if(!Je)return!1;let Ie,We;switch(Pe.overrideType||Pe.type){case"mousemove":We=32,Pe.buttons===void 0?(Ie=3,Pe.button!==void 0&&(Ie=Pe.button<3?Pe.button:3)):Ie=1&Pe.buttons?0:4&Pe.buttons?1:2&Pe.buttons?2:3;break;case"mouseup":We=0,Ie=Pe.button<3?Pe.button:3;break;case"mousedown":We=1,Ie=Pe.button<3?Pe.button:3;break;case"wheel":if(de._customWheelEventHandler&&de._customWheelEventHandler(Pe)===!1||de.viewport.getLinesScrolled(Pe)===0)return!1;We=Pe.deltaY<0?0:1,Ie=4;break;default:return!1}return!(We===void 0||Ie===void 0||Ie>4)&&de.coreMouseService.triggerMouseEvent({col:Je.col,row:Je.row,x:Je.x,y:Je.y,button:Ie,action:We,ctrl:Pe.ctrlKey,alt:Pe.altKey,shift:Pe.shiftKey})}const be={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Te={mouseup:Pe=>(De(Pe),Pe.buttons||(this._document.removeEventListener("mouseup",be.mouseup),be.mousedrag&&this._document.removeEventListener("mousemove",be.mousedrag)),this.cancel(Pe)),wheel:Pe=>(De(Pe),this.cancel(Pe,!0)),mousedrag:Pe=>{Pe.buttons&&De(Pe)},mousemove:Pe=>{Pe.buttons||De(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?be.mousemove||(ie.addEventListener("mousemove",Te.mousemove),be.mousemove=Te.mousemove):(ie.removeEventListener("mousemove",be.mousemove),be.mousemove=null),16&Pe?be.wheel||(ie.addEventListener("wheel",Te.wheel,{passive:!1}),be.wheel=Te.wheel):(ie.removeEventListener("wheel",be.wheel),be.wheel=null),2&Pe?be.mouseup||(be.mouseup=Te.mouseup):(this._document.removeEventListener("mouseup",be.mouseup),be.mouseup=null),4&Pe?be.mousedrag||(be.mousedrag=Te.mousedrag):(this._document.removeEventListener("mousemove",be.mousedrag),be.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,C.addDisposableDomListener)(ie,"mousedown",(Pe=>{if(Pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Pe))return De(Pe),be.mouseup&&this._document.addEventListener("mouseup",be.mouseup),be.mousedrag&&this._document.addEventListener("mousemove",be.mousedrag),this.cancel(Pe)}))),this.register((0,C.addDisposableDomListener)(ie,"wheel",(Pe=>{if(!be.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Pe)===!1)return!1;if(!this.buffer.hasScrollback){const Je=this.viewport.getLinesScrolled(Pe);if(Je===0)return;const Ie=ge.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Pe.deltaY<0?"A":"B");let We="";for(let Xe=0;Xe<Math.abs(Je);Xe++)We+=Ie;return this.coreService.triggerDataEvent(We,!0),this.cancel(Pe,!0)}return this.viewport.handleWheel(Pe)?this.cancel(Pe):void 0}}),{passive:!1})),this.register((0,C.addDisposableDomListener)(ie,"touchstart",(Pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Pe),this.cancel(Pe)}),{passive:!0})),this.register((0,C.addDisposableDomListener)(ie,"touchmove",(Pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Pe)?void 0:this.cancel(Pe)}),{passive:!1}))}refresh(de,ie){var De;(De=this._renderService)==null||De.refreshRows(de,ie)}updateCursorStyle(de){var ie;(ie=this._selectionService)!=null&&ie.shouldColumnSelect(de)?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(de,ie,De=0){var be;De===1?(super.scrollLines(de,ie,De),this.refresh(0,this.rows-1)):(be=this.viewport)==null||be.scrollLines(de)}paste(de){(0,f.paste)(de,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(de){this._customKeyEventHandler=de}attachCustomWheelEventHandler(de){this._customWheelEventHandler=de}registerLinkProvider(de){return this._linkProviderService.registerLinkProvider(de)}registerCharacterJoiner(de){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const ie=this._characterJoinerService.register(de);return this.refresh(0,this.rows-1),ie}deregisterCharacterJoiner(de){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(de)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(de){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+de)}registerDecoration(de){return this._decorationService.registerDecoration(de)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(de,ie,De){this._selectionService.setSelection(de,ie,De)}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 de;(de=this._selectionService)==null||de.clearSelection()}selectAll(){var de;(de=this._selectionService)==null||de.selectAll()}selectLines(de,ie){var De;(De=this._selectionService)==null||De.selectLines(de,ie)}_keyDown(de){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(de)===!1)return!1;const ie=this.browser.isMac&&this.options.macOptionIsMeta&&de.altKey;if(!ie&&!this._compositionHelper.keydown(de))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;ie||de.key!=="Dead"&&de.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const De=(0,he.evaluateKeyboardEvent)(de,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(de),De.type===3||De.type===2){const be=this.rows-1;return this.scrollLines(De.type===2?-be:be),this.cancel(de,!0)}return De.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,de)||(De.cancel&&this.cancel(de,!0),!De.key||!!(de.key&&!de.ctrlKey&&!de.altKey&&!de.metaKey&&de.key.length===1&&de.key.charCodeAt(0)>=65&&de.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(De.key!==ge.C0.ETX&&De.key!==ge.C0.CR||(this.textarea.value=""),this._onKey.fire({key:De.key,domEvent:de}),this._showCursor(),this.coreService.triggerDataEvent(De.key,!0),!this.optionsService.rawOptions.screenReaderMode||de.altKey||de.ctrlKey?this.cancel(de,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(de,ie){const De=de.isMac&&!this.options.macOptionIsMeta&&ie.altKey&&!ie.ctrlKey&&!ie.metaKey||de.isWindows&&ie.altKey&&ie.ctrlKey&&!ie.metaKey||de.isWindows&&ie.getModifierState("AltGraph");return ie.type==="keypress"?De:De&&(!ie.keyCode||ie.keyCode>47)}_keyUp(de){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(de)===!1||((function(ie){return ie.keyCode===16||ie.keyCode===17||ie.keyCode===18})(de)||this.focus(),this.updateCursorStyle(de),this._keyPressHandled=!1)}_keyPress(de){let ie;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(de)===!1)return!1;if(this.cancel(de),de.charCode)ie=de.charCode;else if(de.which===null||de.which===void 0)ie=de.keyCode;else{if(de.which===0||de.charCode===0)return!1;ie=de.which}return!(!ie||(de.altKey||de.ctrlKey||de.metaKey)&&!this._isThirdLevelShift(this.browser,de)||(ie=String.fromCharCode(ie),this._onKey.fire({key:ie,domEvent:de}),this._showCursor(),this.coreService.triggerDataEvent(ie,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(de){if(de.data&&de.inputType==="insertText"&&(!de.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const ie=de.data;return this.coreService.triggerDataEvent(ie,!0),this.cancel(de),!0}return!1}resize(de,ie){de!==this.cols||ie!==this.rows?super.resize(de,ie):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(de,ie){var De,be;(De=this._charSizeService)==null||De.measure(),(be=this.viewport)==null||be.syncScrollArea(!0)}clear(){var de;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 ie=1;ie<this.rows;ie++)this.buffer.lines.push(this.buffer.getBlankLine(fe.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(de=this.viewport)==null||de.reset(),this.refresh(0,this.rows-1)}}reset(){var ie,De;this.options.rows=this.rows,this.options.cols=this.cols;const de=this._customKeyEventHandler;this._setup(),super.reset(),(ie=this._selectionService)==null||ie.reset(),this._decorationService.reset(),(De=this.viewport)==null||De.reset(),this._customKeyEventHandler=de,this.refresh(0,this.rows-1)}clearTextureAtlas(){var de;(de=this._renderService)==null||de.clearTextureAtlas()}_reportFocus(){var de;(de=this.element)!=null&&de.classList.contains("focus")?this.coreService.triggerDataEvent(ge.C0.ESC+"[I"):this.coreService.triggerDataEvent(ge.C0.ESC+"[O")}_reportWindowsOptions(de){if(this._renderService)switch(de){case se.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const ie=this._renderService.dimensions.css.canvas.width.toFixed(0),De=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ge.C0.ESC}[4;${De};${ie}t`);break;case se.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const be=this._renderService.dimensions.css.cell.width.toFixed(0),Te=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ge.C0.ESC}[6;${Te};${be}t`)}}cancel(de,ie){if(this.options.cancelEvents||ie)return de.preventDefault(),de.stopPropagation(),!1}}a.Terminal=Be},9924:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(l,f=1e3){this._renderCallback=l,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,f,C){this._rowCount=C,l=l!==void 0?l:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const j=h-this._lastRefreshMs,U=this._debounceThresholdMS-j;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),U)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,f)}}},1680:function(d,a,l){var f=this&&this.__decorate||function(L,R,N,V){var J,Y=arguments.length,Z=Y<3?R:V===null?V=Object.getOwnPropertyDescriptor(R,N):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(L,R,N,V);else for(var K=L.length-1;K>=0;K--)(J=L[K])&&(Z=(Y<3?J(Z):Y>3?J(R,N,Z):J(R,N))||Z);return Y>3&&Z&&Object.defineProperty(R,N,Z),Z},C=this&&this.__param||function(L,R){return function(N,V){R(N,V,L)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const h=l(3656),j=l(4725),U=l(8460),W=l(844),H=l(2585);let x=a.Viewport=class extends W.Disposable{constructor(L,R,N,V,J,Y,Z,K){super(),this._viewportElement=L,this._scrollArea=R,this._bufferService=N,this._optionsService=V,this._charSizeService=J,this._renderService=Y,this._coreBrowserService=Z,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 U.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((ee=>this._activeBuffer=ee.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((ee=>this._renderDimensions=ee))),this._handleThemeChange(K.colors),this.register(K.onChangeColors((ee=>this._handleThemeChange(ee)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(L){this._viewportElement.style.backgroundColor=L.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(L){if(L)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 R=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==R&&(this._lastRecordedBufferHeight=R,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const L=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==L&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=L),this._refreshAnimationFrame=null}syncScrollArea(L=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(L);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(L)}_handleScroll(L){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 R=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:R,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const L=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(L*(this._smoothScrollState.target-this._smoothScrollState.origin)),L<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(L,R){const N=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(R<0&&this._viewportElement.scrollTop!==0||R>0&&N<this._lastRecordedBufferHeight)||(L.cancelable&&L.preventDefault(),!1)}handleWheel(L){const R=this._getPixelsScrolled(L);return R!==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+R:this._smoothScrollState.target+=R,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=R,this._bubbleScroll(L,R))}scrollLines(L){if(L!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const R=L*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+R,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:L,suppressScrollEvent:!1})}_getPixelsScrolled(L){if(L.deltaY===0||L.shiftKey)return 0;let R=this._applyScrollModifier(L.deltaY,L);return L.deltaMode===WheelEvent.DOM_DELTA_LINE?R*=this._currentRowHeight:L.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(R*=this._currentRowHeight*this._bufferService.rows),R}getBufferElements(L,R){var K;let N,V="";const J=[],Y=R??this._bufferService.buffer.lines.length,Z=this._bufferService.buffer.lines;for(let ee=L;ee<Y;ee++){const oe=Z.get(ee);if(!oe)continue;const ce=(K=Z.get(ee+1))==null?void 0:K.isWrapped;if(V+=oe.translateToString(!ce),!ce||ee===Z.length-1){const le=document.createElement("div");le.textContent=V,J.push(le),V.length>0&&(N=le),V=""}}return{bufferElements:J,cursorElement:N}}getLinesScrolled(L){if(L.deltaY===0||L.shiftKey)return 0;let R=this._applyScrollModifier(L.deltaY,L);return L.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(R/=this._currentRowHeight+0,this._wheelPartialScroll+=R,R=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):L.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(R*=this._bufferService.rows),R}_applyScrollModifier(L,R){const N=this._optionsService.rawOptions.fastScrollModifier;return N==="alt"&&R.altKey||N==="ctrl"&&R.ctrlKey||N==="shift"&&R.shiftKey?L*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:L*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(L){this._lastTouchY=L.touches[0].pageY}handleTouchMove(L){const R=this._lastTouchY-L.touches[0].pageY;return this._lastTouchY=L.touches[0].pageY,R!==0&&(this._viewportElement.scrollTop+=R,this._bubbleScroll(L,R))}};a.Viewport=x=f([C(2,H.IBufferService),C(3,H.IOptionsService),C(4,j.ICharSizeService),C(5,j.IRenderService),C(6,j.ICoreBrowserService),C(7,j.IThemeService)],x)},3107:function(d,a,l){var f=this&&this.__decorate||function(H,x,L,R){var N,V=arguments.length,J=V<3?x:R===null?R=Object.getOwnPropertyDescriptor(x,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(H,x,L,R);else for(var Y=H.length-1;Y>=0;Y--)(N=H[Y])&&(J=(V<3?N(J):V>3?N(x,L,J):N(x,L))||J);return V>3&&J&&Object.defineProperty(x,L,J),J},C=this&&this.__param||function(H,x){return function(L,R){x(L,R,H)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const h=l(4725),j=l(844),U=l(2585);let W=a.BufferDecorationRenderer=class extends j.Disposable{constructor(H,x,L,R,N){super(),this._screenElement=H,this._bufferService=x,this._coreBrowserService=L,this._decorationService=R,this._renderService=N,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((V=>this._removeDecoration(V)))),this.register((0,j.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 H of this._decorationService.decorations)this._renderDecoration(H);this._dimensionsChanged=!1}_renderDecoration(H){this._refreshStyle(H),this._dimensionsChanged&&this._refreshXPosition(H)}_createElement(H){var R;const x=this._coreBrowserService.mainDocument.createElement("div");x.classList.add("xterm-decoration"),x.classList.toggle("xterm-decoration-top-layer",((R=H==null?void 0:H.options)==null?void 0:R.layer)==="top"),x.style.width=`${Math.round((H.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,x.style.height=(H.options.height||1)*this._renderService.dimensions.css.cell.height+"px",x.style.top=(H.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",x.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const L=H.options.x??0;return L&&L>this._bufferService.cols&&(x.style.display="none"),this._refreshXPosition(H,x),x}_refreshStyle(H){const x=H.marker.line-this._bufferService.buffers.active.ydisp;if(x<0||x>=this._bufferService.rows)H.element&&(H.element.style.display="none",H.onRenderEmitter.fire(H.element));else{let L=this._decorationElements.get(H);L||(L=this._createElement(H),H.element=L,this._decorationElements.set(H,L),this._container.appendChild(L),H.onDispose((()=>{this._decorationElements.delete(H),L.remove()}))),L.style.top=x*this._renderService.dimensions.css.cell.height+"px",L.style.display=this._altBufferIsActive?"none":"block",H.onRenderEmitter.fire(L)}}_refreshXPosition(H,x=H.element){if(!x)return;const L=H.options.x??0;(H.options.anchor||"left")==="right"?x.style.right=L?L*this._renderService.dimensions.css.cell.width+"px":"":x.style.left=L?L*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(H){var x;(x=this._decorationElements.get(H))==null||x.remove(),this._decorationElements.delete(H),H.dispose()}};a.BufferDecorationRenderer=W=f([C(1,U.IBufferService),C(2,h.ICoreBrowserService),C(3,U.IDecorationService),C(4,h.IRenderService)],W)},5871:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.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(l){if(l.options.overviewRulerOptions){for(const f of this._zones)if(f.color===l.options.overviewRulerOptions.color&&f.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,l.marker.line))return;if(this._lineAdjacentToZone(f,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(f,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,f){return f>=l.startBufferLine&&f<=l.endBufferLine}_lineAdjacentToZone(l,f,C){return f>=l.startBufferLine-this._linePadding[C||"full"]&&f<=l.endBufferLine+this._linePadding[C||"full"]}_addLineToZone(l,f){l.startBufferLine=Math.min(l.startBufferLine,f),l.endBufferLine=Math.max(l.endBufferLine,f)}}},5744:function(d,a,l){var f=this&&this.__decorate||function(N,V,J,Y){var Z,K=arguments.length,ee=K<3?V:Y===null?Y=Object.getOwnPropertyDescriptor(V,J):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(N,V,J,Y);else for(var oe=N.length-1;oe>=0;oe--)(Z=N[oe])&&(ee=(K<3?Z(ee):K>3?Z(V,J,ee):Z(V,J))||ee);return K>3&&ee&&Object.defineProperty(V,J,ee),ee},C=this&&this.__param||function(N,V){return function(J,Y){V(J,Y,N)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const h=l(5871),j=l(4725),U=l(844),W=l(2585),H={full:0,left:0,center:0,right:0},x={full:0,left:0,center:0,right:0},L={full:0,left:0,center:0,right:0};let R=a.OverviewRulerRenderer=class extends U.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(N,V,J,Y,Z,K,ee){var ce;super(),this._viewportElement=N,this._screenElement=V,this._bufferService=J,this._decorationService=Y,this._renderService=Z,this._optionsService=K,this._coreBrowserService=ee,this._colorZoneStore=new h.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(),(ce=this._viewportElement.parentElement)==null||ce.insertBefore(this._canvas,this._viewportElement);const oe=this._canvas.getContext("2d");if(!oe)throw new Error("Ctx cannot be null");this._ctx=oe,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,U.toDisposable)((()=>{var le;(le=this._canvas)==null||le.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 N=Math.floor(this._canvas.width/3),V=Math.ceil(this._canvas.width/3);x.full=this._canvas.width,x.left=N,x.center=V,x.right=N,this._refreshDrawHeightConstants(),L.full=0,L.left=0,L.center=x.left,L.right=x.left+x.center}_refreshDrawHeightConstants(){H.full=Math.round(2*this._coreBrowserService.dpr);const N=this._canvas.height/this._bufferService.buffer.lines.length,V=Math.round(Math.max(Math.min(N,12),6)*this._coreBrowserService.dpr);H.left=V,H.center=V,H.right=V}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*H.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*H.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*H.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*H.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 V of this._decorationService.decorations)this._colorZoneStore.addDecoration(V);this._ctx.lineWidth=1;const N=this._colorZoneStore.zones;for(const V of N)V.position!=="full"&&this._renderColorZone(V);for(const V of N)V.position==="full"&&this._renderColorZone(V);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(N){this._ctx.fillStyle=N.color,this._ctx.fillRect(L[N.position||"full"],Math.round((this._canvas.height-1)*(N.startBufferLine/this._bufferService.buffers.active.lines.length)-H[N.position||"full"]/2),x[N.position||"full"],Math.round((this._canvas.height-1)*((N.endBufferLine-N.startBufferLine)/this._bufferService.buffers.active.lines.length)+H[N.position||"full"]))}_queueRefresh(N,V){this._shouldUpdateDimensions=N||this._shouldUpdateDimensions,this._shouldUpdateAnchor=V||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=R=f([C(2,W.IBufferService),C(3,W.IDecorationService),C(4,j.IRenderService),C(5,W.IOptionsService),C(6,j.ICoreBrowserService)],R)},2950:function(d,a,l){var f=this&&this.__decorate||function(H,x,L,R){var N,V=arguments.length,J=V<3?x:R===null?R=Object.getOwnPropertyDescriptor(x,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(H,x,L,R);else for(var Y=H.length-1;Y>=0;Y--)(N=H[Y])&&(J=(V<3?N(J):V>3?N(x,L,J):N(x,L))||J);return V>3&&J&&Object.defineProperty(x,L,J),J},C=this&&this.__param||function(H,x){return function(L,R){x(L,R,H)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const h=l(4725),j=l(2585),U=l(2584);let W=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(H,x,L,R,N,V){this._textarea=H,this._compositionView=x,this._bufferService=L,this._optionsService=R,this._coreService=N,this._renderService=V,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(H){this._compositionView.textContent=H.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(H){if(this._isComposing||this._isSendingComposition){if(H.keyCode===229||H.keyCode===16||H.keyCode===17||H.keyCode===18)return!1;this._finalizeComposition(!1)}return H.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(H){if(this._compositionView.classList.remove("active"),this._isComposing=!1,H){const x={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let L;this._isSendingComposition=!1,x.start+=this._dataAlreadySent.length,L=this._isComposing?this._textarea.value.substring(x.start,x.end):this._textarea.value.substring(x.start),L.length>0&&this._coreService.triggerDataEvent(L,!0)}}),0)}else{this._isSendingComposition=!1;const x=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(x,!0)}}_handleAnyTextareaChanges(){const H=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const x=this._textarea.value,L=x.replace(H,"");this._dataAlreadySent=L,x.length>H.length?this._coreService.triggerDataEvent(L,!0):x.length<H.length?this._coreService.triggerDataEvent(`${U.C0.DEL}`,!0):x.length===H.length&&x!==H&&this._coreService.triggerDataEvent(x,!0)}}),0)}updateCompositionElements(H){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const x=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),L=this._renderService.dimensions.css.cell.height,R=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,N=x*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=N+"px",this._compositionView.style.top=R+"px",this._compositionView.style.height=L+"px",this._compositionView.style.lineHeight=L+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const V=this._compositionView.getBoundingClientRect();this._textarea.style.left=N+"px",this._textarea.style.top=R+"px",this._textarea.style.width=Math.max(V.width,1)+"px",this._textarea.style.height=Math.max(V.height,1)+"px",this._textarea.style.lineHeight=V.height+"px"}H||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=W=f([C(2,j.IBufferService),C(3,j.IOptionsService),C(4,j.ICoreService),C(5,h.IRenderService)],W)},9806:(d,a)=>{function l(f,C,h){const j=h.getBoundingClientRect(),U=f.getComputedStyle(h),W=parseInt(U.getPropertyValue("padding-left")),H=parseInt(U.getPropertyValue("padding-top"));return[C.clientX-j.left-W,C.clientY-j.top-H]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=l,a.getCoords=function(f,C,h,j,U,W,H,x,L){if(!W)return;const R=l(f,C,h);return R?(R[0]=Math.ceil((R[0]+(L?H/2:0))/H),R[1]=Math.ceil(R[1]/x),R[0]=Math.min(Math.max(R[0],1),j+(L?1:0)),R[1]=Math.min(Math.max(R[1],1),U),R):void 0}},9504:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const f=l(2584);function C(x,L,R,N){const V=x-h(x,R),J=L-h(L,R),Y=Math.abs(V-J)-(function(Z,K,ee){let oe=0;const ce=Z-h(Z,ee),le=K-h(K,ee);for(let ne=0;ne<Math.abs(ce-le);ne++){const ae=j(Z,K)==="A"?-1:1,_e=ee.buffer.lines.get(ce+ae*ne);_e!=null&&_e.isWrapped&&oe++}return oe})(x,L,R);return H(Y,W(j(x,L),N))}function h(x,L){let R=0,N=L.buffer.lines.get(x),V=N==null?void 0:N.isWrapped;for(;V&&x>=0&&x<L.rows;)R++,N=L.buffer.lines.get(--x),V=N==null?void 0:N.isWrapped;return R}function j(x,L){return x>L?"A":"B"}function U(x,L,R,N,V,J){let Y=x,Z=L,K="";for(;Y!==R||Z!==N;)Y+=V?1:-1,V&&Y>J.cols-1?(K+=J.buffer.translateBufferLineToString(Z,!1,x,Y),Y=0,x=0,Z++):!V&&Y<0&&(K+=J.buffer.translateBufferLineToString(Z,!1,0,x+1),Y=J.cols-1,x=Y,Z--);return K+J.buffer.translateBufferLineToString(Z,!1,x,Y)}function W(x,L){const R=L?"O":"[";return f.C0.ESC+R+x}function H(x,L){x=Math.floor(x);let R="";for(let N=0;N<x;N++)R+=L;return R}a.moveToCellSequence=function(x,L,R,N){const V=R.buffer.x,J=R.buffer.y;if(!R.buffer.hasScrollback)return(function(K,ee,oe,ce,le,ne){return C(ee,ce,le,ne).length===0?"":H(U(K,ee,K,ee-h(ee,le),!1,le).length,W("D",ne))})(V,J,0,L,R,N)+C(J,L,R,N)+(function(K,ee,oe,ce,le,ne){let ae;ae=C(ee,ce,le,ne).length>0?ce-h(ce,le):ee;const _e=ce,fe=(function(ge,he,X,re,Q,se){let Ce;return Ce=C(X,re,Q,se).length>0?re-h(re,Q):he,ge<X&&Ce<=re||ge>=X&&Ce<re?"C":"D"})(K,ee,oe,ce,le,ne);return H(U(K,ae,oe,_e,fe==="C",le).length,W(fe,ne))})(V,J,x,L,R,N);let Y;if(J===L)return Y=V>x?"D":"C",H(Math.abs(V-x),W(Y,N));Y=J>L?"D":"C";const Z=Math.abs(J-L);return H((function(K,ee){return ee.cols-K})(J>L?x:V,R)+(Z-1)*R.cols+1+((J>L?V:x)-1),W(Y,N))}},1296:function(d,a,l){var f=this&&this.__decorate||function(ne,ae,_e,fe){var ge,he=arguments.length,X=he<3?ae:fe===null?fe=Object.getOwnPropertyDescriptor(ae,_e):fe;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(ne,ae,_e,fe);else for(var re=ne.length-1;re>=0;re--)(ge=ne[re])&&(X=(he<3?ge(X):he>3?ge(ae,_e,X):ge(ae,_e))||X);return he>3&&X&&Object.defineProperty(ae,_e,X),X},C=this&&this.__param||function(ne,ae){return function(_e,fe){ae(_e,fe,ne)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const h=l(3787),j=l(2550),U=l(2223),W=l(6171),H=l(6052),x=l(4725),L=l(8055),R=l(8460),N=l(844),V=l(2585),J="xterm-dom-renderer-owner-",Y="xterm-rows",Z="xterm-fg-",K="xterm-bg-",ee="xterm-focus",oe="xterm-selection";let ce=1,le=a.DomRenderer=class extends N.Disposable{constructor(ne,ae,_e,fe,ge,he,X,re,Q,se,Ce,we,Be){super(),this._terminal=ne,this._document=ae,this._element=_e,this._screenElement=fe,this._viewportElement=ge,this._helperContainer=he,this._linkifier2=X,this._charSizeService=Q,this._optionsService=se,this._bufferService=Ce,this._coreBrowserService=we,this._themeService=Be,this._terminalClass=ce++,this._rowElements=[],this._selectionRenderModel=(0,H.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new R.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(oe),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,W.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((Re=>this._injectCss(Re)))),this._injectCss(this._themeService.colors),this._rowFactory=re.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(J+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((Re=>this._handleLinkHover(Re)))),this.register(this._linkifier2.onHideLinkUnderline((Re=>this._handleLinkLeave(Re)))),this.register((0,N.toDisposable)((()=>{this._element.classList.remove(J+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new j.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 ne=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*ne,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*ne),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/ne),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/ne),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 _e of this._rowElements)_e.style.width=`${this.dimensions.css.canvas.width}px`,_e.style.height=`${this.dimensions.css.cell.height}px`,_e.style.lineHeight=`${this.dimensions.css.cell.height}px`,_e.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const ae=`${this._terminalSelector} .${Y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=ae,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(ne){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let ae=`${this._terminalSelector} .${Y} { color: ${ne.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;ae+=`${this._terminalSelector} .${Y} .xterm-dim { color: ${L.color.multiplyOpacity(ne.foreground,.5).css};}`,ae+=`${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 _e=`blink_underline_${this._terminalClass}`,fe=`blink_bar_${this._terminalClass}`,ge=`blink_block_${this._terminalClass}`;ae+=`@keyframes ${_e} { 50% { border-bottom-style: hidden; }}`,ae+=`@keyframes ${fe} { 50% { box-shadow: none; }}`,ae+=`@keyframes ${ge} { 0% { background-color: ${ne.cursor.css}; color: ${ne.cursorAccent.css}; } 50% { background-color: inherit; color: ${ne.cursor.css}; }}`,ae+=`${this._terminalSelector} .${Y}.${ee} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${_e} 1s step-end infinite;}${this._terminalSelector} .${Y}.${ee} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${fe} 1s step-end infinite;}${this._terminalSelector} .${Y}.${ee} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${ge} 1s step-end infinite;}${this._terminalSelector} .${Y} .xterm-cursor.xterm-cursor-block { background-color: ${ne.cursor.css}; color: ${ne.cursorAccent.css};}${this._terminalSelector} .${Y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${ne.cursor.css} !important; color: ${ne.cursorAccent.css} !important;}${this._terminalSelector} .${Y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${ne.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${ne.cursor.css} inset;}${this._terminalSelector} .${Y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${ne.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,ae+=`${this._terminalSelector} .${oe} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${oe} div { position: absolute; background-color: ${ne.selectionBackgroundOpaque.css};}${this._terminalSelector} .${oe} div { position: absolute; background-color: ${ne.selectionInactiveBackgroundOpaque.css};}`;for(const[he,X]of ne.ansi.entries())ae+=`${this._terminalSelector} .${Z}${he} { color: ${X.css}; }${this._terminalSelector} .${Z}${he}.xterm-dim { color: ${L.color.multiplyOpacity(X,.5).css}; }${this._terminalSelector} .${K}${he} { background-color: ${X.css}; }`;ae+=`${this._terminalSelector} .${Z}${U.INVERTED_DEFAULT_COLOR} { color: ${L.color.opaque(ne.background).css}; }${this._terminalSelector} .${Z}${U.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${L.color.multiplyOpacity(L.color.opaque(ne.background),.5).css}; }${this._terminalSelector} .${K}${U.INVERTED_DEFAULT_COLOR} { background-color: ${ne.foreground.css}; }`,this._themeStyleElement.textContent=ae}_setDefaultSpacing(){const ne=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${ne}px`,this._rowFactory.defaultSpacing=ne}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(ne,ae){for(let _e=this._rowElements.length;_e<=ae;_e++){const fe=this._document.createElement("div");this._rowContainer.appendChild(fe),this._rowElements.push(fe)}for(;this._rowElements.length>ae;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(ne,ae){this._refreshRowElements(ne,ae),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(ee),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(ee),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(ne,ae,_e){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(ne,ae,_e),this.renderRows(0,this._bufferService.rows-1),!ne||!ae)return;this._selectionRenderModel.update(this._terminal,ne,ae,_e);const fe=this._selectionRenderModel.viewportStartRow,ge=this._selectionRenderModel.viewportEndRow,he=this._selectionRenderModel.viewportCappedStartRow,X=this._selectionRenderModel.viewportCappedEndRow;if(he>=this._bufferService.rows||X<0)return;const re=this._document.createDocumentFragment();if(_e){const Q=ne[0]>ae[0];re.appendChild(this._createSelectionElement(he,Q?ae[0]:ne[0],Q?ne[0]:ae[0],X-he+1))}else{const Q=fe===he?ne[0]:0,se=he===ge?ae[0]:this._bufferService.cols;re.appendChild(this._createSelectionElement(he,Q,se));const Ce=X-he-1;if(re.appendChild(this._createSelectionElement(he+1,0,this._bufferService.cols,Ce)),he!==X){const we=ge===X?ae[0]:this._bufferService.cols;re.appendChild(this._createSelectionElement(X,0,we))}}this._selectionContainer.appendChild(re)}_createSelectionElement(ne,ae,_e,fe=1){const ge=this._document.createElement("div"),he=ae*this.dimensions.css.cell.width;let X=this.dimensions.css.cell.width*(_e-ae);return he+X>this.dimensions.css.canvas.width&&(X=this.dimensions.css.canvas.width-he),ge.style.height=fe*this.dimensions.css.cell.height+"px",ge.style.top=ne*this.dimensions.css.cell.height+"px",ge.style.left=`${he}px`,ge.style.width=`${X}px`,ge}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 ne of this._rowElements)ne.replaceChildren()}renderRows(ne,ae){const _e=this._bufferService.buffer,fe=_e.ybase+_e.y,ge=Math.min(_e.x,this._bufferService.cols-1),he=this._optionsService.rawOptions.cursorBlink,X=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let Q=ne;Q<=ae;Q++){const se=Q+_e.ydisp,Ce=this._rowElements[Q],we=_e.lines.get(se);if(!Ce||!we)break;Ce.replaceChildren(...this._rowFactory.createRow(we,se,se===fe,X,re,ge,he,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${J}${this._terminalClass}`}_handleLinkHover(ne){this._setCellUnderline(ne.x1,ne.x2,ne.y1,ne.y2,ne.cols,!0)}_handleLinkLeave(ne){this._setCellUnderline(ne.x1,ne.x2,ne.y1,ne.y2,ne.cols,!1)}_setCellUnderline(ne,ae,_e,fe,ge,he){_e<0&&(ne=0),fe<0&&(ae=0);const X=this._bufferService.rows-1;_e=Math.max(Math.min(_e,X),0),fe=Math.max(Math.min(fe,X),0),ge=Math.min(ge,this._bufferService.cols);const re=this._bufferService.buffer,Q=re.ybase+re.y,se=Math.min(re.x,ge-1),Ce=this._optionsService.rawOptions.cursorBlink,we=this._optionsService.rawOptions.cursorStyle,Be=this._optionsService.rawOptions.cursorInactiveStyle;for(let Re=_e;Re<=fe;++Re){const de=Re+re.ydisp,ie=this._rowElements[Re],De=re.lines.get(de);if(!ie||!De)break;ie.replaceChildren(...this._rowFactory.createRow(De,de,de===Q,we,Be,se,Ce,this.dimensions.css.cell.width,this._widthCache,he?Re===_e?ne:0:-1,he?(Re===fe?ae:ge)-1:-1))}}};a.DomRenderer=le=f([C(7,V.IInstantiationService),C(8,x.ICharSizeService),C(9,V.IOptionsService),C(10,V.IBufferService),C(11,x.ICoreBrowserService),C(12,x.IThemeService)],le)},3787:function(d,a,l){var f=this&&this.__decorate||function(Y,Z,K,ee){var oe,ce=arguments.length,le=ce<3?Z:ee===null?ee=Object.getOwnPropertyDescriptor(Z,K):ee;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")le=Reflect.decorate(Y,Z,K,ee);else for(var ne=Y.length-1;ne>=0;ne--)(oe=Y[ne])&&(le=(ce<3?oe(le):ce>3?oe(Z,K,le):oe(Z,K))||le);return ce>3&&le&&Object.defineProperty(Z,K,le),le},C=this&&this.__param||function(Y,Z){return function(K,ee){Z(K,ee,Y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const h=l(2223),j=l(643),U=l(511),W=l(2585),H=l(8055),x=l(4725),L=l(4269),R=l(6171),N=l(3734);let V=a.DomRendererRowFactory=class{constructor(Y,Z,K,ee,oe,ce,le){this._document=Y,this._characterJoinerService=Z,this._optionsService=K,this._coreBrowserService=ee,this._coreService=oe,this._decorationService=ce,this._themeService=le,this._workCell=new U.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(Y,Z,K){this._selectionStart=Y,this._selectionEnd=Z,this._columnSelectMode=K}createRow(Y,Z,K,ee,oe,ce,le,ne,ae,_e,fe){const ge=[],he=this._characterJoinerService.getJoinedCharacters(Z),X=this._themeService.colors;let re,Q=Y.getNoBgTrimmedLength();K&&Q<ce+1&&(Q=ce+1);let se=0,Ce="",we=0,Be=0,Re=0,de=!1,ie=0,De=!1,be=0;const Te=[],Pe=_e!==-1&&fe!==-1;for(let Je=0;Je<Q;Je++){Y.loadCell(Je,this._workCell);let Ie=this._workCell.getWidth();if(Ie===0)continue;let We=!1,Xe=Je,ze=this._workCell;if(he.length>0&&Je===he[0][0]){We=!0;const it=he.shift();ze=new L.JoinedCellData(this._workCell,Y.translateToString(!0,it[0],it[1]),it[1]-it[0]),Xe=it[1]-1,Ie=ze.getWidth()}const At=this._isCellInSelection(Je,Z),cr=K&&Je===ce,$t=Pe&&Je>=_e&&Je<=fe;let nt=!1;this._decorationService.forEachDecorationAtCell(Je,Z,void 0,(it=>{nt=!0}));let dt=ze.getChars()||j.WHITESPACE_CELL_CHAR;if(dt===" "&&(ze.isUnderline()||ze.isOverline())&&(dt=" "),be=Ie*ne-ae.get(dt,ze.isBold(),ze.isItalic()),re){if(se&&(At&&De||!At&&!De&&ze.bg===we)&&(At&&De&&X.selectionForeground||ze.fg===Be)&&ze.extended.ext===Re&&$t===de&&be===ie&&!cr&&!We&&!nt){ze.isInvisible()?Ce+=j.WHITESPACE_CELL_CHAR:Ce+=dt,se++;continue}se&&(re.textContent=Ce),re=this._document.createElement("span"),se=0,Ce=""}else re=this._document.createElement("span");if(we=ze.bg,Be=ze.fg,Re=ze.extended.ext,de=$t,ie=be,De=At,We&&ce>=Je&&ce<=Xe&&(ce=Je),!this._coreService.isCursorHidden&&cr&&this._coreService.isCursorInitialized){if(Te.push("xterm-cursor"),this._coreBrowserService.isFocused)le&&Te.push("xterm-cursor-blink"),Te.push(ee==="bar"?"xterm-cursor-bar":ee==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(oe)switch(oe){case"outline":Te.push("xterm-cursor-outline");break;case"block":Te.push("xterm-cursor-block");break;case"bar":Te.push("xterm-cursor-bar");break;case"underline":Te.push("xterm-cursor-underline")}}if(ze.isBold()&&Te.push("xterm-bold"),ze.isItalic()&&Te.push("xterm-italic"),ze.isDim()&&Te.push("xterm-dim"),Ce=ze.isInvisible()?j.WHITESPACE_CELL_CHAR:ze.getChars()||j.WHITESPACE_CELL_CHAR,ze.isUnderline()&&(Te.push(`xterm-underline-${ze.extended.underlineStyle}`),Ce===" "&&(Ce=" "),!ze.isUnderlineColorDefault()))if(ze.isUnderlineColorRGB())re.style.textDecorationColor=`rgb(${N.AttributeData.toColorRGB(ze.getUnderlineColor()).join(",")})`;else{let it=ze.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ze.isBold()&&it<8&&(it+=8),re.style.textDecorationColor=X.ansi[it].css}ze.isOverline()&&(Te.push("xterm-overline"),Ce===" "&&(Ce=" ")),ze.isStrikethrough()&&Te.push("xterm-strikethrough"),$t&&(re.style.textDecoration="underline");let gt=ze.getFgColor(),Ot=ze.getFgColorMode(),wt=ze.getBgColor(),vt=ze.getBgColorMode();const wr=!!ze.isInverse();if(wr){const it=gt;gt=wt,wt=it;const pi=Ot;Ot=vt,vt=pi}let ut,Jt,yt,Nt=!1;switch(this._decorationService.forEachDecorationAtCell(Je,Z,void 0,(it=>{it.options.layer!=="top"&&Nt||(it.backgroundColorRGB&&(vt=50331648,wt=it.backgroundColorRGB.rgba>>8&16777215,ut=it.backgroundColorRGB),it.foregroundColorRGB&&(Ot=50331648,gt=it.foregroundColorRGB.rgba>>8&16777215,Jt=it.foregroundColorRGB),Nt=it.options.layer==="top")})),!Nt&&At&&(ut=this._coreBrowserService.isFocused?X.selectionBackgroundOpaque:X.selectionInactiveBackgroundOpaque,wt=ut.rgba>>8&16777215,vt=50331648,Nt=!0,X.selectionForeground&&(Ot=50331648,gt=X.selectionForeground.rgba>>8&16777215,Jt=X.selectionForeground)),Nt&&Te.push("xterm-decoration-top"),vt){case 16777216:case 33554432:yt=X.ansi[wt],Te.push(`xterm-bg-${wt}`);break;case 50331648:yt=H.channels.toColor(wt>>16,wt>>8&255,255&wt),this._addStyle(re,`background-color:#${J((wt>>>0).toString(16),"0",6)}`);break;default:wr?(yt=X.foreground,Te.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):yt=X.background}switch(ut||ze.isDim()&&(ut=H.color.multiplyOpacity(yt,.5)),Ot){case 16777216:case 33554432:ze.isBold()&><8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(gt+=8),this._applyMinimumContrast(re,yt,X.ansi[gt],ze,ut,void 0)||Te.push(`xterm-fg-${gt}`);break;case 50331648:const it=H.channels.toColor(gt>>16&255,gt>>8&255,255>);this._applyMinimumContrast(re,yt,it,ze,ut,Jt)||this._addStyle(re,`color:#${J(gt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(re,yt,X.foreground,ze,ut,Jt)||wr&&Te.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}Te.length&&(re.className=Te.join(" "),Te.length=0),cr||We||nt?re.textContent=Ce:se++,be!==this.defaultSpacing&&(re.style.letterSpacing=`${be}px`),ge.push(re),Je=Xe}return re&&se&&(re.textContent=Ce),ge}_applyMinimumContrast(Y,Z,K,ee,oe,ce){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,R.treatGlyphAsBackgroundColor)(ee.getCode()))return!1;const le=this._getContrastCache(ee);let ne;if(oe||ce||(ne=le.getColor(Z.rgba,K.rgba)),ne===void 0){const ae=this._optionsService.rawOptions.minimumContrastRatio/(ee.isDim()?2:1);ne=H.color.ensureContrastRatio(oe||Z,ce||K,ae),le.setColor((oe||Z).rgba,(ce||K).rgba,ne??null)}return!!ne&&(this._addStyle(Y,`color:${ne.css}`),!0)}_getContrastCache(Y){return Y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(Y,Z){Y.setAttribute("style",`${Y.getAttribute("style")||""}${Z};`)}_isCellInSelection(Y,Z){const K=this._selectionStart,ee=this._selectionEnd;return!(!K||!ee)&&(this._columnSelectMode?K[0]<=ee[0]?Y>=K[0]&&Z>=K[1]&&Y<ee[0]&&Z<=ee[1]:Y<K[0]&&Z>=K[1]&&Y>=ee[0]&&Z<=ee[1]:Z>K[1]&&Z<ee[1]||K[1]===ee[1]&&Z===K[1]&&Y>=K[0]&&Y<ee[0]||K[1]<ee[1]&&Z===ee[1]&&Y<ee[0]||K[1]<ee[1]&&Z===K[1]&&Y>=K[0])}};function J(Y,Z,K){for(;Y.length<K;)Y=Z+Y;return Y}a.DomRendererRowFactory=V=f([C(1,x.ICharacterJoinerService),C(2,W.IOptionsService),C(3,x.ICoreBrowserService),C(4,W.ICoreService),C(5,W.IDecorationService),C(6,x.IThemeService)],V)},2550:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(l,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.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 C=l.createElement("span");C.classList.add("xterm-char-measure-element");const h=l.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const j=l.createElement("span");j.classList.add("xterm-char-measure-element"),j.style.fontStyle="italic";const U=l.createElement("span");U.classList.add("xterm-char-measure-element"),U.style.fontWeight="bold",U.style.fontStyle="italic",this._measureElements=[C,h,j,U],this._container.appendChild(C),this._container.appendChild(h),this._container.appendChild(j),this._container.appendChild(U),f.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(l,f,C,h){l===this._font&&f===this._fontSize&&C===this._weight&&h===this._weightBold||(this._font=l,this._fontSize=f,this._weight=C,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${C}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${C}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(l,f,C){let h=0;if(!f&&!C&&l.length===1&&(h=l.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const W=this._measure(l,0);return W>0&&(this._flat[h]=W),W}let j=l;f&&(j+="B"),C&&(j+="I");let U=this._holey.get(j);if(U===void 0){let W=0;f&&(W|=1),C&&(W|=2),U=this._measure(l,W),U>0&&this._holey.set(j,U)}return U}_measure(l,f){const C=this._measureElements[f];return C.textContent=l.repeat(32),C.offsetWidth/32}}},2223:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const f=l(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(d,a)=>{function l(C){return 57508<=C&&C<=57558}function f(C){return C>=128512&&C<=128591||C>=127744&&C<=128511||C>=128640&&C<=128767||C>=9728&&C<=9983||C>=9984&&C<=10175||C>=65024&&C<=65039||C>=129280&&C<=129535||C>=127462&&C<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(C){if(!C)throw new Error("value must not be falsy");return C},a.isPowerlineGlyph=l,a.isRestrictedPowerlineGlyph=function(C){return 57520<=C&&C<=57527},a.isEmoji=f,a.allowRescaling=function(C,h,j,U){return h===1&&j>Math.ceil(1.5*U)&&C!==void 0&&C>255&&!f(C)&&!l(C)&&!(function(W){return 57344<=W&&W<=63743})(C)},a.treatGlyphAsBackgroundColor=function(C){return l(C)||(function(h){return 9472<=h&&h<=9631})(C)},a.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}}}},a.computeNextVariantOffset=function(C,h,j=0){return(C-(2*Math.round(h)-j))%(2*Math.round(h))}},6052:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class l{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(C,h,j,U=!1){if(this.selectionStart=h,this.selectionEnd=j,!h||!j||h[0]===j[0]&&h[1]===j[1])return void this.clear();const W=C.buffers.active.ydisp,H=h[1]-W,x=j[1]-W,L=Math.max(H,0),R=Math.min(x,C.rows-1);L>=C.rows||R<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=U,this.viewportStartRow=H,this.viewportEndRow=x,this.viewportCappedStartRow=L,this.viewportCappedEndRow=R,this.startCol=h[0],this.endCol=j[0])}isCellSelected(C,h,j){return!!this.hasSelection&&(j-=C.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&j>=this.viewportCappedStartRow&&h<this.endCol&&j<=this.viewportCappedEndRow:h<this.startCol&&j>=this.viewportCappedStartRow&&h>=this.endCol&&j<=this.viewportCappedEndRow:j>this.viewportStartRow&&j<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&j===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&j===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&j===this.viewportStartRow&&h>=this.startCol)}}a.createSelectionRenderModel=function(){return new l}},456:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(l){this._bufferService=l,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 l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,f=this.selectionEnd;return!(!l||!f)&&(l[1]>f[1]||l[1]===f[1]&&l[0]>f[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(d,a,l){var f=this&&this.__decorate||function(R,N,V,J){var Y,Z=arguments.length,K=Z<3?N:J===null?J=Object.getOwnPropertyDescriptor(N,V):J;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(R,N,V,J);else for(var ee=R.length-1;ee>=0;ee--)(Y=R[ee])&&(K=(Z<3?Y(K):Z>3?Y(N,V,K):Y(N,V))||K);return Z>3&&K&&Object.defineProperty(N,V,K),K},C=this&&this.__param||function(R,N){return function(V,J){N(V,J,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const h=l(2585),j=l(8460),U=l(844);let W=a.CharSizeService=class extends U.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(R,N,V){super(),this._optionsService=V,this.width=0,this.height=0,this._onCharSizeChange=this.register(new j.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new L(this._optionsService))}catch{this._measureStrategy=this.register(new x(R,N,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const R=this._measureStrategy.measure();R.width===this.width&&R.height===this.height||(this.width=R.width,this.height=R.height,this._onCharSizeChange.fire())}};a.CharSizeService=W=f([C(2,h.IOptionsService)],W);class H extends U.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(N,V){N!==void 0&&N>0&&V!==void 0&&V>0&&(this._result.width=N,this._result.height=V)}}class x extends H{constructor(N,V,J){super(),this._document=N,this._parentElement=V,this._optionsService=J,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 L extends H{constructor(N){super(),this._optionsService=N,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const V=this._ctx.measureText("W");if(!("width"in V&&"fontBoundingBoxAscent"in V&&"fontBoundingBoxDescent"in V))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const N=this._ctx.measureText("W");return this._validateAndSet(N.width,N.fontBoundingBoxAscent+N.fontBoundingBoxDescent),this._result}}},4269:function(d,a,l){var f=this&&this.__decorate||function(L,R,N,V){var J,Y=arguments.length,Z=Y<3?R:V===null?V=Object.getOwnPropertyDescriptor(R,N):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(L,R,N,V);else for(var K=L.length-1;K>=0;K--)(J=L[K])&&(Z=(Y<3?J(Z):Y>3?J(R,N,Z):J(R,N))||Z);return Y>3&&Z&&Object.defineProperty(R,N,Z),Z},C=this&&this.__param||function(L,R){return function(N,V){R(N,V,L)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const h=l(3734),j=l(643),U=l(511),W=l(2585);class H extends h.AttributeData{constructor(R,N,V){super(),this.content=0,this.combinedData="",this.fg=R.fg,this.bg=R.bg,this.combinedData=N,this._width=V}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(R){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=H;let x=a.CharacterJoinerService=class uc{constructor(R){this._bufferService=R,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new U.CellData}register(R){const N={id:this._nextCharacterJoinerId++,handler:R};return this._characterJoiners.push(N),N.id}deregister(R){for(let N=0;N<this._characterJoiners.length;N++)if(this._characterJoiners[N].id===R)return this._characterJoiners.splice(N,1),!0;return!1}getJoinedCharacters(R){if(this._characterJoiners.length===0)return[];const N=this._bufferService.buffer.lines.get(R);if(!N||N.length===0)return[];const V=[],J=N.translateToString(!0);let Y=0,Z=0,K=0,ee=N.getFg(0),oe=N.getBg(0);for(let ce=0;ce<N.getTrimmedLength();ce++)if(N.loadCell(ce,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==ee||this._workCell.bg!==oe){if(ce-Y>1){const le=this._getJoinedRanges(J,K,Z,N,Y);for(let ne=0;ne<le.length;ne++)V.push(le[ne])}Y=ce,K=Z,ee=this._workCell.fg,oe=this._workCell.bg}Z+=this._workCell.getChars().length||j.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-Y>1){const ce=this._getJoinedRanges(J,K,Z,N,Y);for(let le=0;le<ce.length;le++)V.push(ce[le])}return V}_getJoinedRanges(R,N,V,J,Y){const Z=R.substring(N,V);let K=[];try{K=this._characterJoiners[0].handler(Z)}catch(ee){console.error(ee)}for(let ee=1;ee<this._characterJoiners.length;ee++)try{const oe=this._characterJoiners[ee].handler(Z);for(let ce=0;ce<oe.length;ce++)uc._mergeRanges(K,oe[ce])}catch(oe){console.error(oe)}return this._stringRangesToCellRanges(K,J,Y),K}_stringRangesToCellRanges(R,N,V){let J=0,Y=!1,Z=0,K=R[J];if(K){for(let ee=V;ee<this._bufferService.cols;ee++){const oe=N.getWidth(ee),ce=N.getString(ee).length||j.WHITESPACE_CELL_CHAR.length;if(oe!==0){if(!Y&&K[0]<=Z&&(K[0]=ee,Y=!0),K[1]<=Z){if(K[1]=ee,K=R[++J],!K)break;K[0]<=Z?(K[0]=ee,Y=!0):Y=!1}Z+=ce}}K&&(K[1]=this._bufferService.cols)}}static _mergeRanges(R,N){let V=!1;for(let J=0;J<R.length;J++){const Y=R[J];if(V){if(N[1]<=Y[0])return R[J-1][1]=N[1],R;if(N[1]<=Y[1])return R[J-1][1]=Math.max(N[1],Y[1]),R.splice(J,1),R;R.splice(J,1),J--}else{if(N[1]<=Y[0])return R.splice(J,0,N),R;if(N[1]<=Y[1])return Y[0]=Math.min(N[0],Y[0]),R;N[0]<Y[1]&&(Y[0]=Math.min(N[0],Y[0]),V=!0)}}return V?R[R.length-1][1]=N[1]:R.push(N),R}};a.CharacterJoinerService=x=f([C(0,W.IBufferService)],x)},5114:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const f=l(844),C=l(8460),h=l(3656);class j extends f.Disposable{constructor(H,x,L){super(),this._textarea=H,this._window=x,this.mainDocument=L,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new U(this._window),this._onDprChange=this.register(new C.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new C.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((R=>this._screenDprMonitor.setWindow(R)))),this.register((0,C.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(H){this._window!==H&&(this._window=H,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}}a.CoreBrowserService=j;class U extends f.Disposable{constructor(H){super(),this._parentWindow=H,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new C.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(H){this._parentWindow=H,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var H;this._outerListener&&((H=this._resolutionMediaMatchList)==null||H.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:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const f=l(844);class C extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(j){return this.linkProviders.push(j),{dispose:()=>{const U=this.linkProviders.indexOf(j);U!==-1&&this.linkProviders.splice(U,1)}}}}a.LinkProviderService=C},8934:function(d,a,l){var f=this&&this.__decorate||function(W,H,x,L){var R,N=arguments.length,V=N<3?H:L===null?L=Object.getOwnPropertyDescriptor(H,x):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(W,H,x,L);else for(var J=W.length-1;J>=0;J--)(R=W[J])&&(V=(N<3?R(V):N>3?R(H,x,V):R(H,x))||V);return N>3&&V&&Object.defineProperty(H,x,V),V},C=this&&this.__param||function(W,H){return function(x,L){H(x,L,W)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const h=l(4725),j=l(9806);let U=a.MouseService=class{constructor(W,H){this._renderService=W,this._charSizeService=H}getCoords(W,H,x,L,R){return(0,j.getCoords)(window,W,H,x,L,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,R)}getMouseReportCoords(W,H){const x=(0,j.getCoordsRelativeToElement)(window,W,H);if(this._charSizeService.hasValidSize)return x[0]=Math.min(Math.max(x[0],0),this._renderService.dimensions.css.canvas.width-1),x[1]=Math.min(Math.max(x[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(x[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(x[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(x[0]),y:Math.floor(x[1])}}};a.MouseService=U=f([C(0,h.IRenderService),C(1,h.ICharSizeService)],U)},3230:function(d,a,l){var f=this&&this.__decorate||function(R,N,V,J){var Y,Z=arguments.length,K=Z<3?N:J===null?J=Object.getOwnPropertyDescriptor(N,V):J;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(R,N,V,J);else for(var ee=R.length-1;ee>=0;ee--)(Y=R[ee])&&(K=(Z<3?Y(K):Z>3?Y(N,V,K):Y(N,V))||K);return Z>3&&K&&Object.defineProperty(N,V,K),K},C=this&&this.__param||function(R,N){return function(V,J){N(V,J,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const h=l(6193),j=l(4725),U=l(8460),W=l(844),H=l(7226),x=l(2585);let L=a.RenderService=class extends W.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(R,N,V,J,Y,Z,K,ee){super(),this._rowCount=R,this._charSizeService=J,this._renderer=this.register(new W.MutableDisposable),this._pausedResizeTask=new H.DebouncedIdleTask,this._observerDisposable=this.register(new W.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new U.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new U.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new U.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new U.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((oe,ce)=>this._renderRows(oe,ce)),K),this.register(this._renderDebouncer),this.register(K.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(Z.onResize((()=>this._fullRefresh()))),this.register(Z.buffers.onBufferActivate((()=>{var oe;return(oe=this._renderer.value)==null?void 0:oe.clear()}))),this.register(V.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(Y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(Y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(V.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(Z.cols,Z.rows),this._fullRefresh()}))),this.register(V.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(Z.buffer.y,Z.buffer.y,!0)))),this.register(ee.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(K.window,N),this.register(K.onWindowChange((oe=>this._registerIntersectionObserver(oe,N))))}_registerIntersectionObserver(R,N){if("IntersectionObserver"in R){const V=new R.IntersectionObserver((J=>this._handleIntersectionChange(J[J.length-1])),{threshold:0});V.observe(N),this._observerDisposable.value=(0,W.toDisposable)((()=>V.disconnect()))}}_handleIntersectionChange(R){this._isPaused=R.isIntersecting===void 0?R.intersectionRatio===0:!R.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(R,N,V=!1){this._isPaused?this._needsFullRefresh=!0:(V||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(R,N,this._rowCount))}_renderRows(R,N){this._renderer.value&&(R=Math.min(R,this._rowCount-1),N=Math.min(N,this._rowCount-1),this._renderer.value.renderRows(R,N),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:R,end:N}),this._onRender.fire({start:R,end:N}),this._isNextRenderRedrawOnly=!0)}resize(R,N){this._rowCount=N,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(R){this._renderer.value=R,this._renderer.value&&(this._renderer.value.onRequestRedraw((N=>this.refreshRows(N.start,N.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(R){return this._renderDebouncer.addRefreshCallback(R)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var R,N;this._renderer.value&&((N=(R=this._renderer.value).clearTextureAtlas)==null||N.call(R),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(R,N){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var V;return(V=this._renderer.value)==null?void 0:V.handleResize(R,N)})):this._renderer.value.handleResize(R,N),this._fullRefresh())}handleCharSizeChanged(){var R;(R=this._renderer.value)==null||R.handleCharSizeChanged()}handleBlur(){var R;(R=this._renderer.value)==null||R.handleBlur()}handleFocus(){var R;(R=this._renderer.value)==null||R.handleFocus()}handleSelectionChanged(R,N,V){var J;this._selectionState.start=R,this._selectionState.end=N,this._selectionState.columnSelectMode=V,(J=this._renderer.value)==null||J.handleSelectionChanged(R,N,V)}handleCursorMove(){var R;(R=this._renderer.value)==null||R.handleCursorMove()}clear(){var R;(R=this._renderer.value)==null||R.clear()}};a.RenderService=L=f([C(2,x.IOptionsService),C(3,j.ICharSizeService),C(4,x.IDecorationService),C(5,x.IBufferService),C(6,j.ICoreBrowserService),C(7,j.IThemeService)],L)},9312:function(d,a,l){var f=this&&this.__decorate||function(K,ee,oe,ce){var le,ne=arguments.length,ae=ne<3?ee:ce===null?ce=Object.getOwnPropertyDescriptor(ee,oe):ce;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(K,ee,oe,ce);else for(var _e=K.length-1;_e>=0;_e--)(le=K[_e])&&(ae=(ne<3?le(ae):ne>3?le(ee,oe,ae):le(ee,oe))||ae);return ne>3&&ae&&Object.defineProperty(ee,oe,ae),ae},C=this&&this.__param||function(K,ee){return function(oe,ce){ee(oe,ce,K)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const h=l(9806),j=l(9504),U=l(456),W=l(4725),H=l(8460),x=l(844),L=l(6114),R=l(4841),N=l(511),V=l(2585),J=" ",Y=new RegExp(J,"g");let Z=a.SelectionService=class extends x.Disposable{constructor(K,ee,oe,ce,le,ne,ae,_e,fe){super(),this._element=K,this._screenElement=ee,this._linkifier=oe,this._bufferService=ce,this._coreService=le,this._mouseService=ne,this._optionsService=ae,this._renderService=_e,this._coreBrowserService=fe,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new N.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new H.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new H.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new H.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=ge=>this._handleMouseMove(ge),this._mouseUpListener=ge=>this._handleMouseUp(ge),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((ge=>this._handleTrim(ge))),this.register(this._bufferService.buffers.onBufferActivate((ge=>this._handleBufferActivate(ge)))),this.enable(),this._model=new U.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,x.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 K=this._model.finalSelectionStart,ee=this._model.finalSelectionEnd;return!(!K||!ee||K[0]===ee[0]&&K[1]===ee[1])}get selectionText(){const K=this._model.finalSelectionStart,ee=this._model.finalSelectionEnd;if(!K||!ee)return"";const oe=this._bufferService.buffer,ce=[];if(this._activeSelectionMode===3){if(K[0]===ee[0])return"";const le=K[0]<ee[0]?K[0]:ee[0],ne=K[0]<ee[0]?ee[0]:K[0];for(let ae=K[1];ae<=ee[1];ae++){const _e=oe.translateBufferLineToString(ae,!0,le,ne);ce.push(_e)}}else{const le=K[1]===ee[1]?ee[0]:void 0;ce.push(oe.translateBufferLineToString(K[1],!0,K[0],le));for(let ne=K[1]+1;ne<=ee[1]-1;ne++){const ae=oe.lines.get(ne),_e=oe.translateBufferLineToString(ne,!0);ae!=null&&ae.isWrapped?ce[ce.length-1]+=_e:ce.push(_e)}if(K[1]!==ee[1]){const ne=oe.lines.get(ee[1]),ae=oe.translateBufferLineToString(ee[1],!0,0,ee[0]);ne&&ne.isWrapped?ce[ce.length-1]+=ae:ce.push(ae)}}return ce.map((le=>le.replace(Y," "))).join(L.isWindows?`\r
|
|
78
|
-
`:`
|
|
79
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(K){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),L.isLinux&&K&&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(K){const ee=this._getMouseBufferCoords(K),oe=this._model.finalSelectionStart,ce=this._model.finalSelectionEnd;return!!(oe&&ce&&ee)&&this._areCoordsInSelection(ee,oe,ce)}isCellInSelection(K,ee){const oe=this._model.finalSelectionStart,ce=this._model.finalSelectionEnd;return!(!oe||!ce)&&this._areCoordsInSelection([K,ee],oe,ce)}_areCoordsInSelection(K,ee,oe){return K[1]>ee[1]&&K[1]<oe[1]||ee[1]===oe[1]&&K[1]===ee[1]&&K[0]>=ee[0]&&K[0]<oe[0]||ee[1]<oe[1]&&K[1]===oe[1]&&K[0]<oe[0]||ee[1]<oe[1]&&K[1]===ee[1]&&K[0]>=ee[0]}_selectWordAtCursor(K,ee){var le,ne;const oe=(ne=(le=this._linkifier.currentLink)==null?void 0:le.link)==null?void 0:ne.range;if(oe)return this._model.selectionStart=[oe.start.x-1,oe.start.y-1],this._model.selectionStartLength=(0,R.getRangeLength)(oe,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const ce=this._getMouseBufferCoords(K);return!!ce&&(this._selectWordAt(ce,ee),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(K,ee){this._model.clearSelection(),K=Math.max(K,0),ee=Math.min(ee,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,K],this._model.selectionEnd=[this._bufferService.cols,ee],this.refresh(),this._onSelectionChange.fire()}_handleTrim(K){this._model.handleTrim(K)&&this.refresh()}_getMouseBufferCoords(K){const ee=this._mouseService.getCoords(K,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(ee)return ee[0]--,ee[1]--,ee[1]+=this._bufferService.buffer.ydisp,ee}_getMouseEventScrollAmount(K){let ee=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,K,this._screenElement)[1];const oe=this._renderService.dimensions.css.canvas.height;return ee>=0&&ee<=oe?0:(ee>oe&&(ee-=oe),ee=Math.min(Math.max(ee,-50),50),ee/=50,ee/Math.abs(ee)+Math.round(14*ee))}shouldForceSelection(K){return L.isMac?K.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:K.shiftKey}handleMouseDown(K){if(this._mouseDownTimeStamp=K.timeStamp,(K.button!==2||!this.hasSelection)&&K.button===0){if(!this._enabled){if(!this.shouldForceSelection(K))return;K.stopPropagation()}K.preventDefault(),this._dragScrollAmount=0,this._enabled&&K.shiftKey?this._handleIncrementalClick(K):K.detail===1?this._handleSingleClick(K):K.detail===2?this._handleDoubleClick(K):K.detail===3&&this._handleTripleClick(K),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(K){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(K))}_handleSingleClick(K){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(K)?3:0,this._model.selectionStart=this._getMouseBufferCoords(K),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const ee=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);ee&&ee.length!==this._model.selectionStart[0]&&ee.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(K){this._selectWordAtCursor(K,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(K){const ee=this._getMouseBufferCoords(K);ee&&(this._activeSelectionMode=2,this._selectLineAt(ee[1]))}shouldColumnSelect(K){return K.altKey&&!(L.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(K){if(K.stopImmediatePropagation(),!this._model.selectionStart)return;const ee=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(K),!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(K),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const oe=this._bufferService.buffer;if(this._model.selectionEnd[1]<oe.lines.length){const ce=oe.lines.get(this._model.selectionEnd[1]);ce&&ce.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}ee&&ee[0]===this._model.selectionEnd[0]&&ee[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 K=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(K.ydisp+this._bufferService.rows,K.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=K.ydisp),this.refresh()}}_handleMouseUp(K){const ee=K.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&ee<500&&K.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const oe=this._mouseService.getCoords(K,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(oe&&oe[0]!==void 0&&oe[1]!==void 0){const ce=(0,j.moveToCellSequence)(oe[0]-1,oe[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(ce,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const K=this._model.finalSelectionStart,ee=this._model.finalSelectionEnd,oe=!(!K||!ee||K[0]===ee[0]&&K[1]===ee[1]);oe?K&&ee&&(this._oldSelectionStart&&this._oldSelectionEnd&&K[0]===this._oldSelectionStart[0]&&K[1]===this._oldSelectionStart[1]&&ee[0]===this._oldSelectionEnd[0]&&ee[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(K,ee,oe)):this._oldHasSelection&&this._fireOnSelectionChange(K,ee,oe)}_fireOnSelectionChange(K,ee,oe){this._oldSelectionStart=K,this._oldSelectionEnd=ee,this._oldHasSelection=oe,this._onSelectionChange.fire()}_handleBufferActivate(K){this.clearSelection(),this._trimListener.dispose(),this._trimListener=K.activeBuffer.lines.onTrim((ee=>this._handleTrim(ee)))}_convertViewportColToCharacterIndex(K,ee){let oe=ee;for(let ce=0;ee>=ce;ce++){const le=K.loadCell(ce,this._workCell).getChars().length;this._workCell.getWidth()===0?oe--:le>1&&ee!==ce&&(oe+=le-1)}return oe}setSelection(K,ee,oe){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[K,ee],this._model.selectionStartLength=oe,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(K){this._isClickInSelection(K)||(this._selectWordAtCursor(K,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(K,ee,oe=!0,ce=!0){if(K[0]>=this._bufferService.cols)return;const le=this._bufferService.buffer,ne=le.lines.get(K[1]);if(!ne)return;const ae=le.translateBufferLineToString(K[1],!1);let _e=this._convertViewportColToCharacterIndex(ne,K[0]),fe=_e;const ge=K[0]-_e;let he=0,X=0,re=0,Q=0;if(ae.charAt(_e)===" "){for(;_e>0&&ae.charAt(_e-1)===" ";)_e--;for(;fe<ae.length&&ae.charAt(fe+1)===" ";)fe++}else{let we=K[0],Be=K[0];ne.getWidth(we)===0&&(he++,we--),ne.getWidth(Be)===2&&(X++,Be++);const Re=ne.getString(Be).length;for(Re>1&&(Q+=Re-1,fe+=Re-1);we>0&&_e>0&&!this._isCharWordSeparator(ne.loadCell(we-1,this._workCell));){ne.loadCell(we-1,this._workCell);const de=this._workCell.getChars().length;this._workCell.getWidth()===0?(he++,we--):de>1&&(re+=de-1,_e-=de-1),_e--,we--}for(;Be<ne.length&&fe+1<ae.length&&!this._isCharWordSeparator(ne.loadCell(Be+1,this._workCell));){ne.loadCell(Be+1,this._workCell);const de=this._workCell.getChars().length;this._workCell.getWidth()===2?(X++,Be++):de>1&&(Q+=de-1,fe+=de-1),fe++,Be++}}fe++;let se=_e+ge-he+re,Ce=Math.min(this._bufferService.cols,fe-_e+he+X-re-Q);if(ee||ae.slice(_e,fe).trim()!==""){if(oe&&se===0&&ne.getCodePoint(0)!==32){const we=le.lines.get(K[1]-1);if(we&&ne.isWrapped&&we.getCodePoint(this._bufferService.cols-1)!==32){const Be=this._getWordAt([this._bufferService.cols-1,K[1]-1],!1,!0,!1);if(Be){const Re=this._bufferService.cols-Be.start;se-=Re,Ce+=Re}}}if(ce&&se+Ce===this._bufferService.cols&&ne.getCodePoint(this._bufferService.cols-1)!==32){const we=le.lines.get(K[1]+1);if(we!=null&&we.isWrapped&&we.getCodePoint(0)!==32){const Be=this._getWordAt([0,K[1]+1],!1,!1,!0);Be&&(Ce+=Be.length)}}return{start:se,length:Ce}}}_selectWordAt(K,ee){const oe=this._getWordAt(K,ee);if(oe){for(;oe.start<0;)oe.start+=this._bufferService.cols,K[1]--;this._model.selectionStart=[oe.start,K[1]],this._model.selectionStartLength=oe.length}}_selectToWordAt(K){const ee=this._getWordAt(K,!0);if(ee){let oe=K[1];for(;ee.start<0;)ee.start+=this._bufferService.cols,oe--;if(!this._model.areSelectionValuesReversed())for(;ee.start+ee.length>this._bufferService.cols;)ee.length-=this._bufferService.cols,oe++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?ee.start:ee.start+ee.length,oe]}}_isCharWordSeparator(K){return K.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(K.getChars())>=0}_selectLineAt(K){const ee=this._bufferService.buffer.getWrappedRangeForLine(K),oe={start:{x:0,y:ee.first},end:{x:this._bufferService.cols-1,y:ee.last}};this._model.selectionStart=[0,ee.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,R.getRangeLength)(oe,this._bufferService.cols)}};a.SelectionService=Z=f([C(3,V.IBufferService),C(4,V.ICoreService),C(5,W.IMouseService),C(6,V.IOptionsService),C(7,W.IRenderService),C(8,W.ICoreBrowserService)],Z)},4725:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const f=l(8343);a.ICharSizeService=(0,f.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),a.IMouseService=(0,f.createDecorator)("MouseService"),a.IRenderService=(0,f.createDecorator)("RenderService"),a.ISelectionService=(0,f.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,f.createDecorator)("ThemeService"),a.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(d,a,l){var f=this&&this.__decorate||function(Z,K,ee,oe){var ce,le=arguments.length,ne=le<3?K:oe===null?oe=Object.getOwnPropertyDescriptor(K,ee):oe;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(Z,K,ee,oe);else for(var ae=Z.length-1;ae>=0;ae--)(ce=Z[ae])&&(ne=(le<3?ce(ne):le>3?ce(K,ee,ne):ce(K,ee))||ne);return le>3&&ne&&Object.defineProperty(K,ee,ne),ne},C=this&&this.__param||function(Z,K){return function(ee,oe){K(ee,oe,Z)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const h=l(7239),j=l(8055),U=l(8460),W=l(844),H=l(2585),x=j.css.toColor("#ffffff"),L=j.css.toColor("#000000"),R=j.css.toColor("#ffffff"),N=j.css.toColor("#000000"),V={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const Z=[j.css.toColor("#2e3436"),j.css.toColor("#cc0000"),j.css.toColor("#4e9a06"),j.css.toColor("#c4a000"),j.css.toColor("#3465a4"),j.css.toColor("#75507b"),j.css.toColor("#06989a"),j.css.toColor("#d3d7cf"),j.css.toColor("#555753"),j.css.toColor("#ef2929"),j.css.toColor("#8ae234"),j.css.toColor("#fce94f"),j.css.toColor("#729fcf"),j.css.toColor("#ad7fa8"),j.css.toColor("#34e2e2"),j.css.toColor("#eeeeec")],K=[0,95,135,175,215,255];for(let ee=0;ee<216;ee++){const oe=K[ee/36%6|0],ce=K[ee/6%6|0],le=K[ee%6];Z.push({css:j.channels.toCss(oe,ce,le),rgba:j.channels.toRgba(oe,ce,le)})}for(let ee=0;ee<24;ee++){const oe=8+10*ee;Z.push({css:j.channels.toCss(oe,oe,oe),rgba:j.channels.toRgba(oe,oe,oe)})}return Z})());let J=a.ThemeService=class extends W.Disposable{get colors(){return this._colors}constructor(Z){super(),this._optionsService=Z,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new U.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:x,background:L,cursor:R,cursorAccent:N,selectionForeground:void 0,selectionBackgroundTransparent:V,selectionBackgroundOpaque:j.color.blend(L,V),selectionInactiveBackgroundTransparent:V,selectionInactiveBackgroundOpaque:j.color.blend(L,V),ansi:a.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(Z={}){const K=this._colors;if(K.foreground=Y(Z.foreground,x),K.background=Y(Z.background,L),K.cursor=Y(Z.cursor,R),K.cursorAccent=Y(Z.cursorAccent,N),K.selectionBackgroundTransparent=Y(Z.selectionBackground,V),K.selectionBackgroundOpaque=j.color.blend(K.background,K.selectionBackgroundTransparent),K.selectionInactiveBackgroundTransparent=Y(Z.selectionInactiveBackground,K.selectionBackgroundTransparent),K.selectionInactiveBackgroundOpaque=j.color.blend(K.background,K.selectionInactiveBackgroundTransparent),K.selectionForeground=Z.selectionForeground?Y(Z.selectionForeground,j.NULL_COLOR):void 0,K.selectionForeground===j.NULL_COLOR&&(K.selectionForeground=void 0),j.color.isOpaque(K.selectionBackgroundTransparent)&&(K.selectionBackgroundTransparent=j.color.opacity(K.selectionBackgroundTransparent,.3)),j.color.isOpaque(K.selectionInactiveBackgroundTransparent)&&(K.selectionInactiveBackgroundTransparent=j.color.opacity(K.selectionInactiveBackgroundTransparent,.3)),K.ansi=a.DEFAULT_ANSI_COLORS.slice(),K.ansi[0]=Y(Z.black,a.DEFAULT_ANSI_COLORS[0]),K.ansi[1]=Y(Z.red,a.DEFAULT_ANSI_COLORS[1]),K.ansi[2]=Y(Z.green,a.DEFAULT_ANSI_COLORS[2]),K.ansi[3]=Y(Z.yellow,a.DEFAULT_ANSI_COLORS[3]),K.ansi[4]=Y(Z.blue,a.DEFAULT_ANSI_COLORS[4]),K.ansi[5]=Y(Z.magenta,a.DEFAULT_ANSI_COLORS[5]),K.ansi[6]=Y(Z.cyan,a.DEFAULT_ANSI_COLORS[6]),K.ansi[7]=Y(Z.white,a.DEFAULT_ANSI_COLORS[7]),K.ansi[8]=Y(Z.brightBlack,a.DEFAULT_ANSI_COLORS[8]),K.ansi[9]=Y(Z.brightRed,a.DEFAULT_ANSI_COLORS[9]),K.ansi[10]=Y(Z.brightGreen,a.DEFAULT_ANSI_COLORS[10]),K.ansi[11]=Y(Z.brightYellow,a.DEFAULT_ANSI_COLORS[11]),K.ansi[12]=Y(Z.brightBlue,a.DEFAULT_ANSI_COLORS[12]),K.ansi[13]=Y(Z.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),K.ansi[14]=Y(Z.brightCyan,a.DEFAULT_ANSI_COLORS[14]),K.ansi[15]=Y(Z.brightWhite,a.DEFAULT_ANSI_COLORS[15]),Z.extendedAnsi){const ee=Math.min(K.ansi.length-16,Z.extendedAnsi.length);for(let oe=0;oe<ee;oe++)K.ansi[oe+16]=Y(Z.extendedAnsi[oe],a.DEFAULT_ANSI_COLORS[oe+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(Z){this._restoreColor(Z),this._onChangeColors.fire(this.colors)}_restoreColor(Z){if(Z!==void 0)switch(Z){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[Z]=this._restoreColors.ansi[Z]}else for(let K=0;K<this._restoreColors.ansi.length;++K)this._colors.ansi[K]=this._restoreColors.ansi[K]}modifyColors(Z){Z(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function Y(Z,K){if(Z!==void 0)try{return j.css.toColor(Z)}catch{}return K}a.ThemeService=J=f([C(0,H.IOptionsService)],J)},6349:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const f=l(8460),C=l(844);class h extends C.Disposable{constructor(U){super(),this._maxLength=U,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.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(U){if(this._maxLength===U)return;const W=new Array(U);for(let H=0;H<Math.min(U,this.length);H++)W[H]=this._array[this._getCyclicIndex(H)];this._array=W,this._maxLength=U,this._startIndex=0}get length(){return this._length}set length(U){if(U>this._length)for(let W=this._length;W<U;W++)this._array[W]=void 0;this._length=U}get(U){return this._array[this._getCyclicIndex(U)]}set(U,W){this._array[this._getCyclicIndex(U)]=W}push(U){this._array[this._getCyclicIndex(this._length)]=U,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(U,W,...H){if(W){for(let x=U;x<this._length-W;x++)this._array[this._getCyclicIndex(x)]=this._array[this._getCyclicIndex(x+W)];this._length-=W,this.onDeleteEmitter.fire({index:U,amount:W})}for(let x=this._length-1;x>=U;x--)this._array[this._getCyclicIndex(x+H.length)]=this._array[this._getCyclicIndex(x)];for(let x=0;x<H.length;x++)this._array[this._getCyclicIndex(U+x)]=H[x];if(H.length&&this.onInsertEmitter.fire({index:U,amount:H.length}),this._length+H.length>this._maxLength){const x=this._length+H.length-this._maxLength;this._startIndex+=x,this._length=this._maxLength,this.onTrimEmitter.fire(x)}else this._length+=H.length}trimStart(U){U>this._length&&(U=this._length),this._startIndex+=U,this._length-=U,this.onTrimEmitter.fire(U)}shiftElements(U,W,H){if(!(W<=0)){if(U<0||U>=this._length)throw new Error("start argument out of range");if(U+H<0)throw new Error("Cannot shift elements in list beyond index 0");if(H>0){for(let L=W-1;L>=0;L--)this.set(U+L+H,this.get(U+L));const x=U+W+H-this._length;if(x>0)for(this._length+=x;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let x=0;x<W;x++)this.set(U+x+H,this.get(U+x))}}_getCyclicIndex(U){return(this._startIndex+U)%this._maxLength}}a.CircularList=h},1439:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function l(f,C=5){if(typeof f!="object")return f;const h=Array.isArray(f)?[]:{};for(const j in f)h[j]=C<=1?f[j]:f[j]&&l(f[j],C-1);return h}},8055:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let l=0,f=0,C=0,h=0;var j,U,W,H,x;function L(N){const V=N.toString(16);return V.length<2?"0"+V:V}function R(N,V){return N<V?(V+.05)/(N+.05):(N+.05)/(V+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(N){N.toCss=function(V,J,Y,Z){return Z!==void 0?`#${L(V)}${L(J)}${L(Y)}${L(Z)}`:`#${L(V)}${L(J)}${L(Y)}`},N.toRgba=function(V,J,Y,Z=255){return(V<<24|J<<16|Y<<8|Z)>>>0},N.toColor=function(V,J,Y,Z){return{css:N.toCss(V,J,Y,Z),rgba:N.toRgba(V,J,Y,Z)}}})(j||(a.channels=j={})),(function(N){function V(J,Y){return h=Math.round(255*Y),[l,f,C]=x.toChannels(J.rgba),{css:j.toCss(l,f,C,h),rgba:j.toRgba(l,f,C,h)}}N.blend=function(J,Y){if(h=(255&Y.rgba)/255,h===1)return{css:Y.css,rgba:Y.rgba};const Z=Y.rgba>>24&255,K=Y.rgba>>16&255,ee=Y.rgba>>8&255,oe=J.rgba>>24&255,ce=J.rgba>>16&255,le=J.rgba>>8&255;return l=oe+Math.round((Z-oe)*h),f=ce+Math.round((K-ce)*h),C=le+Math.round((ee-le)*h),{css:j.toCss(l,f,C),rgba:j.toRgba(l,f,C)}},N.isOpaque=function(J){return(255&J.rgba)==255},N.ensureContrastRatio=function(J,Y,Z){const K=x.ensureContrastRatio(J.rgba,Y.rgba,Z);if(K)return j.toColor(K>>24&255,K>>16&255,K>>8&255)},N.opaque=function(J){const Y=(255|J.rgba)>>>0;return[l,f,C]=x.toChannels(Y),{css:j.toCss(l,f,C),rgba:Y}},N.opacity=V,N.multiplyOpacity=function(J,Y){return h=255&J.rgba,V(J,h*Y/255)},N.toColorRGB=function(J){return[J.rgba>>24&255,J.rgba>>16&255,J.rgba>>8&255]}})(U||(a.color=U={})),(function(N){let V,J;try{const Y=document.createElement("canvas");Y.width=1,Y.height=1;const Z=Y.getContext("2d",{willReadFrequently:!0});Z&&(V=Z,V.globalCompositeOperation="copy",J=V.createLinearGradient(0,0,1,1))}catch{}N.toColor=function(Y){if(Y.match(/#[\da-f]{3,8}/i))switch(Y.length){case 4:return l=parseInt(Y.slice(1,2).repeat(2),16),f=parseInt(Y.slice(2,3).repeat(2),16),C=parseInt(Y.slice(3,4).repeat(2),16),j.toColor(l,f,C);case 5:return l=parseInt(Y.slice(1,2).repeat(2),16),f=parseInt(Y.slice(2,3).repeat(2),16),C=parseInt(Y.slice(3,4).repeat(2),16),h=parseInt(Y.slice(4,5).repeat(2),16),j.toColor(l,f,C,h);case 7:return{css:Y,rgba:(parseInt(Y.slice(1),16)<<8|255)>>>0};case 9:return{css:Y,rgba:parseInt(Y.slice(1),16)>>>0}}const Z=Y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(Z)return l=parseInt(Z[1]),f=parseInt(Z[2]),C=parseInt(Z[3]),h=Math.round(255*(Z[5]===void 0?1:parseFloat(Z[5]))),j.toColor(l,f,C,h);if(!V||!J)throw new Error("css.toColor: Unsupported css format");if(V.fillStyle=J,V.fillStyle=Y,typeof V.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(V.fillRect(0,0,1,1),[l,f,C,h]=V.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:j.toRgba(l,f,C,h),css:Y}}})(W||(a.css=W={})),(function(N){function V(J,Y,Z){const K=J/255,ee=Y/255,oe=Z/255;return .2126*(K<=.03928?K/12.92:Math.pow((K+.055)/1.055,2.4))+.7152*(ee<=.03928?ee/12.92:Math.pow((ee+.055)/1.055,2.4))+.0722*(oe<=.03928?oe/12.92:Math.pow((oe+.055)/1.055,2.4))}N.relativeLuminance=function(J){return V(J>>16&255,J>>8&255,255&J)},N.relativeLuminance2=V})(H||(a.rgb=H={})),(function(N){function V(Y,Z,K){const ee=Y>>24&255,oe=Y>>16&255,ce=Y>>8&255;let le=Z>>24&255,ne=Z>>16&255,ae=Z>>8&255,_e=R(H.relativeLuminance2(le,ne,ae),H.relativeLuminance2(ee,oe,ce));for(;_e<K&&(le>0||ne>0||ae>0);)le-=Math.max(0,Math.ceil(.1*le)),ne-=Math.max(0,Math.ceil(.1*ne)),ae-=Math.max(0,Math.ceil(.1*ae)),_e=R(H.relativeLuminance2(le,ne,ae),H.relativeLuminance2(ee,oe,ce));return(le<<24|ne<<16|ae<<8|255)>>>0}function J(Y,Z,K){const ee=Y>>24&255,oe=Y>>16&255,ce=Y>>8&255;let le=Z>>24&255,ne=Z>>16&255,ae=Z>>8&255,_e=R(H.relativeLuminance2(le,ne,ae),H.relativeLuminance2(ee,oe,ce));for(;_e<K&&(le<255||ne<255||ae<255);)le=Math.min(255,le+Math.ceil(.1*(255-le))),ne=Math.min(255,ne+Math.ceil(.1*(255-ne))),ae=Math.min(255,ae+Math.ceil(.1*(255-ae))),_e=R(H.relativeLuminance2(le,ne,ae),H.relativeLuminance2(ee,oe,ce));return(le<<24|ne<<16|ae<<8|255)>>>0}N.blend=function(Y,Z){if(h=(255&Z)/255,h===1)return Z;const K=Z>>24&255,ee=Z>>16&255,oe=Z>>8&255,ce=Y>>24&255,le=Y>>16&255,ne=Y>>8&255;return l=ce+Math.round((K-ce)*h),f=le+Math.round((ee-le)*h),C=ne+Math.round((oe-ne)*h),j.toRgba(l,f,C)},N.ensureContrastRatio=function(Y,Z,K){const ee=H.relativeLuminance(Y>>8),oe=H.relativeLuminance(Z>>8);if(R(ee,oe)<K){if(oe<ee){const ne=V(Y,Z,K),ae=R(ee,H.relativeLuminance(ne>>8));if(ae<K){const _e=J(Y,Z,K);return ae>R(ee,H.relativeLuminance(_e>>8))?ne:_e}return ne}const ce=J(Y,Z,K),le=R(ee,H.relativeLuminance(ce>>8));if(le<K){const ne=V(Y,Z,K);return le>R(ee,H.relativeLuminance(ne>>8))?ce:ne}return ce}},N.reduceLuminance=V,N.increaseLuminance=J,N.toChannels=function(Y){return[Y>>24&255,Y>>16&255,Y>>8&255,255&Y]}})(x||(a.rgba=x={})),a.toPaddedHex=L,a.contrastRatio=R},8969:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const f=l(844),C=l(2585),h=l(4348),j=l(7866),U=l(744),W=l(7302),H=l(6975),x=l(8460),L=l(1753),R=l(1480),N=l(7994),V=l(9282),J=l(5435),Y=l(5981),Z=l(2660);let K=!1;class ee extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new x.EventEmitter),this._onScroll.event((ce=>{var le;(le=this._onScrollApi)==null||le.fire(ce.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(ce){for(const le in ce)this.optionsService.options[le]=ce[le]}constructor(ce){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new x.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new x.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new x.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new x.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new W.OptionsService(ce)),this._instantiationService.setService(C.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(U.BufferService)),this._instantiationService.setService(C.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(j.LogService)),this._instantiationService.setService(C.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(H.CoreService)),this._instantiationService.setService(C.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(L.CoreMouseService)),this._instantiationService.setService(C.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(R.UnicodeService)),this._instantiationService.setService(C.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(N.CharsetService),this._instantiationService.setService(C.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Z.OscLinkService),this._instantiationService.setService(C.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new J.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,x.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,x.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,x.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,x.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((le=>{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((le=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new Y.WriteBuffer(((le,ne)=>this._inputHandler.parse(le,ne)))),this.register((0,x.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(ce,le){this._writeBuffer.write(ce,le)}writeSync(ce,le){this._logService.logLevel<=C.LogLevelEnum.WARN&&!K&&(this._logService.warn("writeSync is unreliable and will be removed soon."),K=!0),this._writeBuffer.writeSync(ce,le)}input(ce,le=!0){this.coreService.triggerDataEvent(ce,le)}resize(ce,le){isNaN(ce)||isNaN(le)||(ce=Math.max(ce,U.MINIMUM_COLS),le=Math.max(le,U.MINIMUM_ROWS),this._bufferService.resize(ce,le))}scroll(ce,le=!1){this._bufferService.scroll(ce,le)}scrollLines(ce,le,ne){this._bufferService.scrollLines(ce,le,ne)}scrollPages(ce){this.scrollLines(ce*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(ce){const le=ce-this._bufferService.buffer.ydisp;le!==0&&this.scrollLines(le)}registerEscHandler(ce,le){return this._inputHandler.registerEscHandler(ce,le)}registerDcsHandler(ce,le){return this._inputHandler.registerDcsHandler(ce,le)}registerCsiHandler(ce,le){return this._inputHandler.registerCsiHandler(ce,le)}registerOscHandler(ce,le){return this._inputHandler.registerOscHandler(ce,le)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let ce=!1;const le=this.optionsService.rawOptions.windowsPty;le&&le.buildNumber!==void 0&&le.buildNumber!==void 0?ce=le.backend==="conpty"&&le.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(ce=!0),ce?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const ce=[];ce.push(this.onLineFeed(V.updateWindowsModeWrappedState.bind(null,this._bufferService))),ce.push(this.registerCsiHandler({final:"H"},(()=>((0,V.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const le of ce)le.dispose()}))}}}a.CoreTerminal=ee},8460:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===l)return void this._listeners.splice(f,1)}}})),this._event}fire(l,f){const C=[];for(let h=0;h<this._listeners.length;h++)C.push(this._listeners[h]);for(let h=0;h<C.length;h++)C[h].call(void 0,l,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(l,f){return l((C=>f.fire(C)))},a.runAndSubscribe=function(l,f){return f(void 0),l((C=>f(C)))}},5435:function(d,a,l){var f=this&&this.__decorate||function(he,X,re,Q){var se,Ce=arguments.length,we=Ce<3?X:Q===null?Q=Object.getOwnPropertyDescriptor(X,re):Q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")we=Reflect.decorate(he,X,re,Q);else for(var Be=he.length-1;Be>=0;Be--)(se=he[Be])&&(we=(Ce<3?se(we):Ce>3?se(X,re,we):se(X,re))||we);return Ce>3&&we&&Object.defineProperty(X,re,we),we},C=this&&this.__param||function(he,X){return function(re,Q){X(re,Q,he)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const h=l(2584),j=l(7116),U=l(2015),W=l(844),H=l(482),x=l(8437),L=l(8460),R=l(643),N=l(511),V=l(3734),J=l(2585),Y=l(1480),Z=l(6242),K=l(6351),ee=l(5941),oe={"(":0,")":1,"*":2,"+":3,"-":1,".":2},ce=131072;function le(he,X){if(he>24)return X.setWinLines||!1;switch(he){case 1:return!!X.restoreWin;case 2:return!!X.minimizeWin;case 3:return!!X.setWinPosition;case 4:return!!X.setWinSizePixels;case 5:return!!X.raiseWin;case 6:return!!X.lowerWin;case 7:return!!X.refreshWin;case 8:return!!X.setWinSizeChars;case 9:return!!X.maximizeWin;case 10:return!!X.fullscreenWin;case 11:return!!X.getWinState;case 13:return!!X.getWinPosition;case 14:return!!X.getWinSizePixels;case 15:return!!X.getScreenSizePixels;case 16:return!!X.getCellSizePixels;case 18:return!!X.getWinSizeChars;case 19:return!!X.getScreenSizeChars;case 20:return!!X.getIconTitle;case 21:return!!X.getWinTitle;case 22:return!!X.pushTitle;case 23:return!!X.popTitle;case 24:return!!X.setWinLines}return!1}var ne;(function(he){he[he.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",he[he.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(ne||(a.WindowsOptionsReportType=ne={}));let ae=0;class _e extends W.Disposable{getAttrData(){return this._curAttrData}constructor(X,re,Q,se,Ce,we,Be,Re,de=new U.EscapeSequenceParser){super(),this._bufferService=X,this._charsetService=re,this._coreService=Q,this._logService=se,this._optionsService=Ce,this._oscLinkService=we,this._coreMouseService=Be,this._unicodeService=Re,this._parser=de,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new H.StringToUtf32,this._utf8Decoder=new H.Utf8ToUtf32,this._workCell=new N.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new L.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new L.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new L.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new L.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new L.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new L.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new L.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new L.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new L.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new L.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new L.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new L.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new L.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 fe(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((ie=>this._activeBuffer=ie.activeBuffer))),this._parser.setCsiHandlerFallback(((ie,De)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(ie),params:De.toArray()})})),this._parser.setEscHandlerFallback((ie=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(ie)})})),this._parser.setExecuteHandlerFallback((ie=>{this._logService.debug("Unknown EXECUTE code: ",{code:ie})})),this._parser.setOscHandlerFallback(((ie,De,be)=>{this._logService.debug("Unknown OSC code: ",{identifier:ie,action:De,data:be})})),this._parser.setDcsHandlerFallback(((ie,De,be)=>{De==="HOOK"&&(be=be.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(ie),action:De,payload:be})})),this._parser.setPrintHandler(((ie,De,be)=>this.print(ie,De,be))),this._parser.registerCsiHandler({final:"@"},(ie=>this.insertChars(ie))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(ie=>this.scrollLeft(ie))),this._parser.registerCsiHandler({final:"A"},(ie=>this.cursorUp(ie))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(ie=>this.scrollRight(ie))),this._parser.registerCsiHandler({final:"B"},(ie=>this.cursorDown(ie))),this._parser.registerCsiHandler({final:"C"},(ie=>this.cursorForward(ie))),this._parser.registerCsiHandler({final:"D"},(ie=>this.cursorBackward(ie))),this._parser.registerCsiHandler({final:"E"},(ie=>this.cursorNextLine(ie))),this._parser.registerCsiHandler({final:"F"},(ie=>this.cursorPrecedingLine(ie))),this._parser.registerCsiHandler({final:"G"},(ie=>this.cursorCharAbsolute(ie))),this._parser.registerCsiHandler({final:"H"},(ie=>this.cursorPosition(ie))),this._parser.registerCsiHandler({final:"I"},(ie=>this.cursorForwardTab(ie))),this._parser.registerCsiHandler({final:"J"},(ie=>this.eraseInDisplay(ie,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(ie=>this.eraseInDisplay(ie,!0))),this._parser.registerCsiHandler({final:"K"},(ie=>this.eraseInLine(ie,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(ie=>this.eraseInLine(ie,!0))),this._parser.registerCsiHandler({final:"L"},(ie=>this.insertLines(ie))),this._parser.registerCsiHandler({final:"M"},(ie=>this.deleteLines(ie))),this._parser.registerCsiHandler({final:"P"},(ie=>this.deleteChars(ie))),this._parser.registerCsiHandler({final:"S"},(ie=>this.scrollUp(ie))),this._parser.registerCsiHandler({final:"T"},(ie=>this.scrollDown(ie))),this._parser.registerCsiHandler({final:"X"},(ie=>this.eraseChars(ie))),this._parser.registerCsiHandler({final:"Z"},(ie=>this.cursorBackwardTab(ie))),this._parser.registerCsiHandler({final:"`"},(ie=>this.charPosAbsolute(ie))),this._parser.registerCsiHandler({final:"a"},(ie=>this.hPositionRelative(ie))),this._parser.registerCsiHandler({final:"b"},(ie=>this.repeatPrecedingCharacter(ie))),this._parser.registerCsiHandler({final:"c"},(ie=>this.sendDeviceAttributesPrimary(ie))),this._parser.registerCsiHandler({prefix:">",final:"c"},(ie=>this.sendDeviceAttributesSecondary(ie))),this._parser.registerCsiHandler({final:"d"},(ie=>this.linePosAbsolute(ie))),this._parser.registerCsiHandler({final:"e"},(ie=>this.vPositionRelative(ie))),this._parser.registerCsiHandler({final:"f"},(ie=>this.hVPosition(ie))),this._parser.registerCsiHandler({final:"g"},(ie=>this.tabClear(ie))),this._parser.registerCsiHandler({final:"h"},(ie=>this.setMode(ie))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(ie=>this.setModePrivate(ie))),this._parser.registerCsiHandler({final:"l"},(ie=>this.resetMode(ie))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(ie=>this.resetModePrivate(ie))),this._parser.registerCsiHandler({final:"m"},(ie=>this.charAttributes(ie))),this._parser.registerCsiHandler({final:"n"},(ie=>this.deviceStatus(ie))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(ie=>this.deviceStatusPrivate(ie))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(ie=>this.softReset(ie))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(ie=>this.setCursorStyle(ie))),this._parser.registerCsiHandler({final:"r"},(ie=>this.setScrollRegion(ie))),this._parser.registerCsiHandler({final:"s"},(ie=>this.saveCursor(ie))),this._parser.registerCsiHandler({final:"t"},(ie=>this.windowOptions(ie))),this._parser.registerCsiHandler({final:"u"},(ie=>this.restoreCursor(ie))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(ie=>this.insertColumns(ie))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(ie=>this.deleteColumns(ie))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(ie=>this.selectProtected(ie))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(ie=>this.requestMode(ie,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(ie=>this.requestMode(ie,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new Z.OscHandler((ie=>(this.setTitle(ie),this.setIconName(ie),!0)))),this._parser.registerOscHandler(1,new Z.OscHandler((ie=>this.setIconName(ie)))),this._parser.registerOscHandler(2,new Z.OscHandler((ie=>this.setTitle(ie)))),this._parser.registerOscHandler(4,new Z.OscHandler((ie=>this.setOrReportIndexedColor(ie)))),this._parser.registerOscHandler(8,new Z.OscHandler((ie=>this.setHyperlink(ie)))),this._parser.registerOscHandler(10,new Z.OscHandler((ie=>this.setOrReportFgColor(ie)))),this._parser.registerOscHandler(11,new Z.OscHandler((ie=>this.setOrReportBgColor(ie)))),this._parser.registerOscHandler(12,new Z.OscHandler((ie=>this.setOrReportCursorColor(ie)))),this._parser.registerOscHandler(104,new Z.OscHandler((ie=>this.restoreIndexedColor(ie)))),this._parser.registerOscHandler(110,new Z.OscHandler((ie=>this.restoreFgColor(ie)))),this._parser.registerOscHandler(111,new Z.OscHandler((ie=>this.restoreBgColor(ie)))),this._parser.registerOscHandler(112,new Z.OscHandler((ie=>this.restoreCursorColor(ie)))),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 ie in j.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:ie},(()=>this.selectCharset("("+ie))),this._parser.registerEscHandler({intermediates:")",final:ie},(()=>this.selectCharset(")"+ie))),this._parser.registerEscHandler({intermediates:"*",final:ie},(()=>this.selectCharset("*"+ie))),this._parser.registerEscHandler({intermediates:"+",final:ie},(()=>this.selectCharset("+"+ie))),this._parser.registerEscHandler({intermediates:"-",final:ie},(()=>this.selectCharset("-"+ie))),this._parser.registerEscHandler({intermediates:".",final:ie},(()=>this.selectCharset("."+ie))),this._parser.registerEscHandler({intermediates:"/",final:ie},(()=>this.selectCharset("/"+ie)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((ie=>(this._logService.error("Parsing error: ",ie),ie))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new K.DcsHandler(((ie,De)=>this.requestStatusString(ie,De))))}_preserveStack(X,re,Q,se){this._parseStack.paused=!0,this._parseStack.cursorStartX=X,this._parseStack.cursorStartY=re,this._parseStack.decodedLength=Q,this._parseStack.position=se}_logSlowResolvingAsync(X){this._logService.logLevel<=J.LogLevelEnum.WARN&&Promise.race([X,new Promise(((re,Q)=>setTimeout((()=>Q("#SLOW_TIMEOUT")),5e3)))]).catch((re=>{if(re!=="#SLOW_TIMEOUT")throw re;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(X,re){let Q,se=this._activeBuffer.x,Ce=this._activeBuffer.y,we=0;const Be=this._parseStack.paused;if(Be){if(Q=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,re))return this._logSlowResolvingAsync(Q),Q;se=this._parseStack.cursorStartX,Ce=this._parseStack.cursorStartY,this._parseStack.paused=!1,X.length>ce&&(we=this._parseStack.position+ce)}if(this._logService.logLevel<=J.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof X=="string"?` "${X}"`:` "${Array.prototype.map.call(X,(ie=>String.fromCharCode(ie))).join("")}"`),typeof X=="string"?X.split("").map((ie=>ie.charCodeAt(0))):X),this._parseBuffer.length<X.length&&this._parseBuffer.length<ce&&(this._parseBuffer=new Uint32Array(Math.min(X.length,ce))),Be||this._dirtyRowTracker.clearRange(),X.length>ce)for(let ie=we;ie<X.length;ie+=ce){const De=ie+ce<X.length?ie+ce:X.length,be=typeof X=="string"?this._stringDecoder.decode(X.substring(ie,De),this._parseBuffer):this._utf8Decoder.decode(X.subarray(ie,De),this._parseBuffer);if(Q=this._parser.parse(this._parseBuffer,be))return this._preserveStack(se,Ce,be,ie),this._logSlowResolvingAsync(Q),Q}else if(!Be){const ie=typeof X=="string"?this._stringDecoder.decode(X,this._parseBuffer):this._utf8Decoder.decode(X,this._parseBuffer);if(Q=this._parser.parse(this._parseBuffer,ie))return this._preserveStack(se,Ce,ie,0),this._logSlowResolvingAsync(Q),Q}this._activeBuffer.x===se&&this._activeBuffer.y===Ce||this._onCursorMove.fire();const Re=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),de=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);de<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(de,this._bufferService.rows-1),Math.min(Re,this._bufferService.rows-1))}print(X,re,Q){let se,Ce;const we=this._charsetService.charset,Be=this._optionsService.rawOptions.screenReaderMode,Re=this._bufferService.cols,de=this._coreService.decPrivateModes.wraparound,ie=this._coreService.modes.insertMode,De=this._curAttrData;let be=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&Q-re>0&&be.getWidth(this._activeBuffer.x-1)===2&&be.setCellFromCodepoint(this._activeBuffer.x-1,0,1,De);let Te=this._parser.precedingJoinState;for(let Pe=re;Pe<Q;++Pe){if(se=X[Pe],se<127&&we){const Xe=we[String.fromCharCode(se)];Xe&&(se=Xe.charCodeAt(0))}const Je=this._unicodeService.charProperties(se,Te);Ce=Y.UnicodeService.extractWidth(Je);const Ie=Y.UnicodeService.extractShouldJoin(Je),We=Ie?Y.UnicodeService.extractWidth(Te):0;if(Te=Je,Be&&this._onA11yChar.fire((0,H.stringFromCodePoint)(se)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Ce-We>Re){if(de){const Xe=be;let ze=this._activeBuffer.x-We;for(this._activeBuffer.x=We,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),be=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),We>0&&be instanceof x.BufferLine&&be.copyCellsFrom(Xe,ze,0,We,!1);ze<Re;)Xe.setCellFromCodepoint(ze++,0,1,De)}else if(this._activeBuffer.x=Re-1,Ce===2)continue}if(Ie&&this._activeBuffer.x){const Xe=be.getWidth(this._activeBuffer.x-1)?1:2;be.addCodepointToCell(this._activeBuffer.x-Xe,se,Ce);for(let ze=Ce-We;--ze>=0;)be.setCellFromCodepoint(this._activeBuffer.x++,0,0,De)}else if(ie&&(be.insertCells(this._activeBuffer.x,Ce-We,this._activeBuffer.getNullCell(De)),be.getWidth(Re-1)===2&&be.setCellFromCodepoint(Re-1,R.NULL_CELL_CODE,R.NULL_CELL_WIDTH,De)),be.setCellFromCodepoint(this._activeBuffer.x++,se,Ce,De),Ce>0)for(;--Ce;)be.setCellFromCodepoint(this._activeBuffer.x++,0,0,De)}this._parser.precedingJoinState=Te,this._activeBuffer.x<Re&&Q-re>0&&be.getWidth(this._activeBuffer.x)===0&&!be.hasContent(this._activeBuffer.x)&&be.setCellFromCodepoint(this._activeBuffer.x,0,1,De),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(X,re){return X.final!=="t"||X.prefix||X.intermediates?this._parser.registerCsiHandler(X,re):this._parser.registerCsiHandler(X,(Q=>!le(Q.params[0],this._optionsService.rawOptions.windowOptions)||re(Q)))}registerDcsHandler(X,re){return this._parser.registerDcsHandler(X,new K.DcsHandler(re))}registerEscHandler(X,re){return this._parser.registerEscHandler(X,re)}registerOscHandler(X,re){return this._parser.registerOscHandler(X,new Z.OscHandler(re))}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 X;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&&((X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&X.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);re.hasWidth(this._activeBuffer.x)&&!re.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const X=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-X),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(X=this._bufferService.cols-1){this._activeBuffer.x=Math.min(X,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(X,re){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=X,this._activeBuffer.y=this._activeBuffer.scrollTop+re):(this._activeBuffer.x=X,this._activeBuffer.y=re),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(X,re){this._restrictCursor(),this._setCursor(this._activeBuffer.x+X,this._activeBuffer.y+re)}cursorUp(X){const re=this._activeBuffer.y-this._activeBuffer.scrollTop;return re>=0?this._moveCursor(0,-Math.min(re,X.params[0]||1)):this._moveCursor(0,-(X.params[0]||1)),!0}cursorDown(X){const re=this._activeBuffer.scrollBottom-this._activeBuffer.y;return re>=0?this._moveCursor(0,Math.min(re,X.params[0]||1)):this._moveCursor(0,X.params[0]||1),!0}cursorForward(X){return this._moveCursor(X.params[0]||1,0),!0}cursorBackward(X){return this._moveCursor(-(X.params[0]||1),0),!0}cursorNextLine(X){return this.cursorDown(X),this._activeBuffer.x=0,!0}cursorPrecedingLine(X){return this.cursorUp(X),this._activeBuffer.x=0,!0}cursorCharAbsolute(X){return this._setCursor((X.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(X){return this._setCursor(X.length>=2?(X.params[1]||1)-1:0,(X.params[0]||1)-1),!0}charPosAbsolute(X){return this._setCursor((X.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(X){return this._moveCursor(X.params[0]||1,0),!0}linePosAbsolute(X){return this._setCursor(this._activeBuffer.x,(X.params[0]||1)-1),!0}vPositionRelative(X){return this._moveCursor(0,X.params[0]||1),!0}hVPosition(X){return this.cursorPosition(X),!0}tabClear(X){const re=X.params[0];return re===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:re===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(X){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let re=X.params[0]||1;for(;re--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(X){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let re=X.params[0]||1;for(;re--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(X){const re=X.params[0];return re===1&&(this._curAttrData.bg|=536870912),re!==2&&re!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(X,re,Q,se=!1,Ce=!1){const we=this._activeBuffer.lines.get(this._activeBuffer.ybase+X);we.replaceCells(re,Q,this._activeBuffer.getNullCell(this._eraseAttrData()),Ce),se&&(we.isWrapped=!1)}_resetBufferLine(X,re=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+X);Q&&(Q.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),re),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+X),Q.isWrapped=!1)}eraseInDisplay(X,re=!1){let Q;switch(this._restrictCursor(this._bufferService.cols),X.params[0]){case 0:for(Q=this._activeBuffer.y,this._dirtyRowTracker.markDirty(Q),this._eraseInBufferLine(Q++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,re);Q<this._bufferService.rows;Q++)this._resetBufferLine(Q,re);this._dirtyRowTracker.markDirty(Q);break;case 1:for(Q=this._activeBuffer.y,this._dirtyRowTracker.markDirty(Q),this._eraseInBufferLine(Q,0,this._activeBuffer.x+1,!0,re),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(Q+1).isWrapped=!1);Q--;)this._resetBufferLine(Q,re);this._dirtyRowTracker.markDirty(0);break;case 2:for(Q=this._bufferService.rows,this._dirtyRowTracker.markDirty(Q-1);Q--;)this._resetBufferLine(Q,re);this._dirtyRowTracker.markDirty(0);break;case 3:const se=this._activeBuffer.lines.length-this._bufferService.rows;se>0&&(this._activeBuffer.lines.trimStart(se),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-se,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-se,0),this._onScroll.fire(0))}return!0}eraseInLine(X,re=!1){switch(this._restrictCursor(this._bufferService.cols),X.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,re);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,re);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,re)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(X){this._restrictCursor();let re=X.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const Q=this._activeBuffer.ybase+this._activeBuffer.y,se=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Ce=this._bufferService.rows-1+this._activeBuffer.ybase-se+1;for(;re--;)this._activeBuffer.lines.splice(Ce-1,1),this._activeBuffer.lines.splice(Q,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(X){this._restrictCursor();let re=X.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const Q=this._activeBuffer.ybase+this._activeBuffer.y;let se;for(se=this._bufferService.rows-1-this._activeBuffer.scrollBottom,se=this._bufferService.rows-1+this._activeBuffer.ybase-se;re--;)this._activeBuffer.lines.splice(Q,1),this._activeBuffer.lines.splice(se,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(X){this._restrictCursor();const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return re&&(re.insertCells(this._activeBuffer.x,X.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(X){this._restrictCursor();const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return re&&(re.deleteCells(this._activeBuffer.x,X.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(X){let re=X.params[0]||1;for(;re--;)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(X){let re=X.params[0]||1;for(;re--;)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(x.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(X){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const re=X.params[0]||1;for(let Q=this._activeBuffer.scrollTop;Q<=this._activeBuffer.scrollBottom;++Q){const se=this._activeBuffer.lines.get(this._activeBuffer.ybase+Q);se.deleteCells(0,re,this._activeBuffer.getNullCell(this._eraseAttrData())),se.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(X){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const re=X.params[0]||1;for(let Q=this._activeBuffer.scrollTop;Q<=this._activeBuffer.scrollBottom;++Q){const se=this._activeBuffer.lines.get(this._activeBuffer.ybase+Q);se.insertCells(0,re,this._activeBuffer.getNullCell(this._eraseAttrData())),se.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(X){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const re=X.params[0]||1;for(let Q=this._activeBuffer.scrollTop;Q<=this._activeBuffer.scrollBottom;++Q){const se=this._activeBuffer.lines.get(this._activeBuffer.ybase+Q);se.insertCells(this._activeBuffer.x,re,this._activeBuffer.getNullCell(this._eraseAttrData())),se.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(X){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const re=X.params[0]||1;for(let Q=this._activeBuffer.scrollTop;Q<=this._activeBuffer.scrollBottom;++Q){const se=this._activeBuffer.lines.get(this._activeBuffer.ybase+Q);se.deleteCells(this._activeBuffer.x,re,this._activeBuffer.getNullCell(this._eraseAttrData())),se.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(X){this._restrictCursor();const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return re&&(re.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(X.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(X){const re=this._parser.precedingJoinState;if(!re)return!0;const Q=X.params[0]||1,se=Y.UnicodeService.extractWidth(re),Ce=this._activeBuffer.x-se,we=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Ce),Be=new Uint32Array(we.length*Q);let Re=0;for(let ie=0;ie<we.length;){const De=we.codePointAt(ie)||0;Be[Re++]=De,ie+=De>65535?2:1}let de=Re;for(let ie=1;ie<Q;++ie)Be.copyWithin(de,0,Re),de+=Re;return this.print(Be,0,de),!0}sendDeviceAttributesPrimary(X){return X.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(X){return X.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(X.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(X){return(this._optionsService.rawOptions.termName+"").indexOf(X)===0}setMode(X){for(let re=0;re<X.length;re++)switch(X.params[re]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(X){for(let re=0;re<X.length;re++)switch(X.params[re]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,j.DEFAULT_CHARSET),this._charsetService.setgCharset(1,j.DEFAULT_CHARSET),this._charsetService.setgCharset(2,j.DEFAULT_CHARSET),this._charsetService.setgCharset(3,j.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(X){for(let re=0;re<X.length;re++)switch(X.params[re]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(X){for(let re=0;re<X.length;re++)switch(X.params[re]){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(),X.params[re]===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(X,re){const Q=this._coreService.decPrivateModes,{activeProtocol:se,activeEncoding:Ce}=this._coreMouseService,we=this._coreService,{buffers:Be,cols:Re}=this._bufferService,{active:de,alt:ie}=Be,De=this._optionsService.rawOptions,be=Ie=>Ie?1:2,Te=X.params[0];return Pe=Te,Je=re?Te===2?4:Te===4?be(we.modes.insertMode):Te===12?3:Te===20?be(De.convertEol):0:Te===1?be(Q.applicationCursorKeys):Te===3?De.windowOptions.setWinLines?Re===80?2:Re===132?1:0:0:Te===6?be(Q.origin):Te===7?be(Q.wraparound):Te===8?3:Te===9?be(se==="X10"):Te===12?be(De.cursorBlink):Te===25?be(!we.isCursorHidden):Te===45?be(Q.reverseWraparound):Te===66?be(Q.applicationKeypad):Te===67?4:Te===1e3?be(se==="VT200"):Te===1002?be(se==="DRAG"):Te===1003?be(se==="ANY"):Te===1004?be(Q.sendFocus):Te===1005?4:Te===1006?be(Ce==="SGR"):Te===1015?4:Te===1016?be(Ce==="SGR_PIXELS"):Te===1048?1:Te===47||Te===1047||Te===1049?be(de===ie):Te===2004?be(Q.bracketedPasteMode):0,we.triggerDataEvent(`${h.C0.ESC}[${re?"":"?"}${Pe};${Je}$y`),!0;var Pe,Je}_updateAttrColor(X,re,Q,se,Ce){return re===2?(X|=50331648,X&=-16777216,X|=V.AttributeData.fromColorRGB([Q,se,Ce])):re===5&&(X&=-50331904,X|=33554432|255&Q),X}_extractColor(X,re,Q){const se=[0,0,-1,0,0,0];let Ce=0,we=0;do{if(se[we+Ce]=X.params[re+we],X.hasSubParams(re+we)){const Be=X.getSubParams(re+we);let Re=0;do se[1]===5&&(Ce=1),se[we+Re+1+Ce]=Be[Re];while(++Re<Be.length&&Re+we+1+Ce<se.length);break}if(se[1]===5&&we+Ce>=2||se[1]===2&&we+Ce>=5)break;se[1]&&(Ce=1)}while(++we+re<X.length&&we+Ce<se.length);for(let Be=2;Be<se.length;++Be)se[Be]===-1&&(se[Be]=0);switch(se[0]){case 38:Q.fg=this._updateAttrColor(Q.fg,se[1],se[3],se[4],se[5]);break;case 48:Q.bg=this._updateAttrColor(Q.bg,se[1],se[3],se[4],se[5]);break;case 58:Q.extended=Q.extended.clone(),Q.extended.underlineColor=this._updateAttrColor(Q.extended.underlineColor,se[1],se[3],se[4],se[5])}return we}_processUnderline(X,re){re.extended=re.extended.clone(),(!~X||X>5)&&(X=1),re.extended.underlineStyle=X,re.fg|=268435456,X===0&&(re.fg&=-268435457),re.updateExtended()}_processSGR0(X){X.fg=x.DEFAULT_ATTR_DATA.fg,X.bg=x.DEFAULT_ATTR_DATA.bg,X.extended=X.extended.clone(),X.extended.underlineStyle=0,X.extended.underlineColor&=-67108864,X.updateExtended()}charAttributes(X){if(X.length===1&&X.params[0]===0)return this._processSGR0(this._curAttrData),!0;const re=X.length;let Q;const se=this._curAttrData;for(let Ce=0;Ce<re;Ce++)Q=X.params[Ce],Q>=30&&Q<=37?(se.fg&=-50331904,se.fg|=16777216|Q-30):Q>=40&&Q<=47?(se.bg&=-50331904,se.bg|=16777216|Q-40):Q>=90&&Q<=97?(se.fg&=-50331904,se.fg|=16777224|Q-90):Q>=100&&Q<=107?(se.bg&=-50331904,se.bg|=16777224|Q-100):Q===0?this._processSGR0(se):Q===1?se.fg|=134217728:Q===3?se.bg|=67108864:Q===4?(se.fg|=268435456,this._processUnderline(X.hasSubParams(Ce)?X.getSubParams(Ce)[0]:1,se)):Q===5?se.fg|=536870912:Q===7?se.fg|=67108864:Q===8?se.fg|=1073741824:Q===9?se.fg|=2147483648:Q===2?se.bg|=134217728:Q===21?this._processUnderline(2,se):Q===22?(se.fg&=-134217729,se.bg&=-134217729):Q===23?se.bg&=-67108865:Q===24?(se.fg&=-268435457,this._processUnderline(0,se)):Q===25?se.fg&=-536870913:Q===27?se.fg&=-67108865:Q===28?se.fg&=-1073741825:Q===29?se.fg&=2147483647:Q===39?(se.fg&=-67108864,se.fg|=16777215&x.DEFAULT_ATTR_DATA.fg):Q===49?(se.bg&=-67108864,se.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):Q===38||Q===48||Q===58?Ce+=this._extractColor(X,Ce,se):Q===53?se.bg|=1073741824:Q===55?se.bg&=-1073741825:Q===59?(se.extended=se.extended.clone(),se.extended.underlineColor=-1,se.updateExtended()):Q===100?(se.fg&=-67108864,se.fg|=16777215&x.DEFAULT_ATTR_DATA.fg,se.bg&=-67108864,se.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",Q);return!0}deviceStatus(X){switch(X.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const re=this._activeBuffer.y+1,Q=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${re};${Q}R`)}return!0}deviceStatusPrivate(X){if(X.params[0]===6){const re=this._activeBuffer.y+1,Q=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${re};${Q}R`)}return!0}softReset(X){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=x.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(X){const re=X.params[0]||1;switch(re){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 Q=re%2==1;return this._optionsService.options.cursorBlink=Q,!0}setScrollRegion(X){const re=X.params[0]||1;let Q;return(X.length<2||(Q=X.params[1])>this._bufferService.rows||Q===0)&&(Q=this._bufferService.rows),Q>re&&(this._activeBuffer.scrollTop=re-1,this._activeBuffer.scrollBottom=Q-1,this._setCursor(0,0)),!0}windowOptions(X){if(!le(X.params[0],this._optionsService.rawOptions.windowOptions))return!0;const re=X.length>1?X.params[1]:0;switch(X.params[0]){case 14:re!==2&&this._onRequestWindowsOptionsReport.fire(ne.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(ne.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:re!==0&&re!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),re!==0&&re!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:re!==0&&re!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),re!==0&&re!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(X){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(X){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(X){return this._windowTitle=X,this._onTitleChange.fire(X),!0}setIconName(X){return this._iconName=X,!0}setOrReportIndexedColor(X){const re=[],Q=X.split(";");for(;Q.length>1;){const se=Q.shift(),Ce=Q.shift();if(/^\d+$/.exec(se)){const we=parseInt(se);if(ge(we))if(Ce==="?")re.push({type:0,index:we});else{const Be=(0,ee.parseColor)(Ce);Be&&re.push({type:1,index:we,color:Be})}}}return re.length&&this._onColor.fire(re),!0}setHyperlink(X){const re=X.split(";");return!(re.length<2)&&(re[1]?this._createHyperlink(re[0],re[1]):!re[0]&&this._finishHyperlink())}_createHyperlink(X,re){this._getCurrentLinkId()&&this._finishHyperlink();const Q=X.split(":");let se;const Ce=Q.findIndex((we=>we.startsWith("id=")));return Ce!==-1&&(se=Q[Ce].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:se,uri:re}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(X,re){const Q=X.split(";");for(let se=0;se<Q.length&&!(re>=this._specialColors.length);++se,++re)if(Q[se]==="?")this._onColor.fire([{type:0,index:this._specialColors[re]}]);else{const Ce=(0,ee.parseColor)(Q[se]);Ce&&this._onColor.fire([{type:1,index:this._specialColors[re],color:Ce}])}return!0}setOrReportFgColor(X){return this._setOrReportSpecialColor(X,0)}setOrReportBgColor(X){return this._setOrReportSpecialColor(X,1)}setOrReportCursorColor(X){return this._setOrReportSpecialColor(X,2)}restoreIndexedColor(X){if(!X)return this._onColor.fire([{type:2}]),!0;const re=[],Q=X.split(";");for(let se=0;se<Q.length;++se)if(/^\d+$/.exec(Q[se])){const Ce=parseInt(Q[se]);ge(Ce)&&re.push({type:2,index:Ce})}return re.length&&this._onColor.fire(re),!0}restoreFgColor(X){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(X){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(X){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,j.DEFAULT_CHARSET),!0}selectCharset(X){return X.length!==2?(this.selectDefaultCharset(),!0):(X[0]==="/"||this._charsetService.setgCharset(oe[X[0]],j.CHARSETS[X[1]]||j.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 X=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,X,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=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(X){return this._charsetService.setgLevel(X),!0}screenAlignmentPattern(){const X=new N.CellData;X.content=4194373,X.fg=this._curAttrData.fg,X.bg=this._curAttrData.bg,this._setCursor(0,0);for(let re=0;re<this._bufferService.rows;++re){const Q=this._activeBuffer.ybase+this._activeBuffer.y+re,se=this._activeBuffer.lines.get(Q);se&&(se.fill(X),se.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(X,re){const Q=this._bufferService.buffer,se=this._optionsService.rawOptions;return(Ce=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${Ce}${h.C0.ESC}\\`),!0))(X==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:X==='"p'?'P1$r61;1"p':X==="r"?`P1$r${Q.scrollTop+1};${Q.scrollBottom+1}r`:X==="m"?"P1$r0m":X===" q"?`P1$r${{block:2,underline:4,bar:6}[se.cursorStyle]-(se.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(X,re){this._dirtyRowTracker.markRangeDirty(X,re)}}a.InputHandler=_e;let fe=class{constructor(he){this._bufferService=he,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(he){he<this.start?this.start=he:he>this.end&&(this.end=he)}markRangeDirty(he,X){he>X&&(ae=he,he=X,X=ae),he<this.start&&(this.start=he),X>this.end&&(this.end=X)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function ge(he){return 0<=he&&he<256}fe=f([C(0,J.IBufferService)],fe)},844:(d,a)=>{function l(f){for(const C of f)C.dispose();f.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const C=this._disposables.indexOf(f);C!==-1&&this._disposables.splice(C,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var C;this._isDisposed||f===this._value||((C=this._value)==null||C.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},a.toDisposable=function(f){return{dispose:f}},a.disposeArray=l,a.getDisposeArrayDisposable=function(f){return{dispose:()=>l(f)}}},1505:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(C,h,j){this._data[C]||(this._data[C]={}),this._data[C][h]=j}get(C,h){return this._data[C]?this._data[C][h]:void 0}clear(){this._data={}}}a.TwoKeyMap=l,a.FourKeyMap=class{constructor(){this._data=new l}set(f,C,h,j,U){this._data.get(f,C)||this._data.set(f,C,new l),this._data.get(f,C).set(h,j,U)}get(f,C,h,j){var U;return(U=this._data.get(f,C))==null?void 0:U.get(h,j)}clear(){this._data.clear()}}},6114:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const l=a.isNode?"node":navigator.userAgent,f=a.isNode?"node":navigator.platform;a.isFirefox=l.includes("Firefox"),a.isLegacyEdge=l.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(l),a.getSafariVersion=function(){if(!a.isSafari)return 0;const C=l.match(/Version\/(\d+)/);return C===null||C.length<2?0:parseInt(C[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),a.isIpad=f==="iPad",a.isIphone=f==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),a.isLinux=f.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(l)},6106:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let l=0;a.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(l=this._search(this._getKey(f)),this._array.splice(l,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const C=this._getKey(f);if(C===void 0||(l=this._search(C),l===-1)||this._getKey(this._array[l])!==C)return!1;do if(this._array[l]===f)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===C);return!1}*getKeyIterator(f){if(this._array.length!==0&&(l=this._search(f),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===f))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===f)}forEachByKey(f,C){if(this._array.length!==0&&(l=this._search(f),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===f))do C(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===f)}values(){return[...this._array].values()}_search(f){let C=0,h=this._array.length-1;for(;h>=C;){let j=C+h>>1;const U=this._getKey(this._array[j]);if(U>f)h=j-1;else{if(!(U<f)){for(;j>0&&this._getKey(this._array[j-1])===f;)j--;return j}C=j+1}}return C}}},7226:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const f=l(6114);class C{constructor(){this._tasks=[],this._i=0}enqueue(U){this._tasks.push(U),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(U){this._idleCallback=void 0;let W=0,H=0,x=U.timeRemaining(),L=0;for(;this._i<this._tasks.length;){if(W=Date.now(),this._tasks[this._i]()||this._i++,W=Math.max(1,Date.now()-W),H=Math.max(W,H),L=U.timeRemaining(),1.5*H>L)return x-W<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(x-W))}ms`),void this._start();x=L}this.clear()}}class h extends C{_requestCallback(U){return setTimeout((()=>U(this._createDeadline(16))))}_cancelCallback(U){clearTimeout(U)}_createDeadline(U){const W=Date.now()+U;return{timeRemaining:()=>Math.max(0,W-Date.now())}}}a.PriorityTaskQueue=h,a.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends C{_requestCallback(j){return requestIdleCallback(j)}_cancelCallback(j){cancelIdleCallback(j)}}:h,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(j){this._queue.clear(),this._queue.enqueue(j)}flush(){this._queue.flush()}}},9282:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const f=l(643);a.updateWindowsModeWrappedState=function(C){const h=C.buffer.lines.get(C.buffer.ybase+C.buffer.y-1),j=h==null?void 0:h.get(C.cols-1),U=C.buffer.lines.get(C.buffer.ybase+C.buffer.y);U&&j&&(U.isWrapped=j[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&j[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new l;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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}}a.AttributeData=l;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,j=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=j}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=f},9092:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const f=l(6349),C=l(7226),h=l(3734),j=l(8437),U=l(4634),W=l(511),H=l(643),x=l(4863),L=l(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(R,N,V){this._hasScrollback=R,this._optionsService=N,this._bufferService=V,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=j.DEFAULT_ATTR_DATA.clone(),this.savedCharset=L.DEFAULT_CHARSET,this.markers=[],this._nullCell=W.CellData.fromCharData([0,H.NULL_CELL_CHAR,H.NULL_CELL_WIDTH,H.NULL_CELL_CODE]),this._whitespaceCell=W.CellData.fromCharData([0,H.WHITESPACE_CELL_CHAR,H.WHITESPACE_CELL_WIDTH,H.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new C.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(R){return R?(this._nullCell.fg=R.fg,this._nullCell.bg=R.bg,this._nullCell.extended=R.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(R){return R?(this._whitespaceCell.fg=R.fg,this._whitespaceCell.bg=R.bg,this._whitespaceCell.extended=R.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(R,N){return new j.BufferLine(this._bufferService.cols,this.getNullCell(R),N)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const R=this.ybase+this.y-this.ydisp;return R>=0&&R<this._rows}_getCorrectBufferLength(R){if(!this._hasScrollback)return R;const N=R+this._optionsService.rawOptions.scrollback;return N>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:N}fillViewportRows(R){if(this.lines.length===0){R===void 0&&(R=j.DEFAULT_ATTR_DATA);let N=this._rows;for(;N--;)this.lines.push(this.getBlankLine(R))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(R,N){const V=this.getNullCell(j.DEFAULT_ATTR_DATA);let J=0;const Y=this._getCorrectBufferLength(N);if(Y>this.lines.maxLength&&(this.lines.maxLength=Y),this.lines.length>0){if(this._cols<R)for(let K=0;K<this.lines.length;K++)J+=+this.lines.get(K).resize(R,V);let Z=0;if(this._rows<N)for(let K=this._rows;K<N;K++)this.lines.length<N+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new j.BufferLine(R,V)):this.ybase>0&&this.lines.length<=this.ybase+this.y+Z+1?(this.ybase--,Z++,this.ydisp>0&&this.ydisp--):this.lines.push(new j.BufferLine(R,V)));else for(let K=this._rows;K>N;K--)this.lines.length>N+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(Y<this.lines.maxLength){const K=this.lines.length-Y;K>0&&(this.lines.trimStart(K),this.ybase=Math.max(this.ybase-K,0),this.ydisp=Math.max(this.ydisp-K,0),this.savedY=Math.max(this.savedY-K,0)),this.lines.maxLength=Y}this.x=Math.min(this.x,R-1),this.y=Math.min(this.y,N-1),Z&&(this.y+=Z),this.savedX=Math.min(this.savedX,R-1),this.scrollTop=0}if(this.scrollBottom=N-1,this._isReflowEnabled&&(this._reflow(R,N),this._cols>R))for(let Z=0;Z<this.lines.length;Z++)J+=+this.lines.get(Z).resize(R,V);this._cols=R,this._rows=N,this._memoryCleanupQueue.clear(),J>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let R=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,R=!1);let N=0;for(;this._memoryCleanupPosition<this.lines.length;)if(N+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),N>100)return!0;return R}get _isReflowEnabled(){const R=this._optionsService.rawOptions.windowsPty;return R&&R.buildNumber?this._hasScrollback&&R.backend==="conpty"&&R.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(R,N){this._cols!==R&&(R>this._cols?this._reflowLarger(R,N):this._reflowSmaller(R,N))}_reflowLarger(R,N){const V=(0,U.reflowLargerGetLinesToRemove)(this.lines,this._cols,R,this.ybase+this.y,this.getNullCell(j.DEFAULT_ATTR_DATA));if(V.length>0){const J=(0,U.reflowLargerCreateNewLayout)(this.lines,V);(0,U.reflowLargerApplyNewLayout)(this.lines,J.layout),this._reflowLargerAdjustViewport(R,N,J.countRemoved)}}_reflowLargerAdjustViewport(R,N,V){const J=this.getNullCell(j.DEFAULT_ATTR_DATA);let Y=V;for(;Y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<N&&this.lines.push(new j.BufferLine(R,J))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-V,0)}_reflowSmaller(R,N){const V=this.getNullCell(j.DEFAULT_ATTR_DATA),J=[];let Y=0;for(let Z=this.lines.length-1;Z>=0;Z--){let K=this.lines.get(Z);if(!K||!K.isWrapped&&K.getTrimmedLength()<=R)continue;const ee=[K];for(;K.isWrapped&&Z>0;)K=this.lines.get(--Z),ee.unshift(K);const oe=this.ybase+this.y;if(oe>=Z&&oe<Z+ee.length)continue;const ce=ee[ee.length-1].getTrimmedLength(),le=(0,U.reflowSmallerGetNewLineLengths)(ee,this._cols,R),ne=le.length-ee.length;let ae;ae=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+ne):Math.max(0,this.lines.length-this.lines.maxLength+ne);const _e=[];for(let Q=0;Q<ne;Q++){const se=this.getBlankLine(j.DEFAULT_ATTR_DATA,!0);_e.push(se)}_e.length>0&&(J.push({start:Z+ee.length+Y,newLines:_e}),Y+=_e.length),ee.push(..._e);let fe=le.length-1,ge=le[fe];ge===0&&(fe--,ge=le[fe]);let he=ee.length-ne-1,X=ce;for(;he>=0;){const Q=Math.min(X,ge);if(ee[fe]===void 0)break;if(ee[fe].copyCellsFrom(ee[he],X-Q,ge-Q,Q,!0),ge-=Q,ge===0&&(fe--,ge=le[fe]),X-=Q,X===0){he--;const se=Math.max(he,0);X=(0,U.getWrappedLineTrimmedLength)(ee,se,this._cols)}}for(let Q=0;Q<ee.length;Q++)le[Q]<R&&ee[Q].setCell(le[Q],V);let re=ne-ae;for(;re-- >0;)this.ybase===0?this.y<N-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+Y)-N&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+ne,this.ybase+N-1)}if(J.length>0){const Z=[],K=[];for(let fe=0;fe<this.lines.length;fe++)K.push(this.lines.get(fe));const ee=this.lines.length;let oe=ee-1,ce=0,le=J[ce];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+Y);let ne=0;for(let fe=Math.min(this.lines.maxLength-1,ee+Y-1);fe>=0;fe--)if(le&&le.start>oe+ne){for(let ge=le.newLines.length-1;ge>=0;ge--)this.lines.set(fe--,le.newLines[ge]);fe++,Z.push({index:oe+1,amount:le.newLines.length}),ne+=le.newLines.length,le=J[++ce]}else this.lines.set(fe,K[oe--]);let ae=0;for(let fe=Z.length-1;fe>=0;fe--)Z[fe].index+=ae,this.lines.onInsertEmitter.fire(Z[fe]),ae+=Z[fe].amount;const _e=Math.max(0,ee+Y-this.lines.maxLength);_e>0&&this.lines.onTrimEmitter.fire(_e)}}translateBufferLineToString(R,N,V=0,J){const Y=this.lines.get(R);return Y?Y.translateToString(N,V,J):""}getWrappedRangeForLine(R){let N=R,V=R;for(;N>0&&this.lines.get(N).isWrapped;)N--;for(;V+1<this.lines.length&&this.lines.get(V+1).isWrapped;)V++;return{first:N,last:V}}setupTabStops(R){for(R!=null?this.tabs[R]||(R=this.prevStop(R)):(this.tabs={},R=0);R<this._cols;R+=this._optionsService.rawOptions.tabStopWidth)this.tabs[R]=!0}prevStop(R){for(R==null&&(R=this.x);!this.tabs[--R]&&R>0;);return R>=this._cols?this._cols-1:R<0?0:R}nextStop(R){for(R==null&&(R=this.x);!this.tabs[++R]&&R<this._cols;);return R>=this._cols?this._cols-1:R<0?0:R}clearMarkers(R){this._isClearing=!0;for(let N=0;N<this.markers.length;N++)this.markers[N].line===R&&(this.markers[N].dispose(),this.markers.splice(N--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let R=0;R<this.markers.length;R++)this.markers[R].dispose(),this.markers.splice(R--,1);this._isClearing=!1}addMarker(R){const N=new x.Marker(R);return this.markers.push(N),N.register(this.lines.onTrim((V=>{N.line-=V,N.line<0&&N.dispose()}))),N.register(this.lines.onInsert((V=>{N.line>=V.index&&(N.line+=V.amount)}))),N.register(this.lines.onDelete((V=>{N.line>=V.index&&N.line<V.index+V.amount&&N.dispose(),N.line>V.index&&(N.line-=V.amount)}))),N.register(N.onDispose((()=>this._removeMarker(N)))),N}_removeMarker(R){this._isClearing||this.markers.splice(this.markers.indexOf(R),1)}}},8437:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const f=l(3734),C=l(511),h=l(643),j=l(482);a.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let U=0;class W{constructor(x,L,R=!1){this.isWrapped=R,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*x);const N=L||C.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let V=0;V<x;++V)this.setCell(V,N);this.length=x}get(x){const L=this._data[3*x+0],R=2097151&L;return[this._data[3*x+1],2097152&L?this._combined[x]:R?(0,j.stringFromCodePoint)(R):"",L>>22,2097152&L?this._combined[x].charCodeAt(this._combined[x].length-1):R]}set(x,L){this._data[3*x+1]=L[h.CHAR_DATA_ATTR_INDEX],L[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[x]=L[1],this._data[3*x+0]=2097152|x|L[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*x+0]=L[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|L[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(x){return this._data[3*x+0]>>22}hasWidth(x){return 12582912&this._data[3*x+0]}getFg(x){return this._data[3*x+1]}getBg(x){return this._data[3*x+2]}hasContent(x){return 4194303&this._data[3*x+0]}getCodePoint(x){const L=this._data[3*x+0];return 2097152&L?this._combined[x].charCodeAt(this._combined[x].length-1):2097151&L}isCombined(x){return 2097152&this._data[3*x+0]}getString(x){const L=this._data[3*x+0];return 2097152&L?this._combined[x]:2097151&L?(0,j.stringFromCodePoint)(2097151&L):""}isProtected(x){return 536870912&this._data[3*x+2]}loadCell(x,L){return U=3*x,L.content=this._data[U+0],L.fg=this._data[U+1],L.bg=this._data[U+2],2097152&L.content&&(L.combinedData=this._combined[x]),268435456&L.bg&&(L.extended=this._extendedAttrs[x]),L}setCell(x,L){2097152&L.content&&(this._combined[x]=L.combinedData),268435456&L.bg&&(this._extendedAttrs[x]=L.extended),this._data[3*x+0]=L.content,this._data[3*x+1]=L.fg,this._data[3*x+2]=L.bg}setCellFromCodepoint(x,L,R,N){268435456&N.bg&&(this._extendedAttrs[x]=N.extended),this._data[3*x+0]=L|R<<22,this._data[3*x+1]=N.fg,this._data[3*x+2]=N.bg}addCodepointToCell(x,L,R){let N=this._data[3*x+0];2097152&N?this._combined[x]+=(0,j.stringFromCodePoint)(L):2097151&N?(this._combined[x]=(0,j.stringFromCodePoint)(2097151&N)+(0,j.stringFromCodePoint)(L),N&=-2097152,N|=2097152):N=L|4194304,R&&(N&=-12582913,N|=R<<22),this._data[3*x+0]=N}insertCells(x,L,R){if((x%=this.length)&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,R),L<this.length-x){const N=new C.CellData;for(let V=this.length-x-L-1;V>=0;--V)this.setCell(x+L+V,this.loadCell(x+V,N));for(let V=0;V<L;++V)this.setCell(x+V,R)}else for(let N=x;N<this.length;++N)this.setCell(N,R);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,R)}deleteCells(x,L,R){if(x%=this.length,L<this.length-x){const N=new C.CellData;for(let V=0;V<this.length-x-L;++V)this.setCell(x+V,this.loadCell(x+L+V,N));for(let V=this.length-L;V<this.length;++V)this.setCell(V,R)}else for(let N=x;N<this.length;++N)this.setCell(N,R);x&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,R),this.getWidth(x)!==0||this.hasContent(x)||this.setCellFromCodepoint(x,0,1,R)}replaceCells(x,L,R,N=!1){if(N)for(x&&this.getWidth(x-1)===2&&!this.isProtected(x-1)&&this.setCellFromCodepoint(x-1,0,1,R),L<this.length&&this.getWidth(L-1)===2&&!this.isProtected(L)&&this.setCellFromCodepoint(L,0,1,R);x<L&&x<this.length;)this.isProtected(x)||this.setCell(x,R),x++;else for(x&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,R),L<this.length&&this.getWidth(L-1)===2&&this.setCellFromCodepoint(L,0,1,R);x<L&&x<this.length;)this.setCell(x++,R)}resize(x,L){if(x===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const R=3*x;if(x>this.length){if(this._data.buffer.byteLength>=4*R)this._data=new Uint32Array(this._data.buffer,0,R);else{const N=new Uint32Array(R);N.set(this._data),this._data=N}for(let N=this.length;N<x;++N)this.setCell(N,L)}else{this._data=this._data.subarray(0,R);const N=Object.keys(this._combined);for(let J=0;J<N.length;J++){const Y=parseInt(N[J],10);Y>=x&&delete this._combined[Y]}const V=Object.keys(this._extendedAttrs);for(let J=0;J<V.length;J++){const Y=parseInt(V[J],10);Y>=x&&delete this._extendedAttrs[Y]}}return this.length=x,4*R*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const x=new Uint32Array(this._data.length);return x.set(this._data),this._data=x,1}return 0}fill(x,L=!1){if(L)for(let R=0;R<this.length;++R)this.isProtected(R)||this.setCell(R,x);else{this._combined={},this._extendedAttrs={};for(let R=0;R<this.length;++R)this.setCell(R,x)}}copyFrom(x){this.length!==x.length?this._data=new Uint32Array(x._data):this._data.set(x._data),this.length=x.length,this._combined={};for(const L in x._combined)this._combined[L]=x._combined[L];this._extendedAttrs={};for(const L in x._extendedAttrs)this._extendedAttrs[L]=x._extendedAttrs[L];this.isWrapped=x.isWrapped}clone(){const x=new W(0);x._data=new Uint32Array(this._data),x.length=this.length;for(const L in this._combined)x._combined[L]=this._combined[L];for(const L in this._extendedAttrs)x._extendedAttrs[L]=this._extendedAttrs[L];return x.isWrapped=this.isWrapped,x}getTrimmedLength(){for(let x=this.length-1;x>=0;--x)if(4194303&this._data[3*x+0])return x+(this._data[3*x+0]>>22);return 0}getNoBgTrimmedLength(){for(let x=this.length-1;x>=0;--x)if(4194303&this._data[3*x+0]||50331648&this._data[3*x+2])return x+(this._data[3*x+0]>>22);return 0}copyCellsFrom(x,L,R,N,V){const J=x._data;if(V)for(let Z=N-1;Z>=0;Z--){for(let K=0;K<3;K++)this._data[3*(R+Z)+K]=J[3*(L+Z)+K];268435456&J[3*(L+Z)+2]&&(this._extendedAttrs[R+Z]=x._extendedAttrs[L+Z])}else for(let Z=0;Z<N;Z++){for(let K=0;K<3;K++)this._data[3*(R+Z)+K]=J[3*(L+Z)+K];268435456&J[3*(L+Z)+2]&&(this._extendedAttrs[R+Z]=x._extendedAttrs[L+Z])}const Y=Object.keys(x._combined);for(let Z=0;Z<Y.length;Z++){const K=parseInt(Y[Z],10);K>=L&&(this._combined[K-L+R]=x._combined[K])}}translateToString(x,L,R,N){L=L??0,R=R??this.length,x&&(R=Math.min(R,this.getTrimmedLength())),N&&(N.length=0);let V="";for(;L<R;){const J=this._data[3*L+0],Y=2097151&J,Z=2097152&J?this._combined[L]:Y?(0,j.stringFromCodePoint)(Y):h.WHITESPACE_CELL_CHAR;if(V+=Z,N)for(let K=0;K<Z.length;++K)N.push(L);L+=J>>22||1}return N&&N.push(L),V}}a.BufferLine=W},4841:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(l,f){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return f*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(d,a)=>{function l(f,C,h){if(C===f.length-1)return f[C].getTrimmedLength();const j=!f[C].hasContent(h-1)&&f[C].getWidth(h-1)===1,U=f[C+1].getWidth(0)===2;return j&&U?h-1:h}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(f,C,h,j,U){const W=[];for(let H=0;H<f.length-1;H++){let x=H,L=f.get(++x);if(!L.isWrapped)continue;const R=[f.get(H)];for(;x<f.length&&L.isWrapped;)R.push(L),L=f.get(++x);if(j>=H&&j<x){H+=R.length-1;continue}let N=0,V=l(R,N,C),J=1,Y=0;for(;J<R.length;){const K=l(R,J,C),ee=K-Y,oe=h-V,ce=Math.min(ee,oe);R[N].copyCellsFrom(R[J],Y,V,ce,!1),V+=ce,V===h&&(N++,V=0),Y+=ce,Y===K&&(J++,Y=0),V===0&&N!==0&&R[N-1].getWidth(h-1)===2&&(R[N].copyCellsFrom(R[N-1],h-1,V++,1,!1),R[N-1].setCell(h-1,U))}R[N].replaceCells(V,h,U);let Z=0;for(let K=R.length-1;K>0&&(K>N||R[K].getTrimmedLength()===0);K--)Z++;Z>0&&(W.push(H+R.length-Z),W.push(Z)),H+=R.length-1}return W},a.reflowLargerCreateNewLayout=function(f,C){const h=[];let j=0,U=C[j],W=0;for(let H=0;H<f.length;H++)if(U===H){const x=C[++j];f.onDeleteEmitter.fire({index:H-W,amount:x}),H+=x-1,W+=x,U=C[++j]}else h.push(H);return{layout:h,countRemoved:W}},a.reflowLargerApplyNewLayout=function(f,C){const h=[];for(let j=0;j<C.length;j++)h.push(f.get(C[j]));for(let j=0;j<h.length;j++)f.set(j,h[j]);f.length=C.length},a.reflowSmallerGetNewLineLengths=function(f,C,h){const j=[],U=f.map(((L,R)=>l(f,R,C))).reduce(((L,R)=>L+R));let W=0,H=0,x=0;for(;x<U;){if(U-x<h){j.push(U-x);break}W+=h;const L=l(f,H,C);W>L&&(W-=L,H++);const R=f[H].getWidth(W-1)===2;R&&W--;const N=R?h-1:h;j.push(N),x+=N}return j},a.getWrappedLineTrimmedLength=l},5295:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const f=l(8460),C=l(844),h=l(9092);class j extends C.Disposable{constructor(W,H){super(),this._optionsService=W,this._bufferService=H,this._onBufferActivate=this.register(new f.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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(W){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(W),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(W,H){this._normal.resize(W,H),this._alt.resize(W,H),this.setupTabStops(W)}setupTabStops(W){this._normal.setupTabStops(W),this._alt.setupTabStops(W)}}a.BufferSet=j},511:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const f=l(482),C=l(643),h=l(3734);class j extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(W){const H=new j;return H.setFromCharData(W),H}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(W){this.fg=W[C.CHAR_DATA_ATTR_INDEX],this.bg=0;let H=!1;if(W[C.CHAR_DATA_CHAR_INDEX].length>2)H=!0;else if(W[C.CHAR_DATA_CHAR_INDEX].length===2){const x=W[C.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=x&&x<=56319){const L=W[C.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=L&&L<=57343?this.content=1024*(x-55296)+L-56320+65536|W[C.CHAR_DATA_WIDTH_INDEX]<<22:H=!0}else H=!0}else this.content=W[C.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|W[C.CHAR_DATA_WIDTH_INDEX]<<22;H&&(this.combinedData=W[C.CHAR_DATA_CHAR_INDEX],this.content=2097152|W[C.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=j},643:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const f=l(8460),C=l(844);class h{get id(){return this._id}constructor(U){this.line=U,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,C.disposeArray)(this._disposables),this._disposables.length=0)}register(U){return this._disposables.push(U),U}}a.Marker=h,h._nextId=1},7116:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.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:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(d,a)=>{var l,f,C;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
|
|
80
|
-
`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(l||(a.C0=l={})),(function(h){h.PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC=""})(f||(a.C1=f={})),(function(h){h.ST=`${l.ESC}\\`})(C||(a.C1_ESCAPED=C={}))},7399:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const f=l(2584),C={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:["'",'"']};a.evaluateKeyboardEvent=function(h,j,U,W){const H={type:0,cancel:!1,key:void 0},x=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?H.key=j?f.C0.ESC+"OA":f.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?H.key=j?f.C0.ESC+"OD":f.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?H.key=j?f.C0.ESC+"OC":f.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(H.key=j?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:H.key=h.ctrlKey?"\b":f.C0.DEL,h.altKey&&(H.key=f.C0.ESC+H.key);break;case 9:if(h.shiftKey){H.key=f.C0.ESC+"[Z";break}H.key=f.C0.HT,H.cancel=!0;break;case 13:H.key=h.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,H.cancel=!0;break;case 27:H.key=f.C0.ESC,h.altKey&&(H.key=f.C0.ESC+f.C0.ESC),H.cancel=!0;break;case 37:if(h.metaKey)break;x?(H.key=f.C0.ESC+"[1;"+(x+1)+"D",H.key===f.C0.ESC+"[1;3D"&&(H.key=f.C0.ESC+(U?"b":"[1;5D"))):H.key=j?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(h.metaKey)break;x?(H.key=f.C0.ESC+"[1;"+(x+1)+"C",H.key===f.C0.ESC+"[1;3C"&&(H.key=f.C0.ESC+(U?"f":"[1;5C"))):H.key=j?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(h.metaKey)break;x?(H.key=f.C0.ESC+"[1;"+(x+1)+"A",U||H.key!==f.C0.ESC+"[1;3A"||(H.key=f.C0.ESC+"[1;5A")):H.key=j?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(h.metaKey)break;x?(H.key=f.C0.ESC+"[1;"+(x+1)+"B",U||H.key!==f.C0.ESC+"[1;3B"||(H.key=f.C0.ESC+"[1;5B")):H.key=j?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(H.key=f.C0.ESC+"[2~");break;case 46:H.key=x?f.C0.ESC+"[3;"+(x+1)+"~":f.C0.ESC+"[3~";break;case 36:H.key=x?f.C0.ESC+"[1;"+(x+1)+"H":j?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:H.key=x?f.C0.ESC+"[1;"+(x+1)+"F":j?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:h.shiftKey?H.type=2:h.ctrlKey?H.key=f.C0.ESC+"[5;"+(x+1)+"~":H.key=f.C0.ESC+"[5~";break;case 34:h.shiftKey?H.type=3:h.ctrlKey?H.key=f.C0.ESC+"[6;"+(x+1)+"~":H.key=f.C0.ESC+"[6~";break;case 112:H.key=x?f.C0.ESC+"[1;"+(x+1)+"P":f.C0.ESC+"OP";break;case 113:H.key=x?f.C0.ESC+"[1;"+(x+1)+"Q":f.C0.ESC+"OQ";break;case 114:H.key=x?f.C0.ESC+"[1;"+(x+1)+"R":f.C0.ESC+"OR";break;case 115:H.key=x?f.C0.ESC+"[1;"+(x+1)+"S":f.C0.ESC+"OS";break;case 116:H.key=x?f.C0.ESC+"[15;"+(x+1)+"~":f.C0.ESC+"[15~";break;case 117:H.key=x?f.C0.ESC+"[17;"+(x+1)+"~":f.C0.ESC+"[17~";break;case 118:H.key=x?f.C0.ESC+"[18;"+(x+1)+"~":f.C0.ESC+"[18~";break;case 119:H.key=x?f.C0.ESC+"[19;"+(x+1)+"~":f.C0.ESC+"[19~";break;case 120:H.key=x?f.C0.ESC+"[20;"+(x+1)+"~":f.C0.ESC+"[20~";break;case 121:H.key=x?f.C0.ESC+"[21;"+(x+1)+"~":f.C0.ESC+"[21~";break;case 122:H.key=x?f.C0.ESC+"[23;"+(x+1)+"~":f.C0.ESC+"[23~";break;case 123:H.key=x?f.C0.ESC+"[24;"+(x+1)+"~":f.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(U&&!W||!h.altKey||h.metaKey)!U||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?H.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(H.key=f.C0.US),h.key==="@"&&(H.key=f.C0.NUL)):h.keyCode===65&&(H.type=1);else{const L=C[h.keyCode],R=L==null?void 0:L[h.shiftKey?1:0];if(R)H.key=f.C0.ESC+R;else if(h.keyCode>=65&&h.keyCode<=90){const N=h.ctrlKey?h.keyCode-64:h.keyCode+32;let V=String.fromCharCode(N);h.shiftKey&&(V=V.toUpperCase()),H.key=f.C0.ESC+V}else if(h.keyCode===32)H.key=f.C0.ESC+(h.ctrlKey?f.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let N=h.code.slice(3,4);h.shiftKey||(N=N.toLowerCase()),H.key=f.C0.ESC+N,H.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?H.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?H.key=f.C0.NUL:h.keyCode>=51&&h.keyCode<=55?H.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?H.key=f.C0.DEL:h.keyCode===219?H.key=f.C0.ESC:h.keyCode===220?H.key=f.C0.FS:h.keyCode===221&&(H.key=f.C0.GS)}return H}},482:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},a.utf32ToString=function(l,f=0,C=l.length){let h="";for(let j=f;j<C;++j){let U=l[j];U>65535?(U-=65536,h+=String.fromCharCode(55296+(U>>10))+String.fromCharCode(U%1024+56320)):h+=String.fromCharCode(U)}return h},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,f){const C=l.length;if(!C)return 0;let h=0,j=0;if(this._interim){const U=l.charCodeAt(j++);56320<=U&&U<=57343?f[h++]=1024*(this._interim-55296)+U-56320+65536:(f[h++]=this._interim,f[h++]=U),this._interim=0}for(let U=j;U<C;++U){const W=l.charCodeAt(U);if(55296<=W&&W<=56319){if(++U>=C)return this._interim=W,h;const H=l.charCodeAt(U);56320<=H&&H<=57343?f[h++]=1024*(W-55296)+H-56320+65536:(f[h++]=W,f[h++]=H)}else W!==65279&&(f[h++]=W)}return h}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,f){const C=l.length;if(!C)return 0;let h,j,U,W,H=0,x=0,L=0;if(this.interim[0]){let V=!1,J=this.interim[0];J&=(224&J)==192?31:(240&J)==224?15:7;let Y,Z=0;for(;(Y=63&this.interim[++Z])&&Z<4;)J<<=6,J|=Y;const K=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,ee=K-Z;for(;L<ee;){if(L>=C)return 0;if(Y=l[L++],(192&Y)!=128){L--,V=!0;break}this.interim[Z++]=Y,J<<=6,J|=63&Y}V||(K===2?J<128?L--:f[H++]=J:K===3?J<2048||J>=55296&&J<=57343||J===65279||(f[H++]=J):J<65536||J>1114111||(f[H++]=J)),this.interim.fill(0)}const R=C-4;let N=L;for(;N<C;){for(;!(!(N<R)||128&(h=l[N])||128&(j=l[N+1])||128&(U=l[N+2])||128&(W=l[N+3]));)f[H++]=h,f[H++]=j,f[H++]=U,f[H++]=W,N+=4;if(h=l[N++],h<128)f[H++]=h;else if((224&h)==192){if(N>=C)return this.interim[0]=h,H;if(j=l[N++],(192&j)!=128){N--;continue}if(x=(31&h)<<6|63&j,x<128){N--;continue}f[H++]=x}else if((240&h)==224){if(N>=C)return this.interim[0]=h,H;if(j=l[N++],(192&j)!=128){N--;continue}if(N>=C)return this.interim[0]=h,this.interim[1]=j,H;if(U=l[N++],(192&U)!=128){N--;continue}if(x=(15&h)<<12|(63&j)<<6|63&U,x<2048||x>=55296&&x<=57343||x===65279)continue;f[H++]=x}else if((248&h)==240){if(N>=C)return this.interim[0]=h,H;if(j=l[N++],(192&j)!=128){N--;continue}if(N>=C)return this.interim[0]=h,this.interim[1]=j,H;if(U=l[N++],(192&U)!=128){N--;continue}if(N>=C)return this.interim[0]=h,this.interim[1]=j,this.interim[2]=U,H;if(W=l[N++],(192&W)!=128){N--;continue}if(x=(7&h)<<18|(63&j)<<12|(63&U)<<6|63&W,x<65536||x>1114111)continue;f[H++]=x}}return H}}},225:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const f=l(1480),C=[[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]],h=[[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 j;a.UnicodeV6=class{constructor(){if(this.version="6",!j){j=new Uint8Array(65536),j.fill(1),j[0]=0,j.fill(0,1,32),j.fill(0,127,160),j.fill(2,4352,4448),j[9001]=2,j[9002]=2,j.fill(2,11904,42192),j[12351]=1,j.fill(2,44032,55204),j.fill(2,63744,64256),j.fill(2,65040,65050),j.fill(2,65072,65136),j.fill(2,65280,65377),j.fill(2,65504,65511);for(let U=0;U<C.length;++U)j.fill(0,C[U][0],C[U][1]+1)}}wcwidth(U){return U<32?0:U<127?1:U<65536?j[U]:(function(W,H){let x,L=0,R=H.length-1;if(W<H[0][0]||W>H[R][1])return!1;for(;R>=L;)if(x=L+R>>1,W>H[x][1])L=x+1;else{if(!(W<H[x][0]))return!0;R=x-1}return!1})(U,h)?0:U>=131072&&U<=196605||U>=196608&&U<=262141?2:1}charProperties(U,W){let H=this.wcwidth(U),x=H===0&&W!==0;if(x){const L=f.UnicodeService.extractWidth(W);L===0?x=!1:L>H&&(H=L)}return f.UnicodeService.createPropertyValue(0,H,x)}}},5981:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const f=l(8460),C=l(844);class h extends C.Disposable{constructor(U){super(),this._action=U,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(U,W){if(W!==void 0&&this._syncCalls>W)return void(this._syncCalls=0);if(this._pendingData+=U.length,this._writeBuffer.push(U),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let H;for(this._isSyncWriting=!0;H=this._writeBuffer.shift();){this._action(H);const x=this._callbacks.shift();x&&x()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(U,W){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=U.length,this._writeBuffer.push(U),this._callbacks.push(W),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=U.length,this._writeBuffer.push(U),this._callbacks.push(W)}_innerWrite(U=0,W=!0){const H=U||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const x=this._writeBuffer[this._bufferOffset],L=this._action(x,W);if(L){const N=V=>Date.now()-H>=12?setTimeout((()=>this._innerWrite(0,V))):this._innerWrite(H,V);return void L.catch((V=>(queueMicrotask((()=>{throw V})),Promise.resolve(!1)))).then(N)}const R=this._callbacks[this._bufferOffset];if(R&&R(),this._bufferOffset++,this._pendingData-=x.length,Date.now()-H>=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()}}a.WriteBuffer=h},5941:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const l=/^([\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})$/,f=/^[\da-f]+$/;function C(h,j){const U=h.toString(16),W=U.length<2?"0"+U:U;switch(j){case 4:return U[0];case 8:return W;case 12:return(W+W).slice(0,3);default:return W+W}}a.parseColor=function(h){if(!h)return;let j=h.toLowerCase();if(j.indexOf("rgb:")===0){j=j.slice(4);const U=l.exec(j);if(U){const W=U[1]?15:U[4]?255:U[7]?4095:65535;return[Math.round(parseInt(U[1]||U[4]||U[7]||U[10],16)/W*255),Math.round(parseInt(U[2]||U[5]||U[8]||U[11],16)/W*255),Math.round(parseInt(U[3]||U[6]||U[9]||U[12],16)/W*255)]}}else if(j.indexOf("#")===0&&(j=j.slice(1),f.exec(j)&&[3,6,9,12].includes(j.length))){const U=j.length/3,W=[0,0,0];for(let H=0;H<3;++H){const x=parseInt(j.slice(U*H,U*H+U),16);W[H]=U===1?x<<4:U===2?x:U===3?x>>4:x>>8}return W}},a.toRgbString=function(h,j=16){const[U,W,H]=h;return`rgb:${C(U,j)}/${C(W,j)}/${C(H,j)}`}},5770:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const f=l(482),C=l(8742),h=l(5770),j=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=j,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=j}registerHandler(W,H){this._handlers[W]===void 0&&(this._handlers[W]=[]);const x=this._handlers[W];return x.push(H),{dispose:()=>{const L=x.indexOf(H);L!==-1&&x.splice(L,1)}}}clearHandler(W){this._handlers[W]&&delete this._handlers[W]}setHandlerFallback(W){this._handlerFb=W}reset(){if(this._active.length)for(let W=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;W>=0;--W)this._active[W].unhook(!1);this._stack.paused=!1,this._active=j,this._ident=0}hook(W,H){if(this.reset(),this._ident=W,this._active=this._handlers[W]||j,this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].hook(H);else this._handlerFb(this._ident,"HOOK",H)}put(W,H,x){if(this._active.length)for(let L=this._active.length-1;L>=0;L--)this._active[L].put(W,H,x);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(W,H,x))}unhook(W,H=!0){if(this._active.length){let x=!1,L=this._active.length-1,R=!1;if(this._stack.paused&&(L=this._stack.loopPosition-1,x=H,R=this._stack.fallThrough,this._stack.paused=!1),!R&&x===!1){for(;L>=0&&(x=this._active[L].unhook(W),x!==!0);L--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=L,this._stack.fallThrough=!1,x;L--}for(;L>=0;L--)if(x=this._active[L].unhook(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=L,this._stack.fallThrough=!0,x}else this._handlerFb(this._ident,"UNHOOK",W);this._active=j,this._ident=0}};const U=new C.Params;U.addParam(0),a.DcsHandler=class{constructor(W){this._handler=W,this._data="",this._params=U,this._hitLimit=!1}hook(W){this._params=W.length>1||W.params[0]?W.clone():U,this._data="",this._hitLimit=!1}put(W,H,x){this._hitLimit||(this._data+=(0,f.utf32ToString)(W,H,x),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(W){let H=!1;if(this._hitLimit)H=!1;else if(W&&(H=this._handler(this._data,this._params),H instanceof Promise))return H.then((x=>(this._params=U,this._data="",this._hitLimit=!1,x)));return this._params=U,this._data="",this._hitLimit=!1,H}}},2015:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const f=l(844),C=l(8742),h=l(6242),j=l(6351);class U{constructor(L){this.table=new Uint8Array(L)}setDefault(L,R){this.table.fill(L<<4|R)}add(L,R,N,V){this.table[R<<8|L]=N<<4|V}addMany(L,R,N,V){for(let J=0;J<L.length;J++)this.table[R<<8|L[J]]=N<<4|V}}a.TransitionTable=U;const W=160;a.VT500_TRANSITION_TABLE=(function(){const x=new U(4095),L=Array.apply(null,Array(256)).map(((Z,K)=>K)),R=(Z,K)=>L.slice(Z,K),N=R(32,127),V=R(0,24);V.push(25),V.push.apply(V,R(28,32));const J=R(0,14);let Y;for(Y in x.setDefault(1,0),x.addMany(N,0,2,0),J)x.addMany([24,26,153,154],Y,3,0),x.addMany(R(128,144),Y,3,0),x.addMany(R(144,152),Y,3,0),x.add(156,Y,0,0),x.add(27,Y,11,1),x.add(157,Y,4,8),x.addMany([152,158,159],Y,0,7),x.add(155,Y,11,3),x.add(144,Y,11,9);return x.addMany(V,0,3,0),x.addMany(V,1,3,1),x.add(127,1,0,1),x.addMany(V,8,0,8),x.addMany(V,3,3,3),x.add(127,3,0,3),x.addMany(V,4,3,4),x.add(127,4,0,4),x.addMany(V,6,3,6),x.addMany(V,5,3,5),x.add(127,5,0,5),x.addMany(V,2,3,2),x.add(127,2,0,2),x.add(93,1,4,8),x.addMany(N,8,5,8),x.add(127,8,5,8),x.addMany([156,27,24,26,7],8,6,0),x.addMany(R(28,32),8,0,8),x.addMany([88,94,95],1,0,7),x.addMany(N,7,0,7),x.addMany(V,7,0,7),x.add(156,7,0,0),x.add(127,7,0,7),x.add(91,1,11,3),x.addMany(R(64,127),3,7,0),x.addMany(R(48,60),3,8,4),x.addMany([60,61,62,63],3,9,4),x.addMany(R(48,60),4,8,4),x.addMany(R(64,127),4,7,0),x.addMany([60,61,62,63],4,0,6),x.addMany(R(32,64),6,0,6),x.add(127,6,0,6),x.addMany(R(64,127),6,0,0),x.addMany(R(32,48),3,9,5),x.addMany(R(32,48),5,9,5),x.addMany(R(48,64),5,0,6),x.addMany(R(64,127),5,7,0),x.addMany(R(32,48),4,9,5),x.addMany(R(32,48),1,9,2),x.addMany(R(32,48),2,9,2),x.addMany(R(48,127),2,10,0),x.addMany(R(48,80),1,10,0),x.addMany(R(81,88),1,10,0),x.addMany([89,90,92],1,10,0),x.addMany(R(96,127),1,10,0),x.add(80,1,11,9),x.addMany(V,9,0,9),x.add(127,9,0,9),x.addMany(R(28,32),9,0,9),x.addMany(R(32,48),9,9,12),x.addMany(R(48,60),9,8,10),x.addMany([60,61,62,63],9,9,10),x.addMany(V,11,0,11),x.addMany(R(32,128),11,0,11),x.addMany(R(28,32),11,0,11),x.addMany(V,10,0,10),x.add(127,10,0,10),x.addMany(R(28,32),10,0,10),x.addMany(R(48,60),10,8,10),x.addMany([60,61,62,63],10,0,11),x.addMany(R(32,48),10,9,12),x.addMany(V,12,0,12),x.add(127,12,0,12),x.addMany(R(28,32),12,0,12),x.addMany(R(32,48),12,9,12),x.addMany(R(48,64),12,0,11),x.addMany(R(64,127),12,12,13),x.addMany(R(64,127),10,12,13),x.addMany(R(64,127),9,12,13),x.addMany(V,13,13,13),x.addMany(N,13,13,13),x.add(127,13,0,13),x.addMany([27,156,24,26],13,14,0),x.add(W,0,2,0),x.add(W,8,5,8),x.add(W,6,0,6),x.add(W,11,0,11),x.add(W,13,13,13),x})();class H extends f.Disposable{constructor(L=a.VT500_TRANSITION_TABLE){super(),this._transitions=L,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new C.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(R,N,V)=>{},this._executeHandlerFb=R=>{},this._csiHandlerFb=(R,N)=>{},this._escHandlerFb=R=>{},this._errorHandlerFb=R=>R,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new j.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(L,R=[64,126]){let N=0;if(L.prefix){if(L.prefix.length>1)throw new Error("only one byte as prefix supported");if(N=L.prefix.charCodeAt(0),N&&60>N||N>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(L.intermediates){if(L.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let J=0;J<L.intermediates.length;++J){const Y=L.intermediates.charCodeAt(J);if(32>Y||Y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");N<<=8,N|=Y}}if(L.final.length!==1)throw new Error("final must be a single byte");const V=L.final.charCodeAt(0);if(R[0]>V||V>R[1])throw new Error(`final must be in range ${R[0]} .. ${R[1]}`);return N<<=8,N|=V,N}identToString(L){const R=[];for(;L;)R.push(String.fromCharCode(255&L)),L>>=8;return R.reverse().join("")}setPrintHandler(L){this._printHandler=L}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(L,R){const N=this._identifier(L,[48,126]);this._escHandlers[N]===void 0&&(this._escHandlers[N]=[]);const V=this._escHandlers[N];return V.push(R),{dispose:()=>{const J=V.indexOf(R);J!==-1&&V.splice(J,1)}}}clearEscHandler(L){this._escHandlers[this._identifier(L,[48,126])]&&delete this._escHandlers[this._identifier(L,[48,126])]}setEscHandlerFallback(L){this._escHandlerFb=L}setExecuteHandler(L,R){this._executeHandlers[L.charCodeAt(0)]=R}clearExecuteHandler(L){this._executeHandlers[L.charCodeAt(0)]&&delete this._executeHandlers[L.charCodeAt(0)]}setExecuteHandlerFallback(L){this._executeHandlerFb=L}registerCsiHandler(L,R){const N=this._identifier(L);this._csiHandlers[N]===void 0&&(this._csiHandlers[N]=[]);const V=this._csiHandlers[N];return V.push(R),{dispose:()=>{const J=V.indexOf(R);J!==-1&&V.splice(J,1)}}}clearCsiHandler(L){this._csiHandlers[this._identifier(L)]&&delete this._csiHandlers[this._identifier(L)]}setCsiHandlerFallback(L){this._csiHandlerFb=L}registerDcsHandler(L,R){return this._dcsParser.registerHandler(this._identifier(L),R)}clearDcsHandler(L){this._dcsParser.clearHandler(this._identifier(L))}setDcsHandlerFallback(L){this._dcsParser.setHandlerFallback(L)}registerOscHandler(L,R){return this._oscParser.registerHandler(L,R)}clearOscHandler(L){this._oscParser.clearHandler(L)}setOscHandlerFallback(L){this._oscParser.setHandlerFallback(L)}setErrorHandler(L){this._errorHandler=L}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(L,R,N,V,J){this._parseStack.state=L,this._parseStack.handlers=R,this._parseStack.handlerPos=N,this._parseStack.transition=V,this._parseStack.chunkPos=J}parse(L,R,N){let V,J=0,Y=0,Z=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,Z=this._parseStack.chunkPos+1;else{if(N===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const K=this._parseStack.handlers;let ee=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(N===!1&&ee>-1){for(;ee>=0&&(V=K[ee](this._params),V!==!0);ee--)if(V instanceof Promise)return this._parseStack.handlerPos=ee,V}this._parseStack.handlers=[];break;case 4:if(N===!1&&ee>-1){for(;ee>=0&&(V=K[ee](),V!==!0);ee--)if(V instanceof Promise)return this._parseStack.handlerPos=ee,V}this._parseStack.handlers=[];break;case 6:if(J=L[this._parseStack.chunkPos],V=this._dcsParser.unhook(J!==24&&J!==26,N),V)return V;J===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(J=L[this._parseStack.chunkPos],V=this._oscParser.end(J!==24&&J!==26,N),V)return V;J===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,Z=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let K=Z;K<R;++K){switch(J=L[K],Y=this._transitions.table[this.currentState<<8|(J<160?J:W)],Y>>4){case 2:for(let ne=K+1;;++ne){if(ne>=R||(J=L[ne])<32||J>126&&J<W){this._printHandler(L,K,ne),K=ne-1;break}if(++ne>=R||(J=L[ne])<32||J>126&&J<W){this._printHandler(L,K,ne),K=ne-1;break}if(++ne>=R||(J=L[ne])<32||J>126&&J<W){this._printHandler(L,K,ne),K=ne-1;break}if(++ne>=R||(J=L[ne])<32||J>126&&J<W){this._printHandler(L,K,ne),K=ne-1;break}}break;case 3:this._executeHandlers[J]?this._executeHandlers[J]():this._executeHandlerFb(J),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:K,code:J,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const ee=this._csiHandlers[this._collect<<8|J];let oe=ee?ee.length-1:-1;for(;oe>=0&&(V=ee[oe](this._params),V!==!0);oe--)if(V instanceof Promise)return this._preserveStack(3,ee,oe,Y,K),V;oe<0&&this._csiHandlerFb(this._collect<<8|J,this._params),this.precedingJoinState=0;break;case 8:do switch(J){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(J-48)}while(++K<R&&(J=L[K])>47&&J<60);K--;break;case 9:this._collect<<=8,this._collect|=J;break;case 10:const ce=this._escHandlers[this._collect<<8|J];let le=ce?ce.length-1:-1;for(;le>=0&&(V=ce[le](),V!==!0);le--)if(V instanceof Promise)return this._preserveStack(4,ce,le,Y,K),V;le<0&&this._escHandlerFb(this._collect<<8|J),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|J,this._params);break;case 13:for(let ne=K+1;;++ne)if(ne>=R||(J=L[ne])===24||J===26||J===27||J>127&&J<W){this._dcsParser.put(L,K,ne),K=ne-1;break}break;case 14:if(V=this._dcsParser.unhook(J!==24&&J!==26),V)return this._preserveStack(6,[],0,Y,K),V;J===27&&(Y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let ne=K+1;;ne++)if(ne>=R||(J=L[ne])<32||J>127&&J<W){this._oscParser.put(L,K,ne),K=ne-1;break}break;case 6:if(V=this._oscParser.end(J!==24&&J!==26),V)return this._preserveStack(5,[],0,Y,K),V;J===27&&(Y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&Y}}}a.EscapeSequenceParser=H},6242:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const f=l(5770),C=l(482),h=[];a.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(j,U){this._handlers[j]===void 0&&(this._handlers[j]=[]);const W=this._handlers[j];return W.push(U),{dispose:()=>{const H=W.indexOf(U);H!==-1&&W.splice(H,1)}}}clearHandler(j){this._handlers[j]&&delete this._handlers[j]}setHandlerFallback(j){this._handlerFb=j}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let j=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;j>=0;--j)this._active[j].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let j=this._active.length-1;j>=0;j--)this._active[j].start();else this._handlerFb(this._id,"START")}_put(j,U,W){if(this._active.length)for(let H=this._active.length-1;H>=0;H--)this._active[H].put(j,U,W);else this._handlerFb(this._id,"PUT",(0,C.utf32ToString)(j,U,W))}start(){this.reset(),this._state=1}put(j,U,W){if(this._state!==3){if(this._state===1)for(;U<W;){const H=j[U++];if(H===59){this._state=2,this._start();break}if(H<48||57<H)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+H-48}this._state===2&&W-U>0&&this._put(j,U,W)}}end(j,U=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let W=!1,H=this._active.length-1,x=!1;if(this._stack.paused&&(H=this._stack.loopPosition-1,W=U,x=this._stack.fallThrough,this._stack.paused=!1),!x&&W===!1){for(;H>=0&&(W=this._active[H].end(j),W!==!0);H--)if(W instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=H,this._stack.fallThrough=!1,W;H--}for(;H>=0;H--)if(W=this._active[H].end(!1),W instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=H,this._stack.fallThrough=!0,W}else this._handlerFb(this._id,"END",j);this._active=h,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(j){this._handler=j,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(j,U,W){this._hitLimit||(this._data+=(0,C.utf32ToString)(j,U,W),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(j){let U=!1;if(this._hitLimit)U=!1;else if(j&&(U=this._handler(this._data),U instanceof Promise))return U.then((W=>(this._data="",this._hitLimit=!1,W)));return this._data="",this._hitLimit=!1,U}}},8742:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const l=2147483647;class f{static fromArray(h){const j=new f;if(!h.length)return j;for(let U=Array.isArray(h[0])?1:0;U<h.length;++U){const W=h[U];if(Array.isArray(W))for(let H=0;H<W.length;++H)j.addSubParam(W[H]);else j.addParam(W)}return j}constructor(h=32,j=32){if(this.maxLength=h,this.maxSubParamsLength=j,j>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(j),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new f(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let j=0;j<this.length;++j){h.push(this.params[j]);const U=this._subParamsIdx[j]>>8,W=255&this._subParamsIdx[j];W-U>0&&h.push(Array.prototype.slice.call(this._subParams,U,W))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>l?l:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>l?l:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const j=this._subParamsIdx[h]>>8,U=255&this._subParamsIdx[h];return U-j>0?this._subParams.subarray(j,U):null}getSubParamsAll(){const h={};for(let j=0;j<this.length;++j){const U=this._subParamsIdx[j]>>8,W=255&this._subParamsIdx[j];W-U>0&&(h[j]=this._subParams.slice(U,W))}return h}addDigit(h){let j;if(this._rejectDigits||!(j=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const U=this._digitIsSub?this._subParams:this.params,W=U[j-1];U[j-1]=~W?Math.min(10*W+h,l):h}}a.Params=f},5741:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,f){const C={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(C),f.dispose=()=>this._wrappedAddonDispose(C),f.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let f=-1;for(let C=0;C<this._addons.length;C++)if(this._addons[C]===l){f=C;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(f,1)}}},8771:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const f=l(3785),C=l(511);a.BufferApiView=class{constructor(h,j){this._buffer=h,this.type=j}init(h){return this._buffer=h,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(h){const j=this._buffer.lines.get(h);if(j)return new f.BufferLineApiView(j)}getNullCell(){return new C.CellData}}},3785:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const f=l(511);a.BufferLineApiView=class{constructor(C){this._line=C}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(C,h){if(!(C<0||C>=this._line.length))return h?(this._line.loadCell(C,h),h):this._line.loadCell(C,new f.CellData)}translateToString(C,h,j){return this._line.translateToString(C,h,j)}}},8285:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const f=l(8771),C=l(8460),h=l(844);class j extends h.Disposable{constructor(W){super(),this._core=W,this._onBufferChange=this.register(new C.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.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)}}a.BufferNamespaceApi=j},7975:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,f){return this._core.registerCsiHandler(l,(C=>f(C.toArray())))}addCsiHandler(l,f){return this.registerCsiHandler(l,f)}registerDcsHandler(l,f){return this._core.registerDcsHandler(l,((C,h)=>f(C,h.toArray())))}addDcsHandler(l,f){return this.registerDcsHandler(l,f)}registerEscHandler(l,f){return this._core.registerEscHandler(l,f)}addEscHandler(l,f){return this.registerEscHandler(l,f)}registerOscHandler(l,f){return this._core.registerOscHandler(l,f)}addOscHandler(l,f){return this.registerOscHandler(l,f)}}},7090:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(d,a,l){var f=this&&this.__decorate||function(x,L,R,N){var V,J=arguments.length,Y=J<3?L:N===null?N=Object.getOwnPropertyDescriptor(L,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(x,L,R,N);else for(var Z=x.length-1;Z>=0;Z--)(V=x[Z])&&(Y=(J<3?V(Y):J>3?V(L,R,Y):V(L,R))||Y);return J>3&&Y&&Object.defineProperty(L,R,Y),Y},C=this&&this.__param||function(x,L){return function(R,N){L(R,N,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const h=l(8460),j=l(844),U=l(5295),W=l(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let H=a.BufferService=class extends j.Disposable{get buffer(){return this.buffers.active}constructor(x){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(x.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(x.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new U.BufferSet(x,this))}resize(x,L){this.cols=x,this.rows=L,this.buffers.resize(x,L),this._onResize.fire({cols:x,rows:L})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(x,L=!1){const R=this.buffer;let N;N=this._cachedBlankLine,N&&N.length===this.cols&&N.getFg(0)===x.fg&&N.getBg(0)===x.bg||(N=R.getBlankLine(x,L),this._cachedBlankLine=N),N.isWrapped=L;const V=R.ybase+R.scrollTop,J=R.ybase+R.scrollBottom;if(R.scrollTop===0){const Y=R.lines.isFull;J===R.lines.length-1?Y?R.lines.recycle().copyFrom(N):R.lines.push(N.clone()):R.lines.splice(J+1,0,N.clone()),Y?this.isUserScrolling&&(R.ydisp=Math.max(R.ydisp-1,0)):(R.ybase++,this.isUserScrolling||R.ydisp++)}else{const Y=J-V+1;R.lines.shiftElements(V+1,Y-1,-1),R.lines.set(J,N.clone())}this.isUserScrolling||(R.ydisp=R.ybase),this._onScroll.fire(R.ydisp)}scrollLines(x,L,R){const N=this.buffer;if(x<0){if(N.ydisp===0)return;this.isUserScrolling=!0}else x+N.ydisp>=N.ybase&&(this.isUserScrolling=!1);const V=N.ydisp;N.ydisp=Math.max(Math.min(N.ydisp+x,N.ybase),0),V!==N.ydisp&&(L||this._onScroll.fire(N.ydisp))}};a.BufferService=H=f([C(0,W.IOptionsService)],H)},7994:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,f){this._charsets[l]=f,this.glevel===l&&(this.charset=f)}}},1753:function(d,a,l){var f=this&&this.__decorate||function(N,V,J,Y){var Z,K=arguments.length,ee=K<3?V:Y===null?Y=Object.getOwnPropertyDescriptor(V,J):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(N,V,J,Y);else for(var oe=N.length-1;oe>=0;oe--)(Z=N[oe])&&(ee=(K<3?Z(ee):K>3?Z(V,J,ee):Z(V,J))||ee);return K>3&&ee&&Object.defineProperty(V,J,ee),ee},C=this&&this.__param||function(N,V){return function(J,Y){V(J,Y,N)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const h=l(2585),j=l(8460),U=l(844),W={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:N=>N.button!==4&&N.action===1&&(N.ctrl=!1,N.alt=!1,N.shift=!1,!0)},VT200:{events:19,restrict:N=>N.action!==32},DRAG:{events:23,restrict:N=>N.action!==32||N.button!==3},ANY:{events:31,restrict:N=>!0}};function H(N,V){let J=(N.ctrl?16:0)|(N.shift?4:0)|(N.alt?8:0);return N.button===4?(J|=64,J|=N.action):(J|=3&N.button,4&N.button&&(J|=64),8&N.button&&(J|=128),N.action===32?J|=32:N.action!==0||V||(J|=3)),J}const x=String.fromCharCode,L={DEFAULT:N=>{const V=[H(N,!1)+32,N.col+32,N.row+32];return V[0]>255||V[1]>255||V[2]>255?"":`\x1B[M${x(V[0])}${x(V[1])}${x(V[2])}`},SGR:N=>{const V=N.action===0&&N.button!==4?"m":"M";return`\x1B[<${H(N,!0)};${N.col};${N.row}${V}`},SGR_PIXELS:N=>{const V=N.action===0&&N.button!==4?"m":"M";return`\x1B[<${H(N,!0)};${N.x};${N.y}${V}`}};let R=a.CoreMouseService=class extends U.Disposable{constructor(N,V){super(),this._bufferService=N,this._coreService=V,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new j.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const J of Object.keys(W))this.addProtocol(J,W[J]);for(const J of Object.keys(L))this.addEncoding(J,L[J]);this.reset()}addProtocol(N,V){this._protocols[N]=V}addEncoding(N,V){this._encodings[N]=V}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(N){if(!this._protocols[N])throw new Error(`unknown protocol "${N}"`);this._activeProtocol=N,this._onProtocolChange.fire(this._protocols[N].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(N){if(!this._encodings[N])throw new Error(`unknown encoding "${N}"`);this._activeEncoding=N}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(N){if(N.col<0||N.col>=this._bufferService.cols||N.row<0||N.row>=this._bufferService.rows||N.button===4&&N.action===32||N.button===3&&N.action!==32||N.button!==4&&(N.action===2||N.action===3)||(N.col++,N.row++,N.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,N,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(N))return!1;const V=this._encodings[this._activeEncoding](N);return V&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(V):this._coreService.triggerDataEvent(V,!0)),this._lastEvent=N,!0}explainEvents(N){return{down:!!(1&N),up:!!(2&N),drag:!!(4&N),move:!!(8&N),wheel:!!(16&N)}}_equalEvents(N,V,J){if(J){if(N.x!==V.x||N.y!==V.y)return!1}else if(N.col!==V.col||N.row!==V.row)return!1;return N.button===V.button&&N.action===V.action&&N.ctrl===V.ctrl&&N.alt===V.alt&&N.shift===V.shift}};a.CoreMouseService=R=f([C(0,h.IBufferService),C(1,h.ICoreService)],R)},6975:function(d,a,l){var f=this&&this.__decorate||function(R,N,V,J){var Y,Z=arguments.length,K=Z<3?N:J===null?J=Object.getOwnPropertyDescriptor(N,V):J;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(R,N,V,J);else for(var ee=R.length-1;ee>=0;ee--)(Y=R[ee])&&(K=(Z<3?Y(K):Z>3?Y(N,V,K):Y(N,V))||K);return Z>3&&K&&Object.defineProperty(N,V,K),K},C=this&&this.__param||function(R,N){return function(V,J){N(V,J,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const h=l(1439),j=l(8460),U=l(844),W=l(2585),H=Object.freeze({insertMode:!1}),x=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let L=a.CoreService=class extends U.Disposable{constructor(R,N,V){super(),this._bufferService=R,this._logService=N,this._optionsService=V,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new j.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new j.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new j.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new j.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(H),this.decPrivateModes=(0,h.clone)(x)}reset(){this.modes=(0,h.clone)(H),this.decPrivateModes=(0,h.clone)(x)}triggerDataEvent(R,N=!1){if(this._optionsService.rawOptions.disableStdin)return;const V=this._bufferService.buffer;N&&this._optionsService.rawOptions.scrollOnUserInput&&V.ybase!==V.ydisp&&this._onRequestScrollToBottom.fire(),N&&this._onUserInput.fire(),this._logService.debug(`sending data "${R}"`,(()=>R.split("").map((J=>J.charCodeAt(0))))),this._onData.fire(R)}triggerBinaryEvent(R){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${R}"`,(()=>R.split("").map((N=>N.charCodeAt(0))))),this._onBinary.fire(R))}};a.CoreService=L=f([C(0,W.IBufferService),C(1,W.ILogService),C(2,W.IOptionsService)],L)},9074:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const f=l(8055),C=l(8460),h=l(844),j=l(6106);let U=0,W=0;class H extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new j.SortedList((R=>R==null?void 0:R.marker.line)),this._onDecorationRegistered=this.register(new C.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new C.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(R){if(R.marker.isDisposed)return;const N=new x(R);if(N){const V=N.marker.onDispose((()=>N.dispose()));N.onDispose((()=>{N&&(this._decorations.delete(N)&&this._onDecorationRemoved.fire(N),V.dispose())})),this._decorations.insert(N),this._onDecorationRegistered.fire(N)}return N}reset(){for(const R of this._decorations.values())R.dispose();this._decorations.clear()}*getDecorationsAtCell(R,N,V){let J=0,Y=0;for(const Z of this._decorations.getKeyIterator(N))J=Z.options.x??0,Y=J+(Z.options.width??1),R>=J&&R<Y&&(!V||(Z.options.layer??"bottom")===V)&&(yield Z)}forEachDecorationAtCell(R,N,V,J){this._decorations.forEachByKey(N,(Y=>{U=Y.options.x??0,W=U+(Y.options.width??1),R>=U&&R<W&&(!V||(Y.options.layer??"bottom")===V)&&J(Y)}))}}a.DecorationService=H;class x extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(R){super(),this.options=R,this.onRenderEmitter=this.register(new C.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new C.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=R.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const f=l(2585),C=l(8343);class h{constructor(...U){this._entries=new Map;for(const[W,H]of U)this.set(W,H)}set(U,W){const H=this._entries.get(U);return this._entries.set(U,W),H}forEach(U){for(const[W,H]of this._entries.entries())U(W,H)}has(U){return this._entries.has(U)}get(U){return this._entries.get(U)}}a.ServiceCollection=h,a.InstantiationService=class{constructor(){this._services=new h,this._services.set(f.IInstantiationService,this)}setService(j,U){this._services.set(j,U)}getService(j){return this._services.get(j)}createInstance(j,...U){const W=(0,C.getServiceDependencies)(j).sort(((L,R)=>L.index-R.index)),H=[];for(const L of W){const R=this._services.get(L.id);if(!R)throw new Error(`[createInstance] ${j.name} depends on UNKNOWN service ${L.id}.`);H.push(R)}const x=W.length>0?W[0].index:U.length;if(U.length!==x)throw new Error(`[createInstance] First service dependency of ${j.name} at position ${x+1} conflicts with ${U.length} static arguments`);return new j(...U,...H)}}},7866:function(d,a,l){var f=this&&this.__decorate||function(x,L,R,N){var V,J=arguments.length,Y=J<3?L:N===null?N=Object.getOwnPropertyDescriptor(L,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(x,L,R,N);else for(var Z=x.length-1;Z>=0;Z--)(V=x[Z])&&(Y=(J<3?V(Y):J>3?V(L,R,Y):V(L,R))||Y);return J>3&&Y&&Object.defineProperty(L,R,Y),Y},C=this&&this.__param||function(x,L){return function(R,N){L(R,N,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const h=l(844),j=l(2585),U={trace:j.LogLevelEnum.TRACE,debug:j.LogLevelEnum.DEBUG,info:j.LogLevelEnum.INFO,warn:j.LogLevelEnum.WARN,error:j.LogLevelEnum.ERROR,off:j.LogLevelEnum.OFF};let W,H=a.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(x){super(),this._optionsService=x,this._logLevel=j.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),W=this}_updateLogLevel(){this._logLevel=U[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(x){for(let L=0;L<x.length;L++)typeof x[L]=="function"&&(x[L]=x[L]())}_log(x,L,R){this._evalLazyOptionalParams(R),x.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+L,...R)}trace(x,...L){var R;this._logLevel<=j.LogLevelEnum.TRACE&&this._log(((R=this._optionsService.options.logger)==null?void 0:R.trace.bind(this._optionsService.options.logger))??console.log,x,L)}debug(x,...L){var R;this._logLevel<=j.LogLevelEnum.DEBUG&&this._log(((R=this._optionsService.options.logger)==null?void 0:R.debug.bind(this._optionsService.options.logger))??console.log,x,L)}info(x,...L){var R;this._logLevel<=j.LogLevelEnum.INFO&&this._log(((R=this._optionsService.options.logger)==null?void 0:R.info.bind(this._optionsService.options.logger))??console.info,x,L)}warn(x,...L){var R;this._logLevel<=j.LogLevelEnum.WARN&&this._log(((R=this._optionsService.options.logger)==null?void 0:R.warn.bind(this._optionsService.options.logger))??console.warn,x,L)}error(x,...L){var R;this._logLevel<=j.LogLevelEnum.ERROR&&this._log(((R=this._optionsService.options.logger)==null?void 0:R.error.bind(this._optionsService.options.logger))??console.error,x,L)}};a.LogService=H=f([C(0,j.IOptionsService)],H),a.setTraceLogger=function(x){W=x},a.traceCall=function(x,L,R){if(typeof R.value!="function")throw new Error("not supported");const N=R.value;R.value=function(...V){if(W.logLevel!==j.LogLevelEnum.TRACE)return N.apply(this,V);W.trace(`GlyphRenderer#${N.name}(${V.map((Y=>JSON.stringify(Y))).join(", ")})`);const J=N.apply(this,V);return W.trace(`GlyphRenderer#${N.name} return`,J),J}}},7302:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const f=l(8460),C=l(844),h=l(6114);a.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:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const j=["normal","bold","100","200","300","400","500","600","700","800","900"];class U extends C.Disposable{constructor(H){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const x={...a.DEFAULT_OPTIONS};for(const L in H)if(L in x)try{const R=H[L];x[L]=this._sanitizeAndValidateOption(L,R)}catch(R){console.error(R)}this.rawOptions=x,this.options={...x},this._setupOptions(),this.register((0,C.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(H,x){return this.onOptionChange((L=>{L===H&&x(this.rawOptions[H])}))}onMultipleOptionChange(H,x){return this.onOptionChange((L=>{H.indexOf(L)!==-1&&x()}))}_setupOptions(){const H=L=>{if(!(L in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${L}"`);return this.rawOptions[L]},x=(L,R)=>{if(!(L in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${L}"`);R=this._sanitizeAndValidateOption(L,R),this.rawOptions[L]!==R&&(this.rawOptions[L]=R,this._onOptionChange.fire(L))};for(const L in this.rawOptions){const R={get:H.bind(this,L),set:x.bind(this,L)};Object.defineProperty(this.options,L,R)}}_sanitizeAndValidateOption(H,x){switch(H){case"cursorStyle":if(x||(x=a.DEFAULT_OPTIONS[H]),!(function(L){return L==="block"||L==="underline"||L==="bar"})(x))throw new Error(`"${x}" is not a valid value for ${H}`);break;case"wordSeparator":x||(x=a.DEFAULT_OPTIONS[H]);break;case"fontWeight":case"fontWeightBold":if(typeof x=="number"&&1<=x&&x<=1e3)break;x=j.includes(x)?x:a.DEFAULT_OPTIONS[H];break;case"cursorWidth":x=Math.floor(x);case"lineHeight":case"tabStopWidth":if(x<1)throw new Error(`${H} cannot be less than 1, value: ${x}`);break;case"minimumContrastRatio":x=Math.max(1,Math.min(21,Math.round(10*x)/10));break;case"scrollback":if((x=Math.min(x,4294967295))<0)throw new Error(`${H} cannot be less than 0, value: ${x}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(x<=0)throw new Error(`${H} cannot be less than or equal to 0, value: ${x}`);break;case"rows":case"cols":if(!x&&x!==0)throw new Error(`${H} must be numeric, value: ${x}`);break;case"windowsPty":x=x??{}}return x}}a.OptionsService=U},2660:function(d,a,l){var f=this&&this.__decorate||function(U,W,H,x){var L,R=arguments.length,N=R<3?W:x===null?x=Object.getOwnPropertyDescriptor(W,H):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(U,W,H,x);else for(var V=U.length-1;V>=0;V--)(L=U[V])&&(N=(R<3?L(N):R>3?L(W,H,N):L(W,H))||N);return R>3&&N&&Object.defineProperty(W,H,N),N},C=this&&this.__param||function(U,W){return function(H,x){W(H,x,U)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const h=l(2585);let j=a.OscLinkService=class{constructor(U){this._bufferService=U,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(U){const W=this._bufferService.buffer;if(U.id===void 0){const V=W.addMarker(W.ybase+W.y),J={data:U,id:this._nextId++,lines:[V]};return V.onDispose((()=>this._removeMarkerFromLink(J,V))),this._dataByLinkId.set(J.id,J),J.id}const H=U,x=this._getEntryIdKey(H),L=this._entriesWithId.get(x);if(L)return this.addLineToLink(L.id,W.ybase+W.y),L.id;const R=W.addMarker(W.ybase+W.y),N={id:this._nextId++,key:this._getEntryIdKey(H),data:H,lines:[R]};return R.onDispose((()=>this._removeMarkerFromLink(N,R))),this._entriesWithId.set(N.key,N),this._dataByLinkId.set(N.id,N),N.id}addLineToLink(U,W){const H=this._dataByLinkId.get(U);if(H&&H.lines.every((x=>x.line!==W))){const x=this._bufferService.buffer.addMarker(W);H.lines.push(x),x.onDispose((()=>this._removeMarkerFromLink(H,x)))}}getLinkData(U){var W;return(W=this._dataByLinkId.get(U))==null?void 0:W.data}_getEntryIdKey(U){return`${U.id};;${U.uri}`}_removeMarkerFromLink(U,W){const H=U.lines.indexOf(W);H!==-1&&(U.lines.splice(H,1),U.lines.length===0&&(U.data.id!==void 0&&this._entriesWithId.delete(U.key),this._dataByLinkId.delete(U.id)))}};a.OscLinkService=j=f([C(0,h.IBufferService)],j)},8343:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const l="di$target",f="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(C){return C[f]||[]},a.createDecorator=function(C){if(a.serviceRegistry.has(C))return a.serviceRegistry.get(C);const h=function(j,U,W){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(H,x,L){x[l]===x?x[f].push({id:H,index:L}):(x[f]=[{id:H,index:L}],x[l]=x)})(h,j,W)};return h.toString=()=>C,a.serviceRegistry.set(C,h),h}},2585:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const f=l(8343);var C;a.IBufferService=(0,f.createDecorator)("BufferService"),a.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),a.ICoreService=(0,f.createDecorator)("CoreService"),a.ICharsetService=(0,f.createDecorator)("CharsetService"),a.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(C||(a.LogLevelEnum=C={})),a.ILogService=(0,f.createDecorator)("LogService"),a.IOptionsService=(0,f.createDecorator)("OptionsService"),a.IOscLinkService=(0,f.createDecorator)("OscLinkService"),a.IUnicodeService=(0,f.createDecorator)("UnicodeService"),a.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const f=l(8460),C=l(225);class h{static extractShouldJoin(U){return(1&U)!=0}static extractWidth(U){return U>>1&3}static extractCharKind(U){return U>>3}static createPropertyValue(U,W,H=!1){return(16777215&U)<<3|(3&W)<<1|(H?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const U=new C.UnicodeV6;this.register(U),this._active=U.version,this._activeProvider=U}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(U){if(!this._providers[U])throw new Error(`unknown Unicode version "${U}"`);this._active=U,this._activeProvider=this._providers[U],this._onChange.fire(U)}register(U){this._providers[U.version]=U}wcwidth(U){return this._activeProvider.wcwidth(U)}getStringCellWidth(U){let W=0,H=0;const x=U.length;for(let L=0;L<x;++L){let R=U.charCodeAt(L);if(55296<=R&&R<=56319){if(++L>=x)return W+this.wcwidth(R);const J=U.charCodeAt(L);56320<=J&&J<=57343?R=1024*(R-55296)+J-56320+65536:W+=this.wcwidth(J)}const N=this.charProperties(R,H);let V=h.extractWidth(N);h.extractShouldJoin(N)&&(V-=h.extractWidth(H)),W+=V,H=N}return W}charProperties(U,W){return this._activeProvider.charProperties(U,W)}}a.UnicodeService=h}},s={};function o(d){var a=s[d];if(a!==void 0)return a.exports;var l=s[d]={exports:{}};return r[d].call(l.exports,l,l.exports,o),l.exports}var u={};return(()=>{var d=u;Object.defineProperty(d,"__esModule",{value:!0}),d.Terminal=void 0;const a=o(9042),l=o(3236),f=o(844),C=o(5741),h=o(8285),j=o(7975),U=o(7090),W=["cols","rows"];class H extends f.Disposable{constructor(L){super(),this._core=this.register(new l.Terminal(L)),this._addonManager=this.register(new C.AddonManager),this._publicOptions={...this._core.options};const R=V=>this._core.options[V],N=(V,J)=>{this._checkReadonlyOptions(V),this._core.options[V]=J};for(const V in this._core.options){const J={get:R.bind(this,V),set:N.bind(this,V)};Object.defineProperty(this._publicOptions,V,J)}}_checkReadonlyOptions(L){if(W.includes(L))throw new Error(`Option "${L}" 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 j.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new U.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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const L=this._core.coreService.decPrivateModes;let R="none";switch(this._core.coreMouseService.activeProtocol){case"X10":R="x10";break;case"VT200":R="vt200";break;case"DRAG":R="drag";break;case"ANY":R="any"}return{applicationCursorKeysMode:L.applicationCursorKeys,applicationKeypadMode:L.applicationKeypad,bracketedPasteMode:L.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:R,originMode:L.origin,reverseWraparoundMode:L.reverseWraparound,sendFocusMode:L.sendFocus,wraparoundMode:L.wraparound}}get options(){return this._publicOptions}set options(L){for(const R in L)this._publicOptions[R]=L[R]}blur(){this._core.blur()}focus(){this._core.focus()}input(L,R=!0){this._core.input(L,R)}resize(L,R){this._verifyIntegers(L,R),this._core.resize(L,R)}open(L){this._core.open(L)}attachCustomKeyEventHandler(L){this._core.attachCustomKeyEventHandler(L)}attachCustomWheelEventHandler(L){this._core.attachCustomWheelEventHandler(L)}registerLinkProvider(L){return this._core.registerLinkProvider(L)}registerCharacterJoiner(L){return this._checkProposedApi(),this._core.registerCharacterJoiner(L)}deregisterCharacterJoiner(L){this._checkProposedApi(),this._core.deregisterCharacterJoiner(L)}registerMarker(L=0){return this._verifyIntegers(L),this._core.registerMarker(L)}registerDecoration(L){return this._checkProposedApi(),this._verifyPositiveIntegers(L.x??0,L.width??0,L.height??0),this._core.registerDecoration(L)}hasSelection(){return this._core.hasSelection()}select(L,R,N){this._verifyIntegers(L,R,N),this._core.select(L,R,N)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(L,R){this._verifyIntegers(L,R),this._core.selectLines(L,R)}dispose(){super.dispose()}scrollLines(L){this._verifyIntegers(L),this._core.scrollLines(L)}scrollPages(L){this._verifyIntegers(L),this._core.scrollPages(L)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(L){this._verifyIntegers(L),this._core.scrollToLine(L)}clear(){this._core.clear()}write(L,R){this._core.write(L,R)}writeln(L,R){this._core.write(L),this._core.write(`\r
|
|
81
|
-
`,R)}paste(L){this._core.paste(L)}refresh(L,R){this._verifyIntegers(L,R),this._core.refresh(L,R)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(L){this._addonManager.loadAddon(this,L)}static get strings(){return a}_verifyIntegers(...L){for(const R of L)if(R===1/0||isNaN(R)||R%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...L){for(const R of L)if(R&&(R===1/0||isNaN(R)||R%1!=0||R<0))throw new Error("This API only accepts positive integers")}}d.Terminal=H})(),u})()))})(xterm)),xterm.exports}var xtermExports=requireXterm(),addonFit={exports:{}},hasRequiredAddonFit;function requireAddonFit(){return hasRequiredAddonFit||(hasRequiredAddonFit=1,(function(e,t){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={};return(()=>{var s=r;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const u=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(u._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,u=o._renderService.dimensions;if(u.css.cell.width===0||u.css.cell.height===0)return;const d=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(a.getPropertyValue("height")),f=Math.max(0,parseInt(a.getPropertyValue("width"))),C=window.getComputedStyle(this._terminal.element),h=l-(parseInt(C.getPropertyValue("padding-top"))+parseInt(C.getPropertyValue("padding-bottom"))),j=f-(parseInt(C.getPropertyValue("padding-right"))+parseInt(C.getPropertyValue("padding-left")))-d;return{cols:Math.max(2,Math.floor(j/u.css.cell.width)),rows:Math.max(1,Math.floor(h/u.css.cell.height))}}}})(),r})()))})(addonFit)),addonFit.exports}var addonFitExports=requireAddonFit(),addonWebLinks={exports:{}},hasRequiredAddonWebLinks;function requireAddonWebLinks(){return hasRequiredAddonWebLinks||(hasRequiredAddonWebLinks=1,(function(e,t){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={6:(d,a)=>{function l(C){try{const h=new URL(C),j=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return C.toLocaleLowerCase().startsWith(j.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(C,h,j,U={}){this._terminal=C,this._regex=h,this._handler=j,this._options=U}provideLinks(C,h){const j=f.computeLink(C,this._regex,this._terminal,this._handler);h(this._addCallbacks(j))}_addCallbacks(C){return C.map((h=>(h.leave=this._options.leave,h.hover=(j,U)=>{if(this._options.hover){const{range:W}=h;this._options.hover(j,U,W)}},h)))}};class f{static computeLink(h,j,U,W){const H=new RegExp(j.source,(j.flags||"")+"g"),[x,L]=f._getWindowedLineStrings(h-1,U),R=x.join("");let N;const V=[];for(;N=H.exec(R);){const J=N[0];if(!l(J))continue;const[Y,Z]=f._mapStrIdx(U,L,0,N.index),[K,ee]=f._mapStrIdx(U,Y,Z,J.length);if(Y===-1||Z===-1||K===-1||ee===-1)continue;const oe={start:{x:Z+1,y:Y+1},end:{x:ee,y:K+1}};V.push({range:oe,text:J,activate:W})}return V}static _getWindowedLineStrings(h,j){let U,W=h,H=h,x=0,L="";const R=[];if(U=j.buffer.active.getLine(h)){const N=U.translateToString(!0);if(U.isWrapped&&N[0]!==" "){for(x=0;(U=j.buffer.active.getLine(--W))&&x<2048&&(L=U.translateToString(!0),x+=L.length,R.push(L),U.isWrapped&&L.indexOf(" ")===-1););R.reverse()}for(R.push(N),x=0;(U=j.buffer.active.getLine(++H))&&U.isWrapped&&x<2048&&(L=U.translateToString(!0),x+=L.length,R.push(L),L.indexOf(" ")===-1););}return[R,W]}static _mapStrIdx(h,j,U,W){const H=h.buffer.active,x=H.getNullCell();let L=U;for(;W;){const R=H.getLine(j);if(!R)return[-1,-1];for(let N=L;N<R.length;++N){R.getCell(N,x);const V=x.getChars();if(x.getWidth()&&(W-=V.length||1,N===R.length-1&&V==="")){const J=H.getLine(j+1);J&&J.isWrapped&&(J.getCell(0,x),x.getWidth()===2&&(W+=1))}if(W<0)return[j,N]}j++,L=0}return[j,L]}}a.LinkComputer=f}},s={};function o(d){var a=s[d];if(a!==void 0)return a.exports;var l=s[d]={exports:{}};return r[d](l,l.exports,o),l.exports}var u={};return(()=>{var d=u;Object.defineProperty(d,"__esModule",{value:!0}),d.WebLinksAddon=void 0;const a=o(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(C,h){const j=window.open();if(j){try{j.opener=null}catch{}j.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}d.WebLinksAddon=class{constructor(C=f,h={}){this._handler=C,this._options=h}activate(C){this._terminal=C;const h=this._options,j=h.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,j,this._handler,h))}dispose(){var C;(C=this._linkProvider)==null||C.dispose()}}})(),u})()))})(addonWebLinks)),addonWebLinks.exports}var addonWebLinksExports=requireAddonWebLinks(),addonUnicode11$1={exports:{}},addonUnicode11=addonUnicode11$1.exports,hasRequiredAddonUnicode11;function requireAddonUnicode11(){return hasRequiredAddonUnicode11||(hasRequiredAddonUnicode11=1,(function(e,t){(function(r,s){e.exports=s()})(addonUnicode11,(()=>(()=>{var r={433:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV11=void 0;const f=l(938),C=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],h=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],j=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],U=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let W;function H(x,L){let R,N=0,V=L.length-1;if(x<L[0][0]||x>L[V][1])return!1;for(;V>=N;)if(R=N+V>>1,x>L[R][1])N=R+1;else{if(!(x<L[R][0]))return!0;V=R-1}return!1}a.UnicodeV11=class{constructor(){if(this.version="11",!W){W=new Uint8Array(65536),W.fill(1),W[0]=0,W.fill(0,1,32),W.fill(0,127,160);for(let x=0;x<C.length;++x)W.fill(0,C[x][0],C[x][1]+1);for(let x=0;x<j.length;++x)W.fill(2,j[x][0],j[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?W[x]:H(x,h)?0:H(x,U)?2:1}charProperties(x,L){let R=this.wcwidth(x),N=R===0&&L!==0;if(N){const V=f.UnicodeService.extractWidth(L);V===0?N=!1:V>R&&(R=V)}return f.UnicodeService.createPropertyValue(0,R,N)}}},345:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===l)return void this._listeners.splice(f,1)}}})),this._event}fire(l,f){const C=[];for(let h=0;h<this._listeners.length;h++)C.push(this._listeners[h]);for(let h=0;h<C.length;h++)C[h].call(void 0,l,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(l,f){return l((C=>f.fire(C)))},a.runAndSubscribe=function(l,f){return f(void 0),l((C=>f(C)))}},490:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const f=l(938),C=[[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]],h=[[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 j;a.UnicodeV6=class{constructor(){if(this.version="6",!j){j=new Uint8Array(65536),j.fill(1),j[0]=0,j.fill(0,1,32),j.fill(0,127,160),j.fill(2,4352,4448),j[9001]=2,j[9002]=2,j.fill(2,11904,42192),j[12351]=1,j.fill(2,44032,55204),j.fill(2,63744,64256),j.fill(2,65040,65050),j.fill(2,65072,65136),j.fill(2,65280,65377),j.fill(2,65504,65511);for(let U=0;U<C.length;++U)j.fill(0,C[U][0],C[U][1]+1)}}wcwidth(U){return U<32?0:U<127?1:U<65536?j[U]:(function(W,H){let x,L=0,R=H.length-1;if(W<H[0][0]||W>H[R][1])return!1;for(;R>=L;)if(x=L+R>>1,W>H[x][1])L=x+1;else{if(!(W<H[x][0]))return!0;R=x-1}return!1})(U,h)?0:U>=131072&&U<=196605||U>=196608&&U<=262141?2:1}charProperties(U,W){let H=this.wcwidth(U),x=H===0&&W!==0;if(x){const L=f.UnicodeService.extractWidth(W);L===0?x=!1:L>H&&(H=L)}return f.UnicodeService.createPropertyValue(0,H,x)}}},938:(d,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const f=l(345),C=l(490);class h{static extractShouldJoin(U){return(1&U)!=0}static extractWidth(U){return U>>1&3}static extractCharKind(U){return U>>3}static createPropertyValue(U,W,H=!1){return(16777215&U)<<3|(3&W)<<1|(H?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const U=new C.UnicodeV6;this.register(U),this._active=U.version,this._activeProvider=U}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(U){if(!this._providers[U])throw new Error(`unknown Unicode version "${U}"`);this._active=U,this._activeProvider=this._providers[U],this._onChange.fire(U)}register(U){this._providers[U.version]=U}wcwidth(U){return this._activeProvider.wcwidth(U)}getStringCellWidth(U){let W=0,H=0;const x=U.length;for(let L=0;L<x;++L){let R=U.charCodeAt(L);if(55296<=R&&R<=56319){if(++L>=x)return W+this.wcwidth(R);const J=U.charCodeAt(L);56320<=J&&J<=57343?R=1024*(R-55296)+J-56320+65536:W+=this.wcwidth(J)}const N=this.charProperties(R,H);let V=h.extractWidth(N);h.extractShouldJoin(N)&&(V-=h.extractWidth(H)),W+=V,H=N}return W}charProperties(U,W){return this._activeProvider.charProperties(U,W)}}a.UnicodeService=h}},s={};function o(d){var a=s[d];if(a!==void 0)return a.exports;var l=s[d]={exports:{}};return r[d](l,l.exports,o),l.exports}var u={};return(()=>{var d=u;Object.defineProperty(d,"__esModule",{value:!0}),d.Unicode11Addon=void 0;const a=o(433);d.Unicode11Addon=class{activate(l){l.unicode.register(new a.UnicodeV11)}dispose(){}}})(),u})()))})(addonUnicode11$1)),addonUnicode11$1.exports}var addonUnicode11Exports=requireAddonUnicode11();/**
|
|
82
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
83
|
-
* @license MIT
|
|
84
|
-
*
|
|
85
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
86
|
-
* @license MIT
|
|
87
|
-
*
|
|
88
|
-
* Originally forked from (with the author's permission):
|
|
89
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
90
|
-
* http://bellard.org/jslinux/
|
|
91
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
92
|
-
*/var m=0,p=0,g=0,b=0,I;(e=>{function t(o,u,d,a){return a!==void 0?`#${B(o)}${B(u)}${B(d)}${B(a)}`:`#${B(o)}${B(u)}${B(d)}`}e.toCss=t;function r(o,u,d,a=255){return(o<<24|u<<16|d<<8|a)>>>0}e.toRgba=r;function s(o,u,d,a){return{css:e.toCss(o,u,d,a),rgba:e.toRgba(o,u,d,a)}}e.toColor=s})(I||(I={}));var $;(e=>{function t(l,f){if(b=(f.rgba&255)/255,b===1)return{css:f.css,rgba:f.rgba};let C=f.rgba>>24&255,h=f.rgba>>16&255,j=f.rgba>>8&255,U=l.rgba>>24&255,W=l.rgba>>16&255,H=l.rgba>>8&255;m=U+Math.round((C-U)*b),p=W+Math.round((h-W)*b),g=H+Math.round((j-H)*b);let x=I.toCss(m,p,g),L=I.toRgba(m,p,g);return{css:x,rgba:L}}e.blend=t;function r(l){return(l.rgba&255)===255}e.isOpaque=r;function s(l,f,C){let h=y.ensureContrastRatio(l.rgba,f.rgba,C);if(h)return I.toColor(h>>24&255,h>>16&255,h>>8&255)}e.ensureContrastRatio=s;function o(l){let f=(l.rgba|255)>>>0;return[m,p,g]=y.toChannels(f),{css:I.toCss(m,p,g),rgba:f}}e.opaque=o;function u(l,f){return b=Math.round(f*255),[m,p,g]=y.toChannels(l.rgba),{css:I.toCss(m,p,g,b),rgba:I.toRgba(m,p,g,b)}}e.opacity=u;function d(l,f){return b=l.rgba&255,u(l,b*f/255)}e.multiplyOpacity=d;function a(l){return[l.rgba>>24&255,l.rgba>>16&255,l.rgba>>8&255]}e.toColorRGB=a})($||($={}));var _;(e=>{let t,r;try{let o=document.createElement("canvas");o.width=1,o.height=1;let u=o.getContext("2d",{willReadFrequently:!0});u&&(t=u,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function s(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return m=parseInt(o.slice(1,2).repeat(2),16),p=parseInt(o.slice(2,3).repeat(2),16),g=parseInt(o.slice(3,4).repeat(2),16),I.toColor(m,p,g);case 5:return m=parseInt(o.slice(1,2).repeat(2),16),p=parseInt(o.slice(2,3).repeat(2),16),g=parseInt(o.slice(3,4).repeat(2),16),b=parseInt(o.slice(4,5).repeat(2),16),I.toColor(m,p,g,b);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let u=o.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(u)return m=parseInt(u[1]),p=parseInt(u[2]),g=parseInt(u[3]),b=Math.round((u[5]===void 0?1:parseFloat(u[5]))*255),I.toColor(m,p,g,b);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=o,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[m,p,g,b]=t.getImageData(0,0,1,1).data,b!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:I.toRgba(m,p,g,b),css:o}}e.toColor=s})(_||(_={}));var v;(e=>{function t(s){return r(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function r(s,o,u){let d=s/255,a=o/255,l=u/255,f=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4),C=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4);return f*.2126+C*.7152+h*.0722}e.relativeLuminance2=r})(v||(v={}));var y;(e=>{function t(d,a){if(b=(a&255)/255,b===1)return a;let l=a>>24&255,f=a>>16&255,C=a>>8&255,h=d>>24&255,j=d>>16&255,U=d>>8&255;return m=h+Math.round((l-h)*b),p=j+Math.round((f-j)*b),g=U+Math.round((C-U)*b),I.toRgba(m,p,g)}e.blend=t;function r(d,a,l){let f=v.relativeLuminance(d>>8),C=v.relativeLuminance(a>>8);if(F(f,C)<l){if(C<f){let U=s(d,a,l),W=F(f,v.relativeLuminance(U>>8));if(W<l){let H=o(d,a,l),x=F(f,v.relativeLuminance(H>>8));return W>x?U:H}return U}let h=o(d,a,l),j=F(f,v.relativeLuminance(h>>8));if(j<l){let U=s(d,a,l),W=F(f,v.relativeLuminance(U>>8));return j>W?h:U}return h}}e.ensureContrastRatio=r;function s(d,a,l){let f=d>>24&255,C=d>>16&255,h=d>>8&255,j=a>>24&255,U=a>>16&255,W=a>>8&255,H=F(v.relativeLuminance2(j,U,W),v.relativeLuminance2(f,C,h));for(;H<l&&(j>0||U>0||W>0);)j-=Math.max(0,Math.ceil(j*.1)),U-=Math.max(0,Math.ceil(U*.1)),W-=Math.max(0,Math.ceil(W*.1)),H=F(v.relativeLuminance2(j,U,W),v.relativeLuminance2(f,C,h));return(j<<24|U<<16|W<<8|255)>>>0}e.reduceLuminance=s;function o(d,a,l){let f=d>>24&255,C=d>>16&255,h=d>>8&255,j=a>>24&255,U=a>>16&255,W=a>>8&255,H=F(v.relativeLuminance2(j,U,W),v.relativeLuminance2(f,C,h));for(;H<l&&(j<255||U<255||W<255);)j=Math.min(255,j+Math.ceil((255-j)*.1)),U=Math.min(255,U+Math.ceil((255-U)*.1)),W=Math.min(255,W+Math.ceil((255-W)*.1)),H=F(v.relativeLuminance2(j,U,W),v.relativeLuminance2(f,C,h));return(j<<24|U<<16|W<<8|255)>>>0}e.increaseLuminance=o;function u(d){return[d>>24&255,d>>16&255,d>>8&255,d&255]}e.toChannels=u})(y||(y={}));function B(e){let t=e.toString(16);return t.length<2?"0"+t:t}function F(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var E=Object.freeze((()=>{let e=[_.toColor("#2e3436"),_.toColor("#cc0000"),_.toColor("#4e9a06"),_.toColor("#c4a000"),_.toColor("#3465a4"),_.toColor("#75507b"),_.toColor("#06989a"),_.toColor("#d3d7cf"),_.toColor("#555753"),_.toColor("#ef2929"),_.toColor("#8ae234"),_.toColor("#fce94f"),_.toColor("#729fcf"),_.toColor("#ad7fa8"),_.toColor("#34e2e2"),_.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let s=t[r/36%6|0],o=t[r/6%6|0],u=t[r%6];e.push({css:I.toCss(s,o,u),rgba:I.toRgba(s,o,u)})}for(let r=0;r<24;r++){let s=8+r*10;e.push({css:I.toCss(s,s,s),rgba:I.toRgba(s,s,s)})}return e})());function A(e,t,r){return Math.max(t,Math.min(e,r))}function O(e){switch(e){case"&":return"&";case"<":return"<"}return e}var S=class{constructor(e){this._buffer=e}serialize(e,t){let r=this._buffer.getNullCell(),s=this._buffer.getNullCell(),o=r,u=e.start.y,d=e.end.y,a=e.start.x,l=e.end.x;this._beforeSerialize(d-u,u,d);for(let f=u;f<=d;f++){let C=this._buffer.getLine(f);if(C){let h=f===e.start.y?a:0,j=f===e.end.y?l:C.length;for(let U=h;U<j;U++){let W=C.getCell(U,o===r?s:r);if(!W){console.warn(`Can't get cell at row=${f}, col=${U}`);continue}this._nextCell(W,o,f,U),o=W}}this._rowEnd(f,f===d)}return this._afterSerialize(),this._serializeString(t)}_nextCell(e,t,r,s){}_rowEnd(e,t){}_beforeSerialize(e,t,r){}_afterSerialize(){}_serializeString(e){return""}};function T(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function w(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function z(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isOverline()===t.isOverline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()&&e.isStrikethrough()===t.isStrikethrough()}var k=class extends S{constructor(e,t){super(e),this._terminal=t,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(e,t,r){this._allRows=new Array(e),this._lastContentCursorRow=t,this._lastCursorRow=t,this._firstRow=t}_rowEnd(e,t){var s;this._nullCellCount>0&&!w(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let r="";if(!t){e-this._firstRow>=this._terminal.rows&&((s=this._buffer.getLine(this._cursorStyleRow))==null||s.getCell(this._cursorStyleCol,this._backgroundCell));let o=this._buffer.getLine(e),u=this._buffer.getLine(e+1);if(!u.isWrapped)r=`\r
|
|
93
|
-
`,this._lastCursorRow=e+1,this._lastCursorCol=0;else{r="";let d=o.getCell(o.length-1,this._thisRowLastChar),a=o.getCell(o.length-2,this._thisRowLastSecondChar),l=u.getCell(0,this._nextRowFirstChar),f=l.getWidth()>1,C=!1;(l.getChars()&&f?this._nullCellCount<=1:this._nullCellCount<=0)&&((d.getChars()||d.getWidth()===0)&&w(d,l)&&(C=!0),f&&(a.getChars()||a.getWidth()===0)&&w(d,l)&&w(a,l)&&(C=!0)),C||(r="-".repeat(this._nullCellCount+1),r+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(r+="\x1B[A",r+=`\x1B[${o.length-this._nullCellCount}C`,r+=`\x1B[${this._nullCellCount}X`,r+=`\x1B[${o.length-this._nullCellCount}D`,r+="\x1B[B"),this._lastContentCursorRow=e+1,this._lastContentCursorCol=0,this._lastCursorRow=e+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=r,this._currentRow="",this._nullCellCount=0}_diffStyle(e,t){let r=[],s=!T(e,t),o=!w(e,t),u=!z(e,t);if(s||o||u)if(e.isAttributeDefault())t.isAttributeDefault()||r.push(0);else{if(s){let d=e.getFgColor();e.isFgRGB()?r.push(38,2,d>>>16&255,d>>>8&255,d&255):e.isFgPalette()?d>=16?r.push(38,5,d):r.push(d&8?90+(d&7):30+(d&7)):r.push(39)}if(o){let d=e.getBgColor();e.isBgRGB()?r.push(48,2,d>>>16&255,d>>>8&255,d&255):e.isBgPalette()?d>=16?r.push(48,5,d):r.push(d&8?100+(d&7):40+(d&7)):r.push(49)}u&&(e.isInverse()!==t.isInverse()&&r.push(e.isInverse()?7:27),e.isBold()!==t.isBold()&&r.push(e.isBold()?1:22),e.isUnderline()!==t.isUnderline()&&r.push(e.isUnderline()?4:24),e.isOverline()!==t.isOverline()&&r.push(e.isOverline()?53:55),e.isBlink()!==t.isBlink()&&r.push(e.isBlink()?5:25),e.isInvisible()!==t.isInvisible()&&r.push(e.isInvisible()?8:28),e.isItalic()!==t.isItalic()&&r.push(e.isItalic()?3:23),e.isDim()!==t.isDim()&&r.push(e.isDim()?2:22),e.isStrikethrough()!==t.isStrikethrough()&&r.push(e.isStrikethrough()?9:29))}return r}_nextCell(e,t,r,s){if(e.getWidth()===0)return;let o=e.getChars()==="",u=this._diffStyle(e,this._cursorStyle);if(o?!w(this._cursorStyle,e):u.length>0){this._nullCellCount>0&&(w(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=s,this._currentRow+=`\x1B[${u.join(";")}m`;let d=this._buffer.getLine(r);d!==void 0&&(d.getCell(s,this._cursorStyle),this._cursorStyleRow=r,this._cursorStyleCol=s)}o?this._nullCellCount+=e.getWidth():(this._nullCellCount>0&&(w(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=e.getChars(),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=s+e.getWidth())}_serializeString(e){let t=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(t=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let r="";for(let u=0;u<t;u++)r+=this._allRows[u],u+1<t&&(r+=this._allRowSeparators[u]);if(!e){let u=this._buffer.baseY+this._buffer.cursorY,d=this._buffer.cursorX,a=u!==this._lastCursorRow||d!==this._lastCursorCol,l=f=>{f>0?r+=`\x1B[${f}C`:f<0&&(r+=`\x1B[${-f}D`)};a&&((f=>{f>0?r+=`\x1B[${f}B`:f<0&&(r+=`\x1B[${-f}A`)})(u-this._lastCursorRow),l(d-this._lastCursorCol))}let s=this._terminal._core._inputHandler._curAttrData,o=this._diffStyle(s,this._cursorStyle);return o.length>0&&(r+=`\x1B[${o.join(";")}m`),r}},D=class{activate(e){this._terminal=e}_serializeBufferByScrollback(e,t,r){let s=t.length,o=r===void 0?s:A(r+e.rows,0,s);return this._serializeBufferByRange(e,t,{start:s-o,end:s-1},!1)}_serializeBufferByRange(e,t,r,s){return new k(t,e).serialize({start:{x:0,y:typeof r.start=="number"?r.start:r.start.line},end:{x:e.cols,y:typeof r.end=="number"?r.end:r.end.line}},s)}_serializeBufferAsHTML(e,t){var a;let r=e.buffer.active,s=new M(r,e,t),o=t.onlySelection??!1,u=t.range;if(u)return s.serialize({start:{x:u.startCol,y:(u.startLine,u.startLine)},end:{x:e.cols,y:(u.endLine,u.endLine)}});if(!o){let l=r.length,f=t.scrollback,C=f===void 0?l:A(f+e.rows,0,l);return s.serialize({start:{x:0,y:l-C},end:{x:e.cols,y:l-1}})}let d=(a=this._terminal)==null?void 0:a.getSelectionPosition();return d!==void 0?s.serialize({start:{x:d.start.x,y:d.start.y},end:{x:d.end.x,y:d.end.y}}):""}_serializeModes(e){let t="",r=e.modes;if(r.applicationCursorKeysMode&&(t+="\x1B[?1h"),r.applicationKeypadMode&&(t+="\x1B[?66h"),r.bracketedPasteMode&&(t+="\x1B[?2004h"),r.insertMode&&(t+="\x1B[4h"),r.originMode&&(t+="\x1B[?6h"),r.reverseWraparoundMode&&(t+="\x1B[?45h"),r.sendFocusMode&&(t+="\x1B[?1004h"),r.wraparoundMode===!1&&(t+="\x1B[?7l"),r.mouseTrackingMode!=="none")switch(r.mouseTrackingMode){case"x10":t+="\x1B[?9h";break;case"vt200":t+="\x1B[?1000h";break;case"drag":t+="\x1B[?1002h";break;case"any":t+="\x1B[?1003h";break}return t}serialize(e){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let t=e!=null&&e.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,e.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,e==null?void 0:e.scrollback);if(!(e!=null&&e.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let r=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);t+=`\x1B[?1049h\x1B[H${r}`}return e!=null&&e.excludeModes||(t+=this._serializeModes(this._terminal)),t}serializeAsHTML(e){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,e||{})}dispose(){}},M=class extends S{constructor(e,t,r){super(e),this._terminal=t,this._options=r,this._currentRow="",this._htmlContent="",t._core._themeService?this._ansiColors=t._core._themeService.colors.ansi:this._ansiColors=E}_padStart(e,t,r){return t=t>>0,r=r??" ",e.length>t?e:(t-=e.length,t>r.length&&(r+=r.repeat(t/r.length)),r.slice(0,t)+e)}_beforeSerialize(e,t,r){var d,a;this._htmlContent+="<html><body><!--StartFragment--><pre>";let s="#000000",o="#ffffff";(this._options.includeGlobalBackground??!1)&&(s=((d=this._terminal.options.theme)==null?void 0:d.foreground)??"#ffffff",o=((a=this._terminal.options.theme)==null?void 0:a.background)??"#000000");let u=[];u.push("color: "+s+";"),u.push("background-color: "+o+";"),u.push("font-family: "+this._terminal.options.fontFamily+";"),u.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+u.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(e,t){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(e,t){let r=t?e.getFgColor():e.getBgColor();if(t?e.isFgRGB():e.isBgRGB())return"#"+[r>>16&255,r>>8&255,r&255].map(s=>this._padStart(s.toString(16),2,"0")).join("");if(t?e.isFgPalette():e.isBgPalette())return this._ansiColors[r].css}_diffStyle(e,t){let r=[],s=!T(e,t),o=!w(e,t),u=!z(e,t);if(s||o||u){let d=this._getHexColor(e,!0);d&&r.push("color: "+d+";");let a=this._getHexColor(e,!1);return a&&r.push("background-color: "+a+";"),e.isInverse()&&r.push("color: #000000; background-color: #BFBFBF;"),e.isBold()&&r.push("font-weight: bold;"),e.isUnderline()&&e.isOverline()?r.push("text-decoration: overline underline;"):e.isUnderline()?r.push("text-decoration: underline;"):e.isOverline()&&r.push("text-decoration: overline;"),e.isBlink()&&r.push("text-decoration: blink;"),e.isInvisible()&&r.push("visibility: hidden;"),e.isItalic()&&r.push("font-style: italic;"),e.isDim()&&r.push("opacity: 0.5;"),e.isStrikethrough()&&r.push("text-decoration: line-through;"),r}}_nextCell(e,t,r,s){if(e.getWidth()===0)return;let o=e.getChars()==="",u=this._diffStyle(e,t);u&&(this._currentRow+=u.length===0?"</span><span>":"</span><span style='"+u.join(" ")+"'>"),o?this._currentRow+=" ":this._currentRow+=O(e.getChars())}_serializeString(){return this._htmlContent}},us,CommandParser=(us=class{static splitByOperators(t){const r=[];let s="",o=!1,u=!1;for(let a=0;a<t.length;a++){const l=t[a];if(l==="'"&&!u){o=!o,s+=l;continue}if(l==='"'&&!o){u=!u,s+=l;continue}if(o||u){s+=l;continue}const f=t.slice(a,a+2);if(f===">>"&&s.endsWith("2")){const C=s.slice(0,-1).trim();C&&r.push({type:"command",value:C}),s="",r.push({type:"2>>",value:"2>>"}),a++;continue}if(f==="&&"||f==="||"||f===">>"){const C=s.trim();C&&r.push({type:"command",value:C}),s="",r.push({type:f,value:f}),a++;continue}if(l===">"&&s.endsWith("2")){const C=s.slice(0,-1).trim();C&&r.push({type:"command",value:C}),s="",r.push({type:"2>",value:"2>"});continue}if(l==="|"){const C=s.trim();C&&r.push({type:"command",value:C}),s="",r.push({type:"|",value:"|"});continue}if(l===">"){const C=s.trim();C&&r.push({type:"command",value:C}),s="",r.push({type:">",value:">"});continue}if(l===";"){const C=s.trim();C&&r.push({type:"command",value:C}),s="",r.push({type:";",value:";"});continue}s+=l}const d=s.trim();return d&&r.push({type:"command",value:d}),r}parse(t){const r=/(?:--?([a-zA-Z0-9-_]+)(?:=("[^"]*"|'[^']*'|[^\s]+))?)|(?:[^\s]+)/g,s=Array.from(t.matchAll(r));if(s.length===0)return{commandName:"",args:[],tokens:[]};const o=[],u=[],d=[];for(const a of s)if(a[1]){const l=a[1],f=a[2]!==void 0;let C=a[2];C?C=C.replace(/^['"]|['"]$/g,""):f||(C=!0);const h=this.parseValue(C);u.push({name:l,value:h}),d.push({kind:"flag",name:l,value:h,hasEquals:f})}else a[0].startsWith("-")||(o.push(a[0]),d.push({kind:"word",value:a[0]}));return{commandName:o.join(" "),args:u,tokens:d}}parseValue(t){return typeof t!="string"?t:t.length>0&&!isNaN(Number(t))?Number(t):t==="true"||t==="false"?t==="true":t}},us.OPERATORS=["&&","||","2>>","2>",">>",">","|",";"],us),CliArgsParser=class{static convertToRecord(e,t){const r={},s=(o,u)=>{var d;r[o.name]=u,(d=o.aliases)==null||d.forEach(a=>{r[a]=u})};return e.forEach(o=>{var d;const u=(d=t.parameters)==null?void 0:d.find(a=>{var l;return a.name===o.name||((l=a.aliases)==null?void 0:l.some(f=>f===o.name))});if(u){let a=o.value;switch(u.type){case"array":{a=[...Array.isArray(r[u.name])?r[u.name]:[],o.value];break}case"boolean":a=a===!0||a==="true"||a==="1"||a==="yes"||a==="y"||a===1;break;default:a=o.value;break}s(u,a)}else r[o.name]=o.value}),r}};function reconcileArgs(e,t){const r=[],s=[];for(let o=0;o<e.length;o++){const u=e[o];if(u.kind==="word"){s.push(u.value);continue}const d=findDescriptor(u.name,t);if(d&&d.type!=="boolean"&&!u.hasEquals&&o+1<e.length&&e[o+1].kind==="word"){const a=e[o+1];r.push({name:u.name,value:parseValue(a.value)}),o++}else r.push({name:u.name,value:u.value})}return{args:r,commandParts:s}}function findDescriptor(e,t){if(t)return t.find(r=>{var s;return r.name===e||((s=r.aliases)==null?void 0:s.some(o=>o===e))})}function parseValue(e){return e.length>0&&!isNaN(Number(e))?Number(e):e==="true"||e==="false"?e==="true":e}var groupBy=(e,t)=>e.reduce((r,s)=>{const o=t(s);return r.has(o)||r.set(o,[]),r.get(o).push(s),r},new Map),getGreetingBasedOnTime=e=>{const t=new Date().getHours();return t>=5&&t<12?"☀️ Good morning! Wishing you a productive day ahead!":t>=12&&t<18?"🌤️ Good afternoon! Keep up the great work!":t>=18&&t<22?"🌆 Good evening! Hope you had a fantastic day!":"🌙 Good night! Rest well and see you tomorrow!"},openLink=e=>{try{window.open(e,"_blank")}catch(t){console.error(t)}},ProcessExitedError=class extends Error{constructor(e){super(`Process exited with code ${e}`),this.name="ProcessExitedError",this.code=e,Object.setPrototypeOf(this,new.target.prototype)}},CliCommandProcessorRegistry=class{constructor(e){this.processors=[],e&&this.processors.push(...e)}registerProcessor(e){var r,s;const t=this.getProcessorByName(e.command);if(t){if(t===e)return;const o=this.processors.findIndex(u=>u.command===e.command);if(e.extendsProcessor){if((r=e.processors)!=null&&r.length){t.processors||(t.processors=[]);for(const u of e.processors)t.processors.find(a=>a.command===u.command)||t.processors.push(u)}return}if((s=t.metadata)!=null&&s.sealed){console.warn(`Processor with command: ${e.command} is sealed and cannot be replaced.`);return}this.processors[o]=e}else this.processors.push(e)}unregisterProcessor(e){var s;const t=this.getProcessorByName(e.command);if(t&&(s=t.metadata)!=null&&s.sealed&&!t.originalProcessor){console.warn(`Processor with command: ${e.command} is sealed and cannot be removed.`);return}const r=this.processors.findIndex(o=>o.command===e.command);if(r!==-1){const o=this.processors[r];o.originalProcessor?this.processors[r]=o.originalProcessor:this.processors.splice(r,1)}}findProcessor(e,t){return this.findProcessorInCollection(e,t,this.processors)}findProcessorInCollection(e,t,r){const s=e.toLowerCase(),o=r.find(u=>{var d;return u.command.toLowerCase()===s||((d=u.aliases)==null?void 0:d.some(a=>a.toLowerCase()===s))});if(o){if(t.length===0)return o;if(o.processors&&o.processors.length>0)return this.findProcessorInCollection(t[0],t.slice(1),o.processors);if(o.acceptsRawInput||o.valueRequired)return o}}getRootProcessor(e){return e.parent?this.getRootProcessor(e.parent):e}getProcessorByName(e){return this.processors.find(t=>t.command.toLowerCase()===e.toLowerCase())}},CliProcessorsRegistry_TOKEN="cli-processors-registry",CliStateStoreManager_TOKEN="cli-state-store-manager",CliCommandHistory_TOKEN="cli-command-history",ICliPingServerService_TOKEN="cli-ping-server-service",CliModuleRegistry_TOKEN="cli-module-registry",CliBackgroundServiceRegistry_TOKEN="cli-background-service-registry",CliPackageManagerService_TOKEN="cli-package-manager-service",CliKeyValueStore_TOKEN="cli-key-value-store",SyntaxHighlighterRegistry_TOKEN="syntax-highlighter-registry",LIBRARY_VERSION="2.0.0-beta.14",API_VERSION=2,ANONYMOUS="\0anonymous";function aliasOwner(e){var r;let t;try{t=e.services.get(ICliAuthorizationService_TOKEN)}catch{t=void 0}if(t)return((r=t.getPrincipal())==null?void 0:r.name)??ANONYMOUS}function aliasesFor(e,t){var r;return t===void 0?(e==null?void 0:e.aliases)??{}:((r=e==null?void 0:e.aliasesByUser)==null?void 0:r[t])??{}}function withAliases(e,t,r){return t===void 0?{aliases:r}:{aliasesByUser:{...(e==null?void 0:e.aliasesByUser)??{},[t]:r}}}var CliAliasCommandProcessor=class{constructor(){this.command="alias",this.author=DefaultLibraryAuthor,this.description="Manage aliases for commands",this.metadata={icon:"🔥",module:"misc",sealed:!0},this.stateConfiguration={initialState:{aliases:{}},storeName:"aliases"},this.userAliases={},this.aliasState={},this.processors=[{command:"ls",description:"List all aliases",processCommand:async(e,t)=>{const{writer:r}=t,s=this.aliasesFor(t);r.writeln("Aliases:"),Object.entries(s).forEach(([o,u])=>{r.writeInfo(` ${o} -> ${u}`)}),Object.keys(s).length===0&&r.writeInfo(" No aliases defined")}}]}aliasesFor(e){return aliasesFor(this.aliasState,aliasOwner(e))}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.alias.long_description","Create shortcut aliases for frequently used commands")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("alias --<name>=<command>",CliForegroundColor.Cyan)} ${r.t("cli.alias.create_new","Create a new alias")}`),t.writeln(` ${t.wrapInColor("alias ls",CliForegroundColor.Cyan)} ${r.t("cli.alias.list_all","List all aliases")}`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` alias --h=help ${t.wrapInColor('# "h" → runs "help"',CliForegroundColor.Green)}`),t.writeln(` alias --cls=clear ${t.wrapInColor('# "cls" → runs "clear"',CliForegroundColor.Green)}`),t.writeln(),t.writeln(`💡 ${r.t("cli.alias.remove_hint","Use {command} to remove an alias",{command:"unalias <name>"})}`)}async processCommand(e,t){const r=t.services.getRequired(CliProcessorsRegistry_TOKEN),{writer:s}=t,o=Object.keys(e.args);if(o.length===0){s.writeError("No aliases provided"),t.process.exit(-1);return}for(const d of o){if(r.processors.some(a=>a.command===d)){s.writeError(`${d} cannot be aliased to ${e.args[d]}`),t.process.exit(-1);return}t.writer.writeInfo(`${d} -> ${e.args[d]}`)}const u=aliasOwner(t);t.state.updateState(withAliases(this.aliasState,u,{...aliasesFor(this.aliasState,u),...e.args})),await t.state.persist()}async initialize(e){var t;(t=this.stateSubscription)==null||t.unsubscribe(),this.stateSubscription=e.state.select(r=>r).subscribe(r=>{this.aliasState=r??{},this.userAliases=this.aliasState.aliases??{}})}},CliCaptureCommandProcessor=class{constructor(){this.command="capture",this.description="Export terminal output to a downloadable file",this.aliases=["export-output"],this.author=DefaultLibraryAuthor,this.metadata={icon:CliIcon.Save,module:"system"},this.parameters=[{name:"format",description:"Output format: html (default) or txt",required:!1,type:"string"},{name:"filename",description:"Output filename (without extension)",required:!1,type:"string"},{name:"lines",description:"Number of recent lines to capture (default: all)",required:!1,type:"number"}]}async processCommand(e,t){var C,h,j,U,W,H;const r=((C=e.args)==null?void 0:C.format)??"html",s=((h=e.args)==null?void 0:h.filename)??`terminal-${Date.now()}`,o=(j=e.args)==null?void 0:j.lines;if(r!=="html"&&r!=="txt"){t.writer.writeError('Format must be "html" or "txt"'),t.process.exit(-1);return}const u=t.terminal,d=(U=u==null?void 0:u.buffer)==null?void 0:U.active;if(!d){t.writer.writeError("Terminal buffer is not available"),t.process.exit(-1);return}const a=d.length,l=o?Math.max(0,a-o):0,f=[];for(let x=l;x<a;x++){const L=d.getLine(x);L&&f.push(L.translateToString(!0))}if(r==="txt"){const x=f.join(`
|
|
94
|
-
`);this.download(`${s}.txt`,x,"text/plain"),t.writer.writeSuccess(`Downloaded ${s}.txt (${f.length} lines)`)}else{const x=(H=(W=t.terminal)==null?void 0:W.options)==null?void 0:H.theme,L=this.toHtml(f,x);this.download(`${s}.html`,L,"text/html"),t.writer.writeSuccess(`Downloaded ${s}.html (${f.length} lines)`)}}sanitizeCssColor(e,t){return e&&/^[a-zA-Z0-9#(),. %]+$/.test(e)?e:t}toHtml(e,t){const r=this.sanitizeCssColor(t==null?void 0:t.background,"#0c0c0c"),s=this.sanitizeCssColor(t==null?void 0:t.foreground,"#cccccc"),o=e.map(u=>this.escapeHtml(u)).join(`
|
|
95
|
-
`);return`<!DOCTYPE html>
|
|
96
|
-
<html>
|
|
97
|
-
<head>
|
|
98
|
-
<meta charset="utf-8">
|
|
99
|
-
<title>Terminal Output</title>
|
|
100
|
-
<style>
|
|
101
|
-
body { background: ${r}; color: ${s}; font-family: 'Courier New', monospace; font-size: 14px; padding: 16px; white-space: pre-wrap; word-break: break-all; }
|
|
102
|
-
</style>
|
|
103
|
-
</head>
|
|
104
|
-
<body>${o}</body>
|
|
105
|
-
</html>`}escapeHtml(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}download(e,t,r){const s=new Blob([t],{type:r}),o=URL.createObjectURL(s),u=document.createElement("a");u.href=o,u.download=e,u.click(),setTimeout(()=>URL.revokeObjectURL(o),1e3)}},CliCalCommandProcessor=class{constructor(){this.command="cal",this.aliases=["calendar"],this.description="Display a calendar",this.author=DefaultLibraryAuthor,this.metadata={icon:"📅",module:"misc"},this.parameters=[{name:"month",aliases:["m"],description:"Month (1-12)",type:"number",required:!1},{name:"year",aliases:["y"],description:"Year (e.g. 2024)",type:"number",required:!1}]}async processCommand(e,t){const{writer:r}=t,s=new Date,o=parseInt(e.args.month||e.args.m)||s.getMonth()+1,u=parseInt(e.args.year||e.args.y)||s.getFullYear();if(o<1||o>12){r.writeError("Month must be between 1 and 12"),t.process.exit(-1);return}const a=`${["January","February","March","April","May","June","July","August","September","October","November","December"][o-1]} ${u}`,l=Math.max(0,Math.floor((20-a.length)/2));r.writeln(r.wrapInColor(" ".repeat(l)+a,CliForegroundColor.Yellow)),r.writeln(r.wrapInColor("Su Mo Tu We Th Fr Sa",CliForegroundColor.Cyan));const f=new Date(u,o-1,1).getDay(),C=new Date(u,o,0).getDate(),h=s.getDate(),j=s.getMonth()+1===o&&s.getFullYear()===u;let U=" ".repeat(f);for(let W=1;W<=C;W++){const H=String(W).padStart(2);j&&W===h?U+=`\x1B[7m${H}\x1B[0m `:U+=H+" ",((f+W)%7===0||W===C)&&(r.writeln(U),U="")}}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.cal.long_description","Display a monthly calendar")),t.writeln(r.t("cli.cal.highlight_note","Current day is highlighted")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("cal",CliForegroundColor.Cyan)} ${r.t("cli.cal.current_month","Current month")}`),t.writeln(` ${t.wrapInColor("cal --month=3 --year=2024",CliForegroundColor.Cyan)} ${r.t("cli.cal.specific_month","Specific month")}`)}},CliClearCommandProcessor=class{constructor(){this.command="clear",this.aliases=["cls"],this.description="Clears the terminal",this.author=DefaultLibraryAuthor,this.metadata={icon:"🧹",module:"misc"}}async processCommand(e,t){t.terminal.clear()}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.clear.long_description","Clears all content from the terminal screen")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("clear",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(`⌨️ ${r.t("cli.clear.shortcut","Shortcut:")} ${t.wrapInColor("Ctrl+L",CliForegroundColor.Yellow)}`)}},CliClipboardCommandProcessor=class{constructor(){this.command="clipboard",this.aliases=["cb","pbcopy"],this.description="Copy to or paste from the clipboard",this.author=DefaultLibraryAuthor,this.processors=[],this.metadata={icon:"📎",module:"misc"},this.processors=[{command:"copy",aliases:["cp"],description:"Copy text to clipboard",acceptsRawInput:!0,valueRequired:!0,processCommand:async(e,t)=>{const r=e.value||e.data||"";try{await navigator.clipboard.writeText(r),t.writer.writeSuccess("Copied to clipboard")}catch{t.writer.writeError("Failed to copy. Clipboard access may be denied by the browser."),t.process.exit(-1)}},writeDescription:e=>{const{writer:t}=e;t.writeln("Copy text to the system clipboard"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("clipboard copy <text>",CliForegroundColor.Cyan)}`)}},{command:"paste",aliases:["p"],description:"Paste text from clipboard",processCommand:async(e,t)=>{try{const r=await navigator.clipboard.readText();r?(t.writer.writeln(r),t.process.output(r)):t.writer.writeInfo("Clipboard is empty")}catch{t.writer.writeError("Failed to paste. Clipboard access may be denied by the browser."),t.process.exit(-1)}},writeDescription:e=>{const{writer:t}=e;t.writeln("Read text from the system clipboard"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("clipboard paste",CliForegroundColor.Cyan)}`)}}]}async processCommand(e,t){t.executor.showHelp(e,t)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.clipboard.long_description","Copy text to or paste text from the system clipboard")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("clipboard copy <text>",CliForegroundColor.Cyan)} ${r.t("cli.clipboard.copy_desc","Copy text to clipboard")}`),t.writeln(` ${t.wrapInColor("clipboard paste",CliForegroundColor.Cyan)} ${r.t("cli.clipboard.paste_desc","Paste from clipboard")}`)}},CliColorCommandProcessor=class{constructor(){this.command="color",this.aliases=["colour"],this.description="Convert and preview colors (hex, rgb, hsl)",this.author=DefaultLibraryAuthor,this.acceptsRawInput=!0,this.valueRequired=!0,this.metadata={icon:"🎨",module:"misc"}}async processCommand(e,t){const{writer:r}=t,s=(e.value||"").trim();let o,u,d;try{if(s.startsWith("#"))[o,u,d]=this.parseHex(s);else if(s.startsWith("rgb"))[o,u,d]=this.parseRgb(s);else if(s.startsWith("hsl"))[o,u,d]=this.hslToRgb(...this.parseHsl(s));else if(/^[0-9a-fA-F]{3,8}$/.test(s))[o,u,d]=this.parseHex("#"+s);else{r.writeError("Unrecognized color format. Use hex (#ff0000), rgb(255,0,0), or hsl(0,100%,50%)"),t.process.exit(-1);return}}catch{r.writeError("Invalid color value"),t.process.exit(-1);return}const a=this.rgbToHex(o,u,d),[l,f,C]=this.rgbToHsl(o,u,d),h=`\x1B[48;2;${o};${u};${d}m \x1B[0m`;r.writeln(`${h}`),r.writeln(` ${r.wrapInColor("HEX:",CliForegroundColor.Cyan)} ${a}`),r.writeln(` ${r.wrapInColor("RGB:",CliForegroundColor.Cyan)} rgb(${o}, ${u}, ${d})`),r.writeln(` ${r.wrapInColor("HSL:",CliForegroundColor.Cyan)} hsl(${l}, ${f}%, ${C}%)`),t.process.output({hex:a,rgb:{r:o,g:u,b:d},hsl:{h:l,s:f,l:C}})}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.color.long_description","Convert between color formats and preview colors")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("color <value>",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(`📝 ${r.t("cli.color.supported_formats","Supported formats:")}`),t.writeln(` color #ff6600 ${t.wrapInColor("# Hex",CliForegroundColor.Green)}`),t.writeln(` color ff6600 ${t.wrapInColor("# Hex without #",CliForegroundColor.Green)}`),t.writeln(` color rgb(255,102,0) ${t.wrapInColor("# RGB",CliForegroundColor.Green)}`),t.writeln(` color hsl(24,100%,50%) ${t.wrapInColor("# HSL",CliForegroundColor.Green)}`)}parseHex(e){return e=e.replace("#",""),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}parseRgb(e){const t=e.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(!t)throw new Error("Invalid RGB");return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}parseHsl(e){const t=e.match(/(\d+)\s*,\s*(\d+)%?\s*,\s*(\d+)%?/);if(!t)throw new Error("Invalid HSL");return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}rgbToHex(e,t,r){return"#"+[e,t,r].map(s=>s.toString(16).padStart(2,"0")).join("")}rgbToHsl(e,t,r){e/=255,t/=255,r/=255;const s=Math.max(e,t,r),o=Math.min(e,t,r);let u=0,d=0;const a=(s+o)/2;if(s!==o){const l=s-o;switch(d=a>.5?l/(2-s-o):l/(s+o),s){case e:u=((t-r)/l+(t<r?6:0))/6;break;case t:u=((r-e)/l+2)/6;break;case r:u=((e-t)/l+4)/6;break}}return[Math.round(u*360),Math.round(d*100),Math.round(a*100)]}hslToRgb(e,t,r){e/=360,t/=100,r/=100;let s,o,u;if(t===0)s=o=u=r;else{const d=(f,C,h)=>(h<0&&(h+=1),h>1&&(h-=1),h<.16666666666666666?f+(C-f)*6*h:h<.5?C:h<.6666666666666666?f+(C-f)*(.6666666666666666-h)*6:f),a=r<.5?r*(1+t):r+t-r*t,l=2*r-a;s=d(l,a,e+1/3),o=d(l,a,e),u=d(l,a,e-1/3)}return[Math.round(s*255),Math.round(o*255),Math.round(u*255)]}},lengthUnits={m:{m:1,km:.001,cm:100,mm:1e3,mi:621371e-9,ft:3.28084,in:39.3701,yd:1.09361},km:{m:1e3,km:1,cm:1e5,mm:1e6,mi:.621371,ft:3280.84,in:39370.1,yd:1093.61},cm:{m:.01,km:1e-5,cm:1,mm:10,mi:621371e-11,ft:.0328084,in:.393701,yd:.0109361},mm:{m:.001,km:1e-6,cm:.1,mm:1,mi:62137e-11,ft:.00328084,in:.0393701,yd:.00109361},mi:{m:1609.34,km:1.60934,cm:160934,mm:1609340,mi:1,ft:5280,in:63360,yd:1760},ft:{m:.3048,km:3048e-7,cm:30.48,mm:304.8,mi:189394e-9,ft:1,in:12,yd:.333333},in:{m:.0254,km:254e-7,cm:2.54,mm:25.4,mi:157828e-10,ft:.0833333,in:1,yd:.0277778},yd:{m:.9144,km:9144e-7,cm:91.44,mm:914.4,mi:568182e-9,ft:3,in:36,yd:1}},weightUnits={kg:{kg:1,g:1e3,mg:1e6,lb:2.20462,oz:35.274,t:.001},g:{kg:.001,g:1,mg:1e3,lb:.00220462,oz:.035274,t:1e-6},mg:{kg:1e-6,g:.001,mg:1,lb:220462e-11,oz:35274e-9,t:1e-9},lb:{kg:.453592,g:453.592,mg:453592,lb:1,oz:16,t:453592e-9},oz:{kg:.0283495,g:28.3495,mg:28349.5,lb:.0625,oz:1,t:283495e-10},t:{kg:1e3,g:1e6,mg:1e9,lb:2204.62,oz:35274,t:1}},dataUnits={b:{b:1,kb:1/1024,mb:1/1024**2,gb:1/1024**3,tb:1/1024**4},kb:{b:1024,kb:1,mb:1/1024,gb:1/1024**2,tb:1/1024**3},mb:{b:1024**2,kb:1024,mb:1,gb:1/1024,tb:1/1024**2},gb:{b:1024**3,kb:1024**2,mb:1024,gb:1,tb:1/1024},tb:{b:1024**4,kb:1024**3,mb:1024**2,gb:1024,tb:1}},categories=[{name:"length",units:lengthUnits,unitNames:{m:"meters",km:"kilometers",cm:"centimeters",mm:"millimeters",mi:"miles",ft:"feet",in:"inches",yd:"yards"}},{name:"weight",units:weightUnits,unitNames:{kg:"kilograms",g:"grams",mg:"milligrams",lb:"pounds",oz:"ounces",t:"tonnes"}},{name:"data",units:dataUnits,unitNames:{b:"bytes",kb:"kilobytes",mb:"megabytes",gb:"gigabytes",tb:"terabytes"}}],CliConvertCommandProcessor=class{constructor(){this.command="convert",this.aliases=["conv"],this.description="Convert between units (length, weight, temperature, data)",this.author=DefaultLibraryAuthor,this.acceptsRawInput=!0,this.valueRequired=!0,this.metadata={icon:"📐",module:"misc"}}async processCommand(e,t){const{writer:r}=t,o=(e.value||"").trim().match(/^([\d.]+)\s*([a-zA-Z°]+)\s+(?:to\s+)?([a-zA-Z°]+)$/i);if(!o){r.writeError("Usage: convert <value> <from> to <to>"),r.writeInfo("Example: convert 100 km to mi"),t.process.exit(-1);return}const u=parseFloat(o[1]),d=o[2].toLowerCase(),a=o[3].toLowerCase();if(isNaN(u)){r.writeError("Invalid number"),t.process.exit(-1);return}if(this.isTemperatureUnit(d)&&this.isTemperatureUnit(a)){const l=this.convertTemperature(u,d,a);if(l!==null){const f=Math.round(l*1e3)/1e3;r.writeln(` ${u} ${this.tempLabel(d)} = ${r.wrapInColor(String(f),CliForegroundColor.Cyan)} ${this.tempLabel(a)}`),t.process.output(f);return}}for(const l of categories)if(l.units[d]&&l.units[d][a]!==void 0){const f=u*l.units[d][a],C=Math.round(f*1e6)/1e6,h=l.unitNames[d]||d,j=l.unitNames[a]||a;r.writeln(` ${u} ${h} = ${r.wrapInColor(String(C),CliForegroundColor.Cyan)} ${j}`),t.process.output(C);return}r.writeError(`Cannot convert from "${d}" to "${a}"`),r.writeln(),r.writeInfo("Supported units:"),r.writeln(" Length: m, km, cm, mm, mi, ft, in, yd"),r.writeln(" Weight: kg, g, mg, lb, oz, t"),r.writeln(" Temperature: c, f, k"),r.writeln(" Data: b, kb, mb, gb, tb"),t.process.exit(-1)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.convert.long_description","Convert between various units of measurement")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("convert <value> <from> to <to>",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` convert 100 km to mi ${t.wrapInColor("# → 62.1371 miles",CliForegroundColor.Green)}`),t.writeln(` convert 72 f to c ${t.wrapInColor("# → 22.222 celsius",CliForegroundColor.Green)}`),t.writeln(` convert 1024 mb to gb ${t.wrapInColor("# → 1 gigabytes",CliForegroundColor.Green)}`),t.writeln(` convert 5.5 lb to kg ${t.wrapInColor("# → 2.494 kilograms",CliForegroundColor.Green)}`),t.writeln(),t.writeln(`📐 ${r.t("cli.convert.supported","Supported:")}`),t.writeln(" Length: m, km, cm, mm, mi, ft, in, yd"),t.writeln(" Weight: kg, g, mg, lb, oz, t"),t.writeln(" Temperature: c, f, k"),t.writeln(" Data: b, kb, mb, gb, tb")}isTemperatureUnit(e){return["c","f","k","°c","°f","°k"].includes(e)}tempLabel(e){const t=e.replace("°","");return{c:"°C",f:"°F",k:"K"}[t]||e}convertTemperature(e,t,r){const s=t.replace("°",""),o=r.replace("°","");let u;switch(s){case"c":u=e;break;case"f":u=(e-32)*5/9;break;case"k":u=e-273.15;break;default:return null}switch(o){case"c":return u;case"f":return u*9/5+32;case"k":return u+273.15;default:return null}}},CliEchoCommandProcessor=class{constructor(){this.command="echo",this.aliases=["print"],this.description="Prints the specified text",this.acceptsRawInput=!0,this.author=DefaultLibraryAuthor,this.metadata={icon:"📢",module:"misc"}}async processCommand(e,t){const r=e.value||e.data||"";if(typeof r=="object")t.writer.writeJson(r),t.process.output(r);else{const s=this.interpretEscapes(this.stripQuotes(r));t.writer.writeln(s),t.process.output(s)}}stripQuotes(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}interpretEscapes(e){return e.replace(/\\([\\nrtv0])/g,(t,r)=>{switch(r){case"n":return`
|
|
106
|
-
`;case"t":return" ";case"r":return"\r";case"v":return"\v";case"0":return"\0";case"\\":return"\\";default:return r}})}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.echo.long_description","Prints the specified text to the terminal")),t.writeln(r.t("cli.echo.piping_note","Supports text and JSON object output via piping")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("echo <text>",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` echo Hello World ${t.wrapInColor("# Print text",CliForegroundColor.Green)}`),t.writeln(` echo "Hello, World!" ${t.wrapInColor("# Print quoted text",CliForegroundColor.Green)}`)}},CliEvalCommandProcessor=class{constructor(){this.command="eval",this.aliases=["calc","js"],this.description="Evaluate a JavaScript expression",this.author=DefaultLibraryAuthor,this.acceptsRawInput=!0,this.metadata={icon:"🧮",module:"misc",requiredPermissions:["system:eval"]}}async processCommand(command,context){var e;if(!((e=context.options)!=null&&e.allowEval)){context.writer.writeError("eval is disabled by default for security. Set allowEval: true in CliOptions to enable it."),context.process.exit(1,{silent:!0});return}try{const output=eval(command.value??"");if(Array.isArray(output)){context.writer.writeln("Output:"),context.writer.writeJson(output);return}if(typeof output=="object"){context.writer.writeln("Output:"),context.writer.writeJson(output);return}context.writer.writeln("Output: "+(output==null?void 0:output.toString()))}catch(t){context.writer.writeError(t.toString())}}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.eval.long_description",this.description)),t.writeln(r.t("cli.eval.supports","Supports arithmetic, strings, arrays, objects, and any valid JS")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("eval <expression>",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` eval 1 + 1 ${t.wrapInColor("# → 2",CliForegroundColor.Green)}`),t.writeln(` eval "Hello, " + "World!" ${t.wrapInColor("# → Hello, World!",CliForegroundColor.Green)}`),t.writeln(` eval Math.random() ${t.wrapInColor("# → 0.1234...",CliForegroundColor.Green)}`),t.writeln(` eval [1,2,3].map(x => x * 2) ${t.wrapInColor("# → [2, 4, 6]",CliForegroundColor.Green)}`)}},CliJsonCommandProcessor=class{constructor(){this.command="json",this.description="Format, minify, or validate JSON",this.author=DefaultLibraryAuthor,this.processors=[],this.metadata={icon:"📋",module:"misc"},this.processors=[{command:"format",aliases:["fmt","pretty"],description:"Pretty-print JSON with indentation",acceptsRawInput:!0,valueRequired:!0,processCommand:async(e,t)=>{const r=e.value||e.data||"";try{const s=typeof r=="object"?r:JSON.parse(r),o=JSON.stringify(s,null,2);t.writer.writeln(o),t.process.output(o)}catch{t.writer.writeError("Invalid JSON input"),t.process.exit(-1)}},writeDescription:e=>{const{writer:t}=e;t.writeln("Pretty-print JSON with 2-space indentation"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("json format <json>",CliForegroundColor.Cyan)}`)}},{command:"minify",aliases:["min"],description:"Minify JSON by removing whitespace",acceptsRawInput:!0,valueRequired:!0,processCommand:async(e,t)=>{const r=e.value||e.data||"";try{const s=typeof r=="object"?r:JSON.parse(r),o=JSON.stringify(s);t.writer.writeln(o),t.process.output(o)}catch{t.writer.writeError("Invalid JSON input"),t.process.exit(-1)}},writeDescription:e=>{const{writer:t}=e;t.writeln("Minify JSON by removing all unnecessary whitespace"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("json minify <json>",CliForegroundColor.Cyan)}`)}},{command:"validate",aliases:["check"],description:"Validate whether a string is valid JSON",acceptsRawInput:!0,valueRequired:!0,processCommand:async(e,t)=>{const r=e.value||e.data||"";try{JSON.parse(r),t.writer.writeSuccess("Valid JSON")}catch(s){t.writer.writeError(`Invalid JSON: ${s.message}`),t.process.exit(-1)}},writeDescription:e=>{const{writer:t}=e;t.writeln("Check whether a string is valid JSON"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("json validate <json>",CliForegroundColor.Cyan)}`)}}]}async processCommand(e,t){t.executor.showHelp(e,t)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.json.long_description","Format, minify, or validate JSON strings")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("json format <json>",CliForegroundColor.Cyan)} ${r.t("cli.json.format_desc","Pretty-print JSON")}`),t.writeln(` ${t.wrapInColor("json minify <json>",CliForegroundColor.Cyan)} ${r.t("cli.json.minify_desc","Remove whitespace")}`),t.writeln(` ${t.wrapInColor("json validate <json>",CliForegroundColor.Cyan)} ${r.t("cli.json.validate_desc","Check if valid JSON")}`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` json format {"a":1,"b":2} ${t.wrapInColor("# Pretty-print",CliForegroundColor.Green)}`),t.writeln(` json validate {"valid":true} ${t.wrapInColor("# Check validity",CliForegroundColor.Green)}`)}},LOREM_WORDS=["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit","sed","do","eiusmod","tempor","incididunt","ut","labore","et","dolore","magna","aliqua","enim","ad","minim","veniam","quis","nostrud","exercitation","ullamco","laboris","nisi","aliquip","ex","ea","commodo","consequat","duis","aute","irure","in","reprehenderit","voluptate","velit","esse","cillum","fugiat","nulla","pariatur","excepteur","sint","occaecat","cupidatat","non","proident","sunt","culpa","qui","officia","deserunt","mollit","anim","id","est","laborum"],CliLoremCommandProcessor=class{constructor(){this.command="lorem",this.aliases=["lipsum"],this.description="Generate lorem ipsum placeholder text",this.author=DefaultLibraryAuthor,this.processors=[],this.metadata={icon:"📝",module:"misc"},this.processors=[{command:"words",aliases:["w"],description:"Generate a number of words",parameters:[{name:"count",aliases:["n"],description:"Number of words (default: 10)",type:"number",required:!1}],processCommand:async(e,t)=>{const r=Math.min(parseInt(e.args.count||e.args.n)||10,1e3),s=this.generateWords(r);t.writer.writeln(s),t.process.output(s)},writeDescription:e=>{const{writer:t}=e;t.writeln("Generate a specific number of lorem ipsum words"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("lorem words [--count=N]",CliForegroundColor.Cyan)}`)}},{command:"sentences",aliases:["s"],description:"Generate a number of sentences",parameters:[{name:"count",aliases:["n"],description:"Number of sentences (default: 3)",type:"number",required:!1}],processCommand:async(e,t)=>{const r=Math.min(parseInt(e.args.count||e.args.n)||3,50),s=[];for(let u=0;u<r;u++){const d=Math.floor(Math.random()*10)+5,a=this.generateWords(d);s.push(a.charAt(0).toUpperCase()+a.slice(1)+".")}const o=s.join(" ");t.writer.writeln(o),t.process.output(o)},writeDescription:e=>{const{writer:t}=e;t.writeln("Generate lorem ipsum sentences"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("lorem sentences [--count=N]",CliForegroundColor.Cyan)}`)}},{command:"paragraphs",aliases:["p"],description:"Generate a number of paragraphs",parameters:[{name:"count",aliases:["n"],description:"Number of paragraphs (default: 1)",type:"number",required:!1}],processCommand:async(e,t)=>{const r=Math.min(parseInt(e.args.count||e.args.n)||1,20),s=[];for(let u=0;u<r;u++){const d=Math.floor(Math.random()*4)+3,a=[];for(let l=0;l<d;l++){const f=Math.floor(Math.random()*10)+5,C=this.generateWords(f);a.push(C.charAt(0).toUpperCase()+C.slice(1)+".")}s.push(a.join(" "))}const o=s.join(`
|
|
107
|
-
|
|
108
|
-
`);t.writer.writeln(o),t.process.output(o)},writeDescription:e=>{const{writer:t}=e;t.writeln("Generate lorem ipsum paragraphs"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("lorem paragraphs [--count=N]",CliForegroundColor.Cyan)}`)}}]}async processCommand(e,t){t.executor.showHelp(e,t)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.lorem.long_description","Generate lorem ipsum placeholder text")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("lorem words [--count=N]",CliForegroundColor.Cyan)} ${r.t("cli.lorem.gen_words","Generate words")}`),t.writeln(` ${t.wrapInColor("lorem sentences [--count=N]",CliForegroundColor.Cyan)} ${r.t("cli.lorem.gen_sentences","Generate sentences")}`),t.writeln(` ${t.wrapInColor("lorem paragraphs [--count=N]",CliForegroundColor.Cyan)} ${r.t("cli.lorem.gen_paragraphs","Generate paragraphs")}`)}generateWords(e){const t=[];for(let r=0;r<e;r++)t.push(LOREM_WORDS[Math.floor(Math.random()*LOREM_WORDS.length)]);return t.join(" ")}},CliOpenCommandProcessor=class{constructor(){this.command="open",this.description="Open a URL in a new browser tab",this.author=DefaultLibraryAuthor,this.acceptsRawInput=!0,this.valueRequired=!0,this.metadata={icon:"🌐",module:"misc"}}async processCommand(e,t){let r=e.value||"";!r.startsWith("http://")&&!r.startsWith("https://")&&(r="https://"+r);try{new URL(r)}catch{t.writer.writeError(`Invalid URL: ${e.value}`),t.process.exit(-1);return}window.open(r,"_blank")?t.writer.writeSuccess(`Opened ${t.writer.wrapInColor(r,CliForegroundColor.Blue)}`):(t.writer.writeError("Failed to open URL. Pop-ups may be blocked by the browser."),t.process.exit(-1))}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.open.long_description","Open a URL in a new browser tab")),t.writeln(r.t("cli.open.auto_https","Automatically adds https:// if no protocol is specified")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("open <url>",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` open google.com ${t.wrapInColor("# Opens https://google.com",CliForegroundColor.Green)}`),t.writeln(` open https://github.com ${t.wrapInColor("# Opens GitHub",CliForegroundColor.Green)}`)}},CliRandomCommandProcessor=class{constructor(){this.command="random",this.aliases=["rand"],this.description="Generate random values",this.author=DefaultLibraryAuthor,this.processors=[],this.metadata={icon:"🎲",module:"misc"},this.processors=[{command:"number",aliases:["num"],description:"Generate a random number",parameters:[{name:"min",description:"Minimum value (default: 0)",type:"number",required:!1},{name:"max",description:"Maximum value (default: 100)",type:"number",required:!1},{name:"count",aliases:["n"],description:"How many numbers to generate (default: 1)",type:"number",required:!1}],processCommand:async(e,t)=>{const r=parseInt(e.args.min)||0,s=parseInt(e.args.max)||100,o=Math.min(parseInt(e.args.count||e.args.n)||1,100),u=[];for(let a=0;a<o;a++)u.push(Math.floor(Math.random()*(s-r+1))+r);const d=u.join(", ");t.writer.writeln(d),t.process.output(u.length===1?u[0]:u)},writeDescription:e=>{const{writer:t}=e;t.writeln("Generate random numbers within a range"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("random number [--min=N] [--max=N] [--count=N]",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(`📝 ${e.translator.t("cli.common.examples","Examples:")}`),t.writeln(` random number ${t.wrapInColor("# 0-100",CliForegroundColor.Green)}`),t.writeln(` random number --min=1 --max=6 ${t.wrapInColor("# Dice roll",CliForegroundColor.Green)}`),t.writeln(` random number --count=5 ${t.wrapInColor("# 5 numbers",CliForegroundColor.Green)}`)}},{command:"string",aliases:["str"],description:"Generate a random string",parameters:[{name:"length",aliases:["l"],description:"String length (default: 16)",type:"number",required:!1},{name:"charset",description:"Character set: alphanumeric, alpha, numeric, hex (default: alphanumeric)",type:"string",required:!1}],processCommand:async(e,t)=>{const r=Math.min(parseInt(e.args.length||e.args.l)||16,1024),s=e.args.charset||"alphanumeric",o={alphanumeric:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",alpha:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",numeric:"0123456789",hex:"0123456789abcdef"},u=o[s];if(!u){t.writer.writeError(`Unknown charset: ${s}. Available: ${Object.keys(o).join(", ")}`),t.process.exit(-1);return}const d=new Uint32Array(r);crypto.getRandomValues(d);const a=Array.from(d).map(l=>u[l%u.length]).join("");t.writer.writeln(a),t.process.output(a)},writeDescription:e=>{const{writer:t}=e;t.writeln("Generate a cryptographically random string"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("random string [--length=N] [--charset=TYPE]",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(` Charsets: ${t.wrapInColor("alphanumeric, alpha, numeric, hex",CliForegroundColor.Yellow)}`)}},{command:"uuid",description:"Generate a random UUID v4",processCommand:async(e,t)=>{const r=crypto.randomUUID();t.writer.writeln(r),t.process.output(r)},writeDescription:e=>{const{writer:t}=e;t.writeln("Generate a cryptographically random UUID v4"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("random uuid",CliForegroundColor.Cyan)}`)}},{command:"coin",aliases:["flip"],description:"Flip a coin",processCommand:async(e,t)=>{const r=Math.random()<.5?"Heads":"Tails";t.writer.writeln(`🪙 ${r}`),t.process.output(r)}},{command:"dice",aliases:["roll"],description:"Roll a dice",parameters:[{name:"sides",aliases:["s"],description:"Number of sides (default: 6)",type:"number",required:!1}],processCommand:async(e,t)=>{const r=parseInt(e.args.sides||e.args.s)||6,s=Math.floor(Math.random()*r)+1;t.writer.writeln(`🎲 ${s}`),t.process.output(s)}}]}async processCommand(e,t){t.executor.showHelp(e,t)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.random.long_description","Generate random numbers, strings, UUIDs, and more")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("random number",CliForegroundColor.Cyan)} ${r.t("cli.random.number_desc","Random number (0-100)")}`),t.writeln(` ${t.wrapInColor("random string",CliForegroundColor.Cyan)} ${r.t("cli.random.string_desc","Random string (16 chars)")}`),t.writeln(` ${t.wrapInColor("random uuid",CliForegroundColor.Cyan)} ${r.t("cli.random.uuid_desc","Random UUID v4")}`),t.writeln(` ${t.wrapInColor("random coin",CliForegroundColor.Cyan)} ${r.t("cli.random.coin_desc","Flip a coin")}`),t.writeln(` ${t.wrapInColor("random dice",CliForegroundColor.Cyan)} ${r.t("cli.random.dice_desc","Roll a dice")}`)}},CliScreenCommandProcessor=class{constructor(){this.command="screen",this.aliases=["display"],this.description="Display screen and terminal information",this.author=DefaultLibraryAuthor,this.metadata={icon:"🖥️",module:"misc"}}async processCommand(e,t){var o;const{writer:r}=t;function s(u,d){r.writeln(` ${r.wrapInColor(u.padEnd(22),CliForegroundColor.Cyan)} ${d}`)}r.writeln(r.wrapInColor("🖥️ Screen:",CliForegroundColor.Yellow)),s("Resolution:",`${screen.width} x ${screen.height}`),s("Available:",`${screen.availWidth} x ${screen.availHeight}`),s("Color Depth:",`${screen.colorDepth}-bit`),s("Pixel Ratio:",`${window.devicePixelRatio}x`),s("Orientation:",((o=screen.orientation)==null?void 0:o.type)||"unknown"),r.writeln(),r.writeln(r.wrapInColor("🪟 Viewport:",CliForegroundColor.Yellow)),s("Inner Size:",`${window.innerWidth} x ${window.innerHeight}`),s("Outer Size:",`${window.outerWidth} x ${window.outerHeight}`),r.writeln(),r.writeln(r.wrapInColor("📟 Terminal:",CliForegroundColor.Yellow)),s("Columns:",`${t.terminal.cols}`),s("Rows:",`${t.terminal.rows}`)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.screen.long_description","Display screen, viewport, and terminal dimensions")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("screen",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(`📝 ${r.t("cli.screen.shows","Shows: resolution, color depth, pixel ratio, viewport size, terminal size")}`)}},CliSeqCommandProcessor=class{constructor(){this.command="seq",this.aliases=["sequence"],this.description="Print a sequence of numbers",this.author=DefaultLibraryAuthor,this.acceptsRawInput=!0,this.valueRequired=!0,this.metadata={icon:"🔢",module:"misc"},this.parameters=[{name:"step",aliases:["s"],description:"Step increment (default: 1)",type:"number",required:!1},{name:"separator",aliases:["sep"],description:"Separator between numbers (default: newline)",type:"string",required:!1}]}async processCommand(e,t){const{writer:r}=t,s=(e.value||"").split(/\s+/).map(Number);let o,u;const d=parseFloat(e.args.step||e.args.s)||1,a=e.args.separator||e.args.sep||`
|
|
109
|
-
`;if(s.length===1)o=1,u=s[0];else if(s.length>=2)o=s[0],u=s[1];else{r.writeError("Usage: seq <end> or seq <start> <end>"),t.process.exit(-1);return}if(isNaN(o)||isNaN(u)){r.writeError("Invalid numbers"),t.process.exit(-1);return}const l=1e4,f=[];if(d>0)for(let C=o;C<=u&&f.length<l;C+=d)f.push(C);else if(d<0)for(let C=o;C>=u&&f.length<l;C+=d)f.push(C);else{r.writeError("Step cannot be 0"),t.process.exit(-1);return}r.writeln(f.join(a)),t.process.output(f)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.seq.long_description","Print a sequence of numbers")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("seq <end>",CliForegroundColor.Cyan)} ${r.t("cli.seq.numbers_to_end","Numbers from 1 to end")}`),t.writeln(` ${t.wrapInColor("seq <start> <end>",CliForegroundColor.Cyan)} ${r.t("cli.seq.numbers_range","Numbers from start to end")}`),t.writeln(` ${t.wrapInColor("seq <start> <end> --step=N",CliForegroundColor.Cyan)} ${r.t("cli.seq.with_step","With custom step")}`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` seq 5 ${t.wrapInColor("# 1, 2, 3, 4, 5",CliForegroundColor.Green)}`),t.writeln(` seq 2 10 --step=2 ${t.wrapInColor("# 2, 4, 6, 8, 10",CliForegroundColor.Green)}`),t.writeln(` seq 1 5 --sep=", " ${t.wrapInColor("# 1, 2, 3, 4, 5",CliForegroundColor.Green)}`)}},CliSleepCommandProcessor=class{constructor(){this.command="sleep",this.aliases=["wait"],this.description="Sleep for a specified amount of time",this.author=DefaultLibraryAuthor,this.metadata={sealed:!0,module:"misc",icon:CliIcon.Timer},this.valueRequired=!0}async processCommand(e,t){const{writer:r,onAbort:s}=t,o=parseInt(e.value);if(isNaN(o)||o<0){r.writeError(`Invalid time value: "${e.value}". Please provide a positive number in milliseconds.`);return}let u=!1;await new Promise(d=>{const a=setTimeout(()=>{l.unsubscribe(),d()},o),l=s.subscribe(()=>{clearTimeout(a),u=!0,d()})}),u||r.writeInfo(`Slept for ${o}ms`)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.sleep.long_description","Pauses execution for the specified duration (in milliseconds)")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("sleep <milliseconds>",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` sleep 1000 ${t.wrapInColor("# Sleep for 1 second",CliForegroundColor.Green)}`),t.writeln(` sleep 5000 ${t.wrapInColor("# Sleep for 5 seconds",CliForegroundColor.Green)}`)}},CliTimeCommandProcessor=class{constructor(){this.command="time",this.aliases=["date"],this.description="Display the current local and UTC time",this.author=DefaultLibraryAuthor,this.version=LIBRARY_VERSION,this.processors=[],this.metadata={sealed:!0,module:"misc",icon:CliIcon.Timer},this.processors=[{command:"now",description:"Display the current time",processCommand:async(e,t)=>{const r=new Date,s=r.toLocaleString(),o=r.toUTCString();t.writer.writeSuccess(`🕒 Local Time: ${t.writer.wrapInColor(s,CliForegroundColor.White)}`),t.writer.writeSuccess(`🌐 UTC Time: ${t.writer.wrapInColor(o,CliForegroundColor.White)}`),t.process.output(r)}}]}async processCommand(e,t){t.executor.showHelp(e,t)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.time.long_description","Display the current local and UTC time")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("time now",CliForegroundColor.Cyan)} 🕒 ${r.t("cli.time.show_current","Show current local and UTC time")}`)}},CliTimestampCommandProcessor=class{constructor(){this.command="timestamp",this.aliases=["ts","epoch"],this.description="Convert between Unix timestamps and dates",this.author=DefaultLibraryAuthor,this.processors=[],this.metadata={icon:"🕐",module:"misc"},this.processors=[{command:"now",description:"Show current Unix timestamp",processCommand:async(e,t)=>{const{writer:r}=t,s=Date.now(),o=Math.floor(s/1e3);r.writeln(` ${r.wrapInColor("Seconds:",CliForegroundColor.Cyan)} ${o}`),r.writeln(` ${r.wrapInColor("Milliseconds:",CliForegroundColor.Cyan)} ${s}`),t.process.output(o)}},{command:"to-date",aliases:["todate","parse"],description:"Convert a Unix timestamp to a date",acceptsRawInput:!0,valueRequired:!0,processCommand:async(e,t)=>{const{writer:r}=t;let s=parseInt(e.value||"");if(isNaN(s)){r.writeError("Invalid timestamp"),t.process.exit(-1);return}s<1e12&&(s*=1e3);const o=new Date(s);r.writeln(` ${r.wrapInColor("Local:",CliForegroundColor.Cyan)} ${o.toLocaleString()}`),r.writeln(` ${r.wrapInColor("UTC:",CliForegroundColor.Cyan)} ${o.toUTCString()}`),r.writeln(` ${r.wrapInColor("ISO:",CliForegroundColor.Cyan)} ${o.toISOString()}`),t.process.output(o.toISOString())},writeDescription:e=>{const{writer:t}=e;t.writeln("Convert a Unix timestamp to a human-readable date"),t.writeln("Auto-detects seconds vs milliseconds"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("timestamp to-date <timestamp>",CliForegroundColor.Cyan)}`)}},{command:"from-date",aliases:["fromdate"],description:"Convert a date string to a Unix timestamp",acceptsRawInput:!0,valueRequired:!0,processCommand:async(e,t)=>{const{writer:r}=t,s=e.value||"",o=new Date(s);if(isNaN(o.getTime())){r.writeError(`Invalid date: ${s}`),t.process.exit(-1);return}const u=Math.floor(o.getTime()/1e3);r.writeln(` ${r.wrapInColor("Seconds:",CliForegroundColor.Cyan)} ${u}`),r.writeln(` ${r.wrapInColor("Milliseconds:",CliForegroundColor.Cyan)} ${o.getTime()}`),t.process.output(u)},writeDescription:e=>{const{writer:t}=e;t.writeln("Convert a date string to a Unix timestamp"),t.writeln(),t.writeln(`📋 ${e.translator.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("timestamp from-date <date>",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(`📝 ${e.translator.t("cli.common.examples","Examples:")}`),t.writeln(` timestamp from-date 2024-01-01 ${t.wrapInColor("# ISO date",CliForegroundColor.Green)}`),t.writeln(` timestamp from-date "Jan 1, 2024 12:00" ${t.wrapInColor("# Human-readable",CliForegroundColor.Green)}`)}}]}async processCommand(e,t){t.executor.showHelp(e,t)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.timestamp.long_description","Convert between Unix timestamps and human-readable dates")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("timestamp now",CliForegroundColor.Cyan)} ${r.t("cli.timestamp.current","Current Unix timestamp")}`),t.writeln(` ${t.wrapInColor("timestamp to-date <ts>",CliForegroundColor.Cyan)} ${r.t("cli.timestamp.to_date","Timestamp to date")}`),t.writeln(` ${t.wrapInColor("timestamp from-date <date>",CliForegroundColor.Cyan)} ${r.t("cli.timestamp.from_date","Date to timestamp")}`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` timestamp to-date 1704067200 ${t.wrapInColor("# → Jan 1, 2024",CliForegroundColor.Green)}`),t.writeln(` timestamp from-date 2024-01-01 ${t.wrapInColor("# → 1704067200",CliForegroundColor.Green)}`)}},CliUnAliasCommandProcessor=class{constructor(){this.command="unalias",this.author=DefaultLibraryAuthor,this.description="Remove aliases for commands",this.valueRequired=!0,this.stateConfiguration={initialState:{},storeName:"aliases"},this.metadata={icon:"🔥",module:"misc",sealed:!0}}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.unalias.long_description","Remove a previously defined command alias")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("unalias <name>",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` unalias h ${t.wrapInColor('# Remove the "h" alias',CliForegroundColor.Green)}`),t.writeln(` unalias cls ${t.wrapInColor('# Remove the "cls" alias',CliForegroundColor.Green)}`)}async processCommand(e,t){const{writer:r}=t,s=e.value,o=t.state.getState(),u=aliasOwner(t),d=aliasesFor(o,u);if(!d[s]){r.writeError(`Alias ${s} not found`),t.process.exit(-1);return}const a={};Object.keys(d).filter(l=>l!==s).forEach(l=>{a[l]=d[l]}),t.state.updateState(withAliases(o,u,a)),await t.state.persist()}},CliUnameCommandProcessor=class{constructor(){this.command="uname",this.aliases=["sysinfo"],this.description="Prints detailed system and browser information",this.author=DefaultLibraryAuthor,this.metadata={sealed:!0,icon:CliIcon.Flame,module:"misc"}}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.uname.long_description","Prints detailed system and browser information including:")),t.writeln(` 💾 ${r.t("cli.uname.cli_versions","CLI core and library versions")}`),t.writeln(` 🌐 ${r.t("cli.uname.browser_info","Browser name, version, user agent, language, and platform")}`),t.writeln(` 🖥 ${r.t("cli.uname.os","Operating system")}`),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("uname",CliForegroundColor.Cyan)}`)}async processCommand(e,t){const{writer:r}=t;function s(o,u){r.writeln(`- ${r.wrapInColor(o,CliForegroundColor.Cyan)}: ${u}`)}if(r.writeInfo("CLI:"),s("Core version",LIBRARY_VERSION$1),s("Cli version",LIBRARY_VERSION),r.writeln(),typeof navigator<"u"){r.writeInfo("Browser Information:"),s("User Agent",navigator.userAgent),s("Language",navigator.language),s("Platform",navigator.platform);const o=this.parseUserAgent(navigator.userAgent);s("Browser",o.browserName),s("Version",o.version),s("OS",o.os)}else r.writeError("Browser information is not available in this environment.")}parseUserAgent(e){var o,u,d,a;let t="Unknown",r="Unknown",s="Unknown";return e.includes("Chrome")?(t="Chrome",r=((o=e.match(/Chrome\/([\d.]+)/))==null?void 0:o[1])||"Unknown"):e.includes("Firefox")?(t="Firefox",r=((u=e.match(/Firefox\/([\d.]+)/))==null?void 0:u[1])||"Unknown"):e.includes("Safari")&&!e.includes("Chrome")?(t="Safari",r=((d=e.match(/Version\/([\d.]+)/))==null?void 0:d[1])||"Unknown"):(e.includes("MSIE")||e.includes("Trident"))&&(t="Internet Explorer",r=((a=e.match(/(?:MSIE |rv:)([\d.]+)/))==null?void 0:a[1])||"Unknown"),e.includes("Windows")?s="Windows":e.includes("Mac OS")?s="Mac OS":e.includes("Linux")?s="Linux":e.includes("Android")?s="Android":(e.includes("iPhone")||e.includes("iPad"))&&(s="iOS"),{browserName:t,version:r,os:s}}},CliUptimeCommandProcessor=class{constructor(){this.command="uptime",this.description="Show session uptime",this.author=DefaultLibraryAuthor,this.metadata={icon:"⏱️",module:"misc"}}async initialize(e){try{e.backgroundServices.register({name:"uptime-tracker",description:"Tracks terminal session uptime",type:"daemon",onStart:async t=>{t.log("Uptime tracking started"),await new Promise(r=>{t.signal.addEventListener("abort",()=>r(),{once:!0})}),t.log("Uptime tracking stopped")}}),await e.backgroundServices.start("uptime-tracker")}catch{}}async processCommand(e,t){const r=t.backgroundServices.getStatus("uptime-tracker"),{writer:s}=t;if(!r||r.status!=="running"){s.writeError("Uptime tracker is not running."),s.writeInfo(`Use ${s.wrapInColor("services start uptime-tracker",CliForegroundColor.Cyan)} to restart.`);return}const o=r.startedAt.getTime(),u=Date.now()-o,d=Math.floor(u/1e3)%60,a=Math.floor(u/(1e3*60))%60,l=Math.floor(u/(1e3*60*60))%24,f=Math.floor(u/(1e3*60*60*24)),C=[];f>0&&C.push(`${f}d`),l>0&&C.push(`${l}h`),a>0&&C.push(`${a}m`),C.push(`${d}s`);const h=C.join(" "),j=new Date(o).toLocaleString();s.writeln(`⏱️ Uptime: ${s.wrapInColor(h,CliForegroundColor.Cyan)}`),s.writeln(`📅 Started: ${s.wrapInColor(j,CliForegroundColor.Green)}`)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.uptime.long_description","Show how long the current terminal session has been active")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("uptime",CliForegroundColor.Cyan)}`)}},CliYesCommandProcessor=class{constructor(){this.command="yes",this.description="Output a string repeatedly",this.author=DefaultLibraryAuthor,this.acceptsRawInput=!0,this.metadata={icon:"✅",module:"misc"},this.parameters=[{name:"count",aliases:["n"],description:"Number of repetitions (default: 20)",type:"number",required:!1}]}async processCommand(e,t){const r=e.value||"y",s=Math.min(parseInt(e.args.count||e.args.n)||20,1e3);for(let o=0;o<s;o++)t.writer.writeln(r)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.yes.long_description","Output a string repeatedly")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("yes [text] [--count=N]",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` yes ${t.wrapInColor('# Outputs "y" 20 times',CliForegroundColor.Green)}`),t.writeln(` yes hello --count=5 ${t.wrapInColor('# Outputs "hello" 5 times',CliForegroundColor.Green)}`)}},SYSTEM_OPTIONS=[{key:"logLevel",label:"Log Level",description:"Controls how much logging the CLI outputs",type:"select",defaultValue:"ERROR",options:[{label:"None",value:"None"},{label:"Debug",value:"Debug"},{label:"Log",value:"Log"},{label:"Info",value:"Info"},{label:"Warn",value:"Warn"},{label:"Error",value:"Error"}]},{key:"welcomeMessage",label:"Welcome Message",description:"When to display the welcome message on startup",type:"select",defaultValue:"always",options:[{label:"Always",value:"always"},{label:"Once",value:"once"},{label:"Daily",value:"daily"},{label:"Never",value:"never"}]},{key:"language",label:"Language",description:"Display language for the CLI interface",type:"select",defaultValue:"en",options:[{label:"English",value:"en"}]},{key:"cursorBlink",label:"Cursor Blink",description:"Whether the terminal cursor blinks",type:"boolean",defaultValue:!0},{key:"cursorStyle",label:"Cursor Style",description:"Terminal cursor shape",type:"select",defaultValue:"block",options:[{label:"Block",value:"block"},{label:"Underline",value:"underline"},{label:"Bar",value:"bar"}]},{key:"scrollback",label:"Scrollback",description:"Number of scrollback lines to retain",type:"number",defaultValue:1e3,validator:e=>e<0||e>1e5?{valid:!1,message:"Scrollback must be between 0 and 100,000"}:{valid:!0}},{key:"fontSize",label:"Font Size",description:"Terminal font size in pixels",type:"number",defaultValue:20,validator:e=>e<8||e>40?{valid:!1,message:"Font size must be between 8 and 40"}:{valid:!0}},{key:"fontFamily",label:"Font Family",description:"Terminal font family",type:"string",defaultValue:"monospace"},{key:"smoothScrollDuration",label:"Smooth Scroll",description:"Smooth scroll duration in milliseconds (0 to disable)",type:"number",defaultValue:0,validator:e=>e<0||e>1e3?{valid:!1,message:"Smooth scroll duration must be between 0 and 1,000 ms"}:{valid:!0}},{key:"greeting",label:"Greeting",description:"Show animated time-based greeting on startup",type:"boolean",defaultValue:!0}],LOG_LEVEL_MAP={None:CliLogLevel.None,Debug:CliLogLevel.DEBUG,Log:CliLogLevel.LOG,Info:CliLogLevel.INFO,Warn:CliLogLevel.WARN,Error:CliLogLevel.ERROR},CliConfigureCommandProcessor=class Zs{constructor(){this.command="configure",this.description="Manage system and plugin configuration",this.author=DefaultLibraryAuthor,this.version="1.0.0",this.processors=[],this.metadata={sealed:!0,icon:"⚙",module:"system"},this.stateConfiguration={initialState:{system:Zs.buildDefaults(SYSTEM_OPTIONS),plugins:{}},storeName:"configure"},this.processors=[this.buildListProcessor(),this.buildGetProcessor(),this.buildSetProcessor(),this.buildResetProcessor()]}async processCommand(t,r){const s=r.services.getRequired(CliProcessorsRegistry_TOKEN),o=resolveConfigurationCategories(s);await this.showMainMenu(r,o)}async initialize(t){const r=t.state.getState();r!=null&&r.system&&this.applySystemSettings(r.system,t)}writeDescription(t){const{writer:r,translator:s}=t;r.writeln(s.t("cli.configure.long_description","Manage system and plugin configuration interactively or via subcommands")),r.writeln(),r.writeln(s.t("cli.common.usage","Usage:")),r.writeln(` ${r.wrapInColor("configure",CliForegroundColor.Cyan)} ${s.t("cli.configure.open_menu","Open interactive configuration menu")}`),r.writeln(` ${r.wrapInColor("configure list",CliForegroundColor.Cyan)} ${s.t("cli.configure.list_opts","List all configuration options")}`),r.writeln(` ${r.wrapInColor("configure get <category.key>",CliForegroundColor.Cyan)} ${s.t("cli.configure.get_value","Get a configuration value")}`),r.writeln(` ${r.wrapInColor("configure set <category.key> <value>",CliForegroundColor.Cyan)} ${s.t("cli.configure.set_value","Set a configuration value")}`),r.writeln(` ${r.wrapInColor("configure reset [category]",CliForegroundColor.Cyan)} ${s.t("cli.configure.reset_defaults","Reset configuration to defaults")}`),r.writeln(),r.writeln(s.t("cli.common.examples","Examples:")),r.writeln(` configure get system.logLevel ${r.wrapInColor("# Get the current log level",CliForegroundColor.Green)}`),r.writeln(` configure set system.logLevel Debug ${r.wrapInColor("# Set log level to Debug",CliForegroundColor.Green)}`),r.writeln(` configure set system.welcomeMessage never ${r.wrapInColor("# Disable welcome message",CliForegroundColor.Green)}`),r.writeln(` configure reset system ${r.wrapInColor("# Reset system config to defaults",CliForegroundColor.Green)}`),r.writeln(` configure reset ${r.wrapInColor("# Reset all configuration",CliForegroundColor.Green)}`)}async showMainMenu(t,r){const s=t.translator;for(;;){const o=[{label:s.t("cli.configure.system","System"),value:"system"}];for(const[d]of r)o.push({label:d.charAt(0).toUpperCase()+d.slice(1),value:d});o.push({label:s.t("cli.configure.exit","Exit"),value:"__exit__"});const u=await t.reader.readSelect("Configuration categories:",o);if(u===null||u==="__exit__")return;if(u==="system")await this.showCategoryMenu(t,"System","system",SYSTEM_OPTIONS);else{const d=r.get(u);d&&await this.showCategoryMenu(t,u,u,d.options)}}}async showCategoryMenu(t,r,s,o){if(s==="system"){const u=o.find(d=>d.key==="language");if(u){const d=t.services.get(ICliTranslationService_TOKEN);if(d){const a=d.getAvailableLocales();a.length>0&&(u.options=a.map(l=>({label:this.getLanguageLabel(l),value:l})))}}}for(;;){const u=[];for(const l of o){const f=this.getConfigValue(t,s,l.key,l.defaultValue),C=`${l.label.padEnd(25)} [${f}]`;u.push({label:C,value:l.key})}u.push({label:t.translator.t("cli.configure.back","Back"),value:"__back__"});const d=await t.reader.readSelect(`${r} settings:`,u);if(d===null||d==="__back__")return;const a=o.find(l=>l.key===d);a&&await this.editOption(t,s,a)}}async editOption(t,r,s){const o=this.getConfigValue(t,r,s.key,s.defaultValue);t.writer.writeln(),t.writer.writeln(`${t.writer.wrapInColor(s.label,CliForegroundColor.Cyan)}: ${s.description}`),t.writer.writeln(` ${t.translator.t("cli.configure.current_value","Current value:")} ${t.writer.wrapInColor(String(o),CliForegroundColor.Yellow)}`),t.writer.writeln();let u=null;switch(s.type){case"select":{if(!s.options)break;const d=s.options.map(a=>({label:a.value===o?`${a.label} (current)`:a.label,value:a.value}));u=await t.reader.readSelect("Select a value:",d);break}case"boolean":{u=await t.reader.readConfirm(`${s.label}?`,o===!0);break}case"number":{u=await t.reader.readNumber(`${s.label}: `,{default:typeof o=="number"?o:void 0});break}case"string":{u=await t.reader.readLine(`${s.label} [${o}]: `),u===""&&(u=o);break}}if(u!==null){if(s.validator){const d=s.validator(u);if(!d.valid){t.writer.writeError(d.message||t.translator.t("cli.configure.invalid_value","Invalid value"));return}}this.setConfigValue(t,r,s.key,u),await t.state.persist(),t.writer.writeSuccess(t.translator.t("cli.configure.set_to","Set {label} to {value}",{label:s.label,value:String(u)}))}}setConfigValue(t,r,s,o){const u=t.state.getState();if(r==="system")u.system={...u.system,[s]:o},t.state.updateState({system:u.system}),this.applySystemSettings(u.system,t);else{const d=u.plugins[r]||{};u.plugins={...u.plugins,[r]:{...d,[s]:o}},t.state.updateState({plugins:u.plugins})}}getConfigValue(t,r,s,o){var d,a,l;const u=t.state.getState();return r==="system"?((d=u==null?void 0:u.system)==null?void 0:d[s])??o:((l=(a=u==null?void 0:u.plugins)==null?void 0:a[r])==null?void 0:l[s])??o}getAllOptions(t){const r=[];for(const o of SYSTEM_OPTIONS)r.push({stateKey:"system",option:o});const s=resolveConfigurationCategories(t);for(const[o,{options:u}]of s)for(const d of u)r.push({stateKey:o,option:d});return r}applySystemSettings(t,r){var s;if(t.logLevel){const o=LOG_LEVEL_MAP[t.logLevel];o!==void 0&&r.logger.setCliLogLevel(o)}if(t.language){const o=r.services.get(ICliTranslationService_TOKEN);o==null||o.setLocale(t.language)}(s=r.terminal)!=null&&s.options&&(t.cursorBlink!==void 0&&(r.terminal.options.cursorBlink=t.cursorBlink),t.cursorStyle&&(r.terminal.options.cursorStyle=t.cursorStyle),t.scrollback!==void 0&&(r.terminal.options.scrollback=t.scrollback),t.fontSize!==void 0&&(r.terminal.options.fontSize=t.fontSize),t.fontFamily&&(r.terminal.options.fontFamily=t.fontFamily),t.smoothScrollDuration!==void 0&&(r.terminal.options.smoothScrollDuration=t.smoothScrollDuration))}buildListProcessor(){return{command:"list",aliases:["ls"],description:"List all configuration options and their current values",processCommand:async(t,r)=>{const s=r.services.getRequired(CliProcessorsRegistry_TOKEN),o=this.getAllOptions(s);let u="";const d={};for(const{stateKey:a,option:l}of o){const f=this.getConfigValue(r,a,l.key,l.defaultValue);if(a!==u){u=a;const j=a==="system"?"System":a;r.writer.writeln(),r.writer.writeln(r.writer.wrapInColor(` ${j}`,CliForegroundColor.Cyan)),r.writer.writeln(r.writer.wrapInColor(` ${"─".repeat(40)}`,CliForegroundColor.Cyan))}const C=`${a}.${l.key}`.padEnd(30),h=r.writer.wrapInColor(String(f),CliForegroundColor.Yellow);r.writer.writeln(` ${C} ${h}`),d[a]||(d[a]={}),d[a][l.key]=f}r.writer.writeln(),r.process.output(d)}}}buildGetProcessor(){return{command:"get",description:"Get a configuration value (e.g. configure get system.logLevel)",valueRequired:!0,processCommand:async(t,r)=>{const s=t.value,o=s.indexOf(".");if(o===-1){r.writer.writeError(r.translator.t("cli.configure.invalid_format_get","Invalid format. Use: configure get <category.key>"));return}const u=s.substring(0,o),d=s.substring(o+1),a=r.services.getRequired(CliProcessorsRegistry_TOKEN),f=this.getAllOptions(a).find(h=>h.stateKey===u&&h.option.key===d);if(!f){r.writer.writeError(r.translator.t("cli.configure.unknown_key","Unknown configuration key: {path}",{path:s}));return}const C=this.getConfigValue(r,u,d,f.option.defaultValue);r.writer.writeln(`${r.writer.wrapInColor(s,CliForegroundColor.Cyan)} = ${r.writer.wrapInColor(String(C),CliForegroundColor.Yellow)}`),r.process.output(C)}}}buildSetProcessor(){return{command:"set",description:"Set a configuration value (e.g. configure set system.logLevel Debug)",valueRequired:!0,acceptsRawInput:!0,processCommand:async(t,r)=>{const s=t.value,o=s.indexOf(" ");if(o===-1){r.writer.writeError(r.translator.t("cli.configure.invalid_format_set","Invalid format. Use: configure set <category.key> <value>"));return}const u=s.substring(0,o),d=s.substring(o+1).trim(),a=u.indexOf(".");if(a===-1){r.writer.writeError(r.translator.t("cli.configure.invalid_format_set","Invalid format. Use: configure set <category.key> <value>"));return}const l=u.substring(0,a),f=u.substring(a+1),C=r.services.getRequired(CliProcessorsRegistry_TOKEN),j=this.getAllOptions(C).find(H=>H.stateKey===l&&H.option.key===f);if(!j){r.writer.writeError(r.translator.t("cli.configure.unknown_key","Unknown configuration key: {path}",{path:u}));return}const U=this.coerceValue(d,j.option,r.translator);if(U.error){r.writer.writeError(U.error);return}const W=U.value;if(j.option.validator){const H=j.option.validator(W);if(!H.valid){r.writer.writeError(H.message||`Invalid value for ${u}`);return}}this.setConfigValue(r,l,f,W),await r.state.persist(),r.writer.writeSuccess(r.translator.t("cli.configure.set_success","Set {path} to {value}",{path:u,value:String(W)}))}}}buildResetProcessor(){return{command:"reset",description:"Reset configuration to defaults (optionally for a specific category)",acceptsRawInput:!0,processCommand:async(t,r)=>{var u;const s=r.translator,o=(u=t.value)==null?void 0:u.trim();if(o)if(o==="system"){const d=Zs.buildDefaults(SYSTEM_OPTIONS),a=r.state.getState();r.state.updateState({system:d,plugins:a.plugins}),this.applySystemSettings(d,r),await r.state.persist(),r.writer.writeSuccess(s.t("cli.configure.system_reset","System configuration reset to defaults"))}else{const d=r.services.getRequired(CliProcessorsRegistry_TOKEN),l=resolveConfigurationCategories(d).get(o);if(!l){r.writer.writeError(s.t("cli.configure.unknown_category","Unknown category: {category}",{category:o}));return}const f=Zs.buildDefaults(l.options),C=r.state.getState(),h={...C.plugins,[o]:f};r.state.updateState({system:C.system,plugins:h}),await r.state.persist(),r.writer.writeSuccess(s.t("cli.configure.category_reset",'Configuration for "{category}" reset to defaults',{category:o}))}else{if(!await r.reader.readConfirm(s.t("cli.configure.reset_confirm","Reset all configuration to defaults?"),!1)){r.writer.writeInfo(s.t("cli.configure.reset_cancelled","Reset cancelled"));return}r.state.reset(),await r.state.persist();const a=Zs.buildDefaults(SYSTEM_OPTIONS);this.applySystemSettings(a,r),r.writer.writeSuccess(s.t("cli.configure.all_reset","All configuration reset to defaults"))}}}}coerceValue(t,r,s){switch(r.type){case"number":{const o=Number(t);return isNaN(o)?{value:null,error:s.t("cli.configure.invalid_number","Invalid number: {value}",{value:t})}:{value:o}}case"boolean":{const o=t.toLowerCase();return["true","1","yes"].includes(o)?{value:!0}:["false","0","no"].includes(o)?{value:!1}:{value:null,error:s.t("cli.configure.invalid_boolean",'Invalid boolean value: "{value}". Use true or false.',{value:t})}}case"select":if(r.options){const o=r.options.find(u=>String(u.value).toLowerCase()===t.toLowerCase());if(!o){const u=r.options.map(d=>d.value).join(", ");return{value:null,error:s.t("cli.configure.invalid_options","Invalid value. Valid options: {options}",{options:u})}}return{value:o.value}}return{value:t};default:return{value:t}}}getLanguageLabel(t){return{en:"English",es:"Español",fr:"Français",de:"Deutsch",pt:"Português",it:"Italiano",ja:"日本語",ko:"한국어",zh:"中文",ru:"Русский",ar:"العربية",ro:"Română"}[t]||t}static buildDefaults(t){return t.reduce((r,s)=>(r[s.key]=s.defaultValue,r),{})}},CliSnippetCommandProcessor=class{constructor(){this.command="snippet",this.description="Save and reuse parameterized command templates",this.aliases=["snip"],this.author=DefaultLibraryAuthor,this.metadata={icon:CliIcon.Code,module:"system"},this.stateConfiguration={storeName:"snippets",initialState:{snippets:{}}},this.processors=[{command:"list",description:"List all saved snippets",processCommand:async(e,t)=>{const{snippets:r}=t.state.getState(),s=Object.entries(r);if(s.length===0){t.writer.writeInfo('No snippets saved yet. Use: snippet save <name> "<template>"');return}t.writer.writeln(t.writer.wrapInColor("Saved snippets:",CliForegroundColor.Yellow));for(const[o,u]of s)t.writer.writeln(` ${t.writer.wrapInColor(o,CliForegroundColor.Cyan)} ${u}`)}},{command:"save",description:'Save a new snippet: snippet save <name> "<template>"',acceptsRawInput:!0,valueRequired:!0,processCommand:async(e,t)=>{const r=(e.value??"").trim(),s=r.indexOf(" ");if(s===-1){t.writer.writeError('Usage: snippet save <name> "<template>"');return}const o=r.slice(0,s).trim();let u=r.slice(s+1).trim();if((u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'"))&&(u=u.slice(1,-1)),!o||!u){t.writer.writeError('Usage: snippet save <name> "<template>"');return}const{snippets:d}=t.state.getState(),a={...d,[o]:u};t.state.updateState({snippets:a}),await t.state.persist(),t.writer.writeSuccess(`Snippet "${o}" saved`)}},{command:"show",description:"Show a snippet template: snippet show <name>",acceptsRawInput:!0,valueRequired:!0,processCommand:async(e,t)=>{const r=(e.value??"").trim(),{snippets:s}=t.state.getState();if(!(r in s)){t.writer.writeError(`Snippet "${r}" not found`);return}t.writer.writeln(`${t.writer.wrapInColor(r,CliForegroundColor.Cyan)}: ${s[r]}`)}},{command:"delete",description:"Delete a snippet: snippet delete <name>",aliases:["rm","remove"],acceptsRawInput:!0,valueRequired:!0,processCommand:async(e,t)=>{const r=(e.value??"").trim(),{snippets:s}=t.state.getState();if(!(r in s)){t.writer.writeError(`Snippet "${r}" not found`);return}const o={...s};delete o[r],t.state.updateState({snippets:o}),await t.state.persist(),t.writer.writeSuccess(`Snippet "${r}" deleted`)}},{command:"run",description:"Run a snippet with variable values: snippet run <name> var1=val1 var2=val2",acceptsRawInput:!0,valueRequired:!0,processCommand:async(e,t)=>{const r=(e.value??"").trim(),s=r.indexOf(" "),o=s===-1?r:r.slice(0,s),u=s===-1?"":r.slice(s+1).trim(),{snippets:d}=t.state.getState();if(!(o in d)){t.writer.writeError(`Snippet "${o}" not found`);return}const a={},l=/(\w+)=(?:"([^"]*)"|([\S]*))/g;let f;for(;(f=l.exec(u))!==null;)a[f[1]]=f[2]??f[3]??"";let C=d[o];for(const[j,U]of Object.entries(a))C=C.replace(new RegExp(`\\{\\{${j}\\}\\}`,"g"),U);const h=[...C.matchAll(/\{\{(\w+)\}\}/g)].map(j=>j[1]);if(h.length>0){t.writer.writeError(`Missing variables: ${h.join(", ")}. Usage: snippet run ${o} ${h.map(j=>`${j}=value`).join(" ")}`);return}t.writer.writeInfo(`Running: ${C}`),await t.executor.executeCommand(C,t)}}]}async processCommand(e,t){const{snippets:r}=t.state.getState(),s=Object.keys(r).length;t.writer.writeln(`${s} snippet(s) saved. Sub-commands: list, save, show, run, delete`)}};function computeDiff(e,t){const r=e===""?[]:e.split(`
|
|
110
|
-
`),s=t===""?[]:t.split(`
|
|
111
|
-
`),o=r.length,u=s.length,d=Array.from({length:o+1},()=>new Array(u+1).fill(0));for(let C=o-1;C>=0;C--)for(let h=u-1;h>=0;h--)d[C][h]=r[C]===s[h]?1+d[C+1][h+1]:Math.max(d[C+1][h],d[C][h+1]);const a=[];let l=0,f=0;for(;l<o&&f<u;)r[l]===s[f]?(a.push({type:"same",text:r[l++]}),f++):d[l+1][f]>=d[l][f+1]?a.push({type:"remove",text:r[l++]}):a.push({type:"add",text:s[f++]});for(;l<o;)a.push({type:"remove",text:r[l++]});for(;f<u;)a.push({type:"add",text:s[f++]});return a}function formatDiff(e,t=3){const r=[],s=new Set;e.forEach((d,a)=>{d.type!=="same"&&s.add(a)});const o=new Set;for(const d of s)for(let a=Math.max(0,d-t);a<=Math.min(e.length-1,d+t);a++)o.add(a);let u=-1;for(let d=0;d<e.length;d++){if(!o.has(d))continue;u!==-1&&d>u+1&&r.push("\x1B[2m...\x1B[0m");const{type:a,text:l}=e[d];a==="add"?r.push(`\x1B[32m+ ${l}\x1B[0m`):a==="remove"?r.push(`\x1B[31m- ${l}\x1B[0m`):r.push(`\x1B[2m ${l}\x1B[0m`),u=d}return r}var CliDiffCommandProcessor=class{constructor(){this.command="diff",this.description="Show colored diff between two text inputs",this.author=DefaultLibraryAuthor,this.metadata={icon:CliIcon.Edit,module:"system"},this.parameters=[{name:"b",description:"Second text to compare",required:!1,type:"string"},{name:"a",description:"First text (alternative to pipe)",required:!1,type:"string"},{name:"context",description:"Number of context lines around changes (default: 3)",required:!1,type:"number"}]}async processCommand(e,t){var j;const r=e.args.a??e.value??"",s=e.args.b,o=(j=e.args)==null?void 0:j.context,u=o!==void 0?parseInt(String(o),10):NaN,d=Number.isFinite(u)&&u>=0?u:3;if(s===void 0){t.writer.writeError(`Usage: diff --a "text1" --b "text2"
|
|
112
|
-
echo "text1" | diff --b "text2"`);return}const a=computeDiff(r,s);if(!a.some(U=>U.type!=="same")){t.writer.writeSuccess("No differences found");return}const f=a.filter(U=>U.type==="add").length,C=a.filter(U=>U.type==="remove").length;t.writer.writeln(`\x1B[32m+${f} added\x1B[0m \x1B[31m-${C} removed\x1B[0m`),t.writer.writeln("");const h=formatDiff(a,d);for(const U of h)t.writer.writeln(U)}},BOLD="\x1B[1m",DIM="\x1B[2m",RESET="\x1B[0m",CliHelpCommandProcessor=class{constructor(){this.command="help",this.aliases=["man"],this.description="Displays help for a command",this.acceptsRawInput=!0,this.author=DefaultLibraryAuthor,this.metadata={sealed:!0,icon:CliIcon.Help,module:"system"}}async processCommand(e,t){const{writer:r}=t,s=t.translator,o=t.services.getRequired(CliProcessorsRegistry_TOKEN),[u,...d]=e.command.split(" ");if(d.length===0)await t.executor.executeCommand("version",t),[...groupBy(o.processors.filter(f=>{var C;return!((C=f.metadata)!=null&&C.hidden)}),f=>{var C;return((C=f.metadata)==null?void 0:C.module)||"uncategorized"}).entries()].sort(([f],[C])=>f==="uncategorized"?1:C==="uncategorized"?-1:0).forEach(([f,C])=>{const h=this.formatModuleName(f);r.writeln(` ${BOLD}${r.wrapInColor(h,CliForegroundColor.Yellow)}${RESET}`),C.forEach(j=>{var L,R;const U=((L=j==null?void 0:j.metadata)==null?void 0:L.icon)||CliIcon.Extension,W=r.wrapInColor(j.command.padEnd(20),CliForegroundColor.Cyan),H=(R=j.aliases)!=null&&R.length?`${DIM} ${j.aliases.join(", ")}${RESET}`:"",x=this.translateDescription(j.description,j.command,t);r.writeln(` ${U} ${W} ${x}${H}`)}),r.writeln()}),r.writeln(` ${BOLD}${r.wrapInColor(s.t("cli.help.shortcuts","Shortcuts"),CliForegroundColor.Yellow)}${RESET}`),await t.executor.executeCommand("hotkeys",t),r.writeln(),r.writeln(` ${DIM}${s.t("cli.help.type","Type")}${RESET} ${r.wrapInColor(s.t("cli.help.help_command","help <command>"),CliForegroundColor.Cyan)} ${DIM}${s.t("cli.help.for_details","for detailed information")}${RESET}`);else{const a=o.findProcessor(d[0],d.slice(1));a?this.writeProcessorDescription(a,t):(r.writeError(s.t("cli.help.unknown_command","Unknown command: {command}",{command:d[0]})),r.writeln(),r.writeln(` ${DIM}${s.t("cli.help.type","Type")}${RESET} ${r.wrapInColor("help",CliForegroundColor.Cyan)} ${DIM}${s.t("cli.help.see_all","to see all available commands")}${RESET}`))}}writeDescription(e){const{writer:t}=e,r=e.translator;t.writeln(r.t("cli.help.long_description","Displays help information for commands")),t.writeln(),t.writeln(t.wrapInColor(r.t("cli.common.usage","Usage:"),CliForegroundColor.Yellow)),t.writeln(` ${t.wrapInColor("help",CliForegroundColor.Cyan)} ${r.t("cli.help.show_all","Show all available commands")}`),t.writeln(` ${t.wrapInColor("help <command>",CliForegroundColor.Cyan)} ${r.t("cli.help.show_details","Show details for a command")}`),t.writeln(` ${t.wrapInColor("help <command> <sub>",CliForegroundColor.Cyan)} ${r.t("cli.help.show_sub_details","Show details for a subcommand")}`),t.writeln(),t.writeln(t.wrapInColor(r.t("cli.common.examples","Examples:"),CliForegroundColor.Yellow)),t.writeln(` help pkg ${DIM}# ${r.t("cli.help.example_pkg","Package manager help")}${RESET}`),t.writeln(` help theme apply ${DIM}# ${r.t("cli.help.example_theme","Theme apply subcommand help")}${RESET}`)}translateDescription(e,t,r){return e?r.translator.t(`cli.${t}.description`,e):""}writeProcessorDescription(e,t){var l,f,C,h;const{writer:r}=t,s=t.translator,o=`${DIM}v${e.version||"1.0.0"}${RESET}`,u=[];if(e.description&&u.push(this.translateDescription(e.description,e.command,t)),(l=e.aliases)!=null&&l.length&&u.push(`${DIM}${s.t("cli.help.aliases","Aliases:")}${RESET} ${e.aliases.map(j=>r.wrapInColor(j,CliForegroundColor.Magenta)).join(", ")}`),r.writeln(),r.writeBox(u,{title:`${r.wrapInColor(e.command,CliForegroundColor.Cyan)} ${o}`,borderColor:CliForegroundColor.White}),e.originalProcessor){r.writeln(),r.writeln(` ${BOLD}${r.wrapInColor(s.t("cli.help.extension_chain","Extension chain"),CliForegroundColor.Yellow)}${RESET}`);let j=e.originalProcessor,U=1;for(;j;){const W=((f=j.metadata)==null?void 0:f.module)||"unknown",H=j.version||"1.0.0";r.writeln(` ${"└".padStart(U+1," ")} ${r.wrapInColor(j.command,CliForegroundColor.Cyan)} ${DIM}v${H}${RESET} ${DIM}(${W})${RESET}`),j=j.originalProcessor,U++}}e.writeDescription&&(r.writeln(),e.writeDescription(t)),(C=e.processors)!=null&&C.length&&(r.writeln(),r.writeln(` ${BOLD}${r.wrapInColor(s.t("cli.help.subcommands","Subcommands"),CliForegroundColor.Yellow)}${RESET}`),e.processors.forEach(j=>{var x;const U=r.wrapInColor(j.command.padEnd(16),CliForegroundColor.Cyan),W=(x=j.aliases)!=null&&x.length?`${DIM} (${j.aliases.join(", ")})${RESET}`:"",H=this.translateDescription(j.description,`${e.command}.${j.command}`,t);r.writeln(` ${U} ${H}${W}`)}));const d=e.parameters||[],a=t.executor.getGlobalParameters();d.length>0&&(r.writeln(),r.writeln(` ${BOLD}${r.wrapInColor(s.t("cli.help.options","Options"),CliForegroundColor.Yellow)}${RESET}`),d.forEach(j=>{this.writeParameter(j,r,s)})),a.length>0&&(r.writeln(),r.writeln(` ${BOLD}${r.wrapInColor(s.t("cli.help.global_options","Global options"),CliForegroundColor.Yellow)}${RESET}`),a.forEach(j=>{this.writeParameter(j,r,s)})),(h=e.metadata)!=null&&h.requireServer&&(r.writeln(),r.writeln(` ${r.wrapInColor(s.t("cli.help.requires_server","Requires a connected server"),CliForegroundColor.Red)}`)),r.writeln()}formatModuleName(e){if(e.startsWith("@qodalis/cli-")){const t=e.replace("@qodalis/cli-","");return t.charAt(0).toUpperCase()+t.slice(1)}return e.startsWith("server:")?`Server (${e.substring(7)})`:e.charAt(0).toUpperCase()+e.slice(1)}writeParameter(e,t,r){var l;const s=(l=e.aliases)!=null&&l.length?`, ${e.aliases.map(f=>`-${f}`).join(", ")}`:"",o=t.wrapInColor(`--${e.name}${s}`,CliForegroundColor.Cyan),u=`${DIM}<${e.type}>${RESET}`,d=e.required?t.wrapInColor(` ${r.t("cli.help.required","(required)")}`,CliForegroundColor.Red):"",a=e.defaultValue!==void 0&&!e.required?`${DIM} [${e.defaultValue}]${RESET}`:"";t.writeln(` ${o} ${u} ${e.description}${d}${a}`)}},CLi_Name_Art_Full=`
|
|
113
|
-
____ _ _ _ _____ _ _____
|
|
114
|
-
/ __ \\ | | | (_) / ____| | |_ _|
|
|
115
|
-
| | | | ___ __| | __ _| |_ ___ | | | | | |
|
|
116
|
-
| | | |/ _ \\ / _\` |/ _\` | | / __| | | | | | |
|
|
117
|
-
| |__| | (_) | (_| | (_| | | \\__ \\ | |____| |____ _| |_
|
|
118
|
-
\\___\\_\\\\___/ \\__,_|\\__,_|_|_|___/ \\_____|______|_____|
|
|
119
|
-
`,CLi_Name_Art_Compact=`
|
|
120
|
-
___ _ _ _
|
|
121
|
-
/ _ \\ ___ __| |__ _| (_)___
|
|
122
|
-
| (_) / _ \\/ _\` / _\` | | (_-<
|
|
123
|
-
\\__\\_\\___/\\__,_\\__,_|_|_/__/ CLI
|
|
124
|
-
`,getCliNameArt=e=>e>=60?CLi_Name_Art_Full:e>=35?CLi_Name_Art_Compact:`
|
|
125
|
-
Qodalis CLI
|
|
126
|
-
`,hotkeysInfo=[{key:"Ctrl + C",description:"Cancel command or copy selection"},{key:"Ctrl + V",description:"Paste from clipboard"},{key:"Ctrl + L",description:"Clear the terminal screen"},{key:"↑ / ↓",description:"Navigate command history"},{key:"Tab",description:"Autocomplete command"}],DIM2="\x1B[2m",RESET2="\x1B[0m",CliVersionCommandProcessor=class{constructor(){this.command="version",this.aliases=["ver"],this.description="Prints the version information",this.processors=[],this.author=DefaultLibraryAuthor,this.metadata={sealed:!0,icon:CliIcon.Settings,module:"system"}}async processCommand(e,t){const{writer:r}=t;r.writeln(r.wrapInColor(getCliNameArt(t.terminal.cols),CliForegroundColor.Cyan));const s=t.services.get("cli-framework")??"vanilla";r.writeBox([`${DIM2}CLI${RESET2} ${r.wrapInColor(`v${LIBRARY_VERSION}`,CliForegroundColor.Green)}`,`${DIM2}Core${RESET2} ${r.wrapInColor(`v${LIBRARY_VERSION$1}`,CliForegroundColor.Green)}`,`${DIM2}Framework${RESET2} ${r.wrapInColor(s,CliForegroundColor.Cyan)}`,`${DIM2}Docs${RESET2} ${r.wrapInColor("https://cli.qodalis.com/docs/",CliForegroundColor.Blue)}`],{borderColor:CliForegroundColor.White}),r.writeln()}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.version.long_description","Prints the current version of the CLI and documentation link")),t.writeln(),t.writeln(t.wrapInColor(r.t("cli.common.usage","Usage:"),CliForegroundColor.Yellow)),t.writeln(` ${t.wrapInColor("version",CliForegroundColor.Cyan)}`),t.writeln(),t.writeln(` ${DIM2}Docs${RESET2} ${t.wrapInColor("https://cli.qodalis.com/docs/",CliForegroundColor.Blue)}`)}},githubUrl="https://github.com/qodalis-solutions/web-cli",feedbackTypes=[{command:"report-bug",label:"🐞 Report a Bug",icon:"🐞",description:"Reports a bug on GitHub",gitHubLabel:"bug",gitHubTemplate:"bug_report.md",titlePrompt:"Bug title: ",descriptionPrompt:"Describe the bug (what happened vs what you expected): "},{command:"request-feature",label:"✨ Request a Feature",icon:"✨",description:"Requests a new feature on GitHub",gitHubLabel:"feature-request",gitHubTemplate:"feature_request.md",titlePrompt:"Feature title: ",descriptionPrompt:"Describe the feature you would like: "},{command:"request-command",label:"🧩 Request a Command",icon:"🧩",description:"Requests a new command on GitHub",gitHubLabel:"command-request",gitHubTemplate:"command-request.md",titlePrompt:"Command name or title: ",descriptionPrompt:"Describe what the command should do: "}];function collectSystemInfo(e){const t=[];t.push(`- **CLI Version:** ${LIBRARY_VERSION}`),t.push(`- **Core Version:** ${LIBRARY_VERSION$1}`);const r=e.services.get("cli-framework")??"vanilla";return t.push(`- **Framework:** ${r}`),t.push(`- **Terminal:** ${e.terminal.cols}x${e.terminal.rows}`),typeof navigator<"u"&&(t.push(`- **Browser:** ${navigator.userAgent}`),t.push(`- **Language:** ${navigator.language}`),t.push(`- **Platform:** ${navigator.platform}`),t.push(`- **Online:** ${navigator.onLine}`)),typeof screen<"u"&&t.push(`- **Screen:** ${screen.width}x${screen.height}`),t.join(`
|
|
127
|
-
`)}function buildIssueBody(e,t){const r=[];return e&&r.push(`## Description
|
|
128
|
-
|
|
129
|
-
${e}`),r.push(`## System Info
|
|
130
|
-
|
|
131
|
-
${t}`),r.join(`
|
|
132
|
-
|
|
133
|
-
`)}function buildGitHubUrl(e,t,r){const s=new URLSearchParams;return s.set("labels",e.gitHubLabel),s.set("template",e.gitHubTemplate),s.set("title",t),s.set("body",r),`${githubUrl}/issues/new?${s.toString()}`}async function runInteractiveFlow(e,t,r){const{writer:s,reader:o}=r;let u=t==null?void 0:t.trim();if(!u){if(u=await o.readLine(e.titlePrompt)??void 0,!(u!=null&&u.trim())){s.writeInfo("Feedback cancelled.");return}u=u.trim()}s.writeln();const d=await o.readConfirm("Add a description?",!1);let a;if(d){const U=await o.readLine(e.descriptionPrompt);U!=null&&U.trim()&&(a=U.trim())}const l=collectSystemInfo(r);s.writeln(),s.writeln(`${s.wrapInColor("── Summary ──",CliForegroundColor.Cyan)}`),s.writeln(` Type: ${e.icon} ${e.command}`),s.writeln(` Title: ${s.wrapInColor(u,CliForegroundColor.White)}`),a&&s.writeln(` Desc: ${a}`),s.writeln(),s.writeln(`${s.wrapInColor("── System Info (auto-attached) ──",CliForegroundColor.Cyan)}`),s.writeln(` CLI: ${LIBRARY_VERSION} Core: ${LIBRARY_VERSION$1}`);const f=r.services.get("cli-framework")??"vanilla";if(s.writeln(` Framework: ${f} Terminal: ${r.terminal.cols}x${r.terminal.rows}`),typeof navigator<"u"&&s.writeln(` Platform: ${navigator.platform} Language: ${navigator.language}`),s.writeln(),!await o.readConfirm("Open on GitHub?",!0)){s.writeInfo("Feedback cancelled.");return}const h=buildIssueBody(a,l),j=buildGitHubUrl(e,u,h);openLink(j),s.writeln(),s.writeSuccess(`Opened ${e.command} on GitHub. Thank you for your feedback!`)}var CliFeedbackCommandProcessor=class{constructor(){var e;this.command="feedback",this.aliases=["support"],this.description="Allows users to report bugs or request features",this.processors=[],this.author=DefaultLibraryAuthor,this.metadata={sealed:!0,icon:CliIcon.Bug,module:"system"};for(const t of feedbackTypes)(e=this.processors)==null||e.push({command:t.command,description:t.description,acceptsRawInput:!0,async processCommand({value:r},s){await runInteractiveFlow(t,r,s)},writeDescription(r){const{writer:s}=r;s.writeln(`${t.icon} ${t.description}`),s.writeln(),s.writeln(`📋 ${r.translator.t("cli.common.usage","Usage:")}`),s.writeln(` ${s.wrapInColor(`feedback ${t.command}`,CliForegroundColor.Cyan)} Interactive mode`),s.writeln(` ${s.wrapInColor(`feedback ${t.command} <title>`,CliForegroundColor.Cyan)} Provide title upfront`)}})}async processCommand(e,t){const{writer:r,reader:s}=t;r.writeln("📣 What would you like to do?"),r.writeln();const o=feedbackTypes.map(a=>({label:a.label,value:a.command})),u=await s.readSelect("Select feedback type:",o);if(!u){r.writeInfo("Feedback cancelled.");return}const d=feedbackTypes.find(a=>a.command===u);d&&(r.writeln(),await runInteractiveFlow(d,void 0,t))}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.feedback.long_description","Report bugs, request features, or suggest new commands — interactively or inline.")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("feedback",CliForegroundColor.Cyan)} Interactive wizard`),t.writeln(` ${t.wrapInColor("feedback report-bug",CliForegroundColor.Cyan)} 🐞 Report a bug`),t.writeln(` ${t.wrapInColor("feedback report-bug <title>",CliForegroundColor.Cyan)} 🐞 Report with title`),t.writeln(` ${t.wrapInColor("feedback request-feature",CliForegroundColor.Cyan)} ✨ Request a feature`),t.writeln(` ${t.wrapInColor("feedback request-feature <title>",CliForegroundColor.Cyan)} ✨ Request with title`),t.writeln(` ${t.wrapInColor("feedback request-command",CliForegroundColor.Cyan)} 🧩 Request a command`),t.writeln(` ${t.wrapInColor("feedback request-command <title>",CliForegroundColor.Cyan)} 🧩 Request with title`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` feedback ${t.wrapInColor("# Start interactive wizard",CliForegroundColor.Green)}`),t.writeln(` feedback report-bug "Login page crashes" ${t.wrapInColor("# Opens bug report with title",CliForegroundColor.Green)}`),t.writeln(` feedback request-feature "Dark mode support" ${t.wrapInColor("# Opens feature request with title",CliForegroundColor.Green)}`)}},CliHistoryCommandProcessor=class{constructor(){var t,r,s;this.command="history",this.aliases=["hist"],this.description="Prints the command history of the current session",this.processors=[],this.author=DefaultLibraryAuthor,this.metadata={sealed:!0,icon:CliIcon.Code,module:"system"},(t=this.processors)==null||t.push({command:"list",description:this.description,processCommand:this.processCommand.bind(this),writeDescription:this.writeDescription.bind(this)}),(r=this.processors)==null||r.push({command:"clear",description:"Clears the command history",processCommand:async(o,u)=>{await u.services.getRequired(CliCommandHistory_TOKEN).clearHistory(),u.writer.writeInfo("Command history cleared")},writeDescription:o=>{o.writer.writeln("Clears the command history")}});const e=[{name:"n",description:"Maximum number of results to show",required:!1,type:"number"}];(s=this.processors)==null||s.push({command:"search",description:"Search command history for a pattern",parameters:e,processCommand:async(o,u)=>{var j;const d=u.services.getRequired(CliCommandHistory_TOKEN),a=(o.value??"").trim(),l=((j=o.args)==null?void 0:j.n)??0,f=d.search(a);if(f.length===0){u.writer.writeInfo(a?`No history entries matching "${a}"`:"📜 No command history yet");return}const C=l>0?f.slice(-l):f,h=l>0?f.length-C.length:0;u.writer.writeln(u.writer.wrapInColor(`📜 ${f.length} match${f.length!==1?"es":""}${a?` for "${a}"`:""}:`,CliForegroundColor.Yellow)),C.forEach((U,W)=>{const H=h+W,x=a?U.replace(new RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi"),L=>u.writer.wrapInColor(L,CliForegroundColor.Cyan)):U;u.writer.writeln(` ${u.writer.wrapInColor(String(H+1).padStart(3),CliForegroundColor.Yellow)} ${x}`)})},writeDescription:o=>{o.writer.writeln("Search command history for a pattern (case-insensitive substring match)"),o.writer.writeln(),o.writer.writeln(`📋 ${o.translator.t("cli.common.usage","Usage:")}`),o.writer.writeln(` ${o.writer.wrapInColor("history search git",CliForegroundColor.Cyan)} Show all history entries containing "git"`),o.writer.writeln(` ${o.writer.wrapInColor("history search git --n 5",CliForegroundColor.Cyan)} Show last 5 matches`)}})}async processCommand(e,t){const{writer:r}=t,o=t.services.getRequired(CliCommandHistory_TOKEN).getHistory();if(o.length===0){r.writeInfo("📜 No command history yet");return}else r.writeln(r.wrapInColor(`📜 Command history (${o.length} entries):`,CliForegroundColor.Yellow)),o.forEach((u,d)=>{r.writeln(` ${r.wrapInColor(String(d+1).padStart(3),CliForegroundColor.Yellow)} ${u}`)})}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.history.long_description","Prints the command history of the current session")),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("history",CliForegroundColor.Cyan)} ${r.t("cli.history.show","Show command history")}`),t.writeln(` ${t.wrapInColor("history search <q>",CliForegroundColor.Cyan)} ${r.t("cli.history.search","Search history for pattern")}`),t.writeln(` ${t.wrapInColor("history clear",CliForegroundColor.Cyan)} ${r.t("cli.history.clear","Clear all history")}`),t.writeln(),t.writeln(`💡 ${r.t("cli.history.arrow_hint","Use {keys} arrow keys to navigate through history",{keys:"↑/↓"})}`),t.writeln(`💡 ${r.t("cli.history.prefix_hint","Type a prefix then {key} to search history by prefix",{key:"↑"})}`)}},DIM3="\x1B[2m",RESET3="\x1B[0m",CliHotKeysCommandProcessor=class{constructor(){this.command="hotkeys",this.aliases=["shortcuts","keys"],this.description="Displays the hotkeys information",this.processors=[],this.author=DefaultLibraryAuthor,this.metadata={sealed:!0,icon:"🔥",module:"system"}}async processCommand(e,t){const{writer:r}=t;hotkeysInfo.forEach(s=>{r.writeln(` ${r.wrapInColor(s.key.padEnd(12),CliForegroundColor.Cyan)} ${DIM3}${s.description}${RESET3}`)})}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.hotkeys.long_description","Displays all available keyboard shortcuts and hotkeys")),t.writeln(),t.writeln(t.wrapInColor(r.t("cli.common.usage","Usage:"),CliForegroundColor.Yellow)),t.writeln(` ${t.wrapInColor("hotkeys",CliForegroundColor.Cyan)}`)}},BUILTIN_SOURCES={unpkg:{url:"https://unpkg.com/",kind:"file"},jsdelivr:{url:"https://cdn.jsdelivr.net/npm/",kind:"file"},npm:{url:"https://registry.npmjs.org/",kind:"registry"}},ScriptLoaderService=class{constructor(){this.sources=new Map(Object.entries(BUILTIN_SOURCES)),this.primary="unpkg"}addSource(e,t,r="file"){this.sources.set(e,{url:t.endsWith("/")?t:t+"/",kind:r})}getSources(){return Array.from(this.sources.keys())}getSource(e){return this.sources.get(e)}getSourceUrl(e){var t;return(t=this.sources.get(e))==null?void 0:t.url}getSourcesByKind(e){const t=[];for(const[r,s]of this.sources)s.kind===e&&t.push({name:r,url:s.url});return t}setCdnSource(e){this.sources.has(e)&&(this.primary=e)}getCdnSource(){return this.primary}injectScript(e){return new Promise((t,r)=>{const s=document.createElement("script");s.src=e,s.async=!0,s.onload=()=>t(),s.onerror=()=>r(new Error(`Failed to load script: ${e}`)),document.head.appendChild(s)})}getScript(e,t){const{onProgress:r,signal:s}=t||{};let o=0;return new Promise((u,d)=>{const a=new XMLHttpRequest;if(a.open("GET",e,!0),s){if(s.aborted){d(new Error("Aborted"));return}s.addEventListener("abort",()=>{a.abort(),d(new Error("Aborted"))})}a.onprogress=l=>{if(l.lengthComputable){const f=Math.round(l.loaded/l.total*100);o=f,r==null||r(f)}else o+=20,r==null||r(o)},a.onload=()=>{a.status===200?(r==null||r(100),o=100,u({xhr:a,content:a.responseText})):d(new Error(`Failed to load package: ${e}, Status: ${a.status}, Message: ${a.responseText}`))},a.onerror=()=>{d(new Error(`Failed to load package: ${e}`))},a.send()})}injectBodyScript(e){const t=document.createElement("script");t.text=e,document.head.appendChild(t)}getCdnUrls(e){const t=[],r=this.sources.get(this.primary);r&&r.kind==="file"&&t.push(`${r.url}${e}`);for(const[s,o]of this.sources)s!==this.primary&&o.kind==="file"&&t.push(`${o.url}${e}`);return t}getScriptWithFallback(e,t){const r=this.getCdnUrls(e);return this.getScriptFromUrls(r,t)}injectScriptWithFallback(e){const t=this.getCdnUrls(e);return this.injectScriptFromUrls(t)}async getScriptFromUrls(e,t){let r;for(const s of e)try{return await this.getScript(s,t)}catch(o){if((o==null?void 0:o.message)==="Aborted")throw o;r=o}throw r}async injectScriptFromUrls(e){let t;for(const r of e)try{return await this.injectScript(r)}catch(s){t=s}throw t}},CliPackageManagerService=class{constructor(){this.storageKey="cli-packages",this.QODALIS_COMMAND_PREFIX="@qodalis/cli-",this.cache=null,this.migrationDone=!1}setStore(e){this.store=e}async getPackages(){if(this.cache!==null)return this.cache;if(!this.migrationDone){this.migrationDone=!0;try{const t=localStorage.getItem("cliPackages");t&&(localStorage.removeItem("cliPackages"),await this.store.set(this.storageKey,JSON.parse(t)))}catch{}}const e=await this.store.get(this.storageKey);return this.cache=e??[],this.cache}async getPackage(e){return(await this.getPackages()).find(t=>t.name===e||t.name===this.QODALIS_COMMAND_PREFIX+e)}async hasPackage(e){return await this.getPackage(e)!==void 0}async addPackage(e){const t=await this.getPackages();if(t.find(r=>r.name===e.name))throw new Error(`Package with name "${e.name}" already exists.`);t.push(e),await this.savePackages(t)}async removePackage(e){const t=await this.getPackages(),r=t.find(o=>o.name===e||o.name===this.QODALIS_COMMAND_PREFIX+e);if(!r)throw new Error(`Package with name "${e}" not found.`);const s=t.filter(o=>o.name!==r.name);if(t.length===s.length)throw new Error(`Package with name "${e}" not found.`);return await this.savePackages(s),r}async updatePackage(e){const t=await this.getPackages(),r=t.findIndex(s=>s.name===e.name);if(r===-1)throw new Error(`Package with name "${e.name}" not found.`);t[r]=e,await this.savePackages(t)}async savePackages(e){this.cache=e,await this.store.set(this.storageKey,e)}},CliPackagesCommandProcessor=class{constructor(){this.command="pkg",this.aliases=["packages"],this.description="Manage packages in the cli",this.author=DefaultLibraryAuthor,this.version="1.0.3",this.processors=[],this.metadata={sealed:!0,icon:"📦",module:"system",requiredPermissions:["system:packages"]},this.stateConfiguration={initialState:{cdnSource:"unpkg"}},this.registeredDependencies=[],this.scriptsLoader=new ScriptLoaderService,this.packagesManager=new CliPackageManagerService;const e=this,t=this.scriptsLoader,r=this.packagesManager;this.processors=[{command:"ls",description:"List all packages in the cli",author:DefaultLibraryAuthor,async processCommand(s,o){const u=await r.getPackages();if(u.length===0){o.writer.writeInfo("📦 No packages installed"),o.writer.writeln(),o.writer.writeInfo(`💡 Use ${o.writer.wrapInColor("pkg add <name>",CliForegroundColor.Cyan)} to install a package`);return}o.writer.writeln(o.writer.wrapInColor(`📦 Installed packages (${u.length}):`,CliForegroundColor.Yellow)),u.forEach(d=>{o.writer.writeln(` ${o.writer.wrapInColor(d.name,CliForegroundColor.Cyan)}@${o.writer.wrapInColor(d.version,CliForegroundColor.Green)}`)})},writeDescription(s){s.writer.writeln("List all installed packages and their versions"),s.writer.writeln(),s.writer.writeln(`📋 ${s.translator.t("cli.common.usage","Usage:")}`),s.writer.writeln(` ${s.writer.wrapInColor("pkg ls",CliForegroundColor.Cyan)}`)}},{command:"browse",description:"List all available packages from all configured sources",async processCommand(s,o){const{progressBar:u,writer:d}=o,{signal:a,cleanup:l}=e.createAbortSignal(o);u.show(),o.notifier.info("Browsing packages");const f=r.QODALIS_COMMAND_PREFIX,C=["browser-storage","curl","guid","password-generator","qr","regex","server-logs","speed-test","string","text-to-image","todo","yesno"],h=new Map,j=t.getSourcesByKind("registry");for(const L of j){if(a.aborted)break;u.setText(`Searching ${L.name} registry`);try{const R=`${L.url}-/v1/search?text=${encodeURIComponent(f)}&size=250`,N=await t.getScript(R,{signal:a}),V=JSON.parse(N.content||"{}");for(const J of V.objects||[]){const Y=J.package;!Y.name.startsWith(f)||Y.name===`${f}core`||h.has(Y.name)||h.set(Y.name,{name:Y.name,shortName:Y.name.replace(f,""),version:Y.version,description:Y.description||"",source:L.name})}}catch{if(a.aborted)break}}const U=t.getSourcesByKind("file");for(const L of U){if(a.aborted)break;u.setText(`Scanning ${L.name}`);for(const R of C){if(a.aborted)break;const N=`${f}${R}`;u.setText(`Scanning ${L.name}: ${R}`);try{const V=`${L.url}${N}/package.json`,J=await t.getScript(V,{signal:a}),Y=JSON.parse(J.content||"{}"),Z=h.get(N);Z?(Z.source.includes(L.name)||(Z.source+=`, ${L.name}`),Y.version&&Y.version!==Z.version&&(Z.version=Y.version,Z.source=L.name)):h.set(N,{name:N,shortName:R,version:Y.version||"latest",description:Y.description||"",source:L.name})}catch{}}}if(l(),a.aborted)return;u.complete();const W=Array.from(h.values()).sort((L,R)=>L.name.localeCompare(R.name));if(W.length===0){d.writeInfo("📦 No packages found across any source");return}const H=await r.getPackages(),x=new Map(H.map(L=>[L.name,L.version]));d.writeln(d.wrapInColor(`📦 Available packages (${W.length}):`,CliForegroundColor.Yellow)),d.writeln();for(const L of W){const R=x.get(L.name);let N;R?R===L.version?N=d.wrapInColor("✅ installed",CliForegroundColor.Green):N=d.wrapInColor(`🔄 ${R} → ${L.version}`,CliForegroundColor.Yellow):N=d.wrapInColor("📥 not installed",CliForegroundColor.Magenta);const V=d.wrapInColor(`[${L.source}]`,CliForegroundColor.Blue);d.writeln(` ${d.wrapInColor(L.shortName,CliForegroundColor.Cyan)} ${d.wrapInColor(`v${L.version}`,CliForegroundColor.Green)} ${N} ${V}`),L.description&&d.writeln(` ${L.description}`)}d.writeln(),d.writeInfo(`💡 Use ${d.wrapInColor("pkg add <name>",CliForegroundColor.Cyan)} to install a package`)},writeDescription(s){s.writer.writeln("Browse all available packages across all configured sources"),s.writer.writeln(),s.writer.writeln(`📋 ${s.translator.t("cli.common.usage","Usage:")}`),s.writer.writeln(` ${s.writer.wrapInColor("pkg browse",CliForegroundColor.Cyan)}`),s.writer.writeln(),s.writer.writeln("Shows each package with its latest version, install status, and source:"),s.writer.writeln(` ${s.writer.wrapInColor("✅ installed",CliForegroundColor.Green)} Already installed and up to date`),s.writer.writeln(` ${s.writer.wrapInColor("🔄 update",CliForegroundColor.Yellow)} Installed but a newer version exists`),s.writer.writeln(` ${s.writer.wrapInColor("📥 not installed",CliForegroundColor.Magenta)} Not yet installed`),s.writer.writeln(),s.writer.writeln("🌐 Sources queried:"),s.writer.writeln(` ${s.writer.wrapInColor("registry",CliForegroundColor.Cyan)} npm-compatible search API (e.g. npmjs.org, Verdaccio)`),s.writer.writeln(` ${s.writer.wrapInColor("file",CliForegroundColor.Cyan)} Static file servers, probed for known packages`)}},{command:"add",description:"Add a package to the cli, e.g. pkg add guid.",valueRequired:!0,async processCommand(s,o){const{signal:u,cleanup:d}=e.createAbortSignal(o),a=s.value.split(" ");for(const l of a){if(u.aborted)break;o.notifier.info(`Installing ${l}`),await e.addPackage(l,o,u)}d()},writeDescription(s){const{writer:o}=s;o.writeln("Install one or more packages from the Qodalis registry"),o.writeln(),o.writeln(`📋 ${s.translator.t("cli.common.usage","Usage:")}`),o.writeln(` ${o.wrapInColor("pkg add <package> [package2...]",CliForegroundColor.Cyan)}`),o.writeln(),o.writeln(`📝 ${s.translator.t("cli.common.examples","Examples:")}`),o.writeln(` pkg add guid ${o.wrapInColor("# Short name",CliForegroundColor.Green)}`),o.writeln(` pkg add @qodalis/cli-guid ${o.wrapInColor("# Full name",CliForegroundColor.Green)}`),o.writeln(` pkg add guid server-logs ${o.wrapInColor("# Multiple packages",CliForegroundColor.Green)}`),o.writeln(),o.writeInfo("💡 Short names are automatically prefixed with @qodalis/cli-")}},{command:"remove",description:"Remove a package from the cli",valueRequired:!0,async processCommand(s,o){const{signal:u,cleanup:d}=e.createAbortSignal(o),a=s.value.split(" ");for(const l of a){if(u.aborted)break;o.notifier.info(`Removing ${l}`),await e.removePackage(l,o)}d()},writeDescription(s){const{writer:o}=s;o.writeln("Remove one or more installed packages"),o.writeln(),o.writeln(`📋 ${s.translator.t("cli.common.usage","Usage:")}`),o.writeln(` ${o.wrapInColor("pkg remove <package> [package2...]",CliForegroundColor.Cyan)}`),o.writeln(),o.writeln(`📝 ${s.translator.t("cli.common.examples","Examples:")}`),o.writeln(` pkg remove guid ${o.wrapInColor("# Remove one package",CliForegroundColor.Green)}`),o.writeln(` pkg remove guid server-logs ${o.wrapInColor("# Remove multiple",CliForegroundColor.Green)}`)}},{command:"versions",description:"Show all published versions of a package",valueRequired:!0,acceptsRawInput:!0,async processCommand(s,o){var j;const{progressBar:u,writer:d}=o,{signal:a,cleanup:l}=e.createAbortSignal(o),f=s.value.trim(),C=r.QODALIS_COMMAND_PREFIX,h=f.startsWith(C)?f:`${C}${f}`;u.show(),u.setText(`Fetching versions for ${f}`),o.notifier.info(`Fetching versions for ${f}`);try{const U=await t.getScript(`https://registry.npmjs.org/${encodeURIComponent(h)}`,{signal:a});if(a.aborted){l();return}const W=JSON.parse(U.content||"{}");if(!W.versions){u.complete(),d.writeError(`Package ${f} not found`),l();return}const H=Object.keys(W.versions),x=W.time||{},L=((j=W["dist-tags"])==null?void 0:j.latest)||"",R=await r.getPackage(f);u.complete(),d.writeln(d.wrapInColor(`📦 ${h} — ${H.length} version${H.length!==1?"s":""}:`,CliForegroundColor.Yellow)),d.writeln();for(const N of H){const V=x[N]?new Date(x[N]).toLocaleDateString():"",J=[];N===L&&J.push(d.wrapInColor("latest",CliForegroundColor.Green)),R&&R.version===N&&J.push(d.wrapInColor("installed",CliForegroundColor.Cyan));const Y=J.length>0?` [${J.join(", ")}]`:"";d.writeln(` ${d.wrapInColor(`v${N}`,CliForegroundColor.White)} ${d.wrapInColor(V,CliForegroundColor.Yellow)}${Y}`)}d.writeln()}catch(U){if(a.aborted){l();return}u.complete(),d.writeError((U==null?void 0:U.toString())||"Failed to fetch versions")}l()},writeDescription(s){s.writer.writeln("Show all published versions of a package from the npm registry"),s.writer.writeln(),s.writer.writeln(`📋 ${s.translator.t("cli.common.usage","Usage:")}`),s.writer.writeln(` ${s.writer.wrapInColor("pkg versions <package>",CliForegroundColor.Cyan)}`),s.writer.writeln(),s.writer.writeln(`📝 ${s.translator.t("cli.common.examples","Examples:")}`),s.writer.writeln(` pkg versions guid ${s.writer.wrapInColor("# Short name",CliForegroundColor.Green)}`),s.writer.writeln(` pkg versions @qodalis/cli-guid ${s.writer.wrapInColor("# Full name",CliForegroundColor.Green)}`)}},{command:"check",description:"Check installed packages for available updates",async processCommand(s,o){const u=await r.getPackages();if(u.length===0){o.writer.writeInfo("📦 No packages installed"),o.writer.writeln(),o.writer.writeInfo(`💡 Use ${o.writer.wrapInColor("pkg add <name>",CliForegroundColor.Cyan)} to install a package`);return}const{progressBar:d,writer:a}=o,{signal:l,cleanup:f}=e.createAbortSignal(o);d.show();const C=[],h=[],j=[];for(const U of u){if(l.aborted)break;d.setText(`Checking ${U.name}`);try{const W=await t.getScriptWithFallback(`${U.name}/package.json`,{signal:l}).then(H=>JSON.parse(H.content||"{}"));W.version&&W.version!==U.version?C.push({name:U.name,current:U.version,latest:W.version}):h.push(U.name)}catch{if(l.aborted)break;j.push({name:U.name,error:"Failed to check"})}}if(f(),!l.aborted){if(d.complete(),C.length>0){a.writeln(a.wrapInColor(`🔄 Updates available (${C.length}):`,CliForegroundColor.Yellow)),a.writeln();for(const U of C)a.writeln(` ${a.wrapInColor(U.name,CliForegroundColor.Cyan)} ${a.wrapInColor(U.current,CliForegroundColor.Red)} → ${a.wrapInColor(U.latest,CliForegroundColor.Green)}`);a.writeln(),a.writeInfo(`💡 Run ${a.wrapInColor("pkg update",CliForegroundColor.Cyan)} to update all packages`)}if(h.length>0){C.length>0&&a.writeln(),a.writeln(a.wrapInColor(`✅ Up to date (${h.length}):`,CliForegroundColor.Green)),a.writeln();for(const U of h)a.writeln(` ${a.wrapInColor(U,CliForegroundColor.Cyan)}`)}if(j.length>0){a.writeln();for(const U of j)a.writeWarning(`⚠️ ${U.name}: ${U.error}`)}C.length===0&&j.length===0&&(a.writeln(),a.writeSuccess("🎉 All packages are up to date!"))}},writeDescription(s){s.writer.writeln("Check installed packages for newer versions available on the registry"),s.writer.writeln(),s.writer.writeln(`📋 ${s.translator.t("cli.common.usage","Usage:")}`),s.writer.writeln(` ${s.writer.wrapInColor("pkg check",CliForegroundColor.Cyan)}`),s.writer.writeln(),s.writer.writeInfo(`💡 Use ${s.writer.wrapInColor("pkg update",CliForegroundColor.Cyan)} to apply updates`)}},{command:"update",description:"Update a package in the cli to the latest version or update all packages",acceptsRawInput:!0,valueRequired:!1,async processCommand(s,o){const{signal:u,cleanup:d}=e.createAbortSignal(o);if(s.value){const a=s.value.trim(),l=a.lastIndexOf("@");let f,C;l>0&&!a.slice(0,l).endsWith("/")?(f=a.slice(0,l),C=a.slice(l+1)):f=a,await e.updatePackage(f,o,u,C)}else{const a=await r.getPackages();for(const l of a){if(u.aborted)break;await e.updatePackage(l.name,o,u)}u.aborted||o.writer.writeSuccess("All packages updated")}d()},writeDescription(s){s.writer.writeln("Update packages to their latest versions or to a specific version"),s.writer.writeln(),s.writer.writeln(`📋 ${s.translator.t("cli.common.usage","Usage:")}`),s.writer.writeln(` ${s.writer.wrapInColor("pkg update <package>",CliForegroundColor.Cyan)} Update to latest`),s.writer.writeln(` ${s.writer.wrapInColor("pkg update <package>@<version>",CliForegroundColor.Cyan)} Update to specific version`),s.writer.writeln(` ${s.writer.wrapInColor("pkg update",CliForegroundColor.Cyan)} Update all packages`),s.writer.writeln(),s.writer.writeln(`📝 ${s.translator.t("cli.common.examples","Examples:")}`),s.writer.writeln(` pkg update guid ${s.writer.wrapInColor("# Update to latest",CliForegroundColor.Green)}`),s.writer.writeln(` pkg update guid@1.0.2 ${s.writer.wrapInColor("# Install specific version",CliForegroundColor.Green)}`)}},{command:"source",description:"Get or set the package source for downloads",acceptsRawInput:!0,processors:[{command:"get",description:"Show the current CDN source",async processCommand(s,o){const u=t.getCdnSource(),a=t.getSources().filter(l=>l!==u);o.writer.writeln(`🌐 Current source: ${o.writer.wrapInColor(u,CliForegroundColor.Cyan)}`),a.length>0&&o.writer.writeln(` Fallbacks: ${a.map(l=>o.writer.wrapInColor(l,CliForegroundColor.Yellow)).join(", ")}`)}},{command:"set",description:"Set the preferred package source (interactive if no name given)",acceptsRawInput:!0,async processCommand(s,o){let u=(s.value||"").trim().toLowerCase();const d=t.getSources();if(!u){const l=t.getCdnSource(),f=d.map(h=>{const j=t.getSource(h);return{label:`${h}${h===l?" (active)":""} ${(j==null?void 0:j.url)||""}`,value:h}}),C=await o.reader.readSelect("Select package source:",f);if(!C){o.writer.writeInfo("Source selection cancelled");return}u=C}if(!d.includes(u)){o.writer.writeError(`Invalid source "${u}". Available sources: ${d.join(", ")}`);return}t.setCdnSource(u),o.state.updateState({cdnSource:u}),await o.state.persist(),o.writer.writeSuccess(`Package source set to ${o.writer.wrapInColor(u,CliForegroundColor.Cyan)}`);const a=d.filter(l=>l!==u);a.length>0&&o.writer.writeln(` Fallbacks: ${a.map(l=>o.writer.wrapInColor(l,CliForegroundColor.Yellow)).join(", ")}`)},writeDescription(s){const o=t.getSources();s.writer.writeln("Set the preferred source for package downloads"),s.writer.writeln(),s.writer.writeln(`📋 ${s.translator.t("cli.common.usage","Usage:")}`),s.writer.writeln(` ${s.writer.wrapInColor("pkg source set <name>",CliForegroundColor.Cyan)}`),s.writer.writeln(),s.writer.writeln("🌐 Available sources:");for(const u of o){const d=t.getSource(u),a=d?`[${d.kind}]`:"";s.writer.writeln(` ${s.writer.wrapInColor(u,CliForegroundColor.Cyan)} ${s.writer.wrapInColor(a,CliForegroundColor.Yellow)} ${(d==null?void 0:d.url)||""}`)}}}],async processCommand(s,o){const u=t.getCdnSource(),a=t.getSources().filter(l=>l!==u);o.writer.writeln(`🌐 Current source: ${o.writer.wrapInColor(u,CliForegroundColor.Cyan)}`),a.length>0&&o.writer.writeln(` Fallbacks: ${a.map(l=>o.writer.wrapInColor(l,CliForegroundColor.Yellow)).join(", ")}`),o.writer.writeln(),o.writer.writeInfo(`💡 Use ${o.writer.wrapInColor("pkg source set <name>",CliForegroundColor.Cyan)} to change`)},writeDescription(s){const o=t.getSources();s.writer.writeln("Manage the source used for downloading packages"),s.writer.writeln(),s.writer.writeln("📋 Commands:"),s.writer.writeln(` ${s.writer.wrapInColor("pkg source",CliForegroundColor.Cyan)} Show current source`),s.writer.writeln(` ${s.writer.wrapInColor("pkg source get",CliForegroundColor.Cyan)} Show current source`),s.writer.writeln(` ${s.writer.wrapInColor("pkg source set <name>",CliForegroundColor.Cyan)} Set preferred source`),s.writer.writeln(),s.writer.writeln("🌐 Available sources:");for(const u of o){const d=t.getSourceUrl(u)||"";s.writer.writeln(` ${s.writer.wrapInColor(u,CliForegroundColor.Cyan)} ${d}`)}s.writer.writeln(),s.writer.writeInfo("The non-selected source is used as a fallback.")}}]}createAbortSignal(e){const t=new AbortController,r=e.onAbort.subscribe(()=>{t.abort()});return{signal:t.signal,cleanup:()=>r.unsubscribe()}}async processCommand(e,t){await t.executor.showHelp(e,t)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(this.description),t.writeln(),t.writeln(`📋 ${r.t("cli.common.usage","Usage:")}`),t.writeln(` ${t.wrapInColor("pkg ls",CliForegroundColor.Cyan)} List installed packages`),t.writeln(` ${t.wrapInColor("pkg browse",CliForegroundColor.Cyan)} Browse all available packages`),t.writeln(` ${t.wrapInColor("pkg add <package>",CliForegroundColor.Cyan)} Install a package`),t.writeln(` ${t.wrapInColor("pkg remove <package>",CliForegroundColor.Cyan)} Remove a package`),t.writeln(` ${t.wrapInColor("pkg versions <package>",CliForegroundColor.Cyan)} Show all published versions`),t.writeln(` ${t.wrapInColor("pkg check",CliForegroundColor.Cyan)} Check for available updates`),t.writeln(` ${t.wrapInColor("pkg update [package]",CliForegroundColor.Cyan)} Update one or all packages`),t.writeln(` ${t.wrapInColor("pkg source [get|set <name>]",CliForegroundColor.Cyan)} Get or set package source`),t.writeln(),t.writeln(`🌐 Browse packages: ${t.wrapInColor("https://www.npmjs.com/org/qodalis",CliForegroundColor.Blue)}`),t.writeln(),t.writeln(`📝 ${r.t("cli.common.examples","Examples:")}`),t.writeln(` pkg add guid ${t.wrapInColor("# Install @qodalis/cli-guid",CliForegroundColor.Green)}`),t.writeln(` pkg add guid server-logs ${t.wrapInColor("# Install multiple packages",CliForegroundColor.Green)}`),t.writeln(` pkg update ${t.wrapInColor("# Update all packages",CliForegroundColor.Green)}`)}async initialize(e){var o;this.registry=e.services.getRequired(CliProcessorsRegistry_TOKEN);const t=e.services.getRequired(CliKeyValueStore_TOKEN);this.packagesManager.setStore(t),e.services.set([{provide:CliPackageManagerService_TOKEN,useValue:this.packagesManager}]);const r=(o=e.options)==null?void 0:o.packageSources;if(r!=null&&r.sources)for(const u of r.sources)this.scriptsLoader.addSource(u.name,u.url,u.kind||"file");r!=null&&r.primary&&this.scriptsLoader.setCdnSource(r.primary),e.state.select(u=>u.cdnSource).subscribe(u=>{u&&this.scriptsLoader.setCdnSource(u)});const s=await this.packagesManager.getPackages();for(const u of s)await this.registerPackageDependencies(u,e),await this.injectScriptWithCdnFallback(u.url)}async removePackage(e,t){var r;t.progressBar.show();try{const s=await this.packagesManager.removePackage(e);if(s){const o=window[s.name];o&&((r=o.processors)==null||r.forEach(u=>{this.registry.unregisterProcessor(u)}))}t.progressBar.complete(),t.writer.writeSuccess(`Package ${s.name}@${s.version} removed successfully`)}catch(s){t.progressBar.complete(),t.writer.writeError((s==null?void 0:s.toString())||"Unknown error")}}async addPackage(e,t,r){if(await this.packagesManager.hasPackage(e)){t.writer.writeInfo(`Package ${e} already installed`);return}const o=`pkg-install:${e}`;try{t.backgroundServices.register({name:o,description:`Installing package '${e}'`,type:"job",onStart:async u=>{u.log(`Installing ${e}`),await this.doAddPackage(e,t,r),u.log(`Installation of ${e} complete`)}}),await t.backgroundServices.start(o)}catch{await this.doAddPackage(e,t,r)}}async doAddPackage(e,t,r){const{progressBar:s}=t;s.show(),s.setText(`Fetching package ${e}`);try{const o=e.startsWith(this.packagesManager.QODALIS_COMMAND_PREFIX)?e:`${this.packagesManager.QODALIS_COMMAND_PREFIX}${e}`;let u=await this.scriptsLoader.getScriptWithFallback(`${o}/package.json`,{signal:r}).then(f=>JSON.parse(f.content||"{}")).catch(()=>null);if(r!=null&&r.aborted||(!u&&o!==e&&(s.setText(`Trying ${e}`),u=await this.scriptsLoader.getScriptWithFallback(`${e}/package.json`,{signal:r}).then(f=>JSON.parse(f.content||"{}")).catch(()=>null)),r!=null&&r.aborted))return;if(!u)throw s.setText("Package not found"),new Error(`Package ${e} not found`);s.setText("Downloading package");const d=this.resolvePackageCdnPath(u),a=await this.scriptsLoader.getScriptWithFallback(d,{signal:r});if(r!=null&&r.aborted)return;s.setText("Registering dependencies");const l={name:u.name,version:u.version||"latest",url:a.xhr.responseURL,dependencies:u.cliDependencies||[]};await this.registerPackageDependencies(l,t),s.setText("Injecting package"),a.content&&await this.scriptsLoader.injectBodyScript(a.content),s.setText("Saving package"),await this.packagesManager.addPackage(l),t.progressBar.complete(),t.writer.writeSuccess(`Package ${u.name}@${u.version} added successfully`)}catch(o){if(r!=null&&r.aborted)return;t.progressBar.complete(),t.writer.writeError((o==null?void 0:o.toString())||"Unknown error")}}async updatePackage(e,t,r,s){const{progressBar:o,writer:u}=t;o.show();try{o.setText(`Updating package ${e}`);const d=await this.packagesManager.getPackage(e);if(!d){o.complete(),u.writeError(`Package ${e} not found`);return}const a=s?`@${s}`:"",l=`${d.name}${a}`;o.setText(s?`Fetching ${d.name}@${s}`:`Checking for updates for package ${d.name}`);const f=await this.scriptsLoader.getScriptWithFallback(l+"/package.json",{signal:r}).then(U=>JSON.parse(U.content||"{}"));if(r!=null&&r.aborted)return;if(f.version===d.version){o.complete(),u.writeInfo(`Package ${d.name} is already at version ${d.version}`);return}o.setText(`Downloading package ${d.name}@${f.version}`);const C=this.resolvePackageCdnPath(f,a),h=await this.scriptsLoader.getScriptWithFallback(C,{signal:r});if(r!=null&&r.aborted)return;o.setText("Registering dependencies");const j={name:f.name,version:f.version||"latest",url:h.xhr.responseURL,dependencies:f.cliDependencies||[]};await this.registerPackageDependencies(j,t),o.setText(`Injecting package ${d.name}`),h.content&&await this.scriptsLoader.injectBodyScript(h.content),o.setText(`Saving package ${d.name}`),await this.packagesManager.updatePackage(j),o.complete(),u.writeSuccess(`Package ${d.name} updated to version ${f.version} from ${d.version}`)}catch(d){if(r!=null&&r.aborted)return;o.complete(),u.writeError((d==null?void 0:d.toString())||"Unknown error")}}async injectScriptWithCdnFallback(e){let t=e;for(const r of this.scriptsLoader.getSources()){const s=this.scriptsLoader.getSourceUrl(r);if(s&&t.startsWith(s)){t=t.slice(s.length);break}}await this.scriptsLoader.injectScriptWithFallback(t)}async registerPackageDependencies(e,{logger:t}){if(e.dependencies&&e.dependencies.length>0){t.info(`Injecting package ${e.name} dependencies`);for(const r of e.dependencies){if(this.registeredDependencies.includes(r.name)){t.info(`Dependency ${r.globalName} already registered`);continue}if(await this.injectScriptWithCdnFallback(r.url),r.globalName)if(await this.waitForGlobal(r.globalName,3e3))t.info(`Dependency ${r.globalName} is available in global scope`);else{t.error(`Dependency ${r.globalName} not found in global scope within timeout`);return}this.registeredDependencies.push(r.name)}}else t.info(`Package ${e.name} has no dependencies`)}resolvePackageCdnPath(e,t=""){const r=e.unpkg||e.umd||e.main,s=`${e.name}${t}`;if(r){const o=r.replace(/^\.\//,"");return`${s}/${o}`}return s}waitForGlobal(e,t){return new Promise(r=>{let o=0;const u=()=>{window[e]?r(!0):o>=t?r(!1):(o+=50,setTimeout(u,50))};u()})}},zt,CliServerConnection=(zt=class{constructor(t,r,s,o){this._config=t,this._backgroundServices=r,this._logger=s,this._authService=o,this._connected=!1,this._commands=[],this._capabilities=null,this._eventSocket=null,this._apiVersion=1,this._basePath="",this._wsReconnectAttempts=0,this._wsReconnectTimer=null,this._eventServiceRegistered=!1,this._healthCheckTimer=null,this._healthCheckAttempts=0}get config(){return this._config}get connected(){return this._connected}get commands(){return this._commands}get capabilities(){return this._capabilities}get apiVersion(){return this._apiVersion}resolveAuthHeaders(){return this._authService?this._authService.getHeaders(this._config.name,this._config.headers):resolveHeaders(this._config.headers)}async buildWebSocketUrl(t){var o,u;const r=this.toWebSocketUrl(this.normalizeUrl(this._config.url))+t,s=await((u=(o=this._authService)==null?void 0:o.getWebSocketParams)==null?void 0:u.call(o,this._config.name));return s?appendQueryParams(r,s):buildAuthenticatedWebSocketUrl(r,()=>this.resolveAuthHeaders())}async connect(){var t;try{const r=this.normalizeUrl(this._config.url),s=await ServerVersionNegotiator.discover(r,()=>this.resolveAuthHeaders());s?(this._apiVersion=s.apiVersion,this._basePath=s.basePath):(this._apiVersion=1,this._basePath=`${r}/api/v1/qcli`),this._commands=await this.fetchCommands(),this._connected=!0,this._capabilities=await this.fetchCapabilities(),this.connectEventSocket(),this.stopHealthCheck()}catch(r){(t=this._logger)==null||t.warn(`Failed to connect to server "${this._config.name}": ${r}`),this._connected=!1,this._commands=[],this._capabilities=null}}disconnect(){this._wsReconnectTimer&&(clearTimeout(this._wsReconnectTimer),this._wsReconnectTimer=null),this._wsReconnectAttempts=0,this.stopHealthCheck(),this._connected=!1,this._commands=[],this._capabilities=null,this._apiVersion=1,this._basePath="",this.closeEventSocket()}startHealthCheck(){this.stopHealthCheck(),this._healthCheckAttempts=0,this.scheduleNextHealthCheck()}scheduleNextHealthCheck(){this._healthCheckTimer=setTimeout(async()=>{var r,s,o,u;if(this._healthCheckAttempts++,this._healthCheckAttempts>zt.HEALTH_CHECK_MAX_ATTEMPTS){(r=this._logger)==null||r.debug(`Health check gave up for "${this._config.name}" after ${zt.HEALTH_CHECK_MAX_ATTEMPTS} attempts.`),this.stopHealthCheck();return}(s=this._logger)==null||s.debug(`Health check ${this._healthCheckAttempts}/${zt.HEALTH_CHECK_MAX_ATTEMPTS} for "${this._config.name}"...`),await this.ping()?((o=this._logger)==null||o.debug(`Server "${this._config.name}" is back online, reconnecting...`),this.stopHealthCheck(),await this.connect(),this._connected&&((u=this.onReconnected)==null||u.call(this))):this.scheduleNextHealthCheck()},zt.HEALTH_CHECK_INTERVAL_MS)}stopHealthCheck(){this._healthCheckTimer&&(clearTimeout(this._healthCheckTimer),this._healthCheckTimer=null),this._healthCheckAttempts=0}async fetchCommands(){const t=`${this._basePath}/commands`,r=await this.httpFetch(t);if(!r.ok)throw new Error(`Server ${this._config.name} returned ${r.status}`);return r.json()}async fetchCapabilities(){var t;try{const r=`${this._basePath}/capabilities`,s=await this.httpFetch(r);return s.ok?s.json():null}catch(r){return(t=this._logger)==null||t.debug(`Failed to fetch capabilities for "${this._config.name}": ${r}`),null}}async execute(t){const r=`${this._basePath}/execute`,s=await this.httpFetchWithRetry(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return s.ok?s.json():{exitCode:1,outputs:[{type:"text",value:`Server error: ${s.status} ${s.statusText}`,style:"error"}]}}async executeStream(t,r){var f;const s=`${this._basePath}/execute/stream`,o=await this.httpFetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!o.ok)throw new Error(`Server error: ${o.status} ${o.statusText}`);const u=(f=o.body)==null?void 0:f.getReader();if(!u)throw new Error("Response body is not readable");const d=new TextDecoder;let a="",l=0;try{for(;;){const{done:C,value:h}=await u.read();if(C)break;a+=d.decode(h,{stream:!0});const j=a.split(`
|
|
134
|
-
|
|
135
|
-
`);a=j.pop()??"";for(const U of j){if(!U.trim())continue;let W="message",H="";for(const x of U.split(`
|
|
136
|
-
`))x.startsWith("event: ")?W=x.slice(7):x.startsWith("data: ")&&(H=x.slice(6));if(H)try{const x=JSON.parse(H);if(W==="output")r(x);else if(W==="done")l=x.exitCode??0;else if(W==="error")throw new Error(x.message??"Stream error")}catch(x){if(x.message&&!x.message.includes("JSON"))throw x}}}}finally{u.releaseLock()}return{exitCode:l}}async ping(){var t;try{const s=`${this.normalizeUrl(this._config.url)}/api/qcli/versions`;return(await this.httpFetch(s)).ok}catch(r){return(t=this._logger)==null||t.debug(`Ping failed for "${this._config.name}": ${r}`),!1}}connectEventSocket(){var r;if(!this._backgroundServices){this.connectEventSocketDirect();return}const t=`server-events:${this._config.name}`;if(this._eventServiceRegistered&&this._backgroundServices.getStatus(t)){(this._backgroundServices.getStatus(t).status==="running"?this._backgroundServices.restart(t):this._backgroundServices.start(t)).catch(u=>{var d;(d=this._logger)==null||d.debug(`Background event service failed for "${this._config.name}", falling back to direct: ${u}`),this.connectEventSocketDirect()});return}try{this._backgroundServices.register({name:t,description:`Event stream for server '${this._config.name}'`,type:"daemon",onStart:async s=>{const o=await this.buildWebSocketUrl("/ws/v1/qcli/events");this._connected&&(s.log(`Connecting to ${o.split("?")[0]}`),this.closeEventSocketDirect(),this._eventSocket=new WebSocket(o),this._eventSocket.onopen=()=>{this._wsReconnectAttempts=0,this._wsReconnectTimer&&(clearTimeout(this._wsReconnectTimer),this._wsReconnectTimer=null)},this._eventSocket.onmessage=u=>{try{const d=JSON.parse(u.data);s.emit({source:t,type:d.type||"server-event",data:d}),d.type==="disconnect"&&this.handleServerDisconnect()}catch{}},this._eventSocket.onclose=u=>{if(this.isSessionEndedClose(u)){s.log("Event socket closed: session ended","info");return}this._connected&&(s.log("WebSocket closed unexpectedly, scheduling reconnect","warn"),this.scheduleWsReconnect())},this._eventSocket.onerror=()=>{s.log("WebSocket error","error")})},onStop:async()=>{this.closeEventSocketDirect()}}),this._eventServiceRegistered=!0,this._backgroundServices.start(t).catch(s=>{var o;(o=this._logger)==null||o.debug(`Background event service failed for "${this._config.name}", falling back to direct: ${s}`),this.connectEventSocketDirect()})}catch(s){(r=this._logger)==null||r.debug(`Failed to register event service for "${this._config.name}", falling back to direct: ${s}`),this.connectEventSocketDirect()}}connectEventSocketDirect(){this.connectEventSocketDirectAsync()}async connectEventSocketDirectAsync(){var t;try{const r=await this.buildWebSocketUrl("/ws/v1/qcli/events");if(!this._connected)return;this.closeEventSocketDirect(),this._eventSocket=new WebSocket(r),this._eventSocket.onopen=()=>{this._wsReconnectAttempts=0,this._wsReconnectTimer&&(clearTimeout(this._wsReconnectTimer),this._wsReconnectTimer=null)},this._eventSocket.onmessage=s=>{try{JSON.parse(s.data).type==="disconnect"&&this.handleServerDisconnect()}catch{}},this._eventSocket.onclose=s=>{this.isSessionEndedClose(s)||this._connected&&this.scheduleWsReconnect()},this._eventSocket.onerror=()=>{}}catch(r){(t=this._logger)==null||t.debug(`WebSocket not available for "${this._config.name}": ${r}`)}}isSessionEndedClose(t){return(t==null?void 0:t.code)!==4401?!1:(this.closeEventSocketDirect(),!0)}handleServerDisconnect(){var t;this._connected=!1,this._commands=[],this._capabilities=null,this.closeEventSocket(),(t=this.onDisconnect)==null||t.call(this)}closeEventSocket(){if(this._backgroundServices){const t=`server-events:${this._config.name}`,r=this._backgroundServices.getStatus(t);if(r&&r.status==="running"){this._backgroundServices.stop(t).catch(()=>{});return}}this.closeEventSocketDirect()}closeEventSocketDirect(){this._wsReconnectTimer&&(clearTimeout(this._wsReconnectTimer),this._wsReconnectTimer=null),this._eventSocket&&(this._eventSocket.onclose=null,this._eventSocket.onmessage=null,this._eventSocket.onerror=null,(this._eventSocket.readyState===WebSocket.OPEN||this._eventSocket.readyState===WebSocket.CONNECTING)&&this._eventSocket.close(),this._eventSocket=null)}scheduleWsReconnect(){var r;if(this._wsReconnectAttempts>=zt.WS_MAX_RECONNECT_ATTEMPTS){(r=this._logger)==null||r.warn(`WebSocket reconnect failed after ${this._wsReconnectAttempts} attempts for "${this._config.name}". Marking disconnected.`),this.handleServerDisconnect();return}this.closeEventSocketDirect();const t=Math.min(1e3*Math.pow(2,this._wsReconnectAttempts),zt.WS_MAX_RECONNECT_DELAY_MS);this._wsReconnectTimer=setTimeout(()=>{var s;this._wsReconnectAttempts++,(s=this._logger)==null||s.debug(`WebSocket reconnect attempt ${this._wsReconnectAttempts} for "${this._config.name}"...`),this.connectEventSocket()},t)}async httpFetchWithRetry(t,r,s=1){var o;try{return await this.httpFetch(t,r)}catch(u){if(s>0&&u.name!=="AbortError")return(o=this._logger)==null||o.debug(`Transient fetch error for "${this._config.name}", retrying in 1s: ${u.message}`),await new Promise(d=>setTimeout(d,1e3)),this.httpFetchWithRetry(t,r,s-1);throw u}}httpFetch(t,r){const s=this._config.timeout??3e4,o=new AbortController,u=setTimeout(()=>o.abort(),s),d={...this.resolveAuthHeaders(),...(r==null?void 0:r.headers)??{}};return fetch(t,{...r,headers:d,signal:o.signal}).finally(()=>clearTimeout(u))}normalizeUrl(t){return t.endsWith("/")?t.slice(0,-1):t}toWebSocketUrl(t){if(!t||t.startsWith("/")){const r=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",s=typeof location<"u"?location.host:"localhost";return`${r}//${s}`}return t.replace(/^https:/,"wss:").replace(/^http:/,"ws:")}},zt.WS_MAX_RECONNECT_ATTEMPTS=5,zt.WS_MAX_RECONNECT_DELAY_MS=3e4,zt.HEALTH_CHECK_INTERVAL_MS=3e4,zt.HEALTH_CHECK_MAX_ATTEMPTS=5,zt);function renderSingleOutput(e,t){switch(e.type){case"text":{const r=e.style;r==="success"?t.writer.writeSuccess(e.value):r==="error"?t.writer.writeError(e.value):r==="info"?t.writer.writeInfo(e.value):r==="warning"?t.writer.writeWarning(e.value):t.writer.writeln(e.value);break}case"table":t.writer.writeTable(e.headers,e.rows);break;case"list":t.writer.writeList(e.items,{ordered:e.ordered});break;case"json":t.writer.writeJson(e.value);break;case"key-value":{const r={};for(const s of e.entries)r[s.key]=s.value;t.writer.writeKeyValue(r);break}}}function renderServerResponse(e,t){for(const r of e.outputs??[])renderSingleOutput(r,t);e.exitCode!==0&&t.process.exit(e.exitCode)}async function executeOnServer(e,t,r,s,o,u){var l,f,C,h;if(!e.connected){o.writer.writeError(`Server '${t}' is not reachable. Run 'server reconnect ${t}' to retry.`),o.process.exit(1);return}const d={...s,command:u&&u.length>0?u[0]:r.command,chainCommands:u&&u.length>1?u.slice(1):[]},a=u&&u.length>0?u.join(" "):r.command;o.notifier.info(`executing command: ${a} on server ${t}`);try{if((l=e.capabilities)!=null&&l.streaming){const j=await e.executeStream(d,U=>renderSingleOutput(U,o));j.exitCode!==0&&o.process.exit(j.exitCode)}else{(f=o.spinner)==null||f.show("Executing on server...");const j=await e.execute(d);(C=o.spinner)==null||C.hide(),renderServerResponse(j,o)}}catch(j){(h=o.spinner)==null||h.hide(),j.name==="AbortError"?o.writer.writeError(`Request to server '${t}' timed out after ${e.config.timeout??3e4}ms.`):o.writer.writeError(`Error communicating with server '${t}': ${j.message}`),o.process.exit(1)}}var CliServerProxyProcessor=class cc{constructor(t,r,s,o=!1,u=[]){var d,a,l;this.connection=t,this.descriptor=r,this.serverName=s,this.commandPath=[...u,r.command],this.command=o?r.command:`${s}:${r.command}`,this.description=r.description,this.version=r.version,this.metadata={module:`server:${s}`,icon:"🖥",requireServer:!0},this.parameters=(d=r.parameters)==null?void 0:d.map(f=>({name:f.name,aliases:f.aliases,description:f.description,required:f.required,type:f.type,defaultValue:f.defaultValue})),this.processors=(a=r.processors)==null?void 0:a.map(f=>new cc(t,f,s,!0,this.commandPath)),this.acceptsRawInput=!((l=this.processors)!=null&&l.length)}async processCommand(t,r){return executeOnServer(this.connection,this.serverName,this.descriptor,t,r,this.commandPath)}},CliServerMultiProxyProcessor=class dc{constructor(t,r,s=[]){var u,d,a;this.entries=t,this.provider=r;const o=t[0].descriptor;this.commandPath=[...s,o.command],this.command=o.command,this.description=o.description,this.metadata={module:"server:multi",icon:"🖥",requireServer:!0},this.parameters=(u=o.parameters)==null?void 0:u.map(l=>({name:l.name,aliases:l.aliases,description:l.description,required:l.required,type:l.type,defaultValue:l.defaultValue})),this.processors=(d=o.processors)==null?void 0:d.map(l=>{const f=t.map(C=>{var j;const h=(j=C.descriptor.processors)==null?void 0:j.find(U=>U.command===l.command);return h?{serverName:C.serverName,connection:C.connection,descriptor:h}:null}).filter(C=>C!==null);return new dc(f,this.provider,this.commandPath)}),this.acceptsRawInput=!((a=this.processors)!=null&&a.length)}async processCommand(t,r){const s=this.provider.defaultServer;if(s){const a=this.entries.find(f=>f.serverName===s&&f.connection.connected);if(a)return executeOnServer(a.connection,a.serverName,a.descriptor,t,r,this.commandPath);const l=this.entries.find(f=>f.connection.connected);if(l)return r.writer.writeWarning(`Default server '${s}' is unreachable, falling back to '${l.serverName}'.`),executeOnServer(l.connection,l.serverName,l.descriptor,t,r,this.commandPath);r.writer.writeError("No servers are reachable for this command."),r.process.exit(1);return}const o=this.entries.filter(a=>a.connection.connected);if(o.length===0){r.writer.writeError("No servers are reachable for this command."),r.process.exit(1);return}if(o.length===1)return executeOnServer(o[0].connection,o[0].serverName,o[0].descriptor,t,r,this.commandPath);const u=await r.reader.readSelectInline(`'${this.command}' exists on multiple servers:`,o.map(a=>({label:a.serverName,value:a.serverName})));if(!u){r.writer.writeInfo("Command cancelled.");return}const d=o.find(a=>a.serverName===u);return executeOnServer(d.connection,d.serverName,d.descriptor,t,r,this.commandPath)}},CliServerManager_TOKEN="cli-server-manager",CliServerManager=class{constructor(e,t){this.registry=e,this.authService=t,this.connections=new Map,this._defaultServer=null,this._bareAliases=new Set}get defaultServer(){return this._defaultServer}preferredServer(){var e;if(this._defaultServer&&((e=this.connections.get(this._defaultServer))!=null&&e.connected))return this._defaultServer;for(const[t,r]of this.connections)if(r.connected)return t;return null}setDefaultServer(e){if(e!==null&&!this.connections.has(e))throw new Error(`Unknown server: ${e}`);this._defaultServer=e,this.unregisterBareAliases(),this.registerBareAliases()}async connectAll(e,t,r,s){this._logger=t,this._cliLogger=s,this._backgroundServices=r;for(const o of e){if(o.enabled===!1)continue;const u=new CliServerConnection(o,r,s,this.authService);this.connections.set(o.name,u),u.onDisconnect=()=>{this.handleDisconnect(o.name)},u.onReconnected=()=>{t==null||t.info(`Server '${o.name}' reconnected (${u.commands.length} commands, API v${u.apiVersion}).`),this.registerProxyProcessors(u,o.name),this.unregisterBareAliases(),this.registerBareAliases()},await u.connect(),u.connected?(t==null||t.info(`Connected to server '${o.name}' (${u.commands.length} commands)`),this.registerProxyProcessors(u,o.name)):t==null||t.warn(`Could not connect to server '${o.name}' at ${o.url}. Commands from this server will not be available.`)}this.registerBareAliases()}async reconnect(e){const t=this.connections.get(e);return t?(t.stopHealthCheck(),this.unregisterServerProcessors(e),t.onDisconnect=()=>{this.handleDisconnect(e)},t.onReconnected=()=>{var r;(r=this._logger)==null||r.info(`Server '${e}' reconnected (${t.commands.length} commands, API v${t.apiVersion}).`),this.registerProxyProcessors(t,e),this.unregisterBareAliases(),this.registerBareAliases()},await t.connect(),t.connected?(this.registerProxyProcessors(t,e),this.unregisterBareAliases(),this.registerBareAliases(),{success:!0,commandCount:t.commands.length}):{success:!1,commandCount:0}):{success:!1,commandCount:0}}getConnection(e){return this.connections.get(e)}handleDisconnect(e){var r;(r=this._logger)==null||r.warn(`Server '${e}' disconnected. Its commands are no longer available. Starting health check...`),this.unregisterServerProcessors(e);const t=this.connections.get(e);t&&t.startHealthCheck()}unregisterServerProcessors(e){const t=`${e}:`,r=this.registry.processors.filter(s=>s.command.startsWith(t));for(const s of r)this.registry.unregisterProcessor(s);this.unregisterBareAliases(),this.registerBareAliases()}unregisterBareAliases(){for(const e of this._bareAliases)this.registry.processors.includes(e)&&this.registry.unregisterProcessor(e);this._bareAliases.clear()}registerProxyProcessors(e,t){for(const r of e.commands){const s=new CliServerProxyProcessor(e,r,t);this.registry.registerProcessor(s)}}registerBareAliases(){const e=new Map;for(const[t,r]of this.connections)if(r.connected)for(const s of r.commands){const o=e.get(s.command)??[];o.push(t),e.set(s.command,o)}for(const[t,r]of e){const s=this.registry.findProcessor(t,[]);if(!(s&&!this._bareAliases.has(s)))if(r.length===1){const o=r[0],u=`${o}:${t}`;if(!this.registry.findProcessor(u,[]))continue;const a=this.connections.get(o),l=a.commands.find(C=>C.command===t),f=new CliServerProxyProcessor(a,l,o);f.command=t,f.aliases=[u],this.registry.registerProcessor(f),this._bareAliases.add(f)}else{const o=r.map(d=>{const a=this.connections.get(d),l=a.commands.find(f=>f.command===t);return{serverName:d,connection:a,descriptor:l}}),u=new CliServerMultiProxyProcessor(o,this);this.registry.registerProcessor(u),this._bareAliases.add(u)}}}},JsFallbackAccelerator=class{constructor(){this.ruleSets=new Map}textSearch(e,t,r,s,o,u){if(!t)return[-1,-1];const d=e.split(`
|
|
137
|
-
`),a=o?t:t.toLowerCase();for(let l=r;l<d.length;l++){const f=o?d[l]:d[l].toLowerCase(),C=l===r?s+1:0,h=f.indexOf(a,C);if(h!==-1)return[l,h]}if(!u)return[-1,-1];for(let l=0;l<=r;l++){const f=o?d[l]:d[l].toLowerCase(),C=l===r?s:f.length,h=f.indexOf(a);if(h!==-1&&h<C)return[l,h]}return[-1,-1]}textReplaceAll(e,t,r,s){if(!t)return{count:0,text:e};const o=e.split(`
|
|
138
|
-
`);let u=0;for(let d=0;d<o.length;d++){let a=o[d],l="",f=0;for(;f<=a.length;){const C=s?a:a.toLowerCase(),h=s?t:t.toLowerCase(),j=C.indexOf(h,f);if(j===-1){l+=a.slice(f);break}l+=a.slice(f,j)+r,f=j+t.length,u++}o[d]!==l&&(o[d]=l)}return{count:u,text:o.join(`
|
|
139
|
-
`)}}prefixMatch(e,t){const r=t.toLowerCase(),s=[];for(const o of e)o.toLowerCase().startsWith(r)&&s.push(o);return s.sort()}registerRuleSet(e,t){const r=[];for(const s of t.split(`
|
|
140
|
-
`)){if(!s)continue;const o=s.split(" ");if(!(o.length<2))try{r.push({pattern:new RegExp(o[0]),tokenType:o[1],captureGroup:o[2]?parseInt(o[2],10):0})}catch{}}this.ruleSets.set(e,r)}tokenizeLine(e,t){const r=this.ruleSets.get(t);if(!r||!e)return"";const s=[];let o=0;for(;o<e.length;){let u=!1;for(const d of r){d.pattern.lastIndex=0;const a=e.slice(o),l=d.pattern.exec(a);if(l){let f,C;if(d.captureGroup>0&&l[d.captureGroup]!==void 0){const h=l[d.captureGroup],j=l[0].indexOf(h);f=o+l.index+j,C=f+h.length}else f=o+l.index,C=o+l.index+l[0].length;if(o+l.index+l[0].length>o){s.push(`${f},${C},${d.tokenType}`),o=o+l.index+l[0].length,u=!0;break}}}u||o++}return s.join(`
|
|
141
|
-
`)}commonPrefix(e){if(e.length===0)return"";let t=e[0];for(let r=1;r<e.length;r++)for(;!e[r].startsWith(t);)if(t=t.slice(0,-1),t==="")return"";return t}},accelerator=null,initialized=!1,wasmLoaded=!1,WASM_SEARCH_PATHS=["/assets/wasm/qodalis_cli_wasm_bg.wasm","./assets/wasm/qodalis_cli_wasm_bg.wasm","/wasm/qodalis_cli_wasm_bg.wasm"];function wasmCandidates(e,t){const r=typeof document<"u"?document.baseURI:void 0;let s;try{s=r?new URL(r):void 0}catch{s=void 0}const o=d=>{if(!s)return d;try{return new URL(d,s).href}catch{return d}},u=[];return e&&u.push(o(e)),s&&u.push(o("assets/wasm/qodalis_cli_wasm_bg.wasm")),u.push(...WASM_SEARCH_PATHS.map(o)),[...new Set(u)]}var wasm,cachedDataViewMemory0=null,cachedInt32ArrayMemory0=null,cachedUint8ArrayMemory0=null,WASM_VECTOR_LEN=0,cachedTextDecoder=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});cachedTextDecoder.decode();var MAX_SAFARI_DECODE_BYTES=2146435072,numBytesDecoded=0,cachedTextEncoder=new TextEncoder;"encodeInto"in cachedTextEncoder||(cachedTextEncoder.encodeInto=function(e,t){const r=cachedTextEncoder.encode(e);return t.set(r),{read:e.length,written:r.length}});function getDataViewMemory0(){return(cachedDataViewMemory0===null||cachedDataViewMemory0.buffer.detached===!0||cachedDataViewMemory0.buffer.detached===void 0&&cachedDataViewMemory0.buffer!==wasm.memory.buffer)&&(cachedDataViewMemory0=new DataView(wasm.memory.buffer)),cachedDataViewMemory0}function getInt32ArrayMemory0(){return(cachedInt32ArrayMemory0===null||cachedInt32ArrayMemory0.byteLength===0)&&(cachedInt32ArrayMemory0=new Int32Array(wasm.memory.buffer)),cachedInt32ArrayMemory0}function getUint8ArrayMemory0(){return(cachedUint8ArrayMemory0===null||cachedUint8ArrayMemory0.byteLength===0)&&(cachedUint8ArrayMemory0=new Uint8Array(wasm.memory.buffer)),cachedUint8ArrayMemory0}function decodeText(e,t){return numBytesDecoded+=t,numBytesDecoded>=MAX_SAFARI_DECODE_BYTES&&(cachedTextDecoder=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),cachedTextDecoder.decode(),numBytesDecoded=t),cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(e,e+t))}function getStringFromWasm0(e,t){return e=e>>>0,decodeText(e,t)}function passStringToWasm0(e,t,r){if(r===void 0){const a=cachedTextEncoder.encode(e),l=t(a.length,1)>>>0;return getUint8ArrayMemory0().subarray(l,l+a.length).set(a),WASM_VECTOR_LEN=a.length,l}let s=e.length,o=t(s,1)>>>0;const u=getUint8ArrayMemory0();let d=0;for(;d<s;d++){const a=e.charCodeAt(d);if(a>127)break;u[o+d]=a}if(d!==s){d!==0&&(e=e.slice(d)),o=r(o,s,s=d+e.length*3,1)>>>0;const a=getUint8ArrayMemory0().subarray(o+d,o+s),l=cachedTextEncoder.encodeInto(e,a);d+=l.written,o=r(o,s,d,1)>>>0}return WASM_VECTOR_LEN=d,o}function getArrayI32FromWasm0(e,t){return e=e>>>0,getInt32ArrayMemory0().subarray(e/4,e/4+t)}function wasmTextSearch(e,t,r,s,o,u){try{const d=wasm.__wbindgen_add_to_stack_pointer(-16),a=passStringToWasm0(e,wasm.__wbindgen_export,wasm.__wbindgen_export2),l=WASM_VECTOR_LEN,f=passStringToWasm0(t,wasm.__wbindgen_export,wasm.__wbindgen_export2),C=WASM_VECTOR_LEN;wasm.text_search(d,a,l,f,C,r,s,o,u);const h=getDataViewMemory0().getInt32(d+0,!0),j=getDataViewMemory0().getInt32(d+4,!0),U=getArrayI32FromWasm0(h,j).slice();return wasm.__wbindgen_export3(h,j*4,4),U}finally{wasm.__wbindgen_add_to_stack_pointer(16)}}function wasmTextReplaceAll(e,t,r,s){let o,u;try{const d=wasm.__wbindgen_add_to_stack_pointer(-16),a=passStringToWasm0(e,wasm.__wbindgen_export,wasm.__wbindgen_export2),l=WASM_VECTOR_LEN,f=passStringToWasm0(t,wasm.__wbindgen_export,wasm.__wbindgen_export2),C=WASM_VECTOR_LEN,h=passStringToWasm0(r,wasm.__wbindgen_export,wasm.__wbindgen_export2),j=WASM_VECTOR_LEN;return wasm.text_replace_all(d,a,l,f,C,h,j,s),o=getDataViewMemory0().getInt32(d+0,!0),u=getDataViewMemory0().getInt32(d+4,!0),getStringFromWasm0(o,u)}finally{wasm.__wbindgen_add_to_stack_pointer(16),wasm.__wbindgen_export3(o,u,1)}}function wasmPrefixMatch(e,t){let r,s;try{const o=wasm.__wbindgen_add_to_stack_pointer(-16),u=passStringToWasm0(e,wasm.__wbindgen_export,wasm.__wbindgen_export2),d=WASM_VECTOR_LEN,a=passStringToWasm0(t,wasm.__wbindgen_export,wasm.__wbindgen_export2),l=WASM_VECTOR_LEN;return wasm.prefix_match(o,u,d,a,l),r=getDataViewMemory0().getInt32(o+0,!0),s=getDataViewMemory0().getInt32(o+4,!0),getStringFromWasm0(r,s)}finally{wasm.__wbindgen_add_to_stack_pointer(16),wasm.__wbindgen_export3(r,s,1)}}function wasmCommonPrefix(e){let t,r;try{const s=wasm.__wbindgen_add_to_stack_pointer(-16),o=passStringToWasm0(e,wasm.__wbindgen_export,wasm.__wbindgen_export2),u=WASM_VECTOR_LEN;return wasm.common_prefix(s,o,u),t=getDataViewMemory0().getInt32(s+0,!0),r=getDataViewMemory0().getInt32(s+4,!0),getStringFromWasm0(t,r)}finally{wasm.__wbindgen_add_to_stack_pointer(16),wasm.__wbindgen_export3(t,r,1)}}function wasmRegisterRuleSet(e,t){const r=passStringToWasm0(e,wasm.__wbindgen_export,wasm.__wbindgen_export2),s=WASM_VECTOR_LEN,o=passStringToWasm0(t,wasm.__wbindgen_export,wasm.__wbindgen_export2),u=WASM_VECTOR_LEN;wasm.register_rule_set(r,s,o,u)}function wasmTokenizeLine(e,t){let r,s;try{const o=wasm.__wbindgen_add_to_stack_pointer(-16),u=passStringToWasm0(e,wasm.__wbindgen_export,wasm.__wbindgen_export2),d=WASM_VECTOR_LEN,a=passStringToWasm0(t,wasm.__wbindgen_export,wasm.__wbindgen_export2),l=WASM_VECTOR_LEN;return wasm.tokenize_line(o,u,d,a,l),r=getDataViewMemory0().getInt32(o+0,!0),s=getDataViewMemory0().getInt32(o+4,!0),getStringFromWasm0(r,s)}finally{wasm.__wbindgen_add_to_stack_pointer(16),wasm.__wbindgen_export3(r,s,1)}}async function instantiateWasm(e){const t={__proto__:null,"./qodalis_cli_wasm_bg.js":{__proto__:null}},{instance:r}=await WebAssembly.instantiate(e,t);wasm=r.exports,cachedDataViewMemory0=null,cachedInt32ArrayMemory0=null,cachedUint8ArrayMemory0=null}async function fetchWasmBinary(e){for(const t of e)try{const r=await fetch(t);if(r.ok)return await r.arrayBuffer()}catch{}throw new Error("WASM binary not found")}function createWasmAccelerator(){return{textSearch(e,t,r,s,o,u){const d=wasmTextSearch(e,t,r,s,o,u);return[d[0],d[1]]},textReplaceAll(e,t,r,s){const o=wasmTextReplaceAll(e,t,r,s),u=o.indexOf(`
|
|
142
|
-
`);return{count:parseInt(o.slice(0,u),10),text:o.slice(u+1)}},prefixMatch(e,t){const r=wasmPrefixMatch(e.join(`
|
|
143
|
-
`),t);return r===""?[]:r.split(`
|
|
144
|
-
`)},commonPrefix(e){return wasmCommonPrefix(e.join(`
|
|
145
|
-
`))},registerRuleSet(e,t){wasmRegisterRuleSet(e,t)},tokenizeLine(e,t){return wasmTokenizeLine(e,t)}}}async function initWasmAccelerator(e){if(initialized&&accelerator)return accelerator;try{const t=wasmCandidates(e),r=await fetchWasmBinary(t);await instantiateWasm(r),accelerator=createWasmAccelerator(),wasmLoaded=!0}catch{accelerator=new JsFallbackAccelerator}return initialized=!0,accelerator}function getAccelerator(){return accelerator||(accelerator=new JsFallbackAccelerator),accelerator}function isWasmAccelerated(){return wasmLoaded}var CliDebugCommandProcessor=class{constructor(){this.command="debug",this.description="Displays detailed system diagnostics and CLI internals",this.author=DefaultLibraryAuthor,this.metadata={sealed:!0,icon:CliIcon.Bug,module:"system",hidden:!0},this.processors=[{command:"processors",description:"List all registered command processors",metadata:{icon:CliIcon.Extension,module:"system"},processCommand:async(e,t)=>{var u,d,a,l,f,C,h;const{writer:r}=t,s=t.services.getRequired(CliProcessorsRegistry_TOKEN);r.writeln(r.wrapInColor("Registered Processors:",CliForegroundColor.Yellow)),r.writeln();const o=[];for(const j of s.processors){const U=this.countProcessors(j.processors||[]);o.push([j.command,((u=j.aliases)==null?void 0:u.join(", "))||"-",j.version||"-",((d=j.metadata)==null?void 0:d.module)||"uncategorized",(a=j.metadata)!=null&&a.sealed?"yes":"no",(l=j.metadata)!=null&&l.hidden?"yes":"no",String(U),((C=(f=j.originalProcessor)==null?void 0:f.metadata)==null?void 0:C.module)||"-",((h=j.author)==null?void 0:h.name)||"-"])}r.writeTable(["Command","Aliases","Version","Module","Sealed","Hidden","Children","Extends","Author"],o),r.writeln(),r.writeln(`Total: ${r.wrapInColor(String(s.processors.length),CliForegroundColor.Cyan)} root processors`)}},{command:"modules",description:"List all loaded CLI modules",metadata:{icon:CliIcon.Module,module:"system"},processCommand:async(e,t)=>{const{writer:r}=t,s=t.services.get(CliModuleRegistry_TOKEN);if(!s){r.writeError("Module registry not available.");return}const o=s.getAll();r.writeln(r.wrapInColor("Loaded Modules:",CliForegroundColor.Yellow)),r.writeln();const u=o.map(d=>{var a,l;return[d.name,d.version||"-",d.description||"-",String(((a=d.processors)==null?void 0:a.length)||0),((l=d.dependencies)==null?void 0:l.join(", "))||"-"]});r.writeTable(["Name","Version","Description","Processors","Dependencies"],u),r.writeln(),r.writeln(`Total: ${r.wrapInColor(String(o.length),CliForegroundColor.Cyan)} modules`)}},{command:"state",description:"Inspect all state stores and their values",metadata:{icon:CliIcon.Database,module:"system"},processCommand:async(e,t)=>{const{writer:r}=t,o=t.services.getRequired(CliStateStoreManager_TOKEN).getStoreEntries();if(r.writeln(r.wrapInColor("State Stores:",CliForegroundColor.Yellow)),r.writeln(),o.length===0)r.writeln(" No state stores initialized yet.");else for(const u of o)r.writeln(` ${r.wrapInColor(u.name,CliForegroundColor.Cyan)}:`),r.writeJson(u.state),r.writeln();r.writeln(`Total: ${r.wrapInColor(String(o.length),CliForegroundColor.Cyan)} stores`)}},{command:"services",description:"List all registered services in the DI container",metadata:{icon:CliIcon.Gear,module:"system"},processCommand:async(e,t)=>{const{writer:r}=t,s=t.services;if(!s.getRegisteredServiceDetails){r.writeError("Service introspection not available.");return}const o=s.getRegisteredServiceDetails();r.writeln(r.wrapInColor("Registered Services:",CliForegroundColor.Yellow)),r.writeln(),r.writeTable(["Token","Type","Multi"],o.map(u=>[u.token,u.type,u.multi?"yes":"no"])),r.writeln(),r.writeln(`Total: ${r.wrapInColor(String(o.length),CliForegroundColor.Cyan)} services`)}},{command:"environment",description:"Show browser, terminal, and framework information",metadata:{icon:CliIcon.Network,module:"system"},processCommand:async(e,t)=>{var o;const{writer:r}=t;r.writeln(r.wrapInColor("Environment:",CliForegroundColor.Yellow)),r.writeln(),r.writeln(` ${r.wrapInColor("Core Version:",CliForegroundColor.Cyan)} ${LIBRARY_VERSION$1}`),r.writeln(` ${r.wrapInColor("CLI Version:",CliForegroundColor.Cyan)} ${LIBRARY_VERSION}`);const s=t.services.get("cli-framework")??"vanilla";r.writeln(` ${r.wrapInColor("Framework:",CliForegroundColor.Cyan)} ${s}`),r.writeln(` ${r.wrapInColor("Terminal Cols:",CliForegroundColor.Cyan)} ${t.terminal.cols}`),r.writeln(` ${r.wrapInColor("Terminal Rows:",CliForegroundColor.Cyan)} ${t.terminal.rows}`),r.writeln(` ${r.wrapInColor("Log Level:",CliForegroundColor.Cyan)} ${((o=t.options)==null?void 0:o.logLevel)??"default"}`),r.writeln(),typeof navigator<"u"?(r.writeln(` ${r.wrapInColor("User Agent:",CliForegroundColor.Cyan)} ${navigator.userAgent}`),r.writeln(` ${r.wrapInColor("Language:",CliForegroundColor.Cyan)} ${navigator.language}`),r.writeln(` ${r.wrapInColor("Platform:",CliForegroundColor.Cyan)} ${navigator.platform}`),r.writeln(` ${r.wrapInColor("Online:",CliForegroundColor.Cyan)} ${navigator.onLine}`),r.writeln(` ${r.wrapInColor("Cookies Enabled:",CliForegroundColor.Cyan)} ${navigator.cookieEnabled}`)):r.writeln(" Browser information not available.")}},{command:"history",description:"Show command history statistics",metadata:{icon:CliIcon.Logs,module:"system"},processCommand:async(e,t)=>{const{writer:r}=t,o=t.services.getRequired(CliCommandHistory_TOKEN).getHistory(),u=o.length;if(r.writeln(r.wrapInColor("Command History Stats:",CliForegroundColor.Yellow)),r.writeln(),r.writeln(` ${r.wrapInColor("Total Commands:",CliForegroundColor.Cyan)} ${u}`),u>0){const d=new Set(o.map(h=>h.split(" ")[0]));r.writeln(` ${r.wrapInColor("Unique Commands:",CliForegroundColor.Cyan)} ${d.size}`);const a=new Map;for(const h of o){const j=h.split(" ")[0];a.set(j,(a.get(j)||0)+1)}const f=Array.from(a.entries()).sort((h,j)=>j[1]-h[1]).slice(0,10);r.writeln(),r.writeln(r.wrapInColor(" Most Used:",CliForegroundColor.Yellow)),r.writeTable(["Command","Count"],f.map(([h,j])=>[h,String(j)])),r.writeln(),r.writeln(r.wrapInColor(" Recent Commands:",CliForegroundColor.Yellow));const C=o.slice(-10);for(let h=C.length-1;h>=0;h--)r.writeln(` ${r.wrapInColor(String(o.length-(C.length-1-h)),CliForegroundColor.Green)} ${C[h]}`)}}},{command:"health",description:"Check system health: storage, connectivity, processor status",metadata:{icon:CliIcon.Heart,module:"system"},processCommand:async(e,t)=>{const{writer:r}=t;r.writeln(r.wrapInColor("Health Check:",CliForegroundColor.Yellow)),r.writeln();const s=typeof indexedDB<"u";r.writeln(` ${s?CliIcon.CheckIcon:CliIcon.CrossIcon} IndexedDB: ${s?"available":"unavailable"}`);let o=!1;try{localStorage.setItem("__cli_health_test","1"),localStorage.removeItem("__cli_health_test"),o=!0}catch{}r.writeln(` ${o?CliIcon.CheckIcon:CliIcon.CrossIcon} localStorage: ${o?"available":"unavailable"}`);const u=typeof navigator<"u"?navigator.onLine:!1;r.writeln(` ${u?CliIcon.CheckIcon:CliIcon.CrossIcon} Network: ${u?"online":"offline"}`);const d=t.services.getRequired(CliProcessorsRegistry_TOKEN);r.writeln(` ${CliIcon.CheckIcon} Processors: ${d.processors.length} loaded`);try{const C=t.services.getRequired(CliModuleRegistry_TOKEN).getAll();r.writeln(` ${CliIcon.CheckIcon} Modules: ${C.length} loaded`)}catch{r.writeln(` ${CliIcon.WarningIcon} Modules: registry not available`)}const a=isWasmAccelerated();r.writeln(` ${a?CliIcon.CheckIcon:CliIcon.WarningIcon} WASM Accelerator: ${a?"loaded":"using JS fallback"}`);const l=t.services.getRequired(CliCommandHistory_TOKEN);r.writeln(` ${CliIcon.CheckIcon} History: ${l.getHistory().length} commands stored`)}},{command:"export",description:"Export all debug info as JSON",metadata:{icon:CliIcon.Save,module:"system"},processCommand:async(e,t)=>{const{writer:r}=t,s=t.services.getRequired(CliProcessorsRegistry_TOKEN),o=t.services.getRequired(CliCommandHistory_TOKEN),u=t.services.getRequired(CliStateStoreManager_TOKEN),d={versions:{core:LIBRARY_VERSION$1,cli:LIBRARY_VERSION},wasmAccelerated:isWasmAccelerated(),environment:{userAgent:typeof navigator<"u"?navigator.userAgent:"N/A",language:typeof navigator<"u"?navigator.language:"N/A",platform:typeof navigator<"u"?navigator.platform:"N/A",online:typeof navigator<"u"?navigator.onLine:!1,terminalCols:t.terminal.cols,terminalRows:t.terminal.rows},processors:s.processors.map(l=>{var f,C,h,j,U;return{command:l.command,aliases:l.aliases||[],version:l.version||null,module:((f=l.metadata)==null?void 0:f.module)||"uncategorized",sealed:((C=l.metadata)==null?void 0:C.sealed)||!1,hidden:((h=l.metadata)==null?void 0:h.hidden)||!1,children:this.countProcessors(l.processors||[]),extends:((U=(j=l.originalProcessor)==null?void 0:j.metadata)==null?void 0:U.module)||null}}),history:{total:o.getHistory().length},state:u.getStoreEntries()};try{const l=t.services.getRequired(CliModuleRegistry_TOKEN);d.modules=l.getAll().map(f=>{var C;return{name:f.name,version:f.version||null,description:f.description||null,processors:((C=f.processors)==null?void 0:C.length)||0,dependencies:f.dependencies||[]}})}catch{d.modules="registry not available"}const a=t.services;a.getRegisteredTokens&&(d.services=a.getRegisteredTokens());try{const l=t.services.getRequired(CliServerManager_TOKEN);l&&l.connections.size>0&&(d.servers=Array.from(l.connections.entries()).map(([f,C])=>({name:f,url:C.config.url,connected:C.connected,commands:C.connected?C.commands.length:0})))}catch{}r.writeJson(d)}},{command:"servers",description:"List configured servers and their connection status",metadata:{icon:CliIcon.Server,module:"system"},processCommand:async(e,t)=>{const{writer:r}=t,s=t.services.get(CliServerManager_TOKEN);if(!s||s.connections.size===0){r.writeInfo("No servers configured.");return}r.writeln(r.wrapInColor("Configured Servers:",CliForegroundColor.Yellow)),r.writeln();const o=[];for(const[a,l]of s.connections)o.push([a,l.config.url,l.connected?"Connected":"Disconnected",l.connected?String(l.commands.length):"-",l.config.timeout?`${l.config.timeout}ms`:"default"]);r.writeTable(["Name","URL","Status","Commands","Timeout"],o),r.writeln();const u=Array.from(s.connections.values()).filter(a=>a.connected).length,d=s.connections.size;r.writeln(`Total: ${r.wrapInColor(String(d),CliForegroundColor.Cyan)} servers (${r.wrapInColor(String(u),CliForegroundColor.Green)} connected)`)}}]}async processCommand(e,t){const{writer:r}=t,s=t.services.getRequired(CliProcessorsRegistry_TOKEN),o=t.services.get("cli-framework")??"vanilla",u=t.services.get(CliModuleRegistry_TOKEN),d=t.services.get(CliServerManager_TOKEN),a=t.services.getRequired(CliCommandHistory_TOKEN),l=isWasmAccelerated()?"active":"inactive (JS fallback)",f=[`${r.wrapInColor("Core Version:",CliForegroundColor.Cyan)} ${LIBRARY_VERSION$1}`,`${r.wrapInColor("CLI Version:",CliForegroundColor.Cyan)} ${LIBRARY_VERSION}`,`${r.wrapInColor("Framework:",CliForegroundColor.Cyan)} ${o}`,`${r.wrapInColor("Terminal:",CliForegroundColor.Cyan)} ${t.terminal.cols}x${t.terminal.rows}`,`${r.wrapInColor("Processors:",CliForegroundColor.Cyan)} ${s.processors.length}`];if(u&&f.push(`${r.wrapInColor("Modules:",CliForegroundColor.Cyan)} ${u.getAll().length}`),d&&d.connections.size>0){const C=Array.from(d.connections.values()).filter(h=>h.connected).length;f.push(`${r.wrapInColor("Servers:",CliForegroundColor.Cyan)} ${C}/${d.connections.size} connected`)}f.push(`${r.wrapInColor("History:",CliForegroundColor.Cyan)} ${a.getHistory().length} commands`,`${r.wrapInColor("WASM Accelerator:",CliForegroundColor.Cyan)} ${l}`),r.writeBox(f,{title:"CLI Debug Info",borderColor:CliForegroundColor.Yellow}),r.writeln(),r.writeln(`${CliIcon.Light} Subcommands:`);for(const C of this.processors||[])r.writeln(` ${r.wrapInColor(`debug ${C.command}`,CliForegroundColor.Cyan)} ${C.description}`)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.debug.long_description","Displays detailed system diagnostics and CLI internals.")),t.writeln(r.t("cli.debug.hidden_note","This command is hidden from the help listing but accessible directly.")),t.writeln(),t.writeln(r.t("cli.common.usage","Usage:")),t.writeln(` ${t.wrapInColor("debug",CliForegroundColor.Cyan)} ${r.t("cli.debug.summary","System summary")}`),t.writeln(` ${t.wrapInColor("debug processors",CliForegroundColor.Cyan)} ${r.t("cli.debug.processors","All registered processors")}`),t.writeln(` ${t.wrapInColor("debug modules",CliForegroundColor.Cyan)} ${r.t("cli.debug.modules","All loaded modules")}`),t.writeln(` ${t.wrapInColor("debug state",CliForegroundColor.Cyan)} ${r.t("cli.debug.state","Inspect state stores")}`),t.writeln(` ${t.wrapInColor("debug services",CliForegroundColor.Cyan)} List DI services`),t.writeln(` ${t.wrapInColor("debug environment",CliForegroundColor.Cyan)} Browser/terminal info`),t.writeln(` ${t.wrapInColor("debug history",CliForegroundColor.Cyan)} Command history stats`),t.writeln(` ${t.wrapInColor("debug health",CliForegroundColor.Cyan)} System health check`),t.writeln(` ${t.wrapInColor("debug export",CliForegroundColor.Cyan)} Export all as JSON`),t.writeln(` ${t.wrapInColor("debug servers",CliForegroundColor.Cyan)} Server connections`)}countProcessors(e){let t=e.length;for(const r of e)r.processors&&(t+=this.countProcessors(r.processors));return t}},NanoEditorBuffer=class{constructor(){this.lines=[""],this.cursorRow=0,this.cursorCol=0,this.scrollOffset=0,this.dirty=!1,this.clipboard=[]}load(e){this.lines=e.split(`
|
|
146
|
-
`),this.lines.length===0&&(this.lines=[""]),this.cursorRow=0,this.cursorCol=0,this.scrollOffset=0,this.dirty=!1}getContent(){return this.lines.join(`
|
|
147
|
-
`)}insertChar(e){const t=this.lines[this.cursorRow];this.lines[this.cursorRow]=t.slice(0,this.cursorCol)+e+t.slice(this.cursorCol),this.cursorCol+=e.length,this.dirty=!0}insertNewline(){const e=this.lines[this.cursorRow],t=e.slice(0,this.cursorCol),r=e.slice(this.cursorCol);this.lines[this.cursorRow]=t,this.lines.splice(this.cursorRow+1,0,r),this.cursorRow++,this.cursorCol=0,this.dirty=!0}deleteCharBefore(){if(this.cursorCol>0){const e=this.lines[this.cursorRow];this.lines[this.cursorRow]=e.slice(0,this.cursorCol-1)+e.slice(this.cursorCol),this.cursorCol--,this.dirty=!0}else if(this.cursorRow>0){const e=this.lines[this.cursorRow-1],t=this.lines[this.cursorRow];this.cursorCol=e.length,this.lines[this.cursorRow-1]=e+t,this.lines.splice(this.cursorRow,1),this.cursorRow--,this.dirty=!0}}deleteCharAt(){const e=this.lines[this.cursorRow];this.cursorCol<e.length?(this.lines[this.cursorRow]=e.slice(0,this.cursorCol)+e.slice(this.cursorCol+1),this.dirty=!0):this.cursorRow<this.lines.length-1&&(this.lines[this.cursorRow]=e+this.lines[this.cursorRow+1],this.lines.splice(this.cursorRow+1,1),this.dirty=!0)}deleteLine(){const e=this.lines[this.cursorRow];this.clipboard.push(e),this.lines.length===1?(this.lines[0]="",this.cursorCol=0):(this.lines.splice(this.cursorRow,1),this.cursorRow>=this.lines.length&&(this.cursorRow=this.lines.length-1),this.cursorCol=Math.min(this.cursorCol,this.lines[this.cursorRow].length)),this.dirty=!0}uncutLines(){return this.clipboard.length===0?!1:(this.lines.splice(this.cursorRow,0,...this.clipboard),this.cursorRow+=this.clipboard.length,this.cursorCol=Math.min(this.cursorCol,this.lines[this.cursorRow].length),this.clipboard=[],this.dirty=!0,!0)}moveUp(){this.cursorRow>0&&(this.cursorRow--,this.cursorCol=Math.min(this.cursorCol,this.lines[this.cursorRow].length))}moveDown(){this.cursorRow<this.lines.length-1&&(this.cursorRow++,this.cursorCol=Math.min(this.cursorCol,this.lines[this.cursorRow].length))}moveLeft(){this.cursorCol>0?this.cursorCol--:this.cursorRow>0&&(this.cursorRow--,this.cursorCol=this.lines[this.cursorRow].length)}moveRight(){this.cursorCol<this.lines[this.cursorRow].length?this.cursorCol++:this.cursorRow<this.lines.length-1&&(this.cursorRow++,this.cursorCol=0)}moveHome(){this.cursorCol=0}moveEnd(){this.cursorCol=this.lines[this.cursorRow].length}pageUp(e){this.cursorRow=Math.max(0,this.cursorRow-e),this.cursorCol=Math.min(this.cursorCol,this.lines[this.cursorRow].length)}pageDown(e){this.cursorRow=Math.min(this.lines.length-1,this.cursorRow+e),this.cursorCol=Math.min(this.cursorCol,this.lines[this.cursorRow].length)}moveToStart(){this.cursorRow=0,this.cursorCol=0}moveToEnd(){this.cursorRow=this.lines.length-1,this.cursorCol=this.lines[this.cursorRow].length}searchForward(e,t=!1){if(!e)return!1;const r=getAccelerator(),s=this.lines.join(`
|
|
148
|
-
`),[o,u]=r.textSearch(s,e,this.cursorRow,this.cursorCol,t,!0);return o===-1?!1:(this.cursorRow=o,this.cursorCol=u,!0)}replaceNext(e,t,r=!1){if(!e)return!1;const s=this.lines[this.cursorRow],o=r?e:e.toLowerCase();return(r?s:s.toLowerCase()).startsWith(o,this.cursorCol)?(this.lines[this.cursorRow]=s.slice(0,this.cursorCol)+t+s.slice(this.cursorCol+e.length),this.cursorCol+=t.length,this.dirty=!0,!0):!1}replaceAll(e,t,r=!1){if(!e)return 0;const s=getAccelerator(),o=this.lines.join(`
|
|
149
|
-
`),u=s.textReplaceAll(o,e,t,r);return u.count>0&&(this.lines=u.text.split(`
|
|
150
|
-
`),this.dirty=!0),u.count}ensureVisible(e){this.cursorRow<this.scrollOffset?this.scrollOffset=this.cursorRow:this.cursorRow>=this.scrollOffset+e&&(this.scrollOffset=this.cursorRow-e+1)}},NanoEditorRenderer=class{constructor(e){this.terminal=e}enterAlternateScreen(){this.terminal.write("\x1B[?1049h"),this.terminal.write("\x1B[?25l")}leaveAlternateScreen(){this.terminal.write("\x1B[?25h"),this.terminal.write("\x1B[?1049l")}get contentHeight(){return this.terminal.rows-3}render(e,t,r){const{rows:s,cols:o}=this.terminal;e.ensureVisible(this.contentHeight);let u="\x1B[?25l";u+="\x1B[H",u+=this.renderTitleBar(t,e.dirty,o);for(let l=0;l<this.contentHeight;l++){const f=e.scrollOffset+l;if(u+=`\x1B[${l+2};1H`,u+="\x1B[2K",f<e.lines.length){const C=e.lines[f];this.highlightEngine?u+=this.highlightEngine.renderLine(f,C,o):u+=C.length>o?C.slice(0,o):C}}u+=`\x1B[${s-1};1H`,u+=this.renderShortcutBar(o),u+=`\x1B[${s};1H`,u+=this.renderStatusBar(r,o);const d=e.cursorRow-e.scrollOffset+2,a=e.cursorCol+1;u+=`\x1B[${d};${a}H`,u+="\x1B[?25h",this.terminal.write(u)}renderStatusOnly(e,t){const{rows:r,cols:s}=this.terminal;let o=`\x1B[${r};1H`;o+=this.renderStatusBar(t,s);const u=e.cursorRow-e.scrollOffset+2,d=e.cursorCol+1;o+=`\x1B[${u};${d}H`,this.terminal.write(o)}renderHelp(){const{rows:e,cols:t}=this.terminal,r=[""," CLI Nano Help",""," Main shortcuts:",""," ^G Help ^O Write Out ^F Search ^K Cut Line"," ^X Exit ^R Read File ^\\ Replace ^U Paste Line",""," Navigation:",""," ^A Home ^E End ^Y Page Up ^V Page Down"," ^P Prev Line ^N Next Line Arrow Keys ^B Backward",""," Other:",""," ^C Cur Pos ^S Save (alt) ^J Justify ^T To Spell",""," Arrow keys, Home, End, Page Up, Page Down also work.","",""," [ Press any key to return ]"];let s="\x1B[?25l\x1B[H";s+=`\x1B[7m${" CLI Nano Help".padEnd(t)}\x1B[0m`;for(let u=0;u<e-2;u++)s+=`\x1B[${u+2};1H\x1B[2K`,u<r.length&&(s+=r[u].slice(0,t));s+=`\x1B[${e};1H`,s+=`\x1B[7m${" [ Press any key to return ]".padEnd(t)}\x1B[0m`,this.terminal.write(s)}renderTitleBar(e,t,r){return`\x1B[7m${` CLI Nano ${e||"New Buffer"}${t?" (modified)":""}`.padEnd(r)}\x1B[0m`}renderShortcutBar(e){return`\x1B[7m${"^G Help ^O Write Out ^F Search ^K Cut ^C Cur Pos".padEnd(e)}\x1B[0m`}renderStatusBar(e,t){return`\x1B[7m${(e||"^X Exit ^R Read File ^\\ Replace ^U Paste ^S Save").padEnd(t)}\x1B[0m`}};function truncateAnsi(e,t){let r=0,s=0,o="",u=!1;for(;s<e.length&&r<t;)if(e[s]==="\x1B"&&s+1<e.length&&e[s+1]==="["){let d=s+2;for(;d<e.length&&!(e.charCodeAt(d)>=64&&e.charCodeAt(d)<=126);)d++;if(d<e.length){const a=e.slice(s,d+1);o+=a,a==="\x1B[0m"?u=!1:u=!0,s=d+1}else break}else o+=e[s],r++,s++;return u&&(o+="\x1B[0m"),o}function parseTokens(e){return e?e.split(`
|
|
151
|
-
`).map(t=>{const[r,s,...o]=t.split(",");return{start:parseInt(r,10),end:parseInt(s,10),tokenType:o.join(",")}}):[]}var SyntaxHighlightEngine=class{constructor(e,t,r){this.highlighter=e,this.theme=t,this.accelerator=r,this.cache=new Map,this.registeredRuleSets=new Set}invalidate(e){for(const t of this.cache.keys())t>=e&&this.cache.delete(t)}renderLine(e,t,r){var u;const s=e===0?this.highlighter.initialState:((u=this.cache.get(e-1))==null?void 0:u.exitState)??this.highlighter.initialState,o=this.cache.get(e);if(o&&o.lineContent===t&&o.entryState===s)return truncateAnsi(o.rendered,r);try{const d=`${this.highlighter.id}:${s}`;if(!this.registeredRuleSets.has(d)){const j=this.highlighter.getRules(s).map(U=>`${U.pattern.source} ${U.tokenType} ${U.captureGroup??0}`).join(`
|
|
152
|
-
`);this.accelerator.registerRuleSet(d,j),this.registeredRuleSets.add(d)}const a=this.accelerator.tokenizeLine(t,d),l=parseTokens(a),f=this.highlighter.getNextLineState(t,s),C=this.applyTheme(t,l);return this.cache.set(e,{lineContent:t,entryState:s,exitState:f,rendered:C}),truncateAnsi(C,r)}catch{return t.length>r?t.slice(0,r):t}}applyTheme(e,t){if(t.length===0)return e;let r="",s=0;for(const o of t){o.start>s&&(r+=e.slice(s,o.start));const u=this.theme.colors[o.tokenType],d=e.slice(o.start,o.end);u?r+=u+d+"\x1B[0m":r+=d,s=o.end}return s<e.length&&(r+=e.slice(s)),r}},defaultSyntaxTheme={name:"default",colors:{keyword:"\x1B[93m",string:"\x1B[32m",number:"\x1B[36m",comment:"\x1B[90m",tag:"\x1B[91m",attribute:"\x1B[33m",value:"\x1B[36m",punctuation:"\x1B[97m",heading:"\x1B[1;93m",link:"\x1B[4;36m",bold:"\x1B[1m",italic:"\x1B[3m",code:"\x1B[90;47m"}},FS_TOKEN="cli-file-system-service",CliNanoCommandProcessor=class{constructor(){this.command="nano",this.aliases=["edit"],this.description="Open the built-in text editor",this.author=DefaultLibraryAuthor,this.acceptsRawInput=!0,this.metadata={icon:"📝",module:"system"},this.filePath=null,this.fs=null,this.resizeDisposable=null,this.statusTimeout=null,this.inputMode="normal",this.inputBuffer="",this.searchNeedle="",this.replaceWith="",this.replaceAllMode=!1}async processCommand(e,t){this.context=t,this.buffer=new NanoEditorBuffer,this.renderer=new NanoEditorRenderer(t.terminal),this.inputMode="normal",this.inputBuffer="",this.searchNeedle="",this.replaceWith="",this.statusMessage=void 0;try{this.fs=t.services.getRequired(FS_TOKEN)}catch{this.fs=null}const r=(e.value||"").trim();if(r){if(this.filePath=r,this.fs)try{const s=this.fs.resolvePath(this.filePath);if(this.fs.exists(s)&&!this.fs.isDirectory(s)){const o=this.fs.readFile(s);o!==null&&this.buffer.load(o),this.filePath=s}else if(this.fs.exists(s)&&this.fs.isDirectory(s)){t.writer.writeError(`${this.filePath} is a directory`);return}else this.filePath=s}catch(s){t.writer.writeError(s.message||"Error opening file");return}}else this.filePath=null;this.setupHighlighting(this.filePath),t.enterFullScreenMode(this),this.renderer.render(this.buffer,this.filePath||"New Buffer"),this.resizeDisposable=t.terminal.onResize(()=>{this.inputMode==="help"?this.renderer.renderHelp():this.renderer.render(this.buffer,this.filePath||"New Buffer",this.statusMessage)})}async onData(e,t){var r,s,o,u;switch(this.inputMode){case"help":this.inputMode="normal",this.render();return;case"filename":this.handleTextPrompt(e,d=>{d?(this.filePath=this.fs.resolvePath(d),this.save()):this.showStatus("Cancelled")});return;case"search":this.handleTextPrompt(e,d=>{d?(this.searchNeedle=d,this.buffer.searchForward(this.searchNeedle)?this.render():this.showStatus(`"${this.searchNeedle}" not found`)):this.showStatus("Cancelled")});return;case"replace-needle":this.handleTextPrompt(e,d=>{d?(this.searchNeedle=d,this.inputMode="replace-with",this.inputBuffer=this.replaceWith,this.renderPrompt(`Replace with: ${this.inputBuffer}`)):this.showStatus("Cancelled")});return;case"replace-with":this.handleTextPrompt(e,d=>{if(this.replaceWith=d??"",this.replaceAllMode){const a=this.buffer.replaceAll(this.searchNeedle,this.replaceWith);this.showStatus(a>0?`Replaced ${a} occurrence${a>1?"s":""}`:`"${this.searchNeedle}" not found`)}else this.buffer.searchForward(this.searchNeedle)?(this.inputMode="replace-confirm",this.render(),this.renderPrompt("Replace this instance? [Y]es/[N]o/[A]ll/[C]ancel")):this.showStatus(`"${this.searchNeedle}" not found`)});return;case"replace-confirm":this.handleReplaceConfirm(e);return;case"exit-save-prompt":this.handleExitSavePrompt(e);return;case"read-file":this.handleTextPrompt(e,d=>{d?this.readFileIntoBuffer(d):this.showStatus("Cancelled")});return}if(e===""){this.exitEditor();return}if(e===""){await this.writeOut();return}if(e===""){await this.save();return}if(e==="\x07"){this.inputMode="help",this.renderer.renderHelp();return}if(e===""||e===""){this.inputMode="search",this.inputBuffer=this.searchNeedle,this.renderPrompt(`Search: ${this.inputBuffer}`);return}if(e===""){this.replaceAllMode=!1,this.inputMode="replace-needle",this.inputBuffer=this.searchNeedle,this.renderPrompt(`Search (to replace): ${this.inputBuffer}`);return}if(e==="\v"){this.buffer.deleteLine(),(r=this.renderer.highlightEngine)==null||r.invalidate(this.buffer.cursorRow),this.render();return}if(e===""){this.buffer.uncutLines()?((s=this.renderer.highlightEngine)==null||s.invalidate(this.buffer.cursorRow),this.render()):this.showStatus("Clipboard is empty");return}if(e===""){const d=this.buffer.cursorRow+1,a=this.buffer.cursorCol+1,l=this.buffer.lines.length;this.showStatus(`line ${d}/${l}, col ${a}`);return}if(e===""){if(!this.fs){this.showStatus("No filesystem available");return}this.inputMode="read-file",this.inputBuffer="",this.renderPrompt("File to insert: ");return}if(e===""){this.buffer.moveHome(),this.render();return}if(e===""){this.buffer.moveEnd(),this.render();return}if(e===""){this.buffer.moveUp(),this.render();return}if(e===""){this.buffer.moveDown(),this.render();return}if(e===""){this.buffer.moveLeft(),this.render();return}if(e===""){this.buffer.pageUp(this.renderer.contentHeight),this.render();return}if(e===""){this.buffer.pageDown(this.renderer.contentHeight),this.render();return}if(e==="\r"){this.buffer.insertNewline(),(o=this.renderer.highlightEngine)==null||o.invalidate(this.buffer.cursorRow-1),this.render();return}if(e===""){const d=this.buffer.cursorCol===0&&this.buffer.cursorRow>0;this.buffer.deleteCharBefore(),d&&((u=this.renderer.highlightEngine)==null||u.invalidate(this.buffer.cursorRow)),this.render();return}if(e==="\x1B[3~"){this.buffer.deleteCharAt(),this.render();return}if(e==="\x1B[A"){this.buffer.moveUp(),this.render();return}if(e==="\x1B[B"){this.buffer.moveDown(),this.render();return}if(e==="\x1B[C"){this.buffer.moveRight(),this.render();return}if(e==="\x1B[D"){this.buffer.moveLeft(),this.render();return}if(e==="\x1B[H"||e==="\x1B[1~"){this.buffer.moveHome(),this.render();return}if(e==="\x1B[F"||e==="\x1B[4~"){this.buffer.moveEnd(),this.render();return}if(e==="\x1B[5~"){this.buffer.pageUp(this.renderer.contentHeight),this.render();return}if(e==="\x1B[6~"){this.buffer.pageDown(this.renderer.contentHeight),this.render();return}e.startsWith("\x1B")||e.length===1&&e.charCodeAt(0)<32||(this.buffer.insertChar(e),this.render())}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.nano.long_description","Open the built-in nano-style text editor")),t.writeln(),t.writeln(r.t("cli.common.usage","Usage:")),t.writeln(` ${t.wrapInColor("nano",CliForegroundColor.Cyan)} ${r.t("cli.nano.open_empty","Open empty scratch buffer")}`),t.writeln(` ${t.wrapInColor("nano <file>",CliForegroundColor.Cyan)} ${r.t("cli.nano.open_file","Open or create a file")}`),t.writeln(),t.writeln(r.t("cli.nano.keyboard_shortcuts","Keyboard shortcuts:")),t.writeln(` ${t.wrapInColor("^X",CliForegroundColor.Yellow)} Exit ${t.wrapInColor("^O",CliForegroundColor.Yellow)} Write Out (save)`),t.writeln(` ${t.wrapInColor("^G",CliForegroundColor.Yellow)} Help ${t.wrapInColor("^F",CliForegroundColor.Yellow)} Search`),t.writeln(` ${t.wrapInColor("^K",CliForegroundColor.Yellow)} Cut line ${t.wrapInColor("^U",CliForegroundColor.Yellow)} Paste line`),t.writeln(` ${t.wrapInColor("^\\",CliForegroundColor.Yellow)} Replace ${t.wrapInColor("^R",CliForegroundColor.Yellow)} Read File`),t.writeln(` ${t.wrapInColor("^C",CliForegroundColor.Yellow)} Cursor position ${t.wrapInColor("^S",CliForegroundColor.Yellow)} Save (quick)`),t.writeln(` ${t.wrapInColor("^A",CliForegroundColor.Yellow)} Home ${t.wrapInColor("^E",CliForegroundColor.Yellow)} End`),t.writeln(` ${t.wrapInColor("^Y",CliForegroundColor.Yellow)} Page Up ${t.wrapInColor("^V",CliForegroundColor.Yellow)} Page Down`)}setupHighlighting(e){var t;if(!e){this.renderer.highlightEngine=void 0;return}try{const r=this.context.services.getRequired(SyntaxHighlighterRegistry_TOKEN),s="."+((t=e.split(".").pop())==null?void 0:t.toLowerCase()),o=r.getByExtension(s);o?this.renderer.highlightEngine=new SyntaxHighlightEngine(o,defaultSyntaxTheme,getAccelerator()):this.renderer.highlightEngine=void 0}catch{this.renderer.highlightEngine=void 0}}render(){this.renderer.render(this.buffer,this.filePath||"New Buffer",this.statusMessage)}renderPrompt(e){this.renderer.renderStatusOnly(this.buffer,` ${e}`)}showStatus(e,t=2e3){this.statusMessage=` ${e}`,this.renderer.renderStatusOnly(this.buffer,this.statusMessage),this.statusTimeout&&clearTimeout(this.statusTimeout),this.statusTimeout=setTimeout(()=>{this.statusMessage=void 0,this.render()},t)}handleTextPrompt(e,t){if(e==="\r"){this.inputMode="normal",t(this.inputBuffer.trim()||null);return}if(e==="\x1B"||e===""){this.inputMode="normal",t(null);return}if(e==="")this.inputBuffer.length>0&&(this.inputBuffer=this.inputBuffer.slice(0,-1));else if(e.length===1&&e.charCodeAt(0)>=32)this.inputBuffer+=e;else return;const r=this.getPromptLabel();this.renderPrompt(`${r}${this.inputBuffer}`)}getPromptLabel(){switch(this.inputMode){case"filename":return"File Name to Write: ";case"search":return"Search: ";case"replace-needle":return"Search (to replace): ";case"replace-with":return"Replace with: ";case"read-file":return"File to insert: ";default:return""}}handleReplaceConfirm(e){const t=e.toLowerCase();if(t==="y")this.buffer.replaceNext(this.searchNeedle,this.replaceWith),this.buffer.searchForward(this.searchNeedle)?(this.render(),this.renderPrompt("Replace this instance? [Y]es/[N]o/[A]ll/[C]ancel")):(this.inputMode="normal",this.showStatus("No more occurrences"));else if(t==="n")this.buffer.searchForward(this.searchNeedle)?(this.render(),this.renderPrompt("Replace this instance? [Y]es/[N]o/[A]ll/[C]ancel")):(this.inputMode="normal",this.showStatus("No more occurrences"));else if(t==="a"){const r=this.buffer.replaceAll(this.searchNeedle,this.replaceWith);this.inputMode="normal",this.showStatus(`Replaced ${r} occurrence${r!==1?"s":""}`)}else(t==="c"||e==="\x1B"||e==="")&&(this.inputMode="normal",this.showStatus("Cancelled"))}exitEditor(){if(!this.buffer.dirty){this.cleanup();return}this.inputMode="exit-save-prompt",this.renderPrompt("Save modified buffer? [Y]es/[N]o/[C]ancel")}handleExitSavePrompt(e){const t=e.toLowerCase();t==="y"?(this.inputMode="normal",this.save().then(()=>{this.cleanup()})):t==="n"?(this.inputMode="normal",this.cleanup()):(t==="c"||e==="\x1B"||e==="")&&(this.inputMode="normal",this.render())}async writeOut(){if(!this.fs){this.showStatus("No filesystem available — install @qodalis/cli-files");return}if(!this.filePath){this.inputMode="filename",this.inputBuffer="",this.renderPrompt("File Name to Write: ");return}this.inputMode="filename",this.inputBuffer=this.filePath,this.renderPrompt(`File Name to Write: ${this.inputBuffer}`)}async save(){if(!this.fs){this.showStatus("No filesystem available — install @qodalis/cli-files");return}if(!this.filePath){this.inputMode="filename",this.inputBuffer="",this.renderPrompt("File Name to Write: ");return}try{const e=this.buffer.getContent();this.fs.exists(this.filePath)?this.fs.writeFile(this.filePath,e):this.fs.createFile(this.filePath,e),await this.fs.persist(),this.buffer.dirty=!1,this.showStatus(`Wrote ${this.buffer.lines.length} lines to ${this.filePath}`)}catch(e){this.showStatus(`Error: ${e.message}`)}}readFileIntoBuffer(e){if(!this.fs){this.showStatus("No filesystem available");return}try{const t=this.fs.resolvePath(e);if(!this.fs.exists(t)){this.showStatus(`File not found: ${e}`);return}if(this.fs.isDirectory(t)){this.showStatus(`${e} is a directory`);return}const r=this.fs.readFile(t);if(r===null){this.showStatus(`Could not read: ${e}`);return}const s=r.split(`
|
|
153
|
-
`);this.buffer.lines.splice(this.buffer.cursorRow+1,0,...s),this.buffer.dirty=!0,this.showStatus(`Read ${s.length} lines from ${e}`)}catch(t){this.showStatus(`Error: ${t.message}`)}}cleanup(){var e;this.statusTimeout&&clearTimeout(this.statusTimeout),(e=this.resizeDisposable)==null||e.dispose(),this.context.exitFullScreenMode()}};function formatUptime(e){const t=Math.floor(e/1e3)%60,r=Math.floor(e/(1e3*60))%60,s=Math.floor(e/(1e3*60*60))%24,o=Math.floor(e/(1e3*60*60*24)),u=[];return o>0&&u.push(`${o}d`),s>0&&u.push(`${s}h`),r>0&&u.push(`${r}m`),u.push(`${t}s`),u.join(" ")}function colorStatus(e,t){switch(e){case"running":return t(e,CliForegroundColor.Green);case"stopped":return t(e,CliForegroundColor.White);case"failed":return t(e,CliForegroundColor.Red);case"done":return t(e,CliForegroundColor.Cyan);case"pending":return t(e,CliForegroundColor.Yellow);default:return e}}var CliServicesCommandProcessor=class{constructor(){this.command="services",this.aliases=["svc"],this.description="Manage background services and jobs",this.author=DefaultLibraryAuthor,this.processors=[],this.metadata={sealed:!0,icon:"⚙",module:"system",requiredPermissions:["system:services"]},this.processors=[{command:"list",aliases:["ls"],description:"List all registered background services",processCommand:async(e,t)=>{const{writer:r}=t,s=t.backgroundServices.list();if(s.length===0){r.writeInfo("No background services registered");return}const o=s.map(u=>[u.name,u.type,colorStatus(u.status,r.wrapInColor.bind(r)),u.executionMode,u.status==="running"&&u.uptime!=null?formatUptime(u.uptime):"-"]);r.writeTable(["Name","Type","Status","Mode","Uptime"],o)},writeDescription:e=>{const{writer:t}=e;t.writeln("List all registered background services with their status"),t.writeln(),t.writeln(` ${t.wrapInColor("services list",CliForegroundColor.Cyan)}`)}},{command:"start",description:"Start a background service",valueRequired:!0,processCommand:async(e,t)=>{const r=e.value;try{await t.backgroundServices.start(r),t.writer.writeSuccess(`Service '${r}' started`)}catch(s){t.writer.writeError((s==null?void 0:s.message)||`Failed to start service '${r}'`),t.process.exit(-1)}},writeDescription:e=>{const{writer:t}=e;t.writeln("Start a registered background service"),t.writeln(),t.writeln(` ${t.wrapInColor("services start <name>",CliForegroundColor.Cyan)}`)}},{command:"stop",description:"Stop a running background service",valueRequired:!0,processCommand:async(e,t)=>{const r=e.value;try{await t.backgroundServices.stop(r),t.writer.writeSuccess(`Service '${r}' stopped`)}catch(s){t.writer.writeError((s==null?void 0:s.message)||`Failed to stop service '${r}'`),t.process.exit(-1)}},writeDescription:e=>{const{writer:t}=e;t.writeln("Stop a running background service"),t.writeln(),t.writeln(` ${t.wrapInColor("services stop <name>",CliForegroundColor.Cyan)}`)}},{command:"restart",description:"Restart a background service",valueRequired:!0,processCommand:async(e,t)=>{const r=e.value;try{await t.backgroundServices.restart(r),t.writer.writeSuccess(`Service '${r}' restarted`)}catch(s){t.writer.writeError((s==null?void 0:s.message)||`Failed to restart service '${r}'`),t.process.exit(-1)}},writeDescription:e=>{const{writer:t}=e;t.writeln("Restart a background service (stop then start)"),t.writeln(),t.writeln(` ${t.wrapInColor("services restart <name>",CliForegroundColor.Cyan)}`)}},{command:"logs",description:"Show logs for a background service",valueRequired:!0,processCommand:async(e,t)=>{const r=e.value,s=parseInt(e.args.limit||e.args.n)||50,{writer:o}=t,u=t.backgroundServices.getLogs(r,s);if(u.length===0){o.writeInfo(`No log entries for service '${r}'`);return}for(const d of u){const a=new Date(d.timestamp).toLocaleString();let l;switch(d.level){case"error":l=o.wrapInColor("ERR",CliForegroundColor.Red);break;case"warn":l=o.wrapInColor("WRN",CliForegroundColor.Yellow);break;default:l=o.wrapInColor("INF",CliForegroundColor.Cyan);break}o.writeln(`[${a}] ${l} ${d.message}`)}},writeDescription:e=>{const{writer:t}=e;t.writeln("Display recent log entries for a background service"),t.writeln(),t.writeln(` ${t.wrapInColor("services logs <name>",CliForegroundColor.Cyan)}`),t.writeln(` ${t.wrapInColor("services logs <name> --limit 100",CliForegroundColor.Cyan)}`)}},{command:"info",description:"Show detailed information about a service",valueRequired:!0,processCommand:async(e,t)=>{const r=e.value,{writer:s}=t,o=t.backgroundServices.getStatus(r);if(!o){s.writeError(`Service '${r}' not found`),t.process.exit(-1);return}s.writeln(s.wrapInColor(`Service: ${o.name}`,CliForegroundColor.Cyan)),s.writeln(` Description : ${o.description||"-"}`),s.writeln(` Type : ${o.type}`),s.writeln(` Status : ${colorStatus(o.status,s.wrapInColor.bind(s))}`),s.writeln(` Mode : ${o.executionMode}`),o.startedAt&&s.writeln(` Started at : ${new Date(o.startedAt).toLocaleString()}`),o.stoppedAt&&s.writeln(` Stopped at : ${new Date(o.stoppedAt).toLocaleString()}`),o.status==="running"&&o.uptime!=null&&s.writeln(` Uptime : ${s.wrapInColor(formatUptime(o.uptime),CliForegroundColor.Green)}`),o.error&&s.writeln(` Error : ${s.wrapInColor(o.error,CliForegroundColor.Red)}`)},writeDescription:e=>{const{writer:t}=e;t.writeln("Show detailed information about a specific background service"),t.writeln(),t.writeln(` ${t.wrapInColor("services info <name>",CliForegroundColor.Cyan)}`)}}]}async processCommand(e,t){t.executor.showHelp(e,t)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.services.long_description","Manage background services and jobs")),t.writeln(),t.writeln(` ${t.wrapInColor("services list",CliForegroundColor.Cyan)} ${r.t("cli.services.list_desc","List all services")}`),t.writeln(` ${t.wrapInColor("services start <name>",CliForegroundColor.Cyan)} ${r.t("cli.services.start_desc","Start a service")}`),t.writeln(` ${t.wrapInColor("services stop <name>",CliForegroundColor.Cyan)} ${r.t("cli.services.stop_desc","Stop a service")}`),t.writeln(` ${t.wrapInColor("services restart <name>",CliForegroundColor.Cyan)} ${r.t("cli.services.restart_desc","Restart a service")}`),t.writeln(` ${t.wrapInColor("services logs <name>",CliForegroundColor.Cyan)} ${r.t("cli.services.logs_desc","View service logs")}`),t.writeln(` ${t.wrapInColor("services info <name>",CliForegroundColor.Cyan)} ${r.t("cli.services.info_desc","Service details")}`)}},CliProcessRegistry_TOKEN="cli-process-registry",CliProcessRegistry=class{constructor(){this.nextPid=1,this.processes=new Map,this.maxHistory=50}get currentPid(){return this._currentPid}register(e,t){const r=this.nextPid++,s=new AbortController,o=(t==null?void 0:t.type)??"command";return this.processes.set(r,{pid:r,name:(t==null?void 0:t.name)??e,type:o,command:e,startTime:Date.now(),status:"running",abortController:s,onKill:t==null?void 0:t.onKill}),o==="command"&&(this._currentPid=r),this.pruneHistory(),{pid:r,abortController:s}}complete(e,t){const r=this.processes.get(e);r&&r.status==="running"&&(r.status="completed",r.exitCode=t),this._currentPid===e&&(this._currentPid=void 0)}fail(e){const t=this.processes.get(e);t&&t.status==="running"&&(t.status="failed",t.exitCode=-1),this._currentPid===e&&(this._currentPid=void 0)}kill(e){const t=this.processes.get(e);return!t||t.status!=="running"?!1:(t.onKill&&Promise.resolve(t.onKill()).catch(()=>{}),t.abortController.abort(),t.status="killed",t.exitCode=-9,this._currentPid===e&&(this._currentPid=void 0),!0)}list(){return Array.from(this.processes.values()).map(({abortController:e,onKill:t,...r})=>r)}pruneHistory(){const t=Array.from(this.processes.entries()).filter(([,r])=>r.status!=="running");if(t.length>this.maxHistory){const r=t.slice(0,t.length-this.maxHistory);for(const[s]of r)this.processes.delete(s)}}},CliPsCommandProcessor=class{constructor(){this.command="ps",this.description="List running and recent processes",this.author=DefaultLibraryAuthor,this.metadata={icon:"📋",sealed:!0}}async processCommand(e,t){let r;try{r=t.services.getRequired(CliProcessRegistry_TOKEN)}catch{t.writer.writeInfo("Process registry not available");return}const s=r.list();if(s.length===0){t.writer.writeInfo("No processes");return}const o=["PID","NAME","TYPE","STATUS","EXIT","TIME","COMMAND"],u=s.map(d=>{const a=`${Math.round((Date.now()-d.startTime)/1e3)}s`;return[String(d.pid),d.name,d.type,d.status,d.exitCode!==void 0?String(d.exitCode):"-",a,d.command]});t.writer.writeTable(o,u)}},CliKillCommandProcessor=class{constructor(){this.command="kill",this.description="Terminate a running process by PID",this.author=DefaultLibraryAuthor,this.valueRequired=!0,this.metadata={icon:"💀",sealed:!0}}async processCommand(e,t){var u;let r;try{r=t.services.getRequired(CliProcessRegistry_TOKEN)}catch{t.writer.writeError("Process registry not available");return}const s=(u=e.value)==null?void 0:u.trim();if(!s){t.writer.writeError("kill: missing PID");return}const o=parseInt(s,10);if(isNaN(o)){t.writer.writeError(`kill: invalid PID: ${s}`);return}r.kill(o)?t.writer.writeSuccess(`Killed process ${o}`):t.writer.writeError(`kill: no running process with PID ${o}`)}},ESC="\x1B",CSI=`${ESC}[`,ansi={clearScreen:`${CSI}2J`,cursorHome:`${CSI}H`,hideCursor:`${CSI}?25l`,cursorTo:(e,t)=>`${CSI}${e};${t}H`,fg:{green:`${CSI}32m`,cyan:`${CSI}36m`,yellow:`${CSI}93m`,white:`${CSI}97m`,red:`${CSI}91m`,gray:`${CSI}90m`},bg:{blue:`${CSI}44m`},bold:`${CSI}1m`,dim:`${CSI}2m`,inverse:`${CSI}7m`,reset:`${CSI}0m`},BOX={topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",horizontal:"─",vertical:"│"};function formatElapsed(e){const t=Math.floor(e/1e3)%60,r=Math.floor(e/(1e3*60))%60,s=Math.floor(e/(1e3*60*60))%24,o=Math.floor(e/(1e3*60*60*24)),u=[];return o>0&&u.push(`${o}d`),s>0&&u.push(`${s}h`),r>0&&u.push(`${r}m`),u.push(`${t}s`),u.join(" ")}function statusColor(e){switch(e){case"running":return ansi.fg.green;case"completed":case"done":return ansi.fg.cyan;case"pending":return ansi.fg.yellow;case"stopped":return ansi.fg.white;case"failed":case"killed":return ansi.fg.red;default:return ansi.fg.white}}function truncate(e,t){return e.length<=t?e:e.substring(0,t-1)+"…"}function pad(e,t){return e.length>=t?e.substring(0,t):e+" ".repeat(t-e.length)}var CliHtopCommandProcessor=class{constructor(){this.command="htop",this.description="Interactive process and service monitor",this.author=DefaultLibraryAuthor,this.metadata={icon:"📊",sealed:!0,module:"system"},this.context=null,this.registry=null,this.refreshTimer=null,this.rows=[],this.selectedIndex=0,this.scrollOffset=0,this.termCols=80,this.termRows=24,this.showingLogs=!1,this.errorMessage=null,this.errorTimeout=null}async processCommand(e,t){if(this.registry=t.services.get(CliProcessRegistry_TOKEN)??null,!this.registry){t.writer.writeError("Process registry not available");return}this.context=t,this.termCols=t.terminal.cols||80,this.termRows=t.terminal.rows||24,this.selectedIndex=0,this.scrollOffset=0,this.showingLogs=!1,this.errorMessage=null,t.enterFullScreenMode(this),this.refreshData(),this.render(),this.refreshTimer=t.createInterval(()=>{this.showingLogs||(this.refreshData(),this.render())},1e3)}async onData(e,t){if(this.showingLogs){this.showingLogs=!1,this.render();return}switch(e){case`${ESC}[A`:this.moveSelection(-1),this.render();break;case`${ESC}[B`:this.moveSelection(1),this.render();break;case"q":case ESC:this.exit(t);break;case"k":this.actionKill();break;case"s":await this.actionStart();break;case"t":await this.actionStop();break;case"r":await this.actionRestart();break;case"l":this.actionLogs();break}}onResize(e,t,r){this.termCols=e,this.termRows=t,this.clampScroll(),this.render()}onDispose(e){this.refreshTimer=null,this.context=null,this.registry=null,this.rows=[]}writeDescription(e){const{writer:t}=e;t.writeln("Interactive process and service monitor"),t.writeln(),t.writeln("Usage:"),t.writeln(` ${t.wrapInColor("htop",36)}`)}refreshData(){if(!this.registry||!this.context)return;const e=this.registry.list(),t=this.context.backgroundServices.list(),r=new Set;for(const o of t)o.pid!==void 0&&r.add(o.pid);const s=[];for(const o of e)r.has(o.pid)||s.push({pid:o.pid,name:o.name,type:o.type,status:o.status,time:formatElapsed(Date.now()-o.startTime),mode:"main",source:"process"});for(const o of t){let u="-";o.status==="running"&&o.startedAt&&(u=formatElapsed(Date.now()-new Date(o.startedAt).getTime())),s.push({pid:o.pid??0,name:o.name,type:o.type,status:o.status,time:u,mode:o.executionMode==="worker"?"worker":"main",source:"service",serviceInfo:o})}s.sort((o,u)=>{const d=o.status==="running"?0:1,a=u.status==="running"?0:1;return d!==a?d-a:u.pid-o.pid}),this.rows=s,this.rows.length===0?this.selectedIndex=0:this.selectedIndex=Math.min(this.selectedIndex,this.rows.length-1),this.clampScroll()}actionKill(){const e=this.rows[this.selectedIndex];if(!(!e||e.status!=="running")){if(e.name==="htop"&&e.source==="process"){this.context&&this.exit(this.context);return}try{this.registry&&this.registry.kill(e.pid)}catch(t){this.showError((t==null?void 0:t.message)||"Kill failed")}this.refreshData(),this.render()}}async actionStart(){const e=this.rows[this.selectedIndex];if(!(!e||e.source!=="service")&&!(e.status!=="stopped"&&e.status!=="pending"&&e.status!=="failed")){try{await this.context.backgroundServices.start(e.name)}catch(t){this.showError((t==null?void 0:t.message)||"Start failed")}this.refreshData(),this.render()}}async actionStop(){const e=this.rows[this.selectedIndex];if(!(!e||e.source!=="service"||e.status!=="running")){try{await this.context.backgroundServices.stop(e.name)}catch(t){this.showError((t==null?void 0:t.message)||"Stop failed")}this.refreshData(),this.render()}}async actionRestart(){const e=this.rows[this.selectedIndex];if(!(!e||e.source!=="service")){try{await this.context.backgroundServices.restart(e.name)}catch(t){this.showError((t==null?void 0:t.message)||"Restart failed")}this.refreshData(),this.render()}}actionLogs(){const e=this.rows[this.selectedIndex];!e||e.source!=="service"||!this.context||(this.showingLogs=!0,this.renderLogsOverlay(e.name))}moveSelection(e){this.rows.length!==0&&(this.selectedIndex+=e,this.selectedIndex<0?this.selectedIndex=this.rows.length-1:this.selectedIndex>=this.rows.length&&(this.selectedIndex=0),this.clampScroll())}get visibleRows(){return Math.max(1,this.termRows-4)}clampScroll(){this.selectedIndex<this.scrollOffset?this.scrollOffset=this.selectedIndex:this.selectedIndex>=this.scrollOffset+this.visibleRows&&(this.scrollOffset=this.selectedIndex-this.visibleRows+1),this.scrollOffset=Math.max(0,this.scrollOffset)}render(){if(!this.context)return;const e=[],t=this.termCols;e.push(ansi.clearScreen,ansi.cursorHome,ansi.hideCursor);const r=this.rows.filter(U=>U.status==="running").length,s=this.rows.length;let o;this.errorMessage?o=`${ansi.bold}${ansi.fg.red} htop ${ansi.reset}${ansi.fg.red}${ansi.dim} ${this.errorMessage}${ansi.reset}`:o=`${ansi.bold}${ansi.fg.cyan} htop${ansi.reset}${ansi.fg.gray} — ${r} running / ${s} total${ansi.reset}`;const u=`${ansi.fg.gray}Refresh: 1s${ansi.reset}`;e.push(ansi.cursorTo(1,1)),e.push(o),e.push(ansi.cursorTo(1,Math.max(1,t-11))),e.push(u),e.push(ansi.cursorTo(2,1)),e.push(ansi.fg.gray,BOX.horizontal.repeat(t),ansi.reset);const d=6,a=9,l=11,f=8,C=9,h=Math.max(10,t-d-a-l-f-C-2);if(e.push(ansi.cursorTo(3,1)),e.push(ansi.bold,ansi.fg.white," ",pad("PID",d),pad("NAME",h),pad("TYPE",a),pad("STATUS",l),pad("MODE",f),pad("TIME",C),ansi.reset),this.rows.length===0){const U="No processes",W=Math.floor(this.visibleRows/2)+4,H=Math.max(1,Math.floor((t-U.length)/2));e.push(ansi.cursorTo(W,H)),e.push(ansi.fg.gray,U,ansi.reset)}else{const U=Math.min(this.scrollOffset+this.visibleRows,this.rows.length);for(let W=this.scrollOffset;W<U;W++){const H=this.rows[W],x=4+(W-this.scrollOffset),L=W===this.selectedIndex,R=L?">":" ",N=pad(String(H.pid),d),V=pad(truncate(H.name,h-1),h),J=pad(H.type,a),Y=pad(H.status,l),Z=pad(H.mode,f),K=pad(H.time,C);e.push(ansi.cursorTo(x,1)),L&&e.push(ansi.inverse),e.push(R,N,V,J,L?"":statusColor(H.status),Y,L?"":ansi.reset,Z,K);const ee=1+d+h+a+l+f+C;ee<t&&e.push(" ".repeat(t-ee)),L&&e.push(ansi.reset)}this.scrollOffset>0&&(e.push(ansi.cursorTo(4,t)),e.push(ansi.fg.gray,"↑",ansi.reset)),U<this.rows.length&&(e.push(ansi.cursorTo(3+this.visibleRows,t)),e.push(ansi.fg.gray,"↓",ansi.reset))}const j=this.termRows-1;e.push(ansi.cursorTo(j,1)),e.push(ansi.fg.gray,BOX.horizontal.repeat(t),ansi.reset),e.push(ansi.cursorTo(this.termRows,1)),e.push(ansi.dim," ",this.buildFooter(),ansi.reset),this.context.terminal.write(e.join(""))}buildFooter(){const e=this.rows[this.selectedIndex],t=[];return e&&(e.status==="running"&&t.push("k:Kill"),e.source==="service"&&(e.status==="stopped"||e.status==="pending"||e.status==="failed")&&t.push("s:Start"),e.source==="service"&&e.status==="running"&&t.push("t:Stop"),e.source==="service"&&(t.push("r:Restart"),t.push("l:Logs"))),t.push("q:Quit"),t.push("↑↓:Navigate"),t.join(" ")}renderLogsOverlay(e){if(!this.context)return;const t=this.context.backgroundServices.getLogs(e,15),r=[],s=Math.min(this.termCols-4,70),o=Math.min(this.termRows-4,t.length+4),u=Math.max(1,Math.floor((this.termCols-s)/2)),d=Math.max(1,Math.floor((this.termRows-o)/2)),a=s-2,l=` Logs: ${truncate(e,a-10)} `,f=BOX.topLeft+BOX.horizontal+l+BOX.horizontal.repeat(Math.max(0,s-l.length-3))+BOX.topRight;r.push(ansi.cursorTo(d,u)),r.push(ansi.fg.cyan,f,ansi.reset);const C=o-3;if(t.length===0){const U="No log entries";r.push(ansi.cursorTo(d+1,u)),r.push(ansi.fg.cyan,BOX.vertical,ansi.reset," ",ansi.fg.gray,pad(U,a-1),ansi.reset,ansi.fg.cyan,BOX.vertical,ansi.reset);for(let W=2;W<=C;W++)r.push(ansi.cursorTo(d+W,u)),r.push(ansi.fg.cyan,BOX.vertical,ansi.reset," ".repeat(a),ansi.fg.cyan,BOX.vertical,ansi.reset)}else{const U=t.slice(-C);let W=0;for(const H of U){const x=new Date(H.timestamp).toLocaleTimeString(),L=H.level==="error"?`${ansi.fg.red}ERR${ansi.reset}`:H.level==="warn"?`${ansi.fg.yellow}WRN${ansi.reset}`:`${ansi.fg.cyan}INF${ansi.reset}`,R=`[${x}] ${L} ${truncate(H.message,a-18)}`;r.push(ansi.cursorTo(d+1+W,u)),r.push(ansi.fg.cyan,BOX.vertical,ansi.reset," ",R),r.push(ansi.cursorTo(d+1+W,u+s-1)),r.push(ansi.fg.cyan,BOX.vertical,ansi.reset),W++}for(let H=W;H<C;H++)r.push(ansi.cursorTo(d+1+H,u)),r.push(ansi.fg.cyan,BOX.vertical,ansi.reset," ".repeat(a),ansi.fg.cyan,BOX.vertical,ansi.reset)}const h="Press any key to close",j=Math.max(0,Math.floor((a-h.length)/2));r.push(ansi.cursorTo(d+C+1,u)),r.push(ansi.fg.cyan,BOX.vertical,ansi.reset," ".repeat(j),ansi.fg.gray,h,ansi.reset," ".repeat(Math.max(0,a-j-h.length)),ansi.fg.cyan,BOX.vertical,ansi.reset),r.push(ansi.cursorTo(d+C+2,u)),r.push(ansi.fg.cyan,BOX.bottomLeft,BOX.horizontal.repeat(s-2),BOX.bottomRight,ansi.reset),this.context.terminal.write(r.join(""))}showError(e){this.errorMessage=e,this.errorTimeout&&this.errorTimeout.clear(),this.context&&(this.errorTimeout=this.context.createInterval(()=>{var t;this.errorMessage=null,(t=this.errorTimeout)==null||t.clear(),this.errorTimeout=null},3e3))}exit(e){e.exitFullScreenMode(),this.context=null}},systemProcessors=[new CliHelpCommandProcessor,new CliVersionCommandProcessor,new CliFeedbackCommandProcessor,new CliHistoryCommandProcessor,new CliPackagesCommandProcessor,new CliHotKeysCommandProcessor,new CliDebugCommandProcessor,new CliNanoCommandProcessor,new CliServicesCommandProcessor,new CliPsCommandProcessor,new CliKillCommandProcessor,new CliHtopCommandProcessor],themes={...DefaultThemes},themeInfos={...DefaultThemeInfos};function hexToRgb(e){const t=/^#?([0-9A-Fa-f]{6})$/.exec(e);if(!t)return null;const r=parseInt(t[1],16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function colorSwatch(e){if(!e)return" ";const t=hexToRgb(e);return t?`\x1B[48;2;${t.r};${t.g};${t.b}m \x1B[0m`:" "}function colorText(e,t){if(!t)return e;const r=hexToRgb(t);return r?`\x1B[38;2;${r.r};${r.g};${r.b}m${e}\x1B[0m`:e}var PALETTE_KEYS=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],CliThemeCommandProcessor=class{constructor(){this.command="theme",this.aliases=["themes"],this.description="Interact with the theme",this.author=DefaultLibraryAuthor,this.version="2.0.0",this.processors=[],this.metadata={sealed:!0,icon:"🎨",module:"system"},this.stateConfiguration={initialState:{selectedTheme:"default",customOptions:null}},this.themeOptions=Object.keys(themeOptions),this.processors=[{command:"list",description:"List available themes with color previews",processCommand:async(e,t)=>{const s=t.state.getState().selectedTheme||"",o=Object.entries(themeInfos).filter(([,a])=>a.category==="dark"),u=Object.entries(themeInfos).filter(([,a])=>a.category==="light"),d=(a,l)=>{t.writer.writeln(t.writer.wrapInColor(` ${a}`,CliForegroundColor.Yellow)),t.writer.writeln();for(const[f,C]of l){const h=f===s?" (active)":"",j=PALETTE_KEYS.map(W=>colorSwatch(C.theme[W])).join(""),U=t.writer.wrapInColor(f.padEnd(22),CliForegroundColor.Cyan);t.writer.writeln(` ${j} ${U} ${C.description}${h}`)}t.writer.writeln()};t.writer.writeln("Available themes:"),t.writer.writeln(),d("Dark",o),d("Light",u),t.writer.writeInfo(`Use ${t.writer.wrapInColor("theme apply <name>",CliForegroundColor.Cyan)} or ${t.writer.wrapInColor("theme apply",CliForegroundColor.Cyan)} to select interactively`)}},{command:"current",description:"Show the current theme with color swatches",processCommand:async(e,t)=>{const s=t.state.getState().selectedTheme||"custom",o=t.terminal.options.theme;t.writer.writeln(`Current theme: ${t.writer.wrapInColor(s,CliForegroundColor.Cyan)}`),t.writer.writeln();const u=o.background,d=o.foreground;t.writer.writeln(` ${colorSwatch(u)} background ${u||"default"}`),t.writer.writeln(` ${colorSwatch(d)} foreground ${d||"default"}`),o.cursor&&t.writer.writeln(` ${colorSwatch(o.cursor)} cursor ${o.cursor}`),t.writer.writeln(),t.writer.writeln(" Normal colors:");const a=PALETTE_KEYS.slice(0,8);for(const f of a){const C=o[f];C&&t.writer.writeln(` ${colorSwatch(C)} ${String(f).padEnd(10)} ${C}`)}t.writer.writeln(),t.writer.writeln(" Bright colors:");const l=PALETTE_KEYS.slice(8);for(const f of l){const C=o[f];C&&t.writer.writeln(` ${colorSwatch(C)} ${String(f).padEnd(16)} ${C}`)}t.process.output({theme:s,colors:o})}},{command:"preview",description:"Preview a theme without applying it",valueRequired:!0,processCommand:async(e,t)=>{const r=e.value,s=themes[r];if(!s){t.writer.writeError(`Theme not found: ${r}. Use ${t.writer.wrapInColor("theme list",CliForegroundColor.Cyan)} to see available themes.`);return}this.renderThemePreview(r,s,t)}},{command:"apply",description:"Apply a theme (interactive with live preview if no name given)",acceptsRawInput:!0,processCommand:async(e,t)=>{var s;let r=(s=e.value)==null?void 0:s.trim();if(!r){const o={...t.terminal.options.theme},u=Object.keys(themes).map(a=>({label:a,value:a})),d=await t.reader.readSelect("Select a theme (live preview):",u,{onChange:a=>{themes[a]&&(t.terminal.options.theme=themes[a],this.applyStyles(t))}});if(!d){t.terminal.options.theme=o,this.applyStyles(t),t.writer.writeInfo("Theme selection cancelled");return}r=d}if(!themes[r]){t.writer.writeError(`Theme not found: ${r}. Use ${t.writer.wrapInColor("theme list",CliForegroundColor.Cyan)} to see available themes.`);return}t.terminal.options.theme=themes[r],t.state.updateState({selectedTheme:r,customOptions:null}),await t.state.persist(),this.applyStyles(t),t.writer.writeSuccess(`Theme "${r}" applied`)}},{command:"set",acceptsRawInput:!0,description:"Set a theme variable",parameters:[{name:"save",description:"Save the theme settings",type:"boolean",required:!1}],processCommand:async(e,t)=>{const[r,s]=e.command.split(" ").slice(2);if(!r||!s){t.writer.writeError("Usage: theme set <key> <value>"),t.writer.writeln(),t.writer.writeInfo(`Available keys: ${this.themeOptions.join(", ")}`);return}if(!this.themeOptions.includes(r)){t.writer.writeError(`Unsupported key: ${r}`),t.writer.writeln(),t.writer.writeInfo(`Supported keys: ${this.themeOptions.join(", ")}`);return}t.terminal.options.theme={...t.terminal.options.theme,[r]:s},t.state.updateState({selectedTheme:null,customOptions:t.terminal.options.theme});const o=colorSwatch(s);t.writer.writeSuccess(`Set ${r} to ${o} ${s}`),this.applyStyles(t),e.args.save&&await this.saveTheme(t)}},{command:"save",description:"Save the current theme settings",processCommand:async(e,t)=>{t.state.getState().selectedTheme||t.state.updateState({selectedTheme:null,customOptions:{...t.terminal.options.theme}}),await this.saveTheme(t)}},{command:"reset",description:"Reset the theme to the default",processCommand:async(e,t)=>{t.terminal.options.theme={...this.defaultTheme},t.state.reset(),await t.state.persist(),this.applyStyles(t),t.writer.writeSuccess("Theme reset to default")}},{command:"search",description:"Search themes by name, tag, or description",valueRequired:!0,processCommand:async(e,t)=>{const r=e.value.toLowerCase(),s=Object.entries(themeInfos).filter(([o,u])=>o.toLowerCase().includes(r)||u.description.toLowerCase().includes(r)||u.tags.some(d=>d.toLowerCase().includes(r)));if(s.length===0){t.writer.writeWarning(`No themes matching "${e.value}"`);return}t.writer.writeln(`Found ${s.length} theme${s.length>1?"s":""} matching "${e.value}":`),t.writer.writeln();for(const[o,u]of s){const d=PALETTE_KEYS.map(f=>colorSwatch(u.theme[f])).join(""),a=t.writer.wrapInColor(o.padEnd(22),CliForegroundColor.Cyan),l=u.tags.map(f=>t.writer.wrapInColor(`#${f}`,CliForegroundColor.Magenta)).join(" ");t.writer.writeln(` ${d} ${a} ${u.description} ${l}`)}}},{command:"random",description:'Apply a random theme (optionally filter by "dark" or "light")',processCommand:async(e,t)=>{var d;const r=(d=e.value)==null?void 0:d.toLowerCase();let s=Object.entries(themeInfos);(r==="dark"||r==="light")&&(s=s.filter(([,a])=>a.category===r));const[o,u]=s[Math.floor(Math.random()*s.length)];t.terminal.options.theme=u.theme,t.state.updateState({selectedTheme:o,customOptions:null}),await t.state.persist(),this.applyStyles(t),t.writer.writeSuccess(`Random theme "${o}" applied`)}},{command:"export",description:"Export the current theme as JSON",processCommand:async(e,t)=>{const r=t.terminal.options.theme,s=JSON.stringify(r,null,2);t.writer.writeln(s),t.process.output({json:s})}},{command:"import",description:"Import a theme from JSON",processCommand:async(e,t)=>{t.writer.writeln("Paste your theme JSON (single line or multi-line, then press Enter on an empty line):");let r="";for(;;){const o=await t.reader.readLine("");if(o===null||o.trim()==="")break;r+=o}if(!r.trim()){t.writer.writeWarning("Import cancelled - no input");return}let s;try{s=JSON.parse(r)}catch{t.writer.writeError("Invalid JSON. Please provide a valid theme object.");return}if(typeof s!="object"||s===null||!s.background||!s.foreground){t.writer.writeError('Theme must be an object with at least "background" and "foreground" properties.');return}t.terminal.options.theme=s,t.state.updateState({selectedTheme:null,customOptions:s}),await t.state.persist(),this.applyStyles(t),t.writer.writeSuccess("Custom theme imported and applied")}}]}async initialize(e){this.defaultTheme=e.terminal.options.theme;const t=e.state.getState();if(t.selectedTheme&&t.selectedTheme!=="default"){const r=themes[t.selectedTheme];r&&(e.terminal.options.theme=r)}else t.customOptions&&(e.terminal.options.theme=t.customOptions);this.applyStyles(e)}async processCommand(e,t){t.executor.showHelp(e,t)}renderThemePreview(e,t,r){const{writer:s}=r,o=t.background,u=t.foreground;if(s.writeln(`Theme: ${s.wrapInColor(e,CliForegroundColor.Cyan)}`),s.writeln(),o&&u){const f=hexToRgb(o),C=hexToRgb(u);if(f&&C){const h=`\x1B[48;2;${f.r};${f.g};${f.b}m\x1B[38;2;${C.r};${C.g};${C.b}m ${e.padEnd(20)} Sample text \x1B[0m`;s.writeln(` ${h}`),s.writeln()}}s.writeln(" Normal:");const d=["black","red","green","yellow","blue","magenta","cyan","white"];let a=" ";for(const f of d){const C=t[f];a+=colorSwatch(C)+" "}s.writeln(a),a=" ";for(const f of d){const C=t[f];a+=colorText(String(f).slice(0,2).padEnd(2),C)+" "}s.writeln(a),s.writeln(),s.writeln(" Bright:");const l=["brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"];a=" ";for(const f of l){const C=t[f];a+=colorSwatch(C)+" "}s.writeln(a),a=" ";for(const f of l){const C=t[f],h=String(f).replace("bright","").slice(0,2).toLowerCase();a+=colorText(h.padEnd(2),C)+" "}s.writeln(a),s.writeln(),s.writeln(` ${colorSwatch(o)} background ${o||"default"}`),s.writeln(` ${colorSwatch(u)} foreground ${u||"default"}`),t.cursor&&s.writeln(` ${colorSwatch(t.cursor)} cursor ${t.cursor}`)}applyStyles(e){var r;const t=document.getElementsByClassName("terminal-container");for(const s of Array.from(t))s.style.background=((r=e.terminal.options.theme)==null?void 0:r.background)||this.defaultTheme.background}async saveTheme(e){await e.state.persist(),e.writer.writeSuccess("Theme saved")}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.theme.long_description","Customize the terminal appearance with themes and colors")),t.writeln(),t.writeln(r.t("cli.common.usage","Usage:")),t.writeln(` ${t.wrapInColor("theme list",CliForegroundColor.Cyan)} List themes grouped by dark/light`),t.writeln(` ${t.wrapInColor("theme apply",CliForegroundColor.Cyan)} Select a theme interactively`),t.writeln(` ${t.wrapInColor("theme apply <name>",CliForegroundColor.Cyan)} Apply a theme by name`),t.writeln(` ${t.wrapInColor("theme preview <name>",CliForegroundColor.Cyan)} Preview a theme without applying`),t.writeln(` ${t.wrapInColor("theme search <keyword>",CliForegroundColor.Cyan)} Search by name, tag, or description`),t.writeln(` ${t.wrapInColor("theme random [dark|light]",CliForegroundColor.Cyan)} Apply a random theme`),t.writeln(` ${t.wrapInColor("theme current",CliForegroundColor.Cyan)} Show active theme with swatches`),t.writeln(` ${t.wrapInColor("theme set <key> <value>",CliForegroundColor.Cyan)} Set a theme variable`),t.writeln(` ${t.wrapInColor("theme export",CliForegroundColor.Cyan)} Export current theme as JSON`),t.writeln(` ${t.wrapInColor("theme import",CliForegroundColor.Cyan)} Import a theme from JSON`),t.writeln(` ${t.wrapInColor("theme save",CliForegroundColor.Cyan)} Save current settings`),t.writeln(` ${t.wrapInColor("theme reset",CliForegroundColor.Cyan)} Reset to default`),t.writeln(),t.writeln(r.t("cli.common.examples","Examples:")),t.writeln(` theme apply dracula ${t.wrapInColor("# Apply the Dracula theme",CliForegroundColor.Green)}`),t.writeln(` theme apply tokyoNight ${t.wrapInColor("# Apply Tokyo Night",CliForegroundColor.Green)}`),t.writeln(` theme preview nord ${t.wrapInColor("# Preview Nord palette",CliForegroundColor.Green)}`),t.writeln(` theme search retro ${t.wrapInColor("# Find retro-style themes",CliForegroundColor.Green)}`),t.writeln(` theme random dark ${t.wrapInColor("# Apply a random dark theme",CliForegroundColor.Green)}`),t.writeln(` theme set background #1a1a2e ${t.wrapInColor("# Change background color",CliForegroundColor.Green)}`),t.writeln(` theme export ${t.wrapInColor("# Export theme as JSON",CliForegroundColor.Green)}`),t.writeln(),t.writeln(`Available color keys: ${t.wrapInColor(this.themeOptions.join(", ")??"",CliForegroundColor.Blue)}`)}},themeOptions={background:"",foreground:"",black:"",blue:"",brightBlack:"",brightBlue:"",brightCyan:"",brightGreen:"",brightMagenta:"",brightRed:"",brightWhite:"",brightYellow:"",cyan:"",green:"",magenta:"",red:"",white:"",yellow:"",cursor:"",cursorAccent:"",selectionBackground:"",selectionForeground:"",selectionInactiveBackground:""},CliPingCommandProcessor=class{constructor(){this.command="ping",this.description="Send ICMP-like pings to a host",this.author=DefaultLibraryAuthor,this.acceptsRawInput=!0,this.metadata={icon:"🏓"},this.parameters=[{name:"c",aliases:["count"],description:"Number of pings to send (default: 4, 0 = infinite)",required:!1,type:"number"},{name:"i",aliases:["interval"],description:"Interval between pings in seconds (default: 1)",required:!1,type:"number"}]}async processCommand(e,t){var H;const r=(e.value||"").trim();if(!r){t.writer.writeError("ping: missing host operand"),t.writer.writeln(`Usage: ${t.writer.wrapInColor("ping [-c count] [-i interval] <host>",CliForegroundColor.Cyan)}`),t.process.exit(1,{silent:!0});return}const s=e.args.c??e.args.count??4,o=e.args.i??e.args.interval??1,u=Math.max(200,o*1e3),d=this.normalizeUrl(r);t.writer.writeln(`PING ${r} (${d}):`),t.notifier.info(`ping ${r}`);const a=[];let l=0,f=0,C=0,h=!1;const j=t.onAbort.subscribe(()=>{h=!0});try{const x=s===0?1/0:s;for(;C<x&&!h;){l++;const L=performance.now();try{const R=await t.http.fetch(d,{method:"HEAD",mode:"no-cors",cache:"no-store"}),N=performance.now()-L,V=N.toFixed(1);f++,a.push(N);const J=R.type==="opaque"?"ok":`status=${R.status}`;t.notifier.info(`ping ${r}: seq=${C} time=${V}ms`),t.writer.writeln(`${d}: seq=${C} ${J} time=${V} ms`)}catch(R){if((R==null?void 0:R.name)==="AbortError"){h=!0;break}const N=performance.now()-L;t.writer.writeln(`${d}: seq=${C} request timed out (${N.toFixed(1)} ms)`)}C++,C<x&&!h&&(await this.sleep(u,t),(H=t.signal)!=null&&H.aborted&&(h=!0))}}finally{j.unsubscribe()}t.writer.writeln(""),t.writer.writeln(`--- ${r} ping statistics ---`);const U=l-f,W=l>0?(U/l*100).toFixed(0):"0";if(t.writer.writeln(`${l} packets transmitted, ${f} received, ${W}% packet loss`),a.length>0){const x=Math.min(...a).toFixed(1),L=Math.max(...a).toFixed(1),R=(a.reduce((Y,Z)=>Y+Z,0)/a.length).toFixed(1),N=a.reduce((Y,Z)=>Y+Z,0)/a.length,V=a.reduce((Y,Z)=>Y+(Z-N)**2,0)/a.length,J=Math.sqrt(V).toFixed(1);t.writer.writeln(`rtt min/avg/max/mdev = ${x}/${R}/${L}/${J} ms`)}f===0&&t.process.exit(1,{silent:!0})}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.ping.long_description","Send ICMP-like HTTP pings to a host and display round-trip statistics")),t.writeln(),t.writeln(r.t("cli.common.usage","Usage:")),t.writeln(` ${t.wrapInColor("ping <host>",CliForegroundColor.Cyan)}`),t.writeln(` ${t.wrapInColor("ping -c 10 google.com",CliForegroundColor.Cyan)}`),t.writeln(` ${t.wrapInColor("ping -c 0 -i 2 example.com",CliForegroundColor.Cyan)} (infinite, 2s interval)`),t.writeln(),t.writeln(r.t("cli.help.options","Options:")),t.writeln(" -c, --count Number of pings (default: 4, 0 = infinite)"),t.writeln(" -i, --interval Seconds between pings (default: 1)"),t.writeln(),t.writeln(r.t("cli.ping.ctrl_c","Press Ctrl+C to stop and show statistics."))}normalizeUrl(e){return e.startsWith("http://")||e.startsWith("https://")?e:`https://${e}`}sleep(e,t){return new Promise(r=>{const s=setTimeout(r,e),o=()=>{clearTimeout(s),r()};t.signal&&t.signal.addEventListener("abort",o,{once:!0})})}},ICliEnvironment_TOKEN="cli-environment",CliEnvironment=class{constructor(){this.vars=new Map,this.vars.set("SHELL","/bin/sh"),this.vars.set("TERM","xterm-256color"),this.vars.set("LANG","en_US.UTF-8"),this.vars.set("PWD","/"),this.vars.set("HOME","/home/user"),this.vars.set("USER","user"),this.vars.set("PATH","/usr/local/bin:/usr/bin:/bin")}get(e){return this.vars.get(e)}set(e,t){this.vars.set(e,t)}unset(e){this.vars.delete(e)}getAll(){const e={};for(const[t,r]of this.vars)e[t]=r;return e}has(e){return this.vars.has(e)}},CliExportCommandProcessor=class{constructor(){this.command="export",this.description="Set environment variables",this.author=DefaultLibraryAuthor,this.acceptsRawInput=!0,this.metadata={icon:"📦",module:"system"}}async processCommand(e,t){const r=t.services.getRequired(ICliEnvironment_TOKEN),s=(e.value||"").trim();if(!s){const a=r.getAll(),l=Object.keys(a).sort();for(const f of l)t.writer.writeln(`declare -x ${f}="${a[f]}"`);return}const o=s.match(/^([A-Za-z_][A-Za-z0-9_]*)=(.*)$/);if(!o){t.writer.writeError(`export: invalid syntax: ${s}`),t.process.exit(1,{silent:!0});return}const u=o[1];let d=o[2];(d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'"))&&(d=d.slice(1,-1)),r.set(u,d)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.export.long_description","Set or display environment variables")),t.writeln(),t.writeln(r.t("cli.common.usage","Usage:")),t.writeln(` ${t.wrapInColor("export",CliForegroundColor.Cyan)} ${r.t("cli.export.show_all","Show all variables")}`),t.writeln(` ${t.wrapInColor("export VAR=value",CliForegroundColor.Cyan)} ${r.t("cli.export.set_var","Set a variable")}`),t.writeln(` ${t.wrapInColor('export VAR="hello world"',CliForegroundColor.Cyan)} ${r.t("cli.export.set_spaces","Set with spaces")}`)}},CliUnsetCommandProcessor=class{constructor(){this.command="unset",this.description="Remove environment variables",this.author=DefaultLibraryAuthor,this.acceptsRawInput=!0,this.metadata={icon:"🗑️",module:"system"}}async processCommand(e,t){const r=t.services.getRequired(ICliEnvironment_TOKEN),s=(e.value||"").trim();if(!s){t.writer.writeError("unset: missing variable name"),t.process.exit(1,{silent:!0});return}r.has(s)&&r.unset(s)}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.unset.long_description","Remove an environment variable")),t.writeln(),t.writeln(r.t("cli.common.usage","Usage:")),t.writeln(` ${t.wrapInColor("unset VAR",CliForegroundColor.Cyan)}`)}},CliEnvCommandProcessor=class{constructor(){this.command="env",this.aliases=["printenv"],this.description="Display environment variables",this.author=DefaultLibraryAuthor,this.acceptsRawInput=!0,this.metadata={icon:"🌍",module:"system"}}async processCommand(e,t){const r=t.services.getRequired(ICliEnvironment_TOKEN),s=(e.value||"").trim();if(s){const a=r.get(s);a!==void 0?(t.writer.writeln(a),t.process.output(a)):t.process.exit(1,{silent:!0});return}const o=r.getAll(),u=Object.keys(o).sort(),d=[];for(const a of u)d.push(`${a}=${o[a]}`);t.writer.writeln(d.join(`
|
|
154
|
-
`)),t.process.output(d.join(`
|
|
155
|
-
`))}writeDescription(e){const{writer:t,translator:r}=e;t.writeln(r.t("cli.env.long_description","Display environment variables")),t.writeln(),t.writeln(r.t("cli.common.usage","Usage:")),t.writeln(` ${t.wrapInColor("env",CliForegroundColor.Cyan)} ${r.t("cli.env.show_all","Show all variables")}`),t.writeln(` ${t.wrapInColor("printenv VAR",CliForegroundColor.Cyan)} ${r.t("cli.env.show_single","Show single variable")}`)}},DEFAULT_FONT_SIZE=20,MIN_FONT_SIZE=8,MAX_FONT_SIZE=40,STEP=2,CliFontSizeCommandProcessor=class{constructor(){this.command="font-size",this.description="Adjust the terminal font size",this.aliases=["fontsize"],this.author=DefaultLibraryAuthor,this.metadata={icon:CliIcon.Settings,module:"system"},this.stateConfiguration={storeName:"font-size",initialState:{fontSize:DEFAULT_FONT_SIZE}},this.processors=[{command:"increase",description:`Increase font size by ${STEP}px (max ${MAX_FONT_SIZE})`,processCommand:async(e,t)=>{await this.setFontSize(t,this.getCurrent(t)+STEP)}},{command:"decrease",description:`Decrease font size by ${STEP}px (min ${MIN_FONT_SIZE})`,processCommand:async(e,t)=>{await this.setFontSize(t,this.getCurrent(t)-STEP)}},{command:"reset",description:`Reset font size to default (${DEFAULT_FONT_SIZE}px)`,processCommand:async(e,t)=>{await this.setFontSize(t,DEFAULT_FONT_SIZE)}},{command:"set",description:"Set font size to a specific value",valueRequired:!0,acceptsRawInput:!0,processCommand:async(e,t)=>{const r=parseInt(e.value??"",10);if(isNaN(r)||r<MIN_FONT_SIZE||r>MAX_FONT_SIZE){t.writer.writeError(`Font size must be between ${MIN_FONT_SIZE} and ${MAX_FONT_SIZE}`);return}await this.setFontSize(t,r)}}]}async initialize(e){var r;const t=e.state.getState();(t==null?void 0:t.fontSize)!=null&&((r=e.terminal)!=null&&r.options)&&(e.terminal.options.fontSize=t.fontSize)}async processCommand(e,t){const r=this.getCurrent(t);t.writer.writeKeyValue({"Current font size":`${r}px`}),t.writer.writeln(),t.writer.writeln("Usage:"),t.writer.writeln(` ${t.writer.wrapInColor("font-size increase",CliForegroundColor.Cyan)} Increase by ${STEP}px`),t.writer.writeln(` ${t.writer.wrapInColor("font-size decrease",CliForegroundColor.Cyan)} Decrease by ${STEP}px`),t.writer.writeln(` ${t.writer.wrapInColor("font-size set <n>",CliForegroundColor.Cyan)} Set to exact size`),t.writer.writeln(` ${t.writer.wrapInColor("font-size reset",CliForegroundColor.Cyan)} Reset to default (${DEFAULT_FONT_SIZE}px)`)}getCurrent(e){var s,o;const t=(o=(s=e.terminal)==null?void 0:s.options)==null?void 0:o.fontSize;if(t!=null)return t;const r=e.state.getState();return(r==null?void 0:r.fontSize)??DEFAULT_FONT_SIZE}async setFontSize(e,t){var s;const r=Math.min(MAX_FONT_SIZE,Math.max(MIN_FONT_SIZE,t));(s=e.terminal)!=null&&s.options&&(e.terminal.options.fontSize=r),e.state.updateState({fontSize:r}),await e.state.persist(),e.writer.writeSuccess(`Font size set to ${r}px`)}},miscProcessors=[new CliClearCommandProcessor,new CliEchoCommandProcessor,new CliEvalCommandProcessor,new CliAliasCommandProcessor,new CliUnAliasCommandProcessor,new CliSleepCommandProcessor,new CliUnameCommandProcessor,new CliTimeCommandProcessor,new CliJsonCommandProcessor,new CliRandomCommandProcessor,new CliUptimeCommandProcessor,new CliOpenCommandProcessor,new CliLoremCommandProcessor,new CliTimestampCommandProcessor,new CliColorCommandProcessor,new CliCalCommandProcessor,new CliSeqCommandProcessor,new CliScreenCommandProcessor,new CliClipboardCommandProcessor,new CliConvertCommandProcessor,new CliYesCommandProcessor],builtinProcessors=[...miscProcessors,...systemProcessors,new CliThemeCommandProcessor,new CliConfigureCommandProcessor,new CliPingCommandProcessor,new CliExportCommandProcessor,new CliUnsetCommandProcessor,new CliEnvCommandProcessor,new CliFontSizeCommandProcessor,new CliCaptureCommandProcessor,new CliSnippetCommandProcessor,new CliDiffCommandProcessor],CliExecutionProcess=class{constructor(e){this.context=e,this.running=!1,this.outputCalled=!1}exit(e,t){if(e=e??0,this.exited=!0,this.exitCode=e,this.running=!1,!(t!=null&&t.silent))throw new ProcessExitedError(e)}output(e){this.data=e,this.outputCalled=!0}start(){this.exited=void 0,this.exitCode=void 0,this.data=void 0,this.outputCalled=!1,this.running=!0}end(){this.running=!1,this.exited||(this.exitCode=0)}},CliCommandExecutionContext=class{constructor(e,t){this.context=e,this.setCurrentLine=r=>{this.context.setCurrentLine(r)},this.userSession=e.userSession,this.spinner=e.spinner,this.progressBar=e.progressBar,this.textAnimator=e.textAnimator,this.onAbort=e.onAbort,this.signal=e.signal,this.terminal=e.terminal,this.writer=e.writer,this.executor=e.executor,this.clipboard=e.clipboard,this.options=e.options,this.setContextProcessor=e.setContextProcessor,this.clearLine=()=>e.clearLine(),this.showPrompt=r=>e.showPrompt(r),this.clearCurrentLine=()=>e.clearCurrentLine(),this.refreshCurrentLine=()=>e.refreshCurrentLine(),this.process=e.process,this.logger=e.logger,this.services=e.services,this.translator=e.translator,this.reader=e.reader,this.enterFullScreenMode=(r,s)=>e.enterFullScreenMode(r,s),this.exitFullScreenMode=()=>e.exitFullScreenMode(),this.submitCommand=r=>e.submitCommand(r),this.createInterval=(r,s)=>e.createInterval(r,s),this.createTimeout=(r,s)=>e.createTimeout(r,s),this.backgroundServices=e.backgroundServices,this.http=e.http,this.notifier=e.notifier,this.state=e.services.getRequired(CliStateStoreManager_TOKEN).getProcessorStateStore(t)}get promptLength(){return this.context.promptLength}set promptLength(e){this.context.promptLength=e}get currentLine(){return this.context.currentLine}get cursorPosition(){return this.context.cursorPosition}set cursorPosition(e){this.context.cursorPosition=e}},ServiceLogBuffer=class{constructor(e=1e3){this.maxSize=e,this.head=0,this.size=0,this.buffer=new Array(e)}add(e,t="info"){const r={timestamp:new Date,level:t,message:e};this.buffer[this.head]=r,this.head=(this.head+1)%this.maxSize,this.size<this.maxSize&&this.size++}get(e){const t=e!==void 0?Math.min(e,this.size):this.size,r=new Array(t),s=(this.head-t+this.maxSize)%this.maxSize;for(let o=0;o<t;o++)r[o]=this.buffer[(s+o)%this.maxSize];return r}clear(){this.buffer=new Array(this.maxSize),this.head=0,this.size=0}},CliMainThreadServiceRunner=class{constructor(e,t,r,s,o){this.service=e,this.logBuffer=t,this.emitEvent=r,this.sharedState=s,this.sharedServices=o,this.mode="main-thread",this.timers=new Set,this.abortController=null}async start(){this.abortController=new AbortController;const e={signal:this.abortController.signal,emit:t=>{this.emitEvent({...t,timestamp:new Date})},log:(t,r="info")=>{this.logBuffer.add(t,r)},createInterval:(t,r)=>{let s=setInterval(t,r);const o={clear:()=>{clearInterval(s),this.timers.delete(o)},setDelay:u=>{clearInterval(s),s=setInterval(t,u)}};return this.timers.add(o),o},createTimeout:(t,r)=>{const s=setTimeout(()=>{this.timers.delete(o),t()},r),o={clear:()=>{clearTimeout(s),this.timers.delete(o)}};return this.timers.add(o),o},state:this.sharedState,services:this.sharedServices};await this.service.onStart(e)}async stop(){var e;if(this.clearAllTimers(),(e=this.abortController)==null||e.abort(),this.service.onStop&&this.abortController){const t={signal:this.abortController.signal,emit:r=>this.emitEvent({...r,timestamp:new Date}),log:(r,s="info")=>this.logBuffer.add(r,s),createInterval:()=>{throw new Error("Cannot create timers during stop")},createTimeout:()=>{throw new Error("Cannot create timers during stop")},state:this.sharedState,services:this.sharedServices};await this.service.onStop(t)}this.abortController=null}clearAllTimers(){for(const e of this.timers)e.clear();this.timers.clear()}},CliWorkerServiceRunner=class{constructor(e,t,r,s,o){this.service=e,this.logBuffer=t,this.emitEvent=r,this.onStatusChange=s,this.sharedState=o,this.mode="worker",this.worker=null}async start(e){if(!this.service.workerFactory)throw new Error(`Service "${this.service.name}" is workerCompatible but has no workerFactory`);this.worker=this.service.workerFactory(),this.worker.onmessage=r=>{const s=r.data;switch(s.type){case"log":this.logBuffer.add(s.message,s.level);break;case"event":this.emitEvent({...s.event,timestamp:new Date});break;case"state-update":this.sharedState.updateState(s.patch);break;case"status":this.onStatusChange(s.status);break;case"error":this.logBuffer.add(s.message,"error"),this.emitEvent({source:this.service.name,type:"service-error",data:{error:s.message,stack:s.stack},timestamp:new Date}),this.onStatusChange("failed");break}},this.worker.onerror=r=>{this.logBuffer.add(`Worker error: ${r.message}`,"error"),this.onStatusChange("failed")};const t={type:"start",config:e};this.worker.postMessage(t)}async stop(){if(!this.worker)return;const e=this.worker,t={type:"stop"};e.postMessage(t),await Promise.race([new Promise(r=>{const s=e.onmessage;e.onmessage=o=>{s&&s(o),o.data.type==="status"&&o.data.status==="stopped"&&r()}}),new Promise(r=>setTimeout(r,5e3))]),this.terminate()}terminate(){this.worker&&(this.worker.onmessage=null,this.worker.onerror=null,this.worker.terminate(),this.worker=null)}},CliBackgroundServiceRegistry=class{constructor(e,t,r){this.state=e,this.services=t,this.writer=r,this.entries=new Map,this.handlers=[],this.isFullScreen=!1,this.notificationQueue=[]}setProcessRegistry(e){this.processRegistry=e}register(e){if(this.entries.has(e.name))throw new Error(`Service "${e.name}" is already registered`);this.entries.set(e.name,{service:e,status:"pending",logBuffer:new ServiceLogBuffer,runner:null}),this.emitLifecycleEvent("service-registered",e.name,{name:e.name,type:e.type})}async start(e){const t=this.getEntry(e);if(t.status==="running")throw new Error(`Service "${e}" is already running`);if(this.processRegistry){const o=t.service.type==="daemon"?"daemon":t.service.type==="job"?"job":"service",u=this.processRegistry.register(e,{name:e,type:o,onKill:()=>this.stop(e)});t.pid=u.pid}const r=t.service.workerCompatible&&t.service.workerFactory&&typeof Worker<"u",s=t.service.type==="daemon";if(r){const o=new CliWorkerServiceRunner(t.service,t.logBuffer,u=>this.dispatchEvent(u),u=>this.updateStatus(e,u),this.state);if(t.runner=o,t.status="running",t.startedAt=new Date,t.stoppedAt=void 0,t.error=void 0,s)o.start().catch(u=>this.handleStartError(t,e,u));else try{await o.start()}catch(u){this.handleStartError(t,e,u)}this.emitLifecycleEvent("service-started",e,{name:e,mode:"worker"})}else{const o=new CliMainThreadServiceRunner(t.service,t.logBuffer,u=>this.dispatchEvent(u),this.state,this.services);if(t.runner=o,t.status="running",t.startedAt=new Date,t.stoppedAt=void 0,t.error=void 0,s)o.start().catch(u=>this.handleStartError(t,e,u));else try{await o.start()}catch(u){this.handleStartError(t,e,u)}this.emitLifecycleEvent("service-started",e,{name:e,mode:"main-thread"})}}async stop(e){const t=this.getEntry(e);t.status==="running"&&(t.runner&&await t.runner.stop(),t.status="stopped",t.stoppedAt=new Date,t.runner=null,this.completeInProcessRegistry(t,0),this.emitLifecycleEvent("service-stopped",e,{name:e}))}async restart(e){const t=this.getEntry(e);if(t.service.type!=="daemon")throw new Error(`Cannot restart "${e}": only daemon services can be restarted`);t.status==="running"&&await this.stop(e),await this.start(e)}async startJob(e,t,r){const s={name:e,type:"job",async onStart(o){await t(o)}};this.register(s),this.start(e).then(()=>{const o=this.entries.get(e);if(o&&o.status==="running"){const u=o.startedAt?Date.now()-o.startedAt.getTime():0;o.status="done",o.stoppedAt=new Date,o.runner=null,this.completeInProcessRegistry(o,0),this.emitLifecycleEvent("service-completed",e,{name:e,duration:u})}}).catch(o=>{const u=this.entries.get(e);if(u){const d=o instanceof Error?o:new Error(String(o));u.status="failed",u.error=d.message,u.stoppedAt=new Date,u.runner=null,this.failInProcessRegistry(u),this.emitLifecycleEvent("service-failed",e,{name:e,error:d.message})}})}getStatus(e){const t=this.entries.get(e);if(t)return this.toInfo(t)}list(){return Array.from(this.entries.values()).map(e=>this.toInfo(e))}getLogs(e,t){return this.getEntry(e).logBuffer.get(t)}on(e,t){const r={handler:e,filter:t};return this.handlers.push(r),()=>{const s=this.handlers.indexOf(r);s>=0&&this.handlers.splice(s,1)}}async destroyAll(){const e=Array.from(this.entries.values()).filter(t=>t.status==="running");await Promise.allSettled(e.map(async t=>{try{t.runner&&(await Promise.race([t.runner.stop(),new Promise(r=>setTimeout(r,5e3))]),t.runner instanceof CliWorkerServiceRunner&&t.runner.terminate())}catch{}t.status="stopped",t.stoppedAt=new Date,t.runner=null})),this.entries.clear(),this.handlers.length=0}setFullScreen(e){this.isFullScreen=e,e||this.flushNotificationQueue()}getEntry(e){const t=this.entries.get(e);if(!t)throw new Error(`No service registered with name "${e}"`);return t}toInfo(e){const t=e.runner?e.runner.mode:"main-thread",r=e.status==="running"&&e.startedAt?Date.now()-e.startedAt.getTime():void 0;return{pid:e.pid,name:e.service.name,description:e.service.description,type:e.service.type,status:e.status,executionMode:t,startedAt:e.startedAt,stoppedAt:e.stoppedAt,error:e.error,uptime:r}}updateStatus(e,t){const r=this.entries.get(e);if(!r)return;const s=r.status;r.status=t,t==="stopped"||t==="done"?(r.stoppedAt=new Date,r.runner=null,this.completeInProcessRegistry(r,0)):t==="failed"&&(r.stoppedAt=new Date,r.runner=null,this.failInProcessRegistry(r)),this.emitLifecycleEvent("status-change",e,{name:e,from:s,to:t})}handleStartError(e,t,r){const s=r instanceof Error?r:new Error(String(r));e.status="failed",e.error=s.message,e.stoppedAt=new Date,e.runner=null,e.logBuffer.add(`Failed to start: ${s.message}`,"error"),this.failInProcessRegistry(e),e.service.onError&&e.service.onError(s,{}),this.emitLifecycleEvent("service-failed",t,{name:t,error:s.message})}dispatchEvent(e){const t=e.timestamp?e:{...e,timestamp:new Date};for(const{handler:s,filter:o}of this.handlers)if(!(o!=null&&o.source&&o.source!==t.source)&&!(o!=null&&o.type&&o.type!==t.type))try{s(t)}catch{}const r=t.data;r!=null&&r.notify&&this.notify(t)}emitLifecycleEvent(e,t,r){this.dispatchEvent({source:t,type:e,data:r,timestamp:new Date})}notify(e){if(this.isFullScreen){this.notificationQueue.push(e);return}this.writeNotification(e)}flushNotificationQueue(){for(const e of this.notificationQueue)this.writeNotification(e);this.notificationQueue=[]}writeNotification(e){if(!this.writer)return;const t=e.data,r=(t==null?void 0:t.message)??(t==null?void 0:t.error)??e.type;this.writer.writeln(""),this.writer.writeln(`┌─ [${e.source}] ${r}`),this.writer.writeln("└"+"─".repeat(40))}completeInProcessRegistry(e,t){e.pid!==void 0&&this.processRegistry&&this.processRegistry.complete(e.pid,t)}failInProcessRegistry(e){e.pid!==void 0&&this.processRegistry&&this.processRegistry.fail(e.pid)}},CliHttpClient=class{constructor(e){this.signal=e}async fetch(e,t){return fetch(e,{...t,signal:this.mergeSignal(t==null?void 0:t.signal)})}async get(e,t){return this.jsonRequest("GET",e,void 0,t)}async post(e,t,r){return this.jsonRequest("POST",e,t,r)}async put(e,t,r){return this.jsonRequest("PUT",e,t,r)}async patch(e,t,r){return this.jsonRequest("PATCH",e,t,r)}async delete(e,t){return this.jsonRequest("DELETE",e,void 0,t)}async head(e,t){const{timeout:r,signal:s,...o}=t??{};let u,d;r&&(u=new AbortController,d=setTimeout(()=>u.abort(),r));try{return await fetch(e,{...o,method:"HEAD",signal:this.mergeSignal(s,u==null?void 0:u.signal)})}finally{d!==void 0&&clearTimeout(d)}}async options(e,t){return this.jsonRequest("OPTIONS",e,void 0,t)}async jsonRequest(e,t,r,s){const{timeout:o,...u}=s??{},d=new Headers(u.headers);let a;r!=null&&(this.isRawBody(r)?a=r:(a=JSON.stringify(r),d.has("Content-Type")||d.set("Content-Type","application/json")));let l,f;o&&(f=new AbortController,l=setTimeout(()=>f.abort(),o));const C=this.mergeSignal(u.signal,f==null?void 0:f.signal);try{const h=await fetch(t,{...u,method:e,headers:d,body:a,signal:C});if(!h.ok){let U=`${h.status} ${h.statusText}`,W;try{W=await h.json();const H=W;H.error?U=H.error:H.message&&(U=H.message)}catch{}throw new CliHttpError(U,h.status,h.statusText,W)}const j=await h.text();return j?JSON.parse(j):void 0}finally{l!==void 0&&clearTimeout(l)}}isRawBody(e){return typeof e=="string"||e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||e instanceof URLSearchParams||e instanceof ReadableStream}mergeSignal(...e){const t=[];this.signal&&t.push(this.signal);for(const s of e)s&&t.push(s);if(t.length===0)return;if(t.length===1)return t[0];if(typeof AbortSignal.any=="function")return AbortSignal.any(t);const r=new AbortController;for(const s of t){if(s.aborted)return r.abort(s.reason),r.signal;s.addEventListener("abort",()=>r.abort(s.reason),{once:!0})}return r.signal}},CliNotifier=class{constructor(){this._change$=new Subject,this.change$=this._change$.asObservable()}get current(){return this._current}info(e){this.set("info",e)}success(e){this.set("success",e)}warn(e){this.set("warn",e)}error(e){this.set("error",e)}clear(){this._current=void 0,this._change$.next(void 0)}set(e,t){this._current={level:e,message:t,timestamp:Date.now()},this._change$.next(this._current)}},CliFullScreenManager=class{constructor(e,t){this.terminal=e,this.backgroundServices=t,this.resizeDisposable=null}enter(e,t,r,s){this.terminal.write("\x1B[?1049h"),this.terminal.write("\x1B[H"),s!=null&&s.showCursor?this.terminal.write("\x1B[?25h"):this.terminal.write("\x1B[?25l"),this.backgroundServices.setFullScreen(!0),t(e,!0,!0),e.onResize&&(this.resizeDisposable=this.terminal.onResize(({cols:o,rows:u})=>{e.onResize(o,u,r)}))}exit(e,t,r,s,o){var d;const u=e;this.backgroundServices.setFullScreen(!1),r(),(d=this.resizeDisposable)==null||d.dispose(),this.resizeDisposable=null,u!=null&&u.onDispose&&u.onDispose(o),this.terminal.write("\x1B[?25h"),this.terminal.write("\x1B[?1049l"),t(void 0),s()}dispose(){var e;(e=this.resizeDisposable)==null||e.dispose(),this.resizeDisposable=null}},CliTimerManager=class{constructor(){this.managedTimers=new Set}createInterval(e,t){let r=setInterval(e,t);const s={clear:()=>{clearInterval(r),this.managedTimers.delete(s)},setDelay:o=>{clearInterval(r),r=setInterval(e,o)}};return this.managedTimers.add(s),s}createTimeout(e,t){const r=setTimeout(()=>{this.managedTimers.delete(s),e()},t),s={clear:()=>{clearTimeout(r),this.managedTimers.delete(s)}};return this.managedTimers.add(s),s}clearAll(){for(const e of this.managedTimers)e.clear();this.managedTimers.clear()}},CliTerminalWriter=class{constructor(e){this.terminal=e}write(e){this.terminal.write(e)}writeln(e){this.terminal.writeln(e||"")}writeSuccess(e){this.writeLog(e,CliForegroundColor.Green,CliIcon.CheckIcon)}writeInfo(e){this.writeLog(e,CliForegroundColor.Cyan,CliIcon.InfoIcon)}writeWarning(e){this.writeLog(e,CliForegroundColor.Yellow,CliIcon.WarningIcon)}writeError(e){this.writeLog(e,CliForegroundColor.Red,CliIcon.CrossIcon)}writeLog(e,t,r){this.terminal.writeln(this.wrapInColor(r?r+" "+e:e,t))}writeDivider(e){const{color:t,length:r,char:s}=e||{};let o=r??80;const u=s??"-";this.terminal.cols<o&&(o=this.terminal.cols);let d=u.repeat(o);t&&(d=this.wrapInColor(d,t)),this.writeln(d)}wrapInColor(e,t){return t+e+CliForegroundColor.Reset}wrapInBackgroundColor(e,t){return t+e+CliForegroundColor.Reset}writeJson(e){this.terminal.writeln(formatJson(e))}writeToFile(e,t){const r=new Blob([t],{type:"text/plain"}),s=document.createElement("a");s.href=URL.createObjectURL(r),s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s)}writeObjectsAsTable(e){if(e.length===0){this.writeInfo("No objects to display");return}const t=Object.keys(e[0]),r=e.map(s=>t.map(o=>s[o]));this.writeTable(t,r)}writeList(e,t){const{ordered:r,prefix:s,color:o}=t||{};e.forEach((u,d)=>{const l=` ${s??(r?`${d+1}.`:"•")} ${u}`;this.writeln(o?this.wrapInColor(l,o):l)})}writeKeyValue(e,t){const r=Array.isArray(e)?e:Object.entries(e),s=Math.max(...r.map(([d])=>d.length)),o=(t==null?void 0:t.separator)??":",u=(t==null?void 0:t.keyColor)??CliForegroundColor.Yellow;for(const[d,a]of r){const l=d.padEnd(s);this.writeln(` ${this.wrapInColor(l,u)} ${o} ${a}`)}}writeColumns(e,t){const r=(t==null?void 0:t.columns)??3,s=(t==null?void 0:t.padding)??2,o=Math.max(...e.map(u=>u.length))+s;for(let u=0;u<e.length;u+=r){const d=e.slice(u,u+r);this.writeln(d.map(a=>a.padEnd(o)).join(""))}}writeLink(e,t){this.writeln(`\x1B]8;;${t}\x07${e}\x1B]8;;\x07`)}writeBox(e,t){const r=Array.isArray(e)?e:[e],s=(t==null?void 0:t.padding)??1,o=t==null?void 0:t.borderColor,u=f=>o?this.wrapInColor(f,o):f,a=Math.max(...r.map(f=>visibleLength(f)),t!=null&&t.title?visibleLength(t.title)+2:0)+s*2;if(t!=null&&t.title){const f=` ${t.title} `,C=a-visibleLength(f),h=Math.floor(C/2),j=C-h;this.writeln(u("┌"+"─".repeat(h)+f+"─".repeat(j)+"┐"))}else this.writeln(u("┌"+"─".repeat(a)+"┐"));const l=" ".repeat(s);for(const f of r){const C=a-s*2-visibleLength(f);this.writeln(u("│")+l+f+" ".repeat(Math.max(0,C))+l+u("│"))}this.writeln(u("└"+"─".repeat(a)+"┘"))}writeIndented(e,t=1){const r=" ".repeat(t);this.writeln(`${r}${e}`)}writeTable(e,t,r){const s=this.terminal.cols,o=e.map((j,U)=>Math.max(visibleLength(j),...t.map(W=>visibleLength(W[U]??"")))),u=(e.length-1)*3,d=s-u,a=o.reduce((j,U)=>j+U,0);let l;if(a<=d||d<e.length){if(l=[...o],r!=null&&r.fullWidth&&a<d){const j=d-a;let U=0;l=o.map((W,H)=>{const x=H<l.length-1?Math.floor(W/a*j):j-U;return U+=x,W+x})}}else{l=o.map(W=>Math.max(4,Math.floor(W/a*d)));let U=l.reduce((W,H)=>W+H,0);for(let W=0;U<d&&W<l.length;W++){const H=o.indexOf(Math.max(...o.filter((x,L)=>L>=W)));l[H]++,U++}}const f=(j,U)=>{const W=j??"";return visibleLength(W)<=U?W:stripAnsi(W).slice(0,Math.max(0,U-1))+"…"},C=(j,U)=>{const W=f(j,U),H=visibleLength(W),x=Math.max(0,U-H);return W+" ".repeat(x)};this.write(e.map((j,U)=>this.wrapInColor(C(j,l[U]),CliForegroundColor.Yellow)).join(" | ")+`\r
|
|
156
|
-
`);const h=Math.min(s,l.reduce((j,U)=>j+U+3,-3));this.write("-".repeat(h)+`\r
|
|
157
|
-
`),t.forEach(j=>{this.write(j.map((U,W)=>C(U,l[W])).join(" | ")+`\r
|
|
158
|
-
`)})}},CliTerminalSpinner=class{constructor(e){this.terminal=e,this.isRunning=!1,this.text="",this.spinnerFrames=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],this.spinnerColors=["\x1B[38;5;39m","\x1B[38;5;45m","\x1B[38;5;49m","\x1B[38;5;48m","\x1B[38;5;83m","\x1B[38;5;118m","\x1B[38;5;154m","\x1B[38;5;220m","\x1B[38;5;214m","\x1B[38;5;171m"],this.spinnerIndex=0,this.savedCurrentLine="",this.lastContentLength=0,this.lastLineCount=1}show(e){e&&(this.text=e),!this.isRunning&&(this.context&&(this.savedCurrentLine=this.context.currentLine,this.context.setCurrentLine("")),this.lastContentLength=0,this.lastLineCount=1,this.isRunning=!0,this.resizeDisposable=this.terminal.onResize(()=>{this.lastLineCount=Math.max(this.lastLineCount,this.calcLineCount(this.lastContentLength))}),this.spinnerInterval=setInterval(()=>{this.clearCurrentLine();const t="\x1B[0m",r=this.spinnerFrames[this.spinnerIndex],s=this.spinnerColors[this.spinnerIndex%this.spinnerColors.length],o=this.text.length>0?` ${this.text}`:"",u=`${s}${r}${t}${o}`,d=1+o.length;this.terminal.write(u),this.lastContentLength=d,this.lastLineCount=this.calcLineCount(d),this.context&&this.context.setCurrentLine(u),this.spinnerIndex=(this.spinnerIndex+1)%this.spinnerFrames.length},80))}hide(){var e;this.isRunning=!1,this.spinnerInterval&&(clearInterval(this.spinnerInterval),this.spinnerInterval=null),(e=this.resizeDisposable)==null||e.dispose(),this.resizeDisposable=void 0,this.clearCurrentLine(),this.context&&this.context.setCurrentLine(this.savedCurrentLine),this.text="",this.savedCurrentLine="",this.lastContentLength=0,this.lastLineCount=1}setText(e){this.text=e}clearCurrentLine(){const e=Math.max(this.lastLineCount,this.calcLineCount(this.lastContentLength));for(let t=0;t<e;t++)this.terminal.write("\x1B[2K"),t<e-1&&this.terminal.write("\x1B[A");this.terminal.write("\r")}calcLineCount(e){return Math.max(1,Math.ceil(e/this.terminal.cols))}},CliTerminalProgressBar=class{constructor(e){this.terminal=e,this.isRunning=!1,this.text="",this.progress=0,this.total=100,this.progressText="",this.progressTextPlainLength=0,this.savedCurrentLine="",this.tickCount=0,this.lastLineCount=1}show(e){this.isRunning=!0,this.progress=0,this.tickCount=0,this.lastLineCount=1,this.text=e||"",this.context&&(this.savedCurrentLine=this.context.currentLine,this.context.setCurrentLine("")),this.resizeDisposable=this.terminal.onResize(()=>{this.lastLineCount=Math.max(this.lastLineCount,this.calcLineCount(this.progressTextPlainLength))}),this.progressBarInterval=setInterval(()=>{if(this.tickCount++,this.tickCount%3===0&&this.progress<90){const t=this.progress<30?2:this.progress<60?1:.5;this.progress=Math.min(90,this.progress+t)}this.updateProgressBar(),this.progress>this.total&&(this.progress=this.total,this.hide())},100)}hide(){var e;this.isRunning=!1,this.progressBarInterval&&(clearInterval(this.progressBarInterval),this.progressBarInterval=null),(e=this.resizeDisposable)==null||e.dispose(),this.resizeDisposable=void 0,this.clearCurrentLine(),this.context&&this.context.setCurrentLine(this.savedCurrentLine),this.text="",this.progressText="",this.progressTextPlainLength=0,this.savedCurrentLine="",this.lastLineCount=1}update(e,t){(t==null?void 0:t.type)==="increment"?this.progress+=e:this.progress=e,this.progress>this.total&&(this.progress=this.total),this.updateProgressBar()}complete(){this.progress=100,this.hide()}setText(e){this.text=e,this.updateProgressBar()}updateProgressBar(){const e=Math.round(this.progress),t=30,r=Math.round(e/this.total*t),s=t-r,o="\x1B[0m",u="\x1B[36m",d="\x1B[1;36m",a="\x1B[2m",l=this.tickCount%(r+4);let f="";for(let W=0;W<r;W++){const H=W>=l-1&&W<=l;f+=`${H?d:u}━${o}`}const C=`${a}${"─".repeat(s)}${o}`,h=`${u}[${o}${f}${C}${u}]${o}`,j=`${u}${e}%${o}`.padStart(4," "),U=this.text.length>0?` ${a}${this.text}${o}`:"";this.clearCurrentLine(),this.progressText=`${h} ${j} ${U}`,this.progressTextPlainLength=1+t+1+1+4+1+this.text.length+1,this.terminal.write(this.progressText),this.lastLineCount=this.calcLineCount(this.progressTextPlainLength),this.context&&this.context.setCurrentLine(this.progressText)}clearCurrentLine(){const e=Math.max(this.lastLineCount,this.calcLineCount(this.progressTextPlainLength));for(let t=0;t<e;t++)this.terminal.write("\x1B[2K"),t<e-1&&this.terminal.write("\x1B[A");this.terminal.write("\r")}calcLineCount(e){return Math.max(1,Math.ceil(e/this.terminal.cols))}},CliTerminalTextAnimator=class{constructor(e){this.terminal=e,this.isRunning=!1,this.text="",this.textColor="\x1B[38;5;249m"}show(e){this.showText(e||"")}showText(e,t){var l;const{speed:r,removeAfterTyping:s}=t||{};if(this.isRunning)return Promise.resolve();this.isRunning=!0,this.text=e||this.text;const o=((l=this.context)==null?void 0:l.currentLine)||"";let u=0,d=!0;const a="\x1B[0m";return new Promise(f=>{this.animationInterval=setInterval(()=>{if(d){const C=this.text[u];this.terminal.write(`${this.textColor}${C}${a}`),u++,u===this.text.length&&(d=!1)}else s?(clearInterval(this.animationInterval),this.animationInterval=null,delay(1e3).then(()=>{this.context&&(this.context.setCurrentLine(o+this.text),this.context.clearCurrentLine()),this.isRunning=!1,f()})):(this.terminal.write("\b \b"),u--,u<0&&(clearInterval(this.animationInterval),this.animationInterval=null,this.isRunning=!1,f()))},r||100)})}hide(){this.isRunning&&(this.isRunning=!1,this.animationInterval&&(clearInterval(this.animationInterval),this.animationInterval=null),this.text="")}},CliClipboard=class{constructor(e){this.context=e}async write(e){try{await navigator.clipboard.writeText(e)}catch{this.context.writer.writeError("Failed to write to clipboard")}}async read(){try{return await navigator.clipboard.readText()}catch{return this.context.writer.writeError("Failed to read from clipboard"),""}}},InputModeBase=class{constructor(e,t){this.host=e,this.resolve=t,this._resolved=!1,this.extraLines=0}get isResolved(){return this._resolved}handleKeyEvent(e){return e.code==="KeyC"&&e.ctrlKey||e.code==="Escape"?(this.abort(),!1):!0}resolveAndPop(e){this._resolved||(this._resolved=!0,this.host.terminal.write(`\r
|
|
159
|
-
`),this.host.popMode(),this.resolve(e))}abort(){this._resolved||(this._resolved=!0,this.host.terminal.write(`\r
|
|
160
|
-
`),this.host.popMode(),this.resolve(null))}redrawLine(e,t,r){let s="";if(this.extraLines>0){s+="\x1B[s";for(let u=0;u<this.extraLines;u++)s+="\x1B[B\x1B[2K";s+="\x1B[u",this.extraLines=0}s+="\x1B[2K\r"+e+t;const o=t.length-r;o>0&&(s+=`\x1B[${o}D`),this.host.terminal.write(s)}writeHelp(e){this.extraLines++,this.host.terminal.write(`\r
|
|
161
|
-
\x1B[2m${e}\x1B[0m\x1B[${this.extraLines}A`)}writeError(e){this.extraLines++,this.host.terminal.write(`\r
|
|
162
|
-
\x1B[31m✘ ${e}\x1B[0m\x1B[${this.extraLines}A`)}clearExtraLines(){if(this.extraLines>0){let e="\x1B[s";for(let t=0;t<this.extraLines;t++)e+="\x1B[B\x1B[2K";e+="\x1B[u",this.host.terminal.write(e),this.extraLines=0}}},LineInputMode=class extends InputModeBase{constructor(e,t,r,s){super(e,t),this.promptText=r,this.options=s,this.hasError=!1,this.buffer=(s==null?void 0:s.default)??"",this.cursorPosition=this.buffer.length}activate(){var t;const e=`\x1B[36m?\x1B[0m ${this.promptText}`;this.host.writeToTerminal(e),this.buffer?this.host.writeToTerminal(this.buffer):(t=this.options)!=null&&t.placeholder&&(this.host.writeToTerminal(`\x1B[2m${this.options.placeholder}\x1B[0m`),this.host.terminal.write(`\x1B[${this.options.placeholder.length}D`))}async handleInput(e){var t,r;if(this.hasError&&(this.hasError=!1,this.clearExtraLines()),e==="\r"){if((t=this.options)!=null&&t.validate){const s=this.options.validate(this.buffer);if(s){this.hasError=!0,this.writeError(s);return}}this.resolveAndPop(this.buffer)}else if(e==="")this.cursorPosition>0&&(this.buffer=this.buffer.slice(0,this.cursorPosition-1)+this.buffer.slice(this.cursorPosition),this.cursorPosition--,this.renderLine());else if(e==="\x1B[D")this.cursorPosition>0&&(this.cursorPosition--,this.host.terminal.write(e));else if(e==="\x1B[C")this.cursorPosition<this.buffer.length&&(this.cursorPosition++,this.host.terminal.write(e));else if(!e.startsWith("\x1B")){const s=e.replace(/[\r\n]+/g,"");this.buffer=this.buffer.slice(0,this.cursorPosition)+s+this.buffer.slice(this.cursorPosition),this.cursorPosition+=s.length,this.cursorPosition===this.buffer.length&&this.extraLines===0&&!this.hasError&&!((r=this.options)!=null&&r.placeholder&&this.buffer.length===s.length)?this.host.terminal.write(s):this.renderLine()}}onResize(){this.renderLine()}renderLine(){var t;const e=`\x1B[36m?\x1B[0m ${this.promptText}`;if(this.buffer.length===0&&((t=this.options)!=null&&t.placeholder)){const r=`\x1B[2m${this.options.placeholder}\x1B[0m`;this.redrawLine(e,r,0)}else this.redrawLine(e,this.buffer,this.cursorPosition)}},PasswordInputMode=class extends InputModeBase{constructor(e,t,r){super(e,t),this.promptText=r,this.buffer=""}activate(){const e=`\x1B[36m?\x1B[0m ${this.promptText}`;this.host.writeToTerminal(e)}async handleInput(e){if(e==="\r")this.resolveAndPop(this.buffer);else if(e==="")this.buffer.length>0&&(this.buffer=this.buffer.slice(0,-1),this.renderLine());else if(!e.startsWith("\x1B")){const t=e.replace(/[\r\n]+/g,"");this.buffer+=t,this.extraLines===0?this.host.terminal.write("*".repeat(t.length)):this.renderLine()}}onResize(){this.renderLine()}renderLine(){const e=`\x1B[36m?\x1B[0m ${this.promptText}`,t="*".repeat(this.buffer.length);this.redrawLine(e,t,t.length)}},ConfirmInputMode=class extends InputModeBase{constructor(e,t,r,s=!1){super(e,t),this.promptText=r,this.defaultValue=s,this.buffer=""}activate(){const e=this.defaultValue?"(Y/n)":"(y/N)",t=`\x1B[36m?\x1B[0m ${this.promptText} ${e}: `;this.host.writeToTerminal(t)}async handleInput(e){if(e==="\r")if(this.buffer==="")this.resolveAndPop(this.defaultValue);else{const t=this.buffer.toLowerCase();t==="y"?this.resolveAndPop(!0):t==="n"&&this.resolveAndPop(!1)}else if(e==="")this.buffer.length>0&&(this.buffer=this.buffer.slice(0,-1),this.renderLine());else if(!e.startsWith("\x1B")){const t=e.toLowerCase();(t==="y"||t==="n")&&(this.buffer=t,this.renderLine())}}onResize(){this.renderLine()}renderLine(){const e=this.defaultValue?"(Y/n)":"(y/N)",t=`\x1B[36m?\x1B[0m ${this.promptText} ${e}: `;this.redrawLine(t,this.buffer,this.buffer.length)}},NumberInputMode=class extends InputModeBase{constructor(e,t,r,s){super(e,t),this.promptText=r,this.options=s,this.hasError=!1,this.buffer=(s==null?void 0:s.default)!=null?String(s.default):"",this.cursorPosition=this.buffer.length}activate(){const e=this.buildPrompt();this.host.writeToTerminal(e),this.buffer&&this.host.writeToTerminal(this.buffer)}async handleInput(e){var t,r,s;if(this.hasError&&(this.hasError=!1,this.clearExtraLines()),e==="\r"){if(this.buffer===""||this.buffer==="-"){((t=this.options)==null?void 0:t.default)!=null&&this.resolveAndPop(this.options.default);return}const o=parseInt(this.buffer,10);if(isNaN(o)){this.hasError=!0,this.writeError("Please enter a valid number");return}if(((r=this.options)==null?void 0:r.min)!=null&&o<this.options.min){this.hasError=!0,this.writeError(`Value must be at least ${this.options.min}`);return}if(((s=this.options)==null?void 0:s.max)!=null&&o>this.options.max){this.hasError=!0,this.writeError(`Value must be at most ${this.options.max}`);return}this.resolveAndPop(o)}else if(e==="")this.cursorPosition>0&&(this.buffer=this.buffer.slice(0,this.cursorPosition-1)+this.buffer.slice(this.cursorPosition),this.cursorPosition--,this.renderLine());else if(e==="\x1B[D")this.cursorPosition>0&&(this.cursorPosition--,this.host.terminal.write(e));else if(e==="\x1B[C")this.cursorPosition<this.buffer.length&&(this.cursorPosition++,this.host.terminal.write(e));else if(!e.startsWith("\x1B")){for(const o of e)o>="0"&&o<="9"?(this.buffer=this.buffer.slice(0,this.cursorPosition)+o+this.buffer.slice(this.cursorPosition),this.cursorPosition++):o==="-"&&this.cursorPosition===0&&!this.buffer.startsWith("-")&&(this.buffer="-"+this.buffer,this.cursorPosition++);this.renderLine()}}onResize(){this.renderLine()}buildPrompt(){const{min:e,max:t}=this.options??{};let r="";return e!=null&&t!=null?r=` \x1B[2m(${e}–${t})\x1B[0m`:e!=null?r=` \x1B[2m(min: ${e})\x1B[0m`:t!=null&&(r=` \x1B[2m(max: ${t})\x1B[0m`),`\x1B[36m?\x1B[0m ${this.promptText}${r}`}renderLine(){const e=this.buildPrompt();this.redrawLine(e,this.buffer,this.cursorPosition)}},SelectInputMode=class extends InputModeBase{constructor(e,t,r,s,o){super(e,t),this.promptText=r,this.options=s,this.selectOptions=o,this.selectedIndex=0,this.scrollOffset=0,this.filter="",this.renderedLines=0,this.filteredOptions=[...s],this.maxVisible=Math.min(s.length,e.getTerminalRows()-4)}activate(){var e;if(this.host.terminal.write("\x1B[?25l"),(e=this.selectOptions)!=null&&e.default){const t=this.filteredOptions.findIndex(r=>r.value===this.selectOptions.default);t>=0&&(this.selectedIndex=t,this.selectedIndex>=this.maxVisible&&(this.scrollOffset=this.selectedIndex-this.maxVisible+1))}else this.selectedIndex=this.findNextSelectable(-1,1);this.renderAll()}handleKeyEvent(e){var t;return(t=this.selectOptions)!=null&&t.searchable&&this.filter.length>0&&e.code==="Escape"?(this.clearFilter(),!1):super.handleKeyEvent(e)}resolveAndPop(e){this.clearRenderedLines();const t=this.options.find(s=>s.value===e),r=t?t.label:e;this.host.terminal.write("\x1B[2K\r"),this.host.terminal.write(`\x1B[32m✔\x1B[0m ${this.promptText} \x1B[36m${r}\x1B[0m`),this.host.terminal.write("\x1B[?25h"),super.resolveAndPop(e)}abort(){this.clearRenderedLines(),this.host.terminal.write("\x1B[2K\r"),this.host.terminal.write(`\x1B[33m✘\x1B[0m ${this.promptText} \x1B[2mcancelled\x1B[0m`),this.host.terminal.write("\x1B[?25h"),super.abort()}async handleInput(e){var t,r;if(e==="\x1B[A")this.moveSelection(-1);else if(e==="\x1B[B")this.moveSelection(1);else if(e==="\r"){const o=this.buildDisplayList().filter(u=>u.type==="option"&&!u.option.disabled);if(o.length>0&&this.selectedIndex<o.length){const u=o[this.selectedIndex];this.resolveAndPop(u.option.value)}}else e===""?(t=this.selectOptions)!=null&&t.searchable&&this.filter.length>0&&(this.filter=this.filter.slice(0,-1),this.applyFilter(),this.renderAll()):e.startsWith("\x1B")||(r=this.selectOptions)!=null&&r.searchable&&e.length===1&&e>=" "&&(this.filter+=e,this.applyFilter(),this.renderAll())}onResize(e,t){this.maxVisible=Math.min(this.filteredOptions.length,t-4),this.scrollOffset+this.maxVisible>this.getSelectableCount()&&(this.scrollOffset=Math.max(0,this.getSelectableCount()-this.maxVisible)),this.renderAll()}buildDisplayList(){const e=[];let t;for(const r of this.filteredOptions)r.group&&r.group!==t&&(e.push({type:"group-header",groupName:r.group}),t=r.group),e.push({type:"option",option:r});return e}getSelectableCount(){return this.filteredOptions.filter(e=>!e.disabled).length}moveSelection(e){var o;const t=this.getSelectableCount();if(t===0)return;let r=this.selectedIndex+e;r<0&&(r=t-1),r>=t&&(r=0),this.selectedIndex=r,this.selectedIndex<this.scrollOffset?this.scrollOffset=this.selectedIndex:this.selectedIndex>=this.scrollOffset+this.maxVisible&&(this.scrollOffset=this.selectedIndex-this.maxVisible+1);const s=this.filteredOptions.filter(u=>!u.disabled);(o=this.selectOptions)!=null&&o.onChange&&s[this.selectedIndex]&&this.selectOptions.onChange(s[this.selectedIndex].value),this.renderAll()}findNextSelectable(e,t){const r=this.filteredOptions.length;if(r===0)return 0;let s=e+t;for(let o=0;o<r;o++){if(s<0&&(s=r-1),s>=r&&(s=0),!this.filteredOptions[s].disabled)return s;s+=t}return 0}applyFilter(){if(this.filter.length===0)this.filteredOptions=[...this.options];else{const t=this.filter.toLowerCase();this.filteredOptions=this.options.filter(r=>r.label.toLowerCase().includes(t))}this.selectedIndex=0,this.scrollOffset=0,this.maxVisible=Math.min(this.filteredOptions.length,this.host.getTerminalRows()-4),this.filteredOptions.filter(t=>!t.disabled).length>0&&(this.selectedIndex=0)}clearFilter(){this.filter="",this.applyFilter(),this.renderAll()}renderAll(){this.clearRenderedLines(),this.renderPrompt(),this.renderOptions(),this.renderHelpBar(),this.renderedLines>0&&this.host.terminal.write(`\x1B[${this.renderedLines}A`)}clearRenderedLines(){if(this.renderedLines>0){this.host.terminal.write("\x1B[s");for(let e=0;e<this.renderedLines;e++)this.host.terminal.write("\x1B[B\x1B[2K");this.host.terminal.write("\x1B[u"),this.renderedLines=0}}renderPrompt(){var e;this.host.terminal.write("\x1B[2K\r"),(e=this.selectOptions)!=null&&e.searchable?this.filter.length>0?this.host.terminal.write(`\x1B[36m?\x1B[0m ${this.promptText}: ${this.filter}`):this.host.terminal.write(`\x1B[36m?\x1B[0m ${this.promptText}: \x1B[2mType to filter...\x1B[0m`):this.host.terminal.write(`\x1B[36m?\x1B[0m ${this.promptText}:`)}renderOptions(){const e=this.buildDisplayList(),t=this.filteredOptions.filter(d=>!d.disabled),r=this.scrollOffset,s=Math.min(t.length,this.scrollOffset+this.maxVisible);r>0&&(this.host.terminal.write(`\r
|
|
163
|
-
\x1B[2m ↑ ${r} more above\x1B[0m`),this.renderedLines++);let o=0;for(const d of e)if(d.type==="group-header")this.isGroupVisible(d.groupName,e,r,s)&&(this.host.terminal.write(`\r
|
|
164
|
-
\x1B[35m── ${d.groupName} ──\x1B[0m`),this.renderedLines++);else{const a=d.option;if(a.disabled)this.isDisabledOptionVisible(e,d,r,s)&&(this.renderOptionLine(a,!1,!1),this.renderedLines++);else{if(o>=r&&o<s){const l=o===this.selectedIndex;this.renderOptionLine(a,l,!1),this.renderedLines++}o++}}const u=t.length-s;u>0&&(this.host.terminal.write(`\r
|
|
165
|
-
\x1B[2m ↓ ${u} more below\x1B[0m`),this.renderedLines++)}isGroupVisible(e,t,r,s){let o=0;for(const u of t)if(u.type==="option"&&!u.option.disabled){if(u.option.group===e&&o>=r&&o<s)return!0;o++}return!1}isDisabledOptionVisible(e,t,r,s){const o=e.indexOf(t);let u=0;for(let d=0;d<e.length;d++)if(e[d].type==="option"&&!e[d].option.disabled){if(d>o)return u>=r&&u<s;u++}return u>0&&u-1>=r&&u-1<s}renderOptionLine(e,t,r){const s=this.highlightMatch(e.label),o=e.description?` \x1B[2;3m— ${e.description}\x1B[0m`:"";e.disabled?this.host.terminal.write(`\r
|
|
166
|
-
\x1B[2m${e.label}${o} (disabled)\x1B[0m`):t?this.host.terminal.write(`\r
|
|
167
|
-
\x1B[48;5;24m\x1B[38;5;117m❯ ${s}${o}\x1B[0m`):this.host.terminal.write(`\r
|
|
168
|
-
${s}${o}`)}highlightMatch(e){if(!this.filter||this.filter.length===0)return e;const t=e.toLowerCase(),r=this.filter.toLowerCase(),s=t.indexOf(r);if(s<0)return e;const o=e.substring(0,s),u=e.substring(s,s+this.filter.length),d=e.substring(s+this.filter.length);return`${o}\x1B[33m${u}\x1B[0m${d}`}renderHelpBar(){var t;let e;if((t=this.selectOptions)!=null&&t.searchable)if(this.filter.length>0){const r=this.filteredOptions.filter(o=>!o.disabled).length,s=this.options.filter(o=>!o.disabled).length;e=`${r} of ${s} matches · backspace to clear filter · enter to select · esc to cancel`}else e="↑/↓ navigate · type to filter · enter to select · esc to cancel";else e="↑/↓ navigate · enter to select · esc to cancel";this.host.terminal.write(`\r
|
|
169
|
-
\x1B[2m${e}\x1B[0m`),this.renderedLines++}},InlineSelectInputMode=class extends InputModeBase{constructor(e,t,r,s,o){super(e,t),this.promptText=r,this.options=s,this.selectOptions=o,this.selectedIndex=0,this.visibleStart=0,this.visibleEnd=0,this.selectableOptions=s.filter(u=>!u.disabled)}activate(){var e;if(this.host.terminal.write("\x1B[?25l"),(e=this.selectOptions)!=null&&e.default){const t=this.selectableOptions.findIndex(r=>r.value===this.selectOptions.default);t>=0&&(this.selectedIndex=t)}this.calculateVisibleWindow(),this.render()}resolveAndPop(e){this.clearExtraLines();const t=this.selectableOptions.find(s=>s.value===e),r=t?t.label:e;this.host.terminal.write("\x1B[2K\r"),this.host.terminal.write(`\x1B[32m✔\x1B[0m ${this.promptText}: \x1B[36m${r}\x1B[0m`),this.host.terminal.write("\x1B[?25h"),super.resolveAndPop(e)}abort(){this.clearExtraLines(),this.host.terminal.write("\x1B[2K\r"),this.host.terminal.write(`\x1B[33m✘\x1B[0m ${this.promptText}: \x1B[2mcancelled\x1B[0m`),this.host.terminal.write("\x1B[?25h"),super.abort()}async handleInput(e){e==="\x1B[C"?this.moveSelection(1):e==="\x1B[D"?this.moveSelection(-1):e==="\r"&&this.selectableOptions.length>0&&this.resolveAndPop(this.selectableOptions[this.selectedIndex].value)}onResize(e,t){this.calculateVisibleWindow(),this.render()}moveSelection(e){var r;if(this.selectableOptions.length===0)return;let t=this.selectedIndex+e;t<0&&(t=this.selectableOptions.length-1),t>=this.selectableOptions.length&&(t=0),this.selectedIndex=t,this.adjustVisibleWindow(),(r=this.selectOptions)!=null&&r.onChange&&this.selectOptions.onChange(this.selectableOptions[this.selectedIndex].value),this.render()}getPromptPrefix(){return`? ${this.promptText}: `}getRenderedPromptPrefix(){return`\x1B[36m?\x1B[0m ${this.promptText}: `}getOptionWidth(e,t){return t?e.label.length+4:e.label.length+2}calculateVisibleWindow(){const e=this.host.getTerminalCols(),t=this.getPromptPrefix().length,r=e-t;if(this.selectableOptions.length===0){this.visibleStart=0,this.visibleEnd=0;return}let s=0;for(let o=0;o<this.selectableOptions.length;o++)s+=this.getOptionWidth(this.selectableOptions[o],o===this.selectedIndex);if(s<=r){this.visibleStart=0,this.visibleEnd=this.selectableOptions.length;return}this.adjustVisibleWindow()}adjustVisibleWindow(){const e=this.host.getTerminalCols(),t=this.getPromptPrefix().length,r=e-t;if(this.selectableOptions.length===0)return;let s=0;for(let l=0;l<this.selectableOptions.length;l++)s+=this.getOptionWidth(this.selectableOptions[l],l===this.selectedIndex);if(s<=r){this.visibleStart=0,this.visibleEnd=this.selectableOptions.length;return}const o=2;this.selectedIndex<this.visibleStart&&(this.visibleStart=this.selectedIndex);let u=0;this.visibleStart>0&&(u+=o);let a=this.visibleStart;for(let l=this.visibleStart;l<this.selectableOptions.length;l++){const f=this.getOptionWidth(this.selectableOptions[l],l===this.selectedIndex),h=l<this.selectableOptions.length-1?o:0;if(u+f+h<=r)u+=f,a=l+1;else break}if(this.selectedIndex>=a){a=this.selectedIndex+1,u=this.getOptionWidth(this.selectableOptions[this.selectedIndex],!0),a<this.selectableOptions.length&&(u+=o);let f=this.selectedIndex;for(let C=this.selectedIndex-1;C>=0;C--){const h=this.getOptionWidth(this.selectableOptions[C],!1),U=C>0?o:0,W=f>0?o:0;if(u-W+h+U<=r)u=u-W+h+U,f=C;else break}this.visibleStart=f,a=this.selectedIndex+1,u=0,this.visibleStart>0&&(u+=o);for(let C=this.visibleStart;C<a;C++)u+=this.getOptionWidth(this.selectableOptions[C],C===this.selectedIndex);for(let C=a;C<this.selectableOptions.length;C++){const h=this.getOptionWidth(this.selectableOptions[C],!1),U=C<this.selectableOptions.length-1?o:0;if(u+h+U<=r)u+=h,a=C+1;else break}}this.visibleEnd=a}render(){if(this.clearExtraLines(),this.host.terminal.write("\x1B[2K\r"),this.host.terminal.write(this.getRenderedPromptPrefix()),this.selectableOptions.length===0)return;const e=this.visibleStart>0,t=this.visibleEnd<this.selectableOptions.length;e&&this.host.terminal.write("\x1B[2m◂\x1B[0m ");for(let r=this.visibleStart;r<this.visibleEnd;r++){const s=this.selectableOptions[r];r===this.selectedIndex?this.host.terminal.write(`\x1B[36m[ ${s.label} ]\x1B[0m`):this.host.terminal.write(` ${s.label} `)}t&&this.host.terminal.write(" \x1B[2m▸\x1B[0m"),this.writeHelp("←/→ navigate · enter to select · esc to cancel")}},MultiSelectInputMode=class extends InputModeBase{constructor(e,t,r,s,o){super(e,t),this.promptText=r,this.options=s,this.selectOptions=o,this.selectedIndex=0,this.scrollOffset=0,this.filter="",this.renderedLines=0,this.filteredOptions=[...s],this.maxVisible=Math.min(s.length,e.getTerminalRows()-4),this.checkedState=new Map;for(const u of s)this.checkedState.set(u.value,u.checked===!0)}activate(){this.host.terminal.write("\x1B[?25l"),this.selectedIndex=0,this.filteredOptions.filter(t=>!t.disabled).length>0&&(this.selectedIndex=0),this.renderAll()}handleKeyEvent(e){var t;return(t=this.selectOptions)!=null&&t.searchable&&this.filter.length>0&&e.code==="Escape"?(this.clearFilter(),!1):super.handleKeyEvent(e)}resolveAndPop(e){this.clearRenderedLines();const t=e.map(s=>{const o=this.options.find(u=>u.value===s);return o?o.label:s}),r=t.length>0?t.join(", "):"none";this.host.terminal.write("\x1B[2K\r"),this.host.terminal.write(`\x1B[32m✔\x1B[0m ${this.promptText} \x1B[36m${r}\x1B[0m`),this.host.terminal.write("\x1B[?25h"),super.resolveAndPop(e)}abort(){this.clearRenderedLines(),this.host.terminal.write("\x1B[2K\r"),this.host.terminal.write(`\x1B[33m✘\x1B[0m ${this.promptText} \x1B[2mcancelled\x1B[0m`),this.host.terminal.write("\x1B[?25h"),super.abort()}async handleInput(e){var t,r,s;e==="\x1B[A"?this.moveSelection(-1):e==="\x1B[B"?this.moveSelection(1):e===" "?this.toggleCurrent():e==="a"&&(!((t=this.selectOptions)!=null&&t.searchable)||this.filter.length===0)?this.toggleAll():e==="\r"?this.resolveAndPop(this.getCheckedValues()):e===""?(r=this.selectOptions)!=null&&r.searchable&&this.filter.length>0&&(this.filter=this.filter.slice(0,-1),this.applyFilter(),this.renderAll()):e.startsWith("\x1B")||(s=this.selectOptions)!=null&&s.searchable&&e.length===1&&e>=" "&&(this.filter+=e,this.applyFilter(),this.renderAll())}onResize(e,t){this.maxVisible=Math.min(this.filteredOptions.length,t-4),this.scrollOffset+this.maxVisible>this.getSelectableCount()&&(this.scrollOffset=Math.max(0,this.getSelectableCount()-this.maxVisible)),this.renderAll()}buildDisplayList(){const e=[];let t;for(const r of this.filteredOptions)r.group&&r.group!==t&&(e.push({type:"group-header",groupName:r.group}),t=r.group),e.push({type:"option",option:r});return e}getSelectableCount(){return this.filteredOptions.filter(e=>!e.disabled).length}getCheckedValues(){const e=[];for(const t of this.options)this.checkedState.get(t.value)===!0&&e.push(t.value);return e}moveSelection(e){const t=this.getSelectableCount();if(t===0)return;let r=this.selectedIndex+e;r<0&&(r=t-1),r>=t&&(r=0),this.selectedIndex=r,this.selectedIndex<this.scrollOffset?this.scrollOffset=this.selectedIndex:this.selectedIndex>=this.scrollOffset+this.maxVisible&&(this.scrollOffset=this.selectedIndex-this.maxVisible+1),this.renderAll()}toggleCurrent(){var s;const e=this.filteredOptions.filter(o=>!o.disabled);if(e.length===0||this.selectedIndex>=e.length)return;const t=e[this.selectedIndex],r=this.checkedState.get(t.value)===!0;this.checkedState.set(t.value,!r),(s=this.selectOptions)!=null&&s.onChange&&this.selectOptions.onChange(this.getCheckedValues()),this.renderAll()}toggleAll(){var r;const e=this.options.filter(s=>!s.disabled),t=e.every(s=>this.checkedState.get(s.value)===!0);for(const s of e)this.checkedState.set(s.value,!t);(r=this.selectOptions)!=null&&r.onChange&&this.selectOptions.onChange(this.getCheckedValues()),this.renderAll()}applyFilter(){if(this.filter.length===0)this.filteredOptions=[...this.options];else{const e=this.filter.toLowerCase();this.filteredOptions=this.options.filter(t=>t.label.toLowerCase().includes(e))}this.selectedIndex=0,this.scrollOffset=0,this.maxVisible=Math.min(this.filteredOptions.length,this.host.getTerminalRows()-4)}clearFilter(){this.filter="",this.applyFilter(),this.renderAll()}renderAll(){this.clearRenderedLines(),this.renderPrompt(),this.renderOptions(),this.renderHelpBar(),this.renderedLines>0&&this.host.terminal.write(`\x1B[${this.renderedLines}A`)}clearRenderedLines(){if(this.renderedLines>0){this.host.terminal.write("\x1B[s");for(let e=0;e<this.renderedLines;e++)this.host.terminal.write("\x1B[B\x1B[2K");this.host.terminal.write("\x1B[u"),this.renderedLines=0}}renderPrompt(){var e;this.host.terminal.write("\x1B[2K\r"),(e=this.selectOptions)!=null&&e.searchable?this.filter.length>0?this.host.terminal.write(`\x1B[36m?\x1B[0m ${this.promptText}: ${this.filter}`):this.host.terminal.write(`\x1B[36m?\x1B[0m ${this.promptText}: \x1B[2mType to filter...\x1B[0m`):this.host.terminal.write(`\x1B[36m?\x1B[0m ${this.promptText}:`)}renderOptions(){const e=this.buildDisplayList(),t=this.filteredOptions.filter(d=>!d.disabled),r=this.scrollOffset,s=Math.min(t.length,this.scrollOffset+this.maxVisible);r>0&&(this.host.terminal.write(`\r
|
|
170
|
-
\x1B[2m ↑ ${r} more above\x1B[0m`),this.renderedLines++);let o=0;for(const d of e)if(d.type==="group-header")this.isGroupVisible(d.groupName,e,r,s)&&(this.host.terminal.write(`\r
|
|
171
|
-
\x1B[35m── ${d.groupName} ──\x1B[0m`),this.renderedLines++);else{const a=d.option;if(a.disabled)this.isDisabledOptionVisible(e,d,r,s)&&(this.renderOptionLine(a,!1),this.renderedLines++);else{if(o>=r&&o<s){const l=o===this.selectedIndex;this.renderOptionLine(a,l),this.renderedLines++}o++}}const u=t.length-s;u>0&&(this.host.terminal.write(`\r
|
|
172
|
-
\x1B[2m ↓ ${u} more below\x1B[0m`),this.renderedLines++)}isGroupVisible(e,t,r,s){let o=0;for(const u of t)if(u.type==="option"&&!u.option.disabled){if(u.option.group===e&&o>=r&&o<s)return!0;o++}return!1}isDisabledOptionVisible(e,t,r,s){const o=e.indexOf(t);let u=0;for(let d=0;d<e.length;d++)if(e[d].type==="option"&&!e[d].option.disabled){if(d>o)return u>=r&&u<s;u++}return u>0&&u-1>=r&&u-1<s}renderOptionLine(e,t){const r=this.checkedState.get(e.value)===!0,s=this.highlightMatch(e.label),o=e.description?` \x1B[2;3m— ${e.description}\x1B[0m`:"",u=r?"\x1B[32m◉\x1B[0m":"\x1B[2m○\x1B[0m";if(e.disabled){const d=r?"\x1B[2m◉\x1B[0m":"\x1B[2m○\x1B[0m";this.host.terminal.write(`\r
|
|
173
|
-
${d} \x1B[2m${e.label}${o} (disabled)\x1B[0m`)}else t?this.host.terminal.write(`\r
|
|
174
|
-
\x1B[48;5;24m\x1B[38;5;117m❯ ${u} ${s}${o}\x1B[0m`):this.host.terminal.write(`\r
|
|
175
|
-
${u} ${s}${o}`)}highlightMatch(e){if(!this.filter||this.filter.length===0)return e;const t=e.toLowerCase(),r=this.filter.toLowerCase(),s=t.indexOf(r);if(s<0)return e;const o=e.substring(0,s),u=e.substring(s,s+this.filter.length),d=e.substring(s+this.filter.length);return`${o}\x1B[33m${u}\x1B[0m${d}`}renderHelpBar(){var r;const e=this.getCheckedValues().length;let t;if((r=this.selectOptions)!=null&&r.searchable)if(this.filter.length>0){const s=this.filteredOptions.filter(u=>!u.disabled).length,o=this.options.filter(u=>!u.disabled).length;t=`${e} selected · ${s} of ${o} matches · space to toggle · enter to confirm`}else t=`${e} selected · space to toggle · a to select all · type to filter · enter to confirm`;else t=`${e} selected · space to toggle · a to select all · enter to confirm`;this.host.terminal.write(`\r
|
|
176
|
-
\x1B[2m${t}\x1B[0m`),this.renderedLines++}},DateInputMode=class extends InputModeBase{constructor(e,t,r,s){super(e,t),this.promptText=r,this.options=s,this.hasError=!1,this.format=(s==null?void 0:s.format)??"YYYY-MM-DD",this.separator=this.extractSeparator(this.format),this.buffer=(s==null?void 0:s.default)??"",this.cursorPosition=this.buffer.length}activate(){const e=this.buildPrompt();this.host.writeToTerminal(e),this.buffer&&this.host.writeToTerminal(this.buffer)}async handleInput(e){if(this.hasError&&(this.hasError=!1,this.clearExtraLines()),e==="\r"){const t=this.validateBuffer();if(t){this.hasError=!0,this.writeError(t);return}this.resolveAndPop(this.buffer)}else if(e==="")this.cursorPosition>0&&(this.buffer=this.buffer.slice(0,this.cursorPosition-1)+this.buffer.slice(this.cursorPosition),this.cursorPosition--,this.renderLine());else if(e==="\x1B[D")this.cursorPosition>0&&(this.cursorPosition--,this.host.terminal.write(e));else if(e==="\x1B[C")this.cursorPosition<this.buffer.length&&(this.cursorPosition++,this.host.terminal.write(e));else if(!e.startsWith("\x1B")){for(const t of e)(t>="0"&&t<="9"||t===this.separator)&&(this.buffer=this.buffer.slice(0,this.cursorPosition)+t+this.buffer.slice(this.cursorPosition),this.cursorPosition++);this.renderLine()}}onResize(){this.renderLine()}buildPrompt(){return`\x1B[36m?\x1B[0m ${this.promptText} \x1B[2m(${this.format})\x1B[0m`}renderLine(){const e=this.buildPrompt();this.redrawLine(e,this.buffer,this.cursorPosition)}extractSeparator(e){for(const t of e)if(t<"A"||t>"z"||t>"Z"&&t<"a")return t;return"-"}parseBuffer(){const e=this.buffer.split(this.separator),t=this.format.split(this.separator);if(e.length!==t.length)return null;let r=0,s=0,o=0;for(let u=0;u<t.length;u++){const d=t[u].toUpperCase(),a=parseInt(e[u],10);if(isNaN(a))return null;d==="YYYY"?r=a:d==="MM"?s=a:d==="DD"&&(o=a)}return{year:r,month:s,day:o}}validateBuffer(){var u,d;if(!this.buffer)return`Please enter a date in ${this.format} format`;const e=this.parseBuffer();if(!e)return`Invalid date format, expected ${this.format}`;const{year:t,month:r,day:s}=e;if(r<1||r>12)return"Month must be between 1 and 12";const o=this.daysInMonth(t,r);if(s<1||s>o)return`Day must be between 1 and ${o} for the given month`;if((u=this.options)!=null&&u.min){const a=this.parseDate(this.options.min),l=new Date(t,r-1,s);if(a&&l<a)return`Date must not be before ${this.options.min}`}if((d=this.options)!=null&&d.max){const a=this.parseDate(this.options.max),l=new Date(t,r-1,s);if(a&&l>a)return`Date must not be after ${this.options.max}`}return null}daysInMonth(e,t){return new Date(e,t,0).getDate()}parseDate(e){const t=e.split(this.separator),r=this.format.split(this.separator);if(t.length!==r.length)return null;let s=0,o=0,u=0;for(let d=0;d<r.length;d++){const a=r[d].toUpperCase(),l=parseInt(t[d],10);if(isNaN(l))return null;a==="YYYY"?s=l:a==="MM"?o=l:a==="DD"&&(u=l)}return new Date(s,o-1,u)}},FileInputMode=class extends InputModeBase{constructor(e,t,r,s){super(e,t),this.promptText=r,this.options=s,this.waiting=!1}activate(){var r;const e=this.host.filePickerProvider,t=(r=this.options)!=null&&r.accept?` \x1B[2m(${this.options.accept})\x1B[0m`:"";if(this.host.writeToTerminal(`\x1B[36m?\x1B[0m ${this.promptText}${t}: `),!e.isSupported){this.host.writeToTerminal("\x1B[2m(file picker not available)\x1B[0m"),this.abort();return}this.host.writeToTerminal("\x1B[33mOpening file picker...\x1B[0m"),this.waiting=!0,this.pickFiles(e)}async pickFiles(e){var t;try{let r;if((t=this.options)!=null&&t.directory){const o=await e.pickDirectory();r=o?[o]:null}else r=await e.pickFiles(this.options);if(this.waiting=!1,!r||this.isResolved){this.host.terminal.write("\x1B[2K\r"),this.host.writeToTerminal(`\x1B[36m?\x1B[0m ${this.promptText}: \x1B[2m(cancelled)\x1B[0m\r
|
|
177
|
-
`),this.isResolved||this.abort();return}this.host.terminal.write("\x1B[2K\r"),this.host.writeToTerminal(`\x1B[36m?\x1B[0m ${this.promptText}:\r
|
|
178
|
-
`);let s=0;for(const o of r){const u=this.formatSize(o.size);this.host.writeToTerminal(` \x1B[32m✔\x1B[0m ${o.name} \x1B[2m(${u})\x1B[0m\r
|
|
179
|
-
`),s+=o.size}r.length>1&&this.host.writeToTerminal(` \x1B[2m${r.length} files selected · ${this.formatSize(s)} total\x1B[0m\r
|
|
180
|
-
`),this.resolveAndPop(r)}catch{if(this.waiting=!1,this.isResolved)return;this.host.terminal.write("\x1B[2K\r"),this.host.writeToTerminal(`\x1B[36m?\x1B[0m ${this.promptText}: \x1B[31m(error)\x1B[0m\r
|
|
181
|
-
`),this.abort()}}async handleInput(e){}formatSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}},CliInputReader=class{constructor(e){this.host=e}readLine(e,t){return new Promise(r=>{const s=new LineInputMode(this.host,r,e,t);this.host.pushMode(s)})}readPassword(e){return new Promise(t=>{const r=new PasswordInputMode(this.host,t,e);this.host.pushMode(r)})}readConfirm(e,t=!1){return new Promise(r=>{const s=new ConfirmInputMode(this.host,r,e,t);this.host.pushMode(s)})}readSelect(e,t,r){return!t||t.length===0?Promise.reject(new Error("readSelect requires at least one option")):new Promise(s=>{const o=new SelectInputMode(this.host,s,e,t,r);this.host.pushMode(o)})}readSelectInline(e,t,r){return!t||t.length===0?Promise.reject(new Error("readSelectInline requires at least one option")):new Promise(s=>{const o=new InlineSelectInputMode(this.host,s,e,t,r);this.host.pushMode(o)})}readMultiSelect(e,t,r){return!t||t.length===0?Promise.reject(new Error("readMultiSelect requires at least one option")):new Promise(s=>{const o=new MultiSelectInputMode(this.host,s,e,t,r);this.host.pushMode(o)})}readNumber(e,t){return new Promise(r=>{const s=new NumberInputMode(this.host,r,e,t);this.host.pushMode(s)})}readDate(e,t){return new Promise(r=>{const s=new DateInputMode(this.host,r,e,t);this.host.pushMode(s)})}readFile(e,t){return new Promise(r=>{const s=new FileInputMode(this.host,r,e,t);this.host.pushMode(s)})}},BrowserFilePickerProvider=class{constructor(){this.isSupported=typeof document<"u"}async pickFiles(e){if(!this.isSupported)return null;if(e!=null&&e.directory){const t=await this.pickDirectory();return t?[t]:null}return new Promise(t=>{const r=document.createElement("input");r.type="file",r.style.display="none",e!=null&&e.accept&&(r.accept=e.accept),e!=null&&e.multiple&&(r.multiple=!0),r.addEventListener("change",async()=>{const s=r.files;if(!s||s.length===0){t(null),r.remove();return}const o=(e==null?void 0:e.readAs)??"text",u=[];for(let d=0;d<s.length;d++){const a=s[d],l=await this.readFile(a,o);u.push({name:a.name,content:l,size:a.size,type:a.type||"application/octet-stream"})}t(u),r.remove()}),r.addEventListener("cancel",()=>{t(null),r.remove()}),document.body.appendChild(r),r.click()})}async pickDirectory(){return this.isSupported?new Promise(e=>{const t=document.createElement("input");t.type="file",t.style.display="none",t.webkitdirectory=!0,t.addEventListener("change",()=>{var s;const r=t.files;if(!r||r.length===0)e(null);else{const o=((s=r[0].webkitRelativePath)==null?void 0:s.split("/"))??[];e({name:o[0]||"selected-directory",content:"",size:0,type:"inode/directory"})}t.remove()}),t.addEventListener("cancel",()=>{e(null),t.remove()}),document.body.appendChild(t),t.click()}):null}readFile(e,t){return new Promise((r,s)=>{const o=new FileReader;o.onload=()=>r(o.result),o.onerror=()=>s(o.error),t==="arraybuffer"?o.readAsArrayBuffer(e):o.readAsText(e)})}},NoopFilePickerProvider=class{constructor(){this.isSupported=!1}async pickFiles(e){return null}async pickDirectory(){return null}},CliCompletionEngine=class{constructor(){this.providers=[],this.lastCandidates=[],this.tabCount=0,this.lastInput=""}setProviders(e){this.providers=[...e].sort((t,r)=>t.priority-r.priority)}addProvider(e){this.providers.push(e),this.providers.sort((t,r)=>t.priority-r.priority)}resetState(){this.tabCount=0,this.lastCandidates=[],this.lastInput=""}async complete(e,t){const r=this.buildContext(e,t);if(e===this.lastInput?this.tabCount++:(this.tabCount=1,this.lastInput=e,this.lastCandidates=[]),this.tabCount===1){const s=await this.fetchCompletions(r);if(this.lastCandidates=s,s.length===0)return{action:"none"};if(s.length===1)return this.lastInput="",this.tabCount=0,{action:"complete",replacement:s[0],tokenStart:r.tokenStart,token:r.token};const o=this.commonPrefix(s);return o.length>r.token.length?(this.lastInput=e.slice(0,r.tokenStart)+o+e.slice(r.tokenStart+r.token.length),{action:"complete",replacement:o,tokenStart:r.tokenStart,token:r.token}):{action:"none"}}return this.tabCount>=2&&this.lastCandidates.length>1?{action:"show-candidates",candidates:this.lastCandidates}:{action:"none"}}buildContext(e,t){const r=e.slice(0,t),s=this.tokenize(r),o=this.tokenize(e);let u=0,d="",a=0;return s.length===0||r.endsWith(" ")?(d="",u=t,a=s.length):(d=s[s.length-1],u=r.lastIndexOf(d),a=s.length-1),{input:e,cursor:t,token:d,tokenStart:u,tokenIndex:a,tokens:o}}tokenize(e){return e.split(/\s+/).filter(Boolean)}async fetchCompletions(e){for(const t of this.providers){const r=await t.getCompletions(e);if(r.length>0)return r}return[]}async completeSingle(e,t){if(!e)return null;const r=this.buildContext(e,t),s=await this.fetchCompletions(r);if(s.length!==1)return null;const o=s[0];return o.startsWith(r.token)?e.slice(0,r.tokenStart)+o:null}commonPrefix(e){return getAccelerator().commonPrefix(e)}},CliLineBuffer=class{constructor(){this._text="",this._cursorPosition=0}get text(){return this._text}get cursorPosition(){return this._cursorPosition}set cursorPosition(e){this._cursorPosition=Math.max(0,Math.min(e,this._text.length))}insert(e){this._text=this._text.slice(0,this._cursorPosition)+e+this._text.slice(this._cursorPosition),this._cursorPosition+=e.length}deleteCharBefore(){this._cursorPosition>0&&(this._text=this._text.slice(0,this._cursorPosition-1)+this._text.slice(this._cursorPosition),this._cursorPosition--)}deleteCharAt(){this._cursorPosition<this._text.length&&(this._text=this._text.slice(0,this._cursorPosition)+this._text.slice(this._cursorPosition+1))}moveCursorLeft(){this._cursorPosition>0&&this._cursorPosition--}moveCursorRight(){this._cursorPosition<this._text.length&&this._cursorPosition++}moveHome(){this._cursorPosition=0}moveEnd(){this._cursorPosition=this._text.length}clear(){this._text="",this._cursorPosition=0}setText(e){this._text=e,this._cursorPosition=e.length}},CommandLineMode=class{constructor(e){this.host=e,this.historyIndex=0,this.isExecutingCommand=!1,this.selectionStart=null,this.selectionEnd=null,this.ghostText="",this.ghostDebounceTimer=null,this.historySearchPrefix=null,this.bufferSetByHistory=!1}activate(){this.host.commandHistory.initialize().then(()=>{this.historyIndex=this.host.commandHistory.getLastIndex()})}async handleInput(e){const t=this.host.lineBuffer;if(e===" "){this.clearGhostText(),await this.handleTabCompletion();return}if(this.host.completionEngine.resetState(),e==="\r"){this.clearGhostText(),this.host.terminal.write(`\r
|
|
182
|
-
`);const r=t.text;r&&(this.historyIndex=this.host.commandHistory.getLastIndex(),this.bufferSetByHistory=!1),this.isExecutingCommand=!0,await this.host.getExecutionContext().submitCommand(r),this.isExecutingCommand=!1}else e==="\x1B[A"?this.showPreviousCommand():e==="\x1B[B"?this.showNextCommand():e==="\x1B[D"?t.cursorPosition>0&&(t.moveCursorLeft(),this.host.terminal.write(e)):e==="\x1B[C"?this.ghostText&&t.cursorPosition===t.text.length?(t.insert(this.ghostText),this.ghostText="",this.refreshLine()):t.cursorPosition<t.text.length&&(t.moveCursorRight(),this.host.terminal.write(e)):e===""?this.handleBackspace():this.handleInputText(e)}handleKeyEvent(e){if(e.code==="KeyC"&&e.ctrlKey)return this.host.abort(),this.host.terminal.writeln("Ctrl+C"),this.host.getExecutionContext().setContextProcessor(void 0),this.isExecutingCommand||this.host.showPrompt(),!1;if(e.code==="Escape")return this.host.abort(),this.host.showPrompt({newLine:!0}),!1;if(e.code==="KeyV"&&e.ctrlKey)return!1;if(e.code==="KeyL"&&e.ctrlKey)return e.preventDefault(),this.host.lineBuffer.clear(),this.host.terminal.clear(),this.host.showPrompt({reset:!0}),!1;if(e.shiftKey&&(e.code==="ArrowLeft"||e.code==="ArrowRight")){this.selectionStart||(this.selectionStart=this.getTerminalCursorPosition());const t=this.host.lineBuffer;return e.code==="ArrowLeft"?t.moveCursorLeft():t.moveCursorRight(),this.selectionEnd=this.getTerminalCursorPosition(),this.updateSelection(),!1}else this.selectionStart=null;return!0}handleInputText(e){e=e.replace(/[\r\n\t]+/g,""),this.clearGhostText(),this.clearHistorySearch(),this.bufferSetByHistory=!1,this.host.lineBuffer.insert(e),this.refreshLine(),this.scheduleGhostText()}clearGhostText(){this.ghostText="",this.ghostDebounceTimer!==null&&(clearTimeout(this.ghostDebounceTimer),this.ghostDebounceTimer=null)}scheduleGhostText(){this.ghostDebounceTimer=setTimeout(()=>{this.computeAndShowGhostText()},120)}async computeAndShowGhostText(){const e=this.host.lineBuffer;if(!(!e.text||e.cursorPosition<e.text.length))try{const t=await this.host.completionEngine.completeSingle(e.text,e.cursorPosition);t&&t.startsWith(e.text)&&(this.ghostText=t.slice(e.text.length),this.renderGhostText())}catch{}}handleBackspace(){const e=this.host.lineBuffer;this.clearGhostText(),this.clearHistorySearch(),e.cursorPosition>0&&(e.deleteCharBefore(),this.refreshLine())}async handleTabCompletion(){const e=this.host.lineBuffer,t=await this.host.completionEngine.complete(e.text,e.cursorPosition);switch(t.action){case"complete":{const{replacement:r,tokenStart:s,token:o}=t;if(r===void 0||s===void 0||o===void 0)break;const u=e.text.slice(0,s),d=e.text.slice(s+o.length),a=d.length===0&&!r.endsWith("/")?" ":"";e.setText(u+r+a+d),e.cursorPosition=s+r.length+a.length,this.refreshLine();break}case"show-candidates":{const r=t.candidates??[];if(r.length===0)break;this.host.terminal.write(`\r
|
|
183
|
-
`);const s=Math.max(...r.map(l=>l.length)),o=Math.max(1,Math.floor((this.host.terminal.cols||80)/(s+2)));let u="";for(let l=0;l<r.length;l++)u+=r[l].padEnd(s+2),(l+1)%o===0&&(this.host.terminal.write(u+`\r
|
|
184
|
-
`),u="");u&&this.host.terminal.write(u+`\r
|
|
185
|
-
`);const d=this.host.lineRenderer.getPromptString(this.host.getPromptOptions());this.host.terminal.write(d),this.host.setPromptLength(this.host.terminal.buffer.active.cursorX),this.host.terminal.write(e.text);const a=e.text.length-e.cursorPosition;a>0&&this.host.terminal.write(`\x1B[${a}D`);break}}}showPreviousCommand(){this.clearGhostText();const e=this.host.lineBuffer;if(e.text&&!this.bufferSetByHistory&&this.historySearchPrefix===null&&(this.historySearchPrefix=e.text,this.historyIndex=this.host.commandHistory.getLastIndex()),this.historySearchPrefix!==null){const t=this.host.commandHistory.searchBackward(this.historySearchPrefix,this.historyIndex);t!==-1&&(this.historyIndex=t,this.displayCommandFromHistory());return}this.historyIndex>0&&(this.historyIndex--,this.displayCommandFromHistory())}showNextCommand(){this.clearGhostText();const e=this.host.lineBuffer;if(this.historySearchPrefix!==null){const t=this.host.commandHistory.searchForward(this.historySearchPrefix,this.historyIndex);if(t!==-1)this.historyIndex=t,this.displayCommandFromHistory();else{const r=this.host.getPromptLength()+e.text.length,s=this.historySearchPrefix;this.clearHistorySearch(),e.setText(s),this.refreshLine(r)}return}if(this.historyIndex<this.host.commandHistory.getLastIndex()-1)this.historyIndex++,this.displayCommandFromHistory();else{this.historyIndex=this.host.commandHistory.getLastIndex();const t=this.host.getPromptLength()+e.text.length;e.clear(),this.refreshLine(t)}}clearHistorySearch(){this.historySearchPrefix=null,this.bufferSetByHistory=!1,this.historyIndex=this.host.commandHistory.getLastIndex()}displayCommandFromHistory(){const e=this.host.lineBuffer,t=this.host.getPromptLength()+e.text.length,r=this.host.commandHistory.getCommand(this.historyIndex)||"";e.setText(r),this.bufferSetByHistory=!0,this.refreshLine(t)}refreshLine(e){const t=this.host.lineRenderer.getPromptString(this.host.getPromptOptions());this.host.lineRenderer.refreshLine(this.host.lineBuffer.text,this.host.lineBuffer.cursorPosition,this.host.getPromptLength(),t,e),this.renderGhostText()}renderGhostText(){if(!this.ghostText)return;const e=this.host.lineBuffer;if(e.cursorPosition<e.text.length)return;const t=this.ghostText;this.host.terminal.write(`\x1B[2m\x1B[38;5;240m${t}\x1B[0m\x1B[${t.length}D`)}getTerminalCursorPosition(){const e=this.host.terminal._core.buffer.x,t=this.host.terminal._core.buffer.y;return{x:e,y:t}}updateSelection(){if(this.selectionStart&&this.selectionEnd){const e=Math.min(this.selectionStart.y,this.selectionEnd.y),t=Math.max(this.selectionStart.y,this.selectionEnd.y);if(e===t){const r=Math.min(this.selectionStart.x,this.selectionEnd.x),s=Math.max(this.selectionStart.x,this.selectionEnd.x);this.host.terminal.select(r,e,Math.abs(s-r))}else this.host.terminal.selectLines(e,t)}}},RawMode=class{constructor(e,t,r=!1){this.processor=e,this.context=t,this.fullScreen=r}async handleInput(e){this.processor.onData&&await this.processor.onData(e,this.context)}handleKeyEvent(e){return!this.fullScreen&&e.code==="KeyC"&&e.ctrlKey?(this.context.setContextProcessor(void 0),this.context.writer.writeln(""),this.context.showPrompt(),!1):(e.ctrlKey&&e.preventDefault(),!0)}},CliTerminalLineRenderer=class{constructor(e,t){this.terminal=e,this.writer=t}getPromptString(e){var u;const t=e.userName??"";let r=e.hideUserName?"":t?`\x1B[32m${t}\x1B[0m:`:e.anonymousName?`\x1B[90m${e.anonymousName}\x1B[0m:`:"";e.contextProcessor&&(r=`${e.contextProcessor}`);const s=((u=e.pathProvider)==null?void 0:u.call(e))??null,o=s!==null?`\x1B[34m${s}\x1B[0m`:"\x1B[34m~\x1B[0m";return`${r}${o}$ `}renderPrompt(e){const t=this.getPromptString(e);return this.terminal.write(t),t.replace(/\x1b\[[0-9;]*[A-Za-z]/g,"").length}refreshLine(e,t,r,s,o){const u=r+e.length,d=this.terminal.cols,a=o!==void 0?Math.max(u,o):u,l=Math.max(1,Math.ceil(a/d));let f="";for(let h=1;h<l;h++)f+="\x1B[A";f+="\r\x1B[J",f+=s,f+=colorFirstWord(e,h=>this.writer.wrapInColor(h,CliForegroundColor.Yellow)??e);const C=e.length-t;C>0&&(f+=`\x1B[${C}D`),this.terminal.write(f)}clearLine(e){clearTerminalLine(this.terminal,e)}},CliExecutionContext=class{constructor(e,t,r,s){this.terminal=t,this.executor=r,this.onAbort=new Subject,this.completionEngine=new CliCompletionEngine,this.promptLength=0,this.isExecuting=!1,this.lineBuffer=new CliLineBuffer,this.modeStack=[],this.timerManager=new CliTimerManager,this.setContextProcessor=(a,l,f)=>{var C;if(!a){(C=this.contextProcessor)!=null&&C.onData&&this.popMode(),this.contextProcessor=void 0;return}l||this.writer.writeInfo("Set "+(a==null?void 0:a.command)+" as context processor, press Ctrl+C to exit"),this.contextProcessor=a,a.onData&&this.pushMode(new RawMode(a,this,f))},this.services=e.services,this.translator=e.translator,this.stateStoreManager=e.stateStoreManager,this.state=this.stateStoreManager.getStateStore("shared"),this.options=s,this.writer=new CliTerminalWriter(t);const o=new CliTerminalSpinner(t),u=new CliTerminalProgressBar(t),d=new CliTerminalTextAnimator(t);o.context=this,u.context=this,d.context=this,this.spinner=o,this.progressBar=u,this.textAnimator=d,this.clipboard=new CliClipboard(this),this.process=new CliExecutionProcess(this),this.filePickerProvider=typeof document<"u"?new BrowserFilePickerProvider:new NoopFilePickerProvider,this.reader=new CliInputReader(this),this.logger=e.logger,this.logger.setCliLogLevel((s==null?void 0:s.logLevel)||CliLogLevel.ERROR),this.commandHistory=e.commandHistory,this.lineRenderer=new CliTerminalLineRenderer(t,this.writer),this.http=new CliHttpClient,this.notifier=new CliNotifier,this.backgroundServices=new CliBackgroundServiceRegistry(this.state,e.services,this.writer),this.fullScreenManager=new CliFullScreenManager(t,this.backgroundServices)}writeToTerminal(e){this.terminal.write(e)}getTerminalRows(){return this.terminal.rows}getTerminalCols(){return this.terminal.cols}get currentLine(){return this.lineBuffer.text}get cursorPosition(){return this.lineBuffer.cursorPosition}set cursorPosition(e){this.lineBuffer.cursorPosition=e}initializeTerminalListeners(){const e=new CommandLineMode(this);this.pushMode(e),this.terminal.onData(async r=>{if(this.isProgressRunning())return;const s=this.currentMode;s&&await s.handleInput(r)}),this.terminal.onKey(async r=>{}),this.terminal.attachCustomKeyEventHandler(r=>{if(r.type==="keydown"){const s=this.currentMode;if(s)return s.handleKeyEvent(r)}return!0});const t=this.terminal.element;t&&(this.windowKeydownListener=r=>{if(t.contains(document.activeElement)&&r.ctrlKey&&!r.altKey&&!r.metaKey){const s=r.key.toLowerCase();["f","s","q","o","k","u","g","r","n","h"].includes(s)&&r.preventDefault()}},window.addEventListener("keydown",this.windowKeydownListener,!0))}setCurrentLine(e){this.lineBuffer.setText(e)}clearLine(){this.lineRenderer.clearLine(this.promptLength+this.lineBuffer.text.length)}showPrompt(e){const{reset:t,newLine:r,keepCurrentLine:s}=e||{};t&&this.terminal.write("\x1B[2K\r"),r&&this.terminal.write(`\r
|
|
186
|
-
`),s||this.lineBuffer.clear(),this.promptLength=this.lineRenderer.renderPrompt(this.getPromptOptions())}async submitCommand(e){e.trim()&&(await this.commandHistory.addCommand(e),await this.executor.executeCommand(e,this)),this.isRawModeActive()||this.showPrompt()}clearCurrentLine(){this.clearLine(),this.showPrompt()}refreshCurrentLine(e){const t=this.lineRenderer.getPromptString(this.getPromptOptions());this.lineRenderer.refreshLine(this.lineBuffer.text,this.lineBuffer.cursorPosition,this.promptLength,t,e)}handleTerminalResize(){var o;if(this.isRawModeActive()&&((o=this.contextProcessor)!=null&&o.onResize)){this.contextProcessor.onResize(this.terminal.cols,this.terminal.rows,this);return}if(this.isProgressRunning()||this.isRawModeActive())return;const e=this.currentMode;if(e!=null&&e.onResize){e.onResize(this.terminal.cols,this.terminal.rows);return}const t=this.terminal.buffer.active;let r=t.cursorY;for(;r>0;){const u=t.getLine(t.baseY+r);if(!(u!=null&&u.isWrapped))break;r--}const s=t.cursorY-r+1;this.refreshCurrentLine(s*this.terminal.cols)}isRawModeActive(){var e;return!!((e=this.contextProcessor)!=null&&e.onData)}enterFullScreenMode(e,t){this.fullScreenManager.enter(e,this.setContextProcessor,this,t)}exitFullScreenMode(){this.fullScreenManager.exit(this.contextProcessor,this.setContextProcessor,()=>this.timerManager.clearAll(),()=>this.showPrompt(),this)}createInterval(e,t){return this.timerManager.createInterval(e,t)}createTimeout(e,t){return this.timerManager.createTimeout(e,t)}isProgressRunning(){return this.progressBar.isRunning||this.spinner.isRunning||this.textAnimator.isRunning}abort(){var e,t;this.progressBar.isRunning&&this.progressBar.complete(),(e=this.spinner)!=null&&e.isRunning&&this.spinner.hide(),(t=this.textAnimator)!=null&&t.isRunning&&this.textAnimator.hide(),this.onAbort.next()}setSession(e){this.userSession=e}getPromptOptions(){var s,o;const e=this.services.get("cli-users-module-config"),t=(e==null?void 0:e.hideUserName)??!1,r=e&&!this.userSession&&(e.anonymousName??"anonymous")||void 0;return{userName:(s=this.userSession)==null?void 0:s.displayName,hideUserName:t,anonymousName:r,contextProcessor:(o=this.contextProcessor)==null?void 0:o.command,pathProvider:this.promptPathProvider}}getPromptLength(){return this.promptLength}setPromptLength(e){this.promptLength=e}getExecutionContext(){return this}dispose(){var e;(e=this.contextProcessor)!=null&&e.onDispose&&this.contextProcessor.onDispose(this),this.backgroundServices.destroyAll().catch(()=>{}),this.timerManager.clearAll(),this.fullScreenManager.dispose(),this.windowKeydownListener&&(window.removeEventListener("keydown",this.windowKeydownListener,!0),this.windowKeydownListener=void 0),this.stateStoreManager.dispose()}get currentMode(){return this.modeStack.length>0?this.modeStack[this.modeStack.length-1]:void 0}pushMode(e){const t=this.currentMode;t!=null&&t.deactivate&&t.deactivate(),this.modeStack.push(e),e.activate&&e.activate()}popMode(){const e=this.modeStack.pop();e!=null&&e.deactivate&&e.deactivate();const t=this.currentMode;t!=null&&t.activate&&t.activate()}},CapturingTerminalWriter=class{constructor(e){this.inner=e,this._lines=[],this._jsonValues=[],this._tableObjects=[],this._stderrLines=[]}write(e){this._lines.push(stripAnsi(e)),this.inner.write(e)}writeln(e){e!==void 0&&e!==""&&this._lines.push(stripAnsi(e)),this.inner.writeln(e)}writeJson(e){this._jsonValues.push(e),this.inner.writeJson(e)}writeObjectsAsTable(e){this._tableObjects.push(e),this.inner.writeObjectsAsTable(e)}writeTable(e,t){this.inner.writeTable(e,t)}writeSuccess(e){this.inner.writeSuccess(e)}writeInfo(e){this.inner.writeInfo(e)}writeWarning(e){this._stderrLines.push(stripAnsi(e)),this.inner.writeWarning(e)}writeError(e){this._stderrLines.push(stripAnsi(e)),this.inner.writeError(e)}wrapInColor(e,t){return this.inner.wrapInColor(e,t)}wrapInBackgroundColor(e,t){return this.inner.wrapInBackgroundColor(e,t)}writeToFile(e,t){this.inner.writeToFile(e,t)}writeDivider(e){this.inner.writeDivider(e)}writeList(e,t){this.inner.writeList(e,t)}writeKeyValue(e,t){this.inner.writeKeyValue(e,t)}writeColumns(e,t){this.inner.writeColumns(e,t)}writeLink(e,t){this._lines.push(stripAnsi(e)),this.inner.writeLink(e,t)}writeBox(e,t){(Array.isArray(e)?e:[e]).forEach(s=>this._lines.push(stripAnsi(s))),this.inner.writeBox(e,t)}writeIndented(e,t){this._lines.push(stripAnsi(e)),this.inner.writeIndented(e,t)}hasOutput(){return this._lines.length>0||this._jsonValues.length>0||this._tableObjects.length>0}getCapturedData(){if(this._jsonValues.length>0)return this._jsonValues.length===1?this._jsonValues[0]:this._jsonValues;if(this._tableObjects.length>0)return this._tableObjects.length===1?this._tableObjects[0]:this._tableObjects.flat();if(this._lines.length>0)return this._lines.join(`
|
|
187
|
-
`).replace(/\r\n/g,`
|
|
188
|
-
`).trim()||void 0}hasStderr(){return this._stderrLines.length>0}getCapturedStderr(){if(this._stderrLines.length!==0)return this._stderrLines.join(`
|
|
189
|
-
`).trim()||void 0}},versionGlobalParameter={parameter:{name:"version",aliases:["v"],type:"boolean",description:"Displays the version of the command",required:!1},priority:0,handle(e,t,r,s){return e.v||e.version?(s.writer.writeln(`${s.writer.wrapInColor(t.version||"1.0.0",CliForegroundColor.Cyan)}`),!0):!1}},helpGlobalParameter={parameter:{name:"help",aliases:["h"],type:"boolean",description:"Displays help for the command",required:!1},priority:10,async handle(e,t,r,s){var o;return(o=r.command)!=null&&o.startsWith("help")?!1:e.h||e.help?(await s.executor.showHelp(r,s),!0):!1}},contextGlobalParameter={parameter:{name:"context",aliases:[],type:"boolean",description:"Sets the command as the active context",required:!1},priority:20,handle(e,t,r,s){return e.context?(s.setContextProcessor(t),!0):!1}},FS_TOKEN2="cli-file-system-service";async function writeOutputToFile(e,t){const r=t.services.get(FS_TOKEN2);if(!r){t.writer.writeError("> redirect requires @qodalis/cli-files plugin");return}const s=t.process.data;if(s!=null)try{const o=r.resolvePath(e.trim()),u=typeof s=="string"?s:JSON.stringify(s);r.exists(o)?r.writeFile(o,u):r.createFile(o,u),await r.persist()}catch(o){t.writer.writeError(`> failed: ${o.message||o}`)}}async function appendOutputToFile(e,t){const r=t.services.get(FS_TOKEN2);if(!r){t.writer.writeError(">> redirect requires @qodalis/cli-files plugin");return}const s=t.process.data;if(s!=null)try{const o=r.resolvePath(e.trim()),u=typeof s=="string"?s:JSON.stringify(s);r.exists(o)?r.writeFile(o,u,!0):r.createFile(o,u),await r.persist()}catch(o){t.writer.writeError(`>> failed: ${o.message||o}`)}}async function writeStderrToFile(e,t,r){const s=r==null?void 0:r.getCapturedStderr();if(!s)return;const o=t.services.get(FS_TOKEN2);if(!o){t.writer.writeError("2> redirect requires @qodalis/cli-files plugin");return}try{const u=o.resolvePath(e.trim());o.exists(u)?o.writeFile(u,s):o.createFile(u,s),await o.persist()}catch(u){t.writer.writeError(`2> failed: ${u.message||u}`)}}async function appendStderrToFile(e,t,r){const s=r==null?void 0:r.getCapturedStderr();if(!s)return;const o=t.services.get(FS_TOKEN2);if(!o){t.writer.writeError("2>> redirect requires @qodalis/cli-files plugin");return}try{const u=o.resolvePath(e.trim());o.exists(u)?o.writeFile(u,s,!0):o.createFile(u,s),await o.persist()}catch(u){t.writer.writeError(`2>> failed: ${u.message||u}`)}}async function tryExecuteScript(e,t,r){const o=t.services.get("cli-file-system-service");if(!o)return!1;const u=o.resolvePath(e),d=o.getNode(u);if(!d||d.type!=="file")return!1;const a=d.permissions||"rw-r--r--";if(!(a.length>=3&&a[2]==="x"))return t.writer.writeError(`${e}: Permission denied (missing execute permission)`),t.writer.writeInfo(`Use ${t.writer.wrapInColor(`chmod u+x ${e}`,CliForegroundColor.Cyan)} to make it executable, or run with ${t.writer.wrapInColor(`sh ${e}`,CliForegroundColor.Cyan)}`),t.process.exit(126,{silent:!0}),!0;const f=o.readFile(u);if(f==null)return t.writer.writeError(`${e}: Cannot read file`),t.process.exit(1,{silent:!0}),!0;const C=f.split(`
|
|
190
|
-
`),h={};let j=!0;for(const U of C){const W=U.trim();if(!W||W.startsWith("#"))continue;if(W==="set -e"){j=!0;continue}if(W==="set +e"){j=!1;continue}const H=W.match(/^([A-Za-z_][A-Za-z0-9_]*)=(.*)$/);if(H){const R=H[1];let N=H[2];(N.startsWith('"')&&N.endsWith('"')||N.startsWith("'")&&N.endsWith("'"))&&(N=N.slice(1,-1)),N=substituteVars(N,h),h[R]=N;continue}const x=substituteVars(W,h);await r(x,t);const L=t.process.exitCode;if(j&&L!==void 0&&L!==0)return t.writer.writeError(`${e}: script aborted at line: ${W}`),!0}return!0}function substituteVars(e,t){let r=e.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(s,o)=>t[o]??"");return r=r.replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g,(s,o)=>t[o]??""),r}function expandEnvironmentVars(e,t){const r=t.services.get(ICliEnvironment_TOKEN);if(!r)return e;const s=e.split("'");for(let o=0;o<s.length;o++)o%2===0&&(s[o]=s[o].replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(u,d)=>r.get(d)??""),s[o]=s[o].replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g,(u,d)=>r.get(d)??""));return s.join("'")}var CliCommandExecutor=class{constructor(e){this.registry=e,this.commandParser=new CommandParser,this.globalParameters=[],this.registerGlobalParameter(versionGlobalParameter),this.registerGlobalParameter(helpGlobalParameter),this.registerGlobalParameter(contextGlobalParameter)}registerGlobalParameter(e){this.globalParameters.push(e),this.globalParameters.sort((t,r)=>(t.priority??0)-(r.priority??0))}getGlobalParameters(){return this.globalParameters.map(e=>e.parameter)}async executeCommand(e,t){var o;const r=CommandParser.splitByOperators(e);let s;t instanceof CliCommandExecutionContext?s=t.context:s=t,s.isExecuting=!0;try{let u=!0,d=!0,a,l;for(let f=0;f<r.length;f++){const C=r[f];if(C.type==="&&"){d=u;continue}else if(C.type==="||"){d=!u;continue}else if(C.type==="|"){d=!0;continue}else if(C.type===";"){d=!0,a=void 0;continue}else if(C.type===">>"){const h=r[f+1];if(f++,!h||h.type!=="command"){t.writer.writeError("Missing file path after >>"),u=!1;continue}d&&(await appendOutputToFile(h.value,t),a=void 0);continue}else if(C.type===">"){const h=r[f+1];if(f++,!h||h.type!=="command"){t.writer.writeError("Missing file path after >"),u=!1;continue}d&&(await writeOutputToFile(h.value,t),a=void 0);continue}else if(C.type==="2>>"){const h=r[f+1];if(f++,!h||h.type!=="command"){t.writer.writeError("Missing file path after 2>>"),u=!1;continue}d&&await appendStderrToFile(h.value,t,l);continue}else if(C.type==="2>"){const h=r[f+1];if(f++,!h||h.type!=="command"){t.writer.writeError("Missing file path after 2>"),u=!1;continue}d&&await writeStderrToFile(h.value,t,l);continue}if(d){try{l=await this.executeSingleCommand(C.value,a,s),u=t.process.exitCode===void 0||t.process.exitCode===0,s.lastCommandResult={command:C.value,success:u},a=t.process.data}catch(h){u=!1,s.lastCommandResult={command:C.value,success:!1},t.writer.writeError(`Command ${C.value} failed: ${h}`)}d=!0}}}finally{s.isExecuting=!1,(o=s.notifier)==null||o.clear()}}async executeSingleCommand(e,t,r){var oe,ce,le,ne;const s=r.process;e=expandEnvironmentVars(e,r);const o=e.match(/^([A-Za-z_][A-Za-z0-9_]*)=(.*)$/);if(o){const ae=r.services.get(ICliEnvironment_TOKEN);if(ae){let _e=o[2];(_e.startsWith('"')&&_e.endsWith('"')||_e.startsWith("'")&&_e.endsWith("'"))&&(_e=_e.slice(1,-1)),ae.set(o[1],_e),s.start(),s.end();return}}s.start();let u;const d=r.services.get(CliProcessRegistry_TOKEN);d&&(u=d.register(e));const a=this.commandParser.parse(e);let{commandName:l}=a,f=a.args;const[C,...h]=l.split(" ");let j=h.map(ae=>ae.toLowerCase());const U=r.contextProcessor?r.contextProcessor.processors??[]:this.registry.processors,W=this.registry.findProcessorInCollection(C,j,U);if((oe=W==null?void 0:W.parameters)!=null&&oe.length){const ae=reconcileArgs(a.tokens,W.parameters);f=ae.args,l=ae.commandParts.join(" ")}if(!W){const ae=this.registry.findProcessor("alias",[]),_e=((ce=ae==null?void 0:ae.aliasesFor)==null?void 0:ce.call(ae,r))??(ae==null?void 0:ae.userAliases)??{};if(_e[C])return this.completeProcess(u,r,0),await this.executeSingleCommand(_e[C],t,r);if((C.startsWith("./")||C.startsWith("/"))&&await tryExecuteScript(C,r,this.executeCommand.bind(this))){this.completeProcess(u,r,0),s.end();return}r.writer.writeError(`Command not found: ${r.writer.wrapInColor(l,CliForegroundColor.Cyan)}`),r.writer.writeln(),r.writer.writeInfo(`💡 Type ${r.writer.wrapInColor("help",CliForegroundColor.Cyan)} for a list of available commands`),r.writer.writeInfo(`📦 Use ${r.writer.wrapInColor("pkg add <name>",CliForegroundColor.Cyan)} to install additional commands`),this.failProcess(u,r),r.process.exit(-1,{silent:!0});return}const H=CliArgsParser.convertToRecord(f,W),x={command:l,chainCommands:j,rawCommand:e,args:H,data:t};for(const ae of this.globalParameters)if(!this.processorOwnsParameter(W,ae.parameter)&&await ae.handle(H,W,x,r)){this.completeProcess(u,r,0),s.end();return}const L=W.acceptsRawInput||W.valueRequired?getRightOfWord(l,W.command):void 0;x.value=L;const R=await this.runGuards(x,W,r);if(R){r.writer.writeError(R),this.failProcess(u,r),r.process.exit(-1,{silent:!0});return}const N=!!L||!!t,V=Object.keys(H).length>0;if(W.valueRequired&&!N&&!V){r.writer.writeError(`Value required: ${r.writer.wrapInColor(`${l} <value>`,CliForegroundColor.Cyan)}`),this.failProcess(u,r),r.process.exit(-1,{silent:!0});return}if(!this.validateBeforeExecution(r,W,H,N)){s.end();return}if(W.validateBeforeExecution){const ae=W.validateBeforeExecution(x,r);if(ae.valid===!1){r.writer.writeError((ae==null?void 0:ae.message)||"An error occurred while validating the command."),this.failProcess(u,r),r.process.exit(-1,{silent:!0});return}}let J=null;const Y=new CliCommandExecutionContext(r,W),Z=new AbortController;Y.signal=Z.signal,Y.http=new CliHttpClient(Z.signal);const K=r.onAbort.subscribe(()=>{Z.abort()}),ee=new CapturingTerminalWriter(Y.writer);Y.writer=ee;try{const ae=W.hooks??[];for(const _e of ae.filter(fe=>fe.when==="before"))await _e.execute(Y);J=new CancellablePromise(async(_e,fe)=>{W.processCommand(x,Y).then(()=>{_e()}).catch(ge=>{fe(ge)})}),await J.execute();for(const _e of ae.filter(fe=>fe.when==="after"))await _e.execute(Y);return!s.outputCalled&&ee.hasOutput()&&(s.data=ee.getCapturedData()),this.completeProcess(u,r,r.process.exitCode??0),s.exited||s.end(),ee}catch(ae){(le=r.spinner)==null||le.hide(),ae instanceof ProcessExitedError?(ae.code===0?this.completeProcess(u,r,0):this.failProcess(u,r),J==null||J.cancel(),(ne=r.abort)==null||ne.call(r),ae.code!==0?r.writer.writeError(`Process exited with code ${ae.code}`):r.writer.writeInfo("Process exited successfully with code 0")):isCliAccessDeniedError(ae)?(this.failProcess(u,r),r.writer.writeError(ae.message),r.process.exit(-1)):(this.failProcess(u,r),r.writer.writeError(`Error executing command: ${ae}`),r.process.exit(-1))}finally{K.unsubscribe()}return ee}completeProcess(e,t,r){if(!e)return;const s=t.services.get(CliProcessRegistry_TOKEN);s==null||s.complete(e.pid,r)}failProcess(e,t){if(!e)return;const r=t.services.get(CliProcessRegistry_TOKEN);r==null||r.fail(e.pid)}async showHelp(e,t){try{await this.executeCommand("help "+e.rawCommand,t)}catch(r){t.writer.writeError(`Error executing command: ${r}`)}}validateBeforeExecution(e,t,r,s){var u,d,a,l,f;if(!s&&((u=t.parameters)!=null&&u.some(C=>C.required))){const C=(d=t.parameters)==null?void 0:d.filter(h=>{var j;return h.required&&!r[h.name]&&!((j=h.aliases)!=null&&j.some(U=>r[U]))});if(C!=null&&C.length)return e.writer.writeError(`Missing required parameters: ${C.map(h=>e.writer.wrapInColor(`--${h.name}`,CliForegroundColor.Cyan)).join(", ")}`),!1}const o=((f=(l=(a=t.parameters)==null?void 0:a.filter(C=>C.validator))==null?void 0:l.map(C=>({parameter:C,value:getParameterValue(C,r)})))==null?void 0:f.filter(C=>C.value))??[];if(o.length>0){const C=o.map(h=>({name:h.parameter.name,result:h.parameter.validator(h.value)})).filter(h=>!h.result.valid).map(h=>({name:h.name,message:h.result.message}));if(C!=null&&C.length)return e.writer.writeError("Invalid parameters:"),C.forEach((h,j)=>{e.writer.writeln(` ${j+1}. ${e.writer.wrapInColor(`--${h.name}`,CliForegroundColor.Cyan)} = "${r[h.name]}" → ${h.message}`)}),!1}return!0}async runGuards(e,t,r){let s;try{s=r.services.getAll(ICliCommandGuard_TOKEN)}catch{return}if(!s.length)return;const o=[...s].sort((u,d)=>(u.priority??0)-(d.priority??0));for(const u of o){let d;try{if(u.appliesTo&&!await u.appliesTo(t,e,r))continue;d=await u.canActivate(e,t,r)}catch(l){return`${t.command}: blocked by guard '${u.name}' (${(l==null?void 0:l.message)??l})`}const a=this.guardDenial(d,t.command);if(a)return a}}guardDenial(e,t){const r=`${t}: permission denied`;if(!(e===void 0||e===!0)){if(e===!1)return r;if(typeof e=="string")return e||r;if(typeof e=="object"&&e!==null)return e.allowed?void 0:e.message||r}}processorOwnsParameter(e,t){const r=new Set([t.name,...t.aliases??[]]),s=e.parameters;return s?s.some(o=>{var u;return r.has(o.name)||((u=o.aliases)==null?void 0:u.some(d=>r.has(d)))}):!1}},CliServiceContainer=class{constructor(){this.services=new Map,this.multiServices=new Map,this.sealedTokens=new Set,this.transientRecipes=new Map}get(e){if(this.transientRecipes.has(e))return this.resolveProvider(this.transientRecipes.get(e));if(this.multiServices.has(e)){const t=this.multiServices.get(e);return t[t.length-1]}if(this.services.has(e))return this.services.get(e)}getAll(e){if(this.multiServices.has(e))return this.multiServices.get(e);const t=this.get(e);return t!==void 0?[t]:[]}getRequired(e){const t=this.get(e);if(t===void 0&&!this.has(e))throw new Error(`CliServiceContainer: No provider found for token "${this.tokenToString(e)}".`);return t}has(e){return this.services.has(e)||this.multiServices.has(e)||this.transientRecipes.has(e)}seal(e){this.sealedTokens.add(e)}sealAll(e){for(const t of e)this.sealedTokens.add(t)}isSealed(e){return this.sealedTokens.has(e)}set(e){if(Array.isArray(e))for(const t of e)this.registerProvider(t);else this.registerProvider(e)}getRegisteredTokens(){const e=[];for(const t of this.services.keys())e.push(this.tokenToString(t));for(const t of this.transientRecipes.keys())e.push(`${this.tokenToString(t)} (transient)`);for(const t of this.multiServices.keys())e.push(`${this.tokenToString(t)} (multi)`);return e}getRegisteredServiceDetails(){var t,r;const e=[];for(const[s,o]of this.services.entries())e.push({token:this.tokenToString(s),type:this.describeValue(o),multi:!1});for(const[s,o]of this.transientRecipes.entries()){const u=((t=o.useClass)==null?void 0:t.name)??((r=o.useFactory)==null?void 0:r.name)??"transient";e.push({token:this.tokenToString(s),type:`transient(${u})`,multi:!1})}for(const[s,o]of this.multiServices.entries())e.push({token:this.tokenToString(s),type:`[${o.map(u=>this.describeValue(u)).join(", ")}]`,multi:!0});return e}tokenToString(e){return typeof e=="string"?e:typeof e=="function"?e.name:String(e)}describeValue(e){var t;return e===null?"null":e===void 0?"undefined":typeof e=="string"?`string("${e.length>30?e.slice(0,30)+"...":e}")`:typeof e=="number"?`number(${e})`:typeof e=="boolean"?`boolean(${e})`:Array.isArray(e)?`Array(${e.length})`:typeof e=="object"&&((t=e.constructor)!=null&&t.name)?e.constructor.name:typeof e}registerProvider(e){if(!e.multi&&this.sealedTokens.has(e.provide))throw new Error(`CliServiceContainer: Cannot override sealed service "${this.tokenToString(e.provide)}".`);if(e.transient&&!e.multi)this.transientRecipes.set(e.provide,e),this.services.delete(e.provide);else{const t=this.resolveProvider(e);if(e.multi){const r=this.multiServices.get(e.provide)??[];r.push(t),this.multiServices.set(e.provide,r)}else this.services.set(e.provide,t),this.transientRecipes.delete(e.provide)}e.sealed&&this.sealedTokens.add(e.provide)}resolveProvider(e){if("useValue"in e)return e.useValue;const t=(e.deps??[]).map(r=>this.getRequired(r));if("useFactory"in e)return e.useFactory(...t);if("useClass"in e)return new e.useClass(...t);throw new Error("CliServiceContainer: Provider must specify useValue, useFactory, or useClass.")}},CliLogger=class{constructor(){this.CliLogLevel=CliLogLevel.ERROR}setCliLogLevel(e){this.CliLogLevel=e}log(...e){this.CliLogLevel<=CliLogLevel.LOG&&console.log(...e)}info(...e){this.CliLogLevel<=CliLogLevel.INFO&&console.info(...e)}warn(...e){this.CliLogLevel<=CliLogLevel.WARN&&console.warn(...e)}error(...e){this.CliLogLevel<=CliLogLevel.ERROR&&console.error(...e)}debug(...e){this.CliLogLevel<=CliLogLevel.DEBUG&&console.debug(...e)}},CliCommandHistory=class{constructor(e){this.store=e,this.storageKey="cli-command-history",this.commandHistory=[]}async addCommand(e){const t=e.trim();if(!t)return;const r=this.commandHistory.indexOf(t);r!==-1&&this.commandHistory.splice(r,1),this.commandHistory.push(t),await this.saveHistory()}getLastIndex(){return this.commandHistory.length}getHistory(){return[...this.commandHistory]}async clearHistory(){this.commandHistory=[],await this.saveHistory()}async setHistory(e){this.commandHistory=[...e],await this.saveHistory()}getCommand(e){return this.commandHistory[e]}search(e){if(!e)return[...this.commandHistory];const t=e.toLowerCase();return this.commandHistory.filter(r=>r.toLowerCase().includes(t))}searchBackward(e,t){for(let r=t-1;r>=0;r--)if(this.commandHistory[r].startsWith(e))return r;return-1}searchForward(e,t){for(let r=t+1;r<this.commandHistory.length;r++)if(this.commandHistory[r].startsWith(e))return r;return-1}async saveHistory(){const e=this.commandHistory.slice(-500);return await this.store.set(this.storageKey,e)}async loadHistory(){const e=localStorage.getItem("cliCommandHistory");e&&(localStorage.removeItem("cliCommandHistory"),await this.store.set(this.storageKey,JSON.parse(e)));const t=await this.store.get(this.storageKey);t&&(this.commandHistory=t)}async initialize(){await this.loadHistory()}},welcomeModule={apiVersion:2,name:"@qodalis/cli-welcome",priority:-1,configure(e){return{...this,config:e}},async onAfterBoot(e){var d,a,l;const t=this.config||{};let r=t.show;const s=e.services.get(CliStateStoreManager_TOKEN);if(s){const f=s.getStateStore(CLI_CONFIGURE_STORE_NAME);await f.initialize();const C=f.getState();(d=C==null?void 0:C.system)!=null&&d.welcomeMessage&&(r=C.system.welcomeMessage)}if(r&&!shouldDisplayWelcomeMessage(r)){e.showPrompt();return}t.message?e.terminal.writeln(t.message):[`🚀 Welcome to Web CLI [Version ${e.writer.wrapInColor(LIBRARY_VERSION,CliForegroundColor.Green)}]`,`(c) ${new Date().getFullYear()} Qodalis Solutions. All rights reserved.`,getCliNameArt(e.terminal.cols),"",`📖 ${e.writer.wrapInColor("Documentation:",CliForegroundColor.Green)} https://cli.qodalis.com/docs/`,"",`💡 Type ${e.writer.wrapInColor("'help'",CliForegroundColor.Cyan)} to see available commands`,""].forEach(C=>{e.terminal.write(C+`\r
|
|
191
|
-
`)}),recordWelcomeMessageDisplay(),e.showPrompt();let o=!0;const u=e.services.get(CliStateStoreManager_TOKEN);if(u){const f=u.getStateStore(CLI_CONFIGURE_STORE_NAME);await f.initialize();const C=f.getState();((a=C==null?void 0:C.system)==null?void 0:a.greeting)===!1&&(o=!1)}o&&await((l=e.textAnimator)==null?void 0:l.showText(getGreetingBasedOnTime(),{speed:60,removeAfterTyping:!0}))}};function shouldDisplayWelcomeMessage(e){const t=localStorage.getItem("cliWelcomeMessageLastDisplayed");switch(e){case"always":return!0;case"once":return!t;case"daily":if(!t)return!0;const r=new Date,s=new Date(t);return r.toDateString()!==s.toDateString();case"never":return!1;default:return!0}}function recordWelcomeMessageDisplay(){localStorage.setItem("cliWelcomeMessageLastDisplayed",new Date().toISOString())}var CliBoot=class{constructor(e,t){this.registry=e,this.services=t,this.initialized=!1,this.initializing=!1,this.bootedModules=new Set,this.initializedProcessors=new Set,this.moduleRegistry=new CliModuleRegistry}getModuleRegistry(){return this.moduleRegistry}async boot(e,t){var u,d,a;if((u=e.spinner)==null||u.show(CliIcon.Rocket+" Booting..."),this.initialized||this.initializing){await this.bootShared(e),(d=e.spinner)==null||d.hide();return}this.initializing=!0,this.moduleRegistry.onWarn=l=>e.logger.warn(l),initializeBrowserEnvironment({context:e,registry:this.moduleRegistry}),this.moduleRegistry.onModuleBoot(async l=>{await this.bootModule(l,e)});const r=this.buildCoreModule();await this.bootModule(r,e);const s=t.filter(l=>{const f=l.apiVersion;return typeof f!="number"||f<API_VERSION?(e.writer.writeWarning(`Plugin "${l.name}" targets API version ${f??"unknown"}, but this runtime requires API version ${API_VERSION}. Skipping. See https://qodalis.com/docs/upgrade-v2`),!1):!0}),o=this.topologicalSort(s,e);for(const l of o)await this.bootModule(l,e);await this.bootShared(e),(a=e.spinner)==null||a.hide(),this.initialized=!0}async bootModule(e,t){var r,s,o;if(!this.bootedModules.has(e.name)){for(const u of e.dependencies??[])if(!this.bootedModules.has(u)){t.writer.writeWarning(`Module "${e.name}" requires "${u}" which is not loaded. Skipping.`);return}if(t.logger.info(`Booting module: ${e.name}`),e.services&&e.services.length>0&&this.services.set(e.services),e.guards&&e.guards.length>0&&this.services.set(e.guards.map(u=>({provide:ICliCommandGuard_TOKEN,useValue:u,multi:!0}))),e.permissions&&e.permissions.length>0&&((r=this.services.get(ICliPermissionRegistry_TOKEN))==null||r.register(e.permissions,e.name)),e.translations)for(const[u,d]of Object.entries(e.translations))t.translator.addTranslations(u,d);if(e.onInit)try{await e.onInit(t)}catch(u){t.logger.error(`Error in onInit for module "${e.name}":`,u)}if(e.onSetup){const u=t.services.getRequired(CliKeyValueStore_TOKEN),d=`cli-module-setup:${e.name}`,a=await u.get(d);if(!(a!=null&&a.installed))try{(s=t.spinner)==null||s.hide(),await e.onSetup(t)&&await u.set(d,{installed:!0,installedAt:Date.now()})}catch(l){t.logger.error(`Setup failed for module "${e.name}":`,l)}finally{(o=t.spinner)==null||o.show()}}if(e.processors&&e.processors.length>0){const u=this.filterByVersion(e.processors,t);for(const d of u)this.registry.registerProcessor(d);await this.initializeProcessorsInternal(t,u),this.adoptMergedSubProcessors(u)}this.bootedModules.add(e.name),this.moduleRegistry.has(e.name)||this.moduleRegistry.track(e)}}adoptMergedSubProcessors(e){var t;for(const r of e){if(!r.extendsProcessor)continue;const s=r.command.toLowerCase(),o=this.registry.processors.find(u=>u.command.toLowerCase()===s);if(!(!o||o===r))for(const u of r.processors??[])(t=o.processors)!=null&&t.includes(u)&&(u.parent=o)}}buildCoreModule(){return{apiVersion:API_VERSION,name:"@qodalis/cli-core",version:LIBRARY_VERSION$1,description:"Core CLI services and utilities",processors:[...builtinProcessors],permissions:[{name:"system:packages",description:"Install, update and remove packages (pkg)"},{name:"system:services",description:"Start and stop background services"},{name:"system:eval",description:"Evaluate JavaScript (eval, also requires allowEval)"},{name:"shell:execute",description:"Open a remote shell on a server (ssh)"}]}}topologicalSort(e,t){const r=new Map(e.map(a=>[a.name,a])),s=new Set,o=new Set,u=[],d=a=>{if(s.has(a))return;if(o.has(a)){t.writer.writeError(`Circular dependency detected involving module "${a}". Aborting module loading.`);return}const l=r.get(a);if(l){o.add(a);for(const f of l.dependencies??[]){if(!r.has(f)&&!this.bootedModules.has(f)){t.writer.writeWarning(`Module "${a}" depends on "${f}" which is not loaded. Skipping "${a}".`),o.delete(a);return}d(f)}o.delete(a),s.add(a),u.push(l)}};for(const a of e)d(a.name);return u}filterByVersion(e,t){return e.filter(r=>{const s=r.metadata;return s!=null&&s.requiredCoreVersion&&!satisfiesVersionRange(LIBRARY_VERSION$1,s.requiredCoreVersion)?(t.writer.writeWarning(`Plugin "${r.command}" requires cli-core ${s.requiredCoreVersion} but ${LIBRARY_VERSION$1} is installed. Skipping.`),!1):s!=null&&s.requiredCliVersion&&!satisfiesVersionRange(LIBRARY_VERSION,s.requiredCliVersion)?(t.writer.writeWarning(`Plugin "${r.command}" requires cli ${s.requiredCliVersion} but ${LIBRARY_VERSION} is installed. Skipping.`),!1):!0})}async bootShared(e){const t=this.registry.processors.filter(r=>!this.initializedProcessors.has(r));t.length>0&&await this.initializeProcessorsInternal(e,t)}async initializeProcessorsInternal(e,t,r){for(const s of t)if(!this.initializedProcessors.has(s))try{if(s.parent=r,s.initialize){const o=new CliCommandExecutionContext(e,s);await o.state.initialize(),await s.initialize(o)}this.initializedProcessors.add(s),s.processors&&s.processors.length>0&&await this.initializeProcessorsInternal(e,s.processors,s)}catch(o){e.logger.error(`Error initializing processor "${s.command}":`,o)}}},CliDefaultPingServerService=class{ping(){return new Promise(e=>setTimeout(e,2e3))}},CliDragDropService=class{constructor(e){this._container=e,this._subject=new Subject,this._dragOver=t=>t.preventDefault(),this._drop=t=>{var s;t.preventDefault();const r=Array.from(((s=t.dataTransfer)==null?void 0:s.files)??[]);r.length>0&&this._subject.next(r)},this._container.addEventListener("dragover",this._dragOver),this._container.addEventListener("drop",this._drop)}get onFileDrop(){return this._subject.asObservable()}destroy(){this._container.removeEventListener("dragover",this._dragOver),this._container.removeEventListener("drop",this._drop),this._subject.complete()}},CliPermissionRegistry=class{constructor(){this.definitions=new Map}register(e,t){var r;for(const s of e??[]){const o=(r=s==null?void 0:s.name)==null?void 0:r.trim();if(!o)continue;const u=o.toLowerCase();this.definitions.has(u)||this.definitions.set(u,{...s,name:o,module:s.module??t})}}list(){return[...this.definitions.values()].sort((e,t)=>e.name.localeCompare(t.name))}get(e){return this.definitions.get(e.trim().toLowerCase())}},OverlayAddon=class{constructor(){this.overlayNode=document.createElement("div"),this.overlayNode.style.cssText=`border-radius: 15px;
|
|
192
|
-
font-size: xx-large;
|
|
193
|
-
opacity: 0.75;
|
|
194
|
-
padding: 0.2em 0.5em 0.2em 0.5em;
|
|
195
|
-
position: absolute;
|
|
196
|
-
-webkit-user-select: none;
|
|
197
|
-
-webkit-transition: opacity 180ms ease-in;
|
|
198
|
-
-moz-user-select: none;
|
|
199
|
-
-moz-transition: opacity 180ms ease-in;`,this.overlayNode.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation()},!0)}activate(e){this.terminal=e}dispose(){}showOverlay(e,t){const{terminal:r,overlayNode:s}=this;if(!r.element)return;s.style.color="#101010",s.style.backgroundColor="#f0f0f0",s.textContent=e,s.style.opacity="0.75",s.parentNode||r.element.appendChild(s);const o=r.element.getBoundingClientRect(),u=s.getBoundingClientRect();s.style.top=(o.height-u.height)/2+"px",s.style.left=(o.width-u.width)/2+"px",this.overlayTimeout&&clearTimeout(this.overlayTimeout),t&&(this.overlayTimeout=window.setTimeout(()=>{s.style.opacity="0",this.overlayTimeout=window.setTimeout(()=>{s.parentNode&&s.parentNode.removeChild(s),this.overlayTimeout=void 0,s.style.opacity="0.75"},200)},t||1500))}},CliKeyValueStore=class{constructor(){this.dbName="CliKeyValueDB",this.storeName="KeyValueStore"}initialize(){return new Promise((e,t)=>{const r=indexedDB.open(this.dbName,1);r.onupgradeneeded=s=>{const o=s.target.result;o.objectStoreNames.contains(this.storeName)||o.createObjectStore(this.storeName)},r.onsuccess=s=>{this.db=s.target.result,e()},r.onerror=()=>{var s;t(new Error(`Failed to open IndexedDB "${this.dbName}": ${((s=r.error)==null?void 0:s.message)??"unknown error"}`))}})}async get(e){return new Promise((t,r)=>{try{const u=this.db.transaction(this.storeName,"readonly").objectStore(this.storeName).get(e);u.onsuccess=()=>{t(u.result)},u.onerror=()=>{var d;r(new Error(`IndexedDB get("${e}") failed: ${((d=u.error)==null?void 0:d.message)??"unknown error"}`))}}catch(s){r(new Error(`IndexedDB get("${e}") failed: ${s instanceof Error?s.message:s}`))}})}async set(e,t){return new Promise((r,s)=>{const d=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).put(t,e);d.onsuccess=()=>r(),d.onerror=()=>{var a;s(new Error(`IndexedDB set("${e}") failed: ${((a=d.error)==null?void 0:a.message)??"unknown error"}`))}})}async remove(e){return new Promise((t,r)=>{const u=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete(e);u.onsuccess=()=>t(),u.onerror=()=>{var d;r(new Error(`IndexedDB remove("${e}") failed: ${((d=u.error)==null?void 0:d.message)??"unknown error"}`))}})}async clear(){return new Promise((e,t)=>{const o=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).clear();o.onsuccess=()=>e(),o.onerror=()=>{var u;t(new Error(`IndexedDB clear() failed: ${((u=o.error)==null?void 0:u.message)??"unknown error"}`))}})}},CliStateStore=class{constructor(e,t,r){this.services=e,this.name=t,this.initialState=r,this.state$=new BehaviorSubject(r),this.storageKey=`store-state-${t}`}getState(){return this.state$.getValue()}updateState(e){this.state$.next({...this.getState(),...e})}select(e){return this.state$.asObservable().pipe(map(e),distinctUntilChanged())}subscribe(e){return this.state$.asObservable().subscribe(e)}reset(){this.state$.next(this.initialState)}async persist(){await this.services.getRequired(CliKeyValueStore_TOKEN).set(this.storageKey,this.getState())}async initialize(){const e=this.services.get(CliKeyValueStore_TOKEN);if(e)try{const t=await e.get(this.storageKey);t&&this.state$.next(t)}catch(t){console.error(`CliStateStore: Failed to load state for "${this.name}":`,t)}}dispose(){this.state$.complete()}},CliStateStoreManager=class{constructor(e,t){this.services=e,this.registry=t,this.stores=new Map}getStateStore(e,t){return this.stores.has(e)||this.stores.set(e,new CliStateStore(this.services,e,t??{})),this.stores.get(e)}getProcessorStateStore(e){var r,s;const t=this.registry.getRootProcessor(e);return this.getStateStore(((r=t.stateConfiguration)==null?void 0:r.storeName)||t.command,(s=t.stateConfiguration)==null?void 0:s.initialState)}getStoreEntries(){const e=[];return this.stores.forEach((t,r)=>{e.push({name:r,state:t.getState()})}),e}dispose(){this.stores.forEach(e=>{e.dispose&&e.dispose()}),this.stores.clear()}},CliServerAuthService=class{constructor(e){this.services=e}getHeaders(e,t){const r={...resolveHeaders(t)},s=this.services.getAll(ICliServerAuthTokenProvider_TOKEN);for(const o of s)Object.assign(r,o.getHeaders(e));return r}async getWebSocketParams(e){const t=this.services.getAll(ICliServerAuthTokenProvider_TOKEN);let r=!1;const s={};for(const o of t){if(!o.getWebSocketParams)continue;const u=await o.getWebSocketParams(e);u&&(r=!0,Object.assign(s,u))}return r?s:void 0}},CliCommandCompletionProvider=class{constructor(e){this.registry=e,this.priority=100}getCompletions(e){var a,l,f;const{tokens:t,tokenIndex:r,token:s}=e;if(r===0)return this.getCommandNames(this.registry.processors,s);const o=t[0],u=this.registry.findProcessor(o,[]);if(!((a=u==null?void 0:u.processors)!=null&&a.length))return[];let d=u;for(let C=1;C<r;C++){const h=(l=d.processors)==null?void 0:l.find(j=>j.command===t[C]);if(!((f=h==null?void 0:h.processors)!=null&&f.length))return[];d=h}return this.getCommandNames(d.processors??[],s)}getCommandNames(e,t){const r=[];for(const s of e)r.push(s.command),s.aliases&&r.push(...s.aliases);return getAccelerator().prefixMatch(r,t)}},CliParameterCompletionProvider=class{constructor(e,t){this.registry=e,this.executor=t,this.priority=200}getCompletions(e){const{tokens:t,token:r}=e;if(!r.startsWith("-"))return[];if(t.length===0)return[];const s=t[0],o=t.slice(1).filter(h=>!h.startsWith("-")),u=this.registry.findProcessorInCollection(s,o,this.registry.processors),d=[...(u==null?void 0:u.parameters)??[],...this.executor.getGlobalParameters()];if(d.length===0)return[];const a=r.startsWith("--"),l=a?r.slice(2):r.slice(1),f=[];for(const h of d)if(a)f.push(`--${h.name}`);else{if(h.aliases)for(const j of h.aliases)f.push(`-${j}`);f.push(`--${h.name}`)}const C=a?`--${l}`:`-${l}`;return getAccelerator().prefixMatch(f,C)}},SERVICE_NAME_SUBCOMMANDS=new Set(["start","stop","restart","logs","info"]),CliServiceNameCompletionProvider=class{constructor(e){this.backgroundServices=e,this.priority=50}getCompletions(e){const{tokens:t,tokenIndex:r,token:s}=e;if(r!==2||t.length<2)return[];const o=t[0].toLowerCase();if(o!=="services"&&o!=="svc")return[];const u=t[1].toLowerCase();if(!SERVICE_NAME_SUBCOMMANDS.has(u))return[];const d=s.toLowerCase();return this.backgroundServices.list().map(l=>l.name).filter(l=>l.toLowerCase().startsWith(d)).sort()}},INSTALLED_PKG_SUBCOMMANDS=new Set(["remove","rm","update"]),CliPackageNameCompletionProvider=class{constructor(e){this.services=e,this.priority=50,this.QODALIS_PREFIX="@qodalis/cli-"}async getCompletions(e){const{tokens:t,tokenIndex:r,token:s}=e;if(r<2||t.length<2)return[];const o=t[0].toLowerCase();if(o!=="pkg"&&o!=="packages")return[];const u=t[1].toLowerCase();if(!INSTALLED_PKG_SUBCOMMANDS.has(u))return[];const d=this.services.get(CliPackageManagerService_TOKEN);if(!d)return[];const a=await d.getPackages(),l=s.toLowerCase(),f=new Set(t.slice(2,r).map(h=>h.toLowerCase())),C=[];for(const h of a){const j=h.name,U=j.startsWith(this.QODALIS_PREFIX)?j.slice(this.QODALIS_PREFIX.length):null;f.has(j.toLowerCase())||U&&f.has(U.toLowerCase())||(j.toLowerCase().startsWith(l)&&C.push(j),U&&U.toLowerCase().startsWith(l)&&C.push(U))}return C.sort()}},THEME_NAME_SUBCOMMANDS=new Set(["preview","apply"]),RANDOM_FILTER_VALUES=["dark","light"],SEARCH_TAGS=["popular","retro","fun","pastel","accessibility","built-in","dark","light"],CliThemeNameCompletionProvider=class{constructor(){this.priority=50,this.themeNames=Object.keys(DefaultThemes)}getCompletions(e){const{tokens:t,tokenIndex:r,token:s}=e;if(r!==2||t.length<2)return[];const o=t[0].toLowerCase();if(o!=="theme"&&o!=="themes")return[];const u=t[1].toLowerCase(),d=s.toLowerCase();return THEME_NAME_SUBCOMMANDS.has(u)?this.themeNames.filter(a=>a.toLowerCase().startsWith(d)).sort():u==="random"?RANDOM_FILTER_VALUES.filter(a=>a.startsWith(d)):u==="search"?SEARCH_TAGS.filter(a=>a.startsWith(d)):[]}},CliAliasNameCompletionProvider=class{constructor(e){this.stateStoreManager=e,this.priority=50}getCompletions(e){const{tokens:t,tokenIndex:r,token:s}=e;if(r!==1||t.length<1)return[];if(t[0].toLowerCase()!=="unalias")return[];const d=this.stateStoreManager.getStateStore("aliases").getState(),a=d==null?void 0:d.aliases;if(!a||typeof a!="object")return[];const l=s.toLowerCase();return Object.keys(a).filter(f=>f.toLowerCase().startsWith(l)).sort()}},SERVER_NAME_SUBCOMMANDS=new Set(["status","reconnect","default"]),CliServerNameCompletionProvider=class{constructor(e){this.serverManager=e,this.priority=50}getCompletions(e){var u;const{tokens:t,tokenIndex:r,token:s}=e,o=(u=t[0])==null?void 0:u.toLowerCase();if(o==="ssh"&&r===1)return this.matchServerNames(s,!0);if(o==="server"&&r===2&&t.length>=2){const d=t[1].toLowerCase();if(SERVER_NAME_SUBCOMMANDS.has(d))return this.matchServerNames(s)}return[]}matchServerNames(e,t=!1){var o;const r=e.toLowerCase(),s=[];for(const[u,d]of this.serverManager.connections)t&&!((o=d.capabilities)!=null&&o.shell)||u.toLowerCase().startsWith(r)&&s.push(u);return s.sort()}},CONFIG_KEY_SUBCOMMANDS=new Set(["get","set"]),SYSTEM_KEYS=["logLevel","welcomeMessage"],CliConfigKeyCompletionProvider=class{constructor(e){this.registry=e,this.priority=50}getCompletions(e){const{tokens:t,tokenIndex:r,token:s}=e;if(r!==2||t.length<2)return[];if(t[0].toLowerCase()!=="configure")return[];const u=t[1].toLowerCase();if(!CONFIG_KEY_SUBCOMMANDS.has(u))return[];const d=this.getAllConfigKeys(),a=s.toLowerCase();return d.filter(l=>l.toLowerCase().startsWith(a)).sort()}getAllConfigKeys(){const e=[];for(const r of SYSTEM_KEYS)e.push(`system.${r}`);const t=resolveConfigurationCategories(this.registry);for(const[r,{options:s}]of t)for(const o of s)e.push(`${r}.${o.key}`);return e}},CliServerCommandProcessor=class{constructor(){this.command="server",this.description="Manage remote CLI server connections",this.metadata={icon:CliIcon.Server,module:"@qodalis/cli-server",sealed:!0},this.processors=[new ServerListProcessor,new ServerStatusProcessor,new ServerReconnectProcessor,new ServerDefaultProcessor]}async processCommand(e,t){t.writer.writeln("Usage: server <list|status|reconnect|default>"),t.writer.writeln('Run "help server" for details.')}},ServerListProcessor=class{constructor(){this.command="list",this.description="Show configured servers and their connection status"}async processCommand(e,t){const r=t.services.getRequired(CliServerManager_TOKEN);if(!r||r.connections.size===0){t.writer.writeInfo("No servers configured.");return}const s=["Name","URL","Status","API","Commands"],o=[],u=r.defaultServer;for(const[d,a]of r.connections){const l=d===u;o.push([l?`${d} *`:d,a.config.url,a.connected?"Connected":"Disconnected",a.connected?`v${a.apiVersion}`:"-",a.connected?String(a.commands.length):"-"])}t.writer.writeTable(s,o),u&&t.writer.writeInfo("* = default server")}},ServerStatusProcessor=class{constructor(){this.command="status",this.description="Ping a server and show its version",this.valueRequired=!0}async processCommand(e,t){var d,a;const r=e.value;if(!r){t.writer.writeError("Usage: server status <server-name>"),t.process.exit(1);return}const s=t.services.getRequired(CliServerManager_TOKEN),o=s==null?void 0:s.getConnection(r);if(!o){t.writer.writeError(`Unknown server: ${r}`),t.process.exit(1);return}(d=t.spinner)==null||d.show(`Pinging ${r}...`),t.notifier.info(`Pinging ${r}`);const u=await o.ping();(a=t.spinner)==null||a.hide(),u?(t.writer.writeSuccess(`Server '${r}' is reachable`),t.writer.writeKeyValue({URL:o.config.url,Connected:String(o.connected),"API Version":o.connected?`v${o.apiVersion}`:"unknown",Commands:String(o.commands.length)})):t.writer.writeError(`Server '${r}' is not reachable at ${o.config.url}`)}},ServerReconnectProcessor=class{constructor(){this.command="reconnect",this.description="Re-fetch commands from a server",this.valueRequired=!0}async processCommand(e,t){var u,d;const r=e.value;if(!r){t.writer.writeError("Usage: server reconnect <server-name>"),t.process.exit(1);return}const s=t.services.getRequired(CliServerManager_TOKEN);if(!s){t.writer.writeError("Server manager not available."),t.process.exit(1);return}(u=t.spinner)==null||u.show(`Reconnecting to ${r}...`),t.notifier.info(`Reconnecting to ${r}`);const o=await s.reconnect(r);(d=t.spinner)==null||d.hide(),o.success?t.writer.writeSuccess(`Reconnected to '${r}'. ${o.commandCount} commands available.`):(t.writer.writeError(`Could not reconnect to '${r}'.`),t.process.exit(1))}},ServerDefaultProcessor=class{constructor(){this.command="default",this.description="Get or set the default server for ambiguous commands",this.acceptsRawInput=!0,this.parameters=[{name:"--clear",description:"Remove default server preference",required:!1,type:"boolean"}]}async processCommand(e,t){var o;const r=t.services.getRequired(CliServerManager_TOKEN);if(!r){t.writer.writeError("Server manager not available."),t.process.exit(1);return}if((o=e.args)!=null&&o.clear){r.setDefaultServer(null),t.writer.writeSuccess("Default server cleared.");return}const s=e.value;if(!s){const u=r.defaultServer;u?t.writer.writeInfo(`Default server: ${u}`):t.writer.writeInfo('No default server set. Run "server default <name>" to set one.');return}try{r.setDefaultServer(s),t.writer.writeSuccess(`Default server set to '${s}'.`)}catch{t.writer.writeError(`Unknown server: ${s}`),t.process.exit(1)}}},CliSshCommandProcessor=class{constructor(){this.command="ssh",this.description="Open a remote shell session on a server",this.acceptsRawInput=!0,this.valueRequired=!1,this.metadata={module:"@qodalis/cli-server",icon:"🖥",requiredPermissions:[CliServerPermissions.ShellExecute]},this.parameters=[{name:"server",description:"Name of the server to connect to",required:!1,type:"string"}]}async processCommand(e,t){var a;const r=t.services.getRequired(CliServerManager_TOKEN);if(!r){t.writer.writeError("Server manager not available."),t.process.exit(1);return}const s=[];for(const[l,f]of r.connections)f.connected&&((a=f.capabilities)!=null&&a.shell)&&s.push({name:l,connection:f});if(s.length===0){t.writer.writeError("No servers with shell access are available."),t.process.exit(1);return}const{serverName:o,oneShotCmd:u,connection:d}=await this.resolveServer(e,s,t);!o||!d||(u?await this.executeOneShot(d,o,u,t):await this.executeInteractive(d,o,t))}fullScreenHandler(e){const t=Object.create(this);return t.onData=async r=>{var s;if(((s=e.socket)==null?void 0:s.readyState)===WebSocket.OPEN){const o={type:"stdin",data:r};e.socket.send(JSON.stringify(o))}},t.onResize=(r,s)=>{var o;if(((o=e.socket)==null?void 0:o.readyState)===WebSocket.OPEN){const u={type:"resize",cols:r,rows:s};e.socket.send(JSON.stringify(u))}},t.onDispose=()=>{e.disposed=!0,e.socket&&((e.socket.readyState===WebSocket.OPEN||e.socket.readyState===WebSocket.CONNECTING)&&e.socket.close(),e.socket=null)},t}async resolveServer(e,t,r){var f,C;const s={serverName:null,oneShotCmd:null,connection:null},o=(f=e.args)==null?void 0:f.server;if(o&&typeof o=="string"){const h=t.find(j=>j.name===o);return h?{serverName:o,oneShotCmd:null,connection:h.connection}:(r.writer.writeError(`Server '${o}' not found or does not support shell access.`),r.process.exit(1),s)}const u=(C=e.value)==null?void 0:C.trim();if(u){const h=u.split(/\s+/),j=h[0],U=t.find(W=>W.name===j);if(U){const W=this.remoteCommandFromRaw(e.rawCommand,j)??(h.slice(1).join(" ")||null);return{serverName:j,oneShotCmd:W,connection:U.connection}}return r.writer.writeError(`Server '${j}' not found or does not support shell access.`),r.process.exit(1),s}if(t.length===1)return{serverName:t[0].name,oneShotCmd:null,connection:t[0].connection};const d=r.services.getRequired(CliServerManager_TOKEN);if(d!=null&&d.defaultServer){const h=t.find(j=>j.name===d.defaultServer);if(h)return{serverName:h.name,oneShotCmd:null,connection:h.connection}}const a=await r.reader.readSelectInline("Select a server for shell access:",t.map(h=>({label:h.name,value:h.name})));if(!a)return r.writer.writeInfo("Shell cancelled."),s;const l=t.find(h=>h.name===a);return{serverName:a,oneShotCmd:null,connection:l.connection}}async executeInteractive(e,t,r){var l;const s={socket:null,resolved:!1,disposed:!1},o=r.terminal.cols,u=r.terminal.rows,d=await this.buildShellUrl(e,o,u);(l=r.spinner)==null||l.show(`Connecting to ${t}...`);let a=!1;return new Promise(f=>{var W;const C=r.signal,h=()=>{C==null||C.removeEventListener("abort",j),s.resolved||(s.resolved=!0,f())},j=()=>{var H;(H=r.spinner)==null||H.hide(),this.cleanup(s),a&&r.exitFullScreenMode(),r.process.exit(130,{silent:!0}),h()};if(C!=null&&C.aborted){j();return}C==null||C.addEventListener("abort",j,{once:!0});try{s.socket=new WebSocket(d)}catch(H){(W=r.spinner)==null||W.hide(),r.writer.writeError(`Failed to connect to '${t}': ${H.message}`),r.process.exit(1,{silent:!0}),h();return}s.socket.onopen=()=>{},s.socket.onmessage=H=>{var L,R;const x=parseShellMessage(H.data);if(x)switch(x.type){case"ready":(L=r.spinner)==null||L.hide(),r.writer.writeInfo(`Connected to ${t} (${x.os}, ${x.shell})`),r.enterFullScreenMode(this.fullScreenHandler(s)),a=!0,r.terminal.write("\x1B[2J\x1B[H\x1B[?25h");break;case"stdout":r.terminal.write(x.data);break;case"stderr":r.terminal.write(x.data);break;case"exit":a&&r.exitFullScreenMode(),r.writer.writeInfo(`Shell exited with code ${x.code}.`),r.process.exit(x.code,{silent:!0}),this.cleanup(s),h();break;case"error":(R=r.spinner)==null||R.hide(),a&&r.exitFullScreenMode(),r.writer.writeError(`Server error: ${x.message}`),r.process.exit(1,{silent:!0}),this.cleanup(s),h();break}};let U=!1;s.socket.onclose=H=>{var x;if((x=r.spinner)==null||x.hide(),!s.disposed&&!s.resolved){a&&r.exitFullScreenMode();const L=describeShellClose(H??{},t);L?r.writer.writeError(L):U?r.writer.writeError(`WebSocket error connecting to '${t}'.`):r.writer.writeWarning(`Connection to '${t}' closed.`),r.process.exit(1,{silent:!0})}this.cleanup(s),h()},s.socket.onerror=()=>{U=!0}})}async executeOneShot(e,t,r,s){var l;const o=s.terminal.cols,u=s.terminal.rows,d=await this.buildShellUrl(e,o,u,r);(l=s.spinner)==null||l.show(`Running on ${t}...`);const a={socket:null,resolved:!1,disposed:!1};return new Promise(f=>{var W;const C=s.signal,h=()=>{C==null||C.removeEventListener("abort",j),f()},j=()=>{var H;(H=s.spinner)==null||H.hide(),this.cleanup(a),s.process.exit(130,{silent:!0}),h()};if(C!=null&&C.aborted){j();return}C==null||C.addEventListener("abort",j,{once:!0});try{a.socket=new WebSocket(d)}catch(H){(W=s.spinner)==null||W.hide(),s.writer.writeError(`Failed to connect to '${t}': ${H.message}`),s.process.exit(1,{silent:!0}),h();return}a.socket.onmessage=H=>{var L,R;const x=parseShellMessage(H.data);if(x)switch(x.type){case"ready":(L=s.spinner)==null||L.hide();break;case"stdout":s.writer.writeln(x.data);break;case"stderr":s.writer.writeError(x.data);break;case"exit":x.code!==0&&s.process.exit(x.code,{silent:!0}),this.cleanup(a),h();break;case"error":(R=s.spinner)==null||R.hide(),s.writer.writeError(`Server error: ${x.message}`),s.process.exit(1,{silent:!0}),this.cleanup(a),h();break}};let U=!1;a.socket.onclose=H=>{var L;(L=s.spinner)==null||L.hide();const x=describeShellClose(H??{},t);(x||U)&&(s.writer.writeError(x??`WebSocket error connecting to '${t}'.`),s.process.exit(1,{silent:!0})),this.cleanup(a),h()},a.socket.onerror=()=>{U=!0}})}remoteCommandFromRaw(e,t){const r=e==null?void 0:e.trim().match(/^\S+\s+(\S+)\s+([\s\S]+)$/);return r&&r[1]===t?r[2].trim():null}buildShellUrl(e,t,r,s){let o=`/ws/v1/qcli/shell?cols=${t}&rows=${r}`;return s&&(o+=`&cmd=${encodeURIComponent(s)}`),e.buildWebSocketUrl(o)}cleanup(e){const t=e.socket;t&&(t.onmessage=null,t.onclose=null,t.onerror=null,(t.readyState===WebSocket.OPEN||t.readyState===WebSocket.CONNECTING)&&t.close(),e.socket=null)}};function parseShellMessage(e){try{const t=typeof e=="string"?JSON.parse(e):null;return t&&typeof t=="object"&&typeof t.type=="string"?t:null}catch{return null}}function describeShellClose(e,t){const r=(e.reason??"").toLowerCase();switch(e.code){case 4401:return r==="session ended"?`ssh: shell closed by '${t}' (session ended or shell access revoked)`:r==="shell access is not configured"?`ssh: shell access is not configured on '${t}'`:`ssh: login required on '${t}'`;case 4403:return`ssh: permission denied on '${t}' (requires shell:execute or a valid shell token)`;case 4404:return`ssh: the shell is disabled on '${t}'`;case 4408:return`ssh: shell timed out on '${t}'`;case 4429:return`ssh: too many shell sessions on '${t}'`;default:return null}}function createServerModule(){return{apiVersion:2,name:"@qodalis/cli-server",description:"Remote server command integration",priority:-10,processors:[new CliServerCommandProcessor,new CliSshCommandProcessor],services:[]}}function getTerminalOptions(e){return{cursorBlink:!0,allowProposedApi:!0,fontSize:20,theme:DefaultThemes.default,convertEol:!0,...e??{}}}function initializeTerminal(e,t){var a,l;const r=new xtermExports.Terminal(t),s=new addonFitExports.FitAddon;r.loadAddon(s),r.loadAddon(new addonWebLinksExports.WebLinksAddon),r.loadAddon(new OverlayAddon),r.loadAddon(new addonUnicode11Exports.Unicode11Addon);const o=new D;r.loadAddon(o),r.open(e),s.fit(),requestAnimationFrame(()=>s.fit()),(a=document.fonts)!=null&&a.ready&&document.fonts.ready.then(()=>{requestAnimationFrame(()=>s.fit())}),e.classList.add("terminal-container"),e.style.background=((l=t.theme)==null?void 0:l.background)??"#000";const u=f=>f.preventDefault();e.addEventListener("wheel",u,{passive:!1}),r.focus();const d=new CliDragDropService(e);return{terminal:r,fitAddon:s,serializeAddon:o,dragDropService:d,wheelListener:u}}var LAYOUT_TIMEOUT_MS=1e4;function waitForLayout(e){return new Promise((t,r)=>{const s=Date.now()+LAYOUT_TIMEOUT_MS,o=()=>{if(e.offsetWidth>0&&e.offsetHeight>0){t();return}if(Date.now()>=s){r(new Error(`CliEngine.start(): container has zero dimensions after ${LAYOUT_TIMEOUT_MS}ms. Ensure the container element is visible and laid out before calling start().`));return}requestAnimationFrame(o)};o()})}var SyntaxHighlighterRegistry=class{constructor(){this.highlighters=new Map,this.extensionMap=new Map}register(e){this.highlighters.set(e.id,e);for(const t of e.extensions)this.extensionMap.set(t,e.id)}unregister(e){const t=this.highlighters.get(e);if(t){for(const r of t.extensions)this.extensionMap.delete(r);this.highlighters.delete(e)}}getByExtension(e){const t=this.extensionMap.get(e);return t?this.highlighters.get(t)??null:null}getRegisteredLanguages(){return Array.from(this.highlighters.keys())}},JsonHighlighter=class{constructor(){this.id="json",this.extensions=[".json",".jsonc"],this.initialState=0}getRules(e){return e===1?[{pattern:/.*?\*\//,tokenType:"comment"},{pattern:/.*/,tokenType:"comment"}]:[{pattern:/\/\/.*$/,tokenType:"comment"},{pattern:/\/\*.*?\*\//,tokenType:"comment"},{pattern:/\/\*.*$/,tokenType:"comment"},{pattern:/"(?:[^"\\]|\\.)*"/,tokenType:"string"},{pattern:/-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/,tokenType:"number"},{pattern:/\b(?:true|false|null)\b/,tokenType:"keyword"},{pattern:/[{}\[\]:,]/,tokenType:"punctuation"}]}getNextLineState(e,t){if(t===1)return e.includes("*/")?0:1;const r=e.replace(/"(?:[^"\\]|\\.)*"/g,"").replace(/\/\/.*$/,""),s=r.lastIndexOf("/*");return s===-1?0:r.indexOf("*/",s)===-1?1:0}},HtmlHighlighter=class{constructor(){this.id="html",this.extensions=[".html",".htm",".xml",".svg"],this.initialState=0}getRules(e){return e===1?[{pattern:/.*?-->/,tokenType:"comment"},{pattern:/.*/,tokenType:"comment"}]:[{pattern:/<!--.*?-->/,tokenType:"comment"},{pattern:/<!--.*$/,tokenType:"comment"},{pattern:/(<\/?)([\w-]+)/,tokenType:"tag",captureGroup:2},{pattern:/"[^"]*"/,tokenType:"value"},{pattern:/'[^']*'/,tokenType:"value"},{pattern:/([\w-]+)(\s*=)/,tokenType:"attribute",captureGroup:1},{pattern:/\/?>/,tokenType:"punctuation"},{pattern:/<\/?/,tokenType:"punctuation"},{pattern:/=/,tokenType:"punctuation"}]}getNextLineState(e,t){if(t===1)return e.includes("-->")?0:1;const r=e.lastIndexOf("<!--");return r===-1?0:e.indexOf("-->",r)===-1?1:0}},MarkdownHighlighter=class{constructor(){this.id="markdown",this.extensions=[".md",".mdx",".markdown"],this.initialState=0}getRules(e){return e===1?[{pattern:/^```/,tokenType:"string"},{pattern:/.*/,tokenType:"code"}]:[{pattern:/^#{1,6}\s+.*$/,tokenType:"heading"},{pattern:/^```/,tokenType:"string"},{pattern:/`[^`]+`/,tokenType:"code"},{pattern:/\[[^\]]+\]\([^)]+\)/,tokenType:"link"},{pattern:/\*\*[^*]+\*\*/,tokenType:"bold"},{pattern:/__[^_]+__/,tokenType:"bold"},{pattern:/\*[^*]+\*/,tokenType:"italic"},{pattern:/_[^_]+_/,tokenType:"italic"},{pattern:/^[-*>]\s/,tokenType:"punctuation"}]}getNextLineState(e,t){return e.trimStart().startsWith("```")?t===0?1:0:t}},YamlHighlighter=class{constructor(){this.id="yaml",this.extensions=[".yaml",".yml"],this.initialState=0}getRules(){return[{pattern:/#.*$/,tokenType:"comment"},{pattern:/"(?:[^"\\]|\\.)*"/,tokenType:"string"},{pattern:/'[^']*'/,tokenType:"string"},{pattern:/\b(?:true|false|null|~)\b/,tokenType:"keyword"},{pattern:/-?\d+(?:\.\d+)?/,tokenType:"number"},{pattern:/([\w][\w.\-]*)(\s*:)/,tokenType:"tag",captureGroup:1},{pattern:/[-:\[\]{}]/,tokenType:"punctuation"}]}getNextLineState(){return 0}},CliTranslationService=class{constructor(){this.locale="en",this.translations=new Map}t(e,t,r){var o,u;let s;if(this.locale!=="en"&&(s=(o=this.translations.get(this.locale))==null?void 0:o[e]),s===void 0&&(s=(u=this.translations.get("en"))==null?void 0:u[e]),s===void 0&&(s=t),r)for(const[d,a]of Object.entries(r))s=s.replace(new RegExp(`\\{${d}\\}`,"g"),String(a));return s}getLocale(){return this.locale}setLocale(e){this.locale=e}addTranslations(e,t){const r=this.translations.get(e)||{};this.translations.set(e,{...r,...t})}getAvailableLocales(){return[...new Set(["en",...this.translations.keys()])].sort()}};async function initializeServices(e){const{registry:t,pendingServices:r,dragDropService:s}=e,o=new CliKeyValueStore;await o.initialize();const u=new CliServiceContainer,d=new CliLogger,a=new CliCommandHistory(o);await a.initialize(),u.set([{provide:CliKeyValueStore_TOKEN,useValue:o,sealed:!0}]);const l=new CliStateStoreManager(u,t),f=new CliProcessRegistry;u.set([{provide:CliStateStoreManager_TOKEN,useValue:l,sealed:!0},{provide:CliProcessorsRegistry_TOKEN,useValue:t,sealed:!0},{provide:CliCommandHistory_TOKEN,useValue:a,sealed:!0},{provide:CliProcessRegistry_TOKEN,useValue:f,sealed:!0}]),r.length>0&&u.set(r);const C=new Set(r.map(U=>U.provide));C.has(ICliPingServerService_TOKEN)||u.set([{provide:ICliPingServerService_TOKEN,useClass:CliDefaultPingServerService,sealed:!0}]);const h=new SyntaxHighlighterRegistry;h.register(new JsonHighlighter),h.register(new HtmlHighlighter),h.register(new MarkdownHighlighter),h.register(new YamlHighlighter),u.set([{provide:SyntaxHighlighterRegistry_TOKEN,useValue:h,sealed:!0}]),C.has(ICliEnvironment_TOKEN)||u.set([{provide:ICliEnvironment_TOKEN,useClass:CliEnvironment,sealed:!0}]),u.set([{provide:ICliDragDropService_TOKEN,useValue:s,sealed:!0}]),u.set(cliAccessMetadataGuards.map(U=>({provide:ICliCommandGuard_TOKEN,useValue:U,multi:!0}))),u.set([{provide:ICliPermissionRegistry_TOKEN,useValue:new CliPermissionRegistry,sealed:!0}]);const j=new CliTranslationService;return u.set([{provide:ICliTranslationService_TOKEN,useValue:j,sealed:!0}]),{services:u,logger:d,commandHistory:a,stateStoreManager:l,processRegistry:f,translator:j}}var CliEngine=class{constructor(e,t){this.container=e,this.options=t,this.userModules=[],this.pendingServices=[],this.resizeVersion=0,this.resizeScheduled=!1,this.registry=new CliCommandProcessorRegistry}registerModule(e){this.userModules.push(e)}registerModules(e){this.userModules.push(...e)}registerProcessor(e){this.userModules.push({apiVersion:2,name:`__inline_${e.command}`,processors:[e]})}registerProcessors(e){this.userModules.push({apiVersion:2,name:"__inline_processors",processors:e})}registerService(e,t){this.pendingServices.push({provide:e,useValue:t})}async start(){var x,L,R,N,V;initWasmAccelerator((x=this.options)==null?void 0:x.wasmUrl).catch(()=>{}),await waitForLayout(this.container);const e=getTerminalOptions((L=this.options)==null?void 0:L.terminalOptions),t=initializeTerminal(this.container,e);this.terminal=t.terminal,this.fitAddon=t.fitAddon,this.serializeAddon=t.serializeAddon,this.dragDropService=t.dragDropService,this.wheelListener=t.wheelListener,this.handleResize();const{services:r,logger:s,commandHistory:o,stateStoreManager:u,processRegistry:d,translator:a}=await initializeServices({registry:this.registry,pendingServices:this.pendingServices,dragDropService:this.dragDropService});this.bootService=new CliBoot(this.registry,r),r.set([{provide:CliModuleRegistry_TOKEN,useValue:this.bootService.getModuleRegistry()}]);const l=new CliCommandExecutor(this.registry);this.executionContext=new CliExecutionContext({services:r,logger:s,commandHistory:o,stateStoreManager:u,translator:a},this.terminal,l,{...this.options??{},terminalOptions:e}),this.executionContext.initializeTerminalListeners(),this.executionContext.backgroundServices.setProcessRegistry(d),r.set([{provide:CliBackgroundServiceRegistry_TOKEN,useValue:this.executionContext.backgroundServices}]);const f=new CliServerAuthService(r);r.set([{provide:ICliServerAuthService_TOKEN,useValue:f,sealed:!0}]),r.set([{provide:CliServerManager_TOKEN,useClass:CliServerManager,deps:[CliProcessorsRegistry_TOKEN,ICliServerAuthService_TOKEN]}]);const C=r.getRequired(CliServerManager_TOKEN);(R=this.options)!=null&&R.servers&&this.options.servers.length>0&&await C.connectAll(this.options.servers,{warn:J=>this.executionContext.logger.warn(J),info:J=>this.executionContext.logger.info(J)},this.executionContext.backgroundServices,this.executionContext.logger);const h=createServerModule(),j=(N=this.options)!=null&&N.snapshot?[h,...this.userModules]:[welcomeModule,h,...this.userModules];await this.bootService.boot(this.executionContext,j);const U=[new CliServiceNameCompletionProvider(this.executionContext.backgroundServices),new CliPackageNameCompletionProvider(r),new CliThemeNameCompletionProvider,new CliAliasNameCompletionProvider(u),new CliServerNameCompletionProvider(C),new CliConfigKeyCompletionProvider(this.registry),new CliCommandCompletionProvider(this.registry),new CliParameterCompletionProvider(this.registry,l)],W=r.getAll(ICliCompletionProvider_TOKEN);this.executionContext.completionEngine.setProviders([...W,...U]);const H=[...j].sort((J,Y)=>(J.priority??0)-(Y.priority??0));for(const J of H)if(J.onAfterBoot)try{await J.onAfterBoot(this.executionContext)}catch(Y){this.executionContext.logger.error(`Error in onAfterBoot for module "${J.name}":`,Y)}(V=this.options)!=null&&V.snapshot&&await this.restoreSnapshot(this.options.snapshot),this._startedAt=Date.now(),this.safeFit()}destroy(){var e,t,r,s;if((e=this.executionContext)==null||e.dispose(),this.bootService&&this.executionContext){const o=this.bootService.getModuleRegistry().getAll();for(const u of o)if(u.onDestroy)try{u.onDestroy(this.executionContext)}catch(d){this.executionContext.logger.error(`Error in onDestroy for module "${u.name}":`,d)}}this.resizeListener&&window.removeEventListener("resize",this.resizeListener),this.wheelListener&&this.container.removeEventListener("wheel",this.wheelListener),this.resizeVersion=-1,this.resizeScheduled=!1,(t=this.resizeObserver)==null||t.disconnect(),(r=this.dragDropService)==null||r.destroy(),(s=this.terminal)==null||s.dispose()}focus(){requestAnimationFrame(()=>{var e;this.safeFit(),(e=this.terminal)==null||e.focus()})}getTerminal(){return this.terminal}getContext(){return this.executionContext}getRegistry(){return this.registry}get startedAt(){return this._startedAt}async execute(e){if(!this.executionContext)return;const t=this.executionContext;t.showPrompt({reset:!0}),this.terminal.write(e+`\r
|
|
200
|
-
`),await t.submitCommand(e)}snapshot(){if(!this.executionContext)throw new Error("Cannot snapshot before engine has started");const e=this.executionContext.services.getRequired(CliStateStoreManager_TOKEN);return{version:1,timestamp:Date.now(),terminal:{serializedBuffer:this.serializeAddon.serialize(),cols:this.terminal.cols,rows:this.terminal.rows},commandHistory:this.executionContext.commandHistory.getHistory(),stateStores:e.getStoreEntries()}}async restoreSnapshot(e){e.terminal.serializedBuffer&&await new Promise(r=>{this.terminal.write(e.terminal.serializedBuffer,r)}),await this.executionContext.commandHistory.setHistory(e.commandHistory);const t=this.executionContext.services.getRequired(CliStateStoreManager_TOKEN);for(const r of e.stateStores)t.getStateStore(r.name).updateState(r.state)}handleResize(){this.resizeListener=()=>this.safeFit(),window.addEventListener("resize",this.resizeListener),this.resizeObserver=new ResizeObserver(()=>this.safeFit()),this.resizeObserver.observe(this.container)}safeFit(){if(this.container.offsetWidth>0&&this.container.offsetHeight>0){const e=this.terminal.cols;this.fitAddon.fit(),this.executionContext&&e!==this.terminal.cols&&(this.resizeVersion++,this.resizeScheduled||(this.resizeScheduled=!0,this.deferResizeFix()))}}deferResizeFix(){if(this.resizeVersion<0)return;const e=this.resizeVersion;this.terminal.write("",()=>{var t;if(!(this.resizeVersion<0)){if(this.resizeVersion!==e){this.deferResizeFix();return}this.resizeScheduled=!1,(t=this.executionContext)==null||t.handleTerminalResize()}})}},CliContext=reactExports.createContext({engine:null});function useCli(){return reactExports.useContext(CliContext)}var CliConfigCtx=reactExports.createContext({});function useCliConfig(){return reactExports.useContext(CliConfigCtx)}function CliConfigProvider({modules:e,processors:t,options:r,services:s,children:o}){return jsxRuntimeExports.jsx(CliConfigCtx.Provider,{value:{modules:e,processors:t,options:r,services:s},children:o})}function useCliEngine(e,t){const[r,s]=reactExports.useState(null),o=reactExports.useRef(null),u=reactExports.useRef(null);return reactExports.useEffect(()=>{if(t!=null&&t.disabled||!e.current)return;const d=e.current;return u.current=setTimeout(()=>{if(u.current=null,!d)return;const a=new CliEngine(d,t==null?void 0:t.options);if(a.registerService("cli-framework","React"),t!=null&&t.services)for(const[l,f]of Object.entries(t.services))a.registerService(l,f);t!=null&&t.modules&&a.registerModules(t.modules),t!=null&&t.processors&&a.registerProcessors(t.processors),o.current=a,a.start().then(()=>s(a))},0),()=>{if(u.current!==null){clearTimeout(u.current),u.current=null;return}o.current&&(o.current.destroy(),o.current=null,s(null))}},[]),r}function Cli({modules:e,processors:t,options:r,services:s,snapshot:o,onReady:u,style:d,className:a}){const l=useCli(),f=useCliConfig(),C=reactExports.useRef(null),h=!!l.engine,j=e??f.modules,U=t??f.processors,W=r??f.options,H=s??f.services,x=o?{...W,snapshot:o}:W,L=useCliEngine(C,{modules:j,processors:U,options:x,services:H,disabled:h}),R=l.engine??L;return reactExports.useEffect(()=>{R&&u&&u(R)},[R,u]),h?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}):jsxRuntimeExports.jsx("div",{ref:C,style:{height:"100%",...d},className:a})}var MIN_PANE_WIDTH_PERCENT=10,TerminalIcon=()=>jsxRuntimeExports.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("polyline",{points:"4 17 10 11 4 5"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),MaximizeIcon=()=>jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("polyline",{points:"15 3 21 3 21 9"}),jsxRuntimeExports.jsx("polyline",{points:"9 21 3 21 3 15"}),jsxRuntimeExports.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),jsxRuntimeExports.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),RestoreIcon=()=>jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("polyline",{points:"4 14 10 14 10 20"}),jsxRuntimeExports.jsx("polyline",{points:"20 10 14 10 14 4"}),jsxRuntimeExports.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),jsxRuntimeExports.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),CloseIcon=()=>jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),HideIcon=()=>jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("line",{x1:"5",y1:"18",x2:"19",y2:"18"}),jsxRuntimeExports.jsx("polyline",{points:"9 14 12 17 15 14"})]});function CollapseChevron({position:e,isCollapsed:t}){let r;switch(e){case"top":r=t?"6 9 12 15 18 9":"18 15 12 9 6 15";break;case"left":r=t?"9 18 15 12 9 6":"15 6 9 12 15 18";break;case"right":r=t?"15 6 9 12 15 18":"9 18 15 12 9 6";break;default:r=t?"18 15 12 9 6 15":"6 9 12 15 18 9";break}return jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("polyline",{points:r})})}function HideTabChevron({position:e}){let t;switch(e){case"top":t="6 9 12 15 18 9";break;case"left":t="9 18 15 12 9 6";break;case"right":t="15 6 9 12 15 18";break;default:t="18 15 12 9 6 15";break}return jsxRuntimeExports.jsx("svg",{className:"cli-panel-hide-tab-arrow",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("polyline",{points:t})})}function PositionIcon({position:e,size:t=20}){let r;switch(e){case"top":r=jsxRuntimeExports.jsx("rect",{x:"4",y:"4",width:"16",height:"5",rx:"1",fill:"currentColor",stroke:"none",opacity:"0.5"});break;case"left":r=jsxRuntimeExports.jsx("rect",{x:"4",y:"4",width:"5",height:"16",rx:"1",fill:"currentColor",stroke:"none",opacity:"0.5"});break;case"right":r=jsxRuntimeExports.jsx("rect",{x:"15",y:"4",width:"5",height:"16",rx:"1",fill:"currentColor",stroke:"none",opacity:"0.5"});break;default:r=jsxRuntimeExports.jsx("rect",{x:"4",y:"15",width:"16",height:"5",rx:"1",fill:"currentColor",stroke:"none",opacity:"0.5"});break}return jsxRuntimeExports.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),r]})}React3.forwardRef(function e(t,r){const{options:s,modules:o,processors:u,services:d,onClose:a,style:l,className:f}=t,C=useCliConfig(),h=s?{...C.options,...s}:C.options,j=o??C.modules,U=u??C.processors,W=d??C.services,[H,x]=reactExports.useState(()=>loadPanelPosition()??(h==null?void 0:h.position)??"bottom"),[L,R]=reactExports.useState((h==null?void 0:h.isCollapsed)??!0),[N,V]=reactExports.useState((h==null?void 0:h.isHidden)??!1),[J,Y]=reactExports.useState(!1),[Z,K]=reactExports.useState(600),[ee,oe]=reactExports.useState(400),[ce,le]=reactExports.useState(0),ne=t.position!==void 0?t.position:H,ae=t.collapsed!==void 0?t.collapsed:L,_e=t.hidden!==void 0?t.hidden:N,fe=t.maximized!==void 0?t.maximized:J,ge=t.height!==void 0?t.height:Z,he=t.width!==void 0?t.width:ee,X=t.activeTabId!==void 0?t.activeTabId:ce,re=reactExports.useCallback(ve=>{var Se;R(ve),(Se=t.onCollapsedChange)==null||Se.call(t,ve)},[t.onCollapsedChange]),Q=reactExports.useCallback(ve=>{var Se;V(ve),(Se=t.onHiddenChange)==null||Se.call(t,ve)},[t.onHiddenChange]),se=reactExports.useCallback(ve=>{var Se;Y(ve),(Se=t.onMaximizedChange)==null||Se.call(t,ve)},[t.onMaximizedChange]),Ce=reactExports.useCallback(ve=>{var Se;K(ve),(Se=t.onHeightChange)==null||Se.call(t,ve)},[t.onHeightChange]),we=reactExports.useCallback(ve=>{var Se;oe(ve),(Se=t.onWidthChange)==null||Se.call(t,ve)},[t.onWidthChange]),Be=reactExports.useCallback(ve=>{var Se;le(ve),(Se=t.onActiveTabIdChange)==null||Se.call(t,ve)},[t.onActiveTabIdChange]),Re=reactExports.useCallback(ve=>{var Se;x(ve),savePanelPosition(ve),(Se=t.onPositionChange)==null||Se.call(t,ve)},[t.onPositionChange]),de=(h==null?void 0:h.closable)??!0,ie=(h==null?void 0:h.resizable)??!0,De=ne==="left"||ne==="right",be=(h==null?void 0:h.hideable)??!0,Te=(h==null?void 0:h.hideAlignment)??"center",Pe=(h==null?void 0:h.syncTheme)??!1,[Je,Ie]=reactExports.useState(!0),[We,Xe]=reactExports.useState(!1),ze=reactExports.useRef(!0),[At,cr]=reactExports.useState({}),$t=reactExports.useRef(null),[nt,dt]=reactExports.useState([]),[gt,Ot]=reactExports.useState(0),wt=reactExports.useRef({tab:1,pane:1}),[vt,wr]=reactExports.useState({visible:!1,x:0,y:0,tabId:0}),ut=reactExports.useRef(new Map),Jt=reactExports.useRef(X);Jt.current=X;const yt=reactExports.useRef(gt);yt.current=gt;const[Nt,it]=reactExports.useState(!1),pi=reactExports.useRef({tabId:0,dividerIndex:0,startX:0,startWidths:[],containerWidth:0}),[Pi,Qs]=reactExports.useState(!1),dr=reactExports.useRef({startY:0,startHeight:0,startX:0,startWidth:0}),Ti=reactExports.useRef(600),ji=reactExports.useRef(400),[hr,cs]=reactExports.useState("idle"),[bt,Mr]=reactExports.useState(null),[xr,tn]=reactExports.useState({running:0,total:0}),[ds,rn]=reactExports.useState([]),[Ur,fi]=reactExports.useState("none"),[kr,mi]=reactExports.useState([]),[gi,vi]=reactExports.useState(0),[zr,Ci]=reactExports.useState(null),[Hr,Er]=reactExports.useState(!1),[_i,wi]=reactExports.useState(!1),hs=reactExports.useRef(null),ps=reactExports.useRef(null),tr=reactExports.useCallback(ve=>{const Se=ve.reduce(($e,qe)=>$e+qe.widthPercent,0);if(Se===0)return;const je=100/Se;ve.forEach($e=>{$e.widthPercent*=je})},[]),yr=reactExports.useCallback(ve=>{var Ze;const Se=wt.current.tab++,je=wt.current.pane++,$e={id:je,widthPercent:100},qe={id:Se,title:ve??`Terminal ${Se}`,isEditing:!1,panes:[$e]};return dt(Qe=>[...Qe,qe]),Be(Se),Ot(je),(Ze=t.onTabAdded)==null||Ze.call(t,{tabId:Se}),Se},[Be,t.onTabAdded]),$i=reactExports.useCallback(()=>{ae?(re(!1),We||(Xe(!0),yr())):re(!0)},[ae,We,re,yr]),Wr=reactExports.useCallback(ve=>{var Se;dt(je=>{const $e=je.find(Ze=>Ze.id===ve);$e&&$e.panes.forEach(Ze=>{var Qe;(Qe=ut.current.get(Ze.id))==null||Qe.destroy(),ut.current.delete(Ze.id)});const qe=je.filter(Ze=>Ze.id!==ve);if(qe.length===0)return Xe(!1),re(!0),[];if(Jt.current===ve){const Ze=je.findIndex(st=>st.id===ve),Qe=Math.min(Ze,qe.length-1);Be(qe[Qe].id)}return qe}),(Se=t.onTabClosed)==null||Se.call(t,{tabId:ve})},[re,Be,t.onTabClosed]),Oi=reactExports.useCallback(ve=>{Be(ve),dt(Se=>{const je=Se.find($e=>$e.id===ve);return je&&je.panes.length>0&&Ot(je.panes[0].id),Se})},[Be]),fs=reactExports.useCallback((ve,Se)=>{dt(je=>je.map($e=>$e.id===ve?{...$e,title:Se}:$e))},[]),ms=reactExports.useCallback(ve=>{dt(Se=>Se.map(je=>({...je,isEditing:je.id===ve})))},[]),gs=reactExports.useCallback((ve,Se)=>{const je=Se.trim();dt($e=>$e.map(qe=>qe.id===ve?{...qe,title:je||qe.title,isEditing:!1}:qe))},[]),vs=reactExports.useCallback(ve=>{var $e;const Se=ve??Jt.current,je=wt.current.pane++;return dt(qe=>qe.map(Ze=>{if(Ze.id!==Se)return Ze;const Qe=[...Ze.panes.map(ft=>({...ft})),{id:je,widthPercent:0}],st=100/Qe.length;return Qe.forEach(ft=>{ft.widthPercent=st}),tr(Qe),{...Ze,panes:Qe}})),Ot(je),($e=t.onPaneSplit)==null||$e.call(t,{paneId:je,tabId:Se}),je},[tr,t.onPaneSplit]),Cs=reactExports.useCallback(ve=>{dt(Se=>{var je,$e;for(let qe=0;qe<Se.length;qe++){const Ze=Se[qe],Qe=Ze.panes.findIndex(St=>St.id===ve);if(Qe===-1)continue;if(Ze.panes.length<=1)return setTimeout(()=>Wr(Ze.id),0),Se;const st=Ze.panes.filter(St=>St.id!==ve);tr(st);const ft=[...Se];return ft[qe]={...Ze,panes:st},(je=ut.current.get(ve))==null||je.destroy(),ut.current.delete(ve),yt.current===ve&&Ot(st[Math.min(Qe,st.length-1)].id),($e=t.onPaneClosed)==null||$e.call(t,{paneId:ve}),ft}return Se})},[Wr,tr,t.onPaneClosed]),rt=reactExports.useCallback(()=>{wr(ve=>({...ve,visible:!1}))},[]);reactExports.useEffect(()=>{if(!vt.visible)return;const ve=()=>rt();return document.addEventListener("click",ve),()=>document.removeEventListener("click",ve)},[vt.visible,rt]);const uo=reactExports.useCallback(ve=>{ie&&(ve.preventDefault(),ae&&$i(),Qs(!0),dr.current={startY:ve.clientY,startHeight:ge,startX:ve.clientX,startWidth:he})},[ae,$i,ge,he,ie]);reactExports.useEffect(()=>{if(!Pi)return;const ve=je=>{if(De){const $e=ne==="left"?je.clientX-dr.current.startX:dr.current.startX-je.clientX;let qe=Math.max(100,dr.current.startWidth+$e);qe>window.innerWidth&&(qe=window.innerWidth),we(qe)}else{const $e=ne==="top"?je.clientY-dr.current.startY:dr.current.startY-je.clientY;let qe=Math.max(100,dr.current.startHeight+$e);qe>window.innerHeight&&(qe=window.innerHeight),Ce(qe)}},Se=()=>Qs(!1);return document.addEventListener("mousemove",ve),document.addEventListener("mouseup",Se),()=>{document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",Se)}},[Pi,De,ne,we,Ce]);const _s=reactExports.useCallback((ve,Se,je)=>{ve.preventDefault();const $e=nt.find(Ze=>Ze.id===Se);if(!$e)return;it(!0);const qe=ve.target.closest(".cli-panel-panes-container");pi.current={tabId:Se,dividerIndex:je,startX:ve.clientX,startWidths:$e.panes.map(Ze=>Ze.widthPercent),containerWidth:qe?qe.clientWidth:1}},[nt]);reactExports.useEffect(()=>{if(!Nt)return;const ve=je=>{const $e=pi.current,Ze=(je.clientX-$e.startX)/$e.containerWidth*100,Qe=$e.dividerIndex;let st=$e.startWidths[Qe]+Ze,ft=$e.startWidths[Qe+1]-Ze;st<MIN_PANE_WIDTH_PERCENT&&(st=MIN_PANE_WIDTH_PERCENT,ft=$e.startWidths[Qe]+$e.startWidths[Qe+1]-MIN_PANE_WIDTH_PERCENT),ft<MIN_PANE_WIDTH_PERCENT&&(ft=MIN_PANE_WIDTH_PERCENT,st=$e.startWidths[Qe]+$e.startWidths[Qe+1]-MIN_PANE_WIDTH_PERCENT),dt(St=>{const Ye=St.map(br=>({...br,panes:br.panes.map(kt=>({...kt}))})),rr=Ye.find(br=>br.id===$e.tabId);return rr&&(rr.panes[Qe].widthPercent=st,rr.panes[Qe+1].widthPercent=ft),Ye})},Se=()=>{it(!1),document.body.classList.remove("cli-pane-resizing")};return document.body.classList.add("cli-pane-resizing"),document.addEventListener("mousemove",ve),document.addEventListener("mouseup",Se),()=>{document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",Se)}},[Nt]),reactExports.useEffect(()=>{if(!Pe||!We)return;const ve=()=>{const je=ut.current.values().next().value;if(!je)return;const $e=je.getTerminal().options.theme;$e&&cr(derivePanelThemeStyles($e))},Se=setTimeout(()=>{var qe;ve();const je=(qe=$t.current)==null?void 0:qe.querySelector(".terminal-container");if(!je)return;const $e=new MutationObserver(ve);return $e.observe(je,{attributes:!0,attributeFilter:["style"]}),()=>$e.disconnect()},200);return()=>clearTimeout(Se)},[Pe,We]),reactExports.useEffect(()=>{if(!We)return;const ve=setInterval(()=>{var ft,St;const je=nt.find(Ye=>Ye.id===Jt.current);if(!je)return;const $e=ut.current.get((ft=je.panes[0])==null?void 0:ft.id);if(!$e)return;const qe=$e.getContext();if(!qe)return;const Ze=!!qe.isExecuting||!!qe.contextProcessor;cs(Ze?"running":"idle");const Qe=qe.lastCommandResult;Mr(Qe?{name:Qe.command,success:Qe.success}:null);const st=(St=qe.notifier)==null?void 0:St.current;Ci(st||null)},300),Se=setInterval(()=>{var Ze,Qe,st,ft,St,Ye,rr,br;const je=nt.find(kt=>kt.id===Jt.current);if(!je)return;const $e=ut.current.get((Ze=je.panes[0])==null?void 0:Ze.id);if(!$e)return;const qe=$e.getContext();if(qe){try{const kt=((Qe=qe.backgroundServices)==null?void 0:Qe.list())??[];tn({running:kt.filter(ir=>ir.status==="running").length,total:kt.length}),rn(kt.map(ir=>({name:ir.name,status:ir.status,description:ir.description})))}catch{}try{let kt;try{kt=(ft=(st=qe.services)==null?void 0:st.get)==null?void 0:ft.call(st,"cli-server-manager")}catch{}const ir=[];if(((St=kt==null?void 0:kt.connections)==null?void 0:St.size)>0){let Fr=!1;for(const[Gr,pr]of kt.connections)pr.connected&&(Fr=!0),ir.push({name:Gr,url:((Ye=pr.config)==null?void 0:Ye.url)??"",connected:!!pr.connected,apiVersion:pr.connected?pr.apiVersion:void 0,commandCount:pr.connected?(rr=pr.commands)==null?void 0:rr.length:void 0});fi(Fr?"connected":"disconnected")}else{const Fr=(br=$e.options)==null?void 0:br.servers;if(Array.isArray(Fr)&&Fr.length>0){for(const Gr of Fr)Gr.enabled!==!1&&ir.push({name:Gr.name,url:Gr.url??"",connected:!1});fi("disconnected")}else fi("none")}mi(ir)}catch{}vi($e.startedAt?Date.now()-$e.startedAt:0)}},2e3);return()=>{clearInterval(ve),clearInterval(Se)}},[We,nt]);const sn=reactExports.useCallback(()=>{const ve=!fe;ve?De?(ji.current=he,we(window.innerWidth)):(Ti.current=ge,Ce(window.innerHeight)):De?we(ji.current):Ce(Ti.current),se(ve)},[fe,ge,he,De,se,we,Ce]),qr=reactExports.useCallback(()=>{Ie(!1),a==null||a()},[a]),co=reactExports.useCallback(()=>{ze.current=ae,Q(!0)},[ae,Q]),nn=reactExports.useCallback(()=>{Q(!1),re(ze.current)},[Q,re]),[Vr,Ht]=reactExports.useState(!1),ws=reactExports.useCallback(()=>Ht(!1),[]);reactExports.useEffect(()=>{if(Vr)return document.addEventListener("click",ws),()=>document.removeEventListener("click",ws)},[Vr,ws]),reactExports.useEffect(()=>{if(!Hr&&!_i)return;const ve=()=>{Er(!1),wi(!1)};return document.addEventListener("click",ve),()=>document.removeEventListener("click",ve)},[Hr,_i]);const Yt=reactExports.useCallback(ve=>{ve.stopPropagation(),Ht(Se=>!Se)},[]),ho=reactExports.useCallback(ve=>{Ht(!1),Re(ve)},[Re]),on=reactExports.useCallback(ve=>{const Se=ve??yt.current;return ut.current.get(Se)},[]),an=reactExports.useCallback(()=>({collapsed:ae,hidden:_e,maximized:fe,position:ne,height:ge,width:he,activeTabId:X,activePaneId:gt,tabs:nt.map(ve=>({id:ve.id,title:ve.title,panes:ve.panes.map(Se=>({id:Se.id,widthPercent:Se.widthPercent}))}))}),[ae,_e,fe,ne,ge,he,X,gt,nt]);React3.useImperativeHandle(r,()=>({open:()=>{Je||Ie(!0),_e&&Q(!1),ae&&(re(!1),We||(Xe(!0),yr()))},collapse:()=>{ae||re(!0)},toggleCollapse:()=>{ae?(re(!1),We||(Xe(!0),yr())):re(!0)},hide:()=>{_e||Q(!0)},unhide:()=>{_e&&Q(!1)},toggleHide:()=>{Q(!_e)},close:qr,maximize:()=>{fe||se(!0)},restore:()=>{fe&&se(!1)},toggleMaximize:()=>{se(!fe)},resize:ve=>{ve.height!==void 0&&Ce(ve.height),ve.width!==void 0&&we(ve.width)},setPosition:Re,addTab:yr,closeTab:Wr,selectTab:Oi,renameTab:fs,splitPane:vs,closePane:Cs,getEngine:on,getState:an}),[ae,_e,fe,We,re,Q,se,Ce,we,Re,qr,yr,Wr,Oi,fs,vs,Cs,on,an]);const xi=(()=>{const ve=Math.floor(gi/6e4);return ve<60?`${ve}m`:`${Math.floor(ve/60)}h${ve%60}m`})();if(!Je)return null;const Ni={...De?{width:`${he}px`}:{height:`${ge}px`},..._e?{display:"none"}:{},...At,...l};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[_e&&jsxRuntimeExports.jsxs("button",{className:"cli-panel-hide-tab","data-position":ne,"data-hide-align":Te,style:At,title:"Show CLI",onClick:nn,children:[jsxRuntimeExports.jsxs("svg",{className:"cli-panel-hide-tab-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("polyline",{points:"4 17 10 11 4 5"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),jsxRuntimeExports.jsx("span",{className:"cli-panel-hide-tab-label",children:"CLI"}),jsxRuntimeExports.jsx(HideTabChevron,{position:ne})]}),jsxRuntimeExports.jsxs("div",{ref:$t,className:`cli-panel-wrapper ${ae?"collapsed":""} ${fe?"maximized":""} ${Pi?"resizing":""} ${f??""}`,style:Ni,"data-position":ne,"data-resizable":String(ie),"data-closable":String(de),"data-hideable":String(be),children:[jsxRuntimeExports.jsxs("div",{className:"cli-panel-header",children:[jsxRuntimeExports.jsx("div",{className:"cli-panel-resize-bar",onMouseDown:uo,children:jsxRuntimeExports.jsx("div",{className:"cli-panel-resize-grip"})}),jsxRuntimeExports.jsxs("div",{className:"cli-panel-header-content",children:[jsxRuntimeExports.jsxs("p",{className:"cli-panel-title",children:[jsxRuntimeExports.jsx("span",{className:"cli-panel-title-icon",children:jsxRuntimeExports.jsx(TerminalIcon,{})}),"CLI"]}),(ne==="bottom"||ne==="top")&&jsxRuntimeExports.jsxs("div",{className:"cli-panel-status-indicators",children:[jsxRuntimeExports.jsxs("span",{className:`cli-panel-status-item${hr==="running"?" status-running":""}`,children:[jsxRuntimeExports.jsx("span",{className:`cli-panel-status-dot ${hr==="running"?"dot-running":"dot-idle"}`}),jsxRuntimeExports.jsx("span",{className:"cli-panel-status-label",children:hr})]}),xr.total>0&&jsxRuntimeExports.jsxs("span",{ref:hs,className:"cli-panel-status-item status-clickable",onClick:ve=>{ve.stopPropagation(),Er(Se=>!Se),wi(!1)},children:[jsxRuntimeExports.jsx("span",{className:"cli-panel-status-icon",children:"⚙"}),jsxRuntimeExports.jsxs("span",{className:"cli-panel-status-label",children:[xr.running,"/",xr.total," services"]})]}),bt&&jsxRuntimeExports.jsxs("span",{className:"cli-panel-status-item",children:[jsxRuntimeExports.jsx("span",{className:`cli-panel-status-icon ${bt.success?"status-success":"status-error"}`,children:bt.success?"✓":"✗"}),jsxRuntimeExports.jsx("span",{className:"cli-panel-status-label",children:bt.name})]}),Ur!=="none"&&jsxRuntimeExports.jsxs("span",{ref:ps,className:"cli-panel-status-item status-clickable",onClick:ve=>{ve.stopPropagation(),wi(Se=>!Se),Er(!1)},children:[jsxRuntimeExports.jsx("span",{className:`cli-panel-status-dot ${Ur==="connected"?"dot-idle":"dot-error"}`}),jsxRuntimeExports.jsxs("span",{className:"cli-panel-status-label",children:[kr.filter(ve=>ve.connected).length,"/",kr.length," servers"]})]}),gi>0&&jsxRuntimeExports.jsxs("span",{className:"cli-panel-status-item status-muted",children:[jsxRuntimeExports.jsx("span",{className:"cli-panel-status-icon",children:"↑"}),jsxRuntimeExports.jsx("span",{className:"cli-panel-status-label",children:xi})]}),zr&&jsxRuntimeExports.jsx("span",{className:`cli-panel-status-item status-text level-${zr.level}`,children:jsxRuntimeExports.jsx("span",{className:"cli-panel-status-label",children:zr.message})})]}),jsxRuntimeExports.jsxs("div",{className:"cli-panel-status-indicators-compact",children:[jsxRuntimeExports.jsx("span",{className:"cli-panel-status-compact-item",title:hr,children:jsxRuntimeExports.jsx("span",{className:`cli-panel-status-dot ${hr==="running"?"dot-running":"dot-idle"}`})}),xr.total>0&&jsxRuntimeExports.jsx("span",{ref:ne==="left"||ne==="right"?hs:void 0,className:"cli-panel-status-compact-item status-clickable",title:`${xr.running}/${xr.total} services`,onClick:ve=>{ve.stopPropagation(),Er(Se=>!Se),wi(!1)},children:jsxRuntimeExports.jsx("span",{className:"cli-panel-status-icon",children:"⚙"})}),bt&&jsxRuntimeExports.jsx("span",{className:"cli-panel-status-compact-item",title:`${bt.success?"✓":"✗"} ${bt.name}`,children:jsxRuntimeExports.jsx("span",{className:`cli-panel-status-icon ${bt.success?"status-success":"status-error"}`,children:bt.success?"✓":"✗"})}),Ur!=="none"&&jsxRuntimeExports.jsx("span",{ref:ne==="left"||ne==="right"?ps:void 0,className:"cli-panel-status-compact-item status-clickable",title:`${kr.filter(ve=>ve.connected).length}/${kr.length} servers`,onClick:ve=>{ve.stopPropagation(),wi(Se=>!Se),Er(!1)},children:jsxRuntimeExports.jsx("span",{className:`cli-panel-status-dot ${Ur==="connected"?"dot-idle":"dot-error"}`})}),gi>0&&jsxRuntimeExports.jsx("span",{className:"cli-panel-status-compact-item status-muted",title:xi,children:jsxRuntimeExports.jsx("span",{className:"cli-panel-status-icon",children:"↑"})}),zr&&jsxRuntimeExports.jsx("span",{className:"cli-panel-status-compact-item",title:zr.message,children:jsxRuntimeExports.jsx("span",{className:`cli-panel-status-compact-dot level-${zr.level}`})})]}),jsxRuntimeExports.jsxs("div",{className:"cli-panel-action-buttons",children:[jsxRuntimeExports.jsxs("div",{className:"cli-panel-btn-position-wrapper",onClick:ve=>ve.stopPropagation(),children:[jsxRuntimeExports.jsx("button",{className:"cli-panel-btn cli-panel-btn-position",title:"Move panel",onClick:Yt,children:jsxRuntimeExports.jsx(PositionIcon,{position:ne})}),Vr&&jsxRuntimeExports.jsx("div",{className:"cli-panel-position-dropdown",children:["bottom","top","left","right"].map(ve=>jsxRuntimeExports.jsxs("button",{className:`cli-panel-position-dropdown-item${ne===ve?" active":""}`,onClick:()=>ho(ve),children:[jsxRuntimeExports.jsx(PositionIcon,{position:ve,size:16}),ve.charAt(0).toUpperCase()+ve.slice(1)]},ve))})]}),be&&jsxRuntimeExports.jsx("button",{className:"cli-panel-btn cli-panel-btn-hide",title:"Hide",onClick:co,children:jsxRuntimeExports.jsx(HideIcon,{})}),jsxRuntimeExports.jsx("button",{className:"cli-panel-btn",title:fe?"Restore":"Maximize",disabled:ae,onClick:sn,children:fe?jsxRuntimeExports.jsx(RestoreIcon,{}):jsxRuntimeExports.jsx(MaximizeIcon,{})}),jsxRuntimeExports.jsx("button",{className:"cli-panel-btn",title:ae?"Expand":"Collapse",onClick:$i,children:jsxRuntimeExports.jsx(CollapseChevron,{position:ne,isCollapsed:ae})}),de&&jsxRuntimeExports.jsx("button",{className:"cli-panel-btn cli-panel-btn-close",title:"Close",onClick:qr,children:jsxRuntimeExports.jsx(CloseIcon,{})})]})]}),jsxRuntimeExports.jsx("div",{className:`cli-panel-glow-line${hr==="running"?" glow-active":""}`})]}),We&&jsxRuntimeExports.jsxs("div",{className:"cli-panel-content",style:ae?{display:"none"}:void 0,children:[jsxRuntimeExports.jsxs("div",{className:"cli-panel-tabs",children:[jsxRuntimeExports.jsx("ul",{className:"cli-panel-tab-list",children:nt.map(ve=>jsxRuntimeExports.jsx("li",{className:`cli-panel-tab ${ve.id===X?"active":""}`,onClick:()=>Oi(ve.id),onDoubleClick:()=>ms(ve.id),onContextMenu:Se=>{Se.preventDefault(),Se.stopPropagation(),wr({visible:!0,x:Se.clientX,y:Se.clientY,tabId:ve.id})},children:ve.isEditing?jsxRuntimeExports.jsx("input",{className:"cli-panel-tab-rename-input",type:"text",defaultValue:ve.title,autoFocus:!0,onKeyDown:Se=>{Se.key==="Enter"?gs(ve.id,Se.target.value):Se.key==="Escape"&&dt(je=>je.map($e=>({...$e,isEditing:!1})))},onBlur:Se=>gs(ve.id,Se.target.value),onClick:Se=>Se.stopPropagation(),onDoubleClick:Se=>Se.stopPropagation()}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{className:`cli-panel-tab-dot ${ve.id!==X?"dot-idle":hr==="running"?"dot-running":bt&&!bt.success?"dot-error":"dot-idle"}`}),jsxRuntimeExports.jsx("span",{className:"cli-panel-tab-title",children:ve.title}),jsxRuntimeExports.jsx("button",{className:"cli-panel-tab-close-btn",title:"Close tab",onClick:Se=>{Se.stopPropagation(),Wr(ve.id)},children:"×"})]})},ve.id))}),jsxRuntimeExports.jsx("button",{className:"cli-panel-add-tab",title:"New terminal",onClick:()=>yr(),children:"+"})]}),jsxRuntimeExports.jsx("div",{className:"cli-panel-instances",children:nt.map(ve=>jsxRuntimeExports.jsx("div",{className:"cli-panel-instance",style:{display:ve.id===X?void 0:"none"},children:jsxRuntimeExports.jsx("div",{className:`cli-panel-panes-container ${Nt?"resizing":""}`,children:ve.panes.map((Se,je)=>jsxRuntimeExports.jsxs(React3.Fragment,{children:[je>0&&jsxRuntimeExports.jsx("div",{className:"cli-panel-pane-divider",onMouseDown:$e=>_s($e,ve.id,je-1),children:jsxRuntimeExports.jsx("div",{className:"cli-panel-pane-divider-grip"})}),jsxRuntimeExports.jsxs("div",{className:`cli-panel-pane ${Se.id===gt&&ve.id===X?"active-pane":""}`,style:{flex:`${Se.widthPercent} 1 0`},onClick:()=>{Ot(Se.id),Be(ve.id)},children:[ve.panes.length>1&&jsxRuntimeExports.jsx("button",{className:"cli-panel-pane-close-btn",onClick:$e=>{$e.stopPropagation(),Cs(Se.id)},title:"Close pane",children:"×"}),jsxRuntimeExports.jsx(CliContext.Provider,{value:{engine:null},children:jsxRuntimeExports.jsx(Cli,{options:h,modules:j,processors:U,services:W,snapshot:Se.snapshot,onReady:$e=>ut.current.set(Se.id,$e)})})]})]},Se.id))})},ve.id))})]})]}),vt.visible&&jsxRuntimeExports.jsxs("div",{className:"cli-panel-context-menu",style:{left:vt.x,top:vt.y},onClick:ve=>ve.stopPropagation(),children:[jsxRuntimeExports.jsx("button",{className:"cli-panel-context-menu-item",onClick:()=>{rt(),ms(vt.tabId)},children:"Rename"}),jsxRuntimeExports.jsx("button",{className:"cli-panel-context-menu-item",onClick:()=>{var ft,St;rt();const ve=nt.find(Ye=>Ye.id===vt.tabId);if(!ve)return;const Se=ut.current.get((ft=ve.panes[0])==null?void 0:ft.id),je=Se==null?void 0:Se.snapshot(),$e=wt.current.pane++,qe=wt.current.tab++,Ze={id:$e,widthPercent:100,snapshot:je},Qe={id:qe,title:`${ve.title} (copy)`,isEditing:!1,panes:[Ze]},st=nt.indexOf(ve);dt(Ye=>{const rr=[...Ye];return rr.splice(st+1,0,Qe),rr}),Be(qe),Ot($e),(St=t.onTabAdded)==null||St.call(t,{tabId:qe})},children:"Duplicate"}),jsxRuntimeExports.jsx("button",{className:"cli-panel-context-menu-item",onClick:()=>{rt(),vs(vt.tabId)},children:"Split Right"}),jsxRuntimeExports.jsx("div",{className:"cli-panel-context-menu-separator"}),jsxRuntimeExports.jsx("button",{className:"cli-panel-context-menu-item",onClick:()=>{rt(),Wr(vt.tabId)},children:"Close"}),jsxRuntimeExports.jsx("button",{className:"cli-panel-context-menu-item",disabled:nt.length<=1,onClick:()=>{rt(),dt(ve=>ve.filter(Se=>Se.id===vt.tabId)),Be(vt.tabId)},children:"Close Others"}),jsxRuntimeExports.jsx("button",{className:"cli-panel-context-menu-item",onClick:()=>{const ve=vt.tabId;rt(),dt(Se=>{const je=Se.findIndex($e=>$e.id===ve);return je===-1?Se:Se.slice(0,je+1)})},children:"Close to the Right"}),jsxRuntimeExports.jsx("div",{className:"cli-panel-context-menu-separator"}),jsxRuntimeExports.jsx("button",{className:"cli-panel-context-menu-item destructive",onClick:()=>{rt(),dt([]),Xe(!1),re(!0)},children:"Close All"})]}),Hr&&xr.total>0&&jsxRuntimeExports.jsxs("div",{className:"cli-panel-services-dropdown",style:(()=>{const ve=hs.current;if(!ve)return{};const Se=ve.getBoundingClientRect(),je={position:"fixed",zIndex:1100};switch(ne){case"top":return{...je,top:Se.bottom+4,left:Se.left};case"left":return{...je,top:Se.top,left:Se.right+4};case"right":return{...je,top:Se.top,right:window.innerWidth-Se.left+4};default:return{...je,bottom:window.innerHeight-Se.top+4,left:Se.left}}})(),onClick:ve=>ve.stopPropagation(),children:[jsxRuntimeExports.jsx("div",{className:"cli-panel-services-dropdown-header",children:"Background Services"}),jsxRuntimeExports.jsx("div",{className:"cli-panel-services-dropdown-list",children:ds.map((ve,Se)=>jsxRuntimeExports.jsxs("div",{className:"cli-panel-services-dropdown-item",children:[jsxRuntimeExports.jsx("span",{className:`cli-panel-svc-dot ${ve.status==="running"?"svc-running":"svc-stopped"}`}),jsxRuntimeExports.jsxs("div",{className:"cli-panel-svc-info",children:[jsxRuntimeExports.jsx("span",{className:"cli-panel-svc-name",children:ve.name}),ve.description&&jsxRuntimeExports.jsx("span",{className:"cli-panel-svc-desc",children:ve.description})]}),jsxRuntimeExports.jsx("span",{className:"cli-panel-svc-status",children:ve.status})]},Se))}),ds.length===0&&jsxRuntimeExports.jsx("div",{className:"cli-panel-services-dropdown-empty",children:"No services registered"})]}),_i&&Ur!=="none"&&jsxRuntimeExports.jsxs("div",{className:"cli-panel-services-dropdown",style:(()=>{const ve=ps.current;if(!ve)return{};const Se=ve.getBoundingClientRect(),je={position:"fixed",zIndex:1100};switch(ne){case"top":return{...je,top:Se.bottom+4,left:Se.left};case"left":return{...je,top:Se.top,left:Se.right+4};case"right":return{...je,top:Se.top,right:window.innerWidth-Se.left+4};default:return{...je,bottom:window.innerHeight-Se.top+4,left:Se.left}}})(),onClick:ve=>ve.stopPropagation(),children:[jsxRuntimeExports.jsx("div",{className:"cli-panel-services-dropdown-header",children:"Server Connections"}),jsxRuntimeExports.jsx("div",{className:"cli-panel-services-dropdown-list",children:kr.map((ve,Se)=>jsxRuntimeExports.jsxs("div",{className:"cli-panel-services-dropdown-item",children:[jsxRuntimeExports.jsx("span",{className:`cli-panel-svc-dot ${ve.connected?"svc-running":"svc-stopped"}`}),jsxRuntimeExports.jsxs("div",{className:"cli-panel-svc-info",children:[jsxRuntimeExports.jsx("span",{className:"cli-panel-svc-name",children:ve.name}),ve.url&&jsxRuntimeExports.jsx("span",{className:"cli-panel-svc-desc",children:ve.url})]}),jsxRuntimeExports.jsxs("div",{className:"cli-panel-srv-meta",children:[jsxRuntimeExports.jsx("span",{className:"cli-panel-svc-status",children:ve.connected?"connected":"disconnected"}),ve.apiVersion&&jsxRuntimeExports.jsxs("span",{className:"cli-panel-svc-desc",children:["v",ve.apiVersion]}),ve.commandCount&&jsxRuntimeExports.jsxs("span",{className:"cli-panel-svc-desc",children:[ve.commandCount," cmds"]})]})]},Se))}),kr.length===0&&jsxRuntimeExports.jsx("div",{className:"cli-panel-services-dropdown-empty",children:"No servers configured"})]})]})});var deTranslations={"cli.common.usage":"Verwendung:","cli.common.examples":"Beispiele:","cli.help.description":"Zeigt Hilfe für einen Befehl an","cli.help.long_description":"Zeigt Hilfeinformationen für Befehle an","cli.help.shortcuts":"Tastenkürzel","cli.help.type":"Geben Sie","cli.help.help_command":"help <Befehl>","cli.help.for_details":"für detaillierte Informationen ein","cli.help.unknown_command":"Unbekannter Befehl: {command}","cli.help.see_all":"um alle verfügbaren Befehle anzuzeigen","cli.help.extension_chain":"Erweiterungskette","cli.help.subcommands":"Unterbefehle","cli.help.options":"Optionen","cli.help.global_options":"Globale Optionen","cli.help.requires_server":"Erfordert einen verbundenen Server","cli.help.aliases":"Aliase:","cli.help.required":"(erforderlich)","cli.help.show_all":"Alle verfügbaren Befehle anzeigen","cli.help.show_details":"Details zu einem Befehl anzeigen","cli.help.show_sub_details":"Details zu einem Unterbefehl anzeigen","cli.help.example_pkg":"Hilfe zum Paketmanager","cli.help.example_theme":"Hilfe zum Unterbefehl theme apply","cli.configure.description":"System- und Plugin-Konfiguration verwalten","cli.configure.long_description":"System- und Plugin-Konfiguration interaktiv oder über Unterbefehle verwalten","cli.configure.open_menu":"Interaktives Konfigurationsmenü öffnen","cli.configure.list_opts":"Alle Konfigurationsoptionen auflisten","cli.configure.get_value":"Einen Konfigurationswert abrufen","cli.configure.set_value":"Einen Konfigurationswert festlegen","cli.configure.reset_defaults":"Konfiguration auf Standardwerte zurücksetzen","cli.configure.system":"System","cli.configure.exit":"Beenden","cli.configure.back":"Zurück","cli.configure.current_value":"Aktueller Wert:","cli.configure.invalid_value":"Ungültiger Wert","cli.configure.set_to":"{label} auf {value} gesetzt","cli.configure.invalid_format_get":"Ungültiges Format. Verwenden Sie: configure get <Kategorie.Schlüssel>","cli.configure.unknown_key":"Unbekannter Konfigurationsschlüssel: {path}","cli.configure.invalid_format_set":"Ungültiges Format. Verwenden Sie: configure set <Kategorie.Schlüssel> <Wert>","cli.configure.set_success":"{path} auf {value} gesetzt","cli.configure.system_reset":"Systemkonfiguration auf Standardwerte zurückgesetzt","cli.configure.unknown_category":"Unbekannte Kategorie: {category}","cli.configure.category_reset":'Konfiguration für "{category}" auf Standardwerte zurückgesetzt',"cli.configure.reset_confirm":"Gesamte Konfiguration auf Standardwerte zurücksetzen?","cli.configure.reset_cancelled":"Zurücksetzen abgebrochen","cli.configure.all_reset":"Gesamte Konfiguration auf Standardwerte zurückgesetzt","cli.configure.invalid_number":"Ungültige Zahl: {value}","cli.configure.invalid_options":"Ungültiger Wert. Gültige Optionen: {options}","cli.echo.description":"Gibt den angegebenen Text aus","cli.echo.long_description":"Gibt den angegebenen Text im Terminal aus","cli.echo.piping_note":"Unterstützt Text- und JSON-Ausgabe über Pipes","cli.clear.description":"Terminal leeren","cli.clear.long_description":"Löscht den gesamten Inhalt des Terminal-Bildschirms","cli.clear.shortcut":"Tastenkürzel:","cli.version.description":"Versionsinformationen anzeigen","cli.version.long_description":"Zeigt die aktuelle CLI-Version und den Link zur Dokumentation an","cli.uname.long_description":"Zeigt detaillierte System- und Browserinformationen an, darunter:","cli.uname.cli_versions":"Kern- und Bibliotheksversionen des CLI","cli.uname.browser_info":"Browsername, Version, User-Agent, Sprache und Plattform","cli.uname.os":"Betriebssystem","cli.hash.description":"Hash-Prüfsummen von Text erzeugen","cli.hash.long_description":"Kryptografische Hash-Prüfsummen mit der Web Crypto API erzeugen","cli.cal.description":"Kalender anzeigen","cli.cal.long_description":"Monatskalender anzeigen","cli.cal.highlight_note":"Der aktuelle Tag ist hervorgehoben","cli.cal.current_month":"Aktueller Monat","cli.cal.specific_month":"Bestimmter Monat","cli.time.description":"Aktuelle Ortszeit und UTC anzeigen","cli.time.long_description":"Aktuelle Ortszeit und UTC anzeigen","cli.time.show_current":"Aktuelle Ortszeit und UTC anzeigen","cli.uptime.description":"Sitzungslaufzeit anzeigen","cli.uptime.long_description":"Zeigt an, wie lange die aktuelle Terminalsitzung aktiv ist","cli.convert.description":"Zwischen Einheiten umrechnen (Länge, Gewicht, Temperatur, Daten)","cli.convert.long_description":"Zwischen verschiedenen Maßeinheiten umrechnen","cli.convert.supported":"Unterstützt:","cli.eval.description":"JavaScript-Ausdruck auswerten","cli.eval.long_description":"JavaScript-Ausdruck auswerten","cli.eval.supports":"Unterstützt Arithmetik, Zeichenketten, Arrays, Objekte und beliebiges gültiges JS","cli.seq.description":"Zahlenfolge ausgeben","cli.seq.long_description":"Zahlenfolge ausgeben","cli.seq.numbers_to_end":"Zahlen von 1 bis Ende","cli.seq.numbers_range":"Zahlen von Anfang bis Ende","cli.seq.with_step":"Mit benutzerdefinierter Schrittweite","cli.lorem.description":"Lorem-Ipsum-Platzhaltertext erzeugen","cli.lorem.long_description":"Lorem-Ipsum-Platzhaltertext erzeugen","cli.lorem.gen_words":"Wörter erzeugen","cli.lorem.gen_sentences":"Sätze erzeugen","cli.lorem.gen_paragraphs":"Absätze erzeugen","cli.alias.description":"Befehlsaliase verwalten","cli.alias.long_description":"Alias-Kurzformen für häufig verwendete Befehle erstellen","cli.alias.create_new":"Neuen Alias erstellen","cli.alias.list_all":"Alle Aliase auflisten","cli.alias.remove_hint":"Verwenden Sie {command} um einen Alias zu entfernen","cli.unalias.description":"Befehlsaliase entfernen","cli.unalias.long_description":"Einen zuvor definierten Befehlsalias entfernen","cli.open.description":"URL in neuem Browser-Tab öffnen","cli.open.long_description":"URL in neuem Browser-Tab öffnen","cli.open.auto_https":"Fügt automatisch https:// hinzu, wenn kein Protokoll angegeben ist","cli.color.description":"Farben konvertieren und anzeigen (hex, rgb, hsl)","cli.color.long_description":"Zwischen Farbformaten konvertieren und Farben anzeigen","cli.color.supported_formats":"Unterstützte Formate:","cli.history.long_description":"Zeigt den Befehlsverlauf der aktuellen Sitzung an","cli.history.show":"Befehlsverlauf anzeigen","cli.history.search":"Verlauf nach Muster durchsuchen","cli.history.clear":"Gesamten Verlauf löschen","cli.history.arrow_hint":"Verwenden Sie die Pfeiltasten {keys} um den Verlauf zu durchsuchen","cli.history.prefix_hint":"Geben Sie ein Präfix ein und drücken Sie {key} um den Verlauf nach Präfix zu durchsuchen","cli.theme.description":"Mit dem Thema interagieren","cli.theme.long_description":"Das Erscheinungsbild des Terminals mit Themen und Farben anpassen","cli.hex.description":"Hex kodieren/dekodieren und Zahlenbasen konvertieren","cli.hex.long_description":"Text hexadezimal kodieren/dekodieren und Zahlen zwischen Basen konvertieren","cli.hex.text_to_hex":"Text zu Hexadezimal","cli.hex.hex_to_text":"Hexadezimal zu Text","cli.hex.base_conversion":"Basiskonvertierung","cli.feedback.long_description":"Fehler melden, Funktionen anfragen oder neue Befehle vorschlagen — interaktiv oder inline.","cli.jwt.description":"JWT-Token dekodieren und untersuchen","cli.jwt.long_description":"JSON Web Tokens (JWT) dekodieren und untersuchen","cli.jwt.decode_display":"JWT-Inhalt dekodieren und anzeigen","cli.jwt.shows":"Zeigt: Header, Payload, Ablaufstatus, Ausstellungsdatum","cli.sleep.description":"Ausführung für eine bestimmte Zeit pausieren","cli.sleep.long_description":"Pausiert die Ausführung für die angegebene Dauer (in Millisekunden)","cli.services.description":"Hintergrunddienste und Aufgaben verwalten","cli.services.long_description":"Hintergrunddienste und Aufgaben verwalten","cli.services.list_desc":"Alle Dienste auflisten","cli.services.start_desc":"Dienst starten","cli.services.stop_desc":"Dienst stoppen","cli.services.restart_desc":"Dienst neu starten","cli.services.logs_desc":"Dienstprotokolle anzeigen","cli.services.info_desc":"Dienstdetails","cli.yes.description":"Eine Zeichenkette kontinuierlich wiederholen","cli.yes.long_description":"Eine Zeichenkette kontinuierlich wiederholen","cli.clipboard.description":"In die Zwischenablage kopieren oder daraus einfügen","cli.clipboard.long_description":"Text in die Systemzwischenablage kopieren oder daraus einfügen","cli.clipboard.copy_desc":"Text in die Zwischenablage kopieren","cli.clipboard.paste_desc":"Aus der Zwischenablage einfügen","cli.hotkeys.description":"Tastenkürzel-Informationen anzeigen","cli.hotkeys.long_description":"Zeigt alle verfügbaren Tastenkombinationen und Tastenkürzel an","cli.export.description":"Umgebungsvariablen setzen","cli.export.long_description":"Umgebungsvariablen setzen oder anzeigen","cli.export.show_all":"Alle Variablen anzeigen","cli.export.set_var":"Variable setzen","cli.export.set_spaces":"Mit Leerzeichen setzen","cli.unset.description":"Umgebungsvariablen entfernen","cli.unset.long_description":"Eine Umgebungsvariable entfernen","cli.env.description":"Umgebungsvariablen anzeigen","cli.env.long_description":"Umgebungsvariablen anzeigen","cli.env.show_all":"Alle Variablen anzeigen","cli.env.show_single":"Eine Variable anzeigen","cli.url.description":"URLs kodieren oder dekodieren","cli.url.long_description":"URLs kodieren, dekodieren und analysieren","cli.url.encode_desc":"Zeichenkette als URL kodieren","cli.url.decode_desc":"URL-Zeichenkette dekodieren","cli.url.parse_desc":"URL-Bestandteile analysieren","cli.json.description":"JSON formatieren, minimieren oder validieren","cli.json.long_description":"JSON-Zeichenketten formatieren, minimieren oder validieren","cli.json.format_desc":"JSON mit Einrückung formatieren","cli.json.minify_desc":"Leerzeichen entfernen","cli.json.validate_desc":"Auf gültiges JSON prüfen","cli.base64.description":"Base64-Zeichenketten kodieren oder dekodieren","cli.base64.long_description":"Base64-Zeichenketten kodieren und dekodieren","cli.base64.utf8_note":"Unterstützt UTF-8-Textkodierung","cli.base64.encode_desc":"Text zu Base64 kodieren","cli.base64.decode_desc":"Base64 zu Text dekodieren","cli.timestamp.description":"Zwischen Unix-Zeitstempeln und Daten konvertieren","cli.timestamp.long_description":"Zwischen Unix-Zeitstempeln und lesbaren Daten konvertieren","cli.timestamp.current":"Aktueller Unix-Zeitstempel","cli.timestamp.to_date":"Zeitstempel zu Datum","cli.timestamp.from_date":"Datum zu Zeitstempel","cli.screen.description":"Bildschirm- und Terminalinformationen anzeigen","cli.screen.long_description":"Bildschirm-, Viewport- und Terminalabmessungen anzeigen","cli.screen.shows":"Zeigt: Auflösung, Farbtiefe, Pixelverhältnis, Fenstergröße, Terminalgröße","cli.random.description":"Zufällige Werte erzeugen","cli.random.long_description":"Zufällige Zahlen, Zeichenketten, UUIDs und mehr erzeugen","cli.random.number_desc":"Zufallszahl (0-100)","cli.random.string_desc":"Zufällige Zeichenkette (16 Zeichen)","cli.random.uuid_desc":"Zufällige UUID v4","cli.random.coin_desc":"Münze werfen","cli.random.dice_desc":"Würfel werfen","cli.ping.description":"ICMP-ähnliche Pings an einen Host senden","cli.ping.long_description":"HTTP-basierte ICMP-ähnliche Pings an einen Host senden und Umlaufstatistiken anzeigen","cli.ping.ctrl_c":"Drücken Sie Strg+C um zu stoppen und Statistiken anzuzeigen.","cli.nano.description":"Integrierten Texteditor öffnen","cli.nano.long_description":"Integrierten Nano-ähnlichen Texteditor öffnen","cli.nano.open_empty":"Leeren Puffer öffnen","cli.nano.open_file":"Datei öffnen oder erstellen","cli.nano.keyboard_shortcuts":"Tastenkürzel:","cli.debug.description":"Detaillierte System- und CLI-Diagnosen anzeigen","cli.debug.long_description":"Zeigt detaillierte System- und CLI-interne Diagnosen an.","cli.debug.hidden_note":"Dieser Befehl ist in der Hilfeliste versteckt, aber direkt zugänglich.","cli.debug.summary":"Systemzusammenfassung","cli.debug.processors":"Alle registrierten Prozessoren","cli.debug.modules":"Alle geladenen Module","cli.debug.state":"Zustandsspeicher untersuchen","cli.packages.description":"Pakete im CLI verwalten"},langDeModule={apiVersion:API_VERSION$1,name:"@qodalis/cli-lang-de",version:"1.0.0",description:"German language pack for Qodalis CLI",async onInit(e){e.services.getRequired(ICliTranslationService_TOKEN).addTranslations("de",deTranslations)}},esTranslations={"cli.common.usage":"Uso:","cli.common.examples":"Ejemplos:","cli.help.description":"Muestra la ayuda de un comando","cli.help.long_description":"Muestra información de ayuda para los comandos","cli.help.shortcuts":"Atajos","cli.help.type":"Escriba","cli.help.help_command":"help <comando>","cli.help.for_details":"para información detallada","cli.help.unknown_command":"Comando desconocido: {command}","cli.help.see_all":"para ver todos los comandos disponibles","cli.help.extension_chain":"Cadena de extensiones","cli.help.subcommands":"Subcomandos","cli.help.options":"Opciones","cli.help.global_options":"Opciones globales","cli.help.requires_server":"Requiere un servidor conectado","cli.help.aliases":"Alias:","cli.help.required":"(obligatorio)","cli.help.show_all":"Mostrar todos los comandos disponibles","cli.help.show_details":"Mostrar detalles de un comando","cli.help.show_sub_details":"Mostrar detalles de un subcomando","cli.help.example_pkg":"Ayuda del gestor de paquetes","cli.help.example_theme":"Ayuda del subcomando theme apply","cli.configure.description":"Gestionar la configuración del sistema y los plugins","cli.configure.long_description":"Gestionar la configuración del sistema y de plugins de forma interactiva o mediante subcomandos","cli.configure.open_menu":"Abrir el menú de configuración interactivo","cli.configure.list_opts":"Listar todas las opciones de configuración","cli.configure.get_value":"Obtener un valor de configuración","cli.configure.set_value":"Establecer un valor de configuración","cli.configure.reset_defaults":"Restablecer la configuración a los valores predeterminados","cli.configure.system":"Sistema","cli.configure.exit":"Salir","cli.configure.back":"Volver","cli.configure.current_value":"Valor actual:","cli.configure.invalid_value":"Valor no válido","cli.configure.set_to":"{label} establecido a {value}","cli.configure.invalid_format_get":"Formato no válido. Use: configure get <categoría.clave>","cli.configure.unknown_key":"Clave de configuración desconocida: {path}","cli.configure.invalid_format_set":"Formato no válido. Use: configure set <categoría.clave> <valor>","cli.configure.set_success":"{path} establecido a {value}","cli.configure.system_reset":"Configuración del sistema restablecida a los valores predeterminados","cli.configure.unknown_category":"Categoría desconocida: {category}","cli.configure.category_reset":'Configuración de "{category}" restablecida a los valores predeterminados',"cli.configure.reset_confirm":"¿Restablecer toda la configuración a los valores predeterminados?","cli.configure.reset_cancelled":"Restablecimiento cancelado","cli.configure.all_reset":"Toda la configuración restablecida a los valores predeterminados","cli.configure.invalid_number":"Número no válido: {value}","cli.configure.invalid_options":"Valor no válido. Opciones válidas: {options}","cli.echo.description":"Imprime el texto especificado","cli.echo.long_description":"Imprime el texto especificado en la terminal","cli.echo.piping_note":"Soporta salida de texto y objetos JSON mediante tuberías","cli.clear.description":"Limpia la terminal","cli.clear.long_description":"Limpia todo el contenido de la pantalla de la terminal","cli.clear.shortcut":"Atajo:","cli.version.description":"Muestra información de la versión","cli.version.long_description":"Muestra la versión actual del CLI y el enlace a la documentación","cli.uname.long_description":"Muestra información detallada del sistema y del navegador, incluyendo:","cli.uname.cli_versions":"Versiones del núcleo y las librerías del CLI","cli.uname.browser_info":"Nombre del navegador, versión, agente de usuario, idioma y plataforma","cli.uname.os":"Sistema operativo","cli.hash.description":"Generar resúmenes hash de texto","cli.hash.long_description":"Generar resúmenes hash criptográficos usando la API Web Crypto","cli.cal.description":"Mostrar un calendario","cli.cal.long_description":"Mostrar un calendario mensual","cli.cal.highlight_note":"El día actual está resaltado","cli.cal.current_month":"Mes actual","cli.cal.specific_month":"Mes específico","cli.time.description":"Mostrar la hora local y UTC actual","cli.time.long_description":"Mostrar la hora local y UTC actual","cli.time.show_current":"Mostrar la hora local y UTC actual","cli.uptime.description":"Mostrar el tiempo de actividad de la sesión","cli.uptime.long_description":"Mostrar cuánto tiempo lleva activa la sesión actual de la terminal","cli.convert.description":"Convertir entre unidades (longitud, peso, temperatura, datos)","cli.convert.long_description":"Convertir entre varias unidades de medida","cli.convert.supported":"Soportados:","cli.eval.description":"Evaluar una expresión JavaScript","cli.eval.long_description":"Evaluar una expresión JavaScript","cli.eval.supports":"Soporta aritmética, cadenas, arreglos, objetos y cualquier JS válido","cli.seq.description":"Imprimir una secuencia de números","cli.seq.long_description":"Imprimir una secuencia de números","cli.seq.numbers_to_end":"Números del 1 al final","cli.seq.numbers_range":"Números desde inicio hasta final","cli.seq.with_step":"Con paso personalizado","cli.lorem.description":"Generar texto de relleno lorem ipsum","cli.lorem.long_description":"Generar texto de relleno lorem ipsum","cli.lorem.gen_words":"Generar palabras","cli.lorem.gen_sentences":"Generar oraciones","cli.lorem.gen_paragraphs":"Generar párrafos","cli.alias.description":"Gestionar alias de comandos","cli.alias.long_description":"Crear atajos de alias para comandos usados frecuentemente","cli.alias.create_new":"Crear un nuevo alias","cli.alias.list_all":"Listar todos los alias","cli.alias.remove_hint":"Use {command} para eliminar un alias","cli.unalias.description":"Eliminar alias de comandos","cli.unalias.long_description":"Eliminar un alias de comando previamente definido","cli.open.description":"Abrir una URL en una nueva pestaña del navegador","cli.open.long_description":"Abrir una URL en una nueva pestaña del navegador","cli.open.auto_https":"Agrega automáticamente https:// si no se especifica un protocolo","cli.color.description":"Convertir y previsualizar colores (hex, rgb, hsl)","cli.color.long_description":"Convertir entre formatos de color y previsualizar colores","cli.color.supported_formats":"Formatos soportados:","cli.history.long_description":"Muestra el historial de comandos de la sesión actual","cli.history.show":"Mostrar el historial de comandos","cli.history.search":"Buscar en el historial por patrón","cli.history.clear":"Borrar todo el historial","cli.history.arrow_hint":"Use las teclas de flecha {keys} para navegar por el historial","cli.history.prefix_hint":"Escriba un prefijo y luego {key} para buscar en el historial por prefijo","cli.theme.description":"Interactuar con el tema","cli.theme.long_description":"Personalizar la apariencia de la terminal con temas y colores","cli.hex.description":"Codificar/decodificar hex y conversiones de base numérica","cli.hex.long_description":"Codificar/decodificar texto en hexadecimal y convertir números entre bases","cli.hex.text_to_hex":"Texto a hexadecimal","cli.hex.hex_to_text":"Hexadecimal a texto","cli.hex.base_conversion":"Conversión de base","cli.feedback.long_description":"Reportar errores, solicitar funcionalidades o sugerir nuevos comandos — de forma interactiva o en línea.","cli.jwt.description":"Decodificar e inspeccionar tokens JWT","cli.jwt.long_description":"Decodificar e inspeccionar JSON Web Tokens (JWT)","cli.jwt.decode_display":"Decodificar y mostrar el contenido del JWT","cli.jwt.shows":"Muestra: encabezado, carga útil, estado de expiración, fecha de emisión","cli.sleep.description":"Pausar la ejecución durante un tiempo especificado","cli.sleep.long_description":"Pausa la ejecución durante la duración especificada (en milisegundos)","cli.services.description":"Gestionar servicios en segundo plano y tareas","cli.services.long_description":"Gestionar servicios en segundo plano y tareas","cli.services.list_desc":"Listar todos los servicios","cli.services.start_desc":"Iniciar un servicio","cli.services.stop_desc":"Detener un servicio","cli.services.restart_desc":"Reiniciar un servicio","cli.services.logs_desc":"Ver registros del servicio","cli.services.info_desc":"Detalles del servicio","cli.yes.description":"Repetir una cadena continuamente","cli.yes.long_description":"Repetir una cadena continuamente","cli.clipboard.description":"Copiar o pegar del portapapeles","cli.clipboard.long_description":"Copiar texto al portapapeles del sistema o pegar texto desde él","cli.clipboard.copy_desc":"Copiar texto al portapapeles","cli.clipboard.paste_desc":"Pegar del portapapeles","cli.hotkeys.description":"Mostrar información de las teclas rápidas","cli.hotkeys.long_description":"Muestra todos los atajos de teclado y teclas rápidas disponibles","cli.export.description":"Establecer variables de entorno","cli.export.long_description":"Establecer o mostrar variables de entorno","cli.export.show_all":"Mostrar todas las variables","cli.export.set_var":"Establecer una variable","cli.export.set_spaces":"Establecer con espacios","cli.unset.description":"Eliminar variables de entorno","cli.unset.long_description":"Eliminar una variable de entorno","cli.env.description":"Mostrar variables de entorno","cli.env.long_description":"Mostrar variables de entorno","cli.env.show_all":"Mostrar todas las variables","cli.env.show_single":"Mostrar una variable","cli.url.description":"Codificar o decodificar URLs","cli.url.long_description":"Codificar, decodificar y analizar URLs","cli.url.encode_desc":"Codificar una cadena como URL","cli.url.decode_desc":"Decodificar una cadena URL","cli.url.parse_desc":"Analizar los componentes de una URL","cli.json.description":"Formatear, minificar o validar JSON","cli.json.long_description":"Formatear, minificar o validar cadenas JSON","cli.json.format_desc":"Formatear JSON con sangría","cli.json.minify_desc":"Eliminar espacios en blanco","cli.json.validate_desc":"Verificar si es JSON válido","cli.base64.description":"Codificar o decodificar cadenas Base64","cli.base64.long_description":"Codificar y decodificar cadenas Base64","cli.base64.utf8_note":"Soporta codificación de texto UTF-8","cli.base64.encode_desc":"Codificar texto a Base64","cli.base64.decode_desc":"Decodificar Base64 a texto","cli.timestamp.description":"Convertir entre marcas de tiempo Unix y fechas","cli.timestamp.long_description":"Convertir entre marcas de tiempo Unix y fechas legibles","cli.timestamp.current":"Marca de tiempo Unix actual","cli.timestamp.to_date":"Marca de tiempo a fecha","cli.timestamp.from_date":"Fecha a marca de tiempo","cli.screen.description":"Mostrar información de pantalla y terminal","cli.screen.long_description":"Mostrar dimensiones de la pantalla, ventana gráfica y terminal","cli.screen.shows":"Muestra: resolución, profundidad de color, proporción de píxeles, tamaño de ventana, tamaño de terminal","cli.random.description":"Generar valores aleatorios","cli.random.long_description":"Generar números, cadenas, UUIDs aleatorios y más","cli.random.number_desc":"Número aleatorio (0-100)","cli.random.string_desc":"Cadena aleatoria (16 caracteres)","cli.random.uuid_desc":"UUID v4 aleatorio","cli.random.coin_desc":"Lanzar una moneda","cli.random.dice_desc":"Lanzar un dado","cli.ping.description":"Enviar pings tipo ICMP a un host","cli.ping.long_description":"Enviar pings HTTP tipo ICMP a un host y mostrar estadísticas de ida y vuelta","cli.ping.ctrl_c":"Presione Ctrl+C para detener y mostrar estadísticas.","cli.nano.description":"Abrir el editor de texto integrado","cli.nano.long_description":"Abrir el editor de texto estilo nano integrado","cli.nano.open_empty":"Abrir un búfer vacío","cli.nano.open_file":"Abrir o crear un archivo","cli.nano.keyboard_shortcuts":"Atajos de teclado:","cli.debug.description":"Mostrar diagnósticos detallados del sistema e internos del CLI","cli.debug.long_description":"Muestra diagnósticos detallados del sistema e internos del CLI.","cli.debug.hidden_note":"Este comando está oculto en la lista de ayuda pero es accesible directamente.","cli.debug.summary":"Resumen del sistema","cli.debug.processors":"Todos los procesadores registrados","cli.debug.modules":"Todos los módulos cargados","cli.debug.state":"Inspeccionar almacenes de estado","cli.packages.description":"Gestionar paquetes en el CLI"},langEsModule={apiVersion:API_VERSION$1,name:"@qodalis/cli-lang-es",version:"1.0.0",description:"Spanish language pack for Qodalis CLI",async onInit(e){e.services.getRequired(ICliTranslationService_TOKEN).addTranslations("es",esTranslations)}},frTranslations={"cli.common.usage":"Utilisation :","cli.common.examples":"Exemples :","cli.help.description":"Affiche l'aide d'une commande","cli.help.long_description":"Affiche les informations d'aide pour les commandes","cli.help.shortcuts":"Raccourcis","cli.help.type":"Tapez","cli.help.help_command":"help <commande>","cli.help.for_details":"pour des informations détaillées","cli.help.unknown_command":"Commande inconnue : {command}","cli.help.see_all":"pour voir toutes les commandes disponibles","cli.help.extension_chain":"Chaîne d'extensions","cli.help.subcommands":"Sous-commandes","cli.help.options":"Options","cli.help.global_options":"Options globales","cli.help.requires_server":"Nécessite un serveur connecté","cli.help.aliases":"Alias :","cli.help.required":"(obligatoire)","cli.help.show_all":"Afficher toutes les commandes disponibles","cli.help.show_details":"Afficher les détails d'une commande","cli.help.show_sub_details":"Afficher les détails d'une sous-commande","cli.help.example_pkg":"Aide du gestionnaire de paquets","cli.help.example_theme":"Aide de la sous-commande theme apply","cli.configure.description":"Gérer la configuration du système et des plugins","cli.configure.long_description":"Gérer la configuration du système et des plugins de manière interactive ou par sous-commandes","cli.configure.open_menu":"Ouvrir le menu de configuration interactif","cli.configure.list_opts":"Lister toutes les options de configuration","cli.configure.get_value":"Obtenir une valeur de configuration","cli.configure.set_value":"Définir une valeur de configuration","cli.configure.reset_defaults":"Réinitialiser la configuration aux valeurs par défaut","cli.configure.system":"Système","cli.configure.exit":"Quitter","cli.configure.back":"Retour","cli.configure.current_value":"Valeur actuelle :","cli.configure.invalid_value":"Valeur non valide","cli.configure.set_to":"{label} défini à {value}","cli.configure.invalid_format_get":"Format non valide. Utilisez : configure get <catégorie.clé>","cli.configure.unknown_key":"Clé de configuration inconnue : {path}","cli.configure.invalid_format_set":"Format non valide. Utilisez : configure set <catégorie.clé> <valeur>","cli.configure.set_success":"{path} défini à {value}","cli.configure.system_reset":"Configuration du système réinitialisée aux valeurs par défaut","cli.configure.unknown_category":"Catégorie inconnue : {category}","cli.configure.category_reset":"Configuration de « {category} » réinitialisée aux valeurs par défaut","cli.configure.reset_confirm":"Réinitialiser toute la configuration aux valeurs par défaut ?","cli.configure.reset_cancelled":"Réinitialisation annulée","cli.configure.all_reset":"Toute la configuration réinitialisée aux valeurs par défaut","cli.configure.invalid_number":"Nombre non valide : {value}","cli.configure.invalid_options":"Valeur non valide. Options valides : {options}","cli.echo.description":"Affiche le texte spécifié","cli.echo.long_description":"Affiche le texte spécifié dans le terminal","cli.echo.piping_note":"Prend en charge la sortie de texte et d'objets JSON via les tubes","cli.clear.description":"Efface le terminal","cli.clear.long_description":"Efface tout le contenu de l'écran du terminal","cli.clear.shortcut":"Raccourci :","cli.version.description":"Affiche les informations de version","cli.version.long_description":"Affiche la version actuelle du CLI et le lien vers la documentation","cli.uname.long_description":"Affiche les informations détaillées du système et du navigateur, notamment :","cli.uname.cli_versions":"Versions du noyau et des bibliothèques du CLI","cli.uname.browser_info":"Nom du navigateur, version, agent utilisateur, langue et plateforme","cli.uname.os":"Système d'exploitation","cli.hash.description":"Générer des empreintes de hachage de texte","cli.hash.long_description":"Générer des empreintes de hachage cryptographiques à l'aide de l'API Web Crypto","cli.cal.description":"Afficher un calendrier","cli.cal.long_description":"Afficher un calendrier mensuel","cli.cal.highlight_note":"Le jour actuel est mis en surbrillance","cli.cal.current_month":"Mois actuel","cli.cal.specific_month":"Mois spécifique","cli.time.description":"Afficher l'heure locale et UTC actuelle","cli.time.long_description":"Afficher l'heure locale et UTC actuelle","cli.time.show_current":"Afficher l'heure locale et UTC actuelle","cli.uptime.description":"Afficher le temps d'activité de la session","cli.uptime.long_description":"Afficher depuis combien de temps la session actuelle du terminal est active","cli.convert.description":"Convertir entre unités (longueur, poids, température, données)","cli.convert.long_description":"Convertir entre différentes unités de mesure","cli.convert.supported":"Pris en charge :","cli.eval.description":"Évaluer une expression JavaScript","cli.eval.long_description":"Évaluer une expression JavaScript","cli.eval.supports":"Prend en charge l'arithmétique, les chaînes, les tableaux, les objets et tout JS valide","cli.seq.description":"Afficher une séquence de nombres","cli.seq.long_description":"Afficher une séquence de nombres","cli.seq.numbers_to_end":"Nombres de 1 à la fin","cli.seq.numbers_range":"Nombres du début à la fin","cli.seq.with_step":"Avec un pas personnalisé","cli.lorem.description":"Générer du texte de remplissage lorem ipsum","cli.lorem.long_description":"Générer du texte de remplissage lorem ipsum","cli.lorem.gen_words":"Générer des mots","cli.lorem.gen_sentences":"Générer des phrases","cli.lorem.gen_paragraphs":"Générer des paragraphes","cli.alias.description":"Gérer les alias de commandes","cli.alias.long_description":"Créer des raccourcis d'alias pour les commandes fréquemment utilisées","cli.alias.create_new":"Créer un nouvel alias","cli.alias.list_all":"Lister tous les alias","cli.alias.remove_hint":"Utilisez {command} pour supprimer un alias","cli.unalias.description":"Supprimer des alias de commandes","cli.unalias.long_description":"Supprimer un alias de commande précédemment défini","cli.open.description":"Ouvrir une URL dans un nouvel onglet du navigateur","cli.open.long_description":"Ouvrir une URL dans un nouvel onglet du navigateur","cli.open.auto_https":"Ajoute automatiquement https:// si aucun protocole n'est spécifié","cli.color.description":"Convertir et prévisualiser des couleurs (hex, rgb, hsl)","cli.color.long_description":"Convertir entre les formats de couleur et prévisualiser les couleurs","cli.color.supported_formats":"Formats pris en charge :","cli.history.long_description":"Affiche l'historique des commandes de la session actuelle","cli.history.show":"Afficher l'historique des commandes","cli.history.search":"Rechercher dans l'historique par motif","cli.history.clear":"Effacer tout l'historique","cli.history.arrow_hint":"Utilisez les touches fléchées {keys} pour naviguer dans l'historique","cli.history.prefix_hint":"Tapez un préfixe puis {key} pour rechercher dans l'historique par préfixe","cli.theme.description":"Interagir avec le thème","cli.theme.long_description":"Personnaliser l'apparence du terminal avec des thèmes et des couleurs","cli.hex.description":"Encoder/décoder en hexadécimal et conversions de base numérique","cli.hex.long_description":"Encoder/décoder du texte en hexadécimal et convertir des nombres entre bases","cli.hex.text_to_hex":"Texte vers hexadécimal","cli.hex.hex_to_text":"Hexadécimal vers texte","cli.hex.base_conversion":"Conversion de base","cli.feedback.long_description":"Signaler des bogues, demander des fonctionnalités ou suggérer de nouvelles commandes — de manière interactive ou en ligne.","cli.jwt.description":"Décoder et inspecter des jetons JWT","cli.jwt.long_description":"Décoder et inspecter des JSON Web Tokens (JWT)","cli.jwt.decode_display":"Décoder et afficher le contenu du JWT","cli.jwt.shows":"Affiche : en-tête, charge utile, état d'expiration, date d'émission","cli.sleep.description":"Suspendre l'exécution pendant une durée spécifiée","cli.sleep.long_description":"Suspend l'exécution pendant la durée spécifiée (en millisecondes)","cli.services.description":"Gérer les services en arrière-plan et les tâches","cli.services.long_description":"Gérer les services en arrière-plan et les tâches","cli.services.list_desc":"Lister tous les services","cli.services.start_desc":"Démarrer un service","cli.services.stop_desc":"Arrêter un service","cli.services.restart_desc":"Redémarrer un service","cli.services.logs_desc":"Voir les journaux du service","cli.services.info_desc":"Détails du service","cli.yes.description":"Répéter une chaîne en continu","cli.yes.long_description":"Répéter une chaîne en continu","cli.clipboard.description":"Copier ou coller depuis le presse-papiers","cli.clipboard.long_description":"Copier du texte dans le presse-papiers du système ou coller du texte depuis celui-ci","cli.clipboard.copy_desc":"Copier du texte dans le presse-papiers","cli.clipboard.paste_desc":"Coller depuis le presse-papiers","cli.hotkeys.description":"Afficher les informations sur les raccourcis clavier","cli.hotkeys.long_description":"Affiche tous les raccourcis clavier et touches rapides disponibles","cli.export.description":"Définir des variables d'environnement","cli.export.long_description":"Définir ou afficher les variables d'environnement","cli.export.show_all":"Afficher toutes les variables","cli.export.set_var":"Définir une variable","cli.export.set_spaces":"Définir avec des espaces","cli.unset.description":"Supprimer des variables d'environnement","cli.unset.long_description":"Supprimer une variable d'environnement","cli.env.description":"Afficher les variables d'environnement","cli.env.long_description":"Afficher les variables d'environnement","cli.env.show_all":"Afficher toutes les variables","cli.env.show_single":"Afficher une variable","cli.url.description":"Encoder ou décoder des URLs","cli.url.long_description":"Encoder, décoder et analyser des URLs","cli.url.encode_desc":"Encoder une chaîne en URL","cli.url.decode_desc":"Décoder une chaîne URL","cli.url.parse_desc":"Analyser les composants d'une URL","cli.json.description":"Formater, minifier ou valider du JSON","cli.json.long_description":"Formater, minifier ou valider des chaînes JSON","cli.json.format_desc":"Formater le JSON avec indentation","cli.json.minify_desc":"Supprimer les espaces","cli.json.validate_desc":"Vérifier si le JSON est valide","cli.base64.description":"Encoder ou décoder des chaînes Base64","cli.base64.long_description":"Encoder et décoder des chaînes Base64","cli.base64.utf8_note":"Prend en charge l'encodage de texte UTF-8","cli.base64.encode_desc":"Encoder du texte en Base64","cli.base64.decode_desc":"Décoder du Base64 en texte","cli.timestamp.description":"Convertir entre horodatages Unix et dates","cli.timestamp.long_description":"Convertir entre horodatages Unix et dates lisibles","cli.timestamp.current":"Horodatage Unix actuel","cli.timestamp.to_date":"Horodatage vers date","cli.timestamp.from_date":"Date vers horodatage","cli.screen.description":"Afficher les informations sur l'écran et le terminal","cli.screen.long_description":"Afficher les dimensions de l'écran, de la fenêtre d'affichage et du terminal","cli.screen.shows":"Affiche : résolution, profondeur de couleur, ratio de pixels, taille de la fenêtre, taille du terminal","cli.random.description":"Générer des valeurs aléatoires","cli.random.long_description":"Générer des nombres, chaînes, UUIDs aléatoires et plus","cli.random.number_desc":"Nombre aléatoire (0-100)","cli.random.string_desc":"Chaîne aléatoire (16 caractères)","cli.random.uuid_desc":"UUID v4 aléatoire","cli.random.coin_desc":"Tirer à pile ou face","cli.random.dice_desc":"Lancer un dé","cli.ping.description":"Envoyer des pings de type ICMP à un hôte","cli.ping.long_description":"Envoyer des pings HTTP de type ICMP à un hôte et afficher les statistiques aller-retour","cli.ping.ctrl_c":"Appuyez sur Ctrl+C pour arrêter et afficher les statistiques.","cli.nano.description":"Ouvrir l'éditeur de texte intégré","cli.nano.long_description":"Ouvrir l'éditeur de texte intégré de style nano","cli.nano.open_empty":"Ouvrir un tampon vide","cli.nano.open_file":"Ouvrir ou créer un fichier","cli.nano.keyboard_shortcuts":"Raccourcis clavier :","cli.debug.description":"Afficher les diagnostics détaillés du système et les composants internes du CLI","cli.debug.long_description":"Affiche les diagnostics détaillés du système et les composants internes du CLI.","cli.debug.hidden_note":"Cette commande est masquée dans la liste d'aide mais accessible directement.","cli.debug.summary":"Résumé du système","cli.debug.processors":"Tous les processeurs enregistrés","cli.debug.modules":"Tous les modules chargés","cli.debug.state":"Inspecter les magasins d'état","cli.packages.description":"Gérer les paquets dans le CLI"},langFrModule={apiVersion:API_VERSION$1,name:"@qodalis/cli-lang-fr",version:"1.0.0",description:"French language pack for Qodalis CLI",async onInit(e){e.services.getRequired(ICliTranslationService_TOKEN).addTranslations("fr",frTranslations)}},itTranslations={"cli.common.usage":"Utilizzo:","cli.common.examples":"Esempi:","cli.help.description":"Mostra la guida per un comando","cli.help.long_description":"Mostra le informazioni di aiuto per i comandi","cli.help.shortcuts":"Scorciatoie","cli.help.type":"Digita","cli.help.help_command":"help <comando>","cli.help.for_details":"per informazioni dettagliate","cli.help.unknown_command":"Comando sconosciuto: {command}","cli.help.see_all":"per vedere tutti i comandi disponibili","cli.help.extension_chain":"Catena di estensioni","cli.help.subcommands":"Sottocomandi","cli.help.options":"Opzioni","cli.help.global_options":"Opzioni globali","cli.help.requires_server":"Richiede un server connesso","cli.help.aliases":"Alias:","cli.help.required":"(obbligatorio)","cli.help.show_all":"Mostra tutti i comandi disponibili","cli.help.show_details":"Mostra i dettagli di un comando","cli.help.show_sub_details":"Mostra i dettagli di un sottocomando","cli.help.example_pkg":"Guida del gestore pacchetti","cli.help.example_theme":"Guida del sottocomando theme apply","cli.configure.description":"Gestire la configurazione del sistema e dei plugin","cli.configure.long_description":"Gestire la configurazione del sistema e dei plugin in modo interattivo o tramite sottocomandi","cli.configure.open_menu":"Aprire il menu di configurazione interattivo","cli.configure.list_opts":"Elencare tutte le opzioni di configurazione","cli.configure.get_value":"Ottenere un valore di configurazione","cli.configure.set_value":"Impostare un valore di configurazione","cli.configure.reset_defaults":"Ripristinare la configurazione ai valori predefiniti","cli.configure.system":"Sistema","cli.configure.exit":"Esci","cli.configure.back":"Indietro","cli.configure.current_value":"Valore attuale:","cli.configure.invalid_value":"Valore non valido","cli.configure.set_to":"{label} impostato su {value}","cli.configure.invalid_format_get":"Formato non valido. Usa: configure get <categoria.chiave>","cli.configure.unknown_key":"Chiave di configurazione sconosciuta: {path}","cli.configure.invalid_format_set":"Formato non valido. Usa: configure set <categoria.chiave> <valore>","cli.configure.set_success":"{path} impostato su {value}","cli.configure.system_reset":"Configurazione di sistema ripristinata ai valori predefiniti","cli.configure.unknown_category":"Categoria sconosciuta: {category}","cli.configure.category_reset":'Configurazione di "{category}" ripristinata ai valori predefiniti',"cli.configure.reset_confirm":"Ripristinare tutta la configurazione ai valori predefiniti?","cli.configure.reset_cancelled":"Ripristino annullato","cli.configure.all_reset":"Tutta la configurazione ripristinata ai valori predefiniti","cli.configure.invalid_number":"Numero non valido: {value}","cli.configure.invalid_options":"Valore non valido. Opzioni valide: {options}","cli.echo.description":"Stampa il testo specificato","cli.echo.long_description":"Stampa il testo specificato nel terminale","cli.echo.piping_note":"Supporta output di testo e oggetti JSON tramite pipe","cli.clear.description":"Pulisci il terminale","cli.clear.long_description":"Cancella tutto il contenuto dello schermo del terminale","cli.clear.shortcut":"Scorciatoia:","cli.version.description":"Mostra informazioni sulla versione","cli.version.long_description":"Mostra la versione attuale del CLI e il link alla documentazione","cli.uname.long_description":"Mostra informazioni dettagliate sul sistema e il browser, tra cui:","cli.uname.cli_versions":"Versioni del core e delle librerie del CLI","cli.uname.browser_info":"Nome del browser, versione, user agent, lingua e piattaforma","cli.uname.os":"Sistema operativo","cli.hash.description":"Generare hash digest da testo","cli.hash.long_description":"Generare hash digest crittografici usando la Web Crypto API","cli.cal.description":"Mostrare un calendario","cli.cal.long_description":"Mostrare un calendario mensile","cli.cal.highlight_note":"Il giorno corrente è evidenziato","cli.cal.current_month":"Mese corrente","cli.cal.specific_month":"Mese specifico","cli.time.description":"Mostrare ora locale e UTC corrente","cli.time.long_description":"Mostrare ora locale e UTC corrente","cli.time.show_current":"Mostrare ora locale e UTC corrente","cli.uptime.description":"Mostrare il tempo di attività della sessione","cli.uptime.long_description":"Mostra da quanto tempo è attiva la sessione corrente del terminale","cli.convert.description":"Convertire tra unità (lunghezza, peso, temperatura, dati)","cli.convert.long_description":"Convertire tra varie unità di misura","cli.convert.supported":"Supportati:","cli.eval.description":"Valutare un'espressione JavaScript","cli.eval.long_description":"Valutare un'espressione JavaScript","cli.eval.supports":"Supporta aritmetica, stringhe, array, oggetti e qualsiasi JS valido","cli.seq.description":"Stampare una sequenza di numeri","cli.seq.long_description":"Stampare una sequenza di numeri","cli.seq.numbers_to_end":"Numeri da 1 alla fine","cli.seq.numbers_range":"Numeri dall'inizio alla fine","cli.seq.with_step":"Con passo personalizzato","cli.lorem.description":"Generare testo segnaposto lorem ipsum","cli.lorem.long_description":"Generare testo segnaposto lorem ipsum","cli.lorem.gen_words":"Generare parole","cli.lorem.gen_sentences":"Generare frasi","cli.lorem.gen_paragraphs":"Generare paragrafi","cli.alias.description":"Gestire gli alias dei comandi","cli.alias.long_description":"Creare scorciatoie alias per comandi usati frequentemente","cli.alias.create_new":"Creare un nuovo alias","cli.alias.list_all":"Elencare tutti gli alias","cli.alias.remove_hint":"Usa {command} per rimuovere un alias","cli.unalias.description":"Rimuovere alias dei comandi","cli.unalias.long_description":"Rimuovere un alias di comando definito in precedenza","cli.open.description":"Aprire un URL in una nuova scheda del browser","cli.open.long_description":"Aprire un URL in una nuova scheda del browser","cli.open.auto_https":"Aggiunge automaticamente https:// se non viene specificato un protocollo","cli.color.description":"Convertire e visualizzare colori (hex, rgb, hsl)","cli.color.long_description":"Convertire tra formati di colore e visualizzare colori","cli.color.supported_formats":"Formati supportati:","cli.history.long_description":"Mostra la cronologia dei comandi della sessione corrente","cli.history.show":"Mostrare la cronologia dei comandi","cli.history.search":"Cercare nella cronologia per pattern","cli.history.clear":"Cancellare tutta la cronologia","cli.history.arrow_hint":"Usa i tasti freccia {keys} per navigare nella cronologia","cli.history.prefix_hint":"Digita un prefisso e premi {key} per cercare nella cronologia per prefisso","cli.theme.description":"Interagire con il tema","cli.theme.long_description":"Personalizzare l'aspetto del terminale con temi e colori","cli.hex.description":"Codificare/decodificare hex e conversioni di base numerica","cli.hex.long_description":"Codificare/decodificare testo in esadecimale e convertire numeri tra basi","cli.hex.text_to_hex":"Testo a esadecimale","cli.hex.hex_to_text":"Esadecimale a testo","cli.hex.base_conversion":"Conversione di base","cli.feedback.long_description":"Segnalare bug, richiedere funzionalità o suggerire nuovi comandi — in modo interattivo o inline.","cli.jwt.description":"Decodificare e ispezionare token JWT","cli.jwt.long_description":"Decodificare e ispezionare JSON Web Token (JWT)","cli.jwt.decode_display":"Decodificare e mostrare il contenuto del JWT","cli.jwt.shows":"Mostra: intestazione, payload, stato di scadenza, data di emissione","cli.sleep.description":"Mettere in pausa l'esecuzione per un tempo specificato","cli.sleep.long_description":"Mette in pausa l'esecuzione per la durata specificata (in millisecondi)","cli.services.description":"Gestire servizi in background e attività","cli.services.long_description":"Gestire servizi in background e attività","cli.services.list_desc":"Elencare tutti i servizi","cli.services.start_desc":"Avviare un servizio","cli.services.stop_desc":"Fermare un servizio","cli.services.restart_desc":"Riavviare un servizio","cli.services.logs_desc":"Visualizzare i log del servizio","cli.services.info_desc":"Dettagli del servizio","cli.yes.description":"Ripetere una stringa continuamente","cli.yes.long_description":"Ripetere una stringa continuamente","cli.clipboard.description":"Copiare o incollare dagli appunti","cli.clipboard.long_description":"Copiare testo negli appunti di sistema o incollare testo da essi","cli.clipboard.copy_desc":"Copiare testo negli appunti","cli.clipboard.paste_desc":"Incollare dagli appunti","cli.hotkeys.description":"Mostrare informazioni sulle scorciatoie da tastiera","cli.hotkeys.long_description":"Mostra tutte le combinazioni di tasti e scorciatoie disponibili","cli.export.description":"Impostare variabili d'ambiente","cli.export.long_description":"Impostare o mostrare variabili d'ambiente","cli.export.show_all":"Mostrare tutte le variabili","cli.export.set_var":"Impostare una variabile","cli.export.set_spaces":"Impostare con spazi","cli.unset.description":"Rimuovere variabili d'ambiente","cli.unset.long_description":"Rimuovere una variabile d'ambiente","cli.env.description":"Mostrare variabili d'ambiente","cli.env.long_description":"Mostrare variabili d'ambiente","cli.env.show_all":"Mostrare tutte le variabili","cli.env.show_single":"Mostrare una variabile","cli.url.description":"Codificare o decodificare URL","cli.url.long_description":"Codificare, decodificare e analizzare URL","cli.url.encode_desc":"Codificare una stringa come URL","cli.url.decode_desc":"Decodificare una stringa URL","cli.url.parse_desc":"Analizzare i componenti di un URL","cli.json.description":"Formattare, minimizzare o validare JSON","cli.json.long_description":"Formattare, minimizzare o validare stringhe JSON","cli.json.format_desc":"Formattare JSON con indentazione","cli.json.minify_desc":"Rimuovere spazi bianchi","cli.json.validate_desc":"Verificare se è JSON valido","cli.base64.description":"Codificare o decodificare stringhe Base64","cli.base64.long_description":"Codificare e decodificare stringhe Base64","cli.base64.utf8_note":"Supporta la codifica testo UTF-8","cli.base64.encode_desc":"Codificare testo in Base64","cli.base64.decode_desc":"Decodificare Base64 in testo","cli.timestamp.description":"Convertire tra timestamp Unix e date","cli.timestamp.long_description":"Convertire tra timestamp Unix e date leggibili","cli.timestamp.current":"Timestamp Unix corrente","cli.timestamp.to_date":"Timestamp a data","cli.timestamp.from_date":"Data a timestamp","cli.screen.description":"Mostrare informazioni su schermo e terminale","cli.screen.long_description":"Mostrare dimensioni di schermo, viewport e terminale","cli.screen.shows":"Mostra: risoluzione, profondità colore, rapporto pixel, dimensione finestra, dimensione terminale","cli.random.description":"Generare valori casuali","cli.random.long_description":"Generare numeri, stringhe, UUID casuali e altro","cli.random.number_desc":"Numero casuale (0-100)","cli.random.string_desc":"Stringa casuale (16 caratteri)","cli.random.uuid_desc":"UUID v4 casuale","cli.random.coin_desc":"Lanciare una moneta","cli.random.dice_desc":"Lanciare un dado","cli.ping.description":"Inviare ping tipo ICMP a un host","cli.ping.long_description":"Inviare ping HTTP tipo ICMP a un host e mostrare statistiche di andata e ritorno","cli.ping.ctrl_c":"Premi Ctrl+C per fermare e mostrare le statistiche.","cli.nano.description":"Aprire l'editor di testo integrato","cli.nano.long_description":"Aprire l'editor di testo stile nano integrato","cli.nano.open_empty":"Aprire un buffer vuoto","cli.nano.open_file":"Aprire o creare un file","cli.nano.keyboard_shortcuts":"Scorciatoie da tastiera:","cli.debug.description":"Mostrare diagnostica dettagliata del sistema e interni del CLI","cli.debug.long_description":"Mostra diagnostica dettagliata del sistema e interni del CLI.","cli.debug.hidden_note":"Questo comando è nascosto nella lista di aiuto ma è accessibile direttamente.","cli.debug.summary":"Riepilogo del sistema","cli.debug.processors":"Tutti i processori registrati","cli.debug.modules":"Tutti i moduli caricati","cli.debug.state":"Ispezionare gli archivi di stato","cli.packages.description":"Gestire i pacchetti nel CLI"},langItModule={apiVersion:API_VERSION$1,name:"@qodalis/cli-lang-it",version:"1.0.0",description:"Italian language pack for Qodalis CLI",async onInit(e){e.services.getRequired(ICliTranslationService_TOKEN).addTranslations("it",itTranslations)}},jaTranslations={"cli.common.usage":"使い方:","cli.common.examples":"例:","cli.help.description":"コマンドのヘルプを表示します","cli.help.long_description":"コマンドのヘルプ情報を表示します","cli.help.shortcuts":"ショートカット","cli.help.type":"入力:","cli.help.help_command":"help <コマンド>","cli.help.for_details":"で詳細情報を確認","cli.help.unknown_command":"不明なコマンド: {command}","cli.help.see_all":"で全コマンドを表示","cli.help.extension_chain":"拡張チェーン","cli.help.subcommands":"サブコマンド","cli.help.options":"オプション","cli.help.global_options":"グローバルオプション","cli.help.requires_server":"接続されたサーバーが必要です","cli.help.aliases":"エイリアス:","cli.help.required":"(必須)","cli.help.show_all":"全コマンドを表示","cli.help.show_details":"コマンドの詳細を表示","cli.help.show_sub_details":"サブコマンドの詳細を表示","cli.help.example_pkg":"パッケージマネージャーのヘルプ","cli.help.example_theme":"theme applyサブコマンドのヘルプ","cli.configure.description":"システムとプラグインの設定を管理します","cli.configure.long_description":"システムとプラグインの設定を対話的またはサブコマンドで管理します","cli.configure.open_menu":"対話型設定メニューを開く","cli.configure.list_opts":"すべての設定オプションを一覧表示","cli.configure.get_value":"設定値を取得","cli.configure.set_value":"設定値を設定","cli.configure.reset_defaults":"設定をデフォルトにリセット","cli.configure.system":"システム","cli.configure.exit":"終了","cli.configure.back":"戻る","cli.configure.current_value":"現在の値:","cli.configure.invalid_value":"無効な値","cli.configure.set_to":"{label}を{value}に設定しました","cli.configure.invalid_format_get":"無効な形式です。使用法: configure get <カテゴリ.キー>","cli.configure.unknown_key":"不明な設定キー: {path}","cli.configure.invalid_format_set":"無効な形式です。使用法: configure set <カテゴリ.キー> <値>","cli.configure.set_success":"{path}を{value}に設定しました","cli.configure.system_reset":"システム設定をデフォルトにリセットしました","cli.configure.unknown_category":"不明なカテゴリ: {category}","cli.configure.category_reset":'"{category}"の設定をデフォルトにリセットしました',"cli.configure.reset_confirm":"すべての設定をデフォルトにリセットしますか?","cli.configure.reset_cancelled":"リセットがキャンセルされました","cli.configure.all_reset":"すべての設定をデフォルトにリセットしました","cli.configure.invalid_number":"無効な数値: {value}","cli.configure.invalid_options":"無効な値です。有効なオプション: {options}","cli.echo.description":"指定されたテキストを出力します","cli.echo.long_description":"指定されたテキストをターミナルに出力します","cli.echo.piping_note":"パイプによるテキストとJSONオブジェクトの出力をサポート","cli.clear.description":"ターミナルをクリア","cli.clear.long_description":"ターミナル画面の全内容をクリアします","cli.clear.shortcut":"ショートカット:","cli.version.description":"バージョン情報を表示","cli.version.long_description":"現在のCLIバージョンとドキュメントリンクを表示します","cli.uname.long_description":"システムとブラウザの詳細情報を表示します:","cli.uname.cli_versions":"CLIのコアとライブラリのバージョン","cli.uname.browser_info":"ブラウザ名、バージョン、ユーザーエージェント、言語、プラットフォーム","cli.uname.os":"オペレーティングシステム","cli.hash.description":"テキストのハッシュダイジェストを生成","cli.hash.long_description":"Web Crypto APIを使用して暗号学的ハッシュダイジェストを生成","cli.cal.description":"カレンダーを表示","cli.cal.long_description":"月間カレンダーを表示","cli.cal.highlight_note":"今日の日付がハイライトされます","cli.cal.current_month":"今月","cli.cal.specific_month":"指定月","cli.time.description":"現在のローカル時刻とUTCを表示","cli.time.long_description":"現在のローカル時刻とUTCを表示","cli.time.show_current":"現在のローカル時刻とUTCを表示","cli.uptime.description":"セッションの稼働時間を表示","cli.uptime.long_description":"現在のターミナルセッションの経過時間を表示します","cli.convert.description":"単位間の変換(長さ、重さ、温度、データ)","cli.convert.long_description":"様々な測定単位間の変換","cli.convert.supported":"サポート:","cli.eval.description":"JavaScript式を評価","cli.eval.long_description":"JavaScript式を評価","cli.eval.supports":"算術、文字列、配列、オブジェクト、あらゆる有効なJSをサポート","cli.seq.description":"数列を出力","cli.seq.long_description":"数列を出力","cli.seq.numbers_to_end":"1から終了までの数値","cli.seq.numbers_range":"開始から終了までの数値","cli.seq.with_step":"カスタムステップ付き","cli.lorem.description":"Lorem Ipsumプレースホルダーテキストを生成","cli.lorem.long_description":"Lorem Ipsumプレースホルダーテキストを生成","cli.lorem.gen_words":"単語を生成","cli.lorem.gen_sentences":"文を生成","cli.lorem.gen_paragraphs":"段落を生成","cli.alias.description":"コマンドエイリアスを管理","cli.alias.long_description":"よく使うコマンドのエイリアスショートカットを作成","cli.alias.create_new":"新しいエイリアスを作成","cli.alias.list_all":"すべてのエイリアスを一覧表示","cli.alias.remove_hint":"{command}でエイリアスを削除","cli.unalias.description":"コマンドエイリアスを削除","cli.unalias.long_description":"以前に定義したコマンドエイリアスを削除","cli.open.description":"URLを新しいブラウザタブで開く","cli.open.long_description":"URLを新しいブラウザタブで開く","cli.open.auto_https":"プロトコルが指定されていない場合、自動的にhttps://を追加します","cli.color.description":"色の変換とプレビュー(hex、rgb、hsl)","cli.color.long_description":"色のフォーマット間で変換し、色をプレビュー","cli.color.supported_formats":"サポートされるフォーマット:","cli.history.long_description":"現在のセッションのコマンド履歴を表示します","cli.history.show":"コマンド履歴を表示","cli.history.search":"パターンで履歴を検索","cli.history.clear":"すべての履歴をクリア","cli.history.arrow_hint":"矢印キー{keys}で履歴をナビゲート","cli.history.prefix_hint":"プレフィックスを入力して{key}を押すと、プレフィックスで履歴を検索","cli.theme.description":"テーマを操作","cli.theme.long_description":"テーマと色でターミナルの外観をカスタマイズ","cli.hex.description":"16進数のエンコード/デコードと基数変換","cli.hex.long_description":"テキストを16進数にエンコード/デコードし、基数間で数値を変換","cli.hex.text_to_hex":"テキストから16進数","cli.hex.hex_to_text":"16進数からテキスト","cli.hex.base_conversion":"基数変換","cli.feedback.long_description":"バグの報告、機能のリクエスト、新しいコマンドの提案 — 対話的またはインラインで。","cli.jwt.description":"JWTトークンのデコードと検査","cli.jwt.long_description":"JSON Web Token (JWT) のデコードと検査","cli.jwt.decode_display":"JWTの内容をデコードして表示","cli.jwt.shows":"表示:ヘッダー、ペイロード、有効期限、発行日","cli.sleep.description":"指定時間実行を一時停止","cli.sleep.long_description":"指定された期間(ミリ秒)実行を一時停止します","cli.services.description":"バックグラウンドサービスとタスクを管理","cli.services.long_description":"バックグラウンドサービスとタスクを管理","cli.services.list_desc":"すべてのサービスを一覧表示","cli.services.start_desc":"サービスを開始","cli.services.stop_desc":"サービスを停止","cli.services.restart_desc":"サービスを再起動","cli.services.logs_desc":"サービスログを表示","cli.services.info_desc":"サービスの詳細","cli.yes.description":"文字列を連続的に繰り返す","cli.yes.long_description":"文字列を連続的に繰り返す","cli.clipboard.description":"クリップボードにコピーまたは貼り付け","cli.clipboard.long_description":"システムクリップボードにテキストをコピーまたは貼り付け","cli.clipboard.copy_desc":"テキストをクリップボードにコピー","cli.clipboard.paste_desc":"クリップボードから貼り付け","cli.hotkeys.description":"ホットキー情報を表示","cli.hotkeys.long_description":"利用可能なすべてのキーボードショートカットとホットキーを表示","cli.export.description":"環境変数を設定","cli.export.long_description":"環境変数を設定または表示","cli.export.show_all":"すべての変数を表示","cli.export.set_var":"変数を設定","cli.export.set_spaces":"スペース付きで設定","cli.unset.description":"環境変数を削除","cli.unset.long_description":"環境変数を削除","cli.env.description":"環境変数を表示","cli.env.long_description":"環境変数を表示","cli.env.show_all":"すべての変数を表示","cli.env.show_single":"変数を1つ表示","cli.url.description":"URLのエンコードまたはデコード","cli.url.long_description":"URLのエンコード、デコード、解析","cli.url.encode_desc":"文字列をURLとしてエンコード","cli.url.decode_desc":"URL文字列をデコード","cli.url.parse_desc":"URLのコンポーネントを解析","cli.json.description":"JSONのフォーマット、最小化、検証","cli.json.long_description":"JSON文字列のフォーマット、最小化、検証","cli.json.format_desc":"インデント付きでJSONをフォーマット","cli.json.minify_desc":"空白を除去","cli.json.validate_desc":"有効なJSONかどうか確認","cli.base64.description":"Base64文字列のエンコードまたはデコード","cli.base64.long_description":"Base64文字列のエンコードとデコード","cli.base64.utf8_note":"UTF-8テキストエンコーディングをサポート","cli.base64.encode_desc":"テキストをBase64にエンコード","cli.base64.decode_desc":"Base64をテキストにデコード","cli.timestamp.description":"Unixタイムスタンプと日付の変換","cli.timestamp.long_description":"Unixタイムスタンプと読みやすい日付の変換","cli.timestamp.current":"現在のUnixタイムスタンプ","cli.timestamp.to_date":"タイムスタンプから日付","cli.timestamp.from_date":"日付からタイムスタンプ","cli.screen.description":"画面とターミナルの情報を表示","cli.screen.long_description":"画面、ビューポート、ターミナルのサイズを表示","cli.screen.shows":"表示:解像度、色深度、ピクセル比、ウィンドウサイズ、ターミナルサイズ","cli.random.description":"ランダムな値を生成","cli.random.long_description":"ランダムな数値、文字列、UUIDなどを生成","cli.random.number_desc":"ランダムな数値 (0-100)","cli.random.string_desc":"ランダムな文字列 (16文字)","cli.random.uuid_desc":"ランダムなUUID v4","cli.random.coin_desc":"コイントス","cli.random.dice_desc":"サイコロを振る","cli.ping.description":"ホストにICMP風のpingを送信","cli.ping.long_description":"ホストにHTTPベースのICMP風pingを送信し、往復統計を表示","cli.ping.ctrl_c":"Ctrl+Cで停止して統計を表示。","cli.nano.description":"内蔵テキストエディタを開く","cli.nano.long_description":"内蔵のnano風テキストエディタを開く","cli.nano.open_empty":"空のバッファを開く","cli.nano.open_file":"ファイルを開くまたは作成","cli.nano.keyboard_shortcuts":"キーボードショートカット:","cli.debug.description":"詳細なシステムとCLI内部の診断を表示","cli.debug.long_description":"詳細なシステムとCLI内部の診断を表示します。","cli.debug.hidden_note":"このコマンドはヘルプ一覧には表示されませんが、直接アクセスできます。","cli.debug.summary":"システム概要","cli.debug.processors":"登録済みの全プロセッサ","cli.debug.modules":"読み込み済みの全モジュール","cli.debug.state":"ステートストアを検査","cli.packages.description":"CLIのパッケージを管理"},langJaModule={apiVersion:API_VERSION$1,name:"@qodalis/cli-lang-ja",version:"1.0.0",description:"Japanese language pack for Qodalis CLI",async onInit(e){e.services.getRequired(ICliTranslationService_TOKEN).addTranslations("ja",jaTranslations)}},koTranslations={"cli.common.usage":"사용법:","cli.common.examples":"예시:","cli.help.description":"명령어 도움말을 표시합니다","cli.help.long_description":"명령어에 대한 도움말 정보를 표시합니다","cli.help.shortcuts":"단축키","cli.help.type":"입력:","cli.help.help_command":"help <명령어>","cli.help.for_details":"자세한 정보 확인","cli.help.unknown_command":"알 수 없는 명령어: {command}","cli.help.see_all":"모든 사용 가능한 명령어 보기","cli.help.extension_chain":"확장 체인","cli.help.subcommands":"하위 명령어","cli.help.options":"옵션","cli.help.global_options":"글로벌 옵션","cli.help.requires_server":"연결된 서버가 필요합니다","cli.help.aliases":"별칭:","cli.help.required":"(필수)","cli.help.show_all":"모든 사용 가능한 명령어 표시","cli.help.show_details":"명령어 상세 정보 표시","cli.help.show_sub_details":"하위 명령어 상세 정보 표시","cli.help.example_pkg":"패키지 관리자 도움말","cli.help.example_theme":"theme apply 하위 명령어 도움말","cli.configure.description":"시스템 및 플러그인 설정을 관리합니다","cli.configure.long_description":"시스템 및 플러그인 설정을 대화형 또는 하위 명령어로 관리합니다","cli.configure.open_menu":"대화형 설정 메뉴 열기","cli.configure.list_opts":"모든 설정 옵션 나열","cli.configure.get_value":"설정 값 가져오기","cli.configure.set_value":"설정 값 설정","cli.configure.reset_defaults":"설정을 기본값으로 초기화","cli.configure.system":"시스템","cli.configure.exit":"종료","cli.configure.back":"뒤로","cli.configure.current_value":"현재 값:","cli.configure.invalid_value":"잘못된 값","cli.configure.set_to":"{label}을(를) {value}(으)로 설정했습니다","cli.configure.invalid_format_get":"잘못된 형식입니다. 사용법: configure get <카테고리.키>","cli.configure.unknown_key":"알 수 없는 설정 키: {path}","cli.configure.invalid_format_set":"잘못된 형식입니다. 사용법: configure set <카테고리.키> <값>","cli.configure.set_success":"{path}을(를) {value}(으)로 설정했습니다","cli.configure.system_reset":"시스템 설정이 기본값으로 초기화되었습니다","cli.configure.unknown_category":"알 수 없는 카테고리: {category}","cli.configure.category_reset":'"{category}" 설정이 기본값으로 초기화되었습니다',"cli.configure.reset_confirm":"모든 설정을 기본값으로 초기화하시겠습니까?","cli.configure.reset_cancelled":"초기화가 취소되었습니다","cli.configure.all_reset":"모든 설정이 기본값으로 초기화되었습니다","cli.configure.invalid_number":"잘못된 숫자: {value}","cli.configure.invalid_options":"잘못된 값입니다. 유효한 옵션: {options}","cli.echo.description":"지정된 텍스트를 출력합니다","cli.echo.long_description":"지정된 텍스트를 터미널에 출력합니다","cli.echo.piping_note":"파이프를 통한 텍스트 및 JSON 객체 출력을 지원합니다","cli.clear.description":"터미널 지우기","cli.clear.long_description":"터미널 화면의 모든 내용을 지웁니다","cli.clear.shortcut":"단축키:","cli.version.description":"버전 정보 표시","cli.version.long_description":"현재 CLI 버전과 문서 링크를 표시합니다","cli.uname.long_description":"시스템 및 브라우저의 상세 정보를 표시합니다:","cli.uname.cli_versions":"CLI 코어 및 라이브러리 버전","cli.uname.browser_info":"브라우저 이름, 버전, 사용자 에이전트, 언어 및 플랫폼","cli.uname.os":"운영 체제","cli.hash.description":"텍스트의 해시 다이제스트 생성","cli.hash.long_description":"Web Crypto API를 사용하여 암호화 해시 다이제스트 생성","cli.cal.description":"달력 표시","cli.cal.long_description":"월간 달력 표시","cli.cal.highlight_note":"오늘 날짜가 강조 표시됩니다","cli.cal.current_month":"이번 달","cli.cal.specific_month":"특정 월","cli.time.description":"현재 로컬 시간과 UTC 표시","cli.time.long_description":"현재 로컬 시간과 UTC 표시","cli.time.show_current":"현재 로컬 시간과 UTC 표시","cli.uptime.description":"세션 가동 시간 표시","cli.uptime.long_description":"현재 터미널 세션의 경과 시간을 표시합니다","cli.convert.description":"단위 변환 (길이, 무게, 온도, 데이터)","cli.convert.long_description":"다양한 측정 단위 간 변환","cli.convert.supported":"지원:","cli.eval.description":"JavaScript 표현식 평가","cli.eval.long_description":"JavaScript 표현식 평가","cli.eval.supports":"산술, 문자열, 배열, 객체 및 모든 유효한 JS를 지원합니다","cli.seq.description":"숫자 시퀀스 출력","cli.seq.long_description":"숫자 시퀀스 출력","cli.seq.numbers_to_end":"1부터 끝까지 숫자","cli.seq.numbers_range":"시작부터 끝까지 숫자","cli.seq.with_step":"사용자 정의 단계","cli.lorem.description":"Lorem Ipsum 더미 텍스트 생성","cli.lorem.long_description":"Lorem Ipsum 더미 텍스트 생성","cli.lorem.gen_words":"단어 생성","cli.lorem.gen_sentences":"문장 생성","cli.lorem.gen_paragraphs":"단락 생성","cli.alias.description":"명령어 별칭 관리","cli.alias.long_description":"자주 사용하는 명령어의 별칭 단축키를 생성합니다","cli.alias.create_new":"새 별칭 생성","cli.alias.list_all":"모든 별칭 나열","cli.alias.remove_hint":"{command}로 별칭을 제거하세요","cli.unalias.description":"명령어 별칭 제거","cli.unalias.long_description":"이전에 정의한 명령어 별칭을 제거합니다","cli.open.description":"새 브라우저 탭에서 URL 열기","cli.open.long_description":"새 브라우저 탭에서 URL 열기","cli.open.auto_https":"프로토콜이 지정되지 않으면 자동으로 https://를 추가합니다","cli.color.description":"색상 변환 및 미리보기 (hex, rgb, hsl)","cli.color.long_description":"색상 형식 간 변환 및 색상 미리보기","cli.color.supported_formats":"지원되는 형식:","cli.history.long_description":"현재 세션의 명령어 기록을 표시합니다","cli.history.show":"명령어 기록 표시","cli.history.search":"패턴으로 기록 검색","cli.history.clear":"모든 기록 지우기","cli.history.arrow_hint":"화살표 키 {keys}로 기록을 탐색하세요","cli.history.prefix_hint":"접두사를 입력한 후 {key}를 눌러 접두사로 기록을 검색하세요","cli.theme.description":"테마 조작","cli.theme.long_description":"테마와 색상으로 터미널 외관을 사용자 정의합니다","cli.hex.description":"16진수 인코딩/디코딩 및 진법 변환","cli.hex.long_description":"텍스트를 16진수로 인코딩/디코딩하고 진법 간 숫자 변환","cli.hex.text_to_hex":"텍스트에서 16진수로","cli.hex.hex_to_text":"16진수에서 텍스트로","cli.hex.base_conversion":"진법 변환","cli.feedback.long_description":"버그 보고, 기능 요청 또는 새 명령어 제안 — 대화형 또는 인라인으로.","cli.jwt.description":"JWT 토큰 디코딩 및 검사","cli.jwt.long_description":"JSON 웹 토큰 (JWT) 디코딩 및 검사","cli.jwt.decode_display":"JWT 내용 디코딩 및 표시","cli.jwt.shows":"표시: 헤더, 페이로드, 만료 상태, 발급일","cli.sleep.description":"지정된 시간 동안 실행 일시 중지","cli.sleep.long_description":"지정된 기간(밀리초) 동안 실행을 일시 중지합니다","cli.services.description":"백그라운드 서비스 및 작업 관리","cli.services.long_description":"백그라운드 서비스 및 작업 관리","cli.services.list_desc":"모든 서비스 나열","cli.services.start_desc":"서비스 시작","cli.services.stop_desc":"서비스 중지","cli.services.restart_desc":"서비스 재시작","cli.services.logs_desc":"서비스 로그 보기","cli.services.info_desc":"서비스 상세 정보","cli.yes.description":"문자열을 연속적으로 반복","cli.yes.long_description":"문자열을 연속적으로 반복","cli.clipboard.description":"클립보드에 복사 또는 붙여넣기","cli.clipboard.long_description":"시스템 클립보드에 텍스트를 복사하거나 붙여넣기합니다","cli.clipboard.copy_desc":"텍스트를 클립보드에 복사","cli.clipboard.paste_desc":"클립보드에서 붙여넣기","cli.hotkeys.description":"단축키 정보 표시","cli.hotkeys.long_description":"사용 가능한 모든 키보드 단축키와 핫키를 표시합니다","cli.export.description":"환경 변수 설정","cli.export.long_description":"환경 변수 설정 또는 표시","cli.export.show_all":"모든 변수 표시","cli.export.set_var":"변수 설정","cli.export.set_spaces":"공백 포함 설정","cli.unset.description":"환경 변수 제거","cli.unset.long_description":"환경 변수를 제거합니다","cli.env.description":"환경 변수 표시","cli.env.long_description":"환경 변수 표시","cli.env.show_all":"모든 변수 표시","cli.env.show_single":"변수 하나 표시","cli.url.description":"URL 인코딩 또는 디코딩","cli.url.long_description":"URL 인코딩, 디코딩 및 구문 분석","cli.url.encode_desc":"문자열을 URL로 인코딩","cli.url.decode_desc":"URL 문자열 디코딩","cli.url.parse_desc":"URL 구성 요소 구문 분석","cli.json.description":"JSON 포맷, 최소화 또는 유효성 검사","cli.json.long_description":"JSON 문자열 포맷, 최소화 또는 유효성 검사","cli.json.format_desc":"들여쓰기로 JSON 포맷","cli.json.minify_desc":"공백 제거","cli.json.validate_desc":"유효한 JSON인지 확인","cli.base64.description":"Base64 문자열 인코딩 또는 디코딩","cli.base64.long_description":"Base64 문자열 인코딩 및 디코딩","cli.base64.utf8_note":"UTF-8 텍스트 인코딩을 지원합니다","cli.base64.encode_desc":"텍스트를 Base64로 인코딩","cli.base64.decode_desc":"Base64를 텍스트로 디코딩","cli.timestamp.description":"Unix 타임스탬프와 날짜 변환","cli.timestamp.long_description":"Unix 타임스탬프와 읽기 쉬운 날짜 변환","cli.timestamp.current":"현재 Unix 타임스탬프","cli.timestamp.to_date":"타임스탬프에서 날짜로","cli.timestamp.from_date":"날짜에서 타임스탬프로","cli.screen.description":"화면 및 터미널 정보 표시","cli.screen.long_description":"화면, 뷰포트 및 터미널 크기 표시","cli.screen.shows":"표시: 해상도, 색 깊이, 픽셀 비율, 창 크기, 터미널 크기","cli.random.description":"랜덤 값 생성","cli.random.long_description":"랜덤 숫자, 문자열, UUID 등 생성","cli.random.number_desc":"랜덤 숫자 (0-100)","cli.random.string_desc":"랜덤 문자열 (16자)","cli.random.uuid_desc":"랜덤 UUID v4","cli.random.coin_desc":"동전 던지기","cli.random.dice_desc":"주사위 던지기","cli.ping.description":"호스트에 ICMP 유형 ping 전송","cli.ping.long_description":"호스트에 HTTP 기반 ICMP 유형 ping을 전송하고 왕복 통계 표시","cli.ping.ctrl_c":"Ctrl+C를 눌러 중지하고 통계를 표시합니다.","cli.nano.description":"내장 텍스트 편집기 열기","cli.nano.long_description":"내장 nano 스타일 텍스트 편집기 열기","cli.nano.open_empty":"빈 버퍼 열기","cli.nano.open_file":"파일 열기 또는 생성","cli.nano.keyboard_shortcuts":"키보드 단축키:","cli.debug.description":"상세한 시스템 및 CLI 내부 진단 표시","cli.debug.long_description":"상세한 시스템 및 CLI 내부 진단을 표시합니다.","cli.debug.hidden_note":"이 명령어는 도움말 목록에 숨겨져 있지만 직접 접근할 수 있습니다.","cli.debug.summary":"시스템 요약","cli.debug.processors":"등록된 모든 프로세서","cli.debug.modules":"로드된 모든 모듈","cli.debug.state":"상태 저장소 검사","cli.packages.description":"CLI 패키지 관리"},langKoModule={apiVersion:API_VERSION$1,name:"@qodalis/cli-lang-ko",version:"1.0.0",description:"Korean language pack for Qodalis CLI",async onInit(e){e.services.getRequired(ICliTranslationService_TOKEN).addTranslations("ko",koTranslations)}},ptTranslations={"cli.common.usage":"Uso:","cli.common.examples":"Exemplos:","cli.help.description":"Exibe ajuda para um comando","cli.help.long_description":"Exibe informações de ajuda para comandos","cli.help.shortcuts":"Atalhos","cli.help.type":"Digite","cli.help.help_command":"help <comando>","cli.help.for_details":"para informações detalhadas","cli.help.unknown_command":"Comando desconhecido: {command}","cli.help.see_all":"para ver todos os comandos disponíveis","cli.help.extension_chain":"Cadeia de extensões","cli.help.subcommands":"Subcomandos","cli.help.options":"Opções","cli.help.global_options":"Opções globais","cli.help.requires_server":"Requer um servidor conectado","cli.help.aliases":"Aliases:","cli.help.required":"(obrigatório)","cli.help.show_all":"Mostrar todos os comandos disponíveis","cli.help.show_details":"Mostrar detalhes de um comando","cli.help.show_sub_details":"Mostrar detalhes de um subcomando","cli.help.example_pkg":"Ajuda do gerenciador de pacotes","cli.help.example_theme":"Ajuda do subcomando theme apply","cli.configure.description":"Gerenciar configuração do sistema e plugins","cli.configure.long_description":"Gerenciar configuração do sistema e plugins interativamente ou via subcomandos","cli.configure.open_menu":"Abrir menu de configuração interativo","cli.configure.list_opts":"Listar todas as opções de configuração","cli.configure.get_value":"Obter um valor de configuração","cli.configure.set_value":"Definir um valor de configuração","cli.configure.reset_defaults":"Redefinir configuração para os padrões","cli.configure.system":"Sistema","cli.configure.exit":"Sair","cli.configure.back":"Voltar","cli.configure.current_value":"Valor atual:","cli.configure.invalid_value":"Valor inválido","cli.configure.set_to":"{label} definido como {value}","cli.configure.invalid_format_get":"Formato inválido. Use: configure get <categoria.chave>","cli.configure.unknown_key":"Chave de configuração desconhecida: {path}","cli.configure.invalid_format_set":"Formato inválido. Use: configure set <categoria.chave> <valor>","cli.configure.set_success":"{path} definido como {value}","cli.configure.system_reset":"Configuração do sistema redefinida para os padrões","cli.configure.unknown_category":"Categoria desconhecida: {category}","cli.configure.category_reset":'Configuração de "{category}" redefinida para os padrões',"cli.configure.reset_confirm":"Redefinir toda a configuração para os padrões?","cli.configure.reset_cancelled":"Redefinição cancelada","cli.configure.all_reset":"Toda a configuração redefinida para os padrões","cli.configure.invalid_number":"Número inválido: {value}","cli.configure.invalid_options":"Valor inválido. Opções válidas: {options}","cli.echo.description":"Imprime o texto especificado","cli.echo.long_description":"Imprime o texto especificado no terminal","cli.echo.piping_note":"Suporta saída de texto e objetos JSON via pipes","cli.clear.description":"Limpar o terminal","cli.clear.long_description":"Limpa todo o conteúdo da tela do terminal","cli.clear.shortcut":"Atalho:","cli.version.description":"Exibir informações da versão","cli.version.long_description":"Exibe a versão atual do CLI e o link para a documentação","cli.uname.long_description":"Exibe informações detalhadas do sistema e navegador, incluindo:","cli.uname.cli_versions":"Versões do núcleo e bibliotecas do CLI","cli.uname.browser_info":"Nome do navegador, versão, user agent, idioma e plataforma","cli.uname.os":"Sistema operacional","cli.hash.description":"Gerar resumos hash de texto","cli.hash.long_description":"Gerar resumos hash criptográficos usando a API Web Crypto","cli.cal.description":"Exibir um calendário","cli.cal.long_description":"Exibir um calendário mensal","cli.cal.highlight_note":"O dia atual está destacado","cli.cal.current_month":"Mês atual","cli.cal.specific_month":"Mês específico","cli.time.description":"Exibir hora local e UTC atual","cli.time.long_description":"Exibir hora local e UTC atual","cli.time.show_current":"Exibir hora local e UTC atual","cli.uptime.description":"Exibir tempo de atividade da sessão","cli.uptime.long_description":"Exibe há quanto tempo a sessão atual do terminal está ativa","cli.convert.description":"Converter entre unidades (comprimento, peso, temperatura, dados)","cli.convert.long_description":"Converter entre várias unidades de medida","cli.convert.supported":"Suportados:","cli.eval.description":"Avaliar uma expressão JavaScript","cli.eval.long_description":"Avaliar uma expressão JavaScript","cli.eval.supports":"Suporta aritmética, strings, arrays, objetos e qualquer JS válido","cli.seq.description":"Imprimir uma sequência de números","cli.seq.long_description":"Imprimir uma sequência de números","cli.seq.numbers_to_end":"Números de 1 até o final","cli.seq.numbers_range":"Números do início ao final","cli.seq.with_step":"Com passo personalizado","cli.lorem.description":"Gerar texto de preenchimento lorem ipsum","cli.lorem.long_description":"Gerar texto de preenchimento lorem ipsum","cli.lorem.gen_words":"Gerar palavras","cli.lorem.gen_sentences":"Gerar frases","cli.lorem.gen_paragraphs":"Gerar parágrafos","cli.alias.description":"Gerenciar aliases de comandos","cli.alias.long_description":"Criar atalhos de alias para comandos frequentes","cli.alias.create_new":"Criar um novo alias","cli.alias.list_all":"Listar todos os aliases","cli.alias.remove_hint":"Use {command} para remover um alias","cli.unalias.description":"Remover aliases de comandos","cli.unalias.long_description":"Remover um alias de comando definido anteriormente","cli.open.description":"Abrir URL em nova aba do navegador","cli.open.long_description":"Abrir URL em nova aba do navegador","cli.open.auto_https":"Adiciona automaticamente https:// se nenhum protocolo for especificado","cli.color.description":"Converter e visualizar cores (hex, rgb, hsl)","cli.color.long_description":"Converter entre formatos de cor e visualizar cores","cli.color.supported_formats":"Formatos suportados:","cli.history.long_description":"Exibe o histórico de comandos da sessão atual","cli.history.show":"Mostrar histórico de comandos","cli.history.search":"Pesquisar no histórico por padrão","cli.history.clear":"Limpar todo o histórico","cli.history.arrow_hint":"Use as teclas de seta {keys} para navegar pelo histórico","cli.history.prefix_hint":"Digite um prefixo e pressione {key} para pesquisar no histórico por prefixo","cli.theme.description":"Interagir com o tema","cli.theme.long_description":"Personalizar a aparência do terminal com temas e cores","cli.hex.description":"Codificar/decodificar hex e conversões de base numérica","cli.hex.long_description":"Codificar/decodificar texto em hexadecimal e converter números entre bases","cli.hex.text_to_hex":"Texto para hexadecimal","cli.hex.hex_to_text":"Hexadecimal para texto","cli.hex.base_conversion":"Conversão de base","cli.feedback.long_description":"Reportar bugs, solicitar funcionalidades ou sugerir novos comandos — interativamente ou inline.","cli.jwt.description":"Decodificar e inspecionar tokens JWT","cli.jwt.long_description":"Decodificar e inspecionar JSON Web Tokens (JWT)","cli.jwt.decode_display":"Decodificar e exibir conteúdo do JWT","cli.jwt.shows":"Mostra: cabeçalho, payload, status de expiração, data de emissão","cli.sleep.description":"Pausar execução por um tempo especificado","cli.sleep.long_description":"Pausa a execução pela duração especificada (em milissegundos)","cli.services.description":"Gerenciar serviços em segundo plano e tarefas","cli.services.long_description":"Gerenciar serviços em segundo plano e tarefas","cli.services.list_desc":"Listar todos os serviços","cli.services.start_desc":"Iniciar um serviço","cli.services.stop_desc":"Parar um serviço","cli.services.restart_desc":"Reiniciar um serviço","cli.services.logs_desc":"Ver logs do serviço","cli.services.info_desc":"Detalhes do serviço","cli.yes.description":"Repetir uma string continuamente","cli.yes.long_description":"Repetir uma string continuamente","cli.clipboard.description":"Copiar ou colar da área de transferência","cli.clipboard.long_description":"Copiar texto para a área de transferência do sistema ou colar texto dela","cli.clipboard.copy_desc":"Copiar texto para a área de transferência","cli.clipboard.paste_desc":"Colar da área de transferência","cli.hotkeys.description":"Exibir informações de teclas de atalho","cli.hotkeys.long_description":"Exibe todos os atalhos de teclado e teclas de atalho disponíveis","cli.export.description":"Definir variáveis de ambiente","cli.export.long_description":"Definir ou exibir variáveis de ambiente","cli.export.show_all":"Mostrar todas as variáveis","cli.export.set_var":"Definir uma variável","cli.export.set_spaces":"Definir com espaços","cli.unset.description":"Remover variáveis de ambiente","cli.unset.long_description":"Remover uma variável de ambiente","cli.env.description":"Exibir variáveis de ambiente","cli.env.long_description":"Exibir variáveis de ambiente","cli.env.show_all":"Mostrar todas as variáveis","cli.env.show_single":"Mostrar uma variável","cli.url.description":"Codificar ou decodificar URLs","cli.url.long_description":"Codificar, decodificar e analisar URLs","cli.url.encode_desc":"Codificar uma string como URL","cli.url.decode_desc":"Decodificar uma string de URL","cli.url.parse_desc":"Analisar componentes de uma URL","cli.json.description":"Formatar, minificar ou validar JSON","cli.json.long_description":"Formatar, minificar ou validar strings JSON","cli.json.format_desc":"Formatar JSON com indentação","cli.json.minify_desc":"Remover espaços em branco","cli.json.validate_desc":"Verificar se é JSON válido","cli.base64.description":"Codificar ou decodificar strings Base64","cli.base64.long_description":"Codificar e decodificar strings Base64","cli.base64.utf8_note":"Suporta codificação de texto UTF-8","cli.base64.encode_desc":"Codificar texto para Base64","cli.base64.decode_desc":"Decodificar Base64 para texto","cli.timestamp.description":"Converter entre timestamps Unix e datas","cli.timestamp.long_description":"Converter entre timestamps Unix e datas legíveis","cli.timestamp.current":"Timestamp Unix atual","cli.timestamp.to_date":"Timestamp para data","cli.timestamp.from_date":"Data para timestamp","cli.screen.description":"Exibir informações de tela e terminal","cli.screen.long_description":"Exibir dimensões da tela, viewport e terminal","cli.screen.shows":"Mostra: resolução, profundidade de cor, proporção de pixels, tamanho da janela, tamanho do terminal","cli.random.description":"Gerar valores aleatórios","cli.random.long_description":"Gerar números, strings, UUIDs aleatórios e mais","cli.random.number_desc":"Número aleatório (0-100)","cli.random.string_desc":"String aleatória (16 caracteres)","cli.random.uuid_desc":"UUID v4 aleatório","cli.random.coin_desc":"Jogar uma moeda","cli.random.dice_desc":"Jogar um dado","cli.ping.description":"Enviar pings tipo ICMP para um host","cli.ping.long_description":"Enviar pings HTTP tipo ICMP para um host e exibir estatísticas de ida e volta","cli.ping.ctrl_c":"Pressione Ctrl+C para parar e exibir estatísticas.","cli.nano.description":"Abrir editor de texto integrado","cli.nano.long_description":"Abrir editor de texto estilo nano integrado","cli.nano.open_empty":"Abrir buffer vazio","cli.nano.open_file":"Abrir ou criar um arquivo","cli.nano.keyboard_shortcuts":"Atalhos de teclado:","cli.debug.description":"Exibir diagnósticos detalhados do sistema e internos do CLI","cli.debug.long_description":"Exibe diagnósticos detalhados do sistema e internos do CLI.","cli.debug.hidden_note":"Este comando está oculto na lista de ajuda mas é acessível diretamente.","cli.debug.summary":"Resumo do sistema","cli.debug.processors":"Todos os processadores registrados","cli.debug.modules":"Todos os módulos carregados","cli.debug.state":"Inspecionar armazenamentos de estado","cli.packages.description":"Gerenciar pacotes no CLI"},langPtModule={apiVersion:API_VERSION$1,name:"@qodalis/cli-lang-pt",version:"1.0.0",description:"Portuguese language pack for Qodalis CLI",async onInit(e){e.services.getRequired(ICliTranslationService_TOKEN).addTranslations("pt",ptTranslations)}},ruTranslations={"cli.common.usage":"Использование:","cli.common.examples":"Примеры:","cli.help.description":"Показать справку по команде","cli.help.long_description":"Показать справочную информацию по командам","cli.help.shortcuts":"Горячие клавиши","cli.help.type":"Введите","cli.help.help_command":"help <команда>","cli.help.for_details":"для подробной информации","cli.help.unknown_command":"Неизвестная команда: {command}","cli.help.see_all":"для просмотра всех доступных команд","cli.help.extension_chain":"Цепочка расширений","cli.help.subcommands":"Подкоманды","cli.help.options":"Параметры","cli.help.global_options":"Глобальные параметры","cli.help.requires_server":"Требуется подключённый сервер","cli.help.aliases":"Псевдонимы:","cli.help.required":"(обязательно)","cli.help.show_all":"Показать все доступные команды","cli.help.show_details":"Показать подробности команды","cli.help.show_sub_details":"Показать подробности подкоманды","cli.help.example_pkg":"Справка менеджера пакетов","cli.help.example_theme":"Справка подкоманды theme apply","cli.configure.description":"Управление конфигурацией системы и плагинов","cli.configure.long_description":"Управление конфигурацией системы и плагинов интерактивно или через подкоманды","cli.configure.open_menu":"Открыть интерактивное меню конфигурации","cli.configure.list_opts":"Показать все параметры конфигурации","cli.configure.get_value":"Получить значение конфигурации","cli.configure.set_value":"Установить значение конфигурации","cli.configure.reset_defaults":"Сбросить конфигурацию к значениям по умолчанию","cli.configure.system":"Система","cli.configure.exit":"Выход","cli.configure.back":"Назад","cli.configure.current_value":"Текущее значение:","cli.configure.invalid_value":"Недопустимое значение","cli.configure.set_to":"{label} установлено в {value}","cli.configure.invalid_format_get":"Неверный формат. Используйте: configure get <категория.ключ>","cli.configure.unknown_key":"Неизвестный ключ конфигурации: {path}","cli.configure.invalid_format_set":"Неверный формат. Используйте: configure set <категория.ключ> <значение>","cli.configure.set_success":"{path} установлено в {value}","cli.configure.system_reset":"Конфигурация системы сброшена к значениям по умолчанию","cli.configure.unknown_category":"Неизвестная категория: {category}","cli.configure.category_reset":"Конфигурация «{category}» сброшена к значениям по умолчанию","cli.configure.reset_confirm":"Сбросить всю конфигурацию к значениям по умолчанию?","cli.configure.reset_cancelled":"Сброс отменён","cli.configure.all_reset":"Вся конфигурация сброшена к значениям по умолчанию","cli.configure.invalid_number":"Недопустимое число: {value}","cli.configure.invalid_options":"Недопустимое значение. Допустимые варианты: {options}","cli.echo.description":"Вывести указанный текст","cli.echo.long_description":"Вывести указанный текст в терминал","cli.echo.piping_note":"Поддерживает вывод текста и JSON-объектов через конвейер","cli.clear.description":"Очистить терминал","cli.clear.long_description":"Очистить всё содержимое экрана терминала","cli.clear.shortcut":"Горячая клавиша:","cli.version.description":"Показать информацию о версии","cli.version.long_description":"Показать текущую версию CLI и ссылку на документацию","cli.uname.long_description":"Показать подробную информацию о системе и браузере, включая:","cli.uname.cli_versions":"Версии ядра и библиотек CLI","cli.uname.browser_info":"Название браузера, версия, user agent, язык и платформа","cli.uname.os":"Операционная система","cli.hash.description":"Генерировать хеш-дайджесты текста","cli.hash.long_description":"Генерировать криптографические хеш-дайджесты с помощью Web Crypto API","cli.cal.description":"Показать календарь","cli.cal.long_description":"Показать месячный календарь","cli.cal.highlight_note":"Текущий день выделен","cli.cal.current_month":"Текущий месяц","cli.cal.specific_month":"Конкретный месяц","cli.time.description":"Показать текущее местное время и UTC","cli.time.long_description":"Показать текущее местное время и UTC","cli.time.show_current":"Показать текущее местное время и UTC","cli.uptime.description":"Показать время работы сессии","cli.uptime.long_description":"Показать, сколько времени активна текущая сессия терминала","cli.convert.description":"Конвертировать единицы (длина, вес, температура, данные)","cli.convert.long_description":"Конвертировать между различными единицами измерения","cli.convert.supported":"Поддерживаемые:","cli.eval.description":"Выполнить выражение JavaScript","cli.eval.long_description":"Выполнить выражение JavaScript","cli.eval.supports":"Поддерживает арифметику, строки, массивы, объекты и любой валидный JS","cli.seq.description":"Вывести последовательность чисел","cli.seq.long_description":"Вывести последовательность чисел","cli.seq.numbers_to_end":"Числа от 1 до конца","cli.seq.numbers_range":"Числа от начала до конца","cli.seq.with_step":"С пользовательским шагом","cli.lorem.description":"Генерировать текст-заполнитель lorem ipsum","cli.lorem.long_description":"Генерировать текст-заполнитель lorem ipsum","cli.lorem.gen_words":"Генерировать слова","cli.lorem.gen_sentences":"Генерировать предложения","cli.lorem.gen_paragraphs":"Генерировать абзацы","cli.alias.description":"Управление псевдонимами команд","cli.alias.long_description":"Создание псевдонимов для часто используемых команд","cli.alias.create_new":"Создать новый псевдоним","cli.alias.list_all":"Показать все псевдонимы","cli.alias.remove_hint":"Используйте {command} для удаления псевдонима","cli.unalias.description":"Удалить псевдонимы команд","cli.unalias.long_description":"Удалить ранее определённый псевдоним команды","cli.open.description":"Открыть URL в новой вкладке браузера","cli.open.long_description":"Открыть URL в новой вкладке браузера","cli.open.auto_https":"Автоматически добавляет https://, если протокол не указан","cli.color.description":"Конвертировать и просматривать цвета (hex, rgb, hsl)","cli.color.long_description":"Конвертировать между форматами цветов и просматривать цвета","cli.color.supported_formats":"Поддерживаемые форматы:","cli.history.long_description":"Показать историю команд текущей сессии","cli.history.show":"Показать историю команд","cli.history.search":"Поиск по истории по шаблону","cli.history.clear":"Очистить всю историю","cli.history.arrow_hint":"Используйте клавиши со стрелками {keys} для навигации по истории","cli.history.prefix_hint":"Введите префикс и нажмите {key} для поиска по истории по префиксу","cli.theme.description":"Взаимодействие с темой","cli.theme.long_description":"Настройка внешнего вида терминала с помощью тем и цветов","cli.hex.description":"Кодирование/декодирование hex и преобразование систем счисления","cli.hex.long_description":"Кодирование/декодирование текста в шестнадцатеричный формат и преобразование чисел между системами счисления","cli.hex.text_to_hex":"Текст в шестнадцатеричный","cli.hex.hex_to_text":"Шестнадцатеричный в текст","cli.hex.base_conversion":"Преобразование системы счисления","cli.feedback.long_description":"Сообщить об ошибке, запросить функцию или предложить новую команду — интерактивно или встроенно.","cli.jwt.description":"Декодировать и проверить токены JWT","cli.jwt.long_description":"Декодировать и проверить JSON Web Token (JWT)","cli.jwt.decode_display":"Декодировать и показать содержимое JWT","cli.jwt.shows":"Показывает: заголовок, полезную нагрузку, статус истечения, дату выдачи","cli.sleep.description":"Приостановить выполнение на указанное время","cli.sleep.long_description":"Приостановить выполнение на указанную длительность (в миллисекундах)","cli.services.description":"Управление фоновыми сервисами и задачами","cli.services.long_description":"Управление фоновыми сервисами и задачами","cli.services.list_desc":"Показать все сервисы","cli.services.start_desc":"Запустить сервис","cli.services.stop_desc":"Остановить сервис","cli.services.restart_desc":"Перезапустить сервис","cli.services.logs_desc":"Просмотреть журналы сервиса","cli.services.info_desc":"Подробности сервиса","cli.yes.description":"Непрерывно повторять строку","cli.yes.long_description":"Непрерывно повторять строку","cli.clipboard.description":"Копировать или вставить из буфера обмена","cli.clipboard.long_description":"Копировать текст в системный буфер обмена или вставить текст из него","cli.clipboard.copy_desc":"Копировать текст в буфер обмена","cli.clipboard.paste_desc":"Вставить из буфера обмена","cli.hotkeys.description":"Показать информацию о горячих клавишах","cli.hotkeys.long_description":"Показать все доступные сочетания клавиш и горячие клавиши","cli.export.description":"Установить переменные окружения","cli.export.long_description":"Установить или показать переменные окружения","cli.export.show_all":"Показать все переменные","cli.export.set_var":"Установить переменную","cli.export.set_spaces":"Установить значение с пробелами","cli.unset.description":"Удалить переменные окружения","cli.unset.long_description":"Удалить переменную окружения","cli.env.description":"Показать переменные окружения","cli.env.long_description":"Показать переменные окружения","cli.env.show_all":"Показать все переменные","cli.env.show_single":"Показать одну переменную","cli.url.description":"Кодировать или декодировать URL","cli.url.long_description":"Кодирование, декодирование и разбор URL","cli.url.encode_desc":"Кодировать строку как URL","cli.url.decode_desc":"Декодировать строку URL","cli.url.parse_desc":"Разобрать компоненты URL","cli.json.description":"Форматировать, минифицировать или валидировать JSON","cli.json.long_description":"Форматировать, минифицировать или валидировать строки JSON","cli.json.format_desc":"Форматировать JSON с отступами","cli.json.minify_desc":"Удалить пробелы","cli.json.validate_desc":"Проверить, является ли валидным JSON","cli.base64.description":"Кодировать или декодировать строки Base64","cli.base64.long_description":"Кодирование и декодирование строк Base64","cli.base64.utf8_note":"Поддерживает кодировку текста UTF-8","cli.base64.encode_desc":"Кодировать текст в Base64","cli.base64.decode_desc":"Декодировать Base64 в текст","cli.timestamp.description":"Конвертировать между метками времени Unix и датами","cli.timestamp.long_description":"Конвертировать между метками времени Unix и читаемыми датами","cli.timestamp.current":"Текущая метка времени Unix","cli.timestamp.to_date":"Метка времени в дату","cli.timestamp.from_date":"Дата в метку времени","cli.screen.description":"Показать информацию об экране и терминале","cli.screen.long_description":"Показать размеры экрана, области просмотра и терминала","cli.screen.shows":"Показывает: разрешение, глубину цвета, соотношение пикселей, размер окна, размер терминала","cli.random.description":"Генерировать случайные значения","cli.random.long_description":"Генерировать случайные числа, строки, UUID и другое","cli.random.number_desc":"Случайное число (0-100)","cli.random.string_desc":"Случайная строка (16 символов)","cli.random.uuid_desc":"Случайный UUID v4","cli.random.coin_desc":"Подбросить монету","cli.random.dice_desc":"Бросить кубик","cli.ping.description":"Отправить ICMP-подобный ping на хост","cli.ping.long_description":"Отправить HTTP-based ICMP-подобный ping на хост и показать статистику","cli.ping.ctrl_c":"Нажмите Ctrl+C для остановки и отображения статистики.","cli.nano.description":"Открыть встроенный текстовый редактор","cli.nano.long_description":"Открыть встроенный текстовый редактор в стиле nano","cli.nano.open_empty":"Открыть пустой буфер","cli.nano.open_file":"Открыть или создать файл","cli.nano.keyboard_shortcuts":"Горячие клавиши:","cli.debug.description":"Показать подробную диагностику системы и внутренностей CLI","cli.debug.long_description":"Показать подробную диагностику системы и внутренностей CLI.","cli.debug.hidden_note":"Эта команда скрыта в списке справки, но доступна напрямую.","cli.debug.summary":"Сводка о системе","cli.debug.processors":"Все зарегистрированные процессоры","cli.debug.modules":"Все загруженные модули","cli.debug.state":"Просмотр хранилищ состояния","cli.packages.description":"Управление пакетами CLI"},langRuModule={apiVersion:API_VERSION$1,name:"@qodalis/cli-lang-ru",version:"1.0.0",description:"Russian language pack for Qodalis CLI",async onInit(e){e.services.getRequired(ICliTranslationService_TOKEN).addTranslations("ru",ruTranslations)}},zhTranslations={"cli.common.usage":"用法:","cli.common.examples":"示例:","cli.help.description":"显示命令帮助","cli.help.long_description":"显示命令的帮助信息","cli.help.shortcuts":"快捷键","cli.help.type":"输入","cli.help.help_command":"help <命令>","cli.help.for_details":"查看详细信息","cli.help.unknown_command":"未知命令:{command}","cli.help.see_all":"查看所有可用命令","cli.help.extension_chain":"扩展链","cli.help.subcommands":"子命令","cli.help.options":"选项","cli.help.global_options":"全局选项","cli.help.requires_server":"需要连接的服务器","cli.help.aliases":"别名:","cli.help.required":"(必填)","cli.help.show_all":"显示所有可用命令","cli.help.show_details":"显示命令详细信息","cli.help.show_sub_details":"显示子命令详细信息","cli.help.example_pkg":"包管理器帮助","cli.help.example_theme":"theme apply 子命令帮助","cli.configure.description":"管理系统和插件配置","cli.configure.long_description":"通过交互式菜单或子命令管理系统和插件配置","cli.configure.open_menu":"打开交互式配置菜单","cli.configure.list_opts":"列出所有配置选项","cli.configure.get_value":"获取配置值","cli.configure.set_value":"设置配置值","cli.configure.reset_defaults":"将配置重置为默认值","cli.configure.system":"系统","cli.configure.exit":"退出","cli.configure.back":"返回","cli.configure.current_value":"当前值:","cli.configure.invalid_value":"无效值","cli.configure.set_to":"已将 {label} 设置为 {value}","cli.configure.invalid_format_get":"格式无效。用法:configure get <类别.键>","cli.configure.unknown_key":"未知配置键:{path}","cli.configure.invalid_format_set":"格式无效。用法:configure set <类别.键> <值>","cli.configure.set_success":"已将 {path} 设置为 {value}","cli.configure.system_reset":"系统配置已重置为默认值","cli.configure.unknown_category":"未知类别:{category}","cli.configure.category_reset":'"{category}" 的配置已重置为默认值',"cli.configure.reset_confirm":"是否将所有配置重置为默认值?","cli.configure.reset_cancelled":"重置已取消","cli.configure.all_reset":"所有配置已重置为默认值","cli.configure.invalid_number":"无效数字:{value}","cli.configure.invalid_options":"无效值。有效选项:{options}","cli.echo.description":"输出指定的文本","cli.echo.long_description":"在终端中输出指定的文本","cli.echo.piping_note":"支持通过管道输出文本和 JSON 对象","cli.clear.description":"清除终端","cli.clear.long_description":"清除终端屏幕的所有内容","cli.clear.shortcut":"快捷键:","cli.version.description":"显示版本信息","cli.version.long_description":"显示当前 CLI 版本和文档链接","cli.uname.long_description":"显示详细的系统和浏览器信息,包括:","cli.uname.cli_versions":"CLI 核心和库版本","cli.uname.browser_info":"浏览器名称、版本、用户代理、语言和平台","cli.uname.os":"操作系统","cli.hash.description":"生成文本的哈希摘要","cli.hash.long_description":"使用 Web Crypto API 生成加密哈希摘要","cli.cal.description":"显示日历","cli.cal.long_description":"显示月历","cli.cal.highlight_note":"当前日期已高亮显示","cli.cal.current_month":"当前月份","cli.cal.specific_month":"指定月份","cli.time.description":"显示当前本地时间和 UTC","cli.time.long_description":"显示当前本地时间和 UTC","cli.time.show_current":"显示当前本地时间和 UTC","cli.uptime.description":"显示会话运行时间","cli.uptime.long_description":"显示当前终端会话已运行的时间","cli.convert.description":"单位换算(长度、重量、温度、数据)","cli.convert.long_description":"在各种计量单位之间换算","cli.convert.supported":"支持:","cli.eval.description":"执行 JavaScript 表达式","cli.eval.long_description":"执行 JavaScript 表达式","cli.eval.supports":"支持算术、字符串、数组、对象和任何有效的 JS","cli.seq.description":"输出数字序列","cli.seq.long_description":"输出数字序列","cli.seq.numbers_to_end":"从 1 到结束的数字","cli.seq.numbers_range":"从开始到结束的数字","cli.seq.with_step":"自定义步长","cli.lorem.description":"生成 Lorem Ipsum 占位文本","cli.lorem.long_description":"生成 Lorem Ipsum 占位文本","cli.lorem.gen_words":"生成单词","cli.lorem.gen_sentences":"生成句子","cli.lorem.gen_paragraphs":"生成段落","cli.alias.description":"管理命令别名","cli.alias.long_description":"为常用命令创建别名快捷方式","cli.alias.create_new":"创建新别名","cli.alias.list_all":"列出所有别名","cli.alias.remove_hint":"使用 {command} 删除别名","cli.unalias.description":"删除命令别名","cli.unalias.long_description":"删除先前定义的命令别名","cli.open.description":"在新浏览器标签页中打开 URL","cli.open.long_description":"在新浏览器标签页中打开 URL","cli.open.auto_https":"如果未指定协议,自动添加 https://","cli.color.description":"转换和预览颜色(hex、rgb、hsl)","cli.color.long_description":"在颜色格式之间转换并预览颜色","cli.color.supported_formats":"支持的格式:","cli.history.long_description":"显示当前会话的命令历史","cli.history.show":"显示命令历史","cli.history.search":"按模式搜索历史","cli.history.clear":"清除所有历史","cli.history.arrow_hint":"使用方向键 {keys} 浏览历史","cli.history.prefix_hint":"输入前缀后按 {key} 按前缀搜索历史","cli.theme.description":"与主题交互","cli.theme.long_description":"使用主题和颜色自定义终端外观","cli.hex.description":"十六进制编码/解码和进制转换","cli.hex.long_description":"将文本编码/解码为十六进制,并在进制之间转换数字","cli.hex.text_to_hex":"文本转十六进制","cli.hex.hex_to_text":"十六进制转文本","cli.hex.base_conversion":"进制转换","cli.feedback.long_description":"报告错误、请求功能或建议新命令——交互式或内联方式。","cli.jwt.description":"解码和检查 JWT 令牌","cli.jwt.long_description":"解码和检查 JSON Web Token (JWT)","cli.jwt.decode_display":"解码并显示 JWT 内容","cli.jwt.shows":"显示:头部、载荷、过期状态、签发日期","cli.sleep.description":"暂停执行指定时间","cli.sleep.long_description":"暂停执行指定的持续时间(以毫秒为单位)","cli.services.description":"管理后台服务和任务","cli.services.long_description":"管理后台服务和任务","cli.services.list_desc":"列出所有服务","cli.services.start_desc":"启动服务","cli.services.stop_desc":"停止服务","cli.services.restart_desc":"重启服务","cli.services.logs_desc":"查看服务日志","cli.services.info_desc":"服务详情","cli.yes.description":"连续重复一个字符串","cli.yes.long_description":"连续重复一个字符串","cli.clipboard.description":"从剪贴板复制或粘贴","cli.clipboard.long_description":"将文本复制到系统剪贴板或从中粘贴文本","cli.clipboard.copy_desc":"将文本复制到剪贴板","cli.clipboard.paste_desc":"从剪贴板粘贴","cli.hotkeys.description":"显示热键信息","cli.hotkeys.long_description":"显示所有可用的键盘快捷键和热键","cli.export.description":"设置环境变量","cli.export.long_description":"设置或显示环境变量","cli.export.show_all":"显示所有变量","cli.export.set_var":"设置变量","cli.export.set_spaces":"设置含空格的值","cli.unset.description":"删除环境变量","cli.unset.long_description":"删除环境变量","cli.env.description":"显示环境变量","cli.env.long_description":"显示环境变量","cli.env.show_all":"显示所有变量","cli.env.show_single":"显示单个变量","cli.url.description":"URL 编码或解码","cli.url.long_description":"URL 编码、解码和解析","cli.url.encode_desc":"将字符串编码为 URL","cli.url.decode_desc":"解码 URL 字符串","cli.url.parse_desc":"解析 URL 组件","cli.json.description":"格式化、压缩或验证 JSON","cli.json.long_description":"格式化、压缩或验证 JSON 字符串","cli.json.format_desc":"带缩进格式化 JSON","cli.json.minify_desc":"移除空白","cli.json.validate_desc":"检查是否为有效 JSON","cli.base64.description":"Base64 字符串编码或解码","cli.base64.long_description":"Base64 字符串编码和解码","cli.base64.utf8_note":"支持 UTF-8 文本编码","cli.base64.encode_desc":"将文本编码为 Base64","cli.base64.decode_desc":"将 Base64 解码为文本","cli.timestamp.description":"Unix 时间戳和日期转换","cli.timestamp.long_description":"Unix 时间戳和可读日期之间的转换","cli.timestamp.current":"当前 Unix 时间戳","cli.timestamp.to_date":"时间戳转日期","cli.timestamp.from_date":"日期转时间戳","cli.screen.description":"显示屏幕和终端信息","cli.screen.long_description":"显示屏幕、视口和终端尺寸","cli.screen.shows":"显示:分辨率、色深、像素比、窗口大小、终端大小","cli.random.description":"生成随机值","cli.random.long_description":"生成随机数字、字符串、UUID 等","cli.random.number_desc":"随机数字 (0-100)","cli.random.string_desc":"随机字符串(16 个字符)","cli.random.uuid_desc":"随机 UUID v4","cli.random.coin_desc":"抛硬币","cli.random.dice_desc":"掷骰子","cli.ping.description":"向主机发送 ICMP 类型的 ping","cli.ping.long_description":"向主机发送 HTTP 基础的 ICMP 类型 ping 并显示往返统计","cli.ping.ctrl_c":"按 Ctrl+C 停止并显示统计信息。","cli.nano.description":"打开内置文本编辑器","cli.nano.long_description":"打开内置的 nano 风格文本编辑器","cli.nano.open_empty":"打开空缓冲区","cli.nano.open_file":"打开或创建文件","cli.nano.keyboard_shortcuts":"键盘快捷键:","cli.debug.description":"显示详细的系统和 CLI 内部诊断","cli.debug.long_description":"显示详细的系统和 CLI 内部诊断信息。","cli.debug.hidden_note":"此命令在帮助列表中隐藏,但可直接访问。","cli.debug.summary":"系统摘要","cli.debug.processors":"所有已注册的处理器","cli.debug.modules":"所有已加载的模块","cli.debug.state":"检查状态存储","cli.packages.description":"管理 CLI 包"},langZhModule={apiVersion:API_VERSION$1,name:"@qodalis/cli-lang-zh",version:"1.0.0",description:"Chinese language pack for Qodalis CLI",async onInit(e){e.services.getRequired(ICliTranslationService_TOKEN).addTranslations("zh",zhTranslations)}};const SERVER_NAME="current",dashboardAuthProvider={getHeaders:e=>{const t=getToken();return e===SERVER_NAME&&t?{Authorization:`Bearer ${t}`}:{}},getWebSocketParams:async e=>{if(e!==SERVER_NAME)return;const t=getToken();if(!t)return{};const r=await fetch("/api/v1/qcli/sessions/ws-ticket",{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:"{}"}).catch(()=>{});if(!(r!=null&&r.ok))return{};const s=await r.json().catch(()=>null);return typeof(s==null?void 0:s.ticket)=="string"?{ticket:s.ticket}:{}}},services={[ICliServerAuthTokenProvider_TOKEN]:dashboardAuthProvider},options={servers:[{name:SERVER_NAME,url:window.location.origin}],wasmUrl:"/qcli/admin/assets/wasm/qodalis_cli_wasm_bg.wasm"},languagePacks=[langDeModule,langEsModule,langFrModule,langItModule,langJaModule,langKoModule,langPtModule,langRuModule,langZhModule];function setCliLocale(e,t){var s,o;const r=(o=(s=e==null?void 0:e.getContext())==null?void 0:s.services)==null?void 0:o.get("cli-translation-service");r==null||r.setLocale(t)}function TerminalPage(){const{t:e,locale:t}=useI18n(),r=reactExports.useRef(null),s=reactExports.useRef(t);return s.current=t,reactExports.useEffect(()=>setCliLocale(r.current,t),[t]),jsxRuntimeExports.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntimeExports.jsx(PageHeader,{title:e("terminal.title"),subtitle:e("terminal.subtitle")}),jsxRuntimeExports.jsx("div",{className:"flex-1 p-6 min-h-0",children:jsxRuntimeExports.jsx("div",{className:"h-full bg-black/40 border border-white/[0.08] rounded-xl overflow-hidden",children:jsxRuntimeExports.jsx(ErrorBoundary,{label:e("terminal.title"),children:jsxRuntimeExports.jsx(CliConfigProvider,{options,services,children:jsxRuntimeExports.jsx(Cli,{modules:languagePacks,style:{height:"100%"},onReady:o=>{r.current=o,setCliLocale(o,s.current)}})})})})})]})}function RequireAuth({children:e}){const{user:t,loading:r}=useAuth();return r?jsxRuntimeExports.jsx("div",{className:"min-h-screen flex items-center justify-center text-slate-400",children:"Loading..."}):t?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e}):jsxRuntimeExports.jsx(Navigate,{to:"/login",replace:!0})}function AppRoutes(){return jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"/login",element:jsxRuntimeExports.jsx(LoginPage,{})}),jsxRuntimeExports.jsxs(Route,{element:jsxRuntimeExports.jsx(RequireAuth,{children:jsxRuntimeExports.jsx(FeaturesProvider,{children:jsxRuntimeExports.jsx(WebSocketProvider,{children:jsxRuntimeExports.jsx(DashboardLayout,{})})})}),children:[jsxRuntimeExports.jsx(Route,{index:!0,element:jsxRuntimeExports.jsx(OverviewPage,{})}),jsxRuntimeExports.jsx(Route,{path:"commands",element:jsxRuntimeExports.jsx(CommandsPage,{})}),jsxRuntimeExports.jsx(Route,{path:"jobs",element:jsxRuntimeExports.jsx(JobsPage,{})}),jsxRuntimeExports.jsx(Route,{path:"jobs/:id",element:jsxRuntimeExports.jsx(JobDetail,{})}),jsxRuntimeExports.jsx(Route,{path:"plugins",element:jsxRuntimeExports.jsx(PluginsPage,{})}),jsxRuntimeExports.jsx(Route,{path:"filesystem",element:jsxRuntimeExports.jsx(FilesystemPage,{})}),jsxRuntimeExports.jsx(Route,{path:"events",element:jsxRuntimeExports.jsx(EventsPage,{})}),jsxRuntimeExports.jsx(Route,{path:"config",element:jsxRuntimeExports.jsx(ConfigPage,{})}),jsxRuntimeExports.jsx(Route,{path:"logs",element:jsxRuntimeExports.jsx(LogsPage,{})}),jsxRuntimeExports.jsx(Route,{path:"terminal",element:jsxRuntimeExports.jsx(TerminalPage,{})})]}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(Navigate,{to:"/",replace:!0})})]})}function App(){return jsxRuntimeExports.jsx(ErrorBoundary,{variant:"page",children:jsxRuntimeExports.jsx(AuthProvider,{children:jsxRuntimeExports.jsx(AppRoutes,{})})})}const basename="/qcli/admin/".replace(/\/+$/,"");clientExports.createRoot(document.getElementById("root")).render(jsxRuntimeExports.jsx(reactExports.StrictMode,{children:jsxRuntimeExports.jsx(I18nProvider,{children:jsxRuntimeExports.jsx(BrowserRouter,{basename,children:jsxRuntimeExports.jsx(App,{})})})}));
|