agent-workbench 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/server.js +195 -4
- package/dist/web/assets/{de-fq_F8zRo.js → de-CXvJ7uwt.js} +1 -1
- package/dist/web/assets/{es-BCB5Npb3.js → es-BrWQ_4kO.js} +1 -1
- package/dist/web/assets/{fr-ClL0BO43.js → fr-Cv_qM9E8.js} +1 -1
- package/dist/web/assets/{highlight-2xGvJy1W.js → highlight-nRm-DNTr.js} +1 -1
- package/dist/web/assets/index-BFpUqUWT.js +139 -0
- package/dist/web/assets/index-BnrUWT0F.css +32 -0
- package/dist/web/assets/{ja-C7KI4Gtm.js → ja-h9u8sCMK.js} +1 -1
- package/dist/web/assets/{ko-C8der8AK.js → ko-m0EzMLN6.js} +1 -1
- package/dist/web/assets/{pt-BR-rXhfKNdD.js → pt-BR-BAHKndFr.js} +1 -1
- package/dist/web/assets/{ru-BjrRxMeM.js → ru-D1S49VN_.js} +1 -1
- package/dist/web/assets/{zh-CN-DDY7nBK5.js → zh-CN-CH6r3KGh.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-BoXw3kE_.css +0 -32
- package/dist/web/assets/index-Bu0LGhCK.js +0 -139
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
var Xg=Object.defineProperty;var Qg=(n,r,o)=>r in n?Xg(n,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[r]=o;var Mt=(n,r,o)=>Qg(n,typeof r!="symbol"?r+"":r,o);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const w of document.querySelectorAll('link[rel="modulepreload"]'))m(w);new MutationObserver(w=>{for(const A of w)if(A.type==="childList")for(const T of A.addedNodes)T.tagName==="LINK"&&T.rel==="modulepreload"&&m(T)}).observe(document,{childList:!0,subtree:!0});function o(w){const A={};return w.integrity&&(A.integrity=w.integrity),w.referrerPolicy&&(A.referrerPolicy=w.referrerPolicy),w.crossOrigin==="use-credentials"?A.credentials="include":w.crossOrigin==="anonymous"?A.credentials="omit":A.credentials="same-origin",A}function m(w){if(w.ep)return;w.ep=!0;const A=o(w);fetch(w.href,A)}})();function Jg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Gl={exports:{}},Ai={},Yl={exports:{}},et={};/**
|
|
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 ud;function Zg(){if(ud)return et;ud=1;var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),T=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),u=Symbol.iterator;function y($){return $===null||typeof $!="object"?null:($=u&&$[u]||$["@@iterator"],typeof $=="function"?$:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,g={};function a($,V,J){this.props=$,this.context=V,this.refs=g,this.updater=J||S}a.prototype.isReactComponent={},a.prototype.setState=function($,V){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,V,"setState")},a.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function f(){}f.prototype=a.prototype;function d($,V,J){this.props=$,this.context=V,this.refs=g,this.updater=J||S}var h=d.prototype=new f;h.constructor=d,k(h,a.prototype),h.isPureReactComponent=!0;var C=Array.isArray,D=Object.prototype.hasOwnProperty,x={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function b($,V,J){var re,ie={},he=null,Y=null;if(V!=null)for(re in V.ref!==void 0&&(Y=V.ref),V.key!==void 0&&(he=""+V.key),V)D.call(V,re)&&!M.hasOwnProperty(re)&&(ie[re]=V[re]);var U=arguments.length-2;if(U===1)ie.children=J;else if(1<U){for(var Z=Array(U),ee=0;ee<U;ee++)Z[ee]=arguments[ee+2];ie.children=Z}if($&&$.defaultProps)for(re in U=$.defaultProps,U)ie[re]===void 0&&(ie[re]=U[re]);return{$$typeof:n,type:$,key:he,ref:Y,props:ie,_owner:x.current}}function L($,V){return{$$typeof:n,type:$.type,key:V,ref:$.ref,props:$.props,_owner:$._owner}}function N($){return typeof $=="object"&&$!==null&&$.$$typeof===n}function B($){var V={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(J){return V[J]})}var P=/\/+/g;function F($,V){return typeof $=="object"&&$!==null&&$.key!=null?B(""+$.key):V.toString(36)}function H($,V,J,re,ie){var he=typeof $;(he==="undefined"||he==="boolean")&&($=null);var Y=!1;if($===null)Y=!0;else switch(he){case"string":case"number":Y=!0;break;case"object":switch($.$$typeof){case n:case r:Y=!0}}if(Y)return Y=$,ie=ie(Y),$=re===""?"."+F(Y,0):re,C(ie)?(J="",$!=null&&(J=$.replace(P,"$&/")+"/"),H(ie,V,J,"",function(ee){return ee})):ie!=null&&(N(ie)&&(ie=L(ie,J+(!ie.key||Y&&Y.key===ie.key?"":(""+ie.key).replace(P,"$&/")+"/")+$)),V.push(ie)),1;if(Y=0,re=re===""?".":re+":",C($))for(var U=0;U<$.length;U++){he=$[U];var Z=re+F(he,U);Y+=H(he,V,J,Z,ie)}else if(Z=y($),typeof Z=="function")for($=Z.call($),U=0;!(he=$.next()).done;)he=he.value,Z=re+F(he,U++),Y+=H(he,V,J,Z,ie);else if(he==="object")throw V=String($),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return Y}function q($,V,J){if($==null)return $;var re=[],ie=0;return H($,re,"","",function(he){return V.call(J,he,ie++)}),re}function X($){if($._status===-1){var V=$._result;V=V(),V.then(function(J){($._status===0||$._status===-1)&&($._status=1,$._result=J)},function(J){($._status===0||$._status===-1)&&($._status=2,$._result=J)}),$._status===-1&&($._status=0,$._result=V)}if($._status===1)return $._result.default;throw $._result}var G={current:null},K={transition:null},j={ReactCurrentDispatcher:G,ReactCurrentBatchConfig:K,ReactCurrentOwner:x};function W(){throw Error("act(...) is not supported in production builds of React.")}return et.Children={map:q,forEach:function($,V,J){q($,function(){V.apply(this,arguments)},J)},count:function($){var V=0;return q($,function(){V++}),V},toArray:function($){return q($,function(V){return V})||[]},only:function($){if(!N($))throw Error("React.Children.only expected to receive a single React element child.");return $}},et.Component=a,et.Fragment=o,et.Profiler=w,et.PureComponent=d,et.StrictMode=m,et.Suspense=l,et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,et.act=W,et.cloneElement=function($,V,J){if($==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+$+".");var re=k({},$.props),ie=$.key,he=$.ref,Y=$._owner;if(V!=null){if(V.ref!==void 0&&(he=V.ref,Y=x.current),V.key!==void 0&&(ie=""+V.key),$.type&&$.type.defaultProps)var U=$.type.defaultProps;for(Z in V)D.call(V,Z)&&!M.hasOwnProperty(Z)&&(re[Z]=V[Z]===void 0&&U!==void 0?U[Z]:V[Z])}var Z=arguments.length-2;if(Z===1)re.children=J;else if(1<Z){U=Array(Z);for(var ee=0;ee<Z;ee++)U[ee]=arguments[ee+2];re.children=U}return{$$typeof:n,type:$.type,key:ie,ref:he,props:re,_owner:Y}},et.createContext=function($){return $={$$typeof:T,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},$.Provider={$$typeof:A,_context:$},$.Consumer=$},et.createElement=b,et.createFactory=function($){var V=b.bind(null,$);return V.type=$,V},et.createRef=function(){return{current:null}},et.forwardRef=function($){return{$$typeof:s,render:$}},et.isValidElement=N,et.lazy=function($){return{$$typeof:v,_payload:{_status:-1,_result:$},_init:X}},et.memo=function($,V){return{$$typeof:p,type:$,compare:V===void 0?null:V}},et.startTransition=function($){var V=K.transition;K.transition={};try{$()}finally{K.transition=V}},et.unstable_act=W,et.useCallback=function($,V){return G.current.useCallback($,V)},et.useContext=function($){return G.current.useContext($)},et.useDebugValue=function(){},et.useDeferredValue=function($){return G.current.useDeferredValue($)},et.useEffect=function($,V){return G.current.useEffect($,V)},et.useId=function(){return G.current.useId()},et.useImperativeHandle=function($,V,J){return G.current.useImperativeHandle($,V,J)},et.useInsertionEffect=function($,V){return G.current.useInsertionEffect($,V)},et.useLayoutEffect=function($,V){return G.current.useLayoutEffect($,V)},et.useMemo=function($,V){return G.current.useMemo($,V)},et.useReducer=function($,V,J){return G.current.useReducer($,V,J)},et.useRef=function($){return G.current.useRef($)},et.useState=function($){return G.current.useState($)},et.useSyncExternalStore=function($,V,J){return G.current.useSyncExternalStore($,V,J)},et.useTransition=function(){return G.current.useTransition()},et.version="18.3.1",et}var hd;function Uc(){return hd||(hd=1,Yl.exports=Zg()),Yl.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 dd;function e_(){if(dd)return Ai;dd=1;var n=Uc(),r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,w=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,A={key:!0,ref:!0,__self:!0,__source:!0};function T(s,l,p){var v,u={},y=null,S=null;p!==void 0&&(y=""+p),l.key!==void 0&&(y=""+l.key),l.ref!==void 0&&(S=l.ref);for(v in l)m.call(l,v)&&!A.hasOwnProperty(v)&&(u[v]=l[v]);if(s&&s.defaultProps)for(v in l=s.defaultProps,l)u[v]===void 0&&(u[v]=l[v]);return{$$typeof:r,type:s,key:y,ref:S,props:u,_owner:w.current}}return Ai.Fragment=o,Ai.jsx=T,Ai.jsxs=T,Ai}var fd;function t_(){return fd||(fd=1,Gl.exports=e_()),Gl.exports}var c=t_(),Jo={},Xl={exports:{}},nn={},Ql={exports:{}},Jl={};/**
|
|
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 pd;function n_(){return pd||(pd=1,(function(n){function r(K,j){var W=K.length;K.push(j);e:for(;0<W;){var $=W-1>>>1,V=K[$];if(0<w(V,j))K[$]=j,K[W]=V,W=$;else break e}}function o(K){return K.length===0?null:K[0]}function m(K){if(K.length===0)return null;var j=K[0],W=K.pop();if(W!==j){K[0]=W;e:for(var $=0,V=K.length,J=V>>>1;$<J;){var re=2*($+1)-1,ie=K[re],he=re+1,Y=K[he];if(0>w(ie,W))he<V&&0>w(Y,ie)?(K[$]=Y,K[he]=W,$=he):(K[$]=ie,K[re]=W,$=re);else if(he<V&&0>w(Y,W))K[$]=Y,K[he]=W,$=he;else break e}}return j}function w(K,j){var W=K.sortIndex-j.sortIndex;return W!==0?W:K.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var A=performance;n.unstable_now=function(){return A.now()}}else{var T=Date,s=T.now();n.unstable_now=function(){return T.now()-s}}var l=[],p=[],v=1,u=null,y=3,S=!1,k=!1,g=!1,a=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(K){for(var j=o(p);j!==null;){if(j.callback===null)m(p);else if(j.startTime<=K)m(p),j.sortIndex=j.expirationTime,r(l,j);else break;j=o(p)}}function C(K){if(g=!1,h(K),!k)if(o(l)!==null)k=!0,X(D);else{var j=o(p);j!==null&&G(C,j.startTime-K)}}function D(K,j){k=!1,g&&(g=!1,f(b),b=-1),S=!0;var W=y;try{for(h(j),u=o(l);u!==null&&(!(u.expirationTime>j)||K&&!B());){var $=u.callback;if(typeof $=="function"){u.callback=null,y=u.priorityLevel;var V=$(u.expirationTime<=j);j=n.unstable_now(),typeof V=="function"?u.callback=V:u===o(l)&&m(l),h(j)}else m(l);u=o(l)}if(u!==null)var J=!0;else{var re=o(p);re!==null&&G(C,re.startTime-j),J=!1}return J}finally{u=null,y=W,S=!1}}var x=!1,M=null,b=-1,L=5,N=-1;function B(){return!(n.unstable_now()-N<L)}function P(){if(M!==null){var K=n.unstable_now();N=K;var j=!0;try{j=M(!0,K)}finally{j?F():(x=!1,M=null)}}else x=!1}var F;if(typeof d=="function")F=function(){d(P)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,q=H.port2;H.port1.onmessage=P,F=function(){q.postMessage(null)}}else F=function(){a(P,0)};function X(K){M=K,x||(x=!0,F())}function G(K,j){b=a(function(){K(n.unstable_now())},j)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(K){K.callback=null},n.unstable_continueExecution=function(){k||S||(k=!0,X(D))},n.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<K?Math.floor(1e3/K):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_getFirstCallbackNode=function(){return o(l)},n.unstable_next=function(K){switch(y){case 1:case 2:case 3:var j=3;break;default:j=y}var W=y;y=j;try{return K()}finally{y=W}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(K,j){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var W=y;y=K;try{return j()}finally{y=W}},n.unstable_scheduleCallback=function(K,j,W){var $=n.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?$+W:$):W=$,K){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=W+V,K={id:v++,callback:j,priorityLevel:K,startTime:W,expirationTime:V,sortIndex:-1},W>$?(K.sortIndex=W,r(p,K),o(l)===null&&K===o(p)&&(g?(f(b),b=-1):g=!0,G(C,W-$))):(K.sortIndex=V,r(l,K),k||S||(k=!0,X(D))),K},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(K){var j=y;return function(){var W=y;y=j;try{return K.apply(this,arguments)}finally{y=W}}}})(Jl)),Jl}var md;function r_(){return md||(md=1,Ql.exports=n_()),Ql.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 gd;function s_(){if(gd)return nn;gd=1;var n=Uc(),r=r_();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var m=new Set,w={};function A(e,t){T(e,t),T(e+"Capture",t)}function T(e,t){for(w[e]=t,e=0;e<t.length;e++)m.add(t[e])}var s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),l=Object.prototype.hasOwnProperty,p=/^[: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]*$/,v={},u={};function y(e){return l.call(u,e)?!0:l.call(v,e)?!1:p.test(e)?u[e]=!0:(v[e]=!0,!1)}function S(e,t,i,_){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return _?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function k(e,t,i,_){if(t===null||typeof t>"u"||S(e,t,i,_))return!0;if(_)return!1;if(i!==null)switch(i.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,i,_,R,I,z){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=_,this.attributeNamespace=R,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=I,this.removeEmptyString=z}var a={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){a[e]=new g(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];a[t]=new g(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){a[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){a[e]=new g(e,2,!1,e,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(e){a[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){a[e]=new g(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){a[e]=new g(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){a[e]=new g(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){a[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var f=/[\-:]([a-z])/g;function d(e){return e[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(e){var t=e.replace(f,d);a[t]=new g(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(f,d);a[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(f,d);a[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){a[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),a.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){a[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function h(e,t,i,_){var R=a.hasOwnProperty(t)?a[t]:null;(R!==null?R.type!==0:_||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(k(t,i,R,_)&&(i=null),_||R===null?y(t)&&(i===null?e.removeAttribute(t):e.setAttribute(t,""+i)):R.mustUseProperty?e[R.propertyName]=i===null?R.type===3?!1:"":i:(t=R.attributeName,_=R.attributeNamespace,i===null?e.removeAttribute(t):(R=R.type,i=R===3||R===4&&i===!0?"":""+i,_?e.setAttributeNS(_,t,i):e.setAttribute(t,i))))}var C=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),x=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),B=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),G=Symbol.for("react.offscreen"),K=Symbol.iterator;function j(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var W=Object.assign,$;function V(e){if($===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);$=t&&t[1]||""}return`
|
|
34
|
-
`+$+e}var J=!1;function re(e,t){if(!e||J)return"";J=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(ue){var _=ue}Reflect.construct(e,[],t)}else{try{t.call()}catch(ue){_=ue}e.call(t.prototype)}else{try{throw Error()}catch(ue){_=ue}e()}}catch(ue){if(ue&&_&&typeof ue.stack=="string"){for(var R=ue.stack.split(`
|
|
35
|
-
`),I=_.stack.split(`
|
|
36
|
-
`),z=R.length-1,Q=I.length-1;1<=z&&0<=Q&&R[z]!==I[Q];)Q--;for(;1<=z&&0<=Q;z--,Q--)if(R[z]!==I[Q]){if(z!==1||Q!==1)do if(z--,Q--,0>Q||R[z]!==I[Q]){var te=`
|
|
37
|
-
`+R[z].replace(" at new "," at ");return e.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",e.displayName)),te}while(1<=z&&0<=Q);break}}}finally{J=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?V(e):""}function ie(e){switch(e.tag){case 5:return V(e.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return""}}function he(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case M:return"Fragment";case x:return"Portal";case L:return"Profiler";case b:return"StrictMode";case F:return"Suspense";case H:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case B:return(e.displayName||"Context")+".Consumer";case N:return(e._context.displayName||"Context")+".Provider";case P:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q:return t=e.displayName||null,t!==null?t:he(e.type)||"Memo";case X:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}function Y(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(t);case 8:return t===b?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function U(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Z(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ee(e){var t=Z(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),_=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var R=i.get,I=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return R.call(this)},set:function(z){_=""+z,I.call(this,z)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return _},setValue:function(z){_=""+z},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pe(e){e._valueTracker||(e._valueTracker=ee(e))}function ne(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),_="";return e&&(_=Z(e)?e.checked?"true":"false":e.value),e=_,e!==i?(t.setValue(e),!0):!1}function Ee(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function xe(e,t){var i=t.checked;return W({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function ce(e,t){var i=t.defaultValue==null?"":t.defaultValue,_=t.checked!=null?t.checked:t.defaultChecked;i=U(t.value!=null?t.value:i),e._wrapperState={initialChecked:_,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Se(e,t){t=t.checked,t!=null&&h(e,"checked",t,!1)}function me(e,t){Se(e,t);var i=U(t.value),_=t.type;if(i!=null)_==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(_==="submit"||_==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?qe(e,t.type,i):t.hasOwnProperty("defaultValue")&&qe(e,t.type,U(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ze(e,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var _=t.type;if(!(_!=="submit"&&_!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,i||t===e.value||(e.value=t),e.defaultValue=t}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function qe(e,t,i){(t!=="number"||Ee(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var ve=Array.isArray;function Re(e,t,i,_){if(e=e.options,t){t={};for(var R=0;R<i.length;R++)t["$"+i[R]]=!0;for(i=0;i<e.length;i++)R=t.hasOwnProperty("$"+e[i].value),e[i].selected!==R&&(e[i].selected=R),R&&_&&(e[i].defaultSelected=!0)}else{for(i=""+U(i),t=null,R=0;R<e.length;R++){if(e[R].value===i){e[R].selected=!0,_&&(e[R].defaultSelected=!0);return}t!==null||e[R].disabled||(t=e[R])}t!==null&&(t.selected=!0)}}function Ie(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(o(91));return W({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ke(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(o(92));if(ve(i)){if(1<i.length)throw Error(o(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:U(i)}}function Fe(e,t){var i=U(t.value),_=U(t.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),t.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),_!=null&&(e.defaultValue=""+_)}function $e(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tt(e){switch(e){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 St(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tt(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ke,gt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,i,_,R){MSApp.execUnsafeLocalFunction(function(){return e(t,i,_,R)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ke=Ke||document.createElement("div"),Ke.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ke.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nt(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var ze={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},Ge=["Webkit","ms","Moz","O"];Object.keys(ze).forEach(function(e){Ge.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ze[t]=ze[e]})});function Et(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||ze.hasOwnProperty(e)&&ze[e]?(""+t).trim():t+"px"}function Ct(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var _=i.indexOf("--")===0,R=Et(i,t[i],_);i==="float"&&(i="cssFloat"),_?e.setProperty(i,R):e[i]=R}}var Le=W({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 Ve(e,t){if(t){if(Le[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(o(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(o(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(t.style!=null&&typeof t.style!="object")throw Error(o(62))}}function de(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fe=null;function Te(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ot=null,Pe=null,Ye=null;function lt(e){if(e=gi(e)){if(typeof ot!="function")throw Error(o(280));var t=e.stateNode;t&&(t=fo(t),ot(e.stateNode,e.type,t))}}function Lt(e){Pe?Ye?Ye.push(e):Ye=[e]:Pe=e}function At(){if(Pe){var e=Pe,t=Ye;if(Ye=Pe=null,lt(e),t)for(e=0;e<t.length;e++)lt(t[e])}}function Kn(e,t){return e(t)}function ns(){}var Tn=!1;function Bn(e,t,i){if(Tn)return e(t,i);Tn=!0;try{return Kn(e,t,i)}finally{Tn=!1,(Pe!==null||Ye!==null)&&(ns(),At())}}function kr(e,t){var i=e.stateNode;if(i===null)return null;var _=fo(i);if(_===null)return null;i=_[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(_=!_.disabled)||(e=e.type,_=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!_;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(o(231,t,typeof i));return i}var qs=!1;if(s)try{var Er={};Object.defineProperty(Er,"passive",{get:function(){qs=!0}}),window.addEventListener("test",Er,Er),window.removeEventListener("test",Er,Er)}catch{qs=!1}function qi(e,t,i,_,R,I,z,Q,te){var ue=Array.prototype.slice.call(arguments,3);try{t.apply(i,ue)}catch(_e){this.onError(_e)}}var Lr=!1,Tr=null,Rr=!1,Mr=null,ga={onError:function(e){Lr=!0,Tr=e}};function Ki(e,t,i,_,R,I,z,Q,te){Lr=!1,Tr=null,qi.apply(ga,arguments)}function _a(e,t,i,_,R,I,z,Q,te){if(Ki.apply(this,arguments),Lr){if(Lr){var ue=Tr;Lr=!1,Tr=null}else throw Error(o(198));Rr||(Rr=!0,Mr=ue)}}function un(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function Gi(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ks(e){if(un(e)!==e)throw Error(o(188))}function va(e){var t=e.alternate;if(!t){if(t=un(e),t===null)throw Error(o(188));return t!==e?null:e}for(var i=e,_=t;;){var R=i.return;if(R===null)break;var I=R.alternate;if(I===null){if(_=R.return,_!==null){i=_;continue}break}if(R.child===I.child){for(I=R.child;I;){if(I===i)return Ks(R),e;if(I===_)return Ks(R),t;I=I.sibling}throw Error(o(188))}if(i.return!==_.return)i=R,_=I;else{for(var z=!1,Q=R.child;Q;){if(Q===i){z=!0,i=R,_=I;break}if(Q===_){z=!0,_=R,i=I;break}Q=Q.sibling}if(!z){for(Q=I.child;Q;){if(Q===i){z=!0,i=I,_=R;break}if(Q===_){z=!0,_=I,i=R;break}Q=Q.sibling}if(!z)throw Error(o(189))}}if(i.alternate!==_)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?e:t}function Yi(e){return e=va(e),e!==null?Xi(e):null}function Xi(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Xi(e);if(t!==null)return t;e=e.sibling}return null}var Qi=r.unstable_scheduleCallback,rs=r.unstable_cancelCallback,ya=r.unstable_shouldYield,Gs=r.unstable_requestPaint,ht=r.unstable_now,Gn=r.unstable_getCurrentPriorityLevel,Yn=r.unstable_ImmediatePriority,Ar=r.unstable_UserBlockingPriority,vn=r.unstable_NormalPriority,Ys=r.unstable_LowPriority,sn=r.unstable_IdlePriority,ss=null,on=null;function Xn(e){if(on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(ss,e,void 0,(e.current.flags&128)===128)}catch{}}var Ft=Math.clz32?Math.clz32:Ji,wa=Math.log,Kt=Math.LN2;function Ji(e){return e>>>=0,e===0?32:31-(wa(e)/Kt|0)|0}var is=64,Nr=4194304;function Dr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ir(e,t){var i=e.pendingLanes;if(i===0)return 0;var _=0,R=e.suspendedLanes,I=e.pingedLanes,z=i&268435455;if(z!==0){var Q=z&~R;Q!==0?_=Dr(Q):(I&=z,I!==0&&(_=Dr(I)))}else z=i&~R,z!==0?_=Dr(z):I!==0&&(_=Dr(I));if(_===0)return 0;if(t!==0&&t!==_&&(t&R)===0&&(R=_&-_,I=t&-t,R>=I||R===16&&(I&4194240)!==0))return t;if((_&4)!==0&&(_|=i&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=_;0<t;)i=31-Ft(t),R=1<<i,_|=e[i],t&=~R;return _}function Xs(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 ba(e,t){for(var i=e.suspendedLanes,_=e.pingedLanes,R=e.expirationTimes,I=e.pendingLanes;0<I;){var z=31-Ft(I),Q=1<<z,te=R[z];te===-1?((Q&i)===0||(Q&_)!==0)&&(R[z]=Xs(Q,t)):te<=t&&(e.expiredLanes|=Q),I&=~Q}}function os(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Qs(){var e=is;return is<<=1,(is&4194240)===0&&(is=64),e}function as(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Qn(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ft(t),e[t]=i}function Sa(e,t){var i=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var _=e.eventTimes;for(e=e.expirationTimes;0<i;){var R=31-Ft(i),I=1<<R;t[R]=0,_[R]=-1,e[R]=-1,i&=~I}}function Js(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var _=31-Ft(i),R=1<<_;R&t|e[_]&t&&(e[_]|=t),i&=~R}}var st=0;function Zs(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var ei,Pr,ls,Zi,eo,ti=!1,jr=[],Pt=null,Rn=null,Xt=null,Jn=new Map,Zn=new Map,yn=[],Ca="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 to(e,t){switch(e){case"focusin":case"focusout":Pt=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Xt=null;break;case"pointerover":case"pointerout":Jn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zn.delete(t.pointerId)}}function Or(e,t,i,_,R,I){return e===null||e.nativeEvent!==I?(e={blockedOn:t,domEventName:i,eventSystemFlags:_,nativeEvent:I,targetContainers:[R]},t!==null&&(t=gi(t),t!==null&&Pr(t)),e):(e.eventSystemFlags|=_,t=e.targetContainers,R!==null&&t.indexOf(R)===-1&&t.push(R),e)}function cs(e,t,i,_,R){switch(t){case"focusin":return Pt=Or(Pt,e,t,i,_,R),!0;case"dragenter":return Rn=Or(Rn,e,t,i,_,R),!0;case"mouseover":return Xt=Or(Xt,e,t,i,_,R),!0;case"pointerover":var I=R.pointerId;return Jn.set(I,Or(Jn.get(I)||null,e,t,i,_,R)),!0;case"gotpointercapture":return I=R.pointerId,Zn.set(I,Or(Zn.get(I)||null,e,t,i,_,R)),!0}return!1}function no(e){var t=Wr(e.target);if(t!==null){var i=un(t);if(i!==null){if(t=i.tag,t===13){if(t=Gi(i),t!==null){e.blockedOn=t,eo(e.priority,function(){ls(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function us(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=ds(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var _=new i.constructor(i.type,i);fe=_,i.target.dispatchEvent(_),fe=null}else return t=gi(i),t!==null&&Pr(t),e.blockedOn=i,!1;t.shift()}return!0}function ro(e,t,i){us(e)&&i.delete(t)}function er(){ti=!1,Pt!==null&&us(Pt)&&(Pt=null),Rn!==null&&us(Rn)&&(Rn=null),Xt!==null&&us(Xt)&&(Xt=null),Jn.forEach(ro),Zn.forEach(ro)}function Br(e,t){e.blockedOn===t&&(e.blockedOn=null,ti||(ti=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,er)))}function tr(e){function t(R){return Br(R,e)}if(0<jr.length){Br(jr[0],e);for(var i=1;i<jr.length;i++){var _=jr[i];_.blockedOn===e&&(_.blockedOn=null)}}for(Pt!==null&&Br(Pt,e),Rn!==null&&Br(Rn,e),Xt!==null&&Br(Xt,e),Jn.forEach(t),Zn.forEach(t),i=0;i<yn.length;i++)_=yn[i],_.blockedOn===e&&(_.blockedOn=null);for(;0<yn.length&&(i=yn[0],i.blockedOn===null);)no(i),i.blockedOn===null&&yn.shift()}var nr=C.ReactCurrentBatchConfig,hs=!0;function xa(e,t,i,_){var R=st,I=nr.transition;nr.transition=null;try{st=1,ni(e,t,i,_)}finally{st=R,nr.transition=I}}function ka(e,t,i,_){var R=st,I=nr.transition;nr.transition=null;try{st=4,ni(e,t,i,_)}finally{st=R,nr.transition=I}}function ni(e,t,i,_){if(hs){var R=ds(e,t,i,_);if(R===null)Ba(e,t,_,rr,i),to(e,_);else if(cs(R,e,t,i,_))_.stopPropagation();else if(to(e,_),t&4&&-1<Ca.indexOf(e)){for(;R!==null;){var I=gi(R);if(I!==null&&ei(I),I=ds(e,t,i,_),I===null&&Ba(e,t,_,rr,i),I===R)break;R=I}R!==null&&_.stopPropagation()}else Ba(e,t,_,null,i)}}var rr=null;function ds(e,t,i,_){if(rr=null,e=Te(_),e=Wr(e),e!==null)if(t=un(e),t===null)e=null;else if(i=t.tag,i===13){if(e=Gi(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return rr=e,null}function fs(e){switch(e){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(Gn()){case Yn:return 1;case Ar:return 4;case vn:case Ys:return 16;case sn:return 536870912;default:return 16}default:return 16}}var wn=null,ri=null,Fr=null;function si(){if(Fr)return Fr;var e,t=ri,i=t.length,_,R="value"in wn?wn.value:wn.textContent,I=R.length;for(e=0;e<i&&t[e]===R[e];e++);var z=i-e;for(_=1;_<=z&&t[i-_]===R[I-_];_++);return Fr=R.slice(e,1<_?1-_:void 0)}function Hr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function $r(){return!0}function ii(){return!1}function Ht(e){function t(i,_,R,I,z){this._reactName=i,this._targetInst=R,this.type=_,this.nativeEvent=I,this.target=z,this.currentTarget=null;for(var Q in e)e.hasOwnProperty(Q)&&(i=e[Q],this[Q]=i?i(I):I[Q]);return this.isDefaultPrevented=(I.defaultPrevented!=null?I.defaultPrevented:I.returnValue===!1)?$r:ii,this.isPropagationStopped=ii,this}return W(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=$r)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=$r)},persist:function(){},isPersistent:$r}),t}var sr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ps=Ht(sr),ir=W({},sr,{view:0,detail:0}),so=Ht(ir),ms,gs,ae,we=W({},ir,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:La,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ae&&(ae&&e.type==="mousemove"?(ms=e.screenX-ae.screenX,gs=e.screenY-ae.screenY):gs=ms=0,ae=e),ms)},movementY:function(e){return"movementY"in e?e.movementY:gs}}),Je=Ht(we),Ur=W({},we,{dataTransfer:0}),oi=Ht(Ur),Em=W({},ir,{relatedTarget:0}),Ea=Ht(Em),Lm=W({},sr,{animationName:0,elapsedTime:0,pseudoElement:0}),Tm=Ht(Lm),Rm=W({},sr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mm=Ht(Rm),Am=W({},sr,{data:0}),eu=Ht(Am),Nm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dm={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"},Im={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Im[e])?!!t[e]:!1}function La(){return Pm}var jm=W({},ir,{key:function(e){if(e.key){var t=Nm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Dm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:La,charCode:function(e){return e.type==="keypress"?Hr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Om=Ht(jm),Bm=W({},we,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tu=Ht(Bm),Fm=W({},ir,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:La}),Hm=Ht(Fm),$m=W({},sr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Um=Ht($m),Wm=W({},we,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),zm=Ht(Wm),Vm=[9,13,27,32],Ta=s&&"CompositionEvent"in window,ai=null;s&&"documentMode"in document&&(ai=document.documentMode);var qm=s&&"TextEvent"in window&&!ai,nu=s&&(!Ta||ai&&8<ai&&11>=ai),ru=" ",su=!1;function iu(e,t){switch(e){case"keyup":return Vm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ou(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _s=!1;function Km(e,t){switch(e){case"compositionend":return ou(t);case"keypress":return t.which!==32?null:(su=!0,ru);case"textInput":return e=t.data,e===ru&&su?null:e;default:return null}}function Gm(e,t){if(_s)return e==="compositionend"||!Ta&&iu(e,t)?(e=si(),Fr=ri=wn=null,_s=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return nu&&t.locale!=="ko"?null:t.data;default:return null}}var Ym={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 au(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ym[e.type]:t==="textarea"}function lu(e,t,i,_){Lt(_),t=co(t,"onChange"),0<t.length&&(i=new ps("onChange","change",null,i,_),e.push({event:i,listeners:t}))}var li=null,ci=null;function Xm(e){Eu(e,0)}function io(e){var t=Ss(e);if(ne(t))return e}function Qm(e,t){if(e==="change")return t}var cu=!1;if(s){var Ra;if(s){var Ma="oninput"in document;if(!Ma){var uu=document.createElement("div");uu.setAttribute("oninput","return;"),Ma=typeof uu.oninput=="function"}Ra=Ma}else Ra=!1;cu=Ra&&(!document.documentMode||9<document.documentMode)}function hu(){li&&(li.detachEvent("onpropertychange",du),ci=li=null)}function du(e){if(e.propertyName==="value"&&io(ci)){var t=[];lu(t,ci,e,Te(e)),Bn(Xm,t)}}function Jm(e,t,i){e==="focusin"?(hu(),li=t,ci=i,li.attachEvent("onpropertychange",du)):e==="focusout"&&hu()}function Zm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return io(ci)}function eg(e,t){if(e==="click")return io(t)}function tg(e,t){if(e==="input"||e==="change")return io(t)}function ng(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bn=typeof Object.is=="function"?Object.is:ng;function ui(e,t){if(bn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),_=Object.keys(t);if(i.length!==_.length)return!1;for(_=0;_<i.length;_++){var R=i[_];if(!l.call(t,R)||!bn(e[R],t[R]))return!1}return!0}function fu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pu(e,t){var i=fu(e);e=0;for(var _;i;){if(i.nodeType===3){if(_=e+i.textContent.length,e<=t&&_>=t)return{node:i,offset:t-e};e=_}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=fu(i)}}function mu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gu(){for(var e=window,t=Ee();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Ee(e.document)}return t}function Aa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function rg(e){var t=gu(),i=e.focusedElem,_=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&mu(i.ownerDocument.documentElement,i)){if(_!==null&&Aa(i)){if(t=_.start,e=_.end,e===void 0&&(e=t),"selectionStart"in i)i.selectionStart=t,i.selectionEnd=Math.min(e,i.value.length);else if(e=(t=i.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var R=i.textContent.length,I=Math.min(_.start,R);_=_.end===void 0?I:Math.min(_.end,R),!e.extend&&I>_&&(R=_,_=I,I=R),R=pu(i,I);var z=pu(i,_);R&&z&&(e.rangeCount!==1||e.anchorNode!==R.node||e.anchorOffset!==R.offset||e.focusNode!==z.node||e.focusOffset!==z.offset)&&(t=t.createRange(),t.setStart(R.node,R.offset),e.removeAllRanges(),I>_?(e.addRange(t),e.extend(z.node,z.offset)):(t.setEnd(z.node,z.offset),e.addRange(t)))}}for(t=[],e=i;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<t.length;i++)e=t[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var sg=s&&"documentMode"in document&&11>=document.documentMode,vs=null,Na=null,hi=null,Da=!1;function _u(e,t,i){var _=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Da||vs==null||vs!==Ee(_)||(_=vs,"selectionStart"in _&&Aa(_)?_={start:_.selectionStart,end:_.selectionEnd}:(_=(_.ownerDocument&&_.ownerDocument.defaultView||window).getSelection(),_={anchorNode:_.anchorNode,anchorOffset:_.anchorOffset,focusNode:_.focusNode,focusOffset:_.focusOffset}),hi&&ui(hi,_)||(hi=_,_=co(Na,"onSelect"),0<_.length&&(t=new ps("onSelect","select",null,t,i),e.push({event:t,listeners:_}),t.target=vs)))}function oo(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var ys={animationend:oo("Animation","AnimationEnd"),animationiteration:oo("Animation","AnimationIteration"),animationstart:oo("Animation","AnimationStart"),transitionend:oo("Transition","TransitionEnd")},Ia={},vu={};s&&(vu=document.createElement("div").style,"AnimationEvent"in window||(delete ys.animationend.animation,delete ys.animationiteration.animation,delete ys.animationstart.animation),"TransitionEvent"in window||delete ys.transitionend.transition);function ao(e){if(Ia[e])return Ia[e];if(!ys[e])return e;var t=ys[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in vu)return Ia[e]=t[i];return e}var yu=ao("animationend"),wu=ao("animationiteration"),bu=ao("animationstart"),Su=ao("transitionend"),Cu=new Map,xu="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 or(e,t){Cu.set(e,t),A(t,[e])}for(var Pa=0;Pa<xu.length;Pa++){var ja=xu[Pa],ig=ja.toLowerCase(),og=ja[0].toUpperCase()+ja.slice(1);or(ig,"on"+og)}or(yu,"onAnimationEnd"),or(wu,"onAnimationIteration"),or(bu,"onAnimationStart"),or("dblclick","onDoubleClick"),or("focusin","onFocus"),or("focusout","onBlur"),or(Su,"onTransitionEnd"),T("onMouseEnter",["mouseout","mouseover"]),T("onMouseLeave",["mouseout","mouseover"]),T("onPointerEnter",["pointerout","pointerover"]),T("onPointerLeave",["pointerout","pointerover"]),A("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),A("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),A("onBeforeInput",["compositionend","keypress","textInput","paste"]),A("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),A("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),A("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var di="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(" "),ag=new Set("cancel close invalid load scroll toggle".split(" ").concat(di));function ku(e,t,i){var _=e.type||"unknown-event";e.currentTarget=i,_a(_,t,void 0,e),e.currentTarget=null}function Eu(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var _=e[i],R=_.event;_=_.listeners;e:{var I=void 0;if(t)for(var z=_.length-1;0<=z;z--){var Q=_[z],te=Q.instance,ue=Q.currentTarget;if(Q=Q.listener,te!==I&&R.isPropagationStopped())break e;ku(R,Q,ue),I=te}else for(z=0;z<_.length;z++){if(Q=_[z],te=Q.instance,ue=Q.currentTarget,Q=Q.listener,te!==I&&R.isPropagationStopped())break e;ku(R,Q,ue),I=te}}}if(Rr)throw e=Mr,Rr=!1,Mr=null,e}function dt(e,t){var i=t[za];i===void 0&&(i=t[za]=new Set);var _=e+"__bubble";i.has(_)||(Lu(t,e,2,!1),i.add(_))}function Oa(e,t,i){var _=0;t&&(_|=4),Lu(i,e,_,t)}var lo="_reactListening"+Math.random().toString(36).slice(2);function fi(e){if(!e[lo]){e[lo]=!0,m.forEach(function(i){i!=="selectionchange"&&(ag.has(i)||Oa(i,!1,e),Oa(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[lo]||(t[lo]=!0,Oa("selectionchange",!1,t))}}function Lu(e,t,i,_){switch(fs(t)){case 1:var R=xa;break;case 4:R=ka;break;default:R=ni}i=R.bind(null,t,i,e),R=void 0,!qs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(R=!0),_?R!==void 0?e.addEventListener(t,i,{capture:!0,passive:R}):e.addEventListener(t,i,!0):R!==void 0?e.addEventListener(t,i,{passive:R}):e.addEventListener(t,i,!1)}function Ba(e,t,i,_,R){var I=_;if((t&1)===0&&(t&2)===0&&_!==null)e:for(;;){if(_===null)return;var z=_.tag;if(z===3||z===4){var Q=_.stateNode.containerInfo;if(Q===R||Q.nodeType===8&&Q.parentNode===R)break;if(z===4)for(z=_.return;z!==null;){var te=z.tag;if((te===3||te===4)&&(te=z.stateNode.containerInfo,te===R||te.nodeType===8&&te.parentNode===R))return;z=z.return}for(;Q!==null;){if(z=Wr(Q),z===null)return;if(te=z.tag,te===5||te===6){_=I=z;continue e}Q=Q.parentNode}}_=_.return}Bn(function(){var ue=I,_e=Te(i),ye=[];e:{var ge=Cu.get(e);if(ge!==void 0){var Me=ps,De=e;switch(e){case"keypress":if(Hr(i)===0)break e;case"keydown":case"keyup":Me=Om;break;case"focusin":De="focus",Me=Ea;break;case"focusout":De="blur",Me=Ea;break;case"beforeblur":case"afterblur":Me=Ea;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Me=Je;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Me=oi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Me=Hm;break;case yu:case wu:case bu:Me=Tm;break;case Su:Me=Um;break;case"scroll":Me=so;break;case"wheel":Me=zm;break;case"copy":case"cut":case"paste":Me=Mm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Me=tu}var je=(t&4)!==0,bt=!je&&e==="scroll",oe=je?ge!==null?ge+"Capture":null:ge;je=[];for(var se=ue,le;se!==null;){le=se;var Ce=le.stateNode;if(le.tag===5&&Ce!==null&&(le=Ce,oe!==null&&(Ce=kr(se,oe),Ce!=null&&je.push(pi(se,Ce,le)))),bt)break;se=se.return}0<je.length&&(ge=new Me(ge,De,null,i,_e),ye.push({event:ge,listeners:je}))}}if((t&7)===0){e:{if(ge=e==="mouseover"||e==="pointerover",Me=e==="mouseout"||e==="pointerout",ge&&i!==fe&&(De=i.relatedTarget||i.fromElement)&&(Wr(De)||De[Fn]))break e;if((Me||ge)&&(ge=_e.window===_e?_e:(ge=_e.ownerDocument)?ge.defaultView||ge.parentWindow:window,Me?(De=i.relatedTarget||i.toElement,Me=ue,De=De?Wr(De):null,De!==null&&(bt=un(De),De!==bt||De.tag!==5&&De.tag!==6)&&(De=null)):(Me=null,De=ue),Me!==De)){if(je=Je,Ce="onMouseLeave",oe="onMouseEnter",se="mouse",(e==="pointerout"||e==="pointerover")&&(je=tu,Ce="onPointerLeave",oe="onPointerEnter",se="pointer"),bt=Me==null?ge:Ss(Me),le=De==null?ge:Ss(De),ge=new je(Ce,se+"leave",Me,i,_e),ge.target=bt,ge.relatedTarget=le,Ce=null,Wr(_e)===ue&&(je=new je(oe,se+"enter",De,i,_e),je.target=le,je.relatedTarget=bt,Ce=je),bt=Ce,Me&&De)t:{for(je=Me,oe=De,se=0,le=je;le;le=ws(le))se++;for(le=0,Ce=oe;Ce;Ce=ws(Ce))le++;for(;0<se-le;)je=ws(je),se--;for(;0<le-se;)oe=ws(oe),le--;for(;se--;){if(je===oe||oe!==null&&je===oe.alternate)break t;je=ws(je),oe=ws(oe)}je=null}else je=null;Me!==null&&Tu(ye,ge,Me,je,!1),De!==null&&bt!==null&&Tu(ye,bt,De,je,!0)}}e:{if(ge=ue?Ss(ue):window,Me=ge.nodeName&&ge.nodeName.toLowerCase(),Me==="select"||Me==="input"&&ge.type==="file")var Oe=Qm;else if(au(ge))if(cu)Oe=tg;else{Oe=Zm;var Ue=Jm}else(Me=ge.nodeName)&&Me.toLowerCase()==="input"&&(ge.type==="checkbox"||ge.type==="radio")&&(Oe=eg);if(Oe&&(Oe=Oe(e,ue))){lu(ye,Oe,i,_e);break e}Ue&&Ue(e,ge,ue),e==="focusout"&&(Ue=ge._wrapperState)&&Ue.controlled&&ge.type==="number"&&qe(ge,"number",ge.value)}switch(Ue=ue?Ss(ue):window,e){case"focusin":(au(Ue)||Ue.contentEditable==="true")&&(vs=Ue,Na=ue,hi=null);break;case"focusout":hi=Na=vs=null;break;case"mousedown":Da=!0;break;case"contextmenu":case"mouseup":case"dragend":Da=!1,_u(ye,i,_e);break;case"selectionchange":if(sg)break;case"keydown":case"keyup":_u(ye,i,_e)}var We;if(Ta)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else _s?iu(e,i)&&(Xe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Xe="onCompositionStart");Xe&&(nu&&i.locale!=="ko"&&(_s||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&_s&&(We=si()):(wn=_e,ri="value"in wn?wn.value:wn.textContent,_s=!0)),Ue=co(ue,Xe),0<Ue.length&&(Xe=new eu(Xe,e,null,i,_e),ye.push({event:Xe,listeners:Ue}),We?Xe.data=We:(We=ou(i),We!==null&&(Xe.data=We)))),(We=qm?Km(e,i):Gm(e,i))&&(ue=co(ue,"onBeforeInput"),0<ue.length&&(_e=new eu("onBeforeInput","beforeinput",null,i,_e),ye.push({event:_e,listeners:ue}),_e.data=We))}Eu(ye,t)})}function pi(e,t,i){return{instance:e,listener:t,currentTarget:i}}function co(e,t){for(var i=t+"Capture",_=[];e!==null;){var R=e,I=R.stateNode;R.tag===5&&I!==null&&(R=I,I=kr(e,i),I!=null&&_.unshift(pi(e,I,R)),I=kr(e,t),I!=null&&_.push(pi(e,I,R))),e=e.return}return _}function ws(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Tu(e,t,i,_,R){for(var I=t._reactName,z=[];i!==null&&i!==_;){var Q=i,te=Q.alternate,ue=Q.stateNode;if(te!==null&&te===_)break;Q.tag===5&&ue!==null&&(Q=ue,R?(te=kr(i,I),te!=null&&z.unshift(pi(i,te,Q))):R||(te=kr(i,I),te!=null&&z.push(pi(i,te,Q)))),i=i.return}z.length!==0&&e.push({event:t,listeners:z})}var lg=/\r\n?/g,cg=/\u0000|\uFFFD/g;function Ru(e){return(typeof e=="string"?e:""+e).replace(lg,`
|
|
38
|
-
`).replace(cg,"")}function uo(e,t,i){if(t=Ru(t),Ru(e)!==t&&i)throw Error(o(425))}function ho(){}var Fa=null,Ha=null;function $a(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ua=typeof setTimeout=="function"?setTimeout:void 0,ug=typeof clearTimeout=="function"?clearTimeout:void 0,Mu=typeof Promise=="function"?Promise:void 0,hg=typeof queueMicrotask=="function"?queueMicrotask:typeof Mu<"u"?function(e){return Mu.resolve(null).then(e).catch(dg)}:Ua;function dg(e){setTimeout(function(){throw e})}function Wa(e,t){var i=t,_=0;do{var R=i.nextSibling;if(e.removeChild(i),R&&R.nodeType===8)if(i=R.data,i==="/$"){if(_===0){e.removeChild(R),tr(t);return}_--}else i!=="$"&&i!=="$?"&&i!=="$!"||_++;i=R}while(i);tr(t)}function ar(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Au(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return e;t--}else i==="/$"&&t++}e=e.previousSibling}return null}var bs=Math.random().toString(36).slice(2),Mn="__reactFiber$"+bs,mi="__reactProps$"+bs,Fn="__reactContainer$"+bs,za="__reactEvents$"+bs,fg="__reactListeners$"+bs,pg="__reactHandles$"+bs;function Wr(e){var t=e[Mn];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Fn]||i[Mn]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Au(e);e!==null;){if(i=e[Mn])return i;e=Au(e)}return t}e=i,i=e.parentNode}return null}function gi(e){return e=e[Mn]||e[Fn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ss(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function fo(e){return e[mi]||null}var Va=[],Cs=-1;function lr(e){return{current:e}}function ft(e){0>Cs||(e.current=Va[Cs],Va[Cs]=null,Cs--)}function ct(e,t){Cs++,Va[Cs]=e.current,e.current=t}var cr={},$t=lr(cr),Qt=lr(!1),zr=cr;function xs(e,t){var i=e.type.contextTypes;if(!i)return cr;var _=e.stateNode;if(_&&_.__reactInternalMemoizedUnmaskedChildContext===t)return _.__reactInternalMemoizedMaskedChildContext;var R={},I;for(I in i)R[I]=t[I];return _&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=R),R}function Jt(e){return e=e.childContextTypes,e!=null}function po(){ft(Qt),ft($t)}function Nu(e,t,i){if($t.current!==cr)throw Error(o(168));ct($t,t),ct(Qt,i)}function Du(e,t,i){var _=e.stateNode;if(t=t.childContextTypes,typeof _.getChildContext!="function")return i;_=_.getChildContext();for(var R in _)if(!(R in t))throw Error(o(108,Y(e)||"Unknown",R));return W({},i,_)}function mo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||cr,zr=$t.current,ct($t,e),ct(Qt,Qt.current),!0}function Iu(e,t,i){var _=e.stateNode;if(!_)throw Error(o(169));i?(e=Du(e,t,zr),_.__reactInternalMemoizedMergedChildContext=e,ft(Qt),ft($t),ct($t,e)):ft(Qt),ct(Qt,i)}var Hn=null,go=!1,qa=!1;function Pu(e){Hn===null?Hn=[e]:Hn.push(e)}function mg(e){go=!0,Pu(e)}function ur(){if(!qa&&Hn!==null){qa=!0;var e=0,t=st;try{var i=Hn;for(st=1;e<i.length;e++){var _=i[e];do _=_(!0);while(_!==null)}Hn=null,go=!1}catch(R){throw Hn!==null&&(Hn=Hn.slice(e+1)),Qi(Yn,ur),R}finally{st=t,qa=!1}}return null}var ks=[],Es=0,_o=null,vo=0,hn=[],dn=0,Vr=null,$n=1,Un="";function qr(e,t){ks[Es++]=vo,ks[Es++]=_o,_o=e,vo=t}function ju(e,t,i){hn[dn++]=$n,hn[dn++]=Un,hn[dn++]=Vr,Vr=e;var _=$n;e=Un;var R=32-Ft(_)-1;_&=~(1<<R),i+=1;var I=32-Ft(t)+R;if(30<I){var z=R-R%5;I=(_&(1<<z)-1).toString(32),_>>=z,R-=z,$n=1<<32-Ft(t)+R|i<<R|_,Un=I+e}else $n=1<<I|i<<R|_,Un=e}function Ka(e){e.return!==null&&(qr(e,1),ju(e,1,0))}function Ga(e){for(;e===_o;)_o=ks[--Es],ks[Es]=null,vo=ks[--Es],ks[Es]=null;for(;e===Vr;)Vr=hn[--dn],hn[dn]=null,Un=hn[--dn],hn[dn]=null,$n=hn[--dn],hn[dn]=null}var an=null,ln=null,mt=!1,Sn=null;function Ou(e,t){var i=gn(5,null,null,0);i.elementType="DELETED",i.stateNode=t,i.return=e,t=e.deletions,t===null?(e.deletions=[i],e.flags|=16):t.push(i)}function Bu(e,t){switch(e.tag){case 5:var i=e.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,an=e,ln=ar(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,an=e,ln=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=Vr!==null?{id:$n,overflow:Un}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=gn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,an=e,ln=null,!0):!1;default:return!1}}function Ya(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xa(e){if(mt){var t=ln;if(t){var i=t;if(!Bu(e,t)){if(Ya(e))throw Error(o(418));t=ar(i.nextSibling);var _=an;t&&Bu(e,t)?Ou(_,i):(e.flags=e.flags&-4097|2,mt=!1,an=e)}}else{if(Ya(e))throw Error(o(418));e.flags=e.flags&-4097|2,mt=!1,an=e}}}function Fu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;an=e}function yo(e){if(e!==an)return!1;if(!mt)return Fu(e),mt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!$a(e.type,e.memoizedProps)),t&&(t=ln)){if(Ya(e))throw Hu(),Error(o(418));for(;t;)Ou(e,t),t=ar(t.nextSibling)}if(Fu(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(t===0){ln=ar(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}ln=null}}else ln=an?ar(e.stateNode.nextSibling):null;return!0}function Hu(){for(var e=ln;e;)e=ar(e.nextSibling)}function Ls(){ln=an=null,mt=!1}function Qa(e){Sn===null?Sn=[e]:Sn.push(e)}var gg=C.ReactCurrentBatchConfig;function _i(e,t,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(o(309));var _=i.stateNode}if(!_)throw Error(o(147,e));var R=_,I=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===I?t.ref:(t=function(z){var Q=R.refs;z===null?delete Q[I]:Q[I]=z},t._stringRef=I,t)}if(typeof e!="string")throw Error(o(284));if(!i._owner)throw Error(o(290,e))}return e}function wo(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function $u(e){var t=e._init;return t(e._payload)}function Uu(e){function t(oe,se){if(e){var le=oe.deletions;le===null?(oe.deletions=[se],oe.flags|=16):le.push(se)}}function i(oe,se){if(!e)return null;for(;se!==null;)t(oe,se),se=se.sibling;return null}function _(oe,se){for(oe=new Map;se!==null;)se.key!==null?oe.set(se.key,se):oe.set(se.index,se),se=se.sibling;return oe}function R(oe,se){return oe=vr(oe,se),oe.index=0,oe.sibling=null,oe}function I(oe,se,le){return oe.index=le,e?(le=oe.alternate,le!==null?(le=le.index,le<se?(oe.flags|=2,se):le):(oe.flags|=2,se)):(oe.flags|=1048576,se)}function z(oe){return e&&oe.alternate===null&&(oe.flags|=2),oe}function Q(oe,se,le,Ce){return se===null||se.tag!==6?(se=Ul(le,oe.mode,Ce),se.return=oe,se):(se=R(se,le),se.return=oe,se)}function te(oe,se,le,Ce){var Oe=le.type;return Oe===M?_e(oe,se,le.props.children,Ce,le.key):se!==null&&(se.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===X&&$u(Oe)===se.type)?(Ce=R(se,le.props),Ce.ref=_i(oe,se,le),Ce.return=oe,Ce):(Ce=zo(le.type,le.key,le.props,null,oe.mode,Ce),Ce.ref=_i(oe,se,le),Ce.return=oe,Ce)}function ue(oe,se,le,Ce){return se===null||se.tag!==4||se.stateNode.containerInfo!==le.containerInfo||se.stateNode.implementation!==le.implementation?(se=Wl(le,oe.mode,Ce),se.return=oe,se):(se=R(se,le.children||[]),se.return=oe,se)}function _e(oe,se,le,Ce,Oe){return se===null||se.tag!==7?(se=es(le,oe.mode,Ce,Oe),se.return=oe,se):(se=R(se,le),se.return=oe,se)}function ye(oe,se,le){if(typeof se=="string"&&se!==""||typeof se=="number")return se=Ul(""+se,oe.mode,le),se.return=oe,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case D:return le=zo(se.type,se.key,se.props,null,oe.mode,le),le.ref=_i(oe,null,se),le.return=oe,le;case x:return se=Wl(se,oe.mode,le),se.return=oe,se;case X:var Ce=se._init;return ye(oe,Ce(se._payload),le)}if(ve(se)||j(se))return se=es(se,oe.mode,le,null),se.return=oe,se;wo(oe,se)}return null}function ge(oe,se,le,Ce){var Oe=se!==null?se.key:null;if(typeof le=="string"&&le!==""||typeof le=="number")return Oe!==null?null:Q(oe,se,""+le,Ce);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case D:return le.key===Oe?te(oe,se,le,Ce):null;case x:return le.key===Oe?ue(oe,se,le,Ce):null;case X:return Oe=le._init,ge(oe,se,Oe(le._payload),Ce)}if(ve(le)||j(le))return Oe!==null?null:_e(oe,se,le,Ce,null);wo(oe,le)}return null}function Me(oe,se,le,Ce,Oe){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return oe=oe.get(le)||null,Q(se,oe,""+Ce,Oe);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case D:return oe=oe.get(Ce.key===null?le:Ce.key)||null,te(se,oe,Ce,Oe);case x:return oe=oe.get(Ce.key===null?le:Ce.key)||null,ue(se,oe,Ce,Oe);case X:var Ue=Ce._init;return Me(oe,se,le,Ue(Ce._payload),Oe)}if(ve(Ce)||j(Ce))return oe=oe.get(le)||null,_e(se,oe,Ce,Oe,null);wo(se,Ce)}return null}function De(oe,se,le,Ce){for(var Oe=null,Ue=null,We=se,Xe=se=0,It=null;We!==null&&Xe<le.length;Xe++){We.index>Xe?(It=We,We=null):It=We.sibling;var it=ge(oe,We,le[Xe],Ce);if(it===null){We===null&&(We=It);break}e&&We&&it.alternate===null&&t(oe,We),se=I(it,se,Xe),Ue===null?Oe=it:Ue.sibling=it,Ue=it,We=It}if(Xe===le.length)return i(oe,We),mt&&qr(oe,Xe),Oe;if(We===null){for(;Xe<le.length;Xe++)We=ye(oe,le[Xe],Ce),We!==null&&(se=I(We,se,Xe),Ue===null?Oe=We:Ue.sibling=We,Ue=We);return mt&&qr(oe,Xe),Oe}for(We=_(oe,We);Xe<le.length;Xe++)It=Me(We,oe,Xe,le[Xe],Ce),It!==null&&(e&&It.alternate!==null&&We.delete(It.key===null?Xe:It.key),se=I(It,se,Xe),Ue===null?Oe=It:Ue.sibling=It,Ue=It);return e&&We.forEach(function(yr){return t(oe,yr)}),mt&&qr(oe,Xe),Oe}function je(oe,se,le,Ce){var Oe=j(le);if(typeof Oe!="function")throw Error(o(150));if(le=Oe.call(le),le==null)throw Error(o(151));for(var Ue=Oe=null,We=se,Xe=se=0,It=null,it=le.next();We!==null&&!it.done;Xe++,it=le.next()){We.index>Xe?(It=We,We=null):It=We.sibling;var yr=ge(oe,We,it.value,Ce);if(yr===null){We===null&&(We=It);break}e&&We&&yr.alternate===null&&t(oe,We),se=I(yr,se,Xe),Ue===null?Oe=yr:Ue.sibling=yr,Ue=yr,We=It}if(it.done)return i(oe,We),mt&&qr(oe,Xe),Oe;if(We===null){for(;!it.done;Xe++,it=le.next())it=ye(oe,it.value,Ce),it!==null&&(se=I(it,se,Xe),Ue===null?Oe=it:Ue.sibling=it,Ue=it);return mt&&qr(oe,Xe),Oe}for(We=_(oe,We);!it.done;Xe++,it=le.next())it=Me(We,oe,Xe,it.value,Ce),it!==null&&(e&&it.alternate!==null&&We.delete(it.key===null?Xe:it.key),se=I(it,se,Xe),Ue===null?Oe=it:Ue.sibling=it,Ue=it);return e&&We.forEach(function(Yg){return t(oe,Yg)}),mt&&qr(oe,Xe),Oe}function bt(oe,se,le,Ce){if(typeof le=="object"&&le!==null&&le.type===M&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case D:e:{for(var Oe=le.key,Ue=se;Ue!==null;){if(Ue.key===Oe){if(Oe=le.type,Oe===M){if(Ue.tag===7){i(oe,Ue.sibling),se=R(Ue,le.props.children),se.return=oe,oe=se;break e}}else if(Ue.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===X&&$u(Oe)===Ue.type){i(oe,Ue.sibling),se=R(Ue,le.props),se.ref=_i(oe,Ue,le),se.return=oe,oe=se;break e}i(oe,Ue);break}else t(oe,Ue);Ue=Ue.sibling}le.type===M?(se=es(le.props.children,oe.mode,Ce,le.key),se.return=oe,oe=se):(Ce=zo(le.type,le.key,le.props,null,oe.mode,Ce),Ce.ref=_i(oe,se,le),Ce.return=oe,oe=Ce)}return z(oe);case x:e:{for(Ue=le.key;se!==null;){if(se.key===Ue)if(se.tag===4&&se.stateNode.containerInfo===le.containerInfo&&se.stateNode.implementation===le.implementation){i(oe,se.sibling),se=R(se,le.children||[]),se.return=oe,oe=se;break e}else{i(oe,se);break}else t(oe,se);se=se.sibling}se=Wl(le,oe.mode,Ce),se.return=oe,oe=se}return z(oe);case X:return Ue=le._init,bt(oe,se,Ue(le._payload),Ce)}if(ve(le))return De(oe,se,le,Ce);if(j(le))return je(oe,se,le,Ce);wo(oe,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,se!==null&&se.tag===6?(i(oe,se.sibling),se=R(se,le),se.return=oe,oe=se):(i(oe,se),se=Ul(le,oe.mode,Ce),se.return=oe,oe=se),z(oe)):i(oe,se)}return bt}var Ts=Uu(!0),Wu=Uu(!1),bo=lr(null),So=null,Rs=null,Ja=null;function Za(){Ja=Rs=So=null}function el(e){var t=bo.current;ft(bo),e._currentValue=t}function tl(e,t,i){for(;e!==null;){var _=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,_!==null&&(_.childLanes|=t)):_!==null&&(_.childLanes&t)!==t&&(_.childLanes|=t),e===i)break;e=e.return}}function Ms(e,t){So=e,Ja=Rs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Zt=!0),e.firstContext=null)}function fn(e){var t=e._currentValue;if(Ja!==e)if(e={context:e,memoizedValue:t,next:null},Rs===null){if(So===null)throw Error(o(308));Rs=e,So.dependencies={lanes:0,firstContext:e}}else Rs=Rs.next=e;return t}var Kr=null;function nl(e){Kr===null?Kr=[e]:Kr.push(e)}function zu(e,t,i,_){var R=t.interleaved;return R===null?(i.next=i,nl(t)):(i.next=R.next,R.next=i),t.interleaved=i,Wn(e,_)}function Wn(e,t){e.lanes|=t;var i=e.alternate;for(i!==null&&(i.lanes|=t),i=e,e=e.return;e!==null;)e.childLanes|=t,i=e.alternate,i!==null&&(i.childLanes|=t),i=e,e=e.return;return i.tag===3?i.stateNode:null}var hr=!1;function rl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Vu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function zn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function dr(e,t,i){var _=e.updateQueue;if(_===null)return null;if(_=_.shared,(rt&2)!==0){var R=_.pending;return R===null?t.next=t:(t.next=R.next,R.next=t),_.pending=t,Wn(e,i)}return R=_.interleaved,R===null?(t.next=t,nl(_)):(t.next=R.next,R.next=t),_.interleaved=t,Wn(e,i)}function Co(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194240)!==0)){var _=t.lanes;_&=e.pendingLanes,i|=_,t.lanes=i,Js(e,i)}}function qu(e,t){var i=e.updateQueue,_=e.alternate;if(_!==null&&(_=_.updateQueue,i===_)){var R=null,I=null;if(i=i.firstBaseUpdate,i!==null){do{var z={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};I===null?R=I=z:I=I.next=z,i=i.next}while(i!==null);I===null?R=I=t:I=I.next=t}else R=I=t;i={baseState:_.baseState,firstBaseUpdate:R,lastBaseUpdate:I,shared:_.shared,effects:_.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}function xo(e,t,i,_){var R=e.updateQueue;hr=!1;var I=R.firstBaseUpdate,z=R.lastBaseUpdate,Q=R.shared.pending;if(Q!==null){R.shared.pending=null;var te=Q,ue=te.next;te.next=null,z===null?I=ue:z.next=ue,z=te;var _e=e.alternate;_e!==null&&(_e=_e.updateQueue,Q=_e.lastBaseUpdate,Q!==z&&(Q===null?_e.firstBaseUpdate=ue:Q.next=ue,_e.lastBaseUpdate=te))}if(I!==null){var ye=R.baseState;z=0,_e=ue=te=null,Q=I;do{var ge=Q.lane,Me=Q.eventTime;if((_&ge)===ge){_e!==null&&(_e=_e.next={eventTime:Me,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var De=e,je=Q;switch(ge=t,Me=i,je.tag){case 1:if(De=je.payload,typeof De=="function"){ye=De.call(Me,ye,ge);break e}ye=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=je.payload,ge=typeof De=="function"?De.call(Me,ye,ge):De,ge==null)break e;ye=W({},ye,ge);break e;case 2:hr=!0}}Q.callback!==null&&Q.lane!==0&&(e.flags|=64,ge=R.effects,ge===null?R.effects=[Q]:ge.push(Q))}else Me={eventTime:Me,lane:ge,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},_e===null?(ue=_e=Me,te=ye):_e=_e.next=Me,z|=ge;if(Q=Q.next,Q===null){if(Q=R.shared.pending,Q===null)break;ge=Q,Q=ge.next,ge.next=null,R.lastBaseUpdate=ge,R.shared.pending=null}}while(!0);if(_e===null&&(te=ye),R.baseState=te,R.firstBaseUpdate=ue,R.lastBaseUpdate=_e,t=R.shared.interleaved,t!==null){R=t;do z|=R.lane,R=R.next;while(R!==t)}else I===null&&(R.shared.lanes=0);Xr|=z,e.lanes=z,e.memoizedState=ye}}function Ku(e,t,i){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var _=e[t],R=_.callback;if(R!==null){if(_.callback=null,_=i,typeof R!="function")throw Error(o(191,R));R.call(_)}}}var vi={},An=lr(vi),yi=lr(vi),wi=lr(vi);function Gr(e){if(e===vi)throw Error(o(174));return e}function sl(e,t){switch(ct(wi,t),ct(yi,e),ct(An,vi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:St(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=St(t,e)}ft(An),ct(An,t)}function As(){ft(An),ft(yi),ft(wi)}function Gu(e){Gr(wi.current);var t=Gr(An.current),i=St(t,e.type);t!==i&&(ct(yi,e),ct(An,i))}function il(e){yi.current===e&&(ft(An),ft(yi))}var _t=lr(0);function ko(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ol=[];function al(){for(var e=0;e<ol.length;e++)ol[e]._workInProgressVersionPrimary=null;ol.length=0}var Eo=C.ReactCurrentDispatcher,ll=C.ReactCurrentBatchConfig,Yr=0,vt=null,Tt=null,Nt=null,Lo=!1,bi=!1,Si=0,_g=0;function Ut(){throw Error(o(321))}function cl(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!bn(e[i],t[i]))return!1;return!0}function ul(e,t,i,_,R,I){if(Yr=I,vt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Eo.current=e===null||e.memoizedState===null?bg:Sg,e=i(_,R),bi){I=0;do{if(bi=!1,Si=0,25<=I)throw Error(o(301));I+=1,Nt=Tt=null,t.updateQueue=null,Eo.current=Cg,e=i(_,R)}while(bi)}if(Eo.current=Mo,t=Tt!==null&&Tt.next!==null,Yr=0,Nt=Tt=vt=null,Lo=!1,t)throw Error(o(300));return e}function hl(){var e=Si!==0;return Si=0,e}function Nn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?vt.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function pn(){if(Tt===null){var e=vt.alternate;e=e!==null?e.memoizedState:null}else e=Tt.next;var t=Nt===null?vt.memoizedState:Nt.next;if(t!==null)Nt=t,Tt=e;else{if(e===null)throw Error(o(310));Tt=e,e={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},Nt===null?vt.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function Ci(e,t){return typeof t=="function"?t(e):t}function dl(e){var t=pn(),i=t.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var _=Tt,R=_.baseQueue,I=i.pending;if(I!==null){if(R!==null){var z=R.next;R.next=I.next,I.next=z}_.baseQueue=R=I,i.pending=null}if(R!==null){I=R.next,_=_.baseState;var Q=z=null,te=null,ue=I;do{var _e=ue.lane;if((Yr&_e)===_e)te!==null&&(te=te.next={lane:0,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),_=ue.hasEagerState?ue.eagerState:e(_,ue.action);else{var ye={lane:_e,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null};te===null?(Q=te=ye,z=_):te=te.next=ye,vt.lanes|=_e,Xr|=_e}ue=ue.next}while(ue!==null&&ue!==I);te===null?z=_:te.next=Q,bn(_,t.memoizedState)||(Zt=!0),t.memoizedState=_,t.baseState=z,t.baseQueue=te,i.lastRenderedState=_}if(e=i.interleaved,e!==null){R=e;do I=R.lane,vt.lanes|=I,Xr|=I,R=R.next;while(R!==e)}else R===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function fl(e){var t=pn(),i=t.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var _=i.dispatch,R=i.pending,I=t.memoizedState;if(R!==null){i.pending=null;var z=R=R.next;do I=e(I,z.action),z=z.next;while(z!==R);bn(I,t.memoizedState)||(Zt=!0),t.memoizedState=I,t.baseQueue===null&&(t.baseState=I),i.lastRenderedState=I}return[I,_]}function Yu(){}function Xu(e,t){var i=vt,_=pn(),R=t(),I=!bn(_.memoizedState,R);if(I&&(_.memoizedState=R,Zt=!0),_=_.queue,pl(Zu.bind(null,i,_,e),[e]),_.getSnapshot!==t||I||Nt!==null&&Nt.memoizedState.tag&1){if(i.flags|=2048,xi(9,Ju.bind(null,i,_,R,t),void 0,null),Dt===null)throw Error(o(349));(Yr&30)!==0||Qu(i,t,R)}return R}function Qu(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=vt.updateQueue,t===null?(t={lastEffect:null,stores:null},vt.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Ju(e,t,i,_){t.value=i,t.getSnapshot=_,eh(t)&&th(e)}function Zu(e,t,i){return i(function(){eh(t)&&th(e)})}function eh(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!bn(e,i)}catch{return!0}}function th(e){var t=Wn(e,1);t!==null&&En(t,e,1,-1)}function nh(e){var t=Nn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:e},t.queue=e,e=e.dispatch=wg.bind(null,vt,e),[t.memoizedState,e]}function xi(e,t,i,_){return e={tag:e,create:t,destroy:i,deps:_,next:null},t=vt.updateQueue,t===null?(t={lastEffect:null,stores:null},vt.updateQueue=t,t.lastEffect=e.next=e):(i=t.lastEffect,i===null?t.lastEffect=e.next=e:(_=i.next,i.next=e,e.next=_,t.lastEffect=e)),e}function rh(){return pn().memoizedState}function To(e,t,i,_){var R=Nn();vt.flags|=e,R.memoizedState=xi(1|t,i,void 0,_===void 0?null:_)}function Ro(e,t,i,_){var R=pn();_=_===void 0?null:_;var I=void 0;if(Tt!==null){var z=Tt.memoizedState;if(I=z.destroy,_!==null&&cl(_,z.deps)){R.memoizedState=xi(t,i,I,_);return}}vt.flags|=e,R.memoizedState=xi(1|t,i,I,_)}function sh(e,t){return To(8390656,8,e,t)}function pl(e,t){return Ro(2048,8,e,t)}function ih(e,t){return Ro(4,2,e,t)}function oh(e,t){return Ro(4,4,e,t)}function ah(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function lh(e,t,i){return i=i!=null?i.concat([e]):null,Ro(4,4,ah.bind(null,t,e),i)}function ml(){}function ch(e,t){var i=pn();t=t===void 0?null:t;var _=i.memoizedState;return _!==null&&t!==null&&cl(t,_[1])?_[0]:(i.memoizedState=[e,t],e)}function uh(e,t){var i=pn();t=t===void 0?null:t;var _=i.memoizedState;return _!==null&&t!==null&&cl(t,_[1])?_[0]:(e=e(),i.memoizedState=[e,t],e)}function hh(e,t,i){return(Yr&21)===0?(e.baseState&&(e.baseState=!1,Zt=!0),e.memoizedState=i):(bn(i,t)||(i=Qs(),vt.lanes|=i,Xr|=i,e.baseState=!0),t)}function vg(e,t){var i=st;st=i!==0&&4>i?i:4,e(!0);var _=ll.transition;ll.transition={};try{e(!1),t()}finally{st=i,ll.transition=_}}function dh(){return pn().memoizedState}function yg(e,t,i){var _=gr(e);if(i={lane:_,action:i,hasEagerState:!1,eagerState:null,next:null},fh(e))ph(t,i);else if(i=zu(e,t,i,_),i!==null){var R=Yt();En(i,e,_,R),mh(i,t,_)}}function wg(e,t,i){var _=gr(e),R={lane:_,action:i,hasEagerState:!1,eagerState:null,next:null};if(fh(e))ph(t,R);else{var I=e.alternate;if(e.lanes===0&&(I===null||I.lanes===0)&&(I=t.lastRenderedReducer,I!==null))try{var z=t.lastRenderedState,Q=I(z,i);if(R.hasEagerState=!0,R.eagerState=Q,bn(Q,z)){var te=t.interleaved;te===null?(R.next=R,nl(t)):(R.next=te.next,te.next=R),t.interleaved=R;return}}catch{}finally{}i=zu(e,t,R,_),i!==null&&(R=Yt(),En(i,e,_,R),mh(i,t,_))}}function fh(e){var t=e.alternate;return e===vt||t!==null&&t===vt}function ph(e,t){bi=Lo=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function mh(e,t,i){if((i&4194240)!==0){var _=t.lanes;_&=e.pendingLanes,i|=_,t.lanes=i,Js(e,i)}}var Mo={readContext:fn,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useInsertionEffect:Ut,useLayoutEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useMutableSource:Ut,useSyncExternalStore:Ut,useId:Ut,unstable_isNewReconciler:!1},bg={readContext:fn,useCallback:function(e,t){return Nn().memoizedState=[e,t===void 0?null:t],e},useContext:fn,useEffect:sh,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,To(4194308,4,ah.bind(null,t,e),i)},useLayoutEffect:function(e,t){return To(4194308,4,e,t)},useInsertionEffect:function(e,t){return To(4,2,e,t)},useMemo:function(e,t){var i=Nn();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var _=Nn();return t=i!==void 0?i(t):t,_.memoizedState=_.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},_.queue=e,e=e.dispatch=yg.bind(null,vt,e),[_.memoizedState,e]},useRef:function(e){var t=Nn();return e={current:e},t.memoizedState=e},useState:nh,useDebugValue:ml,useDeferredValue:function(e){return Nn().memoizedState=e},useTransition:function(){var e=nh(!1),t=e[0];return e=vg.bind(null,e[1]),Nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var _=vt,R=Nn();if(mt){if(i===void 0)throw Error(o(407));i=i()}else{if(i=t(),Dt===null)throw Error(o(349));(Yr&30)!==0||Qu(_,t,i)}R.memoizedState=i;var I={value:i,getSnapshot:t};return R.queue=I,sh(Zu.bind(null,_,I,e),[e]),_.flags|=2048,xi(9,Ju.bind(null,_,I,i,t),void 0,null),i},useId:function(){var e=Nn(),t=Dt.identifierPrefix;if(mt){var i=Un,_=$n;i=(_&~(1<<32-Ft(_)-1)).toString(32)+i,t=":"+t+"R"+i,i=Si++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=_g++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Sg={readContext:fn,useCallback:ch,useContext:fn,useEffect:pl,useImperativeHandle:lh,useInsertionEffect:ih,useLayoutEffect:oh,useMemo:uh,useReducer:dl,useRef:rh,useState:function(){return dl(Ci)},useDebugValue:ml,useDeferredValue:function(e){var t=pn();return hh(t,Tt.memoizedState,e)},useTransition:function(){var e=dl(Ci)[0],t=pn().memoizedState;return[e,t]},useMutableSource:Yu,useSyncExternalStore:Xu,useId:dh,unstable_isNewReconciler:!1},Cg={readContext:fn,useCallback:ch,useContext:fn,useEffect:pl,useImperativeHandle:lh,useInsertionEffect:ih,useLayoutEffect:oh,useMemo:uh,useReducer:fl,useRef:rh,useState:function(){return fl(Ci)},useDebugValue:ml,useDeferredValue:function(e){var t=pn();return Tt===null?t.memoizedState=e:hh(t,Tt.memoizedState,e)},useTransition:function(){var e=fl(Ci)[0],t=pn().memoizedState;return[e,t]},useMutableSource:Yu,useSyncExternalStore:Xu,useId:dh,unstable_isNewReconciler:!1};function Cn(e,t){if(e&&e.defaultProps){t=W({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function gl(e,t,i,_){t=e.memoizedState,i=i(_,t),i=i==null?t:W({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Ao={isMounted:function(e){return(e=e._reactInternals)?un(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var _=Yt(),R=gr(e),I=zn(_,R);I.payload=t,i!=null&&(I.callback=i),t=dr(e,I,R),t!==null&&(En(t,e,R,_),Co(t,e,R))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var _=Yt(),R=gr(e),I=zn(_,R);I.tag=1,I.payload=t,i!=null&&(I.callback=i),t=dr(e,I,R),t!==null&&(En(t,e,R,_),Co(t,e,R))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Yt(),_=gr(e),R=zn(i,_);R.tag=2,t!=null&&(R.callback=t),t=dr(e,R,_),t!==null&&(En(t,e,_,i),Co(t,e,_))}};function gh(e,t,i,_,R,I,z){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(_,I,z):t.prototype&&t.prototype.isPureReactComponent?!ui(i,_)||!ui(R,I):!0}function _h(e,t,i){var _=!1,R=cr,I=t.contextType;return typeof I=="object"&&I!==null?I=fn(I):(R=Jt(t)?zr:$t.current,_=t.contextTypes,I=(_=_!=null)?xs(e,R):cr),t=new t(i,I),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ao,e.stateNode=t,t._reactInternals=e,_&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=R,e.__reactInternalMemoizedMaskedChildContext=I),t}function vh(e,t,i,_){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,_),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,_),t.state!==e&&Ao.enqueueReplaceState(t,t.state,null)}function _l(e,t,i,_){var R=e.stateNode;R.props=i,R.state=e.memoizedState,R.refs={},rl(e);var I=t.contextType;typeof I=="object"&&I!==null?R.context=fn(I):(I=Jt(t)?zr:$t.current,R.context=xs(e,I)),R.state=e.memoizedState,I=t.getDerivedStateFromProps,typeof I=="function"&&(gl(e,t,I,i),R.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof R.getSnapshotBeforeUpdate=="function"||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(t=R.state,typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount(),t!==R.state&&Ao.enqueueReplaceState(R,R.state,null),xo(e,i,R,_),R.state=e.memoizedState),typeof R.componentDidMount=="function"&&(e.flags|=4194308)}function Ns(e,t){try{var i="",_=t;do i+=ie(_),_=_.return;while(_);var R=i}catch(I){R=`
|
|
39
|
-
Error generating stack: `+I.message+`
|
|
40
|
-
`+I.stack}return{value:e,source:t,stack:R,digest:null}}function vl(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function yl(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var xg=typeof WeakMap=="function"?WeakMap:Map;function yh(e,t,i){i=zn(-1,i),i.tag=3,i.payload={element:null};var _=t.value;return i.callback=function(){Bo||(Bo=!0,Il=_),yl(e,t)},i}function wh(e,t,i){i=zn(-1,i),i.tag=3;var _=e.type.getDerivedStateFromError;if(typeof _=="function"){var R=t.value;i.payload=function(){return _(R)},i.callback=function(){yl(e,t)}}var I=e.stateNode;return I!==null&&typeof I.componentDidCatch=="function"&&(i.callback=function(){yl(e,t),typeof _!="function"&&(pr===null?pr=new Set([this]):pr.add(this));var z=t.stack;this.componentDidCatch(t.value,{componentStack:z!==null?z:""})}),i}function bh(e,t,i){var _=e.pingCache;if(_===null){_=e.pingCache=new xg;var R=new Set;_.set(t,R)}else R=_.get(t),R===void 0&&(R=new Set,_.set(t,R));R.has(i)||(R.add(i),e=Bg.bind(null,e,t,i),t.then(e,e))}function Sh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ch(e,t,i,_,R){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(t=zn(-1,1),t.tag=2,dr(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=R,e)}var kg=C.ReactCurrentOwner,Zt=!1;function Gt(e,t,i,_){t.child=e===null?Wu(t,null,i,_):Ts(t,e.child,i,_)}function xh(e,t,i,_,R){i=i.render;var I=t.ref;return Ms(t,R),_=ul(e,t,i,_,I,R),i=hl(),e!==null&&!Zt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~R,Vn(e,t,R)):(mt&&i&&Ka(t),t.flags|=1,Gt(e,t,_,R),t.child)}function kh(e,t,i,_,R){if(e===null){var I=i.type;return typeof I=="function"&&!$l(I)&&I.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=I,Eh(e,t,I,_,R)):(e=zo(i.type,null,_,t,t.mode,R),e.ref=t.ref,e.return=t,t.child=e)}if(I=e.child,(e.lanes&R)===0){var z=I.memoizedProps;if(i=i.compare,i=i!==null?i:ui,i(z,_)&&e.ref===t.ref)return Vn(e,t,R)}return t.flags|=1,e=vr(I,_),e.ref=t.ref,e.return=t,t.child=e}function Eh(e,t,i,_,R){if(e!==null){var I=e.memoizedProps;if(ui(I,_)&&e.ref===t.ref)if(Zt=!1,t.pendingProps=_=I,(e.lanes&R)!==0)(e.flags&131072)!==0&&(Zt=!0);else return t.lanes=e.lanes,Vn(e,t,R)}return wl(e,t,i,_,R)}function Lh(e,t,i){var _=t.pendingProps,R=_.children,I=e!==null?e.memoizedState:null;if(_.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(Is,cn),cn|=i;else{if((i&1073741824)===0)return e=I!==null?I.baseLanes|i:i,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ct(Is,cn),cn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_=I!==null?I.baseLanes:i,ct(Is,cn),cn|=_}else I!==null?(_=I.baseLanes|i,t.memoizedState=null):_=i,ct(Is,cn),cn|=_;return Gt(e,t,R,i),t.child}function Th(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function wl(e,t,i,_,R){var I=Jt(i)?zr:$t.current;return I=xs(t,I),Ms(t,R),i=ul(e,t,i,_,I,R),_=hl(),e!==null&&!Zt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~R,Vn(e,t,R)):(mt&&_&&Ka(t),t.flags|=1,Gt(e,t,i,R),t.child)}function Rh(e,t,i,_,R){if(Jt(i)){var I=!0;mo(t)}else I=!1;if(Ms(t,R),t.stateNode===null)Do(e,t),_h(t,i,_),_l(t,i,_,R),_=!0;else if(e===null){var z=t.stateNode,Q=t.memoizedProps;z.props=Q;var te=z.context,ue=i.contextType;typeof ue=="object"&&ue!==null?ue=fn(ue):(ue=Jt(i)?zr:$t.current,ue=xs(t,ue));var _e=i.getDerivedStateFromProps,ye=typeof _e=="function"||typeof z.getSnapshotBeforeUpdate=="function";ye||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(Q!==_||te!==ue)&&vh(t,z,_,ue),hr=!1;var ge=t.memoizedState;z.state=ge,xo(t,_,z,R),te=t.memoizedState,Q!==_||ge!==te||Qt.current||hr?(typeof _e=="function"&&(gl(t,i,_e,_),te=t.memoizedState),(Q=hr||gh(t,i,Q,_,ge,te,ue))?(ye||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount()),typeof z.componentDidMount=="function"&&(t.flags|=4194308)):(typeof z.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=_,t.memoizedState=te),z.props=_,z.state=te,z.context=ue,_=Q):(typeof z.componentDidMount=="function"&&(t.flags|=4194308),_=!1)}else{z=t.stateNode,Vu(e,t),Q=t.memoizedProps,ue=t.type===t.elementType?Q:Cn(t.type,Q),z.props=ue,ye=t.pendingProps,ge=z.context,te=i.contextType,typeof te=="object"&&te!==null?te=fn(te):(te=Jt(i)?zr:$t.current,te=xs(t,te));var Me=i.getDerivedStateFromProps;(_e=typeof Me=="function"||typeof z.getSnapshotBeforeUpdate=="function")||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(Q!==ye||ge!==te)&&vh(t,z,_,te),hr=!1,ge=t.memoizedState,z.state=ge,xo(t,_,z,R);var De=t.memoizedState;Q!==ye||ge!==De||Qt.current||hr?(typeof Me=="function"&&(gl(t,i,Me,_),De=t.memoizedState),(ue=hr||gh(t,i,ue,_,ge,De,te)||!1)?(_e||typeof z.UNSAFE_componentWillUpdate!="function"&&typeof z.componentWillUpdate!="function"||(typeof z.componentWillUpdate=="function"&&z.componentWillUpdate(_,De,te),typeof z.UNSAFE_componentWillUpdate=="function"&&z.UNSAFE_componentWillUpdate(_,De,te)),typeof z.componentDidUpdate=="function"&&(t.flags|=4),typeof z.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof z.componentDidUpdate!="function"||Q===e.memoizedProps&&ge===e.memoizedState||(t.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||Q===e.memoizedProps&&ge===e.memoizedState||(t.flags|=1024),t.memoizedProps=_,t.memoizedState=De),z.props=_,z.state=De,z.context=te,_=ue):(typeof z.componentDidUpdate!="function"||Q===e.memoizedProps&&ge===e.memoizedState||(t.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||Q===e.memoizedProps&&ge===e.memoizedState||(t.flags|=1024),_=!1)}return bl(e,t,i,_,I,R)}function bl(e,t,i,_,R,I){Th(e,t);var z=(t.flags&128)!==0;if(!_&&!z)return R&&Iu(t,i,!1),Vn(e,t,I);_=t.stateNode,kg.current=t;var Q=z&&typeof i.getDerivedStateFromError!="function"?null:_.render();return t.flags|=1,e!==null&&z?(t.child=Ts(t,e.child,null,I),t.child=Ts(t,null,Q,I)):Gt(e,t,Q,I),t.memoizedState=_.state,R&&Iu(t,i,!0),t.child}function Mh(e){var t=e.stateNode;t.pendingContext?Nu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Nu(e,t.context,!1),sl(e,t.containerInfo)}function Ah(e,t,i,_,R){return Ls(),Qa(R),t.flags|=256,Gt(e,t,i,_),t.child}var Sl={dehydrated:null,treeContext:null,retryLane:0};function Cl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Nh(e,t,i){var _=t.pendingProps,R=_t.current,I=!1,z=(t.flags&128)!==0,Q;if((Q=z)||(Q=e!==null&&e.memoizedState===null?!1:(R&2)!==0),Q?(I=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(R|=1),ct(_t,R&1),e===null)return Xa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(z=_.children,e=_.fallback,I?(_=t.mode,I=t.child,z={mode:"hidden",children:z},(_&1)===0&&I!==null?(I.childLanes=0,I.pendingProps=z):I=Vo(z,_,0,null),e=es(e,_,i,null),I.return=t,e.return=t,I.sibling=e,t.child=I,t.child.memoizedState=Cl(i),t.memoizedState=Sl,e):xl(t,z));if(R=e.memoizedState,R!==null&&(Q=R.dehydrated,Q!==null))return Eg(e,t,z,_,Q,R,i);if(I){I=_.fallback,z=t.mode,R=e.child,Q=R.sibling;var te={mode:"hidden",children:_.children};return(z&1)===0&&t.child!==R?(_=t.child,_.childLanes=0,_.pendingProps=te,t.deletions=null):(_=vr(R,te),_.subtreeFlags=R.subtreeFlags&14680064),Q!==null?I=vr(Q,I):(I=es(I,z,i,null),I.flags|=2),I.return=t,_.return=t,_.sibling=I,t.child=_,_=I,I=t.child,z=e.child.memoizedState,z=z===null?Cl(i):{baseLanes:z.baseLanes|i,cachePool:null,transitions:z.transitions},I.memoizedState=z,I.childLanes=e.childLanes&~i,t.memoizedState=Sl,_}return I=e.child,e=I.sibling,_=vr(I,{mode:"visible",children:_.children}),(t.mode&1)===0&&(_.lanes=i),_.return=t,_.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=_,t.memoizedState=null,_}function xl(e,t){return t=Vo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function No(e,t,i,_){return _!==null&&Qa(_),Ts(t,e.child,null,i),e=xl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Eg(e,t,i,_,R,I,z){if(i)return t.flags&256?(t.flags&=-257,_=vl(Error(o(422))),No(e,t,z,_)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(I=_.fallback,R=t.mode,_=Vo({mode:"visible",children:_.children},R,0,null),I=es(I,R,z,null),I.flags|=2,_.return=t,I.return=t,_.sibling=I,t.child=_,(t.mode&1)!==0&&Ts(t,e.child,null,z),t.child.memoizedState=Cl(z),t.memoizedState=Sl,I);if((t.mode&1)===0)return No(e,t,z,null);if(R.data==="$!"){if(_=R.nextSibling&&R.nextSibling.dataset,_)var Q=_.dgst;return _=Q,I=Error(o(419)),_=vl(I,_,void 0),No(e,t,z,_)}if(Q=(z&e.childLanes)!==0,Zt||Q){if(_=Dt,_!==null){switch(z&-z){case 4:R=2;break;case 16:R=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:R=32;break;case 536870912:R=268435456;break;default:R=0}R=(R&(_.suspendedLanes|z))!==0?0:R,R!==0&&R!==I.retryLane&&(I.retryLane=R,Wn(e,R),En(_,e,R,-1))}return Hl(),_=vl(Error(o(421))),No(e,t,z,_)}return R.data==="$?"?(t.flags|=128,t.child=e.child,t=Fg.bind(null,e),R._reactRetry=t,null):(e=I.treeContext,ln=ar(R.nextSibling),an=t,mt=!0,Sn=null,e!==null&&(hn[dn++]=$n,hn[dn++]=Un,hn[dn++]=Vr,$n=e.id,Un=e.overflow,Vr=t),t=xl(t,_.children),t.flags|=4096,t)}function Dh(e,t,i){e.lanes|=t;var _=e.alternate;_!==null&&(_.lanes|=t),tl(e.return,t,i)}function kl(e,t,i,_,R){var I=e.memoizedState;I===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:_,tail:i,tailMode:R}:(I.isBackwards=t,I.rendering=null,I.renderingStartTime=0,I.last=_,I.tail=i,I.tailMode=R)}function Ih(e,t,i){var _=t.pendingProps,R=_.revealOrder,I=_.tail;if(Gt(e,t,_.children,i),_=_t.current,(_&2)!==0)_=_&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dh(e,i,t);else if(e.tag===19)Dh(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}_&=1}if(ct(_t,_),(t.mode&1)===0)t.memoizedState=null;else switch(R){case"forwards":for(i=t.child,R=null;i!==null;)e=i.alternate,e!==null&&ko(e)===null&&(R=i),i=i.sibling;i=R,i===null?(R=t.child,t.child=null):(R=i.sibling,i.sibling=null),kl(t,!1,R,i,I);break;case"backwards":for(i=null,R=t.child,t.child=null;R!==null;){if(e=R.alternate,e!==null&&ko(e)===null){t.child=R;break}e=R.sibling,R.sibling=i,i=R,R=e}kl(t,!0,i,null,I);break;case"together":kl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Do(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Vn(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Xr|=t.lanes,(i&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,i=vr(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=vr(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Lg(e,t,i){switch(t.tag){case 3:Mh(t),Ls();break;case 5:Gu(t);break;case 1:Jt(t.type)&&mo(t);break;case 4:sl(t,t.stateNode.containerInfo);break;case 10:var _=t.type._context,R=t.memoizedProps.value;ct(bo,_._currentValue),_._currentValue=R;break;case 13:if(_=t.memoizedState,_!==null)return _.dehydrated!==null?(ct(_t,_t.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?Nh(e,t,i):(ct(_t,_t.current&1),e=Vn(e,t,i),e!==null?e.sibling:null);ct(_t,_t.current&1);break;case 19:if(_=(i&t.childLanes)!==0,(e.flags&128)!==0){if(_)return Ih(e,t,i);t.flags|=128}if(R=t.memoizedState,R!==null&&(R.rendering=null,R.tail=null,R.lastEffect=null),ct(_t,_t.current),_)break;return null;case 22:case 23:return t.lanes=0,Lh(e,t,i)}return Vn(e,t,i)}var Ph,El,jh,Oh;Ph=function(e,t){for(var i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},El=function(){},jh=function(e,t,i,_){var R=e.memoizedProps;if(R!==_){e=t.stateNode,Gr(An.current);var I=null;switch(i){case"input":R=xe(e,R),_=xe(e,_),I=[];break;case"select":R=W({},R,{value:void 0}),_=W({},_,{value:void 0}),I=[];break;case"textarea":R=Ie(e,R),_=Ie(e,_),I=[];break;default:typeof R.onClick!="function"&&typeof _.onClick=="function"&&(e.onclick=ho)}Ve(i,_);var z;i=null;for(ue in R)if(!_.hasOwnProperty(ue)&&R.hasOwnProperty(ue)&&R[ue]!=null)if(ue==="style"){var Q=R[ue];for(z in Q)Q.hasOwnProperty(z)&&(i||(i={}),i[z]="")}else ue!=="dangerouslySetInnerHTML"&&ue!=="children"&&ue!=="suppressContentEditableWarning"&&ue!=="suppressHydrationWarning"&&ue!=="autoFocus"&&(w.hasOwnProperty(ue)?I||(I=[]):(I=I||[]).push(ue,null));for(ue in _){var te=_[ue];if(Q=R!=null?R[ue]:void 0,_.hasOwnProperty(ue)&&te!==Q&&(te!=null||Q!=null))if(ue==="style")if(Q){for(z in Q)!Q.hasOwnProperty(z)||te&&te.hasOwnProperty(z)||(i||(i={}),i[z]="");for(z in te)te.hasOwnProperty(z)&&Q[z]!==te[z]&&(i||(i={}),i[z]=te[z])}else i||(I||(I=[]),I.push(ue,i)),i=te;else ue==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,Q=Q?Q.__html:void 0,te!=null&&Q!==te&&(I=I||[]).push(ue,te)):ue==="children"?typeof te!="string"&&typeof te!="number"||(I=I||[]).push(ue,""+te):ue!=="suppressContentEditableWarning"&&ue!=="suppressHydrationWarning"&&(w.hasOwnProperty(ue)?(te!=null&&ue==="onScroll"&&dt("scroll",e),I||Q===te||(I=[])):(I=I||[]).push(ue,te))}i&&(I=I||[]).push("style",i);var ue=I;(t.updateQueue=ue)&&(t.flags|=4)}},Oh=function(e,t,i,_){i!==_&&(t.flags|=4)};function ki(e,t){if(!mt)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var _=null;i!==null;)i.alternate!==null&&(_=i),i=i.sibling;_===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:_.sibling=null}}function Wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,_=0;if(t)for(var R=e.child;R!==null;)i|=R.lanes|R.childLanes,_|=R.subtreeFlags&14680064,_|=R.flags&14680064,R.return=e,R=R.sibling;else for(R=e.child;R!==null;)i|=R.lanes|R.childLanes,_|=R.subtreeFlags,_|=R.flags,R.return=e,R=R.sibling;return e.subtreeFlags|=_,e.childLanes=i,t}function Tg(e,t,i){var _=t.pendingProps;switch(Ga(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(t),null;case 1:return Jt(t.type)&&po(),Wt(t),null;case 3:return _=t.stateNode,As(),ft(Qt),ft($t),al(),_.pendingContext&&(_.context=_.pendingContext,_.pendingContext=null),(e===null||e.child===null)&&(yo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Sn!==null&&(Ol(Sn),Sn=null))),El(e,t),Wt(t),null;case 5:il(t);var R=Gr(wi.current);if(i=t.type,e!==null&&t.stateNode!=null)jh(e,t,i,_,R),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!_){if(t.stateNode===null)throw Error(o(166));return Wt(t),null}if(e=Gr(An.current),yo(t)){_=t.stateNode,i=t.type;var I=t.memoizedProps;switch(_[Mn]=t,_[mi]=I,e=(t.mode&1)!==0,i){case"dialog":dt("cancel",_),dt("close",_);break;case"iframe":case"object":case"embed":dt("load",_);break;case"video":case"audio":for(R=0;R<di.length;R++)dt(di[R],_);break;case"source":dt("error",_);break;case"img":case"image":case"link":dt("error",_),dt("load",_);break;case"details":dt("toggle",_);break;case"input":ce(_,I),dt("invalid",_);break;case"select":_._wrapperState={wasMultiple:!!I.multiple},dt("invalid",_);break;case"textarea":ke(_,I),dt("invalid",_)}Ve(i,I),R=null;for(var z in I)if(I.hasOwnProperty(z)){var Q=I[z];z==="children"?typeof Q=="string"?_.textContent!==Q&&(I.suppressHydrationWarning!==!0&&uo(_.textContent,Q,e),R=["children",Q]):typeof Q=="number"&&_.textContent!==""+Q&&(I.suppressHydrationWarning!==!0&&uo(_.textContent,Q,e),R=["children",""+Q]):w.hasOwnProperty(z)&&Q!=null&&z==="onScroll"&&dt("scroll",_)}switch(i){case"input":pe(_),Ze(_,I,!0);break;case"textarea":pe(_),$e(_);break;case"select":case"option":break;default:typeof I.onClick=="function"&&(_.onclick=ho)}_=R,t.updateQueue=_,_!==null&&(t.flags|=4)}else{z=R.nodeType===9?R:R.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tt(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=z.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof _.is=="string"?e=z.createElement(i,{is:_.is}):(e=z.createElement(i),i==="select"&&(z=e,_.multiple?z.multiple=!0:_.size&&(z.size=_.size))):e=z.createElementNS(e,i),e[Mn]=t,e[mi]=_,Ph(e,t,!1,!1),t.stateNode=e;e:{switch(z=de(i,_),i){case"dialog":dt("cancel",e),dt("close",e),R=_;break;case"iframe":case"object":case"embed":dt("load",e),R=_;break;case"video":case"audio":for(R=0;R<di.length;R++)dt(di[R],e);R=_;break;case"source":dt("error",e),R=_;break;case"img":case"image":case"link":dt("error",e),dt("load",e),R=_;break;case"details":dt("toggle",e),R=_;break;case"input":ce(e,_),R=xe(e,_),dt("invalid",e);break;case"option":R=_;break;case"select":e._wrapperState={wasMultiple:!!_.multiple},R=W({},_,{value:void 0}),dt("invalid",e);break;case"textarea":ke(e,_),R=Ie(e,_),dt("invalid",e);break;default:R=_}Ve(i,R),Q=R;for(I in Q)if(Q.hasOwnProperty(I)){var te=Q[I];I==="style"?Ct(e,te):I==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&>(e,te)):I==="children"?typeof te=="string"?(i!=="textarea"||te!=="")&&nt(e,te):typeof te=="number"&&nt(e,""+te):I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&I!=="autoFocus"&&(w.hasOwnProperty(I)?te!=null&&I==="onScroll"&&dt("scroll",e):te!=null&&h(e,I,te,z))}switch(i){case"input":pe(e),Ze(e,_,!1);break;case"textarea":pe(e),$e(e);break;case"option":_.value!=null&&e.setAttribute("value",""+U(_.value));break;case"select":e.multiple=!!_.multiple,I=_.value,I!=null?Re(e,!!_.multiple,I,!1):_.defaultValue!=null&&Re(e,!!_.multiple,_.defaultValue,!0);break;default:typeof R.onClick=="function"&&(e.onclick=ho)}switch(i){case"button":case"input":case"select":case"textarea":_=!!_.autoFocus;break e;case"img":_=!0;break e;default:_=!1}}_&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Wt(t),null;case 6:if(e&&t.stateNode!=null)Oh(e,t,e.memoizedProps,_);else{if(typeof _!="string"&&t.stateNode===null)throw Error(o(166));if(i=Gr(wi.current),Gr(An.current),yo(t)){if(_=t.stateNode,i=t.memoizedProps,_[Mn]=t,(I=_.nodeValue!==i)&&(e=an,e!==null))switch(e.tag){case 3:uo(_.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&uo(_.nodeValue,i,(e.mode&1)!==0)}I&&(t.flags|=4)}else _=(i.nodeType===9?i:i.ownerDocument).createTextNode(_),_[Mn]=t,t.stateNode=_}return Wt(t),null;case 13:if(ft(_t),_=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(mt&&ln!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Hu(),Ls(),t.flags|=98560,I=!1;else if(I=yo(t),_!==null&&_.dehydrated!==null){if(e===null){if(!I)throw Error(o(318));if(I=t.memoizedState,I=I!==null?I.dehydrated:null,!I)throw Error(o(317));I[Mn]=t}else Ls(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Wt(t),I=!1}else Sn!==null&&(Ol(Sn),Sn=null),I=!0;if(!I)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=i,t):(_=_!==null,_!==(e!==null&&e.memoizedState!==null)&&_&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(_t.current&1)!==0?Rt===0&&(Rt=3):Hl())),t.updateQueue!==null&&(t.flags|=4),Wt(t),null);case 4:return As(),El(e,t),e===null&&fi(t.stateNode.containerInfo),Wt(t),null;case 10:return el(t.type._context),Wt(t),null;case 17:return Jt(t.type)&&po(),Wt(t),null;case 19:if(ft(_t),I=t.memoizedState,I===null)return Wt(t),null;if(_=(t.flags&128)!==0,z=I.rendering,z===null)if(_)ki(I,!1);else{if(Rt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(z=ko(e),z!==null){for(t.flags|=128,ki(I,!1),_=z.updateQueue,_!==null&&(t.updateQueue=_,t.flags|=4),t.subtreeFlags=0,_=i,i=t.child;i!==null;)I=i,e=_,I.flags&=14680066,z=I.alternate,z===null?(I.childLanes=0,I.lanes=e,I.child=null,I.subtreeFlags=0,I.memoizedProps=null,I.memoizedState=null,I.updateQueue=null,I.dependencies=null,I.stateNode=null):(I.childLanes=z.childLanes,I.lanes=z.lanes,I.child=z.child,I.subtreeFlags=0,I.deletions=null,I.memoizedProps=z.memoizedProps,I.memoizedState=z.memoizedState,I.updateQueue=z.updateQueue,I.type=z.type,e=z.dependencies,I.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return ct(_t,_t.current&1|2),t.child}e=e.sibling}I.tail!==null&&ht()>Ps&&(t.flags|=128,_=!0,ki(I,!1),t.lanes=4194304)}else{if(!_)if(e=ko(z),e!==null){if(t.flags|=128,_=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),ki(I,!0),I.tail===null&&I.tailMode==="hidden"&&!z.alternate&&!mt)return Wt(t),null}else 2*ht()-I.renderingStartTime>Ps&&i!==1073741824&&(t.flags|=128,_=!0,ki(I,!1),t.lanes=4194304);I.isBackwards?(z.sibling=t.child,t.child=z):(i=I.last,i!==null?i.sibling=z:t.child=z,I.last=z)}return I.tail!==null?(t=I.tail,I.rendering=t,I.tail=t.sibling,I.renderingStartTime=ht(),t.sibling=null,i=_t.current,ct(_t,_?i&1|2:i&1),t):(Wt(t),null);case 22:case 23:return Fl(),_=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==_&&(t.flags|=8192),_&&(t.mode&1)!==0?(cn&1073741824)!==0&&(Wt(t),t.subtreeFlags&6&&(t.flags|=8192)):Wt(t),null;case 24:return null;case 25:return null}throw Error(o(156,t.tag))}function Rg(e,t){switch(Ga(t),t.tag){case 1:return Jt(t.type)&&po(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return As(),ft(Qt),ft($t),al(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return il(t),null;case 13:if(ft(_t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ls()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ft(_t),null;case 4:return As(),null;case 10:return el(t.type._context),null;case 22:case 23:return Fl(),null;case 24:return null;default:return null}}var Io=!1,zt=!1,Mg=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function Ds(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(_){wt(e,t,_)}else i.current=null}function Ll(e,t,i){try{i()}catch(_){wt(e,t,_)}}var Bh=!1;function Ag(e,t){if(Fa=hs,e=gu(),Aa(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var _=i.getSelection&&i.getSelection();if(_&&_.rangeCount!==0){i=_.anchorNode;var R=_.anchorOffset,I=_.focusNode;_=_.focusOffset;try{i.nodeType,I.nodeType}catch{i=null;break e}var z=0,Q=-1,te=-1,ue=0,_e=0,ye=e,ge=null;t:for(;;){for(var Me;ye!==i||R!==0&&ye.nodeType!==3||(Q=z+R),ye!==I||_!==0&&ye.nodeType!==3||(te=z+_),ye.nodeType===3&&(z+=ye.nodeValue.length),(Me=ye.firstChild)!==null;)ge=ye,ye=Me;for(;;){if(ye===e)break t;if(ge===i&&++ue===R&&(Q=z),ge===I&&++_e===_&&(te=z),(Me=ye.nextSibling)!==null)break;ye=ge,ge=ye.parentNode}ye=Me}i=Q===-1||te===-1?null:{start:Q,end:te}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ha={focusedElem:e,selectionRange:i},hs=!1,Ne=t;Ne!==null;)if(t=Ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ne=e;else for(;Ne!==null;){t=Ne;try{var De=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(De!==null){var je=De.memoizedProps,bt=De.memoizedState,oe=t.stateNode,se=oe.getSnapshotBeforeUpdate(t.elementType===t.type?je:Cn(t.type,je),bt);oe.__reactInternalSnapshotBeforeUpdate=se}break;case 3:var le=t.stateNode.containerInfo;le.nodeType===1?le.textContent="":le.nodeType===9&&le.documentElement&&le.removeChild(le.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Ce){wt(t,t.return,Ce)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return De=Bh,Bh=!1,De}function Ei(e,t,i){var _=t.updateQueue;if(_=_!==null?_.lastEffect:null,_!==null){var R=_=_.next;do{if((R.tag&e)===e){var I=R.destroy;R.destroy=void 0,I!==void 0&&Ll(t,i,I)}R=R.next}while(R!==_)}}function Po(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var _=i.create;i.destroy=_()}i=i.next}while(i!==t)}}function Tl(e){var t=e.ref;if(t!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof t=="function"?t(e):t.current=e}}function Fh(e){var t=e.alternate;t!==null&&(e.alternate=null,Fh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Mn],delete t[mi],delete t[za],delete t[fg],delete t[pg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Hh(e){return e.tag===5||e.tag===3||e.tag===4}function $h(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rl(e,t,i){var _=e.tag;if(_===5||_===6)e=e.stateNode,t?i.nodeType===8?i.parentNode.insertBefore(e,t):i.insertBefore(e,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(e,i)):(t=i,t.appendChild(e)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=ho));else if(_!==4&&(e=e.child,e!==null))for(Rl(e,t,i),e=e.sibling;e!==null;)Rl(e,t,i),e=e.sibling}function Ml(e,t,i){var _=e.tag;if(_===5||_===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(_!==4&&(e=e.child,e!==null))for(Ml(e,t,i),e=e.sibling;e!==null;)Ml(e,t,i),e=e.sibling}var jt=null,xn=!1;function fr(e,t,i){for(i=i.child;i!==null;)Uh(e,t,i),i=i.sibling}function Uh(e,t,i){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(ss,i)}catch{}switch(i.tag){case 5:zt||Ds(i,t);case 6:var _=jt,R=xn;jt=null,fr(e,t,i),jt=_,xn=R,jt!==null&&(xn?(e=jt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):jt.removeChild(i.stateNode));break;case 18:jt!==null&&(xn?(e=jt,i=i.stateNode,e.nodeType===8?Wa(e.parentNode,i):e.nodeType===1&&Wa(e,i),tr(e)):Wa(jt,i.stateNode));break;case 4:_=jt,R=xn,jt=i.stateNode.containerInfo,xn=!0,fr(e,t,i),jt=_,xn=R;break;case 0:case 11:case 14:case 15:if(!zt&&(_=i.updateQueue,_!==null&&(_=_.lastEffect,_!==null))){R=_=_.next;do{var I=R,z=I.destroy;I=I.tag,z!==void 0&&((I&2)!==0||(I&4)!==0)&&Ll(i,t,z),R=R.next}while(R!==_)}fr(e,t,i);break;case 1:if(!zt&&(Ds(i,t),_=i.stateNode,typeof _.componentWillUnmount=="function"))try{_.props=i.memoizedProps,_.state=i.memoizedState,_.componentWillUnmount()}catch(Q){wt(i,t,Q)}fr(e,t,i);break;case 21:fr(e,t,i);break;case 22:i.mode&1?(zt=(_=zt)||i.memoizedState!==null,fr(e,t,i),zt=_):fr(e,t,i);break;default:fr(e,t,i)}}function Wh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Mg),t.forEach(function(_){var R=Hg.bind(null,e,_);i.has(_)||(i.add(_),_.then(R,R))})}}function kn(e,t){var i=t.deletions;if(i!==null)for(var _=0;_<i.length;_++){var R=i[_];try{var I=e,z=t,Q=z;e:for(;Q!==null;){switch(Q.tag){case 5:jt=Q.stateNode,xn=!1;break e;case 3:jt=Q.stateNode.containerInfo,xn=!0;break e;case 4:jt=Q.stateNode.containerInfo,xn=!0;break e}Q=Q.return}if(jt===null)throw Error(o(160));Uh(I,z,R),jt=null,xn=!1;var te=R.alternate;te!==null&&(te.return=null),R.return=null}catch(ue){wt(R,t,ue)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)zh(t,e),t=t.sibling}function zh(e,t){var i=e.alternate,_=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(kn(t,e),Dn(e),_&4){try{Ei(3,e,e.return),Po(3,e)}catch(je){wt(e,e.return,je)}try{Ei(5,e,e.return)}catch(je){wt(e,e.return,je)}}break;case 1:kn(t,e),Dn(e),_&512&&i!==null&&Ds(i,i.return);break;case 5:if(kn(t,e),Dn(e),_&512&&i!==null&&Ds(i,i.return),e.flags&32){var R=e.stateNode;try{nt(R,"")}catch(je){wt(e,e.return,je)}}if(_&4&&(R=e.stateNode,R!=null)){var I=e.memoizedProps,z=i!==null?i.memoizedProps:I,Q=e.type,te=e.updateQueue;if(e.updateQueue=null,te!==null)try{Q==="input"&&I.type==="radio"&&I.name!=null&&Se(R,I),de(Q,z);var ue=de(Q,I);for(z=0;z<te.length;z+=2){var _e=te[z],ye=te[z+1];_e==="style"?Ct(R,ye):_e==="dangerouslySetInnerHTML"?gt(R,ye):_e==="children"?nt(R,ye):h(R,_e,ye,ue)}switch(Q){case"input":me(R,I);break;case"textarea":Fe(R,I);break;case"select":var ge=R._wrapperState.wasMultiple;R._wrapperState.wasMultiple=!!I.multiple;var Me=I.value;Me!=null?Re(R,!!I.multiple,Me,!1):ge!==!!I.multiple&&(I.defaultValue!=null?Re(R,!!I.multiple,I.defaultValue,!0):Re(R,!!I.multiple,I.multiple?[]:"",!1))}R[mi]=I}catch(je){wt(e,e.return,je)}}break;case 6:if(kn(t,e),Dn(e),_&4){if(e.stateNode===null)throw Error(o(162));R=e.stateNode,I=e.memoizedProps;try{R.nodeValue=I}catch(je){wt(e,e.return,je)}}break;case 3:if(kn(t,e),Dn(e),_&4&&i!==null&&i.memoizedState.isDehydrated)try{tr(t.containerInfo)}catch(je){wt(e,e.return,je)}break;case 4:kn(t,e),Dn(e);break;case 13:kn(t,e),Dn(e),R=e.child,R.flags&8192&&(I=R.memoizedState!==null,R.stateNode.isHidden=I,!I||R.alternate!==null&&R.alternate.memoizedState!==null||(Dl=ht())),_&4&&Wh(e);break;case 22:if(_e=i!==null&&i.memoizedState!==null,e.mode&1?(zt=(ue=zt)||_e,kn(t,e),zt=ue):kn(t,e),Dn(e),_&8192){if(ue=e.memoizedState!==null,(e.stateNode.isHidden=ue)&&!_e&&(e.mode&1)!==0)for(Ne=e,_e=e.child;_e!==null;){for(ye=Ne=_e;Ne!==null;){switch(ge=Ne,Me=ge.child,ge.tag){case 0:case 11:case 14:case 15:Ei(4,ge,ge.return);break;case 1:Ds(ge,ge.return);var De=ge.stateNode;if(typeof De.componentWillUnmount=="function"){_=ge,i=ge.return;try{t=_,De.props=t.memoizedProps,De.state=t.memoizedState,De.componentWillUnmount()}catch(je){wt(_,i,je)}}break;case 5:Ds(ge,ge.return);break;case 22:if(ge.memoizedState!==null){Kh(ye);continue}}Me!==null?(Me.return=ge,Ne=Me):Kh(ye)}_e=_e.sibling}e:for(_e=null,ye=e;;){if(ye.tag===5){if(_e===null){_e=ye;try{R=ye.stateNode,ue?(I=R.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none"):(Q=ye.stateNode,te=ye.memoizedProps.style,z=te!=null&&te.hasOwnProperty("display")?te.display:null,Q.style.display=Et("display",z))}catch(je){wt(e,e.return,je)}}}else if(ye.tag===6){if(_e===null)try{ye.stateNode.nodeValue=ue?"":ye.memoizedProps}catch(je){wt(e,e.return,je)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===e)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===e)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===e)break e;_e===ye&&(_e=null),ye=ye.return}_e===ye&&(_e=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:kn(t,e),Dn(e),_&4&&Wh(e);break;case 21:break;default:kn(t,e),Dn(e)}}function Dn(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(Hh(i)){var _=i;break e}i=i.return}throw Error(o(160))}switch(_.tag){case 5:var R=_.stateNode;_.flags&32&&(nt(R,""),_.flags&=-33);var I=$h(e);Ml(e,I,R);break;case 3:case 4:var z=_.stateNode.containerInfo,Q=$h(e);Rl(e,Q,z);break;default:throw Error(o(161))}}catch(te){wt(e,e.return,te)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ng(e,t,i){Ne=e,Vh(e)}function Vh(e,t,i){for(var _=(e.mode&1)!==0;Ne!==null;){var R=Ne,I=R.child;if(R.tag===22&&_){var z=R.memoizedState!==null||Io;if(!z){var Q=R.alternate,te=Q!==null&&Q.memoizedState!==null||zt;Q=Io;var ue=zt;if(Io=z,(zt=te)&&!ue)for(Ne=R;Ne!==null;)z=Ne,te=z.child,z.tag===22&&z.memoizedState!==null?Gh(R):te!==null?(te.return=z,Ne=te):Gh(R);for(;I!==null;)Ne=I,Vh(I),I=I.sibling;Ne=R,Io=Q,zt=ue}qh(e)}else(R.subtreeFlags&8772)!==0&&I!==null?(I.return=R,Ne=I):qh(e)}}function qh(e){for(;Ne!==null;){var t=Ne;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:zt||Po(5,t);break;case 1:var _=t.stateNode;if(t.flags&4&&!zt)if(i===null)_.componentDidMount();else{var R=t.elementType===t.type?i.memoizedProps:Cn(t.type,i.memoizedProps);_.componentDidUpdate(R,i.memoizedState,_.__reactInternalSnapshotBeforeUpdate)}var I=t.updateQueue;I!==null&&Ku(t,I,_);break;case 3:var z=t.updateQueue;if(z!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}Ku(t,z,i)}break;case 5:var Q=t.stateNode;if(i===null&&t.flags&4){i=Q;var te=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&i.focus();break;case"img":te.src&&(i.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var ue=t.alternate;if(ue!==null){var _e=ue.memoizedState;if(_e!==null){var ye=_e.dehydrated;ye!==null&&tr(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}zt||t.flags&512&&Tl(t)}catch(ge){wt(t,t.return,ge)}}if(t===e){Ne=null;break}if(i=t.sibling,i!==null){i.return=t.return,Ne=i;break}Ne=t.return}}function Kh(e){for(;Ne!==null;){var t=Ne;if(t===e){Ne=null;break}var i=t.sibling;if(i!==null){i.return=t.return,Ne=i;break}Ne=t.return}}function Gh(e){for(;Ne!==null;){var t=Ne;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{Po(4,t)}catch(te){wt(t,i,te)}break;case 1:var _=t.stateNode;if(typeof _.componentDidMount=="function"){var R=t.return;try{_.componentDidMount()}catch(te){wt(t,R,te)}}var I=t.return;try{Tl(t)}catch(te){wt(t,I,te)}break;case 5:var z=t.return;try{Tl(t)}catch(te){wt(t,z,te)}}}catch(te){wt(t,t.return,te)}if(t===e){Ne=null;break}var Q=t.sibling;if(Q!==null){Q.return=t.return,Ne=Q;break}Ne=t.return}}var Dg=Math.ceil,jo=C.ReactCurrentDispatcher,Al=C.ReactCurrentOwner,mn=C.ReactCurrentBatchConfig,rt=0,Dt=null,xt=null,Ot=0,cn=0,Is=lr(0),Rt=0,Li=null,Xr=0,Oo=0,Nl=0,Ti=null,en=null,Dl=0,Ps=1/0,qn=null,Bo=!1,Il=null,pr=null,Fo=!1,mr=null,Ho=0,Ri=0,Pl=null,$o=-1,Uo=0;function Yt(){return(rt&6)!==0?ht():$o!==-1?$o:$o=ht()}function gr(e){return(e.mode&1)===0?1:(rt&2)!==0&&Ot!==0?Ot&-Ot:gg.transition!==null?(Uo===0&&(Uo=Qs()),Uo):(e=st,e!==0||(e=window.event,e=e===void 0?16:fs(e.type)),e)}function En(e,t,i,_){if(50<Ri)throw Ri=0,Pl=null,Error(o(185));Qn(e,i,_),((rt&2)===0||e!==Dt)&&(e===Dt&&((rt&2)===0&&(Oo|=i),Rt===4&&_r(e,Ot)),tn(e,_),i===1&&rt===0&&(t.mode&1)===0&&(Ps=ht()+500,go&&ur()))}function tn(e,t){var i=e.callbackNode;ba(e,t);var _=Ir(e,e===Dt?Ot:0);if(_===0)i!==null&&rs(i),e.callbackNode=null,e.callbackPriority=0;else if(t=_&-_,e.callbackPriority!==t){if(i!=null&&rs(i),t===1)e.tag===0?mg(Xh.bind(null,e)):Pu(Xh.bind(null,e)),hg(function(){(rt&6)===0&&ur()}),i=null;else{switch(Zs(_)){case 1:i=Yn;break;case 4:i=Ar;break;case 16:i=vn;break;case 536870912:i=sn;break;default:i=vn}i=sd(i,Yh.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function Yh(e,t){if($o=-1,Uo=0,(rt&6)!==0)throw Error(o(327));var i=e.callbackNode;if(js()&&e.callbackNode!==i)return null;var _=Ir(e,e===Dt?Ot:0);if(_===0)return null;if((_&30)!==0||(_&e.expiredLanes)!==0||t)t=Wo(e,_);else{t=_;var R=rt;rt|=2;var I=Jh();(Dt!==e||Ot!==t)&&(qn=null,Ps=ht()+500,Jr(e,t));do try{jg();break}catch(Q){Qh(e,Q)}while(!0);Za(),jo.current=I,rt=R,xt!==null?t=0:(Dt=null,Ot=0,t=Rt)}if(t!==0){if(t===2&&(R=os(e),R!==0&&(_=R,t=jl(e,R))),t===1)throw i=Li,Jr(e,0),_r(e,_),tn(e,ht()),i;if(t===6)_r(e,_);else{if(R=e.current.alternate,(_&30)===0&&!Ig(R)&&(t=Wo(e,_),t===2&&(I=os(e),I!==0&&(_=I,t=jl(e,I))),t===1))throw i=Li,Jr(e,0),_r(e,_),tn(e,ht()),i;switch(e.finishedWork=R,e.finishedLanes=_,t){case 0:case 1:throw Error(o(345));case 2:Zr(e,en,qn);break;case 3:if(_r(e,_),(_&130023424)===_&&(t=Dl+500-ht(),10<t)){if(Ir(e,0)!==0)break;if(R=e.suspendedLanes,(R&_)!==_){Yt(),e.pingedLanes|=e.suspendedLanes&R;break}e.timeoutHandle=Ua(Zr.bind(null,e,en,qn),t);break}Zr(e,en,qn);break;case 4:if(_r(e,_),(_&4194240)===_)break;for(t=e.eventTimes,R=-1;0<_;){var z=31-Ft(_);I=1<<z,z=t[z],z>R&&(R=z),_&=~I}if(_=R,_=ht()-_,_=(120>_?120:480>_?480:1080>_?1080:1920>_?1920:3e3>_?3e3:4320>_?4320:1960*Dg(_/1960))-_,10<_){e.timeoutHandle=Ua(Zr.bind(null,e,en,qn),_);break}Zr(e,en,qn);break;case 5:Zr(e,en,qn);break;default:throw Error(o(329))}}}return tn(e,ht()),e.callbackNode===i?Yh.bind(null,e):null}function jl(e,t){var i=Ti;return e.current.memoizedState.isDehydrated&&(Jr(e,t).flags|=256),e=Wo(e,t),e!==2&&(t=en,en=i,t!==null&&Ol(t)),e}function Ol(e){en===null?en=e:en.push.apply(en,e)}function Ig(e){for(var t=e;;){if(t.flags&16384){var i=t.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var _=0;_<i.length;_++){var R=i[_],I=R.getSnapshot;R=R.value;try{if(!bn(I(),R))return!1}catch{return!1}}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _r(e,t){for(t&=~Nl,t&=~Oo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-Ft(t),_=1<<i;e[i]=-1,t&=~_}}function Xh(e){if((rt&6)!==0)throw Error(o(327));js();var t=Ir(e,0);if((t&1)===0)return tn(e,ht()),null;var i=Wo(e,t);if(e.tag!==0&&i===2){var _=os(e);_!==0&&(t=_,i=jl(e,_))}if(i===1)throw i=Li,Jr(e,0),_r(e,t),tn(e,ht()),i;if(i===6)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Zr(e,en,qn),tn(e,ht()),null}function Bl(e,t){var i=rt;rt|=1;try{return e(t)}finally{rt=i,rt===0&&(Ps=ht()+500,go&&ur())}}function Qr(e){mr!==null&&mr.tag===0&&(rt&6)===0&&js();var t=rt;rt|=1;var i=mn.transition,_=st;try{if(mn.transition=null,st=1,e)return e()}finally{st=_,mn.transition=i,rt=t,(rt&6)===0&&ur()}}function Fl(){cn=Is.current,ft(Is)}function Jr(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,ug(i)),xt!==null)for(i=xt.return;i!==null;){var _=i;switch(Ga(_),_.tag){case 1:_=_.type.childContextTypes,_!=null&&po();break;case 3:As(),ft(Qt),ft($t),al();break;case 5:il(_);break;case 4:As();break;case 13:ft(_t);break;case 19:ft(_t);break;case 10:el(_.type._context);break;case 22:case 23:Fl()}i=i.return}if(Dt=e,xt=e=vr(e.current,null),Ot=cn=t,Rt=0,Li=null,Nl=Oo=Xr=0,en=Ti=null,Kr!==null){for(t=0;t<Kr.length;t++)if(i=Kr[t],_=i.interleaved,_!==null){i.interleaved=null;var R=_.next,I=i.pending;if(I!==null){var z=I.next;I.next=R,_.next=z}i.pending=_}Kr=null}return e}function Qh(e,t){do{var i=xt;try{if(Za(),Eo.current=Mo,Lo){for(var _=vt.memoizedState;_!==null;){var R=_.queue;R!==null&&(R.pending=null),_=_.next}Lo=!1}if(Yr=0,Nt=Tt=vt=null,bi=!1,Si=0,Al.current=null,i===null||i.return===null){Rt=1,Li=t,xt=null;break}e:{var I=e,z=i.return,Q=i,te=t;if(t=Ot,Q.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var ue=te,_e=Q,ye=_e.tag;if((_e.mode&1)===0&&(ye===0||ye===11||ye===15)){var ge=_e.alternate;ge?(_e.updateQueue=ge.updateQueue,_e.memoizedState=ge.memoizedState,_e.lanes=ge.lanes):(_e.updateQueue=null,_e.memoizedState=null)}var Me=Sh(z);if(Me!==null){Me.flags&=-257,Ch(Me,z,Q,I,t),Me.mode&1&&bh(I,ue,t),t=Me,te=ue;var De=t.updateQueue;if(De===null){var je=new Set;je.add(te),t.updateQueue=je}else De.add(te);break e}else{if((t&1)===0){bh(I,ue,t),Hl();break e}te=Error(o(426))}}else if(mt&&Q.mode&1){var bt=Sh(z);if(bt!==null){(bt.flags&65536)===0&&(bt.flags|=256),Ch(bt,z,Q,I,t),Qa(Ns(te,Q));break e}}I=te=Ns(te,Q),Rt!==4&&(Rt=2),Ti===null?Ti=[I]:Ti.push(I),I=z;do{switch(I.tag){case 3:I.flags|=65536,t&=-t,I.lanes|=t;var oe=yh(I,te,t);qu(I,oe);break e;case 1:Q=te;var se=I.type,le=I.stateNode;if((I.flags&128)===0&&(typeof se.getDerivedStateFromError=="function"||le!==null&&typeof le.componentDidCatch=="function"&&(pr===null||!pr.has(le)))){I.flags|=65536,t&=-t,I.lanes|=t;var Ce=wh(I,Q,t);qu(I,Ce);break e}}I=I.return}while(I!==null)}ed(i)}catch(Oe){t=Oe,xt===i&&i!==null&&(xt=i=i.return);continue}break}while(!0)}function Jh(){var e=jo.current;return jo.current=Mo,e===null?Mo:e}function Hl(){(Rt===0||Rt===3||Rt===2)&&(Rt=4),Dt===null||(Xr&268435455)===0&&(Oo&268435455)===0||_r(Dt,Ot)}function Wo(e,t){var i=rt;rt|=2;var _=Jh();(Dt!==e||Ot!==t)&&(qn=null,Jr(e,t));do try{Pg();break}catch(R){Qh(e,R)}while(!0);if(Za(),rt=i,jo.current=_,xt!==null)throw Error(o(261));return Dt=null,Ot=0,Rt}function Pg(){for(;xt!==null;)Zh(xt)}function jg(){for(;xt!==null&&!ya();)Zh(xt)}function Zh(e){var t=rd(e.alternate,e,cn);e.memoizedProps=e.pendingProps,t===null?ed(e):xt=t,Al.current=null}function ed(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=Tg(i,t,cn),i!==null){xt=i;return}}else{if(i=Rg(i,t),i!==null){i.flags&=32767,xt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Rt=6,xt=null;return}}if(t=t.sibling,t!==null){xt=t;return}xt=t=e}while(t!==null);Rt===0&&(Rt=5)}function Zr(e,t,i){var _=st,R=mn.transition;try{mn.transition=null,st=1,Og(e,t,i,_)}finally{mn.transition=R,st=_}return null}function Og(e,t,i,_){do js();while(mr!==null);if((rt&6)!==0)throw Error(o(327));i=e.finishedWork;var R=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var I=i.lanes|i.childLanes;if(Sa(e,I),e===Dt&&(xt=Dt=null,Ot=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Fo||(Fo=!0,sd(vn,function(){return js(),null})),I=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||I){I=mn.transition,mn.transition=null;var z=st;st=1;var Q=rt;rt|=4,Al.current=null,Ag(e,i),zh(i,e),rg(Ha),hs=!!Fa,Ha=Fa=null,e.current=i,Ng(i),Gs(),rt=Q,st=z,mn.transition=I}else e.current=i;if(Fo&&(Fo=!1,mr=e,Ho=R),I=e.pendingLanes,I===0&&(pr=null),Xn(i.stateNode),tn(e,ht()),t!==null)for(_=e.onRecoverableError,i=0;i<t.length;i++)R=t[i],_(R.value,{componentStack:R.stack,digest:R.digest});if(Bo)throw Bo=!1,e=Il,Il=null,e;return(Ho&1)!==0&&e.tag!==0&&js(),I=e.pendingLanes,(I&1)!==0?e===Pl?Ri++:(Ri=0,Pl=e):Ri=0,ur(),null}function js(){if(mr!==null){var e=Zs(Ho),t=mn.transition,i=st;try{if(mn.transition=null,st=16>e?16:e,mr===null)var _=!1;else{if(e=mr,mr=null,Ho=0,(rt&6)!==0)throw Error(o(331));var R=rt;for(rt|=4,Ne=e.current;Ne!==null;){var I=Ne,z=I.child;if((Ne.flags&16)!==0){var Q=I.deletions;if(Q!==null){for(var te=0;te<Q.length;te++){var ue=Q[te];for(Ne=ue;Ne!==null;){var _e=Ne;switch(_e.tag){case 0:case 11:case 15:Ei(8,_e,I)}var ye=_e.child;if(ye!==null)ye.return=_e,Ne=ye;else for(;Ne!==null;){_e=Ne;var ge=_e.sibling,Me=_e.return;if(Fh(_e),_e===ue){Ne=null;break}if(ge!==null){ge.return=Me,Ne=ge;break}Ne=Me}}}var De=I.alternate;if(De!==null){var je=De.child;if(je!==null){De.child=null;do{var bt=je.sibling;je.sibling=null,je=bt}while(je!==null)}}Ne=I}}if((I.subtreeFlags&2064)!==0&&z!==null)z.return=I,Ne=z;else e:for(;Ne!==null;){if(I=Ne,(I.flags&2048)!==0)switch(I.tag){case 0:case 11:case 15:Ei(9,I,I.return)}var oe=I.sibling;if(oe!==null){oe.return=I.return,Ne=oe;break e}Ne=I.return}}var se=e.current;for(Ne=se;Ne!==null;){z=Ne;var le=z.child;if((z.subtreeFlags&2064)!==0&&le!==null)le.return=z,Ne=le;else e:for(z=se;Ne!==null;){if(Q=Ne,(Q.flags&2048)!==0)try{switch(Q.tag){case 0:case 11:case 15:Po(9,Q)}}catch(Oe){wt(Q,Q.return,Oe)}if(Q===z){Ne=null;break e}var Ce=Q.sibling;if(Ce!==null){Ce.return=Q.return,Ne=Ce;break e}Ne=Q.return}}if(rt=R,ur(),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(ss,e)}catch{}_=!0}return _}finally{st=i,mn.transition=t}}return!1}function td(e,t,i){t=Ns(i,t),t=yh(e,t,1),e=dr(e,t,1),t=Yt(),e!==null&&(Qn(e,1,t),tn(e,t))}function wt(e,t,i){if(e.tag===3)td(e,e,i);else for(;t!==null;){if(t.tag===3){td(t,e,i);break}else if(t.tag===1){var _=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof _.componentDidCatch=="function"&&(pr===null||!pr.has(_))){e=Ns(i,e),e=wh(t,e,1),t=dr(t,e,1),e=Yt(),t!==null&&(Qn(t,1,e),tn(t,e));break}}t=t.return}}function Bg(e,t,i){var _=e.pingCache;_!==null&&_.delete(t),t=Yt(),e.pingedLanes|=e.suspendedLanes&i,Dt===e&&(Ot&i)===i&&(Rt===4||Rt===3&&(Ot&130023424)===Ot&&500>ht()-Dl?Jr(e,0):Nl|=i),tn(e,t)}function nd(e,t){t===0&&((e.mode&1)===0?t=1:(t=Nr,Nr<<=1,(Nr&130023424)===0&&(Nr=4194304)));var i=Yt();e=Wn(e,t),e!==null&&(Qn(e,t,i),tn(e,i))}function Fg(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),nd(e,i)}function Hg(e,t){var i=0;switch(e.tag){case 13:var _=e.stateNode,R=e.memoizedState;R!==null&&(i=R.retryLane);break;case 19:_=e.stateNode;break;default:throw Error(o(314))}_!==null&&_.delete(t),nd(e,i)}var rd;rd=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qt.current)Zt=!0;else{if((e.lanes&i)===0&&(t.flags&128)===0)return Zt=!1,Lg(e,t,i);Zt=(e.flags&131072)!==0}else Zt=!1,mt&&(t.flags&1048576)!==0&&ju(t,vo,t.index);switch(t.lanes=0,t.tag){case 2:var _=t.type;Do(e,t),e=t.pendingProps;var R=xs(t,$t.current);Ms(t,i),R=ul(null,t,_,e,R,i);var I=hl();return t.flags|=1,typeof R=="object"&&R!==null&&typeof R.render=="function"&&R.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jt(_)?(I=!0,mo(t)):I=!1,t.memoizedState=R.state!==null&&R.state!==void 0?R.state:null,rl(t),R.updater=Ao,t.stateNode=R,R._reactInternals=t,_l(t,_,e,i),t=bl(null,t,_,!0,I,i)):(t.tag=0,mt&&I&&Ka(t),Gt(null,t,R,i),t=t.child),t;case 16:_=t.elementType;e:{switch(Do(e,t),e=t.pendingProps,R=_._init,_=R(_._payload),t.type=_,R=t.tag=Ug(_),e=Cn(_,e),R){case 0:t=wl(null,t,_,e,i);break e;case 1:t=Rh(null,t,_,e,i);break e;case 11:t=xh(null,t,_,e,i);break e;case 14:t=kh(null,t,_,Cn(_.type,e),i);break e}throw Error(o(306,_,""))}return t;case 0:return _=t.type,R=t.pendingProps,R=t.elementType===_?R:Cn(_,R),wl(e,t,_,R,i);case 1:return _=t.type,R=t.pendingProps,R=t.elementType===_?R:Cn(_,R),Rh(e,t,_,R,i);case 3:e:{if(Mh(t),e===null)throw Error(o(387));_=t.pendingProps,I=t.memoizedState,R=I.element,Vu(e,t),xo(t,_,null,i);var z=t.memoizedState;if(_=z.element,I.isDehydrated)if(I={element:_,isDehydrated:!1,cache:z.cache,pendingSuspenseBoundaries:z.pendingSuspenseBoundaries,transitions:z.transitions},t.updateQueue.baseState=I,t.memoizedState=I,t.flags&256){R=Ns(Error(o(423)),t),t=Ah(e,t,_,i,R);break e}else if(_!==R){R=Ns(Error(o(424)),t),t=Ah(e,t,_,i,R);break e}else for(ln=ar(t.stateNode.containerInfo.firstChild),an=t,mt=!0,Sn=null,i=Wu(t,null,_,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ls(),_===R){t=Vn(e,t,i);break e}Gt(e,t,_,i)}t=t.child}return t;case 5:return Gu(t),e===null&&Xa(t),_=t.type,R=t.pendingProps,I=e!==null?e.memoizedProps:null,z=R.children,$a(_,R)?z=null:I!==null&&$a(_,I)&&(t.flags|=32),Th(e,t),Gt(e,t,z,i),t.child;case 6:return e===null&&Xa(t),null;case 13:return Nh(e,t,i);case 4:return sl(t,t.stateNode.containerInfo),_=t.pendingProps,e===null?t.child=Ts(t,null,_,i):Gt(e,t,_,i),t.child;case 11:return _=t.type,R=t.pendingProps,R=t.elementType===_?R:Cn(_,R),xh(e,t,_,R,i);case 7:return Gt(e,t,t.pendingProps,i),t.child;case 8:return Gt(e,t,t.pendingProps.children,i),t.child;case 12:return Gt(e,t,t.pendingProps.children,i),t.child;case 10:e:{if(_=t.type._context,R=t.pendingProps,I=t.memoizedProps,z=R.value,ct(bo,_._currentValue),_._currentValue=z,I!==null)if(bn(I.value,z)){if(I.children===R.children&&!Qt.current){t=Vn(e,t,i);break e}}else for(I=t.child,I!==null&&(I.return=t);I!==null;){var Q=I.dependencies;if(Q!==null){z=I.child;for(var te=Q.firstContext;te!==null;){if(te.context===_){if(I.tag===1){te=zn(-1,i&-i),te.tag=2;var ue=I.updateQueue;if(ue!==null){ue=ue.shared;var _e=ue.pending;_e===null?te.next=te:(te.next=_e.next,_e.next=te),ue.pending=te}}I.lanes|=i,te=I.alternate,te!==null&&(te.lanes|=i),tl(I.return,i,t),Q.lanes|=i;break}te=te.next}}else if(I.tag===10)z=I.type===t.type?null:I.child;else if(I.tag===18){if(z=I.return,z===null)throw Error(o(341));z.lanes|=i,Q=z.alternate,Q!==null&&(Q.lanes|=i),tl(z,i,t),z=I.sibling}else z=I.child;if(z!==null)z.return=I;else for(z=I;z!==null;){if(z===t){z=null;break}if(I=z.sibling,I!==null){I.return=z.return,z=I;break}z=z.return}I=z}Gt(e,t,R.children,i),t=t.child}return t;case 9:return R=t.type,_=t.pendingProps.children,Ms(t,i),R=fn(R),_=_(R),t.flags|=1,Gt(e,t,_,i),t.child;case 14:return _=t.type,R=Cn(_,t.pendingProps),R=Cn(_.type,R),kh(e,t,_,R,i);case 15:return Eh(e,t,t.type,t.pendingProps,i);case 17:return _=t.type,R=t.pendingProps,R=t.elementType===_?R:Cn(_,R),Do(e,t),t.tag=1,Jt(_)?(e=!0,mo(t)):e=!1,Ms(t,i),_h(t,_,R),_l(t,_,R,i),bl(null,t,_,!0,e,i);case 19:return Ih(e,t,i);case 22:return Lh(e,t,i)}throw Error(o(156,t.tag))};function sd(e,t){return Qi(e,t)}function $g(e,t,i,_){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gn(e,t,i,_){return new $g(e,t,i,_)}function $l(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ug(e){if(typeof e=="function")return $l(e)?1:0;if(e!=null){if(e=e.$$typeof,e===P)return 11;if(e===q)return 14}return 2}function vr(e,t){var i=e.alternate;return i===null?(i=gn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function zo(e,t,i,_,R,I){var z=2;if(_=e,typeof e=="function")$l(e)&&(z=1);else if(typeof e=="string")z=5;else e:switch(e){case M:return es(i.children,R,I,t);case b:z=8,R|=8;break;case L:return e=gn(12,i,t,R|2),e.elementType=L,e.lanes=I,e;case F:return e=gn(13,i,t,R),e.elementType=F,e.lanes=I,e;case H:return e=gn(19,i,t,R),e.elementType=H,e.lanes=I,e;case G:return Vo(i,R,I,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:z=10;break e;case B:z=9;break e;case P:z=11;break e;case q:z=14;break e;case X:z=16,_=null;break e}throw Error(o(130,e==null?e:typeof e,""))}return t=gn(z,i,t,R),t.elementType=e,t.type=_,t.lanes=I,t}function es(e,t,i,_){return e=gn(7,e,_,t),e.lanes=i,e}function Vo(e,t,i,_){return e=gn(22,e,_,t),e.elementType=G,e.lanes=i,e.stateNode={isHidden:!1},e}function Ul(e,t,i){return e=gn(6,e,null,t),e.lanes=i,e}function Wl(e,t,i){return t=gn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Wg(e,t,i,_,R){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=as(0),this.expirationTimes=as(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=as(0),this.identifierPrefix=_,this.onRecoverableError=R,this.mutableSourceEagerHydrationData=null}function zl(e,t,i,_,R,I,z,Q,te){return e=new Wg(e,t,i,Q,te),t===1?(t=1,I===!0&&(t|=8)):t=0,I=gn(3,null,null,t),e.current=I,I.stateNode=e,I.memoizedState={element:_,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},rl(I),e}function zg(e,t,i){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:x,key:_==null?null:""+_,children:e,containerInfo:t,implementation:i}}function id(e){if(!e)return cr;e=e._reactInternals;e:{if(un(e)!==e||e.tag!==1)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(o(171))}if(e.tag===1){var i=e.type;if(Jt(i))return Du(e,i,t)}return t}function od(e,t,i,_,R,I,z,Q,te){return e=zl(i,_,!0,e,R,I,z,Q,te),e.context=id(null),i=e.current,_=Yt(),R=gr(i),I=zn(_,R),I.callback=t??null,dr(i,I,R),e.current.lanes=R,Qn(e,R,_),tn(e,_),e}function qo(e,t,i,_){var R=t.current,I=Yt(),z=gr(R);return i=id(i),t.context===null?t.context=i:t.pendingContext=i,t=zn(I,z),t.payload={element:e},_=_===void 0?null:_,_!==null&&(t.callback=_),e=dr(R,t,z),e!==null&&(En(e,R,z,I),Co(e,R,z)),z}function Ko(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function ad(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Vl(e,t){ad(e,t),(e=e.alternate)&&ad(e,t)}function Vg(){return null}var ld=typeof reportError=="function"?reportError:function(e){console.error(e)};function ql(e){this._internalRoot=e}Go.prototype.render=ql.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));qo(e,t,null,null)},Go.prototype.unmount=ql.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qr(function(){qo(null,e,null,null)}),t[Fn]=null}};function Go(e){this._internalRoot=e}Go.prototype.unstable_scheduleHydration=function(e){if(e){var t=Zi();e={blockedOn:null,target:e,priority:t};for(var i=0;i<yn.length&&t!==0&&t<yn[i].priority;i++);yn.splice(i,0,e),i===0&&no(e)}};function Kl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Yo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function cd(){}function qg(e,t,i,_,R){if(R){if(typeof _=="function"){var I=_;_=function(){var ue=Ko(z);I.call(ue)}}var z=od(t,_,e,0,null,!1,!1,"",cd);return e._reactRootContainer=z,e[Fn]=z.current,fi(e.nodeType===8?e.parentNode:e),Qr(),z}for(;R=e.lastChild;)e.removeChild(R);if(typeof _=="function"){var Q=_;_=function(){var ue=Ko(te);Q.call(ue)}}var te=zl(e,0,!1,null,null,!1,!1,"",cd);return e._reactRootContainer=te,e[Fn]=te.current,fi(e.nodeType===8?e.parentNode:e),Qr(function(){qo(t,te,i,_)}),te}function Xo(e,t,i,_,R){var I=i._reactRootContainer;if(I){var z=I;if(typeof R=="function"){var Q=R;R=function(){var te=Ko(z);Q.call(te)}}qo(t,z,e,R)}else z=qg(i,t,e,R,_);return Ko(z)}ei=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=Dr(t.pendingLanes);i!==0&&(Js(t,i|1),tn(t,ht()),(rt&6)===0&&(Ps=ht()+500,ur()))}break;case 13:Qr(function(){var _=Wn(e,1);if(_!==null){var R=Yt();En(_,e,1,R)}}),Vl(e,1)}},Pr=function(e){if(e.tag===13){var t=Wn(e,134217728);if(t!==null){var i=Yt();En(t,e,134217728,i)}Vl(e,134217728)}},ls=function(e){if(e.tag===13){var t=gr(e),i=Wn(e,t);if(i!==null){var _=Yt();En(i,e,t,_)}Vl(e,t)}},Zi=function(){return st},eo=function(e,t){var i=st;try{return st=e,t()}finally{st=i}},ot=function(e,t,i){switch(t){case"input":if(me(e,i),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var _=i[t];if(_!==e&&_.form===e.form){var R=fo(_);if(!R)throw Error(o(90));ne(_),me(_,R)}}}break;case"textarea":Fe(e,i);break;case"select":t=i.value,t!=null&&Re(e,!!i.multiple,t,!1)}},Kn=Bl,ns=Qr;var Kg={usingClientEntryPoint:!1,Events:[gi,Ss,fo,Lt,At,Bl]},Mi={findFiberByHostInstance:Wr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Gg={bundleType:Mi.bundleType,version:Mi.version,rendererPackageName:Mi.rendererPackageName,rendererConfig:Mi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Yi(e),e===null?null:e.stateNode},findFiberByHostInstance:Mi.findFiberByHostInstance||Vg,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 Qo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qo.isDisabled&&Qo.supportsFiber)try{ss=Qo.inject(Gg),on=Qo}catch{}}return nn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kg,nn.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Kl(t))throw Error(o(200));return zg(e,t,null,i)},nn.createRoot=function(e,t){if(!Kl(e))throw Error(o(299));var i=!1,_="",R=ld;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(_=t.identifierPrefix),t.onRecoverableError!==void 0&&(R=t.onRecoverableError)),t=zl(e,1,!1,null,null,i,!1,_,R),e[Fn]=t.current,fi(e.nodeType===8?e.parentNode:e),new ql(t)},nn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=Yi(t),e=e===null?null:e.stateNode,e},nn.flushSync=function(e){return Qr(e)},nn.hydrate=function(e,t,i){if(!Yo(t))throw Error(o(200));return Xo(null,e,t,!0,i)},nn.hydrateRoot=function(e,t,i){if(!Kl(e))throw Error(o(405));var _=i!=null&&i.hydratedSources||null,R=!1,I="",z=ld;if(i!=null&&(i.unstable_strictMode===!0&&(R=!0),i.identifierPrefix!==void 0&&(I=i.identifierPrefix),i.onRecoverableError!==void 0&&(z=i.onRecoverableError)),t=od(t,null,e,1,i??null,R,!1,I,z),e[Fn]=t.current,fi(e),_)for(e=0;e<_.length;e++)i=_[e],R=i._getVersion,R=R(i._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[i,R]:t.mutableSourceEagerHydrationData.push(i,R);return new Go(t)},nn.render=function(e,t,i){if(!Yo(t))throw Error(o(200));return Xo(null,e,t,!1,i)},nn.unmountComponentAtNode=function(e){if(!Yo(e))throw Error(o(40));return e._reactRootContainer?(Qr(function(){Xo(null,null,e,!1,function(){e._reactRootContainer=null,e[Fn]=null})}),!0):!1},nn.unstable_batchedUpdates=Bl,nn.unstable_renderSubtreeIntoContainer=function(e,t,i,_){if(!Yo(i))throw Error(o(200));if(e==null||e._reactInternals===void 0)throw Error(o(38));return Xo(e,t,i,!1,_)},nn.version="18.3.1-next-f1338f8080-20240426",nn}var _d;function Gf(){if(_d)return Xl.exports;_d=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Xl.exports=s_(),Xl.exports}var vd;function i_(){if(vd)return Jo;vd=1;var n=Gf();return Jo.createRoot=n.createRoot,Jo.hydrateRoot=n.hydrateRoot,Jo}var o_=i_(),O=Uc();const a_=Jg(O);function Be(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)?n:null}function Ae(n){return typeof n=="string"?n:null}function be(n){return typeof n=="string"&&n.length>0?n:null}function at(n){return typeof n=="boolean"?n:null}function He(n){return typeof n=="number"&&Number.isFinite(n)?n:null}function sa(n){if(!Array.isArray(n))return null;const r=[];for(const o of n){if(typeof o!="string")return null;r.push(o)}return r}function pt(n,r){if(!Array.isArray(n))return null;const o=[];for(const m of n){const w=r(m);if(w===null)return null;o.push(w)}return o}function _n(n,r){if(!Array.isArray(n))return null;const o=[];for(const m of n){const w=r(m);w!==null&&o.push(w)}return o}function Qe(n,r){return typeof n=="string"&&r.includes(n)?n:null}function l_(n){try{return JSON.parse(n)}catch{return}}const c_=["auto","default","acceptEdits","plan"];function Hs(n){return typeof n=="string"&&c_.includes(n)}const u_={agentUnknown:[],answerInterrupted:[],answerInvalid:[],answerNoFreeText:[],answerNotPending:[],answerSendFailed:[],answersUnsupported:[],archiveOpenTab:[],attachmentEmpty:["name"],attachmentExecutable:["name"],attachmentSaveFailed:[],attachmentTooLarge:["max","name","size"],badMessage:[],cliMissing:["command","url"],cliNotFound:[],cliNotInstalled:["label"],cliOpenFailed:[],continueFailed:[],continueHistoryMissing:[],continueNoFolder:[],continueNotInHistory:[],continueReadFailed:[],continueSameCli:[],continueTabFailed:[],continueTranscriptFailed:[],conversationNotFollowed:[],cwdMissing:["cwd"],cwdNotDir:["cwd"],diffBinaryUntracked:[],diffNewEmpty:[],diffNoStaged:[],diffNoUnstaged:[],diffReadFailed:[],dirReadFailed:[],dirSearchFailed:[],fileReadFailed:[],filesPerMessage:["max"],gitCommandFailed:["command"],gitMissing:[],gitNotFound:[],gitNotRepo:[],gitRunFailed:[],gitStatusUnknown:[],gitUnexpected:["command"],handoffEmpty:[],handoffNoTranscript:[],imageEmpty:[],imageTooLarge:["max","size"],imageTypeUnsupported:["type"],imageUnknownFormat:[],imagesPerMessage:["max"],imagesUnsupported:[],memoryAppeared:["file"],memoryBrokenBlock:["file"],memoryChooseFile:[],memoryGitFailed:["detail"],memoryHardLinks:["file"],memoryLinkOutside:["path"],memoryNotAFile:["label"],memoryNotInstalled:[],memoryNotUtf8:["file"],memoryNoteClaude:[],memoryNoteGone:[],memoryNoteHardLink:["path"],memoryNoteHardLinkCmd:["path"],memoryNoteName:[],memoryNoteOpenCode:[],memorySameFile:["file","other"],memoryViaEncoding:["file"],memoryViaFallback:[],memoryViaFile:["file"],memoryViaNoBlock:["file"],memoryViaNoBlockEither:[],memoryViaNoFolder:[],memoryViaNoIndex:[],memoryViaOutside:["file"],modePendingConfirmation:[],modeUnreachable:["key"],modesUnsupported:[],noteCliNotStarted:[],noteEmpty:[],noteExists:[],noteGone:[],noteIdInvalid:[],noteImageFailed:[],noteImagesMax:["max"],noteImagesUnsupported:[],noteInterrupted:[],noteNoAgent:[],noteNoReadySignal:[],noteSaveFailed:[],noteTooLong:["max"],notesMax:["max"],openToolSubmit:["label"],operationFailed:["detail"],pasteImageFailed:[],pathMissing:[],pathNotRelative:[],pathNullByte:[],pathOpenFailed:[],pathOutside:[],pendingSubmitAnswer:["label"],pendingSubmitPermission:["label"],pickerCliFolder:[],pickerClosed:[],pickerCreateFailed:[],pickerFolderExists:[],pickerListFailed:[],pickerNameChars:[],pickerNameInvalid:[],pickerNoProjectsHere:[],pickerNotListed:[],pickerRootMissing:[],pickerTooMany:[],planReadFailed:[],raw:["text"],relaunchCloseFailed:[],remoteDeviceGone:[],remoteFailed:[],remoteHostOnly:[],remoteNotActive:[],remoteOpensOnHost:[],remotePortInvalid:["max","min"],remoteTooManyDevices:["max"],searchFailed:[],shellNotFound:[],submitInterrupted:[],submitStoppedTool:["label"],submitStoppedToolNoLabel:[],submitStoppedWaiting:["label"],submitStoppedWaitingNoLabel:[],tabClosedWhileOpening:[],tabDirGone:[],tabOpenFailed:[],terminalAsleep:[],terminalGone:[],terminalOpenFailed:[],tooManyTabs:["max"],vaultBusyMeasuring:[],vaultBusyMoving:[],vaultBusyWriting:[],vaultCannotWrite:[],vaultCurrentInsideTarget:[],vaultDiskFull:["detail"],vaultFailed:[],vaultIndexNotReady:[],vaultMeasureFirst:[],vaultMemoryFailed:["cwd","detail"],vaultMoveFailed:["detail"],vaultMoving:[],vaultNoCopyYet:[],vaultNotLoaded:[],vaultProjectGone:[],vaultReasonNewerFormat:[],vaultReasonOriginMissing:[],vaultReasonUnsafeId:[],vaultSessionFailed:["agent","detail","session"],vaultSessionMissing:[],vaultTargetCliFolder:[],vaultTargetInsideCurrent:[],vaultTargetNotAbsolute:[],waitingSubmit:["label"]};function h_(n){return Object.prototype.hasOwnProperty.call(u_,n)}function On(n,r=0){const o=Be(n);if(o===null)return null;const m=Ae(o.key);if(m===null||m.length===0)return null;const w=o.params;if(w===void 0)return{key:m};const A=Be(w);if(A===null)return null;const T={};for(const[s,l]of Object.entries(A)){if(typeof l=="string"||typeof l=="number"&&Number.isFinite(l)){T[s]=l;continue}const p=r===0?On(l,r+1):null;if(p===null)return null;T[s]=p}return{key:m,params:T}}function d_(n){if(!Array.isArray(n))return null;const r=[];for(const o of n){const m=On(o);if(m===null)return null;r.push(m)}return r}const Us=["claude-code","codex","opencode","antigravity"],f_=["gemini-cli","antigravity-ide"],da=[...Us,...f_],p_={"gemini-cli":"Gemini CLI","antigravity-ide":"Antigravity IDE"};function Ui(n){return Us.includes(n)}const m_=["at-quoted","bare-path-paste"],g_=["at"],__=["usage-with-variants","token-count","usage-with-catalog","status-line"],v_=["child-session-marker"],y_=["active","missing","other-command","disabled","unreadable"];function Yf(n,r=null){return!n.statusSource||r==="unknown"}const Xf={sessionIdAtLaunch:!1,resume:!1,statusSource:!1,readySignal:!1,permissionCycle:null,models:null,efforts:null,questionCards:!1,imagesByPath:null,fileMentions:null,rewind:!1,contextWindowSource:null,plans:!1,waitingBlocksSubmit:!1};function Wc(n){return n.filter(r=>r.available).length>1}function w_(n){const r=Be(n);if(r===null)return null;const o=r.modes;if(!Array.isArray(o)||o.length===0)return null;const m=[];for(const T of o){if(!Hs(T))return null;m.push(T)}const w=r.launchMode;if(!Hs(w)||!m.includes(w))return null;const A=be(r.keyLabel);return A===null?null:{modes:m,launchMode:w,keyLabel:A,approvesPendingOnCycle:r.approvesPendingOnCycle===!0}}function b_(n){const r=Be(n);if(r===null)return null;const o=Qe(r.state,y_),m=be(r.settingsPath),w=be(r.scriptPath),A=r.fragment,T=A===null?null:be(A);return o===null||m===null||w===null||A!==null&&T===null?null:{state:o,settingsPath:m,scriptPath:w,fragment:T}}function S_(n){const r=Be(n);if(r===null)return null;const o=be(r.value),m=Ae(r.label),w=Ae(r.family),A=at(r.long),T=r.window,s=T===null?null:He(T);return o===null||m===null||w===null||A===null||T!==null&&s===null?null:{value:o,label:m,family:w,long:A,window:s}}function C_(n){const r=Be(n);if(r===null)return null;const o=be(r.value),m=Ae(r.label);return o===null||m===null?null:{value:o,label:m}}function yd(n,r){const o=pt(n,r);return o===null||o.length===0?null:o}function x_(n){const r=Be(n);return r===null?{...Xf}:{sessionIdAtLaunch:r.sessionIdAtLaunch===!0,resume:r.resume===!0,statusSource:r.statusSource===!0,readySignal:r.readySignal===!0,permissionCycle:w_(r.permissionCycle),models:yd(r.models,S_),efforts:yd(r.efforts,C_),questionCards:r.questionCards===!0,imagesByPath:Qe(r.imagesByPath,m_),fileMentions:Qe(r.fileMentions,g_),rewind:r.rewind===!0,contextWindowSource:Qe(r.contextWindowSource,__),plans:r.plans===!0,waitingBlocksSubmit:r.waitingBlocksSubmit===!0}}function wd(n){const r=Be(n);if(r===null)return null;const o=Qe(r.id,Us),m=Ae(r.label),w=Ae(r.command),A=Ae(r.installUrl);return o===null||m===null||w===null||A===null?null:{id:o,label:m,command:w,available:r.available===!0,version:Ae(r.version),installUrl:A,missingMessage:On(r.missingMessage),capabilities:x_(r.capabilities),environmentNotice:Qe(r.environmentNotice,v_),statusLine:b_(r.statusLine)}}const k_=["custom","ai","first-message","none"],E_=["native","vault"],L_=["idle","scanning","ready"],T_=["agent","shell"],R_=["busy","idle","waiting","offline","unknown"],M_=["server-closed"];function A_(n){const r=Be(n);if(r===null)return null;const o=be(r.sessionId),m=Ae(r.title),w=Qe(r.titleSource,k_),A=He(r.updatedAt),T=He(r.sizeBytes);if(o===null||m===null||w===null||A===null||T===null)return null;const s=r.agent===void 0?"claude-code":Qe(r.agent,da);if(s===null)return null;const l=Ae(r.cwd)??"";return{agent:s,sessionId:o,cwd:l,title:m,titleSource:w,updatedAt:A,sizeBytes:T,archived:r.archived===!0,storage:Qe(r.storage,E_)??"native",partial:r.partial===!0}}function N_(n){const r=Be(n);if(r===null)return null;const o=Ae(r.cwd),m=at(r.cwdExists),w=_n(r.sessions,A_),A=He(r.lastActivityAt);if(o===null||m===null||w===null||A===null)return null;const T=be(r.key);if(T!==null)return{key:T,fallbackName:Ae(r.fallbackName)??"",cwd:o,cwdExists:m,sessions:w,lastActivityAt:A};const s=be(r.slug);return s===null?null:{key:s,fallbackName:o.length===0?s:"",cwd:o,cwdExists:m,sessions:w,lastActivityAt:A}}function D_(n){const r=Be(n);if(r===null)return null;const o=Qe(r.state,L_),m=He(r.scannedFiles),w=He(r.totalFiles);return o===null||m===null||w===null?null:{state:o,scannedFiles:m,totalFiles:w}}function bd(n){const r=Be(n);if(r===null)return null;const o=be(r.terminalId),m=Qe(r.kind,T_)??"agent";let w=null;if(m==="agent"&&(w=r.agent===void 0?"claude-code":Qe(r.agent,Us),w===null))return null;const A=Ae(r.cwd),T=Ae(r.sessionId),s=Ae(r.label),l=at(r.resumed),p=He(r.createdAt),v=at(r.alive);if(o===null||A===null||T===null||s===null||l===null||p===null||v===null)return null;const u=r.exitCode;return{terminalId:o,kind:m,agent:w,cwd:A,sessionId:T,label:s,resumed:l,createdAt:p,alive:v,exitCode:typeof u=="number"?u:null,sleeping:r.sleeping===!0}}const Qf=["user","assistant"],I_=["content","attachment"],P_=["compacted","interrupted","error"],j_=["cli-plans","project","scratch"],Zl={lastRequestTokens:0,lastOutputTokens:0,lastModel:null,contextWindow:null,contextWindowEstimated:!1,totalInputTokens:0,totalOutputTokens:0,totalCacheReadTokens:0,assistantMessages:0},Sd=["waiting","live","unavailable","no-transcript"];function O_(n){const r=Be(n);if(r===null)return null;const o=He(r.inputTokens),m=He(r.outputTokens),w=He(r.cacheCreationInputTokens),A=He(r.cacheReadInputTokens);return o===null||m===null||w===null||A===null?null:{inputTokens:o,outputTokens:m,cacheCreationInputTokens:w,cacheReadInputTokens:A}}function B_(n){const r=Be(n);if(r===null)return null;const o=be(r.label);return o===null?null:{label:o,description:Ae(r.description)??""}}function F_(n){const r=Be(n);if(r===null)return null;const o=be(r.question),m=pt(r.options,B_);return o===null||m===null||m.length===0?null:{question:o,header:Ae(r.header)??"",multiSelect:r.multiSelect===!0,options:m}}function Jf(n){const r=Be(n);if(r===null)return null;switch(r.kind){case"text":{const o=Ae(r.text),m=at(r.truncated);return o===null||m===null?null:{kind:"text",text:o,truncated:m}}case"tool-call":{const o=Ae(r.toolUseId),m=Ae(r.name),w=Ae(r.input),A=at(r.truncated);return o===null||m===null||w===null||A===null?null:{kind:"tool-call",toolUseId:o,name:m,input:w,truncated:A}}case"tool-result":{const o=Ae(r.toolUseId),m=Ae(r.text),w=at(r.isError),A=at(r.truncated),T=He(r.imageCount);return o===null||m===null||w===null||A===null||T===null?null:{kind:"tool-result",toolUseId:o,text:m,isError:w,truncated:A,imageCount:T}}case"thinking":return{kind:"thinking"};case"question":{const o=be(r.toolUseId),m=pt(r.questions,F_);return o===null||m===null||m.length===0?null:{kind:"question",toolUseId:o,questions:m}}case"image":{const o=He(r.index),m=Ae(r.mediaType);if(o===null||m===null)return null;const w=r.source==="attachment"?"attachment":"content";return{kind:"image",index:o,mediaType:m,source:w}}case"notice":{const o=Qe(r.notice,P_);return o===null?null:{kind:"notice",notice:o,detail:Ae(r.detail)??""}}default:return null}}function ec(n){const r=Be(n);if(r===null)return null;const o=be(r.eventId),m=Qe(r.role,Qf),w=He(r.at),A=pt(r.parts,Jf);return o===null||m===null||w===null||A===null?null:{eventId:o,role:m,at:w,parts:A,model:Ae(r.model),usage:O_(r.usage),effort:Ae(r.effort),durationMs:He(r.durationMs),queued:r.queued===!0}}function Cd(n){const r=Be(n);if(r===null)return null;const o=He(r.lastRequestTokens),m=He(r.lastOutputTokens),w=He(r.totalInputTokens),A=He(r.totalOutputTokens),T=He(r.totalCacheReadTokens),s=He(r.assistantMessages);if(o===null||m===null||w===null||A===null||T===null||s===null)return null;const l=Ae(r.lastEffort);return{lastRequestTokens:o,lastOutputTokens:m,lastModel:Ae(r.lastModel),contextWindow:He(r.contextWindow),contextWindowEstimated:r.contextWindowEstimated===!0,totalInputTokens:w,totalOutputTokens:A,totalCacheReadTokens:T,assistantMessages:s,...l!==null?{lastEffort:l}:{}}}function H_(n){const r=Be(n);if(r===null)return null;const o=be(r.fileName),m=be(r.title),w=He(r.modifiedAt),A=He(r.sizeBytes);if(o===null||m===null||w===null||A===null)return null;const T=r.origin,s=j_.find(p=>p===T)??"cli-plans",l=Ae(r.path)??"";return{fileName:o,title:m,origin:s,path:l,exists:r.exists===!0,modifiedAt:w,sizeBytes:A}}function $_(n){const r=Be(n);if(r===null)return null;const o=be(r.fileName),m=Ae(r.text);return o===null||m===null?null:{fileName:o,text:m,truncated:r.truncated===!0}}const Zf=[{value:"default",label:"Por defecto",family:"",long:!1,window:null},{value:"opus",label:"Opus",family:"opus",long:!1,window:2e5},{value:"opus[1m]",label:"Opus",family:"opus",long:!0,window:1e6},{value:"sonnet",label:"Sonnet",family:"sonnet",long:!1,window:2e5},{value:"sonnet[1m]",label:"Sonnet",family:"sonnet",long:!0,window:1e6},{value:"haiku",label:"Haiku",family:"haiku",long:!1,window:2e5},{value:"fable",label:"Fable",family:"fable",long:!1,window:2e5},{value:"fable[1m]",label:"Fable",family:"fable",long:!0,window:1e6}];function U_(n){if(n.window===null)return n.label;const r=n.window>=1e6?`${Math.round(n.window/1e6)}M`:`${Math.round(n.window/1e3)}k`;return`${n.label} · ${r}`}function W_(n,r=Zf){const o=z_(n,r);if(o===null||n===null)return null;const m=n.includes("[1m]");return r.find(w=>w.family===o&&w.long===m)??null}function z_(n,r=Zf){var m;return n===null||n.length===0?null:((m=r.filter(w=>w.family.length>0).sort((w,A)=>A.family.length-w.family.length).find(w=>n.includes(w.family)))==null?void 0:m.family)??null}function V_(n){return`/model ${n}`}function q_(n){return`/effort ${n}`}const K_=["staged","unstaged","untracked","conflict"],G_=["added","modified","deleted","renamed","copied","type-changed","untracked","conflict"],Y_=["ready","not-a-repo","git-missing","error"],tc={state:"not-a-repo",message:null,repoRoot:"",branch:null,head:null,upstream:null,ahead:0,behind:0,changes:[],worktrees:[],truncated:!1,updatedAt:0},X_=["meta","hunk","context","added","removed"];function Q_(n){const r=Be(n);if(r===null)return null;const o=be(r.path),m=Qe(r.kind,G_),w=Qe(r.stage,K_);return o===null||m===null||w===null?null:{path:o,kind:m,stage:w,oldPath:Ae(r.oldPath)}}function J_(n){const r=Be(n);if(r===null)return null;const o=be(r.path);return o===null?null:{path:o,branch:Ae(r.branch),isCurrent:r.isCurrent===!0}}function Z_(n){const r=Be(n);if(r===null)return null;const o=Qe(r.state,Y_),m=Ae(r.repoRoot),w=He(r.ahead),A=He(r.behind),T=pt(r.changes,Q_),s=pt(r.worktrees,J_),l=He(r.updatedAt);return o===null||m===null||w===null||A===null||T===null||s===null||l===null?null:{state:o,message:On(r.message),repoRoot:m,branch:Ae(r.branch),head:Ae(r.head),upstream:Ae(r.upstream),ahead:w,behind:A,changes:T,worktrees:s,truncated:r.truncated===!0,updatedAt:l}}function ev(n){const r=Be(n);if(r===null)return null;const o=Qe(r.kind,X_),m=Ae(r.text);return o===null||m===null?null:{kind:o,text:m,oldLine:He(r.oldLine),newLine:He(r.newLine)}}function tv(n){const r=Be(n);if(r===null)return null;const o=be(r.path),m=at(r.staged),w=pt(r.lines,ev);return o===null||m===null||w===null?null:{path:o,staged:m,lines:w,truncated:r.truncated===!0,binary:r.binary===!0,message:On(r.message)}}const nv=["dir","file"],rv=["ignored","always"];function ep(n){const r=Be(n);if(r===null)return null;const o=be(r.name),m=be(r.path),w=Qe(r.kind,nv),A=He(r.sizeBytes),T=He(r.modifiedAt);if(o===null||m===null||w===null||A===null||T===null)return null;const s=Qe(r.hidden,rv),l={name:o,path:m,kind:w,sizeBytes:A,modifiedAt:T};return s===null?l:{...l,hidden:s}}function sv(n){const r=Be(n);if(r===null)return null;const o=Ae(r.query),m=pt(r.entries,ep);return o===null||m===null?null:{query:o,entries:m,truncated:r.truncated===!0}}function iv(n){const r=Be(n);if(r===null)return null;const o=Ae(r.path),m=pt(r.entries,ep),w=He(r.hiddenCount);return o===null||m===null||w===null?null:{path:o,entries:m,truncated:r.truncated===!0,hiddenCount:w}}function ov(n){const r=Be(n);if(r===null)return null;const o=be(r.path),m=Ae(r.text),w=He(r.sizeBytes),A=at(r.binary);return o===null||m===null||w===null||A===null?null:{path:o,language:Ae(r.language),text:m,sizeBytes:w,truncated:r.truncated===!0,binary:A}}function av(n){const r=Be(n);if(r===null)return null;const o=be(r.pickerId),m=be(r.path),w=pt(r.entries,T=>be(T)),A=pt(r.roots,T=>be(T));return o===null||m===null||w===null||A===null?null:{pickerId:o,path:m,entries:w,roots:A,canGoUp:r.canGoUp===!0,truncated:r.truncated===!0}}const tp=1e6,lv=100,cv=999999;function np(n){return n.pasted.reduce((r,o)=>r+o.text.length,n.text.length)}function kc(n){return n.text.trim().length===0&&n.pasted.every(r=>r.text.trim().length===0)}function rp(n,r){return n.text!==r.text||n.pasted.length!==r.pasted.length?!1:n.pasted.every((o,m)=>{const w=r.pasted[m];return w!==void 0&&w.number===o.number&&w.text===o.text})}function uv(n){const r=Be(n);if(r===null)return null;const o=r.number,m=Ae(r.text);return typeof o!="number"||!Number.isInteger(o)||o<1||o>cv||m===null?null:{number:o,text:m}}function hv(n){const r=Be(n);if(r===null)return null;const o=Ae(r.text),m=pt(r.pasted,uv);return o===null||m===null||m.length>lv||new Set(m.map(w=>w.number)).size!==m.length?null:{text:o,pasted:m}}const aa="MEMORY.md",zc=["AGENTS.md","CLAUDE.md"],sp=["claude-code","codex","antigravity","opencode"],dv=["outside","encoding"],fv=["create","append-block","replace-block","append-lines","copy"];function pv(n){return{instructionFiles:[...zc],gitMode:n!==null&&n.git.kind==="error"?"version":"ignore",importNative:n!==null&&n.native.pending>0,copyFromMainWorktree:n!==null&&n.git.kind==="repo"&&n.git.worktree!==null&&n.git.worktree.mainHasMemory}}function mv(n){const r=Be(n);if(r===null)return null;const o=Qe(r.name,zc),m=at(r.exists),w=at(r.hasBlock),A=at(r.blockCurrent),T=at(r.brokenBlock),s=r.problem,l=s===null?null:Qe(s,dv);return o===null||m===null||w===null||A===null||T===null||s!==null&&l===null?null:{name:o,exists:m,hasBlock:w,blockCurrent:A,brokenBlock:T,problem:l}}function gv(n){const r=Be(n);if(r===null)return null;switch(r.kind){case"not-repo":return{kind:"not-repo"};case"error":{const o=On(r.message);return o===null?null:{kind:"error",message:o}}case"repo":{const o=at(r.ignored);if(o===null)return null;if(r.worktree===null)return{kind:"repo",ignored:o,worktree:null};const m=Be(r.worktree);if(m===null)return null;const w=be(m.mainPath),A=at(m.mainHasMemory);return w===null||A===null?null:{kind:"repo",ignored:o,worktree:{mainPath:w,mainHasMemory:A}}}default:return null}}function _v(n){const r=Be(n);if(r===null)return null;const o=Qe(r.agent,sp),m=be(r.label),w=at(r.reaches),A=On(r.via);return o===null||m===null||w===null||A===null?null:{agent:o,label:m,reaches:w,via:A}}function vv(n){const r=Be(n);if(r===null)return null;const o=be(r.name),m=Ae(r.title),w=Ae(r.description),A=He(r.sizeBytes),T=He(r.modifiedAt);return o===null||m===null||w===null||A===null||T===null?null:{name:o,title:m,description:w,sizeBytes:A,modifiedAt:T}}const yv=["line","command","json"];function wv(n){const r=Be(n);if(r===null)return null;const o=Qe(r.agent,sp),m=be(r.label),w=be(r.target),A=Qe(r.kind,yv),T=be(r.text),s=On(r.note);return o===null||m===null||w===null||A===null||T===null||s===null?null:{agent:o,label:m,target:w,kind:A,text:T,note:s}}function bv(n){const r=Be(n);if(r===null)return null;const o=be(r.cwd),m=at(r.folderExists),w=at(r.indexExists),A=at(r.installed),T=pt(r.notes,vv),s=pt(r.files,mv),l=gv(r.git),p=pt(r.reach,_v),v=Be(r.native),u=v===null?null:He(v.available),y=v===null?null:He(v.pending),S=pt(r.globalFragments,wv);return o===null||m===null||w===null||A===null||T===null||s===null||l===null||p===null||u===null||y===null||S===null?null:{cwd:o,folderExists:m,indexExists:w,installed:A,notes:T,files:s,git:l,reach:p,native:{available:u,pending:y},globalFragments:S}}function xd(n){const r=Be(n);if(r===null)return null;const o=be(r.file),m=Qe(r.action,fv),w=Ae(r.preview),A=Ae(r.copiedFrom);return o===null||m===null||w===null?null:{file:o,action:m,preview:w,copiedFrom:A}}function Sv(n){const r=Be(n);if(r===null)return null;const o=be(r.name),m=Ae(r.text),w=at(r.truncated);return o===null||m===null||w===null?null:{name:o,text:m,truncated:w}}const kd=20;function Cv(n,r="Nota"){const o=n.text.split(`
|
|
41
|
-
`).map(m=>m.trim()).find(m=>m.length>0);return o===void 0?n.images.length>0?"Imagen":r:o.length>40?`${o.slice(0,40)}…`:o}function xv(n){const r=Be(n);if(r===null)return null;const o=be(r.imageId),m=be(r.mediaType),w=He(r.bytes);return o===null||m===null||w===null?null:{imageId:o,mediaType:m,bytes:w}}function kv(n){const r=Be(n);if(r===null)return null;const o=be(r.noteId),m=Ae(r.text),w=pt(r.images,xv),A=He(r.createdAt),T=He(r.updatedAt);return o===null||m===null||w===null?null:{noteId:o,text:m,images:w,createdAt:A??0,updatedAt:T??0}}const ip=3,Ev=3e4,Lv=["results","time"];function Ws(n){return typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}function Pi(n,r){if(n==null)return null;const o=r(n);return o===null?void 0:o}function op(n){const r=Be(n);if(r===null)return null;const o=Qe(r.agent,da),m=be(r.sessionId),w=Pi(r.cwd,Ae),A=Ae(r.title),T=Pi(r.eventId,be),s=Pi(r.role,y=>Qe(y,Qf)),l=Pi(r.at,He),p=Ae(r.snippet),v=Ws(r.matchStart),u=Ws(r.matchLength);return o===null||m===null||w===void 0||A===null||T===void 0||s===void 0||l===void 0||p===null||v===null||u===null||v+u>p.length?null:{agent:o,sessionId:m,cwd:w,title:A,eventId:T,role:s,at:l,snippet:p,matchStart:v,matchLength:u}}function Tv(n){const r=Be(n);if(r===null)return null;const o=Ae(r.query),m=_n(r.hits,op),w=Ws(r.sessionsScanned),A=Ws(r.sessionsTotal),T=Pi(r.truncated,s=>Qe(s,Lv));return o===null||m===null||w===null||A===null||w>A||T===void 0?null:{query:o,hits:m,sessionsScanned:w,sessionsTotal:A,truncated:T}}function Rv(n){const r=Be(n);if(r===null)return null;const o=Ae(r.query),m=_n(r.hits,op),w=Ws(r.sessionsScanned),A=Ws(r.sessionsTotal);return o===null||m===null||w===null||A===null||w>A?null:{query:o,hits:m,sessionsScanned:w,sessionsTotal:A}}const Mv=["off","idle","measuring","writing","moving"];function qt(n){return typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}function Ni(n,r){if(n==null)return null;const o=r(n);return o===null?void 0:o}function Av(n){const r=Be(n);if(r===null)return null;const o=Qe(r.agent,da),m=qt(r.sessions),w=qt(r.eventBytes),A=qt(r.images),T=qt(r.imageBytes),s=qt(r.skippedArchived),l=qt(r.skippedEmpty),p=qt(r.unsupported),v=qt(r.failed),u=d_(r.failureReasons);return o===null||m===null||w===null||A===null||T===null||s===null||l===null||p===null||v===null||u===null?null:{agent:o,sessions:m,eventBytes:w,images:A,imageBytes:T,skippedArchived:s,skippedEmpty:l,unsupported:p,failed:v,failureReasons:u}}function Nv(n){const r=Be(n);if(r===null)return null;const o=He(r.measuredAt),m=He(r.durationMs),w=_n(r.byAgent,Av),A=qt(r.memoryProjects),T=qt(r.memoryBytes);return o===null||m===null||w===null||A===null||T===null?null:{measuredAt:o,durationMs:m,byAgent:w,memoryProjects:A,memoryBytes:T}}function Dv(n){const r=Be(n);if(r===null)return null;const o=qt(r.done),m=qt(r.total);return o===null||m===null?null:{done:o,total:m}}function Iv(n){const r=Be(n);if(r===null)return null;const o=at(r.enabled),m=Ae(r.dir),w=at(r.isDefaultDir),A=Qe(r.state,Mv),T=qt(r.sessions),s=qt(r.passSessions),l=qt(r.bytes),p=qt(r.pending),v=Ni(r.progress,Dv),u=Ni(r.lastPassAt,He),y=Ni(r.measurement,Nv),S=Ni(r.previousDir,Ae),k=Ni(r.lastError,On);return o===null||m===null||w===null||A===null||T===null||s===null||l===null||p===null||v===void 0||u===void 0||y===void 0||S===void 0||k===void 0?null:{enabled:o,dir:m,isDefaultDir:w,state:A,progress:v,sessions:T,passSessions:s,bytes:l,lastPassAt:u,pending:p,measurement:y,previousDir:S,lastError:k}}const ap=1024,lp=65535,Pv="pair",jv=4001;function Ov(n){return typeof n=="number"&&Number.isInteger(n)&&n>=ap&&n<=lp}const Bv=["off","active","restart-needed","port-busy"];function Fv(n){const r=Be(n);if(r===null)return null;const o=be(r.id),m=Ae(r.label),w=He(r.createdAt),A=at(r.connected);if(o===null||m===null||w===null||A===null)return null;const T=r.lastSeenAt,s=T==null?null:He(T);return T!=null&&s===null?null:{id:o,label:m,createdAt:w,lastSeenAt:s,connected:A}}function Hv(n){const r=Be(n);if(r===null)return null;const o=at(r.enabled),m=He(r.port),w=Qe(r.state,Bv),A=He(r.listeningPort),T=Ae(r.sshUser),s=sa(r.hostNames),l=at(r.pairingActive),p=pt(r.devices,Fv);return o===null||m===null||w===null||A===null||T===null||s===null||l===null||p===null?null:{enabled:o,port:m,state:w,listeningPort:A,sshUser:T,hostNames:s,pairingActive:l,devices:p}}function $v(n){const r=Be(n);if(r===null)return null;const o=be(r.code),m=He(r.expiresAt);return o===null||m===null?null:{code:o,expiresAt:m}}const Uv=["powershell-admin","powershell","terminal"];function Wv(n){const r=Be(n);if(r===null)return null;const o=be(r.payload),m=be(r.authorizeCommand),w=Qe(r.shell,Uv),A=be(r.code),T=He(r.expiresAt);return o===null||m===null||w===null||A===null||T===null?null:{payload:o,authorizeCommand:m,shell:w,code:A,expiresAt:T}}const Bs=8,zv="/ws",Ec="token",la=12*1024*1024,nc=8,Ed=10*1024*1024,rc=4,Vv=["sending","prefilled"],qv=["no-delivery","not-ready","send-failed"],Kv=["cli-not-found","shell-not-found","spawn-failed","bad-message","unknown-terminal","terminal-asleep","invalid-cwd","too-many-terminals","invalid-path","read-failed","submit-failed","answer-failed","mode-failed","archive-failed","notes-failed","picker-failed","memory-failed","vault-failed","continue-failed","search-failed","remote-failed","remote-refused","agent-unsupported","internal"];function Gv(n){const r={model:null,effort:null,contextWindow:null};if(typeof n!="object"||n===null)return r;const o=n;return{model:be(o.model),effort:be(o.effort),contextWindow:He(o.contextWindow)}}function Yv(n){const r=Be(n);if(r===null)return null;const o=be(r.terminalId),m=hv(r.draft);return o===null||m===null?null:{terminalId:o,draft:m}}function Ld(n){return typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}function Zo(n,r){const o=be(r.requestId);return o!==null&&(n.requestId=o),n}function Xv(n){const r=Be(l_(n));if(r===null)return null;switch(r.type){case"hello":{const o=He(r.protocolVersion),m=Ae(r.platform),w=Ae(r.defaultCwd);return o===null||m===null||w===null?null:{type:"hello",protocolVersion:o,agents:_n(r.agents,wd)??[],defaultAgent:Qe(r.defaultAgent,Us),platform:m,defaultCwd:w,shellName:be(r.shellName),remoteClient:r.remoteClient===!0}}case"agents":{const o=_n(r.agents,wd);return o===null?null:{type:"agents",agents:o,defaultAgent:Qe(r.defaultAgent,Us)}}case"terminal.list":{const o=_n(r.terminals,bd),m=sa(r.order);return o===null||m===null?null:{type:"terminal.list",terminals:o,order:m}}case"terminal.opened":{const o=be(r.requestId),m=bd(r.terminal);return o===null||m===null?null:{type:"terminal.opened",requestId:o,terminal:m}}case"terminal.output":{const o=be(r.terminalId),m=Ae(r.data);return o===null||m===null?null:{type:"terminal.output",terminalId:o,data:m}}case"terminal.replay":{const o=be(r.terminalId),m=Ae(r.data);return o===null||m===null?null:{type:"terminal.replay",terminalId:o,data:m,truncated:r.truncated===!0}}case"terminal.exit":{const o=be(r.terminalId),m=He(r.exitCode);if(o===null||m===null)return null;const w=r.signal;return{type:"terminal.exit",terminalId:o,exitCode:m,signal:typeof w=="number"?w:null}}case"terminal.closed":{const o=be(r.terminalId);return o===null?null:{type:"terminal.closed",terminalId:o}}case"terminal.activity":{const o=be(r.terminalId),m=Qe(r.activity,R_);if(o===null||m===null)return null;const w=m==="offline"?Qe(r.offlineReason,M_):null;return w===null?{type:"terminal.activity",terminalId:o,activity:m}:{type:"terminal.activity",terminalId:o,activity:m,offlineReason:w}}case"index.status":{const o=D_(r.status);return o===null?null:{type:"index.status",status:o}}case"index.projects":{const o=_n(r.projects,N_);return o===null?null:{type:"index.projects",projects:o,replace:r.replace===!0}}case"conversation.reset":{const o=be(r.terminalId),m=Ae(r.sessionId),w=Qe(r.state,Sd),A=_n(r.events,ec),T=Cd(r.usage);return o===null||m===null||w===null||A===null||T===null?null:{type:"conversation.reset",terminalId:o,sessionId:m,state:w,events:A,hasMore:r.hasMore===!0,usage:T,permissionMode:Hs(r.permissionMode)?r.permissionMode:null,defaults:Gv(r.defaults),waitingFor:be(r.waitingFor),openToolCall:r.openToolCall===!0}}case"conversation.append":{const o=be(r.terminalId),m=_n(r.events,ec),w=Cd(r.usage);return o===null||m===null||w===null?null:{type:"conversation.append",terminalId:o,events:m,usage:w,permissionMode:Hs(r.permissionMode)?r.permissionMode:null}}case"conversation.mode":{const o=be(r.terminalId),m=r.mode;return o===null||!Hs(m)?null:{type:"conversation.mode",terminalId:o,mode:m}}case"conversation.waiting":{const o=be(r.terminalId);return o===null?null:{type:"conversation.waiting",terminalId:o,waitingFor:be(r.waitingFor)}}case"conversation.toolCall":{const o=be(r.terminalId),m=at(r.open);return o===null||m===null?null:{type:"conversation.toolCall",terminalId:o,open:m}}case"conversation.page":{const o=be(r.terminalId),m=_n(r.events,ec);return o===null||m===null?null:{type:"conversation.page",terminalId:o,events:m,hasMore:r.hasMore===!0}}case"conversation.turns":{const o=be(r.terminalId),m=pt(r.turns,w=>{const A=Be(w);if(A===null)return null;const T=be(A.eventId),s=He(A.durationMs);return T===null||s===null?null:{eventId:T,durationMs:s}});return o===null||m===null?null:{type:"conversation.turns",terminalId:o,turns:m}}case"conversation.parts":{const o=be(r.terminalId),m=pt(r.updates,w=>{const A=Be(w);if(A===null)return null;const T=be(A.eventId),s=pt(A.parts,Jf);return T===null||s===null?null:{eventId:T,parts:s}});return o===null||m===null?null:{type:"conversation.parts",terminalId:o,updates:m}}case"conversation.imageData":{const o=be(r.terminalId),m=be(r.eventId),w=He(r.index),A=Ae(r.mediaType);if(o===null||m===null||w===null||A===null)return null;const T=r.data;return{type:"conversation.imageData",terminalId:o,eventId:m,index:w,source:Qe(r.source,I_)??"content",mediaType:A,data:typeof T=="string"?T:null}}case"conversation.state":{const o=be(r.terminalId),m=Qe(r.state,Sd);return o===null||m===null?null:{type:"conversation.state",terminalId:o,state:m}}case"git.status":{const o=be(r.terminalId),m=Z_(r.status);return o===null||m===null?null:{type:"git.status",terminalId:o,status:m}}case"git.diff":{const o=be(r.terminalId),m=tv(r.diff);return o===null||m===null?null:{type:"git.diff",terminalId:o,diff:m}}case"files.listing":{const o=be(r.terminalId),m=iv(r.listing);return o===null||m===null?null:{type:"files.listing",terminalId:o,listing:m}}case"picker.listing":{const o=av(r.listing);return o===null?null:{type:"picker.listing",listing:o}}case"files.preview":{const o=be(r.terminalId),m=ov(r.preview);return o===null||m===null?null:{type:"files.preview",terminalId:o,preview:m}}case"conversation.plans":{const o=be(r.terminalId),m=pt(r.plans,H_);return o===null||m===null?null:{type:"conversation.plans",terminalId:o,plans:m}}case"plans.content":{const o=be(r.terminalId),m=$_(r.plan);return o===null||m===null?null:{type:"plans.content",terminalId:o,plan:m}}case"files.results":{const o=be(r.terminalId),m=sv(r.result);return o===null||m===null?null:{type:"files.results",terminalId:o,result:m}}case"notes.list":{const o=pt(r.notes,kv);return o===null?null:{type:"notes.list",notes:o}}case"notes.imageData":{const o=be(r.imageId),m=Ae(r.mediaType);if(o===null||m===null)return null;const w=r.data;return{type:"notes.imageData",imageId:o,mediaType:m,data:typeof w=="string"?w:null}}case"memory.status":{const o=be(r.terminalId),m=bv(r.status);return o===null||m===null?null:{type:"memory.status",terminalId:o,status:m}}case"memory.planned":{const o=be(r.terminalId),m=pt(r.changes,xd);return o===null||m===null?null:Zo({type:"memory.planned",terminalId:o,changes:m},r)}case"memory.installed":{const o=be(r.terminalId),m=pt(r.applied,xd);return o===null||m===null?null:Zo({type:"memory.installed",terminalId:o,applied:m},r)}case"memory.imported":{const o=be(r.terminalId),m=sa(r.copied),w=sa(r.skipped);return o===null||m===null||w===null?null:Zo({type:"memory.imported",terminalId:o,copied:m,skipped:w},r)}case"memory.content":{const o=be(r.terminalId),m=Sv(r.note);return o===null||m===null?null:Zo({type:"memory.content",terminalId:o,note:m},r)}case"vault.status":{const o=Iv(r.status);return o===null?null:{type:"vault.status",status:o}}case"vault.exported":{const o=be(r.projectKey),m=He(r.sessions);return o===null||m===null?null:{type:"vault.exported",projectKey:o,sessions:m}}case"session.continued":{const o=be(r.requestId),m=be(r.terminalId),w=Be(r.source),A=Qe(w==null?void 0:w.agent,da),T=be(w==null?void 0:w.sessionId),s=Ae(w==null?void 0:w.title),l=Ld(r.includedTurns),p=Ld(r.totalTurns),v=Qe(r.delivery,Vv);return o===null||m===null||A===null||T===null||s===null||l===null||p===null||l>p||v===null?null:{type:"session.continued",requestId:o,terminalId:m,source:{agent:A,sessionId:T,title:s},includedTurns:l,totalTurns:p,totalTurnsIsMinimum:r.totalTurnsIsMinimum===!0,delivery:v}}case"composer.prefill":{const o=be(r.terminalId),m=be(r.text),w=Qe(r.reason,qv);return o===null||m===null||w===null?null:{type:"composer.prefill",terminalId:o,text:m,reason:w}}case"composer.drafts":{const o=_n(r.drafts,Yv);return o===null?null:{type:"composer.drafts",drafts:o}}case"search.progress":{const o=be(r.searchId),m=Rv(r.progress);return o===null||m===null?null:{type:"search.progress",searchId:o,progress:m}}case"remote.status":{const o=Hv(r.status);return o===null?null:{type:"remote.status",status:o}}case"remote.pairing.code":{const o=$v(r.pairing);return o===null?null:{type:"remote.pairing.code",pairing:o}}case"remote.phone.pairing":{const o=Wv(r.pairing);return o===null?null:{type:"remote.phone.pairing",pairing:o}}case"search.results":{const o=be(r.searchId),m=Tv(r.result);return o===null||m===null?null:{type:"search.results",searchId:o,result:m}}case"error":{const o=On(r.text);if(o===null)return null;const w={type:"error",code:Qe(r.code,Kv)??"internal",text:o},A=Ae(r.detail);A!==null&&(w.detail=A);const T=be(r.requestId);return T!==null&&(w.requestId=T),w}default:return null}}function Td(n){return JSON.stringify(n)}const Qv=/^[A-Za-z]:\\$/;function zs(n,r){return n.length===0?"":r==="win32"?Jv(n):Zv(n)}function Jv(n){let r=n.replace(/\//g,"\\");for(r.startsWith("\\\\?\\UNC\\")?r=`\\\\${r.slice(8)}`:r.startsWith("\\\\?\\")&&(r=r.slice(4)),r=r.startsWith("\\\\")?`\\\\${r.slice(2).replace(/\\+/g,"\\")}`:r.replace(/\\+/g,"\\");r.endsWith("\\")&&!Qv.test(r);)r=r.slice(0,-1);return r.toLowerCase()}function cp(n,r,o){return n.length===0||o==="win32"&&n!==r&&n.toLowerCase()===r.toLowerCase()?r:n}function Zv(n){let r=n.replace(/\/+/g,"/");for(;r.length>1&&r.endsWith("/");)r=r.slice(0,-1);return r}function e0(n,r,o,m){const w=zs(o.cwd,m);let A=-1;for(const[T,s]of n.entries()){const l=r(s);l===void 0||l.kind!=="agent"||zs(l.cwd,m)===w&&(A=T)}return A===-1?n.length:A+1}function up(n){return`[Pasted text #${n}]`}function t0(n){return`[Start of pasted text #${n}]`}function n0(n){return`[End of pasted text #${n}]`}function r0(){return/(^|\n)\[Start of pasted text #(\d{1,6})\]\n([\s\S]*?)\n\[End of pasted text #\2\](?=\n|$)/g}function s0(){return/(^|\n)\[Start of pasted text #(\d{1,6})\]\n/}function i0(){return/\[Pasted text #(\d{1,6})\]/g}const hp="https://buymeacoffee.com/cvelasquez",o0="modulepreload",a0=function(n){return"/"+n},Rd={},In=function(r,o,m){let w=Promise.resolve();if(o&&o.length>0){let T=function(p){return Promise.all(p.map(v=>Promise.resolve(v).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));w=T(o.map(p=>{if(p=a0(p),p in Rd)return;Rd[p]=!0;const v=p.endsWith(".css"),u=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${u}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":o0,v||(y.as="script"),y.crossOrigin="",y.href=p,l&&y.setAttribute("nonce",l),document.head.appendChild(y),v)return new Promise((S,k)=>{y.addEventListener("load",S),y.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${p}`)))})}))}function A(T){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=T,window.dispatchEvent(s),!s.defaultPrevented)throw T}return w.then(T=>{for(const s of T||[])s.status==="rejected"&&A(s.reason);return r().catch(A)})},l0={"agent.composer.imagesRefused":"This CLI doesn't take images from the message box.","agent.continue.discovering":"The session isn't in the history yet: it shows up with the first message.","agent.continue.noConversation":"This tab doesn't have a conversation to continue yet.","agent.continue.noMessages":"This conversation doesn't have any messages to continue yet.","agent.continue.title":"Continue this conversation with another CLI","agent.dot.idle":"Ready, nothing in progress","agent.dot.noStatus":"This CLI doesn't publish its status","agent.dot.open":"CLI open","agent.dot.statusLineOnly":"This CLI only publishes its status with the status line configured","agent.dot.statusLinePending":"The status line hasn't published this conversation's status yet","agent.handoff.notice":"Continued from {{label}}: the agent starts from a transcript of {{turns}}, not from the context it had. Tool results are trimmed and images don't carry over.","agent.handoff.prefill.noDelivery":"The message is in the message box: check it and send it with Enter.","agent.handoff.prefill.notReady":"The CLI wasn't ready in time: the message is in the message box for you to send.","agent.handoff.prefill.sendFailed":"It couldn't be sent automatically: the message is in the message box for you to send.","agent.handoff.sending":"Sending the continuation…","agent.handoff.tabLabel":"Continued: {{title}}","agent.handoff.tabLabelNoTitle":"Continued","agent.handoff.turns.all_one":"the {{count}} turn","agent.handoff.turns.all_other":"the {{count}} turns","agent.handoff.turns.lastManyOfMore_one":"the last {{included}} of more than {{count}} turn","agent.handoff.turns.lastManyOfMore_other":"the last {{included}} of more than {{count}} turns","agent.handoff.turns.lastMany_one":"the last {{included}} of {{count}} turn","agent.handoff.turns.lastMany_other":"the last {{included}} of {{count}} turns","agent.handoff.turns.lastOne":"the last turn of {{total}}","agent.handoff.turns.lastOneOfMore":"the last turn of more than {{total}}","agent.handoff.turns.single":"the only turn","agent.meter.idle.noFile":"The session hasn't measured any response yet. It doesn't start at zero: the system prompt, the tools and the project's instructions file already take up context, and the real number shows up with the first response.","agent.meter.idle.statusLine":"The status line hasn't published tokens for this conversation yet. It doesn't start at zero: the number shows up when the CLI runs it, with the first message or when the session resumes.","agent.meter.idle.withFile":"The session hasn't measured any response yet. It doesn't start at zero: the system prompt, the tools and {{file}} already take up context, and the real number shows up with the first response.","agent.meter.origin.catalog":"limit from the CLI's model catalog","agent.meter.origin.estimated":"limit inferred from the measured tokens","agent.meter.setup.disabled":"This CLI only publishes its tokens through its status line, and the app's status line is disabled. Configure explains how.","agent.meter.setup.missing":"This CLI only publishes its tokens through its status line, and it isn't configured yet. Configure explains how.","agent.meter.setup.otherCommand":"This CLI only publishes its tokens through its status line, and you have another status line configured. Configure explains how.","agent.meter.setup.unreadable":"This CLI only publishes its tokens through its status line, and its settings.json couldn't be read. Configure explains how.","agent.mode.blocked":"There's a confirmation pending in the CLI: changing the mode now would approve it. Answer it in the CLI tab.","agent.mode.title":"{{mode}} mode: {{hint}}. Changing it sends {{key}} to the CLI tab","agent.mode.titleBlind":"{{title}}. Without status line data the app can't tell whether a confirmation is pending; changing the mode at that moment approves it","agent.note.empty":"The note is empty","agent.note.needsTab":"Open a tab first: the conversation opens in its project","agent.note.noReadySignal":"This tab's CLI doesn't say when it's ready, so the note can't be sent","agent.note.send":"Send the note to the agent in a new conversation in {{cwd}}","agent.openBlocked":"Opening a tab in this project…","agent.openTool.noLabel":"The CLI has a tool without a result: it may be asking for approval. Answer it in the CLI tab.","agent.openTool.withLabel":"{{label}} has a tool without a result: it may be asking for approval. Answer it in the CLI tab.","agent.serverClosed.noLabel":"The CLI server closed and this tab lost its connection.","agent.serverClosed.relaunch":"Relaunch","agent.serverClosed.relaunching":"Relaunching…","agent.serverClosed.withLabel":"The {{label}} server closed and this tab lost its connection.","agent.session.cliMissing":"{{label}} isn't installed.","agent.shortcuts.antigravity.answerPermission":"Answer a permission request: 1 allows it, 4 rejects it","agent.shortcuts.antigravity.cycleMode":"Change the mode: accept-edits, plan and default (with focus on the terminal)","agent.shortcuts.antigravity.help":"Show the CLI's shortcuts","agent.shortcuts.antigravity.interrupt":"Interrupt the current turn, or cancel a permission request","agent.shortcuts.claudeCode.cancel":"Cancel","agent.shortcuts.claudeCode.cycleMode":"Change the permission mode (with focus on the terminal)","agent.shortcuts.claudeCode.fullOutput":"Show the full output","agent.shortcuts.claudeCode.pasteImage":"Paste an image from the clipboard","agent.shortcuts.claudeCode.pasteText":"Paste text from the clipboard","agent.shortcuts.claudeCode.rewind":"Open the rewind menu","agent.shortcuts.claudeCode.searchHistory":"Search the command history","agent.shortcuts.codex.cycleMode":"Switch between the default mode and Plan (with focus on the terminal)","agent.shortcuts.codex.editPrevious":"Edit a previous message","agent.shortcuts.codex.effort":"Lower / raise the effort","agent.shortcuts.codex.externalEditor":"Edit the message in the external editor","agent.shortcuts.codex.interruptOrExit":"Interrupt, or exit if there's no turn","agent.shortcuts.codex.interruptTurn":"Interrupt the current turn","agent.shortcuts.codex.mention":"Mention a file, a skill or a plugin","agent.shortcuts.codex.note":"Alt + ← / → switch agents inside Codex, but here the app uses them to switch tabs.","agent.shortcuts.codex.queue":"Queue the message while the agent works","agent.shortcuts.codex.searchHistory":"Search the message history","agent.shortcuts.codex.transcript":"Show the transcript","agent.shortcuts.commands":"Commands","agent.shortcuts.composer.newline":"New line without sending","agent.shortcuts.composer.pasteText":"Paste text","agent.shortcuts.composer.pasteWithImages":"Paste text or an image (it stays as a thumbnail)","agent.shortcuts.composer.send":"Send the message","agent.shortcuts.interruptCli":"Interrupt whatever the CLI is doing","agent.shortcuts.leaderThen":"Ctrl + X, then {{key}}","agent.shortcuts.opencode.clearInput":"Clear the input; twice, exit","agent.shortcuts.opencode.commandList":"Command list, with the model variants","agent.shortcuts.opencode.cycleAgent":"Switch agent, build or plan (with focus on the terminal)","agent.shortcuts.opencode.interrupt":"Interrupt (the first press only warns)","agent.shortcuts.opencode.model":"Choose a model","agent.shortcuts.opencode.newSession":"New session: the tab stays tied to the session it was opened with","agent.shortcuts.opencode.newline":"New line","agent.shortcuts.opencode.note":"Ctrl + T switches the model variant inside OpenCode, but the browser keeps it for itself: it's under Ctrl + P.","agent.shortcuts.opencode.paste":"Paste","agent.statusLine.noFragment":"The app's folder has characters the console interprets (such as & % ! or quotes), and with them there's no line the CLI can run: on Windows it runs it with cmd /c and no quote gets through. Moving the configuration folder to a path without those characters fixes it.","agent.statusLine.state.active":"Configured","agent.statusLine.state.disabled":"Disabled (enabled: false)","agent.statusLine.state.missing":"Not configured","agent.statusLine.state.otherCommand":"You have another status line: pasting this one replaces it","agent.statusLine.state.unreadable":"Couldn't read settings.json","agent.thread.discovering":"The session shows up in the history with the first message.","agent.thread.noTranscript":"This conversation comes from a CLI version that didn't leave a readable transcript. It can be resumed from the sidebar, but there's nothing to show here.","agent.waiting.answer":"The CLI is waiting for an answer from you.","agent.waiting.permission":"The CLI is waiting for you to authorize a tool.","agent.waiting.question":"The agent asked you a question: answer it in the thread.","agentMenu.chooseTitle":"Choose which CLI to open with","agentMenu.openWith":"Open with","agentMenu.titleWithAgent":"{{title}} — with {{label}}","app.banner.revoked":"This device's access was revoked, or remote access was turned off. To come back, pair it again from the computer running Agent Workbench.","app.divider.consoleHeight":"Drag to change the console's height","app.divider.width":"Drag to change the width","app.empty.hint":"Pick a project on the left, or open a session from the history to resume it.","app.empty.newSession":"New session in {{cwd}}","app.empty.noTabs":"No open tabs.","app.empty.opening":"Opening…","app.header.cliVersion":"CLI {{version}}","app.header.remoteAccess":"Remote access","app.header.remoteBadge":"Remote","app.header.remoteBadgeTitle":"This window is connected from a paired device. Managing remote access, and anything that opens a file with the apps of the computer running Agent Workbench, is only available on that computer.","app.header.shortcuts":"Show keyboard shortcuts","app.markerNotice":"This server was started from inside a CLI session. The <code>{{variable}}</code> variable was removed from the tabs' environment: it turns off history saving, and without that there would be no conversation or context meter. The rest of the environment is left untouched.","app.panel.name":"Panel","app.panel.show":"Show the right panel (Alt+P)","app.picker.project.confirm":"Open here","app.picker.project.confirmTitle":"Open an agent tab in {{path}}","app.picker.project.title":"New project","app.picker.vault.confirm":"Use this folder","app.picker.vault.confirmTitle":"Move the local copy to {{path}}. The current folder stays untouched","app.picker.vault.title":"Local copy folder","app.sidebar.name":"Projects","app.sidebar.show":"Show the project list","app.status.connecting":"Connecting","app.status.failed":"No connection","app.status.open":"Connected","app.status.reconnecting":"Reconnecting","app.status.revoked":"Access revoked","archive.allBlocked_one":"Its only conversation has an open tab. Close it first.","archive.allBlocked_other":"Its {{count}} conversations have an open tab. Close them first.","archive.blockedStays_one":"Another one has an open tab and stays.","archive.blockedStays_other":"{{count}} others have an open tab and stay.","archive.confirm_one":"Archive {{count}} conversation?","archive.confirm_other":"Archive the {{count}} conversations?","archive.withBlocked":"{{confirm}} {{blocked}}","common.cancel":"Cancel","common.close":"Close","common.closeEsc":"Close (Esc)","common.copied":"Copied","common.copyCode":"Copy code","common.dismissNotice":"Dismiss the notice","common.gotIt":"Got it","composer.attach":"Attach a file","composer.attachTitle":"Attach a file: a log, a PDF, a document or an image","composer.chip.editHint":"Show and edit the pasted text","composer.chip.editorLabel":"Edit pasted text #{{number}}","composer.chip.pastedTextEmpty":"#{{number}} · Pasted text · empty, won't be sent","composer.chip.pastedText_one":"#{{number}} · Pasted text · {{count}} line","composer.chip.pastedText_other":"#{{number}} · Pasted text · {{count}} lines","composer.chip.remove":"Remove","composer.pastedImage":"pasted image","composer.placeholder.ended":"This tab's session has ended.","composer.placeholder.ready":"Type your message.","composer.placeholder.sleeping":"This tab doesn't have the CLI open yet.","composer.problem.draftTooLong":"This message is too long to keep as a draft: if you close Agent Workbench before sending it, it will be lost.","composer.problem.empty":'"{{name}}" is empty.',"composer.problem.imageTooBig":"The image is {{size}} MB; the maximum is {{max}} MB.","composer.problem.imageUnreadable":"Couldn't read the image from the clipboard.","composer.problem.tooBig":'"{{name}}" is {{size}} MB; the maximum is {{max}} MB.',"composer.problem.tooManyFiles_one":"Up to {{count}} file per message.","composer.problem.tooManyFiles_other":"Up to {{count}} files per message.","composer.problem.tooManyImages_one":"Up to {{count}} image per message.","composer.problem.tooManyImages_other":"Up to {{count}} images per message.","composer.problem.unreadable":`Couldn't read "{{name}}".`,"composer.resizeTitle":"Drag to resize the message box","composer.send":"Send","composer.sendTitle":"Send (Enter)","composer.stop":"Stop","composer.stopTitle":"Interrupt whatever the CLI is doing (Esc)","console.collapse":"Collapse. The processes keep running: to end them, use each terminal's ×","console.name":"Console","console.noShell":"No system console was found to open.","console.openAnother":"Open another {{shell}} in {{cwd}}","console.openAnyIn":"Open a console in {{cwd}}","console.openIn":"Open {{shell}} in {{cwd}}","console.tab.close":"Close this terminal and end its process","console.tab.exited":"Exited with code {{code}}","console.tab.label":"Terminal {{number}}","console.tab.title":"{{shell}} {{number}} in {{cwd}}","continue.menuLabel":"Continue with","controls.effort.high":"High","controls.effort.inUse":"Effort in use: {{effort}}. Changing it sends /effort to the CLI tab","controls.effort.inUseSaved":"Effort in use: {{effort}}. Changing it sends /effort to the CLI tab, and the CLI saves it as the default for the next tabs","controls.effort.low":"Low","controls.effort.max":"Max","controls.effort.medium":"Medium","controls.effort.noData":"Effort: no data. Not every model has levels — with haiku, /effort leaves no trace","controls.effort.placeholder":"effort — no data","controls.effort.provisional":"Effort from your configuration: {{effort}}. No response has confirmed it yet","controls.effort.xhigh":"Very high","controls.model.default":"Default","controls.model.inUse":"Model in use: {{model}}. Changing it sends /model to the CLI tab","controls.model.inUseSaved":"Model in use: {{model}}. Changing it sends /model to the CLI tab, and the CLI saves it as the default for the next tabs","controls.model.noData":"Model: there hasn't been any response in this session yet","controls.model.placeholder":"model — no data","controls.model.provisional":"Model from your configuration: {{model}}. No response has confirmed it yet","conversation.answerUnconfirmed":"The CLI didn't confirm this answer. Try again, or answer in the CLI tab.","diff.binary":"Binary file: there's no diff to show.","diff.noChanges":"No changes.","diff.truncated":"The diff was cut off because of its size. The full file is easier to read outside this panel.","files.allHidden":"everything in it is hidden","files.back":"← Files","files.empty":"empty","files.hidden.hide":"Hide again what .gitignore and the built-in list exclude","files.hidden.show":"Also show what .gitignore and the built-in list exclude","files.hiddenCount_one":"{{count}} hidden","files.hiddenCount_other":"{{count}} hidden","files.hiddenTitle":"Hidden: .git, node_modules, dist, bin, obj and whatever .gitignore says","files.insertFolderPath":"Put this folder's path in your message","files.insertPath":"Put the path of {{name}} in your message","files.loading":"loading…","files.menu.copyAbsolute":"Copy absolute path","files.menu.copyRelative":"Copy relative path","files.menu.insertMention":"Insert as @path","files.menu.openWithSystem":"Open with the default app","files.moreEntries":"there are more entries than shown","files.pathInserted":"Added to your message","files.preview.binary":"Binary file: no preview.","files.preview.truncated":"The file was cut off because of its size. Open it with the default app to see all of it.","files.readDirFailed":"Couldn't read the directory.","files.readingDir":"Reading the directory…","files.readingFile":"Reading the file…","files.refresh":"Reload the tree","files.reveal":"Open {{name}} in the system's file explorer","files.revealFolder":"Open this folder in the system's file explorer","files.row.alwaysHidden":"always hidden: .git, node_modules, dist, bin, obj","files.row.ignored":"hidden by .gitignore","files.search.clear":"Clear (Esc)","files.search.more":"there are more results than shown","files.search.moreTitle":"Narrow the search to see them all","files.search.none":"No file with that name.","files.search.placeholder":"Search files by name…","files.search.prompt":"Type to search.","files.search.searching":"Searching…","format.bytes.b":"{{value}} B","format.bytes.gb":"{{value}} GB","format.bytes.kb":"{{value}} KB","format.bytes.mb":"{{value}} MB","format.duration.minutes":"{{value}} min","format.duration.minutesSeconds":"{{minutes}} min {{seconds}} s","format.duration.ms":"{{value}} ms","format.duration.seconds":"{{value}} s","format.duration.underSecond":"less than 1 s","git.aheadBehindTitle":"Commits ahead of and behind the upstream branch","git.backToChanges":"Changes","git.clean":"The working tree is clean.","git.detached":"Detached HEAD","git.detachedAt":"Detached HEAD @ {{head}}","git.group.conflict":"Conflicted","git.group.conflictHint":"They need to be resolved before going on","git.group.staged":"Staged","git.group.stagedHint":"Already added with git add","git.group.unstaged":"Unstaged","git.group.unstagedHint":"Modified in the working tree","git.group.untracked":"Untracked","git.group.untrackedHint":"New files git doesn't know about","git.kind.added":"added","git.kind.conflict":"conflicted","git.kind.copied":"copied","git.kind.deleted":"deleted","git.kind.modified":"modified","git.kind.renamed":"renamed","git.kind.typeChanged":"type changed","git.kind.untracked":"untracked","git.newFolderTitle":"{{path}} — new folder; its contents show up in Files","git.readingDiff":"Reading the diff…","git.refresh":"Refresh the status now","git.stagedTag":"staged","git.truncated":"There are more changes than shown. It usually means a rule is missing from <code>.gitignore</code>.","git.unknownState":"The repository's status isn't known yet.","git.upstreamTitle":"Upstream branch: {{upstream}}","git.worktrees.detached":"detached","git.worktrees.heading":"Other worktrees","git.worktrees.headingTitle":"Other working trees of this repository","header.locale.auto":"Automatic (browser: {{name}})","header.locale.title":"Language: {{name}}","header.locale.titleAuto":"Language: {{name}} (automatic, from the browser)","memory.action.appendBlock":"the block will be added at the end","memory.action.appendLines":"lines will be added at the end","memory.action.copy":"will be copied","memory.action.create":"will be created","memory.action.replaceBlock":"the block will be replaced","memory.back":"← Memory","memory.error.connectionLost":"The connection dropped before the response. Once it reconnects, the status shows what got written.","memory.form.copyFromMain":"Copy the notes from the main worktree","memory.form.existingNotes":"Existing notes","memory.form.files":"Instruction files","memory.form.importNative_one":"Import {{count}} note from Claude Code's memory","memory.form.importNative_other":"Import {{count}} notes from Claude Code's memory","memory.form.noFiles":"Choose at least one instruction file","memory.form.planning":"Calculating…","memory.form.preview":"Preview changes","memory.git.alreadyIgnored":"This repo already ignores <code>.agents/memory/</code>. To track it, that rule has to be removed from <code>.gitignore</code> by hand.","memory.git.blocked":"With git returning an error, it can only be installed without touching .gitignore","memory.git.dontTouch":"Don't touch <code>.gitignore</code>","memory.git.errorHint":"git returned an error","memory.git.errorWarning":"git returned an error, so there's no telling whether the memory is ignored. It can be installed without touching <code>.gitignore</code>.","memory.git.ignore":"Ignore the memory","memory.git.ignoreHint":"recommended","memory.git.version":"Track it","memory.git.versionHint":"for private repos","memory.global.copy":"Copy the snippet","memory.global.intro":"What applies to all your projects goes in <code>~/.agents/global.md</code>. The app doesn't write it: each CLI reads it once you add its snippet.","memory.global.title":"Global memory","memory.index":"Index","memory.intro.what":"Shared memory keeps what the agents learn about this project —decisions, constraints, pitfalls they already ran into— for the next session.","memory.intro.where":"It lives in <code>.agents/memory/</code>: one note per file and an index, <code>MEMORY.md</code>. The four CLIs read it through a marked block in their instructions file. Nothing is written until you confirm the changes.","memory.list.empty":"No notes yet. The agents save them here when they learn something that's useful in another session.","memory.list.notes":"Notes","memory.loading":"Reading the memory…","memory.native.import_one":"Import {{count}} note","memory.native.import_other":"Import {{count}} notes","memory.native.importing":"Importing…","memory.native.pending_one":"Claude Code's own memory has {{count}} note that isn't here.","memory.native.pending_other":"Claude Code's own memory has {{count}} notes that aren't here.","memory.note.loading":"Reading the note…","memory.note.truncated":"The note was cut off because of its size.","memory.plan.back":"Back","memory.plan.changes":"Changes","memory.plan.copiedFrom":"Copy of {{path}}","memory.plan.install":"Install","memory.plan.nothing":"There's nothing to change: the bridge is already up to date.","memory.plan.update":"Update","memory.plan.writing":"Writing…","memory.problem.brokenBlock":"Its block markers are malformed","memory.problem.brokenBlockWarning":"<code>{{file}}</code> has malformed memory block markers: one without its pair, or the block repeated. The app won't touch it until you fix it by hand.","memory.problem.encoding":"It isn't in UTF-8","memory.problem.encodingWarning":"<code>{{file}}</code> isn't in UTF-8 (it looks like UTF-16, which is what <code>></code> writes in Windows PowerShell 5.1). Save it as UTF-8: the app won't touch it until then.","memory.problem.outside":"It's a link that points outside the project","memory.problem.outsideWarning":"<code>{{file}}</code> is a link that points outside the project: the app doesn't read or write it.","memory.reach.adjust":"Adjust","memory.reach.adjustTitle":"Choose the bridge's instruction files again","memory.reach.doesNotReach":": doesn't reach the memory, {{via}}","memory.reach.reaches":": reaches the memory through {{via}}","memory.reach.title":"{{label}}: {{via}}","memory.result.imported_one":"Imported {{count}} note.","memory.result.imported_other":"Imported {{count}} notes.","memory.result.installed_one":"Done: {{count}} file changed.","memory.result.installed_other":"Done: {{count}} files changed.","memory.result.nothingChanged":"There was nothing to change: the bridge was already up to date.","memory.result.nothingImported":"There were no new notes to import.","memory.result.skipped_one":"Not overwritten because it already existed with different content: {{files}}.","memory.result.skipped_other":"Not overwritten because they already existed with different content: {{files}}.","memory.result.withSkipped":"{{result}} {{skipped}}","memory.update.button":"Update the bridge","memory.update.missing":"The block is missing from {{files}}.","memory.update.outdatedAndMissing_one":"{{outdated}} has an outdated block; the block is missing from {{missing}}.","memory.update.outdatedAndMissing_other":"{{outdated}} have an outdated block; the block is missing from {{missing}}.","memory.update.outdated_one":"{{files}} has an outdated block.","memory.update.outdated_other":"{{files}} have an outdated block.","meter.configure":"Configure","meter.label":"Context","meter.lastResponseTitle":"The model's last response","meter.modelWithOrigin":"{{model}} — {{origin}}","meter.noTokens":"this CLI doesn't publish tokens","meter.noTokensTitle":"This CLI doesn't publish how many tokens each response uses, so there's nothing to measure.","meter.output":"output {{tokens}}","meter.responses_one":"{{count}} response","meter.responses_other":"{{count}} responses","meter.sessionTitle":"Total for the whole session","meter.sessionTotals_one":"session {{output}} out · {{cache}} cache · {{count}} response","meter.sessionTotals_other":"session {{output}} out · {{cache}} cache · {{count}} responses","meter.unknownModel":"unrecognized model: showing the tokens, not the window size","meter.unknownModelShort":"unrecognized model: no window size","meter.unmeasured":"not measured","meter.windowPercent":"{{percent}}% of the window","mode.acceptEdits.hint":"Accepts file edits without asking","mode.acceptEdits.label":"Accept edits","mode.auto.hint":"The CLI decides on its own which tools to use, without asking","mode.auto.label":"Auto","mode.default.hint":"Asks before each tool that isn't allowed","mode.default.label":"Manual","mode.plan.hint":"Researches and proposes a plan, without touching anything until you approve it","mode.plan.label":"Plan","narrow.keys.ctrlO":"Ctrl+O (in Claude Code, expands what is shown cut short)","narrow.keys.ctrlX":"Ctrl+X","narrow.keys.down":"Down arrow","narrow.keys.esc":"Escape","narrow.keys.interrupt":"Ctrl+C: interrupt","narrow.keys.label":"Terminal keys","narrow.keys.left":"Left arrow","narrow.keys.right":"Right arrow","narrow.keys.shiftTab":"Shift+Tab (in Claude Code, cycles the permission mode)","narrow.keys.tab":"Tab","narrow.keys.up":"Up arrow","narrow.menu.chimePage":"This page","narrow.menu.chimeSystem":"System","narrow.menu.cli":"CLI","narrow.menu.connection":"Connection","narrow.menu.folder":"Folder","narrow.menu.language":"Language","narrow.menu.notifications":"System notifications","narrow.menu.phoneAppDisconnect":"Disconnect","narrow.menu.phoneAppSettings":"Settings","narrow.menu.shortcuts":"Keyboard shortcuts","narrow.menu.sound":"Notification sound","narrow.menu.theme":"Theme","narrow.more":"More","narrow.projects":"Projects","narrow.tabs.close":"Close tab","narrow.tabs.new":"New tab","narrow.tabs.none":"No tabs open.","narrow.tabs.open":"Tabs","narrow.tabs.rename":"Rename","narrow.view.chat":"Chat","notes.attach":"Attach an image from a file","notes.closeConfirm":"Closing this note deletes it, along with its images.","notes.closeNote":"Close the note. It's deleted, along with its images","notes.collapse":"Collapse. Notes aren't lost: the × on each tab is what closes them","notes.empty":"No notes. The <b>+</b> opens one; they're for jotting down an idea without leaving what you're doing.","notes.expand":"Expand the notes","notes.imageAlt":"note image","notes.imageFallbackName":"the image","notes.imageOnly":"Image","notes.imageTooBig":'"{{name}}" is {{size}} MB; the maximum is {{max}} MB.',"notes.imageUnavailable":"the image isn't available","notes.lightboxClose":"Click to close","notes.name":"Notes","notes.new":"New note","notes.placeholder":"Jot down an idea. Images can be pasted or dragged here.","notes.readFailed":"Couldn't read the image.","notes.removeImage":"Remove the image","notes.resize":"Drag to change the height","notes.thumbMissing":"missing","notes.tooManyImages_one":"Up to {{count}} image per note.","notes.tooManyImages_other":"Up to {{count}} images per note.","notes.untitled":"Note","notify.attention":"“{{tab}}” is waiting for you","notify.done":"“{{tab}}” finished","panel.cliUnseen":"The CLI wrote something","panel.hide":"Hide the panel (Alt+P)","panel.restoreWidth":"Restore the column's width","panel.tab.cli":"CLI","panel.tab.files":"Files","panel.tab.git":"Changes","panel.tab.memory":"Memory","panel.tab.plans":"Plans","panel.widen":"Widen the column — the CLI's interface needs room to draw diffs and tables","picker.create":"Create","picker.createHere":"Create a folder here","picker.empty":"There are no subfolders here.","picker.goTo":"Go to {{root}}","picker.loading":"Reading the disk...","picker.newFolderName":"Folder name","picker.truncated":"There are more subfolders than fit in the list. Open one to narrow it down.","picker.up":"parent folder","plans.backToList":"Plans","plans.empty":"This conversation hasn't written any documents yet. Plans from plan mode show up here, along with the <code>.md</code> files the agent saves in the project or in its temporary folder.","plans.loading":"Reading the plan…","plans.missing":"missing","plans.missingTitle":"The file is no longer on disk","plans.truncated":"The plan was cut off because of its size.","remote.address":"This computer's address","remote.copied":"Copied","remote.copy":"Copy","remote.device.connected":"Connected now","remote.device.lastSeen":"Last seen: {{when}}","remote.device.never":"Never connected","remote.device.paired":"Paired: {{when}}","remote.device.rename":"Rename","remote.device.revoke":"Revoke","remote.device.revokeConfirm":"Click again to revoke","remote.devices":"Paired devices","remote.devices.empty":"None yet.","remote.intro":"Use Agent Workbench from another computer on your network, or from your phone. Nothing is opened to the network: the connection goes through an SSH tunnel.","remote.onlyOnHost":"Only on the computer running Agent Workbench: it opens with that computer's apps.","remote.pair.after":"After that, the other computer just opens {{url}}.","remote.pair.cancel":"Cancel","remote.pair.expires":"It works once and expires in {{time}}.","remote.pair.needsActive":"You can pair once remote access is on and running.","remote.pair.open":"With the tunnel running, open this address in the other computer's browser:","remote.pair.start":"Pair a device","remote.phone.authorize.admin":"1. Authorize the phone's key: on this computer, paste this into PowerShell as administrator.","remote.phone.authorize.powershell":"1. Authorize the phone's key: on this computer, paste this into PowerShell.","remote.phone.authorize.terminal":"1. Authorize the phone's key: on this computer, paste this into a terminal.","remote.phone.authorizeOnce":"The key only opens the tunnel to Agent Workbench: no terminal and no commands. If you already pasted it, you don't need to do it again.","remote.phone.hint":"Using the Android app? It only needs step 1: it opens the tunnel and pairs itself.","remote.phone.qrLabel":"Code to scan with the phone","remote.phone.scan":"2. In the app, tap “Scan code” and point the camera here:","remote.phone.secret":"Don't share this code or a photo of it: it carries the phone's key.","remote.phone.start":"Pair a phone","remote.phone.title":"A phone","remote.port":"Port","remote.portInvalid":"A number between {{min}} and {{max}}.","remote.portSave":"Save","remote.restartHint":"Turning it on, or changing the port, takes effect when you restart Agent Workbench. Restarting closes the open CLIs: the tabs come back asleep.","remote.ssh.linux":"In a terminal (Ubuntu or Debian; on other distributions, install their OpenSSH server):","remote.ssh.macos":"System Settings → General → Sharing → turn on “Remote Login”.","remote.ssh.windows":"Open PowerShell as administrator and paste this. The first line downloads and installs the server: it takes a few minutes and shows “Running” meanwhile. Wait until the prompt comes back before moving on.","remote.state.active":"On, port {{port}}","remote.state.off":"Off","remote.state.portBusy":"Port {{port}} is busy, so remote access isn't working in this run. Close the other program (it may be another Agent Workbench) and restart, or choose another port.","remote.state.restartNeeded":"On, but it takes effect when you restart Agent Workbench","remote.step.host":"1. On this computer, once: turn on SSH","remote.step.hostHint":"It's a system setting that needs administrator rights, so the app doesn't do it for you. This computer's system is open:","remote.step.pair":"3. Pair it, once per device","remote.step.tunnel":"2. On the other computer, each time you use it","remote.step.tunnelHint":"Paste this command into its terminal and leave it open. It asks for the password of your user on this computer.","remote.title":"Remote access","remote.trouble":"Not connecting?","remote.trouble.network":"On Windows, check that this computer's Wi‑Fi network is set to Private.","remote.turnOff":"Turn off","remote.turnOffHint":"Turning it off takes effect right away: paired devices are disconnected, and stay paired.","remote.turnOn":"Turn on remote access","remote.userHint":"If SSH rejects “{{user}}”: with a Microsoft or work account, try the name of your user folder (C:\\Users\\<name>) and the account password, not the PIN.","remote.vpnHint":"A work VPN that blocks the local network cuts the connection while it's on. The app can't do anything about that.","search.found":"{{hits}} in {{sessions}}","search.hits_one":"{{count}} match","search.hits_other":"{{count}} matches","search.mode.conversations":"In conversations","search.mode.conversationsTitle":"Searches the text of the conversations saved in the local copy, ignoring case and accents","search.mode.titles":"In titles","search.off":"The local copy is off: the search covers what it saved while it was on.","search.placeholder.conversations":"Search the conversations (Enter)","search.placeholder.titles":"Filter projects and sessions","search.role.assistant":"Response","search.role.title":"Title","search.role.user":"Request","search.sessions_one":"{{count}} session","search.sessions_other":"{{count}} sessions","search.status.done":"{{found}}.","search.status.none":"No results","search.status.noneIn":"No results in {{sessions}}.","search.status.progressFound_one":"Searching… {{scanned}} of {{count}} session, {{found}} so far.","search.status.progressFound_other":"Searching… {{scanned}} of {{count}} sessions, {{found}} so far.","search.status.progress_one":"Searching… {{scanned}} of {{count}} session.","search.status.progress_other":"Searching… {{scanned}} of {{count}} sessions.","search.status.searching":"Searching…","search.status.truncatedResults":"{{found}}: these are the first ones, refine the search to see the rest.","search.status.truncatedTime":"{{found}}: the search stopped after {{seconds}} s and {{left}} were left unchecked.","search.tooShort":"Type at least {{min}} characters and press Enter.","searchHook.connectionLost":"The connection to the server was lost: search again.","server.agentUnknown":"This server doesn't know how to launch that CLI.","server.answerInterrupted":"The answer wasn't fully sent: the interruption cut it off.","server.answerInvalid":"The answer doesn't match the question.","server.answerNoFreeText":"This question doesn't accept a written answer: choose one of the options.","server.answerNotPending":"That question is no longer waiting for an answer.","server.answerSendFailed":"The answer couldn't be sent: answer it in the CLI tab.","server.answersUnsupported":"This CLI doesn't take answers from the conversation. Answer it in the CLI tab.","server.archiveOpenTab":"Sessions with an open tab aren't archived. Close it first.","server.attachmentEmpty":'"{{name}}" arrived empty.',"server.attachmentExecutable":`Executables aren't attached: "{{name}}".`,"server.attachmentSaveFailed":"The attached file couldn't be saved.","server.attachmentTooLarge":'"{{name}}" is {{size}} MB; the maximum is {{max}} MB.',"server.badMessage":"Message not recognized by the protocol.","server.cliMissing":`The "{{command}}" command wasn't found in the PATH. Agent Workbench uses the CLI you already have installed: it doesn't include or download it. Install it from {{url}} and start again.`,"server.cliNotFound":"The CLI isn't installed or wasn't found in the PATH.","server.cliNotInstalled":"{{label}} isn't installed or wasn't found in the PATH.","server.cliOpenFailed":"The tab's CLI couldn't be opened.","server.continueFailed":"The continuation couldn't be prepared.","server.continueHistoryMissing":"That conversation's history wasn't found.","server.continueNoFolder":"That conversation doesn't say which folder it ran in.","server.continueNotInHistory":"That conversation isn't in the history: if it just started, try again in a few seconds.","server.continueReadFailed":"That conversation couldn't be read.","server.continueSameCli":"That conversation already belongs to that CLI: to continue it, open it from the sidebar.","server.continueTabFailed":"The continuation's tab couldn't be opened.","server.continueTranscriptFailed":"The continuation's transcript couldn't be saved.","server.conversationNotFollowed":"That conversation is no longer being followed.","server.cwdMissing":"The directory doesn't exist: {{cwd}}","server.cwdNotDir":"It isn't a directory: {{cwd}}","server.diffBinaryUntracked":"Untracked binary file.","server.diffNewEmpty":"New, empty file.","server.diffNoStaged":"There are no staged changes for this file.","server.diffNoUnstaged":"There are no unstaged changes for this file.","server.diffReadFailed":"The diff couldn't be read.","server.dirReadFailed":"The directory couldn't be read.","server.dirSearchFailed":"The directory couldn't be searched.","server.fileReadFailed":"The file couldn't be read.","server.filesPerMessage":"You can attach up to {{max}} files per message.","server.gitCommandFailed":"git {{command}} failed.","server.gitMissing":"git wasn't found in the PATH. The Changes panel needs git installed; the rest of the app works the same.","server.gitNotFound":"git wasn't found in the PATH.","server.gitNotRepo":"This folder isn't inside a git repository.","server.gitRunFailed":"git couldn't be run to read the repository's status.","server.gitStatusUnknown":"The repository's status isn't known yet.","server.gitUnexpected":"Unexpected answer from git {{command}}.","server.handoffEmpty":"That conversation has no messages to continue.","server.handoffNoTranscript":"That conversation has no messages to continue: that CLI didn't leave a readable transcript.","server.imageEmpty":"The image arrived empty.","server.imageTooLarge":"The image is {{size}} MB; the maximum is {{max}} MB.","server.imageTypeUnsupported":"Image type not supported: {{type}}","server.imageUnknownFormat":"The content isn't an image in a known format.","server.imagesPerMessage":"You can attach up to {{max}} images per message.","server.imagesUnsupported":"This CLI doesn't take images from the message box.","server.memoryAppeared":"{{file}} appeared during the installation. Review the changes again.","server.memoryBrokenBlock":"{{file}} has malformed memory block markers (one without its pair, or the block repeated). Fix it by hand: the app won't touch that file in the meantime.","server.memoryChooseFile":"Choose at least one instructions file.","server.memoryGitFailed":"git couldn't be queried ({{detail}}). Without that, there's no telling whether .gitignore needs changes.","server.memoryHardLinks":"{{file}} has hard links: the app doesn't modify it, because writing it would break the link. Add the block by hand.","server.memoryLinkOutside":"{{path}} points outside the project (a link or a junction): the app doesn't write there.","server.memoryNotAFile":"{{label}} exists but isn't a file.","server.memoryNotInstalled":"Install the bridge first: the .agents/memory folder is missing.","server.memoryNotUtf8":"{{file}} isn't UTF-8 (it looks like UTF-16, which is what `>` leaves in Windows PowerShell 5.1). Save it as UTF-8: the app won't touch it in the meantime.","server.memoryNoteClaude":"Add this line at the end. Claude Code imports the file at startup.","server.memoryNoteGone":"That note no longer exists.","server.memoryNoteHardLink":"Hard link. `~/{{path}}` has to exist first, and the CLI's file must not: if it exists, move what it has into `global.md` and delete it. If your editor saves by replacing the file, the link breaks: in that case copy the content.","server.memoryNoteHardLinkCmd":"Hard link, in cmd. `~/{{path}}` has to exist first, and the CLI's file must not: if it exists, move what it has into `global.md` and delete it. If your editor saves by replacing the file, the link breaks: in that case copy the content.","server.memoryNoteName":"That name isn't a memory note.","server.memoryNoteOpenCode":"Inside the root object. Absolute path: OpenCode doesn't expand `~` in this key (unverified).","server.memorySameFile":"{{other}} and {{file}} are the same file (a link). Choose just one.","server.memoryViaEncoding":"{{file}} isn't UTF-8","server.memoryViaFallback":"CLAUDE.md (fallback)","server.memoryViaFile":"{{file}}","server.memoryViaNoBlock":"the block is missing in {{file}}","server.memoryViaNoBlockEither":"the block is missing in AGENTS.md or CLAUDE.md","server.memoryViaNoFolder":"the .agents/memory folder is missing","server.memoryViaNoIndex":".agents/memory/MEMORY.md is missing","server.memoryViaOutside":"{{file}} points outside the project","server.modePendingConfirmation":"There's a confirmation pending in the CLI: changing the mode now would approve it. Answer it in the CLI tab.","server.modeUnreachable":"That mode can't be reached from the current one. Change it with {{key}} in the CLI tab.","server.modesUnsupported":"This CLI has no permission modes to change from here.","server.noteCliNotStarted":"That tab's CLI didn't manage to start; the note wasn't sent.","server.noteEmpty":"The note is empty.","server.noteExists":"That note already exists.","server.noteGone":"The note no longer exists.","server.noteIdInvalid":"The note's id isn't valid.","server.noteImageFailed":"An image from the note couldn't be attached.","server.noteImagesMax":"Up to {{max}} images per note.","server.noteImagesUnsupported":"This CLI doesn't take images; the note wasn't sent.","server.noteInterrupted":"The note wasn't fully sent: the interruption cut it off.","server.noteNoAgent":"That tab has no agent to send the note to.","server.noteNoReadySignal":"This CLI doesn't say when it's ready; the note wasn't sent.","server.noteSaveFailed":"The note couldn't be saved.","server.noteTooLong":"A note holds up to {{max}} characters.","server.notesMax":"Up to {{max}} open notes. Close one first.","server.openToolSubmit":"{{label}} has a tool without a result: it may be asking for approval. Answer it in the CLI tab.","server.operationFailed":"The operation couldn't be completed: {{detail}}","server.pasteImageFailed":"The pasted image couldn't be saved.","server.pathMissing":"The path doesn't exist.","server.pathNotRelative":"Only paths relative to the tab's directory are accepted.","server.pathNullByte":"The path contains a null byte.","server.pathOpenFailed":"The path couldn't be opened.","server.pathOutside":"The path goes outside the tab's directory.","server.pendingSubmitAnswer":"{{label}} is waiting for an answer: the message's Enter would answer it. Answer it in the CLI tab.","server.pendingSubmitPermission":"{{label}} is waiting for you to authorize a tool: the message's Enter would approve it. Answer it in the CLI tab.","server.pickerCliFolder":"That folder belongs to the CLI and can't be opened from here.","server.pickerClosed":"That folder picker is no longer open.","server.pickerCreateFailed":"The folder couldn't be created there.","server.pickerFolderExists":"There's already a folder with that name.","server.pickerListFailed":"That folder couldn't be listed.","server.pickerNameChars":"The name has characters that can't be used.","server.pickerNameInvalid":"The folder name isn't valid.","server.pickerNoProjectsHere":"Projects aren't created there: it's the CLI's folder.","server.pickerNotListed":"That folder isn't in the current listing.","server.pickerRootMissing":"That root doesn't exist.","server.pickerTooMany":"Too many folder pickers are open.","server.planReadFailed":"The plan couldn't be read.","server.raw":"{{text}}","server.relaunchCloseFailed":"The tab's CLI couldn't be closed to relaunch it.","server.remoteDeviceGone":"That device is no longer paired.","server.remoteFailed":"The remote access change couldn't be made.","server.remoteHostOnly":"Remote access is managed only from the computer running Agent Workbench.","server.remoteNotActive":"Remote access isn't on and running yet. Turn it on and restart Agent Workbench.","server.remoteOpensOnHost":"That opens a window on the computer running Agent Workbench, so it isn't available from a remote device.","server.remotePortInvalid":"The port has to be a number between {{min}} and {{max}}.","server.remoteTooManyDevices":"There are already {{max}} paired devices. Revoke one first.","server.searchFailed":"The local copy couldn't be searched.","server.shellNotFound":"No system console was found to open.","server.submitInterrupted":"The message wasn't fully sent: the interruption cut it off.","server.submitStoppedTool":"The message wasn't fully sent: {{label}} opened a tool while it was being typed and may be asking for approval. Check the CLI tab.","server.submitStoppedToolNoLabel":"The message wasn't fully sent: the CLI opened a tool while it was being typed and may be asking for approval. Check the CLI tab.","server.submitStoppedWaiting":"The message wasn't fully sent: {{label}} started waiting for an answer while it was being typed. Answer it before sending another message.","server.submitStoppedWaitingNoLabel":"The message wasn't fully sent: the CLI started waiting for an answer while it was being typed. Answer it before sending another message.","server.tabClosedWhileOpening":"The tab closed while it was opening.","server.tabDirGone":"The tab's directory no longer exists.","server.tabOpenFailed":"The tab couldn't be opened.","server.terminalAsleep":"This tab doesn't have its CLI open. Open it to write to the agent.","server.terminalGone":"The terminal no longer exists.","server.terminalOpenFailed":"The terminal couldn't be opened.","server.tooManyTabs":"You can't open more than {{max}} tabs at once.","server.vaultBusyMeasuring":"The local copy is busy measuring. Try again when it's done.","server.vaultBusyMoving":"The local copy is busy moving to another folder. Try again when it's done.","server.vaultBusyWriting":"The local copy is busy copying. Try again when it's done.","server.vaultCannotWrite":"That folder can't be written to.","server.vaultCurrentInsideTarget":"The current copy can't end up inside the new folder.","server.vaultDiskFull":"Disk full: the pass stopped ({{detail}})","server.vaultFailed":"The local copy operation couldn't be completed.","server.vaultIndexNotReady":"The history is still being read. Measure when it's done.","server.vaultMeasureFirst":"First measure how much it would take.","server.vaultMemoryFailed":"memory of {{cwd}}: {{detail}}","server.vaultMoveFailed":"The local copy couldn't be moved: {{detail}}","server.vaultMoving":"The local copy is moving to another folder. Try again when it's done.","server.vaultNoCopyYet":"There's no local copy yet.","server.vaultNotLoaded":"The local copy isn't loaded.","server.vaultProjectGone":"That project is no longer in the sidebar.","server.vaultReasonNewerFormat":"the existing copy is in a newer format","server.vaultReasonOriginMissing":"the source wasn't found","server.vaultReasonUnsafeId":"a session id that can't be copied","server.vaultSessionFailed":"{{agent}}/{{session}}: {{detail}}","server.vaultSessionMissing":"That session isn't in the local copy.","server.vaultTargetCliFolder":"That folder belongs to a CLI: the local copy isn't kept there.","server.vaultTargetInsideCurrent":"The new folder can't be inside the current copy.","server.vaultTargetNotAbsolute":"The local copy folder has to be an absolute path.","server.waitingSubmit":"{{label}} is waiting for an answer: answer it before sending another message.","session.untitled":"Untitled session","shortcuts.altNumber":"<strong>Alt + number</strong> isn't used either, on purpose: on Windows, Alt with the numeric keypad is how you type characters that aren't on the keyboard (<kbd>Alt + 164</kbd> = ñ). Intercepting it breaks typing accented characters. To switch tabs there are <kbd>Alt + ←</kbd> and <kbd>Alt + →</kbd>.","shortcuts.app.closeTab":"Close the active tab","shortcuts.app.newTab":"New tab in the current tab's directory","shortcuts.app.previousTab":"Go back to the previous tab (outside the terminal: inside, it goes to the CLI)","shortcuts.app.switchTab":"Previous / next tab (also Alt + PgUp / PgDn)","shortcuts.app.togglePanel":"Show or hide the right panel","shortcuts.ariaLabel":"Keyboard shortcuts","shortcuts.browserReserved":"<strong>Ctrl+T</strong>, <strong>Ctrl+W</strong> and <strong>Ctrl+Tab</strong> can't be used: the browser keeps them for its own tabs and the event never reaches the page.","shortcuts.cliHint":"The CLI handles these. The app doesn't intercept them: they reach it as they are. In the terminal, a new line is still <kbd>Ctrl + J</kbd> and images are pasted with <kbd>Alt + V</kbd>; the message box is the one with the keys above.","shortcuts.section.app":"Application","shortcuts.section.cli":"CLI, inside the terminal","shortcuts.section.composer":"In the message box","shortcuts.title":"Shortcuts","sidebar.action.archive":"Archive","sidebar.action.restore":"Restore","sidebar.action.undo":"Undo","sidebar.archived.hide_one":"Hide {{count}} archived","sidebar.archived.hide_other":"Hide {{count}} archived","sidebar.archived.show_one":"Show {{count}} archived","sidebar.archived.show_other":"Show {{count}} archived","sidebar.archived.toggleTitle":"Archived sessions stay on disk; this only shows or hides them","sidebar.empty.noMatch":"Nothing matches the filter.","sidebar.empty.noProjects":"No projects found in the history.","sidebar.hide":"Hide the projects","sidebar.history.button":"Archive history…","sidebar.history.buttonTitle":"Hide a CLI's sessions from before today in one go. Nothing is deleted","sidebar.history.confirm_one":"{{count}} {{label}} session will be hidden; nothing is deleted","sidebar.history.confirm_other":"{{count}} {{label}} sessions will be hidden; nothing is deleted","sidebar.history.count_one":"{{count}} session from before today","sidebar.history.count_other":"{{count}} sessions from before today","sidebar.history.heading":"Archive everything before today","sidebar.history.region":"Archive history","sidebar.indexing":"Indexing {{scanned}} / {{total}}","sidebar.newProject":"New project: choose or create a folder","sidebar.project.archive":"Archive project","sidebar.project.archiveTitle":"Archive the project: hides its conversations from the sidebar. Nothing is deleted","sidebar.project.export":"Export to Markdown","sidebar.project.folderGone":"The folder no longer exists on disk","sidebar.project.missing":"folder not found","sidebar.project.newSession":"New session in this project","sidebar.reindex":"Reindex the history","sidebar.searchMode.label":"Where to search","sidebar.searchMode.titlesTitle":"Filters the list by project name and session title","sidebar.selection.count_one":"{{count}} selected","sidebar.selection.count_other":"{{count}} selected","sidebar.session.archive":"Archive — hides it from the list, nothing is deleted","sidebar.session.blocked":"It has an open tab. Close it first.","sidebar.session.restore":"Restore to the list","sidebar.undo.dismissTitle":"Dismiss the notice; the sessions stay archived","sidebar.undo.text_one":"Archived {{count}} session from {{what}}","sidebar.undo.text_other":"Archived {{count}} sessions from {{what}}","sidebar.vaultLine.lastError":"Last error: {{error}}","sidebar.vaultLine.title":"See the local copy's status and folder","sound.notify.blocked":"The browser is blocking this page's notifications. Allow them in the site's settings and click again.","sound.notify.off":"System notifications off — click to turn them on","sound.notify.on":"System notifications on — click to turn them off. They only show when this window isn't in view.","sound.off":"Notification sound muted — click to turn it on","sound.on":"Notification sound on — click to mute","sound.volume":"Notification sound volume","statusLine.benefit":"With the status line configured, this CLI's tabs show their status, the “waiting” bar when it asks for permission to use a tool, and the context meter with the exact window. Without it there's no way to know: the CLI doesn't leave it in any other file.","statusLine.check":"Check","statusLine.checkHint":"The app also notices on its own within a couple of seconds.","statusLine.checking":"Checking…","statusLine.copied":"Copied","statusLine.copy":"Copy","statusLine.copyTitle":"Copy the line to the clipboard","statusLine.lineSection":"The line","statusLine.mergeHint":"Merge it with what the file below already has, without replacing it: if it already has braces, add only the <kbd>statusLine</kbd> key.","statusLine.runsEverywhere":"With the line in place, every CLI session runs it, including the ones you open outside the app, and it needs <kbd>node</kbd> in the PATH.","statusLine.scriptHint":"It only saves the status, model and tokens of each conversation, in the app's folder. It doesn't save your email, your quota or the cost, which the CLI also passes to it, and it doesn't print anything: the CLI's own line stays as it is.","statusLine.scriptSection":"What the script does","statusLine.title":"{{agent}} status line","statusLine.whereHint":"The app doesn't touch that file: you edit it.","statusLine.whereSection":"Where","summary.alsoWorksWith":"Also works with: {{names}}","summary.newerServer":"The server is from a newer version than this page (protocol {{server}}, this page uses {{page}}). Reload the page with F5.","summary.outdatedServer":"The running server is from an older version than this page (protocol {{server}}, this page uses {{page}}). Restart it and reload the page.","support.dismiss":"Not now","support.link":"Support","support.notice":"If Agent Workbench is useful to you, consider supporting it.","tabs.aria.opening":"opening","tabs.aria.working":"working","tabs.close":"Close (Alt+W)","tabs.dot.busy":"The agent is working","tabs.dot.exited":"This tab's CLI has closed","tabs.dot.sleeping":"Sleeping: readable, no CLI open","tabs.dot.waiting":"The CLI is waiting for an answer from you","tabs.new":"New tab (Alt+T)","tabs.state.alive":"active","tabs.state.exited":"exited (code {{code}})","tabs.state.opening":"opening…","tabs.state.sleeping":"sleeping","terminal.exited":"the process exited (code {{code}})","terminal.replayTruncated":"earlier output trimmed","theme.dark":"Dark theme","theme.light":"Light theme","theme.system":"System theme","theme.title":"{{theme}} — click to change","thread.continueWith":"↪ Continue with…","thread.copyMessage":"Copy this message's text","thread.empty.noMessages":"The session doesn't have any messages yet.","thread.empty.unavailable":"This tab doesn't have a known directory, so there's no session file to follow.","thread.empty.waiting":"Waiting for the first message. The session file is created when the conversation starts.","thread.fold.less":"show less","thread.fold.more_one":"show {{count}} line","thread.fold.more_other":"show all {{count}} lines","thread.goToCli":"Go to the CLI tab","thread.image.alt":"message image","thread.image.gone":"the image is no longer in the file","thread.image.loading":"loading image…","thread.image.openTitle":"Click to see it full size","thread.loadEarlier":"Load earlier messages","thread.loadingMore":"Loading...","thread.notice.compacted":"Context compacted","thread.notice.compactedAuto":"Context compacted automatically","thread.notice.error":"The CLI returned an error: {{detail}}","thread.notice.errorNoDetail":"The CLI returned an error","thread.notice.interrupted":"Interrupted","thread.pasted_one":"Pasted text #{{number}} · {{count}} line","thread.pasted_other":"Pasted text #{{number}} · {{count}} lines","thread.question.answerInCli":"Answer in the CLI tab","thread.question.answered":"Answered","thread.question.multi":"multiple","thread.question.pickEach":"Pick an option in each question · you can also answer in the CLI tab","thread.question.pickOne":"Pick an option · you can also answer in the CLI tab","thread.question.placeholder":"Write your answer","thread.question.send":"Send","thread.question.sendAnswers":"Send answers","thread.question.useText":"Use this text","thread.question.writeOther":"Write another answer…","thread.question.writeOtherHint":"To suggest an alternative, or give more context","thread.rewind":"Go back here — opens the CLI's rewind menu in the CLI tab (Esc Esc)","thread.search.next":"Next","thread.search.none":"no results","thread.search.placeholder":"Search the conversation","thread.search.previous":"Previous","thread.tool.error":"error","thread.tool.imagesNotSent_one":"({{count}} image: not sent to the panel)","thread.tool.imagesNotSent_other":"({{count}} images: not sent to the panel)","thread.tool.images_one":"{{count}} image","thread.tool.images_other":"{{count}} images","thread.tool.input":"input","thread.tool.noOutput":"(no output)","thread.tool.orphanResult":"orphan result","thread.tool.result":"result","thread.truncated":"… (truncated)","thread.turn.effort":"effort {{effort}}","thread.turn.queued":"sent while it was working","thread.turn.queuedTitle":"You wrote it while the agent was working: it went into the turn already in progress","thread.turn.you":"You","thread.wake.exited":"This tab's CLI closed.","thread.wake.exitedWithCode":"This tab's CLI closed (exit code {{code}}).","thread.wake.open":"Open CLI","thread.wake.opening":"Opening…","thread.wake.sleeping":"You're reading this conversation without the CLI open. Open it to write to the agent.","threadFont.size.l":"large","threadFont.size.m":"normal","threadFont.size.s":"small","threadFont.title":"Font size: {{current}} (click: {{next}})","time.daysAgo":"{{count}} d ago","time.hoursAgo":"{{count}} h ago","time.justNow":"just now","time.minutesAgo":"{{count}} min ago","tools.run.agent_one":"{{count}} subagent","tools.run.agent_other":"{{count}} subagents","tools.run.callsTo_one":"{{count}} call to {{name}}","tools.run.callsTo_other":"{{count}} calls to {{name}}","tools.run.edit_one":"{{count}} edit","tools.run.edit_other":"{{count}} edits","tools.run.find_one":"{{count}} project search","tools.run.find_other":"{{count}} project searches","tools.run.read_one":"{{count}} file read","tools.run.read_other":"{{count}} files read","tools.run.shell_one":"{{count}} console command","tools.run.shell_other":"{{count}} console commands","tools.run.todo_one":"{{count}} to-do list","tools.run.todo_other":"{{count}} to-do lists","tools.run.web_one":"{{count}} search","tools.run.web_other":"{{count}} searches","vault.archived":"Archived sessions aren't copied, and archiving one that was already copied doesn't delete its copy. The app never deletes anything from this folder.","vault.busy":"A local copy operation is in progress. Wait for it to finish.","vault.button.off":"Local copy: off. Set it up","vault.button.on":"Local copy: on. See the status and the folder","vault.dialog.activate":"Turn on","vault.dialog.activateExistingHint":"The folder already has a copy. Once on, it completes it and keeps it up to date.","vault.dialog.activateExistingTitle":"The folder already has a copy: turning it on completes it","vault.dialog.activateMeasuredHint":"Copies everything measured and, after that, every session that changes and stays quiet for a minute.","vault.dialog.activateMeasuredTitle":"Copies what was measured now and, after that, every session that changes","vault.dialog.changeDir":"Change folder…","vault.dialog.changeDirTitle":"Choose another folder. What was copied gets copied there; this one stays untouched","vault.dialog.defaultDir":"It's the default one, in the app's folder.","vault.dialog.folderSection":"Folder","vault.dialog.inFolder":"In the folder","vault.dialog.lastError":"Last error","vault.dialog.lastPass":"last pass {{when}}","vault.dialog.measure":"Measure","vault.dialog.measureAgain":"Measure again","vault.dialog.measureTitle":"Reads the whole history without writing anything, not even the folder","vault.dialog.needsMeasure":"First measure how much it would take: then “{{activate}}” shows up.","vault.dialog.openFolder":"Open folder","vault.dialog.openFolderTitle":"Open the folder in the system's file explorer","vault.dialog.pendingCalm_one":"{{count}} waiting for its quiet minute","vault.dialog.pendingCalm_other":"{{count}} waiting for their quiet minute","vault.dialog.sizeSection":"How much it would take","vault.dialog.table.archived":"Archived","vault.dialog.table.archivedTitle":"Archived sessions aren't copied","vault.dialog.table.images":"Images","vault.dialog.table.memory_one":"Memory of {{count}} project","vault.dialog.table.memory_other":"Memory of {{count}} projects","vault.dialog.table.sessions":"Sessions","vault.dialog.table.size":"Size","vault.dialog.table.total":"Total","vault.dialog.turnOff":"Turn off","vault.dialog.turnOffHint":"Turning it off doesn't delete anything: what was copied stays in the folder.","vault.dialog.waiting":"Waiting for the server's status…","vault.export.done":"Exported: the folder was opened","vault.export.exporting":"Exporting to Markdown…","vault.export.idle":"Export this project's sessions to Markdown","vault.indexNotReady":"The history is still being read. Measure when it's done.","vault.line.copying":"copying","vault.line.copyingProgress":"copying {{done}} / {{total}}","vault.line.measuring":"measuring","vault.line.moving":"moving to another folder","vault.line.neverCopied":"not copied yet","vault.line.pending_one":"{{count}} waiting","vault.line.pending_other":"{{count}} waiting","vault.mark.copy":"copy","vault.mark.copyTitle":"The CLI's history no longer has this session. The local copy opens, in Markdown.","vault.mark.partial":"partial","vault.mark.partialTitle":"Only the summary and the documents were recovered: the conversation's content is encrypted.","vault.measure.summary":"Measured {{when}}, in {{duration}}","vault.measure.summaryNoWhen":"Measured in {{duration}}","vault.name":"Local copy","vault.note.empty_one":"{{count}} empty","vault.note.empty_other":"{{count}} empty","vault.note.failedWithReasons_one":"{{count}} failed ({{reasons}})","vault.note.failedWithReasons_other":"{{count}} failed ({{reasons}})","vault.note.failed_one":"{{count}} failed","vault.note.failed_other":"{{count}} failed","vault.note.notCopied":"Not copied: {{parts}}","vault.note.unsupported_one":"{{count}} without a full read","vault.note.unsupported_other":"{{count}} without a full read","vault.previousDir":"The previous folder was left untouched: {{dir}}","vault.privacy":"It keeps the same as each CLI's history —messages, tool inputs and results, images— in a folder of yours. If you put it in a synced folder or in a repository, all that travels with it.","vault.sessions_one":"{{count}} session","vault.sessions_other":"{{count}} sessions","vault.state.measuring":"Measuring…","vault.state.measuringProgress":"Measuring… {{done}} / {{total}}","vault.state.moving":"Moving to another folder…","vault.state.off":"Off","vault.state.on":"On","vault.state.writing":"Copying…","vault.state.writingProgress":"Copying… {{done}} / {{total}}","workspace.connectFailed":"Couldn't connect to the local server. Open the URL it printed at startup again."},Vc=["en","es","de","fr","pt-BR","ru","ja","ko","zh-CN"],dp="en",sc={en:"English",es:"Español",de:"Deutsch",fr:"Français","pt-BR":"Português (Brasil)",ru:"Русский",ja:"日本語",ko:"한국어","zh-CN":"简体中文"},c0={en:"EN",es:"ES",de:"DE",fr:"FR","pt-BR":"PT",ru:"RU",ja:"JA",ko:"KO","zh-CN":"ZH"},qc={en:"en-US",es:"es-419",de:"de-DE",fr:"fr-FR","pt-BR":"pt-BR",ru:"ru-RU",ja:"ja-JP",ko:"ko-KR","zh-CN":"zh-CN"},u0={es:()=>In(()=>import("./es-BCB5Npb3.js"),[]),de:()=>In(()=>import("./de-fq_F8zRo.js"),[]),fr:()=>In(()=>import("./fr-ClL0BO43.js"),[]),"pt-BR":()=>In(()=>import("./pt-BR-rXhfKNdD.js"),[]),ru:()=>In(()=>import("./ru-BjrRxMeM.js"),[]),ja:()=>In(()=>import("./ja-C7KI4Gtm.js"),[]),ko:()=>In(()=>import("./ko-C8der8AK.js"),[]),"zh-CN":()=>In(()=>import("./zh-CN-DDY7nBK5.js"),[])},fp=l0,Lc=new Map([["en",fp]]),Md=new Map,Tc=new Set;let Bi=dp,Rc=qc[dp],Ad=0;function pp(n){return Vc.includes(n)}function Mc(){return Bi}function fa(){return Rc}function h0(n){return qc[n]}function mp(n){return Tc.add(n),()=>Tc.delete(n)}async function gp(n,r=qc[n]){const o=++Ad;if(!Lc.has(n)&&n!=="en"){const m=await u0[n]();Lc.set(n,m.default)}if(o===Ad&&!(Bi===n&&Rc===r)){Bi=n,Rc=r;for(const m of Tc)m()}}function d0(n,r){let o=Md.get(n);return o===void 0&&(o=new Intl.PluralRules(n),Md.set(n,o)),o.select(r)}function Nd(n,r,o,m){if(m!==void 0){const w=n[`${o}_${d0(r,m)}`]??n[`${o}_other`];if(w!==void 0)return w}return n[o]}function f0(n,r,o,m){const w=m==null?void 0:m.count,A=typeof w=="number"?w:void 0;return(n===void 0?void 0:Nd(n,r,o,A))??Nd(fp,"en",o,A)??o}function ia(n,r){return r===void 0?n:n.replace(/\{\{\s*([A-Za-z0-9_]+)\s*\}\}/g,(o,m)=>{const w=r[m];return w===void 0?o:String(w)})}function _p(n,r){return f0(Lc.get(Bi),Bi,n,r)}function E(n,r){return ia(_p(n,r),r)}function p0(){return[{keys:"Esc",description:E("agent.shortcuts.codex.interruptTurn")},{keys:"Esc Esc",description:E("agent.shortcuts.codex.editPrevious")},{keys:"Ctrl + C",description:E("agent.shortcuts.codex.interruptOrExit")},{keys:"Alt + , / Alt + .",description:E("agent.shortcuts.codex.effort")},{keys:"Shift + Tab",description:E("agent.shortcuts.codex.cycleMode")},{keys:"Tab",description:E("agent.shortcuts.codex.queue")},{keys:"Ctrl + T",description:E("agent.shortcuts.codex.transcript")},{keys:"Ctrl + R",description:E("agent.shortcuts.codex.searchHistory")},{keys:"@",description:E("agent.shortcuts.codex.mention")},{keys:"/",description:E("agent.shortcuts.commands")},{keys:"Ctrl + G",description:E("agent.shortcuts.codex.externalEditor")}]}function m0(){return[{keys:"Esc Esc",description:E("agent.shortcuts.opencode.interrupt")},{keys:"Tab / Shift + Tab",description:E("agent.shortcuts.opencode.cycleAgent")},{keys:"Ctrl + P",description:E("agent.shortcuts.opencode.commandList")},{keys:E("agent.shortcuts.leaderThen",{key:"M"}),description:E("agent.shortcuts.opencode.model")},{keys:E("agent.shortcuts.leaderThen",{key:"N"}),description:E("agent.shortcuts.opencode.newSession")},{keys:"Ctrl + J",description:E("agent.shortcuts.opencode.newline")},{keys:"Ctrl + C",description:E("agent.shortcuts.opencode.clearInput")},{keys:"Ctrl + V",description:E("agent.shortcuts.opencode.paste")}]}function g0(){return[{keys:"Esc",description:E("agent.shortcuts.antigravity.interrupt")},{keys:"Shift + Tab",description:E("agent.shortcuts.antigravity.cycleMode")},{keys:"1 … 4",description:E("agent.shortcuts.antigravity.answerPermission")},{keys:"/",description:E("agent.shortcuts.commands")},{keys:"?",description:E("agent.shortcuts.antigravity.help")}]}function _0(){return[{keys:"Esc",description:E("agent.shortcuts.interruptCli")},{keys:"Esc Esc",description:E("agent.shortcuts.claudeCode.rewind")},{keys:"Ctrl + C",description:E("agent.shortcuts.claudeCode.cancel")},{keys:"Ctrl + R",description:E("agent.shortcuts.claudeCode.searchHistory")},{keys:"Ctrl + O",description:E("agent.shortcuts.claudeCode.fullOutput")},{keys:"Shift + Tab",description:E("agent.shortcuts.claudeCode.cycleMode")},{keys:"Alt + V",description:E("agent.shortcuts.claudeCode.pasteImage")},{keys:"Ctrl + V",description:E("agent.shortcuts.claudeCode.pasteText")}]}const $s={"claude-code":{shortLabel:"CC",get shortcuts(){return _0()},shortcutsNote:null,instructionsFile:"CLAUDE.md",savesModelChoice:!1},codex:{shortLabel:"CX",get shortcuts(){return p0()},get shortcutsNote(){return E("agent.shortcuts.codex.note")},instructionsFile:"AGENTS.md",savesModelChoice:!1},opencode:{shortLabel:"OC",get shortcuts(){return m0()},get shortcutsNote(){return E("agent.shortcuts.opencode.note")},instructionsFile:"AGENTS.md",savesModelChoice:!1},antigravity:{shortLabel:"AG",get shortcuts(){return g0()},shortcutsNote:null,instructionsFile:"AGENTS.md",savesModelChoice:!0}},v0={"gemini-cli":"GC","antigravity-ide":"AI"};function y0(n){return Ui(n)?$s[n].shortLabel:v0[n]}function Wi(n,r){var o;return Ui(n)?((o=r.find(m=>m.id===n))==null?void 0:o.label)??n:p_[n]}const w0="Sesion sin titulo";function Pn(n,r){return r==="none"||n===w0?E("session.untitled"):n}function Ac(n){return n.storage==="native"&&Ui(n.agent)}function b0(n){return n!==null&&$s[n].savesModelChoice}function S0(n){return n===null?null:$s[n].instructionsFile}function C0(n){return{modeCycle:n.permissionCycle,models:n.models,efforts:n.efforts,imagesAllowed:n.imagesByPath!==null,rewind:n.rewind,questionsAnswerable:n.questionCards,fileMentions:n.fileMentions!==null,plansAvailable:n.plans,contextWindowSource:n.contextWindowSource,noteSendable:n.readySignal}}function x0(n,r){const o=W_(r,n);return o===null?null:n.find(m=>m.value===o.value)??null}function k0(n,r){return n??r.launchMode}const E0={auto:"mode.auto.label",default:"mode.default.label",acceptEdits:"mode.acceptEdits.label",plan:"mode.plan.label"},L0={auto:"mode.auto.hint",default:"mode.default.hint",acceptEdits:"mode.acceptEdits.hint",plan:"mode.plan.hint"};function vp(n){return E(E0[n])}function T0(n){return E(L0[n])}function R0(n,r){return E("agent.mode.title",{mode:vp(n),hint:T0(n),key:r.keyLabel})}function yp(n,r){return n.approvesPendingOnCycle&&r!==null}function M0(n,r,o,m){if(yp(r,m))return E("agent.mode.blocked");const w=R0(n,r);return!r.approvesPendingOnCycle||o?w:E("agent.mode.titleBlind",{title:w})}const A0={active:"agent.statusLine.state.active",missing:"agent.statusLine.state.missing","other-command":"agent.statusLine.state.otherCommand",disabled:"agent.statusLine.state.disabled",unreadable:"agent.statusLine.state.unreadable"};function N0(n){return E(A0[n])}function D0(){return E("agent.statusLine.noFragment")}function I0(n,r){return n.filter(o=>r||o.id!=="plans")}function P0(n,r){return n==="plans"&&!r?"cli":n}function j0(n,r,o){const m=w=>w===null?void 0:r.find(A=>A.id===w);return m(n)??m(o)??r[0]??null}function O0(n){return[{keys:"Enter",description:E("agent.shortcuts.composer.send")},{keys:"Shift + Enter",description:E("agent.shortcuts.composer.newline")},{keys:"Ctrl + V",description:E(n?"agent.shortcuts.composer.pasteWithImages":"agent.shortcuts.composer.pasteText")},{keys:"Esc",description:E("agent.shortcuts.interruptCli")}]}function B0(){return E("agent.composer.imagesRefused")}function F0(n,r,o){return o??(n==="token-count"||n==="status-line"?r.contextWindow:null)}function H0(n,r){return n==="status-line"?r.lastRequestTokens>0:r.assistantMessages>0}function $0(n,r){return n===null&&r!==null&&r.state!=="active"}function U0(n){return E(n==="other-command"?"agent.meter.setup.otherCommand":n==="disabled"?"agent.meter.setup.disabled":n==="unreadable"?"agent.meter.setup.unreadable":"agent.meter.setup.missing")}function W0(n,r){return r.contextWindowEstimated?E("agent.meter.origin.estimated"):n==="usage-with-catalog"&&r.contextWindow!==null?E("agent.meter.origin.catalog"):null}function z0(n,r=null){return r==="status-line"?E("agent.meter.idle.statusLine"):n===null?E("agent.meter.idle.noFile"):E("agent.meter.idle.withFile",{file:n})}function V0(n,r=null){return n==="idle"?E("agent.dot.idle"):n==="unknown"?r===null?E("agent.dot.noStatus"):r.state==="active"?E("agent.dot.statusLinePending"):E("agent.dot.statusLineOnly"):E("agent.dot.open")}function Dd(n,r){return n.length===0?!0:n.some(o=>o.id===r&&o.available&&o.capabilities.resume)}function q0(n,r,o){return n?o?E("agent.note.empty"):E("agent.note.send",{cwd:r??""}):E(r===null?"agent.note.needsTab":"agent.note.noReadySignal")}function wp(n,r,o){const m=zs(r,o);let w=null;for(const A of n)A.kind!=="agent"||A.agent===null||zs(A.cwd,o)===m&&(w=A.agent);return w}function bp(n,r){var m;const o=r.filter(w=>w.available);for(const w of n)if(w!==null&&o.some(A=>A.id===w))return w;return((m=o[0])==null?void 0:m.id)??null}function K0(n){let r=null;for(const o of n){const m=o.agent;Ui(m)&&(r===null||o.updatedAt>r.updatedAt)&&(r={agent:m,updatedAt:o.updatedAt})}return(r==null?void 0:r.agent)??null}function G0(n,r,o,m,w){return bp([wp(n,r,o),w],m)}function Y0(n,r,o,m,w){return bp([wp(n,r.cwd,o),K0(r.sessions),w],m)}function Sp(n){return n.filter(r=>r.available)}function X0(n,r){const o=n.findIndex(m=>m.id===r);return o===-1?0:o}function Q0(n,r,o){return o<=0?0:((n+r)%o+o)%o}function J0(n,r,o,m=4){const w=n.bottom+2,A=n.top-2-r.height,T=w+r.height+m<=o.height||A<m?Math.max(m,Math.min(w,o.height-r.height-m)):A;return{left:Math.max(m,Math.min(n.left,o.width-r.width-m)),top:T}}function Z0(n,r,o){const m=n;return m===null||typeof m!="object"||typeof m.contains!="function"?!0:o!==null&&o.contains(n)?!1:m.contains(r)}function Cp(n,r,o=!1){return r===null||o||!Wc(n)?[]:Sp(n).filter(m=>m.id!==r)}function ey(){return E("agent.continue.title")}function ty(n,r,o){return r?E("agent.continue.discovering"):n.length===0?E("agent.continue.noConversation"):o?null:E("agent.continue.noMessages")}function ny(n,r,o,m){const w=r>=o&&!m?o===1?E("agent.handoff.turns.single"):E("agent.handoff.turns.all",{count:o}):r===1?m?E("agent.handoff.turns.lastOneOfMore",{total:o}):E("agent.handoff.turns.lastOne",{total:o}):m?E("agent.handoff.turns.lastManyOfMore",{count:o,included:r}):E("agent.handoff.turns.lastMany",{count:o,included:r});return E("agent.handoff.notice",{label:n,turns:w})}const Id=40;function Pd(n){const r=n.replace(/\s+/g," ").trim(),o=[...r],m=o.length>Id?`${o.slice(0,Id).join("").trimEnd()}…`:r;return m.length>0?E("agent.handoff.tabLabel",{title:m}):E("agent.handoff.tabLabelNoTitle")}function ry(){return E("agent.handoff.sending")}function sy(n){switch(n){case"no-delivery":return E("agent.handoff.prefill.noDelivery");case"not-ready":return E("agent.handoff.prefill.notReady");case"send-failed":return E("agent.handoff.prefill.sendFailed")}}function jd(n,r){return n.trim().length===0?r:`${r}
|
|
42
|
-
|
|
43
|
-
${n}`}function iy(n,r){return n&&r!==null}function oy(n,r,o){if(!Ui(n))return{badge:!0,unavailableTitle:null};const m=r.find(T=>T.id===n),w=r.some(T=>T.available),A=m!==void 0&&!m.available&&w;return{badge:o||A,unavailableTitle:A?E("agent.session.cliMissing",{label:m.label}):null}}function ay(n,r,o){return n!==null&&r===""&&!o.sessionIdAtLaunch}function ly(){return E("agent.thread.noTranscript")}function cy(){return E("agent.thread.discovering")}function uy(n,r,o,m,w=null){return!m||!Yf(n,w)||!r?null:o===null?E("agent.openTool.noLabel"):E("agent.openTool.withLabel",{label:o})}function xp(n,r=!1){return E(n==="permission prompt"?"agent.waiting.permission":n==="question"&&r?"agent.waiting.question":"agent.waiting.answer")}function hy(n){return n.relaunching?"relaunching":n.offlineReason==="server-closed"&&n.alive?"offer":null}function dy(n){return n===null?E("agent.serverClosed.noLabel"):E("agent.serverClosed.withLabel",{label:n})}function fy(){return E("agent.serverClosed.relaunch")}function py(){return E("agent.serverClosed.relaunching")}function my(n,r){const o=new Map,m=[];for(const[w,A]of n){const T=r.find(s=>s.terminalId===w);T===void 0||T.alive&&A==="exited"?m.push(w):o.set(w,T.alive?A:"exited")}return{phases:o,finished:m}}function gy(n,r,o){var m;return!o||r===null||((m=n.permissionCycle)==null?void 0:m.approvesPendingOnCycle)!==!0&&!n.waitingBlocksSubmit?null:xp(r,n.questionCards)}const _y=2e4;function vy(n){if(n.label.length>0)return n.label;const r=n.cwd.split(/[\\/]/).filter(o=>o.length>0);return r[r.length-1]??n.cwd}function yy(n,r,o){const m=n.map(A=>({terminalId:A.terminalId,kind:A.kind,cwd:A.cwd})),w=[];for(const A of r){const T=e0(m.map(s=>s.terminalId),s=>m.find(l=>l.terminalId===s),{cwd:A.cwd},o);w.push({pending:A,index:T,label:vy(A)}),m.splice(T,0,{terminalId:`pending:${A.requestId}`,kind:"agent",cwd:A.cwd})}return w}function Od(n,r,o){const m=zs(r,o);return n.some(w=>zs(w.cwd,o)===m)}function kp(){return E("agent.openBlocked")}const wy={low:"controls.effort.low",medium:"controls.effort.medium",high:"controls.effort.high",xhigh:"controls.effort.xhigh",max:"controls.effort.max"};function by(n){const r=wy[n.value];return r===void 0?n.label:E(r)}function Sy(n){return n.value==="default"?E("controls.model.default"):U_(n)}function Cy({models:n,efforts:r,model:o,effort:m,modelProvisional:w=!1,effortProvisional:A=!1,savesChoice:T=!1,disabled:s,onCommand:l}){const p=n===null?null:x0(n,o),v=p===null&&o!==null;return c.jsxs(c.Fragment,{children:[n!==null&&c.jsxs("select",{className:"agent-select",value:(p==null?void 0:p.value)??"",disabled:s,onChange:u=>{u.target.value.length>0&&l(V_(u.target.value))},title:o===null?E("controls.model.noData"):w?E("controls.model.provisional",{model:o}):T?E("controls.model.inUseSaved",{model:o}):E("controls.model.inUse",{model:o}),children:[p===null&&c.jsx("option",{value:"",children:v?o??"":E("controls.model.placeholder")}),n.map(u=>c.jsx("option",{value:u.value,children:Sy(u)},u.value))]}),r!==null&&c.jsxs("select",{className:"agent-select",value:m??"",disabled:s,onChange:u=>{u.target.value.length>0&&l(q_(u.target.value))},title:m===null?E("controls.effort.noData"):A?E("controls.effort.provisional",{effort:m}):T?E("controls.effort.inUseSaved",{effort:m}):E("controls.effort.inUse",{effort:m}),children:[m===null&&c.jsx("option",{value:"",children:E("controls.effort.placeholder")}),r.map(u=>c.jsx("option",{value:u.value,children:by(u)},u.value))]})]})}function xy({mode:n,cycle:r,disabled:o,waitingFor:m=null,statusKnown:w=!0,onChange:A}){const T=k0(n,r);return c.jsx("select",{className:"agent-select agent-select-mode",value:T,disabled:o||yp(r,m),onChange:s=>{Hs(s.target.value)&&A(s.target.value)},title:M0(T,r,w,m),children:r.modes.map(s=>c.jsx("option",{value:s,children:vp(s)},s))})}function ca(n){const r=n.replace(/(\r?\n)+$/,"");return r.length===0?0:r.split(`
|
|
44
|
-
`).length}function ky(n,r){return r===0?E("composer.chip.pastedTextEmpty",{number:n}):E("composer.chip.pastedText",{number:n,count:r})}function Ey(n){return n.length===0?1:Math.max(...n)+1}function Ly(n){const r=new Set;for(const o of n.matchAll(i0()))r.add(Number(o[1]));return[...r].sort((o,m)=>o-m)}const Ty=/[^\s([{"'¿¡«]/u,Ry=/[\p{L}\p{N}]/u;function My(n,r,o,m){const{start:w,end:A,before:T,after:s}=Ep(n,r,o),l=`${T!==""&&Ty.test(T)?" ":""}${up(m)}${s!==""&&Ry.test(s)?" ":""}`;return Lp(n,w,A,l)}const Ay=/[^\s([{¿¡«]/u,Ny=/[\p{L}\p{N}"'«]/u;function Bd(n,r,o,m){const{start:w,end:A,before:T,after:s}=Ep(n,r,o),l=T!==""&&Ay.test(T),p=s===""||Ny.test(s),v=`${l?" ":""}${m}${p?" ":""}`;return Lp(n,w,A,v)}function Ep(n,r,o){const m=Math.max(0,Math.min(r,n.length)),w=Math.max(m,Math.min(o,n.length));return{start:m,end:w,before:m>0?n.charAt(m-1):"",after:w<n.length?n.charAt(w):""}}function Lp(n,r,o,m){return{text:`${n.slice(0,r)}${m}${n.slice(o)}`,inserted:m,caret:r+m.length}}function Tp(n,r){const o=new RegExp(`( ?)${Py(up(r))}( ?)`,"g");return n.replace(o,(m,w,A)=>w!==""&&A!==""?" ":"")}function Dy(n,r){let o=r;const m=[];for(const w of n){const A=w.text.replace(/\r\n?/g,`
|
|
45
|
-
`).replace(/\n+$/,"");if(A.trim().length===0){o=Tp(o,w.number);continue}m.push(`${t0(w.number)}
|
|
46
|
-
${A}
|
|
47
|
-
${n0(w.number)}`)}return o.trim().length>0&&m.push(o),m.join(`
|
|
48
|
-
|
|
49
|
-
`)}function Iy(n,r=!1){const o=n.replace(/\r\n?/g,`
|
|
50
|
-
`),m=[],w=l=>{const p=l.replace(/^\n+|\n+$/g,"");p.trim().length>0&&m.push({kind:"text",text:p})};let A=0;for(const l of o.matchAll(r0())){const p=l[1]??"",v=(l.index??0)+p.length;w(o.slice(A,v)),m.push({kind:"pasted",number:Number(l[2]),text:l[3]??"",complete:!0}),A=(l.index??0)+l[0].length}const T=o.slice(A),s=r?s0().exec(T):null;if(s!==null){const l=s.index+(s[1]??"").length;w(T.slice(0,l)),m.push({kind:"pasted",number:Number(s[2]),text:T.slice(s.index+s[0].length),complete:!1})}else w(T);return m.some(l=>l.kind==="pasted")?m:[{kind:"text",text:n}]}function Py(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const jy=800;function Rp(n){return{text:n.text,pasted:n.items.flatMap(r=>r.kind==="text"?[{number:r.number,text:r.text}]:[])}}function Oy(n,r){return{text:n.text,items:n.pasted.map(o=>({id:r(),kind:"text",number:o.number,text:o.text,lines:ca(o.text)}))}}function By(n){return np(Rp(n))>tp}function Fd(n,r){return n===void 0||kc(n)?kc(r):rp(n,r)}function Fy(n){return n===void 0||n.text.trim().length===0&&n.items.length===0}const Hy={text:"",pasted:[]};class $y{constructor(r){Mt(this,"local",new Map);Mt(this,"saved",new Map);Mt(this,"touched",new Set);Mt(this,"pending",new Map);Mt(this,"listeners",new Set);Mt(this,"serverKeeps",!1);this.deps=r}get(r){return this.local.get(r)}put(r,o){this.local.set(r,o),this.schedule(r,Rp(o))}submitted(r){this.cancel(r),this.local.delete(r),this.saved.delete(r),this.touched.add(r)}restore(r){this.serverKeeps=!0;const o=[];for(const{terminalId:m,draft:w}of r)this.touched.has(m)||(this.saved.set(m,w),Fy(this.local.get(m))&&(this.local.set(m,Oy(w,this.deps.newId)),o.push(m)));for(const m of o)for(const w of this.listeners)w(m);for(const[m,w]of[...this.pending])w.handle===null&&this.sendNow(m)}reconnected(){this.serverKeeps=!1}retain(r){const o=new Set(r);for(const m of new Set([...this.local.keys(),...this.saved.keys(),...this.touched,...this.pending.keys()]))o.has(m)||(this.cancel(m),this.local.delete(m),this.saved.delete(m),this.touched.delete(m))}flushAll(){for(const r of[...this.pending.keys()])this.sendNow(r)}onRestored(r){return this.listeners.add(r),()=>this.listeners.delete(r)}schedule(r,o){const m=this.pending.get(r);if(m!==void 0&&rp(m.draft,o)||(this.cancel(r),Fd(this.saved.get(r),o)))return;this.touched.add(r);const w=this.deps.setTimer(()=>this.sendNow(r),this.deps.delayMs??jy);this.pending.set(r,{handle:w,draft:o})}cancel(r){const o=this.pending.get(r);o!==void 0&&(o.handle!==null&&this.deps.clearTimer(o.handle),this.pending.delete(r))}sendNow(r){const o=this.pending.get(r);if(o===void 0)return;if(o.handle!==null&&this.deps.clearTimer(o.handle),!this.serverKeeps||!this.deps.connected()){this.pending.set(r,{handle:null,draft:o.draft});return}this.pending.delete(r);const m=np(o.draft)>tp?Hy:o.draft;Fd(this.saved.get(r),m)||(this.deps.send(r,m),kc(m)?this.saved.delete(r):this.saved.set(r,m))}}const Nc=1024,Dc=Nc*1024,Hd=Dc*1024;function Fs(n,r=0){return new Intl.NumberFormat(fa(),{minimumFractionDigits:r,maximumFractionDigits:r,useGrouping:!1}).format(n)}function rn(n){return!Number.isFinite(n)||n<Nc?E("format.bytes.b",{value:Fs(Math.max(0,Math.round(n)||0))}):n<Dc?E("format.bytes.kb",{value:Fs(Math.round(n/Nc))}):n<Hd?E("format.bytes.mb",{value:Fs(n/Dc,1)}):E("format.bytes.gb",{value:Fs(n/Hd,2)})}function Mp(n){const r=Math.floor(n/60),o=n%60;return o===0?E("format.duration.minutes",{value:r}):E("format.duration.minutesSeconds",{minutes:r,seconds:o})}function Uy(n){if(n<1e3)return E("format.duration.ms",{value:n});const r=Math.round(n/1e3);return r<60?E("format.duration.seconds",{value:r}):Mp(r)}function $d(n){if(!Number.isFinite(n)||n<1e3)return E("format.duration.underSecond");const r=Math.round(n/1e3);return r<60?E("format.duration.seconds",{value:r}):Mp(r)}function jn(n,r=Date.now()){if(n<=0)return"";const o=Math.floor((r-n)/6e4);if(o<1)return E("time.justNow");if(o<60)return E("time.minutesAgo",{count:o});const m=Math.floor(o/60);if(m<24)return E("time.hoursAgo",{count:m});const w=Math.floor(m/24);return w<30?E("time.daysAgo",{count:w}):Wy(n)}function Wy(n){return new Date(n).toLocaleDateString(fa())}function Ap(n){return new Date(n).toLocaleTimeString(fa(),{hour:"2-digit",minute:"2-digit"})}function Np(n){return new Intl.ListFormat(fa(),{type:"conjunction"}).format(n)}var Dp=Gf();function Ip({src:n,caption:r,onClose:o}){return O.useEffect(()=>{const m=w=>{w.key==="Escape"&&(w.preventDefault(),w.stopPropagation(),o())};return window.addEventListener("keydown",m,!0),()=>window.removeEventListener("keydown",m,!0)},[o]),Dp.createPortal(c.jsxs("div",{className:"viewer",onClick:o,role:"presentation",children:[c.jsx("div",{className:"viewer-frame",onClick:m=>m.stopPropagation(),children:c.jsx("img",{className:"viewer-image",src:n,alt:r})}),c.jsxs("div",{className:"viewer-bar",children:[c.jsx("span",{className:"viewer-caption",children:r}),c.jsx("button",{className:"viewer-close",onClick:o,title:E("common.closeEsc"),children:"×"})]})]}),document.body)}const zy=768,Vy=`(max-width: ${zy}px)`,qy="(hover: none)",Ud="agent-workbench.narrow-view",Pp="tab",jp=["chat","cli","git","files","plans","memory","notes","console"];function Ky(n){return typeof n=="string"&&jp.includes(n)}function Gy(n){return Ky(n)?n:null}function Yy(n){return n.hasTab?jp.filter(r=>r!=="plans"||n.plansAvailable):["chat","notes"]}function Xy(n,r){return r.includes(n)?n:"chat"}function Wd(n){switch(n){case"cli":case"git":case"files":case"plans":case"memory":return n;default:return null}}const Qy={chat:"narrow.view.chat",cli:"panel.tab.cli",git:"panel.tab.git",files:"panel.tab.files",plans:"panel.tab.plans",memory:"panel.tab.memory",notes:"notes.name",console:"console.name"};function Jy(n){return Qy[n]}const Zy=/^[A-Za-z0-9_-]{1,80}$/;function ew(n){const r=new URLSearchParams(n).get(Pp);return r!==null&&Zy.test(r)?r:null}function tw(n,r){const o=new URLSearchParams(n);for(const w of r)o.delete(w);const m=o.toString();return m.length>0?`?${m}`:""}const nw=[{id:"esc",label:"Esc",data:"\x1B",titleKey:"narrow.keys.esc"},{id:"tab",label:"Tab",data:" ",titleKey:"narrow.keys.tab"},{id:"shift-tab",label:"⇧Tab",data:"\x1B[Z",titleKey:"narrow.keys.shiftTab"},{id:"up",label:"↑",data:"\x1B[A",titleKey:"narrow.keys.up"},{id:"down",label:"↓",data:"\x1B[B",titleKey:"narrow.keys.down"},{id:"left",label:"←",data:"\x1B[D",titleKey:"narrow.keys.left"},{id:"right",label:"→",data:"\x1B[C",titleKey:"narrow.keys.right"},{id:"interrupt",label:"^C",data:"",titleKey:"narrow.keys.interrupt"},{id:"ctrl-o",label:"^O",data:"",titleKey:"narrow.keys.ctrlO"},{id:"ctrl-x",label:"^X",data:"",titleKey:"narrow.keys.ctrlX"}];function rw(n,r){return n.shiftKey||n.altKey?!1:!r||n.ctrlKey||n.metaKey}const sw="AgentWorkbenchAndroid/",iw="agentworkbench://settings",ow="agentworkbench://disconnect",zd="agentWorkbenchBack";function Op(n){return n.includes(sw)}function aw(n){return n.dialogOpen?"close-dialog":n.sheetOpen?"close-sheet":n.drawerOpen?"close-drawer":n.view!=="chat"?"show-chat":null}const lw=5,cw=1200;function ic(){return crypto.randomUUID()}function uw(n=!0){const[r,o]=O.useState([]),[m,w]=O.useState(null),A=O.useCallback(k=>{if(r.filter(a=>a.kind==="image").length>=nc){w(E("composer.problem.tooManyImages",{count:nc}));return}if(k.size>la){const a=Math.round(k.size/1024/1024),f=la/1024/1024;w(k.name.length>0?E("composer.problem.tooBig",{name:k.name,size:a,max:f}):E("composer.problem.imageTooBig",{size:a,max:f}));return}const g=new FileReader;g.onload=()=>{const a=g.result;if(typeof a!="string")return;const f=a.indexOf(",");f!==-1&&o(d=>d.filter(h=>h.kind==="image").length>=nc?d:[...d,{id:ic(),kind:"image",mediaType:k.type,base64:a.slice(f+1),dataUrl:a,bytes:k.size,name:k.name.length>0?k.name:E("composer.pastedImage")}])},g.onerror=()=>w(E("composer.problem.imageUnreadable")),g.readAsDataURL(k)},[r]),T=O.useCallback(k=>{if(r.filter(a=>a.kind==="file").length>=rc){w(E("composer.problem.tooManyFiles",{count:rc}));return}if(k.size===0){w(E("composer.problem.empty",{name:k.name}));return}if(k.size>Ed){w(E("composer.problem.tooBig",{name:k.name,size:Math.round(k.size/1024/1024),max:Ed/1024/1024}));return}const g=new FileReader;g.onload=()=>{const a=g.result;if(typeof a!="string")return;const f=a.indexOf(",");f!==-1&&o(d=>d.filter(h=>h.kind==="file").length>=rc?d:[...d,{id:ic(),kind:"file",name:k.name.length>0?k.name:"archivo",base64:a.slice(f+1),bytes:k.size}])},g.onerror=()=>w(E("composer.problem.unreadable",{name:k.name})),g.readAsDataURL(k)},[r]),s=O.useCallback(k=>{const g=Array.from(k),a=g.filter(d=>d.type.startsWith("image/")),f=g.filter(d=>!d.type.startsWith("image/"));if(a.length>0&&!n)w(B0());else for(const d of a)A(d);for(const d of f)T(d)},[A,T,n]),l=O.useCallback((k,g=[])=>{if(k.files.length>0)return s(k.files),{consumed:!0,pastedNumber:null};const a=k.getData("text/plain");if(a.length===0)return{consumed:!1,pastedNumber:null};if(a.split(`
|
|
51
|
-
`).length<lw&&a.length<cw)return{consumed:!1,pastedNumber:null};const f=Ey([...r.flatMap(d=>d.kind==="text"?[d.number]:[]),...g]);return o(d=>[...d,{id:ic(),kind:"text",number:f,text:a,lines:ca(a)}]),{consumed:!0,pastedNumber:f}},[s,r]),p=O.useCallback(k=>{o(g=>g.filter(a=>a.id!==k))},[]),v=O.useCallback((k,g)=>{o(a=>a.map(f=>f.id===k&&f.kind==="text"?{...f,text:g,lines:ca(g)}:f))},[]),u=O.useCallback(k=>{o(k),w(null)},[]),y=O.useCallback(()=>u([]),[u]),S=O.useCallback(()=>w(null),[]);return{items:r,problem:m,acceptPaste:l,acceptFiles:s,remove:p,updateText:v,replace:u,clear:y,dismissProblem:S}}function oa({min:n,max:r,value:o,measure:m,onChange:w,onCommit:A,onStart:T}){const s=O.useRef(!1),l=O.useRef(o),p=O.useCallback(y=>{s.current=!0,l.current=o,T==null||T(y),y.currentTarget.setPointerCapture(y.pointerId),y.preventDefault()},[T,o]),v=O.useCallback(y=>{if(!s.current)return;const S=Math.min(r,Math.max(n,m(y)));l.current=S,w(S)},[r,n,m,w]),u=O.useCallback(y=>{s.current&&(s.current=!1,y.currentTarget.releasePointerCapture(y.pointerId),A(l.current))},[A]);return{onPointerDown:p,onPointerMove:v,onPointerUp:u,onPointerCancel:u}}function Bp(n){const[r,o]=O.useState(()=>typeof window<"u"&&window.matchMedia(n).matches);return O.useEffect(()=>{const m=window.matchMedia(n),w=()=>o(m.matches);return w(),m.addEventListener("change",w),()=>m.removeEventListener("change",w)},[n]),r}function hw(){return Bp(Vy)}function dw(){return Bp(qy)}const Fp="agent_workbench_prefs",Ic="agent-workbench.",Hp=/^[a-z0-9][a-z0-9.-]{0,59}$/,$p=200,fw=400*24*60*60,pw=3500;function mw(n){const r=new Map;for(const o of n.split(";")){const m=o.indexOf("=");if(m===-1||o.slice(0,m).trim()!==Fp)continue;let w;try{w=JSON.parse(decodeURIComponent(o.slice(m+1).trim()))}catch{return r}if(w===null||typeof w!="object"||Array.isArray(w))return r;for(const[A,T]of Object.entries(w))!Hp.test(A)||typeof T!="string"||T.length>$p||r.set(`${Ic}${A}`,T);return r}return r}function gw(n){const r={};for(const[m,w]of n){if(!m.startsWith(Ic))continue;const A=m.slice(Ic.length);!Hp.test(A)||w.length>$p||(r[A]=w)}const o=encodeURIComponent(JSON.stringify(r));return o.length>pw?null:o}function _w(n){return`${Fp}=${n}; Path=/; Max-Age=${fw}; SameSite=Strict`}function Up(){try{return mw(document.cookie)}catch{return new Map}}function Wp(n,r){const o=Up();if(o.get(n)===r)return;o.set(n,r);const m=gw(o);if(m!==null)try{document.cookie=_w(m)}catch{}}function yt(n,r,o){const m=Up().get(n);if(m!==void 0){const w=o(m);if(w!==null)return w}try{const w=window.localStorage.getItem(n);if(w===null)return r;const A=o(w);return A===null?r:(m===void 0&&Wp(n,w),A)}catch{return r}}function ut(n,r){Wp(n,r);try{window.localStorage.setItem(n,r)}catch{}}function vw(n,r,o){const m=Number.parseInt(n,10);return Number.isFinite(m)&&m>=r&&m<=o?m:null}const Vd=90,yw=260,qd=720,Kd="agent-workbench.composer-height";function ww({connection:n,drafts:r,terminalId:o,alive:m,sleeping:w=!1,projectColor:A,activity:T,controls:s,leading:l,imagesAllowed:p=!0,blockedReason:v=null,prefills:u,onPrefillApplied:y,notice:S=null,onDismissNotice:k,onSubmitted:g,fontSize:a,insertRef:f}){const[d,h]=O.useState(""),[C,D]=O.useState(!1),x=uw(p),M=O.useRef(null),b=dw(),[L,N]=O.useState(()=>yt(Kd,yw,ce=>vw(ce,Vd,qd))),[B,P]=O.useState(!1),F=O.useCallback(()=>{const ce=M.current;if(ce===null)return;ce.style.height="auto";const Se=ce.offsetHeight-ce.clientHeight,me=ce.scrollHeight+Se,Ze=B?L:Math.min(me,L);ce.style.height=`${Ze}px`,ce.style.overflowY=me>Ze?"auto":"hidden"},[L,B]);O.useEffect(F,[d,F,a]);const H=O.useRef(0),q=O.useRef(0),X=oa({min:Vd,max:qd,value:L,measure:O.useCallback(ce=>H.current-ce.clientY-q.current,[]),onChange:N,onCommit:O.useCallback(ce=>{P(!1),ut(Kd,String(ce))},[]),onStart:O.useCallback(ce=>{const Se=M.current,me=Se==null?void 0:Se.getBoundingClientRect();H.current=(me==null?void 0:me.bottom)??ce.clientY,q.current=((me==null?void 0:me.bottom)??ce.clientY)-ce.clientY-((me==null?void 0:me.height)??0),P(!0)},[])}),G=O.useRef(null),K=O.useRef(d);K.current=d;const j=O.useRef(x.items);j.current=x.items;const{replace:W}=x;O.useEffect(()=>{const ce=G.current;ce!==null&&r.put(ce,{text:d,items:x.items})},[d,x.items,r]),O.useEffect(()=>{var me;const ce=G.current;if(ce===o)return;G.current=o,ce!==null&&r.put(ce,{text:K.current,items:j.current});const Se=o===null?void 0:r.get(o);h((Se==null?void 0:Se.text)??""),W((Se==null?void 0:Se.items)??[]),o!==null&&((me=M.current)==null||me.focus())},[o,W,r]),O.useEffect(()=>()=>{const ce=G.current;ce!==null&&r.put(ce,{text:K.current,items:j.current})},[r]),O.useEffect(()=>r.onRestored(ce=>{if(ce!==G.current)return;const Se=r.get(ce);Se!==void 0&&(h(Se.text),W(Se.items))}),[r,W]);const $=O.useRef(new Set);O.useEffect(()=>{if(!(u===void 0||u.length===0)){for(const ce of u)if(!$.current.has(ce.id)){if($.current.add(ce.id),ce.terminalId===G.current)h(Se=>jd(Se,ce.text));else{const Se=r.get(ce.terminalId);r.put(ce.terminalId,{text:jd((Se==null?void 0:Se.text)??"",ce.text),items:(Se==null?void 0:Se.items)??[]})}y==null||y(ce.id)}}},[u,y,r]);const V=O.useCallback(()=>{if(o===null||v!==null)return;const ce=x.items.filter(qe=>qe.kind==="text").map(qe=>({number:qe.number,text:qe.text})),Se=x.items.filter(qe=>qe.kind==="image").map(qe=>({mediaType:qe.mediaType,data:qe.base64})),me=x.items.filter(qe=>qe.kind==="file").map(qe=>({name:qe.name,data:qe.base64})),Ze=Dy(ce,d);Ze.length===0&&Se.length===0&&me.length===0||(n.send({type:"agent.submit",terminalId:o,text:Ze,images:Se,...me.length>0?{files:me}:{}}),r.submitted(o),h(""),x.clear(),g==null||g(o))},[n,r,o,d,x,v,g]),J=O.useCallback(()=>{o!==null&&n.send({type:"agent.interrupt",terminalId:o})},[n,o]),re=O.useCallback(ce=>{if(ce.key==="Enter"&&rw(ce,b)){ce.preventDefault(),V();return}ce.key==="Escape"&&(ce.preventDefault(),J())},[V,J,b]),ie=O.useCallback((ce,Se)=>{const{inserted:me}=My(ce.value,ce.selectionStart,ce.selectionEnd,Se);let Ze=!1;try{Ze=document.execCommand("insertText",!1,me)}catch{Ze=!1}Ze||(ce.setRangeText(me,ce.selectionStart,ce.selectionEnd,"end"),h(ce.value))},[]),he=O.useCallback((ce,Se)=>{const me=M.current;if(me===null||me.disabled){h(ve=>Bd(ve,ve.length,ve.length,ce).text);return}const{inserted:Ze}=Bd(me.value,me.selectionStart,me.selectionEnd,ce);let qe=!1;if(Se){me.focus();try{qe=document.execCommand("insertText",!1,Ze)}catch{qe=!1}}qe||(me.setRangeText(Ze,me.selectionStart,me.selectionEnd,"end"),h(me.value))},[]);O.useEffect(()=>{if(f!==void 0)return f.current=he,()=>{f.current===he&&(f.current=null)}},[f,he]);const Y=O.useCallback(ce=>{if(ce.clipboardData===null)return;const Se=x.acceptPaste(ce.clipboardData,Ly(ce.currentTarget.value));Se.consumed&&(ce.preventDefault(),Se.pastedNumber!==null&&ie(ce.currentTarget,Se.pastedNumber))},[x,ie]),U=O.useCallback(ce=>{x.remove(ce.id),ce.kind==="text"&&h(Se=>Tp(Se,ce.number))},[x]),Z=O.useRef(null),ee=o===null||!m,pe=d.trim().length>0||x.items.some(ce=>ce.kind!=="text"||ce.text.trim().length>0),ne=m&&T!=="idle",Ee=pe||!ne,xe=By({text:d,items:x.items});return c.jsxs("div",{className:`composer${C?" composer-dragging":""}`,style:A===void 0?void 0:{"--composer-accent":A},onDragOver:ce=>{Array.from(ce.dataTransfer.types).includes("Files")&&(ce.preventDefault(),D(!0))},onDragLeave:()=>D(!1),onDrop:ce=>{ce.preventDefault(),D(!1),x.acceptFiles(ce.dataTransfer.files)},children:[c.jsx("div",{className:"hdivider composer-divider",...X,title:E("composer.resizeTitle")}),S!==null&&c.jsxs("div",{className:"handoff-notice",role:"status",children:[c.jsxs("span",{className:"handoff-notice-text",children:[S.text,S.status!==null&&c.jsx("span",{className:"handoff-notice-status",children:S.status})]}),k!==void 0&&c.jsx("button",{className:"icon-button",onClick:k,title:E("common.dismissNotice"),children:"×"})]}),x.problem!==null&&c.jsxs("div",{className:"composer-problem",children:[c.jsx("span",{children:x.problem}),c.jsx("button",{className:"icon-button",onClick:x.dismissProblem,title:E("common.close"),children:"×"})]}),xe&&c.jsx("div",{className:"composer-problem",role:"status",children:c.jsx("span",{children:E("composer.problem.draftTooLong")})}),x.items.length>0&&c.jsx("div",{className:"composer-chips",children:x.items.map(ce=>c.jsx(bw,{item:ce,onRemove:()=>U(ce),onEdit:Se=>x.updateText(ce.id,Se),onDoneEditing:()=>{var Se;return(Se=M.current)==null?void 0:Se.focus()}},ce.id))}),c.jsxs("div",{className:`composer-field${ne&&Ee?" composer-field-two":""}`,children:[c.jsx("textarea",{ref:M,className:"composer-input",value:d,rows:1,placeholder:E(ee?w?"composer.placeholder.sleeping":"composer.placeholder.ended":"composer.placeholder.ready"),disabled:ee,onChange:ce=>h(ce.target.value),onKeyDown:re,onPaste:Y,spellCheck:!1}),c.jsxs("div",{className:"composer-field-actions",children:[ne&&c.jsx("button",{className:"composer-icon composer-stop",onClick:J,disabled:ee,title:E("composer.stopTitle"),"aria-label":E("composer.stop"),children:c.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true",children:c.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2",fill:"currentColor"})})}),Ee&&c.jsx("button",{className:"composer-icon composer-send",onClick:V,disabled:ee||!pe||v!==null,title:v??E("composer.sendTitle"),"aria-label":E("composer.send"),children:c.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true",children:c.jsx("path",{d:"M12 19V5M5.5 11.5 12 5l6.5 6.5",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),c.jsxs("div",{className:"composer-bar",children:[c.jsx("input",{ref:Z,type:"file",multiple:!0,hidden:!0,onChange:ce=>{ce.target.files!==null&&x.acceptFiles(ce.target.files),ce.target.value=""}}),c.jsx("button",{className:"icon-button composer-attach",onClick:()=>{var ce;return(ce=Z.current)==null?void 0:ce.click()},disabled:ee,title:E("composer.attachTitle"),"aria-label":E("composer.attach"),children:c.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true",children:c.jsx("path",{d:"M21.4 11.1 12.3 20.2a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),l,c.jsx("span",{className:"composer-spacer"}),s]})]})}function bw({item:n,onRemove:r,onEdit:o,onDoneEditing:m}){const[w,A]=O.useState(!1);if(n.kind==="image"){const T=`${n.name} · ${rn(n.bytes)}`;return c.jsxs("figure",{className:"chip chip-image",title:T,children:[c.jsx("img",{src:n.dataUrl,alt:n.name,onClick:()=>A(!0)}),c.jsx("button",{className:"chip-remove",onClick:r,title:E("composer.chip.remove"),children:"×"}),w&&c.jsx(Ip,{src:n.dataUrl,caption:T,onClose:()=>A(!1)})]})}return n.kind==="file"?c.jsxs("div",{className:"chip chip-text chip-file",title:`${n.name} · ${rn(n.bytes)}`,children:[c.jsxs("span",{className:"chip-toggle chip-file-label",children:[c.jsx("span",{className:"chip-icon",children:"▤"}),c.jsx("span",{className:"chip-file-name",children:n.name}),c.jsx("span",{className:"chip-file-size",children:rn(n.bytes)})]}),c.jsx("button",{className:"chip-remove",onClick:r,title:E("composer.chip.remove"),children:"×"})]}):c.jsxs("div",{className:`chip chip-text${w?" chip-open":""}`,children:[c.jsxs("button",{className:"chip-toggle",onClick:()=>A(T=>!T),title:E("composer.chip.editHint"),"aria-expanded":w,children:[c.jsx("span",{className:"chip-icon",children:"¶"}),ky(n.number,n.lines),c.jsx("span",{className:"chip-chevron",children:w?"▾":"▸"})]}),c.jsx("button",{className:"chip-remove",onClick:r,title:E("composer.chip.remove"),children:"×"}),w&&c.jsx("textarea",{className:"chip-editor",value:n.text,onChange:T=>o(T.target.value),onKeyDown:T=>{T.key==="Escape"&&(T.preventDefault(),A(!1),m())},"aria-label":E("composer.chip.editorLabel",{number:n.number}),spellCheck:!1,autoFocus:!0})]})}var oc={exports:{}},Gd;function Sw(){return Gd||(Gd=1,(function(n,r){(function(o,m){n.exports=m()})(self,(()=>(()=>{var o={};return(()=>{var m=o;Object.defineProperty(m,"__esModule",{value:!0}),m.FitAddon=void 0,m.FitAddon=class{activate(w){this._terminal=w}dispose(){}fit(){const w=this.proposeDimensions();if(!w||!this._terminal||isNaN(w.cols)||isNaN(w.rows))return;const A=this._terminal._core;this._terminal.rows===w.rows&&this._terminal.cols===w.cols||(A._renderService.clear(),this._terminal.resize(w.cols,w.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const w=this._terminal._core,A=w._renderService.dimensions;if(A.css.cell.width===0||A.css.cell.height===0)return;const T=this._terminal.options.scrollback===0?0:w.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(s.getPropertyValue("height")),p=Math.max(0,parseInt(s.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),u=l-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),y=p-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-T;return{cols:Math.max(2,Math.floor(y/A.css.cell.width)),rows:Math.max(1,Math.floor(u/A.css.cell.height))}}}})(),o})()))})(oc)),oc.exports}var Cw=Sw(),ac={exports:{}},Yd;function xw(){return Yd||(Yd=1,(function(n,r){(function(o,m){n.exports=m()})(self,(()=>(()=>{var o={6:(T,s)=>{function l(v){try{const u=new URL(v),y=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return v.toLocaleLowerCase().startsWith(y.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(v,u,y,S={}){this._terminal=v,this._regex=u,this._handler=y,this._options=S}provideLinks(v,u){const y=p.computeLink(v,this._regex,this._terminal,this._handler);u(this._addCallbacks(y))}_addCallbacks(v){return v.map((u=>(u.leave=this._options.leave,u.hover=(y,S)=>{if(this._options.hover){const{range:k}=u;this._options.hover(y,S,k)}},u)))}};class p{static computeLink(u,y,S,k){const g=new RegExp(y.source,(y.flags||"")+"g"),[a,f]=p._getWindowedLineStrings(u-1,S),d=a.join("");let h;const C=[];for(;h=g.exec(d);){const D=h[0];if(!l(D))continue;const[x,M]=p._mapStrIdx(S,f,0,h.index),[b,L]=p._mapStrIdx(S,x,M,D.length);if(x===-1||M===-1||b===-1||L===-1)continue;const N={start:{x:M+1,y:x+1},end:{x:L,y:b+1}};C.push({range:N,text:D,activate:k})}return C}static _getWindowedLineStrings(u,y){let S,k=u,g=u,a=0,f="";const d=[];if(S=y.buffer.active.getLine(u)){const h=S.translateToString(!0);if(S.isWrapped&&h[0]!==" "){for(a=0;(S=y.buffer.active.getLine(--k))&&a<2048&&(f=S.translateToString(!0),a+=f.length,d.push(f),S.isWrapped&&f.indexOf(" ")===-1););d.reverse()}for(d.push(h),a=0;(S=y.buffer.active.getLine(++g))&&S.isWrapped&&a<2048&&(f=S.translateToString(!0),a+=f.length,d.push(f),f.indexOf(" ")===-1););}return[d,k]}static _mapStrIdx(u,y,S,k){const g=u.buffer.active,a=g.getNullCell();let f=S;for(;k;){const d=g.getLine(y);if(!d)return[-1,-1];for(let h=f;h<d.length;++h){d.getCell(h,a);const C=a.getChars();if(a.getWidth()&&(k-=C.length||1,h===d.length-1&&C==="")){const D=g.getLine(y+1);D&&D.isWrapped&&(D.getCell(0,a),a.getWidth()===2&&(k+=1))}if(k<0)return[y,h]}y++,f=0}return[y,f]}}s.LinkComputer=p}},m={};function w(T){var s=m[T];if(s!==void 0)return s.exports;var l=m[T]={exports:{}};return o[T](l,l.exports,w),l.exports}var A={};return(()=>{var T=A;Object.defineProperty(T,"__esModule",{value:!0}),T.WebLinksAddon=void 0;const s=w(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function p(v,u){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}T.WebLinksAddon=class{constructor(v=p,u={}){this._handler=v,this._options=u}activate(v){this._terminal=v;const u=this._options,y=u.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,y,this._handler,u))}dispose(){var v;(v=this._linkProvider)==null||v.dispose()}}})(),A})()))})(ac)),ac.exports}var kw=xw(),lc={exports:{}},Xd;function Ew(){return Xd||(Xd=1,(function(n,r){(function(o,m){n.exports=m()})(self,(()=>(()=>{var o={965:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GlyphRenderer=void 0;const p=l(374),v=l(509),u=l(855),y=l(859),S=l(381),k=11,g=k*Float32Array.BYTES_PER_ELEMENT;let a,f=0,d=0,h=0;class C extends y.Disposable{constructor(x,M,b,L){super(),this._terminal=x,this._gl=M,this._dimensions=b,this._optionsService=L,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const N=this._gl;v.TextureAtlas.maxAtlasPages===void 0&&(v.TextureAtlas.maxAtlasPages=Math.min(32,(0,p.throwIfFalsy)(N.getParameter(N.MAX_TEXTURE_IMAGE_UNITS))),v.TextureAtlas.maxTextureSize=(0,p.throwIfFalsy)(N.getParameter(N.MAX_TEXTURE_SIZE))),this._program=(0,p.throwIfFalsy)((0,S.createProgram)(N,`#version 300 es
|
|
52
|
-
layout (location = 0) in vec2 a_unitquad;
|
|
53
|
-
layout (location = 1) in vec2 a_cellpos;
|
|
54
|
-
layout (location = 2) in vec2 a_offset;
|
|
55
|
-
layout (location = 3) in vec2 a_size;
|
|
56
|
-
layout (location = 4) in float a_texpage;
|
|
57
|
-
layout (location = 5) in vec2 a_texcoord;
|
|
58
|
-
layout (location = 6) in vec2 a_texsize;
|
|
59
|
-
|
|
60
|
-
uniform mat4 u_projection;
|
|
61
|
-
uniform vec2 u_resolution;
|
|
62
|
-
|
|
63
|
-
out vec2 v_texcoord;
|
|
64
|
-
flat out int v_texpage;
|
|
65
|
-
|
|
66
|
-
void main() {
|
|
67
|
-
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
68
|
-
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
69
|
-
v_texpage = int(a_texpage);
|
|
70
|
-
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
71
|
-
}`,(function(X){let G="";for(let K=1;K<X;K++)G+=` else if (v_texpage == ${K}) { outColor = texture(u_texture[${K}], v_texcoord); }`;return`#version 300 es
|
|
72
|
-
precision lowp float;
|
|
73
|
-
|
|
74
|
-
in vec2 v_texcoord;
|
|
75
|
-
flat in int v_texpage;
|
|
76
|
-
|
|
77
|
-
uniform sampler2D u_texture[${X}];
|
|
78
|
-
|
|
79
|
-
out vec4 outColor;
|
|
80
|
-
|
|
81
|
-
void main() {
|
|
82
|
-
if (v_texpage == 0) {
|
|
83
|
-
outColor = texture(u_texture[0], v_texcoord);
|
|
84
|
-
} ${G}
|
|
85
|
-
}`})(v.TextureAtlas.maxAtlasPages))),this.register((0,y.toDisposable)((()=>N.deleteProgram(this._program)))),this._projectionLocation=(0,p.throwIfFalsy)(N.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,p.throwIfFalsy)(N.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,p.throwIfFalsy)(N.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=N.createVertexArray(),N.bindVertexArray(this._vertexArrayObject);const B=new Float32Array([0,0,1,0,0,1,1,1]),P=N.createBuffer();this.register((0,y.toDisposable)((()=>N.deleteBuffer(P)))),N.bindBuffer(N.ARRAY_BUFFER,P),N.bufferData(N.ARRAY_BUFFER,B,N.STATIC_DRAW),N.enableVertexAttribArray(0),N.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const F=new Uint8Array([0,1,2,3]),H=N.createBuffer();this.register((0,y.toDisposable)((()=>N.deleteBuffer(H)))),N.bindBuffer(N.ELEMENT_ARRAY_BUFFER,H),N.bufferData(N.ELEMENT_ARRAY_BUFFER,F,N.STATIC_DRAW),this._attributesBuffer=(0,p.throwIfFalsy)(N.createBuffer()),this.register((0,y.toDisposable)((()=>N.deleteBuffer(this._attributesBuffer)))),N.bindBuffer(N.ARRAY_BUFFER,this._attributesBuffer),N.enableVertexAttribArray(2),N.vertexAttribPointer(2,2,N.FLOAT,!1,g,0),N.vertexAttribDivisor(2,1),N.enableVertexAttribArray(3),N.vertexAttribPointer(3,2,N.FLOAT,!1,g,2*Float32Array.BYTES_PER_ELEMENT),N.vertexAttribDivisor(3,1),N.enableVertexAttribArray(4),N.vertexAttribPointer(4,1,N.FLOAT,!1,g,4*Float32Array.BYTES_PER_ELEMENT),N.vertexAttribDivisor(4,1),N.enableVertexAttribArray(5),N.vertexAttribPointer(5,2,N.FLOAT,!1,g,5*Float32Array.BYTES_PER_ELEMENT),N.vertexAttribDivisor(5,1),N.enableVertexAttribArray(6),N.vertexAttribPointer(6,2,N.FLOAT,!1,g,7*Float32Array.BYTES_PER_ELEMENT),N.vertexAttribDivisor(6,1),N.enableVertexAttribArray(1),N.vertexAttribPointer(1,2,N.FLOAT,!1,g,9*Float32Array.BYTES_PER_ELEMENT),N.vertexAttribDivisor(1,1),N.useProgram(this._program);const q=new Int32Array(v.TextureAtlas.maxAtlasPages);for(let X=0;X<v.TextureAtlas.maxAtlasPages;X++)q[X]=X;N.uniform1iv(this._textureLocation,q),N.uniformMatrix4fv(this._projectionLocation,!1,S.PROJECTION_MATRIX),this._atlasTextures=[];for(let X=0;X<v.TextureAtlas.maxAtlasPages;X++){const G=new S.GLTexture((0,p.throwIfFalsy)(N.createTexture()));this.register((0,y.toDisposable)((()=>N.deleteTexture(G.texture)))),N.activeTexture(N.TEXTURE0+X),N.bindTexture(N.TEXTURE_2D,G.texture),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,N.CLAMP_TO_EDGE),N.texImage2D(N.TEXTURE_2D,0,N.RGBA,1,1,0,N.RGBA,N.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[X]=G}N.enable(N.BLEND),N.blendFunc(N.SRC_ALPHA,N.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(x,M,b,L,N,B,P,F,H){this._updateCell(this._vertices.attributes,x,M,b,L,N,B,P,F,H)}_updateCell(x,M,b,L,N,B,P,F,H,q){f=(b*this._terminal.cols+M)*k,L!==u.NULL_CELL_CODE&&L!==void 0?this._atlas&&(a=F&&F.length>1?this._atlas.getRasterizedGlyphCombinedChar(F,N,B,P,!1):this._atlas.getRasterizedGlyph(L,N,B,P,!1),d=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),N!==q&&a.offset.x>d?(h=a.offset.x-d,x[f]=-(a.offset.x-h)+this._dimensions.device.char.left,x[f+1]=-a.offset.y+this._dimensions.device.char.top,x[f+2]=(a.size.x-h)/this._dimensions.device.canvas.width,x[f+3]=a.size.y/this._dimensions.device.canvas.height,x[f+4]=a.texturePage,x[f+5]=a.texturePositionClipSpace.x+h/this._atlas.pages[a.texturePage].canvas.width,x[f+6]=a.texturePositionClipSpace.y,x[f+7]=a.sizeClipSpace.x-h/this._atlas.pages[a.texturePage].canvas.width,x[f+8]=a.sizeClipSpace.y):(x[f]=-a.offset.x+this._dimensions.device.char.left,x[f+1]=-a.offset.y+this._dimensions.device.char.top,x[f+2]=a.size.x/this._dimensions.device.canvas.width,x[f+3]=a.size.y/this._dimensions.device.canvas.height,x[f+4]=a.texturePage,x[f+5]=a.texturePositionClipSpace.x,x[f+6]=a.texturePositionClipSpace.y,x[f+7]=a.sizeClipSpace.x,x[f+8]=a.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,p.allowRescaling)(L,H,a.size.x,this._dimensions.device.cell.width)&&(x[f+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):x.fill(0,f,f+k-1-2)}clear(){const x=this._terminal,M=x.cols*x.rows*k;this._vertices.count!==M?this._vertices.attributes=new Float32Array(M):this._vertices.attributes.fill(0);let b=0;for(;b<this._vertices.attributesBuffers.length;b++)this._vertices.count!==M?this._vertices.attributesBuffers[b]=new Float32Array(M):this._vertices.attributesBuffers[b].fill(0);this._vertices.count=M,b=0;for(let L=0;L<x.rows;L++)for(let N=0;N<x.cols;N++)this._vertices.attributes[b+9]=N/x.cols,this._vertices.attributes[b+10]=L/x.rows,b+=k}handleResize(){const x=this._gl;x.useProgram(this._program),x.viewport(0,0,x.canvas.width,x.canvas.height),x.uniform2f(this._resolutionLocation,x.canvas.width,x.canvas.height),this.clear()}render(x){if(!this._atlas)return;const M=this._gl;M.useProgram(this._program),M.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const b=this._vertices.attributesBuffers[this._activeBuffer];let L=0;for(let N=0;N<x.lineLengths.length;N++){const B=N*this._terminal.cols*k,P=this._vertices.attributes.subarray(B,B+x.lineLengths[N]*k);b.set(P,L),L+=P.length}M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.bufferData(M.ARRAY_BUFFER,b.subarray(0,L),M.STREAM_DRAW);for(let N=0;N<this._atlas.pages.length;N++)this._atlas.pages[N].version!==this._atlasTextures[N].version&&this._bindAtlasPageTexture(M,this._atlas,N);M.drawElementsInstanced(M.TRIANGLE_STRIP,4,M.UNSIGNED_BYTE,0,L/k)}setAtlas(x){this._atlas=x;for(const M of this._atlasTextures)M.version=-1}_bindAtlasPageTexture(x,M,b){x.activeTexture(x.TEXTURE0+b),x.bindTexture(x.TEXTURE_2D,this._atlasTextures[b].texture),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,x.CLAMP_TO_EDGE),x.texImage2D(x.TEXTURE_2D,0,x.RGBA,x.RGBA,x.UNSIGNED_BYTE,M.pages[b].canvas),x.generateMipmap(x.TEXTURE_2D),this._atlasTextures[b].version=M.pages[b].version}setDimensions(x){this._dimensions=x}}s.GlyphRenderer=C},742:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RectangleRenderer=void 0;const p=l(374),v=l(859),u=l(310),y=l(381),S=8*Float32Array.BYTES_PER_ELEMENT;class k{constructor(){this.attributes=new Float32Array(160),this.count=0}}let g=0,a=0,f=0,d=0,h=0,C=0,D=0;class x extends v.Disposable{constructor(b,L,N,B){super(),this._terminal=b,this._gl=L,this._dimensions=N,this._themeService=B,this._vertices=new k,this._verticesCursor=new k;const P=this._gl;this._program=(0,p.throwIfFalsy)((0,y.createProgram)(P,`#version 300 es
|
|
86
|
-
layout (location = 0) in vec2 a_position;
|
|
87
|
-
layout (location = 1) in vec2 a_size;
|
|
88
|
-
layout (location = 2) in vec4 a_color;
|
|
89
|
-
layout (location = 3) in vec2 a_unitquad;
|
|
90
|
-
|
|
91
|
-
uniform mat4 u_projection;
|
|
92
|
-
|
|
93
|
-
out vec4 v_color;
|
|
94
|
-
|
|
95
|
-
void main() {
|
|
96
|
-
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
97
|
-
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
98
|
-
v_color = a_color;
|
|
99
|
-
}`,`#version 300 es
|
|
100
|
-
precision lowp float;
|
|
101
|
-
|
|
102
|
-
in vec4 v_color;
|
|
103
|
-
|
|
104
|
-
out vec4 outColor;
|
|
105
|
-
|
|
106
|
-
void main() {
|
|
107
|
-
outColor = v_color;
|
|
108
|
-
}`)),this.register((0,v.toDisposable)((()=>P.deleteProgram(this._program)))),this._projectionLocation=(0,p.throwIfFalsy)(P.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=P.createVertexArray(),P.bindVertexArray(this._vertexArrayObject);const F=new Float32Array([0,0,1,0,0,1,1,1]),H=P.createBuffer();this.register((0,v.toDisposable)((()=>P.deleteBuffer(H)))),P.bindBuffer(P.ARRAY_BUFFER,H),P.bufferData(P.ARRAY_BUFFER,F,P.STATIC_DRAW),P.enableVertexAttribArray(3),P.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const q=new Uint8Array([0,1,2,3]),X=P.createBuffer();this.register((0,v.toDisposable)((()=>P.deleteBuffer(X)))),P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,X),P.bufferData(P.ELEMENT_ARRAY_BUFFER,q,P.STATIC_DRAW),this._attributesBuffer=(0,p.throwIfFalsy)(P.createBuffer()),this.register((0,v.toDisposable)((()=>P.deleteBuffer(this._attributesBuffer)))),P.bindBuffer(P.ARRAY_BUFFER,this._attributesBuffer),P.enableVertexAttribArray(0),P.vertexAttribPointer(0,2,P.FLOAT,!1,S,0),P.vertexAttribDivisor(0,1),P.enableVertexAttribArray(1),P.vertexAttribPointer(1,2,P.FLOAT,!1,S,2*Float32Array.BYTES_PER_ELEMENT),P.vertexAttribDivisor(1,1),P.enableVertexAttribArray(2),P.vertexAttribPointer(2,4,P.FLOAT,!1,S,4*Float32Array.BYTES_PER_ELEMENT),P.vertexAttribDivisor(2,1),this._updateCachedColors(B.colors),this.register(this._themeService.onChangeColors((G=>{this._updateCachedColors(G),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(b){const L=this._gl;L.useProgram(this._program),L.bindVertexArray(this._vertexArrayObject),L.uniformMatrix4fv(this._projectionLocation,!1,y.PROJECTION_MATRIX),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.bufferData(L.ARRAY_BUFFER,b.attributes,L.DYNAMIC_DRAW),L.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,L.UNSIGNED_BYTE,0,b.count)}handleResize(){this._updateViewportRectangle()}setDimensions(b){this._dimensions=b}_updateCachedColors(b){this._bgFloat=this._colorToFloat32Array(b.background),this._cursorFloat=this._colorToFloat32Array(b.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(b){const L=this._terminal,N=this._vertices;let B,P,F,H,q,X,G,K,j,W,$,V=1;for(B=0;B<L.rows;B++){for(F=-1,H=0,q=0,X=!1,P=0;P<L.cols;P++)G=(B*L.cols+P)*u.RENDER_MODEL_INDICIES_PER_CELL,K=b.cells[G+u.RENDER_MODEL_BG_OFFSET],j=b.cells[G+u.RENDER_MODEL_FG_OFFSET],W=!!(67108864&j),(K!==H||j!==q&&(X||W))&&((H!==0||X&&q!==0)&&($=8*V++,this._updateRectangle(N,$,q,H,F,P,B)),F=P,H=K,q=j,X=W);(H!==0||X&&q!==0)&&($=8*V++,this._updateRectangle(N,$,q,H,F,L.cols,B))}N.count=V}updateCursor(b){const L=this._verticesCursor,N=b.cursor;if(!N||N.style==="block")return void(L.count=0);let B,P=0;N.style!=="bar"&&N.style!=="outline"||(B=8*P++,this._addRectangleFloat(L.attributes,B,N.x*this._dimensions.device.cell.width,N.y*this._dimensions.device.cell.height,N.style==="bar"?N.dpr*N.cursorWidth:N.dpr,this._dimensions.device.cell.height,this._cursorFloat)),N.style!=="underline"&&N.style!=="outline"||(B=8*P++,this._addRectangleFloat(L.attributes,B,N.x*this._dimensions.device.cell.width,(N.y+1)*this._dimensions.device.cell.height-N.dpr,N.width*this._dimensions.device.cell.width,N.dpr,this._cursorFloat)),N.style==="outline"&&(B=8*P++,this._addRectangleFloat(L.attributes,B,N.x*this._dimensions.device.cell.width,N.y*this._dimensions.device.cell.height,N.width*this._dimensions.device.cell.width,N.dpr,this._cursorFloat),B=8*P++,this._addRectangleFloat(L.attributes,B,(N.x+N.width)*this._dimensions.device.cell.width-N.dpr,N.y*this._dimensions.device.cell.height,N.dpr,this._dimensions.device.cell.height,this._cursorFloat)),L.count=P}_updateRectangle(b,L,N,B,P,F,H){if(67108864&N)switch(50331648&N){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&N].rgba;break;case 50331648:g=(16777215&N)<<8;break;default:g=this._themeService.colors.foreground.rgba}else switch(50331648&B){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&B].rgba;break;case 50331648:g=(16777215&B)<<8;break;default:g=this._themeService.colors.background.rgba}b.attributes.length<L+4&&(b.attributes=(0,y.expandFloat32Array)(b.attributes,this._terminal.rows*this._terminal.cols*8)),a=P*this._dimensions.device.cell.width,f=H*this._dimensions.device.cell.height,d=(g>>24&255)/255,h=(g>>16&255)/255,C=(g>>8&255)/255,D=1,this._addRectangle(b.attributes,L,a,f,(F-P)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,d,h,C,D)}_addRectangle(b,L,N,B,P,F,H,q,X,G){b[L]=N/this._dimensions.device.canvas.width,b[L+1]=B/this._dimensions.device.canvas.height,b[L+2]=P/this._dimensions.device.canvas.width,b[L+3]=F/this._dimensions.device.canvas.height,b[L+4]=H,b[L+5]=q,b[L+6]=X,b[L+7]=G}_addRectangleFloat(b,L,N,B,P,F,H){b[L]=N/this._dimensions.device.canvas.width,b[L+1]=B/this._dimensions.device.canvas.height,b[L+2]=P/this._dimensions.device.canvas.width,b[L+3]=F/this._dimensions.device.canvas.height,b[L+4]=H[0],b[L+5]=H[1],b[L+6]=H[2],b[L+7]=H[3]}_colorToFloat32Array(b){return new Float32Array([(b.rgba>>24&255)/255,(b.rgba>>16&255)/255,(b.rgba>>8&255)/255,(255&b.rgba)/255])}}s.RectangleRenderer=x},310:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderModel=s.COMBINED_CHAR_BIT_MASK=s.RENDER_MODEL_EXT_OFFSET=s.RENDER_MODEL_FG_OFFSET=s.RENDER_MODEL_BG_OFFSET=s.RENDER_MODEL_INDICIES_PER_CELL=void 0;const p=l(296);s.RENDER_MODEL_INDICIES_PER_CELL=4,s.RENDER_MODEL_BG_OFFSET=1,s.RENDER_MODEL_FG_OFFSET=2,s.RENDER_MODEL_EXT_OFFSET=3,s.COMBINED_CHAR_BIT_MASK=2147483648,s.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,p.createSelectionRenderModel)()}resize(v,u){const y=v*u*s.RENDER_MODEL_INDICIES_PER_CELL;y!==this.cells.length&&(this.cells=new Uint32Array(y),this.lineLengths=new Uint32Array(u))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.JoinedCellData=s.WebglRenderer=void 0;const p=l(820),v=l(274),u=l(627),y=l(457),S=l(56),k=l(374),g=l(345),a=l(859),f=l(147),d=l(782),h=l(855),C=l(965),D=l(742),x=l(310),M=l(733);class b extends a.Disposable{constructor(P,F,H,q,X,G,K,j,W){super(),this._terminal=P,this._characterJoinerService=F,this._charSizeService=H,this._coreBrowserService=q,this._coreService=X,this._decorationService=G,this._optionsService=K,this._themeService=j,this._cursorBlinkStateManager=new a.MutableDisposable,this._charAtlasDisposable=this.register(new a.MutableDisposable),this._observerDisposable=this.register(new a.MutableDisposable),this._model=new x.RenderModel,this._workCell=new d.CellData,this._workCell2=new d.CellData,this._rectangleRenderer=this.register(new a.MutableDisposable),this._glyphRenderer=this.register(new a.MutableDisposable),this._onChangeTextureAtlas=this.register(new g.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new g.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new g.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new g.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new v.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new M.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,K,this._themeService)],this.dimensions=(0,k.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(K.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const $={antialias:!1,depth:!1,preserveDrawingBuffer:W};if(this._gl=this._canvas.getContext("webgl2",$),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,p.addDisposableDomListener)(this._canvas,"webglcontextlost",(V=>{console.log("webglcontextlost event received"),V.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(V)}),3e3)}))),this.register((0,p.addDisposableDomListener)(this._canvas,"webglcontextrestored",(V=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,u.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,S.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((V,J)=>this._setCanvasDevicePixelDimensions(V,J))),this.register(this._coreBrowserService.onWindowChange((V=>{this._observerDisposable.value=(0,S.observeDevicePixelDimensions)(this._canvas,V,((J,re)=>this._setCanvasDevicePixelDimensions(J,re)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,a.toDisposable)((()=>{var V;for(const J of this._renderLayers)J.dispose();(V=this._canvas.parentElement)==null||V.removeChild(this._canvas),(0,u.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var P;return(P=this._charAtlas)==null?void 0:P.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(P,F){var H,q,X,G;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const K of this._renderLayers)K.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(H=this._rectangleRenderer.value)==null||H.setDimensions(this.dimensions),(q=this._rectangleRenderer.value)==null||q.handleResize(),(X=this._glyphRenderer.value)==null||X.setDimensions(this.dimensions),(G=this._glyphRenderer.value)==null||G.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var P;for(const F of this._renderLayers)F.handleBlur(this._terminal);(P=this._cursorBlinkStateManager.value)==null||P.pause(),this._requestRedrawViewport()}handleFocus(){var P;for(const F of this._renderLayers)F.handleFocus(this._terminal);(P=this._cursorBlinkStateManager.value)==null||P.resume(),this._requestRedrawViewport()}handleSelectionChanged(P,F,H){for(const q of this._renderLayers)q.handleSelectionChanged(this._terminal,P,F,H);this._model.selection.update(this._core,P,F,H),this._requestRedrawViewport()}handleCursorMove(){var P;for(const F of this._renderLayers)F.handleCursorMove(this._terminal);(P=this._cursorBlinkStateManager.value)==null||P.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new D.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new C.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var F;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const P=(0,u.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==P&&(this._onChangeTextureAtlas.fire(P.pages[0].canvas),this._charAtlasDisposable.value=(0,a.getDisposeArrayDisposable)([(0,g.forwardEvent)(P.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,g.forwardEvent)(P.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=P,this._charAtlas.warmUp(),(F=this._glyphRenderer.value)==null||F.setAtlas(this._charAtlas)}_clearModel(P){var F;this._model.clear(),P&&((F=this._glyphRenderer.value)==null||F.clear())}clearTextureAtlas(){var P;(P=this._charAtlas)==null||P.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var P;this._clearModel(!0);for(const F of this._renderLayers)F.reset(this._terminal);(P=this._cursorBlinkStateManager.value)==null||P.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(P){return-1}deregisterCharacterJoiner(P){return!1}renderRows(P,F){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const H of this._renderLayers)H.handleGridChanged(this._terminal,P,F);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(P,F),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new y.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(P,F){const H=this._core;let q,X,G,K,j,W,$,V,J,re,ie,he,Y,U,Z=this._workCell;P=N(P,H.rows-1,0),F=N(F,H.rows-1,0);const ee=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,pe=ee-H.buffer.ydisp,ne=Math.min(this._terminal.buffer.active.cursorX,H.cols-1);let Ee=-1;const xe=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let ce=!1;for(X=P;X<=F;X++)for(G=X+H.buffer.ydisp,K=H.buffer.lines.get(G),this._model.lineLengths[X]=0,j=this._characterJoinerService.getJoinedCharacters(G),Y=0;Y<H.cols;Y++)if(q=this._cellColorResolver.result.bg,K.loadCell(Y,Z),Y===0&&(q=this._cellColorResolver.result.bg),W=!1,$=Y,j.length>0&&Y===j[0][0]&&(W=!0,V=j.shift(),Z=new L(Z,K.translateToString(!0,V[0],V[1]),V[1]-V[0]),$=V[1]-1),J=Z.getChars(),re=Z.getCode(),he=(X*H.cols+Y)*x.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(Z,Y,G,this.dimensions.device.cell.width),xe&&G===ee&&(Y===ne&&(this._model.cursor={x:ne,y:pe,width:Z.getWidth(),style:this._coreBrowserService.isFocused?H.options.cursorStyle||"block":H.options.cursorInactiveStyle,cursorWidth:H.options.cursorWidth,dpr:this._devicePixelRatio},Ee=ne+Z.getWidth()-1),Y>=ne&&Y<=Ee&&(this._coreBrowserService.isFocused&&(H.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&H.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),re!==h.NULL_CELL_CODE&&(this._model.lineLengths[X]=Y+1),(this._model.cells[he]!==re||this._model.cells[he+x.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[he+x.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[he+x.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(ce=!0,J.length>1&&(re|=x.COMBINED_CHAR_BIT_MASK),this._model.cells[he]=re,this._model.cells[he+x.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[he+x.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[he+x.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,ie=Z.getWidth(),this._glyphRenderer.value.updateCell(Y,X,re,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,J,ie,q),W))for(Z=this._workCell,Y++;Y<$;Y++)U=(X*H.cols+Y)*x.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(Y,X,h.NULL_CELL_CODE,0,0,0,h.NULL_CELL_CHAR,0,0),this._model.cells[U]=h.NULL_CELL_CODE,this._model.cells[U+x.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[U+x.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[U+x.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;ce&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(P,F){this._canvas.width===P&&this._canvas.height===F||(this._canvas.width=P,this._canvas.height=F,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const P=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:P,end:P})}}s.WebglRenderer=b;class L extends f.AttributeData{constructor(P,F,H){super(),this.content=0,this.combinedData="",this.fg=P.fg,this.bg=P.bg,this.combinedData=F,this._width=H}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(P){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function N(B,P,F=0){return Math.max(Math.min(B,P),F)}s.JoinedCellData=L},381:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GLTexture=s.expandFloat32Array=s.createShader=s.createProgram=s.PROJECTION_MATRIX=void 0;const p=l(374);function v(u,y,S){const k=(0,p.throwIfFalsy)(u.createShader(y));if(u.shaderSource(k,S),u.compileShader(k),u.getShaderParameter(k,u.COMPILE_STATUS))return k;console.error(u.getShaderInfoLog(k)),u.deleteShader(k)}s.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),s.createProgram=function(u,y,S){const k=(0,p.throwIfFalsy)(u.createProgram());if(u.attachShader(k,(0,p.throwIfFalsy)(v(u,u.VERTEX_SHADER,y))),u.attachShader(k,(0,p.throwIfFalsy)(v(u,u.FRAGMENT_SHADER,S))),u.linkProgram(k),u.getProgramParameter(k,u.LINK_STATUS))return k;console.error(u.getProgramInfoLog(k)),u.deleteProgram(k)},s.createShader=v,s.expandFloat32Array=function(u,y){const S=Math.min(2*u.length,y),k=new Float32Array(S);for(let g=0;g<u.length;g++)k[g]=u[g];return k},s.GLTexture=class{constructor(u){this.texture=u,this.version=-1}}},592:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const p=l(627),v=l(237),u=l(374),y=l(859);class S extends y.Disposable{constructor(g,a,f,d,h,C,D,x){super(),this._container=a,this._alpha=h,this._coreBrowserService=C,this._optionsService=D,this._themeService=x,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${f}-layer`),this._canvas.style.zIndex=d.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((M=>{this._refreshCharAtlas(g,M),this.reset(g)}))),this.register((0,y.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,u.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(g){}handleFocus(g){}handleCursorMove(g){}handleGridChanged(g,a,f){}handleSelectionChanged(g,a,f,d=!1){}_setTransparency(g,a){if(a===this._alpha)return;const f=this._canvas;this._alpha=a,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,f),this._refreshCharAtlas(g,this._themeService.colors),this.handleGridChanged(g,0,g.rows-1)}_refreshCharAtlas(g,a){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,p.acquireTextureAtlas)(g,this._optionsService.rawOptions,a,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(g,a){this._deviceCellWidth=a.device.cell.width,this._deviceCellHeight=a.device.cell.height,this._deviceCharWidth=a.device.char.width,this._deviceCharHeight=a.device.char.height,this._deviceCharLeft=a.device.char.left,this._deviceCharTop=a.device.char.top,this._canvas.width=a.device.canvas.width,this._canvas.height=a.device.canvas.height,this._canvas.style.width=`${a.css.canvas.width}px`,this._canvas.style.height=`${a.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(g,this._themeService.colors)}_fillBottomLineAtCells(g,a,f=1){this._ctx.fillRect(g*this._deviceCellWidth,(a+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,f*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(g,a,f,d){this._alpha?this._ctx.clearRect(g*this._deviceCellWidth,a*this._deviceCellHeight,f*this._deviceCellWidth,d*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(g*this._deviceCellWidth,a*this._deviceCellHeight,f*this._deviceCellWidth,d*this._deviceCellHeight))}_fillCharTrueColor(g,a,f,d){this._ctx.font=this._getFont(g,!1,!1),this._ctx.textBaseline=v.TEXT_BASELINE,this._clipCell(f,d,a.getWidth()),this._ctx.fillText(a.getChars(),f*this._deviceCellWidth+this._deviceCharLeft,d*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(g,a,f){this._ctx.beginPath(),this._ctx.rect(g*this._deviceCellWidth,a*this._deviceCellHeight,f*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(g,a,f){return`${f?"italic":""} ${a?g.options.fontWeightBold:g.options.fontWeight} ${g.options.fontSize*this._coreBrowserService.dpr}px ${g.options.fontFamily}`}}s.BaseRenderLayer=S},733:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const p=l(197),v=l(237),u=l(592);class y extends u.BaseRenderLayer{constructor(k,g,a,f,d,h,C){super(a,k,"link",g,!0,d,h,C),this.register(f.onShowLinkUnderline((D=>this._handleShowLinkUnderline(D)))),this.register(f.onHideLinkUnderline((D=>this._handleHideLinkUnderline(D))))}resize(k,g){super.resize(k,g),this._state=void 0}reset(k){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const k=this._state.y2-this._state.y1-1;k>0&&this._clearCells(0,this._state.y1+1,this._state.cols,k),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(k){if(k.fg===v.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:k.fg!==void 0&&(0,p.is256Color)(k.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[k.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,k.y1===k.y2)this._fillBottomLineAtCells(k.x1,k.y1,k.x2-k.x1);else{this._fillBottomLineAtCells(k.x1,k.y1,k.cols-k.x1);for(let g=k.y1+1;g<k.y2;g++)this._fillBottomLineAtCells(0,g,k.cols);this._fillBottomLineAtCells(0,k.y2,k.x2)}this._state=k}_handleHideLinkUnderline(k){this._clearCurrentLink()}}s.LinkRenderLayer=y},820:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(l,p,v,u){l.addEventListener(p,v,u);let y=!1;return{dispose:()=>{y||(y=!0,l.removeEventListener(p,v,u))}}}},274:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;const p=l(855),v=l(160),u=l(374);let y,S=0,k=0,g=!1,a=!1,f=!1,d=0;s.CellColorResolver=class{constructor(h,C,D,x,M,b){this._terminal=h,this._optionService=C,this._selectionRenderModel=D,this._decorationService=x,this._coreBrowserService=M,this._themeService=b,this.result={fg:0,bg:0,ext:0}}resolve(h,C,D,x){if(this.result.bg=h.bg,this.result.fg=h.fg,this.result.ext=268435456&h.bg?h.extended.ext:0,k=0,S=0,a=!1,g=!1,f=!1,y=this._themeService.colors,d=0,h.getCode()!==p.NULL_CELL_CODE&&h.extended.underlineStyle===4){const M=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));d=C*x%(2*Math.round(M))}if(this._decorationService.forEachDecorationAtCell(C,D,"bottom",(M=>{M.backgroundColorRGB&&(k=M.backgroundColorRGB.rgba>>8&16777215,a=!0),M.foregroundColorRGB&&(S=M.foregroundColorRGB.rgba>>8&16777215,g=!0)})),f=this._selectionRenderModel.isCellSelected(this._terminal,C,D),f){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:k=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:k=(16777215&this.result.fg)<<8|255;break;default:k=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:k=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:k=(16777215&this.result.bg)<<8|255}k=v.rgba.blend(k,4294967040&(this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else k=(this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(a=!0,y.selectionForeground&&(S=y.selectionForeground.rgba>>8&16777215,g=!0),(0,u.treatGlyphAsBackgroundColor)(h.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)S=(this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:S=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:S=(16777215&this.result.fg)<<8|255;break;default:S=this._themeService.colors.foreground.rgba}S=v.rgba.blend(S,4294967040&(this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}g=!0}}this._decorationService.forEachDecorationAtCell(C,D,"top",(M=>{M.backgroundColorRGB&&(k=M.backgroundColorRGB.rgba>>8&16777215,a=!0),M.foregroundColorRGB&&(S=M.foregroundColorRGB.rgba>>8&16777215,g=!0)})),a&&(k=f?-16777216&h.bg&-134217729|k|50331648:-16777216&h.bg|k|50331648),g&&(S=-16777216&h.fg&-67108865|S|50331648),67108864&this.result.fg&&(a&&!g&&(S=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&y.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,g=!0),!a&&g&&(k=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&y.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,a=!0)),y=void 0,this.result.bg=a?k:this.result.bg,this.result.fg=g?S:this.result.fg,this.result.ext&=536870911,this.result.ext|=d<<29&3758096384}}},627:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const p=l(509),v=l(197),u=[];s.acquireTextureAtlas=function(y,S,k,g,a,f,d,h){const C=(0,v.generateConfig)(g,a,f,d,S,k,h);for(let M=0;M<u.length;M++){const b=u[M],L=b.ownedBy.indexOf(y);if(L>=0){if((0,v.configEquals)(b.config,C))return b.atlas;b.ownedBy.length===1?(b.atlas.dispose(),u.splice(M,1)):b.ownedBy.splice(L,1);break}}for(let M=0;M<u.length;M++){const b=u[M];if((0,v.configEquals)(b.config,C))return b.ownedBy.push(y),b.atlas}const D=y._core,x={atlas:new p.TextureAtlas(document,C,D.unicodeService),config:C,ownedBy:[y]};return u.push(x),x.atlas},s.removeTerminalFromCache=function(y){for(let S=0;S<u.length;S++){const k=u[S].ownedBy.indexOf(y);if(k!==-1){u[S].ownedBy.length===1?(u[S].atlas.dispose(),u.splice(S,1)):u[S].ownedBy.splice(k,1);break}}}},197:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const p=l(160);s.generateConfig=function(v,u,y,S,k,g,a){const f={foreground:g.foreground,background:g.background,cursor:p.NULL_COLOR,cursorAccent:p.NULL_COLOR,selectionForeground:p.NULL_COLOR,selectionBackgroundTransparent:p.NULL_COLOR,selectionBackgroundOpaque:p.NULL_COLOR,selectionInactiveBackgroundTransparent:p.NULL_COLOR,selectionInactiveBackgroundOpaque:p.NULL_COLOR,ansi:g.ansi.slice(),contrastCache:g.contrastCache,halfContrastCache:g.halfContrastCache};return{customGlyphs:k.customGlyphs,devicePixelRatio:a,letterSpacing:k.letterSpacing,lineHeight:k.lineHeight,deviceCellWidth:v,deviceCellHeight:u,deviceCharWidth:y,deviceCharHeight:S,fontFamily:k.fontFamily,fontSize:k.fontSize,fontWeight:k.fontWeight,fontWeightBold:k.fontWeightBold,allowTransparency:k.allowTransparency,drawBoldTextInBrightColors:k.drawBoldTextInBrightColors,minimumContrastRatio:k.minimumContrastRatio,colors:f}},s.configEquals=function(v,u){for(let y=0;y<v.colors.ansi.length;y++)if(v.colors.ansi[y].rgba!==u.colors.ansi[y].rgba)return!1;return v.devicePixelRatio===u.devicePixelRatio&&v.customGlyphs===u.customGlyphs&&v.lineHeight===u.lineHeight&&v.letterSpacing===u.letterSpacing&&v.fontFamily===u.fontFamily&&v.fontSize===u.fontSize&&v.fontWeight===u.fontWeight&&v.fontWeightBold===u.fontWeightBold&&v.allowTransparency===u.allowTransparency&&v.deviceCharWidth===u.deviceCharWidth&&v.deviceCharHeight===u.deviceCharHeight&&v.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&v.minimumContrastRatio===u.minimumContrastRatio&&v.colors.foreground.rgba===u.colors.foreground.rgba&&v.colors.background.rgba===u.colors.background.rgba},s.is256Color=function(v){return(50331648&v)==16777216||(50331648&v)==33554432}},237:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const p=l(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=p.isFirefox||p.isLegacyEdge?"bottom":"ideographic"},457:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(l,p){this._renderCallback=l,this._coreBrowserService=p,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(l=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const p=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,p>0)return void this._restartInterval(p)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const p=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(p)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),l)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const p=l(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const v={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(g,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"║":{1:(g,a)=>`M${.5-g},0 L${.5-g},1 M${.5+g},0 L${.5+g},1`},"╒":{1:(g,a)=>`M.5,1 L.5,${.5-a} L1,${.5-a} M.5,${.5+a} L1,${.5+a}`},"╓":{1:(g,a)=>`M${.5-g},1 L${.5-g},.5 L1,.5 M${.5+g},.5 L${.5+g},1`},"╔":{1:(g,a)=>`M1,${.5-a} L${.5-g},${.5-a} L${.5-g},1 M1,${.5+a} L${.5+g},${.5+a} L${.5+g},1`},"╕":{1:(g,a)=>`M0,${.5-a} L.5,${.5-a} L.5,1 M0,${.5+a} L.5,${.5+a}`},"╖":{1:(g,a)=>`M${.5+g},1 L${.5+g},.5 L0,.5 M${.5-g},.5 L${.5-g},1`},"╗":{1:(g,a)=>`M0,${.5+a} L${.5-g},${.5+a} L${.5-g},1 M0,${.5-a} L${.5+g},${.5-a} L${.5+g},1`},"╘":{1:(g,a)=>`M.5,0 L.5,${.5+a} L1,${.5+a} M.5,${.5-a} L1,${.5-a}`},"╙":{1:(g,a)=>`M1,.5 L${.5-g},.5 L${.5-g},0 M${.5+g},.5 L${.5+g},0`},"╚":{1:(g,a)=>`M1,${.5-a} L${.5+g},${.5-a} L${.5+g},0 M1,${.5+a} L${.5-g},${.5+a} L${.5-g},0`},"╛":{1:(g,a)=>`M0,${.5+a} L.5,${.5+a} L.5,0 M0,${.5-a} L.5,${.5-a}`},"╜":{1:(g,a)=>`M0,.5 L${.5+g},.5 L${.5+g},0 M${.5-g},.5 L${.5-g},0`},"╝":{1:(g,a)=>`M0,${.5-a} L${.5-g},${.5-a} L${.5-g},0 M0,${.5+a} L${.5+g},${.5+a} L${.5+g},0`},"╞":{1:(g,a)=>`M.5,0 L.5,1 M.5,${.5-a} L1,${.5-a} M.5,${.5+a} L1,${.5+a}`},"╟":{1:(g,a)=>`M${.5-g},0 L${.5-g},1 M${.5+g},0 L${.5+g},1 M${.5+g},.5 L1,.5`},"╠":{1:(g,a)=>`M${.5-g},0 L${.5-g},1 M1,${.5+a} L${.5+g},${.5+a} L${.5+g},1 M1,${.5-a} L${.5+g},${.5-a} L${.5+g},0`},"╡":{1:(g,a)=>`M.5,0 L.5,1 M0,${.5-a} L.5,${.5-a} M0,${.5+a} L.5,${.5+a}`},"╢":{1:(g,a)=>`M0,.5 L${.5-g},.5 M${.5-g},0 L${.5-g},1 M${.5+g},0 L${.5+g},1`},"╣":{1:(g,a)=>`M${.5+g},0 L${.5+g},1 M0,${.5+a} L${.5-g},${.5+a} L${.5-g},1 M0,${.5-a} L${.5-g},${.5-a} L${.5-g},0`},"╤":{1:(g,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a} M.5,${.5+a} L.5,1`},"╥":{1:(g,a)=>`M0,.5 L1,.5 M${.5-g},.5 L${.5-g},1 M${.5+g},.5 L${.5+g},1`},"╦":{1:(g,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L${.5-g},${.5+a} L${.5-g},1 M1,${.5+a} L${.5+g},${.5+a} L${.5+g},1`},"╧":{1:(g,a)=>`M.5,0 L.5,${.5-a} M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"╨":{1:(g,a)=>`M0,.5 L1,.5 M${.5-g},.5 L${.5-g},0 M${.5+g},.5 L${.5+g},0`},"╩":{1:(g,a)=>`M0,${.5+a} L1,${.5+a} M0,${.5-a} L${.5-g},${.5-a} L${.5-g},0 M1,${.5-a} L${.5+g},${.5-a} L${.5+g},0`},"╪":{1:(g,a)=>`M.5,0 L.5,1 M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"╫":{1:(g,a)=>`M0,.5 L1,.5 M${.5-g},0 L${.5-g},1 M${.5+g},0 L${.5+g},1`},"╬":{1:(g,a)=>`M0,${.5+a} L${.5-g},${.5+a} L${.5-g},1 M1,${.5+a} L${.5+g},${.5+a} L${.5+g},1 M0,${.5-a} L${.5-g},${.5-a} L${.5-g},0 M1,${.5-a} L${.5+g},${.5-a} L${.5+g},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(g,a)=>`M.5,1 L.5,${.5+a/.15*.5} C.5,${.5+a/.15*.5},.5,.5,1,.5`},"╮":{1:(g,a)=>`M.5,1 L.5,${.5+a/.15*.5} C.5,${.5+a/.15*.5},.5,.5,0,.5`},"╯":{1:(g,a)=>`M.5,0 L.5,${.5-a/.15*.5} C.5,${.5-a/.15*.5},.5,.5,0,.5`},"╰":{1:(g,a)=>`M.5,0 L.5,${.5-a/.15*.5} C.5,${.5-a/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(g,a,f,d,h,C,D,x){const M=s.blockElementDefinitions[a];if(M)return(function(B,P,F,H,q,X){for(let G=0;G<P.length;G++){const K=P[G],j=q/8,W=X/8;B.fillRect(F+K.x*j,H+K.y*W,K.w*j,K.h*W)}})(g,M,f,d,h,C),!0;const b=v[a];if(b)return(function(B,P,F,H,q,X){let G=u.get(P);G||(G=new Map,u.set(P,G));const K=B.fillStyle;if(typeof K!="string")throw new Error(`Unexpected fillStyle type "${K}"`);let j=G.get(K);if(!j){const W=P[0].length,$=P.length,V=B.canvas.ownerDocument.createElement("canvas");V.width=W,V.height=$;const J=(0,p.throwIfFalsy)(V.getContext("2d")),re=new ImageData(W,$);let ie,he,Y,U;if(K.startsWith("#"))ie=parseInt(K.slice(1,3),16),he=parseInt(K.slice(3,5),16),Y=parseInt(K.slice(5,7),16),U=K.length>7&&parseInt(K.slice(7,9),16)||1;else{if(!K.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${K}" when drawing pattern glyph`);[ie,he,Y,U]=K.substring(5,K.length-1).split(",").map((Z=>parseFloat(Z)))}for(let Z=0;Z<$;Z++)for(let ee=0;ee<W;ee++)re.data[4*(Z*W+ee)]=ie,re.data[4*(Z*W+ee)+1]=he,re.data[4*(Z*W+ee)+2]=Y,re.data[4*(Z*W+ee)+3]=P[Z][ee]*(255*U);J.putImageData(re,0,0),j=(0,p.throwIfFalsy)(B.createPattern(V,null)),G.set(K,j)}B.fillStyle=j,B.fillRect(F,H,q,X)})(g,b,f,d,h,C),!0;const L=s.boxDrawingDefinitions[a];if(L)return(function(B,P,F,H,q,X,G){B.strokeStyle=B.fillStyle;for(const[K,j]of Object.entries(P)){let W;B.beginPath(),B.lineWidth=G*Number.parseInt(K),W=typeof j=="function"?j(.15,.15/X*q):j;for(const $ of W.split(" ")){const V=$[0],J=S[V];if(!J){console.error(`Could not find drawing instructions for "${V}"`);continue}const re=$.substring(1).split(",");re[0]&&re[1]&&J(B,k(re,q,X,F,H,!0,G))}B.stroke(),B.closePath()}})(g,L,f,d,h,C,x),!0;const N=s.powerlineDefinitions[a];return!!N&&((function(B,P,F,H,q,X,G,K){const j=new Path2D;j.rect(F,H,q,X),B.clip(j),B.beginPath();const W=G/12;B.lineWidth=K*W;for(const $ of P.d.split(" ")){const V=$[0],J=S[V];if(!J){console.error(`Could not find drawing instructions for "${V}"`);continue}const re=$.substring(1).split(",");re[0]&&re[1]&&J(B,k(re,q,X,F,H,!1,K,(P.leftPadding??0)*(W/2),(P.rightPadding??0)*(W/2)))}P.type===1?(B.strokeStyle=B.fillStyle,B.stroke()):B.fill(),B.closePath()})(g,N,f,d,h,C,D,x),!0)};const u=new Map;function y(g,a,f=0){return Math.max(Math.min(g,a),f)}const S={C:(g,a)=>g.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]),L:(g,a)=>g.lineTo(a[0],a[1]),M:(g,a)=>g.moveTo(a[0],a[1])};function k(g,a,f,d,h,C,D,x=0,M=0){const b=g.map((L=>parseFloat(L)||parseInt(L)));if(b.length<2)throw new Error("Too few arguments for instruction");for(let L=0;L<b.length;L+=2)b[L]*=a-x*D-M*D,C&&b[L]!==0&&(b[L]=y(Math.round(b[L]+.5)-.5,a,0)),b[L]+=d+x*D;for(let L=1;L<b.length;L+=2)b[L]*=f,C&&b[L]!==0&&(b[L]=y(Math.round(b[L]+.5)-.5,f,0)),b[L]+=h;return b}},56:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const p=l(859);s.observeDevicePixelDimensions=function(v,u,y){let S=new u.ResizeObserver((k=>{const g=k.find((d=>d.target===v));if(!g)return;if(!("devicePixelContentBoxSize"in g))return S==null||S.disconnect(),void(S=void 0);const a=g.devicePixelContentBoxSize[0].inlineSize,f=g.devicePixelContentBoxSize[0].blockSize;a>0&&f>0&&y(a,f)}));try{S.observe(v,{box:["device-pixel-content-box"]})}catch{S.disconnect(),S=void 0}return(0,p.toDisposable)((()=>S==null?void 0:S.disconnect()))}},374:(T,s)=>{function l(v){return 57508<=v&&v<=57558}function p(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},s.isPowerlineGlyph=l,s.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},s.isEmoji=p,s.allowRescaling=function(v,u,y,S){return u===1&&y>Math.ceil(1.5*S)&&v!==void 0&&v>255&&!p(v)&&!l(v)&&!(function(k){return 57344<=k&&k<=63743})(v)},s.treatGlyphAsBackgroundColor=function(v){return l(v)||(function(u){return 9472<=u&&u<=9631})(v)},s.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}}}},s.computeNextVariantOffset=function(v,u,y=0){return(v-(2*Math.round(u)-y))%(2*Math.round(u))}},296:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.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(v,u,y,S=!1){if(this.selectionStart=u,this.selectionEnd=y,!u||!y||u[0]===y[0]&&u[1]===y[1])return void this.clear();const k=v.buffers.active.ydisp,g=u[1]-k,a=y[1]-k,f=Math.max(g,0),d=Math.min(a,v.rows-1);f>=v.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=g,this.viewportEndRow=a,this.viewportCappedStartRow=f,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=y[0])}isCellSelected(v,u,y){return!!this.hasSelection&&(y-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&y>=this.viewportCappedStartRow&&u<this.endCol&&y<=this.viewportCappedEndRow:u<this.startCol&&y>=this.viewportCappedStartRow&&u>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new l}},509:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const p=l(237),v=l(860),u=l(374),y=l(160),S=l(345),k=l(485),g=l(385),a=l(147),f=l(855),d={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let h;class C{get pages(){return this._pages}constructor(L,N,B){this._document=L,this._config=N,this._unicodeService=B,this._didWarmUp=!1,this._cacheMap=new k.FourKeyMap,this._cacheMapCombined=new k.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new a.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new S.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new S.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=M(L,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,u.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const L of this.pages)L.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const L=new g.IdleTaskQueue;for(let N=33;N<126;N++)L.enqueue((()=>{if(!this._cacheMap.get(N,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT)){const B=this._drawToCache(N,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT);this._cacheMap.set(N,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT,B)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const L of this._pages)L.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(C.maxAtlasPages&&this._pages.length>=Math.max(4,C.maxAtlasPages)){const N=this._pages.filter((G=>2*G.canvas.width<=(C.maxTextureSize||4096))).sort(((G,K)=>K.canvas.width!==G.canvas.width?K.canvas.width-G.canvas.width:K.percentageUsed-G.percentageUsed));let B=-1,P=0;for(let G=0;G<N.length;G++)if(N[G].canvas.width!==P)B=G,P=N[G].canvas.width;else if(G-B==3)break;const F=N.slice(B,B+4),H=F.map((G=>G.glyphs[0].texturePage)).sort(((G,K)=>G>K?1:-1)),q=this.pages.length-F.length,X=this._mergePages(F,q);X.version++;for(let G=H.length-1;G>=0;G--)this._deletePage(H[G]);this.pages.push(X),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(X.canvas)}const L=new D(this._document,this._textureSize);return this._pages.push(L),this._activePages.push(L),this._onAddTextureAtlasCanvas.fire(L.canvas),L}_mergePages(L,N){const B=2*L[0].canvas.width,P=new D(this._document,B,L);for(const[F,H]of L.entries()){const q=F*H.canvas.width%B,X=Math.floor(F/2)*H.canvas.height;P.ctx.drawImage(H.canvas,q,X);for(const K of H.glyphs)K.texturePage=N,K.sizeClipSpace.x=K.size.x/B,K.sizeClipSpace.y=K.size.y/B,K.texturePosition.x+=q,K.texturePosition.y+=X,K.texturePositionClipSpace.x=K.texturePosition.x/B,K.texturePositionClipSpace.y=K.texturePosition.y/B;this._onRemoveTextureAtlasCanvas.fire(H.canvas);const G=this._activePages.indexOf(H);G!==-1&&this._activePages.splice(G,1)}return P}_deletePage(L){this._pages.splice(L,1);for(let N=L;N<this._pages.length;N++){const B=this._pages[N];for(const P of B.glyphs)P.texturePage--;B.version++}}getRasterizedGlyphCombinedChar(L,N,B,P,F){return this._getFromCacheMap(this._cacheMapCombined,L,N,B,P,F)}getRasterizedGlyph(L,N,B,P,F){return this._getFromCacheMap(this._cacheMap,L,N,B,P,F)}_getFromCacheMap(L,N,B,P,F,H=!1){return h=L.get(N,B,P,F),h||(h=this._drawToCache(N,B,P,F,H),L.set(N,B,P,F,h)),h}_getColorFromAnsiIndex(L){if(L>=this._config.colors.ansi.length)throw new Error("No color found for idx "+L);return this._config.colors.ansi[L]}_getBackgroundColor(L,N,B,P){if(this._config.allowTransparency)return y.NULL_COLOR;let F;switch(L){case 16777216:case 33554432:F=this._getColorFromAnsiIndex(N);break;case 50331648:const H=a.AttributeData.toColorRGB(N);F=y.channels.toColor(H[0],H[1],H[2]);break;default:F=B?y.color.opaque(this._config.colors.foreground):this._config.colors.background}return F}_getForegroundColor(L,N,B,P,F,H,q,X,G,K){const j=this._getMinimumContrastColor(L,N,B,P,F,H,q,G,X,K);if(j)return j;let W;switch(F){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&G&&H<8&&(H+=8),W=this._getColorFromAnsiIndex(H);break;case 50331648:const $=a.AttributeData.toColorRGB(H);W=y.channels.toColor($[0],$[1],$[2]);break;default:W=q?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(W=y.color.opaque(W)),X&&(W=y.color.multiplyOpacity(W,p.DIM_OPACITY)),W}_resolveBackgroundRgba(L,N,B){switch(L){case 16777216:case 33554432:return this._getColorFromAnsiIndex(N).rgba;case 50331648:return N<<8;default:return B?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(L,N,B,P){switch(L){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&P&&N<8&&(N+=8),this._getColorFromAnsiIndex(N).rgba;case 50331648:return N<<8;default:return B?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(L,N,B,P,F,H,q,X,G,K){if(this._config.minimumContrastRatio===1||K)return;const j=this._getContrastCache(G),W=j.getColor(L,P);if(W!==void 0)return W||void 0;const $=this._resolveBackgroundRgba(N,B,q),V=this._resolveForegroundRgba(F,H,q,X),J=y.rgba.ensureContrastRatio($,V,this._config.minimumContrastRatio/(G?2:1));if(!J)return void j.setColor(L,P,null);const re=y.channels.toColor(J>>24&255,J>>16&255,J>>8&255);return j.setColor(L,P,re),re}_getContrastCache(L){return L?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(L,N,B,P,F=!1){const H=typeof L=="number"?String.fromCharCode(L):L,q=Math.min(this._config.deviceCellWidth*Math.max(H.length,2)+4,this._textureSize);this._tmpCanvas.width<q&&(this._tmpCanvas.width=q);const X=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<X&&(this._tmpCanvas.height=X),this._tmpCtx.save(),this._workAttributeData.fg=B,this._workAttributeData.bg=N,this._workAttributeData.extended.ext=P,this._workAttributeData.isInvisible())return d;const G=!!this._workAttributeData.isBold(),K=!!this._workAttributeData.isInverse(),j=!!this._workAttributeData.isDim(),W=!!this._workAttributeData.isItalic(),$=!!this._workAttributeData.isUnderline(),V=!!this._workAttributeData.isStrikethrough(),J=!!this._workAttributeData.isOverline();let re=this._workAttributeData.getFgColor(),ie=this._workAttributeData.getFgColorMode(),he=this._workAttributeData.getBgColor(),Y=this._workAttributeData.getBgColorMode();if(K){const ke=re;re=he,he=ke;const Fe=ie;ie=Y,Y=Fe}const U=this._getBackgroundColor(Y,he,K,j);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=U.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const Z=G?this._config.fontWeightBold:this._config.fontWeight,ee=W?"italic":"";this._tmpCtx.font=`${ee} ${Z} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=p.TEXT_BASELINE;const pe=H.length===1&&(0,u.isPowerlineGlyph)(H.charCodeAt(0)),ne=H.length===1&&(0,u.isRestrictedPowerlineGlyph)(H.charCodeAt(0)),Ee=this._getForegroundColor(N,Y,he,B,ie,re,K,j,G,(0,u.treatGlyphAsBackgroundColor)(H.charCodeAt(0)));this._tmpCtx.fillStyle=Ee.css;const xe=ne?0:4;let ce=!1;this._config.customGlyphs!==!1&&(ce=(0,v.tryDrawCustomChar)(this._tmpCtx,H,xe,xe,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Se,me=!pe;if(Se=typeof L=="number"?this._unicodeService.wcwidth(L):this._unicodeService.getStringCellWidth(L),$){this._tmpCtx.save();const ke=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Fe=ke%2==1?.5:0;if(this._tmpCtx.lineWidth=ke,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())me=!1,this._tmpCtx.strokeStyle=`rgb(${a.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{me=!1;let nt=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&nt<8&&(nt+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(nt).css}this._tmpCtx.beginPath();const $e=xe,tt=Math.ceil(xe+this._config.deviceCharHeight)-Fe-(F?2*ke:0),St=tt+ke,Ke=tt+2*ke;let gt=this._workAttributeData.getUnderlineVariantOffset();for(let nt=0;nt<Se;nt++){this._tmpCtx.save();const ze=$e+nt*this._config.deviceCellWidth,Ge=$e+(nt+1)*this._config.deviceCellWidth,Et=ze+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ze,tt),this._tmpCtx.lineTo(Ge,tt),this._tmpCtx.moveTo(ze,Ke),this._tmpCtx.lineTo(Ge,Ke);break;case 3:const Ct=ke<=1?Ke:Math.ceil(xe+this._config.deviceCharHeight-ke/2)-Fe,Le=ke<=1?tt:Math.ceil(xe+this._config.deviceCharHeight+ke/2)-Fe,Ve=new Path2D;Ve.rect(ze,tt,this._config.deviceCellWidth,Ke-tt),this._tmpCtx.clip(Ve),this._tmpCtx.moveTo(ze-this._config.deviceCellWidth/2,St),this._tmpCtx.bezierCurveTo(ze-this._config.deviceCellWidth/2,Le,ze,Le,ze,St),this._tmpCtx.bezierCurveTo(ze,Ct,Et,Ct,Et,St),this._tmpCtx.bezierCurveTo(Et,Le,Ge,Le,Ge,St),this._tmpCtx.bezierCurveTo(Ge,Ct,Ge+this._config.deviceCellWidth/2,Ct,Ge+this._config.deviceCellWidth/2,St);break;case 4:const de=gt===0?0:gt>=ke?2*ke-gt:ke-gt;gt>=ke||de===0?(this._tmpCtx.setLineDash([Math.round(ke),Math.round(ke)]),this._tmpCtx.moveTo(ze+de,tt),this._tmpCtx.lineTo(Ge,tt)):(this._tmpCtx.setLineDash([Math.round(ke),Math.round(ke)]),this._tmpCtx.moveTo(ze,tt),this._tmpCtx.lineTo(ze+de,tt),this._tmpCtx.moveTo(ze+de+ke,tt),this._tmpCtx.lineTo(Ge,tt)),gt=(0,u.computeNextVariantOffset)(Ge-ze,ke,gt);break;case 5:const fe=.6,Te=.3,ot=Ge-ze,Pe=Math.floor(fe*ot),Ye=Math.floor(Te*ot),lt=ot-Pe-Ye;this._tmpCtx.setLineDash([Pe,Ye,lt]),this._tmpCtx.moveTo(ze,tt),this._tmpCtx.lineTo(Ge,tt);break;default:this._tmpCtx.moveTo(ze,tt),this._tmpCtx.lineTo(Ge,tt)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!ce&&this._config.fontSize>=12&&!this._config.allowTransparency&&H!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const nt=this._tmpCtx.measureText(H);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in nt&&nt.actualBoundingBoxDescent>0){this._tmpCtx.save();const ze=new Path2D;ze.rect($e,tt-Math.ceil(ke/2),this._config.deviceCellWidth*Se,Ke-tt+Math.ceil(ke/2)),this._tmpCtx.clip(ze),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=U.css,this._tmpCtx.strokeText(H,xe,xe+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(J){const ke=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Fe=ke%2==1?.5:0;this._tmpCtx.lineWidth=ke,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(xe,xe+Fe),this._tmpCtx.lineTo(xe+this._config.deviceCharWidth*Se,xe+Fe),this._tmpCtx.stroke()}if(ce||this._tmpCtx.fillText(H,xe,xe+this._config.deviceCharHeight),H==="_"&&!this._config.allowTransparency){let ke=x(this._tmpCtx.getImageData(xe,xe,this._config.deviceCellWidth,this._config.deviceCellHeight),U,Ee,me);if(ke)for(let Fe=1;Fe<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=U.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(H,xe,xe+this._config.deviceCharHeight-Fe),ke=x(this._tmpCtx.getImageData(xe,xe,this._config.deviceCellWidth,this._config.deviceCellHeight),U,Ee,me),ke);Fe++);}if(V){const ke=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Fe=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ke,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(xe,xe+Math.floor(this._config.deviceCharHeight/2)-Fe),this._tmpCtx.lineTo(xe+this._config.deviceCharWidth*Se,xe+Math.floor(this._config.deviceCharHeight/2)-Fe),this._tmpCtx.stroke()}this._tmpCtx.restore();const Ze=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let qe;if(qe=this._config.allowTransparency?(function(ke){for(let Fe=0;Fe<ke.data.length;Fe+=4)if(ke.data[Fe+3]>0)return!1;return!0})(Ze):x(Ze,U,Ee,me),qe)return d;const ve=this._findGlyphBoundingBox(Ze,this._workBoundingBox,q,ne,ce,xe);let Re,Ie;for(;;){if(this._activePages.length===0){const ke=this._createNewPage();Re=ke,Ie=ke.currentRow,Ie.height=ve.size.y;break}Re=this._activePages[this._activePages.length-1],Ie=Re.currentRow;for(const ke of this._activePages)ve.size.y<=ke.currentRow.height&&(Re=ke,Ie=ke.currentRow);for(let ke=this._activePages.length-1;ke>=0;ke--)for(const Fe of this._activePages[ke].fixedRows)Fe.height<=Ie.height&&ve.size.y<=Fe.height&&(Re=this._activePages[ke],Ie=Fe);if(Ie.y+ve.size.y>=Re.canvas.height||Ie.height>ve.size.y+2){let ke=!1;if(Re.currentRow.y+Re.currentRow.height+ve.size.y>=Re.canvas.height){let Fe;for(const $e of this._activePages)if($e.currentRow.y+$e.currentRow.height+ve.size.y<$e.canvas.height){Fe=$e;break}if(Fe)Re=Fe;else if(C.maxAtlasPages&&this._pages.length>=C.maxAtlasPages&&Ie.y+ve.size.y<=Re.canvas.height&&Ie.height>=ve.size.y&&Ie.x+ve.size.x<=Re.canvas.width)ke=!0;else{const $e=this._createNewPage();Re=$e,Ie=$e.currentRow,Ie.height=ve.size.y,ke=!0}}ke||(Re.currentRow.height>0&&Re.fixedRows.push(Re.currentRow),Ie={x:0,y:Re.currentRow.y+Re.currentRow.height,height:ve.size.y},Re.fixedRows.push(Ie),Re.currentRow={x:0,y:Ie.y+Ie.height,height:0})}if(Ie.x+ve.size.x<=Re.canvas.width)break;Ie===Re.currentRow?(Ie.x=0,Ie.y+=Ie.height,Ie.height=0):Re.fixedRows.splice(Re.fixedRows.indexOf(Ie),1)}return ve.texturePage=this._pages.indexOf(Re),ve.texturePosition.x=Ie.x,ve.texturePosition.y=Ie.y,ve.texturePositionClipSpace.x=Ie.x/Re.canvas.width,ve.texturePositionClipSpace.y=Ie.y/Re.canvas.height,ve.sizeClipSpace.x/=Re.canvas.width,ve.sizeClipSpace.y/=Re.canvas.height,Ie.height=Math.max(Ie.height,ve.size.y),Ie.x+=ve.size.x,Re.ctx.putImageData(Ze,ve.texturePosition.x-this._workBoundingBox.left,ve.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,ve.size.x,ve.size.y),Re.addGlyph(ve),Re.version++,ve}_findGlyphBoundingBox(L,N,B,P,F,H){N.top=0;const q=P?this._config.deviceCellHeight:this._tmpCanvas.height,X=P?this._config.deviceCellWidth:B;let G=!1;for(let K=0;K<q;K++){for(let j=0;j<X;j++){const W=K*this._tmpCanvas.width*4+4*j+3;if(L.data[W]!==0){N.top=K,G=!0;break}}if(G)break}N.left=0,G=!1;for(let K=0;K<H+X;K++){for(let j=0;j<q;j++){const W=j*this._tmpCanvas.width*4+4*K+3;if(L.data[W]!==0){N.left=K,G=!0;break}}if(G)break}N.right=X,G=!1;for(let K=H+X-1;K>=H;K--){for(let j=0;j<q;j++){const W=j*this._tmpCanvas.width*4+4*K+3;if(L.data[W]!==0){N.right=K,G=!0;break}}if(G)break}N.bottom=q,G=!1;for(let K=q-1;K>=0;K--){for(let j=0;j<X;j++){const W=K*this._tmpCanvas.width*4+4*j+3;if(L.data[W]!==0){N.bottom=K,G=!0;break}}if(G)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:N.right-N.left+1,y:N.bottom-N.top+1},sizeClipSpace:{x:N.right-N.left+1,y:N.bottom-N.top+1},offset:{x:-N.left+H+(P||F?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-N.top+H+(P||F?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=C;class D{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(L){this._glyphs.push(L),this._usedPixels+=L.size.x*L.size.y}constructor(L,N,B){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],B)for(const P of B)this._glyphs.push(...P.glyphs),this._usedPixels+=P._usedPixels;this.canvas=M(L,N,N),this.ctx=(0,u.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function x(b,L,N,B){const P=L.rgba>>>24,F=L.rgba>>>16&255,H=L.rgba>>>8&255,q=N.rgba>>>24,X=N.rgba>>>16&255,G=N.rgba>>>8&255,K=Math.floor((Math.abs(P-q)+Math.abs(F-X)+Math.abs(H-G))/12);let j=!0;for(let W=0;W<b.data.length;W+=4)b.data[W]===P&&b.data[W+1]===F&&b.data[W+2]===H||B&&Math.abs(b.data[W]-P)+Math.abs(b.data[W+1]-F)+Math.abs(b.data[W+2]-H)<K?b.data[W+3]=0:j=!1;return j}function M(b,L,N){const B=b.createElement("canvas");return B.width=L,B.height=N,B}},160:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let l=0,p=0,v=0,u=0;var y,S,k,g,a;function f(h){const C=h.toString(16);return C.length<2?"0"+C:C}function d(h,C){return h<C?(C+.05)/(h+.05):(h+.05)/(C+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(C,D,x,M){return M!==void 0?`#${f(C)}${f(D)}${f(x)}${f(M)}`:`#${f(C)}${f(D)}${f(x)}`},h.toRgba=function(C,D,x,M=255){return(C<<24|D<<16|x<<8|M)>>>0},h.toColor=function(C,D,x,M){return{css:h.toCss(C,D,x,M),rgba:h.toRgba(C,D,x,M)}}})(y||(s.channels=y={})),(function(h){function C(D,x){return u=Math.round(255*x),[l,p,v]=a.toChannels(D.rgba),{css:y.toCss(l,p,v,u),rgba:y.toRgba(l,p,v,u)}}h.blend=function(D,x){if(u=(255&x.rgba)/255,u===1)return{css:x.css,rgba:x.rgba};const M=x.rgba>>24&255,b=x.rgba>>16&255,L=x.rgba>>8&255,N=D.rgba>>24&255,B=D.rgba>>16&255,P=D.rgba>>8&255;return l=N+Math.round((M-N)*u),p=B+Math.round((b-B)*u),v=P+Math.round((L-P)*u),{css:y.toCss(l,p,v),rgba:y.toRgba(l,p,v)}},h.isOpaque=function(D){return(255&D.rgba)==255},h.ensureContrastRatio=function(D,x,M){const b=a.ensureContrastRatio(D.rgba,x.rgba,M);if(b)return y.toColor(b>>24&255,b>>16&255,b>>8&255)},h.opaque=function(D){const x=(255|D.rgba)>>>0;return[l,p,v]=a.toChannels(x),{css:y.toCss(l,p,v),rgba:x}},h.opacity=C,h.multiplyOpacity=function(D,x){return u=255&D.rgba,C(D,u*x/255)},h.toColorRGB=function(D){return[D.rgba>>24&255,D.rgba>>16&255,D.rgba>>8&255]}})(S||(s.color=S={})),(function(h){let C,D;try{const x=document.createElement("canvas");x.width=1,x.height=1;const M=x.getContext("2d",{willReadFrequently:!0});M&&(C=M,C.globalCompositeOperation="copy",D=C.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return l=parseInt(x.slice(1,2).repeat(2),16),p=parseInt(x.slice(2,3).repeat(2),16),v=parseInt(x.slice(3,4).repeat(2),16),y.toColor(l,p,v);case 5:return l=parseInt(x.slice(1,2).repeat(2),16),p=parseInt(x.slice(2,3).repeat(2),16),v=parseInt(x.slice(3,4).repeat(2),16),u=parseInt(x.slice(4,5).repeat(2),16),y.toColor(l,p,v,u);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const M=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return l=parseInt(M[1]),p=parseInt(M[2]),v=parseInt(M[3]),u=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),y.toColor(l,p,v,u);if(!C||!D)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=D,C.fillStyle=x,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[l,p,v,u]=C.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(l,p,v,u),css:x}}})(k||(s.css=k={})),(function(h){function C(D,x,M){const b=D/255,L=x/255,N=M/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))}h.relativeLuminance=function(D){return C(D>>16&255,D>>8&255,255&D)},h.relativeLuminance2=C})(g||(s.rgb=g={})),(function(h){function C(x,M,b){const L=x>>24&255,N=x>>16&255,B=x>>8&255;let P=M>>24&255,F=M>>16&255,H=M>>8&255,q=d(g.relativeLuminance2(P,F,H),g.relativeLuminance2(L,N,B));for(;q<b&&(P>0||F>0||H>0);)P-=Math.max(0,Math.ceil(.1*P)),F-=Math.max(0,Math.ceil(.1*F)),H-=Math.max(0,Math.ceil(.1*H)),q=d(g.relativeLuminance2(P,F,H),g.relativeLuminance2(L,N,B));return(P<<24|F<<16|H<<8|255)>>>0}function D(x,M,b){const L=x>>24&255,N=x>>16&255,B=x>>8&255;let P=M>>24&255,F=M>>16&255,H=M>>8&255,q=d(g.relativeLuminance2(P,F,H),g.relativeLuminance2(L,N,B));for(;q<b&&(P<255||F<255||H<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),F=Math.min(255,F+Math.ceil(.1*(255-F))),H=Math.min(255,H+Math.ceil(.1*(255-H))),q=d(g.relativeLuminance2(P,F,H),g.relativeLuminance2(L,N,B));return(P<<24|F<<16|H<<8|255)>>>0}h.blend=function(x,M){if(u=(255&M)/255,u===1)return M;const b=M>>24&255,L=M>>16&255,N=M>>8&255,B=x>>24&255,P=x>>16&255,F=x>>8&255;return l=B+Math.round((b-B)*u),p=P+Math.round((L-P)*u),v=F+Math.round((N-F)*u),y.toRgba(l,p,v)},h.ensureContrastRatio=function(x,M,b){const L=g.relativeLuminance(x>>8),N=g.relativeLuminance(M>>8);if(d(L,N)<b){if(N<L){const F=C(x,M,b),H=d(L,g.relativeLuminance(F>>8));if(H<b){const q=D(x,M,b);return H>d(L,g.relativeLuminance(q>>8))?F:q}return F}const B=D(x,M,b),P=d(L,g.relativeLuminance(B>>8));if(P<b){const F=C(x,M,b);return P>d(L,g.relativeLuminance(F>>8))?B:F}return B}},h.reduceLuminance=C,h.increaseLuminance=D,h.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}})(a||(s.rgba=a={})),s.toPaddedHex=f,s.contrastRatio=d},345:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.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 p=0;p<this._listeners.length;p++)if(this._listeners[p]===l)return void this._listeners.splice(p,1)}}})),this._event}fire(l,p){const v=[];for(let u=0;u<this._listeners.length;u++)v.push(this._listeners[u]);for(let u=0;u<v.length;u++)v[u].call(void 0,l,p)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(l,p){return l((v=>p.fire(v)))},s.runAndSubscribe=function(l,p){return p(void 0),l((v=>p(v)))}},859:(T,s)=>{function l(p){for(const v of p)v.dispose();p.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const p of this._disposables)p.dispose();this._disposables.length=0}register(p){return this._disposables.push(p),p}unregister(p){const v=this._disposables.indexOf(p);v!==-1&&this._disposables.splice(v,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(p){var v;this._isDisposed||p===this._value||((v=this._value)==null||v.dispose(),this._value=p)}clear(){this.value=void 0}dispose(){var p;this._isDisposed=!0,(p=this._value)==null||p.dispose(),this._value=void 0}},s.toDisposable=function(p){return{dispose:p}},s.disposeArray=l,s.getDisposeArrayDisposable=function(p){return{dispose:()=>l(p)}}},485:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(v,u,y){this._data[v]||(this._data[v]={}),this._data[v][u]=y}get(v,u){return this._data[v]?this._data[v][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=l,s.FourKeyMap=class{constructor(){this._data=new l}set(p,v,u,y,S){this._data.get(p,v)||this._data.set(p,v,new l),this._data.get(p,v).set(u,y,S)}get(p,v,u,y){var S;return(S=this._data.get(p,v))==null?void 0:S.get(u,y)}clear(){this._data.clear()}}},399:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const l=s.isNode?"node":navigator.userAgent,p=s.isNode?"node":navigator.platform;s.isFirefox=l.includes("Firefox"),s.isLegacyEdge=l.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(l),s.getSafariVersion=function(){if(!s.isSafari)return 0;const v=l.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(p),s.isIpad=p==="iPad",s.isIphone=p==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(p),s.isLinux=p.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(l)},385:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const p=l(399);class v{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let k=0,g=0,a=S.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),g=Math.max(k,g),f=S.timeRemaining(),1.5*g>f)return a-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-k))}ms`),void this._start();a=f}this.clear()}}class u extends v{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const k=Date.now()+S;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!p.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},147:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new p}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}}s.AttributeData=l;class p{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,y=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=y}clone(){return new p(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=p},782:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const p=l(133),v=l(855),u=l(147);class y extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const g=new y;return g.setFromCharData(k),g}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,p.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let g=!1;if(k[v.CHAR_DATA_CHAR_INDEX].length>2)g=!0;else if(k[v.CHAR_DATA_CHAR_INDEX].length===2){const a=k[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const f=k[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(a-55296)+f-56320+65536|k[v.CHAR_DATA_WIDTH_INDEX]<<22:g=!0}else g=!0}else this.content=k[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[v.CHAR_DATA_WIDTH_INDEX]<<22;g&&(this.combinedData=k[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=y},855:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},s.utf32ToString=function(l,p=0,v=l.length){let u="";for(let y=p;y<v;++y){let S=l[y];S>65535?(S-=65536,u+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):u+=String.fromCharCode(S)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,p){const v=l.length;if(!v)return 0;let u=0,y=0;if(this._interim){const S=l.charCodeAt(y++);56320<=S&&S<=57343?p[u++]=1024*(this._interim-55296)+S-56320+65536:(p[u++]=this._interim,p[u++]=S),this._interim=0}for(let S=y;S<v;++S){const k=l.charCodeAt(S);if(55296<=k&&k<=56319){if(++S>=v)return this._interim=k,u;const g=l.charCodeAt(S);56320<=g&&g<=57343?p[u++]=1024*(k-55296)+g-56320+65536:(p[u++]=k,p[u++]=g)}else k!==65279&&(p[u++]=k)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,p){const v=l.length;if(!v)return 0;let u,y,S,k,g=0,a=0,f=0;if(this.interim[0]){let C=!1,D=this.interim[0];D&=(224&D)==192?31:(240&D)==224?15:7;let x,M=0;for(;(x=63&this.interim[++M])&&M<4;)D<<=6,D|=x;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=b-M;for(;f<L;){if(f>=v)return 0;if(x=l[f++],(192&x)!=128){f--,C=!0;break}this.interim[M++]=x,D<<=6,D|=63&x}C||(b===2?D<128?f--:p[g++]=D:b===3?D<2048||D>=55296&&D<=57343||D===65279||(p[g++]=D):D<65536||D>1114111||(p[g++]=D)),this.interim.fill(0)}const d=v-4;let h=f;for(;h<v;){for(;!(!(h<d)||128&(u=l[h])||128&(y=l[h+1])||128&(S=l[h+2])||128&(k=l[h+3]));)p[g++]=u,p[g++]=y,p[g++]=S,p[g++]=k,h+=4;if(u=l[h++],u<128)p[g++]=u;else if((224&u)==192){if(h>=v)return this.interim[0]=u,g;if(y=l[h++],(192&y)!=128){h--;continue}if(a=(31&u)<<6|63&y,a<128){h--;continue}p[g++]=a}else if((240&u)==224){if(h>=v)return this.interim[0]=u,g;if(y=l[h++],(192&y)!=128){h--;continue}if(h>=v)return this.interim[0]=u,this.interim[1]=y,g;if(S=l[h++],(192&S)!=128){h--;continue}if(a=(15&u)<<12|(63&y)<<6|63&S,a<2048||a>=55296&&a<=57343||a===65279)continue;p[g++]=a}else if((248&u)==240){if(h>=v)return this.interim[0]=u,g;if(y=l[h++],(192&y)!=128){h--;continue}if(h>=v)return this.interim[0]=u,this.interim[1]=y,g;if(S=l[h++],(192&S)!=128){h--;continue}if(h>=v)return this.interim[0]=u,this.interim[1]=y,this.interim[2]=S,g;if(k=l[h++],(192&k)!=128){h--;continue}if(a=(7&u)<<18|(63&y)<<12|(63&S)<<6|63&k,a<65536||a>1114111)continue;p[g++]=a}}return g}}},776:function(T,s,l){var p=this&&this.__decorate||function(a,f,d,h){var C,D=arguments.length,x=D<3?f:h===null?h=Object.getOwnPropertyDescriptor(f,d):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,f,d,h);else for(var M=a.length-1;M>=0;M--)(C=a[M])&&(x=(D<3?C(x):D>3?C(f,d,x):C(f,d))||x);return D>3&&x&&Object.defineProperty(f,d,x),x},v=this&&this.__param||function(a,f){return function(d,h){f(d,h,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=l(859),y=l(97),S={trace:y.LogLevelEnum.TRACE,debug:y.LogLevelEnum.DEBUG,info:y.LogLevelEnum.INFO,warn:y.LogLevelEnum.WARN,error:y.LogLevelEnum.ERROR,off:y.LogLevelEnum.OFF};let k,g=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let f=0;f<a.length;f++)typeof a[f]=="function"&&(a[f]=a[f]())}_log(a,f,d){this._evalLazyOptionalParams(d),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...d)}trace(a,...f){var d;this._logLevel<=y.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,a,f)}debug(a,...f){var d;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,a,f)}info(a,...f){var d;this._logLevel<=y.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,a,f)}warn(a,...f){var d;this._logLevel<=y.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,a,f)}error(a,...f){var d;this._logLevel<=y.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,a,f)}};s.LogService=g=p([v(0,y.IOptionsService)],g),s.setTraceLogger=function(a){k=a},s.traceCall=function(a,f,d){if(typeof d.value!="function")throw new Error("not supported");const h=d.value;d.value=function(...C){if(k.logLevel!==y.LogLevelEnum.TRACE)return h.apply(this,C);k.trace(`GlyphRenderer#${h.name}(${C.map((x=>JSON.stringify(x))).join(", ")})`);const D=h.apply(this,C);return k.trace(`GlyphRenderer#${h.name} return`,D),D}}},726:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const l="di$target",p="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(v){return v[p]||[]},s.createDecorator=function(v){if(s.serviceRegistry.has(v))return s.serviceRegistry.get(v);const u=function(y,S,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(g,a,f){a[l]===a?a[p].push({id:g,index:f}):(a[p]=[{id:g,index:f}],a[l]=a)})(u,y,k)};return u.toString=()=>v,s.serviceRegistry.set(v,u),u}},97:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const p=l(726);var v;s.IBufferService=(0,p.createDecorator)("BufferService"),s.ICoreMouseService=(0,p.createDecorator)("CoreMouseService"),s.ICoreService=(0,p.createDecorator)("CoreService"),s.ICharsetService=(0,p.createDecorator)("CharsetService"),s.IInstantiationService=(0,p.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(v||(s.LogLevelEnum=v={})),s.ILogService=(0,p.createDecorator)("LogService"),s.IOptionsService=(0,p.createDecorator)("OptionsService"),s.IOscLinkService=(0,p.createDecorator)("OscLinkService"),s.IUnicodeService=(0,p.createDecorator)("UnicodeService"),s.IDecorationService=(0,p.createDecorator)("DecorationService")}},m={};function w(T){var s=m[T];if(s!==void 0)return s.exports;var l=m[T]={exports:{}};return o[T].call(l.exports,l,l.exports,w),l.exports}var A={};return(()=>{var T=A;Object.defineProperty(T,"__esModule",{value:!0}),T.WebglAddon=void 0;const s=w(345),l=w(859),p=w(399),v=w(666),u=w(776);class y extends l.Disposable{constructor(k){if(p.isSafari&&(0,p.getSafariVersion)()<16){const g={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",g))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=k,this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new s.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new s.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(k){const g=k._core;if(!k.element)return void this.register(g.onWillOpen((()=>this.activate(k))));this._terminal=k;const a=g.coreService,f=g.optionsService,d=g,h=d._renderService,C=d._characterJoinerService,D=d._charSizeService,x=d._coreBrowserService,M=d._decorationService,b=d._logService,L=d._themeService;(0,u.setTraceLogger)(b),this._renderer=this.register(new v.WebglRenderer(k,C,D,x,a,M,f,L,this._preserveDrawingBuffer)),this.register((0,s.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,s.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),h.setRenderer(this._renderer),this.register((0,l.toDisposable)((()=>{const N=this._terminal._core._renderService;N.setRenderer(this._terminal._core._createRenderer()),N.handleResize(k.cols,k.rows)})))}get textureAtlas(){var k;return(k=this._renderer)==null?void 0:k.textureAtlas}clearTextureAtlas(){var k;(k=this._renderer)==null||k.clearTextureAtlas()}}T.WebglAddon=y})(),A})()))})(lc)),lc.exports}var Lw=Ew(),cc={exports:{}},Qd;function Tw(){return Qd||(Qd=1,(function(n,r){(function(o,m){n.exports=m()})(globalThis,(()=>(()=>{var o={4567:function(T,s,l){var p=this&&this.__decorate||function(d,h,C,D){var x,M=arguments.length,b=M<3?h:D===null?D=Object.getOwnPropertyDescriptor(h,C):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(d,h,C,D);else for(var L=d.length-1;L>=0;L--)(x=d[L])&&(b=(M<3?x(b):M>3?x(h,C,b):x(h,C))||b);return M>3&&b&&Object.defineProperty(h,C,b),b},v=this&&this.__param||function(d,h){return function(C,D){h(C,D,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const u=l(9042),y=l(9924),S=l(844),k=l(4725),g=l(2585),a=l(3656);let f=s.AccessibilityManager=class extends S.Disposable{constructor(d,h,C,D){super(),this._terminal=d,this._coreBrowserService=C,this._renderService=D,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 x=0;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);if(this._topBoundaryFocusListener=x=>this._handleBoundaryFocus(x,0),this._bottomBoundaryFocusListener=x=>this._handleBoundaryFocus(x,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 y.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((x=>this._handleResize(x.rows)))),this.register(this._terminal.onRender((x=>this._refreshRows(x.start,x.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((x=>this._handleChar(x)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
109
|
-
`)))),this.register(this._terminal.onA11yTab((x=>this._handleTab(x)))),this.register(this._terminal.onKey((x=>this._handleKey(x.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,a.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(d){for(let h=0;h<d;h++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
|
|
110
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,h){this._liveRegionDebouncer.refresh(d,h,this._terminal.rows)}_renderRows(d,h){const C=this._terminal.buffer,D=C.lines.length.toString();for(let x=d;x<=h;x++){const M=C.lines.get(C.ydisp+x),b=[],L=(M==null?void 0:M.translateToString(!0,void 0,void 0,b))||"",N=(C.ydisp+x+1).toString(),B=this._rowElements[x];B&&(L.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=L,this._rowColumns.set(B,b)),B.setAttribute("aria-posinset",N),B.setAttribute("aria-setsize",D))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,h){const C=d.target,D=this._rowElements[h===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(h===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==D)return;let x,M;if(h===0?(x=C,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(x=this._rowElements.shift(),M=C,this._rowContainer.removeChild(x)),x.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),h===0){const b=this._createAccessibilityTreeNode();this._rowElements.unshift(b),this._rowContainer.insertAdjacentElement("afterbegin",b)}else{const b=this._createAccessibilityTreeNode();this._rowElements.push(b),this._rowContainer.appendChild(b)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(h===0?-1:1),this._rowElements[h===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var L;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let h={node:d.anchorNode,offset:d.anchorOffset},C={node:d.focusNode,offset:d.focusOffset};if((h.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||h.node===C.node&&h.offset>C.offset)&&([h,C]=[C,h]),h.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(h={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(h.node))return;const D=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(D)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:D,offset:((L=D.textContent)==null?void 0:L.length)??0}),!this._rowContainer.contains(C.node))return;const x=({node:N,offset:B})=>{const P=N instanceof Text?N.parentNode:N;let F=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get(P);if(!H)return console.warn("columns is null. Race condition?"),null;let q=B<H.length?H[B]:H.slice(-1)[0]+1;return q>=this._terminal.cols&&(++F,q=0),{row:F,column:q}},M=x(h),b=x(C);if(M&&b){if(M.row>b.row||M.row===b.row&&M.column>=b.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(b.row-M.row)*this._terminal.cols-M.column+b.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let h=this._rowContainer.children.length;h<this._terminal.rows;h++)this._rowElements[h]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[h]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=f=p([v(1,g.IInstantiationService),v(2,k.ICoreBrowserService),v(3,k.IRenderService)],f)},3614:(T,s)=>{function l(y){return y.replace(/\r?\n/g,"\r")}function p(y,S){return S?"\x1B[200~"+y+"\x1B[201~":y}function v(y,S,k,g){y=p(y=l(y),k.decPrivateModes.bracketedPasteMode&&g.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(y,!0),S.value=""}function u(y,S,k){const g=k.getBoundingClientRect(),a=y.clientX-g.left-10,f=y.clientY-g.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${a}px`,S.style.top=`${f}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=l,s.bracketTextForPaste=p,s.copyHandler=function(y,S){y.clipboardData&&y.clipboardData.setData("text/plain",S.selectionText),y.preventDefault()},s.handlePasteEvent=function(y,S,k,g){y.stopPropagation(),y.clipboardData&&v(y.clipboardData.getData("text/plain"),S,k,g)},s.paste=v,s.moveTextAreaUnderMouseCursor=u,s.rightClickHandler=function(y,S,k,g,a){u(y,S,k),a&&g.rightClickSelect(y),S.value=g.selectionText,S.select()}},7239:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const p=l(1505);s.ColorContrastCache=class{constructor(){this._color=new p.TwoKeyMap,this._css=new p.TwoKeyMap}setCss(v,u,y){this._css.set(v,u,y)}getCss(v,u){return this._css.get(v,u)}setColor(v,u,y){this._color.set(v,u,y)}getColor(v,u){return this._color.get(v,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(l,p,v,u){l.addEventListener(p,v,u);let y=!1;return{dispose:()=>{y||(y=!0,l.removeEventListener(p,v,u))}}}},3551:function(T,s,l){var p=this&&this.__decorate||function(f,d,h,C){var D,x=arguments.length,M=x<3?d:C===null?C=Object.getOwnPropertyDescriptor(d,h):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(f,d,h,C);else for(var b=f.length-1;b>=0;b--)(D=f[b])&&(M=(x<3?D(M):x>3?D(d,h,M):D(d,h))||M);return x>3&&M&&Object.defineProperty(d,h,M),M},v=this&&this.__param||function(f,d){return function(h,C){d(h,C,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const u=l(3656),y=l(8460),S=l(844),k=l(2585),g=l(4725);let a=s.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(f,d,h,C,D){super(),this._element=f,this._mouseService=d,this._renderService=h,this._bufferService=C,this._linkProviderService=D,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new y.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new y.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var x;this._lastMouseEvent=void 0,(x=this._activeProviderReplies)==null||x.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(f){this._lastMouseEvent=f;const d=this._positionFromMouseEvent(f,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const h=f.composedPath();for(let C=0;C<h.length;C++){const D=h[C];if(D.classList.contains("xterm"))break;if(D.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_handleHover(f){if(this._activeLine!==f.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(f,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,f)||(this._clearCurrentLink(),this._askForLink(f,!0))}_askForLink(f,d){var C,D;this._activeProviderReplies&&d||((C=this._activeProviderReplies)==null||C.forEach((x=>{x==null||x.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=f.y);let h=!1;for(const[x,M]of this._linkProviderService.linkProviders.entries())d?(D=this._activeProviderReplies)!=null&&D.get(x)&&(h=this._checkLinkProviderResult(x,f,h)):M.provideLinks(f.y,(b=>{var N,B;if(this._isMouseOut)return;const L=b==null?void 0:b.map((P=>({link:P})));(N=this._activeProviderReplies)==null||N.set(x,L),h=this._checkLinkProviderResult(x,f,h),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(f.y,this._activeProviderReplies)}))}_removeIntersectingLinks(f,d){const h=new Set;for(let C=0;C<d.size;C++){const D=d.get(C);if(D)for(let x=0;x<D.length;x++){const M=D[x],b=M.link.range.start.y<f?0:M.link.range.start.x,L=M.link.range.end.y>f?this._bufferService.cols:M.link.range.end.x;for(let N=b;N<=L;N++){if(h.has(N)){D.splice(x--,1);break}h.add(N)}}}}_checkLinkProviderResult(f,d,h){var x;if(!this._activeProviderReplies)return h;const C=this._activeProviderReplies.get(f);let D=!1;for(let M=0;M<f;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(D=!0);if(!D&&C){const M=C.find((b=>this._linkAtPosition(b.link,d)));M&&(h=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!h)for(let M=0;M<this._activeProviderReplies.size;M++){const b=(x=this._activeProviderReplies.get(M))==null?void 0:x.find((L=>this._linkAtPosition(L.link,d)));if(b){h=!0,this._handleNewLink(b);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(f){if(!this._currentLink)return;const d=this._positionFromMouseEvent(f,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(f,this._currentLink.link.text)}_clearCurrentLink(f,d){this._currentLink&&this._lastMouseEvent&&(!f||!d||this._currentLink.link.range.start.y>=f&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(f){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(f.link,d)&&(this._currentLink=f,this._currentLink.state={decorations:{underline:f.link.decorations===void 0||f.link.decorations.underline,pointerCursor:f.link.decorations===void 0||f.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,f.link,this._lastMouseEvent),f.link.decorations={},Object.defineProperties(f.link.decorations,{pointerCursor:{get:()=>{var h,C;return(C=(h=this._currentLink)==null?void 0:h.state)==null?void 0:C.decorations.pointerCursor},set:h=>{var C;(C=this._currentLink)!=null&&C.state&&this._currentLink.state.decorations.pointerCursor!==h&&(this._currentLink.state.decorations.pointerCursor=h,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",h))}},underline:{get:()=>{var h,C;return(C=(h=this._currentLink)==null?void 0:h.state)==null?void 0:C.decorations.underline},set:h=>{var C,D,x;(C=this._currentLink)!=null&&C.state&&((x=(D=this._currentLink)==null?void 0:D.state)==null?void 0:x.decorations.underline)!==h&&(this._currentLink.state.decorations.underline=h,this._currentLink.state.isHovered&&this._fireUnderlineEvent(f.link,h))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((h=>{if(!this._currentLink)return;const C=h.start===0?0:h.start+1+this._bufferService.buffer.ydisp,D=this._bufferService.buffer.ydisp+1+h.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=D&&(this._clearCurrentLink(C,D),this._lastMouseEvent)){const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._askForLink(x,!1)}}))))}_linkHover(f,d,h){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&f.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(h,d.text)}_fireUnderlineEvent(f,d){const h=f.range,C=this._bufferService.buffer.ydisp,D=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-C-1,h.end.x,h.end.y-C-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(D)}_linkLeave(f,d,h){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&f.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(h,d.text)}_linkAtPosition(f,d){const h=f.range.start.y*this._bufferService.cols+f.range.start.x,C=f.range.end.y*this._bufferService.cols+f.range.end.x,D=d.y*this._bufferService.cols+d.x;return h<=D&&D<=C}_positionFromMouseEvent(f,d,h){const C=h.getCoords(f,d,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(f,d,h,C,D){return{x1:f,y1:d,x2:h,y2:C,cols:this._bufferService.cols,fg:D}}};s.Linkifier=a=p([v(1,g.IMouseService),v(2,g.IRenderService),v(3,k.IBufferService),v(4,g.ILinkProviderService)],a)},9042:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(T,s,l){var p=this&&this.__decorate||function(g,a,f,d){var h,C=arguments.length,D=C<3?a:d===null?d=Object.getOwnPropertyDescriptor(a,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,a,f,d);else for(var x=g.length-1;x>=0;x--)(h=g[x])&&(D=(C<3?h(D):C>3?h(a,f,D):h(a,f))||D);return C>3&&D&&Object.defineProperty(a,f,D),D},v=this&&this.__param||function(g,a){return function(f,d){a(f,d,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const u=l(511),y=l(2585);let S=s.OscLinkProvider=class{constructor(g,a,f){this._bufferService=g,this._optionsService=a,this._oscLinkService=f}provideLinks(g,a){var L;const f=this._bufferService.buffer.lines.get(g-1);if(!f)return void a(void 0);const d=[],h=this._optionsService.rawOptions.linkHandler,C=new u.CellData,D=f.getTrimmedLength();let x=-1,M=-1,b=!1;for(let N=0;N<D;N++)if(M!==-1||f.hasContent(N)){if(f.loadCell(N,C),C.hasExtendedAttrs()&&C.extended.urlId){if(M===-1){M=N,x=C.extended.urlId;continue}b=C.extended.urlId!==x}else M!==-1&&(b=!0);if(b||M!==-1&&N===D-1){const B=(L=this._oscLinkService.getLinkData(x))==null?void 0:L.uri;if(B){const P={start:{x:M+1,y:g},end:{x:N+(b||N!==D-1?0:1),y:g}};let F=!1;if(!(h!=null&&h.allowNonHttpProtocols))try{const H=new URL(B);["http:","https:"].includes(H.protocol)||(F=!0)}catch{F=!0}F||d.push({text:B,range:P,activate:(H,q)=>h?h.activate(H,q,P):k(0,q),hover:(H,q)=>{var X;return(X=h==null?void 0:h.hover)==null?void 0:X.call(h,H,q,P)},leave:(H,q)=>{var X;return(X=h==null?void 0:h.leave)==null?void 0:X.call(h,H,q,P)}})}b=!1,C.hasExtendedAttrs()&&C.extended.urlId?(M=N,x=C.extended.urlId):(M=-1,x=-1)}}a(d)}};function k(g,a){if(confirm(`Do you want to navigate to ${a}?
|
|
111
|
-
|
|
112
|
-
WARNING: This link could potentially be dangerous`)){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=a}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=S=p([v(0,y.IBufferService),v(1,y.IOptionsService),v(2,y.IOscLinkService)],S)},6193:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(l,p){this._renderCallback=l,this._coreBrowserService=p,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,p,v){this._rowCount=v,l=l!==void 0?l:0,p=p!==void 0?p: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,p):p,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),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,p),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const p=l(3614),v=l(3656),u=l(3551),y=l(9042),S=l(3730),k=l(1680),g=l(3107),a=l(5744),f=l(2950),d=l(1296),h=l(428),C=l(4269),D=l(5114),x=l(8934),M=l(3230),b=l(9312),L=l(4725),N=l(6731),B=l(8055),P=l(8969),F=l(8460),H=l(844),q=l(6114),X=l(8437),G=l(2584),K=l(7399),j=l(5941),W=l(9074),$=l(2585),V=l(5435),J=l(4567),re=l(779);class ie extends P.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Y={}){super(Y),this.browser=q,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new F.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new F.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new F.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new F.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new F.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new F.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new F.EventEmitter),this._onBlur=this.register(new F.EventEmitter),this._onA11yCharEmitter=this.register(new F.EventEmitter),this._onA11yTabEmitter=this.register(new F.EventEmitter),this._onWillOpen=this.register(new F.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(W.DecorationService),this._instantiationService.setService($.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(L.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((U,Z)=>this.refresh(U,Z)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((U=>this._reportWindowsOptions(U)))),this.register(this._inputHandler.onColor((U=>this._handleColorEvent(U)))),this.register((0,F.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,F.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((U=>this._afterResize(U.cols,U.rows)))),this.register((0,H.toDisposable)((()=>{var U,Z;this._customKeyEventHandler=void 0,(Z=(U=this.element)==null?void 0:U.parentNode)==null||Z.removeChild(this.element)})))}_handleColorEvent(Y){if(this._themeService)for(const U of Y){let Z,ee="";switch(U.index){case 256:Z="foreground",ee="10";break;case 257:Z="background",ee="11";break;case 258:Z="cursor",ee="12";break;default:Z="ansi",ee="4;"+U.index}switch(U.type){case 0:const pe=B.color.toColorRGB(Z==="ansi"?this._themeService.colors.ansi[U.index]:this._themeService.colors[Z]);this.coreService.triggerDataEvent(`${G.C0.ESC}]${ee};${(0,j.toRgbString)(pe)}${G.C1_ESCAPED.ST}`);break;case 1:if(Z==="ansi")this._themeService.modifyColors((ne=>ne.ansi[U.index]=B.channels.toColor(...U.color)));else{const ne=Z;this._themeService.modifyColors((Ee=>Ee[ne]=B.channels.toColor(...U.color)))}break;case 2:this._themeService.restoreColor(U.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Y){Y?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(J.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Y){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Y;return(Y=this.textarea)==null?void 0:Y.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Y=this.buffer.ybase+this.buffer.y,U=this.buffer.lines.get(Y);if(!U)return;const Z=Math.min(this.buffer.x,this.cols-1),ee=this._renderService.dimensions.css.cell.height,pe=U.getWidth(Z),ne=this._renderService.dimensions.css.cell.width*pe,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,xe=Z*this._renderService.dimensions.css.cell.width;this.textarea.style.left=xe+"px",this.textarea.style.top=Ee+"px",this.textarea.style.width=ne+"px",this.textarea.style.height=ee+"px",this.textarea.style.lineHeight=ee+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(U=>{this.hasSelection()&&(0,p.copyHandler)(U,this._selectionService)})));const Y=U=>(0,p.handlePasteEvent)(U,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",Y)),this.register((0,v.addDisposableDomListener)(this.element,"paste",Y)),q.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(U=>{U.button===2&&(0,p.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(U=>{(0,p.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),q.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(U=>{U.button===1&&(0,p.moveTextAreaUnderMouseCursor)(U,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(Y=>this._keyUp(Y)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(Y=>this._keyDown(Y)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(Y=>this._keyPress(Y)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(Y=>this._compositionHelper.compositionupdate(Y)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(Y=>this._inputEvent(Y)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Y){var Z;if(!Y)throw new Error("Terminal requires a parent element.");if(Y.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((Z=this.element)==null?void 0:Z.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Y.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Y.appendChild(this.element);const U=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),U.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,v.addDisposableDomListener)(this.screenElement,"mousemove",(ee=>this.updateCursorStyle(ee)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),U.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",y.promptLabel),q.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(D.CoreBrowserService,this.textarea,Y.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(L.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(ee=>this._handleTextAreaFocus(ee)))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(N.ThemeService),this._instantiationService.setService(L.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(L.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(L.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ee=>this._onRender.fire(ee)))),this.onResize((ee=>this._renderService.resize(ee.cols,ee.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(f.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(x.MouseService),this._instantiationService.setService(L.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(U);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ee=>this.scrollLines(ee.amount,ee.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(b.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ee=>this.scrollLines(ee.amount,ee.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ee=>this._renderService.handleSelectionChanged(ee.start,ee.end,ee.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ee=>{this.textarea.value=ee,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ee=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(g.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(ee=>this._selectionService.handleMouseDown(ee)))),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(J.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ee=>this._handleScreenReaderModeOptionChange(ee)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ee=>{!this._overviewRulerRenderer&&ee&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Y=this,U=this.element;function Z(ne){const Ee=Y._mouseService.getMouseReportCoords(ne,Y.screenElement);if(!Ee)return!1;let xe,ce;switch(ne.overrideType||ne.type){case"mousemove":ce=32,ne.buttons===void 0?(xe=3,ne.button!==void 0&&(xe=ne.button<3?ne.button:3)):xe=1&ne.buttons?0:4&ne.buttons?1:2&ne.buttons?2:3;break;case"mouseup":ce=0,xe=ne.button<3?ne.button:3;break;case"mousedown":ce=1,xe=ne.button<3?ne.button:3;break;case"wheel":if(Y._customWheelEventHandler&&Y._customWheelEventHandler(ne)===!1||Y.viewport.getLinesScrolled(ne)===0)return!1;ce=ne.deltaY<0?0:1,xe=4;break;default:return!1}return!(ce===void 0||xe===void 0||xe>4)&&Y.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:xe,action:ce,ctrl:ne.ctrlKey,alt:ne.altKey,shift:ne.shiftKey})}const ee={mouseup:null,wheel:null,mousedrag:null,mousemove:null},pe={mouseup:ne=>(Z(ne),ne.buttons||(this._document.removeEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.removeEventListener("mousemove",ee.mousedrag)),this.cancel(ne)),wheel:ne=>(Z(ne),this.cancel(ne,!0)),mousedrag:ne=>{ne.buttons&&Z(ne)},mousemove:ne=>{ne.buttons||Z(ne)}};this.register(this.coreMouseService.onProtocolChange((ne=>{ne?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ne)),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&ne?ee.mousemove||(U.addEventListener("mousemove",pe.mousemove),ee.mousemove=pe.mousemove):(U.removeEventListener("mousemove",ee.mousemove),ee.mousemove=null),16&ne?ee.wheel||(U.addEventListener("wheel",pe.wheel,{passive:!1}),ee.wheel=pe.wheel):(U.removeEventListener("wheel",ee.wheel),ee.wheel=null),2&ne?ee.mouseup||(ee.mouseup=pe.mouseup):(this._document.removeEventListener("mouseup",ee.mouseup),ee.mouseup=null),4&ne?ee.mousedrag||(ee.mousedrag=pe.mousedrag):(this._document.removeEventListener("mousemove",ee.mousedrag),ee.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(U,"mousedown",(ne=>{if(ne.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ne))return Z(ne),ee.mouseup&&this._document.addEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.addEventListener("mousemove",ee.mousedrag),this.cancel(ne)}))),this.register((0,v.addDisposableDomListener)(U,"wheel",(ne=>{if(!ee.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ne)===!1)return!1;if(!this.buffer.hasScrollback){const Ee=this.viewport.getLinesScrolled(ne);if(Ee===0)return;const xe=G.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ne.deltaY<0?"A":"B");let ce="";for(let Se=0;Se<Math.abs(Ee);Se++)ce+=xe;return this.coreService.triggerDataEvent(ce,!0),this.cancel(ne,!0)}return this.viewport.handleWheel(ne)?this.cancel(ne):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(U,"touchstart",(ne=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ne),this.cancel(ne)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(U,"touchmove",(ne=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ne)?void 0:this.cancel(ne)}),{passive:!1}))}refresh(Y,U){var Z;(Z=this._renderService)==null||Z.refreshRows(Y,U)}updateCursorStyle(Y){var U;(U=this._selectionService)!=null&&U.shouldColumnSelect(Y)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Y,U,Z=0){var ee;Z===1?(super.scrollLines(Y,U,Z),this.refresh(0,this.rows-1)):(ee=this.viewport)==null||ee.scrollLines(Y)}paste(Y){(0,p.paste)(Y,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Y){this._customKeyEventHandler=Y}attachCustomWheelEventHandler(Y){this._customWheelEventHandler=Y}registerLinkProvider(Y){return this._linkProviderService.registerLinkProvider(Y)}registerCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const U=this._characterJoinerService.register(Y);return this.refresh(0,this.rows-1),U}deregisterCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Y)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Y){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Y)}registerDecoration(Y){return this._decorationService.registerDecoration(Y)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Y,U,Z){this._selectionService.setSelection(Y,U,Z)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Y;(Y=this._selectionService)==null||Y.clearSelection()}selectAll(){var Y;(Y=this._selectionService)==null||Y.selectAll()}selectLines(Y,U){var Z;(Z=this._selectionService)==null||Z.selectLines(Y,U)}_keyDown(Y){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;const U=this.browser.isMac&&this.options.macOptionIsMeta&&Y.altKey;if(!U&&!this._compositionHelper.keydown(Y))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;U||Y.key!=="Dead"&&Y.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const Z=(0,K.evaluateKeyboardEvent)(Y,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Y),Z.type===3||Z.type===2){const ee=this.rows-1;return this.scrollLines(Z.type===2?-ee:ee),this.cancel(Y,!0)}return Z.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Y)||(Z.cancel&&this.cancel(Y,!0),!Z.key||!!(Y.key&&!Y.ctrlKey&&!Y.altKey&&!Y.metaKey&&Y.key.length===1&&Y.key.charCodeAt(0)>=65&&Y.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(Z.key!==G.C0.ETX&&Z.key!==G.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Z.key,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(Z.key,!0),!this.optionsService.rawOptions.screenReaderMode||Y.altKey||Y.ctrlKey?this.cancel(Y,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Y,U){const Z=Y.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||Y.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey||Y.isWindows&&U.getModifierState("AltGraph");return U.type==="keypress"?Z:Z&&(!U.keyCode||U.keyCode>47)}_keyUp(Y){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1||((function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18})(Y)||this.focus(),this.updateCursorStyle(Y),this._keyPressHandled=!1)}_keyPress(Y){let U;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;if(this.cancel(Y),Y.charCode)U=Y.charCode;else if(Y.which===null||Y.which===void 0)U=Y.keyCode;else{if(Y.which===0||Y.charCode===0)return!1;U=Y.which}return!(!U||(Y.altKey||Y.ctrlKey||Y.metaKey)&&!this._isThirdLevelShift(this.browser,Y)||(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(U,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Y){if(Y.data&&Y.inputType==="insertText"&&(!Y.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const U=Y.data;return this.coreService.triggerDataEvent(U,!0),this.cancel(Y),!0}return!1}resize(Y,U){Y!==this.cols||U!==this.rows?super.resize(Y,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Y,U){var Z,ee;(Z=this._charSizeService)==null||Z.measure(),(ee=this.viewport)==null||ee.syncScrollArea(!0)}clear(){var Y;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let U=1;U<this.rows;U++)this.buffer.lines.push(this.buffer.getBlankLine(X.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Y=this.viewport)==null||Y.reset(),this.refresh(0,this.rows-1)}}reset(){var U,Z;this.options.rows=this.rows,this.options.cols=this.cols;const Y=this._customKeyEventHandler;this._setup(),super.reset(),(U=this._selectionService)==null||U.reset(),this._decorationService.reset(),(Z=this.viewport)==null||Z.reset(),this._customKeyEventHandler=Y,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Y;(Y=this._renderService)==null||Y.clearTextureAtlas()}_reportFocus(){var Y;(Y=this.element)!=null&&Y.classList.contains("focus")?this.coreService.triggerDataEvent(G.C0.ESC+"[I"):this.coreService.triggerDataEvent(G.C0.ESC+"[O")}_reportWindowsOptions(Y){if(this._renderService)switch(Y){case V.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const U=this._renderService.dimensions.css.canvas.width.toFixed(0),Z=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[4;${Z};${U}t`);break;case V.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ee=this._renderService.dimensions.css.cell.width.toFixed(0),pe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[6;${pe};${ee}t`)}}cancel(Y,U){if(this.options.cancelEvents||U)return Y.preventDefault(),Y.stopPropagation(),!1}}s.Terminal=ie},9924:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(l,p=1e3){this._renderCallback=l,this._debounceThresholdMS=p,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,p,v){this._rowCount=v,l=l!==void 0?l:0,p=p!==void 0?p: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,p):p;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const y=u-this._lastRefreshMs,S=this._debounceThresholdMS-y;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,p)}}},1680:function(T,s,l){var p=this&&this.__decorate||function(f,d,h,C){var D,x=arguments.length,M=x<3?d:C===null?C=Object.getOwnPropertyDescriptor(d,h):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(f,d,h,C);else for(var b=f.length-1;b>=0;b--)(D=f[b])&&(M=(x<3?D(M):x>3?D(d,h,M):D(d,h))||M);return x>3&&M&&Object.defineProperty(d,h,M),M},v=this&&this.__param||function(f,d){return function(h,C){d(h,C,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const u=l(3656),y=l(4725),S=l(8460),k=l(844),g=l(2585);let a=s.Viewport=class extends k.Disposable{constructor(f,d,h,C,D,x,M,b){super(),this._viewportElement=f,this._scrollArea=d,this._bufferService=h,this._optionsService=C,this._charSizeService=D,this._renderService=x,this._coreBrowserService=M,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((L=>this._renderDimensions=L))),this._handleThemeChange(b.colors),this.register(b.onChangeColors((L=>this._handleThemeChange(L)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(f){this._viewportElement.style.backgroundColor=f.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(f){if(f)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const f=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==f&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=f),this._refreshAnimationFrame=null}syncScrollArea(f=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(f);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(f)}_handleScroll(f){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const f=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(f*(this._smoothScrollState.target-this._smoothScrollState.origin)),f<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(f,d){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&h<this._lastRecordedBufferHeight)||(f.cancelable&&f.preventDefault(),!1)}handleWheel(f){const d=this._getPixelsScrolled(f);return d!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(f,d))}scrollLines(f){if(f!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=f*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!1})}_getPixelsScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let d=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(f,d){var b;let h,C="";const D=[],x=d??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let L=f;L<x;L++){const N=M.get(L);if(!N)continue;const B=(b=M.get(L+1))==null?void 0:b.isWrapped;if(C+=N.translateToString(!B),!B||L===M.length-1){const P=document.createElement("div");P.textContent=C,D.push(P),C.length>0&&(h=P),C=""}}return{bufferElements:D,cursorElement:h}}getLinesScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let d=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(f,d){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&d.altKey||h==="ctrl"&&d.ctrlKey||h==="shift"&&d.shiftKey?f*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:f*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(f){this._lastTouchY=f.touches[0].pageY}handleTouchMove(f){const d=this._lastTouchY-f.touches[0].pageY;return this._lastTouchY=f.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(f,d))}};s.Viewport=a=p([v(2,g.IBufferService),v(3,g.IOptionsService),v(4,y.ICharSizeService),v(5,y.IRenderService),v(6,y.ICoreBrowserService),v(7,y.IThemeService)],a)},3107:function(T,s,l){var p=this&&this.__decorate||function(g,a,f,d){var h,C=arguments.length,D=C<3?a:d===null?d=Object.getOwnPropertyDescriptor(a,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,a,f,d);else for(var x=g.length-1;x>=0;x--)(h=g[x])&&(D=(C<3?h(D):C>3?h(a,f,D):h(a,f))||D);return C>3&&D&&Object.defineProperty(a,f,D),D},v=this&&this.__param||function(g,a){return function(f,d){a(f,d,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const u=l(4725),y=l(844),S=l(2585);let k=s.BufferDecorationRenderer=class extends y.Disposable{constructor(g,a,f,d,h){super(),this._screenElement=g,this._bufferService=a,this._coreBrowserService=f,this._decorationService=d,this._renderService=h,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((C=>this._removeDecoration(C)))),this.register((0,y.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 g of this._decorationService.decorations)this._renderDecoration(g);this._dimensionsChanged=!1}_renderDecoration(g){this._refreshStyle(g),this._dimensionsChanged&&this._refreshXPosition(g)}_createElement(g){var d;const a=this._coreBrowserService.mainDocument.createElement("div");a.classList.add("xterm-decoration"),a.classList.toggle("xterm-decoration-top-layer",((d=g==null?void 0:g.options)==null?void 0:d.layer)==="top"),a.style.width=`${Math.round((g.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,a.style.height=(g.options.height||1)*this._renderService.dimensions.css.cell.height+"px",a.style.top=(g.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",a.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const f=g.options.x??0;return f&&f>this._bufferService.cols&&(a.style.display="none"),this._refreshXPosition(g,a),a}_refreshStyle(g){const a=g.marker.line-this._bufferService.buffers.active.ydisp;if(a<0||a>=this._bufferService.rows)g.element&&(g.element.style.display="none",g.onRenderEmitter.fire(g.element));else{let f=this._decorationElements.get(g);f||(f=this._createElement(g),g.element=f,this._decorationElements.set(g,f),this._container.appendChild(f),g.onDispose((()=>{this._decorationElements.delete(g),f.remove()}))),f.style.top=a*this._renderService.dimensions.css.cell.height+"px",f.style.display=this._altBufferIsActive?"none":"block",g.onRenderEmitter.fire(f)}}_refreshXPosition(g,a=g.element){if(!a)return;const f=g.options.x??0;(g.options.anchor||"left")==="right"?a.style.right=f?f*this._renderService.dimensions.css.cell.width+"px":"":a.style.left=f?f*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(g){var a;(a=this._decorationElements.get(g))==null||a.remove(),this._decorationElements.delete(g),g.dispose()}};s.BufferDecorationRenderer=k=p([v(1,S.IBufferService),v(2,u.ICoreBrowserService),v(3,S.IDecorationService),v(4,u.IRenderService)],k)},5871:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.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 p of this._zones)if(p.color===l.options.overviewRulerOptions.color&&p.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(p,l.marker.line))return;if(this._lineAdjacentToZone(p,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(p,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,p){return p>=l.startBufferLine&&p<=l.endBufferLine}_lineAdjacentToZone(l,p,v){return p>=l.startBufferLine-this._linePadding[v||"full"]&&p<=l.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(l,p){l.startBufferLine=Math.min(l.startBufferLine,p),l.endBufferLine=Math.max(l.endBufferLine,p)}}},5744:function(T,s,l){var p=this&&this.__decorate||function(h,C,D,x){var M,b=arguments.length,L=b<3?C:x===null?x=Object.getOwnPropertyDescriptor(C,D):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(h,C,D,x);else for(var N=h.length-1;N>=0;N--)(M=h[N])&&(L=(b<3?M(L):b>3?M(C,D,L):M(C,D))||L);return b>3&&L&&Object.defineProperty(C,D,L),L},v=this&&this.__param||function(h,C){return function(D,x){C(D,x,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const u=l(5871),y=l(4725),S=l(844),k=l(2585),g={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0};let d=s.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(h,C,D,x,M,b,L){var B;super(),this._viewportElement=h,this._screenElement=C,this._bufferService=D,this._decorationService=x,this._renderService=M,this._optionsService=b,this._coreBrowserService=L,this._colorZoneStore=new u.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(),(B=this._viewportElement.parentElement)==null||B.insertBefore(this._canvas,this._viewportElement);const N=this._canvas.getContext("2d");if(!N)throw new Error("Ctx cannot be null");this._ctx=N,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{var P;(P=this._canvas)==null||P.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 h=Math.floor(this._canvas.width/3),C=Math.ceil(this._canvas.width/3);a.full=this._canvas.width,a.left=h,a.center=C,a.right=h,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=a.left,f.right=a.left+a.center}_refreshDrawHeightConstants(){g.full=Math.round(2*this._coreBrowserService.dpr);const h=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(h,12),6)*this._coreBrowserService.dpr);g.left=C,g.center=C,g.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.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 C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const h=this._colorZoneStore.zones;for(const C of h)C.position!=="full"&&this._renderColorZone(C);for(const C of h)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(h){this._ctx.fillStyle=h.color,this._ctx.fillRect(f[h.position||"full"],Math.round((this._canvas.height-1)*(h.startBufferLine/this._bufferService.buffers.active.lines.length)-g[h.position||"full"]/2),a[h.position||"full"],Math.round((this._canvas.height-1)*((h.endBufferLine-h.startBufferLine)/this._bufferService.buffers.active.lines.length)+g[h.position||"full"]))}_queueRefresh(h,C){this._shouldUpdateDimensions=h||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=d=p([v(2,k.IBufferService),v(3,k.IDecorationService),v(4,y.IRenderService),v(5,k.IOptionsService),v(6,y.ICoreBrowserService)],d)},2950:function(T,s,l){var p=this&&this.__decorate||function(g,a,f,d){var h,C=arguments.length,D=C<3?a:d===null?d=Object.getOwnPropertyDescriptor(a,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,a,f,d);else for(var x=g.length-1;x>=0;x--)(h=g[x])&&(D=(C<3?h(D):C>3?h(a,f,D):h(a,f))||D);return C>3&&D&&Object.defineProperty(a,f,D),D},v=this&&this.__param||function(g,a){return function(f,d){a(f,d,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const u=l(4725),y=l(2585),S=l(2584);let k=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(g,a,f,d,h,C){this._textarea=g,this._compositionView=a,this._bufferService=f,this._optionsService=d,this._coreService=h,this._renderService=C,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(g){this._compositionView.textContent=g.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(g){if(this._isComposing||this._isSendingComposition){if(g.keyCode===229||g.keyCode===16||g.keyCode===17||g.keyCode===18)return!1;this._finalizeComposition(!1)}return g.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(g){if(this._compositionView.classList.remove("active"),this._isComposing=!1,g){const a={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let f;this._isSendingComposition=!1,a.start+=this._dataAlreadySent.length,f=this._isComposing?this._textarea.value.substring(a.start,a.end):this._textarea.value.substring(a.start),f.length>0&&this._coreService.triggerDataEvent(f,!0)}}),0)}else{this._isSendingComposition=!1;const a=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(a,!0)}}_handleAnyTextareaChanges(){const g=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const a=this._textarea.value,f=a.replace(g,"");this._dataAlreadySent=f,a.length>g.length?this._coreService.triggerDataEvent(f,!0):a.length<g.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):a.length===g.length&&a!==g&&this._coreService.triggerDataEvent(a,!0)}}),0)}updateCompositionElements(g){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const a=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),f=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=a*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=d+"px",this._compositionView.style.height=f+"px",this._compositionView.style.lineHeight=f+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const C=this._compositionView.getBoundingClientRect();this._textarea.style.left=h+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(C.width,1)+"px",this._textarea.style.height=Math.max(C.height,1)+"px",this._textarea.style.lineHeight=C.height+"px"}g||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=k=p([v(2,y.IBufferService),v(3,y.IOptionsService),v(4,y.ICoreService),v(5,u.IRenderService)],k)},9806:(T,s)=>{function l(p,v,u){const y=u.getBoundingClientRect(),S=p.getComputedStyle(u),k=parseInt(S.getPropertyValue("padding-left")),g=parseInt(S.getPropertyValue("padding-top"));return[v.clientX-y.left-k,v.clientY-y.top-g]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=l,s.getCoords=function(p,v,u,y,S,k,g,a,f){if(!k)return;const d=l(p,v,u);return d?(d[0]=Math.ceil((d[0]+(f?g/2:0))/g),d[1]=Math.ceil(d[1]/a),d[0]=Math.min(Math.max(d[0],1),y+(f?1:0)),d[1]=Math.min(Math.max(d[1],1),S),d):void 0}},9504:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const p=l(2584);function v(a,f,d,h){const C=a-u(a,d),D=f-u(f,d),x=Math.abs(C-D)-(function(M,b,L){let N=0;const B=M-u(M,L),P=b-u(b,L);for(let F=0;F<Math.abs(B-P);F++){const H=y(M,b)==="A"?-1:1,q=L.buffer.lines.get(B+H*F);q!=null&&q.isWrapped&&N++}return N})(a,f,d);return g(x,k(y(a,f),h))}function u(a,f){let d=0,h=f.buffer.lines.get(a),C=h==null?void 0:h.isWrapped;for(;C&&a>=0&&a<f.rows;)d++,h=f.buffer.lines.get(--a),C=h==null?void 0:h.isWrapped;return d}function y(a,f){return a>f?"A":"B"}function S(a,f,d,h,C,D){let x=a,M=f,b="";for(;x!==d||M!==h;)x+=C?1:-1,C&&x>D.cols-1?(b+=D.buffer.translateBufferLineToString(M,!1,a,x),x=0,a=0,M++):!C&&x<0&&(b+=D.buffer.translateBufferLineToString(M,!1,0,a+1),x=D.cols-1,a=x,M--);return b+D.buffer.translateBufferLineToString(M,!1,a,x)}function k(a,f){const d=f?"O":"[";return p.C0.ESC+d+a}function g(a,f){a=Math.floor(a);let d="";for(let h=0;h<a;h++)d+=f;return d}s.moveToCellSequence=function(a,f,d,h){const C=d.buffer.x,D=d.buffer.y;if(!d.buffer.hasScrollback)return(function(b,L,N,B,P,F){return v(L,B,P,F).length===0?"":g(S(b,L,b,L-u(L,P),!1,P).length,k("D",F))})(C,D,0,f,d,h)+v(D,f,d,h)+(function(b,L,N,B,P,F){let H;H=v(L,B,P,F).length>0?B-u(B,P):L;const q=B,X=(function(G,K,j,W,$,V){let J;return J=v(j,W,$,V).length>0?W-u(W,$):K,G<j&&J<=W||G>=j&&J<W?"C":"D"})(b,L,N,B,P,F);return g(S(b,H,N,q,X==="C",P).length,k(X,F))})(C,D,a,f,d,h);let x;if(D===f)return x=C>a?"D":"C",g(Math.abs(C-a),k(x,h));x=D>f?"D":"C";const M=Math.abs(D-f);return g((function(b,L){return L.cols-b})(D>f?a:C,d)+(M-1)*d.cols+1+((D>f?C:a)-1),k(x,h))}},1296:function(T,s,l){var p=this&&this.__decorate||function(F,H,q,X){var G,K=arguments.length,j=K<3?H:X===null?X=Object.getOwnPropertyDescriptor(H,q):X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(F,H,q,X);else for(var W=F.length-1;W>=0;W--)(G=F[W])&&(j=(K<3?G(j):K>3?G(H,q,j):G(H,q))||j);return K>3&&j&&Object.defineProperty(H,q,j),j},v=this&&this.__param||function(F,H){return function(q,X){H(q,X,F)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const u=l(3787),y=l(2550),S=l(2223),k=l(6171),g=l(6052),a=l(4725),f=l(8055),d=l(8460),h=l(844),C=l(2585),D="xterm-dom-renderer-owner-",x="xterm-rows",M="xterm-fg-",b="xterm-bg-",L="xterm-focus",N="xterm-selection";let B=1,P=s.DomRenderer=class extends h.Disposable{constructor(F,H,q,X,G,K,j,W,$,V,J,re,ie){super(),this._terminal=F,this._document=H,this._element=q,this._screenElement=X,this._viewportElement=G,this._helperContainer=K,this._linkifier2=j,this._charSizeService=$,this._optionsService=V,this._bufferService=J,this._coreBrowserService=re,this._themeService=ie,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,g.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(x),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(N),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((he=>this._injectCss(he)))),this._injectCss(this._themeService.colors),this._rowFactory=W.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(D+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((he=>this._handleLinkHover(he)))),this.register(this._linkifier2.onHideLinkUnderline((he=>this._handleLinkLeave(he)))),this.register((0,h.toDisposable)((()=>{this._element.classList.remove(D+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new y.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 F=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*F,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*F),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/F),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/F),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 q of this._rowElements)q.style.width=`${this.dimensions.css.canvas.width}px`,q.style.height=`${this.dimensions.css.cell.height}px`,q.style.lineHeight=`${this.dimensions.css.cell.height}px`,q.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const H=`${this._terminalSelector} .${x} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=H,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(F){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let H=`${this._terminalSelector} .${x} { color: ${F.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;H+=`${this._terminalSelector} .${x} .xterm-dim { color: ${f.color.multiplyOpacity(F.foreground,.5).css};}`,H+=`${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 q=`blink_underline_${this._terminalClass}`,X=`blink_bar_${this._terminalClass}`,G=`blink_block_${this._terminalClass}`;H+=`@keyframes ${q} { 50% { border-bottom-style: hidden; }}`,H+=`@keyframes ${X} { 50% { box-shadow: none; }}`,H+=`@keyframes ${G} { 0% { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css}; } 50% { background-color: inherit; color: ${F.cursor.css}; }}`,H+=`${this._terminalSelector} .${x}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${x}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${x}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css};}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${F.cursor.css} !important; color: ${F.cursorAccent.css} !important;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${F.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${F.cursor.css} inset;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${F.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,H+=`${this._terminalSelector} .${N} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${N} div { position: absolute; background-color: ${F.selectionBackgroundOpaque.css};}${this._terminalSelector} .${N} div { position: absolute; background-color: ${F.selectionInactiveBackgroundOpaque.css};}`;for(const[K,j]of F.ansi.entries())H+=`${this._terminalSelector} .${M}${K} { color: ${j.css}; }${this._terminalSelector} .${M}${K}.xterm-dim { color: ${f.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${b}${K} { background-color: ${j.css}; }`;H+=`${this._terminalSelector} .${M}${S.INVERTED_DEFAULT_COLOR} { color: ${f.color.opaque(F.background).css}; }${this._terminalSelector} .${M}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${f.color.multiplyOpacity(f.color.opaque(F.background),.5).css}; }${this._terminalSelector} .${b}${S.INVERTED_DEFAULT_COLOR} { background-color: ${F.foreground.css}; }`,this._themeStyleElement.textContent=H}_setDefaultSpacing(){const F=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${F}px`,this._rowFactory.defaultSpacing=F}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(F,H){for(let q=this._rowElements.length;q<=H;q++){const X=this._document.createElement("div");this._rowContainer.appendChild(X),this._rowElements.push(X)}for(;this._rowElements.length>H;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(F,H){this._refreshRowElements(F,H),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(L),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(L),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(F,H,q){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(F,H,q),this.renderRows(0,this._bufferService.rows-1),!F||!H)return;this._selectionRenderModel.update(this._terminal,F,H,q);const X=this._selectionRenderModel.viewportStartRow,G=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||j<0)return;const W=this._document.createDocumentFragment();if(q){const $=F[0]>H[0];W.appendChild(this._createSelectionElement(K,$?H[0]:F[0],$?F[0]:H[0],j-K+1))}else{const $=X===K?F[0]:0,V=K===G?H[0]:this._bufferService.cols;W.appendChild(this._createSelectionElement(K,$,V));const J=j-K-1;if(W.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,J)),K!==j){const re=G===j?H[0]:this._bufferService.cols;W.appendChild(this._createSelectionElement(j,0,re))}}this._selectionContainer.appendChild(W)}_createSelectionElement(F,H,q,X=1){const G=this._document.createElement("div"),K=H*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(q-H);return K+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-K),G.style.height=X*this.dimensions.css.cell.height+"px",G.style.top=F*this.dimensions.css.cell.height+"px",G.style.left=`${K}px`,G.style.width=`${j}px`,G}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 F of this._rowElements)F.replaceChildren()}renderRows(F,H){const q=this._bufferService.buffer,X=q.ybase+q.y,G=Math.min(q.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,W=this._optionsService.rawOptions.cursorInactiveStyle;for(let $=F;$<=H;$++){const V=$+q.ydisp,J=this._rowElements[$],re=q.lines.get(V);if(!J||!re)break;J.replaceChildren(...this._rowFactory.createRow(re,V,V===X,j,W,G,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${D}${this._terminalClass}`}_handleLinkHover(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!0)}_handleLinkLeave(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!1)}_setCellUnderline(F,H,q,X,G,K){q<0&&(F=0),X<0&&(H=0);const j=this._bufferService.rows-1;q=Math.max(Math.min(q,j),0),X=Math.max(Math.min(X,j),0),G=Math.min(G,this._bufferService.cols);const W=this._bufferService.buffer,$=W.ybase+W.y,V=Math.min(W.x,G-1),J=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ie=this._optionsService.rawOptions.cursorInactiveStyle;for(let he=q;he<=X;++he){const Y=he+W.ydisp,U=this._rowElements[he],Z=W.lines.get(Y);if(!U||!Z)break;U.replaceChildren(...this._rowFactory.createRow(Z,Y,Y===$,re,ie,V,J,this.dimensions.css.cell.width,this._widthCache,K?he===q?F:0:-1,K?(he===X?H:G)-1:-1))}}};s.DomRenderer=P=p([v(7,C.IInstantiationService),v(8,a.ICharSizeService),v(9,C.IOptionsService),v(10,C.IBufferService),v(11,a.ICoreBrowserService),v(12,a.IThemeService)],P)},3787:function(T,s,l){var p=this&&this.__decorate||function(x,M,b,L){var N,B=arguments.length,P=B<3?M:L===null?L=Object.getOwnPropertyDescriptor(M,b):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(x,M,b,L);else for(var F=x.length-1;F>=0;F--)(N=x[F])&&(P=(B<3?N(P):B>3?N(M,b,P):N(M,b))||P);return B>3&&P&&Object.defineProperty(M,b,P),P},v=this&&this.__param||function(x,M){return function(b,L){M(b,L,x)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const u=l(2223),y=l(643),S=l(511),k=l(2585),g=l(8055),a=l(4725),f=l(4269),d=l(6171),h=l(3734);let C=s.DomRendererRowFactory=class{constructor(x,M,b,L,N,B,P){this._document=x,this._characterJoinerService=M,this._optionsService=b,this._coreBrowserService=L,this._coreService=N,this._decorationService=B,this._themeService=P,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(x,M,b){this._selectionStart=x,this._selectionEnd=M,this._columnSelectMode=b}createRow(x,M,b,L,N,B,P,F,H,q,X){const G=[],K=this._characterJoinerService.getJoinedCharacters(M),j=this._themeService.colors;let W,$=x.getNoBgTrimmedLength();b&&$<B+1&&($=B+1);let V=0,J="",re=0,ie=0,he=0,Y=!1,U=0,Z=!1,ee=0;const pe=[],ne=q!==-1&&X!==-1;for(let Ee=0;Ee<$;Ee++){x.loadCell(Ee,this._workCell);let xe=this._workCell.getWidth();if(xe===0)continue;let ce=!1,Se=Ee,me=this._workCell;if(K.length>0&&Ee===K[0][0]){ce=!0;const Ge=K.shift();me=new f.JoinedCellData(this._workCell,x.translateToString(!0,Ge[0],Ge[1]),Ge[1]-Ge[0]),Se=Ge[1]-1,xe=me.getWidth()}const Ze=this._isCellInSelection(Ee,M),qe=b&&Ee===B,ve=ne&&Ee>=q&&Ee<=X;let Re=!1;this._decorationService.forEachDecorationAtCell(Ee,M,void 0,(Ge=>{Re=!0}));let Ie=me.getChars()||y.WHITESPACE_CELL_CHAR;if(Ie===" "&&(me.isUnderline()||me.isOverline())&&(Ie=" "),ee=xe*F-H.get(Ie,me.isBold(),me.isItalic()),W){if(V&&(Ze&&Z||!Ze&&!Z&&me.bg===re)&&(Ze&&Z&&j.selectionForeground||me.fg===ie)&&me.extended.ext===he&&ve===Y&&ee===U&&!qe&&!ce&&!Re){me.isInvisible()?J+=y.WHITESPACE_CELL_CHAR:J+=Ie,V++;continue}V&&(W.textContent=J),W=this._document.createElement("span"),V=0,J=""}else W=this._document.createElement("span");if(re=me.bg,ie=me.fg,he=me.extended.ext,Y=ve,U=ee,Z=Ze,ce&&B>=Ee&&B<=Se&&(B=Ee),!this._coreService.isCursorHidden&&qe&&this._coreService.isCursorInitialized){if(pe.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&pe.push("xterm-cursor-blink"),pe.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(N)switch(N){case"outline":pe.push("xterm-cursor-outline");break;case"block":pe.push("xterm-cursor-block");break;case"bar":pe.push("xterm-cursor-bar");break;case"underline":pe.push("xterm-cursor-underline")}}if(me.isBold()&&pe.push("xterm-bold"),me.isItalic()&&pe.push("xterm-italic"),me.isDim()&&pe.push("xterm-dim"),J=me.isInvisible()?y.WHITESPACE_CELL_CHAR:me.getChars()||y.WHITESPACE_CELL_CHAR,me.isUnderline()&&(pe.push(`xterm-underline-${me.extended.underlineStyle}`),J===" "&&(J=" "),!me.isUnderlineColorDefault()))if(me.isUnderlineColorRGB())W.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(me.getUnderlineColor()).join(",")})`;else{let Ge=me.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&me.isBold()&&Ge<8&&(Ge+=8),W.style.textDecorationColor=j.ansi[Ge].css}me.isOverline()&&(pe.push("xterm-overline"),J===" "&&(J=" ")),me.isStrikethrough()&&pe.push("xterm-strikethrough"),ve&&(W.style.textDecoration="underline");let ke=me.getFgColor(),Fe=me.getFgColorMode(),$e=me.getBgColor(),tt=me.getBgColorMode();const St=!!me.isInverse();if(St){const Ge=ke;ke=$e,$e=Ge;const Et=Fe;Fe=tt,tt=Et}let Ke,gt,nt,ze=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,M,void 0,(Ge=>{Ge.options.layer!=="top"&&ze||(Ge.backgroundColorRGB&&(tt=50331648,$e=Ge.backgroundColorRGB.rgba>>8&16777215,Ke=Ge.backgroundColorRGB),Ge.foregroundColorRGB&&(Fe=50331648,ke=Ge.foregroundColorRGB.rgba>>8&16777215,gt=Ge.foregroundColorRGB),ze=Ge.options.layer==="top")})),!ze&&Ze&&(Ke=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,$e=Ke.rgba>>8&16777215,tt=50331648,ze=!0,j.selectionForeground&&(Fe=50331648,ke=j.selectionForeground.rgba>>8&16777215,gt=j.selectionForeground)),ze&&pe.push("xterm-decoration-top"),tt){case 16777216:case 33554432:nt=j.ansi[$e],pe.push(`xterm-bg-${$e}`);break;case 50331648:nt=g.channels.toColor($e>>16,$e>>8&255,255&$e),this._addStyle(W,`background-color:#${D(($e>>>0).toString(16),"0",6)}`);break;default:St?(nt=j.foreground,pe.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):nt=j.background}switch(Ke||me.isDim()&&(Ke=g.color.multiplyOpacity(nt,.5)),Fe){case 16777216:case 33554432:me.isBold()&&ke<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ke+=8),this._applyMinimumContrast(W,nt,j.ansi[ke],me,Ke,void 0)||pe.push(`xterm-fg-${ke}`);break;case 50331648:const Ge=g.channels.toColor(ke>>16&255,ke>>8&255,255&ke);this._applyMinimumContrast(W,nt,Ge,me,Ke,gt)||this._addStyle(W,`color:#${D(ke.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(W,nt,j.foreground,me,Ke,gt)||St&&pe.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}pe.length&&(W.className=pe.join(" "),pe.length=0),qe||ce||Re?W.textContent=J:V++,ee!==this.defaultSpacing&&(W.style.letterSpacing=`${ee}px`),G.push(W),Ee=Se}return W&&V&&(W.textContent=J),G}_applyMinimumContrast(x,M,b,L,N,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(L.getCode()))return!1;const P=this._getContrastCache(L);let F;if(N||B||(F=P.getColor(M.rgba,b.rgba)),F===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);F=g.color.ensureContrastRatio(N||M,B||b,H),P.setColor((N||M).rgba,(B||b).rgba,F??null)}return!!F&&(this._addStyle(x,`color:${F.css}`),!0)}_getContrastCache(x){return x.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(x,M){x.setAttribute("style",`${x.getAttribute("style")||""}${M};`)}_isCellInSelection(x,M){const b=this._selectionStart,L=this._selectionEnd;return!(!b||!L)&&(this._columnSelectMode?b[0]<=L[0]?x>=b[0]&&M>=b[1]&&x<L[0]&&M<=L[1]:x<b[0]&&M>=b[1]&&x>=L[0]&&M<=L[1]:M>b[1]&&M<L[1]||b[1]===L[1]&&M===b[1]&&x>=b[0]&&x<L[0]||b[1]<L[1]&&M===L[1]&&x<L[0]||b[1]<L[1]&&M===b[1]&&x>=b[0])}};function D(x,M,b){for(;x.length<b;)x=M+x;return x}s.DomRendererRowFactory=C=p([v(1,a.ICharacterJoinerService),v(2,k.IOptionsService),v(3,a.ICoreBrowserService),v(4,k.ICoreService),v(5,k.IDecorationService),v(6,a.IThemeService)],C)},2550:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(l,p){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 v=l.createElement("span");v.classList.add("xterm-char-measure-element");const u=l.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const y=l.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontStyle="italic";const S=l.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[v,u,y,S],this._container.appendChild(v),this._container.appendChild(u),this._container.appendChild(y),this._container.appendChild(S),p.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,p,v,u){l===this._font&&p===this._fontSize&&v===this._weight&&u===this._weightBold||(this._font=l,this._fontSize=p,this._weight=v,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(l,p,v){let u=0;if(!p&&!v&&l.length===1&&(u=l.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const k=this._measure(l,0);return k>0&&(this._flat[u]=k),k}let y=l;p&&(y+="B"),v&&(y+="I");let S=this._holey.get(y);if(S===void 0){let k=0;p&&(k|=1),v&&(k|=2),S=this._measure(l,k),S>0&&this._holey.set(y,S)}return S}_measure(l,p){const v=this._measureElements[p];return v.textContent=l.repeat(32),v.offsetWidth/32}}},2223:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const p=l(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=p.isFirefox||p.isLegacyEdge?"bottom":"ideographic"},6171:(T,s)=>{function l(v){return 57508<=v&&v<=57558}function p(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},s.isPowerlineGlyph=l,s.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},s.isEmoji=p,s.allowRescaling=function(v,u,y,S){return u===1&&y>Math.ceil(1.5*S)&&v!==void 0&&v>255&&!p(v)&&!l(v)&&!(function(k){return 57344<=k&&k<=63743})(v)},s.treatGlyphAsBackgroundColor=function(v){return l(v)||(function(u){return 9472<=u&&u<=9631})(v)},s.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}}}},s.computeNextVariantOffset=function(v,u,y=0){return(v-(2*Math.round(u)-y))%(2*Math.round(u))}},6052:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.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(v,u,y,S=!1){if(this.selectionStart=u,this.selectionEnd=y,!u||!y||u[0]===y[0]&&u[1]===y[1])return void this.clear();const k=v.buffers.active.ydisp,g=u[1]-k,a=y[1]-k,f=Math.max(g,0),d=Math.min(a,v.rows-1);f>=v.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=g,this.viewportEndRow=a,this.viewportCappedStartRow=f,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=y[0])}isCellSelected(v,u,y){return!!this.hasSelection&&(y-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&y>=this.viewportCappedStartRow&&u<this.endCol&&y<=this.viewportCappedEndRow:u<this.startCol&&y>=this.viewportCappedStartRow&&u>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new l}},456:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.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,p=this.selectionEnd;return!(!l||!p)&&(l[1]>p[1]||l[1]===p[1]&&l[0]>p[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(T,s,l){var p=this&&this.__decorate||function(d,h,C,D){var x,M=arguments.length,b=M<3?h:D===null?D=Object.getOwnPropertyDescriptor(h,C):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(d,h,C,D);else for(var L=d.length-1;L>=0;L--)(x=d[L])&&(b=(M<3?x(b):M>3?x(h,C,b):x(h,C))||b);return M>3&&b&&Object.defineProperty(h,C,b),b},v=this&&this.__param||function(d,h){return function(C,D){h(C,D,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const u=l(2585),y=l(8460),S=l(844);let k=s.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,h,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new y.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new f(this._optionsService))}catch{this._measureStrategy=this.register(new a(d,h,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};s.CharSizeService=k=p([v(2,u.IOptionsService)],k);class g extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(h,C){h!==void 0&&h>0&&C!==void 0&&C>0&&(this._result.width=h,this._result.height=C)}}class a extends g{constructor(h,C,D){super(),this._document=h,this._parentElement=C,this._optionsService=D,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 f extends g{constructor(h){super(),this._optionsService=h,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const h=this._ctx.measureText("W");return this._validateAndSet(h.width,h.fontBoundingBoxAscent+h.fontBoundingBoxDescent),this._result}}},4269:function(T,s,l){var p=this&&this.__decorate||function(f,d,h,C){var D,x=arguments.length,M=x<3?d:C===null?C=Object.getOwnPropertyDescriptor(d,h):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(f,d,h,C);else for(var b=f.length-1;b>=0;b--)(D=f[b])&&(M=(x<3?D(M):x>3?D(d,h,M):D(d,h))||M);return x>3&&M&&Object.defineProperty(d,h,M),M},v=this&&this.__param||function(f,d){return function(h,C){d(h,C,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const u=l(3734),y=l(643),S=l(511),k=l(2585);class g extends u.AttributeData{constructor(d,h,C){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=h,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=g;let a=s.CharacterJoinerService=class zp{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(d){const h={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(h),h.id}deregister(d){for(let h=0;h<this._characterJoiners.length;h++)if(this._characterJoiners[h].id===d)return this._characterJoiners.splice(h,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const h=this._bufferService.buffer.lines.get(d);if(!h||h.length===0)return[];const C=[],D=h.translateToString(!0);let x=0,M=0,b=0,L=h.getFg(0),N=h.getBg(0);for(let B=0;B<h.getTrimmedLength();B++)if(h.loadCell(B,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==N){if(B-x>1){const P=this._getJoinedRanges(D,b,M,h,x);for(let F=0;F<P.length;F++)C.push(P[F])}x=B,b=M,L=this._workCell.fg,N=this._workCell.bg}M+=this._workCell.getChars().length||y.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-x>1){const B=this._getJoinedRanges(D,b,M,h,x);for(let P=0;P<B.length;P++)C.push(B[P])}return C}_getJoinedRanges(d,h,C,D,x){const M=d.substring(h,C);let b=[];try{b=this._characterJoiners[0].handler(M)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const N=this._characterJoiners[L].handler(M);for(let B=0;B<N.length;B++)zp._mergeRanges(b,N[B])}catch(N){console.error(N)}return this._stringRangesToCellRanges(b,D,x),b}_stringRangesToCellRanges(d,h,C){let D=0,x=!1,M=0,b=d[D];if(b){for(let L=C;L<this._bufferService.cols;L++){const N=h.getWidth(L),B=h.getString(L).length||y.WHITESPACE_CELL_CHAR.length;if(N!==0){if(!x&&b[0]<=M&&(b[0]=L,x=!0),b[1]<=M){if(b[1]=L,b=d[++D],!b)break;b[0]<=M?(b[0]=L,x=!0):x=!1}M+=B}}b&&(b[1]=this._bufferService.cols)}}static _mergeRanges(d,h){let C=!1;for(let D=0;D<d.length;D++){const x=d[D];if(C){if(h[1]<=x[0])return d[D-1][1]=h[1],d;if(h[1]<=x[1])return d[D-1][1]=Math.max(h[1],x[1]),d.splice(D,1),d;d.splice(D,1),D--}else{if(h[1]<=x[0])return d.splice(D,0,h),d;if(h[1]<=x[1])return x[0]=Math.min(h[0],x[0]),d;h[0]<x[1]&&(x[0]=Math.min(h[0],x[0]),C=!0)}}return C?d[d.length-1][1]=h[1]:d.push(h),d}};s.CharacterJoinerService=a=p([v(0,k.IBufferService)],a)},5114:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const p=l(844),v=l(8460),u=l(3656);class y extends p.Disposable{constructor(g,a,f){super(),this._textarea=g,this._window=a,this.mainDocument=f,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new v.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((d=>this._screenDprMonitor.setWindow(d)))),this.register((0,v.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(g){this._window!==g&&(this._window=g,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}}s.CoreBrowserService=y;class S extends p.Disposable{constructor(g){super(),this._parentWindow=g,this._windowResizeListener=this.register(new p.MutableDisposable),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,p.toDisposable)((()=>this.clearListener())))}setWindow(g){this._parentWindow=g,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var g;this._outerListener&&((g=this._resolutionMediaMatchList)==null||g.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const p=l(844);class v extends p.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,p.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(y){return this.linkProviders.push(y),{dispose:()=>{const S=this.linkProviders.indexOf(y);S!==-1&&this.linkProviders.splice(S,1)}}}}s.LinkProviderService=v},8934:function(T,s,l){var p=this&&this.__decorate||function(k,g,a,f){var d,h=arguments.length,C=h<3?g:f===null?f=Object.getOwnPropertyDescriptor(g,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(k,g,a,f);else for(var D=k.length-1;D>=0;D--)(d=k[D])&&(C=(h<3?d(C):h>3?d(g,a,C):d(g,a))||C);return h>3&&C&&Object.defineProperty(g,a,C),C},v=this&&this.__param||function(k,g){return function(a,f){g(a,f,k)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const u=l(4725),y=l(9806);let S=s.MouseService=class{constructor(k,g){this._renderService=k,this._charSizeService=g}getCoords(k,g,a,f,d){return(0,y.getCoords)(window,k,g,a,f,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(k,g){const a=(0,y.getCoordsRelativeToElement)(window,k,g);if(this._charSizeService.hasValidSize)return a[0]=Math.min(Math.max(a[0],0),this._renderService.dimensions.css.canvas.width-1),a[1]=Math.min(Math.max(a[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(a[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(a[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(a[0]),y:Math.floor(a[1])}}};s.MouseService=S=p([v(0,u.IRenderService),v(1,u.ICharSizeService)],S)},3230:function(T,s,l){var p=this&&this.__decorate||function(d,h,C,D){var x,M=arguments.length,b=M<3?h:D===null?D=Object.getOwnPropertyDescriptor(h,C):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(d,h,C,D);else for(var L=d.length-1;L>=0;L--)(x=d[L])&&(b=(M<3?x(b):M>3?x(h,C,b):x(h,C))||b);return M>3&&b&&Object.defineProperty(h,C,b),b},v=this&&this.__param||function(d,h){return function(C,D){h(C,D,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const u=l(6193),y=l(4725),S=l(8460),k=l(844),g=l(7226),a=l(2585);let f=s.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,h,C,D,x,M,b,L){super(),this._rowCount=d,this._charSizeService=D,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new g.DebouncedIdleTask,this._observerDisposable=this.register(new k.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 S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((N,B)=>this._renderRows(N,B)),b),this.register(this._renderDebouncer),this.register(b.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>{var N;return(N=this._renderer.value)==null?void 0:N.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(x.onDecorationRegistered((()=>this._fullRefresh()))),this.register(x.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(L.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(b.window,h),this.register(b.onWindowChange((N=>this._registerIntersectionObserver(N,h))))}_registerIntersectionObserver(d,h){if("IntersectionObserver"in d){const C=new d.IntersectionObserver((D=>this._handleIntersectionChange(D[D.length-1])),{threshold:0});C.observe(h),this._observerDisposable.value=(0,k.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(d,h,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,h,this._rowCount))}_renderRows(d,h){this._renderer.value&&(d=Math.min(d,this._rowCount-1),h=Math.min(h,this._rowCount-1),this._renderer.value.renderRows(d,h),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:h}),this._onRender.fire({start:d,end:h}),this._isNextRenderRedrawOnly=!0)}resize(d,h){this._rowCount=h,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw((h=>this.refreshRows(h.start,h.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var d,h;this._renderer.value&&((h=(d=this._renderer.value).clearTextureAtlas)==null||h.call(d),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(d,h){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(d,h)})):this._renderer.value.handleResize(d,h),this._fullRefresh())}handleCharSizeChanged(){var d;(d=this._renderer.value)==null||d.handleCharSizeChanged()}handleBlur(){var d;(d=this._renderer.value)==null||d.handleBlur()}handleFocus(){var d;(d=this._renderer.value)==null||d.handleFocus()}handleSelectionChanged(d,h,C){var D;this._selectionState.start=d,this._selectionState.end=h,this._selectionState.columnSelectMode=C,(D=this._renderer.value)==null||D.handleSelectionChanged(d,h,C)}handleCursorMove(){var d;(d=this._renderer.value)==null||d.handleCursorMove()}clear(){var d;(d=this._renderer.value)==null||d.clear()}};s.RenderService=f=p([v(2,a.IOptionsService),v(3,y.ICharSizeService),v(4,a.IDecorationService),v(5,a.IBufferService),v(6,y.ICoreBrowserService),v(7,y.IThemeService)],f)},9312:function(T,s,l){var p=this&&this.__decorate||function(b,L,N,B){var P,F=arguments.length,H=F<3?L:B===null?B=Object.getOwnPropertyDescriptor(L,N):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(b,L,N,B);else for(var q=b.length-1;q>=0;q--)(P=b[q])&&(H=(F<3?P(H):F>3?P(L,N,H):P(L,N))||H);return F>3&&H&&Object.defineProperty(L,N,H),H},v=this&&this.__param||function(b,L){return function(N,B){L(N,B,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const u=l(9806),y=l(9504),S=l(456),k=l(4725),g=l(8460),a=l(844),f=l(6114),d=l(4841),h=l(511),C=l(2585),D=" ",x=new RegExp(D,"g");let M=s.SelectionService=class extends a.Disposable{constructor(b,L,N,B,P,F,H,q,X){super(),this._element=b,this._screenElement=L,this._linkifier=N,this._bufferService=B,this._coreService=P,this._mouseService=F,this._optionsService=H,this._renderService=q,this._coreBrowserService=X,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new h.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new g.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new g.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=G=>this._handleMouseMove(G),this._mouseUpListener=G=>this._handleMouseUp(G),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((G=>this._handleTrim(G))),this.register(this._bufferService.buffers.onBufferActivate((G=>this._handleBufferActivate(G)))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,a.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 b=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!b||!L||b[0]===L[0]&&b[1]===L[1])}get selectionText(){const b=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!b||!L)return"";const N=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(b[0]===L[0])return"";const P=b[0]<L[0]?b[0]:L[0],F=b[0]<L[0]?L[0]:b[0];for(let H=b[1];H<=L[1];H++){const q=N.translateBufferLineToString(H,!0,P,F);B.push(q)}}else{const P=b[1]===L[1]?L[0]:void 0;B.push(N.translateBufferLineToString(b[1],!0,b[0],P));for(let F=b[1]+1;F<=L[1]-1;F++){const H=N.lines.get(F),q=N.translateBufferLineToString(F,!0);H!=null&&H.isWrapped?B[B.length-1]+=q:B.push(q)}if(b[1]!==L[1]){const F=N.lines.get(L[1]),H=N.translateBufferLineToString(L[1],!0,0,L[0]);F&&F.isWrapped?B[B.length-1]+=H:B.push(H)}}return B.map((P=>P.replace(x," "))).join(f.isWindows?`\r
|
|
113
|
-
`:`
|
|
114
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(b){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),f.isLinux&&b&&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(b){const L=this._getMouseBufferCoords(b),N=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(N&&B&&L)&&this._areCoordsInSelection(L,N,B)}isCellInSelection(b,L){const N=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!N||!B)&&this._areCoordsInSelection([b,L],N,B)}_areCoordsInSelection(b,L,N){return b[1]>L[1]&&b[1]<N[1]||L[1]===N[1]&&b[1]===L[1]&&b[0]>=L[0]&&b[0]<N[0]||L[1]<N[1]&&b[1]===N[1]&&b[0]<N[0]||L[1]<N[1]&&b[1]===L[1]&&b[0]>=L[0]}_selectWordAtCursor(b,L){var P,F;const N=(F=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:F.range;if(N)return this._model.selectionStart=[N.start.x-1,N.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(N,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(b);return!!B&&(this._selectWordAt(B,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(b,L){this._model.clearSelection(),b=Math.max(b,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,b],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(b){this._model.handleTrim(b)&&this.refresh()}_getMouseBufferCoords(b){const L=this._mouseService.getCoords(b,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(b){let L=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,b,this._screenElement)[1];const N=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=N?0:(L>N&&(L-=N),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(b){return f.isMac?b.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:b.shiftKey}handleMouseDown(b){if(this._mouseDownTimeStamp=b.timeStamp,(b.button!==2||!this.hasSelection)&&b.button===0){if(!this._enabled){if(!this.shouldForceSelection(b))return;b.stopPropagation()}b.preventDefault(),this._dragScrollAmount=0,this._enabled&&b.shiftKey?this._handleIncrementalClick(b):b.detail===1?this._handleSingleClick(b):b.detail===2?this._handleDoubleClick(b):b.detail===3&&this._handleTripleClick(b),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(b){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(b))}_handleSingleClick(b){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(b)?3:0,this._model.selectionStart=this._getMouseBufferCoords(b),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(b){this._selectWordAtCursor(b,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(b){const L=this._getMouseBufferCoords(b);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(b){return b.altKey&&!(f.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(b){if(b.stopImmediatePropagation(),!this._model.selectionStart)return;const L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(b),!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(b),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const N=this._bufferService.buffer;if(this._model.selectionEnd[1]<N.lines.length){const B=N.lines.get(this._model.selectionEnd[1]);B&&B.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const b=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(b.ydisp+this._bufferService.rows,b.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=b.ydisp),this.refresh()}}_handleMouseUp(b){const L=b.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&b.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const N=this._mouseService.getCoords(b,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(N&&N[0]!==void 0&&N[1]!==void 0){const B=(0,y.moveToCellSequence)(N[0]-1,N[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const b=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,N=!(!b||!L||b[0]===L[0]&&b[1]===L[1]);N?b&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&b[0]===this._oldSelectionStart[0]&&b[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(b,L,N)):this._oldHasSelection&&this._fireOnSelectionChange(b,L,N)}_fireOnSelectionChange(b,L,N){this._oldSelectionStart=b,this._oldSelectionEnd=L,this._oldHasSelection=N,this._onSelectionChange.fire()}_handleBufferActivate(b){this.clearSelection(),this._trimListener.dispose(),this._trimListener=b.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(b,L){let N=L;for(let B=0;L>=B;B++){const P=b.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?N--:P>1&&L!==B&&(N+=P-1)}return N}setSelection(b,L,N){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[b,L],this._model.selectionStartLength=N,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(b){this._isClickInSelection(b)||(this._selectWordAtCursor(b,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(b,L,N=!0,B=!0){if(b[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,F=P.lines.get(b[1]);if(!F)return;const H=P.translateBufferLineToString(b[1],!1);let q=this._convertViewportColToCharacterIndex(F,b[0]),X=q;const G=b[0]-q;let K=0,j=0,W=0,$=0;if(H.charAt(q)===" "){for(;q>0&&H.charAt(q-1)===" ";)q--;for(;X<H.length&&H.charAt(X+1)===" ";)X++}else{let re=b[0],ie=b[0];F.getWidth(re)===0&&(K++,re--),F.getWidth(ie)===2&&(j++,ie++);const he=F.getString(ie).length;for(he>1&&($+=he-1,X+=he-1);re>0&&q>0&&!this._isCharWordSeparator(F.loadCell(re-1,this._workCell));){F.loadCell(re-1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,re--):Y>1&&(W+=Y-1,q-=Y-1),q--,re--}for(;ie<F.length&&X+1<H.length&&!this._isCharWordSeparator(F.loadCell(ie+1,this._workCell));){F.loadCell(ie+1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,ie++):Y>1&&($+=Y-1,X+=Y-1),X++,ie++}}X++;let V=q+G-K+W,J=Math.min(this._bufferService.cols,X-q+K+j-W-$);if(L||H.slice(q,X).trim()!==""){if(N&&V===0&&F.getCodePoint(0)!==32){const re=P.lines.get(b[1]-1);if(re&&F.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ie=this._getWordAt([this._bufferService.cols-1,b[1]-1],!1,!0,!1);if(ie){const he=this._bufferService.cols-ie.start;V-=he,J+=he}}}if(B&&V+J===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){const re=P.lines.get(b[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ie=this._getWordAt([0,b[1]+1],!1,!1,!0);ie&&(J+=ie.length)}}return{start:V,length:J}}}_selectWordAt(b,L){const N=this._getWordAt(b,L);if(N){for(;N.start<0;)N.start+=this._bufferService.cols,b[1]--;this._model.selectionStart=[N.start,b[1]],this._model.selectionStartLength=N.length}}_selectToWordAt(b){const L=this._getWordAt(b,!0);if(L){let N=b[1];for(;L.start<0;)L.start+=this._bufferService.cols,N--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,N++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,N]}}_isCharWordSeparator(b){return b.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(b.getChars())>=0}_selectLineAt(b){const L=this._bufferService.buffer.getWrappedRangeForLine(b),N={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(N,this._bufferService.cols)}};s.SelectionService=M=p([v(3,C.IBufferService),v(4,C.ICoreService),v(5,k.IMouseService),v(6,C.IOptionsService),v(7,k.IRenderService),v(8,k.ICoreBrowserService)],M)},4725:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const p=l(8343);s.ICharSizeService=(0,p.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,p.createDecorator)("CoreBrowserService"),s.IMouseService=(0,p.createDecorator)("MouseService"),s.IRenderService=(0,p.createDecorator)("RenderService"),s.ISelectionService=(0,p.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,p.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,p.createDecorator)("ThemeService"),s.ILinkProviderService=(0,p.createDecorator)("LinkProviderService")},6731:function(T,s,l){var p=this&&this.__decorate||function(M,b,L,N){var B,P=arguments.length,F=P<3?b:N===null?N=Object.getOwnPropertyDescriptor(b,L):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(M,b,L,N);else for(var H=M.length-1;H>=0;H--)(B=M[H])&&(F=(P<3?B(F):P>3?B(b,L,F):B(b,L))||F);return P>3&&F&&Object.defineProperty(b,L,F),F},v=this&&this.__param||function(M,b){return function(L,N){b(L,N,M)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const u=l(7239),y=l(8055),S=l(8460),k=l(844),g=l(2585),a=y.css.toColor("#ffffff"),f=y.css.toColor("#000000"),d=y.css.toColor("#ffffff"),h=y.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[y.css.toColor("#2e3436"),y.css.toColor("#cc0000"),y.css.toColor("#4e9a06"),y.css.toColor("#c4a000"),y.css.toColor("#3465a4"),y.css.toColor("#75507b"),y.css.toColor("#06989a"),y.css.toColor("#d3d7cf"),y.css.toColor("#555753"),y.css.toColor("#ef2929"),y.css.toColor("#8ae234"),y.css.toColor("#fce94f"),y.css.toColor("#729fcf"),y.css.toColor("#ad7fa8"),y.css.toColor("#34e2e2"),y.css.toColor("#eeeeec")],b=[0,95,135,175,215,255];for(let L=0;L<216;L++){const N=b[L/36%6|0],B=b[L/6%6|0],P=b[L%6];M.push({css:y.channels.toCss(N,B,P),rgba:y.channels.toRgba(N,B,P)})}for(let L=0;L<24;L++){const N=8+10*L;M.push({css:y.channels.toCss(N,N,N),rgba:y.channels.toRgba(N,N,N)})}return M})());let D=s.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:a,background:f,cursor:d,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:y.color.blend(f,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:y.color.blend(f,C),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(M={}){const b=this._colors;if(b.foreground=x(M.foreground,a),b.background=x(M.background,f),b.cursor=x(M.cursor,d),b.cursorAccent=x(M.cursorAccent,h),b.selectionBackgroundTransparent=x(M.selectionBackground,C),b.selectionBackgroundOpaque=y.color.blend(b.background,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundTransparent=x(M.selectionInactiveBackground,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundOpaque=y.color.blend(b.background,b.selectionInactiveBackgroundTransparent),b.selectionForeground=M.selectionForeground?x(M.selectionForeground,y.NULL_COLOR):void 0,b.selectionForeground===y.NULL_COLOR&&(b.selectionForeground=void 0),y.color.isOpaque(b.selectionBackgroundTransparent)&&(b.selectionBackgroundTransparent=y.color.opacity(b.selectionBackgroundTransparent,.3)),y.color.isOpaque(b.selectionInactiveBackgroundTransparent)&&(b.selectionInactiveBackgroundTransparent=y.color.opacity(b.selectionInactiveBackgroundTransparent,.3)),b.ansi=s.DEFAULT_ANSI_COLORS.slice(),b.ansi[0]=x(M.black,s.DEFAULT_ANSI_COLORS[0]),b.ansi[1]=x(M.red,s.DEFAULT_ANSI_COLORS[1]),b.ansi[2]=x(M.green,s.DEFAULT_ANSI_COLORS[2]),b.ansi[3]=x(M.yellow,s.DEFAULT_ANSI_COLORS[3]),b.ansi[4]=x(M.blue,s.DEFAULT_ANSI_COLORS[4]),b.ansi[5]=x(M.magenta,s.DEFAULT_ANSI_COLORS[5]),b.ansi[6]=x(M.cyan,s.DEFAULT_ANSI_COLORS[6]),b.ansi[7]=x(M.white,s.DEFAULT_ANSI_COLORS[7]),b.ansi[8]=x(M.brightBlack,s.DEFAULT_ANSI_COLORS[8]),b.ansi[9]=x(M.brightRed,s.DEFAULT_ANSI_COLORS[9]),b.ansi[10]=x(M.brightGreen,s.DEFAULT_ANSI_COLORS[10]),b.ansi[11]=x(M.brightYellow,s.DEFAULT_ANSI_COLORS[11]),b.ansi[12]=x(M.brightBlue,s.DEFAULT_ANSI_COLORS[12]),b.ansi[13]=x(M.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),b.ansi[14]=x(M.brightCyan,s.DEFAULT_ANSI_COLORS[14]),b.ansi[15]=x(M.brightWhite,s.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const L=Math.min(b.ansi.length-16,M.extendedAnsi.length);for(let N=0;N<L;N++)b.ansi[N+16]=x(M.extendedAnsi[N],s.DEFAULT_ANSI_COLORS[N+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[M]=this._restoreColors.ansi[M]}else for(let b=0;b<this._restoreColors.ansi.length;++b)this._colors.ansi[b]=this._restoreColors.ansi[b]}modifyColors(M){M(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function x(M,b){if(M!==void 0)try{return y.css.toColor(M)}catch{}return b}s.ThemeService=D=p([v(0,g.IOptionsService)],D)},6349:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const p=l(8460),v=l(844);class u extends v.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new p.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new p.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new p.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(S){if(this._maxLength===S)return;const k=new Array(S);for(let g=0;g<Math.min(S,this.length);g++)k[g]=this._array[this._getCyclicIndex(g)];this._array=k,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let k=this._length;k<S;k++)this._array[k]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,k){this._array[this._getCyclicIndex(S)]=k}push(S){this._array[this._getCyclicIndex(this._length)]=S,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(S,k,...g){if(k){for(let a=S;a<this._length-k;a++)this._array[this._getCyclicIndex(a)]=this._array[this._getCyclicIndex(a+k)];this._length-=k,this.onDeleteEmitter.fire({index:S,amount:k})}for(let a=this._length-1;a>=S;a--)this._array[this._getCyclicIndex(a+g.length)]=this._array[this._getCyclicIndex(a)];for(let a=0;a<g.length;a++)this._array[this._getCyclicIndex(S+a)]=g[a];if(g.length&&this.onInsertEmitter.fire({index:S,amount:g.length}),this._length+g.length>this._maxLength){const a=this._length+g.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=g.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,k,g){if(!(k<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(let f=k-1;f>=0;f--)this.set(S+f+g,this.get(S+f));const a=S+k+g-this._length;if(a>0)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let a=0;a<k;a++)this.set(S+a+g,this.get(S+a))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}s.CircularList=u},1439:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function l(p,v=5){if(typeof p!="object")return p;const u=Array.isArray(p)?[]:{};for(const y in p)u[y]=v<=1?p[y]:p[y]&&l(p[y],v-1);return u}},8055:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let l=0,p=0,v=0,u=0;var y,S,k,g,a;function f(h){const C=h.toString(16);return C.length<2?"0"+C:C}function d(h,C){return h<C?(C+.05)/(h+.05):(h+.05)/(C+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(C,D,x,M){return M!==void 0?`#${f(C)}${f(D)}${f(x)}${f(M)}`:`#${f(C)}${f(D)}${f(x)}`},h.toRgba=function(C,D,x,M=255){return(C<<24|D<<16|x<<8|M)>>>0},h.toColor=function(C,D,x,M){return{css:h.toCss(C,D,x,M),rgba:h.toRgba(C,D,x,M)}}})(y||(s.channels=y={})),(function(h){function C(D,x){return u=Math.round(255*x),[l,p,v]=a.toChannels(D.rgba),{css:y.toCss(l,p,v,u),rgba:y.toRgba(l,p,v,u)}}h.blend=function(D,x){if(u=(255&x.rgba)/255,u===1)return{css:x.css,rgba:x.rgba};const M=x.rgba>>24&255,b=x.rgba>>16&255,L=x.rgba>>8&255,N=D.rgba>>24&255,B=D.rgba>>16&255,P=D.rgba>>8&255;return l=N+Math.round((M-N)*u),p=B+Math.round((b-B)*u),v=P+Math.round((L-P)*u),{css:y.toCss(l,p,v),rgba:y.toRgba(l,p,v)}},h.isOpaque=function(D){return(255&D.rgba)==255},h.ensureContrastRatio=function(D,x,M){const b=a.ensureContrastRatio(D.rgba,x.rgba,M);if(b)return y.toColor(b>>24&255,b>>16&255,b>>8&255)},h.opaque=function(D){const x=(255|D.rgba)>>>0;return[l,p,v]=a.toChannels(x),{css:y.toCss(l,p,v),rgba:x}},h.opacity=C,h.multiplyOpacity=function(D,x){return u=255&D.rgba,C(D,u*x/255)},h.toColorRGB=function(D){return[D.rgba>>24&255,D.rgba>>16&255,D.rgba>>8&255]}})(S||(s.color=S={})),(function(h){let C,D;try{const x=document.createElement("canvas");x.width=1,x.height=1;const M=x.getContext("2d",{willReadFrequently:!0});M&&(C=M,C.globalCompositeOperation="copy",D=C.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return l=parseInt(x.slice(1,2).repeat(2),16),p=parseInt(x.slice(2,3).repeat(2),16),v=parseInt(x.slice(3,4).repeat(2),16),y.toColor(l,p,v);case 5:return l=parseInt(x.slice(1,2).repeat(2),16),p=parseInt(x.slice(2,3).repeat(2),16),v=parseInt(x.slice(3,4).repeat(2),16),u=parseInt(x.slice(4,5).repeat(2),16),y.toColor(l,p,v,u);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const M=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return l=parseInt(M[1]),p=parseInt(M[2]),v=parseInt(M[3]),u=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),y.toColor(l,p,v,u);if(!C||!D)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=D,C.fillStyle=x,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[l,p,v,u]=C.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(l,p,v,u),css:x}}})(k||(s.css=k={})),(function(h){function C(D,x,M){const b=D/255,L=x/255,N=M/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))}h.relativeLuminance=function(D){return C(D>>16&255,D>>8&255,255&D)},h.relativeLuminance2=C})(g||(s.rgb=g={})),(function(h){function C(x,M,b){const L=x>>24&255,N=x>>16&255,B=x>>8&255;let P=M>>24&255,F=M>>16&255,H=M>>8&255,q=d(g.relativeLuminance2(P,F,H),g.relativeLuminance2(L,N,B));for(;q<b&&(P>0||F>0||H>0);)P-=Math.max(0,Math.ceil(.1*P)),F-=Math.max(0,Math.ceil(.1*F)),H-=Math.max(0,Math.ceil(.1*H)),q=d(g.relativeLuminance2(P,F,H),g.relativeLuminance2(L,N,B));return(P<<24|F<<16|H<<8|255)>>>0}function D(x,M,b){const L=x>>24&255,N=x>>16&255,B=x>>8&255;let P=M>>24&255,F=M>>16&255,H=M>>8&255,q=d(g.relativeLuminance2(P,F,H),g.relativeLuminance2(L,N,B));for(;q<b&&(P<255||F<255||H<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),F=Math.min(255,F+Math.ceil(.1*(255-F))),H=Math.min(255,H+Math.ceil(.1*(255-H))),q=d(g.relativeLuminance2(P,F,H),g.relativeLuminance2(L,N,B));return(P<<24|F<<16|H<<8|255)>>>0}h.blend=function(x,M){if(u=(255&M)/255,u===1)return M;const b=M>>24&255,L=M>>16&255,N=M>>8&255,B=x>>24&255,P=x>>16&255,F=x>>8&255;return l=B+Math.round((b-B)*u),p=P+Math.round((L-P)*u),v=F+Math.round((N-F)*u),y.toRgba(l,p,v)},h.ensureContrastRatio=function(x,M,b){const L=g.relativeLuminance(x>>8),N=g.relativeLuminance(M>>8);if(d(L,N)<b){if(N<L){const F=C(x,M,b),H=d(L,g.relativeLuminance(F>>8));if(H<b){const q=D(x,M,b);return H>d(L,g.relativeLuminance(q>>8))?F:q}return F}const B=D(x,M,b),P=d(L,g.relativeLuminance(B>>8));if(P<b){const F=C(x,M,b);return P>d(L,g.relativeLuminance(F>>8))?B:F}return B}},h.reduceLuminance=C,h.increaseLuminance=D,h.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}})(a||(s.rgba=a={})),s.toPaddedHex=f,s.contrastRatio=d},8969:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const p=l(844),v=l(2585),u=l(4348),y=l(7866),S=l(744),k=l(7302),g=l(6975),a=l(8460),f=l(1753),d=l(1480),h=l(7994),C=l(9282),D=l(5435),x=l(5981),M=l(2660);let b=!1;class L extends p.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new a.EventEmitter),this._onScroll.event((B=>{var P;(P=this._onScrollApi)==null||P.fire(B.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(B){for(const P in B)this.optionsService.options[P]=B[P]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new p.MutableDisposable),this._onBinary=this.register(new a.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new a.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new a.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new k.OptionsService(B)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(y.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(g.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(f.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new D.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,a.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,a.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,a.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,a.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((P=>{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((P=>{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 x.WriteBuffer(((P,F)=>this._inputHandler.parse(P,F)))),this.register((0,a.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,P){this._writeBuffer.write(B,P)}writeSync(B,P){this._logService.logLevel<=v.LogLevelEnum.WARN&&!b&&(this._logService.warn("writeSync is unreliable and will be removed soon."),b=!0),this._writeBuffer.writeSync(B,P)}input(B,P=!0){this.coreService.triggerDataEvent(B,P)}resize(B,P){isNaN(B)||isNaN(P)||(B=Math.max(B,S.MINIMUM_COLS),P=Math.max(P,S.MINIMUM_ROWS),this._bufferService.resize(B,P))}scroll(B,P=!1){this._bufferService.scroll(B,P)}scrollLines(B,P,F){this._bufferService.scrollLines(B,P,F)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const P=B-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(B,P){return this._inputHandler.registerEscHandler(B,P)}registerDcsHandler(B,P){return this._inputHandler.registerDcsHandler(B,P)}registerCsiHandler(B,P){return this._inputHandler.registerCsiHandler(B,P)}registerOscHandler(B,P){return this._inputHandler.registerOscHandler(B,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?B=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,p.toDisposable)((()=>{for(const P of B)P.dispose()}))}}}s.CoreTerminal=L},8460:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.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 p=0;p<this._listeners.length;p++)if(this._listeners[p]===l)return void this._listeners.splice(p,1)}}})),this._event}fire(l,p){const v=[];for(let u=0;u<this._listeners.length;u++)v.push(this._listeners[u]);for(let u=0;u<v.length;u++)v[u].call(void 0,l,p)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(l,p){return l((v=>p.fire(v)))},s.runAndSubscribe=function(l,p){return p(void 0),l((v=>p(v)))}},5435:function(T,s,l){var p=this&&this.__decorate||function(K,j,W,$){var V,J=arguments.length,re=J<3?j:$===null?$=Object.getOwnPropertyDescriptor(j,W):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(K,j,W,$);else for(var ie=K.length-1;ie>=0;ie--)(V=K[ie])&&(re=(J<3?V(re):J>3?V(j,W,re):V(j,W))||re);return J>3&&re&&Object.defineProperty(j,W,re),re},v=this&&this.__param||function(K,j){return function(W,$){j(W,$,K)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const u=l(2584),y=l(7116),S=l(2015),k=l(844),g=l(482),a=l(8437),f=l(8460),d=l(643),h=l(511),C=l(3734),D=l(2585),x=l(1480),M=l(6242),b=l(6351),L=l(5941),N={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function P(K,j){if(K>24)return j.setWinLines||!1;switch(K){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var F;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(s.WindowsOptionsReportType=F={}));let H=0;class q extends k.Disposable{getAttrData(){return this._curAttrData}constructor(j,W,$,V,J,re,ie,he,Y=new S.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=W,this._coreService=$,this._logService=V,this._optionsService=J,this._oscLinkService=re,this._coreMouseService=ie,this._unicodeService=he,this._parser=Y,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new g.StringToUtf32,this._utf8Decoder=new g.Utf8ToUtf32,this._workCell=new h.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new f.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new f.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new f.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new f.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new f.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new f.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new f.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new f.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new f.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new f.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new f.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 X(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((U=>this._activeBuffer=U.activeBuffer))),this._parser.setCsiHandlerFallback(((U,Z)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(U),params:Z.toArray()})})),this._parser.setEscHandlerFallback((U=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(U)})})),this._parser.setExecuteHandlerFallback((U=>{this._logService.debug("Unknown EXECUTE code: ",{code:U})})),this._parser.setOscHandlerFallback(((U,Z,ee)=>{this._logService.debug("Unknown OSC code: ",{identifier:U,action:Z,data:ee})})),this._parser.setDcsHandlerFallback(((U,Z,ee)=>{Z==="HOOK"&&(ee=ee.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(U),action:Z,payload:ee})})),this._parser.setPrintHandler(((U,Z,ee)=>this.print(U,Z,ee))),this._parser.registerCsiHandler({final:"@"},(U=>this.insertChars(U))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(U=>this.scrollLeft(U))),this._parser.registerCsiHandler({final:"A"},(U=>this.cursorUp(U))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(U=>this.scrollRight(U))),this._parser.registerCsiHandler({final:"B"},(U=>this.cursorDown(U))),this._parser.registerCsiHandler({final:"C"},(U=>this.cursorForward(U))),this._parser.registerCsiHandler({final:"D"},(U=>this.cursorBackward(U))),this._parser.registerCsiHandler({final:"E"},(U=>this.cursorNextLine(U))),this._parser.registerCsiHandler({final:"F"},(U=>this.cursorPrecedingLine(U))),this._parser.registerCsiHandler({final:"G"},(U=>this.cursorCharAbsolute(U))),this._parser.registerCsiHandler({final:"H"},(U=>this.cursorPosition(U))),this._parser.registerCsiHandler({final:"I"},(U=>this.cursorForwardTab(U))),this._parser.registerCsiHandler({final:"J"},(U=>this.eraseInDisplay(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(U=>this.eraseInDisplay(U,!0))),this._parser.registerCsiHandler({final:"K"},(U=>this.eraseInLine(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(U=>this.eraseInLine(U,!0))),this._parser.registerCsiHandler({final:"L"},(U=>this.insertLines(U))),this._parser.registerCsiHandler({final:"M"},(U=>this.deleteLines(U))),this._parser.registerCsiHandler({final:"P"},(U=>this.deleteChars(U))),this._parser.registerCsiHandler({final:"S"},(U=>this.scrollUp(U))),this._parser.registerCsiHandler({final:"T"},(U=>this.scrollDown(U))),this._parser.registerCsiHandler({final:"X"},(U=>this.eraseChars(U))),this._parser.registerCsiHandler({final:"Z"},(U=>this.cursorBackwardTab(U))),this._parser.registerCsiHandler({final:"`"},(U=>this.charPosAbsolute(U))),this._parser.registerCsiHandler({final:"a"},(U=>this.hPositionRelative(U))),this._parser.registerCsiHandler({final:"b"},(U=>this.repeatPrecedingCharacter(U))),this._parser.registerCsiHandler({final:"c"},(U=>this.sendDeviceAttributesPrimary(U))),this._parser.registerCsiHandler({prefix:">",final:"c"},(U=>this.sendDeviceAttributesSecondary(U))),this._parser.registerCsiHandler({final:"d"},(U=>this.linePosAbsolute(U))),this._parser.registerCsiHandler({final:"e"},(U=>this.vPositionRelative(U))),this._parser.registerCsiHandler({final:"f"},(U=>this.hVPosition(U))),this._parser.registerCsiHandler({final:"g"},(U=>this.tabClear(U))),this._parser.registerCsiHandler({final:"h"},(U=>this.setMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(U=>this.setModePrivate(U))),this._parser.registerCsiHandler({final:"l"},(U=>this.resetMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(U=>this.resetModePrivate(U))),this._parser.registerCsiHandler({final:"m"},(U=>this.charAttributes(U))),this._parser.registerCsiHandler({final:"n"},(U=>this.deviceStatus(U))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(U=>this.deviceStatusPrivate(U))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(U=>this.softReset(U))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(U=>this.setCursorStyle(U))),this._parser.registerCsiHandler({final:"r"},(U=>this.setScrollRegion(U))),this._parser.registerCsiHandler({final:"s"},(U=>this.saveCursor(U))),this._parser.registerCsiHandler({final:"t"},(U=>this.windowOptions(U))),this._parser.registerCsiHandler({final:"u"},(U=>this.restoreCursor(U))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(U=>this.insertColumns(U))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(U=>this.deleteColumns(U))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(U=>this.selectProtected(U))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(U=>this.requestMode(U,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(U=>this.requestMode(U,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((U=>(this.setTitle(U),this.setIconName(U),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((U=>this.setIconName(U)))),this._parser.registerOscHandler(2,new M.OscHandler((U=>this.setTitle(U)))),this._parser.registerOscHandler(4,new M.OscHandler((U=>this.setOrReportIndexedColor(U)))),this._parser.registerOscHandler(8,new M.OscHandler((U=>this.setHyperlink(U)))),this._parser.registerOscHandler(10,new M.OscHandler((U=>this.setOrReportFgColor(U)))),this._parser.registerOscHandler(11,new M.OscHandler((U=>this.setOrReportBgColor(U)))),this._parser.registerOscHandler(12,new M.OscHandler((U=>this.setOrReportCursorColor(U)))),this._parser.registerOscHandler(104,new M.OscHandler((U=>this.restoreIndexedColor(U)))),this._parser.registerOscHandler(110,new M.OscHandler((U=>this.restoreFgColor(U)))),this._parser.registerOscHandler(111,new M.OscHandler((U=>this.restoreBgColor(U)))),this._parser.registerOscHandler(112,new M.OscHandler((U=>this.restoreCursorColor(U)))),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 U in y.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:U},(()=>this.selectCharset("("+U))),this._parser.registerEscHandler({intermediates:")",final:U},(()=>this.selectCharset(")"+U))),this._parser.registerEscHandler({intermediates:"*",final:U},(()=>this.selectCharset("*"+U))),this._parser.registerEscHandler({intermediates:"+",final:U},(()=>this.selectCharset("+"+U))),this._parser.registerEscHandler({intermediates:"-",final:U},(()=>this.selectCharset("-"+U))),this._parser.registerEscHandler({intermediates:".",final:U},(()=>this.selectCharset("."+U))),this._parser.registerEscHandler({intermediates:"/",final:U},(()=>this.selectCharset("/"+U)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((U=>(this._logService.error("Parsing error: ",U),U))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new b.DcsHandler(((U,Z)=>this.requestStatusString(U,Z))))}_preserveStack(j,W,$,V){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=W,this._parseStack.decodedLength=$,this._parseStack.position=V}_logSlowResolvingAsync(j){this._logService.logLevel<=D.LogLevelEnum.WARN&&Promise.race([j,new Promise(((W,$)=>setTimeout((()=>$("#SLOW_TIMEOUT")),5e3)))]).catch((W=>{if(W!=="#SLOW_TIMEOUT")throw W;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,W){let $,V=this._activeBuffer.x,J=this._activeBuffer.y,re=0;const ie=this._parseStack.paused;if(ie){if($=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,W))return this._logSlowResolvingAsync($),$;V=this._parseStack.cursorStartX,J=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>B&&(re=this._parseStack.position+B)}if(this._logService.logLevel<=D.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(U=>String.fromCharCode(U))).join("")}"`),typeof j=="string"?j.split("").map((U=>U.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<B&&(this._parseBuffer=new Uint32Array(Math.min(j.length,B))),ie||this._dirtyRowTracker.clearRange(),j.length>B)for(let U=re;U<j.length;U+=B){const Z=U+B<j.length?U+B:j.length,ee=typeof j=="string"?this._stringDecoder.decode(j.substring(U,Z),this._parseBuffer):this._utf8Decoder.decode(j.subarray(U,Z),this._parseBuffer);if($=this._parser.parse(this._parseBuffer,ee))return this._preserveStack(V,J,ee,U),this._logSlowResolvingAsync($),$}else if(!ie){const U=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if($=this._parser.parse(this._parseBuffer,U))return this._preserveStack(V,J,U,0),this._logSlowResolvingAsync($),$}this._activeBuffer.x===V&&this._activeBuffer.y===J||this._onCursorMove.fire();const he=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Y=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Y<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Y,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(j,W,$){let V,J;const re=this._charsetService.charset,ie=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,Y=this._coreService.decPrivateModes.wraparound,U=this._coreService.modes.insertMode,Z=this._curAttrData;let ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&$-W>0&&ee.getWidth(this._activeBuffer.x-1)===2&&ee.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Z);let pe=this._parser.precedingJoinState;for(let ne=W;ne<$;++ne){if(V=j[ne],V<127&&re){const Se=re[String.fromCharCode(V)];Se&&(V=Se.charCodeAt(0))}const Ee=this._unicodeService.charProperties(V,pe);J=x.UnicodeService.extractWidth(Ee);const xe=x.UnicodeService.extractShouldJoin(Ee),ce=xe?x.UnicodeService.extractWidth(pe):0;if(pe=Ee,ie&&this._onA11yChar.fire((0,g.stringFromCodePoint)(V)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+J-ce>he){if(Y){const Se=ee;let me=this._activeBuffer.x-ce;for(this._activeBuffer.x=ce,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),ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ce>0&&ee instanceof a.BufferLine&&ee.copyCellsFrom(Se,me,0,ce,!1);me<he;)Se.setCellFromCodepoint(me++,0,1,Z)}else if(this._activeBuffer.x=he-1,J===2)continue}if(xe&&this._activeBuffer.x){const Se=ee.getWidth(this._activeBuffer.x-1)?1:2;ee.addCodepointToCell(this._activeBuffer.x-Se,V,J);for(let me=J-ce;--me>=0;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,Z)}else if(U&&(ee.insertCells(this._activeBuffer.x,J-ce,this._activeBuffer.getNullCell(Z)),ee.getWidth(he-1)===2&&ee.setCellFromCodepoint(he-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,Z)),ee.setCellFromCodepoint(this._activeBuffer.x++,V,J,Z),J>0)for(;--J;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,Z)}this._parser.precedingJoinState=pe,this._activeBuffer.x<he&&$-W>0&&ee.getWidth(this._activeBuffer.x)===0&&!ee.hasContent(this._activeBuffer.x)&&ee.setCellFromCodepoint(this._activeBuffer.x,0,1,Z),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,W){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,W):this._parser.registerCsiHandler(j,($=>!P($.params[0],this._optionsService.rawOptions.windowOptions)||W($)))}registerDcsHandler(j,W){return this._parser.registerDcsHandler(j,new b.DcsHandler(W))}registerEscHandler(j,W){return this._parser.registerEscHandler(j,W)}registerOscHandler(j,W){return this._parser.registerOscHandler(j,new M.OscHandler(W))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var j;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&j.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);W.hasWidth(this._activeBuffer.x)&&!W.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(j,W){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+W):(this._activeBuffer.x=j,this._activeBuffer.y=W),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,W){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+W)}cursorUp(j){const W=this._activeBuffer.y-this._activeBuffer.scrollTop;return W>=0?this._moveCursor(0,-Math.min(W,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const W=this._activeBuffer.scrollBottom-this._activeBuffer.y;return W>=0?this._moveCursor(0,Math.min(W,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const W=j.params[0];return W===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:W===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let W=j.params[0]||1;for(;W--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let W=j.params[0]||1;for(;W--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const W=j.params[0];return W===1&&(this._curAttrData.bg|=536870912),W!==2&&W!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,W,$,V=!1,J=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);re.replaceCells(W,$,this._activeBuffer.getNullCell(this._eraseAttrData()),J),V&&(re.isWrapped=!1)}_resetBufferLine(j,W=!1){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);$&&($.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),W),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),$.isWrapped=!1)}eraseInDisplay(j,W=!1){let $;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for($=this._activeBuffer.y,this._dirtyRowTracker.markDirty($),this._eraseInBufferLine($++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,W);$<this._bufferService.rows;$++)this._resetBufferLine($,W);this._dirtyRowTracker.markDirty($);break;case 1:for($=this._activeBuffer.y,this._dirtyRowTracker.markDirty($),this._eraseInBufferLine($,0,this._activeBuffer.x+1,!0,W),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get($+1).isWrapped=!1);$--;)this._resetBufferLine($,W);this._dirtyRowTracker.markDirty(0);break;case 2:for($=this._bufferService.rows,this._dirtyRowTracker.markDirty($-1);$--;)this._resetBufferLine($,W);this._dirtyRowTracker.markDirty(0);break;case 3:const V=this._activeBuffer.lines.length-this._bufferService.rows;V>0&&(this._activeBuffer.lines.trimStart(V),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-V,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-V,0),this._onScroll.fire(0))}return!0}eraseInLine(j,W=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,W);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,W);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,W)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let W=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=this._activeBuffer.ybase+this._activeBuffer.y,V=this._bufferService.rows-1-this._activeBuffer.scrollBottom,J=this._bufferService.rows-1+this._activeBuffer.ybase-V+1;for(;W--;)this._activeBuffer.lines.splice(J-1,1),this._activeBuffer.lines.splice($,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let W=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=this._activeBuffer.ybase+this._activeBuffer.y;let V;for(V=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-V;W--;)this._activeBuffer.lines.splice($,1),this._activeBuffer.lines.splice(V,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return W&&(W.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return W&&(W.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let W=j.params[0]||1;for(;W--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(j){let W=j.params[0]||1;for(;W--;)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(a.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=j.params[0]||1;for(let $=this._activeBuffer.scrollTop;$<=this._activeBuffer.scrollBottom;++$){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+$);V.deleteCells(0,W,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=j.params[0]||1;for(let $=this._activeBuffer.scrollTop;$<=this._activeBuffer.scrollBottom;++$){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+$);V.insertCells(0,W,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=j.params[0]||1;for(let $=this._activeBuffer.scrollTop;$<=this._activeBuffer.scrollBottom;++$){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+$);V.insertCells(this._activeBuffer.x,W,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=j.params[0]||1;for(let $=this._activeBuffer.scrollTop;$<=this._activeBuffer.scrollBottom;++$){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+$);V.deleteCells(this._activeBuffer.x,W,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return W&&(W.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const W=this._parser.precedingJoinState;if(!W)return!0;const $=j.params[0]||1,V=x.UnicodeService.extractWidth(W),J=this._activeBuffer.x-V,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(J),ie=new Uint32Array(re.length*$);let he=0;for(let U=0;U<re.length;){const Z=re.codePointAt(U)||0;ie[he++]=Z,U+=Z>65535?2:1}let Y=he;for(let U=1;U<$;++U)ie.copyWithin(Y,0,he),Y+=he;return this.print(ie,0,Y),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let W=0;W<j.length;W++)switch(j.params[W]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let W=0;W<j.length;W++)switch(j.params[W]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),this._charsetService.setgCharset(1,y.DEFAULT_CHARSET),this._charsetService.setgCharset(2,y.DEFAULT_CHARSET),this._charsetService.setgCharset(3,y.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(j){for(let W=0;W<j.length;W++)switch(j.params[W]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let W=0;W<j.length;W++)switch(j.params[W]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),j.params[W]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(j,W){const $=this._coreService.decPrivateModes,{activeProtocol:V,activeEncoding:J}=this._coreMouseService,re=this._coreService,{buffers:ie,cols:he}=this._bufferService,{active:Y,alt:U}=ie,Z=this._optionsService.rawOptions,ee=xe=>xe?1:2,pe=j.params[0];return ne=pe,Ee=W?pe===2?4:pe===4?ee(re.modes.insertMode):pe===12?3:pe===20?ee(Z.convertEol):0:pe===1?ee($.applicationCursorKeys):pe===3?Z.windowOptions.setWinLines?he===80?2:he===132?1:0:0:pe===6?ee($.origin):pe===7?ee($.wraparound):pe===8?3:pe===9?ee(V==="X10"):pe===12?ee(Z.cursorBlink):pe===25?ee(!re.isCursorHidden):pe===45?ee($.reverseWraparound):pe===66?ee($.applicationKeypad):pe===67?4:pe===1e3?ee(V==="VT200"):pe===1002?ee(V==="DRAG"):pe===1003?ee(V==="ANY"):pe===1004?ee($.sendFocus):pe===1005?4:pe===1006?ee(J==="SGR"):pe===1015?4:pe===1016?ee(J==="SGR_PIXELS"):pe===1048?1:pe===47||pe===1047||pe===1049?ee(Y===U):pe===2004?ee($.bracketedPasteMode):0,re.triggerDataEvent(`${u.C0.ESC}[${W?"":"?"}${ne};${Ee}$y`),!0;var ne,Ee}_updateAttrColor(j,W,$,V,J){return W===2?(j|=50331648,j&=-16777216,j|=C.AttributeData.fromColorRGB([$,V,J])):W===5&&(j&=-50331904,j|=33554432|255&$),j}_extractColor(j,W,$){const V=[0,0,-1,0,0,0];let J=0,re=0;do{if(V[re+J]=j.params[W+re],j.hasSubParams(W+re)){const ie=j.getSubParams(W+re);let he=0;do V[1]===5&&(J=1),V[re+he+1+J]=ie[he];while(++he<ie.length&&he+re+1+J<V.length);break}if(V[1]===5&&re+J>=2||V[1]===2&&re+J>=5)break;V[1]&&(J=1)}while(++re+W<j.length&&re+J<V.length);for(let ie=2;ie<V.length;++ie)V[ie]===-1&&(V[ie]=0);switch(V[0]){case 38:$.fg=this._updateAttrColor($.fg,V[1],V[3],V[4],V[5]);break;case 48:$.bg=this._updateAttrColor($.bg,V[1],V[3],V[4],V[5]);break;case 58:$.extended=$.extended.clone(),$.extended.underlineColor=this._updateAttrColor($.extended.underlineColor,V[1],V[3],V[4],V[5])}return re}_processUnderline(j,W){W.extended=W.extended.clone(),(!~j||j>5)&&(j=1),W.extended.underlineStyle=j,W.fg|=268435456,j===0&&(W.fg&=-268435457),W.updateExtended()}_processSGR0(j){j.fg=a.DEFAULT_ATTR_DATA.fg,j.bg=a.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const W=j.length;let $;const V=this._curAttrData;for(let J=0;J<W;J++)$=j.params[J],$>=30&&$<=37?(V.fg&=-50331904,V.fg|=16777216|$-30):$>=40&&$<=47?(V.bg&=-50331904,V.bg|=16777216|$-40):$>=90&&$<=97?(V.fg&=-50331904,V.fg|=16777224|$-90):$>=100&&$<=107?(V.bg&=-50331904,V.bg|=16777224|$-100):$===0?this._processSGR0(V):$===1?V.fg|=134217728:$===3?V.bg|=67108864:$===4?(V.fg|=268435456,this._processUnderline(j.hasSubParams(J)?j.getSubParams(J)[0]:1,V)):$===5?V.fg|=536870912:$===7?V.fg|=67108864:$===8?V.fg|=1073741824:$===9?V.fg|=2147483648:$===2?V.bg|=134217728:$===21?this._processUnderline(2,V):$===22?(V.fg&=-134217729,V.bg&=-134217729):$===23?V.bg&=-67108865:$===24?(V.fg&=-268435457,this._processUnderline(0,V)):$===25?V.fg&=-536870913:$===27?V.fg&=-67108865:$===28?V.fg&=-1073741825:$===29?V.fg&=2147483647:$===39?(V.fg&=-67108864,V.fg|=16777215&a.DEFAULT_ATTR_DATA.fg):$===49?(V.bg&=-67108864,V.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):$===38||$===48||$===58?J+=this._extractColor(j,J,V):$===53?V.bg|=1073741824:$===55?V.bg&=-1073741825:$===59?(V.extended=V.extended.clone(),V.extended.underlineColor=-1,V.updateExtended()):$===100?(V.fg&=-67108864,V.fg|=16777215&a.DEFAULT_ATTR_DATA.fg,V.bg&=-67108864,V.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",$);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const W=this._activeBuffer.y+1,$=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${W};${$}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const W=this._activeBuffer.y+1,$=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${W};${$}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(j){const W=j.params[0]||1;switch(W){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 $=W%2==1;return this._optionsService.options.cursorBlink=$,!0}setScrollRegion(j){const W=j.params[0]||1;let $;return(j.length<2||($=j.params[1])>this._bufferService.rows||$===0)&&($=this._bufferService.rows),$>W&&(this._activeBuffer.scrollTop=W-1,this._activeBuffer.scrollBottom=$-1,this._setCursor(0,0)),!0}windowOptions(j){if(!P(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const W=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:W!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:W!==0&&W!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),W!==0&&W!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:W!==0&&W!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),W!==0&&W!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(j){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const W=[],$=j.split(";");for(;$.length>1;){const V=$.shift(),J=$.shift();if(/^\d+$/.exec(V)){const re=parseInt(V);if(G(re))if(J==="?")W.push({type:0,index:re});else{const ie=(0,L.parseColor)(J);ie&&W.push({type:1,index:re,color:ie})}}}return W.length&&this._onColor.fire(W),!0}setHyperlink(j){const W=j.split(";");return!(W.length<2)&&(W[1]?this._createHyperlink(W[0],W[1]):!W[0]&&this._finishHyperlink())}_createHyperlink(j,W){this._getCurrentLinkId()&&this._finishHyperlink();const $=j.split(":");let V;const J=$.findIndex((re=>re.startsWith("id=")));return J!==-1&&(V=$[J].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:V,uri:W}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,W){const $=j.split(";");for(let V=0;V<$.length&&!(W>=this._specialColors.length);++V,++W)if($[V]==="?")this._onColor.fire([{type:0,index:this._specialColors[W]}]);else{const J=(0,L.parseColor)($[V]);J&&this._onColor.fire([{type:1,index:this._specialColors[W],color:J}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const W=[],$=j.split(";");for(let V=0;V<$.length;++V)if(/^\d+$/.exec($[V])){const J=parseInt($[V]);G(J)&&W.push({type:2,index:J})}return W.length&&this._onColor.fire(W),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(N[j[0]],y.CHARSETS[j[1]]||y.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new h.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let W=0;W<this._bufferService.rows;++W){const $=this._activeBuffer.ybase+this._activeBuffer.y+W,V=this._activeBuffer.lines.get($);V&&(V.fill(j),V.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,W){const $=this._bufferService.buffer,V=this._optionsService.rawOptions;return(J=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${J}${u.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${$.scrollTop+1};${$.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[V.cursorStyle]-(V.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,W){this._dirtyRowTracker.markRangeDirty(j,W)}}s.InputHandler=q;let X=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){K<this.start?this.start=K:K>this.end&&(this.end=K)}markRangeDirty(K,j){K>j&&(H=K,K=j,j=H),K<this.start&&(this.start=K),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G(K){return 0<=K&&K<256}X=p([v(0,D.IBufferService)],X)},844:(T,s)=>{function l(p){for(const v of p)v.dispose();p.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const p of this._disposables)p.dispose();this._disposables.length=0}register(p){return this._disposables.push(p),p}unregister(p){const v=this._disposables.indexOf(p);v!==-1&&this._disposables.splice(v,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(p){var v;this._isDisposed||p===this._value||((v=this._value)==null||v.dispose(),this._value=p)}clear(){this.value=void 0}dispose(){var p;this._isDisposed=!0,(p=this._value)==null||p.dispose(),this._value=void 0}},s.toDisposable=function(p){return{dispose:p}},s.disposeArray=l,s.getDisposeArrayDisposable=function(p){return{dispose:()=>l(p)}}},1505:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(v,u,y){this._data[v]||(this._data[v]={}),this._data[v][u]=y}get(v,u){return this._data[v]?this._data[v][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=l,s.FourKeyMap=class{constructor(){this._data=new l}set(p,v,u,y,S){this._data.get(p,v)||this._data.set(p,v,new l),this._data.get(p,v).set(u,y,S)}get(p,v,u,y){var S;return(S=this._data.get(p,v))==null?void 0:S.get(u,y)}clear(){this._data.clear()}}},6114:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const l=s.isNode?"node":navigator.userAgent,p=s.isNode?"node":navigator.platform;s.isFirefox=l.includes("Firefox"),s.isLegacyEdge=l.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(l),s.getSafariVersion=function(){if(!s.isSafari)return 0;const v=l.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(p),s.isIpad=p==="iPad",s.isIphone=p==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(p),s.isLinux=p.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(l)},6106:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let l=0;s.SortedList=class{constructor(p){this._getKey=p,this._array=[]}clear(){this._array.length=0}insert(p){this._array.length!==0?(l=this._search(this._getKey(p)),this._array.splice(l,0,p)):this._array.push(p)}delete(p){if(this._array.length===0)return!1;const v=this._getKey(p);if(v===void 0||(l=this._search(v),l===-1)||this._getKey(this._array[l])!==v)return!1;do if(this._array[l]===p)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===v);return!1}*getKeyIterator(p){if(this._array.length!==0&&(l=this._search(p),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===p))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===p)}forEachByKey(p,v){if(this._array.length!==0&&(l=this._search(p),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===p))do v(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===p)}values(){return[...this._array].values()}_search(p){let v=0,u=this._array.length-1;for(;u>=v;){let y=v+u>>1;const S=this._getKey(this._array[y]);if(S>p)u=y-1;else{if(!(S<p)){for(;y>0&&this._getKey(this._array[y-1])===p;)y--;return y}v=y+1}}return v}}},7226:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const p=l(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let k=0,g=0,a=S.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),g=Math.max(k,g),f=S.timeRemaining(),1.5*g>f)return a-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-k))}ms`),void this._start();a=f}this.clear()}}class u extends v{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const k=Date.now()+S;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!p.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},9282:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const p=l(643);s.updateWindowsModeWrappedState=function(v){const u=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),y=u==null?void 0:u.get(v.cols-1),S=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);S&&y&&(S.isWrapped=y[p.CHAR_DATA_CODE_INDEX]!==p.NULL_CELL_CODE&&y[p.CHAR_DATA_CODE_INDEX]!==p.WHITESPACE_CELL_CODE)}},3734:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new p}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}}s.AttributeData=l;class p{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,y=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=y}clone(){return new p(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=p},9092:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const p=l(6349),v=l(7226),u=l(3734),y=l(8437),S=l(4634),k=l(511),g=l(643),a=l(4863),f=l(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(d,h,C){this._hasScrollback=d,this._optionsService=h,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=y.DEFAULT_ATTR_DATA.clone(),this.savedCharset=f.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,g.WHITESPACE_CELL_CHAR,g.WHITESPACE_CELL_WIDTH,g.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,h){return new y.BufferLine(this._bufferService.cols,this.getNullCell(d),h)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const h=d+this._optionsService.rawOptions.scrollback;return h>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:h}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=y.DEFAULT_ATTR_DATA);let h=this._rows;for(;h--;)this.lines.push(this.getBlankLine(d))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,h){const C=this.getNullCell(y.DEFAULT_ATTR_DATA);let D=0;const x=this._getCorrectBufferLength(h);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<d)for(let b=0;b<this.lines.length;b++)D+=+this.lines.get(b).resize(d,C);let M=0;if(this._rows<h)for(let b=this._rows;b<h;b++)this.lines.length<h+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new y.BufferLine(d,C)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new y.BufferLine(d,C)));else for(let b=this._rows;b>h;b--)this.lines.length>h+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){const b=this.lines.length-x;b>0&&(this.lines.trimStart(b),this.ybase=Math.max(this.ybase-b,0),this.ydisp=Math.max(this.ydisp-b,0),this.savedY=Math.max(this.savedY-b,0)),this.lines.maxLength=x}this.x=Math.min(this.x,d-1),this.y=Math.min(this.y,h-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=h-1,this._isReflowEnabled&&(this._reflow(d,h),this._cols>d))for(let M=0;M<this.lines.length;M++)D+=+this.lines.get(M).resize(d,C);this._cols=d,this._rows=h,this._memoryCleanupQueue.clear(),D>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let h=0;for(;this._memoryCleanupPosition<this.lines.length;)if(h+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),h>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,h){this._cols!==d&&(d>this._cols?this._reflowLarger(d,h):this._reflowSmaller(d,h))}_reflowLarger(d,h){const C=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(y.DEFAULT_ATTR_DATA));if(C.length>0){const D=(0,S.reflowLargerCreateNewLayout)(this.lines,C);(0,S.reflowLargerApplyNewLayout)(this.lines,D.layout),this._reflowLargerAdjustViewport(d,h,D.countRemoved)}}_reflowLargerAdjustViewport(d,h,C){const D=this.getNullCell(y.DEFAULT_ATTR_DATA);let x=C;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<h&&this.lines.push(new y.BufferLine(d,D))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-C,0)}_reflowSmaller(d,h){const C=this.getNullCell(y.DEFAULT_ATTR_DATA),D=[];let x=0;for(let M=this.lines.length-1;M>=0;M--){let b=this.lines.get(M);if(!b||!b.isWrapped&&b.getTrimmedLength()<=d)continue;const L=[b];for(;b.isWrapped&&M>0;)b=this.lines.get(--M),L.unshift(b);const N=this.ybase+this.y;if(N>=M&&N<M+L.length)continue;const B=L[L.length-1].getTrimmedLength(),P=(0,S.reflowSmallerGetNewLineLengths)(L,this._cols,d),F=P.length-L.length;let H;H=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+F):Math.max(0,this.lines.length-this.lines.maxLength+F);const q=[];for(let $=0;$<F;$++){const V=this.getBlankLine(y.DEFAULT_ATTR_DATA,!0);q.push(V)}q.length>0&&(D.push({start:M+L.length+x,newLines:q}),x+=q.length),L.push(...q);let X=P.length-1,G=P[X];G===0&&(X--,G=P[X]);let K=L.length-F-1,j=B;for(;K>=0;){const $=Math.min(j,G);if(L[X]===void 0)break;if(L[X].copyCellsFrom(L[K],j-$,G-$,$,!0),G-=$,G===0&&(X--,G=P[X]),j-=$,j===0){K--;const V=Math.max(K,0);j=(0,S.getWrappedLineTrimmedLength)(L,V,this._cols)}}for(let $=0;$<L.length;$++)P[$]<d&&L[$].setCell(P[$],C);let W=F-H;for(;W-- >0;)this.ybase===0?this.y<h-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-h&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+F,this.ybase+h-1)}if(D.length>0){const M=[],b=[];for(let X=0;X<this.lines.length;X++)b.push(this.lines.get(X));const L=this.lines.length;let N=L-1,B=0,P=D[B];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let F=0;for(let X=Math.min(this.lines.maxLength-1,L+x-1);X>=0;X--)if(P&&P.start>N+F){for(let G=P.newLines.length-1;G>=0;G--)this.lines.set(X--,P.newLines[G]);X++,M.push({index:N+1,amount:P.newLines.length}),F+=P.newLines.length,P=D[++B]}else this.lines.set(X,b[N--]);let H=0;for(let X=M.length-1;X>=0;X--)M[X].index+=H,this.lines.onInsertEmitter.fire(M[X]),H+=M[X].amount;const q=Math.max(0,L+x-this.lines.maxLength);q>0&&this.lines.onTrimEmitter.fire(q)}}translateBufferLineToString(d,h,C=0,D){const x=this.lines.get(d);return x?x.translateToString(h,C,D):""}getWrappedRangeForLine(d){let h=d,C=d;for(;h>0&&this.lines.get(h).isWrapped;)h--;for(;C+1<this.lines.length&&this.lines.get(C+1).isWrapped;)C++;return{first:h,last:C}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].line===d&&(this.markers[h].dispose(),this.markers.splice(h--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const h=new a.Marker(d);return this.markers.push(h),h.register(this.lines.onTrim((C=>{h.line-=C,h.line<0&&h.dispose()}))),h.register(this.lines.onInsert((C=>{h.line>=C.index&&(h.line+=C.amount)}))),h.register(this.lines.onDelete((C=>{h.line>=C.index&&h.line<C.index+C.amount&&h.dispose(),h.line>C.index&&(h.line-=C.amount)}))),h.register(h.onDispose((()=>this._removeMarker(h)))),h}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const p=l(3734),v=l(511),u=l(643),y=l(482);s.DEFAULT_ATTR_DATA=Object.freeze(new p.AttributeData);let S=0;class k{constructor(a,f,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*a);const h=f||v.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let C=0;C<a;++C)this.setCell(C,h);this.length=a}get(a){const f=this._data[3*a+0],d=2097151&f;return[this._data[3*a+1],2097152&f?this._combined[a]:d?(0,y.stringFromCodePoint)(d):"",f>>22,2097152&f?this._combined[a].charCodeAt(this._combined[a].length-1):d]}set(a,f){this._data[3*a+1]=f[u.CHAR_DATA_ATTR_INDEX],f[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[a]=f[1],this._data[3*a+0]=2097152|a|f[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*a+0]=f[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|f[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(a){return this._data[3*a+0]>>22}hasWidth(a){return 12582912&this._data[3*a+0]}getFg(a){return this._data[3*a+1]}getBg(a){return this._data[3*a+2]}hasContent(a){return 4194303&this._data[3*a+0]}getCodePoint(a){const f=this._data[3*a+0];return 2097152&f?this._combined[a].charCodeAt(this._combined[a].length-1):2097151&f}isCombined(a){return 2097152&this._data[3*a+0]}getString(a){const f=this._data[3*a+0];return 2097152&f?this._combined[a]:2097151&f?(0,y.stringFromCodePoint)(2097151&f):""}isProtected(a){return 536870912&this._data[3*a+2]}loadCell(a,f){return S=3*a,f.content=this._data[S+0],f.fg=this._data[S+1],f.bg=this._data[S+2],2097152&f.content&&(f.combinedData=this._combined[a]),268435456&f.bg&&(f.extended=this._extendedAttrs[a]),f}setCell(a,f){2097152&f.content&&(this._combined[a]=f.combinedData),268435456&f.bg&&(this._extendedAttrs[a]=f.extended),this._data[3*a+0]=f.content,this._data[3*a+1]=f.fg,this._data[3*a+2]=f.bg}setCellFromCodepoint(a,f,d,h){268435456&h.bg&&(this._extendedAttrs[a]=h.extended),this._data[3*a+0]=f|d<<22,this._data[3*a+1]=h.fg,this._data[3*a+2]=h.bg}addCodepointToCell(a,f,d){let h=this._data[3*a+0];2097152&h?this._combined[a]+=(0,y.stringFromCodePoint)(f):2097151&h?(this._combined[a]=(0,y.stringFromCodePoint)(2097151&h)+(0,y.stringFromCodePoint)(f),h&=-2097152,h|=2097152):h=f|4194304,d&&(h&=-12582913,h|=d<<22),this._data[3*a+0]=h}insertCells(a,f,d){if((a%=this.length)&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,d),f<this.length-a){const h=new v.CellData;for(let C=this.length-a-f-1;C>=0;--C)this.setCell(a+f+C,this.loadCell(a+C,h));for(let C=0;C<f;++C)this.setCell(a+C,d)}else for(let h=a;h<this.length;++h)this.setCell(h,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(a,f,d){if(a%=this.length,f<this.length-a){const h=new v.CellData;for(let C=0;C<this.length-a-f;++C)this.setCell(a+C,this.loadCell(a+f+C,h));for(let C=this.length-f;C<this.length;++C)this.setCell(C,d)}else for(let h=a;h<this.length;++h)this.setCell(h,d);a&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,d),this.getWidth(a)!==0||this.hasContent(a)||this.setCellFromCodepoint(a,0,1,d)}replaceCells(a,f,d,h=!1){if(h)for(a&&this.getWidth(a-1)===2&&!this.isProtected(a-1)&&this.setCellFromCodepoint(a-1,0,1,d),f<this.length&&this.getWidth(f-1)===2&&!this.isProtected(f)&&this.setCellFromCodepoint(f,0,1,d);a<f&&a<this.length;)this.isProtected(a)||this.setCell(a,d),a++;else for(a&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,d),f<this.length&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f,0,1,d);a<f&&a<this.length;)this.setCell(a++,d)}resize(a,f){if(a===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*a;if(a>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const h=new Uint32Array(d);h.set(this._data),this._data=h}for(let h=this.length;h<a;++h)this.setCell(h,f)}else{this._data=this._data.subarray(0,d);const h=Object.keys(this._combined);for(let D=0;D<h.length;D++){const x=parseInt(h[D],10);x>=a&&delete this._combined[x]}const C=Object.keys(this._extendedAttrs);for(let D=0;D<C.length;D++){const x=parseInt(C[D],10);x>=a&&delete this._extendedAttrs[x]}}return this.length=a,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const a=new Uint32Array(this._data.length);return a.set(this._data),this._data=a,1}return 0}fill(a,f=!1){if(f)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,a);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,a)}}copyFrom(a){this.length!==a.length?this._data=new Uint32Array(a._data):this._data.set(a._data),this.length=a.length,this._combined={};for(const f in a._combined)this._combined[f]=a._combined[f];this._extendedAttrs={};for(const f in a._extendedAttrs)this._extendedAttrs[f]=a._extendedAttrs[f];this.isWrapped=a.isWrapped}clone(){const a=new k(0);a._data=new Uint32Array(this._data),a.length=this.length;for(const f in this._combined)a._combined[f]=this._combined[f];for(const f in this._extendedAttrs)a._extendedAttrs[f]=this._extendedAttrs[f];return a.isWrapped=this.isWrapped,a}getTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0])return a+(this._data[3*a+0]>>22);return 0}getNoBgTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0]||50331648&this._data[3*a+2])return a+(this._data[3*a+0]>>22);return 0}copyCellsFrom(a,f,d,h,C){const D=a._data;if(C)for(let M=h-1;M>=0;M--){for(let b=0;b<3;b++)this._data[3*(d+M)+b]=D[3*(f+M)+b];268435456&D[3*(f+M)+2]&&(this._extendedAttrs[d+M]=a._extendedAttrs[f+M])}else for(let M=0;M<h;M++){for(let b=0;b<3;b++)this._data[3*(d+M)+b]=D[3*(f+M)+b];268435456&D[3*(f+M)+2]&&(this._extendedAttrs[d+M]=a._extendedAttrs[f+M])}const x=Object.keys(a._combined);for(let M=0;M<x.length;M++){const b=parseInt(x[M],10);b>=f&&(this._combined[b-f+d]=a._combined[b])}}translateToString(a,f,d,h){f=f??0,d=d??this.length,a&&(d=Math.min(d,this.getTrimmedLength())),h&&(h.length=0);let C="";for(;f<d;){const D=this._data[3*f+0],x=2097151&D,M=2097152&D?this._combined[f]:x?(0,y.stringFromCodePoint)(x):u.WHITESPACE_CELL_CHAR;if(C+=M,h)for(let b=0;b<M.length;++b)h.push(f);f+=D>>22||1}return h&&h.push(f),C}}s.BufferLine=k},4841:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(l,p){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 p*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(T,s)=>{function l(p,v,u){if(v===p.length-1)return p[v].getTrimmedLength();const y=!p[v].hasContent(u-1)&&p[v].getWidth(u-1)===1,S=p[v+1].getWidth(0)===2;return y&&S?u-1:u}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(p,v,u,y,S){const k=[];for(let g=0;g<p.length-1;g++){let a=g,f=p.get(++a);if(!f.isWrapped)continue;const d=[p.get(g)];for(;a<p.length&&f.isWrapped;)d.push(f),f=p.get(++a);if(y>=g&&y<a){g+=d.length-1;continue}let h=0,C=l(d,h,v),D=1,x=0;for(;D<d.length;){const b=l(d,D,v),L=b-x,N=u-C,B=Math.min(L,N);d[h].copyCellsFrom(d[D],x,C,B,!1),C+=B,C===u&&(h++,C=0),x+=B,x===b&&(D++,x=0),C===0&&h!==0&&d[h-1].getWidth(u-1)===2&&(d[h].copyCellsFrom(d[h-1],u-1,C++,1,!1),d[h-1].setCell(u-1,S))}d[h].replaceCells(C,u,S);let M=0;for(let b=d.length-1;b>0&&(b>h||d[b].getTrimmedLength()===0);b--)M++;M>0&&(k.push(g+d.length-M),k.push(M)),g+=d.length-1}return k},s.reflowLargerCreateNewLayout=function(p,v){const u=[];let y=0,S=v[y],k=0;for(let g=0;g<p.length;g++)if(S===g){const a=v[++y];p.onDeleteEmitter.fire({index:g-k,amount:a}),g+=a-1,k+=a,S=v[++y]}else u.push(g);return{layout:u,countRemoved:k}},s.reflowLargerApplyNewLayout=function(p,v){const u=[];for(let y=0;y<v.length;y++)u.push(p.get(v[y]));for(let y=0;y<u.length;y++)p.set(y,u[y]);p.length=v.length},s.reflowSmallerGetNewLineLengths=function(p,v,u){const y=[],S=p.map(((f,d)=>l(p,d,v))).reduce(((f,d)=>f+d));let k=0,g=0,a=0;for(;a<S;){if(S-a<u){y.push(S-a);break}k+=u;const f=l(p,g,v);k>f&&(k-=f,g++);const d=p[g].getWidth(k-1)===2;d&&k--;const h=d?u-1:u;y.push(h),a+=h}return y},s.getWrappedLineTrimmedLength=l},5295:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const p=l(8460),v=l(844),u=l(9092);class y extends v.Disposable{constructor(k,g){super(),this._optionsService=k,this._bufferService=g,this._onBufferActivate=this.register(new p.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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.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(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,g){this._normal.resize(k,g),this._alt.resize(k,g),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}s.BufferSet=y},511:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const p=l(482),v=l(643),u=l(3734);class y extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const g=new y;return g.setFromCharData(k),g}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,p.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let g=!1;if(k[v.CHAR_DATA_CHAR_INDEX].length>2)g=!0;else if(k[v.CHAR_DATA_CHAR_INDEX].length===2){const a=k[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const f=k[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(a-55296)+f-56320+65536|k[v.CHAR_DATA_WIDTH_INDEX]<<22:g=!0}else g=!0}else this.content=k[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[v.CHAR_DATA_WIDTH_INDEX]<<22;g&&(this.combinedData=k[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=y},643:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const p=l(8460),v=l(844);class u{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}s.Marker=u,u._nextId=1},7116:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.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:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(T,s)=>{var l,p,v;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
115
|
-
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(l||(s.C0=l={})),(function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""})(p||(s.C1=p={})),(function(u){u.ST=`${l.ESC}\\`})(v||(s.C1_ESCAPED=v={}))},7399:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const p=l(2584),v={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:["'",'"']};s.evaluateKeyboardEvent=function(u,y,S,k){const g={type:0,cancel:!1,key:void 0},a=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?g.key=y?p.C0.ESC+"OA":p.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?g.key=y?p.C0.ESC+"OD":p.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?g.key=y?p.C0.ESC+"OC":p.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(g.key=y?p.C0.ESC+"OB":p.C0.ESC+"[B");break;case 8:g.key=u.ctrlKey?"\b":p.C0.DEL,u.altKey&&(g.key=p.C0.ESC+g.key);break;case 9:if(u.shiftKey){g.key=p.C0.ESC+"[Z";break}g.key=p.C0.HT,g.cancel=!0;break;case 13:g.key=u.altKey?p.C0.ESC+p.C0.CR:p.C0.CR,g.cancel=!0;break;case 27:g.key=p.C0.ESC,u.altKey&&(g.key=p.C0.ESC+p.C0.ESC),g.cancel=!0;break;case 37:if(u.metaKey)break;a?(g.key=p.C0.ESC+"[1;"+(a+1)+"D",g.key===p.C0.ESC+"[1;3D"&&(g.key=p.C0.ESC+(S?"b":"[1;5D"))):g.key=y?p.C0.ESC+"OD":p.C0.ESC+"[D";break;case 39:if(u.metaKey)break;a?(g.key=p.C0.ESC+"[1;"+(a+1)+"C",g.key===p.C0.ESC+"[1;3C"&&(g.key=p.C0.ESC+(S?"f":"[1;5C"))):g.key=y?p.C0.ESC+"OC":p.C0.ESC+"[C";break;case 38:if(u.metaKey)break;a?(g.key=p.C0.ESC+"[1;"+(a+1)+"A",S||g.key!==p.C0.ESC+"[1;3A"||(g.key=p.C0.ESC+"[1;5A")):g.key=y?p.C0.ESC+"OA":p.C0.ESC+"[A";break;case 40:if(u.metaKey)break;a?(g.key=p.C0.ESC+"[1;"+(a+1)+"B",S||g.key!==p.C0.ESC+"[1;3B"||(g.key=p.C0.ESC+"[1;5B")):g.key=y?p.C0.ESC+"OB":p.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(g.key=p.C0.ESC+"[2~");break;case 46:g.key=a?p.C0.ESC+"[3;"+(a+1)+"~":p.C0.ESC+"[3~";break;case 36:g.key=a?p.C0.ESC+"[1;"+(a+1)+"H":y?p.C0.ESC+"OH":p.C0.ESC+"[H";break;case 35:g.key=a?p.C0.ESC+"[1;"+(a+1)+"F":y?p.C0.ESC+"OF":p.C0.ESC+"[F";break;case 33:u.shiftKey?g.type=2:u.ctrlKey?g.key=p.C0.ESC+"[5;"+(a+1)+"~":g.key=p.C0.ESC+"[5~";break;case 34:u.shiftKey?g.type=3:u.ctrlKey?g.key=p.C0.ESC+"[6;"+(a+1)+"~":g.key=p.C0.ESC+"[6~";break;case 112:g.key=a?p.C0.ESC+"[1;"+(a+1)+"P":p.C0.ESC+"OP";break;case 113:g.key=a?p.C0.ESC+"[1;"+(a+1)+"Q":p.C0.ESC+"OQ";break;case 114:g.key=a?p.C0.ESC+"[1;"+(a+1)+"R":p.C0.ESC+"OR";break;case 115:g.key=a?p.C0.ESC+"[1;"+(a+1)+"S":p.C0.ESC+"OS";break;case 116:g.key=a?p.C0.ESC+"[15;"+(a+1)+"~":p.C0.ESC+"[15~";break;case 117:g.key=a?p.C0.ESC+"[17;"+(a+1)+"~":p.C0.ESC+"[17~";break;case 118:g.key=a?p.C0.ESC+"[18;"+(a+1)+"~":p.C0.ESC+"[18~";break;case 119:g.key=a?p.C0.ESC+"[19;"+(a+1)+"~":p.C0.ESC+"[19~";break;case 120:g.key=a?p.C0.ESC+"[20;"+(a+1)+"~":p.C0.ESC+"[20~";break;case 121:g.key=a?p.C0.ESC+"[21;"+(a+1)+"~":p.C0.ESC+"[21~";break;case 122:g.key=a?p.C0.ESC+"[23;"+(a+1)+"~":p.C0.ESC+"[23~";break;case 123:g.key=a?p.C0.ESC+"[24;"+(a+1)+"~":p.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(S&&!k||!u.altKey||u.metaKey)!S||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?g.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(g.key=p.C0.US),u.key==="@"&&(g.key=p.C0.NUL)):u.keyCode===65&&(g.type=1);else{const f=v[u.keyCode],d=f==null?void 0:f[u.shiftKey?1:0];if(d)g.key=p.C0.ESC+d;else if(u.keyCode>=65&&u.keyCode<=90){const h=u.ctrlKey?u.keyCode-64:u.keyCode+32;let C=String.fromCharCode(h);u.shiftKey&&(C=C.toUpperCase()),g.key=p.C0.ESC+C}else if(u.keyCode===32)g.key=p.C0.ESC+(u.ctrlKey?p.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let h=u.code.slice(3,4);u.shiftKey||(h=h.toLowerCase()),g.key=p.C0.ESC+h,g.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?g.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?g.key=p.C0.NUL:u.keyCode>=51&&u.keyCode<=55?g.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?g.key=p.C0.DEL:u.keyCode===219?g.key=p.C0.ESC:u.keyCode===220?g.key=p.C0.FS:u.keyCode===221&&(g.key=p.C0.GS)}return g}},482:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},s.utf32ToString=function(l,p=0,v=l.length){let u="";for(let y=p;y<v;++y){let S=l[y];S>65535?(S-=65536,u+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):u+=String.fromCharCode(S)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,p){const v=l.length;if(!v)return 0;let u=0,y=0;if(this._interim){const S=l.charCodeAt(y++);56320<=S&&S<=57343?p[u++]=1024*(this._interim-55296)+S-56320+65536:(p[u++]=this._interim,p[u++]=S),this._interim=0}for(let S=y;S<v;++S){const k=l.charCodeAt(S);if(55296<=k&&k<=56319){if(++S>=v)return this._interim=k,u;const g=l.charCodeAt(S);56320<=g&&g<=57343?p[u++]=1024*(k-55296)+g-56320+65536:(p[u++]=k,p[u++]=g)}else k!==65279&&(p[u++]=k)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,p){const v=l.length;if(!v)return 0;let u,y,S,k,g=0,a=0,f=0;if(this.interim[0]){let C=!1,D=this.interim[0];D&=(224&D)==192?31:(240&D)==224?15:7;let x,M=0;for(;(x=63&this.interim[++M])&&M<4;)D<<=6,D|=x;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=b-M;for(;f<L;){if(f>=v)return 0;if(x=l[f++],(192&x)!=128){f--,C=!0;break}this.interim[M++]=x,D<<=6,D|=63&x}C||(b===2?D<128?f--:p[g++]=D:b===3?D<2048||D>=55296&&D<=57343||D===65279||(p[g++]=D):D<65536||D>1114111||(p[g++]=D)),this.interim.fill(0)}const d=v-4;let h=f;for(;h<v;){for(;!(!(h<d)||128&(u=l[h])||128&(y=l[h+1])||128&(S=l[h+2])||128&(k=l[h+3]));)p[g++]=u,p[g++]=y,p[g++]=S,p[g++]=k,h+=4;if(u=l[h++],u<128)p[g++]=u;else if((224&u)==192){if(h>=v)return this.interim[0]=u,g;if(y=l[h++],(192&y)!=128){h--;continue}if(a=(31&u)<<6|63&y,a<128){h--;continue}p[g++]=a}else if((240&u)==224){if(h>=v)return this.interim[0]=u,g;if(y=l[h++],(192&y)!=128){h--;continue}if(h>=v)return this.interim[0]=u,this.interim[1]=y,g;if(S=l[h++],(192&S)!=128){h--;continue}if(a=(15&u)<<12|(63&y)<<6|63&S,a<2048||a>=55296&&a<=57343||a===65279)continue;p[g++]=a}else if((248&u)==240){if(h>=v)return this.interim[0]=u,g;if(y=l[h++],(192&y)!=128){h--;continue}if(h>=v)return this.interim[0]=u,this.interim[1]=y,g;if(S=l[h++],(192&S)!=128){h--;continue}if(h>=v)return this.interim[0]=u,this.interim[1]=y,this.interim[2]=S,g;if(k=l[h++],(192&k)!=128){h--;continue}if(a=(7&u)<<18|(63&y)<<12|(63&S)<<6|63&k,a<65536||a>1114111)continue;p[g++]=a}}return g}}},225:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const p=l(1480),v=[[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]],u=[[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 y;s.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let S=0;S<v.length;++S)y.fill(0,v[S][0],v[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?y[S]:(function(k,g){let a,f=0,d=g.length-1;if(k<g[0][0]||k>g[d][1])return!1;for(;d>=f;)if(a=f+d>>1,k>g[a][1])f=a+1;else{if(!(k<g[a][0]))return!0;d=a-1}return!1})(S,u)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,k){let g=this.wcwidth(S),a=g===0&&k!==0;if(a){const f=p.UnicodeService.extractWidth(k);f===0?a=!1:f>g&&(g=f)}return p.UnicodeService.createPropertyValue(0,g,a)}}},5981:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const p=l(8460),v=l(844);class u extends v.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let g;for(this._isSyncWriting=!0;g=this._writeBuffer.shift();){this._action(g);const a=this._callbacks.shift();a&&a()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,k){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+=S.length,this._writeBuffer.push(S),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(k)}_innerWrite(S=0,k=!0){const g=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const a=this._writeBuffer[this._bufferOffset],f=this._action(a,k);if(f){const h=C=>Date.now()-g>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(g,C);return void f.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(h)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=a.length,Date.now()-g>=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()}}s.WriteBuffer=u},5941:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.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})$/,p=/^[\da-f]+$/;function v(u,y){const S=u.toString(16),k=S.length<2?"0"+S:S;switch(y){case 4:return S[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}s.parseColor=function(u){if(!u)return;let y=u.toLowerCase();if(y.indexOf("rgb:")===0){y=y.slice(4);const S=l.exec(y);if(S){const k=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/k*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/k*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/k*255)]}}else if(y.indexOf("#")===0&&(y=y.slice(1),p.exec(y)&&[3,6,9,12].includes(y.length))){const S=y.length/3,k=[0,0,0];for(let g=0;g<3;++g){const a=parseInt(y.slice(S*g,S*g+S),16);k[g]=S===1?a<<4:S===2?a:S===3?a>>4:a>>8}return k}},s.toRgbString=function(u,y=16){const[S,k,g]=u;return`rgb:${v(S,y)}/${v(k,y)}/${v(g,y)}`}},5770:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const p=l(482),v=l(8742),u=l(5770),y=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=y,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=y}registerHandler(k,g){this._handlers[k]===void 0&&(this._handlers[k]=[]);const a=this._handlers[k];return a.push(g),{dispose:()=>{const f=a.indexOf(g);f!==-1&&a.splice(f,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=y,this._ident=0}hook(k,g){if(this.reset(),this._ident=k,this._active=this._handlers[k]||y,this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].hook(g);else this._handlerFb(this._ident,"HOOK",g)}put(k,g,a){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(k,g,a);else this._handlerFb(this._ident,"PUT",(0,p.utf32ToString)(k,g,a))}unhook(k,g=!0){if(this._active.length){let a=!1,f=this._active.length-1,d=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,a=g,d=this._stack.fallThrough,this._stack.paused=!1),!d&&a===!1){for(;f>=0&&(a=this._active[f].unhook(k),a!==!0);f--)if(a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,a;f--}for(;f>=0;f--)if(a=this._active[f].unhook(!1),a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,a}else this._handlerFb(this._ident,"UNHOOK",k);this._active=y,this._ident=0}};const S=new v.Params;S.addParam(0),s.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=S,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():S,this._data="",this._hitLimit=!1}put(k,g,a){this._hitLimit||(this._data+=(0,p.utf32ToString)(k,g,a),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let g=!1;if(this._hitLimit)g=!1;else if(k&&(g=this._handler(this._data,this._params),g instanceof Promise))return g.then((a=>(this._params=S,this._data="",this._hitLimit=!1,a)));return this._params=S,this._data="",this._hitLimit=!1,g}}},2015:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const p=l(844),v=l(8742),u=l(6242),y=l(6351);class S{constructor(f){this.table=new Uint8Array(f)}setDefault(f,d){this.table.fill(f<<4|d)}add(f,d,h,C){this.table[d<<8|f]=h<<4|C}addMany(f,d,h,C){for(let D=0;D<f.length;D++)this.table[d<<8|f[D]]=h<<4|C}}s.TransitionTable=S;const k=160;s.VT500_TRANSITION_TABLE=(function(){const a=new S(4095),f=Array.apply(null,Array(256)).map(((M,b)=>b)),d=(M,b)=>f.slice(M,b),h=d(32,127),C=d(0,24);C.push(25),C.push.apply(C,d(28,32));const D=d(0,14);let x;for(x in a.setDefault(1,0),a.addMany(h,0,2,0),D)a.addMany([24,26,153,154],x,3,0),a.addMany(d(128,144),x,3,0),a.addMany(d(144,152),x,3,0),a.add(156,x,0,0),a.add(27,x,11,1),a.add(157,x,4,8),a.addMany([152,158,159],x,0,7),a.add(155,x,11,3),a.add(144,x,11,9);return a.addMany(C,0,3,0),a.addMany(C,1,3,1),a.add(127,1,0,1),a.addMany(C,8,0,8),a.addMany(C,3,3,3),a.add(127,3,0,3),a.addMany(C,4,3,4),a.add(127,4,0,4),a.addMany(C,6,3,6),a.addMany(C,5,3,5),a.add(127,5,0,5),a.addMany(C,2,3,2),a.add(127,2,0,2),a.add(93,1,4,8),a.addMany(h,8,5,8),a.add(127,8,5,8),a.addMany([156,27,24,26,7],8,6,0),a.addMany(d(28,32),8,0,8),a.addMany([88,94,95],1,0,7),a.addMany(h,7,0,7),a.addMany(C,7,0,7),a.add(156,7,0,0),a.add(127,7,0,7),a.add(91,1,11,3),a.addMany(d(64,127),3,7,0),a.addMany(d(48,60),3,8,4),a.addMany([60,61,62,63],3,9,4),a.addMany(d(48,60),4,8,4),a.addMany(d(64,127),4,7,0),a.addMany([60,61,62,63],4,0,6),a.addMany(d(32,64),6,0,6),a.add(127,6,0,6),a.addMany(d(64,127),6,0,0),a.addMany(d(32,48),3,9,5),a.addMany(d(32,48),5,9,5),a.addMany(d(48,64),5,0,6),a.addMany(d(64,127),5,7,0),a.addMany(d(32,48),4,9,5),a.addMany(d(32,48),1,9,2),a.addMany(d(32,48),2,9,2),a.addMany(d(48,127),2,10,0),a.addMany(d(48,80),1,10,0),a.addMany(d(81,88),1,10,0),a.addMany([89,90,92],1,10,0),a.addMany(d(96,127),1,10,0),a.add(80,1,11,9),a.addMany(C,9,0,9),a.add(127,9,0,9),a.addMany(d(28,32),9,0,9),a.addMany(d(32,48),9,9,12),a.addMany(d(48,60),9,8,10),a.addMany([60,61,62,63],9,9,10),a.addMany(C,11,0,11),a.addMany(d(32,128),11,0,11),a.addMany(d(28,32),11,0,11),a.addMany(C,10,0,10),a.add(127,10,0,10),a.addMany(d(28,32),10,0,10),a.addMany(d(48,60),10,8,10),a.addMany([60,61,62,63],10,0,11),a.addMany(d(32,48),10,9,12),a.addMany(C,12,0,12),a.add(127,12,0,12),a.addMany(d(28,32),12,0,12),a.addMany(d(32,48),12,9,12),a.addMany(d(48,64),12,0,11),a.addMany(d(64,127),12,12,13),a.addMany(d(64,127),10,12,13),a.addMany(d(64,127),9,12,13),a.addMany(C,13,13,13),a.addMany(h,13,13,13),a.add(127,13,0,13),a.addMany([27,156,24,26],13,14,0),a.add(k,0,2,0),a.add(k,8,5,8),a.add(k,6,0,6),a.add(k,11,0,11),a.add(k,13,13,13),a})();class g extends p.Disposable{constructor(f=s.VT500_TRANSITION_TABLE){super(),this._transitions=f,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(d,h,C)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,h)=>{},this._escHandlerFb=d=>{},this._errorHandlerFb=d=>d,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,p.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new y.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(f,d=[64,126]){let h=0;if(f.prefix){if(f.prefix.length>1)throw new Error("only one byte as prefix supported");if(h=f.prefix.charCodeAt(0),h&&60>h||h>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(f.intermediates){if(f.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let D=0;D<f.intermediates.length;++D){const x=f.intermediates.charCodeAt(D);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");h<<=8,h|=x}}if(f.final.length!==1)throw new Error("final must be a single byte");const C=f.final.charCodeAt(0);if(d[0]>C||C>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return h<<=8,h|=C,h}identToString(f){const d=[];for(;f;)d.push(String.fromCharCode(255&f)),f>>=8;return d.reverse().join("")}setPrintHandler(f){this._printHandler=f}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(f,d){const h=this._identifier(f,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const C=this._escHandlers[h];return C.push(d),{dispose:()=>{const D=C.indexOf(d);D!==-1&&C.splice(D,1)}}}clearEscHandler(f){this._escHandlers[this._identifier(f,[48,126])]&&delete this._escHandlers[this._identifier(f,[48,126])]}setEscHandlerFallback(f){this._escHandlerFb=f}setExecuteHandler(f,d){this._executeHandlers[f.charCodeAt(0)]=d}clearExecuteHandler(f){this._executeHandlers[f.charCodeAt(0)]&&delete this._executeHandlers[f.charCodeAt(0)]}setExecuteHandlerFallback(f){this._executeHandlerFb=f}registerCsiHandler(f,d){const h=this._identifier(f);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const C=this._csiHandlers[h];return C.push(d),{dispose:()=>{const D=C.indexOf(d);D!==-1&&C.splice(D,1)}}}clearCsiHandler(f){this._csiHandlers[this._identifier(f)]&&delete this._csiHandlers[this._identifier(f)]}setCsiHandlerFallback(f){this._csiHandlerFb=f}registerDcsHandler(f,d){return this._dcsParser.registerHandler(this._identifier(f),d)}clearDcsHandler(f){this._dcsParser.clearHandler(this._identifier(f))}setDcsHandlerFallback(f){this._dcsParser.setHandlerFallback(f)}registerOscHandler(f,d){return this._oscParser.registerHandler(f,d)}clearOscHandler(f){this._oscParser.clearHandler(f)}setOscHandlerFallback(f){this._oscParser.setHandlerFallback(f)}setErrorHandler(f){this._errorHandler=f}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(f,d,h,C,D){this._parseStack.state=f,this._parseStack.handlers=d,this._parseStack.handlerPos=h,this._parseStack.transition=C,this._parseStack.chunkPos=D}parse(f,d,h){let C,D=0,x=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(h===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const b=this._parseStack.handlers;let L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&L>-1){for(;L>=0&&(C=b[L](this._params),C!==!0);L--)if(C instanceof Promise)return this._parseStack.handlerPos=L,C}this._parseStack.handlers=[];break;case 4:if(h===!1&&L>-1){for(;L>=0&&(C=b[L](),C!==!0);L--)if(C instanceof Promise)return this._parseStack.handlerPos=L,C}this._parseStack.handlers=[];break;case 6:if(D=f[this._parseStack.chunkPos],C=this._dcsParser.unhook(D!==24&&D!==26,h),C)return C;D===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(D=f[this._parseStack.chunkPos],C=this._oscParser.end(D!==24&&D!==26,h),C)return C;D===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let b=M;b<d;++b){switch(D=f[b],x=this._transitions.table[this.currentState<<8|(D<160?D:k)],x>>4){case 2:for(let F=b+1;;++F){if(F>=d||(D=f[F])<32||D>126&&D<k){this._printHandler(f,b,F),b=F-1;break}if(++F>=d||(D=f[F])<32||D>126&&D<k){this._printHandler(f,b,F),b=F-1;break}if(++F>=d||(D=f[F])<32||D>126&&D<k){this._printHandler(f,b,F),b=F-1;break}if(++F>=d||(D=f[F])<32||D>126&&D<k){this._printHandler(f,b,F),b=F-1;break}}break;case 3:this._executeHandlers[D]?this._executeHandlers[D]():this._executeHandlerFb(D),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:b,code:D,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const L=this._csiHandlers[this._collect<<8|D];let N=L?L.length-1:-1;for(;N>=0&&(C=L[N](this._params),C!==!0);N--)if(C instanceof Promise)return this._preserveStack(3,L,N,x,b),C;N<0&&this._csiHandlerFb(this._collect<<8|D,this._params),this.precedingJoinState=0;break;case 8:do switch(D){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(D-48)}while(++b<d&&(D=f[b])>47&&D<60);b--;break;case 9:this._collect<<=8,this._collect|=D;break;case 10:const B=this._escHandlers[this._collect<<8|D];let P=B?B.length-1:-1;for(;P>=0&&(C=B[P](),C!==!0);P--)if(C instanceof Promise)return this._preserveStack(4,B,P,x,b),C;P<0&&this._escHandlerFb(this._collect<<8|D),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|D,this._params);break;case 13:for(let F=b+1;;++F)if(F>=d||(D=f[F])===24||D===26||D===27||D>127&&D<k){this._dcsParser.put(f,b,F),b=F-1;break}break;case 14:if(C=this._dcsParser.unhook(D!==24&&D!==26),C)return this._preserveStack(6,[],0,x,b),C;D===27&&(x|=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 F=b+1;;F++)if(F>=d||(D=f[F])<32||D>127&&D<k){this._oscParser.put(f,b,F),b=F-1;break}break;case 6:if(C=this._oscParser.end(D!==24&&D!==26),C)return this._preserveStack(5,[],0,x,b),C;D===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&x}}}s.EscapeSequenceParser=g},6242:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const p=l(5770),v=l(482),u=[];s.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(y,S){this._handlers[y]===void 0&&(this._handlers[y]=[]);const k=this._handlers[y];return k.push(S),{dispose:()=>{const g=k.indexOf(S);g!==-1&&k.splice(g,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].start();else this._handlerFb(this._id,"START")}_put(y,S,k){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(y,S,k);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(y,S,k))}start(){this.reset(),this._state=1}put(y,S,k){if(this._state!==3){if(this._state===1)for(;S<k;){const g=y[S++];if(g===59){this._state=2,this._start();break}if(g<48||57<g)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+g-48}this._state===2&&k-S>0&&this._put(y,S,k)}}end(y,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,g=this._active.length-1,a=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,k=S,a=this._stack.fallThrough,this._stack.paused=!1),!a&&k===!1){for(;g>=0&&(k=this._active[g].end(y),k!==!0);g--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,k;g--}for(;g>=0;g--)if(k=this._active[g].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",y);this._active=u,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(y){this._handler=y,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(y,S,k){this._hitLimit||(this._data+=(0,v.utf32ToString)(y,S,k),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(y){let S=!1;if(this._hitLimit)S=!1;else if(y&&(S=this._handler(this._data),S instanceof Promise))return S.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,S}}},8742:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const l=2147483647;class p{static fromArray(u){const y=new p;if(!u.length)return y;for(let S=Array.isArray(u[0])?1:0;S<u.length;++S){const k=u[S];if(Array.isArray(k))for(let g=0;g<k.length;++g)y.addSubParam(k[g]);else y.addParam(k)}return y}constructor(u=32,y=32){if(this.maxLength=u,this.maxSubParamsLength=y,y>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(y),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new p(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let y=0;y<this.length;++y){u.push(this.params[y]);const S=this._subParamsIdx[y]>>8,k=255&this._subParamsIdx[y];k-S>0&&u.push(Array.prototype.slice.call(this._subParams,S,k))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>l?l:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>l?l:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const y=this._subParamsIdx[u]>>8,S=255&this._subParamsIdx[u];return S-y>0?this._subParams.subarray(y,S):null}getSubParamsAll(){const u={};for(let y=0;y<this.length;++y){const S=this._subParamsIdx[y]>>8,k=255&this._subParamsIdx[y];k-S>0&&(u[y]=this._subParams.slice(S,k))}return u}addDigit(u){let y;if(this._rejectDigits||!(y=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,k=S[y-1];S[y-1]=~k?Math.min(10*k+u,l):u}}s.Params=p},5741:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,p){const v={instance:p,dispose:p.dispose,isDisposed:!1};this._addons.push(v),p.dispose=()=>this._wrappedAddonDispose(v),p.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let p=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===l){p=v;break}if(p===-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(p,1)}}},8771:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const p=l(3785),v=l(511);s.BufferApiView=class{constructor(u,y){this._buffer=u,this.type=y}init(u){return this._buffer=u,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(u){const y=this._buffer.lines.get(u);if(y)return new p.BufferLineApiView(y)}getNullCell(){return new v.CellData}}},3785:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const p=l(511);s.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,u){if(!(v<0||v>=this._line.length))return u?(this._line.loadCell(v,u),u):this._line.loadCell(v,new p.CellData)}translateToString(v,u,y){return this._line.translateToString(v,u,y)}}},8285:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const p=l(8771),v=l(8460),u=l(844);class y extends u.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new p.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new p.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)}}s.BufferNamespaceApi=y},7975:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,p){return this._core.registerCsiHandler(l,(v=>p(v.toArray())))}addCsiHandler(l,p){return this.registerCsiHandler(l,p)}registerDcsHandler(l,p){return this._core.registerDcsHandler(l,((v,u)=>p(v,u.toArray())))}addDcsHandler(l,p){return this.registerDcsHandler(l,p)}registerEscHandler(l,p){return this._core.registerEscHandler(l,p)}addEscHandler(l,p){return this.registerEscHandler(l,p)}registerOscHandler(l,p){return this._core.registerOscHandler(l,p)}addOscHandler(l,p){return this.registerOscHandler(l,p)}}},7090:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.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(T,s,l){var p=this&&this.__decorate||function(a,f,d,h){var C,D=arguments.length,x=D<3?f:h===null?h=Object.getOwnPropertyDescriptor(f,d):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,f,d,h);else for(var M=a.length-1;M>=0;M--)(C=a[M])&&(x=(D<3?C(x):D>3?C(f,d,x):C(f,d))||x);return D>3&&x&&Object.defineProperty(f,d,x),x},v=this&&this.__param||function(a,f){return function(d,h){f(d,h,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const u=l(8460),y=l(844),S=l(5295),k=l(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let g=s.BufferService=class extends y.Disposable{get buffer(){return this.buffers.active}constructor(a){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(a.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(a.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(a,this))}resize(a,f){this.cols=a,this.rows=f,this.buffers.resize(a,f),this._onResize.fire({cols:a,rows:f})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(a,f=!1){const d=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===a.fg&&h.getBg(0)===a.bg||(h=d.getBlankLine(a,f),this._cachedBlankLine=h),h.isWrapped=f;const C=d.ybase+d.scrollTop,D=d.ybase+d.scrollBottom;if(d.scrollTop===0){const x=d.lines.isFull;D===d.lines.length-1?x?d.lines.recycle().copyFrom(h):d.lines.push(h.clone()):d.lines.splice(D+1,0,h.clone()),x?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const x=D-C+1;d.lines.shiftElements(C+1,x-1,-1),d.lines.set(D,h.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(a,f,d){const h=this.buffer;if(a<0){if(h.ydisp===0)return;this.isUserScrolling=!0}else a+h.ydisp>=h.ybase&&(this.isUserScrolling=!1);const C=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+a,h.ybase),0),C!==h.ydisp&&(f||this._onScroll.fire(h.ydisp))}};s.BufferService=g=p([v(0,k.IOptionsService)],g)},7994:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.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,p){this._charsets[l]=p,this.glevel===l&&(this.charset=p)}}},1753:function(T,s,l){var p=this&&this.__decorate||function(h,C,D,x){var M,b=arguments.length,L=b<3?C:x===null?x=Object.getOwnPropertyDescriptor(C,D):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(h,C,D,x);else for(var N=h.length-1;N>=0;N--)(M=h[N])&&(L=(b<3?M(L):b>3?M(C,D,L):M(C,D))||L);return b>3&&L&&Object.defineProperty(C,D,L),L},v=this&&this.__param||function(h,C){return function(D,x){C(D,x,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const u=l(2585),y=l(8460),S=l(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:h=>h.button!==4&&h.action===1&&(h.ctrl=!1,h.alt=!1,h.shift=!1,!0)},VT200:{events:19,restrict:h=>h.action!==32},DRAG:{events:23,restrict:h=>h.action!==32||h.button!==3},ANY:{events:31,restrict:h=>!0}};function g(h,C){let D=(h.ctrl?16:0)|(h.shift?4:0)|(h.alt?8:0);return h.button===4?(D|=64,D|=h.action):(D|=3&h.button,4&h.button&&(D|=64),8&h.button&&(D|=128),h.action===32?D|=32:h.action!==0||C||(D|=3)),D}const a=String.fromCharCode,f={DEFAULT:h=>{const C=[g(h,!1)+32,h.col+32,h.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${a(C[0])}${a(C[1])}${a(C[2])}`},SGR:h=>{const C=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${g(h,!0)};${h.col};${h.row}${C}`},SGR_PIXELS:h=>{const C=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${g(h,!0)};${h.x};${h.y}${C}`}};let d=s.CoreMouseService=class extends S.Disposable{constructor(h,C){super(),this._bufferService=h,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new y.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const D of Object.keys(k))this.addProtocol(D,k[D]);for(const D of Object.keys(f))this.addEncoding(D,f[D]);this.reset()}addProtocol(h,C){this._protocols[h]=C}addEncoding(h,C){this._encodings[h]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(h){if(!this._protocols[h])throw new Error(`unknown protocol "${h}"`);this._activeProtocol=h,this._onProtocolChange.fire(this._protocols[h].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(h){if(!this._encodings[h])throw new Error(`unknown encoding "${h}"`);this._activeEncoding=h}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(h){if(h.col<0||h.col>=this._bufferService.cols||h.row<0||h.row>=this._bufferService.rows||h.button===4&&h.action===32||h.button===3&&h.action!==32||h.button!==4&&(h.action===2||h.action===3)||(h.col++,h.row++,h.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,h,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(h))return!1;const C=this._encodings[this._activeEncoding](h);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=h,!0}explainEvents(h){return{down:!!(1&h),up:!!(2&h),drag:!!(4&h),move:!!(8&h),wheel:!!(16&h)}}_equalEvents(h,C,D){if(D){if(h.x!==C.x||h.y!==C.y)return!1}else if(h.col!==C.col||h.row!==C.row)return!1;return h.button===C.button&&h.action===C.action&&h.ctrl===C.ctrl&&h.alt===C.alt&&h.shift===C.shift}};s.CoreMouseService=d=p([v(0,u.IBufferService),v(1,u.ICoreService)],d)},6975:function(T,s,l){var p=this&&this.__decorate||function(d,h,C,D){var x,M=arguments.length,b=M<3?h:D===null?D=Object.getOwnPropertyDescriptor(h,C):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(d,h,C,D);else for(var L=d.length-1;L>=0;L--)(x=d[L])&&(b=(M<3?x(b):M>3?x(h,C,b):x(h,C))||b);return M>3&&b&&Object.defineProperty(h,C,b),b},v=this&&this.__param||function(d,h){return function(C,D){h(C,D,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const u=l(1439),y=l(8460),S=l(844),k=l(2585),g=Object.freeze({insertMode:!1}),a=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let f=s.CoreService=class extends S.Disposable{constructor(d,h,C){super(),this._bufferService=d,this._logService=h,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new y.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new y.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(g),this.decPrivateModes=(0,u.clone)(a)}reset(){this.modes=(0,u.clone)(g),this.decPrivateModes=(0,u.clone)(a)}triggerDataEvent(d,h=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;h&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),h&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,(()=>d.split("").map((D=>D.charCodeAt(0))))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,(()=>d.split("").map((h=>h.charCodeAt(0))))),this._onBinary.fire(d))}};s.CoreService=f=p([v(0,k.IBufferService),v(1,k.ILogService),v(2,k.IOptionsService)],f)},9074:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const p=l(8055),v=l(8460),u=l(844),y=l(6106);let S=0,k=0;class g extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new y.SortedList((d=>d==null?void 0:d.marker.line)),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(d){if(d.marker.isDisposed)return;const h=new a(d);if(h){const C=h.marker.onDispose((()=>h.dispose()));h.onDispose((()=>{h&&(this._decorations.delete(h)&&this._onDecorationRemoved.fire(h),C.dispose())})),this._decorations.insert(h),this._onDecorationRegistered.fire(h)}return h}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,h,C){let D=0,x=0;for(const M of this._decorations.getKeyIterator(h))D=M.options.x??0,x=D+(M.options.width??1),d>=D&&d<x&&(!C||(M.options.layer??"bottom")===C)&&(yield M)}forEachDecorationAtCell(d,h,C,D){this._decorations.forEachByKey(h,(x=>{S=x.options.x??0,k=S+(x.options.width??1),d>=S&&d<k&&(!C||(x.options.layer??"bottom")===C)&&D(x)}))}}s.DecorationService=g;class a extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=p.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=p.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(d){super(),this.options=d,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=d.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const p=l(2585),v=l(8343);class u{constructor(...S){this._entries=new Map;for(const[k,g]of S)this.set(k,g)}set(S,k){const g=this._entries.get(S);return this._entries.set(S,k),g}forEach(S){for(const[k,g]of this._entries.entries())S(k,g)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}s.ServiceCollection=u,s.InstantiationService=class{constructor(){this._services=new u,this._services.set(p.IInstantiationService,this)}setService(y,S){this._services.set(y,S)}getService(y){return this._services.get(y)}createInstance(y,...S){const k=(0,v.getServiceDependencies)(y).sort(((f,d)=>f.index-d.index)),g=[];for(const f of k){const d=this._services.get(f.id);if(!d)throw new Error(`[createInstance] ${y.name} depends on UNKNOWN service ${f.id}.`);g.push(d)}const a=k.length>0?k[0].index:S.length;if(S.length!==a)throw new Error(`[createInstance] First service dependency of ${y.name} at position ${a+1} conflicts with ${S.length} static arguments`);return new y(...S,...g)}}},7866:function(T,s,l){var p=this&&this.__decorate||function(a,f,d,h){var C,D=arguments.length,x=D<3?f:h===null?h=Object.getOwnPropertyDescriptor(f,d):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,f,d,h);else for(var M=a.length-1;M>=0;M--)(C=a[M])&&(x=(D<3?C(x):D>3?C(f,d,x):C(f,d))||x);return D>3&&x&&Object.defineProperty(f,d,x),x},v=this&&this.__param||function(a,f){return function(d,h){f(d,h,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=l(844),y=l(2585),S={trace:y.LogLevelEnum.TRACE,debug:y.LogLevelEnum.DEBUG,info:y.LogLevelEnum.INFO,warn:y.LogLevelEnum.WARN,error:y.LogLevelEnum.ERROR,off:y.LogLevelEnum.OFF};let k,g=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let f=0;f<a.length;f++)typeof a[f]=="function"&&(a[f]=a[f]())}_log(a,f,d){this._evalLazyOptionalParams(d),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...d)}trace(a,...f){var d;this._logLevel<=y.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,a,f)}debug(a,...f){var d;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,a,f)}info(a,...f){var d;this._logLevel<=y.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,a,f)}warn(a,...f){var d;this._logLevel<=y.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,a,f)}error(a,...f){var d;this._logLevel<=y.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,a,f)}};s.LogService=g=p([v(0,y.IOptionsService)],g),s.setTraceLogger=function(a){k=a},s.traceCall=function(a,f,d){if(typeof d.value!="function")throw new Error("not supported");const h=d.value;d.value=function(...C){if(k.logLevel!==y.LogLevelEnum.TRACE)return h.apply(this,C);k.trace(`GlyphRenderer#${h.name}(${C.map((x=>JSON.stringify(x))).join(", ")})`);const D=h.apply(this,C);return k.trace(`GlyphRenderer#${h.name} return`,D),D}}},7302:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const p=l(8460),v=l(844),u=l(6114);s.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:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const y=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends v.Disposable{constructor(g){super(),this._onOptionChange=this.register(new p.EventEmitter),this.onOptionChange=this._onOptionChange.event;const a={...s.DEFAULT_OPTIONS};for(const f in g)if(f in a)try{const d=g[f];a[f]=this._sanitizeAndValidateOption(f,d)}catch(d){console.error(d)}this.rawOptions=a,this.options={...a},this._setupOptions(),this.register((0,v.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(g,a){return this.onOptionChange((f=>{f===g&&a(this.rawOptions[g])}))}onMultipleOptionChange(g,a){return this.onOptionChange((f=>{g.indexOf(f)!==-1&&a()}))}_setupOptions(){const g=f=>{if(!(f in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);return this.rawOptions[f]},a=(f,d)=>{if(!(f in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);d=this._sanitizeAndValidateOption(f,d),this.rawOptions[f]!==d&&(this.rawOptions[f]=d,this._onOptionChange.fire(f))};for(const f in this.rawOptions){const d={get:g.bind(this,f),set:a.bind(this,f)};Object.defineProperty(this.options,f,d)}}_sanitizeAndValidateOption(g,a){switch(g){case"cursorStyle":if(a||(a=s.DEFAULT_OPTIONS[g]),!(function(f){return f==="block"||f==="underline"||f==="bar"})(a))throw new Error(`"${a}" is not a valid value for ${g}`);break;case"wordSeparator":a||(a=s.DEFAULT_OPTIONS[g]);break;case"fontWeight":case"fontWeightBold":if(typeof a=="number"&&1<=a&&a<=1e3)break;a=y.includes(a)?a:s.DEFAULT_OPTIONS[g];break;case"cursorWidth":a=Math.floor(a);case"lineHeight":case"tabStopWidth":if(a<1)throw new Error(`${g} cannot be less than 1, value: ${a}`);break;case"minimumContrastRatio":a=Math.max(1,Math.min(21,Math.round(10*a)/10));break;case"scrollback":if((a=Math.min(a,4294967295))<0)throw new Error(`${g} cannot be less than 0, value: ${a}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(a<=0)throw new Error(`${g} cannot be less than or equal to 0, value: ${a}`);break;case"rows":case"cols":if(!a&&a!==0)throw new Error(`${g} must be numeric, value: ${a}`);break;case"windowsPty":a=a??{}}return a}}s.OptionsService=S},2660:function(T,s,l){var p=this&&this.__decorate||function(S,k,g,a){var f,d=arguments.length,h=d<3?k:a===null?a=Object.getOwnPropertyDescriptor(k,g):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(S,k,g,a);else for(var C=S.length-1;C>=0;C--)(f=S[C])&&(h=(d<3?f(h):d>3?f(k,g,h):f(k,g))||h);return d>3&&h&&Object.defineProperty(k,g,h),h},v=this&&this.__param||function(S,k){return function(g,a){k(g,a,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const u=l(2585);let y=s.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const k=this._bufferService.buffer;if(S.id===void 0){const C=k.addMarker(k.ybase+k.y),D={data:S,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(D,C))),this._dataByLinkId.set(D.id,D),D.id}const g=S,a=this._getEntryIdKey(g),f=this._entriesWithId.get(a);if(f)return this.addLineToLink(f.id,k.ybase+k.y),f.id;const d=k.addMarker(k.ybase+k.y),h={id:this._nextId++,key:this._getEntryIdKey(g),data:g,lines:[d]};return d.onDispose((()=>this._removeMarkerFromLink(h,d))),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(S,k){const g=this._dataByLinkId.get(S);if(g&&g.lines.every((a=>a.line!==k))){const a=this._bufferService.buffer.addMarker(k);g.lines.push(a),a.onDispose((()=>this._removeMarkerFromLink(g,a)))}}getLinkData(S){var k;return(k=this._dataByLinkId.get(S))==null?void 0:k.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,k){const g=S.lines.indexOf(k);g!==-1&&(S.lines.splice(g,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};s.OscLinkService=y=p([v(0,u.IBufferService)],y)},8343:(T,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const l="di$target",p="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(v){return v[p]||[]},s.createDecorator=function(v){if(s.serviceRegistry.has(v))return s.serviceRegistry.get(v);const u=function(y,S,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(g,a,f){a[l]===a?a[p].push({id:g,index:f}):(a[p]=[{id:g,index:f}],a[l]=a)})(u,y,k)};return u.toString=()=>v,s.serviceRegistry.set(v,u),u}},2585:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const p=l(8343);var v;s.IBufferService=(0,p.createDecorator)("BufferService"),s.ICoreMouseService=(0,p.createDecorator)("CoreMouseService"),s.ICoreService=(0,p.createDecorator)("CoreService"),s.ICharsetService=(0,p.createDecorator)("CharsetService"),s.IInstantiationService=(0,p.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(v||(s.LogLevelEnum=v={})),s.ILogService=(0,p.createDecorator)("LogService"),s.IOptionsService=(0,p.createDecorator)("OptionsService"),s.IOscLinkService=(0,p.createDecorator)("OscLinkService"),s.IUnicodeService=(0,p.createDecorator)("UnicodeService"),s.IDecorationService=(0,p.createDecorator)("DecorationService")},1480:(T,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const p=l(8460),v=l(225);class u{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,k,g=!1){return(16777215&S)<<3|(3&k)<<1|(g?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new p.EventEmitter,this.onChange=this._onChange.event;const S=new v.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let k=0,g=0;const a=S.length;for(let f=0;f<a;++f){let d=S.charCodeAt(f);if(55296<=d&&d<=56319){if(++f>=a)return k+this.wcwidth(d);const D=S.charCodeAt(f);56320<=D&&D<=57343?d=1024*(d-55296)+D-56320+65536:k+=this.wcwidth(D)}const h=this.charProperties(d,g);let C=u.extractWidth(h);u.extractShouldJoin(h)&&(C-=u.extractWidth(g)),k+=C,g=h}return k}charProperties(S,k){return this._activeProvider.charProperties(S,k)}}s.UnicodeService=u}},m={};function w(T){var s=m[T];if(s!==void 0)return s.exports;var l=m[T]={exports:{}};return o[T].call(l.exports,l,l.exports,w),l.exports}var A={};return(()=>{var T=A;Object.defineProperty(T,"__esModule",{value:!0}),T.Terminal=void 0;const s=w(9042),l=w(3236),p=w(844),v=w(5741),u=w(8285),y=w(7975),S=w(7090),k=["cols","rows"];class g extends p.Disposable{constructor(f){super(),this._core=this.register(new l.Terminal(f)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const d=C=>this._core.options[C],h=(C,D)=>{this._checkReadonlyOptions(C),this._core.options[C]=D};for(const C in this._core.options){const D={get:d.bind(this,C),set:h.bind(this,C)};Object.defineProperty(this._publicOptions,C,D)}}_checkReadonlyOptions(f){if(k.includes(f))throw new Error(`Option "${f}" 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 y.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.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 u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const f=this._core.coreService.decPrivateModes;let d="none";switch(this._core.coreMouseService.activeProtocol){case"X10":d="x10";break;case"VT200":d="vt200";break;case"DRAG":d="drag";break;case"ANY":d="any"}return{applicationCursorKeysMode:f.applicationCursorKeys,applicationKeypadMode:f.applicationKeypad,bracketedPasteMode:f.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:f.origin,reverseWraparoundMode:f.reverseWraparound,sendFocusMode:f.sendFocus,wraparoundMode:f.wraparound}}get options(){return this._publicOptions}set options(f){for(const d in f)this._publicOptions[d]=f[d]}blur(){this._core.blur()}focus(){this._core.focus()}input(f,d=!0){this._core.input(f,d)}resize(f,d){this._verifyIntegers(f,d),this._core.resize(f,d)}open(f){this._core.open(f)}attachCustomKeyEventHandler(f){this._core.attachCustomKeyEventHandler(f)}attachCustomWheelEventHandler(f){this._core.attachCustomWheelEventHandler(f)}registerLinkProvider(f){return this._core.registerLinkProvider(f)}registerCharacterJoiner(f){return this._checkProposedApi(),this._core.registerCharacterJoiner(f)}deregisterCharacterJoiner(f){this._checkProposedApi(),this._core.deregisterCharacterJoiner(f)}registerMarker(f=0){return this._verifyIntegers(f),this._core.registerMarker(f)}registerDecoration(f){return this._checkProposedApi(),this._verifyPositiveIntegers(f.x??0,f.width??0,f.height??0),this._core.registerDecoration(f)}hasSelection(){return this._core.hasSelection()}select(f,d,h){this._verifyIntegers(f,d,h),this._core.select(f,d,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(f,d){this._verifyIntegers(f,d),this._core.selectLines(f,d)}dispose(){super.dispose()}scrollLines(f){this._verifyIntegers(f),this._core.scrollLines(f)}scrollPages(f){this._verifyIntegers(f),this._core.scrollPages(f)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(f){this._verifyIntegers(f),this._core.scrollToLine(f)}clear(){this._core.clear()}write(f,d){this._core.write(f,d)}writeln(f,d){this._core.write(f),this._core.write(`\r
|
|
116
|
-
`,d)}paste(f){this._core.paste(f)}refresh(f,d){this._verifyIntegers(f,d),this._core.refresh(f,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(f){this._addonManager.loadAddon(this,f)}static get strings(){return s}_verifyIntegers(...f){for(const d of f)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...f){for(const d of f)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}T.Terminal=g})(),A})()))})(cc)),cc.exports}var Rw=Tw();const Mw=8,Aw=100,Nw=80,Jd=6,Zd=.02,Dw=.95,Iw=50;function Pw(n,r){return Math.hypot(n,r)>Mw}function jw(n,r){const o=n[n.length-1];if(o===void 0||r-o.t>Nw)return 0;const m=n.filter(T=>o.t-T.t<=Aw),w=m[0];if(w===void 0||m.length<2||o.t===w.t)return 0;const A=(w.y-o.y)/(o.t-w.t);return Math.max(-Jd,Math.min(Jd,A))}function Ow(n,r){if(Math.abs(n)<Zd)return{delta:0,velocity:0};const o=Math.max(0,Math.min(Iw,r)),m=n*Dw**(o/16);return{delta:n*o,velocity:Math.abs(m)<Zd?0:m}}function Bw(n){const r=Math.trunc(n);return{pixels:r,rest:n-r}}const Fw=60;function Hw(){return new URLSearchParams(window.location.search).get("renderer")==="webgl"?"webgl":"canvas"}const ef={dark:{background:"#12141a",foreground:"#d8dee9",cursor:"#d8dee9",selectionBackground:"#2f3542"},light:{background:"#fbfbfd",foreground:"#22262e",cursor:"#22262e",selectionBackground:"#cfd8e3"}};function Vp({terminalId:n,connection:r,active:o,theme:m,autoFocus:w=!0}){const A=O.useRef(null),T=O.useRef(null),s=O.useRef(null),l=O.useRef(m);return l.current=m,O.useEffect(()=>{const p=A.current;if(p===null)return;const v=new Rw.Terminal({convertEol:!1,cursorBlink:!0,fontFamily:'"Cascadia Mono", "Consolas", "Menlo", "DejaVu Sans Mono", monospace',fontSize:14,lineHeight:1.2,scrollback:1e4,allowProposedApi:!0,theme:ef[l.current]});T.current=v;const u=new Cw.FitAddon;s.current=u,v.loadAddon(u),v.loadAddon(new kw.WebLinksAddon),v.open(p);let y=!1;const S=()=>{if(!(y||Hw()!=="webgl")){y=!0;try{const U=new Lw.WebglAddon;U.onContextLoss(()=>U.dispose()),v.loadAddon(U)}catch{console.info("[terminal] WebGL no disponible; se usa el renderer por defecto.")}}};let k={cols:0,rows:0},g;const a=()=>p.clientWidth>0&&p.clientHeight>0,f=U=>{const{cols:Z,rows:ee}=v;Z<=0||ee<=0||!U&&Z===k.cols&&ee===k.rows||(k={cols:Z,rows:ee},r.send({type:"resize",terminalId:n,cols:Z,rows:ee}))};let d={atBottom:!0,line:0},h=!1;const C=()=>{if(h||!a())return;const U=v.buffer.active;d={atBottom:U.viewportY>=U.baseY,line:U.viewportY}},D=()=>{const U=v.buffer.active;if(U.baseY===0)return;const Z=d.atBottom?U.baseY:Math.min(d.line,U.baseY);v.scrollToLine(Z>0?Z-1:Z+1),v.scrollToLine(Z)},x=v.onRender(C),M=v.onScroll(C);let b=a();const L=()=>{if(a()){try{u.fit()}catch{return}h&&(D(),h=!1),v.cols>0&&v.rows>0&&S(),f(!1)}},N=()=>{window.clearTimeout(g),g=window.setTimeout(L,Fw)},B=new ResizeObserver(()=>{const U=a();h=!0,U&&!b&&D(),b=U,N()});B.observe(p),window.addEventListener("resize",N);let P=null,F=0,H=0;const q=(U,Z,ee)=>{const pe=v.element;if(pe===void 0)return;const ne=Bw(H+U);H=ne.rest,ne.pixels!==0&&pe.dispatchEvent(new WheelEvent("wheel",{deltaY:ne.pixels,deltaMode:WheelEvent.DOM_DELTA_PIXEL,clientX:Z,clientY:ee,bubbles:!0,cancelable:!0}))},X=()=>{window.cancelAnimationFrame(F),F=0},G=(U,Z,ee)=>{let pe=U,ne=performance.now();const Ee=xe=>{if(!a()){F=0;return}const ce=Ow(pe,xe-ne);ne=xe,q(ce.delta,Z,ee),pe=ce.velocity,F=pe===0?0:window.requestAnimationFrame(Ee)};F=window.requestAnimationFrame(Ee)},K=(U,Z)=>{for(let ee=0;ee<U.length;ee++){const pe=U.item(ee);if(pe!==null&&pe.identifier===Z)return pe}return null},j=U=>{X(),H=0;const Z=U.touches.length===1?U.touches.item(0):null;P=Z===null?null:{id:Z.identifier,startX:Z.clientX,startY:Z.clientY,lastX:Z.clientX,lastY:Z.clientY,moving:!1,samples:[{t:U.timeStamp,y:Z.clientY}]}},W=U=>{if(U.stopPropagation(),P===null)return;const Z=K(U.touches,P.id);if(Z===null)return;if(!P.moving){if(!Pw(Z.clientX-P.startX,Z.clientY-P.startY))return;P.moving=!0}U.cancelable&&U.preventDefault();const ee=P.lastY-Z.clientY;P.lastX=Z.clientX,P.lastY=Z.clientY,P.samples.push({t:U.timeStamp,y:Z.clientY}),P.samples.length>32&&P.samples.shift(),q(ee,Z.clientX,Z.clientY)},$=U=>{if(P===null||K(U.changedTouches,P.id)===null)return;const Z=P;if(P=null,!Z.moving)return;const ee=jw(Z.samples,U.timeStamp);ee!==0&&G(ee,Z.lastX,Z.lastY)},V=()=>{P=null};p.addEventListener("touchstart",j,{capture:!0,passive:!0}),p.addEventListener("touchmove",W,{capture:!0,passive:!1}),p.addEventListener("touchend",$,{capture:!0,passive:!0}),p.addEventListener("touchcancel",V,{capture:!0,passive:!0});const J=()=>{if(!(document.visibilityState!=="visible"||!a())){try{u.fit()}catch{return}f(!0)}};window.addEventListener("focus",J),document.addEventListener("visibilitychange",J);const re=v.onData(U=>{r.send({type:"input",terminalId:n,data:U})}),ie=r.onMessage(U=>{switch(U.type){case"terminal.output":U.terminalId===n&&v.write(U.data);break;case"terminal.replay":if(U.terminalId!==n)break;v.reset(),U.truncated&&v.write(`\x1B[90m-- ${E("terminal.replayTruncated")} --\x1B[0m\r
|
|
117
|
-
`),v.write(U.data);break;case"terminal.exit":if(U.terminalId!==n)break;v.write(`\r
|
|
118
|
-
\x1B[90m-- ${E("terminal.exited",{code:U.exitCode})} --\x1B[0m\r
|
|
119
|
-
`);break}}),he=()=>{if(a())try{u.fit()}catch{}const U=v.cols>0?v.cols:80,Z=v.rows>0?v.rows:24;k={cols:U,rows:Z},r.send({type:"terminal.attach",terminalId:n,cols:U,rows:Z})};he();const Y=r.onReopen(he);return()=>{window.clearTimeout(g),window.removeEventListener("resize",N),window.removeEventListener("focus",J),document.removeEventListener("visibilitychange",J),B.disconnect(),X(),p.removeEventListener("touchstart",j,{capture:!0}),p.removeEventListener("touchmove",W,{capture:!0}),p.removeEventListener("touchend",$,{capture:!0}),p.removeEventListener("touchcancel",V,{capture:!0}),x.dispose(),M.dispose(),re.dispose(),ie(),Y(),r.send({type:"terminal.detach",terminalId:n}),v.dispose(),T.current=null,s.current=null}},[n,r]),O.useEffect(()=>{const p=T.current;p!==null&&(p.options.theme=ef[m])},[m]),O.useEffect(()=>{if(!o)return;const p=T.current,v=s.current;if(p===null||v===null)return;const u=window.setTimeout(()=>{const y=A.current;if(!(y===null||y.clientWidth===0||y.clientHeight===0)){try{v.fit()}catch{return}w&&p.focus(),p.cols>0&&p.rows>0&&r.send({type:"resize",terminalId:n,cols:p.cols,rows:p.rows})}},0);return()=>window.clearTimeout(u)},[o,w,n,r]),c.jsx("div",{className:`terminal-surface${o?"":" terminal-surface-hidden"}`,ref:A})}function $w({connection:n,shells:r,activeShellId:o,cwd:m,shellName:w,theme:A,onSelect:T,onOpen:s,onCloseShell:l,onCollapse:p}){const v=w??E("console.name"),u=r.find(y=>y.terminalId===o)??r[0]??null;return c.jsxs("section",{className:"console-pane",children:[c.jsxs("header",{className:"console-header",children:[c.jsxs("div",{className:"strip-tabs",children:[r.map((y,S)=>c.jsxs("div",{className:`strip-tab${y.terminalId===(u==null?void 0:u.terminalId)?" is-active":""}${y.alive?"":" is-dead"}`,children:[c.jsx("button",{className:"strip-tab-label",onClick:()=>T(y.terminalId),title:y.alive?E("console.tab.title",{shell:v,number:S+1,cwd:m}):E("console.tab.exited",{code:y.exitCode??"?"}),children:E("console.tab.label",{number:S+1})}),c.jsx("button",{className:"strip-tab-close",onClick:()=>l(y.terminalId),title:E("console.tab.close"),children:"×"})]},y.terminalId)),w!==null&&c.jsx("button",{className:"strip-tab-new",onClick:s,title:E("console.openAnother",{shell:v,cwd:m}),children:"+"})]}),c.jsx("span",{className:"strip-spacer"}),c.jsx("button",{className:"icon-button",onClick:p,title:E("console.collapse"),children:"▾"})]}),c.jsx("div",{className:"console-body",children:r.length===0?c.jsx("div",{className:"console-empty",children:w===null?c.jsx("p",{className:"panel-note",children:E("console.noShell")}):c.jsx("button",{className:"link-button",onClick:s,children:E("console.openIn",{shell:v,cwd:m})})}):c.jsx("div",{className:"terminal-stack",children:r.map(y=>c.jsx(Vp,{terminalId:y.terminalId,connection:n,active:y.terminalId===(u==null?void 0:u.terminalId),theme:A},y.terminalId))})})]})}const Uw=.75,Ww=.9;function Ln(n){if(n<1e3)return String(n);if(n<1e6){const r=n/1e3;return`${r<100?Fs(r,1):Math.round(r)}k`}return`${Fs(n/1e6,2)}M`}function zw({usage:n,source:r,instructionsFile:o,fallbackWindow:m=null,compact:w=!1,statusLineState:A=null,onConfigure:T}){const{lastRequestTokens:s,contextWindow:l}=n;if(T!==void 0&&A!==null&&$0(r,{state:A}))return c.jsxs("div",{className:`meter meter-idle${w?" meter-compact":""}`,title:U0(A),children:[c.jsx("span",{className:"meter-label",children:E("meter.label")}),c.jsx("span",{className:`meter-bar${w?" meter-bar-inline":""}`}),c.jsx("span",{className:"meter-value",children:E("meter.unmeasured")}),c.jsx("button",{className:"link-button",onClick:T,children:E("meter.configure")})]});if(r===null)return c.jsxs("div",{className:`meter meter-idle${w?" meter-compact":""}`,title:E("meter.noTokensTitle"),children:[c.jsx("span",{className:"meter-label",children:E("meter.label")}),c.jsx("span",{className:`meter-bar${w?" meter-bar-inline":""}`}),c.jsx("span",{className:"meter-value",children:E("meter.noTokens")})]});if(!H0(r,n)){const S=z0(o,r),k=F0(r,n,m);return c.jsxs("div",{className:`meter meter-idle${w?" meter-compact":""}`,title:S,children:[c.jsx("span",{className:"meter-label",children:E("meter.label")}),c.jsx("span",{className:`meter-bar${w?" meter-bar-inline":""}`}),c.jsxs("span",{className:"meter-value",children:[E("meter.unmeasured"),k!==null&&c.jsxs("span",{className:"meter-dim",children:[" / ",Ln(k)]})]})]})}const p=l!==null&&l>0?Math.min(s/l,1):null,v=p===null?"unknown":p>=Ww?"danger":p>=Uw?"warn":"ok",u=l===null?"":` / ${Ln(l)}${n.contextWindowEstimated?"+":""}`,y=W0(r,n);if(w){const S=[n.lastModel===null?null:n.lastModel,y,p===null?E("meter.unknownModelShort"):E("meter.windowPercent",{percent:Math.round(p*100)}),E("meter.output",{tokens:Ln(n.lastOutputTokens)}),r==="status-line"?E("meter.responses",{count:n.assistantMessages}):E("meter.sessionTotals",{output:Ln(n.totalOutputTokens),cache:Ln(n.totalCacheReadTokens),count:n.assistantMessages})].filter(k=>k!==null).join(" · ");return c.jsxs("div",{className:"meter meter-compact",title:S,children:[c.jsx("span",{className:"meter-label",children:E("meter.label")}),p!==null&&c.jsx("span",{className:"meter-bar meter-bar-inline",children:c.jsx("span",{className:`meter-fill meter-fill-${v}`,style:{width:`${p*100}%`}})}),c.jsxs("span",{className:"meter-value",children:[Ln(s),u.length>0&&c.jsx("span",{className:"meter-dim",children:u})]})]})}return c.jsxs("div",{className:"meter",children:[c.jsxs("div",{className:"meter-row",children:[c.jsx("span",{className:"meter-label",children:E("meter.label")}),c.jsxs("span",{className:"meter-value",children:[Ln(s),l!==null&&c.jsxs("span",{className:"meter-dim",title:n.lastModel===null?void 0:y!==null?E("meter.modelWithOrigin",{model:n.lastModel,origin:y}):n.lastModel,children:[" ","/ ",Ln(l),n.contextWindowEstimated&&"+"]})]})]}),p!==null?c.jsx("div",{className:"meter-bar",title:E("meter.windowPercent",{percent:Math.round(p*100)}),children:c.jsx("div",{className:`meter-fill meter-fill-${v}`,style:{width:`${p*100}%`}})}):c.jsx("div",{className:"meter-note",title:n.lastModel??void 0,children:E("meter.unknownModel")}),c.jsxs("div",{className:"meter-row meter-row-dim",children:[c.jsx("span",{title:E("meter.lastResponseTitle"),children:E("meter.output",{tokens:Ln(n.lastOutputTokens)})}),c.jsx("span",{title:E("meter.sessionTitle"),children:E("meter.sessionTotals",{output:Ln(n.totalOutputTokens),cache:Ln(n.totalCacheReadTokens),count:n.assistantMessages})})]})]})}const uc=["s","m","l"],qp="m",Vw="agent-workbench.thread-font",qw="agent-workbench.notes-font",Kw="s",Gw={s:"threadFont.size.s",m:"threadFont.size.m",l:"threadFont.size.l"};function tf(n){return E(Gw[n])}function Kp(n){const r=uc.indexOf(n);return uc[(r+1)%uc.length]??qp}function Yw(n){return n==="s"||n==="m"||n==="l"?n:null}function ua(n){return E("threadFont.title",{current:tf(n),next:tf(Kp(n))})}function Gp({agents:n,preselected:r,anchor:o,label:m=E("agentMenu.openWith"),onPick:w,onClose:A}){const T=O.useMemo(()=>Sp(n),[n]),[s,l]=O.useState(()=>X0(T,r)),[p,v]=O.useState(null),u=O.useRef(null),y=O.useRef([]);return O.useLayoutEffect(()=>{const S=u.current;if(S===null)return;const k=o.getBoundingClientRect(),g=S.getBoundingClientRect();v(J0({left:k.left,top:k.top,bottom:k.bottom},{width:g.width,height:g.height},{width:window.innerWidth,height:window.innerHeight}))},[o]),O.useEffect(()=>{var S;(S=y.current[s])==null||S.focus()},[s,p]),O.useEffect(()=>{const S=a=>{if(!(a.altKey||a.ctrlKey||a.metaKey)){if(a.key==="Escape"){a.preventDefault(),a.stopPropagation(),A(),o.focus();return}if(a.key==="ArrowDown"||a.key==="ArrowUp"){a.preventDefault(),a.stopPropagation(),l(f=>Q0(f,a.key==="ArrowDown"?1:-1,T.length));return}if(a.key==="Enter"){a.preventDefault(),a.stopPropagation();const f=T[s];f!==void 0&&w(f.id);return}a.key==="Tab"&&A()}},k=a=>{var d;const f=a.target;f instanceof Node&&((d=u.current)!=null&&d.contains(f)||o.contains(f))||A()},g=a=>{Z0(a.target,o,u.current)&&A()};return window.addEventListener("keydown",S,!0),document.addEventListener("pointerdown",k,!0),window.addEventListener("scroll",g,!0),window.addEventListener("resize",A),()=>{window.removeEventListener("keydown",S,!0),document.removeEventListener("pointerdown",k,!0),window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",A)}},[s,o,T,A,w]),Dp.createPortal(c.jsx("div",{ref:u,className:"agent-menu",role:"menu","aria-label":m,style:p===null?{left:0,top:0,visibility:"hidden"}:{left:`${p.left}px`,top:`${p.top}px`},children:T.map((S,k)=>c.jsxs("button",{ref:g=>{y.current[k]=g},className:`agent-menu-item${k===s?" agent-menu-item-active":""}`,role:"menuitem",tabIndex:k===s?0:-1,onMouseEnter:()=>l(k),onClick:()=>w(S.id),children:[c.jsx("span",{className:"agent-menu-label",children:S.label}),S.version!==null&&c.jsx("span",{className:"agent-menu-version",children:S.version})]},S.id))}),document.body)}function Yp({targets:n,className:r,text:o,blockedReason:m=null,onPick:w}){const[A,T]=O.useState(!1),s=O.useRef(null),l=O.useCallback(()=>T(!1),[]),p=O.useCallback(v=>{T(!1),w(v)},[w]);return n.length===0?null:c.jsxs(c.Fragment,{children:[c.jsx("button",{ref:s,className:r,onClick:()=>T(v=>!v),disabled:m!==null,"aria-haspopup":"menu","aria-expanded":A,title:m??ey(),children:o}),A&&s.current!==null&&c.jsx(Gp,{agents:n,preselected:null,anchor:s.current,label:E("continue.menuLabel"),onPick:p,onClose:l})]})}function Xp(n){switch(n.notice){case"compacted":return n.detail==="auto"?E("thread.notice.compactedAuto"):E("thread.notice.compacted");case"interrupted":return E("thread.notice.interrupted");case"error":return n.detail.length>0?E("thread.notice.error",{detail:n.detail}):E("thread.notice.errorNoDetail")}}const Qp="agent-workbench.locale",Jp="auto";function Xw(n){return n==="auto"||pp(n)?n:null}function Zp(n){const r=n.trim().replace(/_/g,"-").toLowerCase();if(r.length===0)return null;const o=Vc.find(A=>A.toLowerCase()===r);if(o!==void 0)return o;const[m="",...w]=r.split("-");return m==="zh"?w.includes("hant")||w.some(T=>T==="tw"||T==="hk"||T==="mo")?null:hc("zh-CN"):hc(m==="pt"?"pt-BR":m)}function hc(n){return pp(n)?n:null}function em(n,r){if(n!=="auto")return n;for(const o of r){const m=Zp(o);if(m!==null)return m}return"en"}function tm(n,r){for(const o of r)if(Zp(o)===n)try{if(Intl.DateTimeFormat.supportedLocalesOf([o]).length>0)return o}catch{}return h0(n)}let ha=Jp;const Pc=new Set;function Kc(){return Array.isArray(navigator.languages)&&navigator.languages.length>0?navigator.languages:typeof navigator.language=="string"?[navigator.language]:[]}function Qw(){return em("auto",Kc())}async function nm(n){const r=Kc(),o=em(n,r);await gp(o,tm(o,r))}async function Jw(){ha=yt(Qp,Jp,Xw);try{await nm(ha)}catch{await gp("en",tm("en",Kc()))}document.documentElement.lang=Mc(),mp(()=>{document.documentElement.lang=Mc()})}async function Zw(n){await nm(n),ha=n,ut(Qp,n);for(const r of Pc)r()}function e1(n){return Pc.add(n),()=>Pc.delete(n)}function t1(){return ha}function zi(){return O.useSyncExternalStore(mp,Mc)}function n1(){return O.useSyncExternalStore(e1,t1)}const rm=String.raw`https?:\/\/[^\s<>"'\`]+`,r1=new RegExp([String.raw`(\`[^\`\n]+\`)`,String.raw`(\*\*[^*\n]+\*\*)`,String.raw`(__[^_\n]+__)`,String.raw`(\*[^*\n]+\*)`,String.raw`(~~[^~\n]+~~)`,String.raw`(\[[^\]\n]+\]\([^)\s]+\))`,`(${rm})`].join("|")),s1=/^(https?:|mailto:)/i,i1=new RegExp(rm);function o1(n){const r=i1.exec(n);if(r===null||r.index===void 0)return null;const o=sm(r[0]);return{index:r.index,length:o.length,href:o}}function ea(n,r){let o=0;for(const m of n)m===r&&(o+=1);return o}function sm(n){let r=n;for(;;){const o=r.slice(-1);if(o.length===0)return r;if(".,;:!?".includes(o)){r=r.slice(0,-1);continue}if(o===")"&&ea(r,"(")<ea(r,")")){r=r.slice(0,-1);continue}if(o==="]"&&ea(r,"[")<ea(r,"]")){r=r.slice(0,-1);continue}return r}}function a1(n){const r=r1.exec(n);if(r===null||r.index===void 0)return null;const o=r[0],m=r.index,w=(T,s=o.length)=>({index:m,length:s,token:T});if(o.startsWith("`"))return w({kind:"code",text:o.slice(1,-1)});if(o.startsWith("**")||o.startsWith("__"))return w({kind:"strong",text:o.slice(2,-2)});if(o.startsWith("~~"))return w({kind:"del",text:o.slice(2,-2)});if(o.startsWith("*"))return w({kind:"em",text:o.slice(1,-1)});if(o.startsWith("[")){const T=o.indexOf("]("),s=o.slice(1,T),l=o.slice(T+2,-1);return s1.test(l)?w({kind:"link",label:s,href:l}):w({kind:"plain",text:o})}const A=sm(o);return w({kind:"link",label:A,href:A},A.length)}function wr(n,r,o){if(r.length===0)return[n];const m=n.toLowerCase(),w=r.toLowerCase(),A=[];let T=0,s=m.indexOf(w),l=0;for(;s!==-1;)s>T&&A.push(n.slice(T,s)),A.push(c.jsx("mark",{children:n.slice(s,s+r.length)},`${o}-m${l++}`)),T=s+r.length,s=m.indexOf(w,T);return T<n.length&&A.push(n.slice(T)),A}const l1=/^\[([^\]\n]+)\]\(([^)\s]+)\)$/;function c1(n,r){const o=l1.exec(n);if(o===null)return null;const m=o[2]??"",w=r(m);return w===null?null:{label:o[1]??"",href:m,open:w}}function Os(n,r,o,m){const w=[];let A=n,T=0;for(;A.length>0;){const s=a1(A);if(s===null){w.push(...wr(A,r,`${o}-${T++}`));break}s.index>0&&w.push(...wr(A.slice(0,s.index),r,`${o}-${T++}`));const l=`${o}-i${T++}`,{token:p}=s;switch(p.kind){case"code":w.push(c.jsx("code",{children:p.text},l));break;case"strong":w.push(c.jsx("strong",{children:wr(p.text,r,l)},l));break;case"del":w.push(c.jsx("del",{children:wr(p.text,r,l)},l));break;case"em":w.push(c.jsx("em",{children:wr(p.text,r,l)},l));break;case"link":w.push(c.jsx("a",{href:p.href,target:"_blank",rel:"noreferrer noopener",children:wr(p.label,r,l)},l));break;default:{const v=m===void 0?null:c1(p.text,m);if(v!==null){w.push(c.jsx("button",{className:"md-local-link",onClick:v.open,title:v.href,children:wr(v.label,r,l)},l));break}w.push(c.jsx("span",{children:wr(p.text,r,l)},l));break}}A=A.slice(s.index+s.length)}return w}function u1({code:n,language:r}){const[o,m]=O.useState(null),[w,A]=O.useState(!1),T=O.useRef(null);O.useEffect(()=>()=>{T.current!==null&&window.clearTimeout(T.current)},[]);const s=()=>{navigator.clipboard.writeText(n).then(()=>{A(!0),T.current!==null&&window.clearTimeout(T.current),T.current=window.setTimeout(()=>A(!1),1200)}).catch(()=>A(!1))};return O.useEffect(()=>{let l=!0;return In(async()=>{const{highlightCode:p}=await import("./highlight-2xGvJy1W.js");return{highlightCode:p}},[]).then(({highlightCode:p})=>{l&&m(p(n,r))}).catch(()=>{l&&m(null)}),()=>{l=!1}},[n,r]),c.jsxs("div",{className:"md-code-wrap",children:[c.jsx("pre",{className:"md-code hljs",children:o===null?c.jsx("code",{children:n}):c.jsx("code",{dangerouslySetInnerHTML:{__html:o}})}),c.jsxs("div",{className:"md-code-tools",children:[r!==null&&c.jsx("span",{className:"md-code-lang",children:r}),c.jsx("button",{className:"md-code-copy",onClick:s,title:E(w?"common.copied":"common.copyCode"),"aria-label":E("common.copyCode"),children:w?"✓":"⧉"})]})]})}const nf=/^(#{1,6})\s+(.*)$/,dc=/^\s{0,3}[-*+]\s+(.*)$/,Di=/^\s{0,3}(\d{1,3})[.)]\s+(.*)$/,ta=/^>\s?(.*)$/,fc=/^\s*```(\S*)\s*$/,rf=/^\s*(-{3,}|\*{3,}|_{3,})\s*$/,pc=/^\s*\|.*\|\s*$/,h1=/^\s*\|[\s:|-]+\|\s*$/;function sf(n){return n.trim().replace(/^\||\|$/g,"").split("|").map(r=>r.trim())}function Gc({text:n,needle:r="",localLink:o}){var T,s;const m=n.split(`
|
|
120
|
-
`),w=[];let A=0;for(;A<m.length;){const l=m[A]??"",p=`b${A}`,v=fc.exec(l);if(v!==null){const S=(v[1]??"").length>0?v[1]:null,k=[];for(A+=1;A<m.length&&!fc.test(m[A]??"");)k.push(m[A]??""),A+=1;A+=1,w.push({key:p,node:c.jsx(u1,{code:k.join(`
|
|
121
|
-
`),language:S},p)});continue}if(l.trim().length===0){A+=1;continue}if(rf.test(l)){w.push({key:p,node:c.jsx("hr",{className:"md-rule"},p)}),A+=1;continue}const u=nf.exec(l);if(u!==null){const S=Math.min((u[1]??"#").length,6);w.push({key:p,node:c.jsx("p",{className:`md-heading md-h${S}`,children:Os(u[2]??"",r,p,o)},p)}),A+=1;continue}if(pc.test(l)&&h1.test(m[A+1]??"")){const S=sf(l);A+=2;const k=[];for(;A<m.length&&pc.test(m[A]??"");)k.push(sf(m[A]??"")),A+=1;w.push({key:p,node:c.jsx("div",{className:"md-table-wrap",children:c.jsxs("table",{className:"md-table",children:[c.jsx("thead",{children:c.jsx("tr",{children:S.map((g,a)=>c.jsx("th",{children:Os(g,r,`${p}-h${a}`,o)},a))})}),c.jsx("tbody",{children:k.map((g,a)=>c.jsx("tr",{children:g.map((f,d)=>c.jsx("td",{children:Os(f,r,`${p}-${a}-${d}`,o)},d))},a))})]})},p)});continue}if(ta.test(l)){const S=[];for(;A<m.length&&ta.test(m[A]??"");)S.push(((T=ta.exec(m[A]??""))==null?void 0:T[1])??""),A+=1;w.push({key:p,node:c.jsx("blockquote",{className:"md-quote",children:Os(S.join(`
|
|
122
|
-
`),r,p,o)},p)});continue}if(dc.test(l)||Di.test(l)){const S=Di.test(l),k=S?Number(((s=Di.exec(l))==null?void 0:s[1])??"1"):1,g=[];for(;A<m.length;){const f=m[A]??"",d=dc.exec(f),h=Di.exec(f);if(S&&h!==null)g.push(h[2]??"");else if(!S&&d!==null)g.push(d[1]??"");else if(g.length>0&&/^\s{2,}\S/.test(f)&&d===null&&h===null)g[g.length-1]=`${g[g.length-1]??""} ${f.trim()}`;else break;A+=1}const a=g.map((f,d)=>c.jsx("li",{children:Os(f,r,`${p}-l${d}`,o)},d));w.push({key:p,node:S?c.jsx("ol",{className:"md-list",start:k===1?void 0:k,children:a},p):c.jsx("ul",{className:"md-list",children:a},p)});continue}const y=[];for(;A<m.length;){const S=m[A]??"";if(S.trim().length===0||fc.test(S)||nf.test(S)||dc.test(S)||Di.test(S)||ta.test(S)||rf.test(S)||pc.test(S))break;y.push(S),A+=1}w.push({key:p,node:c.jsx("p",{className:"md-paragraph",children:Os(y.join(`
|
|
123
|
-
`),r,p,o)},p)})}return c.jsx("div",{className:"md",children:w.map(l=>l.node)})}const im=[{key:"shell",names:["Bash","PowerShell","BashOutput","KillShell","shell_command","bash"],run:"tools.run.shell"},{key:"read",names:["Read","NotebookRead","read"],run:"tools.run.read"},{key:"find",names:["Glob","Grep","LS","grep","glob","list"],run:"tools.run.find"},{key:"edit",names:["Edit","Write","NotebookEdit","MultiEdit","apply_patch","edit","write"],run:"tools.run.edit"},{key:"web",names:["WebSearch","WebFetch","ToolSearch","webfetch","websearch","codesearch"],run:"tools.run.web"},{key:"agent",names:["Task","Agent","task"],run:"tools.run.agent"},{key:"todo",names:["TodoWrite","update_plan","todowrite","todoread"],run:"tools.run.todo"}];function mc(n){const r=im.find(o=>o.names.includes(n));return r===void 0?{key:`name:${n}`,known:!1}:{key:r.key,known:!0}}function d1(n,r,o){const m=im.find(w=>w.key===n);return m===void 0?E("tools.run.callsTo",{count:r,name:o}):E(m.run,{count:r})}function kt(n){if(!h_(n.key))return n.key;let r;if(n.params!==void 0){const o={};for(const[m,w]of Object.entries(n.params))o[m]=typeof w=="object"?kt(w):w;r=o}return E(`server.${n.key}`,r)}const gc={model:null,effort:null,contextWindow:null},f1=200,p1=2e4,m1={},g1={};function jc(n,r,o){return`${n}:${o}:${r}`}function _1(n,r){const[o,m]=O.useState([]),[w,A]=O.useState(Zl),[T,s]=O.useState(gc),[l,p]=O.useState("waiting"),[v,u]=O.useState(!1),[y,S]=O.useState(!1),[k,g]=O.useState({}),[a,f]=O.useState(null),[d,h]=O.useState(null),[C,D]=O.useState(!1),[x,M]=O.useState({}),[b,L]=O.useState({}),N=(r===null?void 0:x[r])??m1,B=(r===null?void 0:b[r])??g1,P=O.useRef(new Set),F=O.useRef(new Map),H=O.useRef(new Set),q=O.useCallback((J,re,ie)=>{L(he=>({...he,[J]:{...he[J]??{},[re]:ie}}))},[]),X=O.useCallback(J=>{L(re=>{let ie=!1;const he={};for(const[Y,U]of Object.entries(re))if(J in U){const Z={...U};delete Z[J],he[Y]=Z,ie=!0}else he[Y]=U;return ie?he:re})},[]),G=O.useCallback((J,re)=>{L(ie=>{const he=ie[J];if(he===void 0||!(re in he))return ie;const Y={...he};return delete Y[re],{...ie,[J]:Y}})},[]);O.useEffect(()=>{for(const J of o)for(const re of J.parts){if(re.kind!=="tool-result")continue;H.current.add(re.toolUseId);const ie=F.current.get(re.toolUseId);ie!==void 0&&(window.clearTimeout(ie),F.current.delete(re.toolUseId)),X(re.toolUseId)}},[o,X]),O.useEffect(()=>{const J=F.current;return()=>{for(const re of J.values())window.clearTimeout(re);J.clear()}},[]);const K=O.useRef(null);O.useEffect(()=>{if(r===null){m([]),A(Zl),s(gc),p("waiting"),u(!1),K.current=null;return}m([]),A(Zl),s(gc),p("waiting"),u(!1),S(!1),g({}),f(null),h(null),D(!1),P.current.clear(),K.current=null;const J=n.onMessage(ie=>{var he;switch(ie.type){case"conversation.reset":if(ie.terminalId!==r)break;m(ie.events),A(ie.usage),s(ie.defaults),f(ie.permissionMode),h(ie.waitingFor),D(ie.openToolCall),p(ie.state),u(ie.hasMore),S(!1),K.current=((he=ie.events[0])==null?void 0:he.eventId)??null;break;case"conversation.append":{if(ie.terminalId!==r)break;m(Y=>{var ee;const U=new Set(Y.map(pe=>pe.eventId)),Z=ie.events.filter(pe=>!U.has(pe.eventId));return Z.length===0?Y:(K.current===null&&(K.current=((ee=Z[0])==null?void 0:ee.eventId)??null),[...Y,...Z])}),A(ie.usage),ie.permissionMode!==null&&f(ie.permissionMode),p("live");break}case"conversation.page":{if(ie.terminalId!==r)break;m(Y=>{var ee;const U=new Set(Y.map(pe=>pe.eventId)),Z=ie.events.filter(pe=>!U.has(pe.eventId));return Z.length===0?Y:(K.current=((ee=Z[0])==null?void 0:ee.eventId)??K.current,[...Z,...Y])}),u(ie.hasMore),S(!1);break}case"conversation.turns":{if(ie.terminalId!==r)break;const Y=new Map(ie.turns.map(U=>[U.eventId,U.durationMs]));m(U=>U.map(Z=>{const ee=Y.get(Z.eventId);return ee===void 0?Z:{...Z,durationMs:ee}}));break}case"conversation.parts":{if(ie.terminalId!==r)break;const Y=new Map(ie.updates.map(U=>[U.eventId,U.parts]));m(U=>U.map(Z=>{const ee=Y.get(Z.eventId);return ee===void 0?Z:{...Z,parts:ee}}));break}case"conversation.imageData":{if(ie.terminalId!==r)break;const Y=jc(ie.eventId,ie.index,ie.source);g(U=>({...U,[Y]:ie.data===null?null:`data:${ie.mediaType};base64,${ie.data}`}));break}case"conversation.state":if(ie.terminalId!==r)break;p(ie.state);break;case"conversation.mode":if(ie.terminalId!==r)break;f(ie.mode);break;case"conversation.waiting":if(ie.terminalId!==r)break;h(ie.waitingFor);break;case"conversation.toolCall":if(ie.terminalId!==r)break;D(ie.open);break;case"error":{if(ie.code!=="answer-failed"||r===null)break;for(const[Y,U]of F.current)window.clearTimeout(U),F.current.delete(Y),M(Z=>{const ee=Z[r];if(ee===void 0||!(Y in ee))return Z;const pe={...ee};return delete pe[Y],{...Z,[r]:pe}}),q(r,Y,kt(ie.text));break}}});n.send({type:"conversation.subscribe",terminalId:r});const re=n.onReopen(()=>{n.send({type:"conversation.subscribe",terminalId:r})});return()=>{J(),re(),n.send({type:"conversation.unsubscribe",terminalId:r})}},[n,r,q]);const j=O.useCallback(()=>{const J=K.current;r===null||J===null||y||(S(!0),n.send({type:"conversation.loadMore",terminalId:r,beforeEventId:J,limit:f1}))},[n,r,y]),W=O.useCallback((J,re,ie)=>{if(r===null)return;const he=jc(J,re,ie);P.current.has(he)||(P.current.add(he),n.send({type:"conversation.image",terminalId:r,eventId:J,index:re,source:ie}))},[n,r]),$=O.useCallback((J,re)=>{if(r===null)return;M(he=>{const Y=he[r]??{};return J in Y?he:{...he,[r]:{...Y,[J]:re}}}),G(r,J),n.send({type:"agent.answer",terminalId:r,toolUseId:J,selections:re});const ie=window.setTimeout(()=>{H.current.has(J)||(M(he=>{const Y=he[r];if(Y===void 0||!(J in Y))return he;const U={...Y};return delete U[J],{...he,[r]:U}}),q(r,J,E("conversation.answerUnconfirmed")))},p1);F.current.set(J,ie)},[n,r,q,G]),V=O.useCallback(J=>{r!==null&&n.send({type:"agent.mode",terminalId:r,mode:J})},[n,r]);return{events:o,usage:w,defaults:T,state:l,permissionMode:a,waitingFor:d,openToolCall:C,hasMore:v,loadingMore:y,loadMore:j,images:k,requestImage:W,answer:$,answered:N,answerFailed:B,setPermissionMode:V}}const v1=80,of=5;function na(n){return!Array.isArray(n)}function af(n){const r=[];for(const o of n.parts){if(o.kind!=="tool-call")return null;r.push(o.name)}return r.length>0?r:null}function y1(n){const r=[];let o=0;for(;o<n.length;){const m=n[o];if(m===void 0)break;const w=af(m),A=w===null?null:mc(w[0]??"");if(!(w!==null&&A!==null&&w.every(v=>mc(v).key===A.key))||w===null||A===null){r.push({kind:"card",card:m}),o+=1;continue}const s=[m];let l=w.length,p=o+1;for(;p<n.length;){const v=n[p];if(v===void 0)break;const u=af(v);if(u===null||!u.every(y=>mc(y).key===A.key))break;s.push(v),l+=u.length,p+=1}if(l<2){r.push({kind:"card",card:m}),o+=1;continue}r.push({kind:"tools",id:`tools-${m.event.eventId}`,summary:d1(A.key,l,w[0]??""),at:m.event.at,cards:s}),o=p}return r}function w1(n){switch(n.kind){case"text":return n.text;case"tool-call":return`${n.name} ${n.input}`;case"tool-result":return n.text;case"question":return n.questions.map(r=>`${r.question} ${r.options.map(o=>o.label).join(" ")}`).join(`
|
|
124
|
-
`);case"notice":return Xp(n);case"thinking":case"image":return""}}function lf(n,r){const o=[];for(const m of n.parts)if(o.push(w1(m)),m.kind==="tool-call"){const w=r.get(m.toolUseId);w!==void 0&&o.push(w.text)}return o.join(`
|
|
125
|
-
`)}function xr(n,r){if(r.length===0)return c.jsx(c.Fragment,{children:n});const o=n.toLowerCase(),m=r.toLowerCase(),w=[];let A=0,T=o.indexOf(m),s=0;for(;T!==-1;)T>A&&w.push(c.jsx("span",{children:n.slice(A,T)},s++)),w.push(c.jsx("mark",{children:n.slice(T,T+r.length)},s++)),A=T+r.length,T=o.indexOf(m,A);return A<n.length&&w.push(c.jsx("span",{children:n.slice(A)},s++)),c.jsx(c.Fragment,{children:w})}function om(n,r){const o=[];let m=n,w=0;for(;m.length>0;){const A=o1(m);if(A===null){o.push(c.jsx("span",{children:xr(m,r)},w++));break}A.index>0&&o.push(c.jsx("span",{children:xr(m.slice(0,A.index),r)},w++)),o.push(c.jsx("a",{href:A.href,target:"_blank",rel:"noreferrer noopener",children:xr(A.href,r)},w++)),m=m.slice(A.index+A.length)}return c.jsx(c.Fragment,{children:o})}function b1({view:n,terminalId:r,onRewind:o,questionsAnswerable:m,contextWindowSource:w,instructionsFile:A,onGoToCli:T,cliPresence:s,exitCode:l,onWakeCli:p,waking:v,discovering:u=!1,toolCallNotice:y=null,serverClosed:S=null,statusLineState:k=null,onConfigureStatusLine:g,threadFont:a,continueTargets:f=[],continueBlockedReason:d=null,onContinue:h,searchRequest:C=null,onSearchRequestApplied:D}){const{events:x,usage:M,defaults:b,state:L,waitingFor:N,hasMore:B,loadingMore:P,loadMore:F,images:H,requestImage:q,answer:X,answered:G,answerFailed:K}=n,j=zi(),[W,$]=O.useState(""),[V,J]=O.useState(0),[re,ie]=O.useState(null);O.useEffect(()=>{C!==null&&($(C.query),D==null||D(C.seq))},[C,D]);const he=O.useRef(null),Y=O.useRef(new Map),U=O.useRef(!0),{cards:Z,results:ee}=O.useMemo(()=>{const ve=new Map,Re=new Set;for(const ke of x)for(const Fe of ke.parts)Fe.kind==="tool-result"?ve.set(Fe.toolUseId,Fe):(Fe.kind==="tool-call"||Fe.kind==="question")&&Re.add(Fe.toolUseId);const Ie=[];for(const ke of x){const Fe=ke.parts.filter($e=>$e.kind!=="thinking"&&!($e.kind==="tool-result"&&Re.has($e.toolUseId)));Fe.length!==0&&Ie.push({event:ke,parts:Fe})}return{cards:Ie,results:ve}},[x]),pe=O.useMemo(()=>y1(Z),[Z,j]),ne=W.trim(),Ee=O.useMemo(()=>{if(ne.length===0)return[];const ve=ne.toLowerCase();return Z.filter(Re=>lf(Re,ee).toLowerCase().includes(ve)).map(Re=>Re.event.eventId)},[Z,ee,ne,j]);O.useEffect(()=>{J(0)},[ne]);const xe=O.useMemo(()=>new Set(Ee),[Ee]),ce=Ee[V]??null;O.useEffect(()=>{var ve;ce!==null&&((ve=Y.current.get(ce))==null||ve.scrollIntoView({block:"center"}))},[ce]),O.useLayoutEffect(()=>{U.current=!0},[r]),O.useLayoutEffect(()=>{const ve=he.current;ve===null||!U.current||ne.length>0||(ve.scrollTop=ve.scrollHeight)},[Z.length,ne]);const Se=O.useCallback(()=>{const ve=he.current;if(ve===null)return;const Re=ve.scrollHeight-ve.scrollTop-ve.clientHeight;U.current=Re<=v1},[]),me=O.useCallback((ve,Re)=>{Re===null?Y.current.delete(ve):Y.current.set(ve,Re)},[]),Ze=O.useCallback(ve=>{const Re=lf(ve,ee);navigator.clipboard.writeText(Re).then(()=>{ie(ve.event.eventId),window.setTimeout(()=>ie(null),1200)}).catch(()=>ie(null))},[ee,j]),qe=ve=>{Ee.length!==0&&J(Re=>(Re+ve+Ee.length)%Ee.length)};return c.jsxs("div",{className:"conversation-pane",children:[c.jsxs("div",{className:"conversation-search",children:[c.jsx("input",{className:"conversation-search-input",type:"search",placeholder:E("thread.search.placeholder"),value:W,onChange:ve=>$(ve.target.value),onKeyDown:ve=>{ve.key==="Enter"&&qe(ve.shiftKey?-1:1),ve.stopPropagation()},spellCheck:!1}),ne.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"conversation-matches",children:Ee.length===0?E("thread.search.none"):`${V+1}/${Ee.length}`}),c.jsx("button",{className:"icon-button",onClick:()=>qe(-1),disabled:Ee.length===0,title:E("thread.search.previous"),children:"↑"}),c.jsx("button",{className:"icon-button",onClick:()=>qe(1),disabled:Ee.length===0,title:E("thread.search.next"),children:"↓"})]}),c.jsx("span",{className:"conversation-spacer"}),h!==void 0&&c.jsx(Yp,{targets:f,className:"icon-button conversation-continue",text:E("thread.continueWith"),blockedReason:d,onPick:h}),a!==void 0&&c.jsx("button",{className:"icon-button thread-font-button",onClick:a.cycle,title:ua(a.size),"aria-label":ua(a.size),children:c.jsxs("span",{"aria-hidden":"true",children:["a",c.jsx("span",{className:"thread-font-big",children:"A"})]})}),c.jsx(zw,{usage:M,source:w,instructionsFile:A,fallbackWindow:b.contextWindow,compact:!0,statusLineState:k,onConfigure:g})]}),c.jsxs("div",{className:"conversation-scroll",ref:he,onScroll:Se,children:[B&&c.jsx("button",{className:"conversation-more",onClick:F,disabled:P,children:E(P?"thread.loadingMore":"thread.loadEarlier")}),Z.length===0&&c.jsxs("p",{className:"conversation-empty",children:[L==="unavailable"?E("thread.empty.unavailable"):L==="no-transcript"?ly():E(L==="waiting"?"thread.empty.waiting":"thread.empty.noMessages"),L==="waiting"&&u&&c.jsxs(c.Fragment,{children:[c.jsx("br",{}),cy()]})]}),pe.map(ve=>{if(ve.kind==="card")return c.jsx(cf,{card:ve.card,results:ee,needle:ne,isMatch:ve.card.event.eventId===ce,copied:re===ve.card.event.eventId,images:H,onRequestImage:q,onCopy:()=>Ze(ve.card),onRewind:o,register:me,answered:G,answerFailed:K,answerable:m,onAnswer:X},ve.card.event.eventId);const Re=ve.cards.some(Ie=>xe.has(Ie.event.eventId));return c.jsx(E1,{summary:ve.summary,at:ve.at,open:Re,children:ve.cards.map(Ie=>c.jsx(cf,{card:Ie,results:ee,needle:ne,isMatch:Ie.event.eventId===ce,copied:re===Ie.event.eventId,images:H,onRequestImage:q,onCopy:()=>Ze(Ie),onRewind:o,register:me,answered:G,answerFailed:K,answerable:m,onAnswer:X},Ie.event.eventId))},ve.id)})]}),S!==null&&(S.state==="relaunching"||s==="live")?c.jsx(C1,{text:S.text,relaunching:S.state==="relaunching",onRelaunch:p}):s==="live"?N===null&&y!==null?c.jsx(k1,{notice:y,onGoToCli:T}):c.jsx(x1,{waitingFor:N,questionsAnswerable:m,onGoToCli:T}):c.jsx(S1,{presence:s,exitCode:l,waking:v,onWake:p})]})}function S1({presence:n,exitCode:r,waking:o,onWake:m}){const w=n==="sleeping"?E("thread.wake.sleeping"):r===null?E("thread.wake.exited"):E("thread.wake.exitedWithCode",{code:r});return c.jsxs("div",{className:"conversation-waiting conversation-wake",role:"status",children:[c.jsx("span",{className:"conversation-wake-dot","aria-hidden":"true"}),c.jsx("span",{children:w}),c.jsx("button",{className:"primary-button primary-button-small",onClick:m,disabled:o,children:E(o?"thread.wake.opening":"thread.wake.open")})]})}function C1({text:n,relaunching:r,onRelaunch:o}){return c.jsxs("div",{className:"conversation-waiting conversation-wake",role:"status",children:[c.jsx("span",{className:"conversation-wake-dot","aria-hidden":"true"}),c.jsx("span",{children:n}),c.jsx("button",{className:"primary-button primary-button-small",onClick:o,disabled:r,children:r?py():fy()})]})}function x1({waitingFor:n,questionsAnswerable:r,onGoToCli:o}){if(n===null)return null;const m=xp(n,r);return c.jsxs("div",{className:"conversation-waiting",role:"status",children:[c.jsx("span",{className:"conversation-waiting-dot","aria-hidden":"true"}),c.jsx("span",{children:m}),c.jsx("button",{className:"link-button",onClick:o,children:E("thread.goToCli")})]})}function k1({notice:n,onGoToCli:r}){return c.jsxs("div",{className:"conversation-waiting",role:"status",children:[c.jsx("span",{className:"conversation-waiting-dot","aria-hidden":"true"}),c.jsx("span",{children:n}),c.jsx("button",{className:"link-button",onClick:r,children:E("thread.goToCli")})]})}function cf({card:n,results:r,needle:o,isMatch:m,copied:w,images:A,onRequestImage:T,onCopy:s,onRewind:l,register:p,answered:v,answerFailed:u,answerable:y,onAnswer:S}){const{event:k}=n,g=k.role==="user",a=f=>{const d=v[f.toolUseId];return d!==void 0?d:r.has(f.toolUseId)?[]:null};return c.jsxs("article",{ref:f=>p(k.eventId,f),className:`turn turn-${k.role}${m?" turn-match":""}`,children:[c.jsxs("div",{className:"turn-actions",children:[c.jsx("button",{className:"icon-button",onClick:s,title:E("thread.copyMessage"),children:w?"✓":"⧉"}),g&&l!==void 0&&c.jsx("button",{className:"icon-button",onClick:l,title:E("thread.rewind"),children:"↩"})]}),n.parts.map((f,d)=>c.jsx(T1,{part:f,eventId:k.eventId,mine:g,result:f.kind==="tool-call"?r.get(f.toolUseId)??null:null,needle:o,images:A,onRequestImage:T,answeredAt:f.kind==="question"?a(f):null,failure:f.kind==="question"?u[f.toolUseId]??null:null,answerable:y,onAnswer:S},d)),c.jsx(L1,{event:k,mine:g})]})}function E1({summary:n,at:r,open:o,children:m}){const w=r>0?Ap(r):"";return c.jsxs("details",{className:"tool-group",open:o,children:[c.jsxs("summary",{className:"tool-group-summary",children:[c.jsx("span",{className:"tool-group-chevron","aria-hidden":"true",children:"▸"}),c.jsx("span",{className:"tool-group-count",children:n}),w.length>0&&c.jsx("span",{className:"tool-group-time",children:w})]}),c.jsx("div",{className:"tool-group-body",children:m})]})}function L1({event:n,mine:r}){const o=n.at>0?Ap(n.at):"",m=[];return n.durationMs!==null&&m.push(Uy(n.durationMs)),n.effort!==null&&m.push(E("thread.turn.effort",{effort:n.effort})),c.jsxs("div",{className:"turn-meta",children:[r&&c.jsx("span",{className:"turn-who",children:E("thread.turn.you")}),o.length>0&&c.jsx("span",{children:o}),n.queued&&c.jsx("span",{className:"turn-queued",title:E("thread.turn.queuedTitle"),children:E("thread.turn.queued")}),m.map(w=>c.jsx("span",{className:"turn-meta-bit",children:w},w))]})}function T1({part:n,eventId:r,mine:o,result:m,needle:w,images:A,onRequestImage:T,answeredAt:s,failure:l,answerable:p,onAnswer:v}){switch(n.kind){case"text":return o?c.jsx(M1,{text:n.text,truncated:n.truncated,needle:w}):c.jsxs("div",{className:"part-text",children:[c.jsx(Gc,{text:n.text,needle:w}),n.truncated&&c.jsxs("span",{className:"part-truncated",children:[" ",E("thread.truncated")]})]});case"image":return c.jsx(N1,{eventId:r,index:n.index,source:n.source,src:A[jc(r,n.index,n.source)],onRequest:T});case"thinking":return null;case"notice":return c.jsx("div",{className:`turn-notice turn-notice-${n.notice}`,children:xr(Xp(n),w)});case"question":return c.jsx(R1,{part:n,answeredAt:s,failure:l,answerable:p,onAnswer:v,needle:w});case"tool-call":{const u=w.length>0&&`${n.name} ${n.input} ${(m==null?void 0:m.text)??""}`.toLowerCase().includes(w.toLowerCase());return c.jsxs("details",{className:"tool",open:u,children:[c.jsxs("summary",{className:"tool-summary",children:[c.jsx("span",{className:"tool-name",children:n.name}),m!==null&&m.isError&&c.jsx("span",{className:"tool-error",children:E("thread.tool.error")}),m!==null&&m.imageCount>0&&c.jsx("span",{className:"tool-images",children:E("thread.tool.images",{count:m.imageCount})})]}),c.jsxs("div",{className:"tool-block",children:[c.jsx("span",{className:"tool-label",children:E("thread.tool.input")}),c.jsxs("pre",{className:"tool-pre",children:[xr(n.input,w),n.truncated&&c.jsxs("span",{className:"part-truncated",children:[" ",E("thread.truncated")]})]})]}),m!==null&&c.jsxs("div",{className:"tool-block",children:[c.jsx("span",{className:"tool-label",children:E("thread.tool.result")}),c.jsxs("pre",{className:`tool-pre${m.isError?" tool-pre-error":""}`,children:[m.text.length>0?xr(m.text,w):m.imageCount>0?E("thread.tool.imagesNotSent",{count:m.imageCount}):E("thread.tool.noOutput"),m.truncated&&c.jsxs("span",{className:"part-truncated",children:[" ",E("thread.truncated")]})]})]})]})}case"tool-result":return c.jsxs("div",{className:"tool-block",children:[c.jsx("span",{className:"tool-label",children:E("thread.tool.orphanResult")}),c.jsx("pre",{className:`tool-pre${n.isError?" tool-pre-error":""}`,children:xr(n.text,w)})]})}}function R1({part:n,answeredAt:r,failure:o,answerable:m,onAnswer:w,needle:A}){var D;const[T,s]=O.useState(()=>n.questions.map(()=>[])),[l,p]=O.useState(null),[v,u]=O.useState(""),y=r!==null,S=y||!m,k=r??T,g=n.questions.length===1&&((D=n.questions[0])==null?void 0:D.multiSelect)===!1,a=k.every(x=>na(x)?x.text.trim().length>0:x.length>0),f=x=>x===void 0||na(x)?[]:x,d=(x,M)=>{if(S)return;const b=n.questions[x];if(b!==void 0){if(g){w(n.toolUseId,[[M]]);return}p(L=>L===x?null:L),s(L=>L.map((N,B)=>{if(B!==x)return N;const P=f(N);return b.multiSelect?P.includes(M)?P.filter(F=>F!==M):[...P,M]:[M]}))}},h=x=>{const M=v.trim();if(M.length===0||S)return;const b={kind:"free",text:M};if(g){w(n.toolUseId,[b]);return}s(L=>L.map((N,B)=>B===x?b:N)),p(null),u("")},C=x=>{if(S)return;const M=k[x];u(M!==void 0&&na(M)?M.text:""),p(x)};return c.jsxs("div",{className:`question${y?" question-done":""}`,children:[n.questions.map((x,M)=>{const b=k[M],L=b!==void 0&&na(b)?b.text:null;return c.jsxs("div",{className:"question-item",children:[c.jsxs("div",{className:"question-head",children:[x.header.length>0&&c.jsx("span",{className:"question-header",children:x.header}),c.jsx("span",{className:"question-text",children:xr(x.question,A)}),x.multiSelect&&c.jsx("span",{className:"question-hint",children:E("thread.question.multi")})]}),c.jsxs("div",{className:"question-options",children:[x.options.map((N,B)=>{const P=f(b).includes(B);return c.jsxs("button",{type:"button",className:`question-option${P?" question-option-picked":""}`,disabled:S,onClick:()=>d(M,B),children:[c.jsx("span",{className:"question-option-label",children:N.label}),N.description.length>0&&c.jsx("span",{className:"question-option-desc",children:N.description})]},B)}),l===M&&!S?c.jsxs("div",{className:"question-write",children:[c.jsx("textarea",{className:"question-write-input",autoFocus:!0,rows:2,value:v,placeholder:E("thread.question.placeholder"),onChange:N=>u(N.target.value),onKeyDown:N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),h(M)),N.key==="Escape"&&p(null),N.stopPropagation()}}),c.jsxs("div",{className:"question-write-actions",children:[c.jsx("button",{type:"button",className:"question-send",disabled:v.trim().length===0,onClick:()=>h(M),children:E(g?"thread.question.send":"thread.question.useText")}),c.jsx("button",{type:"button",className:"question-write-cancel",onClick:()=>p(null),children:E("common.cancel")})]})]}):c.jsxs("button",{type:"button",className:`question-option question-option-write${L!==null?" question-option-picked":""}`,disabled:S,onClick:()=>C(M),children:[c.jsx("span",{className:"question-option-label",children:L!==null?L:E("thread.question.writeOther")}),L===null&&c.jsx("span",{className:"question-option-desc",children:E("thread.question.writeOtherHint")})]})]})]},M)}),c.jsxs("div",{className:"question-foot",children:[o!==null&&c.jsx("span",{className:"question-failed",children:o}),y?c.jsx("span",{className:"question-sent",children:E("thread.question.answered")}):m?c.jsxs(c.Fragment,{children:[!g&&c.jsx("button",{type:"button",className:"question-send",disabled:!a,onClick:()=>w(n.toolUseId,T),children:E("thread.question.sendAnswers")}),c.jsx("span",{className:"question-note",children:E(g?"thread.question.pickOne":"thread.question.pickEach")})]}):c.jsx("span",{className:"question-note",children:E("thread.question.answerInCli")})]})]})}function M1({text:n,truncated:r,needle:o}){const m=Iy(n,r),w=m.length===1?m[0]:void 0;if(w!==void 0&&w.kind==="text")return c.jsx(uf,{text:n,truncated:r,needle:o});const A=m.length-1;return c.jsx("div",{className:"part-own",children:m.map((T,s)=>T.kind==="text"?c.jsx(uf,{text:T.text,truncated:r&&s===A,needle:o},s):c.jsx(A1,{number:T.number,text:T.text,complete:T.complete,needle:o},s))})}function A1({number:n,text:r,complete:o,needle:m}){const[w,A]=O.useState(!1),T=m.length>0&&r.toLowerCase().includes(m.toLowerCase()),s=w||T;return c.jsxs("div",{className:`thread-pasted${s?" thread-pasted-open":""}`,children:[c.jsxs("button",{className:"thread-pasted-toggle",onClick:()=>A(l=>!l),"aria-expanded":s,children:[c.jsx("span",{className:"chip-icon",children:"¶"}),E("thread.pasted",{number:n,count:ca(r)}),!o&&c.jsxs("span",{className:"part-truncated",children:[" ",E("thread.truncated")]}),c.jsx("span",{className:"chip-chevron",children:s?"▾":"▸"})]}),s&&c.jsx("div",{className:"thread-pasted-text part-mine",children:om(r,m)})]})}function uf({text:n,truncated:r,needle:o}){const[m,w]=O.useState(!1),A=n.split(`
|
|
126
|
-
`),T=o.length>0&&n.toLowerCase().includes(o.toLowerCase()),s=A.length>=of&&!T,l=s&&!m?A.slice(0,of-1).join(`
|
|
127
|
-
`):n;return c.jsxs("div",{className:"part-text part-mine",children:[om(l,o),r&&c.jsxs("span",{className:"part-truncated",children:[" ",E("thread.truncated")]}),s&&c.jsx("button",{className:"fold-toggle",onClick:()=>w(p=>!p),children:m?E("thread.fold.less"):E("thread.fold.more",{count:A.length})})]})}function N1({eventId:n,index:r,source:o,src:m,onRequest:w}){const[A,T]=O.useState(!1);return O.useEffect(()=>{m===void 0&&w(n,r,o)},[m,n,r,o,w]),m===void 0?c.jsx("div",{className:"conversation-image-placeholder",children:E("thread.image.loading")}):m===null?c.jsx("div",{className:"conversation-image-placeholder",children:E("thread.image.gone")}):c.jsxs(c.Fragment,{children:[c.jsx("img",{className:"conversation-image",src:m,alt:E("thread.image.alt"),onClick:()=>T(!0),title:E("thread.image.openTitle")}),A&&c.jsx(Ip,{src:m,caption:E("thread.image.alt"),onClose:()=>T(!1)})]})}function hf({connection:n,title:r,confirmLabel:o,confirmTitle:m,onChoose:w,onClose:A}){const[T,s]=O.useState(null),[l,p]=O.useState(null),[v,u]=O.useState(!1),[y,S]=O.useState(""),k=O.useRef(null),g=O.useRef(null);O.useEffect(()=>{const h=n.onMessage(C=>{if(C.type==="picker.listing"){k.current=C.listing.pickerId,s(C.listing),p(null),u(!1),S("");return}C.type==="error"&&C.code==="picker-failed"&&p(kt(C.text))});return n.send({type:"picker.open"}),()=>{h();const C=k.current;C!==null&&n.send({type:"picker.close",pickerId:C})}},[n]),O.useEffect(()=>{const h=C=>{C.key==="Escape"&&(C.preventDefault(),C.stopPropagation(),A())};return window.addEventListener("keydown",h,!0),()=>window.removeEventListener("keydown",h,!0)},[A]),O.useEffect(()=>{var h;v&&((h=g.current)==null||h.focus())},[v]);const a=O.useCallback(h=>{const C=k.current;C!==null&&n.send({type:"picker.enter",pickerId:C,name:h})},[n]),f=O.useCallback(h=>{const C=k.current;C!==null&&n.send({type:"picker.root",pickerId:C,rootIndex:h})},[n]),d=O.useCallback(()=>{const h=k.current,C=y.trim();h===null||C.length===0||n.send({type:"picker.create",pickerId:h,name:C})},[n,y]);return c.jsx("div",{className:"modal-backdrop",onClick:A,children:c.jsxs("div",{className:"modal picker-modal",role:"dialog","aria-label":r,onClick:h=>h.stopPropagation(),children:[c.jsxs("header",{className:"modal-header",children:[c.jsx("span",{className:"modal-title",children:r}),c.jsx("button",{className:"icon-button",onClick:A,title:E("common.close"),children:"×"})]}),T===null?c.jsx("p",{className:"panel-note",children:E("picker.loading")}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"picker-roots",children:T.roots.map((h,C)=>c.jsx("button",{className:"picker-root",onClick:()=>f(C),title:E("picker.goTo",{root:h}),children:h},h))}),c.jsx("p",{className:"picker-path",title:T.path,children:T.path}),c.jsxs("div",{className:"picker-list",children:[T.canGoUp&&c.jsxs("button",{className:"picker-entry picker-up",onClick:()=>a(".."),children:["‹ ",E("picker.up")]}),T.entries.length===0&&!T.canGoUp&&c.jsx("p",{className:"panel-note",children:E("picker.empty")}),T.entries.map(h=>c.jsx("button",{className:"picker-entry",onClick:()=>a(h),children:h},h)),T.truncated&&c.jsx("p",{className:"panel-note",children:E("picker.truncated")})]}),l!==null&&c.jsx("p",{className:"picker-problem",children:l}),c.jsxs("footer",{className:"picker-footer",children:[v?c.jsxs("div",{className:"picker-create",children:[c.jsx("input",{ref:g,className:"picker-create-input",value:y,placeholder:E("picker.newFolderName"),onChange:h=>S(h.target.value),onKeyDown:h=>{h.key==="Enter"&&d(),h.key==="Escape"&&(h.stopPropagation(),u(!1)),h.stopPropagation()},spellCheck:!1}),c.jsx("button",{className:"link-button",onClick:d,children:E("picker.create")}),c.jsx("button",{className:"link-button",onClick:()=>u(!1),children:E("common.cancel")})]}):c.jsx("button",{className:"link-button",onClick:()=>u(!0),children:E("picker.createHere")}),c.jsx("span",{className:"composer-spacer"}),c.jsx("button",{className:"picker-open",onClick:()=>w(T.pickerId,T.path),title:m(T.path),children:o})]})]})]})})}function D1(n,r){return Wc(n)&&r!==null&&r.sessions>0}function I1(){return E("search.mode.titles")}function P1(){return E("search.mode.conversations")}function j1(){return E("search.mode.conversationsTitle")}function O1(n){return E(n==="conversations"?"search.placeholder.conversations":"search.placeholder.titles")}function B1(){return E("search.tooShort",{min:ip})}function F1(n){return[...n.trim()].length<ip}function H1(){return E("search.off")}function $1(n){const r=new Map;for(const o of n){const m=`${o.agent}:${o.sessionId}`;let w=r.get(m);w===void 0&&(w={key:m,agent:o.agent,sessionId:o.sessionId,title:o.title,titleHit:null,hits:[],lastAt:null},r.set(m,w)),o.eventId===null?w.titleHit=o:w.hits.push(o),o.at!==null&&(w.lastAt=Math.max(w.lastAt??0,o.at))}return[...r.values()]}const U1=40;function am(n,r=U1){const o=n.matchStart+n.matchLength;let m=n.snippet.slice(0,n.matchStart);if(m.length>r){let w=m.length-r;const A=m.charCodeAt(w);A>=56320&&A<=57343&&(w+=1),m=`…${m.slice(w)}`}return{before:m,match:n.snippet.slice(n.matchStart,o),after:n.snippet.slice(o)}}function W1(n){return n.role==="user"?E("search.role.user"):n.role==="assistant"?E("search.role.assistant"):E("search.role.title")}function lm(n){return am(n).match.trim()}function z1(n){const r=n.hits[0]??n.titleHit;return r===null?"":lm(r)}const Oc=n=>E("search.sessions",{count:n});function V1(n,r){return{query:r.query,hits:n===null?[...r.hits]:[...n.hits,...r.hits],sessionsScanned:r.sessionsScanned,sessionsTotal:r.sessionsTotal,truncated:null}}function q1(n){const{result:r}=n;if(n.searching&&n.error===null){if(r===null)return E("search.status.searching");const m={count:r.sessionsTotal,scanned:r.sessionsScanned};return r.hits.length===0?E("search.status.progress",m):E("search.status.progressFound",{...m,found:df(r)})}if(n.error!==null)return n.error;if(r===null)return null;const o=r.hits.length===0?E("search.status.none"):df(r);if(r.truncated===null&&r.hits.length===0&&r.sessionsScanned>0)return E("search.status.noneIn",{sessions:Oc(r.sessionsScanned)});if(r.truncated==="results")return E("search.status.truncatedResults",{found:o});if(r.truncated==="time"){const m=Math.max(0,r.sessionsTotal-r.sessionsScanned);return E("search.status.truncatedTime",{found:o,seconds:Math.round(Ev/1e3),left:Oc(m)})}return E("search.status.done",{found:o})}function df(n){const r=new Set(n.hits.map(o=>`${o.agent}:${o.sessionId}`)).size;return E("search.found",{hits:E("search.hits",{count:n.hits.length}),sessions:Oc(r)})}function K1(n,r){const o=r.terminals.find(m=>m.kind==="agent"&&m.agent===n.agent&&m.sessionId===n.sessionId);if(o!==void 0)return{kind:"activate",terminalId:o.terminalId};for(const m of r.projects){const w=m.sessions.find(A=>A.agent===n.agent&&A.sessionId===n.sessionId);if(w!==void 0)return Ac(w)&&m.cwdExists&&r.canResume(w.agent)?{kind:"resume",cwd:cp(w.cwd,m.cwd,r.platform),session:w}:{kind:"copy"}}return{kind:"copy"}}const G1=/<(code|kbd|b|strong|em)>([\s\S]*?)<\/\1>|<br\s*\/?>/g;function Bt(n,r,o){const m=_p(n,r),w=[];let A=0;for(const T of m.matchAll(G1)){const s=T.index??0;s>A&&w.push(ia(m.slice(A,s),r));const l=T[1];if(l===void 0)w.push(O.createElement("br",{key:w.length}));else{const p=ia(T[2]??"",r);w.push(O.createElement(l,{key:w.length},p))}A=s+T[0].length}return A<m.length&&w.push(ia(m.slice(A),r)),w.length===1?w[0]:w}const ff="0.4.0",pf="agent-workbench.support-notice",Y1=3e4;function X1(n){return/^[0-9A-Za-z][0-9A-Za-z.+-]{0,39}$/.test(n)?n:null}function Q1(n,r){return n!==r}function J1(){return[{keys:"Alt + T",description:E("shortcuts.app.newTab")},{keys:"Alt + W",description:E("shortcuts.app.closeTab")},{keys:"Alt + ← / →",description:E("shortcuts.app.switchTab")},{keys:"Alt + P",description:E("shortcuts.app.togglePanel")},{keys:"Shift + Tab",description:E("shortcuts.app.previousTab")}]}function Z1({agent:n,onClose:r}){return O.useEffect(()=>{const o=m=>{m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),r())};return window.addEventListener("keydown",o,!0),()=>window.removeEventListener("keydown",o,!0)},[r]),c.jsx("div",{className:"modal-backdrop",onClick:r,children:c.jsxs("div",{className:"modal",role:"dialog","aria-label":E("shortcuts.ariaLabel"),onClick:o=>o.stopPropagation(),children:[c.jsxs("header",{className:"modal-header",children:[c.jsx("span",{className:"modal-title",children:E("shortcuts.title")}),c.jsx("button",{className:"icon-button",onClick:r,title:E("common.close"),children:"×"})]}),c.jsxs("div",{className:"modal-body",children:[c.jsx("h3",{className:"modal-section",children:E("shortcuts.section.app")}),c.jsx(_c,{shortcuts:J1()}),c.jsx("h3",{className:"modal-section",children:E("shortcuts.section.composer")}),c.jsx(_c,{shortcuts:O0(n!==null&&n.capabilities.imagesByPath!==null)}),n!==null&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"modal-section",children:E("shortcuts.section.cli")}),c.jsx("p",{className:"modal-hint",children:Bt("shortcuts.cliHint")}),c.jsx(_c,{shortcuts:$s[n.id].shortcuts}),$s[n.id].shortcutsNote!==null&&c.jsx("p",{className:"modal-hint",children:$s[n.id].shortcutsNote})]}),c.jsx("p",{className:"modal-hint",children:Bt("shortcuts.browserReserved")}),c.jsx("p",{className:"modal-hint",children:Bt("shortcuts.altNumber")}),c.jsxs("p",{className:"modal-hint support-hint",children:[c.jsx("span",{"aria-hidden":"true",children:"☕"})," ",E("support.notice")," ",c.jsx("a",{href:hp,target:"_blank",rel:"noreferrer noopener",children:E("support.link")})]})]})]})})}function _c({shortcuts:n}){return c.jsx("dl",{className:"shortcut-list",children:n.map(r=>c.jsxs("div",{className:"shortcut-row",children:[c.jsx("dt",{children:c.jsx("kbd",{children:r.keys})}),c.jsx("dd",{children:r.description})]},r.keys))})}const eb=1e3,tb=5e3;function nb({info:n,agentLabel:r,onRefresh:o,onClose:m}){const[w,A]=O.useState(!1),[T,s]=O.useState(!1),l=O.useRef(null),p=O.useRef(null);O.useEffect(()=>{const k=g=>{g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),m())};return window.addEventListener("keydown",k,!0),()=>window.removeEventListener("keydown",k,!0)},[m]),O.useEffect(()=>{s(!1)},[n]),O.useEffect(()=>()=>{l.current!==null&&window.clearTimeout(l.current),p.current!==null&&window.clearTimeout(p.current)},[]);const v=k=>{navigator.clipboard.writeText(k).then(()=>{A(!0),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>A(!1),eb)}).catch(()=>A(!1))},u=()=>{s(!0),o(),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>s(!1),tb)},y=n.state==="active",S=E("statusLine.title",{agent:r});return c.jsx("div",{className:"modal-backdrop",onClick:m,children:c.jsxs("div",{className:"modal",role:"dialog","aria-label":S,onClick:k=>k.stopPropagation(),children:[c.jsxs("header",{className:"modal-header",children:[c.jsx("span",{className:"modal-title",children:S}),c.jsx("button",{className:"icon-button",onClick:m,title:E("common.close"),children:"×"})]}),c.jsxs("div",{className:"modal-body",children:[c.jsx("p",{className:`status-line-state${y?" status-line-state-active":""}`,children:N0(n.state)}),c.jsx("p",{className:"modal-hint",children:E("statusLine.benefit")}),c.jsx("h3",{className:"modal-section",children:E("statusLine.lineSection")}),n.fragment===null?c.jsx("p",{className:"modal-hint",children:D0()}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"modal-hint",children:Bt("statusLine.mergeHint")}),c.jsxs("div",{className:"status-line-fragment",children:[c.jsx("pre",{className:"tool-pre",children:n.fragment}),c.jsx("button",{className:"link-button",onClick:()=>v(n.fragment??""),title:E("statusLine.copyTitle"),children:w?c.jsxs(c.Fragment,{children:["✓ ",E("statusLine.copied")]}):E("statusLine.copy")})]})]}),c.jsx("h3",{className:"modal-section",children:E("statusLine.whereSection")}),c.jsx("p",{className:"status-line-path",children:n.settingsPath}),c.jsx("p",{className:"modal-hint",children:E("statusLine.whereHint")}),c.jsx("h3",{className:"modal-section",children:E("statusLine.scriptSection")}),c.jsx("p",{className:"modal-hint",children:E("statusLine.scriptHint")}),c.jsx("p",{className:"status-line-path",children:n.scriptPath}),c.jsx("p",{className:"modal-hint",children:Bt("statusLine.runsEverywhere")}),c.jsxs("div",{className:"status-line-actions",children:[c.jsx("button",{className:"primary-button",onClick:u,disabled:T,children:E(T?"statusLine.checking":"statusLine.check")}),c.jsx("span",{className:"modal-hint",children:E("statusLine.checkHint")})]})]})]})})}function rb(){const[n,r]=O.useState(()=>Q1(yt(pf,null,X1),ff));return O.useEffect(()=>{if(!n)return;ut(pf,ff);const o=window.setTimeout(()=>r(!1),Y1);return()=>window.clearTimeout(o)},[n]),n?c.jsxs("div",{className:"banner banner-support",role:"status",children:[c.jsx("span",{children:E("support.notice")}),c.jsx("a",{className:"banner-support-link",href:hp,target:"_blank",rel:"noreferrer noopener",onClick:()=>r(!1),children:E("support.link")}),c.jsx("button",{className:"link-button banner-support-dismiss",onClick:()=>r(!1),children:E("support.dismiss")})]}):null}function Bc({agent:n,agents:r}){return c.jsx("span",{className:"agent-badge",title:Wi(n,r),children:y0(n)})}const sb=500,mf=10;function ib(n){const r=O.useRef(null),o=O.useRef(null),m=O.useRef(!1),w=O.useRef(n);w.current=n;const A=O.useCallback(()=>{r.current!==null&&window.clearTimeout(r.current),r.current=null,o.current=null},[]),T=O.useCallback(v=>{v.pointerType==="mouse"||v.button!==0||(A(),m.current=!1,o.current={x:v.clientX,y:v.clientY},r.current=window.setTimeout(()=>{r.current=null,m.current=!0,w.current()},sb))},[A]),s=O.useCallback(v=>{const u=o.current;u!==null&&(Math.abs(v.clientX-u.x)>mf||Math.abs(v.clientY-u.y)>mf)&&A()},[A]),l=O.useCallback(v=>{(m.current||r.current!==null)&&v.preventDefault()},[]),p=O.useCallback(v=>{m.current&&(m.current=!1,v.preventDefault(),v.stopPropagation())},[]);return{onPointerDown:T,onPointerMove:s,onPointerUp:A,onPointerCancel:A,onContextMenu:l,onClickCapture:p}}function ob({onLongPress:n,...r}){const o=ib(n);return c.jsx("button",{...r,...o})}function Yc({className:n,text:r,title:o,disabled:m,offerAgentChoice:w,agents:A,agent:T,onOpen:s}){var k;const[l,p]=O.useState(!1),v=O.useRef(null),u=O.useCallback(()=>p(!1),[]),y=O.useCallback(g=>{p(!1),s(g)},[s]);if(!w)return c.jsx("button",{className:n,onClick:()=>s(),disabled:m,title:o,children:r});const S=((k=A.find(g=>g.id===T))==null?void 0:k.label)??null;return c.jsxs("span",{className:"split-button",children:[c.jsx("button",{className:`${n} split-button-main`,onClick:()=>s(T??void 0),disabled:m,title:S===null?o:E("agentMenu.titleWithAgent",{title:o,label:S}),children:r}),c.jsx("button",{ref:v,className:`${n} split-button-arrow`,onClick:()=>p(g=>!g),disabled:m,"aria-haspopup":"menu","aria-expanded":l,title:E("agentMenu.chooseTitle"),children:"▾"}),l&&v.current!==null&&c.jsx(Gp,{agents:A,preselected:T,anchor:v.current,onPick:y,onClose:u})]})}function ab(n){const r=new Date(n);return r.setHours(0,0,0,0),r.getTime()}function cm(n,r,o,m){const w=new Set;for(const A of n)for(const T of A.sessions)T.agent===r&&(T.archived||T.updatedAt<o&&(m.has(T.sessionId)||w.add(T.sessionId)));return[...w]}function lb(n,r,o,m){const w=[];for(const s of n)for(const l of s.sessions)w.includes(l.agent)||w.push(l.agent);const A=m,T=s=>{const l=A.indexOf(s);return l===-1?m.length:l};return w.sort((s,l)=>T(s)-T(l)).map(s=>({agent:s,count:cm(n,s,r,o).length})).filter(s=>s.count>0)}function um(n,r){const o=new Set;let m=0;for(const w of n.sessions)if(!w.archived){if(r.has(w.sessionId)){m+=1;continue}o.add(w.sessionId)}return{sessionIds:[...o],blocked:m}}function cb(n){const{sessionIds:r,blocked:o}=n;if(r.length===0)return E("archive.allBlocked",{count:o});const m=E("archive.confirm",{count:r.length});return o===0?m:E("archive.withBlocked",{confirm:m,blocked:E("archive.blockedStays",{count:o})})}const gf=12;function ub(n){let r=2166136261;for(let o=0;o<n.length;o+=1)r^=n.charCodeAt(o),r=Math.imul(r,16777619);return r>>>0}function ts(n){const r=n.toLowerCase().replace(/[\\/]+/g,"/").replace(/\/+$/,"");return`hsl(${ub(r)%gf*(360/gf)} var(--project-color-s) var(--project-color-l))`}function Fi(){return E("vault.name")}function hb(){return E("vault.privacy")}function db(){return E("vault.archived")}function fb(){return E("vault.mark.copy")}function _f(){return E("vault.mark.copyTitle")}function pb(){return E("vault.mark.partial")}function mb(){return E("vault.mark.partialTitle")}function hm(n){return E("vault.sessions",{count:n})}function Xc(n){return n==="measuring"||n==="writing"||n==="moving"}function gb(n){const r=n.progress;switch(n.state){case"measuring":return r===null?E("vault.state.measuring"):E("vault.state.measuringProgress",{done:r.done,total:r.total});case"writing":return r===null?E("vault.state.writing"):E("vault.state.writingProgress",{done:r.done,total:r.total});case"moving":return E("vault.state.moving");default:return n.enabled?E("vault.state.on"):E("vault.state.off")}}function _b(n){if(n===null||!n.enabled)return null;const r=[Fi(),hm(n.sessions)];return n.state==="writing"?r.push(n.progress===null?E("vault.line.copying"):E("vault.line.copyingProgress",{done:n.progress.done,total:n.progress.total})):n.state==="moving"?r.push(E("vault.line.moving")):n.state==="measuring"?r.push(E("vault.line.measuring")):r.push(n.lastPassAt===null?E("vault.line.neverCopied"):jn(n.lastPassAt)),n.pending>0&&r.push(E("vault.line.pending",{count:n.pending})),r.join(" · ")}function vb(n){return n===null?Fi():n.enabled?E("vault.button.on"):E("vault.button.off")}function yb(n){return n.enabled?"enabled":Xc(n.state)?"busy":n.measurement!==null?"measured":n.passSessions>0?"existing":"needs-measure"}function wb(n,r){return Xc(n.state)?E("vault.busy"):r?null:E("vault.indexNotReady")}function bb(n){return Xc(n.state)?E("vault.busy"):null}function Sb(n){return E("vault.previousDir",{dir:n})}function Cb(n){const r=[];return n.skippedEmpty>0&&r.push(E("vault.note.empty",{count:n.skippedEmpty})),n.unsupported>0&&r.push(E("vault.note.unsupported",{count:n.unsupported})),n.failed>0&&r.push(n.failureReasons.length>0?E("vault.note.failedWithReasons",{count:n.failed,reasons:n.failureReasons.map(kt).join("; ")}):E("vault.note.failed",{count:n.failed})),r.length===0?null:E("vault.note.notCopied",{parts:r.join(" · ")})}function xb(n,r){const o=n.byAgent.map(A=>({agent:A.agent,label:Wi(A.agent,r),sessions:A.sessions,bytes:A.eventBytes+A.imageBytes,images:A.images,imageBytes:A.imageBytes,skippedArchived:A.skippedArchived,note:Cb(A)})),m=o.reduce((A,T)=>({sessions:A.sessions+T.sessions,bytes:A.bytes+T.bytes,images:A.images+T.images,skippedArchived:A.skippedArchived+T.skippedArchived}),{sessions:0,bytes:n.memoryBytes,images:0,skippedArchived:0}),w=jn(n.measuredAt);return{rows:o,memoryProjects:n.memoryProjects,memoryBytes:n.memoryBytes,total:m,summary:w.length>0?E("vault.measure.summary",{when:w,duration:$d(n.durationMs)}):E("vault.measure.summaryNoWhen",{duration:$d(n.durationMs)})}}function kb(n){const r=n.storage==="vault";return{copy:r,partial:r&&n.partial}}function Eb(n){switch(n){case"exporting":return E("vault.export.exporting");case"done":return E("vault.export.done");default:return E("vault.export.idle")}}const Lb=1e3;function vf({hit:n}){const{before:r,match:o,after:m}=am(n);return c.jsxs(c.Fragment,{children:[r,c.jsx("mark",{children:o}),m]})}function Tb({project:n,openSessionIds:r,onConfirm:o,onCancel:m}){const w=um(n,r);return c.jsxs("div",{className:"project-archive-confirm",role:"group",children:[c.jsx("span",{className:"archive-history-text",children:cb(w)}),w.sessionIds.length>0&&c.jsx("button",{className:"link-button",onClick:o,children:E("sidebar.action.archive")}),c.jsx("button",{className:"link-button",onClick:m,children:w.sessionIds.length>0?E("common.cancel"):E("common.close")})]})}function vc(n){if(n.cwd.length===0)return n.fallbackName;const r=n.cwd.split(/[\\/]/).filter(o=>o.length>0);return r[r.length-1]??n.cwd}function yf({out:n}){return c.jsxs("svg",{className:"archive-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("rect",{x:"2.5",y:"3.5",width:"19",height:"5",rx:"1.2"}),c.jsx("path",{d:"M4.5 8.5v10a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-10"}),n?c.jsx("path",{d:"M12 18.5v-6M9.2 15.3 12 12.5l2.8 2.8"}):c.jsx("path",{d:"M10 12.5h4"})]})}function Rb(){return c.jsxs("svg",{className:"archive-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("path",{d:"M8 6.5V4.5a1.5 1.5 0 0 1 1.5-1.5h9A1.5 1.5 0 0 1 20 4.5v11a1.5 1.5 0 0 1-1.5 1.5H17"}),c.jsx("rect",{x:"4",y:"7",width:"12",height:"14",rx:"1.5"}),c.jsx("path",{d:"M7.5 12h5M7.5 15.5h5"})]})}function Mb({done:n}){return c.jsx("svg",{className:"archive-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n?c.jsx("path",{d:"M5 12.5l4.5 4.5L19 7.5"}):c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14 3H7a1.5 1.5 0 0 0-1.5 1.5v15A1.5 1.5 0 0 0 7 21h10a1.5 1.5 0 0 0 1.5-1.5V7.5z"}),c.jsx("path",{d:"M12 10.5v6.5M9.2 14.2 12 17l2.8-2.8"})]})})}function Ab({candidates:n,agents:r,onArchiveAgent:o,onClose:m,anchorRef:w}){const[A,T]=O.useState(null),s=O.useRef(null);return O.useEffect(()=>{const l=u=>{var y,S;return u instanceof Node&&(((y=s.current)==null?void 0:y.contains(u))===!0||((S=w.current)==null?void 0:S.contains(u))===!0)},p=u=>{u.key!=="Escape"||!l(document.activeElement)||(u.preventDefault(),u.stopPropagation(),m())},v=u=>{l(u.target)||m()};return window.addEventListener("keydown",p,!0),document.addEventListener("pointerdown",v,!0),()=>{window.removeEventListener("keydown",p,!0),document.removeEventListener("pointerdown",v,!0)}},[w,m]),c.jsxs("div",{ref:s,className:"archive-history",role:"region","aria-label":E("sidebar.history.region"),children:[c.jsxs("div",{className:"archive-history-header",children:[c.jsx("span",{children:E("sidebar.history.heading")}),c.jsx("button",{className:"icon-button",onClick:m,title:E("common.closeEsc"),children:"×"})]}),n.map(({agent:l,count:p})=>{const v=Wi(l,r);return A===l?c.jsxs("div",{className:"archive-history-row archive-history-confirm",children:[c.jsx("span",{className:"archive-history-text",children:E("sidebar.history.confirm",{count:p,label:v})}),c.jsx("button",{className:"link-button",onClick:()=>o(l),children:E("sidebar.action.archive")}),c.jsx("button",{className:"link-button",onClick:()=>T(null),children:E("common.cancel")})]},l):c.jsxs("div",{className:"archive-history-row",children:[c.jsxs("span",{className:"archive-history-text",children:[c.jsx("span",{className:"archive-history-agent",children:v}),c.jsx("span",{className:"archive-history-count",children:E("sidebar.history.count",{count:p})})]}),c.jsx("button",{className:"link-button",onClick:()=>T(l),children:E("sidebar.action.archive")})]},l)})]})}function Nb({projects:n,indexStatus:r,disabled:o,openSessionIds:m,openBlocked:w,onOpenProject:A,agents:T,offerAgentChoice:s,agentForProject:l,onOpenSession:p,canResume:v,platform:u,onRefresh:y,onArchive:S,onHide:k,width:g,onNewProject:a,vault:f,onOpenVault:d,onOpenVaultSession:h,onExportProject:C,exporting:D,lastExported:x,onContinueSession:M,globalSearch:b,onOpenSearchHit:L}){const[N,B]=O.useState(new Set),[P,F]=O.useState(null);O.useEffect(()=>{const de=x===null?0:x.at+Lb-Date.now();if(x===null||de<=0)return;F(x.projectKey);const fe=window.setTimeout(()=>F(null),de);return()=>window.clearTimeout(fe)},[x]);const H=de=>D.has(de)?"exporting":P===de?"done":"idle",q=_b(f),[X,G]=O.useState(""),[K,j]=O.useState(!1),[W,$]=O.useState(new Set),[V,J]=O.useState("titles"),re=b===null?"titles":V,[ie,he]=O.useState(!1),Y=b!==null&&re==="conversations"&&X.trim().length>0&&(ie||b.submitted!==null),U=(b==null?void 0:b.result)??null,Z=O.useMemo(()=>Y&&U!==null?$1(U.hits):[],[Y,U]),ee=de=>{J(de),he(!1),b==null||b.clear()},pe=()=>{if(b!==null){if(F1(X)){he(!0),b.clear();return}he(!1),b.search(X.trim(),K)}},ne=(b==null?void 0:b.submitted)??null,Ee=b==null?void 0:b.search;O.useEffect(()=>{re!=="conversations"||ne===null||Ee===void 0||ne.includeArchived!==K&&Ee(ne.query,K)},[re,ne,Ee,K]);const xe=O.useMemo(()=>n.reduce((de,fe)=>de+fe.sessions.filter(Te=>Te.archived).length,0),[n]),ce=O.useMemo(()=>{const de=re==="titles"?X.trim().toLowerCase():"";return n.map(fe=>{const Te=K?fe.sessions:fe.sessions.filter(Ye=>!Ye.archived);if(Te.length===0)return null;if(de.length===0)return{...fe,sessions:Te};if(vc(fe).toLowerCase().includes(de)||fe.cwd.toLowerCase().includes(de))return{...fe,sessions:Te};const Pe=Te.filter(Ye=>Pn(Ye.title,Ye.titleSource).toLowerCase().includes(de));return Pe.length>0?{...fe,sessions:Pe}:null}).filter(fe=>fe!==null)},[n,X,K,re]),Se=re==="titles"&&X.trim().length>0,me=de=>de.archived||!m.has(de.sessionId),[Ze,qe]=O.useState(!1),ve=O.useRef(null),Re=ab(Date.now()),Ie=O.useMemo(()=>T.map(de=>de.id),[T]),ke=O.useMemo(()=>lb(n,Re,m,Ie),[n,Re,m,Ie]),[Fe,$e]=O.useState(null);O.useEffect(()=>{ke.length===0&&qe(!1)},[ke.length]);const tt=O.useCallback(()=>qe(!1),[]),St=de=>{const fe=cm(n,de,Re,m);fe.length>0&&(S(fe,!0),$e({what:Wi(de,T),sessionIds:fe})),qe(!1)},[Ke,gt]=O.useState(null),nt=de=>{const fe=um(de,m);fe.sessionIds.length>0&&(S(fe.sessionIds,!0),$e({what:vc(de),sessionIds:fe.sessionIds})),gt(null)},ze=()=>{Fe!==null&&S(Fe.sessionIds,!1),$e(null)},Ge=de=>{$(fe=>{const Te=new Set(fe);return Te.has(de)?Te.delete(de):Te.add(de),Te})},Et=O.useMemo(()=>{const de=[];for(const fe of ce)for(const Te of fe.sessions)W.has(Te.sessionId)&&de.push(Te);return de},[ce,W]),Ct=de=>{const fe=Et.filter(Te=>de?me(Te):!0).map(Te=>Te.sessionId);fe.length>0&&S(fe,de),$(new Set)},Le=de=>{B(fe=>{const Te=new Set(fe);return Te.has(de)?Te.delete(de):Te.add(de),Te})},Ve=r.state==="scanning";return c.jsxs("aside",{className:"sidebar",style:{width:`${g}px`},children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsx("input",{className:"sidebar-filter",type:"search",placeholder:O1(re),value:X,onChange:de=>{G(de.target.value),re==="conversations"&&(he(!1),de.target.value.trim().length===0&&(b==null||b.clear()))},onKeyDown:de=>{re!=="conversations"||de.key!=="Enter"||(de.preventDefault(),pe())},spellCheck:!1}),c.jsx("button",{className:"icon-button",onClick:a,title:E("sidebar.newProject"),disabled:o,children:"+"}),c.jsx("button",{className:"icon-button",onClick:y,title:E("sidebar.reindex"),disabled:Ve,children:"⟳"}),c.jsx("button",{className:`icon-button${(f==null?void 0:f.enabled)===!0?" icon-button-on":""}`,onClick:d,title:vb(f),"aria-label":Fi(),children:c.jsx(Rb,{})}),c.jsx("button",{className:"icon-button",onClick:k,title:E("sidebar.hide"),children:"«"})]}),b!==null&&c.jsxs("div",{className:"sidebar-search-mode",role:"group","aria-label":E("sidebar.searchMode.label"),children:[c.jsx("button",{className:`sidebar-search-mode-option${re==="titles"?" is-on":""}`,"aria-pressed":re==="titles",onClick:()=>ee("titles"),title:E("sidebar.searchMode.titlesTitle"),children:I1()}),c.jsx("button",{className:`sidebar-search-mode-option${re==="conversations"?" is-on":""}`,"aria-pressed":re==="conversations",onClick:()=>ee("conversations"),title:j1(),children:P1()})]}),Ve&&c.jsx("div",{className:"sidebar-progress",children:E("sidebar.indexing",{scanned:r.scannedFiles,total:r.totalFiles})}),(xe>0||ke.length>0)&&c.jsxs("div",{className:"sidebar-archive-bar",children:[xe>0&&c.jsx("button",{className:`sidebar-archived-toggle${K?" is-on":""}`,onClick:()=>j(de=>!de),title:E("sidebar.archived.toggleTitle"),children:K?E("sidebar.archived.hide",{count:xe}):E("sidebar.archived.show",{count:xe})}),ke.length>0&&c.jsx("button",{ref:ve,className:`link-button sidebar-archive-history${Ze?" is-on":""}`,onClick:()=>qe(de=>!de),"aria-expanded":Ze,title:E("sidebar.history.buttonTitle"),children:E("sidebar.history.button")})]}),Ze&&ke.length>0&&c.jsx(Ab,{candidates:ke,agents:T,onArchiveAgent:St,onClose:tt,anchorRef:ve}),Fe!==null&&!Ze&&c.jsxs("div",{className:"archive-history archive-history-undo",role:"status",children:[c.jsx("span",{className:"archive-history-text",children:E("sidebar.undo.text",{count:Fe.sessionIds.length,what:Fe.what})}),c.jsx("button",{className:"link-button",onClick:ze,children:E("sidebar.action.undo")}),c.jsx("button",{className:"icon-button",onClick:()=>$e(null),title:E("sidebar.undo.dismissTitle"),children:"×"})]}),q!==null&&c.jsx("button",{className:`sidebar-vault-line${(f==null?void 0:f.lastError)!=null?" is-problem":""}`,onClick:d,title:(f==null?void 0:f.lastError)!=null?E("sidebar.vaultLine.lastError",{error:kt(f.lastError)}):E("sidebar.vaultLine.title"),children:q}),c.jsxs("div",{className:"sidebar-scroll",children:[Y&&b!==null&&c.jsxs("div",{className:"search-results",children:[!b.vaultEnabled&&c.jsx("p",{className:"search-note",children:H1()}),c.jsx("p",{className:`search-status${b.error!==null?" is-problem":""}`,role:"status",children:ie?B1():q1(b)}),!ie&&Z.map(de=>{const fe=de.hits[0]??de.titleHit;return fe===null?null:c.jsxs("div",{className:"search-group",children:[c.jsxs("button",{className:"search-group-title",onClick:()=>L(fe,z1(de)),title:Pn(de.title),children:[c.jsx(Bc,{agent:de.agent,agents:T}),de.titleHit!==null?c.jsx(vf,{hit:de.titleHit}):Pn(de.title)]}),de.hits.map(Te=>c.jsxs("button",{className:"search-hit",onClick:()=>L(Te,lm(Te)),children:[c.jsx("span",{className:"search-hit-snippet",children:c.jsx(vf,{hit:Te})}),c.jsxs("span",{className:"search-hit-meta",children:[W1(Te),Te.at!==null?` · ${jn(Te.at)}`:""]})]},Te.eventId??"titulo"))]},de.key)})]}),!Y&&ce.length===0&&!Ve&&c.jsx("p",{className:"sidebar-empty",children:n.length===0?E("sidebar.empty.noProjects"):E("sidebar.empty.noMatch")}),!Y&&ce.map(de=>{const fe=N.has(de.key)||Se,Te=!o&&de.cwdExists,ot=w(de.cwd);return c.jsxs("div",{className:"project",children:[c.jsxs("div",{className:"project-row",children:[c.jsxs("button",{className:"project-toggle",onClick:()=>Le(de.key),title:de.cwd.length>0?de.cwd:de.fallbackName,children:[c.jsx("span",{className:`chevron${fe?" chevron-open":""}`,children:"›"}),c.jsx("span",{className:"project-swatch",style:{background:ts(de.cwd)},"aria-hidden":"true"}),c.jsx("span",{className:"project-name",children:vc(de)}),c.jsx("span",{className:"project-count",children:de.sessions.length})]}),c.jsxs("span",{className:"project-actions",children:[C!==null&&c.jsx("button",{className:`icon-button project-action${H(de.key)!=="idle"?" project-action-busy":""}`,onClick:()=>C(de.key),disabled:H(de.key)==="exporting",title:Eb(H(de.key)),"aria-label":E("sidebar.project.export"),children:c.jsx(Mb,{done:H(de.key)==="done"})}),c.jsx("button",{className:`icon-button project-action${Ke===de.key?" project-action-busy":""}`,onClick:()=>gt(Pe=>Pe===de.key?null:de.key),title:E("sidebar.project.archiveTitle"),"aria-label":E("sidebar.project.archive"),"aria-expanded":Ke===de.key,children:c.jsx(yf,{out:!1})})]}),c.jsx(Yc,{className:"icon-button",text:"+",title:ot?kp():de.cwdExists?E("sidebar.project.newSession"):E("sidebar.project.folderGone"),disabled:!Te||ot,offerAgentChoice:s,agents:T,agent:s?l(de):null,onOpen:Pe=>A(de.cwd,Pe)})]}),!de.cwdExists&&c.jsx("div",{className:"project-missing",title:de.cwd,children:E("sidebar.project.missing")}),Ke===de.key&&c.jsx(Tb,{project:de,openSessionIds:m,onConfirm:()=>nt(de),onCancel:()=>gt(null)}),fe&&c.jsx("ul",{className:"session-list",children:de.sessions.map(Pe=>{const Ye=W.has(Pe.sessionId),lt=!me(Pe),Lt=oy(Pe.agent,T,s),At=kb(Pe),Kn=Ac(Pe)&&v(Pe.agent),ns=At.copy?h!==null:Te&&Kn;return c.jsxs("li",{className:`session-row${Pe.archived?" session-archived":""}${Ye?" session-selected":""}`,children:[c.jsxs(ob,{className:"session-item",onLongPress:()=>Ge(Pe.sessionId),onClick:Tn=>{if(Tn.ctrlKey||Tn.metaKey){Ge(Pe.sessionId);return}if(At.copy){h==null||h(Pe);return}Ac(Pe)&&(Pe.archived&&S([Pe.sessionId],!1),p(cp(Pe.cwd,de.cwd,u),Pe))},disabled:!ns,title:At.copy?`${Pn(Pe.title,Pe.titleSource)}
|
|
128
|
-
${h===null?E("remote.onlyOnHost"):_f()}`:Lt.unavailableTitle??Pn(Pe.title,Pe.titleSource),children:[c.jsxs("span",{className:"session-title",children:[Lt.badge&&c.jsx(Bc,{agent:Pe.agent,agents:T}),At.copy&&c.jsx("span",{className:"session-vault-mark",title:_f(),children:fb()}),At.partial&&c.jsx("span",{className:"session-partial-mark",title:mb(),children:pb()}),Pn(Pe.title,Pe.titleSource)]}),c.jsx("span",{className:"session-meta",children:jn(Pe.updatedAt)})]}),c.jsx(Yp,{targets:Cp(T,Pe.agent,Pe.partial),className:"icon-button session-continue",text:"↪",onPick:Tn=>M(Pe,Tn)}),c.jsx("button",{className:"icon-button session-action",onClick:()=>S([Pe.sessionId],!Pe.archived),disabled:lt,title:Pe.archived?E("sidebar.session.restore"):E(lt?"sidebar.session.blocked":"sidebar.session.archive"),children:c.jsx(yf,{out:Pe.archived})})]},`${Pe.agent}:${Pe.sessionId}`)})})]},de.key)})]}),Et.length>0&&c.jsxs("div",{className:"sidebar-selection",children:[c.jsx("span",{children:E("sidebar.selection.count",{count:Et.length})}),Et.some(de=>!de.archived)&&c.jsx("button",{className:"link-button",onClick:()=>Ct(!0),children:E("sidebar.action.archive")}),Et.some(de=>de.archived)&&c.jsx("button",{className:"link-button",onClick:()=>Ct(!1),children:E("sidebar.action.restore")}),c.jsx("button",{className:"link-button",onClick:()=>$(new Set),children:E("common.cancel")})]})]})}function Fc({x:n,y:r,items:o,onClose:m,anchor:w=null}){const A=O.useRef(null),[T,s]=O.useState({left:n,top:r});return O.useLayoutEffect(()=>{const l=A.current;if(l===null)return;const{width:p,height:v}=l.getBoundingClientRect();s({left:Math.max(4,Math.min(n,window.innerWidth-p-4)),top:Math.max(4,Math.min(r,window.innerHeight-v-4))})},[n,r]),O.useEffect(()=>{const l=v=>{v.key==="Escape"&&(v.stopPropagation(),m())},p=v=>{var y;const u=v.target;u instanceof Node&&((y=A.current)!=null&&y.contains(u)||w!=null&&w.contains(u))||m()};return window.addEventListener("keydown",l,!0),window.addEventListener("pointerdown",p,!0),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("keydown",l,!0),window.removeEventListener("pointerdown",p,!0),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[w,m]),c.jsx("div",{ref:A,className:"context-menu",style:{left:`${T.left}px`,top:`${T.top}px`},onPointerDown:l=>l.stopPropagation(),children:o.map(l=>c.jsxs("button",{className:"context-menu-item",lang:l.lang,role:l.checked===void 0?void 0:"menuitemradio","aria-checked":l.checked,onClick:()=>{l.onSelect(),m()},children:[l.checked!==void 0&&c.jsx("span",{className:"context-menu-check","aria-hidden":"true",children:l.checked?"✓":""}),l.label]},l.label))})}function Db({preview:n,onOpenWithSystem:r,onInsert:o}){const[m,w]=O.useState(null);O.useEffect(()=>{if(n.binary||n.language===null){w(null);return}let s=!1;return In(async()=>{const{highlightCode:l}=await import("./highlight-2xGvJy1W.js");return{highlightCode:l}},[]).then(({highlightCode:l})=>{s||w(l(n.text,n.language))}).catch(()=>{s||w(null)}),()=>{s=!0,w(null)}},[n.text,n.language,n.binary]);const A=O.useMemo(()=>n.binary?0:n.text.split(`
|
|
129
|
-
`).length,[n.text,n.binary]),T=c.jsxs("div",{className:"preview-actions",children:[o!==void 0&&c.jsx("button",{className:"primary-button primary-button-small preview-open",onClick:o,children:E("files.menu.insertMention")}),r!==null&&c.jsx("button",{className:"primary-button primary-button-small preview-open",onClick:r,children:E("files.menu.openWithSystem")})]});return n.binary?c.jsxs("div",{className:"preview-fallback",children:[c.jsx("p",{className:"panel-note",children:E("files.preview.binary")}),T]}):c.jsxs("div",{className:"panel-scroll",children:[c.jsxs("div",{className:"preview",children:[c.jsx("div",{className:"preview-gutter","aria-hidden":"true",children:Array.from({length:A},(s,l)=>c.jsx("span",{children:l+1},l))}),m!==null?c.jsx("pre",{className:"preview-code hljs",dangerouslySetInnerHTML:{__html:m}}):c.jsx("pre",{className:"preview-code",children:n.text})]}),n.truncated&&c.jsxs("div",{className:"preview-fallback",children:[c.jsx("p",{className:"panel-note",children:E("files.preview.truncated")}),T]})]})}function Qc(){return c.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:c.jsx("path",{d:"M1.5 3.5h4l1.2 1.6h7.8v7.4a1 1 0 0 1-1 1h-12a1 1 0 0 1-1-1V3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function Ib(){return c.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:[c.jsx("rect",{x:"5.5",y:"1.5",width:"9",height:"10",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),c.jsx("path",{d:"M10.5 13.2v.3a1 1 0 0 1-1 1h-7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h.3",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Pb({open:n}){return c.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:[c.jsx("path",{d:"M1.4 8S3.8 3.9 8 3.9 14.6 8 14.6 8 12.2 12.1 8 12.1 1.4 8 1.4 8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),c.jsx("circle",{cx:"8",cy:"8",r:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),!n&&c.jsx("path",{d:"M2.6 13.4L13.4 2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function jb(){return c.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:[c.jsx("rect",{x:"1.5",y:"10",width:"13",height:"4.5",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),c.jsx("path",{d:"M8 1.5v6.2M5.4 5.3L8 7.9l2.6-2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ob(){return c.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:c.jsx("path",{d:"M3 8.5l3.2 3.2L13 4.8",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function dm({className:n,title:r,doneTitle:o,icon:m,onAction:w}){const[A,T]=O.useState(!1),s=O.useRef(null);O.useEffect(()=>()=>{s.current!==null&&window.clearTimeout(s.current)},[]);const l=p=>{p.stopPropagation(),w(),T(!0),s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>T(!1),1200)};return c.jsx("button",{className:A?`${n} tree-action-done`:n,onClick:l,title:A?o:r,children:A?c.jsx(Ob,{}):m})}function Bb({className:n,title:r,onCopy:o}){return c.jsx(dm,{className:n,title:r,doneTitle:E("common.copied"),icon:c.jsx(Ib,{}),onAction:o})}function Jc({className:n,title:r,onInsert:o}){return c.jsx(dm,{className:n,title:r,doneTitle:E("files.pathInserted"),icon:c.jsx(jb,{}),onAction:o})}function Fb({view:n,cwd:r,platform:o,onInsert:m,onInsertPath:w,onReveal:A}){const{listings:T,loading:s,preview:l,loadingPreview:p,closePreview:v,refresh:u,query:y,setQuery:S,showHidden:k,toggleHidden:g}=n,a=zi(),[f,d]=O.useState(null),h=o==="win32"?"\\":"/",C=O.useCallback(N=>{const B=N.split("/").join(h);return r.length===0?B:r.endsWith(h)?`${r}${B}`:`${r}${h}${B}`},[r,h]),D=O.useCallback(N=>{navigator.clipboard.writeText(N).catch(()=>{})},[]),x=O.useCallback(N=>w(`"${C(N)}"`),[C,w]),M=O.useCallback((N,B)=>{N.preventDefault(),N.stopPropagation(),d({x:N.clientX,y:N.clientY,items:[{label:E("files.menu.copyAbsolute"),onSelect:()=>D(C(B))},{label:E("files.menu.copyRelative"),onSelect:()=>D(B)},...m===void 0?[]:[{label:E("files.menu.insertMention"),onSelect:()=>m(`@${B}`)}],...A===null?[]:[{label:E("files.menu.openWithSystem"),onSelect:()=>A(B)}]]})},[C,D,m,A,a]);if(l!==null||p)return c.jsxs("div",{className:"panel-body",children:[c.jsxs("div",{className:"panel-subhead",children:[c.jsx("button",{className:"link-button",onClick:v,children:E("files.back")}),l!==null&&c.jsxs("span",{className:"panel-subhead-title",title:l.path,children:[l.path.split("/").pop(),c.jsxs("span",{className:"panel-tagline",children:[" ",rn(l.sizeBytes)]})]})]}),p?c.jsx("p",{className:"panel-note",children:E("files.readingFile")}):l!==null&&c.jsx(Db,{preview:l,onOpenWithSystem:A===null?null:()=>A(l.path),onInsert:m===void 0?void 0:()=>m(`@${l.path}`)}),f!==null&&c.jsx(Fc,{x:f.x,y:f.y,items:f.items,onClose:()=>d(null)})]});const b=T.get(""),L=y.trim();return c.jsxs("div",{className:"panel-body",children:[c.jsxs("div",{className:"panel-subhead",children:[c.jsx("span",{className:"panel-subhead-title",title:r,children:r.split(/[\\/]/).filter(N=>N.length>0).pop()??r}),c.jsx(Jc,{className:"icon-button",title:E("files.insertFolderPath"),onInsert:()=>x("")}),c.jsx("button",{className:k?"icon-button icon-button-on":"icon-button",onClick:g,title:E(k?"files.hidden.hide":"files.hidden.show"),children:c.jsx(Pb,{open:k})}),A!==null&&c.jsx("button",{className:"icon-button",onClick:()=>A(""),title:E("files.revealFolder"),children:c.jsx(Qc,{})}),c.jsx("button",{className:"icon-button",onClick:u,title:E("files.refresh"),children:"⟳"})]}),c.jsxs("div",{className:"tree-search",children:[c.jsx("input",{className:"tree-search-input",value:y,placeholder:E("files.search.placeholder"),onChange:N=>S(N.target.value),onKeyDown:N=>{N.key==="Escape"&&y.length>0&&(N.stopPropagation(),S(""))}}),y.length>0&&c.jsx("button",{className:"tree-search-clear",onClick:()=>S(""),title:E("files.search.clear"),children:"×"})]}),c.jsx("div",{className:"panel-scroll",children:L.length>0?c.jsx(Hb,{view:n,onContextMenu:M,onReveal:A,onInsertPath:x}):b===void 0?c.jsx("p",{className:"panel-note",children:s.has("")?E("files.readingDir"):E("files.readDirFailed")}):c.jsx(fm,{path:"",depth:0,view:n,onContextMenu:M,onReveal:A,onInsertPath:x})}),f!==null&&c.jsx(Fc,{x:f.x,y:f.y,items:f.items,onClose:()=>d(null)})]})}function Hb({view:n,onContextMenu:r,onReveal:o,onInsertPath:m}){const{results:w,searching:A,openFile:T,toggleDirectory:s}=n;return w===null?c.jsx("p",{className:"panel-note",children:E(A?"files.search.searching":"files.search.prompt")}):w.entries.length===0?c.jsx("p",{className:"panel-note",children:E("files.search.none")}):c.jsxs("ul",{className:"tree tree-results",children:[w.entries.map(l=>c.jsx("li",{children:c.jsxs("div",{className:"tree-item",children:[c.jsxs("button",{className:`tree-row tree-row-${l.kind}${l.hidden===void 0?"":" tree-row-hidden"}`,onClick:()=>l.kind==="dir"?s(l.path):T(l.path),onContextMenu:p=>r(p,l.path,l.kind),title:l.path,children:[c.jsx("span",{className:"tree-chevron",children:l.kind==="dir"?"›":""}),c.jsxs("span",{className:"tree-result",children:[c.jsx("span",{className:"tree-name",children:l.name}),c.jsx("span",{className:"tree-result-path",children:l.path})]}),l.kind==="file"&&c.jsx("span",{className:"tree-size",children:rn(l.sizeBytes)})]}),c.jsx(Jc,{className:"tree-action",title:E("files.insertPath",{name:l.name}),onInsert:()=>m(l.path)}),l.kind==="dir"&&o!==null&&c.jsx("button",{className:"tree-action",onClick:()=>o(l.path),title:E("files.reveal",{name:l.name}),children:c.jsx(Qc,{})})]})},l.path)),w.truncated&&c.jsx("li",{className:"tree-hidden",title:E("files.search.moreTitle"),children:E("files.search.more")})]})}function fm({path:n,depth:r,view:o,onContextMenu:m,onReveal:w,onInsertPath:A}){const{listings:T,loading:s}=o,l=T.get(n);return l===void 0?s.has(n)?c.jsx("div",{className:"tree-loading",children:E("files.loading")}):null:c.jsxs("ul",{className:"tree",children:[l.entries.map(p=>c.jsx($b,{entry:p,depth:r,view:o,onContextMenu:m,onReveal:w,onInsertPath:A},p.path)),l.entries.length===0&&c.jsx("li",{className:"tree-empty",style:{paddingLeft:`${r*12+8}px`},children:l.hiddenCount>0?E("files.allHidden"):E("files.empty")}),(l.truncated||l.hiddenCount>0)&&l.entries.length>0&&c.jsx("li",{className:"tree-hidden",style:{paddingLeft:`${r*12+8}px`},title:E("files.hiddenTitle"),children:l.truncated?E("files.moreEntries"):E("files.hiddenCount",{count:l.hiddenCount})})]})}function $b({entry:n,depth:r,view:o,onContextMenu:m,onReveal:w,onInsertPath:A}){const{expanded:T,toggleDirectory:s,openFile:l}=o,p=n.kind==="dir"&&T.has(n.path);return c.jsxs("li",{children:[c.jsxs("div",{className:"tree-item",children:[c.jsxs("button",{className:`tree-row tree-row-${n.kind}${n.hidden===void 0?"":" tree-row-hidden"}`,style:{paddingLeft:`${r*12+6}px`},onClick:()=>n.kind==="dir"?s(n.path):l(n.path),onContextMenu:v=>m(v,n.path,n.kind),title:n.hidden===void 0?n.path:`${n.path}
|
|
130
|
-
${n.hidden==="ignored"?E("files.row.ignored"):E("files.row.alwaysHidden")}`,children:[c.jsx("span",{className:`tree-chevron${p?" tree-chevron-open":""}`,children:n.kind==="dir"?"›":""}),c.jsx("span",{className:"tree-name",children:n.name}),n.kind==="file"&&c.jsx("span",{className:"tree-size",children:rn(n.sizeBytes)})]}),c.jsx(Jc,{className:"tree-action",title:E("files.insertPath",{name:n.name}),onInsert:()=>A(n.path)}),n.kind==="dir"&&w!==null&&c.jsx("button",{className:"tree-action",onClick:()=>w(n.path),title:E("files.reveal",{name:n.name}),children:c.jsx(Qc,{})})]}),p&&c.jsx(fm,{path:n.path,depth:r+1,view:o,onContextMenu:m,onReveal:w,onInsertPath:A})]})}const Ub={added:"+",removed:"-",context:" ",hunk:"",meta:""};function Wb({diff:n}){return n.binary?c.jsx("p",{className:"panel-note",children:E("diff.binary")}):n.lines.length===0?c.jsx("p",{className:"panel-note",children:n.message===null?E("diff.noChanges"):kt(n.message)}):c.jsxs("div",{className:"panel-scroll",children:[c.jsx("div",{className:"diff",children:n.lines.map((r,o)=>c.jsxs("div",{className:`diff-line diff-line-${r.kind}`,children:[c.jsx("span",{className:"diff-num","aria-hidden":"true",children:r.oldLine??""}),c.jsx("span",{className:"diff-num","aria-hidden":"true",children:r.newLine??""}),c.jsx("span",{className:"diff-marker","aria-hidden":"true",children:Ub[r.kind]}),c.jsx("span",{className:"diff-text",children:r.text})]},o))}),n.truncated&&c.jsx("p",{className:"panel-note",children:E("diff.truncated")})]})}const zb={added:"A",modified:"M",deleted:"D",renamed:"R",copied:"C","type-changed":"T",untracked:"?",conflict:"!"},Vb={added:"git.kind.added",modified:"git.kind.modified",deleted:"git.kind.deleted",renamed:"git.kind.renamed",copied:"git.kind.copied","type-changed":"git.kind.typeChanged",untracked:"git.kind.untracked",conflict:"git.kind.conflict"},qb=[{stage:"conflict",title:"git.group.conflict",hint:"git.group.conflictHint"},{stage:"staged",title:"git.group.staged",hint:"git.group.stagedHint"},{stage:"unstaged",title:"git.group.unstaged",hint:"git.group.unstagedHint"},{stage:"untracked",title:"git.group.untracked",hint:"git.group.untrackedHint"}];function wf(n){const r=n.endsWith("/"),o=r?n.slice(0,-1):n,m=o.lastIndexOf("/"),w=m===-1?o:o.slice(m+1);return{dir:m===-1?"":o.slice(0,m+1),name:r?`${w}/`:w,isDirectory:r}}function Kb({status:n}){return c.jsxs("div",{className:"git-headline",children:[c.jsx("span",{className:"git-branch",title:n.repoRoot,children:n.branch??(n.head!==null?E("git.detachedAt",{head:n.head}):E("git.detached"))}),n.upstream!==null&&c.jsx("span",{className:"git-upstream",title:E("git.upstreamTitle",{upstream:n.upstream}),children:n.upstream}),(n.ahead>0||n.behind>0)&&c.jsxs("span",{className:"git-ab",title:E("git.aheadBehindTitle"),children:[n.ahead>0&&c.jsxs("span",{className:"git-ahead",children:["↑",n.ahead]}),n.behind>0&&c.jsxs("span",{className:"git-behind",children:["↓",n.behind]})]})]})}function Gb({view:n}){const{status:r,diff:o,loadingDiff:m,openDiff:w,closeDiff:A,refresh:T}=n;if(o!==null||m)return c.jsxs("div",{className:"panel-body",children:[c.jsxs("div",{className:"panel-subhead",children:[c.jsxs("button",{className:"link-button",onClick:A,children:["← ",E("git.backToChanges")]}),o!==null&&c.jsxs("span",{className:"panel-subhead-title",title:o.path,children:[wf(o.path).name,o.staged&&c.jsxs("span",{className:"panel-tagline",children:[" ",E("git.stagedTag")]})]})]}),m?c.jsx("p",{className:"panel-note",children:E("git.readingDiff")}):o!==null&&c.jsx(Wb,{diff:o})]});if(r.state!=="ready")return c.jsx("div",{className:"panel-body",children:c.jsx("p",{className:"panel-note",children:r.message===null?E("git.unknownState"):kt(r.message)})});const s=r.worktrees.filter(l=>!l.isCurrent);return c.jsxs("div",{className:"panel-body",children:[c.jsxs("div",{className:"panel-subhead",children:[c.jsx(Kb,{status:r}),c.jsx("button",{className:"icon-button",onClick:T,title:E("git.refresh"),children:"⟳"})]}),c.jsxs("div",{className:"panel-scroll",children:[r.changes.length===0&&c.jsx("p",{className:"panel-note",children:E("git.clean")}),qb.map(l=>{const p=r.changes.filter(v=>v.stage===l.stage);return p.length===0?null:c.jsxs("section",{className:"git-group",children:[c.jsxs("h3",{className:"git-group-title",title:E(l.hint),children:[E(l.title),c.jsx("span",{className:"git-group-count",children:p.length})]}),c.jsx("ul",{className:"git-list",children:p.map(v=>{const{dir:u,name:y,isDirectory:S}=wf(v.path),k=v.oldPath!==null?`${v.oldPath} → ${v.path}`:S?E("git.newFolderTitle",{path:v.path}):v.path,g=c.jsxs(c.Fragment,{children:[c.jsx("span",{className:`git-badge git-badge-${v.kind}`,title:E(Vb[v.kind]),children:zb[v.kind]}),c.jsxs("span",{className:"git-path",children:[c.jsx("span",{className:"git-path-name",children:y}),u.length>0&&c.jsx("span",{className:"git-path-dir",children:u})]})]});return c.jsx("li",{children:S?c.jsx("div",{className:"git-item git-item-static",title:k,children:g}):c.jsx("button",{className:"git-item",onClick:()=>w(v.path,v.stage==="staged"),title:k,children:g})},`${l.stage}:${v.path}`)})})]},l.stage)}),r.truncated&&c.jsx("p",{className:"panel-note",children:Bt("git.truncated")}),s.length>0&&c.jsxs("section",{className:"git-group",children:[c.jsxs("h3",{className:"git-group-title",title:E("git.worktrees.headingTitle"),children:[E("git.worktrees.heading"),c.jsx("span",{className:"git-group-count",children:s.length})]}),c.jsx("ul",{className:"git-list",children:s.map(l=>c.jsx("li",{children:c.jsxs("div",{className:"git-worktree",title:l.path,children:[c.jsx("span",{className:"git-worktree-branch",children:l.branch??E("git.worktrees.detached")}),c.jsx("span",{className:"git-worktree-path",children:l.path})]})},l.path))})]})]})]})}const Yb={create:"memory.action.create","append-block":"memory.action.appendBlock","replace-block":"memory.action.replaceBlock","append-lines":"memory.action.appendLines",copy:"memory.action.copy"},Xb={"AGENTS.md":["Codex","Antigravity","OpenCode"],"CLAUDE.md":["Claude Code"]};function pa(n){return n.brokenBlock||n.problem!==null}function Qb(n){return n.problem==="outside"?E("memory.problem.outside"):n.problem==="encoding"?E("memory.problem.encoding"):n.brokenBlock?E("memory.problem.brokenBlock"):null}function Jb(n){const r=n.files.filter(o=>!pa(o));return n.installed?{instructionFiles:r.filter(o=>o.hasBlock||o.exists).map(o=>o.name),gitMode:n.git.kind==="error"||n.git.kind==="repo"&&!n.git.ignored?"version":"ignore",importNative:!1,copyFromMainWorktree:!1}:{...pv(n),instructionFiles:r.map(o=>o.name)}}function Zb(n){const r=n.files.filter(w=>w.hasBlock&&!w.blockCurrent),o=n.files.filter(w=>w.exists&&!w.hasBlock&&!pa(w)),m=w=>Np(w.map(A=>A.name));return r.length===0?o.length===0?null:E("memory.update.missing",{files:m(o)}):o.length===0?E("memory.update.outdated",{count:r.length,files:m(r)}):E("memory.update.outdatedAndMissing",{count:r.length,outdated:m(r),missing:m(o)})}function eS(n){const r=n.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
131
|
-
`),o=/^---\n[\s\S]*?\n---(?:\n|$)/.exec(r);return o===null?r:r.slice(o[0].length)}function tS(n){return n.split(/`([^`]+)`/).map((r,o)=>o%2===1?c.jsx("code",{children:r},o):r)}function nS({view:n}){var a;const{status:r,open:o,loading:m,error:w,closeNote:A,openNote:T}=n,[s,l]=O.useState(null),[p,v]=O.useState(!1),u=(r==null?void 0:r.cwd)??null;O.useEffect(()=>{l(null),v(!1)},[u]),O.useEffect(()=>{n.lastResult!==null&&(l(null),v(!1))},[n.lastResult]);const y=O.useCallback(f=>{if(r===null)return null;let d=f.replace(/^\.\//,"");try{d=decodeURIComponent(d)}catch{return null}return d===aa||r.notes.some(C=>C.name===d)?()=>T(d):null},[r,T]);if(r===null)return c.jsx("div",{className:"panel-body",children:c.jsx("p",{className:"panel-note",children:w??E("memory.loading")})});if(o!==null||m!==null){const f=(o==null?void 0:o.name)??m??"",d=f===aa?E("memory.index"):((a=r.notes.find(h=>h.name===f))==null?void 0:a.title)??f;return c.jsxs("div",{className:"panel-body",children:[c.jsxs("div",{className:"panel-subhead",children:[c.jsx("button",{className:"link-button",onClick:A,children:E("memory.back")}),c.jsx("span",{className:"panel-subhead-title",title:f,children:d})]}),o===null?c.jsx("p",{className:"panel-note",children:E("memory.note.loading")}):c.jsxs("div",{className:"panel-scroll",children:[c.jsx("div",{className:"plan-body",children:c.jsx(Gc,{text:eS(o.text),localLink:y})}),o.truncated&&c.jsx("p",{className:"panel-note",children:E("memory.note.truncated")})]})]})}const S=s??Jb(r),k=r.installed?Zb(r):null,g=!r.installed||p||n.planned!==null;return c.jsxs("div",{className:"panel-body",children:[c.jsx(rS,{reach:r.reach,onAdjust:r.installed&&!g&&k===null&&r.reach.some(f=>!f.reaches)?()=>v(!0):null}),c.jsxs("div",{className:"panel-scroll",children:[(w??n.lastResult)!==null&&c.jsxs("div",{className:`memory-message${w!==null?" memory-message-error":""}`,children:[c.jsx("span",{children:w??n.lastResult}),c.jsx("button",{className:"link-button",onClick:n.dismissMessage,title:E("common.dismissNotice"),children:"×"})]}),r.git.kind==="error"&&c.jsxs("div",{className:"memory-warning",children:[c.jsx("p",{className:"memory-warning-line",children:Bt("memory.git.errorWarning")}),c.jsx("pre",{className:"memory-git-message",children:kt(r.git.message)})]}),r.files.filter(pa).map(f=>c.jsx("p",{className:"memory-warning",children:f.problem==="outside"?Bt("memory.problem.outsideWarning",{file:f.name}):f.problem==="encoding"?Bt("memory.problem.encodingWarning",{file:f.name}):Bt("memory.problem.brokenBlockWarning",{file:f.name})},f.name)),!r.installed&&c.jsxs("div",{className:"memory-intro",children:[c.jsx("p",{children:E("memory.intro.what")}),c.jsx("p",{children:Bt("memory.intro.where")})]}),r.installed&&k!==null&&!g&&c.jsxs("div",{className:"memory-callout",children:[c.jsx("span",{children:k}),c.jsx("button",{className:"primary-button primary-button-small",onClick:()=>v(!0),children:E("memory.update.button")})]}),g&&(n.planned===null?c.jsx(sS,{status:r,options:S,busy:n.busy,onChange:l,onPlan:()=>{l(S),n.requestPlan(S)},onCancel:r.installed?()=>{v(!1),l(null)}:null}):c.jsx(iS,{changes:n.planned,busy:n.busy,confirmLabel:r.installed?E("memory.plan.update"):E("memory.plan.install"),onConfirm:n.install,onCancel:n.cancelPlan})),r.installed&&r.native.pending>0&&!g&&c.jsxs("div",{className:"memory-callout",children:[c.jsx("span",{children:E("memory.native.pending",{count:r.native.pending})}),c.jsx("button",{className:"primary-button primary-button-small",disabled:n.busy!==null,onClick:n.importNative,children:n.busy==="import"?E("memory.native.importing"):E("memory.native.import",{count:r.native.pending})})]}),r.installed&&c.jsx(oS,{notes:r.notes,indexExists:r.indexExists,onOpen:T}),r.globalFragments.length>0&&c.jsx(aS,{fragments:r.globalFragments})]})]})}function rS({reach:n,onAdjust:r}){return c.jsxs("div",{className:"memory-reach",children:[n.map(o=>c.jsxs("span",{className:`memory-reach-item${o.reaches?" memory-reach-on":""}`,title:E("memory.reach.title",{label:o.label,via:kt(o.via)}),children:[c.jsx("span",{className:"memory-reach-mark","aria-hidden":"true",children:o.reaches?"✓":"—"}),o.label,c.jsx("span",{className:"visually-hidden",children:o.reaches?E("memory.reach.reaches",{via:kt(o.via)}):E("memory.reach.doesNotReach",{via:kt(o.via)})})]},o.agent)),r!==null&&c.jsx("button",{className:"link-button memory-reach-adjust",onClick:r,title:E("memory.reach.adjustTitle"),children:E("memory.reach.adjust")})]})}function sS({status:n,options:r,busy:o,onChange:m,onPlan:w,onCancel:A}){const{git:T}=n,s=T.kind==="repo"?T.worktree:null,l=T.kind==="error"&&r.gitMode==="ignore",p=(v,u)=>{const y=new Set(r.instructionFiles);u?y.add(v):y.delete(v),m({...r,instructionFiles:zc.filter(S=>y.has(S))})};return c.jsxs("div",{className:"memory-form",children:[c.jsx("p",{className:"memory-section-label",children:E("memory.form.files")}),n.files.map(v=>c.jsxs("label",{className:"memory-option",title:Qb(v)??void 0,children:[c.jsx("input",{type:"checkbox",checked:r.instructionFiles.includes(v.name),disabled:pa(v),onChange:u=>p(v.name,u.target.checked)}),c.jsx("code",{children:v.name}),c.jsx("span",{className:"memory-option-hint",children:Np(Xb[v.name])})]},v.name)),T.kind==="repo"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"memory-section-label",children:"Git"}),c.jsxs("label",{className:"memory-option",children:[c.jsx("input",{type:"radio",name:"memory-git-mode",checked:r.gitMode==="ignore",onChange:()=>m({...r,gitMode:"ignore"})}),E("memory.git.ignore"),c.jsx("span",{className:"memory-option-hint",children:E("memory.git.ignoreHint")})]}),c.jsxs("label",{className:"memory-option",children:[c.jsx("input",{type:"radio",name:"memory-git-mode",checked:r.gitMode==="version",onChange:()=>m({...r,gitMode:"version"})}),E("memory.git.version"),c.jsx("span",{className:"memory-option-hint",children:E("memory.git.versionHint")})]}),T.ignored&&r.gitMode==="version"&&c.jsx("p",{className:"memory-warning",children:Bt("memory.git.alreadyIgnored")})]}),T.kind==="error"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"memory-section-label",children:"Git"}),c.jsxs("label",{className:"memory-option",children:[c.jsx("input",{type:"radio",name:"memory-git-mode",checked:r.gitMode==="version",onChange:()=>m({...r,gitMode:"version"})}),Bt("memory.git.dontTouch"),c.jsx("span",{className:"memory-option-hint",children:E("memory.git.errorHint")})]})]}),(n.native.pending>0||(s==null?void 0:s.mainHasMemory)===!0)&&c.jsx("p",{className:"memory-section-label",children:E("memory.form.existingNotes")}),n.native.pending>0&&c.jsxs("label",{className:"memory-option",children:[c.jsx("input",{type:"checkbox",checked:r.importNative,onChange:v=>m({...r,importNative:v.target.checked})}),E("memory.form.importNative",{count:n.native.pending})]}),(s==null?void 0:s.mainHasMemory)===!0&&c.jsxs("label",{className:"memory-option",title:s.mainPath,children:[c.jsx("input",{type:"checkbox",checked:r.copyFromMainWorktree,onChange:v=>m({...r,copyFromMainWorktree:v.target.checked})}),E("memory.form.copyFromMain")]}),c.jsxs("div",{className:"memory-actions",children:[c.jsx("button",{className:"primary-button primary-button-small",disabled:o!==null||r.instructionFiles.length===0||l,onClick:w,title:r.instructionFiles.length===0?E("memory.form.noFiles"):l?E("memory.git.blocked"):void 0,children:E(o==="plan"?"memory.form.planning":"memory.form.preview")}),A!==null&&c.jsx("button",{className:"link-button",onClick:A,disabled:o!==null,children:E("common.cancel")})]})]})}function iS({changes:n,busy:r,confirmLabel:o,onConfirm:m,onCancel:w}){const A=r==="install";return c.jsxs("div",{className:"memory-form",children:[c.jsx("p",{className:"memory-section-label",children:E("memory.plan.changes")}),n.length===0?c.jsx("p",{className:"memory-empty",children:E("memory.plan.nothing")}):c.jsx("ul",{className:"memory-change-list",children:n.map((T,s)=>c.jsxs("li",{className:"memory-change",children:[c.jsxs("div",{className:"memory-change-head",children:[c.jsx("code",{className:"memory-change-file",children:T.file}),c.jsx("span",{className:"memory-option-hint",children:E(Yb[T.action])})]}),T.copiedFrom!==null&&c.jsx("p",{className:"memory-option-hint",children:E("memory.plan.copiedFrom",{path:T.copiedFrom})}),T.preview.length>0&&c.jsx("pre",{className:"memory-preview",children:T.preview})]},`${T.file}-${s}`))}),c.jsxs("div",{className:"memory-actions",children:[n.length>0&&c.jsx("button",{className:"primary-button primary-button-small",disabled:r!==null,onClick:m,children:A?E("memory.plan.writing"):o}),c.jsx("button",{className:"link-button",onClick:w,disabled:A,children:n.length===0?E("memory.plan.back"):E("common.cancel")})]})]})}function oS({notes:n,indexExists:r,onOpen:o}){return c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"memory-section-label",children:E("memory.list.notes")}),c.jsxs("ul",{className:"plan-list",children:[r&&c.jsx("li",{children:c.jsxs("button",{className:"plan-row",onClick:()=>o(aa),children:[c.jsx("span",{className:"plan-name",children:E("memory.index")}),c.jsx("span",{className:"plan-meta",children:aa})]})}),n.map(m=>c.jsx("li",{children:c.jsxs("button",{className:"plan-row",onClick:()=>o(m.name),title:m.name,children:[c.jsx("span",{className:"plan-name",children:m.title}),m.description.length>0&&c.jsx("span",{className:"memory-note-description",children:m.description}),c.jsxs("span",{className:"plan-meta",children:[jn(m.modifiedAt)," · ",rn(m.sizeBytes)]})]})},m.name))]}),n.length===0&&c.jsx("p",{className:"memory-empty",children:E("memory.list.empty")})]})}function aS({fragments:n}){const r=O.useCallback(o=>{navigator.clipboard.writeText(o).catch(()=>{})},[]);return c.jsxs("details",{className:"memory-global",children:[c.jsx("summary",{className:"memory-global-summary",children:E("memory.global.title")}),c.jsx("p",{className:"memory-empty",children:Bt("memory.global.intro")}),n.map(o=>c.jsxs("div",{className:"memory-fragment",children:[c.jsxs("div",{className:"memory-change-head",children:[c.jsx("span",{className:"memory-fragment-label",children:o.label}),c.jsx("code",{className:"memory-fragment-target",title:o.target,children:o.target})]}),c.jsxs("div",{className:"memory-fragment-body",children:[c.jsx("pre",{className:"memory-preview",children:o.text}),c.jsx(Bb,{className:"icon-button",title:E("memory.global.copy"),onCopy:()=>r(o.text)})]}),c.jsx("p",{className:"memory-fragment-note",children:tS(kt(o.note))})]},o.agent))]})}function lS(n){for(const r of n.split(`
|
|
132
|
-
`,40)){const o=/^#{1,3}\s+(.+)$/.exec(r.trim());if(o!==null)return(o[1]??"").trim()}return null}function cS({view:n}){var T,s;const{plans:r,open:o,loading:m,openPlan:w,closePlan:A}=n;if(o!==null||m!==null){const l=((T=r.find(u=>u.fileName===(o==null?void 0:o.fileName)))==null?void 0:T.path)??null,p=((s=r.find(u=>u.fileName===(o==null?void 0:o.fileName)))==null?void 0:s.title)??null,v=o===null?m:lS(o.text)??p??m;return c.jsxs("div",{className:"panel-body",children:[c.jsxs("div",{className:"panel-subhead",children:[c.jsxs("button",{className:"link-button",onClick:A,children:["← ",E("plans.backToList")]}),c.jsx("span",{className:"panel-subhead-title",title:l??void 0,children:v})]}),o===null?c.jsx("p",{className:"panel-note",children:E("plans.loading")}):c.jsxs("div",{className:"panel-scroll",children:[c.jsx("div",{className:"plan-body",children:c.jsx(Gc,{text:o.text})}),o.truncated&&c.jsx("p",{className:"panel-note",children:E("plans.truncated")})]})]})}return c.jsx("div",{className:"panel-body",children:c.jsx("div",{className:"panel-scroll",children:r.length===0?c.jsx("p",{className:"panel-note",children:Bt("plans.empty")}):c.jsx("ul",{className:"plan-list",children:[...r].reverse().map(l=>c.jsx(uS,{plan:l,onOpen:()=>w(l)},l.fileName))})})})}function uS({plan:n,onOpen:r}){const o=n.path.length>0?n.path:null;return n.exists?c.jsx("li",{children:c.jsxs("button",{className:"plan-row",onClick:r,title:o??void 0,children:[c.jsx("span",{className:"plan-name",children:n.title}),o!==null&&c.jsx("span",{className:"plan-path",children:o}),c.jsxs("span",{className:"plan-meta",children:[jn(n.modifiedAt)," · ",rn(n.sizeBytes)]})]})}):c.jsxs("li",{className:"plan-row plan-row-missing",title:o??E("plans.missingTitle"),children:[c.jsx("span",{className:"plan-name",children:n.title}),o!==null&&c.jsx("span",{className:"plan-path",children:o}),c.jsx("span",{className:"plan-meta",children:E("plans.missing")})]})}const hS=[{id:"cli",labelKey:"panel.tab.cli"},{id:"git",labelKey:"panel.tab.git"},{id:"files",labelKey:"panel.tab.files"},{id:"plans",labelKey:"panel.tab.plans"},{id:"memory",labelKey:"panel.tab.memory"}];function pm(n){return n.state!=="ready"?0:new Set(n.changes.map(r=>r.path)).size}function dS({tab:n,plansAvailable:r,hidden:o,onTabChange:m,title:w,cwd:A,platform:T,cli:s,cliUnseen:l,expanded:p,onToggleExpanded:v,git:u,files:y,plans:S,memory:k,onInsert:g,onInsertPath:a,onReveal:f,onHide:d}){var D;const h=pm(u.status),C=((D=k.status)==null?void 0:D.installed)===!0?k.status.notes.length:0;return c.jsxs("section",{className:`side-panel${o?" side-panel-hidden":""}`,"aria-hidden":o,children:[c.jsxs("header",{className:"side-panel-header",children:[c.jsx("button",{className:"icon-button",onClick:d,title:E("panel.hide"),children:"»"}),A.length>0&&c.jsx("span",{className:"project-swatch",style:{background:ts(A)}}),c.jsx("span",{className:"side-panel-title",title:A,children:w}),c.jsx("button",{className:"icon-button",onClick:v,title:E(p?"panel.restoreWidth":"panel.widen"),children:p?"⇥":"⇤"})]}),c.jsx("nav",{className:"side-panel-tabs",children:I0(hS,r).map(x=>c.jsxs("button",{className:`side-panel-tab${x.id===n?" side-panel-tab-active":""}`,onClick:()=>m(x.id),title:E(x.labelKey),children:[c.jsx("span",{className:"side-panel-tab-label",children:E(x.labelKey)}),x.id==="git"&&h>0&&c.jsx("span",{className:"side-panel-badge",children:h}),x.id==="plans"&&S.plans.length>0&&c.jsx("span",{className:"side-panel-badge",children:S.plans.length}),x.id==="memory"&&C>0&&c.jsx("span",{className:"side-panel-badge",children:C}),x.id==="cli"&&l&&n!=="cli"&&c.jsx("span",{className:"side-panel-dot",title:E("panel.cliUnseen")})]},x.id))}),c.jsxs("div",{className:"side-panel-body",children:[c.jsx("div",{className:`cli-slot${n==="cli"?"":" cli-slot-hidden"}`,children:s}),n==="git"&&c.jsx(Gb,{view:u}),n==="plans"&&c.jsx(cS,{view:S}),n==="memory"&&c.jsx(nS,{view:k}),n==="files"&&c.jsx(Fb,{view:y,cwd:A,platform:T,onInsert:g,onInsertPath:a,onReveal:f})]})]})}function fS({placement:n}){return c.jsxs("div",{className:"tab tab-pending","aria-busy":"true",title:`${n.pending.cwd}
|
|
133
|
-
${E("tabs.state.opening")}`,style:{"--tab-project-color":ts(n.pending.cwd)},children:[c.jsx("span",{className:"tab-opening","aria-label":E("tabs.aria.opening"),children:c.jsx("i",{})}),c.jsx("span",{className:"tab-label",children:n.label})]})}function Zc({terminal:n,activity:r,statusLine:o}){if(!n.alive){const m=n.sleeping;return c.jsx("span",{className:`tab-dot${m?" tab-dot-sleeping":" tab-dot-dead"}`,title:E(m?"tabs.dot.sleeping":"tabs.dot.exited")})}return r==="waiting"?c.jsx("span",{className:"tab-bang",title:E("tabs.dot.waiting"),children:"!"}):r==="busy"?c.jsxs("span",{className:"tab-working",title:E("tabs.dot.busy"),"aria-label":E("tabs.aria.working"),children:[c.jsx("i",{}),c.jsx("i",{}),c.jsx("i",{})]}):c.jsx("span",{className:"tab-dot",title:V0(r,o)})}function Hi(n){if(n.label.length>0)return n.label;const r=n.cwd.split(/[\\/]/).filter(m=>m.length>0),o=r[r.length-1]??n.cwd;return n.resumed?`${o} ↩`:o}function pS(n){return n.alive?E("tabs.state.alive"):n.sleeping?E("tabs.state.sleeping"):E("tabs.state.exited",{code:n.exitCode??"?"})}function mS({terminals:n,activeTerminalId:r,activity:o,canOpen:m,onSelect:w,onClose:A,onRename:T,onReorder:s,onNew:l,agents:p,offerAgentChoice:v,newTabAgent:u,pendingOpens:y,platform:S,newTabBlockedTitle:k}){const[g,a]=O.useState(null),[f,d]=O.useState(""),[h,C]=O.useState(null),D=O.useRef(null);O.useEffect(()=>{var P;g!==null&&((P=D.current)==null||P.select())},[g]);const x=P=>{a(P.terminalId),d(P.label.length>0?P.label:Hi(P))},M=()=>{g!==null&&T(g,f.trim()),a(null)},b=P=>{if(h===null||h===P)return;const F=n.map(X=>X.terminalId),H=F.indexOf(h),q=F.indexOf(P);H===-1||q===-1||(F.splice(q,0,...F.splice(H,1)),s(F),C(null))},L=yy(n,y,S),N=new Map;for(const P of L){const F=N.get(P.index);F===void 0?N.set(P.index,[P]):F.push(P)}const B=P=>(N.get(P)??[]).map(F=>c.jsx(fS,{placement:F},`pending:${F.pending.requestId}`));return c.jsxs("div",{className:"tab-bar",children:[n.map((P,F)=>{var X;const H=P.terminalId===r,q=P.terminalId===g;return c.jsxs(a_.Fragment,{children:[B(F),c.jsx("div",{className:`tab${H?" tab-active":""}${P.alive||P.sleeping?"":" tab-dead"}`,draggable:!q,onDragStart:()=>C(P.terminalId),onDragOver:G=>G.preventDefault(),onDrop:()=>b(P.terminalId),onDragEnd:()=>C(null),onClick:()=>w(P.terminalId),onDoubleClick:()=>x(P),title:`${P.cwd}
|
|
134
|
-
${pS(P)}`,style:{"--tab-project-color":ts(P.cwd)},children:q?c.jsx("input",{ref:D,className:"tab-input",value:f,onChange:G=>d(G.target.value),onBlur:M,onKeyDown:G=>{G.key==="Enter"&&M(),G.key==="Escape"&&a(null),G.stopPropagation()},onClick:G=>G.stopPropagation()}):c.jsxs(c.Fragment,{children:[c.jsx(Zc,{terminal:P,activity:o.get(P.terminalId),statusLine:((X=p.find(G=>G.id===P.agent))==null?void 0:X.statusLine)??null}),c.jsxs("span",{className:"tab-label",children:[P.agent!==null&&iy(v,P.agent)&&c.jsx(Bc,{agent:P.agent,agents:p}),Hi(P)]}),c.jsx("button",{className:"tab-close",onClick:G=>{G.stopPropagation(),A(P.terminalId)},title:E("tabs.close"),children:"×"})]})})]},P.terminalId)}),B(n.length),c.jsx(Yc,{className:"tab-new",text:"+",title:k??E("tabs.new"),disabled:!m||k!==null,offerAgentChoice:v,agents:p,agent:u,onOpen:l})]})}function gS(n,r,o){const[m,w]=O.useState(!1);return O.useEffect(()=>{if(w(!1),!(r===null||o))return n.onMessage(A=>{A.type==="terminal.output"&&A.terminalId===r&&w(!0)})},[n,r,o]),m&&!o}const _S=200,bf="agent-workbench.files.hidden";function vS(n,r){const[o,m]=O.useState(new Map),[w,A]=O.useState(new Set),[T,s]=O.useState(new Set),[l,p]=O.useState(null),[v,u]=O.useState(!1),[y,S]=O.useState(""),[k,g]=O.useState(null),[a,f]=O.useState(!1),[d,h]=O.useState(()=>yt(bf,!1,P=>P==="true"?!0:P==="false"?!1:null)),C=O.useRef(new Set),D=O.useRef(d);D.current=d;const x=O.useCallback(P=>{r===null||C.current.has(P)||(C.current.add(P),s(F=>new Set(F).add(P)),n.send({type:"files.list",terminalId:r,path:P,includeHidden:D.current}))},[n,r]);O.useEffect(()=>{if(m(new Map),A(new Set),s(new Set),p(null),u(!1),S(""),g(null),f(!1),C.current=new Set,r===null)return;const P=n.onMessage(H=>{switch(H.type){case"files.listing":{if(H.terminalId!==r)break;const{listing:q}=H;C.current.delete(q.path),m(X=>new Map(X).set(q.path,q)),s(X=>{const G=new Set(X);return G.delete(q.path),G});break}case"files.results":if(H.terminalId!==r)break;g(H.result),f(!1);break;case"files.preview":if(H.terminalId!==r)break;p(H.preview),u(!1);break;case"error":C.current=new Set,s(new Set),u(!1),f(!1);break}});n.send({type:"files.list",terminalId:r,path:"",includeHidden:D.current}),C.current.add(""),s(new Set([""]));const F=n.onReopen(()=>{C.current=new Set,n.send({type:"files.list",terminalId:r,path:"",includeHidden:D.current})});return()=>{P(),F()}},[n,r]),O.useEffect(()=>{const P=y.trim();if(r===null||P.length===0){g(null),f(!1);return}f(!0);const F=window.setTimeout(()=>{n.send({type:"files.search",terminalId:r,query:P,includeHidden:D.current})},_S);return()=>window.clearTimeout(F)},[n,r,y,d]);const M=O.useCallback(P=>{A(F=>{const H=new Set(F);return H.has(P)?H.delete(P):(H.add(P),x(P)),H})},[x]),b=O.useCallback(P=>{r!==null&&(u(!0),p(null),n.send({type:"files.read",terminalId:r,path:P}))},[n,r]),L=O.useCallback(()=>{p(null),u(!1)},[]),N=O.useCallback(()=>{if(r===null)return;C.current=new Set;const P=["",...w];for(const F of P)C.current.add(F),n.send({type:"files.list",terminalId:r,path:F,includeHidden:D.current});s(new Set(P))},[n,r,w]),B=O.useCallback(()=>{h(P=>{const F=!P;if(D.current=F,ut(bf,String(F)),r!==null){C.current=new Set;const H=["",...w];for(const q of H)C.current.add(q),n.send({type:"files.list",terminalId:r,path:q,includeHidden:F});s(new Set(H))}return F})},[n,r,w]);return{listings:o,expanded:w,loading:T,preview:l,loadingPreview:v,query:y,setQuery:S,results:k,searching:a,showHidden:d,toggleHidden:B,toggleDirectory:M,openFile:b,closePreview:L,refresh:N}}function yS(n){const[r,o]=O.useState(!1),[m,w]=O.useState(null),[A,T]=O.useState(null),[s,l]=O.useState(null),p=O.useRef(null);O.useEffect(()=>{const y=n.onMessage(k=>{switch(k.type){case"search.progress":if(p.current===null||k.searchId!==p.current)break;w(g=>V1(g,k.progress));break;case"search.results":if(p.current===null||k.searchId!==p.current)break;p.current=null,w(k.result),T(null),o(!1);break;case"error":if(k.code!=="search-failed"||p.current===null||k.requestId!==p.current)break;p.current=null,k.detail!==void 0&&console.error("[servidor]",k.detail),w(null),T(kt(k.text)),o(!1);break}}),S=n.onReopen(()=>{p.current!==null&&(p.current=null,o(!1),T(E("searchHook.connectionLost")))});return()=>{y(),S()}},[n]);const v=O.useCallback((y,S)=>{const k=crypto.randomUUID();p.current=k,l({query:y,includeArchived:S}),o(!0),T(null),w(null),n.send({type:"search.global",searchId:k,query:y,includeArchived:S})},[n]),u=O.useCallback(()=>{const y=p.current;p.current=null,y!==null&&n.send({type:"search.cancel",searchId:y}),l(null),o(!1),w(null),T(null)},[n]);return{searching:r,result:m,error:A,submitted:s,search:v,clear:u}}function wS(n,r){const[o,m]=O.useState([]),[w,A]=O.useState(null),[T,s]=O.useState(null);O.useEffect(()=>{if(m([]),A(null),s(null),r!==null)return n.onMessage(v=>{switch(v.type){case"conversation.plans":if(v.terminalId!==r)break;m(v.plans);break;case"plans.content":if(v.terminalId!==r)break;A(v.plan),s(null);break;case"error":s(null);break}})},[n,r]);const l=O.useCallback(v=>{r!==null&&(s(v.title),A(null),n.send({type:"plans.read",terminalId:r,fileName:v.fileName}))},[n,r]),p=O.useCallback(()=>{A(null),s(null)},[]);return{plans:o,open:w,loading:T,openPlan:l,closePlan:p}}function bS(n,r){const[o,m]=O.useState(tc),[w,A]=O.useState(null),[T,s]=O.useState(!1);O.useEffect(()=>{if(r===null){m(tc),A(null);return}m(tc),A(null),s(!1);const u=n.onMessage(S=>{switch(S.type){case"git.status":S.terminalId===r&&m(S.status);break;case"git.diff":if(S.terminalId!==r)break;A(S.diff),s(!1);break;case"error":s(!1);break}});n.send({type:"git.subscribe",terminalId:r});const y=n.onReopen(()=>{n.send({type:"git.subscribe",terminalId:r})});return()=>{u(),y(),n.send({type:"git.unsubscribe",terminalId:r})}},[n,r]);const l=O.useCallback((u,y)=>{r!==null&&(s(!0),A(null),n.send({type:"git.diff",terminalId:r,path:u,staged:y}))},[n,r]),p=O.useCallback(()=>{A(null),s(!1)},[]),v=O.useCallback(()=>{r!==null&&n.send({type:"git.refresh",terminalId:r})},[n,r]);return{status:o,diff:w,loadingDiff:T,openDiff:l,closeDiff:p,refresh:v}}const Hc=new Set;function SS(n){return n!==void 0&&Hc.has(n)}function CS(n){return n.length===0?E("memory.result.nothingChanged"):E("memory.result.installed",{count:n.length})}function xS(n,r){const o=n.length===0?E("memory.result.nothingImported"):E("memory.result.imported",{count:n.length});return r.length===0?o:E("memory.result.withSkipped",{result:o,skipped:E("memory.result.skipped",{count:r.length,files:r.join(", ")})})}function kS(n,r){const[o,m]=O.useState(null),[w,A]=O.useState(null),[T,s]=O.useState(null),[l,p]=O.useState(null),[v,u]=O.useState(null),[y,S]=O.useState(null),[k,g]=O.useState(null),a=O.useRef(new Map),f=O.useRef(new Set),d=O.useRef(null),h=O.useRef(!1),C=O.useCallback(H=>{const q=`memory-${crypto.randomUUID()}`;return a.current.set(q,H),f.current.add(q),Hc.add(q),q},[]),D=O.useCallback(H=>{for(const[q,X]of a.current)X===H&&a.current.delete(q)},[]);O.useEffect(()=>{m(null),A(null),s(null),p(null),u(null),S(null),g(null),a.current.clear();for(const j of f.current)Hc.delete(j);if(f.current.clear(),d.current=null,h.current=!1,r===null)return;const H=(j,W)=>j===void 0||a.current.get(j)!==W?!1:(a.current.delete(j),!0),q=n.onMessage(j=>{switch(j.type){case"memory.status":if(j.terminalId!==r)break;m(j.status),h.current&&(h.current=!1,g(null));break;case"memory.planned":if(j.terminalId!==r||!H(j.requestId,"plan"))break;p(j.changes),u(null);break;case"memory.installed":if(j.terminalId!==r||!H(j.requestId,"install"))break;d.current=null,p(null),u(null),S(CS(j.applied));break;case"memory.imported":if(j.terminalId!==r||!H(j.requestId,"import"))break;u(null),S(xS(j.copied,j.skipped));break;case"memory.content":if(j.terminalId!==r||!H(j.requestId,"read"))break;A(j.note),s(null);break;case"error":{const W=j.requestId,$=W===void 0?void 0:a.current.get(W);if(W===void 0||$===void 0)break;a.current.delete(W),$==="read"?s(null):$!=="subscribe"&&u(null),g(kt(j.text)),h.current=$==="subscribe";break}}}),X=n.onStatus(j=>{if(j!=="reconnecting"&&j!=="failed")return;const W=new Set(a.current.values());a.current.clear(),u(null),s(null),(W.has("install")||W.has("import"))&&(d.current=null,p(null),g(E("memory.error.connectionLost")))}),G=()=>{n.send({type:"memory.subscribe",terminalId:r,requestId:C("subscribe")})};G();const K=n.onReopen(G);return()=>{q(),X(),K(),n.send({type:"memory.unsubscribe",terminalId:r})}},[n,r,C]);const x=O.useCallback(()=>{h.current=!1,g(null),S(null)},[]),M=O.useCallback(H=>{r!==null&&(D("read"),x(),s(H),A(null),n.send({type:"memory.read",terminalId:r,name:H,requestId:C("read")}))},[n,r,x,D,C]),b=O.useCallback(()=>{D("read"),A(null),s(null)},[D]),L=O.useCallback(H=>{r!==null&&(x(),d.current=H,p(null),u("plan"),n.send({type:"memory.plan",terminalId:r,options:H,requestId:C("plan")}))},[n,r,x,C]),N=O.useCallback(()=>{const H=d.current;r===null||H===null||(x(),u("install"),n.send({type:"memory.install",terminalId:r,options:H,requestId:C("install")}))},[n,r,x,C]),B=O.useCallback(()=>{r!==null&&(x(),u("import"),n.send({type:"memory.import",terminalId:r,requestId:C("import")}))},[n,r,x,C]),P=O.useCallback(()=>{D("plan"),d.current=null,p(null)},[D]),F=O.useCallback(()=>{h.current=!1,g(null),S(null)},[]);return{status:o,open:w,loading:T,planned:l,busy:v,lastResult:y,error:k,openNote:M,closeNote:b,requestPlan:L,install:N,importNative:B,cancelPlan:P,dismissMessage:F}}function ES(n){const[r,o]=O.useState([]),[m,w]=O.useState({}),[A,T]=O.useState(null),s=O.useRef(new Set);O.useEffect(()=>{const a=n.onMessage(d=>{switch(d.type){case"notes.list":o(d.notes);break;case"notes.imageData":s.current.add(d.imageId),w(h=>({...h,[d.imageId]:d.data===null?null:`data:${d.mediaType};base64,${d.data}`}));break;case"error":d.code==="notes-failed"&&T(kt(d.text));break}}),f=n.onReopen(()=>{s.current.clear()});return()=>{a(),f()}},[n]);const l=O.useCallback(a=>{s.current.has(a)||(s.current.add(a),n.send({type:"notes.image",imageId:a}))},[n]),p=O.useCallback(()=>{const a=crypto.randomUUID(),f=Date.now();return o(d=>[...d,{noteId:a,text:"",images:[],createdAt:f,updatedAt:f}]),n.send({type:"notes.create",noteId:a}),a},[n]),v=O.useCallback((a,f)=>{o(d=>d.map(h=>h.noteId===a?{...h,text:f,updatedAt:Date.now()}:h)),n.send({type:"notes.update",noteId:a,text:f})},[n]),u=O.useCallback(a=>{o(f=>f.filter(d=>d.noteId!==a)),n.send({type:"notes.delete",noteId:a})},[n]),y=O.useCallback((a,f)=>{const d=r.find(C=>C.noteId===a);if(d!==void 0&&d.images.length>=kd){T(E("notes.tooManyImages",{count:kd}));return}if(f.size>la){T(E("notes.imageTooBig",{name:f.name||E("notes.imageFallbackName"),size:Math.round(f.size/1024/1024),max:la/1024/1024}));return}const h=new FileReader;h.onload=()=>{const C=h.result;if(typeof C!="string")return;const D=C.indexOf(",");D!==-1&&n.send({type:"notes.addImage",noteId:a,image:{mediaType:f.type,data:C.slice(D+1)}})},h.onerror=()=>T(E("notes.readFailed")),h.readAsDataURL(f)},[n,r]),S=O.useCallback((a,f)=>{o(d=>d.map(h=>h.noteId===a?{...h,images:h.images.filter(C=>C.imageId!==f)}:h)),n.send({type:"notes.removeImage",noteId:a,imageId:f})},[n]),k=O.useCallback((a,f)=>{n.send({type:"notes.send",noteId:a,terminalId:f})},[n]),g=O.useCallback(()=>T(null),[]);return{notes:r,images:m,problem:A,requestImage:l,create:p,updateText:v,remove:u,addImage:y,removeImage:S,sendToAgent:k,dismissProblem:g}}const mm="agent-workbench.theme",yc=["system","light","dark"],LS={system:"theme.system",light:"theme.light",dark:"theme.dark"};function Sf(n){return E("theme.title",{theme:E(LS[n])})}const Cf={system:"◐",light:"☀",dark:"☾"};function TS(){return yt(mm,"system",n=>n==="light"||n==="dark"||n==="system"?n:null)}function RS(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function MS(){const[n,r]=O.useState(TS),[o,m]=O.useState(RS);O.useEffect(()=>{const T=window.matchMedia("(prefers-color-scheme: dark)"),s=l=>m(l.matches);return T.addEventListener("change",s),()=>T.removeEventListener("change",s)},[]);const w=n==="system"?o?"dark":"light":n;O.useEffect(()=>{document.documentElement.dataset.theme=w,document.documentElement.style.colorScheme=w},[w]);const A=O.useCallback(()=>{r(T=>{const s=yc[(yc.indexOf(T)+1)%yc.length]??"system";return ut(mm,s),s})},[]);return{preference:n,resolved:w,cycle:A}}const AS=1500;function NS(n,r){return n===void 0||n===r?null:r==="waiting"?"attention":r==="idle"&&n==="busy"?"done":null}function DS(n,r){const o={now:[],later:[],cancel:[]};for(const[m,w]of r){const A=n.get(m);if(A===w)continue;o.cancel.push(m);const T=NS(A,w);T==="attention"?o.now.push(m):T==="done"&&o.later.push(m)}for(const m of n.keys())r.has(m)||o.cancel.push(m);return o}const xf="agent-workbench.phone-chime";function IS(n){return n==="system"||n==="page"?n:null}function PS(n){return`agentworkbench://chime?source=${n}`}function jS(n,r,o,m){return n?r==="page"?ma:null:o?Vi(m):null}const kf="agent-workbench.sound";function OS(n){return n==="on"?!0:n==="off"?!1:null}function BS(n){return E(n?"sound.on":"sound.off")}function FS(n,r){return n&&r>0}const HS={done:[{frequency:880,at:0,duration:.18},{frequency:659.25,at:.14,duration:.28}],attention:[{frequency:659.25,at:0,duration:.18},{frequency:987.77,at:.14,duration:.28}]},gm=.02,ma=.8,_m=.2,Ef="agent-workbench.sound-volume";function Vi(n){return Math.min(ma,Math.max(gm,n))}function $S(n){if(n.trim().length===0)return null;const r=Number(n);return Number.isFinite(r)?Vi(r):null}function US(n){return Math.round(Vi(n)/ma*100)}class WS{constructor(){Mt(this,"context",null);Mt(this,"volume",_m)}unlock(){typeof window>"u"||typeof window.AudioContext!="function"||(this.context??(this.context=new window.AudioContext),this.context.state==="suspended"&&this.context.resume().catch(()=>{}))}get ready(){var r;return((r=this.context)==null?void 0:r.state)==="running"}play(r){const o=this.context;if(o===null||o.state!=="running")return;const m=o.currentTime+.01;for(const w of HS[r]){const A=o.createOscillator(),T=o.createGain();A.type="sine",A.frequency.value=w.frequency;const s=m+w.at;T.gain.setValueAtTime(1e-4,s),T.gain.exponentialRampToValueAtTime(Vi(this.volume),s+.012),T.gain.exponentialRampToValueAtTime(1e-4,s+w.duration),A.connect(T),T.connect(o.destination),A.start(s),A.stop(s+w.duration+.02)}}}const wc="agent-workbench.notify";function zS(n){return n==="on"?!0:n==="off"?!1:null}function VS(n,r,o){return n&&r==="granted"&&!o}function qS(n,r){return E(r==="denied"?"sound.notify.blocked":n?"sound.notify.on":"sound.notify.off")}function KS(n,r){return n==="attention"?E("notify.attention",{tab:r}):E("notify.done",{tab:r})}function GS(n){return n===void 0?"":n.label.length>0?n.label:n.cwd.split(/[\\/]/).filter(r=>r.length>0).pop()??n.cwd}function Oi(){return typeof window>"u"||!("Notification"in window)||!window.isSecureContext?"unsupported":Notification.permission}async function YS(){if(Oi()==="unsupported")return"unsupported";try{return await Notification.requestPermission()}catch{return Oi()}}function XS(){return document.visibilityState==="visible"&&document.hasFocus()}function QS(n){try{const r=new Notification("Agent Workbench",{body:KS(n.chime,n.tabName),tag:`agent-workbench:${n.terminalId}`});r.onclick=()=>{window.focus(),n.onClick(),r.close()}}catch{}}function JS(n,r){const[o,m]=O.useState(()=>yt(kf,!0,OS)),w=O.useRef(o);w.current=o;const[A,T]=O.useState(()=>yt(Ef,_m,$S)),s=O.useRef(A);s.current=A;const[l]=O.useState(()=>typeof navigator<"u"&&Op(navigator.userAgent)),[p,v]=O.useState(()=>yt(xf,"system",IS)),u=O.useRef(p);u.current=p;const[y,S]=O.useState(()=>Oi()),[k,g]=O.useState(()=>yt(wc,!1,zS)),a=O.useRef(k);a.current=k;const f=O.useRef(r);f.current=r;const d=O.useCallback((H,q)=>{VS(a.current,Oi(),XS())&&QS({chime:H,terminalId:q,tabName:f.current.nameOf(q),onClick:()=>f.current.activate(q)})},[]),h=O.useRef(null),C=O.useRef(new Map),D=O.useRef(new Map),x=O.useCallback(H=>{const q=h.current,X=jS(l,u.current,w.current,s.current);q===null||X===null||(q.volume=X,q.play(H))},[l]);O.useEffect(()=>{const H=new WS;H.volume=s.current,h.current=H;const q=()=>{H.unlock(),H.ready&&(window.removeEventListener("pointerdown",q),window.removeEventListener("keydown",q))};return window.addEventListener("pointerdown",q),window.addEventListener("keydown",q),()=>{window.removeEventListener("pointerdown",q),window.removeEventListener("keydown",q),h.current=null}},[]),O.useEffect(()=>{const H=DS(C.current,n);C.current=new Map(n);const q=D.current;for(const X of H.cancel){const G=q.get(X);G!==void 0&&(window.clearTimeout(G),q.delete(X))}H.now.length>0&&x("attention");for(const X of H.now)d("attention",X);for(const X of H.later)q.set(X,window.setTimeout(()=>{q.delete(X),x("done"),d("done",X)},AS))},[n,d,x]),O.useEffect(()=>{const H=D.current;return()=>{for(const q of H.values())window.clearTimeout(q);H.clear()}},[]);const M=O.useCallback(()=>{var H,q;m(X=>{const G=!X;return ut(kf,G?"on":"off"),G}),w.current||((H=h.current)==null||H.unlock(),(q=h.current)==null||q.play("done"))},[]),b=O.useCallback(H=>{const q=Vi(H);T(q),ut(Ef,String(q)),h.current!==null&&(h.current.volume=q)},[]),L=O.useCallback(()=>{var H,q;w.current&&((H=h.current)==null||H.unlock(),(q=h.current)==null||q.play("done"))},[]),N=O.useCallback(()=>{if(a.current&&Oi()==="granted"){g(!1),ut(wc,"off");return}YS().then(H=>{S(H),H==="granted"&&(g(!0),ut(wc,"on"))})},[]),B={supported:y!=="unsupported",enabled:k&&y==="granted",permission:y,toggle:N},P=O.useCallback(H=>{var q;v(H),u.current=H,ut(xf,H),window.location.href=PS(H),H==="page"&&((q=h.current)==null||q.unlock(),x("done"))},[x]);return{enabled:o,toggle:M,volume:A,setVolume:b,previewVolume:L,notify:B,phoneChime:l?{source:p,setSource:P}:null}}function vm(n,r,o){const[m,w]=O.useState(()=>yt(n,r,Yw));O.useLayoutEffect(()=>{document.documentElement.dataset[o]=m},[o,m]);const A=O.useCallback(()=>{w(T=>{const s=Kp(T);return ut(n,s),s})},[n]);return{size:m,cycle:A}}function ZS(){return vm(Vw,qp,"threadFont")}function eC(){return vm(qw,Kw,"notesFont")}const tC=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]);function ym({sound:n}){return c.jsxs("span",{className:"sound-control",children:[c.jsx("button",{className:`icon-button${FS(n.enabled,n.volume)?" icon-button-on":""}`,onClick:n.toggle,title:BS(n.enabled),"aria-pressed":n.enabled,children:"♪"}),n.enabled&&c.jsx("div",{className:"sound-volume",children:c.jsxs("div",{className:"sound-volume-box",children:[c.jsx("input",{className:"sound-volume-slider",type:"range",min:gm,max:ma,step:.01,value:n.volume,onChange:r=>n.setVolume(Number(r.target.value)),onPointerUp:n.previewVolume,onKeyUp:r=>{tC.has(r.key)&&n.previewVolume()},title:E("sound.volume"),"aria-label":E("sound.volume")}),c.jsxs("span",{className:"sound-volume-value",children:[US(n.volume),"%"]})]})})]})}function wm({notify:n}){return n.supported?c.jsx("button",{className:`icon-button${n.enabled?" icon-button-on":""}`,onClick:n.toggle,title:qS(n.enabled,n.permission),"aria-pressed":n.enabled,children:c.jsx(nC,{})}):null}function nC(){return c.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:c.jsx("path",{d:"M4 11V7a4 4 0 0 1 8 0v4l1.2 1.5H2.8L4 11zM6.6 14a1.5 1.5 0 0 0 2.8 0",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function rC(n){const[r,o]=O.useState(null),[m,w]=O.useState(null),[A,T]=O.useState(null),[s,l]=O.useState(!1),[p,v]=O.useState(null);O.useEffect(()=>{const C=n.onMessage(x=>{switch(x.type){case"remote.status":o(x.status),x.status.pairingActive||(w(null),T(null));break;case"remote.pairing.code":w(x.pairing),T(null);break;case"remote.phone.pairing":T(x.pairing),w(null);break;case"error":if(x.code!=="remote-failed")break;v(kt(x.text)),x.detail!==void 0&&console.error("[servidor]",x.detail);break}}),D=n.onReopen(()=>{w(null),T(null),l(!1)});return()=>{C(),D()}},[n]);const u=O.useCallback(C=>{v(null),n.send({type:"remote.configure",enabled:C})},[n]),y=O.useCallback(C=>{v(null),n.send({type:"remote.configure",port:C})},[n]),S=O.useCallback(()=>{v(null),n.send({type:"remote.pairing.start"})},[n]),k=O.useCallback(()=>{w(null),n.send({type:"remote.pairing.cancel"})},[n]),g=O.useCallback(()=>{v(null),l(!0),n.send({type:"remote.phone.start"})},[n]),a=O.useCallback(()=>{T(null),l(!1),n.send({type:"remote.phone.cancel"})},[n]),f=O.useCallback((C,D)=>{v(null),n.send({type:"remote.device.rename",deviceId:C,label:D})},[n]),d=O.useCallback(C=>{v(null),n.send({type:"remote.device.revoke",deviceId:C})},[n]),h=O.useCallback(()=>v(null),[]);return{status:r,pairing:m,phonePairing:A,phoneStarted:s,problem:p,setEnabled:u,setPort:y,startPairing:S,cancelPairing:k,startPhonePairing:g,cancelPhonePairing:a,renameDevice:f,revokeDevice:d,dismissProblem:h}}const sC="USER";function iC(n,r){const o=n.sshUser.length>0?n.sshUser:sC,m=/\s/.test(o)?`"${o}@${r}"`:`${o}@${r}`;return`ssh -N -L ${n.port}:127.0.0.1:${n.port} ${m}`}function bm(n){return`http://localhost:${n}`}function oC(n,r){return`${bm(n)}/?${Pv}=${r}`}function Lf(n){return n[0]??"localhost"}function $c(n,r){switch(n){case"off":return E("remote.state.off");case"active":return E("remote.state.active",{port:r});case"restart-needed":return E("remote.state.restartNeeded");case"port-busy":return E("remote.state.portBusy",{port:r})}}function aC(n){const r=n.trim();if(!/^\d{1,5}$/.test(r))return null;const o=Number(r);return Ov(o)?o:null}function lC(){return E("remote.portInvalid",{min:ap,max:lp})}function Tf(n,r){return Math.max(0,Math.ceil((n-r)/1e3))}function Rf(n){return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function cC(n,r=Date.now()){return n.connected?E("remote.device.connected"):n.lastSeenAt===null?E("remote.device.never"):E("remote.device.lastSeen",{when:jn(n.lastSeenAt,r)})}function uC(n,r=Date.now()){return E("remote.device.paired",{when:jn(n.createdAt,r)})}function hC(n){switch(n){case"powershell-admin":return E("remote.phone.authorize.admin");case"powershell":return E("remote.phone.authorize.powershell");case"terminal":return E("remote.phone.authorize.terminal")}}function dC(){return[{platform:"win32",label:"Windows",hint:E("remote.ssh.windows"),command:["Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0","Start-Service sshd","Set-Service -Name sshd -StartupType Automatic"].join(`
|
|
135
|
-
`)},{platform:"darwin",label:"macOS",hint:E("remote.ssh.macos"),command:null},{platform:"linux",label:"Linux",hint:E("remote.ssh.linux"),command:["sudo apt install openssh-server","sudo systemctl enable --now ssh"].join(`
|
|
136
|
-
`)}]}function fC(n){return n==="win32"||n==="darwin"?n:"linux"}function ra(n){return n!==null&&n.state==="active"}function Mf(n){return n!==null&&n.state==="active"&&n.devices.length>0}const Vs=function(n,r){let w=n;const A=ji[r];let T=null,s=0,l=null;const p=[],v={},u=function(M,b){s=w*4+17,T=(function(L){const N=new Array(L);for(let B=0;B<L;B+=1){N[B]=new Array(L);for(let P=0;P<L;P+=1)N[B][P]=null}return N})(s),y(0,0),y(s-7,0),y(0,s-7),g(),k(),f(M,b),w>=7&&a(M),l==null&&(l=C(w,A,p)),d(l,b)},y=function(M,b){for(let L=-1;L<=7;L+=1)if(!(M+L<=-1||s<=M+L))for(let N=-1;N<=7;N+=1)b+N<=-1||s<=b+N||(0<=L&&L<=6&&(N==0||N==6)||0<=N&&N<=6&&(L==0||L==6)||2<=L&&L<=4&&2<=N&&N<=4?T[M+L][b+N]=!0:T[M+L][b+N]=!1)},S=function(){let M=0,b=0;for(let L=0;L<8;L+=1){u(!0,L);const N=Sr.getLostPoint(v);(L==0||M>N)&&(M=N,b=L)}return b},k=function(){for(let M=8;M<s-8;M+=1)T[M][6]==null&&(T[M][6]=M%2==0);for(let M=8;M<s-8;M+=1)T[6][M]==null&&(T[6][M]=M%2==0)},g=function(){const M=Sr.getPatternPosition(w);for(let b=0;b<M.length;b+=1)for(let L=0;L<M.length;L+=1){const N=M[b],B=M[L];if(T[N][B]==null)for(let P=-2;P<=2;P+=1)for(let F=-2;F<=2;F+=1)P==-2||P==2||F==-2||F==2||P==0&&F==0?T[N+P][B+F]=!0:T[N+P][B+F]=!1}},a=function(M){const b=Sr.getBCHTypeNumber(w);for(let L=0;L<18;L+=1){const N=!M&&(b>>L&1)==1;T[Math.floor(L/3)][L%3+s-8-3]=N}for(let L=0;L<18;L+=1){const N=!M&&(b>>L&1)==1;T[L%3+s-8-3][Math.floor(L/3)]=N}},f=function(M,b){const L=A<<3|b,N=Sr.getBCHTypeInfo(L);for(let B=0;B<15;B+=1){const P=!M&&(N>>B&1)==1;B<6?T[B][8]=P:B<8?T[B+1][8]=P:T[s-15+B][8]=P}for(let B=0;B<15;B+=1){const P=!M&&(N>>B&1)==1;B<8?T[8][s-B-1]=P:B<9?T[8][15-B-1+1]=P:T[8][15-B-1]=P}T[s-8][8]=!M},d=function(M,b){let L=-1,N=s-1,B=7,P=0;const F=Sr.getMaskFunction(b);for(let H=s-1;H>0;H-=2)for(H==6&&(H-=1);;){for(let q=0;q<2;q+=1)if(T[N][H-q]==null){let X=!1;P<M.length&&(X=(M[P]>>>B&1)==1),F(N,H-q)&&(X=!X),T[N][H-q]=X,B-=1,B==-1&&(P+=1,B=7)}if(N+=L,N<0||s<=N){N-=L,L=-L;break}}},h=function(M,b){let L=0,N=0,B=0;const P=new Array(b.length),F=new Array(b.length);for(let G=0;G<b.length;G+=1){const K=b[G].dataCount,j=b[G].totalCount-K;N=Math.max(N,K),B=Math.max(B,j),P[G]=new Array(K);for(let J=0;J<P[G].length;J+=1)P[G][J]=255&M.getBuffer()[J+L];L+=K;const W=Sr.getErrorCorrectPolynomial(j),V=$i(P[G],W.getLength()-1).mod(W);F[G]=new Array(W.getLength()-1);for(let J=0;J<F[G].length;J+=1){const re=J+V.getLength()-F[G].length;F[G][J]=re>=0?V.getAt(re):0}}let H=0;for(let G=0;G<b.length;G+=1)H+=b[G].totalCount;const q=new Array(H);let X=0;for(let G=0;G<N;G+=1)for(let K=0;K<b.length;K+=1)G<P[K].length&&(q[X]=P[K][G],X+=1);for(let G=0;G<B;G+=1)for(let K=0;K<b.length;K+=1)G<F[K].length&&(q[X]=F[K][G],X+=1);return q},C=function(M,b,L){const N=Af.getRSBlocks(M,b),B=Nf();for(let F=0;F<L.length;F+=1){const H=L[F];B.put(H.getMode(),4),B.put(H.getLength(),Sr.getLengthInBits(H.getMode(),M)),H.write(B)}let P=0;for(let F=0;F<N.length;F+=1)P+=N[F].dataCount;if(B.getLengthInBits()>P*8)throw"code length overflow. ("+B.getLengthInBits()+">"+P*8+")";for(B.getLengthInBits()+4<=P*8&&B.put(0,4);B.getLengthInBits()%8!=0;)B.putBit(!1);for(;!(B.getLengthInBits()>=P*8||(B.put(236,8),B.getLengthInBits()>=P*8));)B.put(17,8);return h(B,N)};v.addData=function(M,b){b=b||"Byte";let L=null;switch(b){case"Numeric":L=pC(M);break;case"Alphanumeric":L=mC(M);break;case"Byte":L=gC(M);break;case"Kanji":L=_C(M);break;default:throw"mode:"+b}p.push(L),l=null},v.isDark=function(M,b){if(M<0||s<=M||b<0||s<=b)throw M+","+b;return T[M][b]},v.getModuleCount=function(){return s},v.make=function(){if(w<1){let M=1;for(;M<40;M++){const b=Af.getRSBlocks(M,A),L=Nf();for(let B=0;B<p.length;B++){const P=p[B];L.put(P.getMode(),4),L.put(P.getLength(),Sr.getLengthInBits(P.getMode(),M)),P.write(L)}let N=0;for(let B=0;B<b.length;B++)N+=b[B].dataCount;if(L.getLengthInBits()<=N*8)break}w=M}u(!1,S())},v.createTableTag=function(M,b){M=M||2,b=typeof b>"u"?M*4:b;let L="";L+='<table style="',L+=" border-width: 0px; border-style: none;",L+=" border-collapse: collapse;",L+=" padding: 0px; margin: "+b+"px;",L+='">',L+="<tbody>";for(let N=0;N<v.getModuleCount();N+=1){L+="<tr>";for(let B=0;B<v.getModuleCount();B+=1)L+='<td style="',L+=" border-width: 0px; border-style: none;",L+=" border-collapse: collapse;",L+=" padding: 0px; margin: 0px;",L+=" width: "+M+"px;",L+=" height: "+M+"px;",L+=" background-color: ",L+=v.isDark(N,B)?"#000000":"#ffffff",L+=";",L+='"/>';L+="</tr>"}return L+="</tbody>",L+="</table>",L},v.createSvgTag=function(M,b,L,N){let B={};typeof arguments[0]=="object"&&(B=arguments[0],M=B.cellSize,b=B.margin,L=B.alt,N=B.title),M=M||2,b=typeof b>"u"?M*4:b,L=typeof L=="string"?{text:L}:L||{},L.text=L.text||null,L.id=L.text?L.id||"qrcode-description":null,N=typeof N=="string"?{text:N}:N||{},N.text=N.text||null,N.id=N.text?N.id||"qrcode-title":null;const P=v.getModuleCount()*M+b*2;let F,H,q,X,G="",K;for(K="l"+M+",0 0,"+M+" -"+M+",0 0,-"+M+"z ",G+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',G+=B.scalable?"":' width="'+P+'px" height="'+P+'px"',G+=' viewBox="0 0 '+P+" "+P+'" ',G+=' preserveAspectRatio="xMinYMin meet"',G+=N.text||L.text?' role="img" aria-labelledby="'+D([N.id,L.id].join(" ").trim())+'"':"",G+=">",G+=N.text?'<title id="'+D(N.id)+'">'+D(N.text)+"</title>":"",G+=L.text?'<description id="'+D(L.id)+'">'+D(L.text)+"</description>":"",G+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',G+='<path d="',q=0;q<v.getModuleCount();q+=1)for(X=q*M+b,F=0;F<v.getModuleCount();F+=1)v.isDark(q,F)&&(H=F*M+b,G+="M"+H+","+X+K);return G+='" stroke="transparent" fill="black"/>',G+="</svg>",G},v.createDataURL=function(M,b){M=M||2,b=typeof b>"u"?M*4:b;const L=v.getModuleCount()*M+b*2,N=b,B=L-b;return bC(L,L,function(P,F){if(N<=P&&P<B&&N<=F&&F<B){const H=Math.floor((P-N)/M),q=Math.floor((F-N)/M);return v.isDark(q,H)?0:1}else return 1})},v.createImgTag=function(M,b,L){M=M||2,b=typeof b>"u"?M*4:b;const N=v.getModuleCount()*M+b*2;let B="";return B+="<img",B+=' src="',B+=v.createDataURL(M,b),B+='"',B+=' width="',B+=N,B+='"',B+=' height="',B+=N,B+='"',L&&(B+=' alt="',B+=D(L),B+='"'),B+="/>",B};const D=function(M){let b="";for(let L=0;L<M.length;L+=1){const N=M.charAt(L);switch(N){case"<":b+="<";break;case">":b+=">";break;case"&":b+="&";break;case'"':b+=""";break;default:b+=N;break}}return b},x=function(M){M=typeof M>"u"?2:M;const L=v.getModuleCount()*1+M*2,N=M,B=L-M;let P,F,H,q,X;const G={"██":"█","█ ":"▀"," █":"▄"," ":" "},K={"██":"▀","█ ":"▀"," █":" "," ":" "};let j="";for(P=0;P<L;P+=2){for(H=Math.floor((P-N)/1),q=Math.floor((P+1-N)/1),F=0;F<L;F+=1)X="█",N<=F&&F<B&&N<=P&&P<B&&v.isDark(H,Math.floor((F-N)/1))&&(X=" "),N<=F&&F<B&&N<=P+1&&P+1<B&&v.isDark(q,Math.floor((F-N)/1))?X+=" ":X+="█",j+=M<1&&P+1>=B?K[X]:G[X];j+=`
|
|
137
|
-
`}return L%2&&M>0?j.substring(0,j.length-L-1)+Array(L+1).join("▀"):j.substring(0,j.length-1)};return v.createASCII=function(M,b){if(M=M||1,M<2)return x(b);M-=1,b=typeof b>"u"?M*2:b;const L=v.getModuleCount()*M+b*2,N=b,B=L-b;let P,F,H,q;const X=Array(M+1).join("██"),G=Array(M+1).join(" ");let K="",j="";for(P=0;P<L;P+=1){for(H=Math.floor((P-N)/M),j="",F=0;F<L;F+=1)q=1,N<=F&&F<B&&N<=P&&P<B&&v.isDark(H,Math.floor((F-N)/M))&&(q=0),j+=q?X:G;for(H=0;H<M;H+=1)K+=j+`
|
|
138
|
-
`}return K.substring(0,K.length-1)},v.renderTo2dContext=function(M,b){b=b||2;const L=v.getModuleCount();for(let N=0;N<L;N++)for(let B=0;B<L;B++)M.fillStyle=v.isDark(N,B)?"black":"white",M.fillRect(B*b,N*b,b,b)},v};Vs.stringToBytes=function(n){const r=[];for(let o=0;o<n.length;o+=1){const m=n.charCodeAt(o);r.push(m&255)}return r};Vs.createStringToBytes=function(n,r){const o=(function(){const w=yC(n),A=function(){const l=w.read();if(l==-1)throw"eof";return l};let T=0;const s={};for(;;){const l=w.read();if(l==-1)break;const p=A(),v=A(),u=A(),y=String.fromCharCode(l<<8|p),S=v<<8|u;s[y]=S,T+=1}if(T!=r)throw T+" != "+r;return s})(),m=63;return function(w){const A=[];for(let T=0;T<w.length;T+=1){const s=w.charCodeAt(T);if(s<128)A.push(s);else{const l=o[w.charAt(T)];typeof l=="number"?(l&255)==l?A.push(l):(A.push(l>>>8),A.push(l&255)):A.push(m)}}return A}};const Vt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},ji={L:1,M:0,Q:3,H:2},br={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Sr=(function(){const n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,o=7973,m=21522,w={},A=function(T){let s=0;for(;T!=0;)s+=1,T>>>=1;return s};return w.getBCHTypeInfo=function(T){let s=T<<10;for(;A(s)-A(r)>=0;)s^=r<<A(s)-A(r);return(T<<10|s)^m},w.getBCHTypeNumber=function(T){let s=T<<12;for(;A(s)-A(o)>=0;)s^=o<<A(s)-A(o);return T<<12|s},w.getPatternPosition=function(T){return n[T-1]},w.getMaskFunction=function(T){switch(T){case br.PATTERN000:return function(s,l){return(s+l)%2==0};case br.PATTERN001:return function(s,l){return s%2==0};case br.PATTERN010:return function(s,l){return l%3==0};case br.PATTERN011:return function(s,l){return(s+l)%3==0};case br.PATTERN100:return function(s,l){return(Math.floor(s/2)+Math.floor(l/3))%2==0};case br.PATTERN101:return function(s,l){return s*l%2+s*l%3==0};case br.PATTERN110:return function(s,l){return(s*l%2+s*l%3)%2==0};case br.PATTERN111:return function(s,l){return(s*l%3+(s+l)%2)%2==0};default:throw"bad maskPattern:"+T}},w.getErrorCorrectPolynomial=function(T){let s=$i([1],0);for(let l=0;l<T;l+=1)s=s.multiply($i([1,Cr.gexp(l)],0));return s},w.getLengthInBits=function(T,s){if(1<=s&&s<10)switch(T){case Vt.MODE_NUMBER:return 10;case Vt.MODE_ALPHA_NUM:return 9;case Vt.MODE_8BIT_BYTE:return 8;case Vt.MODE_KANJI:return 8;default:throw"mode:"+T}else if(s<27)switch(T){case Vt.MODE_NUMBER:return 12;case Vt.MODE_ALPHA_NUM:return 11;case Vt.MODE_8BIT_BYTE:return 16;case Vt.MODE_KANJI:return 10;default:throw"mode:"+T}else if(s<41)switch(T){case Vt.MODE_NUMBER:return 14;case Vt.MODE_ALPHA_NUM:return 13;case Vt.MODE_8BIT_BYTE:return 16;case Vt.MODE_KANJI:return 12;default:throw"mode:"+T}else throw"type:"+s},w.getLostPoint=function(T){const s=T.getModuleCount();let l=0;for(let u=0;u<s;u+=1)for(let y=0;y<s;y+=1){let S=0;const k=T.isDark(u,y);for(let g=-1;g<=1;g+=1)if(!(u+g<0||s<=u+g))for(let a=-1;a<=1;a+=1)y+a<0||s<=y+a||g==0&&a==0||k==T.isDark(u+g,y+a)&&(S+=1);S>5&&(l+=3+S-5)}for(let u=0;u<s-1;u+=1)for(let y=0;y<s-1;y+=1){let S=0;T.isDark(u,y)&&(S+=1),T.isDark(u+1,y)&&(S+=1),T.isDark(u,y+1)&&(S+=1),T.isDark(u+1,y+1)&&(S+=1),(S==0||S==4)&&(l+=3)}for(let u=0;u<s;u+=1)for(let y=0;y<s-6;y+=1)T.isDark(u,y)&&!T.isDark(u,y+1)&&T.isDark(u,y+2)&&T.isDark(u,y+3)&&T.isDark(u,y+4)&&!T.isDark(u,y+5)&&T.isDark(u,y+6)&&(l+=40);for(let u=0;u<s;u+=1)for(let y=0;y<s-6;y+=1)T.isDark(y,u)&&!T.isDark(y+1,u)&&T.isDark(y+2,u)&&T.isDark(y+3,u)&&T.isDark(y+4,u)&&!T.isDark(y+5,u)&&T.isDark(y+6,u)&&(l+=40);let p=0;for(let u=0;u<s;u+=1)for(let y=0;y<s;y+=1)T.isDark(y,u)&&(p+=1);const v=Math.abs(100*p/s/s-50)/5;return l+=v*10,l},w})(),Cr=(function(){const n=new Array(256),r=new Array(256);for(let m=0;m<8;m+=1)n[m]=1<<m;for(let m=8;m<256;m+=1)n[m]=n[m-4]^n[m-5]^n[m-6]^n[m-8];for(let m=0;m<255;m+=1)r[n[m]]=m;const o={};return o.glog=function(m){if(m<1)throw"glog("+m+")";return r[m]},o.gexp=function(m){for(;m<0;)m+=255;for(;m>=256;)m-=255;return n[m]},o})(),$i=function(n,r){if(typeof n.length>"u")throw n.length+"/"+r;const o=(function(){let w=0;for(;w<n.length&&n[w]==0;)w+=1;const A=new Array(n.length-w+r);for(let T=0;T<n.length-w;T+=1)A[T]=n[T+w];return A})(),m={};return m.getAt=function(w){return o[w]},m.getLength=function(){return o.length},m.multiply=function(w){const A=new Array(m.getLength()+w.getLength()-1);for(let T=0;T<m.getLength();T+=1)for(let s=0;s<w.getLength();s+=1)A[T+s]^=Cr.gexp(Cr.glog(m.getAt(T))+Cr.glog(w.getAt(s)));return $i(A,0)},m.mod=function(w){if(m.getLength()-w.getLength()<0)return m;const A=Cr.glog(m.getAt(0))-Cr.glog(w.getAt(0)),T=new Array(m.getLength());for(let s=0;s<m.getLength();s+=1)T[s]=m.getAt(s);for(let s=0;s<w.getLength();s+=1)T[s]^=Cr.gexp(Cr.glog(w.getAt(s))+A);return $i(T,0).mod(w)},m},Af=(function(){const n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(w,A){const T={};return T.totalCount=w,T.dataCount=A,T},o={},m=function(w,A){switch(A){case ji.L:return n[(w-1)*4+0];case ji.M:return n[(w-1)*4+1];case ji.Q:return n[(w-1)*4+2];case ji.H:return n[(w-1)*4+3];default:return}};return o.getRSBlocks=function(w,A){const T=m(w,A);if(typeof T>"u")throw"bad rs block @ typeNumber:"+w+"/errorCorrectionLevel:"+A;const s=T.length/3,l=[];for(let p=0;p<s;p+=1){const v=T[p*3+0],u=T[p*3+1],y=T[p*3+2];for(let S=0;S<v;S+=1)l.push(r(u,y))}return l},o})(),Nf=function(){const n=[];let r=0;const o={};return o.getBuffer=function(){return n},o.getAt=function(m){const w=Math.floor(m/8);return(n[w]>>>7-m%8&1)==1},o.put=function(m,w){for(let A=0;A<w;A+=1)o.putBit((m>>>w-A-1&1)==1)},o.getLengthInBits=function(){return r},o.putBit=function(m){const w=Math.floor(r/8);n.length<=w&&n.push(0),m&&(n[w]|=128>>>r%8),r+=1},o},pC=function(n){const r=Vt.MODE_NUMBER,o=n,m={};m.getMode=function(){return r},m.getLength=function(T){return o.length},m.write=function(T){const s=o;let l=0;for(;l+2<s.length;)T.put(w(s.substring(l,l+3)),10),l+=3;l<s.length&&(s.length-l==1?T.put(w(s.substring(l,l+1)),4):s.length-l==2&&T.put(w(s.substring(l,l+2)),7))};const w=function(T){let s=0;for(let l=0;l<T.length;l+=1)s=s*10+A(T.charAt(l));return s},A=function(T){if("0"<=T&&T<="9")return T.charCodeAt(0)-48;throw"illegal char :"+T};return m},mC=function(n){const r=Vt.MODE_ALPHA_NUM,o=n,m={};m.getMode=function(){return r},m.getLength=function(A){return o.length},m.write=function(A){const T=o;let s=0;for(;s+1<T.length;)A.put(w(T.charAt(s))*45+w(T.charAt(s+1)),11),s+=2;s<T.length&&A.put(w(T.charAt(s)),6)};const w=function(A){if("0"<=A&&A<="9")return A.charCodeAt(0)-48;if("A"<=A&&A<="Z")return A.charCodeAt(0)-65+10;switch(A){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+A}};return m},gC=function(n){const r=Vt.MODE_8BIT_BYTE,o=Vs.stringToBytes(n),m={};return m.getMode=function(){return r},m.getLength=function(w){return o.length},m.write=function(w){for(let A=0;A<o.length;A+=1)w.put(o[A],8)},m},_C=function(n){const r=Vt.MODE_KANJI,o=Vs.stringToBytes;(function(A,T){const s=o(A);if(s.length!=2||(s[0]<<8|s[1])!=T)throw"sjis not supported."})("友",38726);const m=o(n),w={};return w.getMode=function(){return r},w.getLength=function(A){return~~(m.length/2)},w.write=function(A){const T=m;let s=0;for(;s+1<T.length;){let l=(255&T[s])<<8|255&T[s+1];if(33088<=l&&l<=40956)l-=33088;else if(57408<=l&&l<=60351)l-=49472;else throw"illegal char at "+(s+1)+"/"+l;l=(l>>>8&255)*192+(l&255),A.put(l,13),s+=2}if(s<T.length)throw"illegal char at "+(s+1)},w},Sm=function(){const n=[],r={};return r.writeByte=function(o){n.push(o&255)},r.writeShort=function(o){r.writeByte(o),r.writeByte(o>>>8)},r.writeBytes=function(o,m,w){m=m||0,w=w||o.length;for(let A=0;A<w;A+=1)r.writeByte(o[A+m])},r.writeString=function(o){for(let m=0;m<o.length;m+=1)r.writeByte(o.charCodeAt(m))},r.toByteArray=function(){return n},r.toString=function(){let o="";o+="[";for(let m=0;m<n.length;m+=1)m>0&&(o+=","),o+=n[m];return o+="]",o},r},vC=function(){let n=0,r=0,o=0,m="";const w={},A=function(s){m+=String.fromCharCode(T(s&63))},T=function(s){if(s<0)throw"n:"+s;if(s<26)return 65+s;if(s<52)return 97+(s-26);if(s<62)return 48+(s-52);if(s==62)return 43;if(s==63)return 47;throw"n:"+s};return w.writeByte=function(s){for(n=n<<8|s&255,r+=8,o+=1;r>=6;)A(n>>>r-6),r-=6},w.flush=function(){if(r>0&&(A(n<<6-r),n=0,r=0),o%3!=0){const s=3-o%3;for(let l=0;l<s;l+=1)m+="="}},w.toString=function(){return m},w},yC=function(n){const r=n;let o=0,m=0,w=0;const A={};A.read=function(){for(;w<8;){if(o>=r.length){if(w==0)return-1;throw"unexpected end of file./"+w}const l=r.charAt(o);if(o+=1,l=="=")return w=0,-1;if(l.match(/^\s$/))continue;m=m<<6|T(l.charCodeAt(0)),w+=6}const s=m>>>w-8&255;return w-=8,s};const T=function(s){if(65<=s&&s<=90)return s-65;if(97<=s&&s<=122)return s-97+26;if(48<=s&&s<=57)return s-48+52;if(s==43)return 62;if(s==47)return 63;throw"c:"+s};return A},wC=function(n,r){const o=n,m=r,w=new Array(n*r),A={};A.setPixel=function(p,v,u){w[v*o+p]=u},A.write=function(p){p.writeString("GIF87a"),p.writeShort(o),p.writeShort(m),p.writeByte(128),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(255),p.writeByte(255),p.writeByte(255),p.writeString(","),p.writeShort(0),p.writeShort(0),p.writeShort(o),p.writeShort(m),p.writeByte(0);const v=2,u=s(v);p.writeByte(v);let y=0;for(;u.length-y>255;)p.writeByte(255),p.writeBytes(u,y,255),y+=255;p.writeByte(u.length-y),p.writeBytes(u,y,u.length-y),p.writeByte(0),p.writeString(";")};const T=function(p){const v=p;let u=0,y=0;const S={};return S.write=function(k,g){if(k>>>g)throw"length over";for(;u+g>=8;)v.writeByte(255&(k<<u|y)),g-=8-u,k>>>=8-u,y=0,u=0;y=k<<u|y,u=u+g},S.flush=function(){u>0&&v.writeByte(y)},S},s=function(p){const v=1<<p,u=(1<<p)+1;let y=p+1;const S=l();for(let d=0;d<v;d+=1)S.add(String.fromCharCode(d));S.add(String.fromCharCode(v)),S.add(String.fromCharCode(u));const k=Sm(),g=T(k);g.write(v,y);let a=0,f=String.fromCharCode(w[a]);for(a+=1;a<w.length;){const d=String.fromCharCode(w[a]);a+=1,S.contains(f+d)?f=f+d:(g.write(S.indexOf(f),y),S.size()<4095&&(S.size()==1<<y&&(y+=1),S.add(f+d)),f=d)}return g.write(S.indexOf(f),y),g.write(u,y),g.flush(),k.toByteArray()},l=function(){const p={};let v=0;const u={};return u.add=function(y){if(u.contains(y))throw"dup key:"+y;p[y]=v,v+=1},u.size=function(){return v},u.indexOf=function(y){return p[y]},u.contains=function(y){return typeof p[y]<"u"},u};return A},bC=function(n,r,o){const m=wC(n,r);for(let s=0;s<r;s+=1)for(let l=0;l<n;l+=1)m.setPixel(l,s,o(l,s));const w=Sm();m.write(w);const A=vC(),T=w.toByteArray();for(let s=0;s<T.length;s+=1)A.writeByte(T[s]);return A.flush(),"data:image/gif;base64,"+A};Vs.stringToBytes;const Ii=4;function SC(n){const r=Vs(0,"M");r.addData(n,"Byte"),r.make();const o=r.getModuleCount();let m="";for(let w=0;w<o;w++){let A=0;for(;A<o;){if(!r.isDark(w,A)){A++;continue}const T=A;for(;A<o&&r.isDark(w,A);)A++;m+=`M${T} ${w}h${A-T}v1h-${A-T}z`}}return{size:o,path:m}}const CC=1e3,xC=4e3;function kC({status:n,pairing:r,phonePairing:o,phoneStarted:m,problem:w,platform:A,onSetEnabled:T,onSetPort:s,onStartPairing:l,onCancelPairing:p,onStartPhonePairing:v,onCancelPhonePairing:u,onRenameDevice:y,onRevokeDevice:S,onDismissProblem:k,onClose:g}){const[a,f]=O.useState(()=>Lf(n.hostNames)),[d,h]=O.useState(String(n.port)),[C,D]=O.useState(null),x=O.useRef(null),[M,b]=O.useState(()=>Date.now()),L=()=>{r!==null&&p(),m&&u(),g()},N=O.useRef(L);N.current=L,O.useEffect(()=>{const G=K=>{K.key==="Escape"&&(K.preventDefault(),K.stopPropagation(),N.current())};return window.addEventListener("keydown",G,!0),()=>window.removeEventListener("keydown",G,!0)},[]),O.useEffect(()=>{if(r===null&&o===null)return;b(Date.now());const G=window.setInterval(()=>b(Date.now()),1e3);return()=>window.clearInterval(G)},[r,o]),O.useEffect(()=>()=>{x.current!==null&&window.clearTimeout(x.current)},[]),O.useEffect(()=>{h(String(n.port))},[n.port]),O.useEffect(()=>{n.hostNames.includes(a)||f(Lf(n.hostNames))},[n.hostNames,a]);const B=(G,K)=>{navigator.clipboard.writeText(K).then(()=>{D(G),x.current!==null&&window.clearTimeout(x.current),x.current=window.setTimeout(()=>D(null),CC)}).catch(()=>D(null))},P=aC(d),F=P!==null&&P!==n.port,H=iC(n,a),q=E("remote.title"),X=r===null?null:oC(n.port,r.code);return c.jsx("div",{className:"modal-backdrop",onClick:L,children:c.jsxs("div",{className:"modal",role:"dialog","aria-label":q,onClick:G=>G.stopPropagation(),children:[c.jsxs("header",{className:"modal-header",children:[c.jsx("span",{className:"modal-title",children:q}),c.jsx("button",{className:"icon-button",onClick:L,title:E("common.close"),children:"×"})]}),c.jsxs("div",{className:"modal-body",children:[c.jsx("p",{className:`status-line-state${n.state==="active"?" status-line-state-active":""}`,children:$c(n.state,n.port)}),c.jsx("p",{className:"modal-hint",children:E("remote.intro")}),c.jsx("div",{className:"vault-actions",children:n.enabled?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"link-button",onClick:()=>T(!1),children:E("remote.turnOff")}),c.jsx("span",{className:"modal-hint",children:E("remote.turnOffHint")})]}):c.jsx("button",{className:"primary-button",onClick:()=>T(!0),children:E("remote.turnOn")})}),c.jsxs("div",{className:"remote-port",children:[c.jsx("label",{className:"modal-hint",htmlFor:"remote-port-input",children:E("remote.port")}),c.jsx("input",{id:"remote-port-input",className:"remote-port-input",inputMode:"numeric",value:d,onChange:G=>h(G.target.value),onKeyDown:G=>{G.key==="Enter"&&F&&P!==null&&s(P)}}),c.jsx("button",{className:"link-button",onClick:()=>P!==null&&s(P),disabled:!F,children:E("remote.portSave")}),P===null&&c.jsx("span",{className:"modal-hint remote-port-invalid",children:lC()})]}),c.jsx("p",{className:"modal-hint",children:E("remote.restartHint")}),w!==null&&c.jsxs("div",{className:"vault-problem",role:"alert",children:[c.jsx("span",{children:w}),c.jsx("button",{className:"icon-button",onClick:k,title:E("common.close"),children:"×"})]}),c.jsx("h3",{className:"modal-section",children:E("remote.step.host")}),c.jsx("p",{className:"modal-hint",children:E("remote.step.hostHint")}),dC().map(G=>c.jsxs("details",{className:"remote-os",open:G.platform===fC(A),children:[c.jsx("summary",{className:"remote-os-summary",children:G.label}),c.jsx("p",{className:"modal-hint",children:G.hint}),G.command!==null&&c.jsxs("div",{className:"status-line-fragment",children:[c.jsx("pre",{className:"tool-pre",children:G.command}),c.jsx("button",{className:"link-button",onClick:()=>B("ssh",G.command??""),children:C==="ssh"?c.jsxs(c.Fragment,{children:["✓ ",E("remote.copied")]}):E("remote.copy")})]})]},G.platform)),c.jsx("h3",{className:"modal-section",children:E("remote.step.tunnel")}),c.jsx("p",{className:"modal-hint",children:E("remote.step.tunnelHint")}),n.hostNames.length>1&&c.jsxs("div",{className:"remote-port",children:[c.jsx("label",{className:"modal-hint",htmlFor:"remote-host-select",children:E("remote.address")}),c.jsx("select",{id:"remote-host-select",className:"remote-host-select",value:a,onChange:G=>f(G.target.value),children:n.hostNames.map(G=>c.jsx("option",{value:G,children:G},G))})]}),c.jsxs("div",{className:"status-line-fragment",children:[c.jsx("pre",{className:"tool-pre",children:H}),c.jsx("button",{className:"link-button",onClick:()=>B("command",H),children:C==="command"?c.jsxs(c.Fragment,{children:["✓ ",E("remote.copied")]}):E("remote.copy")})]}),c.jsxs("details",{className:"remote-os",children:[c.jsx("summary",{className:"remote-os-summary",children:E("remote.trouble")}),c.jsxs("ul",{className:"remote-trouble",children:[c.jsx("li",{className:"modal-hint",children:E("remote.trouble.network")}),c.jsx("li",{className:"modal-hint",children:E("remote.vpnHint")}),n.sshUser.length>0&&c.jsx("li",{className:"modal-hint",children:E("remote.userHint",{user:n.sshUser})})]})]}),c.jsx("h3",{className:"modal-section",children:E("remote.step.pair")}),r===null||X===null?c.jsxs("div",{className:"vault-actions",children:[c.jsx("button",{className:"primary-button",onClick:l,disabled:!ra(n),children:E("remote.pair.start")}),!ra(n)&&c.jsx("span",{className:"modal-hint",children:E("remote.pair.needsActive")})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"modal-hint",children:E("remote.pair.open")}),c.jsxs("div",{className:"status-line-fragment",children:[c.jsx("pre",{className:"tool-pre",children:X}),c.jsx("button",{className:"link-button",onClick:()=>B("pairing",X),children:C==="pairing"?c.jsxs(c.Fragment,{children:["✓ ",E("remote.copied")]}):E("remote.copy")})]}),c.jsxs("p",{className:"modal-hint",children:[E("remote.pair.expires",{time:Rf(Tf(r.expiresAt,M))})," ",E("remote.pair.after",{url:bm(n.port)})]}),c.jsx("div",{className:"vault-actions",children:c.jsx("button",{className:"link-button",onClick:p,children:E("remote.pair.cancel")})})]}),c.jsx("h3",{className:"modal-section",children:E("remote.phone.title")}),o===null?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"modal-hint",children:E("remote.phone.hint")}),c.jsxs("div",{className:"vault-actions",children:[c.jsx("button",{className:"primary-button",onClick:v,disabled:!ra(n),children:E("remote.phone.start")}),!ra(n)&&c.jsx("span",{className:"modal-hint",children:E("remote.pair.needsActive")})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"modal-hint",children:hC(o.shell)}),c.jsxs("div",{className:"status-line-fragment",children:[c.jsx("pre",{className:"tool-pre remote-phone-command",children:o.authorizeCommand}),c.jsx("button",{className:"link-button",onClick:()=>B("phone",o.authorizeCommand),children:C==="phone"?c.jsxs(c.Fragment,{children:["✓ ",E("remote.copied")]}):E("remote.copy")})]}),c.jsx("p",{className:"modal-hint",children:E("remote.phone.authorizeOnce")}),c.jsx("p",{className:"modal-hint",children:E("remote.phone.scan")}),c.jsx(EC,{payload:o.payload}),c.jsx("p",{className:"modal-hint",children:E("remote.phone.secret")}),c.jsx("p",{className:"modal-hint",children:E("remote.pair.expires",{time:Rf(Tf(o.expiresAt,M))})}),c.jsx("div",{className:"vault-actions",children:c.jsx("button",{className:"link-button",onClick:u,children:E("remote.pair.cancel")})})]}),c.jsx("h3",{className:"modal-section",children:E("remote.devices")}),n.devices.length===0?c.jsx("p",{className:"modal-hint",children:E("remote.devices.empty")}):c.jsx("ul",{className:"remote-devices",children:n.devices.map(G=>c.jsx(LC,{device:G,onRename:K=>y(G.id,K),onRevoke:()=>S(G.id)},G.id))})]})]})})}function EC({payload:n}){const r=SC(n),o=r.size+Ii*2;return c.jsxs("svg",{className:"remote-phone-qr",viewBox:`${-Ii} ${-Ii} ${o} ${o}`,role:"img","aria-label":E("remote.phone.qrLabel"),shapeRendering:"crispEdges",children:[c.jsx("rect",{x:-Ii,y:-Ii,width:o,height:o,fill:"#fff"}),c.jsx("path",{d:r.path,fill:"#000"})]})}function LC({device:n,onRename:r,onRevoke:o}){const[m,w]=O.useState(!1),[A,T]=O.useState(n.label),[s,l]=O.useState(!1),p=O.useRef(null);O.useEffect(()=>()=>{p.current!==null&&window.clearTimeout(p.current)},[]);const v=()=>{w(!1);const y=A.trim();y.length>0&&y!==n.label&&r(y)},u=()=>{if(s){o();return}l(!0),p.current=window.setTimeout(()=>l(!1),xC)};return c.jsxs("li",{className:"remote-device",children:[c.jsxs("div",{className:"remote-device-main",children:[m?c.jsx("input",{className:"remote-device-input",value:A,autoFocus:!0,onChange:y=>T(y.target.value),onBlur:v,onKeyDown:y=>{y.key==="Enter"&&v()}}):c.jsx("button",{className:"remote-device-label",onClick:()=>{T(n.label),w(!0)},title:E("remote.device.rename"),children:n.label}),c.jsx("span",{className:`remote-device-seen${n.connected?" remote-device-connected":""}`,children:cC(n)}),c.jsx("span",{className:"remote-device-paired",children:uC(n)})]}),c.jsx("button",{className:`link-button${s?" remote-device-confirm":""}`,onClick:u,children:E(s?"remote.device.revokeConfirm":"remote.device.revoke")})]})}const bc="agent-workbench.notes-open",Df="agent-workbench.notes-active",If="agent-workbench.notes-height",Sc=160,TC=300;function RC(n){return n.text.trim().length===0?n.images.length>0?E("notes.imageOnly"):E("notes.untitled"):Cv(n)}function MC({notes:n,onSendNote:r,sendTargetCwd:o,fill:m}){const[w,A]=O.useState(()=>yt(bc,!1,H=>H==="true")),T=w||m,[s,l]=O.useState(()=>yt(If,TC,H=>{const q=Number.parseInt(H,10);return Number.isFinite(q)?Math.max(q,Sc):null})),[p,v]=O.useState(()=>yt(Df,null,H=>H)),[u,y]=O.useState(null),[S,k]=O.useState(null),[g,a]=O.useState(0),f=eC(),d=O.useMemo(()=>n.notes.length===0?null:n.notes.find(H=>H.noteId===p)??n.notes[n.notes.length-1]??null,[n.notes,p]),h=O.useCallback(H=>{v(H),ut(Df,H),y(null)},[]),C=O.useCallback(()=>{A(H=>{const q=!H;return ut(bc,String(q)),q})},[]),D=O.useCallback(()=>{const H=n.create();h(H),T||(A(!0),ut(bc,"true")),a(q=>q+1)},[n,T,h]),x=O.useCallback(H=>{if(H.text.trim().length===0&&H.images.length===0){n.remove(H.noteId);return}h(H.noteId),y(H.noteId)},[n,h]),M=O.useCallback(()=>{u!==null&&n.remove(u),y(null)},[u,n]),b=O.useRef(null),L=O.useCallback(H=>{b.current={startY:H.clientY,startHeight:s},H.currentTarget.setPointerCapture(H.pointerId),H.preventDefault()},[s]),N=O.useCallback(H=>{const q=b.current;if(q===null)return;const X=Math.max(Sc,Math.floor(window.innerHeight*.8));l(Math.min(X,Math.max(Sc,q.startHeight+q.startY-H.clientY)))},[]),B=O.useCallback(H=>{b.current!==null&&(b.current=null,H.currentTarget.releasePointerCapture(H.pointerId),ut(If,String(s)))},[s]);O.useEffect(()=>{if(S===null)return;const H=q=>{q.key==="Escape"&&(q.stopPropagation(),k(null))};return window.addEventListener("keydown",H,!0),()=>window.removeEventListener("keydown",H,!0)},[S]);const P=S===null?void 0:n.images[S],F=n.notes.length;return c.jsxs("section",{className:`notes${T?" notes-open":""}${m?" notes-fill":""}`,style:T&&!m?{height:`${s}px`}:void 0,children:[T&&!m&&c.jsx("div",{className:"notes-resize",onPointerDown:L,onPointerMove:N,onPointerUp:B,onPointerCancel:B,title:E("notes.resize")}),T?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"notes-header",children:[c.jsxs("div",{className:"strip-tabs",role:"tablist",children:[n.notes.map(H=>{const q=H.noteId===(d==null?void 0:d.noteId),X=RC(H);return c.jsxs("div",{className:`strip-tab${q?" is-active":""}`,role:"tab","aria-selected":q,children:[c.jsx("button",{className:"strip-tab-label",onClick:()=>h(H.noteId),title:X,children:X}),c.jsx("button",{className:"strip-tab-close",onClick:()=>x(H),title:E("notes.closeNote"),children:"×"})]},H.noteId)}),c.jsx("button",{className:"strip-tab-new",onClick:D,title:E("notes.new"),children:"+"})]}),c.jsx("span",{className:"strip-spacer"}),c.jsx("button",{className:"icon-button thread-font-button",onClick:f.cycle,title:ua(f.size),"aria-label":ua(f.size),children:c.jsxs("span",{"aria-hidden":"true",children:["a",c.jsx("span",{className:"thread-font-big",children:"A"})]})}),!m&&c.jsx("button",{className:"icon-button",onClick:C,title:E("notes.collapse"),children:"▾"})]}),c.jsx("div",{className:"notes-body",children:F===0||d===null?c.jsx("p",{className:"notes-empty",children:Bt("notes.empty")}):c.jsx(DC,{note:d,notes:n,closing:u===d.noteId,focusRequest:g,onConfirmClose:M,onCancelClose:()=>y(null),onOpenImage:k,onSend:r===null?null:()=>r(d.noteId),sendTargetCwd:o},d.noteId)})]}):c.jsxs("button",{className:"strip-collapsed",onClick:C,title:E("notes.expand"),children:[c.jsx("span",{className:"strip-collapsed-arrow",children:"▸"}),c.jsx("span",{children:E("notes.name")}),F>0&&c.jsx("span",{className:"strip-collapsed-count",children:F})]}),S!==null&&c.jsx("div",{className:"notes-lightbox",onClick:()=>k(null),title:E("notes.lightboxClose"),children:typeof P=="string"?c.jsx("img",{src:P,alt:E("notes.imageAlt")}):c.jsx("span",{className:"notes-lightbox-missing",children:E("notes.imageUnavailable")})})]})}function AC(){return c.jsx("svg",{viewBox:"0 0 24 24",width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:c.jsx("path",{d:"M20 11.5 11.7 19.8a5 5 0 0 1-7.1-7.1l8.6-8.6a3.4 3.4 0 0 1 4.8 4.8l-8.5 8.5a1.8 1.8 0 0 1-2.5-2.5l7.9-7.9"})})}function NC(){return c.jsxs("svg",{viewBox:"0 0 24 24",width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("path",{d:"M21.5 2.5 11 13"}),c.jsx("path",{d:"M21.5 2.5 15 21.5l-4-8.5-8.5-4z"})]})}function DC({note:n,notes:r,closing:o,focusRequest:m,onConfirmClose:w,onCancelClose:A,onOpenImage:T,onSend:s,sendTargetCwd:l}){const p=O.useRef(null),[v,u]=O.useState(!1),y=n.text.trim().length===0&&n.images.length===0;O.useEffect(()=>{var g;m>0&&((g=p.current)==null||g.focus())},[m]);const S=O.useCallback(g=>{const a=Array.from(g).filter(f=>f.type.startsWith("image/"));for(const f of a)r.addImage(n.noteId,f);return a.length>0},[r,n.noteId]),k=O.useCallback(g=>{g.clipboardData!==null&&S(g.clipboardData.files)&&g.preventDefault()},[S]);return c.jsxs("div",{className:`note-editor${v?" note-editor-dragging":""}`,onDragOver:g=>{Array.from(g.dataTransfer.types).includes("Files")&&(g.preventDefault(),u(!0))},onDragLeave:()=>u(!1),onDrop:g=>{g.preventDefault(),u(!1),S(g.dataTransfer.files)},children:[o&&c.jsxs("div",{className:"note-closing",children:[c.jsx("span",{children:E("notes.closeConfirm")}),c.jsx("button",{className:"link-button link-danger",onClick:w,children:E("common.close")}),c.jsx("button",{className:"link-button",onClick:A,children:E("common.cancel")})]}),r.problem!==null&&c.jsxs("div",{className:"composer-problem",children:[c.jsx("span",{children:r.problem}),c.jsx("button",{className:"icon-button",onClick:r.dismissProblem,title:E("common.close"),children:"×"})]}),c.jsx("textarea",{ref:p,className:"note-input",value:n.text,placeholder:E("notes.placeholder"),onChange:g=>r.updateText(n.noteId,g.target.value),onPaste:k,spellCheck:!1}),n.images.length>0&&c.jsx("div",{className:"note-images",children:n.images.map(g=>c.jsx(IC,{image:g,src:r.images[g.imageId],onRequest:r.requestImage,onOpen:()=>T(g.imageId),onRemove:()=>r.removeImage(n.noteId,g.imageId)},g.imageId))}),c.jsxs("div",{className:"note-footer",children:[c.jsx("span",{className:"note-meta",children:jn(n.updatedAt)}),c.jsx("span",{className:"composer-spacer"}),c.jsx("button",{className:"icon-button",onClick:()=>s==null?void 0:s(),disabled:s===null||y,title:q0(s!==null,l,y),children:c.jsx(NC,{})}),c.jsxs("label",{className:"icon-button note-attach",title:E("notes.attach"),children:[c.jsx(AC,{}),c.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:g=>{g.target.files!==null&&S(g.target.files),g.target.value=""}})]})]})]})}function IC({image:n,src:r,onRequest:o,onOpen:m,onRemove:w}){return O.useEffect(()=>{r===void 0&&o(n.imageId)},[r,n.imageId,o]),c.jsxs("figure",{className:"chip chip-image note-thumb",title:rn(n.bytes),children:[typeof r=="string"?c.jsx("img",{src:r,alt:E("notes.imageAlt"),onClick:m}):c.jsx("span",{className:"note-thumb-placeholder",children:r===null?E("notes.thumbMissing"):"…"}),c.jsx("button",{className:"chip-remove",onClick:w,title:E("notes.removeImage"),children:"×"})]})}function Cm(){const n=zi(),r=n1(),[o,m]=O.useState(null),w=O.useCallback(()=>m(null),[]),A=O.useRef(null),T=p=>{Zw(p).catch(()=>{})},s=[{label:E("header.locale.auto",{name:sc[Qw()]}),checked:r==="auto",onSelect:()=>T("auto")},...Vc.map(p=>({label:sc[p],lang:p,checked:r===p,onSelect:()=>T(p)}))],l=sc[n];return c.jsxs(c.Fragment,{children:[c.jsx("button",{ref:A,className:"icon-button locale-button",onClick:p=>{const v=p.currentTarget.getBoundingClientRect();m(u=>u===null?{x:v.left,y:v.bottom+4}:null)},title:r==="auto"?E("header.locale.titleAuto",{name:l}):E("header.locale.title",{name:l}),"aria-haspopup":"menu","aria-expanded":o!==null,children:c0[n]}),o!==null&&c.jsx(Fc,{x:o.x,y:o.y,items:s,onClose:w,anchor:A.current})]})}function PC({onKey:n}){return c.jsx("div",{className:"narrow-keys",role:"toolbar","aria-label":E("narrow.keys.label"),children:nw.map(r=>c.jsx("button",{className:"narrow-key",onPointerDown:o=>o.preventDefault(),onClick:()=>n(r.data),title:E(r.titleKey),children:r.label},r.id))})}function jC({banners:n,status:r,statusLabel:o,terminals:m,activeTerminalId:w,activity:A,agents:T,offerAgentChoice:s,newTabAgent:l,canOpen:p,newTabBlockedTitle:v,onSelectTab:u,onCloseTab:y,onRenameTab:S,onNewTab:k,drawer:g,drawerOpen:a,onDrawerChange:f,menu:d,view:h,views:C,onViewChange:D,badges:x,chat:M,panel:b,notes:L,console:N,onTerminalKey:B}){const[P,F]=O.useState(null),H=m.find(j=>j.terminalId===w)??null,q=j=>{var W;return((W=T.find($=>$.id===j.agent))==null?void 0:W.statusLine)??null};O.useEffect(()=>{if(!a&&P===null)return;const j=W=>{W.key==="Escape"&&(W.preventDefault(),W.stopPropagation(),P!==null?F(null):f(!1))};return window.addEventListener("keydown",j,!0),()=>window.removeEventListener("keydown",j,!0)},[a,P,f]);const X=O.useRef({sheet:P,drawerOpen:a,view:h,onDrawerChange:f,onViewChange:D});X.current={sheet:P,drawerOpen:a,view:h,onDrawerChange:f,onViewChange:D},O.useEffect(()=>{const j=window;return j[zd]=()=>{const W=X.current;switch(aw({dialogOpen:document.querySelector(".modal-backdrop")!==null,sheetOpen:W.sheet!==null,drawerOpen:W.drawerOpen,view:W.view})){case"close-dialog":return window.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),!0;case"close-sheet":return F(null),!0;case"close-drawer":return W.onDrawerChange(!1),!0;case"show-chat":return W.onViewChange("chat"),!0;case null:return!1}},()=>{delete j[zd]}},[]);const G=O.useRef(null);O.useEffect(()=>{var j;(j=G.current)==null||j.scrollIntoView({block:"nearest",inline:"nearest"})},[h]);const K=j=>{const W=j==="git"?x.changes:j==="plans"?x.plans:j==="memory"?x.memory:0;return W>0?c.jsx("span",{className:"side-panel-badge",children:W}):j==="cli"&&x.cliUnseen&&h!=="cli"?c.jsx("span",{className:"narrow-view-dot",title:E("panel.cliUnseen")}):null};return c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"app-header narrow-header",children:[c.jsx("button",{className:"icon-button narrow-icon",onClick:()=>f(!0),title:E("narrow.projects"),"aria-label":E("narrow.projects"),children:"☰"}),c.jsxs("button",{className:"narrow-current",onClick:()=>F("tabs"),title:E("narrow.tabs.open"),children:[H===null?c.jsx("span",{className:"app-name",children:"Agent Workbench"}):c.jsxs(c.Fragment,{children:[c.jsx(Zc,{terminal:H,activity:A.get(H.terminalId),statusLine:q(H)}),c.jsx("span",{className:"project-swatch",style:{background:ts(H.cwd)}}),c.jsx("span",{className:"narrow-current-label",children:Hi(H)})]}),c.jsx("span",{className:"narrow-caret","aria-hidden":"true",children:"▾"})]}),r!=="open"&&c.jsx("span",{className:`status status-${r}`,children:o}),c.jsx("button",{className:"icon-button narrow-icon",onClick:()=>F("menu"),title:E("narrow.more"),"aria-label":E("narrow.more"),children:"⋮"})]}),n,c.jsxs("div",{className:"narrow-body",children:[c.jsx("nav",{className:"narrow-views",role:"tablist",children:C.map(j=>c.jsxs("button",{ref:j===h?G:null,role:"tab","aria-selected":j===h,className:`narrow-view-tab${j===h?" narrow-view-active":""}`,onClick:()=>D(j),children:[c.jsx("span",{children:E(Jy(j))}),K(j)]},j))}),c.jsxs("div",{className:"narrow-stack",children:[c.jsx("main",{className:`workspace narrow-pane${h==="chat"?"":" narrow-pane-veiled"}`,children:M}),b,c.jsx("div",{className:`narrow-pane${h==="notes"?"":" narrow-pane-hidden"}`,children:L}),c.jsx("div",{className:`narrow-pane${h==="console"?"":" narrow-pane-hidden"}`,children:N})]}),B!==null&&c.jsx(PC,{onKey:B})]}),a&&c.jsx("div",{className:"narrow-backdrop",onClick:()=>f(!1),children:c.jsx("div",{className:"narrow-drawer",onClick:j=>j.stopPropagation(),children:g})}),P==="tabs"&&c.jsx("div",{className:"narrow-backdrop",onClick:()=>F(null),children:c.jsxs("div",{className:"narrow-sheet",role:"dialog","aria-label":E("narrow.tabs.open"),onClick:j=>j.stopPropagation(),children:[c.jsx(OC,{terminals:m,activeTerminalId:w,activity:A,statusLineOf:q,onSelect:j=>{u(j),F(null)},onClose:y,onRename:S}),c.jsx(Yc,{className:"narrow-sheet-new",text:E("narrow.tabs.new"),title:v??E("narrow.tabs.new"),disabled:!p||v!==null,offerAgentChoice:s,agents:T,agent:l,onOpen:j=>{k(j),F(null)}})]})}),P==="menu"&&c.jsx("div",{className:"narrow-backdrop",onClick:()=>F(null),children:c.jsx("div",{className:"narrow-sheet",role:"dialog","aria-label":E("narrow.more"),onClick:j=>j.stopPropagation(),children:c.jsx(FC,{menu:d,status:r,statusLabel:o,onClose:()=>F(null)})})})]})}function OC({terminals:n,activeTerminalId:r,activity:o,statusLineOf:m,onSelect:w,onClose:A,onRename:T}){const[s,l]=O.useState(null),[p,v]=O.useState(""),u=O.useRef(null);O.useEffect(()=>{var S;s!==null&&((S=u.current)==null||S.select())},[s]);const y=()=>{s!==null&&T(s,p.trim()),l(null)};return n.length===0?c.jsx("p",{className:"narrow-sheet-empty",children:E("narrow.tabs.none")}):c.jsx("ul",{className:"narrow-tabs",children:n.map(S=>{const k=s===S.terminalId;return c.jsxs("li",{className:`narrow-tab-row${S.terminalId===r?" narrow-tab-active":""}`,style:{"--tab-project-color":ts(S.cwd)},children:[k?c.jsx("input",{ref:u,className:"narrow-tab-input",value:p,onChange:g=>v(g.target.value),onBlur:y,onKeyDown:g=>{g.key==="Enter"&&y(),g.key==="Escape"&&(g.stopPropagation(),l(null))}}):c.jsxs("button",{className:"narrow-tab-select",onClick:()=>w(S.terminalId),children:[c.jsx(Zc,{terminal:S,activity:o.get(S.terminalId),statusLine:m(S)}),c.jsx("span",{className:"narrow-tab-label",children:Hi(S)})]}),c.jsx("button",{className:"icon-button",onClick:()=>{l(S.terminalId),v(S.label.length>0?S.label:Hi(S))},title:E("narrow.tabs.rename"),children:"✎"}),c.jsx("button",{className:"icon-button",onClick:()=>A(S.terminalId),title:E("narrow.tabs.close"),children:"×"})]},S.terminalId)})})}function BC({choice:n}){const r=[{source:"system",label:E("narrow.menu.chimeSystem")},{source:"page",label:E("narrow.menu.chimePage")}];return c.jsx("div",{className:"narrow-chime-choice",role:"group","aria-label":E("narrow.menu.sound"),children:r.map(({source:o,label:m})=>c.jsx("button",{className:`narrow-chime-option${n.source===o?" is-on":""}`,"aria-pressed":n.source===o,onClick:()=>n.setSource(o),children:m},o))})}function FC({menu:n,status:r,statusLabel:o,onClose:m}){return c.jsxs("div",{className:"narrow-menu",children:[c.jsxs("div",{className:"narrow-menu-row",children:[c.jsx("span",{className:"narrow-menu-label",children:E("narrow.menu.connection")}),c.jsx("span",{className:`status status-${r}`,children:o}),Op(navigator.userAgent)&&c.jsxs(c.Fragment,{children:[c.jsx("a",{className:"link-button",href:ow,onClick:m,children:E("narrow.menu.phoneAppDisconnect")}),c.jsx("a",{className:"link-button",href:iw,onClick:m,children:E("narrow.menu.phoneAppSettings")})]})]}),n.cwd!==null&&c.jsxs("div",{className:"narrow-menu-row",children:[c.jsx("span",{className:"narrow-menu-label",children:E("narrow.menu.folder")}),c.jsx("span",{className:"narrow-menu-value",title:n.cwd,children:n.cwd})]}),n.cliVersion!==null&&c.jsxs("div",{className:"narrow-menu-row",children:[c.jsx("span",{className:"narrow-menu-label",children:E("narrow.menu.cli")}),c.jsx("span",{className:"narrow-menu-value",title:n.cliVersion,children:n.cliVersion})]}),n.remoteClient&&c.jsxs("div",{className:"narrow-menu-row",children:[c.jsx("span",{className:"narrow-menu-label",children:E("app.header.remoteBadge")}),c.jsx("span",{className:"narrow-menu-value narrow-menu-value-wrap",children:E("app.header.remoteBadgeTitle")})]}),c.jsxs("div",{className:"narrow-menu-row",children:[c.jsx("span",{className:"narrow-menu-label",children:E("narrow.menu.theme")}),c.jsx("button",{className:"icon-button",onClick:n.onCycleTheme,title:n.themeTitle,children:n.themeIcon})]}),c.jsxs("div",{className:"narrow-menu-row",children:[c.jsx("span",{className:"narrow-menu-label",children:E("narrow.menu.language")}),c.jsx(Cm,{})]}),c.jsxs("div",{className:"narrow-menu-row",children:[c.jsx("span",{className:"narrow-menu-label",children:E("narrow.menu.sound")}),n.sound.phoneChime===null?c.jsx(ym,{sound:n.sound}):c.jsx(BC,{choice:n.sound.phoneChime})]}),n.sound.notify.supported&&c.jsxs("div",{className:"narrow-menu-row",children:[c.jsx("span",{className:"narrow-menu-label",children:E("narrow.menu.notifications")}),c.jsx(wm,{notify:n.sound.notify})]}),n.remote!==null&&c.jsxs("div",{className:"narrow-menu-row",children:[c.jsx("span",{className:"narrow-menu-label",children:E("app.header.remoteAccess")}),c.jsx("button",{className:`icon-button${n.remote.active?" icon-button-on":""}`,onClick:()=>{var w;m(),(w=n.remote)==null||w.onOpen()},title:n.remote.title,children:"⇄"})]}),c.jsxs("div",{className:"narrow-menu-row",children:[c.jsx("span",{className:"narrow-menu-label",children:E("narrow.menu.shortcuts")}),c.jsx("button",{className:"icon-button",onClick:()=>{m(),n.onShortcuts()},title:E("app.header.shortcuts"),children:"?"})]})]})}function HC(){const n=window.location.search,r=new URLSearchParams(n).get(Ec),o=r!==null&&r.length>0?r:null,m=ew(n);return o===null&&m===null?{token:o,tab:m}:(window.history.replaceState(null,"",`${window.location.pathname}${tw(n,[Ec,Pp])}`),{token:o,tab:m})}const xm=HC(),Pf=xm.token,$C=xm.tab,Cc=new Set;function UC(n){const[r,o]=O.useState(null),[m,w]=O.useState(null),[A,T]=O.useState(Cc),[s,l]=O.useState(null);O.useEffect(()=>{const a=n.onMessage(d=>{switch(d.type){case"vault.status":o(d.status);break;case"vault.exported":T(h=>{if(!h.has(d.projectKey))return h;const C=new Set(h);return C.delete(d.projectKey),C}),l({projectKey:d.projectKey,sessions:d.sessions,at:Date.now()});break;case"error":if(d.code!=="vault-failed")break;w(kt(d.text)),d.detail!==void 0&&console.error("[servidor]",d.detail),T(Cc);break}}),f=n.onReopen(()=>T(Cc));return()=>{a(),f()}},[n]);const p=O.useCallback(()=>{w(null),n.send({type:"vault.measure"})},[n]),v=O.useCallback(a=>{w(null),n.send({type:"vault.enable",enabled:a})},[n]),u=O.useCallback(a=>{w(null),n.send({type:"vault.setDir",pickerId:a})},[n]),y=O.useCallback(a=>{w(null),T(f=>new Set(f).add(a)),n.send({type:"vault.exportProject",projectKey:a})},[n]),S=O.useCallback((a,f)=>{w(null),n.send({type:"vault.openSession",agent:a,sessionId:f})},[n]),k=O.useCallback(()=>{w(null),n.send({type:"vault.reveal"})},[n]),g=O.useCallback(()=>w(null),[]);return{status:r,problem:m,exporting:A,lastExported:s,measure:p,setEnabled:v,chooseDir:u,exportProject:y,openSession:S,reveal:k,dismissProblem:g}}function WC(n){return E("summary.outdatedServer",{server:n,page:Bs})}function zC(n){const[r,...o]=n;if(r===void 0||r.missingMessage===null)return null;const m=kt(r.missingMessage);return o.length===0?m:`${m}
|
|
139
|
-
${E("summary.alsoWorksWith",{names:o.map(w=>w.label).join(", ")})}`}function VC(n){const r=n.version??"?";return r.toLowerCase().includes(n.label.toLowerCase())?r:`${n.label} ${r}`}function qC(n,r,o=Bs){var T,s;if(r&&o<Bs)return{cliAvailable:!1,cliVersion:null,cliMissingMessage:WC(o),environmentNotice:null};if(r&&o>Bs)return{cliAvailable:!1,cliVersion:null,cliMissingMessage:E("summary.newerServer",{server:o,page:Bs}),environmentNotice:null};const m=n.filter(l=>l.available);let w=null;m.length===1?w=((T=m[0])==null?void 0:T.version)??null:m.length>1&&(w=m.map(VC).join(" · "));const A=r&&m.length===0;return{cliAvailable:!r||m.length>0,cliVersion:w,cliMissingMessage:A?zC(n):null,environmentNotice:((s=n.find(l=>l.environmentNotice!==null))==null?void 0:s.environmentNotice)??null}}const KC=500,GC=8e3;class YC{constructor(){Mt(this,"socket",null);Mt(this,"status","connecting");Mt(this,"attempt",0);Mt(this,"closedByUs",!1);Mt(this,"hasConnectedOnce",!1);Mt(this,"reconnectTimer");Mt(this,"messageHandlers",new Set);Mt(this,"statusHandlers",new Set);Mt(this,"reopenHandlers",new Set);Mt(this,"outbox",[])}getStatus(){return this.status}onMessage(r){return this.messageHandlers.add(r),()=>this.messageHandlers.delete(r)}onStatus(r){return this.statusHandlers.add(r),()=>this.statusHandlers.delete(r)}onReopen(r){return this.reopenHandlers.add(r),()=>this.reopenHandlers.delete(r)}connect(){if(this.socket!==null)return;const r=new URL(zv,window.location.href);r.protocol=window.location.protocol==="https:"?"wss:":"ws:",Pf!==null&&r.searchParams.set(Ec,Pf);const o=new WebSocket(r);this.socket=o,o.onopen=()=>{for(this.attempt=0,this.setStatus("open");this.outbox.length>0;){const m=this.outbox.shift();m!==void 0&&o.send(Td(m))}if(this.hasConnectedOnce)for(const m of this.reopenHandlers)m();this.hasConnectedOnce=!0},o.onmessage=m=>{const w=Xv(m.data);if(w===null){console.warn("[conexion] mensaje del servidor no reconocido");return}for(const A of this.messageHandlers)A(w)},o.onclose=m=>{if(this.socket=null,!this.closedByUs){if(m.code===jv){this.setStatus("revoked");return}this.setStatus("reconnecting"),this.scheduleReconnect()}},o.onerror=()=>{}}send(r){if(this.socket!==null&&this.socket.readyState===WebSocket.OPEN){this.socket.send(Td(r));return}r.type!=="input"&&r.type!=="resize"&&this.outbox.push(r)}close(){var r;this.closedByUs=!0,window.clearTimeout(this.reconnectTimer),(r=this.socket)==null||r.close(),this.socket=null}setStatus(r){if(this.status!==r){this.status=r;for(const o of this.statusHandlers)o(r)}}scheduleReconnect(){if(this.attempt+=1,!this.hasConnectedOnce&&this.attempt>4){this.setStatus("failed");return}const r=Math.min(KC*2**(this.attempt-1),GC);window.clearTimeout(this.reconnectTimer),this.reconnectTimer=window.setTimeout(()=>this.connect(),r)}}const XC={state:"idle",scannedFiles:0,totalFiles:0};function QC(n,r,o){const m=new Map(o?[]:n.map(w=>[w.key,w]));for(const w of r)m.set(w.key,w);return[...m.values()].sort((w,A)=>A.lastActivityAt-w.lastActivityAt)}function JC(){const n=O.useMemo(()=>new YC,[]),r=O.useMemo(()=>new $y({send:(Le,Ve)=>n.send({type:"composer.draft",terminalId:Le,draft:Ve}),connected:()=>n.getStatus()==="open",setTimer:(Le,Ve)=>window.setTimeout(Le,Ve),clearTimer:Le=>window.clearTimeout(Le),newId:()=>crypto.randomUUID()}),[n]),[o,m]=O.useState("connecting"),[w,A]=O.useState([]),[T,s]=O.useState(null),[l,p]=O.useState(!1),[v,u]=O.useState(Bs),[y,S]=O.useState(""),[k,g]=O.useState(""),[a,f]=O.useState(null),[d,h]=O.useState(!1),[C,D]=O.useState([]),[x,M]=O.useState([]),[b,L]=O.useState(XC),[N,B]=O.useState(null),[P,F]=O.useState(new Set),[H,q]=O.useState(new Map),[X,G]=O.useState(new Map),K=O.useRef(new Map),j=O.useRef(new Map),[W,$]=O.useState(new Set),[V,J]=O.useState(null),[re,ie]=O.useState([]),[he,Y]=O.useState(new Map),[U,Z]=O.useState([]),ee=O.useRef(1),pe=O.useRef(new Set),ne=O.useRef(new Map),Ee=O.useRef(new Map),xe=O.useCallback(Le=>{const Ve=Ee.current.get(Le);Ve!==void 0&&(clearTimeout(Ve),Ee.current.delete(Le)),ie(de=>de.some(fe=>fe.requestId===Le)?de.filter(fe=>fe.requestId!==Le):de)},[]),ce=O.useCallback(()=>{for(const Le of Ee.current.values())clearTimeout(Le);Ee.current.clear(),ie(Le=>Le.length===0?Le:[])},[]);O.useEffect(()=>{const Le=n.onStatus(fe=>{m(fe),fe==="failed"&&J({message:E("workspace.connectFailed"),at:Date.now()})}),Ve=n.onMessage(fe=>{switch(fe.type){case"agents":A(fe.agents),s(fe.defaultAgent);break;case"hello":A(fe.agents),s(fe.defaultAgent),p(!0),u(fe.protocolVersion),S(fe.platform),g(fe.defaultCwd),f(fe.shellName),h(fe.remoteClient);break;case"terminal.list":{D(fe.terminals),r.retain(fe.terminals.map(Ye=>Ye.terminalId));const Te=my(j.current,fe.terminals),ot=Te.finished.length>0||[...Te.phases].some(([Ye,lt])=>j.current.get(Ye)!==lt);j.current=Te.phases,ot&&$(new Set(Te.phases.keys())),F(Ye=>{if(Ye.size===0)return Ye;const lt=new Set(Ye);for(const Lt of Ye){if(Te.phases.has(Lt))continue;const At=fe.terminals.find(Kn=>Kn.terminalId===Lt);(At===void 0||At.alive)&<.delete(Lt)}return lt.size===Ye.size?Ye:lt}),G(Ye=>{if(Ye.size===0)return Ye;const lt=new Map([...Ye].filter(([Lt])=>fe.terminals.some(At=>At.terminalId===Lt)));return lt.size===Ye.size?Ye:(K.current=lt,lt)});const Pe=fe.terminals.filter(Ye=>Ye.kind==="agent");B(Ye=>{var lt;return Ye!==null&&Pe.some(Lt=>Lt.terminalId===Ye)?Ye:((lt=Pe[0])==null?void 0:lt.terminalId)??null}),Y(Ye=>{if(Ye.size===0)return Ye;const lt=new Map(Ye);for(const Lt of Ye.keys())fe.terminals.some(At=>At.terminalId===Lt)||lt.delete(Lt);return lt.size===Ye.size?Ye:lt});break}case"session.continued":Y(Te=>new Map(Te).set(fe.terminalId,{sourceAgent:fe.source.agent,includedTurns:fe.includedTurns,totalTurns:fe.totalTurns,totalTurnsIsMinimum:fe.totalTurnsIsMinimum,delivery:fe.delivery,prefillReason:null}));break;case"composer.prefill":{const Te=ee.current;ee.current+=1,Z(ot=>[...ot,{id:Te,terminalId:fe.terminalId,text:fe.text}]),Y(ot=>{const Pe=ot.get(fe.terminalId);return Pe===void 0?ot:new Map(ot).set(fe.terminalId,{...Pe,delivery:"prefilled",prefillReason:fe.reason})});break}case"composer.drafts":r.restore(fe.drafts);break;case"terminal.opened":{xe(fe.requestId),pe.current.delete(fe.requestId)&&fe.terminal.kind==="agent"&&B(fe.terminal.terminalId);const Te=ne.current.get(fe.requestId);Te!==void 0&&(ne.current.delete(fe.requestId),Te(fe.terminal));break}case"terminal.activity":q(Te=>Te.get(fe.terminalId)===fe.activity?Te:new Map(Te).set(fe.terminalId,fe.activity)),G(Te=>{const ot=fe.offlineReason??null;if((Te.get(fe.terminalId)??null)===ot)return Te;const Pe=new Map(Te);return ot===null?Pe.delete(fe.terminalId):Pe.set(fe.terminalId,ot),K.current=Pe,Pe});break;case"index.status":L(fe.status);break;case"index.projects":M(Te=>QC(Te,fe.projects,fe.replace));break;case"error":if(SS(fe.requestId)){fe.detail!==void 0&&console.error("[servidor]",fe.detail);break}if(fe.code==="vault-failed"||fe.code==="search-failed"||fe.code==="remote-failed")break;J({message:kt(fe.text),at:Date.now()}),F(Te=>Te.size===0?Te:new Set),j.current.size>0&&(j.current=new Map,$(new Set)),fe.detail!==void 0&&console.error("[servidor]",fe.detail),fe.requestId!==void 0&&(pe.current.delete(fe.requestId),ne.current.delete(fe.requestId),xe(fe.requestId));break}}),de=n.onReopen(()=>{ce(),F(fe=>fe.size===0?fe:new Set),j.current.size>0&&(j.current=new Map,$(new Set))});return n.connect(),()=>{Le(),Ve(),de(),n.close()}},[n,r,xe,ce]),O.useEffect(()=>{const Le=n.onReopen(()=>r.reconnected()),Ve=()=>r.flushAll(),de=()=>{document.visibilityState==="hidden"&&r.flushAll()};return window.addEventListener("pagehide",Ve),document.addEventListener("visibilitychange",de),()=>{Le(),window.removeEventListener("pagehide",Ve),document.removeEventListener("visibilitychange",de)}},[n,r]),O.useEffect(()=>ce,[ce]);const Se=O.useCallback(Le=>{const Ve=crypto.randomUUID();pe.current.add(Ve),Le.onOpened!==void 0&&ne.current.set(Ve,Le.onOpened),ie(fe=>[...fe,{requestId:Ve,cwd:Le.cwd,agent:Le.agent??null,label:Le.label??"",at:Date.now()}]);const de=setTimeout(()=>xe(Ve),_y);Ee.current.set(Ve,de),n.send({type:"terminal.open",requestId:Ve,cwd:Le.cwd,...Le.resumeSessionId!==void 0?{resumeSessionId:Le.resumeSessionId}:{},...Le.label!==void 0?{label:Le.label}:{},...Le.agent!==void 0?{agent:Le.agent}:{}})},[n,xe]),me=O.useCallback(Le=>{n.send({type:"terminal.open",requestId:crypto.randomUUID(),cwd:Le,kind:"shell"})},[n]),Ze=O.useCallback(Le=>n.send({type:"terminal.close",terminalId:Le}),[n]),qe=O.useCallback(Le=>{F(Ve=>new Set(Ve).add(Le)),K.current.get(Le)==="server-closed"&&(j.current=new Map(j.current).set(Le,"waiting-exit"),$(new Set(j.current.keys()))),n.send({type:"terminal.wake",terminalId:Le})},[n]),ve=O.useCallback((Le,Ve)=>n.send({type:"terminal.rename",terminalId:Le,label:Ve}),[n]),Re=O.useCallback(Le=>n.send({type:"tabs.reorder",terminalIds:Le}),[n]),Ie=O.useCallback((Le,Ve)=>n.send({type:"session.archive",sessionIds:Le,archived:Ve}),[n]),ke=O.useCallback((Le,Ve,de)=>{const fe=crypto.randomUUID();pe.current.add(fe),n.send({type:"session.continue",requestId:fe,agent:Le.agent,sessionId:Le.sessionId,target:Ve,label:de})},[n]),Fe=O.useCallback(Le=>{Y(Ve=>{if(!Ve.has(Le))return Ve;const de=new Map(Ve);return de.delete(Le),de})},[]),$e=O.useCallback(Le=>{Z(Ve=>Ve.some(de=>de.id===Le)?Ve.filter(de=>de.id!==Le):Ve)},[]),tt=O.useCallback(()=>n.send({type:"index.refresh"}),[n]),St=O.useCallback(()=>n.send({type:"agents.refresh"}),[n]),Ke=O.useCallback(()=>J(null),[]),gt=O.useMemo(()=>C.filter(Le=>Le.kind==="agent"),[C]),nt=O.useMemo(()=>C.filter(Le=>Le.kind==="shell"),[C]),ze=zi(),Ge=O.useMemo(()=>qC(w,l,v),[w,l,v,ze]),Et=O.useCallback(Le=>{var Ve;return(Le===null||(Ve=w.find(de=>de.id===Le))==null?void 0:Ve.capabilities)??Xf},[w]),Ct=O.useMemo(()=>Wc(w),[w]);return{connection:n,status:o,agents:w,defaultAgent:T,capabilitiesFor:Et,offerAgentChoice:Ct,cliAvailable:Ge.cliAvailable,cliVersion:Ge.cliVersion,cliMissingMessage:Ge.cliMissingMessage,platform:y,defaultCwd:k,environmentNotice:Ge.environmentNotice,shellName:a,remoteClient:d,terminals:gt,shells:nt,pendingOpens:re,activeTerminalId:N,projects:x,indexStatus:b,error:V,dismissError:Ke,setActiveTerminal:B,openTerminal:Se,openShell:me,closeTerminal:Ze,wakeTerminal:qe,waking:P,activity:H,offlineReasons:X,relaunching:W,renameTerminal:ve,reorderTabs:Re,refreshIndex:tt,refreshAgents:St,archiveSessions:Ie,continueSession:ke,handoffs:he,dismissHandoff:Fe,prefills:U,prefillApplied:$e,drafts:r}}function ZC({status:n,agents:r,indexReady:o,problem:m,covered:w,onMeasure:A,onSetEnabled:T,onChangeDir:s,onReveal:l,onDismissProblem:p,onClose:v}){return O.useEffect(()=>{if(w)return;const u=y=>{y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),v())};return window.addEventListener("keydown",u,!0),()=>window.removeEventListener("keydown",u,!0)},[w,v]),c.jsx("div",{className:"modal-backdrop",onClick:v,children:c.jsxs("div",{className:"modal vault-modal",role:"dialog","aria-label":Fi(),onClick:u=>u.stopPropagation(),children:[c.jsxs("header",{className:"modal-header",children:[c.jsx("span",{className:"modal-title",children:Fi()}),n!==null&&c.jsx("span",{className:`vault-state${n.enabled?" vault-state-on":""}`,children:gb(n)}),c.jsx("button",{className:"icon-button",onClick:v,title:E("common.closeEsc"),children:"×"})]}),c.jsxs("div",{className:"modal-body",children:[c.jsx("p",{className:"vault-lead",children:hb()}),c.jsx("p",{className:"modal-hint",children:db()}),n===null?c.jsx("p",{className:"modal-hint",children:E("vault.dialog.waiting")}):c.jsx(ex,{status:n,agents:r,indexReady:o,onMeasure:A,onSetEnabled:T,onChangeDir:s,onReveal:l}),m!==null&&c.jsxs("div",{className:"vault-problem",role:"alert",children:[c.jsx("span",{children:m}),c.jsx("button",{className:"icon-button",onClick:p,title:E("common.dismissNotice"),children:"×"})]})]})]})})}function ex({status:n,agents:r,indexReady:o,onMeasure:m,onSetEnabled:w,onChangeDir:A,onReveal:T}){const s=wb(n,o),l=bb(n),p=yb(n),v=n.measurement===null?null:xb(n.measurement,r),u=n.progress;return c.jsxs(c.Fragment,{children:[n.enabled&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"modal-section",children:E("vault.dialog.inFolder")}),c.jsxs("p",{className:"vault-summary",children:[hm(n.sessions)," · ",rn(n.bytes),n.lastPassAt!==null&&c.jsxs(c.Fragment,{children:[" · ",E("vault.dialog.lastPass",{when:jn(n.lastPassAt)})]}),n.pending>0&&c.jsxs(c.Fragment,{children:[" · ",E("vault.dialog.pendingCalm",{count:n.pending})]})]})]}),u!==null&&u.total>0&&c.jsx("progress",{className:"vault-progress",value:u.done,max:u.total}),c.jsx("h3",{className:"modal-section",children:E("vault.dialog.sizeSection")}),c.jsxs("div",{className:"vault-actions",children:[c.jsx("button",{className:"link-button vault-measure",onClick:m,disabled:s!==null,title:s??E("vault.dialog.measureTitle"),children:n.state==="measuring"?E("vault.state.measuring"):E(v===null?"vault.dialog.measure":"vault.dialog.measureAgain")}),v!==null&&c.jsx("span",{className:"modal-hint",children:v.summary})]}),v!==null&&c.jsx("div",{className:"vault-table-wrap",children:c.jsxs("table",{className:"vault-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"CLI"}),c.jsx("th",{children:E("vault.dialog.table.sessions")}),c.jsx("th",{children:E("vault.dialog.table.size")}),c.jsx("th",{children:E("vault.dialog.table.images")}),c.jsx("th",{title:E("vault.dialog.table.archivedTitle"),children:E("vault.dialog.table.archived")})]})}),c.jsxs("tbody",{children:[v.rows.map(y=>c.jsxs("tr",{children:[c.jsxs("td",{children:[y.label,y.note!==null&&c.jsx("span",{className:"vault-table-note",children:y.note})]}),c.jsx("td",{children:y.sessions}),c.jsx("td",{children:rn(y.bytes)}),c.jsx("td",{title:y.images>0?rn(y.imageBytes):void 0,children:y.images}),c.jsx("td",{children:y.skippedArchived})]},y.agent)),c.jsxs("tr",{children:[c.jsx("td",{children:E("vault.dialog.table.memory",{count:v.memoryProjects})}),c.jsx("td",{}),c.jsx("td",{children:rn(v.memoryBytes)}),c.jsx("td",{}),c.jsx("td",{})]})]}),c.jsx("tfoot",{children:c.jsxs("tr",{children:[c.jsx("td",{children:E("vault.dialog.table.total")}),c.jsx("td",{children:v.total.sessions}),c.jsx("td",{children:rn(v.total.bytes)}),c.jsx("td",{children:v.total.images}),c.jsx("td",{children:v.total.skippedArchived})]})})]})}),c.jsxs("div",{className:"vault-actions vault-switch",children:[p==="enabled"&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"link-button",onClick:()=>w(!1),children:E("vault.dialog.turnOff")}),c.jsx("span",{className:"modal-hint",children:E("vault.dialog.turnOffHint")})]}),(p==="measured"||p==="existing")&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"primary-button",onClick:()=>w(!0),title:E(p==="existing"?"vault.dialog.activateExistingTitle":"vault.dialog.activateMeasuredTitle"),children:E("vault.dialog.activate")}),c.jsx("span",{className:"modal-hint",children:E(p==="existing"?"vault.dialog.activateExistingHint":"vault.dialog.activateMeasuredHint")})]}),p==="needs-measure"&&c.jsx("span",{className:"modal-hint",children:E("vault.dialog.needsMeasure",{activate:E("vault.dialog.activate")})})]}),c.jsx("h3",{className:"modal-section",children:E("vault.dialog.folderSection")}),c.jsx("p",{className:"vault-dir",title:n.dir,children:n.dir}),n.isDefaultDir&&c.jsx("p",{className:"modal-hint",children:E("vault.dialog.defaultDir")}),c.jsxs("div",{className:"vault-actions",children:[c.jsx("button",{className:"link-button",onClick:A,disabled:l!==null,title:l??E("vault.dialog.changeDirTitle"),children:E("vault.dialog.changeDir")}),T!==null&&c.jsx("button",{className:"link-button",onClick:T,title:E("vault.dialog.openFolderTitle"),children:E("vault.dialog.openFolder")})]}),n.previousDir!==null&&c.jsx("p",{className:"modal-hint",children:Sb(n.previousDir)}),n.lastError!==null&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"modal-section",children:E("vault.dialog.lastError")}),c.jsx("p",{className:"vault-error",children:kt(n.lastError)})]})]})}const jf={connecting:"app.status.connecting",open:"app.status.open",reconnecting:"app.status.reconnecting",failed:"app.status.failed",revoked:"app.status.revoked"},Of=320,tx=1400,nx=640,Bf=200,Ff=560,rx=270,sx=120,ix=720,ox=260,Hf="agent-workbench.panel-width",$f="agent-workbench.panel-visible",Uf="agent-workbench.panel-tab",xc="agent-workbench.panel-expanded",Wf="agent-workbench.sidebar-visible",zf="agent-workbench.sidebar-width",Vf="agent-workbench.console-visible",qf="agent-workbench.console-height",Kf="agent-workbench.marker-notice-dismissed";function ax(){var so,ms,gs;const n=zi(),r=JC(),{connection:o,status:m,agents:w,defaultAgent:A,capabilitiesFor:T,offerAgentChoice:s,cliAvailable:l,cliVersion:p,cliMissingMessage:v,platform:u,defaultCwd:y,environmentNotice:S,shellName:k,terminals:g,archiveSessions:a,shells:f,pendingOpens:d,activeTerminalId:h,projects:C,indexStatus:D,error:x,dismissError:M,setActiveTerminal:b,openTerminal:L,openShell:N,closeTerminal:B,wakeTerminal:P,waking:F,activity:H,offlineReasons:q,relaunching:X,renameTerminal:G,reorderTabs:K,refreshIndex:j,refreshAgents:W,continueSession:$,handoffs:V,dismissHandoff:J,prefills:re,prefillApplied:ie,drafts:he,remoteClient:Y}=r,U=MS(),Z=O.useMemo(()=>({nameOf:ae=>GS(g.find(we=>we.terminalId===ae)),activate:b}),[g,b]),ee=JS(H,Z),pe=ZS(),ne=g.find(ae=>ae.terminalId===h)??null,Ee=O.useCallback(ae=>{ae!==h&&M(),b(ae)},[h,M,b]),xe=(ne==null?void 0:ne.agent)??null,ce=T(xe),Se=O.useMemo(()=>C0(ce),[ce]),me=w.find(ae=>ae.id===xe)??null,Ze=O.useMemo(()=>{if(ne===null||xe===null)return null;for(const ae of C){const we=ae.sessions.find(Je=>Je.agent===xe&&Je.sessionId===ne.sessionId);if(we!==void 0)return Pn(we.title,we.titleSource)}return null},[ne,xe,C,n]),qe=(me==null?void 0:me.statusLine)??null,ve=(ne==null?void 0:ne.cwd)??y,Re=O.useMemo(()=>s?G0(g,ve,u,w,A):null,[s,g,ve,u,w,A]),Ie=O.useMemo(()=>Od(d,ve,u),[d,ve,u]),ke=Ie?kp():null,Fe=ES(o),$e=UC(o),[tt,St]=O.useState(!1),Ke=rC(o),[gt,nt]=O.useState(!1),ze=hw(),[Ge,Et]=O.useState(!1),Ct=O.useCallback(()=>Et(!1),[]),[Le,Ve]=O.useState(()=>yt(Ud,"chat",Gy)),de=O.useMemo(()=>Yy({hasTab:ne!==null,plansAvailable:Se.plansAvailable}),[ne,Se.plansAvailable]),fe=Xy(Le,de),Te=O.useCallback(ae=>{Ve(ae),ut(Ud,ae)},[]),ot=O.useRef($C);O.useEffect(()=>{if(ot.current!==null)return o.onMessage(ae=>{if(ae.type!=="terminal.list"||ot.current===null)return;const we=ot.current;ot.current=null,ae.terminals.some(Je=>Je.terminalId===we&&Je.kind==="agent")&&b(we)})},[o,b]);const Pe=yS(o),Ye=D1(w,$e.status),[lt,Lt]=O.useState(null),At=O.useRef(0),Kn=O.useCallback(ae=>{Lt(we=>we!==null&&we.seq===ae?null:we)},[]),ns=(ae,we)=>{const Je=K1(ae,{projects:C,terminals:g,platform:u,canResume:oi=>Dd(w,oi)}),Ur=()=>{we.length!==0&&(At.current+=1,Lt({query:we,seq:At.current}))};switch(Je.kind){case"activate":Ee(Je.terminalId),Ur();break;case"resume":Je.session.archived&&a([Je.session.sessionId],!1),L({cwd:Je.cwd,resumeSessionId:Je.session.sessionId,agent:Je.session.agent,label:Pn(Je.session.title,Je.session.titleSource)}),Ur();break;case"copy":$e.openSession(ae.agent,ae.sessionId);break}},Tn=O.useMemo(()=>new Set(g.map(ae=>ae.sessionId).filter(ae=>ae.length>0)),[g]),[Bn,kr]=O.useState(()=>yt($f,!0,ae=>ae==="true")),[qs,Er]=O.useState(()=>yt(Uf,"cli",ae=>ae==="git"||ae==="files"||ae==="cli"||ae==="plans"||ae==="memory"?ae:ae==="conversation"?"cli":null)),[qi,Lr]=O.useState(()=>yt(Hf,nx,ae=>{const we=Number.parseInt(ae,10);return Number.isFinite(we)?Math.max(we,Of):null})),[Tr,Rr]=O.useState(()=>yt(xc,!1,ae=>ae==="true")),[Mr,ga]=O.useState(()=>yt(Wf,!0,ae=>ae==="true")),[Ki,_a]=O.useState(()=>yt(zf,rx,ae=>{const we=Number.parseInt(ae,10);return Number.isFinite(we)?Math.min(Ff,Math.max(Bf,we)):null})),[un,Gi]=O.useState(()=>yt(Vf,!1,ae=>ae==="true")),[Ks,va]=O.useState(()=>yt(qf,ox,ae=>{const we=Number.parseInt(ae,10);return Number.isFinite(we)?we:null})),[Yi,Xi]=O.useState(()=>yt(Kf,!0,ae=>ae!=="true")),[Qi,rs]=O.useState(!1),[ya,Gs]=O.useState(!1);O.useEffect(()=>{qe===null&&Gs(!1)},[qe]);const[ht,Gn]=O.useState(null),Yn=Bn&&ne!==null,Ar=P0(qs,Se.plansAvailable),vn=ne!==null?Bn||un:Bn,Ys=Tr&&ne!==null,sn=O.useMemo(()=>ne===null?[]:f.filter(ae=>ae.cwd===ne.cwd),[f,ne]),[ss,on]=O.useState(null),Xn=sn.find(ae=>ae.terminalId===ss)??sn[0]??null,Ft=fe==="cli"?h:fe==="console"?(Xn==null?void 0:Xn.terminalId)??null:null,wa=O.useCallback(ae=>{Ft!==null&&o.send({type:"input",terminalId:Ft,data:ae})},[o,Ft]),Kt=_1(o,h),Ji=ze?ne!==null:Yn,is=ze?fe==="files":Yn&&Ar==="files",Nr=bS(o,Ji?h:null),Dr=vS(o,is?h:null),Ir=wS(o,h),Xs=kS(o,Ji?h:null),ba=ze?fe==="cli":Yn&&Ar==="cli",os=Kt.usage.lastModel,Qs=Kt.usage.lastEffort??((so=[...Kt.events].reverse().find(ae=>ae.effort!==null))==null?void 0:so.effort)??null,as=os??Kt.defaults.model,Qn=Qs??Kt.defaults.effort,Sa=os===null&&as!==null,Js=Qs===null&&Qn!==null,st=gS(o,h,ba),Zs=h===null?null:H.get(h)??null,ei=uy(ce,Kt.openToolCall,(me==null?void 0:me.label)??null,(ne==null?void 0:ne.alive)??!1,Zs),Pr=hy({offlineReason:h===null?null:q.get(h)??null,alive:(ne==null?void 0:ne.alive)??!1,relaunching:h!==null&&X.has(h)}),ls=Pr===null?null:dy((me==null?void 0:me.label)??null),Zi=ls??ei??gy(ce,Kt.waitingFor,(ne==null?void 0:ne.alive)??!1),eo=!Yf(ce,Zs),ti=O.useMemo(()=>Cp(w,xe),[w,xe]),jr=ne!==null&&ay(xe,ne.sessionId,ce),Pt=h===null?null:V.get(h)??null,Rn=Pt===null?null:{text:ny(Wi(Pt.sourceAgent,w),Pt.includedTurns,Pt.totalTurns,Pt.totalTurnsIsMinimum),status:Pt.prefillReason!==null?sy(Pt.prefillReason):Pt.delivery==="sending"&&Kt.events.length===0?ry():null},Xt=O.useCallback(()=>{kr(ae=>{const we=!ae;return ut($f,String(we)),we})},[]),Jn=O.useCallback(()=>{ga(ae=>{const we=!ae;return ut(Wf,String(we)),we})},[]),Zn=O.useCallback(()=>{Gi(ae=>{const we=!ae;return ut(Vf,String(we)),we})},[]),yn=O.useCallback(ae=>{Er(ae),ut(Uf,ae)},[]),Ca=O.useCallback(()=>{Rr(ae=>{const we=!ae;return ut(xc,String(we)),we})},[]),to=O.useCallback(()=>{h!==null&&o.send({type:"input",terminalId:h,data:"\x1B\x1B"})},[o,h]),Or=O.useCallback(ae=>{h!==null&&o.send({type:"input",terminalId:h,data:`${ae} `})},[o,h]),cs=O.useRef(null),no=O.useCallback(ae=>{var we;return(we=cs.current)==null?void 0:we.call(cs,ae,!ze)},[ze]),us=O.useCallback(ae=>{h!==null&&o.send({type:"agent.submit",terminalId:h,text:ae,images:[]})},[o,h]),ro=O.useCallback(ae=>{h!==null&&o.send({type:"files.reveal",terminalId:h,path:ae})},[o,h]),er=O.useRef(new Set);O.useEffect(()=>{if(!un){er.current.clear();return}if(ne===null)return;const{cwd:ae}=ne;if(f.some(we=>we.cwd===ae)){er.current.delete(ae);return}er.current.has(ae)||(er.current.add(ae),N(ae))},[un,ne,f,N]);const Br=O.useCallback(ae=>{const we=sn.find(Je=>Je.terminalId===ae);we!==void 0&&er.current.delete(we.cwd),B(ae)},[sn,B]),tr=O.useRef(new Set);O.useEffect(()=>{const ae=sn.filter(Je=>!tr.current.has(Je.terminalId));for(const Je of sn)tr.current.add(Je.terminalId);const we=ae[ae.length-1];we!==void 0&&on(we.terminalId)},[sn]);const nr=O.useCallback(()=>{ne!==null&&(er.current.add(ne.cwd),N(ne.cwd))},[ne,N]),hs=oa({min:Of,max:tx,value:qi,measure:O.useCallback(ae=>window.innerWidth-ae.clientX,[]),onChange:Lr,onCommit:O.useCallback(ae=>ut(Hf,String(ae)),[]),onStart:O.useCallback(()=>{Rr(!1),ut(xc,"false")},[])}),xa=oa({min:Bf,max:Ff,value:Ki,measure:O.useCallback(ae=>ae.clientX,[]),onChange:_a,onCommit:O.useCallback(ae=>ut(zf,String(ae)),[])}),ka=oa({min:sx,max:ix,value:Ks,measure:O.useCallback(ae=>window.innerHeight-ae.clientY,[]),onChange:va,onCommit:O.useCallback(ae=>ut(qf,String(ae)),[])}),ni=O.useCallback(()=>{Xi(!1),ut(Kf,"true")},[]),rr=O.useCallback(ae=>{if(g.length===0)return;const Je=(g.findIndex(oi=>oi.terminalId===h)+ae+g.length)%g.length,Ur=g[Je];Ur!==void 0&&Ee(Ur.terminalId)},[g,h,Ee]),ds=O.useRef(null),fs=O.useRef(null);O.useEffect(()=>{h!==fs.current&&(ds.current=fs.current,fs.current=h)},[h]);const wn=O.useCallback(()=>{const ae=ds.current;ae===null||ae===h||g.some(we=>we.terminalId===ae)&&Ee(ae)},[h,g,Ee]);O.useEffect(()=>{const ae=we=>{if(we.key!=="Tab"||!we.shiftKey||we.altKey||we.ctrlKey||we.metaKey)return;const Je=document.activeElement;Je instanceof Element&&Je.closest(".xterm")!==null||(we.preventDefault(),we.stopPropagation(),wn())};return window.addEventListener("keydown",ae,!0),()=>window.removeEventListener("keydown",ae,!0)},[wn]),O.useEffect(()=>{const ae=we=>{if(!we.altKey||we.ctrlKey||we.metaKey)return;const Je=we.key.toLowerCase();if(Je==="t"){l&&y.length>0&&!Ie&&(we.preventDefault(),we.stopPropagation(),L({cwd:(ne==null?void 0:ne.cwd)??y}));return}if(Je==="w"){h!==null&&(we.preventDefault(),we.stopPropagation(),B(h));return}if(Je==="p"){we.preventDefault(),we.stopPropagation(),Xt();return}if(Je==="arrowright"||Je==="pagedown"){we.preventDefault(),we.stopPropagation(),rr(1);return}(Je==="arrowleft"||Je==="pageup")&&(we.preventDefault(),we.stopPropagation(),rr(-1))};return window.addEventListener("keydown",ae,!0),()=>window.removeEventListener("keydown",ae,!0)},[ne,h,l,B,rr,y,Ie,L,Xt]);const ri=ne===null?E("app.panel.name"):ne.label.length>0?ne.label:ne.cwd.split(/[\\/]/).filter(ae=>ae.length>0).pop()??ne.cwd,Fr=c.jsx(Nb,{projects:C,indexStatus:D,disabled:!l,onOpenProject:(ae,we)=>{Ct(),L({cwd:ae,...we!==void 0?{agent:we}:{}})},agents:w,offerAgentChoice:s,agentForProject:ae=>Y0(g,ae,u,w,A),onOpenSession:(ae,we)=>{Ct(),L({cwd:ae,resumeSessionId:we.sessionId,agent:we.agent,label:Pn(we.title,we.titleSource)})},canResume:ae=>Dd(w,ae),platform:u,onRefresh:j,openSessionIds:Tn,openBlocked:ae=>Od(d,ae,u),onArchive:a,onHide:ze?Ct:Jn,width:Ki,onNewProject:()=>{Ct(),Gn("project")},vault:$e.status,onOpenVault:()=>{Ct(),St(!0)},onOpenVaultSession:Y?null:ae=>$e.openSession(ae.agent,ae.sessionId),onExportProject:Y?null:$e.exportProject,exporting:$e.exporting,lastExported:$e.lastExported,onContinueSession:(ae,we)=>{Ct(),$({agent:ae.agent,sessionId:ae.sessionId},we,Pd(Pn(ae.title,ae.titleSource)))},globalSearch:Ye?{...Pe,vaultEnabled:((ms=$e.status)==null?void 0:ms.enabled)===!0}:null,onOpenSearchHit:(ae,we)=>{Ct(),ns(ae,we)}}),si=c.jsx("div",{className:"chat-stack",children:g.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx("p",{children:E("app.empty.noTabs")}),c.jsx("p",{className:"empty-hint",children:E("app.empty.hint")}),l&&y.length>0&&c.jsx("button",{className:"primary-button",onClick:()=>L({cwd:y}),disabled:Ie,title:ke??void 0,children:Ie?E("app.empty.opening"):E("app.empty.newSession",{cwd:y})})]}):c.jsx(b1,{view:Kt,terminalId:h,threadFont:pe,onRewind:Se.rewind&&(ne==null?void 0:ne.alive)===!0?to:void 0,questionsAnswerable:Se.questionsAnswerable,contextWindowSource:Se.contextWindowSource,instructionsFile:S0(xe),onGoToCli:()=>{if(ze){Te("cli");return}Yn||Xt(),yn("cli")},cliPresence:ne===null||ne.alive?"live":ne.sleeping?"sleeping":"exited",exitCode:(ne==null?void 0:ne.exitCode)??null,waking:h!==null&&F.has(h),onWakeCli:()=>{h!==null&&P(h)},discovering:jr,continueTargets:ti,continueBlockedReason:ty((ne==null?void 0:ne.sessionId)??"",jr,Kt.events.length>0),onContinue:ne===null||xe===null?void 0:ae=>$({agent:xe,sessionId:ne.sessionId},ae,Pd(Ze??ne.label)),searchRequest:lt,onSearchRequestApplied:Kn,toolCallNotice:ei,serverClosed:Pr===null||ls===null?null:{state:Pr,text:ls},statusLineState:(qe==null?void 0:qe.state)??null,onConfigureStatusLine:qe===null?void 0:()=>Gs(!0)})}),Hr=c.jsx(c.Fragment,{children:ne!==null&&c.jsx(ww,{connection:o,drafts:he,terminalId:h,alive:ne.alive,sleeping:ne.sleeping,projectColor:ts(ne.cwd),activity:H.get(ne.terminalId),imagesAllowed:Se.imagesAllowed,blockedReason:Zi,prefills:re,onPrefillApplied:ie,notice:Rn,onDismissNotice:h===null?void 0:()=>J(h),onSubmitted:J,fontSize:pe.size,insertRef:cs,leading:Se.modeCycle===null?void 0:c.jsx(xy,{mode:Kt.permissionMode,cycle:Se.modeCycle,disabled:!ne.alive,waitingFor:Kt.waitingFor,statusKnown:eo,onChange:Kt.setPermissionMode}),controls:Se.models===null&&Se.efforts===null?void 0:c.jsx(Cy,{models:Se.models,efforts:Se.efforts,model:as,effort:Qn,modelProvisional:Sa,effortProvisional:Js,savesChoice:b0(xe),disabled:!ne.alive,onCommand:us})})}),$r=ne===null?null:c.jsx(dS,{tab:ze?Wd(fe)??Ar:Ar,plansAvailable:Se.plansAvailable,hidden:ze?Wd(fe)===null:!Bn,onTabChange:ze?Te:yn,title:ri,cwd:ne.cwd,platform:u,cli:c.jsx("div",{className:"terminal-stack",children:g.map(ae=>c.jsx(Vp,{terminalId:ae.terminalId,connection:o,active:ae.terminalId===h,theme:U.resolved,autoFocus:!1},ae.terminalId))}),cliUnseen:st,expanded:Tr,onToggleExpanded:Ca,git:Nr,files:Dr,plans:Ir,memory:Xs,onInsert:Se.fileMentions&&ne.alive?Or:void 0,onInsertPath:no,onReveal:Y?null:ro,onHide:Xt}),ii=ne===null?null:c.jsx($w,{connection:o,shells:sn,activeShellId:(Xn==null?void 0:Xn.terminalId)??null,cwd:ne.cwd,shellName:k,theme:U.resolved,onSelect:on,onOpen:nr,onCloseShell:Br,onCollapse:ze?()=>Te("chat"):Zn}),Ht=c.jsx(MC,{notes:Fe,fill:ze||ne===null,onSendNote:ne===null||!Se.noteSendable?null:ae=>{const we=ne.cwd;L({cwd:we,...ne.agent!==null?{agent:ne.agent}:{},onOpened:Je=>{o.send({type:"notes.send",noteId:ae,terminalId:Je.terminalId}),ze&&Te("chat")}})},sendTargetCwd:(ne==null?void 0:ne.cwd)??null}),sr=ne===null?null:c.jsx(c.Fragment,{children:un?c.jsxs(c.Fragment,{children:[Bn&&c.jsx("div",{className:"hdivider",...ka,title:E("app.divider.consoleHeight")}),c.jsx("div",{className:"console-slot",style:Bn?{height:`${Ks}px`}:{flex:"1 1 auto"},children:ii})]}):c.jsxs("button",{className:"strip-collapsed",onClick:Zn,title:k===null?E("console.openAnyIn",{cwd:ne.cwd}):E("console.openIn",{shell:k,cwd:ne.cwd}),children:[c.jsx("span",{className:"strip-collapsed-arrow",children:"▸"}),c.jsx("span",{children:k??E("console.name")}),sn.length>0&&c.jsx("span",{className:"strip-collapsed-count",children:sn.length})]})}),ps=c.jsxs(c.Fragment,{children:[m==="revoked"&&c.jsx("div",{className:"banner banner-error",children:E("app.banner.revoked")}),!l&&v!==null&&c.jsx("div",{className:"banner banner-error banner-lines",children:v}),S==="child-session-marker"&&Yi&&c.jsxs("div",{className:"banner banner-notice",children:[c.jsx("span",{children:Bt("app.markerNotice",{variable:"CLAUDE_CODE_CHILD_SESSION"})}),c.jsx("button",{className:"banner-close",onClick:ni,title:E("common.gotIt"),children:"×"})]}),x!==null&&c.jsxs("div",{className:"banner banner-error",children:[c.jsx("span",{children:x.message}),c.jsx("button",{className:"banner-close",onClick:M,title:E("common.close"),children:"×"})]}),$e.problem!==null&&!tt&&c.jsxs("div",{className:"banner banner-error",children:[c.jsx("span",{children:$e.problem}),c.jsx("button",{className:"banner-close",onClick:$e.dismissProblem,title:E("common.close"),children:"×"})]}),c.jsx(rb,{})]}),ir=c.jsxs(c.Fragment,{children:[ya&&qe!==null&&me!==null&&c.jsx(nb,{info:qe,agentLabel:me.label,onRefresh:W,onClose:()=>Gs(!1)}),Qi&&c.jsx(Z1,{agent:j0(xe,w,A),onClose:()=>rs(!1)}),ht==="project"&&c.jsx(hf,{connection:o,title:E("app.picker.project.title"),confirmLabel:E("app.picker.project.confirm"),confirmTitle:ae=>E("app.picker.project.confirmTitle",{path:ae}),onChoose:(ae,we)=>{Gn(null),L({cwd:we})},onClose:()=>Gn(null)}),tt&&c.jsx(ZC,{status:$e.status,agents:w,indexReady:D.state==="ready",problem:$e.problem,covered:ht==="vault",onMeasure:$e.measure,onSetEnabled:$e.setEnabled,onChangeDir:()=>Gn("vault"),onReveal:Y?null:$e.reveal,onDismissProblem:$e.dismissProblem,onClose:()=>St(!1)}),gt&&Ke.status!==null&&!Y&&c.jsx(kC,{status:Ke.status,pairing:Ke.pairing,phonePairing:Ke.phonePairing,phoneStarted:Ke.phoneStarted,problem:Ke.problem,platform:u,onSetEnabled:Ke.setEnabled,onSetPort:Ke.setPort,onStartPairing:Ke.startPairing,onCancelPairing:Ke.cancelPairing,onStartPhonePairing:Ke.startPhonePairing,onCancelPhonePairing:Ke.cancelPhonePairing,onRenameDevice:Ke.renameDevice,onRevokeDevice:Ke.revokeDevice,onDismissProblem:Ke.dismissProblem,onClose:()=>nt(!1)}),ht==="vault"&&c.jsx(hf,{connection:o,title:E("app.picker.vault.title"),confirmLabel:E("app.picker.vault.confirm"),confirmTitle:ae=>E("app.picker.vault.confirmTitle",{path:ae}),onChoose:ae=>{$e.chooseDir(ae),Gn(null)},onClose:()=>Gn(null)})]});return ze?c.jsxs("div",{className:"app app-narrow",children:[c.jsx(jC,{banners:ps,status:m,statusLabel:E(jf[m]),terminals:g,activeTerminalId:h,activity:H,agents:w,offerAgentChoice:s,newTabAgent:Re,canOpen:l&&y.length>0,newTabBlockedTitle:ke,onSelectTab:Ee,onCloseTab:B,onRenameTab:G,onNewTab:ae=>L({cwd:ve,...ae!==void 0?{agent:ae}:{}}),drawer:Fr,drawerOpen:Ge,onDrawerChange:Et,menu:{cwd:(ne==null?void 0:ne.cwd)??null,cliVersion:p,themeIcon:Cf[U.preference],themeTitle:Sf(U.preference),onCycleTheme:U.cycle,sound:ee,remote:Ke.status!==null&&!Y?{title:`${E("app.header.remoteAccess")} — ${$c(Ke.status.state,Ke.status.port)}`,active:Mf(Ke.status),onOpen:()=>nt(!0)}:null,remoteClient:Y,onShortcuts:()=>rs(!0)},view:fe,views:de,onViewChange:Te,badges:{changes:pm(Nr.status),plans:Ir.plans.length,memory:((gs=Xs.status)==null?void 0:gs.installed)===!0?Xs.status.notes.length:0,cliUnseen:st},chat:c.jsxs(c.Fragment,{children:[si,Hr]}),panel:$r,notes:Ht,console:ii,onTerminalKey:Ft===null?null:wa}),ir]}):c.jsxs("div",{className:"app",children:[c.jsxs("header",{className:"app-header",children:[c.jsx("span",{className:"app-name",children:"Agent Workbench"}),c.jsx("span",{className:`status status-${m}`,children:E(jf[m])}),ne!==null&&c.jsx("span",{className:"meta",title:ne.cwd,children:ne.cwd}),c.jsx("span",{className:"header-spacer"}),p!==null&&c.jsx("span",{className:"meta meta-dim",children:E("app.header.cliVersion",{version:p})}),c.jsx("button",{className:"icon-button",onClick:U.cycle,title:Sf(U.preference),children:Cf[U.preference]}),c.jsx(Cm,{}),c.jsx(ym,{sound:ee}),c.jsx(wm,{notify:ee.notify}),Ke.status!==null&&!Y&&c.jsx("button",{className:`icon-button${Mf(Ke.status)?" icon-button-on":""}`,onClick:()=>nt(!0),title:`${E("app.header.remoteAccess")} — ${$c(Ke.status.state,Ke.status.port)}`,children:"⇄"}),Y&&c.jsx("span",{className:"remote-badge",title:E("app.header.remoteBadgeTitle"),children:E("app.header.remoteBadge")}),c.jsx("button",{className:"icon-button",onClick:()=>rs(!0),title:E("app.header.shortcuts"),children:"?"})]}),ps,c.jsxs("div",{className:"app-body",children:[!Mr&&c.jsxs("button",{className:"panel-peek panel-peek-left",onClick:Jn,title:E("app.sidebar.show"),children:[c.jsx("span",{className:"panel-peek-arrow",children:"»"}),c.jsx("span",{className:"panel-peek-label",children:E("app.sidebar.name")})]}),Mr&&Fr,Mr&&c.jsx("div",{className:"divider",...xa,title:E("app.divider.width")}),c.jsxs("main",{className:`workspace${Ys&&vn?" workspace-narrow":""}`,children:[c.jsx(mS,{terminals:g,activeTerminalId:h,activity:H,canOpen:l&&y.length>0,onSelect:Ee,onClose:B,onRename:G,onReorder:K,onNew:ae=>L({cwd:ve,...ae!==void 0?{agent:ae}:{}}),agents:w,offerAgentChoice:s,newTabAgent:Re,pendingOpens:d,platform:u,newTabBlockedTitle:ke}),si,Hr]}),c.jsxs(c.Fragment,{children:[!vn&&c.jsxs("button",{className:"panel-peek",onClick:Xt,title:E("app.panel.show"),children:[c.jsx("span",{className:"panel-peek-arrow",children:"«"}),c.jsx("span",{className:"panel-peek-label",children:E("app.panel.name")})]}),vn&&c.jsx("div",{className:"divider",...hs,title:E("app.divider.width")}),c.jsxs("div",{className:`panel-slot${vn?"":" panel-slot-collapsed"}${vn&&Ys?" panel-slot-expanded":""}`,style:vn&&!Ys?{width:`${qi}px`}:void 0,children:[ne!==null&&c.jsxs(c.Fragment,{children:[$r,sr]}),Ht]})]})]}),ir]})}const km=document.getElementById("root");if(km===null)throw new Error("Falta el contenedor #root.");const lx=o_.createRoot(km);Jw().then(()=>lx.render(c.jsx(ax,{})));export{Jg as g};
|