claude-code-session-manager 0.1.0 → 0.2.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/dist/assets/{cssMode-CnHaSLkc.js → cssMode-DbVwjtsF.js} +1 -1
- package/dist/assets/{editor.main-HqS8FFud.js → editor.main-BnrhL2Ub.js} +3 -3
- package/dist/assets/{freemarker2-Dk6tNdYu.js → freemarker2-BSEwnssm.js} +1 -1
- package/dist/assets/{handlebars-CAvgYvfp.js → handlebars-2A6Ao-MM.js} +1 -1
- package/dist/assets/{html-BA1RF9wZ.js → html-D5SHl8IM.js} +1 -1
- package/dist/assets/{htmlMode-DFW80Ka7.js → htmlMode-BsfbJLaF.js} +1 -1
- package/dist/assets/index-BH5PBjYe.css +32 -0
- package/dist/assets/index-BQcSEEpz.js +122 -0
- package/dist/assets/{javascript-DyjJvfl0.js → javascript-D7ns9sFV.js} +1 -1
- package/dist/assets/{jsonMode-YyKPYrIT.js → jsonMode-D8BOjEqQ.js} +1 -1
- package/dist/assets/{liquid-FOT2GA4k.js → liquid-DqFRm1iO.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-Bpjj6MSM.js → lspLanguageFeatures-DFWVu75j.js} +1 -1
- package/dist/assets/{mdx-BkJBjkOz.js → mdx-Brygho1C.js} +1 -1
- package/dist/assets/ort-wasm-simd-threaded.asyncify-CtKKja6V.wasm +0 -0
- package/dist/assets/{python-BCzercLQ.js → python-AViopZds.js} +1 -1
- package/dist/assets/{razor-C06x2uSS.js → razor-DASVnUhs.js} +1 -1
- package/dist/assets/{tsMode-C8HsFkIE.js → tsMode-C-wV5DBK.js} +1 -1
- package/dist/assets/{typescript-COsI_g0X.js → typescript-C0eDfVuQ.js} +1 -1
- package/dist/assets/whisperWorker-BhZpQ_3S.js +41 -0
- package/dist/assets/{xml-DsbXKT_u.js → xml-EMOZDtWW.js} +1 -1
- package/dist/assets/{yaml-C_KvuH83.js → yaml-BRUujrQC.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +2 -1
- package/dist/assets/index-D1uJQ7wg.js +0 -121
- package/dist/assets/index-D5g_3PBl.css +0 -32
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editor.main-HqS8FFud.js","./editor-BTnBOi8r.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var Uf=Object.defineProperty;var $f=(l,m,p)=>m in l?Uf(l,m,{enumerable:!0,configurable:!0,writable:!0,value:p}):l[m]=p;var Ra=(l,m,p)=>$f(l,typeof m!="symbol"?m+"":m,p);(function(){const m=document.createElement("link").relList;if(m&&m.supports&&m.supports("modulepreload"))return;for(const P of document.querySelectorAll('link[rel="modulepreload"]'))k(P);new MutationObserver(P=>{for(const O of P)if(O.type==="childList")for(const R of O.addedNodes)R.tagName==="LINK"&&R.rel==="modulepreload"&&k(R)}).observe(document,{childList:!0,subtree:!0});function p(P){const O={};return P.integrity&&(O.integrity=P.integrity),P.referrerPolicy&&(O.referrerPolicy=P.referrerPolicy),P.crossOrigin==="use-credentials"?O.credentials="include":P.crossOrigin==="anonymous"?O.credentials="omit":O.credentials="same-origin",O}function k(P){if(P.ep)return;P.ep=!0;const O=p(P);fetch(P.href,O)}})();function bd(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var ja={exports:{}},ci={},Da={exports:{}},Ee={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react.production.min.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Wu;function Wf(){if(Wu)return Ee;Wu=1;var l=Symbol.for("react.element"),m=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),R=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),h=Symbol.iterator;function _(T){return T===null||typeof T!="object"?null:(T=h&&T[h]||T["@@iterator"],typeof T=="function"?T:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,v={};function n(T,F,ee){this.props=T,this.context=F,this.refs=v,this.updater=ee||x}n.prototype.isReactComponent={},n.prototype.setState=function(T,F){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,F,"setState")},n.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function d(){}d.prototype=n.prototype;function o(T,F,ee){this.props=T,this.context=F,this.refs=v,this.updater=ee||x}var a=o.prototype=new d;a.constructor=o,C(a,n.prototype),a.isPureReactComponent=!0;var S=Array.isArray,E=Object.prototype.hasOwnProperty,L={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function w(T,F,ee){var ne,ce={},de=null,K=null;if(F!=null)for(ne in F.ref!==void 0&&(K=F.ref),F.key!==void 0&&(de=""+F.key),F)E.call(F,ne)&&!j.hasOwnProperty(ne)&&(ce[ne]=F[ne]);var N=arguments.length-2;if(N===1)ce.children=ee;else if(1<N){for(var ie=Array(N),se=0;se<N;se++)ie[se]=arguments[se+2];ce.children=ie}if(T&&T.defaultProps)for(ne in N=T.defaultProps,N)ce[ne]===void 0&&(ce[ne]=N[ne]);return{$$typeof:l,type:T,key:de,ref:K,props:ce,_owner:L.current}}function D(T,F){return{$$typeof:l,type:T.type,key:F,ref:T.ref,props:T.props,_owner:T._owner}}function H(T){return typeof T=="object"&&T!==null&&T.$$typeof===l}function U(T){var F={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(ee){return F[ee]})}var W=/\/+/g;function I(T,F){return typeof T=="object"&&T!==null&&T.key!=null?U(""+T.key):F.toString(36)}function Q(T,F,ee,ne,ce){var de=typeof T;(de==="undefined"||de==="boolean")&&(T=null);var K=!1;if(T===null)K=!0;else switch(de){case"string":case"number":K=!0;break;case"object":switch(T.$$typeof){case l:case m:K=!0}}if(K)return K=T,ce=ce(K),T=ne===""?"."+I(K,0):ne,S(ce)?(ee="",T!=null&&(ee=T.replace(W,"$&/")+"/"),Q(ce,F,ee,"",function(se){return se})):ce!=null&&(H(ce)&&(ce=D(ce,ee+(!ce.key||K&&K.key===ce.key?"":(""+ce.key).replace(W,"$&/")+"/")+T)),F.push(ce)),1;if(K=0,ne=ne===""?".":ne+":",S(T))for(var N=0;N<T.length;N++){de=T[N];var ie=ne+I(de,N);K+=Q(de,F,ee,ie,ce)}else if(ie=_(T),typeof ie=="function")for(T=ie.call(T),N=0;!(de=T.next()).done;)de=de.value,ie=ne+I(de,N++),K+=Q(de,F,ee,ie,ce);else if(de==="object")throw F=String(T),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.");return K}function q(T,F,ee){if(T==null)return T;var ne=[],ce=0;return Q(T,ne,"","",function(de){return F.call(ee,de,ce++)}),ne}function z(T){if(T._status===-1){var F=T._result;F=F(),F.then(function(ee){(T._status===0||T._status===-1)&&(T._status=1,T._result=ee)},function(ee){(T._status===0||T._status===-1)&&(T._status=2,T._result=ee)}),T._status===-1&&(T._status=0,T._result=F)}if(T._status===1)return T._result.default;throw T._result}var re={current:null},X={transition:null},A={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:X,ReactCurrentOwner:L};function B(){throw Error("act(...) is not supported in production builds of React.")}return Ee.Children={map:q,forEach:function(T,F,ee){q(T,function(){F.apply(this,arguments)},ee)},count:function(T){var F=0;return q(T,function(){F++}),F},toArray:function(T){return q(T,function(F){return F})||[]},only:function(T){if(!H(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},Ee.Component=n,Ee.Fragment=p,Ee.Profiler=P,Ee.PureComponent=o,Ee.StrictMode=k,Ee.Suspense=c,Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=A,Ee.act=B,Ee.cloneElement=function(T,F,ee){if(T==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+T+".");var ne=C({},T.props),ce=T.key,de=T.ref,K=T._owner;if(F!=null){if(F.ref!==void 0&&(de=F.ref,K=L.current),F.key!==void 0&&(ce=""+F.key),T.type&&T.type.defaultProps)var N=T.type.defaultProps;for(ie in F)E.call(F,ie)&&!j.hasOwnProperty(ie)&&(ne[ie]=F[ie]===void 0&&N!==void 0?N[ie]:F[ie])}var ie=arguments.length-2;if(ie===1)ne.children=ee;else if(1<ie){N=Array(ie);for(var se=0;se<ie;se++)N[se]=arguments[se+2];ne.children=N}return{$$typeof:l,type:T.type,key:ce,ref:de,props:ne,_owner:K}},Ee.createContext=function(T){return T={$$typeof:R,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},T.Provider={$$typeof:O,_context:T},T.Consumer=T},Ee.createElement=w,Ee.createFactory=function(T){var F=w.bind(null,T);return F.type=T,F},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(T){return{$$typeof:i,render:T}},Ee.isValidElement=H,Ee.lazy=function(T){return{$$typeof:y,_payload:{_status:-1,_result:T},_init:z}},Ee.memo=function(T,F){return{$$typeof:g,type:T,compare:F===void 0?null:F}},Ee.startTransition=function(T){var F=X.transition;X.transition={};try{T()}finally{X.transition=F}},Ee.unstable_act=B,Ee.useCallback=function(T,F){return re.current.useCallback(T,F)},Ee.useContext=function(T){return re.current.useContext(T)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(T){return re.current.useDeferredValue(T)},Ee.useEffect=function(T,F){return re.current.useEffect(T,F)},Ee.useId=function(){return re.current.useId()},Ee.useImperativeHandle=function(T,F,ee){return re.current.useImperativeHandle(T,F,ee)},Ee.useInsertionEffect=function(T,F){return re.current.useInsertionEffect(T,F)},Ee.useLayoutEffect=function(T,F){return re.current.useLayoutEffect(T,F)},Ee.useMemo=function(T,F){return re.current.useMemo(T,F)},Ee.useReducer=function(T,F,ee){return re.current.useReducer(T,F,ee)},Ee.useRef=function(T){return re.current.useRef(T)},Ee.useState=function(T){return re.current.useState(T)},Ee.useSyncExternalStore=function(T,F,ee){return re.current.useSyncExternalStore(T,F,ee)},Ee.useTransition=function(){return re.current.useTransition()},Ee.version="18.3.1",Ee}var zu;function Ga(){return zu||(zu=1,Da.exports=Wf()),Da.exports}/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react-jsx-runtime.production.min.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var Vu;function zf(){if(Vu)return ci;Vu=1;var l=Ga(),m=Symbol.for("react.element"),p=Symbol.for("react.fragment"),k=Object.prototype.hasOwnProperty,P=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,O={key:!0,ref:!0,__self:!0,__source:!0};function R(i,c,g){var y,h={},_=null,x=null;g!==void 0&&(_=""+g),c.key!==void 0&&(_=""+c.key),c.ref!==void 0&&(x=c.ref);for(y in c)k.call(c,y)&&!O.hasOwnProperty(y)&&(h[y]=c[y]);if(i&&i.defaultProps)for(y in c=i.defaultProps,c)h[y]===void 0&&(h[y]=c[y]);return{$$typeof:m,type:i,key:_,ref:x,props:h,_owner:P.current}}return ci.Fragment=p,ci.jsx=R,ci.jsxs=R,ci}var qu;function Vf(){return qu||(qu=1,ja.exports=zf()),ja.exports}var u=Vf(),En={},Pa={exports:{}},mt={},Ta={exports:{}},Aa={};/**
|
|
19
|
-
* @license React
|
|
20
|
-
* scheduler.production.min.js
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var Ku;function qf(){return Ku||(Ku=1,(function(l){function m(X,A){var B=X.length;X.push(A);e:for(;0<B;){var T=B-1>>>1,F=X[T];if(0<P(F,A))X[T]=A,X[B]=F,B=T;else break e}}function p(X){return X.length===0?null:X[0]}function k(X){if(X.length===0)return null;var A=X[0],B=X.pop();if(B!==A){X[0]=B;e:for(var T=0,F=X.length,ee=F>>>1;T<ee;){var ne=2*(T+1)-1,ce=X[ne],de=ne+1,K=X[de];if(0>P(ce,B))de<F&&0>P(K,ce)?(X[T]=K,X[de]=B,T=de):(X[T]=ce,X[ne]=B,T=ne);else if(de<F&&0>P(K,B))X[T]=K,X[de]=B,T=de;else break e}}return A}function P(X,A){var B=X.sortIndex-A.sortIndex;return B!==0?B:X.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var O=performance;l.unstable_now=function(){return O.now()}}else{var R=Date,i=R.now();l.unstable_now=function(){return R.now()-i}}var c=[],g=[],y=1,h=null,_=3,x=!1,C=!1,v=!1,n=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,o=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function a(X){for(var A=p(g);A!==null;){if(A.callback===null)k(g);else if(A.startTime<=X)k(g),A.sortIndex=A.expirationTime,m(c,A);else break;A=p(g)}}function S(X){if(v=!1,a(X),!C)if(p(c)!==null)C=!0,z(E);else{var A=p(g);A!==null&&re(S,A.startTime-X)}}function E(X,A){C=!1,v&&(v=!1,d(w),w=-1),x=!0;var B=_;try{for(a(A),h=p(c);h!==null&&(!(h.expirationTime>A)||X&&!U());){var T=h.callback;if(typeof T=="function"){h.callback=null,_=h.priorityLevel;var F=T(h.expirationTime<=A);A=l.unstable_now(),typeof F=="function"?h.callback=F:h===p(c)&&k(c),a(A)}else k(c);h=p(c)}if(h!==null)var ee=!0;else{var ne=p(g);ne!==null&&re(S,ne.startTime-A),ee=!1}return ee}finally{h=null,_=B,x=!1}}var L=!1,j=null,w=-1,D=5,H=-1;function U(){return!(l.unstable_now()-H<D)}function W(){if(j!==null){var X=l.unstable_now();H=X;var A=!0;try{A=j(!0,X)}finally{A?I():(L=!1,j=null)}}else L=!1}var I;if(typeof o=="function")I=function(){o(W)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,q=Q.port2;Q.port1.onmessage=W,I=function(){q.postMessage(null)}}else I=function(){n(W,0)};function z(X){j=X,L||(L=!0,I())}function re(X,A){w=n(function(){X(l.unstable_now())},A)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(X){X.callback=null},l.unstable_continueExecution=function(){C||x||(C=!0,z(E))},l.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<X?Math.floor(1e3/X):5},l.unstable_getCurrentPriorityLevel=function(){return _},l.unstable_getFirstCallbackNode=function(){return p(c)},l.unstable_next=function(X){switch(_){case 1:case 2:case 3:var A=3;break;default:A=_}var B=_;_=A;try{return X()}finally{_=B}},l.unstable_pauseExecution=function(){},l.unstable_requestPaint=function(){},l.unstable_runWithPriority=function(X,A){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var B=_;_=X;try{return A()}finally{_=B}},l.unstable_scheduleCallback=function(X,A,B){var T=l.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?T+B:T):B=T,X){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=B+F,X={id:y++,callback:A,priorityLevel:X,startTime:B,expirationTime:F,sortIndex:-1},B>T?(X.sortIndex=B,m(g,X),p(c)===null&&X===p(g)&&(v?(d(w),w=-1):v=!0,re(S,B-T))):(X.sortIndex=F,m(c,X),C||x||(C=!0,z(E))),X},l.unstable_shouldYield=U,l.unstable_wrapCallback=function(X){var A=_;return function(){var B=_;_=A;try{return X.apply(this,arguments)}finally{_=B}}}})(Aa)),Aa}var Gu;function Kf(){return Gu||(Gu=1,Ta.exports=qf()),Ta.exports}/**
|
|
27
|
-
* @license React
|
|
28
|
-
* react-dom.production.min.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var Ju;function Gf(){if(Ju)return mt;Ju=1;var l=Ga(),m=Kf();function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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 k=new Set,P={};function O(e,t){R(e,t),R(e+"Capture",t)}function R(e,t){for(P[e]=t,e=0;e<t.length;e++)k.add(t[e])}var i=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,g=/^[: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]*$/,y={},h={};function _(e){return c.call(h,e)?!0:c.call(y,e)?!1:g.test(e)?h[e]=!0:(y[e]=!0,!1)}function x(e,t,r,s){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,t,r,s){if(t===null||typeof t>"u"||x(e,t,r,s))return!0;if(s)return!1;if(r!==null)switch(r.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 v(e,t,r,s,f,b,M){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=f,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=b,this.removeEmptyString=M}var n={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){n[e]=new v(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];n[t]=new v(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){n[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){n[e]=new v(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){n[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){n[e]=new v(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){n[e]=new v(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){n[e]=new v(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){n[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var d=/[\-:]([a-z])/g;function o(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(d,o);n[t]=new v(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(d,o);n[t]=new v(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(d,o);n[t]=new v(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){n[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),n.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){n[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function a(e,t,r,s){var f=n.hasOwnProperty(t)?n[t]:null;(f!==null?f.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(C(t,r,f,s)&&(r=null),s||f===null?_(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):f.mustUseProperty?e[f.propertyName]=r===null?f.type===3?!1:"":r:(t=f.attributeName,s=f.attributeNamespace,r===null?e.removeAttribute(t):(f=f.type,r=f===3||f===4&&r===!0?"":""+r,s?e.setAttributeNS(s,t,r):e.setAttribute(t,r))))}var S=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E=Symbol.for("react.element"),L=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),U=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),re=Symbol.for("react.offscreen"),X=Symbol.iterator;function A(e){return e===null||typeof e!="object"?null:(e=X&&e[X]||e["@@iterator"],typeof e=="function"?e:null)}var B=Object.assign,T;function F(e){if(T===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);T=t&&t[1]||""}return`
|
|
35
|
-
`+T+e}var ee=!1;function ne(e,t){if(!e||ee)return"";ee=!0;var r=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(te){var s=te}Reflect.construct(e,[],t)}else{try{t.call()}catch(te){s=te}e.call(t.prototype)}else{try{throw Error()}catch(te){s=te}e()}}catch(te){if(te&&s&&typeof te.stack=="string"){for(var f=te.stack.split(`
|
|
36
|
-
`),b=s.stack.split(`
|
|
37
|
-
`),M=f.length-1,$=b.length-1;1<=M&&0<=$&&f[M]!==b[$];)$--;for(;1<=M&&0<=$;M--,$--)if(f[M]!==b[$]){if(M!==1||$!==1)do if(M--,$--,0>$||f[M]!==b[$]){var V=`
|
|
38
|
-
`+f[M].replace(" at new "," at ");return e.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",e.displayName)),V}while(1<=M&&0<=$);break}}}finally{ee=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?F(e):""}function ce(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=ne(e.type,!1),e;case 11:return e=ne(e.type.render,!1),e;case 1:return e=ne(e.type,!0),e;default:return""}}function de(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 j:return"Fragment";case L:return"Portal";case D:return"Profiler";case w:return"StrictMode";case I:return"Suspense";case Q:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U:return(e.displayName||"Context")+".Consumer";case H:return(e._context.displayName||"Context")+".Provider";case W: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:de(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}function K(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 de(t);case 8:return t===w?"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 N(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ie(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function se(e){var t=ie(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var f=r.get,b=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(M){s=""+M,b.call(this,M)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(M){s=""+M},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function fe(e){e._valueTracker||(e._valueTracker=se(e))}function he(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),s="";return e&&(s=ie(e)?e.checked?"true":"false":e.value),e=s,e!==r?(t.setValue(e),!0):!1}function ke(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 Te(e,t){var r=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Me(e,t){var r=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;r=N(t.value!=null?t.value:r),e._wrapperState={initialChecked:s,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Xe(e,t){t=t.checked,t!=null&&a(e,"checked",t,!1)}function be(e,t){Xe(e,t);var r=N(t.value),s=t.type;if(r!=null)s==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Tr(e,t.type,r):t.hasOwnProperty("defaultValue")&&Tr(e,t.type,N(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nr(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Tr(e,t,r){(t!=="number"||ke(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Qt=Array.isArray;function Ut(e,t,r,s){if(e=e.options,t){t={};for(var f=0;f<r.length;f++)t["$"+r[f]]=!0;for(r=0;r<e.length;r++)f=t.hasOwnProperty("$"+e[r].value),e[r].selected!==f&&(e[r].selected=f),f&&s&&(e[r].defaultSelected=!0)}else{for(r=""+N(r),t=null,f=0;f<e.length;f++){if(e[f].value===r){e[f].selected=!0,s&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function or(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(p(91));return B({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function nt(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(p(92));if(Qt(r)){if(1<r.length)throw Error(p(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:N(r)}}function ar(e,t){var r=N(t.value),s=N(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),s!=null&&(e.defaultValue=""+s)}function gt(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function lr(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 Ar(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?lr(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var vt,Mr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,s,f){MSApp.execUnsafeLocalFunction(function(){return e(t,r,s,f)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(vt=vt||document.createElement("div"),vt.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=vt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ct(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Tt={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},Oe=["Webkit","ms","Moz","O"];Object.keys(Tt).forEach(function(e){Oe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tt[t]=Tt[e]})});function vi(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Tt.hasOwnProperty(e)&&Tt[e]?(""+t).trim():t+"px"}function nl(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var s=r.indexOf("--")===0,f=vi(r,t[r],s);r==="float"&&(r="cssFloat"),s?e.setProperty(r,f):e[r]=f}}var Vd=B({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 Fn(e,t){if(t){if(Vd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(p(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(p(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(p(61))}if(t.style!=null&&typeof t.style!="object")throw Error(p(62))}}function Hn(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 Un=null;function $n(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wn=null,Yr=null,Zr=null;function ol(e){if(e=Gs(e)){if(typeof Wn!="function")throw Error(p(280));var t=e.stateNode;t&&(t=Hi(t),Wn(e.stateNode,e.type,t))}}function al(e){Yr?Zr?Zr.push(e):Zr=[e]:Yr=e}function ll(){if(Yr){var e=Yr,t=Zr;if(Zr=Yr=null,ol(e),t)for(e=0;e<t.length;e++)ol(t[e])}}function cl(e,t){return e(t)}function ul(){}var zn=!1;function dl(e,t,r){if(zn)return e(t,r);zn=!0;try{return cl(e,t,r)}finally{zn=!1,(Yr!==null||Zr!==null)&&(ul(),ll())}}function Ls(e,t){var r=e.stateNode;if(r===null)return null;var s=Hi(r);if(s===null)return null;r=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(p(231,t,typeof r));return r}var Vn=!1;if(i)try{var Rs={};Object.defineProperty(Rs,"passive",{get:function(){Vn=!0}}),window.addEventListener("test",Rs,Rs),window.removeEventListener("test",Rs,Rs)}catch{Vn=!1}function qd(e,t,r,s,f,b,M,$,V){var te=Array.prototype.slice.call(arguments,3);try{t.apply(r,te)}catch(ae){this.onError(ae)}}var js=!1,_i=null,yi=!1,qn=null,Kd={onError:function(e){js=!0,_i=e}};function Gd(e,t,r,s,f,b,M,$,V){js=!1,_i=null,qd.apply(Kd,arguments)}function Jd(e,t,r,s,f,b,M,$,V){if(Gd.apply(this,arguments),js){if(js){var te=_i;js=!1,_i=null}else throw Error(p(198));yi||(yi=!0,qn=te)}}function Or(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function hl(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 fl(e){if(Or(e)!==e)throw Error(p(188))}function Qd(e){var t=e.alternate;if(!t){if(t=Or(e),t===null)throw Error(p(188));return t!==e?null:e}for(var r=e,s=t;;){var f=r.return;if(f===null)break;var b=f.alternate;if(b===null){if(s=f.return,s!==null){r=s;continue}break}if(f.child===b.child){for(b=f.child;b;){if(b===r)return fl(f),e;if(b===s)return fl(f),t;b=b.sibling}throw Error(p(188))}if(r.return!==s.return)r=f,s=b;else{for(var M=!1,$=f.child;$;){if($===r){M=!0,r=f,s=b;break}if($===s){M=!0,s=f,r=b;break}$=$.sibling}if(!M){for($=b.child;$;){if($===r){M=!0,r=b,s=f;break}if($===s){M=!0,s=b,r=f;break}$=$.sibling}if(!M)throw Error(p(189))}}if(r.alternate!==s)throw Error(p(190))}if(r.tag!==3)throw Error(p(188));return r.stateNode.current===r?e:t}function pl(e){return e=Qd(e),e!==null?ml(e):null}function ml(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ml(e);if(t!==null)return t;e=e.sibling}return null}var gl=m.unstable_scheduleCallback,vl=m.unstable_cancelCallback,Xd=m.unstable_shouldYield,Yd=m.unstable_requestPaint,$e=m.unstable_now,Zd=m.unstable_getCurrentPriorityLevel,Kn=m.unstable_ImmediatePriority,_l=m.unstable_UserBlockingPriority,Si=m.unstable_NormalPriority,eh=m.unstable_LowPriority,yl=m.unstable_IdlePriority,wi=null,$t=null;function th(e){if($t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(wi,e,void 0,(e.current.flags&128)===128)}catch{}}var At=Math.clz32?Math.clz32:ih,rh=Math.log,sh=Math.LN2;function ih(e){return e>>>=0,e===0?32:31-(rh(e)/sh|0)|0}var xi=64,bi=4194304;function Ds(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 Ci(e,t){var r=e.pendingLanes;if(r===0)return 0;var s=0,f=e.suspendedLanes,b=e.pingedLanes,M=r&268435455;if(M!==0){var $=M&~f;$!==0?s=Ds($):(b&=M,b!==0&&(s=Ds(b)))}else M=r&~f,M!==0?s=Ds(M):b!==0&&(s=Ds(b));if(s===0)return 0;if(t!==0&&t!==s&&(t&f)===0&&(f=s&-s,b=t&-t,f>=b||f===16&&(b&4194240)!==0))return t;if((s&4)!==0&&(s|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)r=31-At(t),f=1<<r,s|=e[r],t&=~f;return s}function nh(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 oh(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,f=e.expirationTimes,b=e.pendingLanes;0<b;){var M=31-At(b),$=1<<M,V=f[M];V===-1?(($&r)===0||($&s)!==0)&&(f[M]=nh($,t)):V<=t&&(e.expiredLanes|=$),b&=~$}}function Gn(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Sl(){var e=xi;return xi<<=1,(xi&4194240)===0&&(xi=64),e}function Jn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ps(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-At(t),e[t]=r}function ah(e,t){var r=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 s=e.eventTimes;for(e=e.expirationTimes;0<r;){var f=31-At(r),b=1<<f;t[f]=0,s[f]=-1,e[f]=-1,r&=~b}}function Qn(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var s=31-At(r),f=1<<s;f&t|e[s]&t&&(e[s]|=t),r&=~f}}var De=0;function wl(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var xl,Xn,bl,Cl,kl,Yn=!1,ki=[],cr=null,ur=null,dr=null,Ts=new Map,As=new Map,hr=[],lh="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 El(e,t){switch(e){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":ur=null;break;case"mouseover":case"mouseout":dr=null;break;case"pointerover":case"pointerout":Ts.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":As.delete(t.pointerId)}}function Ms(e,t,r,s,f,b){return e===null||e.nativeEvent!==b?(e={blockedOn:t,domEventName:r,eventSystemFlags:s,nativeEvent:b,targetContainers:[f]},t!==null&&(t=Gs(t),t!==null&&Xn(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,f!==null&&t.indexOf(f)===-1&&t.push(f),e)}function ch(e,t,r,s,f){switch(t){case"focusin":return cr=Ms(cr,e,t,r,s,f),!0;case"dragenter":return ur=Ms(ur,e,t,r,s,f),!0;case"mouseover":return dr=Ms(dr,e,t,r,s,f),!0;case"pointerover":var b=f.pointerId;return Ts.set(b,Ms(Ts.get(b)||null,e,t,r,s,f)),!0;case"gotpointercapture":return b=f.pointerId,As.set(b,Ms(As.get(b)||null,e,t,r,s,f)),!0}return!1}function Ll(e){var t=Nr(e.target);if(t!==null){var r=Or(t);if(r!==null){if(t=r.tag,t===13){if(t=hl(r),t!==null){e.blockedOn=t,kl(e.priority,function(){bl(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ei(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=eo(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);Un=s,r.target.dispatchEvent(s),Un=null}else return t=Gs(r),t!==null&&Xn(t),e.blockedOn=r,!1;t.shift()}return!0}function Rl(e,t,r){Ei(e)&&r.delete(t)}function uh(){Yn=!1,cr!==null&&Ei(cr)&&(cr=null),ur!==null&&Ei(ur)&&(ur=null),dr!==null&&Ei(dr)&&(dr=null),Ts.forEach(Rl),As.forEach(Rl)}function Os(e,t){e.blockedOn===t&&(e.blockedOn=null,Yn||(Yn=!0,m.unstable_scheduleCallback(m.unstable_NormalPriority,uh)))}function Ns(e){function t(f){return Os(f,e)}if(0<ki.length){Os(ki[0],e);for(var r=1;r<ki.length;r++){var s=ki[r];s.blockedOn===e&&(s.blockedOn=null)}}for(cr!==null&&Os(cr,e),ur!==null&&Os(ur,e),dr!==null&&Os(dr,e),Ts.forEach(t),As.forEach(t),r=0;r<hr.length;r++)s=hr[r],s.blockedOn===e&&(s.blockedOn=null);for(;0<hr.length&&(r=hr[0],r.blockedOn===null);)Ll(r),r.blockedOn===null&&hr.shift()}var es=S.ReactCurrentBatchConfig,Li=!0;function dh(e,t,r,s){var f=De,b=es.transition;es.transition=null;try{De=1,Zn(e,t,r,s)}finally{De=f,es.transition=b}}function hh(e,t,r,s){var f=De,b=es.transition;es.transition=null;try{De=4,Zn(e,t,r,s)}finally{De=f,es.transition=b}}function Zn(e,t,r,s){if(Li){var f=eo(e,t,r,s);if(f===null)_o(e,t,s,Ri,r),El(e,s);else if(ch(f,e,t,r,s))s.stopPropagation();else if(El(e,s),t&4&&-1<lh.indexOf(e)){for(;f!==null;){var b=Gs(f);if(b!==null&&xl(b),b=eo(e,t,r,s),b===null&&_o(e,t,s,Ri,r),b===f)break;f=b}f!==null&&s.stopPropagation()}else _o(e,t,s,null,r)}}var Ri=null;function eo(e,t,r,s){if(Ri=null,e=$n(s),e=Nr(e),e!==null)if(t=Or(e),t===null)e=null;else if(r=t.tag,r===13){if(e=hl(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ri=e,null}function jl(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(Zd()){case Kn:return 1;case _l:return 4;case Si:case eh:return 16;case yl:return 536870912;default:return 16}default:return 16}}var fr=null,to=null,ji=null;function Dl(){if(ji)return ji;var e,t=to,r=t.length,s,f="value"in fr?fr.value:fr.textContent,b=f.length;for(e=0;e<r&&t[e]===f[e];e++);var M=r-e;for(s=1;s<=M&&t[r-s]===f[b-s];s++);return ji=f.slice(e,1<s?1-s:void 0)}function Di(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 Pi(){return!0}function Pl(){return!1}function _t(e){function t(r,s,f,b,M){this._reactName=r,this._targetInst=f,this.type=s,this.nativeEvent=b,this.target=M,this.currentTarget=null;for(var $ in e)e.hasOwnProperty($)&&(r=e[$],this[$]=r?r(b):b[$]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Pi:Pl,this.isPropagationStopped=Pl,this}return B(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Pi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Pi)},persist:function(){},isPersistent:Pi}),t}var ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ro=_t(ts),Is=B({},ts,{view:0,detail:0}),fh=_t(Is),so,io,Bs,Ti=B({},Is,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:oo,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!==Bs&&(Bs&&e.type==="mousemove"?(so=e.screenX-Bs.screenX,io=e.screenY-Bs.screenY):io=so=0,Bs=e),so)},movementY:function(e){return"movementY"in e?e.movementY:io}}),Tl=_t(Ti),ph=B({},Ti,{dataTransfer:0}),mh=_t(ph),gh=B({},Is,{relatedTarget:0}),no=_t(gh),vh=B({},ts,{animationName:0,elapsedTime:0,pseudoElement:0}),_h=_t(vh),yh=B({},ts,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Sh=_t(yh),wh=B({},ts,{data:0}),Al=_t(wh),xh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bh={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"},Ch={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ch[e])?!!t[e]:!1}function oo(){return kh}var Eh=B({},Is,{key:function(e){if(e.key){var t=xh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Di(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:oo,charCode:function(e){return e.type==="keypress"?Di(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Di(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Lh=_t(Eh),Rh=B({},Ti,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ml=_t(Rh),jh=B({},Is,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:oo}),Dh=_t(jh),Ph=B({},ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),Th=_t(Ph),Ah=B({},Ti,{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}),Mh=_t(Ah),Oh=[9,13,27,32],ao=i&&"CompositionEvent"in window,Fs=null;i&&"documentMode"in document&&(Fs=document.documentMode);var Nh=i&&"TextEvent"in window&&!Fs,Ol=i&&(!ao||Fs&&8<Fs&&11>=Fs),Nl=" ",Il=!1;function Bl(e,t){switch(e){case"keyup":return Oh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fl(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rs=!1;function Ih(e,t){switch(e){case"compositionend":return Fl(t);case"keypress":return t.which!==32?null:(Il=!0,Nl);case"textInput":return e=t.data,e===Nl&&Il?null:e;default:return null}}function Bh(e,t){if(rs)return e==="compositionend"||!ao&&Bl(e,t)?(e=Dl(),ji=to=fr=null,rs=!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 Ol&&t.locale!=="ko"?null:t.data;default:return null}}var Fh={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 Hl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Fh[e.type]:t==="textarea"}function Ul(e,t,r,s){al(s),t=Ii(t,"onChange"),0<t.length&&(r=new ro("onChange","change",null,r,s),e.push({event:r,listeners:t}))}var Hs=null,Us=null;function Hh(e){nc(e,0)}function Ai(e){var t=as(e);if(he(t))return e}function Uh(e,t){if(e==="change")return t}var $l=!1;if(i){var lo;if(i){var co="oninput"in document;if(!co){var Wl=document.createElement("div");Wl.setAttribute("oninput","return;"),co=typeof Wl.oninput=="function"}lo=co}else lo=!1;$l=lo&&(!document.documentMode||9<document.documentMode)}function zl(){Hs&&(Hs.detachEvent("onpropertychange",Vl),Us=Hs=null)}function Vl(e){if(e.propertyName==="value"&&Ai(Us)){var t=[];Ul(t,Us,e,$n(e)),dl(Hh,t)}}function $h(e,t,r){e==="focusin"?(zl(),Hs=t,Us=r,Hs.attachEvent("onpropertychange",Vl)):e==="focusout"&&zl()}function Wh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ai(Us)}function zh(e,t){if(e==="click")return Ai(t)}function Vh(e,t){if(e==="input"||e==="change")return Ai(t)}function qh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mt=typeof Object.is=="function"?Object.is:qh;function $s(e,t){if(Mt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var f=r[s];if(!c.call(t,f)||!Mt(e[f],t[f]))return!1}return!0}function ql(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kl(e,t){var r=ql(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=t&&s>=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ql(r)}}function Gl(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gl(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jl(){for(var e=window,t=ke();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ke(e.document)}return t}function uo(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 Kh(e){var t=Jl(),r=e.focusedElem,s=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Gl(r.ownerDocument.documentElement,r)){if(s!==null&&uo(r)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var f=r.textContent.length,b=Math.min(s.start,f);s=s.end===void 0?b:Math.min(s.end,f),!e.extend&&b>s&&(f=s,s=b,b=f),f=Kl(r,b);var M=Kl(r,s);f&&M&&(e.rangeCount!==1||e.anchorNode!==f.node||e.anchorOffset!==f.offset||e.focusNode!==M.node||e.focusOffset!==M.offset)&&(t=t.createRange(),t.setStart(f.node,f.offset),e.removeAllRanges(),b>s?(e.addRange(t),e.extend(M.node,M.offset)):(t.setEnd(M.node,M.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Gh=i&&"documentMode"in document&&11>=document.documentMode,ss=null,ho=null,Ws=null,fo=!1;function Ql(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;fo||ss==null||ss!==ke(s)||(s=ss,"selectionStart"in s&&uo(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Ws&&$s(Ws,s)||(Ws=s,s=Ii(ho,"onSelect"),0<s.length&&(t=new ro("onSelect","select",null,t,r),e.push({event:t,listeners:s}),t.target=ss)))}function Mi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var is={animationend:Mi("Animation","AnimationEnd"),animationiteration:Mi("Animation","AnimationIteration"),animationstart:Mi("Animation","AnimationStart"),transitionend:Mi("Transition","TransitionEnd")},po={},Xl={};i&&(Xl=document.createElement("div").style,"AnimationEvent"in window||(delete is.animationend.animation,delete is.animationiteration.animation,delete is.animationstart.animation),"TransitionEvent"in window||delete is.transitionend.transition);function Oi(e){if(po[e])return po[e];if(!is[e])return e;var t=is[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Xl)return po[e]=t[r];return e}var Yl=Oi("animationend"),Zl=Oi("animationiteration"),ec=Oi("animationstart"),tc=Oi("transitionend"),rc=new Map,sc="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 pr(e,t){rc.set(e,t),O(t,[e])}for(var mo=0;mo<sc.length;mo++){var go=sc[mo],Jh=go.toLowerCase(),Qh=go[0].toUpperCase()+go.slice(1);pr(Jh,"on"+Qh)}pr(Yl,"onAnimationEnd"),pr(Zl,"onAnimationIteration"),pr(ec,"onAnimationStart"),pr("dblclick","onDoubleClick"),pr("focusin","onFocus"),pr("focusout","onBlur"),pr(tc,"onTransitionEnd"),R("onMouseEnter",["mouseout","mouseover"]),R("onMouseLeave",["mouseout","mouseover"]),R("onPointerEnter",["pointerout","pointerover"]),R("onPointerLeave",["pointerout","pointerover"]),O("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),O("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),O("onBeforeInput",["compositionend","keypress","textInput","paste"]),O("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),O("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),O("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zs="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(" "),Xh=new Set("cancel close invalid load scroll toggle".split(" ").concat(zs));function ic(e,t,r){var s=e.type||"unknown-event";e.currentTarget=r,Jd(s,t,void 0,e),e.currentTarget=null}function nc(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],f=s.event;s=s.listeners;e:{var b=void 0;if(t)for(var M=s.length-1;0<=M;M--){var $=s[M],V=$.instance,te=$.currentTarget;if($=$.listener,V!==b&&f.isPropagationStopped())break e;ic(f,$,te),b=V}else for(M=0;M<s.length;M++){if($=s[M],V=$.instance,te=$.currentTarget,$=$.listener,V!==b&&f.isPropagationStopped())break e;ic(f,$,te),b=V}}}if(yi)throw e=qn,yi=!1,qn=null,e}function Ne(e,t){var r=t[Co];r===void 0&&(r=t[Co]=new Set);var s=e+"__bubble";r.has(s)||(oc(t,e,2,!1),r.add(s))}function vo(e,t,r){var s=0;t&&(s|=4),oc(r,e,s,t)}var Ni="_reactListening"+Math.random().toString(36).slice(2);function Vs(e){if(!e[Ni]){e[Ni]=!0,k.forEach(function(r){r!=="selectionchange"&&(Xh.has(r)||vo(r,!1,e),vo(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ni]||(t[Ni]=!0,vo("selectionchange",!1,t))}}function oc(e,t,r,s){switch(jl(t)){case 1:var f=dh;break;case 4:f=hh;break;default:f=Zn}r=f.bind(null,t,r,e),f=void 0,!Vn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(f=!0),s?f!==void 0?e.addEventListener(t,r,{capture:!0,passive:f}):e.addEventListener(t,r,!0):f!==void 0?e.addEventListener(t,r,{passive:f}):e.addEventListener(t,r,!1)}function _o(e,t,r,s,f){var b=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var M=s.tag;if(M===3||M===4){var $=s.stateNode.containerInfo;if($===f||$.nodeType===8&&$.parentNode===f)break;if(M===4)for(M=s.return;M!==null;){var V=M.tag;if((V===3||V===4)&&(V=M.stateNode.containerInfo,V===f||V.nodeType===8&&V.parentNode===f))return;M=M.return}for(;$!==null;){if(M=Nr($),M===null)return;if(V=M.tag,V===5||V===6){s=b=M;continue e}$=$.parentNode}}s=s.return}dl(function(){var te=b,ae=$n(r),le=[];e:{var oe=rc.get(e);if(oe!==void 0){var pe=ro,ge=e;switch(e){case"keypress":if(Di(r)===0)break e;case"keydown":case"keyup":pe=Lh;break;case"focusin":ge="focus",pe=no;break;case"focusout":ge="blur",pe=no;break;case"beforeblur":case"afterblur":pe=no;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Tl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=mh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=Dh;break;case Yl:case Zl:case ec:pe=_h;break;case tc:pe=Th;break;case"scroll":pe=fh;break;case"wheel":pe=Mh;break;case"copy":case"cut":case"paste":pe=Sh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Ml}var ve=(t&4)!==0,We=!ve&&e==="scroll",Y=ve?oe!==null?oe+"Capture":null:oe;ve=[];for(var G=te,Z;G!==null;){Z=G;var ue=Z.stateNode;if(Z.tag===5&&ue!==null&&(Z=ue,Y!==null&&(ue=Ls(G,Y),ue!=null&&ve.push(qs(G,ue,Z)))),We)break;G=G.return}0<ve.length&&(oe=new pe(oe,ge,null,r,ae),le.push({event:oe,listeners:ve}))}}if((t&7)===0){e:{if(oe=e==="mouseover"||e==="pointerover",pe=e==="mouseout"||e==="pointerout",oe&&r!==Un&&(ge=r.relatedTarget||r.fromElement)&&(Nr(ge)||ge[Xt]))break e;if((pe||oe)&&(oe=ae.window===ae?ae:(oe=ae.ownerDocument)?oe.defaultView||oe.parentWindow:window,pe?(ge=r.relatedTarget||r.toElement,pe=te,ge=ge?Nr(ge):null,ge!==null&&(We=Or(ge),ge!==We||ge.tag!==5&&ge.tag!==6)&&(ge=null)):(pe=null,ge=te),pe!==ge)){if(ve=Tl,ue="onMouseLeave",Y="onMouseEnter",G="mouse",(e==="pointerout"||e==="pointerover")&&(ve=Ml,ue="onPointerLeave",Y="onPointerEnter",G="pointer"),We=pe==null?oe:as(pe),Z=ge==null?oe:as(ge),oe=new ve(ue,G+"leave",pe,r,ae),oe.target=We,oe.relatedTarget=Z,ue=null,Nr(ae)===te&&(ve=new ve(Y,G+"enter",ge,r,ae),ve.target=Z,ve.relatedTarget=We,ue=ve),We=ue,pe&&ge)t:{for(ve=pe,Y=ge,G=0,Z=ve;Z;Z=ns(Z))G++;for(Z=0,ue=Y;ue;ue=ns(ue))Z++;for(;0<G-Z;)ve=ns(ve),G--;for(;0<Z-G;)Y=ns(Y),Z--;for(;G--;){if(ve===Y||Y!==null&&ve===Y.alternate)break t;ve=ns(ve),Y=ns(Y)}ve=null}else ve=null;pe!==null&&ac(le,oe,pe,ve,!1),ge!==null&&We!==null&&ac(le,We,ge,ve,!0)}}e:{if(oe=te?as(te):window,pe=oe.nodeName&&oe.nodeName.toLowerCase(),pe==="select"||pe==="input"&&oe.type==="file")var _e=Uh;else if(Hl(oe))if($l)_e=Vh;else{_e=Wh;var Se=$h}else(pe=oe.nodeName)&&pe.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(_e=zh);if(_e&&(_e=_e(e,te))){Ul(le,_e,r,ae);break e}Se&&Se(e,oe,te),e==="focusout"&&(Se=oe._wrapperState)&&Se.controlled&&oe.type==="number"&&Tr(oe,"number",oe.value)}switch(Se=te?as(te):window,e){case"focusin":(Hl(Se)||Se.contentEditable==="true")&&(ss=Se,ho=te,Ws=null);break;case"focusout":Ws=ho=ss=null;break;case"mousedown":fo=!0;break;case"contextmenu":case"mouseup":case"dragend":fo=!1,Ql(le,r,ae);break;case"selectionchange":if(Gh)break;case"keydown":case"keyup":Ql(le,r,ae)}var we;if(ao)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else rs?Bl(e,r)&&(Ce="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ce="onCompositionStart");Ce&&(Ol&&r.locale!=="ko"&&(rs||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&rs&&(we=Dl()):(fr=ae,to="value"in fr?fr.value:fr.textContent,rs=!0)),Se=Ii(te,Ce),0<Se.length&&(Ce=new Al(Ce,e,null,r,ae),le.push({event:Ce,listeners:Se}),we?Ce.data=we:(we=Fl(r),we!==null&&(Ce.data=we)))),(we=Nh?Ih(e,r):Bh(e,r))&&(te=Ii(te,"onBeforeInput"),0<te.length&&(ae=new Al("onBeforeInput","beforeinput",null,r,ae),le.push({event:ae,listeners:te}),ae.data=we))}nc(le,t)})}function qs(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Ii(e,t){for(var r=t+"Capture",s=[];e!==null;){var f=e,b=f.stateNode;f.tag===5&&b!==null&&(f=b,b=Ls(e,r),b!=null&&s.unshift(qs(e,b,f)),b=Ls(e,t),b!=null&&s.push(qs(e,b,f))),e=e.return}return s}function ns(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ac(e,t,r,s,f){for(var b=t._reactName,M=[];r!==null&&r!==s;){var $=r,V=$.alternate,te=$.stateNode;if(V!==null&&V===s)break;$.tag===5&&te!==null&&($=te,f?(V=Ls(r,b),V!=null&&M.unshift(qs(r,V,$))):f||(V=Ls(r,b),V!=null&&M.push(qs(r,V,$)))),r=r.return}M.length!==0&&e.push({event:t,listeners:M})}var Yh=/\r\n?/g,Zh=/\u0000|\uFFFD/g;function lc(e){return(typeof e=="string"?e:""+e).replace(Yh,`
|
|
39
|
-
`).replace(Zh,"")}function Bi(e,t,r){if(t=lc(t),lc(e)!==t&&r)throw Error(p(425))}function Fi(){}var yo=null,So=null;function wo(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 xo=typeof setTimeout=="function"?setTimeout:void 0,ef=typeof clearTimeout=="function"?clearTimeout:void 0,cc=typeof Promise=="function"?Promise:void 0,tf=typeof queueMicrotask=="function"?queueMicrotask:typeof cc<"u"?function(e){return cc.resolve(null).then(e).catch(rf)}:xo;function rf(e){setTimeout(function(){throw e})}function bo(e,t){var r=t,s=0;do{var f=r.nextSibling;if(e.removeChild(r),f&&f.nodeType===8)if(r=f.data,r==="/$"){if(s===0){e.removeChild(f),Ns(t);return}s--}else r!=="$"&&r!=="$?"&&r!=="$!"||s++;r=f}while(r);Ns(t)}function mr(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 uc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var os=Math.random().toString(36).slice(2),Wt="__reactFiber$"+os,Ks="__reactProps$"+os,Xt="__reactContainer$"+os,Co="__reactEvents$"+os,sf="__reactListeners$"+os,nf="__reactHandles$"+os;function Nr(e){var t=e[Wt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Xt]||r[Wt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=uc(e);e!==null;){if(r=e[Wt])return r;e=uc(e)}return t}e=r,r=e.parentNode}return null}function Gs(e){return e=e[Wt]||e[Xt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function as(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(p(33))}function Hi(e){return e[Ks]||null}var ko=[],ls=-1;function gr(e){return{current:e}}function Ie(e){0>ls||(e.current=ko[ls],ko[ls]=null,ls--)}function Ae(e,t){ls++,ko[ls]=e.current,e.current=t}var vr={},et=gr(vr),ut=gr(!1),Ir=vr;function cs(e,t){var r=e.type.contextTypes;if(!r)return vr;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var f={},b;for(b in r)f[b]=t[b];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=f),f}function dt(e){return e=e.childContextTypes,e!=null}function Ui(){Ie(ut),Ie(et)}function dc(e,t,r){if(et.current!==vr)throw Error(p(168));Ae(et,t),Ae(ut,r)}function hc(e,t,r){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var f in s)if(!(f in t))throw Error(p(108,K(e)||"Unknown",f));return B({},r,s)}function $i(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vr,Ir=et.current,Ae(et,e),Ae(ut,ut.current),!0}function fc(e,t,r){var s=e.stateNode;if(!s)throw Error(p(169));r?(e=hc(e,t,Ir),s.__reactInternalMemoizedMergedChildContext=e,Ie(ut),Ie(et),Ae(et,e)):Ie(ut),Ae(ut,r)}var Yt=null,Wi=!1,Eo=!1;function pc(e){Yt===null?Yt=[e]:Yt.push(e)}function of(e){Wi=!0,pc(e)}function _r(){if(!Eo&&Yt!==null){Eo=!0;var e=0,t=De;try{var r=Yt;for(De=1;e<r.length;e++){var s=r[e];do s=s(!0);while(s!==null)}Yt=null,Wi=!1}catch(f){throw Yt!==null&&(Yt=Yt.slice(e+1)),gl(Kn,_r),f}finally{De=t,Eo=!1}}return null}var us=[],ds=0,zi=null,Vi=0,bt=[],Ct=0,Br=null,Zt=1,er="";function Fr(e,t){us[ds++]=Vi,us[ds++]=zi,zi=e,Vi=t}function mc(e,t,r){bt[Ct++]=Zt,bt[Ct++]=er,bt[Ct++]=Br,Br=e;var s=Zt;e=er;var f=32-At(s)-1;s&=~(1<<f),r+=1;var b=32-At(t)+f;if(30<b){var M=f-f%5;b=(s&(1<<M)-1).toString(32),s>>=M,f-=M,Zt=1<<32-At(t)+f|r<<f|s,er=b+e}else Zt=1<<b|r<<f|s,er=e}function Lo(e){e.return!==null&&(Fr(e,1),mc(e,1,0))}function Ro(e){for(;e===zi;)zi=us[--ds],us[ds]=null,Vi=us[--ds],us[ds]=null;for(;e===Br;)Br=bt[--Ct],bt[Ct]=null,er=bt[--Ct],bt[Ct]=null,Zt=bt[--Ct],bt[Ct]=null}var yt=null,St=null,Be=!1,Ot=null;function gc(e,t){var r=Rt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function vc(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,yt=e,St=mr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,yt=e,St=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Br!==null?{id:Zt,overflow:er}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Rt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,yt=e,St=null,!0):!1;default:return!1}}function jo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Do(e){if(Be){var t=St;if(t){var r=t;if(!vc(e,t)){if(jo(e))throw Error(p(418));t=mr(r.nextSibling);var s=yt;t&&vc(e,t)?gc(s,r):(e.flags=e.flags&-4097|2,Be=!1,yt=e)}}else{if(jo(e))throw Error(p(418));e.flags=e.flags&-4097|2,Be=!1,yt=e}}}function _c(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;yt=e}function qi(e){if(e!==yt)return!1;if(!Be)return _c(e),Be=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!wo(e.type,e.memoizedProps)),t&&(t=St)){if(jo(e))throw yc(),Error(p(418));for(;t;)gc(e,t),t=mr(t.nextSibling)}if(_c(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(p(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){St=mr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}St=null}}else St=yt?mr(e.stateNode.nextSibling):null;return!0}function yc(){for(var e=St;e;)e=mr(e.nextSibling)}function hs(){St=yt=null,Be=!1}function Po(e){Ot===null?Ot=[e]:Ot.push(e)}var af=S.ReactCurrentBatchConfig;function Js(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(p(309));var s=r.stateNode}if(!s)throw Error(p(147,e));var f=s,b=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===b?t.ref:(t=function(M){var $=f.refs;M===null?delete $[b]:$[b]=M},t._stringRef=b,t)}if(typeof e!="string")throw Error(p(284));if(!r._owner)throw Error(p(290,e))}return e}function Ki(e,t){throw e=Object.prototype.toString.call(t),Error(p(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Sc(e){var t=e._init;return t(e._payload)}function wc(e){function t(Y,G){if(e){var Z=Y.deletions;Z===null?(Y.deletions=[G],Y.flags|=16):Z.push(G)}}function r(Y,G){if(!e)return null;for(;G!==null;)t(Y,G),G=G.sibling;return null}function s(Y,G){for(Y=new Map;G!==null;)G.key!==null?Y.set(G.key,G):Y.set(G.index,G),G=G.sibling;return Y}function f(Y,G){return Y=Er(Y,G),Y.index=0,Y.sibling=null,Y}function b(Y,G,Z){return Y.index=Z,e?(Z=Y.alternate,Z!==null?(Z=Z.index,Z<G?(Y.flags|=2,G):Z):(Y.flags|=2,G)):(Y.flags|=1048576,G)}function M(Y){return e&&Y.alternate===null&&(Y.flags|=2),Y}function $(Y,G,Z,ue){return G===null||G.tag!==6?(G=xa(Z,Y.mode,ue),G.return=Y,G):(G=f(G,Z),G.return=Y,G)}function V(Y,G,Z,ue){var _e=Z.type;return _e===j?ae(Y,G,Z.props.children,ue,Z.key):G!==null&&(G.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===z&&Sc(_e)===G.type)?(ue=f(G,Z.props),ue.ref=Js(Y,G,Z),ue.return=Y,ue):(ue=_n(Z.type,Z.key,Z.props,null,Y.mode,ue),ue.ref=Js(Y,G,Z),ue.return=Y,ue)}function te(Y,G,Z,ue){return G===null||G.tag!==4||G.stateNode.containerInfo!==Z.containerInfo||G.stateNode.implementation!==Z.implementation?(G=ba(Z,Y.mode,ue),G.return=Y,G):(G=f(G,Z.children||[]),G.return=Y,G)}function ae(Y,G,Z,ue,_e){return G===null||G.tag!==7?(G=Kr(Z,Y.mode,ue,_e),G.return=Y,G):(G=f(G,Z),G.return=Y,G)}function le(Y,G,Z){if(typeof G=="string"&&G!==""||typeof G=="number")return G=xa(""+G,Y.mode,Z),G.return=Y,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case E:return Z=_n(G.type,G.key,G.props,null,Y.mode,Z),Z.ref=Js(Y,null,G),Z.return=Y,Z;case L:return G=ba(G,Y.mode,Z),G.return=Y,G;case z:var ue=G._init;return le(Y,ue(G._payload),Z)}if(Qt(G)||A(G))return G=Kr(G,Y.mode,Z,null),G.return=Y,G;Ki(Y,G)}return null}function oe(Y,G,Z,ue){var _e=G!==null?G.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number")return _e!==null?null:$(Y,G,""+Z,ue);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case E:return Z.key===_e?V(Y,G,Z,ue):null;case L:return Z.key===_e?te(Y,G,Z,ue):null;case z:return _e=Z._init,oe(Y,G,_e(Z._payload),ue)}if(Qt(Z)||A(Z))return _e!==null?null:ae(Y,G,Z,ue,null);Ki(Y,Z)}return null}function pe(Y,G,Z,ue,_e){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return Y=Y.get(Z)||null,$(G,Y,""+ue,_e);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case E:return Y=Y.get(ue.key===null?Z:ue.key)||null,V(G,Y,ue,_e);case L:return Y=Y.get(ue.key===null?Z:ue.key)||null,te(G,Y,ue,_e);case z:var Se=ue._init;return pe(Y,G,Z,Se(ue._payload),_e)}if(Qt(ue)||A(ue))return Y=Y.get(Z)||null,ae(G,Y,ue,_e,null);Ki(G,ue)}return null}function ge(Y,G,Z,ue){for(var _e=null,Se=null,we=G,Ce=G=0,Qe=null;we!==null&&Ce<Z.length;Ce++){we.index>Ce?(Qe=we,we=null):Qe=we.sibling;var Re=oe(Y,we,Z[Ce],ue);if(Re===null){we===null&&(we=Qe);break}e&&we&&Re.alternate===null&&t(Y,we),G=b(Re,G,Ce),Se===null?_e=Re:Se.sibling=Re,Se=Re,we=Qe}if(Ce===Z.length)return r(Y,we),Be&&Fr(Y,Ce),_e;if(we===null){for(;Ce<Z.length;Ce++)we=le(Y,Z[Ce],ue),we!==null&&(G=b(we,G,Ce),Se===null?_e=we:Se.sibling=we,Se=we);return Be&&Fr(Y,Ce),_e}for(we=s(Y,we);Ce<Z.length;Ce++)Qe=pe(we,Y,Ce,Z[Ce],ue),Qe!==null&&(e&&Qe.alternate!==null&&we.delete(Qe.key===null?Ce:Qe.key),G=b(Qe,G,Ce),Se===null?_e=Qe:Se.sibling=Qe,Se=Qe);return e&&we.forEach(function(Lr){return t(Y,Lr)}),Be&&Fr(Y,Ce),_e}function ve(Y,G,Z,ue){var _e=A(Z);if(typeof _e!="function")throw Error(p(150));if(Z=_e.call(Z),Z==null)throw Error(p(151));for(var Se=_e=null,we=G,Ce=G=0,Qe=null,Re=Z.next();we!==null&&!Re.done;Ce++,Re=Z.next()){we.index>Ce?(Qe=we,we=null):Qe=we.sibling;var Lr=oe(Y,we,Re.value,ue);if(Lr===null){we===null&&(we=Qe);break}e&&we&&Lr.alternate===null&&t(Y,we),G=b(Lr,G,Ce),Se===null?_e=Lr:Se.sibling=Lr,Se=Lr,we=Qe}if(Re.done)return r(Y,we),Be&&Fr(Y,Ce),_e;if(we===null){for(;!Re.done;Ce++,Re=Z.next())Re=le(Y,Re.value,ue),Re!==null&&(G=b(Re,G,Ce),Se===null?_e=Re:Se.sibling=Re,Se=Re);return Be&&Fr(Y,Ce),_e}for(we=s(Y,we);!Re.done;Ce++,Re=Z.next())Re=pe(we,Y,Ce,Re.value,ue),Re!==null&&(e&&Re.alternate!==null&&we.delete(Re.key===null?Ce:Re.key),G=b(Re,G,Ce),Se===null?_e=Re:Se.sibling=Re,Se=Re);return e&&we.forEach(function(Hf){return t(Y,Hf)}),Be&&Fr(Y,Ce),_e}function We(Y,G,Z,ue){if(typeof Z=="object"&&Z!==null&&Z.type===j&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case E:e:{for(var _e=Z.key,Se=G;Se!==null;){if(Se.key===_e){if(_e=Z.type,_e===j){if(Se.tag===7){r(Y,Se.sibling),G=f(Se,Z.props.children),G.return=Y,Y=G;break e}}else if(Se.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===z&&Sc(_e)===Se.type){r(Y,Se.sibling),G=f(Se,Z.props),G.ref=Js(Y,Se,Z),G.return=Y,Y=G;break e}r(Y,Se);break}else t(Y,Se);Se=Se.sibling}Z.type===j?(G=Kr(Z.props.children,Y.mode,ue,Z.key),G.return=Y,Y=G):(ue=_n(Z.type,Z.key,Z.props,null,Y.mode,ue),ue.ref=Js(Y,G,Z),ue.return=Y,Y=ue)}return M(Y);case L:e:{for(Se=Z.key;G!==null;){if(G.key===Se)if(G.tag===4&&G.stateNode.containerInfo===Z.containerInfo&&G.stateNode.implementation===Z.implementation){r(Y,G.sibling),G=f(G,Z.children||[]),G.return=Y,Y=G;break e}else{r(Y,G);break}else t(Y,G);G=G.sibling}G=ba(Z,Y.mode,ue),G.return=Y,Y=G}return M(Y);case z:return Se=Z._init,We(Y,G,Se(Z._payload),ue)}if(Qt(Z))return ge(Y,G,Z,ue);if(A(Z))return ve(Y,G,Z,ue);Ki(Y,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"?(Z=""+Z,G!==null&&G.tag===6?(r(Y,G.sibling),G=f(G,Z),G.return=Y,Y=G):(r(Y,G),G=xa(Z,Y.mode,ue),G.return=Y,Y=G),M(Y)):r(Y,G)}return We}var fs=wc(!0),xc=wc(!1),Gi=gr(null),Ji=null,ps=null,To=null;function Ao(){To=ps=Ji=null}function Mo(e){var t=Gi.current;Ie(Gi),e._currentValue=t}function Oo(e,t,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===r)break;e=e.return}}function ms(e,t){Ji=e,To=ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ht=!0),e.firstContext=null)}function kt(e){var t=e._currentValue;if(To!==e)if(e={context:e,memoizedValue:t,next:null},ps===null){if(Ji===null)throw Error(p(308));ps=e,Ji.dependencies={lanes:0,firstContext:e}}else ps=ps.next=e;return t}var Hr=null;function No(e){Hr===null?Hr=[e]:Hr.push(e)}function bc(e,t,r,s){var f=t.interleaved;return f===null?(r.next=r,No(t)):(r.next=f.next,f.next=r),t.interleaved=r,tr(e,s)}function tr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var yr=!1;function Io(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Cc(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 rr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Sr(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Le&2)!==0){var f=s.pending;return f===null?t.next=t:(t.next=f.next,f.next=t),s.pending=t,tr(e,r)}return f=s.interleaved,f===null?(t.next=t,No(s)):(t.next=f.next,f.next=t),s.interleaved=t,tr(e,r)}function Qi(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Qn(e,r)}}function kc(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var f=null,b=null;if(r=r.firstBaseUpdate,r!==null){do{var M={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};b===null?f=b=M:b=b.next=M,r=r.next}while(r!==null);b===null?f=b=t:b=b.next=t}else f=b=t;r={baseState:s.baseState,firstBaseUpdate:f,lastBaseUpdate:b,shared:s.shared,effects:s.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Xi(e,t,r,s){var f=e.updateQueue;yr=!1;var b=f.firstBaseUpdate,M=f.lastBaseUpdate,$=f.shared.pending;if($!==null){f.shared.pending=null;var V=$,te=V.next;V.next=null,M===null?b=te:M.next=te,M=V;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,$=ae.lastBaseUpdate,$!==M&&($===null?ae.firstBaseUpdate=te:$.next=te,ae.lastBaseUpdate=V))}if(b!==null){var le=f.baseState;M=0,ae=te=V=null,$=b;do{var oe=$.lane,pe=$.eventTime;if((s&oe)===oe){ae!==null&&(ae=ae.next={eventTime:pe,lane:0,tag:$.tag,payload:$.payload,callback:$.callback,next:null});e:{var ge=e,ve=$;switch(oe=t,pe=r,ve.tag){case 1:if(ge=ve.payload,typeof ge=="function"){le=ge.call(pe,le,oe);break e}le=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=ve.payload,oe=typeof ge=="function"?ge.call(pe,le,oe):ge,oe==null)break e;le=B({},le,oe);break e;case 2:yr=!0}}$.callback!==null&&$.lane!==0&&(e.flags|=64,oe=f.effects,oe===null?f.effects=[$]:oe.push($))}else pe={eventTime:pe,lane:oe,tag:$.tag,payload:$.payload,callback:$.callback,next:null},ae===null?(te=ae=pe,V=le):ae=ae.next=pe,M|=oe;if($=$.next,$===null){if($=f.shared.pending,$===null)break;oe=$,$=oe.next,oe.next=null,f.lastBaseUpdate=oe,f.shared.pending=null}}while(!0);if(ae===null&&(V=le),f.baseState=V,f.firstBaseUpdate=te,f.lastBaseUpdate=ae,t=f.shared.interleaved,t!==null){f=t;do M|=f.lane,f=f.next;while(f!==t)}else b===null&&(f.shared.lanes=0);Wr|=M,e.lanes=M,e.memoizedState=le}}function Ec(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],f=s.callback;if(f!==null){if(s.callback=null,s=r,typeof f!="function")throw Error(p(191,f));f.call(s)}}}var Qs={},zt=gr(Qs),Xs=gr(Qs),Ys=gr(Qs);function Ur(e){if(e===Qs)throw Error(p(174));return e}function Bo(e,t){switch(Ae(Ys,t),Ae(Xs,e),Ae(zt,Qs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ar(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ar(t,e)}Ie(zt),Ae(zt,t)}function gs(){Ie(zt),Ie(Xs),Ie(Ys)}function Lc(e){Ur(Ys.current);var t=Ur(zt.current),r=Ar(t,e.type);t!==r&&(Ae(Xs,e),Ae(zt,r))}function Fo(e){Xs.current===e&&(Ie(zt),Ie(Xs))}var Fe=gr(0);function Yi(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.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 Ho=[];function Uo(){for(var e=0;e<Ho.length;e++)Ho[e]._workInProgressVersionPrimary=null;Ho.length=0}var Zi=S.ReactCurrentDispatcher,$o=S.ReactCurrentBatchConfig,$r=0,He=null,Ve=null,Ge=null,en=!1,Zs=!1,ei=0,lf=0;function tt(){throw Error(p(321))}function Wo(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Mt(e[r],t[r]))return!1;return!0}function zo(e,t,r,s,f,b){if($r=b,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Zi.current=e===null||e.memoizedState===null?hf:ff,e=r(s,f),Zs){b=0;do{if(Zs=!1,ei=0,25<=b)throw Error(p(301));b+=1,Ge=Ve=null,t.updateQueue=null,Zi.current=pf,e=r(s,f)}while(Zs)}if(Zi.current=sn,t=Ve!==null&&Ve.next!==null,$r=0,Ge=Ve=He=null,en=!1,t)throw Error(p(300));return e}function Vo(){var e=ei!==0;return ei=0,e}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ge===null?He.memoizedState=Ge=e:Ge=Ge.next=e,Ge}function Et(){if(Ve===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=Ge===null?He.memoizedState:Ge.next;if(t!==null)Ge=t,Ve=e;else{if(e===null)throw Error(p(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},Ge===null?He.memoizedState=Ge=e:Ge=Ge.next=e}return Ge}function ti(e,t){return typeof t=="function"?t(e):t}function qo(e){var t=Et(),r=t.queue;if(r===null)throw Error(p(311));r.lastRenderedReducer=e;var s=Ve,f=s.baseQueue,b=r.pending;if(b!==null){if(f!==null){var M=f.next;f.next=b.next,b.next=M}s.baseQueue=f=b,r.pending=null}if(f!==null){b=f.next,s=s.baseState;var $=M=null,V=null,te=b;do{var ae=te.lane;if(($r&ae)===ae)V!==null&&(V=V.next={lane:0,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),s=te.hasEagerState?te.eagerState:e(s,te.action);else{var le={lane:ae,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null};V===null?($=V=le,M=s):V=V.next=le,He.lanes|=ae,Wr|=ae}te=te.next}while(te!==null&&te!==b);V===null?M=s:V.next=$,Mt(s,t.memoizedState)||(ht=!0),t.memoizedState=s,t.baseState=M,t.baseQueue=V,r.lastRenderedState=s}if(e=r.interleaved,e!==null){f=e;do b=f.lane,He.lanes|=b,Wr|=b,f=f.next;while(f!==e)}else f===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ko(e){var t=Et(),r=t.queue;if(r===null)throw Error(p(311));r.lastRenderedReducer=e;var s=r.dispatch,f=r.pending,b=t.memoizedState;if(f!==null){r.pending=null;var M=f=f.next;do b=e(b,M.action),M=M.next;while(M!==f);Mt(b,t.memoizedState)||(ht=!0),t.memoizedState=b,t.baseQueue===null&&(t.baseState=b),r.lastRenderedState=b}return[b,s]}function Rc(){}function jc(e,t){var r=He,s=Et(),f=t(),b=!Mt(s.memoizedState,f);if(b&&(s.memoizedState=f,ht=!0),s=s.queue,Go(Tc.bind(null,r,s,e),[e]),s.getSnapshot!==t||b||Ge!==null&&Ge.memoizedState.tag&1){if(r.flags|=2048,ri(9,Pc.bind(null,r,s,f,t),void 0,null),Je===null)throw Error(p(349));($r&30)!==0||Dc(r,t,f)}return f}function Dc(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=He.updateQueue,t===null?(t={lastEffect:null,stores:null},He.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Pc(e,t,r,s){t.value=r,t.getSnapshot=s,Ac(t)&&Mc(e)}function Tc(e,t,r){return r(function(){Ac(t)&&Mc(e)})}function Ac(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Mt(e,r)}catch{return!0}}function Mc(e){var t=tr(e,1);t!==null&&Ft(t,e,1,-1)}function Oc(e){var t=Vt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:e},t.queue=e,e=e.dispatch=df.bind(null,He,e),[t.memoizedState,e]}function ri(e,t,r,s){return e={tag:e,create:t,destroy:r,deps:s,next:null},t=He.updateQueue,t===null?(t={lastEffect:null,stores:null},He.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,t.lastEffect=e)),e}function Nc(){return Et().memoizedState}function tn(e,t,r,s){var f=Vt();He.flags|=e,f.memoizedState=ri(1|t,r,void 0,s===void 0?null:s)}function rn(e,t,r,s){var f=Et();s=s===void 0?null:s;var b=void 0;if(Ve!==null){var M=Ve.memoizedState;if(b=M.destroy,s!==null&&Wo(s,M.deps)){f.memoizedState=ri(t,r,b,s);return}}He.flags|=e,f.memoizedState=ri(1|t,r,b,s)}function Ic(e,t){return tn(8390656,8,e,t)}function Go(e,t){return rn(2048,8,e,t)}function Bc(e,t){return rn(4,2,e,t)}function Fc(e,t){return rn(4,4,e,t)}function Hc(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 Uc(e,t,r){return r=r!=null?r.concat([e]):null,rn(4,4,Hc.bind(null,t,e),r)}function Jo(){}function $c(e,t){var r=Et();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&Wo(t,s[1])?s[0]:(r.memoizedState=[e,t],e)}function Wc(e,t){var r=Et();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&Wo(t,s[1])?s[0]:(e=e(),r.memoizedState=[e,t],e)}function zc(e,t,r){return($r&21)===0?(e.baseState&&(e.baseState=!1,ht=!0),e.memoizedState=r):(Mt(r,t)||(r=Sl(),He.lanes|=r,Wr|=r,e.baseState=!0),t)}function cf(e,t){var r=De;De=r!==0&&4>r?r:4,e(!0);var s=$o.transition;$o.transition={};try{e(!1),t()}finally{De=r,$o.transition=s}}function Vc(){return Et().memoizedState}function uf(e,t,r){var s=Cr(e);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},qc(e))Kc(t,r);else if(r=bc(e,t,r,s),r!==null){var f=at();Ft(r,e,s,f),Gc(r,t,s)}}function df(e,t,r){var s=Cr(e),f={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(qc(e))Kc(t,f);else{var b=e.alternate;if(e.lanes===0&&(b===null||b.lanes===0)&&(b=t.lastRenderedReducer,b!==null))try{var M=t.lastRenderedState,$=b(M,r);if(f.hasEagerState=!0,f.eagerState=$,Mt($,M)){var V=t.interleaved;V===null?(f.next=f,No(t)):(f.next=V.next,V.next=f),t.interleaved=f;return}}catch{}finally{}r=bc(e,t,f,s),r!==null&&(f=at(),Ft(r,e,s,f),Gc(r,t,s))}}function qc(e){var t=e.alternate;return e===He||t!==null&&t===He}function Kc(e,t){Zs=en=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Gc(e,t,r){if((r&4194240)!==0){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Qn(e,r)}}var sn={readContext:kt,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useInsertionEffect:tt,useLayoutEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useMutableSource:tt,useSyncExternalStore:tt,useId:tt,unstable_isNewReconciler:!1},hf={readContext:kt,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:kt,useEffect:Ic,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,tn(4194308,4,Hc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return tn(4194308,4,e,t)},useInsertionEffect:function(e,t){return tn(4,2,e,t)},useMemo:function(e,t){var r=Vt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=Vt();return t=r!==void 0?r(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=uf.bind(null,He,e),[s.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:Oc,useDebugValue:Jo,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=Oc(!1),t=e[0];return e=cf.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=He,f=Vt();if(Be){if(r===void 0)throw Error(p(407));r=r()}else{if(r=t(),Je===null)throw Error(p(349));($r&30)!==0||Dc(s,t,r)}f.memoizedState=r;var b={value:r,getSnapshot:t};return f.queue=b,Ic(Tc.bind(null,s,b,e),[e]),s.flags|=2048,ri(9,Pc.bind(null,s,b,r,t),void 0,null),r},useId:function(){var e=Vt(),t=Je.identifierPrefix;if(Be){var r=er,s=Zt;r=(s&~(1<<32-At(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=ei++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=lf++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ff={readContext:kt,useCallback:$c,useContext:kt,useEffect:Go,useImperativeHandle:Uc,useInsertionEffect:Bc,useLayoutEffect:Fc,useMemo:Wc,useReducer:qo,useRef:Nc,useState:function(){return qo(ti)},useDebugValue:Jo,useDeferredValue:function(e){var t=Et();return zc(t,Ve.memoizedState,e)},useTransition:function(){var e=qo(ti)[0],t=Et().memoizedState;return[e,t]},useMutableSource:Rc,useSyncExternalStore:jc,useId:Vc,unstable_isNewReconciler:!1},pf={readContext:kt,useCallback:$c,useContext:kt,useEffect:Go,useImperativeHandle:Uc,useInsertionEffect:Bc,useLayoutEffect:Fc,useMemo:Wc,useReducer:Ko,useRef:Nc,useState:function(){return Ko(ti)},useDebugValue:Jo,useDeferredValue:function(e){var t=Et();return Ve===null?t.memoizedState=e:zc(t,Ve.memoizedState,e)},useTransition:function(){var e=Ko(ti)[0],t=Et().memoizedState;return[e,t]},useMutableSource:Rc,useSyncExternalStore:jc,useId:Vc,unstable_isNewReconciler:!1};function Nt(e,t){if(e&&e.defaultProps){t=B({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Qo(e,t,r,s){t=e.memoizedState,r=r(s,t),r=r==null?t:B({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var nn={isMounted:function(e){return(e=e._reactInternals)?Or(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var s=at(),f=Cr(e),b=rr(s,f);b.payload=t,r!=null&&(b.callback=r),t=Sr(e,b,f),t!==null&&(Ft(t,e,f,s),Qi(t,e,f))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var s=at(),f=Cr(e),b=rr(s,f);b.tag=1,b.payload=t,r!=null&&(b.callback=r),t=Sr(e,b,f),t!==null&&(Ft(t,e,f,s),Qi(t,e,f))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=at(),s=Cr(e),f=rr(r,s);f.tag=2,t!=null&&(f.callback=t),t=Sr(e,f,s),t!==null&&(Ft(t,e,s,r),Qi(t,e,s))}};function Jc(e,t,r,s,f,b,M){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,b,M):t.prototype&&t.prototype.isPureReactComponent?!$s(r,s)||!$s(f,b):!0}function Qc(e,t,r){var s=!1,f=vr,b=t.contextType;return typeof b=="object"&&b!==null?b=kt(b):(f=dt(t)?Ir:et.current,s=t.contextTypes,b=(s=s!=null)?cs(e,f):vr),t=new t(r,b),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=nn,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=f,e.__reactInternalMemoizedMaskedChildContext=b),t}function Xc(e,t,r,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,s),t.state!==e&&nn.enqueueReplaceState(t,t.state,null)}function Xo(e,t,r,s){var f=e.stateNode;f.props=r,f.state=e.memoizedState,f.refs={},Io(e);var b=t.contextType;typeof b=="object"&&b!==null?f.context=kt(b):(b=dt(t)?Ir:et.current,f.context=cs(e,b)),f.state=e.memoizedState,b=t.getDerivedStateFromProps,typeof b=="function"&&(Qo(e,t,b,r),f.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(t=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),t!==f.state&&nn.enqueueReplaceState(f,f.state,null),Xi(e,r,f,s),f.state=e.memoizedState),typeof f.componentDidMount=="function"&&(e.flags|=4194308)}function vs(e,t){try{var r="",s=t;do r+=ce(s),s=s.return;while(s);var f=r}catch(b){f=`
|
|
40
|
-
Error generating stack: `+b.message+`
|
|
41
|
-
`+b.stack}return{value:e,source:t,stack:f,digest:null}}function Yo(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Zo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var mf=typeof WeakMap=="function"?WeakMap:Map;function Yc(e,t,r){r=rr(-1,r),r.tag=3,r.payload={element:null};var s=t.value;return r.callback=function(){hn||(hn=!0,pa=s),Zo(e,t)},r}function Zc(e,t,r){r=rr(-1,r),r.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var f=t.value;r.payload=function(){return s(f)},r.callback=function(){Zo(e,t)}}var b=e.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(r.callback=function(){Zo(e,t),typeof s!="function"&&(xr===null?xr=new Set([this]):xr.add(this));var M=t.stack;this.componentDidCatch(t.value,{componentStack:M!==null?M:""})}),r}function eu(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new mf;var f=new Set;s.set(t,f)}else f=s.get(t),f===void 0&&(f=new Set,s.set(t,f));f.has(r)||(f.add(r),e=jf.bind(null,e,t,r),t.then(e,e))}function tu(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 ru(e,t,r,s,f){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=rr(-1,1),t.tag=2,Sr(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var gf=S.ReactCurrentOwner,ht=!1;function ot(e,t,r,s){t.child=e===null?xc(t,null,r,s):fs(t,e.child,r,s)}function su(e,t,r,s,f){r=r.render;var b=t.ref;return ms(t,f),s=zo(e,t,r,s,b,f),r=Vo(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~f,sr(e,t,f)):(Be&&r&&Lo(t),t.flags|=1,ot(e,t,s,f),t.child)}function iu(e,t,r,s,f){if(e===null){var b=r.type;return typeof b=="function"&&!wa(b)&&b.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=b,nu(e,t,b,s,f)):(e=_n(r.type,null,s,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(b=e.child,(e.lanes&f)===0){var M=b.memoizedProps;if(r=r.compare,r=r!==null?r:$s,r(M,s)&&e.ref===t.ref)return sr(e,t,f)}return t.flags|=1,e=Er(b,s),e.ref=t.ref,e.return=t,t.child=e}function nu(e,t,r,s,f){if(e!==null){var b=e.memoizedProps;if($s(b,s)&&e.ref===t.ref)if(ht=!1,t.pendingProps=s=b,(e.lanes&f)!==0)(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,sr(e,t,f)}return ea(e,t,r,s,f)}function ou(e,t,r){var s=t.pendingProps,f=s.children,b=e!==null?e.memoizedState:null;if(s.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ae(ys,wt),wt|=r;else{if((r&1073741824)===0)return e=b!==null?b.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ae(ys,wt),wt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=b!==null?b.baseLanes:r,Ae(ys,wt),wt|=s}else b!==null?(s=b.baseLanes|r,t.memoizedState=null):s=r,Ae(ys,wt),wt|=s;return ot(e,t,f,r),t.child}function au(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function ea(e,t,r,s,f){var b=dt(r)?Ir:et.current;return b=cs(t,b),ms(t,f),r=zo(e,t,r,s,b,f),s=Vo(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~f,sr(e,t,f)):(Be&&s&&Lo(t),t.flags|=1,ot(e,t,r,f),t.child)}function lu(e,t,r,s,f){if(dt(r)){var b=!0;$i(t)}else b=!1;if(ms(t,f),t.stateNode===null)an(e,t),Qc(t,r,s),Xo(t,r,s,f),s=!0;else if(e===null){var M=t.stateNode,$=t.memoizedProps;M.props=$;var V=M.context,te=r.contextType;typeof te=="object"&&te!==null?te=kt(te):(te=dt(r)?Ir:et.current,te=cs(t,te));var ae=r.getDerivedStateFromProps,le=typeof ae=="function"||typeof M.getSnapshotBeforeUpdate=="function";le||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||($!==s||V!==te)&&Xc(t,M,s,te),yr=!1;var oe=t.memoizedState;M.state=oe,Xi(t,s,M,f),V=t.memoizedState,$!==s||oe!==V||ut.current||yr?(typeof ae=="function"&&(Qo(t,r,ae,s),V=t.memoizedState),($=yr||Jc(t,r,$,s,oe,V,te))?(le||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(t.flags|=4194308)):(typeof M.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=V),M.props=s,M.state=V,M.context=te,s=$):(typeof M.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{M=t.stateNode,Cc(e,t),$=t.memoizedProps,te=t.type===t.elementType?$:Nt(t.type,$),M.props=te,le=t.pendingProps,oe=M.context,V=r.contextType,typeof V=="object"&&V!==null?V=kt(V):(V=dt(r)?Ir:et.current,V=cs(t,V));var pe=r.getDerivedStateFromProps;(ae=typeof pe=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||($!==le||oe!==V)&&Xc(t,M,s,V),yr=!1,oe=t.memoizedState,M.state=oe,Xi(t,s,M,f);var ge=t.memoizedState;$!==le||oe!==ge||ut.current||yr?(typeof pe=="function"&&(Qo(t,r,pe,s),ge=t.memoizedState),(te=yr||Jc(t,r,te,s,oe,ge,V)||!1)?(ae||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(s,ge,V),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(s,ge,V)),typeof M.componentDidUpdate=="function"&&(t.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof M.componentDidUpdate!="function"||$===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||$===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ge),M.props=s,M.state=ge,M.context=V,s=te):(typeof M.componentDidUpdate!="function"||$===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||$===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),s=!1)}return ta(e,t,r,s,b,f)}function ta(e,t,r,s,f,b){au(e,t);var M=(t.flags&128)!==0;if(!s&&!M)return f&&fc(t,r,!1),sr(e,t,b);s=t.stateNode,gf.current=t;var $=M&&typeof r.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&M?(t.child=fs(t,e.child,null,b),t.child=fs(t,null,$,b)):ot(e,t,$,b),t.memoizedState=s.state,f&&fc(t,r,!0),t.child}function cu(e){var t=e.stateNode;t.pendingContext?dc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&dc(e,t.context,!1),Bo(e,t.containerInfo)}function uu(e,t,r,s,f){return hs(),Po(f),t.flags|=256,ot(e,t,r,s),t.child}var ra={dehydrated:null,treeContext:null,retryLane:0};function sa(e){return{baseLanes:e,cachePool:null,transitions:null}}function du(e,t,r){var s=t.pendingProps,f=Fe.current,b=!1,M=(t.flags&128)!==0,$;if(($=M)||($=e!==null&&e.memoizedState===null?!1:(f&2)!==0),$?(b=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(f|=1),Ae(Fe,f&1),e===null)return Do(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):(M=s.children,e=s.fallback,b?(s=t.mode,b=t.child,M={mode:"hidden",children:M},(s&1)===0&&b!==null?(b.childLanes=0,b.pendingProps=M):b=yn(M,s,0,null),e=Kr(e,s,r,null),b.return=t,e.return=t,b.sibling=e,t.child=b,t.child.memoizedState=sa(r),t.memoizedState=ra,e):ia(t,M));if(f=e.memoizedState,f!==null&&($=f.dehydrated,$!==null))return vf(e,t,M,s,$,f,r);if(b){b=s.fallback,M=t.mode,f=e.child,$=f.sibling;var V={mode:"hidden",children:s.children};return(M&1)===0&&t.child!==f?(s=t.child,s.childLanes=0,s.pendingProps=V,t.deletions=null):(s=Er(f,V),s.subtreeFlags=f.subtreeFlags&14680064),$!==null?b=Er($,b):(b=Kr(b,M,r,null),b.flags|=2),b.return=t,s.return=t,s.sibling=b,t.child=s,s=b,b=t.child,M=e.child.memoizedState,M=M===null?sa(r):{baseLanes:M.baseLanes|r,cachePool:null,transitions:M.transitions},b.memoizedState=M,b.childLanes=e.childLanes&~r,t.memoizedState=ra,s}return b=e.child,e=b.sibling,s=Er(b,{mode:"visible",children:s.children}),(t.mode&1)===0&&(s.lanes=r),s.return=t,s.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=s,t.memoizedState=null,s}function ia(e,t){return t=yn({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function on(e,t,r,s){return s!==null&&Po(s),fs(t,e.child,null,r),e=ia(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vf(e,t,r,s,f,b,M){if(r)return t.flags&256?(t.flags&=-257,s=Yo(Error(p(422))),on(e,t,M,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(b=s.fallback,f=t.mode,s=yn({mode:"visible",children:s.children},f,0,null),b=Kr(b,f,M,null),b.flags|=2,s.return=t,b.return=t,s.sibling=b,t.child=s,(t.mode&1)!==0&&fs(t,e.child,null,M),t.child.memoizedState=sa(M),t.memoizedState=ra,b);if((t.mode&1)===0)return on(e,t,M,null);if(f.data==="$!"){if(s=f.nextSibling&&f.nextSibling.dataset,s)var $=s.dgst;return s=$,b=Error(p(419)),s=Yo(b,s,void 0),on(e,t,M,s)}if($=(M&e.childLanes)!==0,ht||$){if(s=Je,s!==null){switch(M&-M){case 4:f=2;break;case 16:f=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:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(s.suspendedLanes|M))!==0?0:f,f!==0&&f!==b.retryLane&&(b.retryLane=f,tr(e,f),Ft(s,e,f,-1))}return Sa(),s=Yo(Error(p(421))),on(e,t,M,s)}return f.data==="$?"?(t.flags|=128,t.child=e.child,t=Df.bind(null,e),f._reactRetry=t,null):(e=b.treeContext,St=mr(f.nextSibling),yt=t,Be=!0,Ot=null,e!==null&&(bt[Ct++]=Zt,bt[Ct++]=er,bt[Ct++]=Br,Zt=e.id,er=e.overflow,Br=t),t=ia(t,s.children),t.flags|=4096,t)}function hu(e,t,r){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Oo(e.return,t,r)}function na(e,t,r,s,f){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:f}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=r,b.tailMode=f)}function fu(e,t,r){var s=t.pendingProps,f=s.revealOrder,b=s.tail;if(ot(e,t,s.children,r),s=Fe.current,(s&2)!==0)s=s&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&&hu(e,r,t);else if(e.tag===19)hu(e,r,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}s&=1}if(Ae(Fe,s),(t.mode&1)===0)t.memoizedState=null;else switch(f){case"forwards":for(r=t.child,f=null;r!==null;)e=r.alternate,e!==null&&Yi(e)===null&&(f=r),r=r.sibling;r=f,r===null?(f=t.child,t.child=null):(f=r.sibling,r.sibling=null),na(t,!1,f,r,b);break;case"backwards":for(r=null,f=t.child,t.child=null;f!==null;){if(e=f.alternate,e!==null&&Yi(e)===null){t.child=f;break}e=f.sibling,f.sibling=r,r=f,f=e}na(t,!0,r,null,b);break;case"together":na(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function an(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Wr|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(p(153));if(t.child!==null){for(e=t.child,r=Er(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Er(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function _f(e,t,r){switch(t.tag){case 3:cu(t),hs();break;case 5:Lc(t);break;case 1:dt(t.type)&&$i(t);break;case 4:Bo(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,f=t.memoizedProps.value;Ae(Gi,s._currentValue),s._currentValue=f;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(Ae(Fe,Fe.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?du(e,t,r):(Ae(Fe,Fe.current&1),e=sr(e,t,r),e!==null?e.sibling:null);Ae(Fe,Fe.current&1);break;case 19:if(s=(r&t.childLanes)!==0,(e.flags&128)!==0){if(s)return fu(e,t,r);t.flags|=128}if(f=t.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ae(Fe,Fe.current),s)break;return null;case 22:case 23:return t.lanes=0,ou(e,t,r)}return sr(e,t,r)}var pu,oa,mu,gu;pu=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},oa=function(){},mu=function(e,t,r,s){var f=e.memoizedProps;if(f!==s){e=t.stateNode,Ur(zt.current);var b=null;switch(r){case"input":f=Te(e,f),s=Te(e,s),b=[];break;case"select":f=B({},f,{value:void 0}),s=B({},s,{value:void 0}),b=[];break;case"textarea":f=or(e,f),s=or(e,s),b=[];break;default:typeof f.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Fi)}Fn(r,s);var M;r=null;for(te in f)if(!s.hasOwnProperty(te)&&f.hasOwnProperty(te)&&f[te]!=null)if(te==="style"){var $=f[te];for(M in $)$.hasOwnProperty(M)&&(r||(r={}),r[M]="")}else te!=="dangerouslySetInnerHTML"&&te!=="children"&&te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&te!=="autoFocus"&&(P.hasOwnProperty(te)?b||(b=[]):(b=b||[]).push(te,null));for(te in s){var V=s[te];if($=f!=null?f[te]:void 0,s.hasOwnProperty(te)&&V!==$&&(V!=null||$!=null))if(te==="style")if($){for(M in $)!$.hasOwnProperty(M)||V&&V.hasOwnProperty(M)||(r||(r={}),r[M]="");for(M in V)V.hasOwnProperty(M)&&$[M]!==V[M]&&(r||(r={}),r[M]=V[M])}else r||(b||(b=[]),b.push(te,r)),r=V;else te==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,$=$?$.__html:void 0,V!=null&&$!==V&&(b=b||[]).push(te,V)):te==="children"?typeof V!="string"&&typeof V!="number"||(b=b||[]).push(te,""+V):te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&(P.hasOwnProperty(te)?(V!=null&&te==="onScroll"&&Ne("scroll",e),b||$===V||(b=[])):(b=b||[]).push(te,V))}r&&(b=b||[]).push("style",r);var te=b;(t.updateQueue=te)&&(t.flags|=4)}},gu=function(e,t,r,s){r!==s&&(t.flags|=4)};function si(e,t){if(!Be)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function rt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(t)for(var f=e.child;f!==null;)r|=f.lanes|f.childLanes,s|=f.subtreeFlags&14680064,s|=f.flags&14680064,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)r|=f.lanes|f.childLanes,s|=f.subtreeFlags,s|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=s,e.childLanes=r,t}function yf(e,t,r){var s=t.pendingProps;switch(Ro(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rt(t),null;case 1:return dt(t.type)&&Ui(),rt(t),null;case 3:return s=t.stateNode,gs(),Ie(ut),Ie(et),Uo(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(qi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ot!==null&&(va(Ot),Ot=null))),oa(e,t),rt(t),null;case 5:Fo(t);var f=Ur(Ys.current);if(r=t.type,e!==null&&t.stateNode!=null)mu(e,t,r,s,f),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(p(166));return rt(t),null}if(e=Ur(zt.current),qi(t)){s=t.stateNode,r=t.type;var b=t.memoizedProps;switch(s[Wt]=t,s[Ks]=b,e=(t.mode&1)!==0,r){case"dialog":Ne("cancel",s),Ne("close",s);break;case"iframe":case"object":case"embed":Ne("load",s);break;case"video":case"audio":for(f=0;f<zs.length;f++)Ne(zs[f],s);break;case"source":Ne("error",s);break;case"img":case"image":case"link":Ne("error",s),Ne("load",s);break;case"details":Ne("toggle",s);break;case"input":Me(s,b),Ne("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!b.multiple},Ne("invalid",s);break;case"textarea":nt(s,b),Ne("invalid",s)}Fn(r,b),f=null;for(var M in b)if(b.hasOwnProperty(M)){var $=b[M];M==="children"?typeof $=="string"?s.textContent!==$&&(b.suppressHydrationWarning!==!0&&Bi(s.textContent,$,e),f=["children",$]):typeof $=="number"&&s.textContent!==""+$&&(b.suppressHydrationWarning!==!0&&Bi(s.textContent,$,e),f=["children",""+$]):P.hasOwnProperty(M)&&$!=null&&M==="onScroll"&&Ne("scroll",s)}switch(r){case"input":fe(s),nr(s,b,!0);break;case"textarea":fe(s),gt(s);break;case"select":case"option":break;default:typeof b.onClick=="function"&&(s.onclick=Fi)}s=f,t.updateQueue=s,s!==null&&(t.flags|=4)}else{M=f.nodeType===9?f:f.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=lr(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=M.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=M.createElement(r,{is:s.is}):(e=M.createElement(r),r==="select"&&(M=e,s.multiple?M.multiple=!0:s.size&&(M.size=s.size))):e=M.createElementNS(e,r),e[Wt]=t,e[Ks]=s,pu(e,t,!1,!1),t.stateNode=e;e:{switch(M=Hn(r,s),r){case"dialog":Ne("cancel",e),Ne("close",e),f=s;break;case"iframe":case"object":case"embed":Ne("load",e),f=s;break;case"video":case"audio":for(f=0;f<zs.length;f++)Ne(zs[f],e);f=s;break;case"source":Ne("error",e),f=s;break;case"img":case"image":case"link":Ne("error",e),Ne("load",e),f=s;break;case"details":Ne("toggle",e),f=s;break;case"input":Me(e,s),f=Te(e,s),Ne("invalid",e);break;case"option":f=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},f=B({},s,{value:void 0}),Ne("invalid",e);break;case"textarea":nt(e,s),f=or(e,s),Ne("invalid",e);break;default:f=s}Fn(r,f),$=f;for(b in $)if($.hasOwnProperty(b)){var V=$[b];b==="style"?nl(e,V):b==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,V!=null&&Mr(e,V)):b==="children"?typeof V=="string"?(r!=="textarea"||V!=="")&&ct(e,V):typeof V=="number"&&ct(e,""+V):b!=="suppressContentEditableWarning"&&b!=="suppressHydrationWarning"&&b!=="autoFocus"&&(P.hasOwnProperty(b)?V!=null&&b==="onScroll"&&Ne("scroll",e):V!=null&&a(e,b,V,M))}switch(r){case"input":fe(e),nr(e,s,!1);break;case"textarea":fe(e),gt(e);break;case"option":s.value!=null&&e.setAttribute("value",""+N(s.value));break;case"select":e.multiple=!!s.multiple,b=s.value,b!=null?Ut(e,!!s.multiple,b,!1):s.defaultValue!=null&&Ut(e,!!s.multiple,s.defaultValue,!0);break;default:typeof f.onClick=="function"&&(e.onclick=Fi)}switch(r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return rt(t),null;case 6:if(e&&t.stateNode!=null)gu(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(p(166));if(r=Ur(Ys.current),Ur(zt.current),qi(t)){if(s=t.stateNode,r=t.memoizedProps,s[Wt]=t,(b=s.nodeValue!==r)&&(e=yt,e!==null))switch(e.tag){case 3:Bi(s.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Bi(s.nodeValue,r,(e.mode&1)!==0)}b&&(t.flags|=4)}else s=(r.nodeType===9?r:r.ownerDocument).createTextNode(s),s[Wt]=t,t.stateNode=s}return rt(t),null;case 13:if(Ie(Fe),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Be&&St!==null&&(t.mode&1)!==0&&(t.flags&128)===0)yc(),hs(),t.flags|=98560,b=!1;else if(b=qi(t),s!==null&&s.dehydrated!==null){if(e===null){if(!b)throw Error(p(318));if(b=t.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(p(317));b[Wt]=t}else hs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;rt(t),b=!1}else Ot!==null&&(va(Ot),Ot=null),b=!0;if(!b)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Fe.current&1)!==0?qe===0&&(qe=3):Sa())),t.updateQueue!==null&&(t.flags|=4),rt(t),null);case 4:return gs(),oa(e,t),e===null&&Vs(t.stateNode.containerInfo),rt(t),null;case 10:return Mo(t.type._context),rt(t),null;case 17:return dt(t.type)&&Ui(),rt(t),null;case 19:if(Ie(Fe),b=t.memoizedState,b===null)return rt(t),null;if(s=(t.flags&128)!==0,M=b.rendering,M===null)if(s)si(b,!1);else{if(qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(M=Yi(e),M!==null){for(t.flags|=128,si(b,!1),s=M.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=r,r=t.child;r!==null;)b=r,e=s,b.flags&=14680066,M=b.alternate,M===null?(b.childLanes=0,b.lanes=e,b.child=null,b.subtreeFlags=0,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null,b.stateNode=null):(b.childLanes=M.childLanes,b.lanes=M.lanes,b.child=M.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=M.memoizedProps,b.memoizedState=M.memoizedState,b.updateQueue=M.updateQueue,b.type=M.type,e=M.dependencies,b.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ae(Fe,Fe.current&1|2),t.child}e=e.sibling}b.tail!==null&&$e()>Ss&&(t.flags|=128,s=!0,si(b,!1),t.lanes=4194304)}else{if(!s)if(e=Yi(M),e!==null){if(t.flags|=128,s=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),si(b,!0),b.tail===null&&b.tailMode==="hidden"&&!M.alternate&&!Be)return rt(t),null}else 2*$e()-b.renderingStartTime>Ss&&r!==1073741824&&(t.flags|=128,s=!0,si(b,!1),t.lanes=4194304);b.isBackwards?(M.sibling=t.child,t.child=M):(r=b.last,r!==null?r.sibling=M:t.child=M,b.last=M)}return b.tail!==null?(t=b.tail,b.rendering=t,b.tail=t.sibling,b.renderingStartTime=$e(),t.sibling=null,r=Fe.current,Ae(Fe,s?r&1|2:r&1),t):(rt(t),null);case 22:case 23:return ya(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&(t.mode&1)!==0?(wt&1073741824)!==0&&(rt(t),t.subtreeFlags&6&&(t.flags|=8192)):rt(t),null;case 24:return null;case 25:return null}throw Error(p(156,t.tag))}function Sf(e,t){switch(Ro(t),t.tag){case 1:return dt(t.type)&&Ui(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return gs(),Ie(ut),Ie(et),Uo(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Fo(t),null;case 13:if(Ie(Fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(p(340));hs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(Fe),null;case 4:return gs(),null;case 10:return Mo(t.type._context),null;case 22:case 23:return ya(),null;case 24:return null;default:return null}}var ln=!1,st=!1,wf=typeof WeakSet=="function"?WeakSet:Set,me=null;function _s(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){Ue(e,t,s)}else r.current=null}function aa(e,t,r){try{r()}catch(s){Ue(e,t,s)}}var vu=!1;function xf(e,t){if(yo=Li,e=Jl(),uo(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var f=s.anchorOffset,b=s.focusNode;s=s.focusOffset;try{r.nodeType,b.nodeType}catch{r=null;break e}var M=0,$=-1,V=-1,te=0,ae=0,le=e,oe=null;t:for(;;){for(var pe;le!==r||f!==0&&le.nodeType!==3||($=M+f),le!==b||s!==0&&le.nodeType!==3||(V=M+s),le.nodeType===3&&(M+=le.nodeValue.length),(pe=le.firstChild)!==null;)oe=le,le=pe;for(;;){if(le===e)break t;if(oe===r&&++te===f&&($=M),oe===b&&++ae===s&&(V=M),(pe=le.nextSibling)!==null)break;le=oe,oe=le.parentNode}le=pe}r=$===-1||V===-1?null:{start:$,end:V}}else r=null}r=r||{start:0,end:0}}else r=null;for(So={focusedElem:e,selectionRange:r},Li=!1,me=t;me!==null;)if(t=me,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,me=e;else for(;me!==null;){t=me;try{var ge=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ge!==null){var ve=ge.memoizedProps,We=ge.memoizedState,Y=t.stateNode,G=Y.getSnapshotBeforeUpdate(t.elementType===t.type?ve:Nt(t.type,ve),We);Y.__reactInternalSnapshotBeforeUpdate=G}break;case 3:var Z=t.stateNode.containerInfo;Z.nodeType===1?Z.textContent="":Z.nodeType===9&&Z.documentElement&&Z.removeChild(Z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163))}}catch(ue){Ue(t,t.return,ue)}if(e=t.sibling,e!==null){e.return=t.return,me=e;break}me=t.return}return ge=vu,vu=!1,ge}function ii(e,t,r){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var f=s=s.next;do{if((f.tag&e)===e){var b=f.destroy;f.destroy=void 0,b!==void 0&&aa(t,r,b)}f=f.next}while(f!==s)}}function cn(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var s=r.create;r.destroy=s()}r=r.next}while(r!==t)}}function la(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function _u(e){var t=e.alternate;t!==null&&(e.alternate=null,_u(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wt],delete t[Ks],delete t[Co],delete t[sf],delete t[nf])),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 yu(e){return e.tag===5||e.tag===3||e.tag===4}function Su(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yu(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 ca(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Fi));else if(s!==4&&(e=e.child,e!==null))for(ca(e,t,r),e=e.sibling;e!==null;)ca(e,t,r),e=e.sibling}function ua(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(ua(e,t,r),e=e.sibling;e!==null;)ua(e,t,r),e=e.sibling}var Ye=null,It=!1;function wr(e,t,r){for(r=r.child;r!==null;)wu(e,t,r),r=r.sibling}function wu(e,t,r){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(wi,r)}catch{}switch(r.tag){case 5:st||_s(r,t);case 6:var s=Ye,f=It;Ye=null,wr(e,t,r),Ye=s,It=f,Ye!==null&&(It?(e=Ye,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ye.removeChild(r.stateNode));break;case 18:Ye!==null&&(It?(e=Ye,r=r.stateNode,e.nodeType===8?bo(e.parentNode,r):e.nodeType===1&&bo(e,r),Ns(e)):bo(Ye,r.stateNode));break;case 4:s=Ye,f=It,Ye=r.stateNode.containerInfo,It=!0,wr(e,t,r),Ye=s,It=f;break;case 0:case 11:case 14:case 15:if(!st&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){f=s=s.next;do{var b=f,M=b.destroy;b=b.tag,M!==void 0&&((b&2)!==0||(b&4)!==0)&&aa(r,t,M),f=f.next}while(f!==s)}wr(e,t,r);break;case 1:if(!st&&(_s(r,t),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch($){Ue(r,t,$)}wr(e,t,r);break;case 21:wr(e,t,r);break;case 22:r.mode&1?(st=(s=st)||r.memoizedState!==null,wr(e,t,r),st=s):wr(e,t,r);break;default:wr(e,t,r)}}function xu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new wf),t.forEach(function(s){var f=Pf.bind(null,e,s);r.has(s)||(r.add(s),s.then(f,f))})}}function Bt(e,t){var r=t.deletions;if(r!==null)for(var s=0;s<r.length;s++){var f=r[s];try{var b=e,M=t,$=M;e:for(;$!==null;){switch($.tag){case 5:Ye=$.stateNode,It=!1;break e;case 3:Ye=$.stateNode.containerInfo,It=!0;break e;case 4:Ye=$.stateNode.containerInfo,It=!0;break e}$=$.return}if(Ye===null)throw Error(p(160));wu(b,M,f),Ye=null,It=!1;var V=f.alternate;V!==null&&(V.return=null),f.return=null}catch(te){Ue(f,t,te)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bu(t,e),t=t.sibling}function bu(e,t){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Bt(t,e),qt(e),s&4){try{ii(3,e,e.return),cn(3,e)}catch(ve){Ue(e,e.return,ve)}try{ii(5,e,e.return)}catch(ve){Ue(e,e.return,ve)}}break;case 1:Bt(t,e),qt(e),s&512&&r!==null&&_s(r,r.return);break;case 5:if(Bt(t,e),qt(e),s&512&&r!==null&&_s(r,r.return),e.flags&32){var f=e.stateNode;try{ct(f,"")}catch(ve){Ue(e,e.return,ve)}}if(s&4&&(f=e.stateNode,f!=null)){var b=e.memoizedProps,M=r!==null?r.memoizedProps:b,$=e.type,V=e.updateQueue;if(e.updateQueue=null,V!==null)try{$==="input"&&b.type==="radio"&&b.name!=null&&Xe(f,b),Hn($,M);var te=Hn($,b);for(M=0;M<V.length;M+=2){var ae=V[M],le=V[M+1];ae==="style"?nl(f,le):ae==="dangerouslySetInnerHTML"?Mr(f,le):ae==="children"?ct(f,le):a(f,ae,le,te)}switch($){case"input":be(f,b);break;case"textarea":ar(f,b);break;case"select":var oe=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!b.multiple;var pe=b.value;pe!=null?Ut(f,!!b.multiple,pe,!1):oe!==!!b.multiple&&(b.defaultValue!=null?Ut(f,!!b.multiple,b.defaultValue,!0):Ut(f,!!b.multiple,b.multiple?[]:"",!1))}f[Ks]=b}catch(ve){Ue(e,e.return,ve)}}break;case 6:if(Bt(t,e),qt(e),s&4){if(e.stateNode===null)throw Error(p(162));f=e.stateNode,b=e.memoizedProps;try{f.nodeValue=b}catch(ve){Ue(e,e.return,ve)}}break;case 3:if(Bt(t,e),qt(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{Ns(t.containerInfo)}catch(ve){Ue(e,e.return,ve)}break;case 4:Bt(t,e),qt(e);break;case 13:Bt(t,e),qt(e),f=e.child,f.flags&8192&&(b=f.memoizedState!==null,f.stateNode.isHidden=b,!b||f.alternate!==null&&f.alternate.memoizedState!==null||(fa=$e())),s&4&&xu(e);break;case 22:if(ae=r!==null&&r.memoizedState!==null,e.mode&1?(st=(te=st)||ae,Bt(t,e),st=te):Bt(t,e),qt(e),s&8192){if(te=e.memoizedState!==null,(e.stateNode.isHidden=te)&&!ae&&(e.mode&1)!==0)for(me=e,ae=e.child;ae!==null;){for(le=me=ae;me!==null;){switch(oe=me,pe=oe.child,oe.tag){case 0:case 11:case 14:case 15:ii(4,oe,oe.return);break;case 1:_s(oe,oe.return);var ge=oe.stateNode;if(typeof ge.componentWillUnmount=="function"){s=oe,r=oe.return;try{t=s,ge.props=t.memoizedProps,ge.state=t.memoizedState,ge.componentWillUnmount()}catch(ve){Ue(s,r,ve)}}break;case 5:_s(oe,oe.return);break;case 22:if(oe.memoizedState!==null){Eu(le);continue}}pe!==null?(pe.return=oe,me=pe):Eu(le)}ae=ae.sibling}e:for(ae=null,le=e;;){if(le.tag===5){if(ae===null){ae=le;try{f=le.stateNode,te?(b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none"):($=le.stateNode,V=le.memoizedProps.style,M=V!=null&&V.hasOwnProperty("display")?V.display:null,$.style.display=vi("display",M))}catch(ve){Ue(e,e.return,ve)}}}else if(le.tag===6){if(ae===null)try{le.stateNode.nodeValue=te?"":le.memoizedProps}catch(ve){Ue(e,e.return,ve)}}else if((le.tag!==22&&le.tag!==23||le.memoizedState===null||le===e)&&le.child!==null){le.child.return=le,le=le.child;continue}if(le===e)break e;for(;le.sibling===null;){if(le.return===null||le.return===e)break e;ae===le&&(ae=null),le=le.return}ae===le&&(ae=null),le.sibling.return=le.return,le=le.sibling}}break;case 19:Bt(t,e),qt(e),s&4&&xu(e);break;case 21:break;default:Bt(t,e),qt(e)}}function qt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(yu(r)){var s=r;break e}r=r.return}throw Error(p(160))}switch(s.tag){case 5:var f=s.stateNode;s.flags&32&&(ct(f,""),s.flags&=-33);var b=Su(e);ua(e,b,f);break;case 3:case 4:var M=s.stateNode.containerInfo,$=Su(e);ca(e,$,M);break;default:throw Error(p(161))}}catch(V){Ue(e,e.return,V)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bf(e,t,r){me=e,Cu(e)}function Cu(e,t,r){for(var s=(e.mode&1)!==0;me!==null;){var f=me,b=f.child;if(f.tag===22&&s){var M=f.memoizedState!==null||ln;if(!M){var $=f.alternate,V=$!==null&&$.memoizedState!==null||st;$=ln;var te=st;if(ln=M,(st=V)&&!te)for(me=f;me!==null;)M=me,V=M.child,M.tag===22&&M.memoizedState!==null?Lu(f):V!==null?(V.return=M,me=V):Lu(f);for(;b!==null;)me=b,Cu(b),b=b.sibling;me=f,ln=$,st=te}ku(e)}else(f.subtreeFlags&8772)!==0&&b!==null?(b.return=f,me=b):ku(e)}}function ku(e){for(;me!==null;){var t=me;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:st||cn(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!st)if(r===null)s.componentDidMount();else{var f=t.elementType===t.type?r.memoizedProps:Nt(t.type,r.memoizedProps);s.componentDidUpdate(f,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var b=t.updateQueue;b!==null&&Ec(t,b,s);break;case 3:var M=t.updateQueue;if(M!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Ec(t,M,r)}break;case 5:var $=t.stateNode;if(r===null&&t.flags&4){r=$;var V=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":V.autoFocus&&r.focus();break;case"img":V.src&&(r.src=V.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var te=t.alternate;if(te!==null){var ae=te.memoizedState;if(ae!==null){var le=ae.dehydrated;le!==null&&Ns(le)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(p(163))}st||t.flags&512&&la(t)}catch(oe){Ue(t,t.return,oe)}}if(t===e){me=null;break}if(r=t.sibling,r!==null){r.return=t.return,me=r;break}me=t.return}}function Eu(e){for(;me!==null;){var t=me;if(t===e){me=null;break}var r=t.sibling;if(r!==null){r.return=t.return,me=r;break}me=t.return}}function Lu(e){for(;me!==null;){var t=me;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{cn(4,t)}catch(V){Ue(t,r,V)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var f=t.return;try{s.componentDidMount()}catch(V){Ue(t,f,V)}}var b=t.return;try{la(t)}catch(V){Ue(t,b,V)}break;case 5:var M=t.return;try{la(t)}catch(V){Ue(t,M,V)}}}catch(V){Ue(t,t.return,V)}if(t===e){me=null;break}var $=t.sibling;if($!==null){$.return=t.return,me=$;break}me=t.return}}var Cf=Math.ceil,un=S.ReactCurrentDispatcher,da=S.ReactCurrentOwner,Lt=S.ReactCurrentBatchConfig,Le=0,Je=null,ze=null,Ze=0,wt=0,ys=gr(0),qe=0,ni=null,Wr=0,dn=0,ha=0,oi=null,ft=null,fa=0,Ss=1/0,ir=null,hn=!1,pa=null,xr=null,fn=!1,br=null,pn=0,ai=0,ma=null,mn=-1,gn=0;function at(){return(Le&6)!==0?$e():mn!==-1?mn:mn=$e()}function Cr(e){return(e.mode&1)===0?1:(Le&2)!==0&&Ze!==0?Ze&-Ze:af.transition!==null?(gn===0&&(gn=Sl()),gn):(e=De,e!==0||(e=window.event,e=e===void 0?16:jl(e.type)),e)}function Ft(e,t,r,s){if(50<ai)throw ai=0,ma=null,Error(p(185));Ps(e,r,s),((Le&2)===0||e!==Je)&&(e===Je&&((Le&2)===0&&(dn|=r),qe===4&&kr(e,Ze)),pt(e,s),r===1&&Le===0&&(t.mode&1)===0&&(Ss=$e()+500,Wi&&_r()))}function pt(e,t){var r=e.callbackNode;oh(e,t);var s=Ci(e,e===Je?Ze:0);if(s===0)r!==null&&vl(r),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(r!=null&&vl(r),t===1)e.tag===0?of(ju.bind(null,e)):pc(ju.bind(null,e)),tf(function(){(Le&6)===0&&_r()}),r=null;else{switch(wl(s)){case 1:r=Kn;break;case 4:r=_l;break;case 16:r=Si;break;case 536870912:r=yl;break;default:r=Si}r=Iu(r,Ru.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Ru(e,t){if(mn=-1,gn=0,(Le&6)!==0)throw Error(p(327));var r=e.callbackNode;if(ws()&&e.callbackNode!==r)return null;var s=Ci(e,e===Je?Ze:0);if(s===0)return null;if((s&30)!==0||(s&e.expiredLanes)!==0||t)t=vn(e,s);else{t=s;var f=Le;Le|=2;var b=Pu();(Je!==e||Ze!==t)&&(ir=null,Ss=$e()+500,Vr(e,t));do try{Lf();break}catch($){Du(e,$)}while(!0);Ao(),un.current=b,Le=f,ze!==null?t=0:(Je=null,Ze=0,t=qe)}if(t!==0){if(t===2&&(f=Gn(e),f!==0&&(s=f,t=ga(e,f))),t===1)throw r=ni,Vr(e,0),kr(e,s),pt(e,$e()),r;if(t===6)kr(e,s);else{if(f=e.current.alternate,(s&30)===0&&!kf(f)&&(t=vn(e,s),t===2&&(b=Gn(e),b!==0&&(s=b,t=ga(e,b))),t===1))throw r=ni,Vr(e,0),kr(e,s),pt(e,$e()),r;switch(e.finishedWork=f,e.finishedLanes=s,t){case 0:case 1:throw Error(p(345));case 2:qr(e,ft,ir);break;case 3:if(kr(e,s),(s&130023424)===s&&(t=fa+500-$e(),10<t)){if(Ci(e,0)!==0)break;if(f=e.suspendedLanes,(f&s)!==s){at(),e.pingedLanes|=e.suspendedLanes&f;break}e.timeoutHandle=xo(qr.bind(null,e,ft,ir),t);break}qr(e,ft,ir);break;case 4:if(kr(e,s),(s&4194240)===s)break;for(t=e.eventTimes,f=-1;0<s;){var M=31-At(s);b=1<<M,M=t[M],M>f&&(f=M),s&=~b}if(s=f,s=$e()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Cf(s/1960))-s,10<s){e.timeoutHandle=xo(qr.bind(null,e,ft,ir),s);break}qr(e,ft,ir);break;case 5:qr(e,ft,ir);break;default:throw Error(p(329))}}}return pt(e,$e()),e.callbackNode===r?Ru.bind(null,e):null}function ga(e,t){var r=oi;return e.current.memoizedState.isDehydrated&&(Vr(e,t).flags|=256),e=vn(e,t),e!==2&&(t=ft,ft=r,t!==null&&va(t)),e}function va(e){ft===null?ft=e:ft.push.apply(ft,e)}function kf(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var s=0;s<r.length;s++){var f=r[s],b=f.getSnapshot;f=f.value;try{if(!Mt(b(),f))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 kr(e,t){for(t&=~ha,t&=~dn,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-At(t),s=1<<r;e[r]=-1,t&=~s}}function ju(e){if((Le&6)!==0)throw Error(p(327));ws();var t=Ci(e,0);if((t&1)===0)return pt(e,$e()),null;var r=vn(e,t);if(e.tag!==0&&r===2){var s=Gn(e);s!==0&&(t=s,r=ga(e,s))}if(r===1)throw r=ni,Vr(e,0),kr(e,t),pt(e,$e()),r;if(r===6)throw Error(p(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,qr(e,ft,ir),pt(e,$e()),null}function _a(e,t){var r=Le;Le|=1;try{return e(t)}finally{Le=r,Le===0&&(Ss=$e()+500,Wi&&_r())}}function zr(e){br!==null&&br.tag===0&&(Le&6)===0&&ws();var t=Le;Le|=1;var r=Lt.transition,s=De;try{if(Lt.transition=null,De=1,e)return e()}finally{De=s,Lt.transition=r,Le=t,(Le&6)===0&&_r()}}function ya(){wt=ys.current,Ie(ys)}function Vr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,ef(r)),ze!==null)for(r=ze.return;r!==null;){var s=r;switch(Ro(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Ui();break;case 3:gs(),Ie(ut),Ie(et),Uo();break;case 5:Fo(s);break;case 4:gs();break;case 13:Ie(Fe);break;case 19:Ie(Fe);break;case 10:Mo(s.type._context);break;case 22:case 23:ya()}r=r.return}if(Je=e,ze=e=Er(e.current,null),Ze=wt=t,qe=0,ni=null,ha=dn=Wr=0,ft=oi=null,Hr!==null){for(t=0;t<Hr.length;t++)if(r=Hr[t],s=r.interleaved,s!==null){r.interleaved=null;var f=s.next,b=r.pending;if(b!==null){var M=b.next;b.next=f,s.next=M}r.pending=s}Hr=null}return e}function Du(e,t){do{var r=ze;try{if(Ao(),Zi.current=sn,en){for(var s=He.memoizedState;s!==null;){var f=s.queue;f!==null&&(f.pending=null),s=s.next}en=!1}if($r=0,Ge=Ve=He=null,Zs=!1,ei=0,da.current=null,r===null||r.return===null){qe=1,ni=t,ze=null;break}e:{var b=e,M=r.return,$=r,V=t;if(t=Ze,$.flags|=32768,V!==null&&typeof V=="object"&&typeof V.then=="function"){var te=V,ae=$,le=ae.tag;if((ae.mode&1)===0&&(le===0||le===11||le===15)){var oe=ae.alternate;oe?(ae.updateQueue=oe.updateQueue,ae.memoizedState=oe.memoizedState,ae.lanes=oe.lanes):(ae.updateQueue=null,ae.memoizedState=null)}var pe=tu(M);if(pe!==null){pe.flags&=-257,ru(pe,M,$,b,t),pe.mode&1&&eu(b,te,t),t=pe,V=te;var ge=t.updateQueue;if(ge===null){var ve=new Set;ve.add(V),t.updateQueue=ve}else ge.add(V);break e}else{if((t&1)===0){eu(b,te,t),Sa();break e}V=Error(p(426))}}else if(Be&&$.mode&1){var We=tu(M);if(We!==null){(We.flags&65536)===0&&(We.flags|=256),ru(We,M,$,b,t),Po(vs(V,$));break e}}b=V=vs(V,$),qe!==4&&(qe=2),oi===null?oi=[b]:oi.push(b),b=M;do{switch(b.tag){case 3:b.flags|=65536,t&=-t,b.lanes|=t;var Y=Yc(b,V,t);kc(b,Y);break e;case 1:$=V;var G=b.type,Z=b.stateNode;if((b.flags&128)===0&&(typeof G.getDerivedStateFromError=="function"||Z!==null&&typeof Z.componentDidCatch=="function"&&(xr===null||!xr.has(Z)))){b.flags|=65536,t&=-t,b.lanes|=t;var ue=Zc(b,$,t);kc(b,ue);break e}}b=b.return}while(b!==null)}Au(r)}catch(_e){t=_e,ze===r&&r!==null&&(ze=r=r.return);continue}break}while(!0)}function Pu(){var e=un.current;return un.current=sn,e===null?sn:e}function Sa(){(qe===0||qe===3||qe===2)&&(qe=4),Je===null||(Wr&268435455)===0&&(dn&268435455)===0||kr(Je,Ze)}function vn(e,t){var r=Le;Le|=2;var s=Pu();(Je!==e||Ze!==t)&&(ir=null,Vr(e,t));do try{Ef();break}catch(f){Du(e,f)}while(!0);if(Ao(),Le=r,un.current=s,ze!==null)throw Error(p(261));return Je=null,Ze=0,qe}function Ef(){for(;ze!==null;)Tu(ze)}function Lf(){for(;ze!==null&&!Xd();)Tu(ze)}function Tu(e){var t=Nu(e.alternate,e,wt);e.memoizedProps=e.pendingProps,t===null?Au(e):ze=t,da.current=null}function Au(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=yf(r,t,wt),r!==null){ze=r;return}}else{if(r=Sf(r,t),r!==null){r.flags&=32767,ze=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{qe=6,ze=null;return}}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);qe===0&&(qe=5)}function qr(e,t,r){var s=De,f=Lt.transition;try{Lt.transition=null,De=1,Rf(e,t,r,s)}finally{Lt.transition=f,De=s}return null}function Rf(e,t,r,s){do ws();while(br!==null);if((Le&6)!==0)throw Error(p(327));r=e.finishedWork;var f=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(p(177));e.callbackNode=null,e.callbackPriority=0;var b=r.lanes|r.childLanes;if(ah(e,b),e===Je&&(ze=Je=null,Ze=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||fn||(fn=!0,Iu(Si,function(){return ws(),null})),b=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||b){b=Lt.transition,Lt.transition=null;var M=De;De=1;var $=Le;Le|=4,da.current=null,xf(e,r),bu(r,e),Kh(So),Li=!!yo,So=yo=null,e.current=r,bf(r),Yd(),Le=$,De=M,Lt.transition=b}else e.current=r;if(fn&&(fn=!1,br=e,pn=f),b=e.pendingLanes,b===0&&(xr=null),th(r.stateNode),pt(e,$e()),t!==null)for(s=e.onRecoverableError,r=0;r<t.length;r++)f=t[r],s(f.value,{componentStack:f.stack,digest:f.digest});if(hn)throw hn=!1,e=pa,pa=null,e;return(pn&1)!==0&&e.tag!==0&&ws(),b=e.pendingLanes,(b&1)!==0?e===ma?ai++:(ai=0,ma=e):ai=0,_r(),null}function ws(){if(br!==null){var e=wl(pn),t=Lt.transition,r=De;try{if(Lt.transition=null,De=16>e?16:e,br===null)var s=!1;else{if(e=br,br=null,pn=0,(Le&6)!==0)throw Error(p(331));var f=Le;for(Le|=4,me=e.current;me!==null;){var b=me,M=b.child;if((me.flags&16)!==0){var $=b.deletions;if($!==null){for(var V=0;V<$.length;V++){var te=$[V];for(me=te;me!==null;){var ae=me;switch(ae.tag){case 0:case 11:case 15:ii(8,ae,b)}var le=ae.child;if(le!==null)le.return=ae,me=le;else for(;me!==null;){ae=me;var oe=ae.sibling,pe=ae.return;if(_u(ae),ae===te){me=null;break}if(oe!==null){oe.return=pe,me=oe;break}me=pe}}}var ge=b.alternate;if(ge!==null){var ve=ge.child;if(ve!==null){ge.child=null;do{var We=ve.sibling;ve.sibling=null,ve=We}while(ve!==null)}}me=b}}if((b.subtreeFlags&2064)!==0&&M!==null)M.return=b,me=M;else e:for(;me!==null;){if(b=me,(b.flags&2048)!==0)switch(b.tag){case 0:case 11:case 15:ii(9,b,b.return)}var Y=b.sibling;if(Y!==null){Y.return=b.return,me=Y;break e}me=b.return}}var G=e.current;for(me=G;me!==null;){M=me;var Z=M.child;if((M.subtreeFlags&2064)!==0&&Z!==null)Z.return=M,me=Z;else e:for(M=G;me!==null;){if($=me,($.flags&2048)!==0)try{switch($.tag){case 0:case 11:case 15:cn(9,$)}}catch(_e){Ue($,$.return,_e)}if($===M){me=null;break e}var ue=$.sibling;if(ue!==null){ue.return=$.return,me=ue;break e}me=$.return}}if(Le=f,_r(),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(wi,e)}catch{}s=!0}return s}finally{De=r,Lt.transition=t}}return!1}function Mu(e,t,r){t=vs(r,t),t=Yc(e,t,1),e=Sr(e,t,1),t=at(),e!==null&&(Ps(e,1,t),pt(e,t))}function Ue(e,t,r){if(e.tag===3)Mu(e,e,r);else for(;t!==null;){if(t.tag===3){Mu(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(xr===null||!xr.has(s))){e=vs(r,e),e=Zc(t,e,1),t=Sr(t,e,1),e=at(),t!==null&&(Ps(t,1,e),pt(t,e));break}}t=t.return}}function jf(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),t=at(),e.pingedLanes|=e.suspendedLanes&r,Je===e&&(Ze&r)===r&&(qe===4||qe===3&&(Ze&130023424)===Ze&&500>$e()-fa?Vr(e,0):ha|=r),pt(e,t)}function Ou(e,t){t===0&&((e.mode&1)===0?t=1:(t=bi,bi<<=1,(bi&130023424)===0&&(bi=4194304)));var r=at();e=tr(e,t),e!==null&&(Ps(e,t,r),pt(e,r))}function Df(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Ou(e,r)}function Pf(e,t){var r=0;switch(e.tag){case 13:var s=e.stateNode,f=e.memoizedState;f!==null&&(r=f.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(p(314))}s!==null&&s.delete(t),Ou(e,r)}var Nu;Nu=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ut.current)ht=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return ht=!1,_f(e,t,r);ht=(e.flags&131072)!==0}else ht=!1,Be&&(t.flags&1048576)!==0&&mc(t,Vi,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;an(e,t),e=t.pendingProps;var f=cs(t,et.current);ms(t,r),f=zo(null,t,s,e,f,r);var b=Vo();return t.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,dt(s)?(b=!0,$i(t)):b=!1,t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Io(t),f.updater=nn,t.stateNode=f,f._reactInternals=t,Xo(t,s,e,r),t=ta(null,t,s,!0,b,r)):(t.tag=0,Be&&b&&Lo(t),ot(null,t,f,r),t=t.child),t;case 16:s=t.elementType;e:{switch(an(e,t),e=t.pendingProps,f=s._init,s=f(s._payload),t.type=s,f=t.tag=Af(s),e=Nt(s,e),f){case 0:t=ea(null,t,s,e,r);break e;case 1:t=lu(null,t,s,e,r);break e;case 11:t=su(null,t,s,e,r);break e;case 14:t=iu(null,t,s,Nt(s.type,e),r);break e}throw Error(p(306,s,""))}return t;case 0:return s=t.type,f=t.pendingProps,f=t.elementType===s?f:Nt(s,f),ea(e,t,s,f,r);case 1:return s=t.type,f=t.pendingProps,f=t.elementType===s?f:Nt(s,f),lu(e,t,s,f,r);case 3:e:{if(cu(t),e===null)throw Error(p(387));s=t.pendingProps,b=t.memoizedState,f=b.element,Cc(e,t),Xi(t,s,null,r);var M=t.memoizedState;if(s=M.element,b.isDehydrated)if(b={element:s,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},t.updateQueue.baseState=b,t.memoizedState=b,t.flags&256){f=vs(Error(p(423)),t),t=uu(e,t,s,r,f);break e}else if(s!==f){f=vs(Error(p(424)),t),t=uu(e,t,s,r,f);break e}else for(St=mr(t.stateNode.containerInfo.firstChild),yt=t,Be=!0,Ot=null,r=xc(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(hs(),s===f){t=sr(e,t,r);break e}ot(e,t,s,r)}t=t.child}return t;case 5:return Lc(t),e===null&&Do(t),s=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,M=f.children,wo(s,f)?M=null:b!==null&&wo(s,b)&&(t.flags|=32),au(e,t),ot(e,t,M,r),t.child;case 6:return e===null&&Do(t),null;case 13:return du(e,t,r);case 4:return Bo(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=fs(t,null,s,r):ot(e,t,s,r),t.child;case 11:return s=t.type,f=t.pendingProps,f=t.elementType===s?f:Nt(s,f),su(e,t,s,f,r);case 7:return ot(e,t,t.pendingProps,r),t.child;case 8:return ot(e,t,t.pendingProps.children,r),t.child;case 12:return ot(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(s=t.type._context,f=t.pendingProps,b=t.memoizedProps,M=f.value,Ae(Gi,s._currentValue),s._currentValue=M,b!==null)if(Mt(b.value,M)){if(b.children===f.children&&!ut.current){t=sr(e,t,r);break e}}else for(b=t.child,b!==null&&(b.return=t);b!==null;){var $=b.dependencies;if($!==null){M=b.child;for(var V=$.firstContext;V!==null;){if(V.context===s){if(b.tag===1){V=rr(-1,r&-r),V.tag=2;var te=b.updateQueue;if(te!==null){te=te.shared;var ae=te.pending;ae===null?V.next=V:(V.next=ae.next,ae.next=V),te.pending=V}}b.lanes|=r,V=b.alternate,V!==null&&(V.lanes|=r),Oo(b.return,r,t),$.lanes|=r;break}V=V.next}}else if(b.tag===10)M=b.type===t.type?null:b.child;else if(b.tag===18){if(M=b.return,M===null)throw Error(p(341));M.lanes|=r,$=M.alternate,$!==null&&($.lanes|=r),Oo(M,r,t),M=b.sibling}else M=b.child;if(M!==null)M.return=b;else for(M=b;M!==null;){if(M===t){M=null;break}if(b=M.sibling,b!==null){b.return=M.return,M=b;break}M=M.return}b=M}ot(e,t,f.children,r),t=t.child}return t;case 9:return f=t.type,s=t.pendingProps.children,ms(t,r),f=kt(f),s=s(f),t.flags|=1,ot(e,t,s,r),t.child;case 14:return s=t.type,f=Nt(s,t.pendingProps),f=Nt(s.type,f),iu(e,t,s,f,r);case 15:return nu(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,f=t.pendingProps,f=t.elementType===s?f:Nt(s,f),an(e,t),t.tag=1,dt(s)?(e=!0,$i(t)):e=!1,ms(t,r),Qc(t,s,f),Xo(t,s,f,r),ta(null,t,s,!0,e,r);case 19:return fu(e,t,r);case 22:return ou(e,t,r)}throw Error(p(156,t.tag))};function Iu(e,t){return gl(e,t)}function Tf(e,t,r,s){this.tag=e,this.key=r,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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rt(e,t,r,s){return new Tf(e,t,r,s)}function wa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Af(e){if(typeof e=="function")return wa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===W)return 11;if(e===q)return 14}return 2}function Er(e,t){var r=e.alternate;return r===null?(r=Rt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function _n(e,t,r,s,f,b){var M=2;if(s=e,typeof e=="function")wa(e)&&(M=1);else if(typeof e=="string")M=5;else e:switch(e){case j:return Kr(r.children,f,b,t);case w:M=8,f|=8;break;case D:return e=Rt(12,r,t,f|2),e.elementType=D,e.lanes=b,e;case I:return e=Rt(13,r,t,f),e.elementType=I,e.lanes=b,e;case Q:return e=Rt(19,r,t,f),e.elementType=Q,e.lanes=b,e;case re:return yn(r,f,b,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:M=10;break e;case U:M=9;break e;case W:M=11;break e;case q:M=14;break e;case z:M=16,s=null;break e}throw Error(p(130,e==null?e:typeof e,""))}return t=Rt(M,r,t,f),t.elementType=e,t.type=s,t.lanes=b,t}function Kr(e,t,r,s){return e=Rt(7,e,s,t),e.lanes=r,e}function yn(e,t,r,s){return e=Rt(22,e,s,t),e.elementType=re,e.lanes=r,e.stateNode={isHidden:!1},e}function xa(e,t,r){return e=Rt(6,e,null,t),e.lanes=r,e}function ba(e,t,r){return t=Rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mf(e,t,r,s,f){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=Jn(0),this.expirationTimes=Jn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jn(0),this.identifierPrefix=s,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function Ca(e,t,r,s,f,b,M,$,V){return e=new Mf(e,t,r,$,V),t===1?(t=1,b===!0&&(t|=8)):t=0,b=Rt(3,null,null,t),e.current=b,b.stateNode=e,b.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Io(b),e}function Of(e,t,r){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:s==null?null:""+s,children:e,containerInfo:t,implementation:r}}function Bu(e){if(!e)return vr;e=e._reactInternals;e:{if(Or(e)!==e||e.tag!==1)throw Error(p(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(dt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(p(171))}if(e.tag===1){var r=e.type;if(dt(r))return hc(e,r,t)}return t}function Fu(e,t,r,s,f,b,M,$,V){return e=Ca(r,s,!0,e,f,b,M,$,V),e.context=Bu(null),r=e.current,s=at(),f=Cr(r),b=rr(s,f),b.callback=t??null,Sr(r,b,f),e.current.lanes=f,Ps(e,f,s),pt(e,s),e}function Sn(e,t,r,s){var f=t.current,b=at(),M=Cr(f);return r=Bu(r),t.context===null?t.context=r:t.pendingContext=r,t=rr(b,M),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Sr(f,t,M),e!==null&&(Ft(e,f,M,b),Qi(e,f,M)),M}function wn(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 Hu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ka(e,t){Hu(e,t),(e=e.alternate)&&Hu(e,t)}function Nf(){return null}var Uu=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ea(e){this._internalRoot=e}xn.prototype.render=Ea.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(p(409));Sn(e,t,null,null)},xn.prototype.unmount=Ea.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zr(function(){Sn(null,e,null,null)}),t[Xt]=null}};function xn(e){this._internalRoot=e}xn.prototype.unstable_scheduleHydration=function(e){if(e){var t=Cl();e={blockedOn:null,target:e,priority:t};for(var r=0;r<hr.length&&t!==0&&t<hr[r].priority;r++);hr.splice(r,0,e),r===0&&Ll(e)}};function La(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bn(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function $u(){}function If(e,t,r,s,f){if(f){if(typeof s=="function"){var b=s;s=function(){var te=wn(M);b.call(te)}}var M=Fu(t,s,e,0,null,!1,!1,"",$u);return e._reactRootContainer=M,e[Xt]=M.current,Vs(e.nodeType===8?e.parentNode:e),zr(),M}for(;f=e.lastChild;)e.removeChild(f);if(typeof s=="function"){var $=s;s=function(){var te=wn(V);$.call(te)}}var V=Ca(e,0,!1,null,null,!1,!1,"",$u);return e._reactRootContainer=V,e[Xt]=V.current,Vs(e.nodeType===8?e.parentNode:e),zr(function(){Sn(t,V,r,s)}),V}function Cn(e,t,r,s,f){var b=r._reactRootContainer;if(b){var M=b;if(typeof f=="function"){var $=f;f=function(){var V=wn(M);$.call(V)}}Sn(t,M,e,f)}else M=If(r,t,e,f,s);return wn(M)}xl=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ds(t.pendingLanes);r!==0&&(Qn(t,r|1),pt(t,$e()),(Le&6)===0&&(Ss=$e()+500,_r()))}break;case 13:zr(function(){var s=tr(e,1);if(s!==null){var f=at();Ft(s,e,1,f)}}),ka(e,1)}},Xn=function(e){if(e.tag===13){var t=tr(e,134217728);if(t!==null){var r=at();Ft(t,e,134217728,r)}ka(e,134217728)}},bl=function(e){if(e.tag===13){var t=Cr(e),r=tr(e,t);if(r!==null){var s=at();Ft(r,e,t,s)}ka(e,t)}},Cl=function(){return De},kl=function(e,t){var r=De;try{return De=e,t()}finally{De=r}},Wn=function(e,t,r){switch(t){case"input":if(be(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var s=r[t];if(s!==e&&s.form===e.form){var f=Hi(s);if(!f)throw Error(p(90));he(s),be(s,f)}}}break;case"textarea":ar(e,r);break;case"select":t=r.value,t!=null&&Ut(e,!!r.multiple,t,!1)}},cl=_a,ul=zr;var Bf={usingClientEntryPoint:!1,Events:[Gs,as,Hi,al,ll,_a]},li={findFiberByHostInstance:Nr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ff={bundleType:li.bundleType,version:li.version,rendererPackageName:li.rendererPackageName,rendererConfig:li.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=pl(e),e===null?null:e.stateNode},findFiberByHostInstance:li.findFiberByHostInstance||Nf,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 kn=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kn.isDisabled&&kn.supportsFiber)try{wi=kn.inject(Ff),$t=kn}catch{}}return mt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Bf,mt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!La(t))throw Error(p(200));return Of(e,t,null,r)},mt.createRoot=function(e,t){if(!La(e))throw Error(p(299));var r=!1,s="",f=Uu;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=Ca(e,1,!1,null,null,r,!1,s,f),e[Xt]=t.current,Vs(e.nodeType===8?e.parentNode:e),new Ea(t)},mt.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(p(188)):(e=Object.keys(e).join(","),Error(p(268,e)));return e=pl(t),e=e===null?null:e.stateNode,e},mt.flushSync=function(e){return zr(e)},mt.hydrate=function(e,t,r){if(!bn(t))throw Error(p(200));return Cn(null,e,t,!0,r)},mt.hydrateRoot=function(e,t,r){if(!La(e))throw Error(p(405));var s=r!=null&&r.hydratedSources||null,f=!1,b="",M=Uu;if(r!=null&&(r.unstable_strictMode===!0&&(f=!0),r.identifierPrefix!==void 0&&(b=r.identifierPrefix),r.onRecoverableError!==void 0&&(M=r.onRecoverableError)),t=Fu(t,null,e,1,r??null,f,!1,b,M),e[Xt]=t.current,Vs(e),s)for(e=0;e<s.length;e++)r=s[e],f=r._getVersion,f=f(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,f]:t.mutableSourceEagerHydrationData.push(r,f);return new xn(t)},mt.render=function(e,t,r){if(!bn(t))throw Error(p(200));return Cn(null,e,t,!1,r)},mt.unmountComponentAtNode=function(e){if(!bn(e))throw Error(p(40));return e._reactRootContainer?(zr(function(){Cn(null,null,e,!1,function(){e._reactRootContainer=null,e[Xt]=null})}),!0):!1},mt.unstable_batchedUpdates=_a,mt.unstable_renderSubtreeIntoContainer=function(e,t,r,s){if(!bn(r))throw Error(p(200));if(e==null||e._reactInternals===void 0)throw Error(p(38));return Cn(e,t,r,!1,s)},mt.version="18.3.1-next-f1338f8080-20240426",mt}var Qu;function Jf(){if(Qu)return Pa.exports;Qu=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(m){console.error(m)}}return l(),Pa.exports=Gf(),Pa.exports}var Xu;function Qf(){if(Xu)return En;Xu=1;var l=Jf();return En.createRoot=l.createRoot,En.hydrateRoot=l.hydrateRoot,En}var Xf=Qf();const Yf=bd(Xf);var J=Ga();const Kt=bd(J),Yu=l=>{let m;const p=new Set,k=(g,y)=>{const h=typeof g=="function"?g(m):g;if(!Object.is(h,m)){const _=m;m=y??(typeof h!="object"||h===null)?h:Object.assign({},m,h),p.forEach(x=>x(m,_))}},P=()=>m,i={setState:k,getState:P,getInitialState:()=>c,subscribe:g=>(p.add(g),()=>p.delete(g))},c=m=l(k,P,i);return i},Zf=(l=>l?Yu(l):Yu),ep=l=>l;function tp(l,m=ep){const p=Kt.useSyncExternalStore(l.subscribe,Kt.useCallback(()=>m(l.getState()),[l,m]),Kt.useCallback(()=>m(l.getInitialState()),[l,m]));return Kt.useDebugValue(p),p}const Zu=l=>{const m=Zf(l),p=k=>tp(m,k);return Object.assign(p,m),p},Ja=(l=>l?Zu(l):Zu);function Ht(l){return"'"+l.replace(/'/g,"'\\''")+"'"}const Ma=({sessionId:l})=>`claude --dangerously-skip-permissions --session-id ${Ht(l)}`,ed=({sessionId:l})=>`claude --session-id ${Ht(l)}`,rp=()=>"claude --resume",Cd=[{id:"sm-dangerous",label:"Session Manager (skip perms)",description:"claude --dangerously-skip-permissions in this project",category:"build",cwd:"app-cwd",command:Ma},{id:"sm-safe",label:"Session Manager (safe)",description:"claude with normal permission prompts in this project",category:"build",cwd:"app-cwd",command:ed},{id:"home-dangerous",label:"Home (skip perms)",description:"claude --dangerously-skip-permissions in ~",category:"build",cwd:"home",command:Ma},{id:"pick-dangerous",label:"Pick directory (skip perms)…",description:"Choose a folder, launch claude --dangerously-skip-permissions",category:"build",cwd:"pick",command:Ma},{id:"pick-safe",label:"Pick directory (safe)…",description:"Choose a folder, launch claude with normal prompts",category:"build",cwd:"pick",command:ed},{id:"pick-resume",label:"Pick directory + resume…",description:"Choose a folder, then pick a past session to resume",category:"build",cwd:"pick",command:rp},{id:"pick-shell",label:"Pick directory (shell only)…",description:"Bare interactive shell, no claude auto-launch",category:"build",cwd:"pick",command:null}];let jt=null;async function sp(){if(jt)return jt;try{const l=await window.api.app.engageRulesPath();if(!l)return jt=[],jt;const m=await window.api.config.readJson(l);if(!m.exists||m.parseError||!m.data)return jt=[],jt;const p=m.data;if(!p.presets||!Array.isArray(p.presets))return jt=[],jt;const k=p.projectPath;return jt=p.presets.map(P=>({id:P.id,label:P.label,description:P.description,category:"engage",cwd:k,platform:P.platform,pipeline:P.pipeline,rules:P.rules,command:()=>`cd ${Ht(k)} && ${P.cliEntry}`})),jt}catch(l){return console.warn("[presets] Failed to load engage presets:",l),jt=[],jt}}async function ip(l){const m=Cd.find(k=>k.id===l);return m||((await sp()).find(k=>k.id===l)??null)}async function np(l){return l.cwd==="app-cwd"?window.api.app.cwd():l.cwd==="home"?window.api.app.homeDir():l.cwd==="pick"?window.api.app.pickDirectory():l.cwd}function kd(l,m){return l.command?l.command(m):null}function op(l){const m=l.split("/").filter(Boolean);return m[m.length-1]||l}const je=Ja((l,m)=>({tabs:[],activeTabId:null,hydrated:!1,addTab:({id:p,cwd:k,startupCommand:P,presetId:O=null,label:R})=>{const i=p??crypto.randomUUID();if(m().tabs.find(y=>y.id===i))return l({activeTabId:i}),i;const g={id:i,claudeSessionId:i,label:R??op(k),cwd:k,pid:null,status:"spawning",exitCode:null,startupCommand:P,presetId:O,generation:0};return l({tabs:[...m().tabs,g],activeTabId:i}),i},setTabRunning:(p,k)=>l({tabs:m().tabs.map(P=>P.id===p?{...P,pid:k,status:"running"}:P)}),setTabExited:(p,k)=>l({tabs:m().tabs.map(P=>P.id===p?{...P,status:"exited",exitCode:k}:P)}),closeTab:p=>{var O;window.api.pty.kill(p);const k=m().tabs.filter(R=>R.id!==p),P=m().activeTabId===p?((O=k[k.length-1])==null?void 0:O.id)??null:m().activeTabId;l({tabs:k,activeTabId:P})},setActive:p=>l({activeTabId:p}),restartTab:p=>{const k=m().tabs.find(R=>R.id===p);if(!k)return;window.api.pty.kill(p);const P=crypto.randomUUID(),O=R=>{l({tabs:m().tabs.map(i=>i.id===p?{...i,claudeSessionId:P,pid:null,status:"spawning",exitCode:null,startupCommand:R,generation:i.generation+1}:i)})};k.presetId?ip(k.presetId).then(R=>{O(R?kd(R,{sessionId:P,cwd:k.cwd}):`claude --dangerously-skip-permissions --session-id ${Ht(P)}`)}):O(`claude --dangerously-skip-permissions --session-id ${Ht(P)}`)},restoreTabs:(p,k)=>l({tabs:p,activeTabId:k,hydrated:!0})}));async function ap(){var p;if(je.getState().hydrated)return;try{const{tabs:k,activeTabId:P,freshStart:O}=await window.api.sessions.load();if(k.length>0){const R=k.map(c=>({id:c.id,claudeSessionId:c.claudeSessionId,cwd:c.cwd,label:c.label,presetId:c.presetId,pid:null,status:"spawning",exitCode:null,startupCommand:O?`claude --dangerously-skip-permissions --session-id ${Ht(c.claudeSessionId)}`:`claude --dangerously-skip-permissions --resume ${Ht(c.claudeSessionId)}`,generation:0})),i=P&&R.find(c=>c.id===P)?P:((p=R[0])==null?void 0:p.id)??null;je.getState().restoreTabs(R,i)}else je.setState({hydrated:!0})}catch(k){console.warn("[sessions] hydrate failed:",k),je.setState({hydrated:!0})}const l=()=>{const{tabs:k,activeTabId:P}=je.getState(),O=k.map(R=>({id:R.id,claudeSessionId:R.claudeSessionId,cwd:R.cwd,label:R.label,presetId:R.presetId}));window.api.sessions.save({tabs:O,activeTabId:P}).catch(R=>{console.warn("[sessions] save failed:",R)})};let m=null;je.subscribe((k,P)=>{k.hydrated&&(k.tabs===P.tabs&&k.activeTabId===P.activeTabId||(m!==null&&window.clearTimeout(m),m=window.setTimeout(l,200)))}),l()}function lp(){const{tabs:l,activeTabId:m,addTab:p,closeTab:k,setActive:P}=je(),[O,R]=J.useState(null),i=async()=>{R(null);try{const c=await window.api.app.pickDirectory();if(!c)return;const g=crypto.randomUUID(),y=`claude --dangerously-skip-permissions --session-id ${Ht(g)}`;p({id:g,cwd:c,startupCommand:y,presetId:"pick-dangerous"})}catch(c){const g=c instanceof Error?c.message:String(c);R(g),console.error("[TabBar] createPickedSession failed:",c)}};return u.jsxs("div",{className:"h-9 bg-bg-elev border-b border-line flex items-center px-2 gap-1 shrink-0",children:[u.jsx("div",{className:"flex items-center gap-1 overflow-x-auto min-w-0 flex-1",children:l.map(c=>{const g=c.id===m;return u.jsxs("div",{onClick:()=>P(c.id),className:`group px-3 py-1 flex items-center gap-2 border border-line rounded-t text-xs cursor-pointer shrink-0 ${g?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg"}`,title:c.cwd,children:[u.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${c.status==="running"?"bg-green-500":c.status==="spawning"?"bg-yellow-500 animate-pulse":"bg-fg-faint"}`}),u.jsx("span",{children:c.label}),u.jsx("button",{onClick:y=>{y.stopPropagation(),k(c.id)},className:"text-fg-faint opacity-0 group-hover:opacity-100 hover:text-fg ml-1",title:"Close session",children:"×"})]},c.id)})}),u.jsx("div",{className:"shrink-0",children:u.jsx("button",{onClick:i,className:"px-2 py-1 text-fg-dim hover:text-fg text-xs",title:"New session — pick a project directory",children:"+ new"})}),O&&u.jsx("div",{className:"text-red-400 text-xs px-2 shrink-0",children:O}),u.jsx("div",{className:"text-fg-faint text-xs px-2 shrink-0",children:"Claude Session Manager"})]})}const cp=[{key:"overview",label:"Overview"},{key:"terminal",label:"Terminal"},{key:"system-prompt",label:"System Prompt"},{key:"settings",label:"Settings"},{key:"permissions",label:"Permissions"},{key:"skills",label:"Skills"},{key:"plugins",label:"Plugins"},{key:"mcp",label:"MCP Servers"},{key:"hooks",label:"Hooks"},{key:"subagents",label:"Subagents",live:!0},{key:"plans",label:"Plans"},{key:"tasks",label:"Tasks",live:!0},{key:"projects",label:"Projects"},{key:"history",label:"History"},{key:"keybindings",label:"Keybindings"},{key:"usage",label:"Usage"}];function up({active:l,onChange:m,onNewSession:p}){return u.jsxs("nav",{className:"w-52 bg-bg-elev border-r border-line shrink-0 overflow-y-auto py-2 flex flex-col",children:[u.jsx("div",{className:"flex-1",children:cp.map(k=>u.jsxs("button",{onClick:()=>m(k.key),className:`w-full text-left px-4 py-1.5 text-xs flex items-center justify-between transition-colors ${l===k.key?"bg-bg-hi text-fg border-l-2 border-accent":"text-fg-dim hover:text-fg hover:bg-bg-hi border-l-2 border-transparent"}`,children:[u.jsx("span",{children:k.label}),k.live&&u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent animate-pulse"})]},k.key))}),p&&u.jsx("div",{className:"px-3 py-3 border-t border-line",children:u.jsx("button",{onClick:p,className:"w-full px-3 py-1.5 text-xs text-fg-dim hover:text-fg bg-bg hover:bg-bg-hi border border-line rounded transition-colors",children:"+ New Session"})})]})}function dp(){const l=je(P=>P.tabs),m=je(P=>P.activeTabId),p=je(P=>P.restartTab),k=l.find(P=>P.id===m)??null;return u.jsxs("div",{className:"h-6 bg-bg-elev border-t border-line flex items-center px-3 gap-4 text-xs text-fg-faint shrink-0",children:[u.jsxs("span",{children:["status: ",u.jsx("span",{className:"text-fg-dim",children:(k==null?void 0:k.status)??"—"})]}),u.jsxs("span",{children:["pid: ",u.jsx("span",{className:"text-fg-dim",children:(k==null?void 0:k.pid)??"—"})]}),u.jsx("span",{children:"tokens: — in / — out"}),u.jsx("span",{children:"cost: $—"}),u.jsx("div",{className:"flex-1"}),k&&k.status==="running"&&u.jsx("button",{onClick:()=>p(k.id),className:"text-fg-faint hover:text-fg transition-colors",title:"Restart session — kill claude and start fresh (picks up config changes)",children:"restart session"}),u.jsx("button",{onClick:()=>window.api.app.rebootApp(),className:"text-fg-faint hover:text-fg transition-colors",title:"Restart Session Manager — reload app code (Ctrl+Shift+R)",children:"restart app"}),u.jsxs("span",{className:"truncate max-w-md",children:["cwd: ",u.jsx("span",{className:"text-fg-dim",children:(k==null?void 0:k.cwd)??"—"})]})]})}var Oa={exports:{}},td;function hp(){return td||(td=1,(function(l,m){(function(p,k){l.exports=k()})(globalThis,(()=>(()=>{var p={4567:function(R,i,c){var g=this&&this.__decorate||function(o,a,S,E){var L,j=arguments.length,w=j<3?a:E===null?E=Object.getOwnPropertyDescriptor(a,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(o,a,S,E);else for(var D=o.length-1;D>=0;D--)(L=o[D])&&(w=(j<3?L(w):j>3?L(a,S,w):L(a,S))||w);return j>3&&w&&Object.defineProperty(a,S,w),w},y=this&&this.__param||function(o,a){return function(S,E){a(S,E,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;const h=c(9042),_=c(9924),x=c(844),C=c(4725),v=c(2585),n=c(3656);let d=i.AccessibilityManager=class extends x.Disposable{constructor(o,a,S,E){super(),this._terminal=o,this._coreBrowserService=S,this._renderService=E,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 L=0;L<this._terminal.rows;L++)this._rowElements[L]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[L]);if(this._topBoundaryFocusListener=L=>this._handleBoundaryFocus(L,0),this._bottomBoundaryFocusListener=L=>this._handleBoundaryFocus(L,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 _.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((L=>this._handleResize(L.rows)))),this.register(this._terminal.onRender((L=>this._refreshRows(L.start,L.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((L=>this._handleChar(L)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
42
|
-
`)))),this.register(this._terminal.onA11yTab((L=>this._handleTab(L)))),this.register(this._terminal.onKey((L=>this._handleKey(L.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,n.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(o){for(let a=0;a<o;a++)this._handleChar(" ")}_handleChar(o){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==o&&(this._charsToAnnounce+=o):this._charsToAnnounce+=o,o===`
|
|
43
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(o){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(o)||this._charsToConsume.push(o)}_refreshRows(o,a){this._liveRegionDebouncer.refresh(o,a,this._terminal.rows)}_renderRows(o,a){const S=this._terminal.buffer,E=S.lines.length.toString();for(let L=o;L<=a;L++){const j=S.lines.get(S.ydisp+L),w=[],D=(j==null?void 0:j.translateToString(!0,void 0,void 0,w))||"",H=(S.ydisp+L+1).toString(),U=this._rowElements[L];U&&(D.length===0?(U.innerText=" ",this._rowColumns.set(U,[0,1])):(U.textContent=D,this._rowColumns.set(U,w)),U.setAttribute("aria-posinset",H),U.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(o,a){const S=o.target,E=this._rowElements[a===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(a===0?"1":`${this._terminal.buffer.lines.length}`)||o.relatedTarget!==E)return;let L,j;if(a===0?(L=S,j=this._rowElements.pop(),this._rowContainer.removeChild(j)):(L=this._rowElements.shift(),j=S,this._rowContainer.removeChild(L)),L.removeEventListener("focus",this._topBoundaryFocusListener),j.removeEventListener("focus",this._bottomBoundaryFocusListener),a===0){const w=this._createAccessibilityTreeNode();this._rowElements.unshift(w),this._rowContainer.insertAdjacentElement("afterbegin",w)}else{const w=this._createAccessibilityTreeNode();this._rowElements.push(w),this._rowContainer.appendChild(w)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(a===0?-1:1),this._rowElements[a===0?1:this._rowElements.length-2].focus(),o.preventDefault(),o.stopImmediatePropagation()}_handleSelectionChange(){var D;if(this._rowElements.length===0)return;const o=document.getSelection();if(!o)return;if(o.isCollapsed)return void(this._rowContainer.contains(o.anchorNode)&&this._terminal.clearSelection());if(!o.anchorNode||!o.focusNode)return void console.error("anchorNode and/or focusNode are null");let a={node:o.anchorNode,offset:o.anchorOffset},S={node:o.focusNode,offset:o.focusOffset};if((a.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||a.node===S.node&&a.offset>S.offset)&&([a,S]=[S,a]),a.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(a={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(a.node))return;const E=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:E,offset:((D=E.textContent)==null?void 0:D.length)??0}),!this._rowContainer.contains(S.node))return;const L=({node:H,offset:U})=>{const W=H instanceof Text?H.parentNode:H;let I=parseInt(W==null?void 0:W.getAttribute("aria-posinset"),10)-1;if(isNaN(I))return console.warn("row is invalid. Race condition?"),null;const Q=this._rowColumns.get(W);if(!Q)return console.warn("columns is null. Race condition?"),null;let q=U<Q.length?Q[U]:Q.slice(-1)[0]+1;return q>=this._terminal.cols&&(++I,q=0),{row:I,column:q}},j=L(a),w=L(S);if(j&&w){if(j.row>w.row||j.row===w.row&&j.column>=w.column)throw new Error("invalid range");this._terminal.select(j.column,j.row,(w.row-j.row)*this._terminal.cols-j.column+w.column)}}_handleResize(o){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let a=this._rowContainer.children.length;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);for(;this._rowElements.length>o;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const o=this._coreBrowserService.mainDocument.createElement("div");return o.setAttribute("role","listitem"),o.tabIndex=-1,this._refreshRowDimensions(o),o}_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 o=0;o<this._terminal.rows;o++)this._refreshRowDimensions(this._rowElements[o])}}_refreshRowDimensions(o){o.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=d=g([y(1,v.IInstantiationService),y(2,C.ICoreBrowserService),y(3,C.IRenderService)],d)},3614:(R,i)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function g(_,x){return x?"\x1B[200~"+_+"\x1B[201~":_}function y(_,x,C,v){_=g(_=c(_),C.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(_,!0),x.value=""}function h(_,x,C){const v=C.getBoundingClientRect(),n=_.clientX-v.left-10,d=_.clientY-v.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${n}px`,x.style.top=`${d}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=c,i.bracketTextForPaste=g,i.copyHandler=function(_,x){_.clipboardData&&_.clipboardData.setData("text/plain",x.selectionText),_.preventDefault()},i.handlePasteEvent=function(_,x,C,v){_.stopPropagation(),_.clipboardData&&y(_.clipboardData.getData("text/plain"),x,C,v)},i.paste=y,i.moveTextAreaUnderMouseCursor=h,i.rightClickHandler=function(_,x,C,v,n){h(_,x,C),n&&v.rightClickSelect(_),x.value=v.selectionText,x.select()}},7239:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const g=c(1505);i.ColorContrastCache=class{constructor(){this._color=new g.TwoKeyMap,this._css=new g.TwoKeyMap}setCss(y,h,_){this._css.set(y,h,_)}getCss(y,h){return this._css.get(y,h)}setColor(y,h,_){this._color.set(y,h,_)}getColor(y,h){return this._color.get(y,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(c,g,y,h){c.addEventListener(g,y,h);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(g,y,h))}}}},3551:function(R,i,c){var g=this&&this.__decorate||function(d,o,a,S){var E,L=arguments.length,j=L<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,a):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(d,o,a,S);else for(var w=d.length-1;w>=0;w--)(E=d[w])&&(j=(L<3?E(j):L>3?E(o,a,j):E(o,a))||j);return L>3&&j&&Object.defineProperty(o,a,j),j},y=this&&this.__param||function(d,o){return function(a,S){o(a,S,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;const h=c(3656),_=c(8460),x=c(844),C=c(2585),v=c(4725);let n=i.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(d,o,a,S,E){super(),this._element=d,this._mouseService=o,this._renderService=a,this._bufferService=S,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{var L;this._lastMouseEvent=void 0,(L=this._activeProviderReplies)==null||L.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(d){this._lastMouseEvent=d;const o=this._positionFromMouseEvent(d,this._element,this._mouseService);if(!o)return;this._isMouseOut=!1;const a=d.composedPath();for(let S=0;S<a.length;S++){const E=a[S];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&o.x===this._lastBufferCell.x&&o.y===this._lastBufferCell.y||(this._handleHover(o),this._lastBufferCell=o)}_handleHover(d){if(this._activeLine!==d.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(d,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,d)||(this._clearCurrentLink(),this._askForLink(d,!0))}_askForLink(d,o){var S,E;this._activeProviderReplies&&o||((S=this._activeProviderReplies)==null||S.forEach((L=>{L==null||L.forEach((j=>{j.link.dispose&&j.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=d.y);let a=!1;for(const[L,j]of this._linkProviderService.linkProviders.entries())o?(E=this._activeProviderReplies)!=null&&E.get(L)&&(a=this._checkLinkProviderResult(L,d,a)):j.provideLinks(d.y,(w=>{var H,U;if(this._isMouseOut)return;const D=w==null?void 0:w.map((W=>({link:W})));(H=this._activeProviderReplies)==null||H.set(L,D),a=this._checkLinkProviderResult(L,d,a),((U=this._activeProviderReplies)==null?void 0:U.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(d.y,this._activeProviderReplies)}))}_removeIntersectingLinks(d,o){const a=new Set;for(let S=0;S<o.size;S++){const E=o.get(S);if(E)for(let L=0;L<E.length;L++){const j=E[L],w=j.link.range.start.y<d?0:j.link.range.start.x,D=j.link.range.end.y>d?this._bufferService.cols:j.link.range.end.x;for(let H=w;H<=D;H++){if(a.has(H)){E.splice(L--,1);break}a.add(H)}}}}_checkLinkProviderResult(d,o,a){var L;if(!this._activeProviderReplies)return a;const S=this._activeProviderReplies.get(d);let E=!1;for(let j=0;j<d;j++)this._activeProviderReplies.has(j)&&!this._activeProviderReplies.get(j)||(E=!0);if(!E&&S){const j=S.find((w=>this._linkAtPosition(w.link,o)));j&&(a=!0,this._handleNewLink(j))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!a)for(let j=0;j<this._activeProviderReplies.size;j++){const w=(L=this._activeProviderReplies.get(j))==null?void 0:L.find((D=>this._linkAtPosition(D.link,o)));if(w){a=!0,this._handleNewLink(w);break}}return a}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(d){if(!this._currentLink)return;const o=this._positionFromMouseEvent(d,this._element,this._mouseService);o&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,o)&&this._currentLink.link.activate(d,this._currentLink.link.text)}_clearCurrentLink(d,o){this._currentLink&&this._lastMouseEvent&&(!d||!o||this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=o)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(d){if(!this._lastMouseEvent)return;const o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._linkAtPosition(d.link,o)&&(this._currentLink=d,this._currentLink.state={decorations:{underline:d.link.decorations===void 0||d.link.decorations.underline,pointerCursor:d.link.decorations===void 0||d.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,d.link,this._lastMouseEvent),d.link.decorations={},Object.defineProperties(d.link.decorations,{pointerCursor:{get:()=>{var a,S;return(S=(a=this._currentLink)==null?void 0:a.state)==null?void 0:S.decorations.pointerCursor},set:a=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==a&&(this._currentLink.state.decorations.pointerCursor=a,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",a))}},underline:{get:()=>{var a,S;return(S=(a=this._currentLink)==null?void 0:a.state)==null?void 0:S.decorations.underline},set:a=>{var S,E,L;(S=this._currentLink)!=null&&S.state&&((L=(E=this._currentLink)==null?void 0:E.state)==null?void 0:L.decorations.underline)!==a&&(this._currentLink.state.decorations.underline=a,this._currentLink.state.isHovered&&this._fireUnderlineEvent(d.link,a))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((a=>{if(!this._currentLink)return;const S=a.start===0?0:a.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+a.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(S,E),this._lastMouseEvent)){const L=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);L&&this._askForLink(L,!1)}}))))}_linkHover(d,o,a){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!0),this._currentLink.state.decorations.pointerCursor&&d.classList.add("xterm-cursor-pointer")),o.hover&&o.hover(a,o.text)}_fireUnderlineEvent(d,o){const a=d.range,S=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(a.start.x-1,a.start.y-S-1,a.end.x,a.end.y-S-1,void 0);(o?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(d,o,a){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!1),this._currentLink.state.decorations.pointerCursor&&d.classList.remove("xterm-cursor-pointer")),o.leave&&o.leave(a,o.text)}_linkAtPosition(d,o){const a=d.range.start.y*this._bufferService.cols+d.range.start.x,S=d.range.end.y*this._bufferService.cols+d.range.end.x,E=o.y*this._bufferService.cols+o.x;return a<=E&&E<=S}_positionFromMouseEvent(d,o,a){const S=a.getCoords(d,o,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(d,o,a,S,E){return{x1:d,y1:o,x2:a,y2:S,cols:this._bufferService.cols,fg:E}}};i.Linkifier=n=g([y(1,v.IMouseService),y(2,v.IRenderService),y(3,C.IBufferService),y(4,v.ILinkProviderService)],n)},9042:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(R,i,c){var g=this&&this.__decorate||function(v,n,d,o){var a,S=arguments.length,E=S<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,d):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,n,d,o);else for(var L=v.length-1;L>=0;L--)(a=v[L])&&(E=(S<3?a(E):S>3?a(n,d,E):a(n,d))||E);return S>3&&E&&Object.defineProperty(n,d,E),E},y=this&&this.__param||function(v,n){return function(d,o){n(d,o,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;const h=c(511),_=c(2585);let x=i.OscLinkProvider=class{constructor(v,n,d){this._bufferService=v,this._optionsService=n,this._oscLinkService=d}provideLinks(v,n){var D;const d=this._bufferService.buffer.lines.get(v-1);if(!d)return void n(void 0);const o=[],a=this._optionsService.rawOptions.linkHandler,S=new h.CellData,E=d.getTrimmedLength();let L=-1,j=-1,w=!1;for(let H=0;H<E;H++)if(j!==-1||d.hasContent(H)){if(d.loadCell(H,S),S.hasExtendedAttrs()&&S.extended.urlId){if(j===-1){j=H,L=S.extended.urlId;continue}w=S.extended.urlId!==L}else j!==-1&&(w=!0);if(w||j!==-1&&H===E-1){const U=(D=this._oscLinkService.getLinkData(L))==null?void 0:D.uri;if(U){const W={start:{x:j+1,y:v},end:{x:H+(w||H!==E-1?0:1),y:v}};let I=!1;if(!(a!=null&&a.allowNonHttpProtocols))try{const Q=new URL(U);["http:","https:"].includes(Q.protocol)||(I=!0)}catch{I=!0}I||o.push({text:U,range:W,activate:(Q,q)=>a?a.activate(Q,q,W):C(0,q),hover:(Q,q)=>{var z;return(z=a==null?void 0:a.hover)==null?void 0:z.call(a,Q,q,W)},leave:(Q,q)=>{var z;return(z=a==null?void 0:a.leave)==null?void 0:z.call(a,Q,q,W)}})}w=!1,S.hasExtendedAttrs()&&S.extended.urlId?(j=H,L=S.extended.urlId):(j=-1,L=-1)}}n(o)}};function C(v,n){if(confirm(`Do you want to navigate to ${n}?
|
|
44
|
-
|
|
45
|
-
WARNING: This link could potentially be dangerous`)){const d=window.open();if(d){try{d.opener=null}catch{}d.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=x=g([y(0,_.IBufferService),y(1,_.IOptionsService),y(2,_.IOscLinkService)],x)},6193:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(c,g){this._renderCallback=c,this._coreBrowserService=g,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,g,y){this._rowCount=y,c=c!==void 0?c:0,g=g!==void 0?g:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,g):g,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 c=Math.max(this._rowStart,0),g=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,g),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;const g=c(3614),y=c(3656),h=c(3551),_=c(9042),x=c(3730),C=c(1680),v=c(3107),n=c(5744),d=c(2950),o=c(1296),a=c(428),S=c(4269),E=c(5114),L=c(8934),j=c(3230),w=c(9312),D=c(4725),H=c(6731),U=c(8055),W=c(8969),I=c(8460),Q=c(844),q=c(6114),z=c(8437),re=c(2584),X=c(7399),A=c(5941),B=c(9074),T=c(2585),F=c(5435),ee=c(4567),ne=c(779);class ce extends W.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(K={}){super(K),this.browser=q,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Q.MutableDisposable),this._onCursorMove=this.register(new I.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new I.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new I.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new I.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new I.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new I.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new I.EventEmitter),this._onBlur=this.register(new I.EventEmitter),this._onA11yCharEmitter=this.register(new I.EventEmitter),this._onA11yTabEmitter=this.register(new I.EventEmitter),this._onWillOpen=this.register(new I.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(T.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((N,ie)=>this.refresh(N,ie)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((N=>this._reportWindowsOptions(N)))),this.register(this._inputHandler.onColor((N=>this._handleColorEvent(N)))),this.register((0,I.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,I.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((N=>this._afterResize(N.cols,N.rows)))),this.register((0,Q.toDisposable)((()=>{var N,ie;this._customKeyEventHandler=void 0,(ie=(N=this.element)==null?void 0:N.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(K){if(this._themeService)for(const N of K){let ie,se="";switch(N.index){case 256:ie="foreground",se="10";break;case 257:ie="background",se="11";break;case 258:ie="cursor",se="12";break;default:ie="ansi",se="4;"+N.index}switch(N.type){case 0:const fe=U.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[N.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${re.C0.ESC}]${se};${(0,A.toRgbString)(fe)}${re.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors((he=>he.ansi[N.index]=U.channels.toColor(...N.color)));else{const he=ie;this._themeService.modifyColors((ke=>ke[he]=U.channels.toColor(...N.color)))}break;case 2:this._themeService.restoreColor(N.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ee.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(re.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)==null?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(re.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 K=this.buffer.ybase+this.buffer.y,N=this.buffer.lines.get(K);if(!N)return;const ie=Math.min(this.buffer.x,this.cols-1),se=this._renderService.dimensions.css.cell.height,fe=N.getWidth(ie),he=this._renderService.dimensions.css.cell.width*fe,ke=this.buffer.y*this._renderService.dimensions.css.cell.height,Te=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Te+"px",this.textarea.style.top=ke+"px",this.textarea.style.width=he+"px",this.textarea.style.height=se+"px",this.textarea.style.lineHeight=se+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(N=>{this.hasSelection()&&(0,g.copyHandler)(N,this._selectionService)})));const K=N=>(0,g.handlePasteEvent)(N,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,y.addDisposableDomListener)(this.element,"paste",K)),q.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(N=>{N.button===2&&(0,g.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(N=>{(0,g.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),q.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(N=>{N.button===1&&(0,g.moveTextAreaUnderMouseCursor)(N,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(K=>this._keyUp(K)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(K=>this._keyDown(K)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(K=>this._keyPress(K)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(K=>this._compositionHelper.compositionupdate(K)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(K=>this._inputEvent(K)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(K){var ie;if(!K)throw new Error("Terminal requires a parent element.");if(K.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ie=this.element)==null?void 0:ie.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=K.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"),K.appendChild(this.element);const N=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),N.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,y.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),N.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.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(E.CoreBrowserService,this.textarea,K.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(a.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(H.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(j.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(L.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(N);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(w.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),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(ee.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(o.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const K=this,N=this.element;function ie(he){const ke=K._mouseService.getMouseReportCoords(he,K.screenElement);if(!ke)return!1;let Te,Me;switch(he.overrideType||he.type){case"mousemove":Me=32,he.buttons===void 0?(Te=3,he.button!==void 0&&(Te=he.button<3?he.button:3)):Te=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":Me=0,Te=he.button<3?he.button:3;break;case"mousedown":Me=1,Te=he.button<3?he.button:3;break;case"wheel":if(K._customWheelEventHandler&&K._customWheelEventHandler(he)===!1||K.viewport.getLinesScrolled(he)===0)return!1;Me=he.deltaY<0?0:1,Te=4;break;default:return!1}return!(Me===void 0||Te===void 0||Te>4)&&K.coreMouseService.triggerMouseEvent({col:ke.col,row:ke.row,x:ke.x,y:ke.y,button:Te,action:Me,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const se={mouseup:null,wheel:null,mousedrag:null,mousemove:null},fe={mouseup:he=>(ie(he),he.buttons||(this._document.removeEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.removeEventListener("mousemove",se.mousedrag)),this.cancel(he)),wheel:he=>(ie(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&ie(he)},mousemove:he=>{he.buttons||ie(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),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&he?se.mousemove||(N.addEventListener("mousemove",fe.mousemove),se.mousemove=fe.mousemove):(N.removeEventListener("mousemove",se.mousemove),se.mousemove=null),16&he?se.wheel||(N.addEventListener("wheel",fe.wheel,{passive:!1}),se.wheel=fe.wheel):(N.removeEventListener("wheel",se.wheel),se.wheel=null),2&he?se.mouseup||(se.mouseup=fe.mouseup):(this._document.removeEventListener("mouseup",se.mouseup),se.mouseup=null),4&he?se.mousedrag||(se.mousedrag=fe.mousedrag):(this._document.removeEventListener("mousemove",se.mousedrag),se.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(N,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return ie(he),se.mouseup&&this._document.addEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.addEventListener("mousemove",se.mousedrag),this.cancel(he)}))),this.register((0,y.addDisposableDomListener)(N,"wheel",(he=>{if(!se.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const ke=this.viewport.getLinesScrolled(he);if(ke===0)return;const Te=re.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let Me="";for(let Xe=0;Xe<Math.abs(ke);Xe++)Me+=Te;return this.coreService.triggerDataEvent(Me,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(N,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(N,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(K,N){var ie;(ie=this._renderService)==null||ie.refreshRows(K,N)}updateCursorStyle(K){var N;(N=this._selectionService)!=null&&N.shouldColumnSelect(K)?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(K,N,ie=0){var se;ie===1?(super.scrollLines(K,N,ie),this.refresh(0,this.rows-1)):(se=this.viewport)==null||se.scrollLines(K)}paste(K){(0,g.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}attachCustomWheelEventHandler(K){this._customWheelEventHandler=K}registerLinkProvider(K){return this._linkProviderService.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const N=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),N}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,N,ie){this._selectionService.setSelection(K,N,ie)}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 K;(K=this._selectionService)==null||K.clearSelection()}selectAll(){var K;(K=this._selectionService)==null||K.selectAll()}selectLines(K,N){var ie;(ie=this._selectionService)==null||ie.selectLines(K,N)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const N=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!N&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;N||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,X.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),ie.type===3||ie.type===2){const se=this.rows-1;return this.scrollLines(ie.type===2?-se:se),this.cancel(K,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(ie.cancel&&this.cancel(K,!0),!ie.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ie.key!==re.C0.ETX&&ie.key!==re.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ie.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,N){const ie=K.isMac&&!this.options.macOptionIsMeta&&N.altKey&&!N.ctrlKey&&!N.metaKey||K.isWindows&&N.altKey&&N.ctrlKey&&!N.metaKey||K.isWindows&&N.getModifierState("AltGraph");return N.type==="keypress"?ie:ie&&(!N.keyCode||N.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||((function(N){return N.keyCode===16||N.keyCode===17||N.keyCode===18})(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let N;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)N=K.charCode;else if(K.which===null||K.which===void 0)N=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;N=K.which}return!(!N||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||(N=String.fromCharCode(N),this._onKey.fire({key:N,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(N,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const N=K.data;return this.coreService.triggerDataEvent(N,!0),this.cancel(K),!0}return!1}resize(K,N){K!==this.cols||N!==this.rows?super.resize(K,N):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,N){var ie,se;(ie=this._charSizeService)==null||ie.measure(),(se=this.viewport)==null||se.syncScrollArea(!0)}clear(){var K;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 N=1;N<this.rows;N++)this.buffer.lines.push(this.buffer.getBlankLine(z.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(K=this.viewport)==null||K.reset(),this.refresh(0,this.rows-1)}}reset(){var N,ie;this.options.rows=this.rows,this.options.cols=this.cols;const K=this._customKeyEventHandler;this._setup(),super.reset(),(N=this._selectionService)==null||N.reset(),this._decorationService.reset(),(ie=this.viewport)==null||ie.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1)}clearTextureAtlas(){var K;(K=this._renderService)==null||K.clearTextureAtlas()}_reportFocus(){var K;(K=this.element)!=null&&K.classList.contains("focus")?this.coreService.triggerDataEvent(re.C0.ESC+"[I"):this.coreService.triggerDataEvent(re.C0.ESC+"[O")}_reportWindowsOptions(K){if(this._renderService)switch(K){case F.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const N=this._renderService.dimensions.css.canvas.width.toFixed(0),ie=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${re.C0.ESC}[4;${ie};${N}t`);break;case F.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const se=this._renderService.dimensions.css.cell.width.toFixed(0),fe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${re.C0.ESC}[6;${fe};${se}t`)}}cancel(K,N){if(this.options.cancelEvents||N)return K.preventDefault(),K.stopPropagation(),!1}}i.Terminal=ce},9924:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(c,g=1e3){this._renderCallback=c,this._debounceThresholdMS=g,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,g,y){this._rowCount=y,c=c!==void 0?c:0,g=g!==void 0?g:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,g):g;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=h-this._lastRefreshMs,x=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),g=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,g)}}},1680:function(R,i,c){var g=this&&this.__decorate||function(d,o,a,S){var E,L=arguments.length,j=L<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,a):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(d,o,a,S);else for(var w=d.length-1;w>=0;w--)(E=d[w])&&(j=(L<3?E(j):L>3?E(o,a,j):E(o,a))||j);return L>3&&j&&Object.defineProperty(o,a,j),j},y=this&&this.__param||function(d,o){return function(a,S){o(a,S,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;const h=c(3656),_=c(4725),x=c(8460),C=c(844),v=c(2585);let n=i.Viewport=class extends C.Disposable{constructor(d,o,a,S,E,L,j,w){super(),this._viewportElement=d,this._scrollArea=o,this._bufferService=a,this._optionsService=S,this._charSizeService=E,this._renderService=L,this._coreBrowserService=j,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(w.colors),this.register(w.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(d){this._viewportElement.style.backgroundColor=d.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(d){if(d)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 o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const d=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==d&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=d),this._refreshAnimationFrame=null}syncScrollArea(d=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(d);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(d)}_handleScroll(d){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 o=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const d=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(d*(this._smoothScrollState.target-this._smoothScrollState.origin)),d<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(d,o){const a=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(o<0&&this._viewportElement.scrollTop!==0||o>0&&a<this._lastRecordedBufferHeight)||(d.cancelable&&d.preventDefault(),!1)}handleWheel(d){const o=this._getPixelsScrolled(d);return o!==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+o:this._smoothScrollState.target+=o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=o,this._bubbleScroll(d,o))}scrollLines(d){if(d!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const o=d*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!1})}_getPixelsScrolled(d){if(d.deltaY===0||d.shiftKey)return 0;let o=this._applyScrollModifier(d.deltaY,d);return d.deltaMode===WheelEvent.DOM_DELTA_LINE?o*=this._currentRowHeight:d.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._currentRowHeight*this._bufferService.rows),o}getBufferElements(d,o){var w;let a,S="";const E=[],L=o??this._bufferService.buffer.lines.length,j=this._bufferService.buffer.lines;for(let D=d;D<L;D++){const H=j.get(D);if(!H)continue;const U=(w=j.get(D+1))==null?void 0:w.isWrapped;if(S+=H.translateToString(!U),!U||D===j.length-1){const W=document.createElement("div");W.textContent=S,E.push(W),S.length>0&&(a=W),S=""}}return{bufferElements:E,cursorElement:a}}getLinesScrolled(d){if(d.deltaY===0||d.shiftKey)return 0;let o=this._applyScrollModifier(d.deltaY,d);return d.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=this._currentRowHeight+0,this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):d.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(d,o){const a=this._optionsService.rawOptions.fastScrollModifier;return a==="alt"&&o.altKey||a==="ctrl"&&o.ctrlKey||a==="shift"&&o.shiftKey?d*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:d*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(d){this._lastTouchY=d.touches[0].pageY}handleTouchMove(d){const o=this._lastTouchY-d.touches[0].pageY;return this._lastTouchY=d.touches[0].pageY,o!==0&&(this._viewportElement.scrollTop+=o,this._bubbleScroll(d,o))}};i.Viewport=n=g([y(2,v.IBufferService),y(3,v.IOptionsService),y(4,_.ICharSizeService),y(5,_.IRenderService),y(6,_.ICoreBrowserService),y(7,_.IThemeService)],n)},3107:function(R,i,c){var g=this&&this.__decorate||function(v,n,d,o){var a,S=arguments.length,E=S<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,d):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,n,d,o);else for(var L=v.length-1;L>=0;L--)(a=v[L])&&(E=(S<3?a(E):S>3?a(n,d,E):a(n,d))||E);return S>3&&E&&Object.defineProperty(n,d,E),E},y=this&&this.__param||function(v,n){return function(d,o){n(d,o,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;const h=c(4725),_=c(844),x=c(2585);let C=i.BufferDecorationRenderer=class extends _.Disposable{constructor(v,n,d,o,a){super(),this._screenElement=v,this._bufferService=n,this._coreBrowserService=d,this._decorationService=o,this._renderService=a,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((S=>this._removeDecoration(S)))),this.register((0,_.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 v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var o;const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",((o=v==null?void 0:v.options)==null?void 0:o.layer)==="top"),n.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const d=v.options.x??0;return d&&d>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(v,n),n}_refreshStyle(v){const n=v.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let d=this._decorationElements.get(v);d||(d=this._createElement(v),v.element=d,this._decorationElements.set(v,d),this._container.appendChild(d),v.onDispose((()=>{this._decorationElements.delete(v),d.remove()}))),d.style.top=n*this._renderService.dimensions.css.cell.height+"px",d.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(d)}}_refreshXPosition(v,n=v.element){if(!n)return;const d=v.options.x??0;(v.options.anchor||"left")==="right"?n.style.right=d?d*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=d?d*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var n;(n=this._decorationElements.get(v))==null||n.remove(),this._decorationElements.delete(v),v.dispose()}};i.BufferDecorationRenderer=C=g([y(1,x.IBufferService),y(2,h.ICoreBrowserService),y(3,x.IDecorationService),y(4,h.IRenderService)],C)},5871:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.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(c){if(c.options.overviewRulerOptions){for(const g of this._zones)if(g.color===c.options.overviewRulerOptions.color&&g.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(g,c.marker.line))return;if(this._lineAdjacentToZone(g,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(g,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,g){return g>=c.startBufferLine&&g<=c.endBufferLine}_lineAdjacentToZone(c,g,y){return g>=c.startBufferLine-this._linePadding[y||"full"]&&g<=c.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(c,g){c.startBufferLine=Math.min(c.startBufferLine,g),c.endBufferLine=Math.max(c.endBufferLine,g)}}},5744:function(R,i,c){var g=this&&this.__decorate||function(a,S,E,L){var j,w=arguments.length,D=w<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(a,S,E,L);else for(var H=a.length-1;H>=0;H--)(j=a[H])&&(D=(w<3?j(D):w>3?j(S,E,D):j(S,E))||D);return w>3&&D&&Object.defineProperty(S,E,D),D},y=this&&this.__param||function(a,S){return function(E,L){S(E,L,a)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;const h=c(5871),_=c(4725),x=c(844),C=c(2585),v={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0};let o=i.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(a,S,E,L,j,w,D){var U;super(),this._viewportElement=a,this._screenElement=S,this._bufferService=E,this._decorationService=L,this._renderService=j,this._optionsService=w,this._coreBrowserService=D,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(U=this._viewportElement.parentElement)==null||U.insertBefore(this._canvas,this._viewportElement);const H=this._canvas.getContext("2d");if(!H)throw new Error("Ctx cannot be null");this._ctx=H,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{var W;(W=this._canvas)==null||W.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 a=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=a,n.center=S,n.right=a,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=n.left,d.right=n.left+n.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const a=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(a,12),6)*this._coreBrowserService.dpr);v.left=S,v.center=S,v.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const a=this._colorZoneStore.zones;for(const S of a)S.position!=="full"&&this._renderColorZone(S);for(const S of a)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(a){this._ctx.fillStyle=a.color,this._ctx.fillRect(d[a.position||"full"],Math.round((this._canvas.height-1)*(a.startBufferLine/this._bufferService.buffers.active.lines.length)-v[a.position||"full"]/2),n[a.position||"full"],Math.round((this._canvas.height-1)*((a.endBufferLine-a.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[a.position||"full"]))}_queueRefresh(a,S){this._shouldUpdateDimensions=a||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};i.OverviewRulerRenderer=o=g([y(2,C.IBufferService),y(3,C.IDecorationService),y(4,_.IRenderService),y(5,C.IOptionsService),y(6,_.ICoreBrowserService)],o)},2950:function(R,i,c){var g=this&&this.__decorate||function(v,n,d,o){var a,S=arguments.length,E=S<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,d):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,n,d,o);else for(var L=v.length-1;L>=0;L--)(a=v[L])&&(E=(S<3?a(E):S>3?a(n,d,E):a(n,d))||E);return S>3&&E&&Object.defineProperty(n,d,E),E},y=this&&this.__param||function(v,n){return function(d,o){n(d,o,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;const h=c(4725),_=c(2585),x=c(2584);let C=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,n,d,o,a,S){this._textarea=v,this._compositionView=n,this._bufferService=d,this._optionsService=o,this._coreService=a,this._renderService=S,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let d;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,d=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),d.length>0&&this._coreService.triggerDataEvent(d,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,d=n.replace(v,"");this._dataAlreadySent=d,n.length>v.length?this._coreService.triggerDataEvent(d,!0):n.length<v.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):n.length===v.length&&n!==v&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),d=this._renderService.dimensions.css.cell.height,o=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=o+"px",this._compositionView.style.height=d+"px",this._compositionView.style.lineHeight=d+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=o+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}v||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=C=g([y(2,_.IBufferService),y(3,_.IOptionsService),y(4,_.ICoreService),y(5,h.IRenderService)],C)},9806:(R,i)=>{function c(g,y,h){const _=h.getBoundingClientRect(),x=g.getComputedStyle(h),C=parseInt(x.getPropertyValue("padding-left")),v=parseInt(x.getPropertyValue("padding-top"));return[y.clientX-_.left-C,y.clientY-_.top-v]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=c,i.getCoords=function(g,y,h,_,x,C,v,n,d){if(!C)return;const o=c(g,y,h);return o?(o[0]=Math.ceil((o[0]+(d?v/2:0))/v),o[1]=Math.ceil(o[1]/n),o[0]=Math.min(Math.max(o[0],1),_+(d?1:0)),o[1]=Math.min(Math.max(o[1],1),x),o):void 0}},9504:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;const g=c(2584);function y(n,d,o,a){const S=n-h(n,o),E=d-h(d,o),L=Math.abs(S-E)-(function(j,w,D){let H=0;const U=j-h(j,D),W=w-h(w,D);for(let I=0;I<Math.abs(U-W);I++){const Q=_(j,w)==="A"?-1:1,q=D.buffer.lines.get(U+Q*I);q!=null&&q.isWrapped&&H++}return H})(n,d,o);return v(L,C(_(n,d),a))}function h(n,d){let o=0,a=d.buffer.lines.get(n),S=a==null?void 0:a.isWrapped;for(;S&&n>=0&&n<d.rows;)o++,a=d.buffer.lines.get(--n),S=a==null?void 0:a.isWrapped;return o}function _(n,d){return n>d?"A":"B"}function x(n,d,o,a,S,E){let L=n,j=d,w="";for(;L!==o||j!==a;)L+=S?1:-1,S&&L>E.cols-1?(w+=E.buffer.translateBufferLineToString(j,!1,n,L),L=0,n=0,j++):!S&&L<0&&(w+=E.buffer.translateBufferLineToString(j,!1,0,n+1),L=E.cols-1,n=L,j--);return w+E.buffer.translateBufferLineToString(j,!1,n,L)}function C(n,d){const o=d?"O":"[";return g.C0.ESC+o+n}function v(n,d){n=Math.floor(n);let o="";for(let a=0;a<n;a++)o+=d;return o}i.moveToCellSequence=function(n,d,o,a){const S=o.buffer.x,E=o.buffer.y;if(!o.buffer.hasScrollback)return(function(w,D,H,U,W,I){return y(D,U,W,I).length===0?"":v(x(w,D,w,D-h(D,W),!1,W).length,C("D",I))})(S,E,0,d,o,a)+y(E,d,o,a)+(function(w,D,H,U,W,I){let Q;Q=y(D,U,W,I).length>0?U-h(U,W):D;const q=U,z=(function(re,X,A,B,T,F){let ee;return ee=y(A,B,T,F).length>0?B-h(B,T):X,re<A&&ee<=B||re>=A&&ee<B?"C":"D"})(w,D,H,U,W,I);return v(x(w,Q,H,q,z==="C",W).length,C(z,I))})(S,E,n,d,o,a);let L;if(E===d)return L=S>n?"D":"C",v(Math.abs(S-n),C(L,a));L=E>d?"D":"C";const j=Math.abs(E-d);return v((function(w,D){return D.cols-w})(E>d?n:S,o)+(j-1)*o.cols+1+((E>d?S:n)-1),C(L,a))}},1296:function(R,i,c){var g=this&&this.__decorate||function(I,Q,q,z){var re,X=arguments.length,A=X<3?Q:z===null?z=Object.getOwnPropertyDescriptor(Q,q):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(I,Q,q,z);else for(var B=I.length-1;B>=0;B--)(re=I[B])&&(A=(X<3?re(A):X>3?re(Q,q,A):re(Q,q))||A);return X>3&&A&&Object.defineProperty(Q,q,A),A},y=this&&this.__param||function(I,Q){return function(q,z){Q(q,z,I)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;const h=c(3787),_=c(2550),x=c(2223),C=c(6171),v=c(6052),n=c(4725),d=c(8055),o=c(8460),a=c(844),S=c(2585),E="xterm-dom-renderer-owner-",L="xterm-rows",j="xterm-fg-",w="xterm-bg-",D="xterm-focus",H="xterm-selection";let U=1,W=i.DomRenderer=class extends a.Disposable{constructor(I,Q,q,z,re,X,A,B,T,F,ee,ne,ce){super(),this._terminal=I,this._document=Q,this._element=q,this._screenElement=z,this._viewportElement=re,this._helperContainer=X,this._linkifier2=A,this._charSizeService=T,this._optionsService=F,this._bufferService=ee,this._coreBrowserService=ne,this._themeService=ce,this._terminalClass=U++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new o.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(L),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(H),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((de=>this._injectCss(de)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((de=>this._handleLinkHover(de)))),this.register(this._linkifier2.onHideLinkUnderline((de=>this._handleLinkLeave(de)))),this.register((0,a.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.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 I=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*I,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*I),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/I),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/I),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 Q=`${this._terminalSelector} .${L} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Q,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(I){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Q=`${this._terminalSelector} .${L} { color: ${I.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Q+=`${this._terminalSelector} .${L} .xterm-dim { color: ${d.color.multiplyOpacity(I.foreground,.5).css};}`,Q+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const q=`blink_underline_${this._terminalClass}`,z=`blink_bar_${this._terminalClass}`,re=`blink_block_${this._terminalClass}`;Q+=`@keyframes ${q} { 50% { border-bottom-style: hidden; }}`,Q+=`@keyframes ${z} { 50% { box-shadow: none; }}`,Q+=`@keyframes ${re} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,Q+=`${this._terminalSelector} .${L}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${L}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${L}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${re} 1s step-end infinite;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css};}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Q+=`${this._terminalSelector} .${H} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${H} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${H} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[X,A]of I.ansi.entries())Q+=`${this._terminalSelector} .${j}${X} { color: ${A.css}; }${this._terminalSelector} .${j}${X}.xterm-dim { color: ${d.color.multiplyOpacity(A,.5).css}; }${this._terminalSelector} .${w}${X} { background-color: ${A.css}; }`;Q+=`${this._terminalSelector} .${j}${x.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(I.background).css}; }${this._terminalSelector} .${j}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${w}${x.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=Q}_setDefaultSpacing(){const I=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${I}px`,this._rowFactory.defaultSpacing=I}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(I,Q){for(let q=this._rowElements.length;q<=Q;q++){const z=this._document.createElement("div");this._rowContainer.appendChild(z),this._rowElements.push(z)}for(;this._rowElements.length>Q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,Q){this._refreshRowElements(I,Q),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,Q,q){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,Q,q),this.renderRows(0,this._bufferService.rows-1),!I||!Q)return;this._selectionRenderModel.update(this._terminal,I,Q,q);const z=this._selectionRenderModel.viewportStartRow,re=this._selectionRenderModel.viewportEndRow,X=this._selectionRenderModel.viewportCappedStartRow,A=this._selectionRenderModel.viewportCappedEndRow;if(X>=this._bufferService.rows||A<0)return;const B=this._document.createDocumentFragment();if(q){const T=I[0]>Q[0];B.appendChild(this._createSelectionElement(X,T?Q[0]:I[0],T?I[0]:Q[0],A-X+1))}else{const T=z===X?I[0]:0,F=X===re?Q[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(X,T,F));const ee=A-X-1;if(B.appendChild(this._createSelectionElement(X+1,0,this._bufferService.cols,ee)),X!==A){const ne=re===A?Q[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(A,0,ne))}}this._selectionContainer.appendChild(B)}_createSelectionElement(I,Q,q,z=1){const re=this._document.createElement("div"),X=Q*this.dimensions.css.cell.width;let A=this.dimensions.css.cell.width*(q-Q);return X+A>this.dimensions.css.canvas.width&&(A=this.dimensions.css.canvas.width-X),re.style.height=z*this.dimensions.css.cell.height+"px",re.style.top=I*this.dimensions.css.cell.height+"px",re.style.left=`${X}px`,re.style.width=`${A}px`,re}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 I of this._rowElements)I.replaceChildren()}renderRows(I,Q){const q=this._bufferService.buffer,z=q.ybase+q.y,re=Math.min(q.x,this._bufferService.cols-1),X=this._optionsService.rawOptions.cursorBlink,A=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let T=I;T<=Q;T++){const F=T+q.ydisp,ee=this._rowElements[T],ne=q.lines.get(F);if(!ee||!ne)break;ee.replaceChildren(...this._rowFactory.createRow(ne,F,F===z,A,B,re,X,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!0)}_handleLinkLeave(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!1)}_setCellUnderline(I,Q,q,z,re,X){q<0&&(I=0),z<0&&(Q=0);const A=this._bufferService.rows-1;q=Math.max(Math.min(q,A),0),z=Math.max(Math.min(z,A),0),re=Math.min(re,this._bufferService.cols);const B=this._bufferService.buffer,T=B.ybase+B.y,F=Math.min(B.x,re-1),ee=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let de=q;de<=z;++de){const K=de+B.ydisp,N=this._rowElements[de],ie=B.lines.get(K);if(!N||!ie)break;N.replaceChildren(...this._rowFactory.createRow(ie,K,K===T,ne,ce,F,ee,this.dimensions.css.cell.width,this._widthCache,X?de===q?I:0:-1,X?(de===z?Q:re)-1:-1))}}};i.DomRenderer=W=g([y(7,S.IInstantiationService),y(8,n.ICharSizeService),y(9,S.IOptionsService),y(10,S.IBufferService),y(11,n.ICoreBrowserService),y(12,n.IThemeService)],W)},3787:function(R,i,c){var g=this&&this.__decorate||function(L,j,w,D){var H,U=arguments.length,W=U<3?j:D===null?D=Object.getOwnPropertyDescriptor(j,w):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(L,j,w,D);else for(var I=L.length-1;I>=0;I--)(H=L[I])&&(W=(U<3?H(W):U>3?H(j,w,W):H(j,w))||W);return U>3&&W&&Object.defineProperty(j,w,W),W},y=this&&this.__param||function(L,j){return function(w,D){j(w,D,L)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;const h=c(2223),_=c(643),x=c(511),C=c(2585),v=c(8055),n=c(4725),d=c(4269),o=c(6171),a=c(3734);let S=i.DomRendererRowFactory=class{constructor(L,j,w,D,H,U,W){this._document=L,this._characterJoinerService=j,this._optionsService=w,this._coreBrowserService=D,this._coreService=H,this._decorationService=U,this._themeService=W,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(L,j,w){this._selectionStart=L,this._selectionEnd=j,this._columnSelectMode=w}createRow(L,j,w,D,H,U,W,I,Q,q,z){const re=[],X=this._characterJoinerService.getJoinedCharacters(j),A=this._themeService.colors;let B,T=L.getNoBgTrimmedLength();w&&T<U+1&&(T=U+1);let F=0,ee="",ne=0,ce=0,de=0,K=!1,N=0,ie=!1,se=0;const fe=[],he=q!==-1&&z!==-1;for(let ke=0;ke<T;ke++){L.loadCell(ke,this._workCell);let Te=this._workCell.getWidth();if(Te===0)continue;let Me=!1,Xe=ke,be=this._workCell;if(X.length>0&&ke===X[0][0]){Me=!0;const Oe=X.shift();be=new d.JoinedCellData(this._workCell,L.translateToString(!0,Oe[0],Oe[1]),Oe[1]-Oe[0]),Xe=Oe[1]-1,Te=be.getWidth()}const nr=this._isCellInSelection(ke,j),Tr=w&&ke===U,Qt=he&&ke>=q&&ke<=z;let Ut=!1;this._decorationService.forEachDecorationAtCell(ke,j,void 0,(Oe=>{Ut=!0}));let or=be.getChars()||_.WHITESPACE_CELL_CHAR;if(or===" "&&(be.isUnderline()||be.isOverline())&&(or=" "),se=Te*I-Q.get(or,be.isBold(),be.isItalic()),B){if(F&&(nr&&ie||!nr&&!ie&&be.bg===ne)&&(nr&&ie&&A.selectionForeground||be.fg===ce)&&be.extended.ext===de&&Qt===K&&se===N&&!Tr&&!Me&&!Ut){be.isInvisible()?ee+=_.WHITESPACE_CELL_CHAR:ee+=or,F++;continue}F&&(B.textContent=ee),B=this._document.createElement("span"),F=0,ee=""}else B=this._document.createElement("span");if(ne=be.bg,ce=be.fg,de=be.extended.ext,K=Qt,N=se,ie=nr,Me&&U>=ke&&U<=Xe&&(U=ke),!this._coreService.isCursorHidden&&Tr&&this._coreService.isCursorInitialized){if(fe.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&fe.push("xterm-cursor-blink"),fe.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(H)switch(H){case"outline":fe.push("xterm-cursor-outline");break;case"block":fe.push("xterm-cursor-block");break;case"bar":fe.push("xterm-cursor-bar");break;case"underline":fe.push("xterm-cursor-underline")}}if(be.isBold()&&fe.push("xterm-bold"),be.isItalic()&&fe.push("xterm-italic"),be.isDim()&&fe.push("xterm-dim"),ee=be.isInvisible()?_.WHITESPACE_CELL_CHAR:be.getChars()||_.WHITESPACE_CELL_CHAR,be.isUnderline()&&(fe.push(`xterm-underline-${be.extended.underlineStyle}`),ee===" "&&(ee=" "),!be.isUnderlineColorDefault()))if(be.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${a.AttributeData.toColorRGB(be.getUnderlineColor()).join(",")})`;else{let Oe=be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&be.isBold()&&Oe<8&&(Oe+=8),B.style.textDecorationColor=A.ansi[Oe].css}be.isOverline()&&(fe.push("xterm-overline"),ee===" "&&(ee=" ")),be.isStrikethrough()&&fe.push("xterm-strikethrough"),Qt&&(B.style.textDecoration="underline");let nt=be.getFgColor(),ar=be.getFgColorMode(),gt=be.getBgColor(),lr=be.getBgColorMode();const Ar=!!be.isInverse();if(Ar){const Oe=nt;nt=gt,gt=Oe;const vi=ar;ar=lr,lr=vi}let vt,Mr,ct,Tt=!1;switch(this._decorationService.forEachDecorationAtCell(ke,j,void 0,(Oe=>{Oe.options.layer!=="top"&&Tt||(Oe.backgroundColorRGB&&(lr=50331648,gt=Oe.backgroundColorRGB.rgba>>8&16777215,vt=Oe.backgroundColorRGB),Oe.foregroundColorRGB&&(ar=50331648,nt=Oe.foregroundColorRGB.rgba>>8&16777215,Mr=Oe.foregroundColorRGB),Tt=Oe.options.layer==="top")})),!Tt&&nr&&(vt=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,gt=vt.rgba>>8&16777215,lr=50331648,Tt=!0,A.selectionForeground&&(ar=50331648,nt=A.selectionForeground.rgba>>8&16777215,Mr=A.selectionForeground)),Tt&&fe.push("xterm-decoration-top"),lr){case 16777216:case 33554432:ct=A.ansi[gt],fe.push(`xterm-bg-${gt}`);break;case 50331648:ct=v.channels.toColor(gt>>16,gt>>8&255,255>),this._addStyle(B,`background-color:#${E((gt>>>0).toString(16),"0",6)}`);break;default:Ar?(ct=A.foreground,fe.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):ct=A.background}switch(vt||be.isDim()&&(vt=v.color.multiplyOpacity(ct,.5)),ar){case 16777216:case 33554432:be.isBold()&&nt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(nt+=8),this._applyMinimumContrast(B,ct,A.ansi[nt],be,vt,void 0)||fe.push(`xterm-fg-${nt}`);break;case 50331648:const Oe=v.channels.toColor(nt>>16&255,nt>>8&255,255&nt);this._applyMinimumContrast(B,ct,Oe,be,vt,Mr)||this._addStyle(B,`color:#${E(nt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,ct,A.foreground,be,vt,Mr)||Ar&&fe.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}fe.length&&(B.className=fe.join(" "),fe.length=0),Tr||Me||Ut?B.textContent=ee:F++,se!==this.defaultSpacing&&(B.style.letterSpacing=`${se}px`),re.push(B),ke=Xe}return B&&F&&(B.textContent=ee),re}_applyMinimumContrast(L,j,w,D,H,U){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const W=this._getContrastCache(D);let I;if(H||U||(I=W.getColor(j.rgba,w.rgba)),I===void 0){const Q=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);I=v.color.ensureContrastRatio(H||j,U||w,Q),W.setColor((H||j).rgba,(U||w).rgba,I??null)}return!!I&&(this._addStyle(L,`color:${I.css}`),!0)}_getContrastCache(L){return L.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(L,j){L.setAttribute("style",`${L.getAttribute("style")||""}${j};`)}_isCellInSelection(L,j){const w=this._selectionStart,D=this._selectionEnd;return!(!w||!D)&&(this._columnSelectMode?w[0]<=D[0]?L>=w[0]&&j>=w[1]&&L<D[0]&&j<=D[1]:L<w[0]&&j>=w[1]&&L>=D[0]&&j<=D[1]:j>w[1]&&j<D[1]||w[1]===D[1]&&j===w[1]&&L>=w[0]&&L<D[0]||w[1]<D[1]&&j===D[1]&&L<D[0]||w[1]<D[1]&&j===w[1]&&L>=w[0])}};function E(L,j,w){for(;L.length<w;)L=j+L;return L}i.DomRendererRowFactory=S=g([y(1,n.ICharacterJoinerService),y(2,C.IOptionsService),y(3,n.ICoreBrowserService),y(4,C.ICoreService),y(5,C.IDecorationService),y(6,n.IThemeService)],S)},2550:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(c,g){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const y=c.createElement("span");y.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const x=c.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[y,h,_,x],this._container.appendChild(y),this._container.appendChild(h),this._container.appendChild(_),this._container.appendChild(x),g.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(c,g,y,h){c===this._font&&g===this._fontSize&&y===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=g,this._weight=y,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,g,y){let h=0;if(!g&&!y&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const C=this._measure(c,0);return C>0&&(this._flat[h]=C),C}let _=c;g&&(_+="B"),y&&(_+="I");let x=this._holey.get(_);if(x===void 0){let C=0;g&&(C|=1),y&&(C|=2),x=this._measure(c,C),x>0&&this._holey.set(_,x)}return x}_measure(c,g){const y=this._measureElements[g];return y.textContent=c.repeat(32),y.offsetWidth/32}}},2223:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const g=c(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=g.isFirefox||g.isLegacyEdge?"bottom":"ideographic"},6171:(R,i)=>{function c(y){return 57508<=y&&y<=57558}function g(y){return y>=128512&&y<=128591||y>=127744&&y<=128511||y>=128640&&y<=128767||y>=9728&&y<=9983||y>=9984&&y<=10175||y>=65024&&y<=65039||y>=129280&&y<=129535||y>=127462&&y<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(y){if(!y)throw new Error("value must not be falsy");return y},i.isPowerlineGlyph=c,i.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},i.isEmoji=g,i.allowRescaling=function(y,h,_,x){return h===1&&_>Math.ceil(1.5*x)&&y!==void 0&&y>255&&!g(y)&&!c(y)&&!(function(C){return 57344<=C&&C<=63743})(y)},i.treatGlyphAsBackgroundColor=function(y){return c(y)||(function(h){return 9472<=h&&h<=9631})(y)},i.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}}}},i.computeNextVariantOffset=function(y,h,_=0){return(y-(2*Math.round(h)-_))%(2*Math.round(h))}},6052:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(y,h,_,x=!1){if(this.selectionStart=h,this.selectionEnd=_,!h||!_||h[0]===_[0]&&h[1]===_[1])return void this.clear();const C=y.buffers.active.ydisp,v=h[1]-C,n=_[1]-C,d=Math.max(v,0),o=Math.min(n,y.rows-1);d>=y.rows||o<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=v,this.viewportEndRow=n,this.viewportCappedStartRow=d,this.viewportCappedEndRow=o,this.startCol=h[0],this.endCol=_[0])}isCellSelected(y,h,_){return!!this.hasSelection&&(_-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&_>=this.viewportCappedStartRow&&h<this.endCol&&_<=this.viewportCappedEndRow:h<this.startCol&&_>=this.viewportCappedStartRow&&h>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol)}}i.createSelectionRenderModel=function(){return new c}},456:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(c){this._bufferService=c,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 c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,g=this.selectionEnd;return!(!c||!g)&&(c[1]>g[1]||c[1]===g[1]&&c[0]>g[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(R,i,c){var g=this&&this.__decorate||function(o,a,S,E){var L,j=arguments.length,w=j<3?a:E===null?E=Object.getOwnPropertyDescriptor(a,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(o,a,S,E);else for(var D=o.length-1;D>=0;D--)(L=o[D])&&(w=(j<3?L(w):j>3?L(a,S,w):L(a,S))||w);return j>3&&w&&Object.defineProperty(a,S,w),w},y=this&&this.__param||function(o,a){return function(S,E){a(S,E,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;const h=c(2585),_=c(8460),x=c(844);let C=i.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(o,a,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new d(this._optionsService))}catch{this._measureStrategy=this.register(new n(o,a,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const o=this._measureStrategy.measure();o.width===this.width&&o.height===this.height||(this.width=o.width,this.height=o.height,this._onCharSizeChange.fire())}};i.CharSizeService=C=g([y(2,h.IOptionsService)],C);class v extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(a,S){a!==void 0&&a>0&&S!==void 0&&S>0&&(this._result.width=a,this._result.height=S)}}class n extends v{constructor(a,S,E){super(),this._document=a,this._parentElement=S,this._optionsService=E,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 d extends v{constructor(a){super(),this._optionsService=a,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const a=this._ctx.measureText("W");return this._validateAndSet(a.width,a.fontBoundingBoxAscent+a.fontBoundingBoxDescent),this._result}}},4269:function(R,i,c){var g=this&&this.__decorate||function(d,o,a,S){var E,L=arguments.length,j=L<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,a):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(d,o,a,S);else for(var w=d.length-1;w>=0;w--)(E=d[w])&&(j=(L<3?E(j):L>3?E(o,a,j):E(o,a))||j);return L>3&&j&&Object.defineProperty(o,a,j),j},y=this&&this.__param||function(d,o){return function(a,S){o(a,S,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;const h=c(3734),_=c(643),x=c(511),C=c(2585);class v extends h.AttributeData{constructor(o,a,S){super(),this.content=0,this.combinedData="",this.fg=o.fg,this.bg=o.bg,this.combinedData=a,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(o){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=v;let n=i.CharacterJoinerService=class Ed{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(o){const a={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(a),a.id}deregister(o){for(let a=0;a<this._characterJoiners.length;a++)if(this._characterJoiners[a].id===o)return this._characterJoiners.splice(a,1),!0;return!1}getJoinedCharacters(o){if(this._characterJoiners.length===0)return[];const a=this._bufferService.buffer.lines.get(o);if(!a||a.length===0)return[];const S=[],E=a.translateToString(!0);let L=0,j=0,w=0,D=a.getFg(0),H=a.getBg(0);for(let U=0;U<a.getTrimmedLength();U++)if(a.loadCell(U,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==D||this._workCell.bg!==H){if(U-L>1){const W=this._getJoinedRanges(E,w,j,a,L);for(let I=0;I<W.length;I++)S.push(W[I])}L=U,w=j,D=this._workCell.fg,H=this._workCell.bg}j+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-L>1){const U=this._getJoinedRanges(E,w,j,a,L);for(let W=0;W<U.length;W++)S.push(U[W])}return S}_getJoinedRanges(o,a,S,E,L){const j=o.substring(a,S);let w=[];try{w=this._characterJoiners[0].handler(j)}catch(D){console.error(D)}for(let D=1;D<this._characterJoiners.length;D++)try{const H=this._characterJoiners[D].handler(j);for(let U=0;U<H.length;U++)Ed._mergeRanges(w,H[U])}catch(H){console.error(H)}return this._stringRangesToCellRanges(w,E,L),w}_stringRangesToCellRanges(o,a,S){let E=0,L=!1,j=0,w=o[E];if(w){for(let D=S;D<this._bufferService.cols;D++){const H=a.getWidth(D),U=a.getString(D).length||_.WHITESPACE_CELL_CHAR.length;if(H!==0){if(!L&&w[0]<=j&&(w[0]=D,L=!0),w[1]<=j){if(w[1]=D,w=o[++E],!w)break;w[0]<=j?(w[0]=D,L=!0):L=!1}j+=U}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(o,a){let S=!1;for(let E=0;E<o.length;E++){const L=o[E];if(S){if(a[1]<=L[0])return o[E-1][1]=a[1],o;if(a[1]<=L[1])return o[E-1][1]=Math.max(a[1],L[1]),o.splice(E,1),o;o.splice(E,1),E--}else{if(a[1]<=L[0])return o.splice(E,0,a),o;if(a[1]<=L[1])return L[0]=Math.min(a[0],L[0]),o;a[0]<L[1]&&(L[0]=Math.min(a[0],L[0]),S=!0)}}return S?o[o.length-1][1]=a[1]:o.push(a),o}};i.CharacterJoinerService=n=g([y(0,C.IBufferService)],n)},5114:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;const g=c(844),y=c(8460),h=c(3656);class _ extends g.Disposable{constructor(v,n,d){super(),this._textarea=v,this._window=n,this.mainDocument=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new y.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((o=>this._screenDprMonitor.setWindow(o)))),this.register((0,y.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(v){this._window!==v&&(this._window=v,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}}i.CoreBrowserService=_;class x extends g.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new g.MutableDisposable),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,g.toDisposable)((()=>this.clearListener())))}setWindow(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.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:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;const g=c(844);class y extends g.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,g.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const x=this.linkProviders.indexOf(_);x!==-1&&this.linkProviders.splice(x,1)}}}}i.LinkProviderService=y},8934:function(R,i,c){var g=this&&this.__decorate||function(C,v,n,d){var o,a=arguments.length,S=a<3?v:d===null?d=Object.getOwnPropertyDescriptor(v,n):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(C,v,n,d);else for(var E=C.length-1;E>=0;E--)(o=C[E])&&(S=(a<3?o(S):a>3?o(v,n,S):o(v,n))||S);return a>3&&S&&Object.defineProperty(v,n,S),S},y=this&&this.__param||function(C,v){return function(n,d){v(n,d,C)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;const h=c(4725),_=c(9806);let x=i.MouseService=class{constructor(C,v){this._renderService=C,this._charSizeService=v}getCoords(C,v,n,d,o){return(0,_.getCoords)(window,C,v,n,d,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(C,v){const n=(0,_.getCoordsRelativeToElement)(window,C,v);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};i.MouseService=x=g([y(0,h.IRenderService),y(1,h.ICharSizeService)],x)},3230:function(R,i,c){var g=this&&this.__decorate||function(o,a,S,E){var L,j=arguments.length,w=j<3?a:E===null?E=Object.getOwnPropertyDescriptor(a,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(o,a,S,E);else for(var D=o.length-1;D>=0;D--)(L=o[D])&&(w=(j<3?L(w):j>3?L(a,S,w):L(a,S))||w);return j>3&&w&&Object.defineProperty(a,S,w),w},y=this&&this.__param||function(o,a){return function(S,E){a(S,E,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;const h=c(6193),_=c(4725),x=c(8460),C=c(844),v=c(7226),n=c(2585);let d=i.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(o,a,S,E,L,j,w,D){super(),this._rowCount=o,this._charSizeService=E,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((H,U)=>this._renderRows(H,U)),w),this.register(this._renderDebouncer),this.register(w.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(j.onResize((()=>this._fullRefresh()))),this.register(j.buffers.onBufferActivate((()=>{var H;return(H=this._renderer.value)==null?void 0:H.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(L.onDecorationRegistered((()=>this._fullRefresh()))),this.register(L.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(j.cols,j.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(j.buffer.y,j.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(w.window,a),this.register(w.onWindowChange((H=>this._registerIntersectionObserver(H,a))))}_registerIntersectionObserver(o,a){if("IntersectionObserver"in o){const S=new o.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});S.observe(a),this._observerDisposable.value=(0,C.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(o){this._isPaused=o.isIntersecting===void 0?o.intersectionRatio===0:!o.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(o,a,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(o,a,this._rowCount))}_renderRows(o,a){this._renderer.value&&(o=Math.min(o,this._rowCount-1),a=Math.min(a,this._rowCount-1),this._renderer.value.renderRows(o,a),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:o,end:a}),this._onRender.fire({start:o,end:a}),this._isNextRenderRedrawOnly=!0)}resize(o,a){this._rowCount=a,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(o){this._renderer.value=o,this._renderer.value&&(this._renderer.value.onRequestRedraw((a=>this.refreshRows(a.start,a.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(o){return this._renderDebouncer.addRefreshCallback(o)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var o,a;this._renderer.value&&((a=(o=this._renderer.value).clearTextureAtlas)==null||a.call(o),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(o,a){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(o,a)})):this._renderer.value.handleResize(o,a),this._fullRefresh())}handleCharSizeChanged(){var o;(o=this._renderer.value)==null||o.handleCharSizeChanged()}handleBlur(){var o;(o=this._renderer.value)==null||o.handleBlur()}handleFocus(){var o;(o=this._renderer.value)==null||o.handleFocus()}handleSelectionChanged(o,a,S){var E;this._selectionState.start=o,this._selectionState.end=a,this._selectionState.columnSelectMode=S,(E=this._renderer.value)==null||E.handleSelectionChanged(o,a,S)}handleCursorMove(){var o;(o=this._renderer.value)==null||o.handleCursorMove()}clear(){var o;(o=this._renderer.value)==null||o.clear()}};i.RenderService=d=g([y(2,n.IOptionsService),y(3,_.ICharSizeService),y(4,n.IDecorationService),y(5,n.IBufferService),y(6,_.ICoreBrowserService),y(7,_.IThemeService)],d)},9312:function(R,i,c){var g=this&&this.__decorate||function(w,D,H,U){var W,I=arguments.length,Q=I<3?D:U===null?U=Object.getOwnPropertyDescriptor(D,H):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(w,D,H,U);else for(var q=w.length-1;q>=0;q--)(W=w[q])&&(Q=(I<3?W(Q):I>3?W(D,H,Q):W(D,H))||Q);return I>3&&Q&&Object.defineProperty(D,H,Q),Q},y=this&&this.__param||function(w,D){return function(H,U){D(H,U,w)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;const h=c(9806),_=c(9504),x=c(456),C=c(4725),v=c(8460),n=c(844),d=c(6114),o=c(4841),a=c(511),S=c(2585),E=" ",L=new RegExp(E,"g");let j=i.SelectionService=class extends n.Disposable{constructor(w,D,H,U,W,I,Q,q,z){super(),this._element=w,this._screenElement=D,this._linkifier=H,this._bufferService=U,this._coreService=W,this._mouseService=I,this._optionsService=Q,this._renderService=q,this._coreBrowserService=z,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new a.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=re=>this._handleMouseMove(re),this._mouseUpListener=re=>this._handleMouseUp(re),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((re=>this._handleTrim(re))),this.register(this._bufferService.buffers.onBufferActivate((re=>this._handleBufferActivate(re)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const w=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!w||!D||w[0]===D[0]&&w[1]===D[1])}get selectionText(){const w=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!w||!D)return"";const H=this._bufferService.buffer,U=[];if(this._activeSelectionMode===3){if(w[0]===D[0])return"";const W=w[0]<D[0]?w[0]:D[0],I=w[0]<D[0]?D[0]:w[0];for(let Q=w[1];Q<=D[1];Q++){const q=H.translateBufferLineToString(Q,!0,W,I);U.push(q)}}else{const W=w[1]===D[1]?D[0]:void 0;U.push(H.translateBufferLineToString(w[1],!0,w[0],W));for(let I=w[1]+1;I<=D[1]-1;I++){const Q=H.lines.get(I),q=H.translateBufferLineToString(I,!0);Q!=null&&Q.isWrapped?U[U.length-1]+=q:U.push(q)}if(w[1]!==D[1]){const I=H.lines.get(D[1]),Q=H.translateBufferLineToString(D[1],!0,0,D[0]);I&&I.isWrapped?U[U.length-1]+=Q:U.push(Q)}}return U.map((W=>W.replace(L," "))).join(d.isWindows?`\r
|
|
46
|
-
`:`
|
|
47
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(w){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),d.isLinux&&w&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(w){const D=this._getMouseBufferCoords(w),H=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!!(H&&U&&D)&&this._areCoordsInSelection(D,H,U)}isCellInSelection(w,D){const H=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!(!H||!U)&&this._areCoordsInSelection([w,D],H,U)}_areCoordsInSelection(w,D,H){return w[1]>D[1]&&w[1]<H[1]||D[1]===H[1]&&w[1]===D[1]&&w[0]>=D[0]&&w[0]<H[0]||D[1]<H[1]&&w[1]===H[1]&&w[0]<H[0]||D[1]<H[1]&&w[1]===D[1]&&w[0]>=D[0]}_selectWordAtCursor(w,D){var W,I;const H=(I=(W=this._linkifier.currentLink)==null?void 0:W.link)==null?void 0:I.range;if(H)return this._model.selectionStart=[H.start.x-1,H.start.y-1],this._model.selectionStartLength=(0,o.getRangeLength)(H,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const U=this._getMouseBufferCoords(w);return!!U&&(this._selectWordAt(U,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,D){this._model.clearSelection(),w=Math.max(w,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const D=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(w){let D=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const H=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=H?0:(D>H&&(D-=H),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(w){return d.isMac?w.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:w.shiftKey}handleMouseDown(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._handleIncrementalClick(w):w.detail===1?this._handleSingleClick(w):w.detail===2?this._handleDoubleClick(w):w.detail===3&&this._handleTripleClick(w),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))}_handleSingleClick(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const D=this._getMouseBufferCoords(w);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(w){return w.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const D=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(w),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const H=this._bufferService.buffer;if(this._model.selectionEnd[1]<H.lines.length){const U=H.lines.get(this._model.selectionEnd[1]);U&&U.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}D&&D[0]===this._model.selectionEnd[0]&&D[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const w=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}}_handleMouseUp(w){const D=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&w.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const H=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(H&&H[0]!==void 0&&H[1]!==void 0){const U=(0,_.moveToCellSequence)(H[0]-1,H[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(U,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,H=!(!w||!D||w[0]===D[0]&&w[1]===D[1]);H?w&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,D,H)):this._oldHasSelection&&this._fireOnSelectionChange(w,D,H)}_fireOnSelectionChange(w,D,H){this._oldSelectionStart=w,this._oldSelectionEnd=D,this._oldHasSelection=H,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(w,D){let H=D;for(let U=0;D>=U;U++){const W=w.loadCell(U,this._workCell).getChars().length;this._workCell.getWidth()===0?H--:W>1&&D!==U&&(H+=W-1)}return H}setSelection(w,D,H){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,D],this._model.selectionStartLength=H,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,D,H=!0,U=!0){if(w[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,I=W.lines.get(w[1]);if(!I)return;const Q=W.translateBufferLineToString(w[1],!1);let q=this._convertViewportColToCharacterIndex(I,w[0]),z=q;const re=w[0]-q;let X=0,A=0,B=0,T=0;if(Q.charAt(q)===" "){for(;q>0&&Q.charAt(q-1)===" ";)q--;for(;z<Q.length&&Q.charAt(z+1)===" ";)z++}else{let ne=w[0],ce=w[0];I.getWidth(ne)===0&&(X++,ne--),I.getWidth(ce)===2&&(A++,ce++);const de=I.getString(ce).length;for(de>1&&(T+=de-1,z+=de-1);ne>0&&q>0&&!this._isCharWordSeparator(I.loadCell(ne-1,this._workCell));){I.loadCell(ne-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(X++,ne--):K>1&&(B+=K-1,q-=K-1),q--,ne--}for(;ce<I.length&&z+1<Q.length&&!this._isCharWordSeparator(I.loadCell(ce+1,this._workCell));){I.loadCell(ce+1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===2?(A++,ce++):K>1&&(T+=K-1,z+=K-1),z++,ce++}}z++;let F=q+re-X+B,ee=Math.min(this._bufferService.cols,z-q+X+A-B-T);if(D||Q.slice(q,z).trim()!==""){if(H&&F===0&&I.getCodePoint(0)!==32){const ne=W.lines.get(w[1]-1);if(ne&&I.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(ce){const de=this._bufferService.cols-ce.start;F-=de,ee+=de}}}if(U&&F+ee===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const ne=W.lines.get(w[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const ce=this._getWordAt([0,w[1]+1],!1,!1,!0);ce&&(ee+=ce.length)}}return{start:F,length:ee}}}_selectWordAt(w,D){const H=this._getWordAt(w,D);if(H){for(;H.start<0;)H.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[H.start,w[1]],this._model.selectionStartLength=H.length}}_selectToWordAt(w){const D=this._getWordAt(w,!0);if(D){let H=w[1];for(;D.start<0;)D.start+=this._bufferService.cols,H--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,H++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,H]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const D=this._bufferService.buffer.getWrappedRangeForLine(w),H={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(H,this._bufferService.cols)}};i.SelectionService=j=g([y(3,S.IBufferService),y(4,S.ICoreService),y(5,C.IMouseService),y(6,S.IOptionsService),y(7,C.IRenderService),y(8,C.ICoreBrowserService)],j)},4725:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;const g=c(8343);i.ICharSizeService=(0,g.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,g.createDecorator)("CoreBrowserService"),i.IMouseService=(0,g.createDecorator)("MouseService"),i.IRenderService=(0,g.createDecorator)("RenderService"),i.ISelectionService=(0,g.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,g.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,g.createDecorator)("ThemeService"),i.ILinkProviderService=(0,g.createDecorator)("LinkProviderService")},6731:function(R,i,c){var g=this&&this.__decorate||function(j,w,D,H){var U,W=arguments.length,I=W<3?w:H===null?H=Object.getOwnPropertyDescriptor(w,D):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(j,w,D,H);else for(var Q=j.length-1;Q>=0;Q--)(U=j[Q])&&(I=(W<3?U(I):W>3?U(w,D,I):U(w,D))||I);return W>3&&I&&Object.defineProperty(w,D,I),I},y=this&&this.__param||function(j,w){return function(D,H){w(D,H,j)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),_=c(8055),x=c(8460),C=c(844),v=c(2585),n=_.css.toColor("#ffffff"),d=_.css.toColor("#000000"),o=_.css.toColor("#ffffff"),a=_.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const j=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let D=0;D<216;D++){const H=w[D/36%6|0],U=w[D/6%6|0],W=w[D%6];j.push({css:_.channels.toCss(H,U,W),rgba:_.channels.toRgba(H,U,W)})}for(let D=0;D<24;D++){const H=8+10*D;j.push({css:_.channels.toCss(H,H,H),rgba:_.channels.toRgba(H,H,H)})}return j})());let E=i.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(j){super(),this._optionsService=j,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:d,cursor:o,cursorAccent:a,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:_.color.blend(d,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:_.color.blend(d,S),ansi:i.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(j={}){const w=this._colors;if(w.foreground=L(j.foreground,n),w.background=L(j.background,d),w.cursor=L(j.cursor,o),w.cursorAccent=L(j.cursorAccent,a),w.selectionBackgroundTransparent=L(j.selectionBackground,S),w.selectionBackgroundOpaque=_.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=L(j.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=_.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=j.selectionForeground?L(j.selectionForeground,_.NULL_COLOR):void 0,w.selectionForeground===_.NULL_COLOR&&(w.selectionForeground=void 0),_.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=_.color.opacity(w.selectionBackgroundTransparent,.3)),_.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=_.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=i.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=L(j.black,i.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=L(j.red,i.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=L(j.green,i.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=L(j.yellow,i.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=L(j.blue,i.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=L(j.magenta,i.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=L(j.cyan,i.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=L(j.white,i.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=L(j.brightBlack,i.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=L(j.brightRed,i.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=L(j.brightGreen,i.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=L(j.brightYellow,i.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=L(j.brightBlue,i.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=L(j.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=L(j.brightCyan,i.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=L(j.brightWhite,i.DEFAULT_ANSI_COLORS[15]),j.extendedAnsi){const D=Math.min(w.ansi.length-16,j.extendedAnsi.length);for(let H=0;H<D;H++)w.ansi[H+16]=L(j.extendedAnsi[H],i.DEFAULT_ANSI_COLORS[H+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(j){this._restoreColor(j),this._onChangeColors.fire(this.colors)}_restoreColor(j){if(j!==void 0)switch(j){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[j]=this._restoreColors.ansi[j]}else for(let w=0;w<this._restoreColors.ansi.length;++w)this._colors.ansi[w]=this._restoreColors.ansi[w]}modifyColors(j){j(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 L(j,w){if(j!==void 0)try{return _.css.toColor(j)}catch{}return w}i.ThemeService=E=g([y(0,v.IOptionsService)],E)},6349:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;const g=c(8460),y=c(844);class h extends y.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new g.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new g.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new g.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const C=new Array(x);for(let v=0;v<Math.min(x,this.length);v++)C[v]=this._array[this._getCyclicIndex(v)];this._array=C,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let C=this._length;C<x;C++)this._array[C]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,C){this._array[this._getCyclicIndex(x)]=C}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,C,...v){if(C){for(let n=x;n<this._length-C;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+C)];this._length-=C,this.onDeleteEmitter.fire({index:x,amount:C})}for(let n=this._length-1;n>=x;n--)this._array[this._getCyclicIndex(n+v.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<v.length;n++)this._array[this._getCyclicIndex(x+n)]=v[n];if(v.length&&this.onInsertEmitter.fire({index:x,amount:v.length}),this._length+v.length>this._maxLength){const n=this._length+v.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=v.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,C,v){if(!(C<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let d=C-1;d>=0;d--)this.set(x+d+v,this.get(x+d));const n=x+C+v-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<C;n++)this.set(x+n+v,this.get(x+n))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}i.CircularList=h},1439:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function c(g,y=5){if(typeof g!="object")return g;const h=Array.isArray(g)?[]:{};for(const _ in g)h[_]=y<=1?g[_]:g[_]&&c(g[_],y-1);return h}},8055:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let c=0,g=0,y=0,h=0;var _,x,C,v,n;function d(a){const S=a.toString(16);return S.length<2?"0"+S:S}function o(a,S){return a<S?(S+.05)/(a+.05):(a+.05)/(S+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(a){a.toCss=function(S,E,L,j){return j!==void 0?`#${d(S)}${d(E)}${d(L)}${d(j)}`:`#${d(S)}${d(E)}${d(L)}`},a.toRgba=function(S,E,L,j=255){return(S<<24|E<<16|L<<8|j)>>>0},a.toColor=function(S,E,L,j){return{css:a.toCss(S,E,L,j),rgba:a.toRgba(S,E,L,j)}}})(_||(i.channels=_={})),(function(a){function S(E,L){return h=Math.round(255*L),[c,g,y]=n.toChannels(E.rgba),{css:_.toCss(c,g,y,h),rgba:_.toRgba(c,g,y,h)}}a.blend=function(E,L){if(h=(255&L.rgba)/255,h===1)return{css:L.css,rgba:L.rgba};const j=L.rgba>>24&255,w=L.rgba>>16&255,D=L.rgba>>8&255,H=E.rgba>>24&255,U=E.rgba>>16&255,W=E.rgba>>8&255;return c=H+Math.round((j-H)*h),g=U+Math.round((w-U)*h),y=W+Math.round((D-W)*h),{css:_.toCss(c,g,y),rgba:_.toRgba(c,g,y)}},a.isOpaque=function(E){return(255&E.rgba)==255},a.ensureContrastRatio=function(E,L,j){const w=n.ensureContrastRatio(E.rgba,L.rgba,j);if(w)return _.toColor(w>>24&255,w>>16&255,w>>8&255)},a.opaque=function(E){const L=(255|E.rgba)>>>0;return[c,g,y]=n.toChannels(L),{css:_.toCss(c,g,y),rgba:L}},a.opacity=S,a.multiplyOpacity=function(E,L){return h=255&E.rgba,S(E,h*L/255)},a.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(x||(i.color=x={})),(function(a){let S,E;try{const L=document.createElement("canvas");L.width=1,L.height=1;const j=L.getContext("2d",{willReadFrequently:!0});j&&(S=j,S.globalCompositeOperation="copy",E=S.createLinearGradient(0,0,1,1))}catch{}a.toColor=function(L){if(L.match(/#[\da-f]{3,8}/i))switch(L.length){case 4:return c=parseInt(L.slice(1,2).repeat(2),16),g=parseInt(L.slice(2,3).repeat(2),16),y=parseInt(L.slice(3,4).repeat(2),16),_.toColor(c,g,y);case 5:return c=parseInt(L.slice(1,2).repeat(2),16),g=parseInt(L.slice(2,3).repeat(2),16),y=parseInt(L.slice(3,4).repeat(2),16),h=parseInt(L.slice(4,5).repeat(2),16),_.toColor(c,g,y,h);case 7:return{css:L,rgba:(parseInt(L.slice(1),16)<<8|255)>>>0};case 9:return{css:L,rgba:parseInt(L.slice(1),16)>>>0}}const j=L.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(j)return c=parseInt(j[1]),g=parseInt(j[2]),y=parseInt(j[3]),h=Math.round(255*(j[5]===void 0?1:parseFloat(j[5]))),_.toColor(c,g,y,h);if(!S||!E)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=E,S.fillStyle=L,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[c,g,y,h]=S.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,g,y,h),css:L}}})(C||(i.css=C={})),(function(a){function S(E,L,j){const w=E/255,D=L/255,H=j/255;return .2126*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(H<=.03928?H/12.92:Math.pow((H+.055)/1.055,2.4))}a.relativeLuminance=function(E){return S(E>>16&255,E>>8&255,255&E)},a.relativeLuminance2=S})(v||(i.rgb=v={})),(function(a){function S(L,j,w){const D=L>>24&255,H=L>>16&255,U=L>>8&255;let W=j>>24&255,I=j>>16&255,Q=j>>8&255,q=o(v.relativeLuminance2(W,I,Q),v.relativeLuminance2(D,H,U));for(;q<w&&(W>0||I>0||Q>0);)W-=Math.max(0,Math.ceil(.1*W)),I-=Math.max(0,Math.ceil(.1*I)),Q-=Math.max(0,Math.ceil(.1*Q)),q=o(v.relativeLuminance2(W,I,Q),v.relativeLuminance2(D,H,U));return(W<<24|I<<16|Q<<8|255)>>>0}function E(L,j,w){const D=L>>24&255,H=L>>16&255,U=L>>8&255;let W=j>>24&255,I=j>>16&255,Q=j>>8&255,q=o(v.relativeLuminance2(W,I,Q),v.relativeLuminance2(D,H,U));for(;q<w&&(W<255||I<255||Q<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),I=Math.min(255,I+Math.ceil(.1*(255-I))),Q=Math.min(255,Q+Math.ceil(.1*(255-Q))),q=o(v.relativeLuminance2(W,I,Q),v.relativeLuminance2(D,H,U));return(W<<24|I<<16|Q<<8|255)>>>0}a.blend=function(L,j){if(h=(255&j)/255,h===1)return j;const w=j>>24&255,D=j>>16&255,H=j>>8&255,U=L>>24&255,W=L>>16&255,I=L>>8&255;return c=U+Math.round((w-U)*h),g=W+Math.round((D-W)*h),y=I+Math.round((H-I)*h),_.toRgba(c,g,y)},a.ensureContrastRatio=function(L,j,w){const D=v.relativeLuminance(L>>8),H=v.relativeLuminance(j>>8);if(o(D,H)<w){if(H<D){const I=S(L,j,w),Q=o(D,v.relativeLuminance(I>>8));if(Q<w){const q=E(L,j,w);return Q>o(D,v.relativeLuminance(q>>8))?I:q}return I}const U=E(L,j,w),W=o(D,v.relativeLuminance(U>>8));if(W<w){const I=S(L,j,w);return W>o(D,v.relativeLuminance(I>>8))?U:I}return U}},a.reduceLuminance=S,a.increaseLuminance=E,a.toChannels=function(L){return[L>>24&255,L>>16&255,L>>8&255,255&L]}})(n||(i.rgba=n={})),i.toPaddedHex=d,i.contrastRatio=o},8969:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;const g=c(844),y=c(2585),h=c(4348),_=c(7866),x=c(744),C=c(7302),v=c(6975),n=c(8460),d=c(1753),o=c(1480),a=c(7994),S=c(9282),E=c(5435),L=c(5981),j=c(2660);let w=!1;class D extends g.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event((U=>{var W;(W=this._onScrollApi)==null||W.fire(U.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(U){for(const W in U)this.optionsService.options[W]=U[W]}constructor(U){super(),this._windowsWrappingHeuristics=this.register(new g.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new C.OptionsService(U)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(d.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(o.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(a.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(j.OscLinkService),this._instantiationService.setService(y.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.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((W=>{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((W=>{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 L.WriteBuffer(((W,I)=>this._inputHandler.parse(W,I)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(U,W){this._writeBuffer.write(U,W)}writeSync(U,W){this._logService.logLevel<=y.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(U,W)}input(U,W=!0){this.coreService.triggerDataEvent(U,W)}resize(U,W){isNaN(U)||isNaN(W)||(U=Math.max(U,x.MINIMUM_COLS),W=Math.max(W,x.MINIMUM_ROWS),this._bufferService.resize(U,W))}scroll(U,W=!1){this._bufferService.scroll(U,W)}scrollLines(U,W,I){this._bufferService.scrollLines(U,W,I)}scrollPages(U){this.scrollLines(U*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(U){const W=U-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler(U,W){return this._inputHandler.registerEscHandler(U,W)}registerDcsHandler(U,W){return this._inputHandler.registerDcsHandler(U,W)}registerCsiHandler(U,W){return this._inputHandler.registerCsiHandler(U,W)}registerOscHandler(U,W){return this._inputHandler.registerOscHandler(U,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let U=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?U=W.backend==="conpty"&&W.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(U=!0),U?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const U=[];U.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),U.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,g.toDisposable)((()=>{for(const W of U)W.dispose()}))}}}i.CoreTerminal=D},8460:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let g=0;g<this._listeners.length;g++)if(this._listeners[g]===c)return void this._listeners.splice(g,1)}}})),this._event}fire(c,g){const y=[];for(let h=0;h<this._listeners.length;h++)y.push(this._listeners[h]);for(let h=0;h<y.length;h++)y[h].call(void 0,c,g)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(c,g){return c((y=>g.fire(y)))},i.runAndSubscribe=function(c,g){return g(void 0),c((y=>g(y)))}},5435:function(R,i,c){var g=this&&this.__decorate||function(X,A,B,T){var F,ee=arguments.length,ne=ee<3?A:T===null?T=Object.getOwnPropertyDescriptor(A,B):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(X,A,B,T);else for(var ce=X.length-1;ce>=0;ce--)(F=X[ce])&&(ne=(ee<3?F(ne):ee>3?F(A,B,ne):F(A,B))||ne);return ee>3&&ne&&Object.defineProperty(A,B,ne),ne},y=this&&this.__param||function(X,A){return function(B,T){A(B,T,X)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;const h=c(2584),_=c(7116),x=c(2015),C=c(844),v=c(482),n=c(8437),d=c(8460),o=c(643),a=c(511),S=c(3734),E=c(2585),L=c(1480),j=c(6242),w=c(6351),D=c(5941),H={"(":0,")":1,"*":2,"+":3,"-":1,".":2},U=131072;function W(X,A){if(X>24)return A.setWinLines||!1;switch(X){case 1:return!!A.restoreWin;case 2:return!!A.minimizeWin;case 3:return!!A.setWinPosition;case 4:return!!A.setWinSizePixels;case 5:return!!A.raiseWin;case 6:return!!A.lowerWin;case 7:return!!A.refreshWin;case 8:return!!A.setWinSizeChars;case 9:return!!A.maximizeWin;case 10:return!!A.fullscreenWin;case 11:return!!A.getWinState;case 13:return!!A.getWinPosition;case 14:return!!A.getWinSizePixels;case 15:return!!A.getScreenSizePixels;case 16:return!!A.getCellSizePixels;case 18:return!!A.getWinSizeChars;case 19:return!!A.getScreenSizeChars;case 20:return!!A.getIconTitle;case 21:return!!A.getWinTitle;case 22:return!!A.pushTitle;case 23:return!!A.popTitle;case 24:return!!A.setWinLines}return!1}var I;(function(X){X[X.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",X[X.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(i.WindowsOptionsReportType=I={}));let Q=0;class q extends C.Disposable{getAttrData(){return this._curAttrData}constructor(A,B,T,F,ee,ne,ce,de,K=new x.EscapeSequenceParser){super(),this._bufferService=A,this._charsetService=B,this._coreService=T,this._logService=F,this._optionsService=ee,this._oscLinkService=ne,this._coreMouseService=ce,this._unicodeService=de,this._parser=K,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new a.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new d.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new d.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new d.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new d.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new d.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new d.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new d.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new d.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new d.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new d.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new d.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 z(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((N=>this._activeBuffer=N.activeBuffer))),this._parser.setCsiHandlerFallback(((N,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(N),params:ie.toArray()})})),this._parser.setEscHandlerFallback((N=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(N)})})),this._parser.setExecuteHandlerFallback((N=>{this._logService.debug("Unknown EXECUTE code: ",{code:N})})),this._parser.setOscHandlerFallback(((N,ie,se)=>{this._logService.debug("Unknown OSC code: ",{identifier:N,action:ie,data:se})})),this._parser.setDcsHandlerFallback(((N,ie,se)=>{ie==="HOOK"&&(se=se.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(N),action:ie,payload:se})})),this._parser.setPrintHandler(((N,ie,se)=>this.print(N,ie,se))),this._parser.registerCsiHandler({final:"@"},(N=>this.insertChars(N))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(N=>this.scrollLeft(N))),this._parser.registerCsiHandler({final:"A"},(N=>this.cursorUp(N))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(N=>this.scrollRight(N))),this._parser.registerCsiHandler({final:"B"},(N=>this.cursorDown(N))),this._parser.registerCsiHandler({final:"C"},(N=>this.cursorForward(N))),this._parser.registerCsiHandler({final:"D"},(N=>this.cursorBackward(N))),this._parser.registerCsiHandler({final:"E"},(N=>this.cursorNextLine(N))),this._parser.registerCsiHandler({final:"F"},(N=>this.cursorPrecedingLine(N))),this._parser.registerCsiHandler({final:"G"},(N=>this.cursorCharAbsolute(N))),this._parser.registerCsiHandler({final:"H"},(N=>this.cursorPosition(N))),this._parser.registerCsiHandler({final:"I"},(N=>this.cursorForwardTab(N))),this._parser.registerCsiHandler({final:"J"},(N=>this.eraseInDisplay(N,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(N=>this.eraseInDisplay(N,!0))),this._parser.registerCsiHandler({final:"K"},(N=>this.eraseInLine(N,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(N=>this.eraseInLine(N,!0))),this._parser.registerCsiHandler({final:"L"},(N=>this.insertLines(N))),this._parser.registerCsiHandler({final:"M"},(N=>this.deleteLines(N))),this._parser.registerCsiHandler({final:"P"},(N=>this.deleteChars(N))),this._parser.registerCsiHandler({final:"S"},(N=>this.scrollUp(N))),this._parser.registerCsiHandler({final:"T"},(N=>this.scrollDown(N))),this._parser.registerCsiHandler({final:"X"},(N=>this.eraseChars(N))),this._parser.registerCsiHandler({final:"Z"},(N=>this.cursorBackwardTab(N))),this._parser.registerCsiHandler({final:"`"},(N=>this.charPosAbsolute(N))),this._parser.registerCsiHandler({final:"a"},(N=>this.hPositionRelative(N))),this._parser.registerCsiHandler({final:"b"},(N=>this.repeatPrecedingCharacter(N))),this._parser.registerCsiHandler({final:"c"},(N=>this.sendDeviceAttributesPrimary(N))),this._parser.registerCsiHandler({prefix:">",final:"c"},(N=>this.sendDeviceAttributesSecondary(N))),this._parser.registerCsiHandler({final:"d"},(N=>this.linePosAbsolute(N))),this._parser.registerCsiHandler({final:"e"},(N=>this.vPositionRelative(N))),this._parser.registerCsiHandler({final:"f"},(N=>this.hVPosition(N))),this._parser.registerCsiHandler({final:"g"},(N=>this.tabClear(N))),this._parser.registerCsiHandler({final:"h"},(N=>this.setMode(N))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(N=>this.setModePrivate(N))),this._parser.registerCsiHandler({final:"l"},(N=>this.resetMode(N))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(N=>this.resetModePrivate(N))),this._parser.registerCsiHandler({final:"m"},(N=>this.charAttributes(N))),this._parser.registerCsiHandler({final:"n"},(N=>this.deviceStatus(N))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(N=>this.deviceStatusPrivate(N))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(N=>this.softReset(N))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(N=>this.setCursorStyle(N))),this._parser.registerCsiHandler({final:"r"},(N=>this.setScrollRegion(N))),this._parser.registerCsiHandler({final:"s"},(N=>this.saveCursor(N))),this._parser.registerCsiHandler({final:"t"},(N=>this.windowOptions(N))),this._parser.registerCsiHandler({final:"u"},(N=>this.restoreCursor(N))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(N=>this.insertColumns(N))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(N=>this.deleteColumns(N))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(N=>this.selectProtected(N))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(N=>this.requestMode(N,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(N=>this.requestMode(N,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new j.OscHandler((N=>(this.setTitle(N),this.setIconName(N),!0)))),this._parser.registerOscHandler(1,new j.OscHandler((N=>this.setIconName(N)))),this._parser.registerOscHandler(2,new j.OscHandler((N=>this.setTitle(N)))),this._parser.registerOscHandler(4,new j.OscHandler((N=>this.setOrReportIndexedColor(N)))),this._parser.registerOscHandler(8,new j.OscHandler((N=>this.setHyperlink(N)))),this._parser.registerOscHandler(10,new j.OscHandler((N=>this.setOrReportFgColor(N)))),this._parser.registerOscHandler(11,new j.OscHandler((N=>this.setOrReportBgColor(N)))),this._parser.registerOscHandler(12,new j.OscHandler((N=>this.setOrReportCursorColor(N)))),this._parser.registerOscHandler(104,new j.OscHandler((N=>this.restoreIndexedColor(N)))),this._parser.registerOscHandler(110,new j.OscHandler((N=>this.restoreFgColor(N)))),this._parser.registerOscHandler(111,new j.OscHandler((N=>this.restoreBgColor(N)))),this._parser.registerOscHandler(112,new j.OscHandler((N=>this.restoreCursorColor(N)))),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 N in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:N},(()=>this.selectCharset("("+N))),this._parser.registerEscHandler({intermediates:")",final:N},(()=>this.selectCharset(")"+N))),this._parser.registerEscHandler({intermediates:"*",final:N},(()=>this.selectCharset("*"+N))),this._parser.registerEscHandler({intermediates:"+",final:N},(()=>this.selectCharset("+"+N))),this._parser.registerEscHandler({intermediates:"-",final:N},(()=>this.selectCharset("-"+N))),this._parser.registerEscHandler({intermediates:".",final:N},(()=>this.selectCharset("."+N))),this._parser.registerEscHandler({intermediates:"/",final:N},(()=>this.selectCharset("/"+N)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((N=>(this._logService.error("Parsing error: ",N),N))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new w.DcsHandler(((N,ie)=>this.requestStatusString(N,ie))))}_preserveStack(A,B,T,F){this._parseStack.paused=!0,this._parseStack.cursorStartX=A,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=T,this._parseStack.position=F}_logSlowResolvingAsync(A){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([A,new Promise(((B,T)=>setTimeout((()=>T("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(A,B){let T,F=this._activeBuffer.x,ee=this._activeBuffer.y,ne=0;const ce=this._parseStack.paused;if(ce){if(T=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(T),T;F=this._parseStack.cursorStartX,ee=this._parseStack.cursorStartY,this._parseStack.paused=!1,A.length>U&&(ne=this._parseStack.position+U)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof A=="string"?` "${A}"`:` "${Array.prototype.map.call(A,(N=>String.fromCharCode(N))).join("")}"`),typeof A=="string"?A.split("").map((N=>N.charCodeAt(0))):A),this._parseBuffer.length<A.length&&this._parseBuffer.length<U&&(this._parseBuffer=new Uint32Array(Math.min(A.length,U))),ce||this._dirtyRowTracker.clearRange(),A.length>U)for(let N=ne;N<A.length;N+=U){const ie=N+U<A.length?N+U:A.length,se=typeof A=="string"?this._stringDecoder.decode(A.substring(N,ie),this._parseBuffer):this._utf8Decoder.decode(A.subarray(N,ie),this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,se))return this._preserveStack(F,ee,se,N),this._logSlowResolvingAsync(T),T}else if(!ce){const N=typeof A=="string"?this._stringDecoder.decode(A,this._parseBuffer):this._utf8Decoder.decode(A,this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,N))return this._preserveStack(F,ee,N,0),this._logSlowResolvingAsync(T),T}this._activeBuffer.x===F&&this._activeBuffer.y===ee||this._onCursorMove.fire();const de=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),K=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);K<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(K,this._bufferService.rows-1),Math.min(de,this._bufferService.rows-1))}print(A,B,T){let F,ee;const ne=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,de=this._bufferService.cols,K=this._coreService.decPrivateModes.wraparound,N=this._coreService.modes.insertMode,ie=this._curAttrData;let se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&T-B>0&&se.getWidth(this._activeBuffer.x-1)===2&&se.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ie);let fe=this._parser.precedingJoinState;for(let he=B;he<T;++he){if(F=A[he],F<127&&ne){const Xe=ne[String.fromCharCode(F)];Xe&&(F=Xe.charCodeAt(0))}const ke=this._unicodeService.charProperties(F,fe);ee=L.UnicodeService.extractWidth(ke);const Te=L.UnicodeService.extractShouldJoin(ke),Me=Te?L.UnicodeService.extractWidth(fe):0;if(fe=ke,ce&&this._onA11yChar.fire((0,v.stringFromCodePoint)(F)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+ee-Me>de){if(K){const Xe=se;let be=this._activeBuffer.x-Me;for(this._activeBuffer.x=Me,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),se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Me>0&&se instanceof n.BufferLine&&se.copyCellsFrom(Xe,be,0,Me,!1);be<de;)Xe.setCellFromCodepoint(be++,0,1,ie)}else if(this._activeBuffer.x=de-1,ee===2)continue}if(Te&&this._activeBuffer.x){const Xe=se.getWidth(this._activeBuffer.x-1)?1:2;se.addCodepointToCell(this._activeBuffer.x-Xe,F,ee);for(let be=ee-Me;--be>=0;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(N&&(se.insertCells(this._activeBuffer.x,ee-Me,this._activeBuffer.getNullCell(ie)),se.getWidth(de-1)===2&&se.setCellFromCodepoint(de-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,ie)),se.setCellFromCodepoint(this._activeBuffer.x++,F,ee,ie),ee>0)for(;--ee;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=fe,this._activeBuffer.x<de&&T-B>0&&se.getWidth(this._activeBuffer.x)===0&&!se.hasContent(this._activeBuffer.x)&&se.setCellFromCodepoint(this._activeBuffer.x,0,1,ie),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(A,B){return A.final!=="t"||A.prefix||A.intermediates?this._parser.registerCsiHandler(A,B):this._parser.registerCsiHandler(A,(T=>!W(T.params[0],this._optionsService.rawOptions.windowOptions)||B(T)))}registerDcsHandler(A,B){return this._parser.registerDcsHandler(A,new w.DcsHandler(B))}registerEscHandler(A,B){return this._parser.registerEscHandler(A,B)}registerOscHandler(A,B){return this._parser.registerOscHandler(A,new j.OscHandler(B))}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 A;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&&((A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&A.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const A=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-A),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(A=this._bufferService.cols-1){this._activeBuffer.x=Math.min(A,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(A,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=A,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=A,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(A,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+A,this._activeBuffer.y+B)}cursorUp(A){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,A.params[0]||1)):this._moveCursor(0,-(A.params[0]||1)),!0}cursorDown(A){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,A.params[0]||1)):this._moveCursor(0,A.params[0]||1),!0}cursorForward(A){return this._moveCursor(A.params[0]||1,0),!0}cursorBackward(A){return this._moveCursor(-(A.params[0]||1),0),!0}cursorNextLine(A){return this.cursorDown(A),this._activeBuffer.x=0,!0}cursorPrecedingLine(A){return this.cursorUp(A),this._activeBuffer.x=0,!0}cursorCharAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(A){return this._setCursor(A.length>=2?(A.params[1]||1)-1:0,(A.params[0]||1)-1),!0}charPosAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(A){return this._moveCursor(A.params[0]||1,0),!0}linePosAbsolute(A){return this._setCursor(this._activeBuffer.x,(A.params[0]||1)-1),!0}vPositionRelative(A){return this._moveCursor(0,A.params[0]||1),!0}hVPosition(A){return this.cursorPosition(A),!0}tabClear(A){const B=A.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=A.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=A.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(A){const B=A.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(A,B,T,F=!1,ee=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);ne.replaceCells(B,T,this._activeBuffer.getNullCell(this._eraseAttrData()),ee),F&&(ne.isWrapped=!1)}_resetBufferLine(A,B=!1){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);T&&(T.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+A),T.isWrapped=!1)}eraseInDisplay(A,B=!1){let T;switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);T<this._bufferService.rows;T++)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(T);break;case 1:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowTracker.markDirty(T-1);T--;)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(0);break;case 3:const F=this._activeBuffer.lines.length-this._bufferService.rows;F>0&&(this._activeBuffer.lines.trimStart(F),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-F,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-F,0),this._onScroll.fire(0))}return!0}eraseInLine(A,B=!1){switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(A){this._restrictCursor();let B=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y,F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ee=this._bufferService.rows-1+this._activeBuffer.ybase-F+1;for(;B--;)this._activeBuffer.lines.splice(ee-1,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(A){this._restrictCursor();let B=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y;let F;for(F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-F;B--;)this._activeBuffer.lines.splice(T,1),this._activeBuffer.lines.splice(F,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(A){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(A){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(A){let B=A.params[0]||1;for(;B--;)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(A){let B=A.params[0]||1;for(;B--;)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(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);F.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);F.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);F.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);F.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(A){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(A.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(A){const B=this._parser.precedingJoinState;if(!B)return!0;const T=A.params[0]||1,F=L.UnicodeService.extractWidth(B),ee=this._activeBuffer.x-F,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(ee),ce=new Uint32Array(ne.length*T);let de=0;for(let N=0;N<ne.length;){const ie=ne.codePointAt(N)||0;ce[de++]=ie,N+=ie>65535?2:1}let K=de;for(let N=1;N<T;++N)ce.copyWithin(K,0,de),K+=de;return this.print(ce,0,K),!0}sendDeviceAttributesPrimary(A){return A.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(A){return A.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(A.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(A){return(this._optionsService.rawOptions.termName+"").indexOf(A)===0}setMode(A){for(let B=0;B<A.length;B++)switch(A.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(A){for(let B=0;B<A.length;B++)switch(A.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(A){for(let B=0;B<A.length;B++)switch(A.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(A){for(let B=0;B<A.length;B++)switch(A.params[B]){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(),A.params[B]===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(A,B){const T=this._coreService.decPrivateModes,{activeProtocol:F,activeEncoding:ee}=this._coreMouseService,ne=this._coreService,{buffers:ce,cols:de}=this._bufferService,{active:K,alt:N}=ce,ie=this._optionsService.rawOptions,se=Te=>Te?1:2,fe=A.params[0];return he=fe,ke=B?fe===2?4:fe===4?se(ne.modes.insertMode):fe===12?3:fe===20?se(ie.convertEol):0:fe===1?se(T.applicationCursorKeys):fe===3?ie.windowOptions.setWinLines?de===80?2:de===132?1:0:0:fe===6?se(T.origin):fe===7?se(T.wraparound):fe===8?3:fe===9?se(F==="X10"):fe===12?se(ie.cursorBlink):fe===25?se(!ne.isCursorHidden):fe===45?se(T.reverseWraparound):fe===66?se(T.applicationKeypad):fe===67?4:fe===1e3?se(F==="VT200"):fe===1002?se(F==="DRAG"):fe===1003?se(F==="ANY"):fe===1004?se(T.sendFocus):fe===1005?4:fe===1006?se(ee==="SGR"):fe===1015?4:fe===1016?se(ee==="SGR_PIXELS"):fe===1048?1:fe===47||fe===1047||fe===1049?se(K===N):fe===2004?se(T.bracketedPasteMode):0,ne.triggerDataEvent(`${h.C0.ESC}[${B?"":"?"}${he};${ke}$y`),!0;var he,ke}_updateAttrColor(A,B,T,F,ee){return B===2?(A|=50331648,A&=-16777216,A|=S.AttributeData.fromColorRGB([T,F,ee])):B===5&&(A&=-50331904,A|=33554432|255&T),A}_extractColor(A,B,T){const F=[0,0,-1,0,0,0];let ee=0,ne=0;do{if(F[ne+ee]=A.params[B+ne],A.hasSubParams(B+ne)){const ce=A.getSubParams(B+ne);let de=0;do F[1]===5&&(ee=1),F[ne+de+1+ee]=ce[de];while(++de<ce.length&&de+ne+1+ee<F.length);break}if(F[1]===5&&ne+ee>=2||F[1]===2&&ne+ee>=5)break;F[1]&&(ee=1)}while(++ne+B<A.length&&ne+ee<F.length);for(let ce=2;ce<F.length;++ce)F[ce]===-1&&(F[ce]=0);switch(F[0]){case 38:T.fg=this._updateAttrColor(T.fg,F[1],F[3],F[4],F[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,F[1],F[3],F[4],F[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,F[1],F[3],F[4],F[5])}return ne}_processUnderline(A,B){B.extended=B.extended.clone(),(!~A||A>5)&&(A=1),B.extended.underlineStyle=A,B.fg|=268435456,A===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(A){A.fg=n.DEFAULT_ATTR_DATA.fg,A.bg=n.DEFAULT_ATTR_DATA.bg,A.extended=A.extended.clone(),A.extended.underlineStyle=0,A.extended.underlineColor&=-67108864,A.updateExtended()}charAttributes(A){if(A.length===1&&A.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=A.length;let T;const F=this._curAttrData;for(let ee=0;ee<B;ee++)T=A.params[ee],T>=30&&T<=37?(F.fg&=-50331904,F.fg|=16777216|T-30):T>=40&&T<=47?(F.bg&=-50331904,F.bg|=16777216|T-40):T>=90&&T<=97?(F.fg&=-50331904,F.fg|=16777224|T-90):T>=100&&T<=107?(F.bg&=-50331904,F.bg|=16777224|T-100):T===0?this._processSGR0(F):T===1?F.fg|=134217728:T===3?F.bg|=67108864:T===4?(F.fg|=268435456,this._processUnderline(A.hasSubParams(ee)?A.getSubParams(ee)[0]:1,F)):T===5?F.fg|=536870912:T===7?F.fg|=67108864:T===8?F.fg|=1073741824:T===9?F.fg|=2147483648:T===2?F.bg|=134217728:T===21?this._processUnderline(2,F):T===22?(F.fg&=-134217729,F.bg&=-134217729):T===23?F.bg&=-67108865:T===24?(F.fg&=-268435457,this._processUnderline(0,F)):T===25?F.fg&=-536870913:T===27?F.fg&=-67108865:T===28?F.fg&=-1073741825:T===29?F.fg&=2147483647:T===39?(F.fg&=-67108864,F.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):T===49?(F.bg&=-67108864,F.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?ee+=this._extractColor(A,ee,F):T===53?F.bg|=1073741824:T===55?F.bg&=-1073741825:T===59?(F.extended=F.extended.clone(),F.extended.underlineColor=-1,F.updateExtended()):T===100?(F.fg&=-67108864,F.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,F.bg&=-67108864,F.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T);return!0}deviceStatus(A){switch(A.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${B};${T}R`)}return!0}deviceStatusPrivate(A){if(A.params[0]===6){const B=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${B};${T}R`)}return!0}softReset(A){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.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(A){const B=A.params[0]||1;switch(B){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 T=B%2==1;return this._optionsService.options.cursorBlink=T,!0}setScrollRegion(A){const B=A.params[0]||1;let T;return(A.length<2||(T=A.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=T-1,this._setCursor(0,0)),!0}windowOptions(A){if(!W(A.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=A.length>1?A.params[1]:0;switch(A.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(I.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(I.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(A){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(A){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(A){return this._windowTitle=A,this._onTitleChange.fire(A),!0}setIconName(A){return this._iconName=A,!0}setOrReportIndexedColor(A){const B=[],T=A.split(";");for(;T.length>1;){const F=T.shift(),ee=T.shift();if(/^\d+$/.exec(F)){const ne=parseInt(F);if(re(ne))if(ee==="?")B.push({type:0,index:ne});else{const ce=(0,D.parseColor)(ee);ce&&B.push({type:1,index:ne,color:ce})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(A){const B=A.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(A,B){this._getCurrentLinkId()&&this._finishHyperlink();const T=A.split(":");let F;const ee=T.findIndex((ne=>ne.startsWith("id=")));return ee!==-1&&(F=T[ee].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:F,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(A,B){const T=A.split(";");for(let F=0;F<T.length&&!(B>=this._specialColors.length);++F,++B)if(T[F]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const ee=(0,D.parseColor)(T[F]);ee&&this._onColor.fire([{type:1,index:this._specialColors[B],color:ee}])}return!0}setOrReportFgColor(A){return this._setOrReportSpecialColor(A,0)}setOrReportBgColor(A){return this._setOrReportSpecialColor(A,1)}setOrReportCursorColor(A){return this._setOrReportSpecialColor(A,2)}restoreIndexedColor(A){if(!A)return this._onColor.fire([{type:2}]),!0;const B=[],T=A.split(";");for(let F=0;F<T.length;++F)if(/^\d+$/.exec(T[F])){const ee=parseInt(T[F]);re(ee)&&B.push({type:2,index:ee})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(A){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(A){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(A){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,_.DEFAULT_CHARSET),!0}selectCharset(A){return A.length!==2?(this.selectDefaultCharset(),!0):(A[0]==="/"||this._charsetService.setgCharset(H[A[0]],_.CHARSETS[A[1]]||_.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 A=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,A,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=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(A){return this._charsetService.setgLevel(A),!0}screenAlignmentPattern(){const A=new a.CellData;A.content=4194373,A.fg=this._curAttrData.fg,A.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const T=this._activeBuffer.ybase+this._activeBuffer.y+B,F=this._activeBuffer.lines.get(T);F&&(F.fill(A),F.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(A,B){const T=this._bufferService.buffer,F=this._optionsService.rawOptions;return(ee=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${ee}${h.C0.ESC}\\`),!0))(A==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:A==='"p'?'P1$r61;1"p':A==="r"?`P1$r${T.scrollTop+1};${T.scrollBottom+1}r`:A==="m"?"P1$r0m":A===" q"?`P1$r${{block:2,underline:4,bar:6}[F.cursorStyle]-(F.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(A,B){this._dirtyRowTracker.markRangeDirty(A,B)}}i.InputHandler=q;let z=class{constructor(X){this._bufferService=X,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(X){X<this.start?this.start=X:X>this.end&&(this.end=X)}markRangeDirty(X,A){X>A&&(Q=X,X=A,A=Q),X<this.start&&(this.start=X),A>this.end&&(this.end=A)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function re(X){return 0<=X&&X<256}z=g([y(0,E.IBufferService)],z)},844:(R,i)=>{function c(g){for(const y of g)y.dispose();g.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const g of this._disposables)g.dispose();this._disposables.length=0}register(g){return this._disposables.push(g),g}unregister(g){const y=this._disposables.indexOf(g);y!==-1&&this._disposables.splice(y,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(g){var y;this._isDisposed||g===this._value||((y=this._value)==null||y.dispose(),this._value=g)}clear(){this.value=void 0}dispose(){var g;this._isDisposed=!0,(g=this._value)==null||g.dispose(),this._value=void 0}},i.toDisposable=function(g){return{dispose:g}},i.disposeArray=c,i.getDisposeArrayDisposable=function(g){return{dispose:()=>c(g)}}},1505:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(y,h,_){this._data[y]||(this._data[y]={}),this._data[y][h]=_}get(y,h){return this._data[y]?this._data[y][h]:void 0}clear(){this._data={}}}i.TwoKeyMap=c,i.FourKeyMap=class{constructor(){this._data=new c}set(g,y,h,_,x){this._data.get(g,y)||this._data.set(g,y,new c),this._data.get(g,y).set(h,_,x)}get(g,y,h,_){var x;return(x=this._data.get(g,y))==null?void 0:x.get(h,_)}clear(){this._data.clear()}}},6114:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const c=i.isNode?"node":navigator.userAgent,g=i.isNode?"node":navigator.platform;i.isFirefox=c.includes("Firefox"),i.isLegacyEdge=c.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(c),i.getSafariVersion=function(){if(!i.isSafari)return 0;const y=c.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(g),i.isIpad=g==="iPad",i.isIphone=g==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(g),i.isLinux=g.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(c)},6106:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let c=0;i.SortedList=class{constructor(g){this._getKey=g,this._array=[]}clear(){this._array.length=0}insert(g){this._array.length!==0?(c=this._search(this._getKey(g)),this._array.splice(c,0,g)):this._array.push(g)}delete(g){if(this._array.length===0)return!1;const y=this._getKey(g);if(y===void 0||(c=this._search(y),c===-1)||this._getKey(this._array[c])!==y)return!1;do if(this._array[c]===g)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===y);return!1}*getKeyIterator(g){if(this._array.length!==0&&(c=this._search(g),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===g))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===g)}forEachByKey(g,y){if(this._array.length!==0&&(c=this._search(g),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===g))do y(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===g)}values(){return[...this._array].values()}_search(g){let y=0,h=this._array.length-1;for(;h>=y;){let _=y+h>>1;const x=this._getKey(this._array[_]);if(x>g)h=_-1;else{if(!(x<g)){for(;_>0&&this._getKey(this._array[_-1])===g;)_--;return _}y=_+1}}return y}}},7226:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const g=c(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let C=0,v=0,n=x.timeRemaining(),d=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),v=Math.max(C,v),d=x.timeRemaining(),1.5*v>d)return n-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-C))}ms`),void this._start();n=d}this.clear()}}class h extends y{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const C=Date.now()+x;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}i.PriorityTaskQueue=h,i.IdleTaskQueue=!g.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:h,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;const g=c(643);i.updateWindowsModeWrappedState=function(y){const h=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),_=h==null?void 0:h.get(y.cols-1),x=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);x&&_&&(x.isWrapped=_[g.CHAR_DATA_CODE_INDEX]!==g.NULL_CELL_CODE&&_[g.CHAR_DATA_CODE_INDEX]!==g.WHITESPACE_CELL_CODE)}},3734:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new g}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}i.AttributeData=c;class g{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,_=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=_}clone(){return new g(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=g},9092:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;const g=c(6349),y=c(7226),h=c(3734),_=c(8437),x=c(4634),C=c(511),v=c(643),n=c(4863),d=c(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(o,a,S){this._hasScrollback=o,this._optionsService=a,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=d.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new g.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(o){return o?(this._nullCell.fg=o.fg,this._nullCell.bg=o.bg,this._nullCell.extended=o.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(o){return o?(this._whitespaceCell.fg=o.fg,this._whitespaceCell.bg=o.bg,this._whitespaceCell.extended=o.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(o,a){return new _.BufferLine(this._bufferService.cols,this.getNullCell(o),a)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const o=this.ybase+this.y-this.ydisp;return o>=0&&o<this._rows}_getCorrectBufferLength(o){if(!this._hasScrollback)return o;const a=o+this._optionsService.rawOptions.scrollback;return a>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:a}fillViewportRows(o){if(this.lines.length===0){o===void 0&&(o=_.DEFAULT_ATTR_DATA);let a=this._rows;for(;a--;)this.lines.push(this.getBlankLine(o))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new g.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(o,a){const S=this.getNullCell(_.DEFAULT_ATTR_DATA);let E=0;const L=this._getCorrectBufferLength(a);if(L>this.lines.maxLength&&(this.lines.maxLength=L),this.lines.length>0){if(this._cols<o)for(let w=0;w<this.lines.length;w++)E+=+this.lines.get(w).resize(o,S);let j=0;if(this._rows<a)for(let w=this._rows;w<a;w++)this.lines.length<a+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(o,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+j+1?(this.ybase--,j++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(o,S)));else for(let w=this._rows;w>a;w--)this.lines.length>a+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(L<this.lines.maxLength){const w=this.lines.length-L;w>0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=L}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,a-1),j&&(this.y+=j),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=a-1,this._isReflowEnabled&&(this._reflow(o,a),this._cols>o))for(let j=0;j<this.lines.length;j++)E+=+this.lines.get(j).resize(o,S);this._cols=o,this._rows=a,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let o=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,o=!1);let a=0;for(;this._memoryCleanupPosition<this.lines.length;)if(a+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),a>100)return!0;return o}get _isReflowEnabled(){const o=this._optionsService.rawOptions.windowsPty;return o&&o.buildNumber?this._hasScrollback&&o.backend==="conpty"&&o.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(o,a){this._cols!==o&&(o>this._cols?this._reflowLarger(o,a):this._reflowSmaller(o,a))}_reflowLarger(o,a){const S=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(S.length>0){const E=(0,x.reflowLargerCreateNewLayout)(this.lines,S);(0,x.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(o,a,E.countRemoved)}}_reflowLargerAdjustViewport(o,a,S){const E=this.getNullCell(_.DEFAULT_ATTR_DATA);let L=S;for(;L-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<a&&this.lines.push(new _.BufferLine(o,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(o,a){const S=this.getNullCell(_.DEFAULT_ATTR_DATA),E=[];let L=0;for(let j=this.lines.length-1;j>=0;j--){let w=this.lines.get(j);if(!w||!w.isWrapped&&w.getTrimmedLength()<=o)continue;const D=[w];for(;w.isWrapped&&j>0;)w=this.lines.get(--j),D.unshift(w);const H=this.ybase+this.y;if(H>=j&&H<j+D.length)continue;const U=D[D.length-1].getTrimmedLength(),W=(0,x.reflowSmallerGetNewLineLengths)(D,this._cols,o),I=W.length-D.length;let Q;Q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+I):Math.max(0,this.lines.length-this.lines.maxLength+I);const q=[];for(let T=0;T<I;T++){const F=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);q.push(F)}q.length>0&&(E.push({start:j+D.length+L,newLines:q}),L+=q.length),D.push(...q);let z=W.length-1,re=W[z];re===0&&(z--,re=W[z]);let X=D.length-I-1,A=U;for(;X>=0;){const T=Math.min(A,re);if(D[z]===void 0)break;if(D[z].copyCellsFrom(D[X],A-T,re-T,T,!0),re-=T,re===0&&(z--,re=W[z]),A-=T,A===0){X--;const F=Math.max(X,0);A=(0,x.getWrappedLineTrimmedLength)(D,F,this._cols)}}for(let T=0;T<D.length;T++)W[T]<o&&D[T].setCell(W[T],S);let B=I-Q;for(;B-- >0;)this.ybase===0?this.y<a-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+L)-a&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+a-1)}if(E.length>0){const j=[],w=[];for(let z=0;z<this.lines.length;z++)w.push(this.lines.get(z));const D=this.lines.length;let H=D-1,U=0,W=E[U];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+L);let I=0;for(let z=Math.min(this.lines.maxLength-1,D+L-1);z>=0;z--)if(W&&W.start>H+I){for(let re=W.newLines.length-1;re>=0;re--)this.lines.set(z--,W.newLines[re]);z++,j.push({index:H+1,amount:W.newLines.length}),I+=W.newLines.length,W=E[++U]}else this.lines.set(z,w[H--]);let Q=0;for(let z=j.length-1;z>=0;z--)j[z].index+=Q,this.lines.onInsertEmitter.fire(j[z]),Q+=j[z].amount;const q=Math.max(0,D+L-this.lines.maxLength);q>0&&this.lines.onTrimEmitter.fire(q)}}translateBufferLineToString(o,a,S=0,E){const L=this.lines.get(o);return L?L.translateToString(a,S,E):""}getWrappedRangeForLine(o){let a=o,S=o;for(;a>0&&this.lines.get(a).isWrapped;)a--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:a,last:S}}setupTabStops(o){for(o!=null?this.tabs[o]||(o=this.prevStop(o)):(this.tabs={},o=0);o<this._cols;o+=this._optionsService.rawOptions.tabStopWidth)this.tabs[o]=!0}prevStop(o){for(o==null&&(o=this.x);!this.tabs[--o]&&o>0;);return o>=this._cols?this._cols-1:o<0?0:o}nextStop(o){for(o==null&&(o=this.x);!this.tabs[++o]&&o<this._cols;);return o>=this._cols?this._cols-1:o<0?0:o}clearMarkers(o){this._isClearing=!0;for(let a=0;a<this.markers.length;a++)this.markers[a].line===o&&(this.markers[a].dispose(),this.markers.splice(a--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].dispose(),this.markers.splice(o--,1);this._isClearing=!1}addMarker(o){const a=new n.Marker(o);return this.markers.push(a),a.register(this.lines.onTrim((S=>{a.line-=S,a.line<0&&a.dispose()}))),a.register(this.lines.onInsert((S=>{a.line>=S.index&&(a.line+=S.amount)}))),a.register(this.lines.onDelete((S=>{a.line>=S.index&&a.line<S.index+S.amount&&a.dispose(),a.line>S.index&&(a.line-=S.amount)}))),a.register(a.onDispose((()=>this._removeMarker(a)))),a}_removeMarker(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)}}},8437:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;const g=c(3734),y=c(511),h=c(643),_=c(482);i.DEFAULT_ATTR_DATA=Object.freeze(new g.AttributeData);let x=0;class C{constructor(n,d,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const a=d||y.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let S=0;S<n;++S)this.setCell(S,a);this.length=n}get(n){const d=this._data[3*n+0],o=2097151&d;return[this._data[3*n+1],2097152&d?this._combined[n]:o?(0,_.stringFromCodePoint)(o):"",d>>22,2097152&d?this._combined[n].charCodeAt(this._combined[n].length-1):o]}set(n,d){this._data[3*n+1]=d[h.CHAR_DATA_ATTR_INDEX],d[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=d[1],this._data[3*n+0]=2097152|n|d[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=d[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|d[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const d=this._data[3*n+0];return 2097152&d?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&d}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const d=this._data[3*n+0];return 2097152&d?this._combined[n]:2097151&d?(0,_.stringFromCodePoint)(2097151&d):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,d){return x=3*n,d.content=this._data[x+0],d.fg=this._data[x+1],d.bg=this._data[x+2],2097152&d.content&&(d.combinedData=this._combined[n]),268435456&d.bg&&(d.extended=this._extendedAttrs[n]),d}setCell(n,d){2097152&d.content&&(this._combined[n]=d.combinedData),268435456&d.bg&&(this._extendedAttrs[n]=d.extended),this._data[3*n+0]=d.content,this._data[3*n+1]=d.fg,this._data[3*n+2]=d.bg}setCellFromCodepoint(n,d,o,a){268435456&a.bg&&(this._extendedAttrs[n]=a.extended),this._data[3*n+0]=d|o<<22,this._data[3*n+1]=a.fg,this._data[3*n+2]=a.bg}addCodepointToCell(n,d,o){let a=this._data[3*n+0];2097152&a?this._combined[n]+=(0,_.stringFromCodePoint)(d):2097151&a?(this._combined[n]=(0,_.stringFromCodePoint)(2097151&a)+(0,_.stringFromCodePoint)(d),a&=-2097152,a|=2097152):a=d|4194304,o&&(a&=-12582913,a|=o<<22),this._data[3*n+0]=a}insertCells(n,d,o){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),d<this.length-n){const a=new y.CellData;for(let S=this.length-n-d-1;S>=0;--S)this.setCell(n+d+S,this.loadCell(n+S,a));for(let S=0;S<d;++S)this.setCell(n+S,o)}else for(let a=n;a<this.length;++a)this.setCell(a,o);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,o)}deleteCells(n,d,o){if(n%=this.length,d<this.length-n){const a=new y.CellData;for(let S=0;S<this.length-n-d;++S)this.setCell(n+S,this.loadCell(n+d+S,a));for(let S=this.length-d;S<this.length;++S)this.setCell(S,o)}else for(let a=n;a<this.length;++a)this.setCell(a,o);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,o)}replaceCells(n,d,o,a=!1){if(a)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,o),d<this.length&&this.getWidth(d-1)===2&&!this.isProtected(d)&&this.setCellFromCodepoint(d,0,1,o);n<d&&n<this.length;)this.isProtected(n)||this.setCell(n,o),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),d<this.length&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d,0,1,o);n<d&&n<this.length;)this.setCell(n++,o)}resize(n,d){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*o)this._data=new Uint32Array(this._data.buffer,0,o);else{const a=new Uint32Array(o);a.set(this._data),this._data=a}for(let a=this.length;a<n;++a)this.setCell(a,d)}else{this._data=this._data.subarray(0,o);const a=Object.keys(this._combined);for(let E=0;E<a.length;E++){const L=parseInt(a[E],10);L>=n&&delete this._combined[L]}const S=Object.keys(this._extendedAttrs);for(let E=0;E<S.length;E++){const L=parseInt(S[E],10);L>=n&&delete this._extendedAttrs[L]}}return this.length=n,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,d=!1){if(d)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,n);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const d in n._combined)this._combined[d]=n._combined[d];this._extendedAttrs={};for(const d in n._extendedAttrs)this._extendedAttrs[d]=n._extendedAttrs[d];this.isWrapped=n.isWrapped}clone(){const n=new C(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const d in this._combined)n._combined[d]=this._combined[d];for(const d in this._extendedAttrs)n._extendedAttrs[d]=this._extendedAttrs[d];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,d,o,a,S){const E=n._data;if(S)for(let j=a-1;j>=0;j--){for(let w=0;w<3;w++)this._data[3*(o+j)+w]=E[3*(d+j)+w];268435456&E[3*(d+j)+2]&&(this._extendedAttrs[o+j]=n._extendedAttrs[d+j])}else for(let j=0;j<a;j++){for(let w=0;w<3;w++)this._data[3*(o+j)+w]=E[3*(d+j)+w];268435456&E[3*(d+j)+2]&&(this._extendedAttrs[o+j]=n._extendedAttrs[d+j])}const L=Object.keys(n._combined);for(let j=0;j<L.length;j++){const w=parseInt(L[j],10);w>=d&&(this._combined[w-d+o]=n._combined[w])}}translateToString(n,d,o,a){d=d??0,o=o??this.length,n&&(o=Math.min(o,this.getTrimmedLength())),a&&(a.length=0);let S="";for(;d<o;){const E=this._data[3*d+0],L=2097151&E,j=2097152&E?this._combined[d]:L?(0,_.stringFromCodePoint)(L):h.WHITESPACE_CELL_CHAR;if(S+=j,a)for(let w=0;w<j.length;++w)a.push(d);d+=E>>22||1}return a&&a.push(d),S}}i.BufferLine=C},4841:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(c,g){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return g*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(R,i)=>{function c(g,y,h){if(y===g.length-1)return g[y].getTrimmedLength();const _=!g[y].hasContent(h-1)&&g[y].getWidth(h-1)===1,x=g[y+1].getWidth(0)===2;return _&&x?h-1:h}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(g,y,h,_,x){const C=[];for(let v=0;v<g.length-1;v++){let n=v,d=g.get(++n);if(!d.isWrapped)continue;const o=[g.get(v)];for(;n<g.length&&d.isWrapped;)o.push(d),d=g.get(++n);if(_>=v&&_<n){v+=o.length-1;continue}let a=0,S=c(o,a,y),E=1,L=0;for(;E<o.length;){const w=c(o,E,y),D=w-L,H=h-S,U=Math.min(D,H);o[a].copyCellsFrom(o[E],L,S,U,!1),S+=U,S===h&&(a++,S=0),L+=U,L===w&&(E++,L=0),S===0&&a!==0&&o[a-1].getWidth(h-1)===2&&(o[a].copyCellsFrom(o[a-1],h-1,S++,1,!1),o[a-1].setCell(h-1,x))}o[a].replaceCells(S,h,x);let j=0;for(let w=o.length-1;w>0&&(w>a||o[w].getTrimmedLength()===0);w--)j++;j>0&&(C.push(v+o.length-j),C.push(j)),v+=o.length-1}return C},i.reflowLargerCreateNewLayout=function(g,y){const h=[];let _=0,x=y[_],C=0;for(let v=0;v<g.length;v++)if(x===v){const n=y[++_];g.onDeleteEmitter.fire({index:v-C,amount:n}),v+=n-1,C+=n,x=y[++_]}else h.push(v);return{layout:h,countRemoved:C}},i.reflowLargerApplyNewLayout=function(g,y){const h=[];for(let _=0;_<y.length;_++)h.push(g.get(y[_]));for(let _=0;_<h.length;_++)g.set(_,h[_]);g.length=y.length},i.reflowSmallerGetNewLineLengths=function(g,y,h){const _=[],x=g.map(((d,o)=>c(g,o,y))).reduce(((d,o)=>d+o));let C=0,v=0,n=0;for(;n<x;){if(x-n<h){_.push(x-n);break}C+=h;const d=c(g,v,y);C>d&&(C-=d,v++);const o=g[v].getWidth(C-1)===2;o&&C--;const a=o?h-1:h;_.push(a),n+=a}return _},i.getWrappedLineTrimmedLength=c},5295:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;const g=c(8460),y=c(844),h=c(9092);class _ extends y.Disposable{constructor(C,v){super(),this._optionsService=C,this._bufferService=v,this._onBufferActivate=this.register(new g.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),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(C,v){this._normal.resize(C,v),this._alt.resize(C,v),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}i.BufferSet=_},511:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const g=c(482),y=c(643),h=c(3734);class _ extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const v=new _;return v.setFromCharData(C),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,g.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(C[y.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(C[y.CHAR_DATA_CHAR_INDEX].length===2){const n=C[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const d=C[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=d&&d<=57343?this.content=1024*(n-55296)+d-56320+65536|C[y.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=C[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[y.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=C[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=_},643:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;const g=c(8460),y=c(844);class h{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,y.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}i.Marker=h,h._nextId=1},7116:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.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:"≥","{":"π","|":"≠","}":"£","~":"·"},i.CHARSETS.A={"#":"£"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},i.CHARSETS.C=i.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},i.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},i.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},i.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},i.CHARSETS.E=i.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},i.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},i.CHARSETS.H=i.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(R,i)=>{var c,g,y;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
|
|
48
|
-
`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(c||(i.C0=c={})),(function(h){h.PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC=""})(g||(i.C1=g={})),(function(h){h.ST=`${c.ESC}\\`})(y||(i.C1_ESCAPED=y={}))},7399:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;const g=c(2584),y={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};i.evaluateKeyboardEvent=function(h,_,x,C){const v={type:0,cancel:!1,key:void 0},n=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?v.key=_?g.C0.ESC+"OA":g.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?v.key=_?g.C0.ESC+"OD":g.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?v.key=_?g.C0.ESC+"OC":g.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(v.key=_?g.C0.ESC+"OB":g.C0.ESC+"[B");break;case 8:v.key=h.ctrlKey?"\b":g.C0.DEL,h.altKey&&(v.key=g.C0.ESC+v.key);break;case 9:if(h.shiftKey){v.key=g.C0.ESC+"[Z";break}v.key=g.C0.HT,v.cancel=!0;break;case 13:v.key=h.altKey?g.C0.ESC+g.C0.CR:g.C0.CR,v.cancel=!0;break;case 27:v.key=g.C0.ESC,h.altKey&&(v.key=g.C0.ESC+g.C0.ESC),v.cancel=!0;break;case 37:if(h.metaKey)break;n?(v.key=g.C0.ESC+"[1;"+(n+1)+"D",v.key===g.C0.ESC+"[1;3D"&&(v.key=g.C0.ESC+(x?"b":"[1;5D"))):v.key=_?g.C0.ESC+"OD":g.C0.ESC+"[D";break;case 39:if(h.metaKey)break;n?(v.key=g.C0.ESC+"[1;"+(n+1)+"C",v.key===g.C0.ESC+"[1;3C"&&(v.key=g.C0.ESC+(x?"f":"[1;5C"))):v.key=_?g.C0.ESC+"OC":g.C0.ESC+"[C";break;case 38:if(h.metaKey)break;n?(v.key=g.C0.ESC+"[1;"+(n+1)+"A",x||v.key!==g.C0.ESC+"[1;3A"||(v.key=g.C0.ESC+"[1;5A")):v.key=_?g.C0.ESC+"OA":g.C0.ESC+"[A";break;case 40:if(h.metaKey)break;n?(v.key=g.C0.ESC+"[1;"+(n+1)+"B",x||v.key!==g.C0.ESC+"[1;3B"||(v.key=g.C0.ESC+"[1;5B")):v.key=_?g.C0.ESC+"OB":g.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(v.key=g.C0.ESC+"[2~");break;case 46:v.key=n?g.C0.ESC+"[3;"+(n+1)+"~":g.C0.ESC+"[3~";break;case 36:v.key=n?g.C0.ESC+"[1;"+(n+1)+"H":_?g.C0.ESC+"OH":g.C0.ESC+"[H";break;case 35:v.key=n?g.C0.ESC+"[1;"+(n+1)+"F":_?g.C0.ESC+"OF":g.C0.ESC+"[F";break;case 33:h.shiftKey?v.type=2:h.ctrlKey?v.key=g.C0.ESC+"[5;"+(n+1)+"~":v.key=g.C0.ESC+"[5~";break;case 34:h.shiftKey?v.type=3:h.ctrlKey?v.key=g.C0.ESC+"[6;"+(n+1)+"~":v.key=g.C0.ESC+"[6~";break;case 112:v.key=n?g.C0.ESC+"[1;"+(n+1)+"P":g.C0.ESC+"OP";break;case 113:v.key=n?g.C0.ESC+"[1;"+(n+1)+"Q":g.C0.ESC+"OQ";break;case 114:v.key=n?g.C0.ESC+"[1;"+(n+1)+"R":g.C0.ESC+"OR";break;case 115:v.key=n?g.C0.ESC+"[1;"+(n+1)+"S":g.C0.ESC+"OS";break;case 116:v.key=n?g.C0.ESC+"[15;"+(n+1)+"~":g.C0.ESC+"[15~";break;case 117:v.key=n?g.C0.ESC+"[17;"+(n+1)+"~":g.C0.ESC+"[17~";break;case 118:v.key=n?g.C0.ESC+"[18;"+(n+1)+"~":g.C0.ESC+"[18~";break;case 119:v.key=n?g.C0.ESC+"[19;"+(n+1)+"~":g.C0.ESC+"[19~";break;case 120:v.key=n?g.C0.ESC+"[20;"+(n+1)+"~":g.C0.ESC+"[20~";break;case 121:v.key=n?g.C0.ESC+"[21;"+(n+1)+"~":g.C0.ESC+"[21~";break;case 122:v.key=n?g.C0.ESC+"[23;"+(n+1)+"~":g.C0.ESC+"[23~";break;case 123:v.key=n?g.C0.ESC+"[24;"+(n+1)+"~":g.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(x&&!C||!h.altKey||h.metaKey)!x||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?v.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(v.key=g.C0.US),h.key==="@"&&(v.key=g.C0.NUL)):h.keyCode===65&&(v.type=1);else{const d=y[h.keyCode],o=d==null?void 0:d[h.shiftKey?1:0];if(o)v.key=g.C0.ESC+o;else if(h.keyCode>=65&&h.keyCode<=90){const a=h.ctrlKey?h.keyCode-64:h.keyCode+32;let S=String.fromCharCode(a);h.shiftKey&&(S=S.toUpperCase()),v.key=g.C0.ESC+S}else if(h.keyCode===32)v.key=g.C0.ESC+(h.ctrlKey?g.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let a=h.code.slice(3,4);h.shiftKey||(a=a.toLowerCase()),v.key=g.C0.ESC+a,v.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?v.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?v.key=g.C0.NUL:h.keyCode>=51&&h.keyCode<=55?v.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?v.key=g.C0.DEL:h.keyCode===219?v.key=g.C0.ESC:h.keyCode===220?v.key=g.C0.FS:h.keyCode===221&&(v.key=g.C0.GS)}return v}},482:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},i.utf32ToString=function(c,g=0,y=c.length){let h="";for(let _=g;_<y;++_){let x=c[_];x>65535?(x-=65536,h+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):h+=String.fromCharCode(x)}return h},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,g){const y=c.length;if(!y)return 0;let h=0,_=0;if(this._interim){const x=c.charCodeAt(_++);56320<=x&&x<=57343?g[h++]=1024*(this._interim-55296)+x-56320+65536:(g[h++]=this._interim,g[h++]=x),this._interim=0}for(let x=_;x<y;++x){const C=c.charCodeAt(x);if(55296<=C&&C<=56319){if(++x>=y)return this._interim=C,h;const v=c.charCodeAt(x);56320<=v&&v<=57343?g[h++]=1024*(C-55296)+v-56320+65536:(g[h++]=C,g[h++]=v)}else C!==65279&&(g[h++]=C)}return h}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,g){const y=c.length;if(!y)return 0;let h,_,x,C,v=0,n=0,d=0;if(this.interim[0]){let S=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let L,j=0;for(;(L=63&this.interim[++j])&&j<4;)E<<=6,E|=L;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=w-j;for(;d<D;){if(d>=y)return 0;if(L=c[d++],(192&L)!=128){d--,S=!0;break}this.interim[j++]=L,E<<=6,E|=63&L}S||(w===2?E<128?d--:g[v++]=E:w===3?E<2048||E>=55296&&E<=57343||E===65279||(g[v++]=E):E<65536||E>1114111||(g[v++]=E)),this.interim.fill(0)}const o=y-4;let a=d;for(;a<y;){for(;!(!(a<o)||128&(h=c[a])||128&(_=c[a+1])||128&(x=c[a+2])||128&(C=c[a+3]));)g[v++]=h,g[v++]=_,g[v++]=x,g[v++]=C,a+=4;if(h=c[a++],h<128)g[v++]=h;else if((224&h)==192){if(a>=y)return this.interim[0]=h,v;if(_=c[a++],(192&_)!=128){a--;continue}if(n=(31&h)<<6|63&_,n<128){a--;continue}g[v++]=n}else if((240&h)==224){if(a>=y)return this.interim[0]=h,v;if(_=c[a++],(192&_)!=128){a--;continue}if(a>=y)return this.interim[0]=h,this.interim[1]=_,v;if(x=c[a++],(192&x)!=128){a--;continue}if(n=(15&h)<<12|(63&_)<<6|63&x,n<2048||n>=55296&&n<=57343||n===65279)continue;g[v++]=n}else if((248&h)==240){if(a>=y)return this.interim[0]=h,v;if(_=c[a++],(192&_)!=128){a--;continue}if(a>=y)return this.interim[0]=h,this.interim[1]=_,v;if(x=c[a++],(192&x)!=128){a--;continue}if(a>=y)return this.interim[0]=h,this.interim[1]=_,this.interim[2]=x,v;if(C=c[a++],(192&C)!=128){a--;continue}if(n=(7&h)<<18|(63&_)<<12|(63&x)<<6|63&C,n<65536||n>1114111)continue;g[v++]=n}}return v}}},225:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;const g=c(1480),y=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;i.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let x=0;x<y.length;++x)_.fill(0,y[x][0],y[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?_[x]:(function(C,v){let n,d=0,o=v.length-1;if(C<v[0][0]||C>v[o][1])return!1;for(;o>=d;)if(n=d+o>>1,C>v[n][1])d=n+1;else{if(!(C<v[n][0]))return!0;o=n-1}return!1})(x,h)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,C){let v=this.wcwidth(x),n=v===0&&C!==0;if(n){const d=g.UnicodeService.extractWidth(C);d===0?n=!1:d>v&&(v=d)}return g.UnicodeService.createPropertyValue(0,v,n)}}},5981:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;const g=c(8460),y=c(844);class h extends y.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new g.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C)}_innerWrite(x=0,C=!0){const v=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],d=this._action(n,C);if(d){const a=S=>Date.now()-v>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(v,S);return void d.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(a)}const o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-v>=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()}}i.WriteBuffer=h},5941:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,g=/^[\da-f]+$/;function y(h,_){const x=h.toString(16),C=x.length<2?"0"+x:x;switch(_){case 4:return x[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}i.parseColor=function(h){if(!h)return;let _=h.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const x=c.exec(_);if(x){const C=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/C*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/C*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/C*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),g.exec(_)&&[3,6,9,12].includes(_.length))){const x=_.length/3,C=[0,0,0];for(let v=0;v<3;++v){const n=parseInt(_.slice(x*v,x*v+x),16);C[v]=x===1?n<<4:x===2?n:x===3?n>>4:n>>8}return C}},i.toRgbString=function(h,_=16){const[x,C,v]=h;return`rgb:${y(x,_)}/${y(C,_)}/${y(v,_)}`}},5770:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;const g=c(482),y=c(8742),h=c(5770),_=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(C,v){this._handlers[C]===void 0&&(this._handlers[C]=[]);const n=this._handlers[C];return n.push(v),{dispose:()=>{const d=n.indexOf(v);d!==-1&&n.splice(d,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(C,v){if(this.reset(),this._ident=C,this._active=this._handlers[C]||_,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(C,v,n){if(this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].put(C,v,n);else this._handlerFb(this._ident,"PUT",(0,g.utf32ToString)(C,v,n))}unhook(C,v=!0){if(this._active.length){let n=!1,d=this._active.length-1,o=!1;if(this._stack.paused&&(d=this._stack.loopPosition-1,n=v,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;d>=0&&(n=this._active[d].unhook(C),n!==!0);d--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=d,this._stack.fallThrough=!1,n;d--}for(;d>=0;d--)if(n=this._active[d].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=d,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",C);this._active=_,this._ident=0}};const x=new y.Params;x.addParam(0),i.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=x,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():x,this._data="",this._hitLimit=!1}put(C,v,n){this._hitLimit||(this._data+=(0,g.utf32ToString)(C,v,n),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let v=!1;if(this._hitLimit)v=!1;else if(C&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then((n=>(this._params=x,this._data="",this._hitLimit=!1,n)));return this._params=x,this._data="",this._hitLimit=!1,v}}},2015:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;const g=c(844),y=c(8742),h=c(6242),_=c(6351);class x{constructor(d){this.table=new Uint8Array(d)}setDefault(d,o){this.table.fill(d<<4|o)}add(d,o,a,S){this.table[o<<8|d]=a<<4|S}addMany(d,o,a,S){for(let E=0;E<d.length;E++)this.table[o<<8|d[E]]=a<<4|S}}i.TransitionTable=x;const C=160;i.VT500_TRANSITION_TABLE=(function(){const n=new x(4095),d=Array.apply(null,Array(256)).map(((j,w)=>w)),o=(j,w)=>d.slice(j,w),a=o(32,127),S=o(0,24);S.push(25),S.push.apply(S,o(28,32));const E=o(0,14);let L;for(L in n.setDefault(1,0),n.addMany(a,0,2,0),E)n.addMany([24,26,153,154],L,3,0),n.addMany(o(128,144),L,3,0),n.addMany(o(144,152),L,3,0),n.add(156,L,0,0),n.add(27,L,11,1),n.add(157,L,4,8),n.addMany([152,158,159],L,0,7),n.add(155,L,11,3),n.add(144,L,11,9);return n.addMany(S,0,3,0),n.addMany(S,1,3,1),n.add(127,1,0,1),n.addMany(S,8,0,8),n.addMany(S,3,3,3),n.add(127,3,0,3),n.addMany(S,4,3,4),n.add(127,4,0,4),n.addMany(S,6,3,6),n.addMany(S,5,3,5),n.add(127,5,0,5),n.addMany(S,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(a,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(o(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(a,7,0,7),n.addMany(S,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(o(64,127),3,7,0),n.addMany(o(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(o(48,60),4,8,4),n.addMany(o(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(o(32,64),6,0,6),n.add(127,6,0,6),n.addMany(o(64,127),6,0,0),n.addMany(o(32,48),3,9,5),n.addMany(o(32,48),5,9,5),n.addMany(o(48,64),5,0,6),n.addMany(o(64,127),5,7,0),n.addMany(o(32,48),4,9,5),n.addMany(o(32,48),1,9,2),n.addMany(o(32,48),2,9,2),n.addMany(o(48,127),2,10,0),n.addMany(o(48,80),1,10,0),n.addMany(o(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(o(96,127),1,10,0),n.add(80,1,11,9),n.addMany(S,9,0,9),n.add(127,9,0,9),n.addMany(o(28,32),9,0,9),n.addMany(o(32,48),9,9,12),n.addMany(o(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(S,11,0,11),n.addMany(o(32,128),11,0,11),n.addMany(o(28,32),11,0,11),n.addMany(S,10,0,10),n.add(127,10,0,10),n.addMany(o(28,32),10,0,10),n.addMany(o(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(o(32,48),10,9,12),n.addMany(S,12,0,12),n.add(127,12,0,12),n.addMany(o(28,32),12,0,12),n.addMany(o(32,48),12,9,12),n.addMany(o(48,64),12,0,11),n.addMany(o(64,127),12,12,13),n.addMany(o(64,127),10,12,13),n.addMany(o(64,127),9,12,13),n.addMany(S,13,13,13),n.addMany(a,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(C,0,2,0),n.add(C,8,5,8),n.add(C,6,0,6),n.add(C,11,0,11),n.add(C,13,13,13),n})();class v extends g.Disposable{constructor(d=i.VT500_TRANSITION_TABLE){super(),this._transitions=d,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(o,a,S)=>{},this._executeHandlerFb=o=>{},this._csiHandlerFb=(o,a)=>{},this._escHandlerFb=o=>{},this._errorHandlerFb=o=>o,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,g.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(d,o=[64,126]){let a=0;if(d.prefix){if(d.prefix.length>1)throw new Error("only one byte as prefix supported");if(a=d.prefix.charCodeAt(0),a&&60>a||a>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(d.intermediates){if(d.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;E<d.intermediates.length;++E){const L=d.intermediates.charCodeAt(E);if(32>L||L>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");a<<=8,a|=L}}if(d.final.length!==1)throw new Error("final must be a single byte");const S=d.final.charCodeAt(0);if(o[0]>S||S>o[1])throw new Error(`final must be in range ${o[0]} .. ${o[1]}`);return a<<=8,a|=S,a}identToString(d){const o=[];for(;d;)o.push(String.fromCharCode(255&d)),d>>=8;return o.reverse().join("")}setPrintHandler(d){this._printHandler=d}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(d,o){const a=this._identifier(d,[48,126]);this._escHandlers[a]===void 0&&(this._escHandlers[a]=[]);const S=this._escHandlers[a];return S.push(o),{dispose:()=>{const E=S.indexOf(o);E!==-1&&S.splice(E,1)}}}clearEscHandler(d){this._escHandlers[this._identifier(d,[48,126])]&&delete this._escHandlers[this._identifier(d,[48,126])]}setEscHandlerFallback(d){this._escHandlerFb=d}setExecuteHandler(d,o){this._executeHandlers[d.charCodeAt(0)]=o}clearExecuteHandler(d){this._executeHandlers[d.charCodeAt(0)]&&delete this._executeHandlers[d.charCodeAt(0)]}setExecuteHandlerFallback(d){this._executeHandlerFb=d}registerCsiHandler(d,o){const a=this._identifier(d);this._csiHandlers[a]===void 0&&(this._csiHandlers[a]=[]);const S=this._csiHandlers[a];return S.push(o),{dispose:()=>{const E=S.indexOf(o);E!==-1&&S.splice(E,1)}}}clearCsiHandler(d){this._csiHandlers[this._identifier(d)]&&delete this._csiHandlers[this._identifier(d)]}setCsiHandlerFallback(d){this._csiHandlerFb=d}registerDcsHandler(d,o){return this._dcsParser.registerHandler(this._identifier(d),o)}clearDcsHandler(d){this._dcsParser.clearHandler(this._identifier(d))}setDcsHandlerFallback(d){this._dcsParser.setHandlerFallback(d)}registerOscHandler(d,o){return this._oscParser.registerHandler(d,o)}clearOscHandler(d){this._oscParser.clearHandler(d)}setOscHandlerFallback(d){this._oscParser.setHandlerFallback(d)}setErrorHandler(d){this._errorHandler=d}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(d,o,a,S,E){this._parseStack.state=d,this._parseStack.handlers=o,this._parseStack.handlerPos=a,this._parseStack.transition=S,this._parseStack.chunkPos=E}parse(d,o,a){let S,E=0,L=0,j=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,j=this._parseStack.chunkPos+1;else{if(a===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const w=this._parseStack.handlers;let D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(a===!1&&D>-1){for(;D>=0&&(S=w[D](this._params),S!==!0);D--)if(S instanceof Promise)return this._parseStack.handlerPos=D,S}this._parseStack.handlers=[];break;case 4:if(a===!1&&D>-1){for(;D>=0&&(S=w[D](),S!==!0);D--)if(S instanceof Promise)return this._parseStack.handlerPos=D,S}this._parseStack.handlers=[];break;case 6:if(E=d[this._parseStack.chunkPos],S=this._dcsParser.unhook(E!==24&&E!==26,a),S)return S;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=d[this._parseStack.chunkPos],S=this._oscParser.end(E!==24&&E!==26,a),S)return S;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,j=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let w=j;w<o;++w){switch(E=d[w],L=this._transitions.table[this.currentState<<8|(E<160?E:C)],L>>4){case 2:for(let I=w+1;;++I){if(I>=o||(E=d[I])<32||E>126&&E<C){this._printHandler(d,w,I),w=I-1;break}if(++I>=o||(E=d[I])<32||E>126&&E<C){this._printHandler(d,w,I),w=I-1;break}if(++I>=o||(E=d[I])<32||E>126&&E<C){this._printHandler(d,w,I),w=I-1;break}if(++I>=o||(E=d[I])<32||E>126&&E<C){this._printHandler(d,w,I),w=I-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:w,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const D=this._csiHandlers[this._collect<<8|E];let H=D?D.length-1:-1;for(;H>=0&&(S=D[H](this._params),S!==!0);H--)if(S instanceof Promise)return this._preserveStack(3,D,H,L,w),S;H<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++w<o&&(E=d[w])>47&&E<60);w--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const U=this._escHandlers[this._collect<<8|E];let W=U?U.length-1:-1;for(;W>=0&&(S=U[W](),S!==!0);W--)if(S instanceof Promise)return this._preserveStack(4,U,W,L,w),S;W<0&&this._escHandlerFb(this._collect<<8|E),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|E,this._params);break;case 13:for(let I=w+1;;++I)if(I>=o||(E=d[I])===24||E===26||E===27||E>127&&E<C){this._dcsParser.put(d,w,I),w=I-1;break}break;case 14:if(S=this._dcsParser.unhook(E!==24&&E!==26),S)return this._preserveStack(6,[],0,L,w),S;E===27&&(L|=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 I=w+1;;I++)if(I>=o||(E=d[I])<32||E>127&&E<C){this._oscParser.put(d,w,I),w=I-1;break}break;case 6:if(S=this._oscParser.end(E!==24&&E!==26),S)return this._preserveStack(5,[],0,L,w),S;E===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&L}}}i.EscapeSequenceParser=v},6242:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;const g=c(5770),y=c(482),h=[];i.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,x){this._handlers[_]===void 0&&(this._handlers[_]=[]);const C=this._handlers[_];return C.push(x),{dispose:()=>{const v=C.indexOf(x);v!==-1&&C.splice(v,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,x,C){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(_,x,C);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(_,x,C))}start(){this.reset(),this._state=1}put(_,x,C){if(this._state!==3){if(this._state===1)for(;x<C;){const v=_[x++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&C-x>0&&this._put(_,x,C)}}end(_,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,v=this._active.length-1,n=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,C=x,n=this._stack.fallThrough,this._stack.paused=!1),!n&&C===!1){for(;v>=0&&(C=this._active[v].end(_),C!==!0);v--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,C;v--}for(;v>=0;v--)if(C=this._active[v].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",_);this._active=h,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,x,C){this._hitLimit||(this._data+=(0,y.utf32ToString)(_,x,C),this._data.length>g.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let x=!1;if(this._hitLimit)x=!1;else if(_&&(x=this._handler(this._data),x instanceof Promise))return x.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,x}}},8742:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;const c=2147483647;class g{static fromArray(h){const _=new g;if(!h.length)return _;for(let x=Array.isArray(h[0])?1:0;x<h.length;++x){const C=h[x];if(Array.isArray(C))for(let v=0;v<C.length;++v)_.addSubParam(C[v]);else _.addParam(C)}return _}constructor(h=32,_=32){if(this.maxLength=h,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new g(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let _=0;_<this.length;++_){h.push(this.params[_]);const x=this._subParamsIdx[_]>>8,C=255&this._subParamsIdx[_];C-x>0&&h.push(Array.prototype.slice.call(this._subParams,x,C))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const _=this._subParamsIdx[h]>>8,x=255&this._subParamsIdx[h];return x-_>0?this._subParams.subarray(_,x):null}getSubParamsAll(){const h={};for(let _=0;_<this.length;++_){const x=this._subParamsIdx[_]>>8,C=255&this._subParamsIdx[_];C-x>0&&(h[_]=this._subParams.slice(x,C))}return h}addDigit(h){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,C=x[_-1];x[_-1]=~C?Math.min(10*C+h,c):h}}i.Params=g},5741:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,g){const y={instance:g,dispose:g.dispose,isDisposed:!1};this._addons.push(y),g.dispose=()=>this._wrappedAddonDispose(y),g.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let g=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===c){g=y;break}if(g===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(g,1)}}},8771:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;const g=c(3785),y=c(511);i.BufferApiView=class{constructor(h,_){this._buffer=h,this.type=_}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const _=this._buffer.lines.get(h);if(_)return new g.BufferLineApiView(_)}getNullCell(){return new y.CellData}}},3785:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;const g=c(511);i.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,h){if(!(y<0||y>=this._line.length))return h?(this._line.loadCell(y,h),h):this._line.loadCell(y,new g.CellData)}translateToString(y,h,_){return this._line.translateToString(y,h,_)}}},8285:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;const g=c(8771),y=c(8460),h=c(844);class _ extends h.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new g.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new g.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)}}i.BufferNamespaceApi=_},7975:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,g){return this._core.registerCsiHandler(c,(y=>g(y.toArray())))}addCsiHandler(c,g){return this.registerCsiHandler(c,g)}registerDcsHandler(c,g){return this._core.registerDcsHandler(c,((y,h)=>g(y,h.toArray())))}addDcsHandler(c,g){return this.registerDcsHandler(c,g)}registerEscHandler(c,g){return this._core.registerEscHandler(c,g)}addEscHandler(c,g){return this.registerEscHandler(c,g)}registerOscHandler(c,g){return this._core.registerOscHandler(c,g)}addOscHandler(c,g){return this.registerOscHandler(c,g)}}},7090:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(R,i,c){var g=this&&this.__decorate||function(n,d,o,a){var S,E=arguments.length,L=E<3?d:a===null?a=Object.getOwnPropertyDescriptor(d,o):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(n,d,o,a);else for(var j=n.length-1;j>=0;j--)(S=n[j])&&(L=(E<3?S(L):E>3?S(d,o,L):S(d,o))||L);return E>3&&L&&Object.defineProperty(d,o,L),L},y=this&&this.__param||function(n,d){return function(o,a){d(o,a,n)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;const h=c(8460),_=c(844),x=c(5295),C=c(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let v=i.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(n,this))}resize(n,d){this.cols=n,this.rows=d,this.buffers.resize(n,d),this._onResize.fire({cols:n,rows:d})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,d=!1){const o=this.buffer;let a;a=this._cachedBlankLine,a&&a.length===this.cols&&a.getFg(0)===n.fg&&a.getBg(0)===n.bg||(a=o.getBlankLine(n,d),this._cachedBlankLine=a),a.isWrapped=d;const S=o.ybase+o.scrollTop,E=o.ybase+o.scrollBottom;if(o.scrollTop===0){const L=o.lines.isFull;E===o.lines.length-1?L?o.lines.recycle().copyFrom(a):o.lines.push(a.clone()):o.lines.splice(E+1,0,a.clone()),L?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const L=E-S+1;o.lines.shiftElements(S+1,L-1,-1),o.lines.set(E,a.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(n,d,o){const a=this.buffer;if(n<0){if(a.ydisp===0)return;this.isUserScrolling=!0}else n+a.ydisp>=a.ybase&&(this.isUserScrolling=!1);const S=a.ydisp;a.ydisp=Math.max(Math.min(a.ydisp+n,a.ybase),0),S!==a.ydisp&&(d||this._onScroll.fire(a.ydisp))}};i.BufferService=v=g([y(0,C.IOptionsService)],v)},7994:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharsetService=void 0,i.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,g){this._charsets[c]=g,this.glevel===c&&(this.charset=g)}}},1753:function(R,i,c){var g=this&&this.__decorate||function(a,S,E,L){var j,w=arguments.length,D=w<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(a,S,E,L);else for(var H=a.length-1;H>=0;H--)(j=a[H])&&(D=(w<3?j(D):w>3?j(S,E,D):j(S,E))||D);return w>3&&D&&Object.defineProperty(S,E,D),D},y=this&&this.__param||function(a,S){return function(E,L){S(E,L,a)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;const h=c(2585),_=c(8460),x=c(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:a=>a.button!==4&&a.action===1&&(a.ctrl=!1,a.alt=!1,a.shift=!1,!0)},VT200:{events:19,restrict:a=>a.action!==32},DRAG:{events:23,restrict:a=>a.action!==32||a.button!==3},ANY:{events:31,restrict:a=>!0}};function v(a,S){let E=(a.ctrl?16:0)|(a.shift?4:0)|(a.alt?8:0);return a.button===4?(E|=64,E|=a.action):(E|=3&a.button,4&a.button&&(E|=64),8&a.button&&(E|=128),a.action===32?E|=32:a.action!==0||S||(E|=3)),E}const n=String.fromCharCode,d={DEFAULT:a=>{const S=[v(a,!1)+32,a.col+32,a.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${n(S[0])}${n(S[1])}${n(S[2])}`},SGR:a=>{const S=a.action===0&&a.button!==4?"m":"M";return`\x1B[<${v(a,!0)};${a.col};${a.row}${S}`},SGR_PIXELS:a=>{const S=a.action===0&&a.button!==4?"m":"M";return`\x1B[<${v(a,!0)};${a.x};${a.y}${S}`}};let o=i.CoreMouseService=class extends x.Disposable{constructor(a,S){super(),this._bufferService=a,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(C))this.addProtocol(E,C[E]);for(const E of Object.keys(d))this.addEncoding(E,d[E]);this.reset()}addProtocol(a,S){this._protocols[a]=S}addEncoding(a,S){this._encodings[a]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(a){if(!this._protocols[a])throw new Error(`unknown protocol "${a}"`);this._activeProtocol=a,this._onProtocolChange.fire(this._protocols[a].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(a){if(!this._encodings[a])throw new Error(`unknown encoding "${a}"`);this._activeEncoding=a}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(a){if(a.col<0||a.col>=this._bufferService.cols||a.row<0||a.row>=this._bufferService.rows||a.button===4&&a.action===32||a.button===3&&a.action!==32||a.button!==4&&(a.action===2||a.action===3)||(a.col++,a.row++,a.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,a,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(a))return!1;const S=this._encodings[this._activeEncoding](a);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=a,!0}explainEvents(a){return{down:!!(1&a),up:!!(2&a),drag:!!(4&a),move:!!(8&a),wheel:!!(16&a)}}_equalEvents(a,S,E){if(E){if(a.x!==S.x||a.y!==S.y)return!1}else if(a.col!==S.col||a.row!==S.row)return!1;return a.button===S.button&&a.action===S.action&&a.ctrl===S.ctrl&&a.alt===S.alt&&a.shift===S.shift}};i.CoreMouseService=o=g([y(0,h.IBufferService),y(1,h.ICoreService)],o)},6975:function(R,i,c){var g=this&&this.__decorate||function(o,a,S,E){var L,j=arguments.length,w=j<3?a:E===null?E=Object.getOwnPropertyDescriptor(a,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(o,a,S,E);else for(var D=o.length-1;D>=0;D--)(L=o[D])&&(w=(j<3?L(w):j>3?L(a,S,w):L(a,S))||w);return j>3&&w&&Object.defineProperty(a,S,w),w},y=this&&this.__param||function(o,a){return function(S,E){a(S,E,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;const h=c(1439),_=c(8460),x=c(844),C=c(2585),v=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let d=i.CoreService=class extends x.Disposable{constructor(o,a,S){super(),this._bufferService=o,this._logService=a,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(n)}reset(){this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(n)}triggerDataEvent(o,a=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;a&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),a&&this._onUserInput.fire(),this._logService.debug(`sending data "${o}"`,(()=>o.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(o)}triggerBinaryEvent(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${o}"`,(()=>o.split("").map((a=>a.charCodeAt(0))))),this._onBinary.fire(o))}};i.CoreService=d=g([y(0,C.IBufferService),y(1,C.ILogService),y(2,C.IOptionsService)],d)},9074:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;const g=c(8055),y=c(8460),h=c(844),_=c(6106);let x=0,C=0;class v extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((o=>o==null?void 0:o.marker.line)),this._onDecorationRegistered=this.register(new y.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new y.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(o){if(o.marker.isDisposed)return;const a=new n(o);if(a){const S=a.marker.onDispose((()=>a.dispose()));a.onDispose((()=>{a&&(this._decorations.delete(a)&&this._onDecorationRemoved.fire(a),S.dispose())})),this._decorations.insert(a),this._onDecorationRegistered.fire(a)}return a}reset(){for(const o of this._decorations.values())o.dispose();this._decorations.clear()}*getDecorationsAtCell(o,a,S){let E=0,L=0;for(const j of this._decorations.getKeyIterator(a))E=j.options.x??0,L=E+(j.options.width??1),o>=E&&o<L&&(!S||(j.options.layer??"bottom")===S)&&(yield j)}forEachDecorationAtCell(o,a,S,E){this._decorations.forEachByKey(a,(L=>{x=L.options.x??0,C=x+(L.options.width??1),o>=x&&o<C&&(!S||(L.options.layer??"bottom")===S)&&E(L)}))}}i.DecorationService=v;class n extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=g.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=g.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(o){super(),this.options=o,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=o.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;const g=c(2585),y=c(8343);class h{constructor(...x){this._entries=new Map;for(const[C,v]of x)this.set(C,v)}set(x,C){const v=this._entries.get(x);return this._entries.set(x,C),v}forEach(x){for(const[C,v]of this._entries.entries())x(C,v)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}i.ServiceCollection=h,i.InstantiationService=class{constructor(){this._services=new h,this._services.set(g.IInstantiationService,this)}setService(_,x){this._services.set(_,x)}getService(_){return this._services.get(_)}createInstance(_,...x){const C=(0,y.getServiceDependencies)(_).sort(((d,o)=>d.index-o.index)),v=[];for(const d of C){const o=this._services.get(d.id);if(!o)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${d.id}.`);v.push(o)}const n=C.length>0?C[0].index:x.length;if(x.length!==n)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${n+1} conflicts with ${x.length} static arguments`);return new _(...x,...v)}}},7866:function(R,i,c){var g=this&&this.__decorate||function(n,d,o,a){var S,E=arguments.length,L=E<3?d:a===null?a=Object.getOwnPropertyDescriptor(d,o):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(n,d,o,a);else for(var j=n.length-1;j>=0;j--)(S=n[j])&&(L=(E<3?S(L):E>3?S(d,o,L):S(d,o))||L);return E>3&&L&&Object.defineProperty(d,o,L),L},y=this&&this.__param||function(n,d){return function(o,a){d(o,a,n)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const h=c(844),_=c(2585),x={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let C,v=i.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let d=0;d<n.length;d++)typeof n[d]=="function"&&(n[d]=n[d]())}_log(n,d,o){this._evalLazyOptionalParams(o),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+d,...o)}trace(n,...d){var o;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.trace.bind(this._optionsService.options.logger))??console.log,n,d)}debug(n,...d){var o;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.debug.bind(this._optionsService.options.logger))??console.log,n,d)}info(n,...d){var o;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.info.bind(this._optionsService.options.logger))??console.info,n,d)}warn(n,...d){var o;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.warn.bind(this._optionsService.options.logger))??console.warn,n,d)}error(n,...d){var o;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.error.bind(this._optionsService.options.logger))??console.error,n,d)}};i.LogService=v=g([y(0,_.IOptionsService)],v),i.setTraceLogger=function(n){C=n},i.traceCall=function(n,d,o){if(typeof o.value!="function")throw new Error("not supported");const a=o.value;o.value=function(...S){if(C.logLevel!==_.LogLevelEnum.TRACE)return a.apply(this,S);C.trace(`GlyphRenderer#${a.name}(${S.map((L=>JSON.stringify(L))).join(", ")})`);const E=a.apply(this,S);return C.trace(`GlyphRenderer#${a.name} return`,E),E}}},7302:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;const g=c(8460),y=c(844),h=c(6114);i.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends y.Disposable{constructor(v){super(),this._onOptionChange=this.register(new g.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...i.DEFAULT_OPTIONS};for(const d in v)if(d in n)try{const o=v[d];n[d]=this._sanitizeAndValidateOption(d,o)}catch(o){console.error(o)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(v,n){return this.onOptionChange((d=>{d===v&&n(this.rawOptions[v])}))}onMultipleOptionChange(v,n){return this.onOptionChange((d=>{v.indexOf(d)!==-1&&n()}))}_setupOptions(){const v=d=>{if(!(d in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${d}"`);return this.rawOptions[d]},n=(d,o)=>{if(!(d in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${d}"`);o=this._sanitizeAndValidateOption(d,o),this.rawOptions[d]!==o&&(this.rawOptions[d]=o,this._onOptionChange.fire(d))};for(const d in this.rawOptions){const o={get:v.bind(this,d),set:n.bind(this,d)};Object.defineProperty(this.options,d,o)}}_sanitizeAndValidateOption(v,n){switch(v){case"cursorStyle":if(n||(n=i.DEFAULT_OPTIONS[v]),!(function(d){return d==="block"||d==="underline"||d==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${v}`);break;case"wordSeparator":n||(n=i.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=_.includes(n)?n:i.DEFAULT_OPTIONS[v];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${v} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${v} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}i.OptionsService=x},2660:function(R,i,c){var g=this&&this.__decorate||function(x,C,v,n){var d,o=arguments.length,a=o<3?C:n===null?n=Object.getOwnPropertyDescriptor(C,v):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(x,C,v,n);else for(var S=x.length-1;S>=0;S--)(d=x[S])&&(a=(o<3?d(a):o>3?d(C,v,a):d(C,v))||a);return o>3&&a&&Object.defineProperty(C,v,a),a},y=this&&this.__param||function(x,C){return function(v,n){C(v,n,x)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;const h=c(2585);let _=i.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const C=this._bufferService.buffer;if(x.id===void 0){const S=C.addMarker(C.ybase+C.y),E={data:x,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(E,S))),this._dataByLinkId.set(E.id,E),E.id}const v=x,n=this._getEntryIdKey(v),d=this._entriesWithId.get(n);if(d)return this.addLineToLink(d.id,C.ybase+C.y),d.id;const o=C.addMarker(C.ybase+C.y),a={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[o]};return o.onDispose((()=>this._removeMarkerFromLink(a,o))),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(x,C){const v=this._dataByLinkId.get(x);if(v&&v.lines.every((n=>n.line!==C))){const n=this._bufferService.buffer.addMarker(C);v.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(v,n)))}}getLinkData(x){var C;return(C=this._dataByLinkId.get(x))==null?void 0:C.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,C){const v=x.lines.indexOf(C);v!==-1&&(x.lines.splice(v,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};i.OscLinkService=_=g([y(0,h.IBufferService)],_)},8343:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const c="di$target",g="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(y){return y[g]||[]},i.createDecorator=function(y){if(i.serviceRegistry.has(y))return i.serviceRegistry.get(y);const h=function(_,x,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,n,d){n[c]===n?n[g].push({id:v,index:d}):(n[g]=[{id:v,index:d}],n[c]=n)})(h,_,C)};return h.toString=()=>y,i.serviceRegistry.set(y,h),h}},2585:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const g=c(8343);var y;i.IBufferService=(0,g.createDecorator)("BufferService"),i.ICoreMouseService=(0,g.createDecorator)("CoreMouseService"),i.ICoreService=(0,g.createDecorator)("CoreService"),i.ICharsetService=(0,g.createDecorator)("CharsetService"),i.IInstantiationService=(0,g.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(y||(i.LogLevelEnum=y={})),i.ILogService=(0,g.createDecorator)("LogService"),i.IOptionsService=(0,g.createDecorator)("OptionsService"),i.IOscLinkService=(0,g.createDecorator)("OscLinkService"),i.IUnicodeService=(0,g.createDecorator)("UnicodeService"),i.IDecorationService=(0,g.createDecorator)("DecorationService")},1480:(R,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;const g=c(8460),y=c(225);class h{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,C,v=!1){return(16777215&x)<<3|(3&C)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new g.EventEmitter,this.onChange=this._onChange.event;const x=new y.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let C=0,v=0;const n=x.length;for(let d=0;d<n;++d){let o=x.charCodeAt(d);if(55296<=o&&o<=56319){if(++d>=n)return C+this.wcwidth(o);const E=x.charCodeAt(d);56320<=E&&E<=57343?o=1024*(o-55296)+E-56320+65536:C+=this.wcwidth(E)}const a=this.charProperties(o,v);let S=h.extractWidth(a);h.extractShouldJoin(a)&&(S-=h.extractWidth(v)),C+=S,v=a}return C}charProperties(x,C){return this._activeProvider.charProperties(x,C)}}i.UnicodeService=h}},k={};function P(R){var i=k[R];if(i!==void 0)return i.exports;var c=k[R]={exports:{}};return p[R].call(c.exports,c,c.exports,P),c.exports}var O={};return(()=>{var R=O;Object.defineProperty(R,"__esModule",{value:!0}),R.Terminal=void 0;const i=P(9042),c=P(3236),g=P(844),y=P(5741),h=P(8285),_=P(7975),x=P(7090),C=["cols","rows"];class v extends g.Disposable{constructor(d){super(),this._core=this.register(new c.Terminal(d)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const o=S=>this._core.options[S],a=(S,E)=>{this._checkReadonlyOptions(S),this._core.options[S]=E};for(const S in this._core.options){const E={get:o.bind(this,S),set:a.bind(this,S)};Object.defineProperty(this._publicOptions,S,E)}}_checkReadonlyOptions(d){if(C.includes(d))throw new Error(`Option "${d}" 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 _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const d=this._core.coreService.decPrivateModes;let o="none";switch(this._core.coreMouseService.activeProtocol){case"X10":o="x10";break;case"VT200":o="vt200";break;case"DRAG":o="drag";break;case"ANY":o="any"}return{applicationCursorKeysMode:d.applicationCursorKeys,applicationKeypadMode:d.applicationKeypad,bracketedPasteMode:d.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:d.origin,reverseWraparoundMode:d.reverseWraparound,sendFocusMode:d.sendFocus,wraparoundMode:d.wraparound}}get options(){return this._publicOptions}set options(d){for(const o in d)this._publicOptions[o]=d[o]}blur(){this._core.blur()}focus(){this._core.focus()}input(d,o=!0){this._core.input(d,o)}resize(d,o){this._verifyIntegers(d,o),this._core.resize(d,o)}open(d){this._core.open(d)}attachCustomKeyEventHandler(d){this._core.attachCustomKeyEventHandler(d)}attachCustomWheelEventHandler(d){this._core.attachCustomWheelEventHandler(d)}registerLinkProvider(d){return this._core.registerLinkProvider(d)}registerCharacterJoiner(d){return this._checkProposedApi(),this._core.registerCharacterJoiner(d)}deregisterCharacterJoiner(d){this._checkProposedApi(),this._core.deregisterCharacterJoiner(d)}registerMarker(d=0){return this._verifyIntegers(d),this._core.registerMarker(d)}registerDecoration(d){return this._checkProposedApi(),this._verifyPositiveIntegers(d.x??0,d.width??0,d.height??0),this._core.registerDecoration(d)}hasSelection(){return this._core.hasSelection()}select(d,o,a){this._verifyIntegers(d,o,a),this._core.select(d,o,a)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(d,o){this._verifyIntegers(d,o),this._core.selectLines(d,o)}dispose(){super.dispose()}scrollLines(d){this._verifyIntegers(d),this._core.scrollLines(d)}scrollPages(d){this._verifyIntegers(d),this._core.scrollPages(d)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(d){this._verifyIntegers(d),this._core.scrollToLine(d)}clear(){this._core.clear()}write(d,o){this._core.write(d,o)}writeln(d,o){this._core.write(d),this._core.write(`\r
|
|
49
|
-
`,o)}paste(d){this._core.paste(d)}refresh(d,o){this._verifyIntegers(d,o),this._core.refresh(d,o)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(d){this._addonManager.loadAddon(this,d)}static get strings(){return i}_verifyIntegers(...d){for(const o of d)if(o===1/0||isNaN(o)||o%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...d){for(const o of d)if(o&&(o===1/0||isNaN(o)||o%1!=0||o<0))throw new Error("This API only accepts positive integers")}}R.Terminal=v})(),O})()))})(Oa)),Oa.exports}var fp=hp(),Na={exports:{}},rd;function pp(){return rd||(rd=1,(function(l,m){(function(p,k){l.exports=k()})(self,(()=>(()=>{var p={};return(()=>{var k=p;Object.defineProperty(k,"__esModule",{value:!0}),k.FitAddon=void 0,k.FitAddon=class{activate(P){this._terminal=P}dispose(){}fit(){const P=this.proposeDimensions();if(!P||!this._terminal||isNaN(P.cols)||isNaN(P.rows))return;const O=this._terminal._core;this._terminal.rows===P.rows&&this._terminal.cols===P.cols||(O._renderService.clear(),this._terminal.resize(P.cols,P.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const P=this._terminal._core,O=P._renderService.dimensions;if(O.css.cell.width===0||O.css.cell.height===0)return;const R=this._terminal.options.scrollback===0?0:P.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(i.getPropertyValue("height")),g=Math.max(0,parseInt(i.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),h=c-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),_=g-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-R;return{cols:Math.max(2,Math.floor(_/O.css.cell.width)),rows:Math.max(1,Math.floor(h/O.css.cell.height))}}}})(),p})()))})(Na)),Na.exports}var mp=pp(),Ia={exports:{}},sd;function gp(){return sd||(sd=1,(function(l,m){(function(p,k){l.exports=k()})(self,(()=>(()=>{var p={6:(R,i)=>{function c(y){try{const h=new URL(y),_=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return y.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(i,"__esModule",{value:!0}),i.LinkComputer=i.WebLinkProvider=void 0,i.WebLinkProvider=class{constructor(y,h,_,x={}){this._terminal=y,this._regex=h,this._handler=_,this._options=x}provideLinks(y,h){const _=g.computeLink(y,this._regex,this._terminal,this._handler);h(this._addCallbacks(_))}_addCallbacks(y){return y.map((h=>(h.leave=this._options.leave,h.hover=(_,x)=>{if(this._options.hover){const{range:C}=h;this._options.hover(_,x,C)}},h)))}};class g{static computeLink(h,_,x,C){const v=new RegExp(_.source,(_.flags||"")+"g"),[n,d]=g._getWindowedLineStrings(h-1,x),o=n.join("");let a;const S=[];for(;a=v.exec(o);){const E=a[0];if(!c(E))continue;const[L,j]=g._mapStrIdx(x,d,0,a.index),[w,D]=g._mapStrIdx(x,L,j,E.length);if(L===-1||j===-1||w===-1||D===-1)continue;const H={start:{x:j+1,y:L+1},end:{x:D,y:w+1}};S.push({range:H,text:E,activate:C})}return S}static _getWindowedLineStrings(h,_){let x,C=h,v=h,n=0,d="";const o=[];if(x=_.buffer.active.getLine(h)){const a=x.translateToString(!0);if(x.isWrapped&&a[0]!==" "){for(n=0;(x=_.buffer.active.getLine(--C))&&n<2048&&(d=x.translateToString(!0),n+=d.length,o.push(d),x.isWrapped&&d.indexOf(" ")===-1););o.reverse()}for(o.push(a),n=0;(x=_.buffer.active.getLine(++v))&&x.isWrapped&&n<2048&&(d=x.translateToString(!0),n+=d.length,o.push(d),d.indexOf(" ")===-1););}return[o,C]}static _mapStrIdx(h,_,x,C){const v=h.buffer.active,n=v.getNullCell();let d=x;for(;C;){const o=v.getLine(_);if(!o)return[-1,-1];for(let a=d;a<o.length;++a){o.getCell(a,n);const S=n.getChars();if(n.getWidth()&&(C-=S.length||1,a===o.length-1&&S==="")){const E=v.getLine(_+1);E&&E.isWrapped&&(E.getCell(0,n),n.getWidth()===2&&(C+=1))}if(C<0)return[_,a]}_++,d=0}return[_,d]}}i.LinkComputer=g}},k={};function P(R){var i=k[R];if(i!==void 0)return i.exports;var c=k[R]={exports:{}};return p[R](c,c.exports,P),c.exports}var O={};return(()=>{var R=O;Object.defineProperty(R,"__esModule",{value:!0}),R.WebLinksAddon=void 0;const i=P(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function g(y,h){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}R.WebLinksAddon=class{constructor(y=g,h={}){this._handler=y,this._options=h}activate(y){this._terminal=y;const h=this._options,_=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new i.WebLinkProvider(this._terminal,_,this._handler,h))}dispose(){var y;(y=this._linkProvider)==null||y.dispose()}}})(),O})()))})(Ia)),Ia.exports}var vp=gp();function _p({tabId:l,cwd:m}){const p=J.useRef(null),k=J.useRef(null),P=J.useRef(null),O=J.useRef(!1);return J.useEffect(()=>{if(console.log("[Terminal] mount effect running, tabId=",l,"cwd=",m,"alreadySpawned=",O.current),!p.current||O.current)return;O.current=!0;const R=new fp.Terminal({fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,allowProposedApi:!0,theme:{background:"#0b0d10",foreground:"#e6e8ec",cursor:"#d97757",selectionBackground:"#3a4250",black:"#1a1f27",red:"#e06c75",green:"#98c379",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#56b6c2",white:"#e6e8ec",brightBlack:"#545c68",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#ffffff"}}),i=new mp.FitAddon;R.loadAddon(i),R.loadAddon(new vp.WebLinksAddon),R.open(p.current),i.fit(),R.focus(),k.current=R,P.current=i;const{cols:c,rows:g}=R,y=window.api.pty.onData(l,C=>R.write(C)),h=window.api.pty.onExit(l,({exitCode:C})=>{R.write(`\r
|
|
50
|
-
\x1B[38;5;240m[session exited code=${C}]\x1B[0m\r
|
|
51
|
-
`),je.getState().setTabExited(l,C)});R.onData(C=>window.api.pty.write({tabId:l,data:C})),R.onResize(({cols:C,rows:v})=>window.api.pty.resize({tabId:l,cols:C,rows:v})),console.log("[Terminal] calling pty.spawn",{tabId:l,cwd:m,cols:c,rows:g}),window.api.pty.spawn({tabId:l,cwd:m,cols:c,rows:g}).then(({pid:C,reattached:v})=>{if(console.log("[Terminal] pty.spawn resolved, pid=",C,"tabId=",l,"reattached=",v),je.getState().setTabRunning(l,C),v)return;const{startupCommand:n}=je.getState().tabs.find(d=>d.id===l)??{};n&&setTimeout(()=>{window.api.pty.write({tabId:l,data:`${n}
|
|
52
|
-
`})},350)}).catch(C=>{console.error("[Terminal] pty.spawn rejected for tabId=",l,C),R.write(`\r
|
|
53
|
-
\x1B[31mfailed to spawn: ${C.message}\x1B[0m\r
|
|
54
|
-
`),je.getState().setTabExited(l,-1)});const _=()=>i.fit();window.addEventListener("resize",_);const x=new ResizeObserver(()=>i.fit());return x.observe(p.current),()=>{window.removeEventListener("resize",_),x.disconnect(),y(),h(),R.dispose()}},[l,m]),u.jsx("div",{ref:p,onMouseDown:()=>{var R;return(R=k.current)==null?void 0:R.focus()},className:"h-full w-full bg-bg"})}function Pe({toolbar:l,footer:m,children:p}){return u.jsxs("div",{className:"h-full flex flex-col",children:[l&&u.jsx("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:l}),u.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:p}),m&&u.jsx("div",{className:"shrink-0 border-t border-line bg-bg-elev",children:m})]})}function xe({title:l,hint:m}){return u.jsx("div",{className:"h-full flex items-center justify-center text-fg-faint text-xs",children:u.jsxs("div",{className:"text-center max-w-md",children:[u.jsx("div",{className:"mb-2 text-fg-dim",children:l}),m&&u.jsx("div",{className:"text-fg-faint",children:m})]})})}let bs=null;const qa=new Set;let Ln=null;function yp(){return bs?Promise.resolve(bs):Ln||(Ln=window.api.app.homeDir().then(l=>(bs=l,qa.forEach(m=>m(l)),l)),Ln)}function Ke(){const[l,m]=J.useState(bs);return J.useEffect(()=>{if(bs){m(bs);return}const p=k=>m(k);return qa.add(p),yp(),()=>{qa.delete(p)}},[]),l}function Sp(){const l=Ke(),m=je(P=>P.tabs),[p,k]=J.useState(null);return J.useEffect(()=>{if(!l)return;let P=!1;return(async()=>{try{const[O,R,i,c,g,y,h]=await Promise.all([window.api.config.listDir(`${l}/.claude/projects`,{dirsOnly:!0}),window.api.config.listDir(`${l}/.claude/skills`,{dirsOnly:!0}),window.api.config.listDir(`${l}/.claude/agents`,{filesOnly:!0}),window.api.config.listDir(`${l}/.claude/plugins`,{dirsOnly:!0}),window.api.config.exists(`${l}/.claude/settings.json`),window.api.config.exists(`${l}/.claude/CLAUDE.md`),window.api.config.readJson(`${l}/.claude.json`)]);let _=0;for(const C of O.entries){if(P)return;const v=await window.api.config.listDir(C.path,{filesOnly:!0});_+=v.entries.filter(n=>n.name.endsWith(".jsonl")).length}const x=h.data&&typeof h.data=="object"&&"mcpServers"in h.data?Object.keys(h.data.mcpServers??{}).length:0;P||k({projects:O.entries.length,sessions:_,skills:R.entries.length,agents:i.entries.filter(C=>C.name.endsWith(".md")).length,mcpServers:x,plugins:c.entries.length,settingsExists:g,claudeMdExists:y})}catch(O){console.error("[Overview] scan failed:",O)}})(),()=>{P=!0}},[l]),l?u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-fg-faint",children:"home"}),u.jsx("span",{className:"ml-2 text-fg-dim font-mono truncate",children:l}),u.jsx("div",{className:"flex-1"}),u.jsxs("span",{className:"text-fg-faint",children:[m.length," open tabs"]})]}),children:p?u.jsxs("div",{className:"p-6 max-w-4xl space-y-6",children:[u.jsxs("section",{children:[u.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg mb-3",children:"User Configuration"}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx(Rr,{label:"settings.json",value:p.settingsExists?"exists":"not created",dim:!p.settingsExists}),u.jsx(Rr,{label:"CLAUDE.md",value:p.claudeMdExists?"exists":"not created",dim:!p.claudeMdExists}),u.jsx(Rr,{label:"skills",value:p.skills.toString()}),u.jsx(Rr,{label:"subagents",value:p.agents.toString()}),u.jsx(Rr,{label:"MCP servers",value:p.mcpServers.toString()}),u.jsx(Rr,{label:"plugins",value:p.plugins.toString()})]})]}),u.jsxs("section",{children:[u.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg mb-3",children:"Session History"}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx(Rr,{label:"projects with history",value:p.projects.toString()}),u.jsx(Rr,{label:"total transcripts",value:p.sessions.toString()})]})]})]}):u.jsx(xe,{title:"scanning ~/.claude…"})}):u.jsx(xe,{title:"loading…"})}function Rr({label:l,value:m,dim:p}){return u.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[u.jsx("div",{className:"text-xs text-fg-faint uppercase tracking-wider mb-1",children:l}),u.jsx("div",{className:`text-base font-mono ${p?"text-fg-faint":"text-fg"}`,children:m})]})}function Jr(...l){return l.filter(Boolean).map((m,p)=>p===0?m.replace(/\/+$/,""):m.replace(/^\/+|\/+$/g,"")).join("/")}const Cs={scopes:["user","project","local"],resolve:(l,m,p)=>l==="user"?Jr(m,".claude","settings.json"):p?l==="project"?Jr(p,".claude","settings.json"):Jr(p,".claude","settings.local.json"):null},Ba={scopes:["user","project","local"],resolve:(l,m,p)=>l==="user"?Jr(m,".claude","CLAUDE.md"):p?l==="project"?Jr(p,"CLAUDE.md"):Jr(p,"CLAUDE.local.md"):null},Fa=Cs,wp={scopes:["user"],resolve:(l,m)=>l==="user"?Jr(m,".claude","keybindings.json"):null},lt={user:{label:"User",hint:"~/.claude/ — applies to all projects"},project:{label:"Project",hint:"<cwd>/.claude/ — checked into git"},local:{label:"Local",hint:"<cwd>/.claude/…local — gitignored, per-machine"}};function Jt({scopes:l,active:m,onChange:p,annotate:k}){return u.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:l.map(P=>{const O=lt[P],R=k==null?void 0:k(P),i=P===m;return u.jsxs("button",{title:O.hint,onClick:()=>p(P),className:`px-2.5 py-1 text-xs flex items-center gap-1.5 transition-colors ${i?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[u.jsx("span",{children:O.label}),(R==null?void 0:R.dirty)&&u.jsx("span",{className:"w-1 h-1 rounded-full bg-accent",title:"unsaved edits"}),R&&R.exists===!1&&!R.dirty&&u.jsx("span",{className:"w-1 h-1 rounded-full bg-fg-faint",title:"not yet created"})]},P)})})}function xp(l){if(!l)return"";const m=Math.max(0,Date.now()-l);return m<6e4?`saved ${Math.round(m/1e3)}s ago`:m<36e5?`saved ${Math.round(m/6e4)}m ago`:`saved ${Math.round(m/36e5)}h ago`}function Dr({dirty:l,busy:m,parseError:p,lastSavedAt:k,onSave:P,onRevert:O,leading:R}){const i=l&&!m&&!p;return u.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-2 text-xs",children:[u.jsx("div",{className:"flex-1 min-w-0 truncate text-fg-faint",children:R}),p&&u.jsx("span",{className:"text-red-400 truncate max-w-xs",title:p,children:p}),!l&&!p&&k&&u.jsx("span",{className:"text-fg-faint",children:xp(k)}),l&&!p&&u.jsx("span",{className:"text-accent",children:"unsaved"}),u.jsx("button",{onClick:O,disabled:!l||m,className:"px-2 py-0.5 border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-40 disabled:cursor-not-allowed",children:"Revert"}),u.jsx("button",{onClick:P,disabled:!i,className:`px-2.5 py-0.5 rounded border ${i?"border-accent bg-accent/15 text-accent hover:bg-accent/25":"border-line text-fg-faint opacity-50 cursor-not-allowed"}`,children:m?"Saving…":"Save"})]})}const bp="modulepreload",Cp=function(l,m){return new URL(l,m).href},id={},kp=function(m,p,k){let P=Promise.resolve();if(p&&p.length>0){let R=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};const i=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),g=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));P=R(p.map(y=>{if(y=Cp(y,k),y in id)return;id[y]=!0;const h=y.endsWith(".css"),_=h?'[rel="stylesheet"]':"";if(!!k)for(let v=i.length-1;v>=0;v--){const n=i[v];if(n.href===y&&(!h||n.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${_}`))return;const C=document.createElement("link");if(C.rel=h?"stylesheet":bp,h||(C.as="script"),C.crossOrigin="",C.href=y,g&&C.setAttribute("nonce",g),document.head.appendChild(C),h)return new Promise((v,n)=>{C.addEventListener("load",v),C.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${y}`)))})}))}function O(R){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=R,window.dispatchEvent(i),!i.defaultPrevented)throw R}return P.then(R=>{for(const i of R||[])i.status==="rejected"&&O(i.reason);return m().catch(O)})};function nd(l,m){(m==null||m>l.length)&&(m=l.length);for(var p=0,k=Array(m);p<m;p++)k[p]=l[p];return k}function Ep(l){if(Array.isArray(l))return l}function Lp(l,m,p){return(m=Mp(m))in l?Object.defineProperty(l,m,{value:p,enumerable:!0,configurable:!0,writable:!0}):l[m]=p,l}function Rp(l,m){var p=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(p!=null){var k,P,O,R,i=[],c=!0,g=!1;try{if(O=(p=p.call(l)).next,m!==0)for(;!(c=(k=O.call(p)).done)&&(i.push(k.value),i.length!==m);c=!0);}catch(y){g=!0,P=y}finally{try{if(!c&&p.return!=null&&(R=p.return(),Object(R)!==R))return}finally{if(g)throw P}}return i}}function jp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
55
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function od(l,m){var p=Object.keys(l);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(l);m&&(k=k.filter(function(P){return Object.getOwnPropertyDescriptor(l,P).enumerable})),p.push.apply(p,k)}return p}function ad(l){for(var m=1;m<arguments.length;m++){var p=arguments[m]!=null?arguments[m]:{};m%2?od(Object(p),!0).forEach(function(k){Lp(l,k,p[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(p)):od(Object(p)).forEach(function(k){Object.defineProperty(l,k,Object.getOwnPropertyDescriptor(p,k))})}return l}function Dp(l,m){if(l==null)return{};var p,k,P=Pp(l,m);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(l);for(k=0;k<O.length;k++)p=O[k],m.indexOf(p)===-1&&{}.propertyIsEnumerable.call(l,p)&&(P[p]=l[p])}return P}function Pp(l,m){if(l==null)return{};var p={};for(var k in l)if({}.hasOwnProperty.call(l,k)){if(m.indexOf(k)!==-1)continue;p[k]=l[k]}return p}function Tp(l,m){return Ep(l)||Rp(l,m)||Op(l,m)||jp()}function Ap(l,m){if(typeof l!="object"||!l)return l;var p=l[Symbol.toPrimitive];if(p!==void 0){var k=p.call(l,m);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(l)}function Mp(l){var m=Ap(l,"string");return typeof m=="symbol"?m:m+""}function Op(l,m){if(l){if(typeof l=="string")return nd(l,m);var p={}.toString.call(l).slice(8,-1);return p==="Object"&&l.constructor&&(p=l.constructor.name),p==="Map"||p==="Set"?Array.from(l):p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p)?nd(l,m):void 0}}function Np(l,m,p){return m in l?Object.defineProperty(l,m,{value:p,enumerable:!0,configurable:!0,writable:!0}):l[m]=p,l}function ld(l,m){var p=Object.keys(l);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(l);m&&(k=k.filter(function(P){return Object.getOwnPropertyDescriptor(l,P).enumerable})),p.push.apply(p,k)}return p}function cd(l){for(var m=1;m<arguments.length;m++){var p=arguments[m]!=null?arguments[m]:{};m%2?ld(Object(p),!0).forEach(function(k){Np(l,k,p[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(p)):ld(Object(p)).forEach(function(k){Object.defineProperty(l,k,Object.getOwnPropertyDescriptor(p,k))})}return l}function Ip(){for(var l=arguments.length,m=new Array(l),p=0;p<l;p++)m[p]=arguments[p];return function(k){return m.reduceRight(function(P,O){return O(P)},k)}}function hi(l){return function m(){for(var p=this,k=arguments.length,P=new Array(k),O=0;O<k;O++)P[O]=arguments[O];return P.length>=l.length?l.apply(this,P):function(){for(var R=arguments.length,i=new Array(R),c=0;c<R;c++)i[c]=arguments[c];return m.apply(p,[].concat(P,i))}}}function Tn(l){return{}.toString.call(l).includes("Object")}function Bp(l){return!Object.keys(l).length}function pi(l){return typeof l=="function"}function Fp(l,m){return Object.prototype.hasOwnProperty.call(l,m)}function Hp(l,m){return Tn(m)||jr("changeType"),Object.keys(m).some(function(p){return!Fp(l,p)})&&jr("changeField"),m}function Up(l){pi(l)||jr("selectorType")}function $p(l){pi(l)||Tn(l)||jr("handlerType"),Tn(l)&&Object.values(l).some(function(m){return!pi(m)})&&jr("handlersType")}function Wp(l){l||jr("initialIsRequired"),Tn(l)||jr("initialType"),Bp(l)&&jr("initialContent")}function zp(l,m){throw new Error(l[m]||l.default)}var Vp={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},jr=hi(zp)(Vp),Rn={changes:Hp,selector:Up,handler:$p,initial:Wp};function qp(l){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Rn.initial(l),Rn.handler(m);var p={current:l},k=hi(Jp)(p,m),P=hi(Gp)(p),O=hi(Rn.changes)(l),R=hi(Kp)(p);function i(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(y){return y};return Rn.selector(g),g(p.current)}function c(g){Ip(k,P,O,R)(g)}return[i,c]}function Kp(l,m){return pi(m)?m(l.current):m}function Gp(l,m){return l.current=cd(cd({},l.current),m),m}function Jp(l,m,p){return pi(m)?m(l.current):Object.keys(p).forEach(function(k){var P;return(P=m[k])===null||P===void 0?void 0:P.call(m,l.current[k])}),p}var Qp={create:qp},Xp={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function Yp(l){return function m(){for(var p=this,k=arguments.length,P=new Array(k),O=0;O<k;O++)P[O]=arguments[O];return P.length>=l.length?l.apply(this,P):function(){for(var R=arguments.length,i=new Array(R),c=0;c<R;c++)i[c]=arguments[c];return m.apply(p,[].concat(P,i))}}}function Zp(l){return{}.toString.call(l).includes("Object")}function em(l){return l||ud("configIsRequired"),Zp(l)||ud("configType"),l.urls?(tm(),{paths:{vs:l.urls.monacoBase}}):l}function tm(){console.warn(Ld.deprecation)}function rm(l,m){throw new Error(l[m]||l.default)}var Ld={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
56
|
-
You are using deprecated way of configuration.
|
|
57
|
-
|
|
58
|
-
Instead of using
|
|
59
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
60
|
-
use
|
|
61
|
-
monaco.config({ paths: { vs: '...' } })
|
|
62
|
-
|
|
63
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
64
|
-
`},ud=Yp(rm)(Ld),sm={config:em},im=function(){for(var m=arguments.length,p=new Array(m),k=0;k<m;k++)p[k]=arguments[k];return function(P){return p.reduceRight(function(O,R){return R(O)},P)}};function Rd(l,m){return Object.keys(m).forEach(function(p){m[p]instanceof Object&&l[p]&&Object.assign(m[p],Rd(l[p],m[p]))}),ad(ad({},l),m)}var nm={type:"cancelation",msg:"operation is manually canceled"};function Ha(l){var m=!1,p=new Promise(function(k,P){l.then(function(O){return m?P(nm):k(O)}),l.catch(P)});return p.cancel=function(){return m=!0},p}var om=["monaco"],am=Qp.create({config:Xp,isInitialized:!1,resolve:null,reject:null,monaco:null}),jd=Tp(am,2),gi=jd[0],On=jd[1];function lm(l){var m=sm.config(l),p=m.monaco,k=Dp(m,om);On(function(P){return{config:Rd(P.config,k),monaco:p}})}function cm(){var l=gi(function(m){var p=m.monaco,k=m.isInitialized,P=m.resolve;return{monaco:p,isInitialized:k,resolve:P}});if(!l.isInitialized){if(On({isInitialized:!0}),l.monaco)return l.resolve(l.monaco),Ha(Ua);if(window.monaco&&window.monaco.editor)return Dd(window.monaco),l.resolve(window.monaco),Ha(Ua);im(um,hm)(fm)}return Ha(Ua)}function um(l){return document.body.appendChild(l)}function dm(l){var m=document.createElement("script");return l&&(m.src=l),m}function hm(l){var m=gi(function(k){var P=k.config,O=k.reject;return{config:P,reject:O}}),p=dm("".concat(m.config.paths.vs,"/loader.js"));return p.onload=function(){return l()},p.onerror=m.reject,p}function fm(){var l=gi(function(p){var k=p.config,P=p.resolve,O=p.reject;return{config:k,resolve:P,reject:O}}),m=window.require;m.config(l.config),m(["vs/editor/editor.main"],function(p){var k=p.m||p;Dd(k),l.resolve(k)},function(p){l.reject(p)})}function Dd(l){gi().monaco||On({monaco:l})}function pm(){return gi(function(l){var m=l.monaco;return m})}var Ua=new Promise(function(l,m){return On({resolve:l,reject:m})}),Pd={config:lm,init:cm,__getMonacoInstance:pm},mm={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},$a=mm,gm={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},vm=gm;function _m({children:l}){return Kt.createElement("div",{style:vm.container},l)}var ym=_m,Sm=ym;function wm({width:l,height:m,isEditorReady:p,loading:k,_ref:P,className:O,wrapperProps:R}){return Kt.createElement("section",{style:{...$a.wrapper,width:l,height:m},...R},!p&&Kt.createElement(Sm,null,k),Kt.createElement("div",{ref:P,style:{...$a.fullWidth,...!p&&$a.hide},className:O}))}var xm=wm,Td=J.memo(xm);function bm(l){J.useEffect(l,[])}var Ad=bm;function Cm(l,m,p=!0){let k=J.useRef(!0);J.useEffect(k.current||!p?()=>{k.current=!1}:l,m)}var xt=Cm;function fi(){}function xs(l,m,p,k){return km(l,k)||Em(l,m,p,k)}function km(l,m){return l.editor.getModel(Md(l,m))}function Em(l,m,p,k){return l.editor.createModel(m,p,k?Md(l,k):void 0)}function Md(l,m){return l.Uri.parse(m)}function Lm({original:l,modified:m,language:p,originalLanguage:k,modifiedLanguage:P,originalModelPath:O,modifiedModelPath:R,keepCurrentOriginalModel:i=!1,keepCurrentModifiedModel:c=!1,theme:g="light",loading:y="Loading...",options:h={},height:_="100%",width:x="100%",className:C,wrapperProps:v={},beforeMount:n=fi,onMount:d=fi}){let[o,a]=J.useState(!1),[S,E]=J.useState(!0),L=J.useRef(null),j=J.useRef(null),w=J.useRef(null),D=J.useRef(d),H=J.useRef(n),U=J.useRef(!1);Ad(()=>{let q=Pd.init();return q.then(z=>(j.current=z)&&E(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>L.current?Q():q.cancel()}),xt(()=>{if(L.current&&j.current){let q=L.current.getOriginalEditor(),z=xs(j.current,l||"",k||p||"text",O||"");z!==q.getModel()&&q.setModel(z)}},[O],o),xt(()=>{if(L.current&&j.current){let q=L.current.getModifiedEditor(),z=xs(j.current,m||"",P||p||"text",R||"");z!==q.getModel()&&q.setModel(z)}},[R],o),xt(()=>{let q=L.current.getModifiedEditor();q.getOption(j.current.editor.EditorOption.readOnly)?q.setValue(m||""):m!==q.getValue()&&(q.executeEdits("",[{range:q.getModel().getFullModelRange(),text:m||"",forceMoveMarkers:!0}]),q.pushUndoStop())},[m],o),xt(()=>{var q,z;(z=(q=L.current)==null?void 0:q.getModel())==null||z.original.setValue(l||"")},[l],o),xt(()=>{let{original:q,modified:z}=L.current.getModel();j.current.editor.setModelLanguage(q,k||p||"text"),j.current.editor.setModelLanguage(z,P||p||"text")},[p,k,P],o),xt(()=>{var q;(q=j.current)==null||q.editor.setTheme(g)},[g],o),xt(()=>{var q;(q=L.current)==null||q.updateOptions(h)},[h],o);let W=J.useCallback(()=>{var re;if(!j.current)return;H.current(j.current);let q=xs(j.current,l||"",k||p||"text",O||""),z=xs(j.current,m||"",P||p||"text",R||"");(re=L.current)==null||re.setModel({original:q,modified:z})},[p,m,P,l,k,O,R]),I=J.useCallback(()=>{var q;!U.current&&w.current&&(L.current=j.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...h}),W(),(q=j.current)==null||q.editor.setTheme(g),a(!0),U.current=!0)},[h,g,W]);J.useEffect(()=>{o&&D.current(L.current,j.current)},[o]),J.useEffect(()=>{!S&&!o&&I()},[S,o,I]);function Q(){var z,re,X,A;let q=(z=L.current)==null?void 0:z.getModel();i||((re=q==null?void 0:q.original)==null||re.dispose()),c||((X=q==null?void 0:q.modified)==null||X.dispose()),(A=L.current)==null||A.dispose()}return Kt.createElement(Td,{width:x,height:_,isEditorReady:o,loading:y,_ref:w,className:C,wrapperProps:v})}var Rm=Lm;J.memo(Rm);function jm(l){let m=J.useRef();return J.useEffect(()=>{m.current=l},[l]),m.current}var Dm=jm,jn=new Map;function Pm({defaultValue:l,defaultLanguage:m,defaultPath:p,value:k,language:P,path:O,theme:R="light",line:i,loading:c="Loading...",options:g={},overrideServices:y={},saveViewState:h=!0,keepCurrentModel:_=!1,width:x="100%",height:C="100%",className:v,wrapperProps:n={},beforeMount:d=fi,onMount:o=fi,onChange:a,onValidate:S=fi}){let[E,L]=J.useState(!1),[j,w]=J.useState(!0),D=J.useRef(null),H=J.useRef(null),U=J.useRef(null),W=J.useRef(o),I=J.useRef(d),Q=J.useRef(),q=J.useRef(k),z=Dm(O),re=J.useRef(!1),X=J.useRef(!1);Ad(()=>{let T=Pd.init();return T.then(F=>(D.current=F)&&w(!1)).catch(F=>(F==null?void 0:F.type)!=="cancelation"&&console.error("Monaco initialization: error:",F)),()=>H.current?B():T.cancel()}),xt(()=>{var F,ee,ne,ce;let T=xs(D.current,l||k||"",m||P||"",O||p||"");T!==((F=H.current)==null?void 0:F.getModel())&&(h&&jn.set(z,(ee=H.current)==null?void 0:ee.saveViewState()),(ne=H.current)==null||ne.setModel(T),h&&((ce=H.current)==null||ce.restoreViewState(jn.get(O))))},[O],E),xt(()=>{var T;(T=H.current)==null||T.updateOptions(g)},[g],E),xt(()=>{!H.current||k===void 0||(H.current.getOption(D.current.editor.EditorOption.readOnly)?H.current.setValue(k):k!==H.current.getValue()&&(X.current=!0,H.current.executeEdits("",[{range:H.current.getModel().getFullModelRange(),text:k,forceMoveMarkers:!0}]),H.current.pushUndoStop(),X.current=!1))},[k],E),xt(()=>{var F,ee;let T=(F=H.current)==null?void 0:F.getModel();T&&P&&((ee=D.current)==null||ee.editor.setModelLanguage(T,P))},[P],E),xt(()=>{var T;i!==void 0&&((T=H.current)==null||T.revealLine(i))},[i],E),xt(()=>{var T;(T=D.current)==null||T.editor.setTheme(R)},[R],E);let A=J.useCallback(()=>{var T;if(!(!U.current||!D.current)&&!re.current){I.current(D.current);let F=O||p,ee=xs(D.current,k||l||"",m||P||"",F||"");H.current=(T=D.current)==null?void 0:T.editor.create(U.current,{model:ee,automaticLayout:!0,...g},y),h&&H.current.restoreViewState(jn.get(F)),D.current.editor.setTheme(R),i!==void 0&&H.current.revealLine(i),L(!0),re.current=!0}},[l,m,p,k,P,O,g,y,h,R,i]);J.useEffect(()=>{E&&W.current(H.current,D.current)},[E]),J.useEffect(()=>{!j&&!E&&A()},[j,E,A]),q.current=k,J.useEffect(()=>{var T,F;E&&a&&((T=Q.current)==null||T.dispose(),Q.current=(F=H.current)==null?void 0:F.onDidChangeModelContent(ee=>{X.current||a(H.current.getValue(),ee)}))},[E,a]),J.useEffect(()=>{if(E){let T=D.current.editor.onDidChangeMarkers(F=>{var ne;let ee=(ne=H.current.getModel())==null?void 0:ne.uri;if(ee&&F.find(ce=>ce.path===ee.path)){let ce=D.current.editor.getModelMarkers({resource:ee});S==null||S(ce)}});return()=>{T==null||T.dispose()}}return()=>{}},[E,S]);function B(){var T,F;(T=Q.current)==null||T.dispose(),_?h&&jn.set(O,H.current.saveViewState()):(F=H.current.getModel())==null||F.dispose(),H.current.dispose()}return Kt.createElement(Td,{width:x,height:C,isEditorReady:E,loading:c,_ref:U,className:v,wrapperProps:n})}var Tm=Pm,Am=J.memo(Tm),Od=Am;function Nd({value:l,onChange:m,path:p,readOnly:k}){const P=J.useRef(null),O=R=>{P.current=R};return u.jsx(Od,{path:`file://${p}`,defaultLanguage:"json",value:l,onChange:R=>m(R??""),onMount:O,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:12,fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",lineNumbers:"on",renderLineHighlight:"line",scrollBeyondLastLine:!1,tabSize:2,formatOnPaste:!0,readOnly:k,automaticLayout:!0,bracketPairColorization:{enabled:!0},wordWrap:"on"}})}let dd=!1;async function Mm(l){if(dd)return;const m=await kp(()=>import("./editor.main-HqS8FFud.js").then(P=>P.b),__vite__mapDeps([0,1]),import.meta.url),p=await Promise.all(l.map(async P=>{let O=P.schema;if(!O){const R=["https://json.schemastore.org","https://www.schemastore.org","https://code.claude.com"];try{const i=new URL(P.uri).origin;if(!R.includes(i))throw new Error("untrusted origin");const c=await fetch(P.uri);c.ok&&(O=await c.json())}catch{}}return{uri:P.uri,fileMatch:P.fileMatch,schema:O}}));m.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,allowComments:!1,schemas:p.filter(P=>P.schema),enableSchemaRequest:!0}),dd=!0}function Qa({node:l,targetScope:m,onOverride:p,schema:k,rootLabel:P}){const[O,R]=J.useState(""),[i,c]=J.useState(!0),g=[],y=l.kind==="object"&&Object.keys(l.children).length===0,_=((k==null?void 0:k.rootKeys())??[]).length>0;return u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[u.jsxs("span",{className:"text-fg-faint",children:["merged · overrides → ",u.jsx("span",{className:"text-fg-dim",children:lt[m].label})]}),_&&u.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:i,onChange:x=>c(x.target.checked),className:"accent-accent"}),"show unset keys"]}),u.jsx("div",{className:"flex-1"}),u.jsx("input",{value:O,onChange:x=>R(x.target.value),placeholder:"filter keys or descriptions…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-56"})]}),u.jsx("div",{className:"flex-1 overflow-auto px-3 py-2 font-mono text-xs",children:y&&!i?u.jsx("div",{className:"text-fg-faint italic px-2 py-4",children:"no settings resolved — all scope files empty or missing"}):u.jsx(Id,{node:l,path:g,label:P??"(root)",targetScope:m,onOverride:p,filter:O,depth:0,schema:k,showGhosts:i,defaultOpen:!0})})]})}function Id(l){return l.node.kind==="object"?u.jsx(Om,{...l,node:l.node}):l.node.kind==="array"?u.jsx(Nm,{...l,node:l.node}):u.jsx(Im,{...l,node:l.node})}function hd(l,m){return m.trim()?l.toLowerCase().includes(m.toLowerCase()):!0}function ks(l,m,p){return!!(!p.trim()||l.some(k=>hd(k,p))||m!=null&&m.description&&hd(m.description,p))}function Om({node:l,path:m,label:p,targetScope:k,onOverride:P,filter:O,depth:R,schema:i,showGhosts:c,defaultOpen:g}){const[y,h]=J.useState(g??R<2),_=(i==null?void 0:i.at(m))??null,x=new Set(Object.keys(l.children)),C=c?(_==null?void 0:_.knownChildren)??[]:[],v=Array.from(new Set([...x,...C])).sort(),n=J.useMemo(()=>O.trim()?v.filter(o=>{const a=(i==null?void 0:i.at([...m,o]))??null;return ks([...m,o],a,O)?!0:x.has(o)?Bd(l.children[o],[...m,o],O,i):!1}):v,[v.join(","),O,l,m.join("."),i]);if(O.trim()&&n.length===0&&!ks(m,_,O))return null;if(m.length===0)return u.jsx("div",{children:n.map(o=>d(o))});return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:R*14},onClick:()=>h(!y),children:[u.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:y?"▾":"▸"}),u.jsx("span",{className:"text-fg",children:p}),u.jsxs("span",{className:"text-fg-faint",children:[" {",x.size,C.length>x.size?`/${new Set([...x,...C]).size}`:"","}"]}),(_==null?void 0:_.description)&&u.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:_.description,children:["— ",_.description]})]}),y&&n.map(o=>d(o))]});function d(o){if(x.has(o))return u.jsx(Id,{node:l.children[o],path:[...m,o],label:o,targetScope:k,onOverride:P,filter:O,depth:R+1,schema:i,showGhosts:c},o);const a=(i==null?void 0:i.at([...m,o]))??null;return a?u.jsx(Bm,{path:[...m,o],label:o,info:a,targetScope:k,onSet:P,depth:R+1,filter:O},o):null}}function Bd(l,m,p,k){const P=(k==null?void 0:k.at(m))??null;if(ks(m,P,p))return!0;if(l.kind!=="object")return!1;for(const O of Object.keys(l.children))if(Bd(l.children[O],[...m,O],p,k))return!0;return!1}function Nm({node:l,path:m,label:p,filter:k,depth:P,schema:O}){const[R,i]=J.useState(!0),c=(O==null?void 0:O.at(m))??null;return ks(m,c,k)?u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:P*14},onClick:()=>i(!R),children:[u.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:R?"▾":"▸"}),u.jsx("span",{className:"text-fg",children:p}),u.jsxs("span",{className:"text-fg-faint",children:[" [",l.items.length,"]"]}),u.jsx(mi,{tone:"warn",children:"accumulated"}),(c==null?void 0:c.description)&&u.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:c.description,children:["— ",c.description]})]}),R&&l.items.map((g,y)=>u.jsxs("div",{className:"flex items-start gap-2 py-0.5",style:{paddingLeft:(P+1)*14},children:[u.jsx("span",{className:"text-fg-faint w-3 shrink-0"}),u.jsxs("span",{className:"text-fg-faint",children:[y,":"]}),u.jsx("span",{className:"text-fg-dim truncate max-w-xl",children:An(g.value)}),u.jsx(Ka,{scope:g.fromScope})]},y))]}):null}function Im({node:l,path:m,label:p,targetScope:k,onOverride:P,filter:O,depth:R,schema:i}){const[c,g]=J.useState(!1),y=(i==null?void 0:i.at(m))??null;if(!ks(m,y,O))return null;const h=l.winner!==k,_=l.shadowed.length>0;return u.jsxs("div",{children:[u.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded",style:{paddingLeft:R*14},children:[u.jsx("span",{className:`w-3 shrink-0 ${_?"text-fg-faint cursor-pointer":""}`,onClick:()=>_&&g(!c),children:_?c?"▾":"▸":""}),u.jsxs("span",{className:"text-fg",children:[p,":"]}),u.jsx("span",{className:"text-fg-dim truncate max-w-md",children:An(l.value)}),u.jsx(Ka,{scope:l.winner}),(y==null?void 0:y.deprecated)&&u.jsx(mi,{tone:"warn",children:"deprecated"}),(y==null?void 0:y.default)!==void 0&&Fm(l.value,y.default)&&u.jsx(mi,{tone:"dim",children:"= default"}),l.typeMismatch&&u.jsx("span",{className:"text-yellow-500/80",title:"shadowed scopes have a different value type",children:"⚠"}),(y==null?void 0:y.description)&&u.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:y.description,children:["— ",y.description]}),u.jsx("div",{className:"flex-1"}),(y==null?void 0:y.enum)&&u.jsx(Fd,{values:y.enum}),u.jsx("button",{disabled:!h,onClick:()=>P(m,l.value),className:`opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border rounded transition-opacity ${h?"border-accent/50 text-accent hover:bg-accent hover:text-bg":"border-line text-fg-faint cursor-not-allowed"}`,title:h?`copy into ${lt[k].label} draft`:`already winning in ${lt[k].label}`,children:"override"})]}),c&&l.shadowed.map((x,C)=>u.jsxs("div",{className:"flex items-center gap-2 py-0.5 text-fg-faint line-through",style:{paddingLeft:(R+1)*14+12},children:[u.jsx("span",{children:"shadowed:"}),u.jsx("span",{className:"truncate max-w-xl",children:An(x.value)}),u.jsx(Ka,{scope:x.scope,dim:!0})]},C))]})}function Bm({path:l,label:m,info:p,targetScope:k,onSet:P,depth:O,filter:R}){if(!ks(l,p,R))return null;const i=p.default!==void 0?p.default:Hm(p.type),c=Array.isArray(p.type)?p.type.join("|"):p.type??"?";return u.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded opacity-60",style:{paddingLeft:O*14},children:[u.jsx("span",{className:"w-3 shrink-0"}),u.jsx("span",{className:"text-fg-dim",children:m}),u.jsx(mi,{tone:"dim",children:c}),p.required&&u.jsx(mi,{tone:"warn",children:"required"}),p.default!==void 0&&u.jsxs("span",{className:"text-fg-faint",children:["default: ",An(p.default)]}),p.description&&u.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:p.description,children:["— ",p.description]}),u.jsx("div",{className:"flex-1"}),p.enum&&u.jsx(Fd,{values:p.enum}),u.jsx("button",{onClick:()=>P(l,i),className:"opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg transition-opacity",title:`write to ${lt[k].label} draft`,children:"set"})]})}function Fm(l,m){return l===m?!0:typeof l!=typeof m?!1:l&&m&&typeof l=="object"?JSON.stringify(l)===JSON.stringify(m):!1}function Hm(l){switch(Array.isArray(l)?l[0]:l){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};case"null":return null;default:return null}}function An(l){if(typeof l=="string")return JSON.stringify(l);if(l===null)return"null";if(typeof l=="object"){const m=JSON.stringify(l);return m.length>100?m.slice(0,100)+"…":m}return String(l)}function Ka({scope:l,dim:m}){const p=l==="user"?"bg-bg-hi text-fg-dim border-line":l==="project"?"bg-blue-950/30 text-blue-400/80 border-blue-900/40":"bg-purple-950/30 text-purple-400/80 border-purple-900/40";return u.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${p} ${m?"opacity-60":""}`,children:lt[l].label})}function mi({children:l,tone:m="default"}){const p={default:"bg-bg-hi text-fg-dim border-line",warn:"bg-yellow-950/30 text-yellow-500/80 border-yellow-900/40",dim:"bg-bg-elev text-fg-faint border-line"}[m];return u.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${p}`,children:l})}function Fd({values:l}){const m=l.map(p=>String(p)).join(" | ");return u.jsxs("span",{className:"text-[10px] text-fg-faint truncate max-w-xs",title:`allowed: ${m}`,children:["∈ ",m.length>30?m.slice(0,30)+"…":m]})}const Um=[{id:"essentials",title:"Essentials",summary:"The knobs you reach for first.",keys:["model","language","outputStyle","permissions"]},{id:"git",title:"Git & Commits",summary:"How Claude writes commits and pull requests on your behalf.",keys:["attribution","includeGitInstructions","includeCoAuthoredBy"]},{id:"memory",title:"Memory & Plans",summary:"Context Claude keeps between sessions and where it files plans.",keys:["autoMemoryEnabled","plansDirectory","claudeMdExcludes","respectGitignore"]},{id:"model",title:"Model & Reasoning",summary:"Which model runs, how hard it thinks, and fast-mode toggles.",keys:["availableModels","modelOverrides","effortLevel","fastMode","fastModePerSessionOptIn","alwaysThinkingEnabled"]},{id:"interface",title:"Interface",summary:"Visual polish — spinners, progress bars, motion.",keys:["spinnerTipsEnabled","spinnerTipsOverride","spinnerVerbs","terminalProgressBarEnabled","showTurnDuration","prefersReducedMotion","companyAnnouncements","statusLine","teammateMode"]},{id:"updates",title:"Updates & Cleanup",summary:"Release channel and how long transcripts stick around.",keys:["autoUpdatesChannel","cleanupPeriodDays"]},{id:"env",title:"Environment & Auth",summary:"Environment variables and auth-helper scripts.",keys:["env","apiKeyHelper","awsCredentialExport","awsAuthRefresh"]},{id:"hooks",title:"Hooks",summary:"Scripts Claude runs before/after tool use.",keys:["hooks","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars"]},{id:"mcp",title:"MCP Servers",summary:"External tool providers Claude can talk to.",keys:["enableAllProjectMcpServers","enabledMcpjsonServers","disabledMcpjsonServers"]},{id:"plugins",title:"Plugins",summary:"Installed plugins, marketplaces, and per-plugin configuration.",keys:["enabledPlugins","extraKnownMarketplaces","skippedPlugins","skippedMarketplaces","pluginConfigs"]},{id:"filesystem",title:"File Picker & Sandbox",summary:"How Claude browses files and the sandbox it runs in.",keys:["fileSuggestion","sandbox","worktree"]},{id:"login",title:"Login",summary:"Which login method to force on startup.",keys:["forceLoginMethod","forceLoginOrgUUID"]},{id:"feedback",title:"Feedback",summary:"Session-quality surveys.",keys:["feedbackSurveyRate"]},{id:"advanced",title:"Advanced / Enterprise",summary:"Managed-settings-only keys and enterprise allow/denylists.",advanced:!0,keys:["allowedMcpServers","deniedMcpServers","allowManagedHooksOnly","allowManagedPermissionRulesOnly","allowManagedMcpServersOnly","strictKnownMarketplaces","blockedMarketplaces","pluginTrustMessage","otelHeadersHelper","skipWebFetchPreflight"]}],$m={mcp:"MCP",url:"URL",urls:"URLs",http:"HTTP",ui:"UI",id:"ID",uuid:"UUID",api:"API",aws:"AWS",otel:"OTel",json:"JSON"};function Hd(l){return l.replace(/^\$/,"").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").toLowerCase().split(/\s+/).filter(Boolean).map((k,P)=>{const O=$m[k];return O||(P===0?k.charAt(0).toUpperCase()+k.slice(1):k)}).join(" ")}function Wm(l){const m=new Set,p=[];for(const P of Um){const O=P.keys.filter(R=>l.has(R));O.forEach(R=>m.add(R)),O.length!==0&&p.push({id:P.id,title:P.title,summary:P.summary,advanced:!!P.advanced,keys:O})}const k=Array.from(l).filter(P=>!m.has(P)&&P!=="$schema").sort();return k.length>0&&p.push({id:"other",title:"Other",summary:"Keys not yet grouped.",advanced:!1,keys:k}),p}function zm({node:l,targetScope:m,onOverride:p,schema:k}){const[P,O]=J.useState(""),[R,i]=J.useState(!1),[c,g]=J.useState(!0),y=l.kind==="object"?l:null,h=y?Object.keys(y.children):[],_=k.rootKeys(),x=new Set([...h,..._]),C=J.useMemo(()=>Wm(x),[Array.from(x).sort().join(",")]),v=J.useMemo(()=>C.filter(n=>R||!n.advanced).map(n=>({...n,keys:n.keys.filter(d=>{const o=(y==null?void 0:y.children[d])!==void 0;if(!c&&!o)return!1;if(!P.trim())return!0;const a=k.at([d]);return[d,Hd(d),(a==null?void 0:a.description)??""].join(" ").toLowerCase().includes(P.toLowerCase())})})).filter(n=>n.keys.length>0),[C,P,R,c,y,k]);return u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-3 text-xs",children:[u.jsxs("span",{className:"text-fg-faint",children:["writing overrides to"," ",u.jsx("span",{className:"text-fg-dim font-medium",children:lt[m].label})]}),u.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:c,onChange:n=>g(n.target.checked),className:"accent-accent"}),"show not-yet-configured"]}),u.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:R,onChange:n=>i(n.target.checked),className:"accent-accent"}),"show advanced"]}),u.jsx("div",{className:"flex-1"}),u.jsx("input",{value:P,onChange:n=>O(n.target.value),placeholder:"search settings…",className:"bg-bg border border-line rounded px-2 py-1 text-xs text-fg w-64"})]}),u.jsxs("div",{className:"flex-1 overflow-auto",children:[v.map(n=>u.jsx(Vm,{title:n.title,summary:n.summary,advanced:n.advanced,children:n.keys.map(d=>{const o=y==null?void 0:y.children[d],a=k.at([d]);return u.jsx(qm,{keyName:d,node:o,info:a,targetScope:m,onOverride:S=>p([d],S)},d)})},n.id)),v.length===0&&u.jsxs("div",{className:"px-6 py-12 text-center text-fg-faint text-sm",children:['no settings match "',P,'"']})]})]})}function Vm({title:l,summary:m,advanced:p,children:k}){const[P,O]=J.useState(!0);return u.jsxs("section",{className:"border-b border-line",children:[u.jsxs("header",{className:"px-4 py-2.5 bg-bg-elev/40 cursor-pointer hover:bg-bg-elev flex items-center gap-3",onClick:()=>O(!P),children:[u.jsx("span",{className:"text-fg-faint w-3",children:P?"▾":"▸"}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h2",{className:"text-fg text-sm font-medium",children:l}),p&&u.jsx("span",{className:"text-[9px] px-1.5 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"advanced"})]}),u.jsx("p",{className:"text-fg-faint text-xs",children:m})]})]}),P&&u.jsx("div",{className:"divide-y divide-line/60",children:k})]})}function qm({keyName:l,node:m,info:p,targetScope:k,onOverride:P}){const[O,R]=J.useState(!1),i=Hd(l),c=m!==void 0,y=(m==null?void 0:m.kind)==="leaf"?m:null,h=(m==null?void 0:m.kind)==="object"||(m==null?void 0:m.kind)==="array",_=p==null?void 0:p.default,x=y&&_!==void 0&&$d(y.value,_),C=Ym({isSet:c,leafNode:y,defaultVal:_,isDefault:!!x,node:m});return u.jsx("div",{className:"px-4 py-3 hover:bg-bg-elev/20",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("button",{onClick:()=>R(!O),className:"text-fg-faint hover:text-fg w-3 mt-0.5",title:O?"collapse":"expand",children:O?"▾":"▸"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[u.jsx("h3",{className:"text-fg text-sm",children:i}),u.jsx(Zm,{kind:C.kind,label:C.label}),(p==null?void 0:p.deprecated)&&u.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"deprecated"}),(p==null?void 0:p.required)&&!c&&u.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-red-900/40 bg-red-950/30 text-red-400/80 uppercase tracking-wide",children:"required"})]}),(p==null?void 0:p.description)&&u.jsx("p",{className:"text-fg-dim text-xs mt-0.5 leading-relaxed",children:eg(p.description)}),O&&u.jsx(Km,{keyName:l,node:m,info:p,targetScope:k,onOverride:P})]}),u.jsx("div",{className:"shrink-0",children:!O&&u.jsx(Xm,{node:m,info:p,onSet:v=>{P(v)},disabled:h&&c})})]})})}function Km({keyName:l,node:m,info:p,targetScope:k,onOverride:P}){const R=(m==null?void 0:m.kind)==="leaf"?m:null;return u.jsxs("div",{className:"mt-3 space-y-2 text-xs",children:[(p==null?void 0:p.description)&&u.jsx("p",{className:"text-fg-dim leading-relaxed whitespace-pre-wrap",children:p.description}),u.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-fg-faint",children:[(p==null?void 0:p.type)&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Type"}),u.jsx("dd",{className:"text-fg-dim font-mono",children:Array.isArray(p.type)?p.type.join(" | "):p.type})]}),(p==null?void 0:p.default)!==void 0&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Default"}),u.jsx("dd",{className:"text-fg-dim font-mono",children:Pn(p.default)})]}),(p==null?void 0:p.enum)&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Options"}),u.jsx("dd",{className:"text-fg-dim font-mono",children:p.enum.map(i=>String(i)).join(" | ")})]}),R&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Current"}),u.jsxs("dd",{className:"font-mono",children:[u.jsx("span",{className:"text-fg-dim",children:Pn(R.value)}),u.jsxs("span",{className:"ml-2 text-fg-faint",children:["from ",lt[R.winner].label]})]})]}),R&&R.shadowed.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Shadowed"}),u.jsx("dd",{className:"space-y-0.5",children:R.shadowed.map((i,c)=>u.jsxs("div",{className:"font-mono text-fg-faint line-through",children:[Pn(i.value)," —"," ",u.jsx("span",{className:"no-underline",children:lt[i.scope].label})]},c))})]}),(m==null?void 0:m.kind)==="array"&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Accumulated"}),u.jsxs("dd",{className:"text-fg-dim",children:[m.items.length," items across all scopes"]})]})]}),u.jsx("div",{className:"pt-2 flex items-center gap-2 flex-wrap border-t border-line/60",children:u.jsx(Gm,{keyName:l,node:m,info:p,onChange:P,targetScope:k})})]})}function Gm({node:l,info:m,onChange:p,targetScope:k}){const O=(l==null?void 0:l.kind)==="leaf"?l.value:m==null?void 0:m.default,R=Ud(m==null?void 0:m.type);if(R==="boolean"){const i=O===!0;return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg-faint",children:"Set to:"}),u.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:[{v:!0,label:"on"},{v:!1,label:"off"}].map(({v:c,label:g})=>u.jsx("button",{onClick:()=>p(c),className:`px-3 py-0.5 text-xs transition-colors ${i===c?"bg-accent text-bg":"bg-bg-elev text-fg-dim hover:bg-bg-hi hover:text-fg"}`,children:g},g))}),u.jsxs("span",{className:"text-fg-faint",children:["→ ",lt[k].label]})]})}return m!=null&&m.enum?u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("span",{className:"text-fg-faint",children:"Choose:"}),m.enum.map(i=>{const c=$d(O,i);return u.jsx("button",{onClick:()=>p(i),className:`px-2 py-0.5 text-xs rounded border ${c?"bg-accent text-bg border-accent":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,children:String(i)},String(i))}),u.jsxs("span",{className:"text-fg-faint",children:["→ ",lt[k].label]})]}):R==="integer"||R==="number"?u.jsx(Jm,{value:typeof O=="number"?O:void 0,integer:R==="integer",onCommit:p,target:lt[k].label}):R==="string"?u.jsx(Qm,{value:typeof O=="string"?O:"",onCommit:p,target:lt[k].label}):u.jsxs("div",{className:"text-fg-faint",children:["Complex value (",R??"object/array",") — use the"," ",u.jsx("span",{className:"text-fg-dim",children:"Raw"})," tab to edit."]})}function Jm({value:l,integer:m,onCommit:p,target:k}){const[P,O]=J.useState(l!==void 0?String(l):""),R=()=>{const i=m?parseInt(P,10):parseFloat(P);Number.isNaN(i)||p(i)};return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg-faint",children:"Set to:"}),u.jsx("input",{type:"number",value:P,onChange:i=>O(i.target.value),onBlur:R,onKeyDown:i=>{i.key==="Enter"&&i.target.blur()},className:"w-24 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),u.jsxs("button",{onClick:R,className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",k]})]})}function Qm({value:l,onCommit:m,target:p}){const[k,P]=J.useState(l);return u.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[u.jsx("span",{className:"text-fg-faint shrink-0",children:"Set to:"}),u.jsx("input",{type:"text",value:k,onChange:O=>P(O.target.value),onKeyDown:O=>{O.key==="Enter"&&m(k)},className:"flex-1 min-w-0 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),u.jsxs("button",{onClick:()=>m(k),className:"shrink-0 px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",p]})]})}function Xm({node:l,info:m,onSet:p,disabled:k}){const P=(l==null?void 0:l.kind)==="leaf",O=Ud(m==null?void 0:m.type);if(k)return null;if(O==="boolean"){const R=P&&l.value===!0;return u.jsx("button",{onClick:()=>p(!R),className:`px-2.5 py-0.5 text-xs rounded border transition-colors ${R?"bg-accent/15 text-accent border-accent/40 hover:bg-accent hover:text-bg":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,title:"toggle",children:R?"on":"off"})}return null}function Ym({isSet:l,leafNode:m,defaultVal:p,isDefault:k,node:P}){return l?(P==null?void 0:P.kind)==="array"?{kind:"accumulated",label:`${P.items.length} items`}:(P==null?void 0:P.kind)==="object"?{kind:"set",label:"configured"}:m?k?{kind:"default",label:`= default · ${lt[m.winner].label}`}:m.shadowed.length>0?{kind:"override",label:`overriding ${m.shadowed.length} scope(s)`}:{kind:"set",label:`set in ${lt[m.winner].label}`}:{kind:"set",label:"configured"}:p!==void 0?{kind:"default",label:`using default: ${Pn(p)}`}:{kind:"unset",label:"not configured"}}function Zm({kind:l,label:m}){const p={set:"bg-accent/15 text-accent border-accent/30",default:"bg-bg-hi text-fg-dim border-line",unset:"bg-bg-elev text-fg-faint border-line",override:"bg-purple-950/30 text-purple-400/80 border-purple-900/40",accumulated:"bg-blue-950/30 text-blue-400/80 border-blue-900/40"}[l];return u.jsx("span",{className:`text-[9px] px-1.5 py-0 rounded border uppercase tracking-wide ${p}`,children:m})}function Ud(l){if(l)return Array.isArray(l)?l.find(p=>p!=="null")??l[0]:l}function $d(l,m){return l===m?!0:typeof l!=typeof m?!1:l&&m&&typeof l=="object"?JSON.stringify(l)===JSON.stringify(m):!1}function eg(l){const m=l.trim().split(`
|
|
65
|
-
`)[0],p=m.match(/^([^.!?]+[.!?])/);return p?p[1]:m.length>120?m.slice(0,120)+"…":m}function Pn(l){if(typeof l=="string")return l===""?'""':JSON.stringify(l);if(l===null)return"null";if(l===void 0)return"—";if(typeof l=="object"){const m=JSON.stringify(l);return m.length>60?m.slice(0,60)+"…":m}return String(l)}function Xa({options:l,active:m,onChange:p}){return u.jsx("div",{className:"flex rounded border border-line overflow-hidden",children:l.map(({key:k,label:P})=>u.jsx("button",{onClick:()=>p(k),className:`px-2 py-0.5 text-xs ${m===k?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:P},k))})}function ui(l){return{path:l,diskRaw:"",draftRaw:"",diskData:null,exists:!1,parseError:null,loadError:null,mtimeMs:0,dirty:!1,busy:!1,lastSavedAt:null}}function Wa(l,m,p){const k={...l,diskRaw:m.raw,diskData:m.data,exists:m.exists,parseError:m.parseError,loadError:m.error,mtimeMs:m.mtimeMs,busy:!1};return!p||!l.dirty?(k.draftRaw=m.raw,k.dirty=!1):k.dirty=k.draftRaw!==k.diskRaw,k}function fd(l,m,p){const k={...l,diskRaw:m.text,diskData:null,exists:m.exists,parseError:null,loadError:m.error,mtimeMs:m.mtimeMs,busy:!1};return k.draftRaw=m.text,k.dirty=!1,k}const ye=Ja((l,m)=>({files:{},watchRefs:{},loadJson:async p=>{const k=m().files[p];l({files:{...m().files,[p]:{...k??ui(p),busy:!0}}});const P=await window.api.config.readJson(p),O=m().files[p]??ui(p);l({files:{...m().files,[p]:Wa(O,P,!1)}})},loadText:async p=>{const k=m().files[p];l({files:{...m().files,[p]:{...k??ui(p),busy:!0}}});const P=await window.api.config.readText(p),O=m().files[p]??ui(p);l({files:{...m().files,[p]:fd(O,P)}})},setDraft:(p,k)=>{const P=m().files[p]??ui(p),O=k!==P.diskRaw;l({files:{...m().files,[p]:{...P,draftRaw:k,dirty:O}}})},revert:p=>{const k=m().files[p];k&&l({files:{...m().files,[p]:{...k,draftRaw:k.diskRaw,dirty:!1}}})},saveJson:async p=>{const k=m().files[p];if(!k)return{ok:!1,error:"not loaded"};let P;try{P=k.draftRaw.trim()===""?{}:JSON.parse(k.draftRaw)}catch(c){return{ok:!1,error:`invalid JSON: ${c.message}`}}l({files:{...m().files,[p]:{...k,busy:!0}}});const O=await window.api.config.writeJson(p,P);if(!O.ok)return l({files:{...m().files,[p]:{...k,busy:!1}}}),{ok:!1,error:O.error};const R=await window.api.config.readJson(p),i=Wa({...k,busy:!1},R,!1);return l({files:{...m().files,[p]:{...i,lastSavedAt:Date.now()}}}),{ok:!0}},saveText:async p=>{const k=m().files[p];if(!k)return{ok:!1,error:"not loaded"};l({files:{...m().files,[p]:{...k,busy:!0}}});const P=await window.api.config.writeText(p,k.draftRaw);if(!P.ok)return l({files:{...m().files,[p]:{...k,busy:!1}}}),{ok:!1,error:P.error};const O=await window.api.config.readText(p),R=fd({...k,busy:!1},O);return l({files:{...m().files,[p]:{...R,lastSavedAt:Date.now()}}}),{ok:!0}},watchFile:p=>{const k={...m().watchRefs};k[p]=(k[p]??0)+1,l({watchRefs:k}),k[p]===1&&window.api.config.watch([p])},unwatchFile:p=>{const k={...m().watchRefs};k[p]&&(k[p]--,k[p]<=0&&(delete k[p],window.api.config.unwatch([p])),l({watchRefs:k}))},onExternalChange:p=>{m().files[p]&&window.api.config.readJson(p).then(P=>{const O=m().files[p];O&&l({files:{...m().files,[p]:Wa(O,P,!0)}})})}}));function tg(){return window.api.config.onChanged(({path:l})=>{ye.getState().onExternalChange(l)})}const rg=[];function Dn(l){return Array.isArray(l)?"array":l!==null&&typeof l=="object"?"object":"scalar"}function Ya(l){const m=l.filter(p=>p.data!==void 0);return m.length===0?{kind:"object",children:{}}:Wd(m,[])}function Wd(l,m){const p=rg.includes(m.join(".")),k=l.every(y=>Dn(y.data)==="object"),P=l.every(y=>Dn(y.data)==="array");if(k){const y=new Set;for(const _ of l)for(const x of Object.keys(_.data))y.add(x);const h={};for(const _ of y){const x=l.filter(C=>_ in C.data).map(C=>({scope:C.scope,data:C.data[_]}));h[_]=Wd(x,[...m,_])}return{kind:"object",children:h}}if(P&&!p){const y=[];for(const h of[...l].reverse())for(const _ of h.data)y.push({value:_,fromScope:h.scope,index:y.length});return{kind:"array",items:y}}const O=[...l].reverse(),R=O[0],i=O.slice(1).map(y=>({scope:y.scope,value:y.data})),c=Dn(R.data),g=i.some(y=>Dn(y.value)!==c);return{kind:"leaf",value:R.data,winner:R.scope,shadowed:i,...g?{typeMismatch:!0}:{}}}function Za(l,m){if(m.length===0)return l;if(l.kind!=="object")return null;const[p,...k]=m,P=l.children[p];return P?Za(P,k):null}function Nn(l,m,p){if(m.length===0)return p;const[k,...P]=m,O=l&&typeof l=="object"&&!Array.isArray(l)?{...l}:{};return O[k]=Nn(O[k],P,p),O}const sg=["user","project","local"];function el(l,m){const p=[];for(const k of sg){const P=m[k];if(!P)continue;const O=l[P];if(!O||!O.exists)continue;const R=O.draftRaw??"";if(R.trim())try{p.push({scope:k,data:JSON.parse(R)})}catch{}}return p}const ig="http://json-schema.org/draft-07/schema#",ng="https://json.schemastore.org/claude-code-settings.json",og={permissionRule:{type:"string",description:`Tool permission rule.
|
|
66
|
-
See https://code.claude.com/docs/en/settings#permission-rule-syntax
|
|
67
|
-
See https://code.claude.com/docs/en/settings#tools-available-to-claude for full list of tools available to Claude.`,pattern:"^((Agent|Bash|Edit|ExitPlanMode|Glob|Grep|KillShell|LSP|NotebookEdit|Read|Skill|TaskCreate|TaskGet|TaskList|TaskOutput|TaskStop|TaskUpdate|TodoWrite|ToolSearch|WebFetch|WebSearch|Write)(\\((?=.*[^)*?])[^)]+\\))?|mcp__.*)$",examples:["Bash","Bash(npm run build)","Bash(git commit *)","Bash(npm run *)","Bash(ls*)","Bash(git * main)","Edit","Edit(/src/**/*.ts)","Read(./.env)","Read(./secrets/**)","Read(//Users/alice/secrets/**)","Read(~/Documents/*.pdf)","Agent(Explore)","WebFetch","WebFetch(domain:example.com)","mcp__puppeteer","mcp__github__search_repositories"]},hookCommand:{anyOf:[{type:"object",description:"Bash command hook",additionalProperties:!1,required:["type","command"],properties:{type:{type:"string",description:"Hook type",const:"command"},command:{type:"string",description:"Shell command to execute",minLength:1},timeout:{type:"number",description:"Optional timeout in seconds",exclusiveMinimum:0},async:{type:"boolean",description:"Run this hook asynchronously without blocking Claude Code"},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"LLM prompt hook. See https://code.claude.com/docs/en/hooks#prompt-based-hooks",additionalProperties:!1,required:["type","prompt"],properties:{type:{type:"string",description:"Hook type",const:"prompt"},prompt:{type:"string",description:"Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.",minLength:1},model:{type:"string",description:"Model to use for evaluation. Defaults to a fast model"},timeout:{type:"number",description:"Optional timeout in seconds (default: 30)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"Agent hook with multi-turn tool access for verification. See https://code.claude.com/docs/en/hooks#agent-based-hooks",additionalProperties:!1,required:["type","prompt"],properties:{type:{type:"string",description:"Hook type",const:"agent"},prompt:{type:"string",description:"Prompt describing what to verify. Use $ARGUMENTS placeholder for hook input JSON.",minLength:1},model:{type:"string",description:"Model to use for evaluation. Defaults to a fast model"},timeout:{type:"number",description:"Optional timeout in seconds (default: 60)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"HTTP webhook hook. POST JSON to a URL and receive JSON response. See https://code.claude.com/docs/en/hooks#http-hooks",additionalProperties:!1,required:["type","url"],properties:{type:{type:"string",description:"Hook type",const:"http"},url:{type:"string",description:"URL to POST hook input JSON to. Endpoint must accept POST requests and return JSON.",minLength:1},headers:{type:"object",additionalProperties:{type:"string"},description:"Custom HTTP headers (e.g., Authorization: Bearer token). Values support $VAR_NAME or ${VAR_NAME} interpolation."},allowedEnvVars:{type:"array",items:{type:"string",minLength:1},description:"List of environment variable names permitted for interpolation in headers. If not set, no env var interpolation is allowed."},timeout:{type:"number",description:"Optional timeout in seconds (default: 30)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}}]},hookMatcher:{type:"object",description:"Hook matcher configuration with multiple hooks",additionalProperties:!1,required:["hooks"],properties:{matcher:{type:"string",description:"Optional pattern to match event contexts, case-sensitive. Behavior depends on event type. See https://code.claude.com/docs/en/hooks#matcher-patterns for event-specific details and examples"},hooks:{type:"array",description:"Array of hooks to execute",items:{$ref:"#/$defs/hookCommand"}}}}},ag="Configuration settings for Claude Code. Learn more: https://code.claude.com/docs/en/settings",lg=!0,cg=!0,ug="object",dg=JSON.parse(`{"$schema":{"type":"string","description":"JSON Schema reference for Claude Code settings"},"apiKeyHelper":{"type":"string","description":"Path to a script that outputs authentication values","examples":["/bin/generate_temp_api_key.sh"],"minLength":1},"autoMemoryEnabled":{"type":"boolean","description":"Enable automatic memory saves that capture useful context to .claude/memory/. Also configurable via CLAUDE_CODE_DISABLE_AUTO_MEMORY environment variable (set to 1 to disable, 0 to enable). See https://code.claude.com/docs/en/memory#auto-memory","default":true},"autoUpdatesChannel":{"type":"string","enum":["stable","latest"],"description":"Release channel to follow for updates. Use \\"stable\\" for a version that is typically about one week old and skips versions with major regressions, or \\"latest\\" (default) for the most recent release. Set DISABLE_AUTOUPDATER=1 to disable updates entirely.","default":"latest"},"awsCredentialExport":{"type":"string","description":"Path to a script that exports AWS credentials","examples":["/bin/generate_aws_grant.sh"],"minLength":1},"awsAuthRefresh":{"type":"string","description":"Path to a script that refreshes AWS authentication","examples":["aws sso login --profile myprofile"],"minLength":1},"claudeMdExcludes":{"type":"array","items":{"type":"string","minLength":1},"description":"Glob patterns for CLAUDE.md files to exclude from loading. Useful in monorepos to skip irrelevant instructions from other teams. Patterns match against absolute file paths. Arrays merge across settings layers. Managed policy CLAUDE.md files cannot be excluded. See https://code.claude.com/docs/en/memory#exclude-specific-claudemd-files","examples":[["**/monorepo/CLAUDE.md","/home/user/monorepo/other-team/.claude/rules/**"]]},"cleanupPeriodDays":{"type":"integer","minimum":0,"description":"Number of days to retain chat transcripts (0 to disable cleanup)","examples":[20,30,60],"default":30},"env":{"type":"object","additionalProperties":false,"description":"Environment variables to set for Claude Code sessions. Many environment variables provide settings dimensions not available as dedicated settings.json properties (e.g., thinking tokens, prompt caching, bash timeouts, shell configuration). See https://code.claude.com/docs/en/settings#environment-variables for the full list.\\nUNDOCUMENTED: CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS (plugin marketplace git timeout in ms, default 120000, see https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2151).\\nUNDOCUMENTED: ENABLE_CLAUDEAI_MCP_SERVERS (set to false to opt out of claude.ai MCP servers, see https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2163).","examples":[{"ANTHROPIC_MODEL":"claude-opus-4-1","ANTHROPIC_SMALL_FAST_MODEL":"claude-3-5-haiku-latest"}],"default":{},"patternProperties":{"^[A-Z_][A-Z0-9_]*$":{"type":"string","description":"Environment variable value"}}},"attribution":{"type":"object","description":"Customize attribution for git commits and pull requests. See https://code.claude.com/docs/en/settings#attribution-settings","additionalProperties":false,"properties":{"commit":{"type":"string","description":"Attribution for git commits, including any trailers. Empty string hides commit attribution"},"pr":{"type":"string","description":"Attribution for pull request descriptions. Empty string hides pull request attribution"}}},"includeGitInstructions":{"type":"boolean","description":"Include built-in git commit and PR workflow instructions in Claude's system prompt. Also configurable via CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS environment variable (set to 1 to disable). See https://code.claude.com/docs/en/settings#available-settings","default":true},"includeCoAuthoredBy":{"type":"boolean","description":"DEPRECATED. Use 'attribution' instead. Whether to include the co-authored-by Claude byline in git commits and pull requests (default: true)","default":true},"plansDirectory":{"type":"string","description":"Customize where plan files are stored. Path is relative to project root (default: ~/.claude/plans)","default":"~/.claude/plans","examples":["./plans"]},"respectGitignore":{"type":"boolean","description":"Control whether the @ file picker respects .gitignore patterns. When true (default), files matching .gitignore patterns are excluded from suggestions","default":true},"permissions":{"type":"object","properties":{"allow":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules for allowed operations","uniqueItems":true},"deny":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules for denied operations","uniqueItems":true},"ask":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules that should always prompt for confirmation","uniqueItems":true},"defaultMode":{"type":"string","enum":["acceptEdits","bypassPermissions","default","delegate","dontAsk","plan"],"description":"Default permission mode.\\n\\"default\\": prompts on first use.\\n\\"acceptEdits\\": auto-accepts file edits.\\n\\"plan\\": read-only, no modifications.\\nUNDOCUMENTED. \\"delegate\\": coordination-only for agent team leads (agent teams are experimental; enable via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS).\\n\\"dontAsk\\": auto-denies unless pre-approved via permissions.\\n\\"bypassPermissions\\": skips all prompts (use only in isolated environments).\\nSee https://code.claude.com/docs/en/permissions"},"disableBypassPermissionsMode":{"type":"string","enum":["disable"],"description":"Disable the ability to bypass permission prompts"},"additionalDirectories":{"type":"array","items":{"type":"string","minLength":1},"description":"Additional directories to include in the permission scope","examples":[["//Users/alice/Documents","~/projects"]],"uniqueItems":true}},"additionalProperties":false,"description":"Tool usage permissions configuration.\\nSee https://code.claude.com/docs/en/permissions and https://code.claude.com/docs/en/settings#permission-settings\\nSee https://code.claude.com/docs/en/settings#tools-available-to-claude for full list of tools available to Claude.","examples":[{"allow":["Bash(git add:*)"],"ask":["Bash(gh pr create:*)","Bash(git commit:*)"],"deny":["Read(*.env)","Bash(rm:*)","Bash(curl:*)"],"defaultMode":"default"}]},"language":{"type":"string","description":"Preferred language for Claude's responses","examples":["japanese","spanish","french"]},"model":{"type":"string","description":"Override the default model used by Claude Code. For finer control, use environment variables: ANTHROPIC_MODEL (runtime override), ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL (per-class pinning), CLAUDE_CODE_SUBAGENT_MODEL (subagent model). See https://code.claude.com/docs/en/model-config"},"availableModels":{"type":"array","items":{"type":"string"},"description":"Restrict which models users can select. When defined at multiple settings levels (user, project, etc.), arrays are merged and deduplicated. See https://code.claude.com/docs/en/model-config#restrict-model-selection","examples":[["sonnet","haiku"]]},"modelOverrides":{"type":"object","additionalProperties":{"type":"string"},"description":"Map Anthropic model IDs to provider-specific model IDs such as Bedrock inference profile ARNs, Vertex AI version names, or Foundry deployment names. Each model picker entry uses its mapped value when calling the provider API. Unknown keys are ignored. See https://code.claude.com/docs/en/model-config#override-model-ids-per-version","examples":[{"claude-opus-4-6":"arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/opus-prod"}]},"effortLevel":{"type":"string","enum":["low","medium","high"],"description":"Control Opus 4.6 adaptive reasoning effort. Lower effort is faster and cheaper for straightforward tasks, higher effort provides deeper reasoning. Defaults vary by model and plan (Opus 4.6 defaults to medium for Max and Team subscribers). Use /effort auto to reset to model default. Also configurable via CLAUDE_CODE_EFFORT_LEVEL environment variable. See https://code.claude.com/docs/en/model-config#adjust-effort-level"},"fastMode":{"type":"boolean","description":"Enable fast mode for Opus 4.6 (research preview). Fast mode uses the same model with 2.5x faster output at higher per-token cost. Requires extra usage enabled. Alternatively, toggle with /fast command. See https://code.claude.com/docs/en/fast-mode","default":false},"fastModePerSessionOptIn":{"type":"boolean","description":"Require per-session opt-in for fast mode. When true, fast mode does not persist across sessions and users must enable it with /fast each session. Useful for controlling costs. See https://code.claude.com/docs/en/fast-mode","default":false},"feedbackSurveyRate":{"type":"number","minimum":0,"maximum":1,"description":"Probability (0–1) that the session quality survey appears when eligible. A value of 0.05 means 5% of eligible sessions. See https://code.claude.com/docs/en/settings","examples":[0.05]},"enableAllProjectMcpServers":{"type":"boolean","description":"Whether to automatically approve all MCP servers in the project. See https://code.claude.com/docs/en/mcp","examples":[true]},"enabledMcpjsonServers":{"type":"array","items":{"type":"string","minLength":1},"description":"List of approved MCP servers from .mcp.json. See https://code.claude.com/docs/en/mcp","examples":[["memory","github"]]},"disabledMcpjsonServers":{"type":"array","items":{"type":"string","minLength":1},"description":"List of rejected MCP servers from .mcp.json. See https://code.claude.com/docs/en/mcp","examples":[["filesystem"]]},"allowedMcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"serverName":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the MCP server that users are allowed to configure"}},"required":["serverName"],"additionalProperties":false},{"type":"object","properties":{"serverCommand":{"type":"array","items":{"type":"string"},"description":"Exact command and arguments used to start stdio servers"}},"required":["serverCommand"],"additionalProperties":false},{"type":"object","properties":{"serverUrl":{"type":"string","description":"URL pattern for remote servers, supports wildcards (e.g., https://*.example.com/*)"}},"required":["serverUrl"],"additionalProperties":false}]},"description":"Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied. See https://code.claude.com/docs/en/mcp#restriction-options"},"deniedMcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"serverName":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the MCP server that is explicitly blocked"}},"required":["serverName"],"additionalProperties":false},{"type":"object","properties":{"serverCommand":{"type":"array","items":{"type":"string"},"description":"Exact command and arguments used to start stdio servers"}},"required":["serverCommand"],"additionalProperties":false},{"type":"object","properties":{"serverUrl":{"type":"string","description":"URL pattern for remote servers, supports wildcards (e.g., https://*.example.com/*)"}},"required":["serverUrl"],"additionalProperties":false}]},"description":"Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied. See https://code.claude.com/docs/en/mcp#restriction-options"},"httpHookAllowedEnvVars":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. Undefined = no restriction. Arrays merge across settings sources. See https://code.claude.com/docs/en/settings#hook-configuration","examples":[["MY_TOKEN","HOOK_SECRET"]]},"hooks":{"type":"object","additionalProperties":false,"description":"Custom commands to run before/after tool executions. See https://code.claude.com/docs/en/hooks","examples":[{"PostToolUse":[{"matcher":"Edit|Write","hooks":[{"type":"command","command":"prettier --write","timeout":5}]}]}],"properties":{"PreToolUse":{"type":"array","description":"Hooks that run before tool calls","items":{"$ref":"#/$defs/hookMatcher"}},"PostToolUse":{"type":"array","description":"Hooks that run after tool completion","items":{"$ref":"#/$defs/hookMatcher"}},"PostToolUseFailure":{"type":"array","description":"Hooks that run after a tool fails","items":{"$ref":"#/$defs/hookMatcher"}},"PermissionRequest":{"type":"array","description":"Hooks that run when a permission dialog appears","items":{"$ref":"#/$defs/hookMatcher"}},"Notification":{"type":"array","description":"Hooks that trigger on notifications","items":{"$ref":"#/$defs/hookMatcher"}},"UserPromptSubmit":{"type":"array","description":"Hooks that run when a user submits a prompt","items":{"$ref":"#/$defs/hookMatcher"}},"Stop":{"type":"array","description":"Hooks that run when agents finish responding. Does not run on user interrupt","items":{"$ref":"#/$defs/hookMatcher"}},"SubagentStart":{"type":"array","description":"Hooks that run when a subagent is spawned","items":{"$ref":"#/$defs/hookMatcher"}},"SubagentStop":{"type":"array","description":"Hooks that run when subagents finish responding","items":{"$ref":"#/$defs/hookMatcher"}},"PreCompact":{"type":"array","description":"Hooks that run before the context is compacted","items":{"$ref":"#/$defs/hookMatcher"}},"PostCompact":{"type":"array","description":"Hooks that run after the context is compacted. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"Elicitation":{"type":"array","description":"Hooks that run when an MCP server requests user input during a tool call. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"ElicitationResult":{"type":"array","description":"Hooks that run after a user responds to an MCP elicitation, before the response is sent back to the server. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"TeammateIdle":{"type":"array","description":"Hooks that run when an agent team teammate is about to go idle. Exit code 2 sends feedback and keeps the teammate working. Does not support matchers. Agent teams are experimental. See https://code.claude.com/docs/en/hooks#teammateidle","items":{"$ref":"#/$defs/hookMatcher"}},"TaskCompleted":{"type":"array","description":"Hooks that run when a task is being marked as completed. Exit code 2 prevents completion and sends feedback. Does not support matchers. See https://code.claude.com/docs/en/hooks#taskcompleted","items":{"$ref":"#/$defs/hookMatcher"}},"Setup":{"type":"array","description":"UNDOCUMENTED. Hooks that run during repository initialization (--init, --init-only) or maintenance (--maintenance)","items":{"$ref":"#/$defs/hookMatcher"}},"InstructionsLoaded":{"type":"array","description":"Hooks that run when a CLAUDE.md or .claude/rules/*.md file is loaded into context. Fires at session start and when files are lazily loaded (e.g., nested traversal, path glob match). No decision control; used for audit logging and observability. Does not support matchers. See https://code.claude.com/docs/en/hooks#instructionsloaded","items":{"$ref":"#/$defs/hookMatcher"}},"ConfigChange":{"type":"array","description":"Hooks that run when settings, managed settings, or skill files change during a session. Supports matchers: user_settings, project_settings, local_settings, policy_settings, skills. Command handlers only. Exit code 2 blocks the change (except policy_settings which is audit-only). See https://code.claude.com/docs/en/hooks#configchange","items":{"$ref":"#/$defs/hookMatcher"}},"WorktreeCreate":{"type":"array","description":"Hooks that run when a worktree is created via --worktree or isolation: \\"worktree\\" in subagents. Command handlers only, no matchers. Hook must print absolute path to created worktree on stdout; non-zero exit fails creation. See https://code.claude.com/docs/en/hooks#worktreecreate","items":{"$ref":"#/$defs/hookMatcher"}},"WorktreeRemove":{"type":"array","description":"Hooks that run when a worktree is being removed at session exit or when a subagent finishes. Command handlers only, no matchers. Used for cleanup tasks; cannot block removal. See https://code.claude.com/docs/en/hooks#worktreeremove","items":{"$ref":"#/$defs/hookMatcher"}},"SessionStart":{"type":"array","description":"Hooks that run when a new session starts","items":{"$ref":"#/$defs/hookMatcher"}},"SessionEnd":{"type":"array","description":"Hooks that run when a session ends","items":{"$ref":"#/$defs/hookMatcher"}}}},"disableAllHooks":{"type":"boolean","description":"Disable all hooks and statusLine execution. When true in managed settings, user and project-level disableAllHooks cannot override it. See https://code.claude.com/docs/en/hooks#disable-or-remove-hooks"},"allowedHttpHookUrls":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard. When set, hooks with non-matching URLs are blocked. Undefined = no restriction, empty array = block all HTTP hooks. Arrays merge across settings sources. See https://code.claude.com/docs/en/settings#hook-configuration","examples":[["https://hooks.example.com/*","http://localhost:*"]]},"allowManagedHooksOnly":{"type":"boolean","description":"(Managed settings only) Prevent loading of user, project, and plugin hooks. Only allows managed hooks and SDK hooks. See https://code.claude.com/docs/en/settings#hook-configuration"},"allowManagedPermissionRulesOnly":{"type":"boolean","description":"(Managed settings only) Prevent user and project settings from defining allow, ask, or deny permission rules. Only rules in managed settings apply. See https://code.claude.com/docs/en/settings#permission-settings"},"statusLine":{"type":"object","properties":{"type":{"type":"string","description":"The type of status line handler; must be set to \\"command\\" to run a custom shell script that receives JSON session data via stdin.","const":"command"},"command":{"type":"string","description":"A shell command or path to a script that displays session information (context usage, costs, git status, etc.) by reading JSON data from stdin and writing output to stdout. See https://code.claude.com/docs/en/statusline"},"padding":{"type":"number","description":"Optional number of extra horizontal spacing characters added to the status line content; defaults to 0."}},"required":["type","command"],"additionalProperties":false,"description":"Custom status line display configuration. See https://code.claude.com/docs/en/statusline","examples":[{"type":"command","command":"~/.claude/statusline.sh"}]},"fileSuggestion":{"type":"object","properties":{"type":{"type":"string","description":"The type of file suggestion handler; must be set to \\"command\\" to execute a custom shell script that generates file suggestions for the @ file picker.","const":"command"},"command":{"type":"string","description":"Shell command to execute for file suggestions"}},"required":["type","command"],"additionalProperties":false,"description":"Configure a custom script for @ file autocomplete. See https://code.claude.com/docs/en/settings#file-suggestion-settings","examples":[{"type":"command","command":"~/.claude/file-suggestion.sh"}]},"enabledPlugins":{"type":"object","additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"boolean"},{"not":{}}]},"description":"Enabled plugins using plugin-id@marketplace-id format. Example: { \\"formatter@anthropic-tools\\": true }. See https://code.claude.com/docs/en/plugins"},"extraKnownMarketplaces":{"type":"object","additionalProperties":{"type":"object","properties":{"source":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"url"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json file"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"hostPattern"},"hostPattern":{"type":"string","description":"Git host pattern to trust for repositories in source specifications"}},"required":["source","hostPattern"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"github"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch or tag to use (e.g., \\"main\\", \\"v1.0.0\\"). Defaults to repository default branch."},"path":{"type":"string","description":"Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"}},"required":["source","repo"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"git"},"url":{"type":"string","pattern":"\\\\.git$","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch or tag to use (e.g., \\"main\\", \\"v1.0.0\\"). Defaults to repository default branch."},"path":{"type":"string","description":"Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"npm"},"package":{"type":"string","description":"NPM package containing marketplace.json"}},"required":["source","package"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"file"},"path":{"type":"string","description":"Local file path to marketplace.json"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"directory"},"path":{"type":"string","description":"Local directory containing .claude-plugin/marketplace.json"}},"required":["source","path"],"additionalProperties":false}],"description":"Where to fetch the marketplace from"},"installLocation":{"type":"string","description":"Local cache path where marketplace manifest is stored (auto-generated if not provided)"}},"required":["source"],"additionalProperties":false},"description":"Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources. See https://code.claude.com/docs/en/plugin-marketplaces"},"strictKnownMarketplaces":{"type":"array","description":"(Managed settings only) Allowlist of plugin marketplaces users can add. Undefined = no restrictions, empty array = lockdown. Uses exact matching for source specifications. See https://code.claude.com/docs/en/settings#strictknownmarketplaces","items":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"hostPattern"},"hostPattern":{"type":"string","description":"Git host pattern to trust for repositories in source specifications"}},"required":["source","hostPattern"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"github"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch, tag, or SHA"},"path":{"type":"string","description":"Subdirectory path"}},"required":["source","repo"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"git"},"url":{"type":"string","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch, tag, or SHA"},"path":{"type":"string","description":"Subdirectory path"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"url"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"HTTP headers for authenticated access"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"npm"},"package":{"type":"string","description":"NPM package name (supports scoped packages)"}},"required":["source","package"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"file"},"path":{"type":"string","description":"Absolute path to marketplace.json file"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"directory"},"path":{"type":"string","description":"Absolute path to directory containing .claude-plugin/marketplace.json"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"pathPattern"},"pathPattern":{"type":"string","description":"Regex pattern to match file or directory paths for marketplace sources"}},"required":["source","pathPattern"],"additionalProperties":false}]},"examples":[[{"source":"github","repo":"acme-corp/approved-plugins"},{"source":"npm","package":"@acme-corp/compliance-plugins"}]]},"skippedMarketplaces":{"type":"array","items":{"type":"string","minLength":1},"description":"List of marketplace names the user has chosen not to install when prompted"},"skippedPlugins":{"type":"array","items":{"type":"string","minLength":1},"description":"List of plugin IDs (plugin@marketplace format) the user has chosen not to install when prompted"},"forceLoginMethod":{"type":"string","enum":["claudeai","console"],"description":"Force a specific login method: \\"claudeai\\" for Claude Pro/Max, \\"console\\" for Console billing","examples":["claudeai"]},"forceLoginOrgUUID":{"type":"string","description":"Organization UUID to use for OAuth login","examples":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],"minLength":1},"otelHeadersHelper":{"type":"string","description":"Path to a script that outputs OpenTelemetry headers","minLength":1},"outputStyle":{"type":"string","description":"Controls the output style for assistant responses. Built-in styles: default, Explanatory, Learning. Custom styles can be added in ~/.claude/output-styles/ or .claude/output-styles/. See https://code.claude.com/docs/en/output-styles","examples":["default","Explanatory","Learning"],"minLength":1},"skipWebFetchPreflight":{"type":"boolean","description":"Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"},"sandbox":{"type":"object","description":"Sandbox execution configuration. See https://code.claude.com/docs/en/sandboxing","properties":{"network":{"type":"object","description":"Configures network isolation settings for the sandboxed bash environment, including domain restrictions, Unix socket access, and custom proxy configuration.","properties":{"allowUnixSockets":{"type":"array","items":{"type":"string"},"description":"Allow Unix domain sockets for local IPC (SSH agent, Docker, etc.). Provide an array of specific paths. Defaults to blocking if not specified"},"allowLocalBinding":{"type":"boolean","description":"Allow binding to local network addresses (e.g., localhost ports). Defaults to false if not specified"},"httpProxyPort":{"type":"integer","minimum":1,"maximum":65535,"description":"HTTP proxy port to use for network filtering. If not specified, a proxy server will be started automatically"},"socksProxyPort":{"type":"integer","minimum":1,"maximum":65535,"description":"SOCKS proxy port to use for network filtering. If not specified, a proxy server will be started automatically"},"allowAllUnixSockets":{"type":"boolean","description":"Allow all Unix domain socket connections. If true, this overrides allowUnixSockets"},"allowedDomains":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of network domains for sandboxed commands. Supports wildcard patterns like *.example.com"},"allowManagedDomainsOnly":{"type":"boolean","description":"(Managed settings only) Only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources. Non-allowed domains are automatically blocked without user prompts."}},"additionalProperties":false},"ignoreViolations":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"description":"List of filesystem paths to ignore sandbox violations for when this command pattern matches"},"description":"Map of command patterns to filesystem paths to ignore violations for. Use \\"*\\" to match all commands"},"excludedCommands":{"type":"array","items":{"type":"string"},"description":"Commands that should never run in the sandbox (e.g., [\\"git\\", \\"docker\\"])"},"autoAllowBashIfSandboxed":{"type":"boolean","description":"Automatically allow bash commands without prompting when they run in the sandbox. Only applies to commands that will run sandboxed.","default":true},"enableWeakerNetworkIsolation":{"type":"boolean","description":"macOS only. Allow access to the system TLS trust service (com.apple.trustd.agent) in the sandbox. Required for Go-based tools like gh, gcloud, and terraform to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. Reduces security by opening a potential data exfiltration path. Default: false. See https://code.claude.com/docs/en/settings#sandbox-settings","default":false},"enableWeakerNestedSandbox":{"type":"boolean","description":"Enable weaker sandbox mode for unprivileged docker environments where --proc mounting fails. This significantly reduces the strength of the sandbox and should only be used when this risk is acceptable.Default: false (secure)."},"allowUnsandboxedCommands":{"type":"boolean","description":"Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."},"enabled":{"type":"boolean","description":"Enable sandboxed bash"},"filesystem":{"type":"object","description":"Filesystem access control for sandboxed commands. See https://code.claude.com/docs/en/sandboxing#filesystem-isolation","properties":{"allowWrite":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are allowed to write. Supports prefixes: // (absolute), ~/ (home directory), / (relative to settings file), ./ or no prefix (relative path)"},"denyWrite":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are explicitly denied write access. Takes precedence over allowWrite"},"denyRead":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are explicitly denied read access"},"allowRead":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths"},"allowManagedReadPathsOnly":{"type":"boolean","description":"When true (managed settings only), only allowRead paths from managed settings are used"}},"additionalProperties":false}},"additionalProperties":false},"spinnerVerbs":{"type":"object","description":"Customize the verbs shown in spinner progress messages","properties":{"mode":{"type":"string","enum":["append","replace"],"description":"How to combine custom verbs with default spinner verbs: 'append' adds custom verbs to the default list, 'replace' uses only custom verbs"},"verbs":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"description":"Custom verbs used in spinner progress text"}},"required":["verbs"],"additionalProperties":false},"spinnerTipsEnabled":{"type":"boolean","description":"Show tips in the spinner while Claude is working. Set to false to disable tips (default: true)","default":true},"spinnerTipsOverride":{"type":"object","description":"Customize the tips displayed in the spinner while Claude is working. See https://code.claude.com/docs/en/settings#available-settings","properties":{"excludeDefault":{"type":"boolean","description":"If true, only show custom tips. If false or absent, custom tips merge with built-in tips","default":false},"tips":{"type":"array","items":{"type":"string","minLength":1},"description":"Custom tip strings to display in the spinner","minItems":1}},"required":["tips"],"additionalProperties":false},"terminalProgressBarEnabled":{"type":"boolean","description":"Enable the terminal progress bar that shows progress in supported terminals like Windows Terminal and iTerm2 (default: true)","default":true},"showTurnDuration":{"type":"boolean","description":"Show turn duration messages after responses (e.g., \\"Cooked for 1m 6s\\"). Set to false to hide these messages (default: true)","default":true},"prefersReducedMotion":{"type":"boolean","description":"Reduce or disable UI animations (spinners, shimmer, flash effects) for accessibility","default":false},"alwaysThinkingEnabled":{"type":"boolean","description":"Enable extended thinking by default for all sessions. Typically configured via the /config command rather than editing directly. See https://code.claude.com/docs/en/common-workflows#use-extended-thinking-thinking-mode"},"companyAnnouncements":{"type":"array","items":{"type":"string","minLength":1},"description":"Company announcements to display at startup (one will be randomly selected if multiple are provided)"},"teammateMode":{"type":"string","enum":["auto","in-process","tmux"],"description":"How agent team teammates display: \\"auto\\" picks split panes in tmux or iTerm2, in-process otherwise. Agent teams are experimental and disabled by default. Enable them by adding CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to your settings.json or environment. See https://code.claude.com/docs/en/agent-teams","default":"auto"},"worktree":{"type":"object","additionalProperties":false,"description":"Configuration for --worktree sessions. See https://code.claude.com/docs/en/settings","properties":{"sparsePaths":{"type":"array","items":{"type":"string","minLength":1},"description":"Directories to check out in each worktree via git sparse-checkout (cone mode). Only the listed paths are written to disk, which is faster in large monorepos.","examples":[["packages/my-app","shared/utils"]]}}},"pluginTrustMessage":{"type":"string","description":"(Managed settings only) Custom message appended to the plugin trust warning shown before installation. Use to provide organization-specific context about approved plugins. See https://code.claude.com/docs/en/settings#plugin-settings","minLength":1},"pluginConfigs":{"type":"object","additionalProperties":{"type":"object","properties":{"mcpServers":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}},"description":"User configuration values for MCP servers keyed by server name"}},"additionalProperties":false},"description":"Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format). See https://code.claude.com/docs/en/plugins"},"allowManagedMcpServersOnly":{"type":"boolean","description":"(Managed settings only) Only allowedMcpServers from managed settings are respected. deniedMcpServers still merges from all sources. Users can still add their own MCP servers, but only the admin-defined allowlist applies."},"blockedMarketplaces":{"type":"array","description":"(Managed settings only) Blocklist of marketplace sources. These exact sources are blocked from being added as marketplaces. The check happens before downloading, so blocked sources never touch the filesystem.","items":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"url","description":"Block marketplace fetched from direct URL"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json file"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom HTTP headers (e.g., for authentication)"}},"required":["source","url"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"github","description":"Block marketplace from GitHub repository"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch or tag to use"},"path":{"type":"string","description":"Path to marketplace.json within repo"}},"required":["source","repo"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"git","description":"Block marketplace from git repository URL"},"url":{"type":"string","pattern":".*\\\\.git$","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch or tag to use"},"path":{"type":"string","description":"Path to marketplace.json within repo"}},"required":["source","url"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"npm","description":"Block marketplace from NPM package"},"package":{"type":"string","description":"NPM package containing marketplace.json"}},"required":["source","package"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"file","description":"Block marketplace from local file"},"path":{"type":"string","description":"Local file path to marketplace.json"}},"required":["source","path"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"directory","description":"Block marketplace from local directory"},"path":{"type":"string","description":"Local directory containing .claude-plugin/marketplace.json"}},"required":["source","path"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"hostPattern","description":"Block marketplace by host pattern matching"},"hostPattern":{"type":"string","description":"Regex pattern to match the host/domain extracted from any marketplace source type"}},"required":["source","hostPattern"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"pathPattern","description":"Block marketplace by file/directory path pattern matching"},"pathPattern":{"type":"string","description":"Regex pattern to match file or directory paths for marketplace sources"}},"required":["source","pathPattern"]}]}}}`),hg="Claude Code Settings",fg={$schema:ig,$id:ng,$defs:og,description:ag,allowTrailingCommas:lg,additionalProperties:cg,type:ug,properties:dg,title:hg};function pg(l){const m=l??{},p={...m.$defs??{},...m.definitions??{}},k=x=>{if(!x)return{};if(!x.$ref)return R(x);const C=/^#\/(\$defs|definitions)\/(.+)$/.exec(x.$ref);if(!C)return R(x);const v=p[C[2]];return v?k({...v,...i(x)}):R(x)},P=new Set(["__proto__","constructor","prototype"]),O=x=>{if(!x)return{};const C={};for(const[v,n]of Object.entries(x))P.has(v)||(C[v]=n);return C},R=x=>{if(!x.allOf||x.allOf.length===0)return x;const C={...x};delete C.allOf;for(const v of x.allOf){const n=k(v);Object.assign(C,{properties:{...O(C.properties),...O(n.properties)},required:mg([...C.required??[],...n.required??[]])}),!C.description&&n.description&&(C.description=n.description),C.default===void 0&&n.default!==void 0&&(C.default=n.default),!C.type&&n.type&&(C.type=n.type)}return C},i=x=>{const{$ref:C,...v}=x;return v},c=(x,C)=>{let v=k(x);for(const n of C){if(!v)return null;if(/^\d+$/.test(n)){const a=Array.isArray(v.items)?v.items[Number(n)]:v.items;v=a?k(a):null;continue}const d=v.properties;if(d&&!P.has(n)&&n in d){v=k(d[n]);continue}const o=v.additionalProperties;if(o&&typeof o=="object"){v=k(o);continue}return null}return v},g=(x,C,v)=>{if(!x)return null;const n={};if(x.description&&(n.description=x.description),x.type&&(n.type=x.type),x.default!==void 0&&(n.default=x.default),x.enum&&(n.enum=x.enum),x.const!==void 0&&(n.const=x.const),x.deprecated&&(n.deprecated=!0),x.examples&&(n.examples=x.examples),x.properties&&(n.knownChildren=Object.keys(x.properties)),v&&(C!=null&&C.includes(v))&&(n.required=!0),x.items&&!Array.isArray(x.items)){const d=k(x.items),o=g(d,void 0,null);o&&(n.itemsInfo=o)}return(x.additionalProperties===!0||typeof x.additionalProperties=="object")&&(n.open=!0),n},y=x=>C=>{if(C.length===0)return g(k(x),void 0,null);const v=c(x,C.slice(0,-1));if(!v)return null;const n=C[C.length-1],d=c(v,[n]);return g(d,v.required,n)},h=x=>{const C=k(x);return Object.keys(C.properties??{})},_=x=>({at:y(x),rootKeys:()=>h(x),rootedAt:C=>{const v=c(x,C);return _(v??{})}});return _(m)}function mg(l){return Array.from(new Set(l))}let za=null;function Mn(){return za||(za=pg(fg)),za}function gg(){const l=Ke(),m=je(w=>w.tabs),p=je(w=>w.activeTabId),k=m.find(w=>w.id===p)??null,P=(k==null?void 0:k.cwd)??null,[O,R]=J.useState("user"),[i,c]=J.useState("effective"),g=J.useMemo(()=>{const w={};for(const D of Cs.scopes){const H=Cs.resolve(D,l??"",P);H&&(w[D]=H)}return w},[l,P]),y=g[O]??null,h=ye(w=>w.files),_=ye(w=>w.loadJson),x=ye(w=>w.setDraft),C=ye(w=>w.saveJson),v=ye(w=>w.revert),n=ye(w=>w.watchFile),d=ye(w=>w.unwatchFile);J.useEffect(()=>{const w=Object.values(g).filter(Boolean);return w.forEach(D=>{h[D]||_(D),n(D)}),()=>{w.forEach(D=>d(D))}},[JSON.stringify(g)]);const[o,a]=J.useState(null),S=J.useMemo(()=>Ya(el(h,g)),[h,g]),E=(w,D)=>{var Q;const H=g[O];if(!H)return;a(null);const U=((Q=h[H])==null?void 0:Q.draftRaw)??"";let W={};if(U.trim())try{W=JSON.parse(U)}catch{W={}}const I=Nn(W,w,D);x(H,JSON.stringify(I,null,2)+`
|
|
68
|
-
`)};if(!l)return u.jsx(xe,{title:"loading…"});const L=y?h[y]:null,j=w=>w!=="user"&&!P;return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Xa,{options:[{key:"effective",label:"Guided"},{key:"tree",label:"Tree"},{key:"raw",label:"Raw"}],active:i,onChange:c}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Jt,{scopes:Cs.scopes,active:O,onChange:R,annotate:w=>{if(j(w))return{exists:!1};const D=g[w];if(!D)return null;const H=h[D];return{exists:(H==null?void 0:H.exists)??!1,dirty:(H==null?void 0:H.dirty)??!1}}}),u.jsx("span",{className:"ml-3 text-fg-faint truncate",children:i==="effective"?`overrides → ${y??"—"}`:y??"—"}),u.jsx("div",{className:"flex-1"}),u.jsx("a",{href:"https://code.claude.com/docs/en/settings",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"schema reference ↗"})]}),footer:y&&L?u.jsx(Dr,{dirty:L.dirty,busy:L.busy,parseError:o||L.parseError,lastSavedAt:L.lastSavedAt,leading:L.exists?null:u.jsx("span",{children:"file will be created on save"}),onSave:async()=>{a(null);const w=await C(y);w.ok||a(w.error??"save failed")},onRevert:()=>{a(null),v(y)}}):null,children:j(O)?u.jsx(xe,{title:"no active project",hint:"open a tab in a project directory to edit project or local settings"}):i==="effective"?u.jsx(zm,{node:S,targetScope:O,onOverride:E,schema:Mn()}):i==="tree"?u.jsx(Qa,{node:S,targetScope:O,onOverride:E,schema:Mn()}):y&&L?u.jsx(Nd,{path:y,value:L.draftRaw,onChange:w=>{a(null),x(y,w)}}):u.jsx(xe,{title:"resolving…"})})}function tl({value:l,onChange:m,path:p,readOnly:k}){return u.jsx(Od,{path:`file://${p}`,defaultLanguage:"markdown",value:l,onChange:P=>m(P??""),theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",lineNumbers:"on",renderLineHighlight:"line",scrollBeyondLastLine:!1,tabSize:2,wordWrap:"on",readOnly:k,automaticLayout:!0}})}const pd=[{id:"filesystem",name:"Filesystem",description:"Secure file operations with configurable access controls",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem",config:{command:"npx",args:["-y","@modelcontextprotocol/server-filesystem","<path>"]},envVars:[]},{id:"fetch",name:"Fetch",description:"Web content fetching and conversion for efficient LLM usage",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",config:{command:"uvx",args:["mcp-server-fetch"]},envVars:[]},{id:"memory",name:"Memory",description:"Knowledge graph-based persistent memory system",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/memory",config:{command:"npx",args:["-y","@modelcontextprotocol/server-memory"]},envVars:[]},{id:"sequential-thinking",name:"Sequential Thinking",description:"Dynamic and reflective problem-solving through thought sequences",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",config:{command:"npx",args:["-y","@modelcontextprotocol/server-sequential-thinking"]},envVars:[]},{id:"git",name:"Git",description:"Tools to read, search, and manipulate Git repositories",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/git",config:{command:"uvx",args:["mcp-server-git","--repository","<path>"]},envVars:[]},{id:"time",name:"Time",description:"Time and timezone conversion capabilities",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/time",config:{command:"uvx",args:["mcp-server-time"]},envVars:[]},{id:"everything",name:"Everything",description:"Reference/test server with prompts, resources, and tools",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/everything",config:{command:"npx",args:["-y","@modelcontextprotocol/server-everything"]},envVars:[]},{id:"github",name:"GitHub",description:"Official GitHub repository, issues, and PR management",official:!1,homepage:"https://github.com/github/github-mcp-server",config:{command:"docker",args:["run","-i","--rm","-e","GITHUB_PERSONAL_ACCESS_TOKEN","ghcr.io/github/github-mcp-server"]},envVars:["GITHUB_PERSONAL_ACCESS_TOKEN"]},{id:"gitlab",name:"GitLab",description:"GitLab API integration for projects, issues, and merge requests",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gitlab",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gitlab"]},envVars:["GITLAB_PERSONAL_ACCESS_TOKEN","GITLAB_API_URL"]},{id:"postgres",name:"PostgreSQL",description:"Read-only database access with schema inspection",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres",config:{command:"npx",args:["-y","@modelcontextprotocol/server-postgres","<connection-string>"]},envVars:[]},{id:"sqlite",name:"SQLite",description:"Database interaction and business intelligence over SQLite",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/sqlite",config:{command:"uvx",args:["mcp-server-sqlite","--db-path","<path>"]},envVars:[]},{id:"slack",name:"Slack",description:"Channel management and messaging for Slack workspaces",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/slack",config:{command:"npx",args:["-y","@modelcontextprotocol/server-slack"]},envVars:["SLACK_BOT_TOKEN","SLACK_TEAM_ID"]},{id:"google-drive",name:"Google Drive",description:"File access and search for Google Drive",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gdrive",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gdrive"]},envVars:["GDRIVE_CREDENTIALS_PATH"]},{id:"google-maps",name:"Google Maps",description:"Location services, directions, and place details",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/google-maps",config:{command:"npx",args:["-y","@modelcontextprotocol/server-google-maps"]},envVars:["GOOGLE_MAPS_API_KEY"]},{id:"puppeteer",name:"Puppeteer",description:"Browser automation and web scraping via Puppeteer",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/puppeteer",config:{command:"npx",args:["-y","@modelcontextprotocol/server-puppeteer"]},envVars:[]},{id:"playwright",name:"Playwright",description:"Cross-browser automation for navigation, screenshots, and data extraction",official:!1,homepage:"https://github.com/microsoft/playwright-mcp",config:{command:"npx",args:["-y","@playwright/mcp@latest"]},envVars:[]},{id:"brave-search",name:"Brave Search",description:"Web and local search using the Brave Search API",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/brave-search",config:{command:"npx",args:["-y","@modelcontextprotocol/server-brave-search"]},envVars:["BRAVE_API_KEY"]},{id:"redis",name:"Redis",description:"Interact with Redis key-value stores",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/redis",config:{command:"npx",args:["-y","@modelcontextprotocol/server-redis","<redis-url>"]},envVars:[]},{id:"sentry",name:"Sentry",description:"Retrieve and analyze Sentry error tracking issues",official:!1,homepage:"https://github.com/getsentry/sentry-mcp",config:{command:"npx",args:["-y","@sentry/mcp-server@latest"]},envVars:["SENTRY_AUTH_TOKEN"]},{id:"linear",name:"Linear",description:"Issue tracking and project management for Linear",official:!1,homepage:"https://linear.app/docs/mcp",config:{command:"npx",args:["-y","mcp-remote","https://mcp.linear.app/sse"]},envVars:[]},{id:"notion",name:"Notion",description:"Notion workspace page and database management",official:!1,homepage:"https://github.com/makenotion/notion-mcp-server",config:{command:"npx",args:["-y","@notionhq/notion-mcp-server"]},envVars:["NOTION_API_KEY"]},{id:"stripe",name:"Stripe",description:"Payment processing, customers, and invoices via Stripe API",official:!1,homepage:"https://github.com/stripe/agent-toolkit",config:{command:"npx",args:["-y","@stripe/mcp","--tools=all"]},envVars:["STRIPE_SECRET_KEY"]},{id:"cloudflare",name:"Cloudflare",description:"Manage Cloudflare Workers, KV, R2, D1, and Workers AI",official:!1,homepage:"https://github.com/cloudflare/mcp-server-cloudflare",config:{command:"npx",args:["-y","mcp-remote","https://observability.mcp.cloudflare.com/sse"]},envVars:[]},{id:"context7",name:"Context7",description:"Up-to-date version-specific library docs injected into prompts",official:!1,homepage:"https://github.com/upstash/context7",config:{command:"npx",args:["-y","@upstash/context7-mcp@latest"]},envVars:[]},{id:"tavily",name:"Tavily",description:"AI-optimized web search with clean structured results",official:!1,homepage:"https://github.com/tavily-ai/tavily-mcp",config:{command:"npx",args:["-y","tavily-mcp@latest"]},envVars:["TAVILY_API_KEY"]},{id:"perplexity",name:"Perplexity",description:"Answer-engine search with deep research and reasoning",official:!1,homepage:"https://github.com/ppl-ai/modelcontextprotocol",config:{command:"npx",args:["-y","server-perplexity-ask"]},envVars:["PERPLEXITY_API_KEY"]},{id:"figma",name:"Figma Dev Mode",description:"First-party Figma design-to-code bridge exposing node tree",official:!1,homepage:"https://help.figma.com/hc/en-us/articles/32132100833559",config:{url:"http://127.0.0.1:3845/sse"},envVars:[]},{id:"supabase",name:"Supabase",description:"Manage Supabase projects, tables, and SQL queries",official:!1,homepage:"https://github.com/supabase-community/supabase-mcp",config:{command:"npx",args:["-y","@supabase/mcp-server-supabase@latest"]},envVars:["SUPABASE_ACCESS_TOKEN"]},{id:"atlassian",name:"Atlassian (Jira/Confluence)",description:"Official Jira and Confluence integration",official:!1,homepage:"https://www.atlassian.com/platform/remote-mcp-server",config:{command:"npx",args:["-y","mcp-remote","https://mcp.atlassian.com/v1/sse"]},envVars:[]},{id:"aws",name:"AWS",description:"AWS services access and best-practice guidance",official:!1,homepage:"https://github.com/awslabs/mcp",config:{command:"uvx",args:["awslabs.core-mcp-server@latest"]},envVars:["AWS_PROFILE","AWS_REGION"]},{id:"obsidian",name:"Obsidian",description:"Read and search notes in an Obsidian vault",official:!1,homepage:"https://github.com/MarkusPfundstein/mcp-obsidian",config:{command:"uvx",args:["mcp-obsidian"]},envVars:["OBSIDIAN_API_KEY"]}],md=[{id:"pdf",name:"PDF",description:"Create, edit, and extract content from PDF documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pdf"},{id:"docx",name:"DOCX",description:"Create and edit Microsoft Word documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/docx"},{id:"xlsx",name:"XLSX",description:"Create and edit Excel spreadsheets with formulas and formatting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/xlsx"},{id:"pptx",name:"PPTX",description:"Create and edit PowerPoint presentations",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pptx"},{id:"webapp-testing",name:"Webapp Testing",description:"Test web applications using Playwright-driven browser automation",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/webapp-testing"},{id:"web-artifacts-builder",name:"Web Artifacts Builder",description:"Build polished interactive web artifacts and demos",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/web-artifacts-builder"},{id:"frontend-design",name:"Frontend Design",description:"Apply frontend UI/UX design patterns and visual polish",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/frontend-design"},{id:"canvas-design",name:"Canvas Design",description:"Canvas-based graphic design and composition techniques",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/canvas-design"},{id:"algorithmic-art",name:"Algorithmic Art",description:"Create generative and algorithmic art",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/algorithmic-art"},{id:"brand-guidelines",name:"Brand Guidelines",description:"Apply brand identity and style guideline specifications",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/brand-guidelines"},{id:"theme-factory",name:"Theme Factory",description:"Generate and customize visual themes",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/theme-factory"},{id:"slack-gif-creator",name:"Slack GIF Creator",description:"Create animated GIFs suitable for Slack",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/slack-gif-creator"},{id:"doc-coauthoring",name:"Doc Coauthoring",description:"Collaborative document authoring and editing workflows",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/doc-coauthoring"},{id:"internal-comms",name:"Internal Comms",description:"Internal communications templates and drafting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/internal-comms"},{id:"claude-api",name:"Claude API",description:"Build apps with the Claude API and Anthropic SDKs",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/claude-api"},{id:"mcp-builder",name:"MCP Builder",description:"Scaffold and build new Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/mcp-builder"},{id:"skill-creator",name:"Skill Creator",description:"Scaffold and create new Claude Code skills",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/skill-creator"}],gd=[{id:"code-review",name:"Code Review",description:"Comprehensive code review with best practices and improvement suggestions",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-review",bundles:["commands","agents"]},{id:"pr-review-toolkit",name:"PR Review Toolkit",description:"Pull request review automation and workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pr-review-toolkit",bundles:["commands","agents"]},{id:"commit-commands",name:"Commit Commands",description:"Git commit workflow shortcuts with conventional commit formatting",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/commit-commands",bundles:["commands"]},{id:"feature-dev",name:"Feature Dev",description:"Feature development assistance from spec to implementation",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/feature-dev",bundles:["commands","agents"]},{id:"security-guidance",name:"Security Guidance",description:"Security best-practice review and enforcement",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/security-guidance",bundles:["commands","agents"]},{id:"agent-sdk-dev",name:"Agent SDK Dev",description:"Development tools for building with the Claude Agent SDK",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/agent-sdk-dev",bundles:["commands","skills"]},{id:"plugin-dev",name:"Plugin Dev",description:"Scaffolding and tooling for authoring Claude Code plugins",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/plugin-dev",bundles:["commands","skills"]},{id:"mcp-server-dev",name:"MCP Server Dev",description:"Develop and test Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/mcp-server-dev",bundles:["commands","skills"]},{id:"skill-creator",name:"Skill Creator",description:"Framework for creating and iterating on new skills",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/skill-creator",bundles:["commands","skills"]},{id:"claude-md-management",name:"CLAUDE.md Management",description:"Manage and maintain CLAUDE.md project memory files",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/claude-md-management",bundles:["commands"]},{id:"typescript-lsp",name:"TypeScript LSP",description:"TypeScript/JavaScript language server integration",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/typescript-lsp",bundles:["hooks","commands"]},{id:"pyright-lsp",name:"Pyright LSP",description:"Python language server integration via Pyright",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pyright-lsp",bundles:["hooks","commands"]},{id:"rust-analyzer-lsp",name:"Rust Analyzer LSP",description:"Rust language server integration via rust-analyzer",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/rust-analyzer-lsp",bundles:["hooks","commands"]},{id:"gopls-lsp",name:"Go LSP (gopls)",description:"Go language server integration via gopls",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gopls-lsp",bundles:["hooks","commands"]},{id:"code-simplifier",name:"Code Simplifier",description:"Review changed code for reuse, quality, and efficiency then fix issues",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-simplifier",bundles:["commands","agents"]},{id:"hookify",name:"Hookify",description:"Utilities and templates for authoring Claude Code hooks",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/hookify",bundles:["commands","skills"]},{id:"frontend-design-plugin",name:"Frontend Design Plugin",description:"Frontend design assistance and visual polish workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/frontend-design",bundles:["commands","skills","agents"]}],vd=[{id:"prettier-on-write",name:"Prettier on Write",description:"Auto-format JS/TS/JSON/MD files after edit via prettier",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.(js|jsx|ts|tsx|json|md|css|html|yaml|yml)$' | xargs -r -I{} npx --no-install prettier --write {} 2>/dev/null || true"},{id:"black-on-write",name:"Black on Write (Python)",description:"Auto-format Python files after edit via black",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.py$' | xargs -r black -q 2>/dev/null || true"},{id:"rustfmt-on-write",name:"rustfmt on Write",description:"Auto-format Rust files after edit via rustfmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.rs$' | xargs -r rustfmt 2>/dev/null || true"},{id:"gofmt-on-write",name:"gofmt on Write",description:"Auto-format Go files after edit via gofmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.go$' | xargs -r gofmt -w 2>/dev/null || true"},{id:"block-secret-writes",name:"Block Writes to Secrets",description:"Deny edits to .env, credentials, key files",event:"PreToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); echo "$path" | grep -qE '(^|/)(\\.env|\\.env\\..+|id_rsa|id_ed25519|.*\\.pem|.*\\.key|credentials\\.json|\\.aws/credentials)$' && { echo '{"decision":"block","reason":"refusing to edit secret file"}'; exit 2; } || true`},{id:"notify-on-stop",name:"Desktop Notify on Stop",description:"Send a desktop notification when Claude finishes a turn",event:"Stop",command:`command -v notify-send >/dev/null && notify-send "Claude Code" "Session ready" || (command -v osascript >/dev/null && osascript -e 'display notification "Session ready" with title "Claude Code"') || true`},{id:"bell-on-notification",name:"Terminal Bell on Notification",description:"Ring the terminal bell on permission prompts / idle notifications",event:"Notification",command:"printf '\\a'"},{id:"log-tool-calls",name:"Log Tool Calls (JSONL)",description:"Append every tool call to ~/.claude/logs/tool-calls.jsonl for audit",event:"PreToolUse",command:"mkdir -p ~/.claude/logs && cat >> ~/.claude/logs/tool-calls.jsonl"},{id:"auto-stage-edits",name:"Auto-stage Edited Files",description:"git add each file Claude edits (inside a repo)",event:"PostToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); [ -n "$path" ] && git -C "$(dirname "$path")" add "$path" 2>/dev/null || true`},{id:"block-dangerous-bash",name:"Block Dangerous Bash",description:"Refuse rm -rf /, fork bombs, curl|sh pipes",event:"PreToolUse",matcher:"Bash",command:`cmd=$(jq -r '.tool_input.command // empty'); echo "$cmd" | grep -qE '(rm -rf /|:\\(\\)\\{.*\\};|curl.*\\|\\s*(bash|sh)|wget.*\\|\\s*(bash|sh)|mkfs\\.|dd if=.*of=/dev/)' && { echo '{"decision":"block","reason":"dangerous command pattern"}'; exit 2; } || true`},{id:"prepend-cwd-to-prompt",name:"Prepend CWD to Prompt",description:"Add cwd context to every user prompt automatically",event:"UserPromptSubmit",command:'echo "{\\"additionalContext\\":\\"cwd: $(pwd)\\"}"'},{id:"archive-transcript",name:"Archive Transcript on SessionEnd",description:"Copy the session jsonl to ~/.claude/archive/ when done",event:"SessionEnd",command:`src=$(jq -r '.transcript_path // empty'); [ -n "$src" ] && mkdir -p ~/.claude/archive && cp "$src" ~/.claude/archive/ 2>/dev/null || true`}],Dt=(l,m,p,k)=>`---
|
|
69
|
-
name: ${l}
|
|
70
|
-
description: ${m}
|
|
71
|
-
tools: ${p}
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
${k}
|
|
75
|
-
`,_d=[{id:"code-reviewer",name:"Code Reviewer",description:"Review staged changes for bugs, style, and maintainability",tools:"Read, Grep, Glob, Bash",content:Dt("code-reviewer","Review staged changes for bugs, style, and maintainability","Read, Grep, Glob, Bash",`You are a senior code reviewer. Read the user's staged diff (via \`git diff --staged\`), walk each change, and report:
|
|
76
|
-
- correctness issues (bugs, edge cases, race conditions)
|
|
77
|
-
- security issues (injection, auth, secrets)
|
|
78
|
-
- maintainability issues (naming, duplication, abstractions)
|
|
79
|
-
- style / convention deviations vs the rest of the repo
|
|
80
|
-
|
|
81
|
-
Be specific: cite file:line. Distinguish blocking issues from nits. Do not rewrite — just review.`)},{id:"test-runner",name:"Test Runner",description:"Run the project test suite, report failures, suggest fixes",tools:"Bash, Read, Grep",content:Dt("test-runner","Run the project test suite, report failures, suggest fixes","Bash, Read, Grep","Detect the test framework (jest, vitest, pytest, cargo test, go test, …) from package manifests. Run the suite. For each failure: read the failing test + the code under test, diagnose the cause, and propose a concrete fix. Do not apply fixes yourself.")},{id:"security-auditor",name:"Security Auditor",description:"Scan code for common vulnerabilities and unsafe patterns",tools:"Read, Grep, Glob, Bash",content:Dt("security-auditor","Scan code for common vulnerabilities and unsafe patterns","Read, Grep, Glob, Bash","Audit the codebase for OWASP top-10 and common CWE patterns: SQL injection, XSS, SSRF, path traversal, hardcoded secrets, weak crypto, insecure deserialization, missing authz. Report findings with severity, file:line, and remediation sketch.")},{id:"docs-writer",name:"Docs Writer",description:"Generate or update docstrings and README sections",tools:"Read, Edit, Grep, Glob",content:Dt("docs-writer","Generate or update docstrings and README sections","Read, Edit, Grep, Glob","For each public symbol missing documentation, write a concise doc comment in the project's existing style. For README sections, match the existing tone. Never invent APIs — read the code first.")},{id:"refactorer",name:"Refactorer",description:"Propose structural refactors without changing behavior",tools:"Read, Grep, Glob, Edit",content:Dt("refactorer","Propose structural refactors without changing behavior","Read, Grep, Glob, Edit","Identify extract-method, extract-class, inline, rename, and dead-code opportunities. Prefer small reversible refactors. Always preserve behavior — no feature changes.")},{id:"debugger",name:"Debugger",description:"Diagnose a failing test or runtime error from a stack trace",tools:"Read, Grep, Glob, Bash",content:Dt("debugger","Diagnose a failing test or runtime error from a stack trace","Read, Grep, Glob, Bash","Given a stack trace or failing test, walk the call chain, read the relevant code, form a hypothesis, and propose a minimal fix. Reproduce the bug before fixing when possible.")},{id:"commit-msg-writer",name:"Commit Message Writer",description:"Write a conventional commit message from staged changes",tools:"Bash, Read",content:Dt("commit-msg-writer","Write a conventional commit message from staged changes","Bash, Read","Run `git diff --staged`, summarize the change, and produce a conventional-commit message: `<type>(<scope>): <subject>`. Types: feat, fix, refactor, docs, test, chore, perf. Subject ≤72 chars, imperative, lowercase.")},{id:"perf-profiler",name:"Performance Profiler",description:"Identify hot paths and perf regressions in changed code",tools:"Read, Grep, Glob, Bash",content:Dt("perf-profiler","Identify hot paths and perf regressions in changed code","Read, Grep, Glob, Bash","Look for accidental N+1 loops, quadratic scans, sync IO in hot loops, and unbounded allocations. Rank findings by likely impact; cite file:line. Do not micro-optimize without evidence.")},{id:"sql-reviewer",name:"SQL Reviewer",description:"Review SQL/ORM queries for correctness and performance",tools:"Read, Grep, Glob",content:Dt("sql-reviewer","Review SQL/ORM queries for correctness and performance","Read, Grep, Glob","Inspect SQL and ORM queries for missing indexes, SELECT *, N+1, cartesian joins, SQL injection risk, and transaction boundaries. Report severity + remediation.")},{id:"api-designer",name:"API Designer",description:"Review REST/GraphQL API design for consistency and correctness",tools:"Read, Grep, Glob",content:Dt("api-designer","Review REST/GraphQL API design for consistency and correctness","Read, Grep, Glob","Audit route naming, HTTP verb usage, status codes, pagination, auth, error envelopes, and versioning. Flag inconsistencies against the rest of the surface.")},{id:"migration-planner",name:"Migration Planner",description:"Draft a safe DB migration + rollback plan for a schema change",tools:"Read, Grep, Glob, Bash",content:Dt("migration-planner","Draft a safe DB migration + rollback plan for a schema change","Read, Grep, Glob, Bash","For the requested schema change, produce forward + rollback migrations, a backfill strategy for large tables, and a deploy sequence that keeps the old code running through the transition.")},{id:"dependency-auditor",name:"Dependency Auditor",description:"Audit dependencies for vulnerabilities and stale versions",tools:"Bash, Read",content:Dt("dependency-auditor","Audit dependencies for vulnerabilities and stale versions","Bash, Read","Run the ecosystem audit (npm audit, pip-audit, cargo audit, etc.) and read the lockfile. Rank CVEs by severity + reachability. Suggest upgrades with known-compatible versions.")}],yd=[{id:"strict",name:"Strict",description:"Deny all network + dangerous bash; ask before edits; no auto-accept",permissions:{deny:["Bash(curl:*)","Bash(wget:*)","Bash(nc:*)","Bash(ssh:*)","Bash(rm -rf:*)","Bash(sudo:*)","WebFetch","WebSearch"],ask:["Edit","Write","Bash"],defaultMode:"default"}},{id:"standard-dev",name:"Standard Dev",description:"Allow common dev commands (git, npm, pnpm, cargo, go, make); deny destructive ops",permissions:{allow:["Bash(git:*)","Bash(npm:*)","Bash(pnpm:*)","Bash(yarn:*)","Bash(cargo:*)","Bash(go:*)","Bash(make:*)","Bash(ls:*)","Bash(pwd)","Bash(cat:*)","Bash(grep:*)","Bash(rg:*)","Bash(find:*)","Read","Glob","Grep"],deny:["Bash(rm -rf /:*)","Bash(sudo:*)","Bash(shutdown:*)","Bash(reboot:*)","Bash(dd:*)"],defaultMode:"acceptEdits"}},{id:"sandboxed",name:"Sandboxed",description:"Block writes outside cwd; allow reads everywhere; deny network and sudo",permissions:{deny:["Bash(sudo:*)","Bash(curl:*)","Bash(wget:*)","WebFetch","WebSearch"],ask:["Write","Edit"],defaultMode:"default",additionalDirectories:[]}},{id:"read-only",name:"Read-only",description:"Research / analysis only — no edits, no bash, no writes",permissions:{allow:["Read","Glob","Grep","WebFetch","WebSearch"],deny:["Write","Edit","Bash","NotebookEdit"],defaultMode:"default"}},{id:"plan-mode",name:"Plan Mode",description:"Force plan-mode by default; ask before any mutation",permissions:{ask:["Write","Edit","Bash","NotebookEdit"],defaultMode:"plan"}}],Gr=[{id:"local-time",name:"Local time (Pacific)",description:"Always state times in the user's local timezone (America/Los_Angeles)",category:"communication",section:"Time and timezone",bullets:["When stating any time, date, or deadline, use the user's local timezone: America/Los_Angeles (Pacific Time, PST/PDT depending on DST).","Never use UTC, server time, or your own assumed timezone in user-facing replies. Convert if necessary.",'When showing a time, include the zone abbreviation (e.g., "3:15 PM PDT") so it is unambiguous.',`For relative phrasing ("tomorrow", "in 2 hours"), anchor to the user's local clock, not UTC.`],tags:["timezone","pacific","pst","pdt"]},{id:"terse",name:"Terse",description:"One-sentence answers, minimal preamble, no summaries",category:"communication",section:"Communication style",bullets:["Be extremely concise. Lead with the answer or the diff.","No preamble, no trailing summaries, no recap of what you just did.","If the answer fits in one sentence, use one sentence. Skip pleasantries."],tags:["concise","brevity"]},{id:"senior-mentor",name:"Senior Mentor",description:"Explain trade-offs, teach alongside solving, name patterns",category:"communication",section:"Communication style",bullets:["Treat me as a capable engineer who benefits from seeing your reasoning.","When you make a design choice, name the trade-off explicitly.","When you use a pattern, name it. Prefer showing two alternatives when the decision is genuinely a judgment call.","Teach, don't lecture."],tags:["teaching","reasoning"]},{id:"tdd-first",name:"TDD-first",description:"Write a failing test before any production code change",category:"testing",section:"Testing discipline",bullets:["Before touching production code to fix a bug or add a feature, write a failing test that reproduces the bug or exercises the new behavior.","Run it to confirm it fails. Only then implement. Only then re-run the test.","This discipline is non-negotiable for non-trivial changes."],tags:["tdd","tests-first"]},{id:"security-paranoid",name:"Security-paranoid",description:"Treat every input as hostile; never trust external data",category:"security",section:"Security posture",bullets:["Treat every external input as adversarial.","Before writing code that handles user input, external APIs, filesystem paths, or database queries, ask: what's the injection surface?","Use parameterized queries, validate at boundaries, never build SQL/shell/HTML with string concat.","Secrets never touch logs or git. When in doubt, ask."],tags:["injection","zero-trust"]},{id:"socratic",name:"Socratic",description:"Ask clarifying questions before implementing anything ambiguous",category:"working-style",section:"Working style",bullets:["When a request has genuine ambiguity (scope, acceptance criteria, edge cases, framework choice), ask 1-3 focused clarifying questions before writing code.","Don't ask for confirmation of the obvious — just for decisions that would cost real time to redo."],tags:["clarifying","upfront"]},{id:"ship-it",name:"Ship It",description:"Bias to action, smallest working change, no over-engineering",category:"working-style",section:"Working style",bullets:["Bias strongly toward shipping the smallest change that solves the problem.","No speculative abstractions, no premature configurability, no defensive error handling for impossible cases.","Three similar lines beat a premature abstraction. When the task is done, stop."],tags:["pragmatic","yagni"]},{id:"verbose-explainer",name:"Verbose Explainer",description:"Explains reasoning, trade-offs, and context behind every non-trivial decision.",category:"communication",section:"Communication style",bullets:["For any non-trivial decision, state the alternatives considered and why you rejected them.","After writing code, summarize what changed and why in 2-4 sentences.","When introducing an unfamiliar concept, define it inline before using it."],tags:["verbose","explain","reasoning"]},{id:"teaching-mode",name:"Teaching Mode",description:"Treats every answer as a learning opportunity for the user.",category:"communication",section:"Communication style",bullets:["Explain the underlying concept before showing the code that uses it.","Link each suggestion to the principle or pattern it derives from.","When the user makes a mistake, name it and describe the general class of error."],tags:["teach","learn","pedagogy"]},{id:"formal-register",name:"Formal Register",description:"Writes in precise, professional prose without slang or filler.",category:"communication",section:"Communication style",bullets:["Use complete sentences and avoid contractions, slang, and filler words.","Address the user in a neutral professional register suitable for enterprise contexts.","Never use exclamation marks or cheerleading phrases."],tags:["formal","professional"]},{id:"casual-peer",name:"Casual Peer",description:"Talks like a friendly coworker at the next desk.",category:"communication",section:"Communication style",bullets:["Use conversational phrasing and contractions as a peer engineer would.","Skip ceremonial preambles and get to the point quickly.",'Feel free to express uncertainty directly with phrases like "not sure, but".'],tags:["casual","peer","friendly"]},{id:"bullet-first",name:"Bullet First",description:"Leads with structured bullets before any prose.",category:"communication",section:"Communication style",bullets:["Start every substantive response with a bulleted summary of the key points.","Reserve prose paragraphs for details that do not fit a bullet.","Cap bullets at two lines each."],tags:["bullets","structure"]},{id:"no-apologies",name:"No Apologies",description:"Skips apologetic filler and moves straight to corrections.",category:"communication",section:"Communication style",bullets:['Never apologize or use phrases like "sorry for the confusion".',"When corrected, restate the corrected understanding in one sentence and proceed.","Do not thank the user for feedback; just act on it."],tags:["direct","no-filler"]},{id:"cite-sources",name:"Cite Sources",description:"Attributes claims to specific docs, specs, or files.",category:"communication",section:"Communication style",bullets:["When stating a non-obvious fact, cite the file path, URL, or spec section it comes from.","Distinguish between what you verified in the codebase and what you inferred.",'If you cannot cite a source, flag the claim as "unverified".'],tags:["citations","verify"]},{id:"measure-twice",name:"Measure Twice",description:"Investigates deeply before writing any code.",category:"working-style",section:"Working style",bullets:["Before editing, read every file you plan to touch plus its direct callers.","Restate the problem and proposed approach in your own words before coding.","Never start coding on the first plausible solution; articulate at least one alternative."],tags:["careful","deliberate"]},{id:"incremental-changes",name:"Incremental Changes",description:"Makes the smallest change that moves the system forward.",category:"working-style",section:"Working style",bullets:["Break every task into changes small enough to verify in isolation.","Keep each change green: the build and tests pass before moving on.","Prefer many small diffs over one large sweeping diff."],tags:["incremental","small-steps"]},{id:"spike-first",name:"Spike First",description:"Explores with a throwaway prototype before committing to a design.",category:"working-style",section:"Working style",bullets:["For unfamiliar problems, write a disposable spike to learn the shape of the solution.","Mark spike code clearly and delete it before merging production code.","Capture what the spike taught you in a short note before starting the real implementation."],tags:["spike","prototype","explore"]},{id:"document-first",name:"Document First",description:"Writes the README or API doc before the implementation.",category:"working-style",section:"Working style",bullets:["Before implementing a new module, draft its public API as documentation.","Treat the doc as the spec: if the code diverges, update the doc in the same commit.","Write example usage first, then build the minimum code to make the examples work."],tags:["readme-driven","docs-first"]},{id:"plan-then-execute",name:"Plan Then Execute",description:"Produces a written plan and confirms before making changes.",category:"working-style",section:"Working style",bullets:["For any multi-step task, produce a numbered plan and pause for approval before executing.","State explicit success criteria for each step of the plan.","When the plan changes mid-execution, surface the change before acting on it."],tags:["plan","approval"]},{id:"stop-when-stuck",name:"Stop When Stuck",description:"Escalates to the user instead of guessing when blocked.",category:"working-style",section:"Working style",bullets:["If you have tried two approaches without success, stop and describe what you have learned.","Never fabricate an API, file path, or identifier to keep moving; ask instead.","Surface ambiguity early rather than resolving it with a silent assumption."],tags:["escalate","ask"]},{id:"zero-trust-inputs",name:"Zero Trust Inputs",description:"Treats every external input as hostile until validated.",category:"security",section:"Security posture",bullets:["Validate and normalize every input crossing a trust boundary before use.","Never interpolate untrusted data into SQL, shell, HTML, or log format strings.","Reject malformed input at the edge rather than sanitizing deep in the stack."],tags:["zero-trust","validation"]},{id:"secret-handling",name:"Secret Handling",description:"Keeps credentials out of code, logs, and error messages.",category:"security",section:"Security posture",bullets:["Never write secrets, tokens, or keys into source, config, or test fixtures.","Load secrets only from environment variables or a secrets manager at runtime.","Redact credentials and PII from every log line and error message."],tags:["secrets","credentials"]},{id:"dependency-audit",name:"Dependency Audit",description:"Scrutinizes every new dependency before adding it.",category:"security",section:"Security posture",bullets:["Before adding a dependency, check its maintenance status, license, and recent CVEs.","Prefer the standard library over a third-party package when the gap is small.","Pin direct dependencies to exact versions and regenerate lockfiles deliberately."],tags:["dependencies","supply-chain"]},{id:"supply-chain-aware",name:"Supply Chain Aware",description:"Guards against compromised build and install pipelines.",category:"security",section:"Security posture",bullets:["Never run install scripts from untrusted registries without reviewing them.","Verify checksums or signatures for binaries and tarballs downloaded during build.","Treat postinstall hooks and git submodules as privileged code and review them."],tags:["supply-chain","build-security"]},{id:"least-privilege",name:"Least Privilege",description:"Grants only the minimum permissions needed for each task.",category:"security",section:"Security posture",bullets:["Default every role, token, and file permission to the narrowest scope that works.","Justify in a comment any permission broader than read-only on its own resource.","Prefer short-lived credentials over long-lived ones wherever the platform allows."],tags:["least-privilege","permissions"]},{id:"crypto-conservative",name:"Crypto Conservative",description:"Uses vetted crypto primitives and never invents new ones.",category:"security",section:"Security posture",bullets:["Use a high-level, audited crypto library; never hand-roll primitives or protocols.","Use authenticated encryption (AEAD) for any encrypted payload.","Never compare secrets with non-constant-time equality."],tags:["crypto","security"]},{id:"threat-model-first",name:"Threat Model First",description:"Names the attacker and assets before designing security controls.",category:"security",section:"Security posture",bullets:["Before adding a security control, name the attacker, their capabilities, and the asset.","Call out assumptions that, if broken, would invalidate the control.","Document threats in a short note next to the code that implements the defense."],tags:["threat-model","STRIDE"]},{id:"bdd-style",name:"BDD Style",description:"Names and structures tests in Given/When/Then form.",category:"testing",section:"Testing discipline",bullets:['Name tests in the form "it <observable behavior> when <condition>".',"Structure each test body as Given (setup), When (action), Then (assertion).","Write tests from the caller's perspective, not the implementation's."],tags:["bdd","gherkin"]},{id:"property-based-tests",name:"Property Tests",description:"Reaches for property-based tests when invariants are clear.",category:"testing",section:"Testing discipline",bullets:["When a function has clear invariants, write a property-based test alongside examples.","Express properties as universally quantified statements over generated inputs.","Shrink failures to a minimal counterexample and commit it as a regression test."],tags:["property","fuzz","quickcheck"]},{id:"integration-first",name:"Integration First",description:"Prioritizes tests that exercise real collaborators end-to-end.",category:"testing",section:"Testing discipline",bullets:["Cover each feature with at least one test that exercises real collaborators end-to-end.","Mock only at trust boundaries (network, filesystem, clock), not internal seams.","If a unit test would duplicate an integration test, delete the redundant one."],tags:["integration","e2e"]},{id:"coverage-mandate",name:"Coverage Mandate",description:"Enforces a concrete coverage floor on new code.",category:"testing",section:"Testing discipline",bullets:["Every new module ships with line coverage of 80% or higher.","Every bug fix includes a test that fails before the fix and passes after.","Never lower a coverage threshold to make CI pass; raise tests instead."],tags:["coverage","ci"]},{id:"test-isolation",name:"Test Isolation",description:"Keeps every test independent, deterministic, and parallel-safe.",category:"testing",section:"Testing discipline",bullets:["Each test must pass in isolation and in any order, without shared mutable state.","Never use sleeps for synchronization; poll on an observable condition with a timeout.","Seed randomness and freeze the clock so failures are reproducible."],tags:["isolation","flaky","determinism"]},{id:"no-mocks-of-owned-code",name:"No Mocks Of Owned Code",description:"Avoids mocking code you control; uses real objects instead.",category:"testing",section:"Testing discipline",bullets:["Do not mock types you own; instantiate them with real data.","Mock only at the boundary to third-party services or slow resources.","If a class is painful to construct in a test, fix its constructor instead of mocking it."],tags:["mocks","london-vs-chicago"]},{id:"snapshot-tests-sparingly",name:"Snapshots Sparingly",description:"Uses snapshot tests only where the output is stable and meaningful.",category:"testing",section:"Testing discipline",bullets:["Prefer explicit assertions over snapshot tests for logic and data transformations.","Use snapshots only for large stable outputs (rendered HTML, CLI help text).","Review every snapshot diff manually; never update snapshots blindly."],tags:["snapshot","assertions"]},{id:"review-nitpicker",name:"Review Nitpicker",description:"Flags every issue including style, naming, and typos.",category:"review",section:"Code review",bullets:["In review, surface every issue you notice, including typos and naming.","Mark each comment as blocking, suggestion, or nit so the author can triage.","Propose a concrete alternative for every nit you raise."],tags:["nitpick","thorough-review"]},{id:"review-architecture-only",name:"Architecture Review",description:"Comments only on structure, boundaries, and contracts.",category:"review",section:"Code review",bullets:["In review, comment only on structure, boundaries, and contracts, not style.","Focus on module coupling, dependency direction, and data ownership.","Defer style and naming issues to linters and formatters."],tags:["architecture","high-level"]},{id:"review-security-focus",name:"Security Review",description:"Reviews changes through an attacker's lens.",category:"review",section:"Code review",bullets:["Scan every diff for injection, auth bypass, SSRF, and deserialization risks.","Flag any new trust boundary crossing and verify its validation.","Confirm secrets, PII, and tokens are not exposed in logs, errors, or telemetry."],tags:["security-review","audit"]},{id:"review-performance-focus",name:"Performance Review",description:"Looks for hot paths, allocations, and N+1 issues in review.",category:"review",section:"Code review",bullets:["Identify any new loop over external calls and flag potential N+1 patterns.","Note algorithmic complexity changes in hot paths.","Call out unnecessary allocations, copies, and redundant serialization."],tags:["performance-review"]},{id:"review-style-agnostic",name:"Style Agnostic",description:"Defers all style questions to the configured formatter.",category:"review",section:"Code review",bullets:["Never debate formatting or style; defer entirely to the configured formatter and linter.","If a style rule is missing, add it to config instead of arguing in review.","Focus review energy on behavior, correctness, and design."],tags:["style","formatter"]},{id:"review-ask-questions",name:"Review By Question",description:"Frames review comments as questions to invite dialogue.",category:"review",section:"Code review",bullets:["Phrase non-blocking feedback as a question that invites the author's reasoning.","Reserve imperative language for actual blockers.","Assume the author has context you lack until proven otherwise."],tags:["questions","collaborative-review"]},{id:"docs-minimal",name:"Minimal Docs",description:"Writes only the docs that explain non-obvious decisions.",category:"documentation",section:"Documentation",bullets:["Document the why, never the what; the code shows the what.","Skip docstrings on self-explanatory functions and trivial types.",'Write a short comment only where a reader would otherwise ask "why?".'],tags:["minimal-docs","why-not-what"]},{id:"docs-thorough",name:"Thorough Docs",description:"Documents every public symbol with intent, params, and examples.",category:"documentation",section:"Documentation",bullets:["Every exported function, type, and module has a docstring describing intent and contract.","Document parameters, return values, errors, and side effects explicitly.","Include a runnable example for any non-trivial public API."],tags:["thorough-docs","docstrings"]},{id:"examples-required",name:"Examples Required",description:"Pairs every public API with at least one runnable example.",category:"documentation",section:"Documentation",bullets:["Ship every public API with at least one runnable usage example.","Keep examples short, self-contained, and executable in isolation.","Verify examples in CI so they never drift from the code."],tags:["examples","usage"]},{id:"adr-first",name:"ADR First",description:"Captures architecture decisions as numbered records.",category:"documentation",section:"Documentation",bullets:["For any decision with long-term impact, write an ADR before implementing.","State the context, alternatives, decision, and consequences in the ADR.","Number ADRs sequentially and never delete them; supersede instead."],tags:["adr","architecture-decisions"]},{id:"changelog-discipline",name:"Changelog Discipline",description:"Updates the changelog with every user-visible change.",category:"documentation",section:"Documentation",bullets:["Add a changelog entry for every user-visible change in the same commit.","Group entries under Added, Changed, Deprecated, Removed, Fixed, Security.","Write entries from the user's perspective, not the implementer's."],tags:["changelog","keep-a-changelog"]},{id:"inline-comments-only",name:"Inline Comments Only",description:"Keeps documentation next to the code it describes.",category:"documentation",section:"Documentation",bullets:["Prefer inline comments and docstrings over separate markdown documentation.","When external docs are needed, generate them from the inline sources.","Never let external docs contradict the code; delete them if they drift."],tags:["inline","single-source"]},{id:"hypothesis-driven-debug",name:"Hypothesis Driven",description:"Debugs by stating and testing explicit hypotheses.",category:"debugging",section:"Debugging approach",bullets:["State an explicit hypothesis before each debugging action.","Describe what observation would confirm or refute the hypothesis.","If three hypotheses fail, stop and re-examine your assumptions from scratch."],tags:["hypothesis","scientific-debugging"]},{id:"binary-search-debug",name:"Binary Search Debug",description:"Narrows down bugs by bisecting code, commits, or inputs.",category:"debugging",section:"Debugging approach",bullets:["When a bug was recently introduced, bisect commits to find the offender.","When a bug is in a long pipeline, halve the input or code path until it localizes.","Record each bisection step so the path to the root cause is reproducible."],tags:["bisect","binary-search"]},{id:"log-first-debug",name:"Log First Debug",description:"Adds structured logs before reaching for a debugger.",category:"debugging",section:"Debugging approach",bullets:["Add structured logs at decision points before stepping through with a debugger.","Log the inputs, outputs, and branch taken at each suspect boundary.","Remove or downgrade debug logs before merging."],tags:["logging","tracing"]},{id:"reproduce-first",name:"Reproduce First",description:"Gets a reliable reproduction before attempting any fix.",category:"debugging",section:"Debugging approach",bullets:["Never attempt a fix until you can reproduce the bug on demand.","Capture the reproduction as a failing test before changing production code.","If the bug cannot be reproduced, instrument the system until it can."],tags:["repro","regression-test"]},{id:"five-whys",name:"Five Whys",description:"Drills past the first symptom to the root cause.",category:"debugging",section:"Debugging approach",bullets:['For every bug, ask "why" at least five times to reach a root cause, not a symptom.',"Record the chain of causes in the commit or PR description.","Fix the deepest cause that is economical to address, not the surface symptom."],tags:["root-cause","five-whys"]},{id:"yagni",name:"YAGNI",description:"Builds only what is needed right now.",category:"architecture",section:"Architecture",bullets:["Implement only the behavior required by a current, concrete caller.","Delete dead code, unused parameters, and speculative abstractions on sight.","Never add configuration until a second caller needs a different value."],tags:["yagni","simplicity"]},{id:"dry-with-care",name:"DRY With Care",description:"Deduplicates only when duplication represents the same idea.",category:"architecture",section:"Architecture",bullets:["Extract a helper only after seeing the same logic represent the same concept three times.","Prefer duplication over the wrong abstraction.","When deduplicating, name the concept the new helper represents."],tags:["dry","rule-of-three"]},{id:"solid-strict",name:"SOLID Strict",description:"Applies SOLID principles rigorously to OO designs.",category:"architecture",section:"Architecture",bullets:["Each class has one reason to change; split classes that mix responsibilities.","Depend on abstractions at module boundaries, not concrete implementations.","Clients should never be forced to depend on methods they do not use."],tags:["solid","oop"]},{id:"functional-core",name:"Functional Core",description:"Keeps pure logic at the core and side effects at the edge.",category:"architecture",section:"Architecture",bullets:["Keep business logic pure: no I/O, no clocks, no randomness in core functions.","Push side effects to a thin imperative shell that calls the pure core.","Pass data in and out explicitly; avoid hidden mutable state."],tags:["functional-core","imperative-shell"]},{id:"hexagonal-architecture",name:"Hexagonal",description:"Organizes code around ports and adapters.",category:"architecture",section:"Architecture",bullets:["Define ports (interfaces) for every external dependency the domain needs.","Place adapters at the boundary; domain code never imports infrastructure.","Test the domain through ports, swapping in fakes for adapters."],tags:["hexagonal","ports-adapters"]},{id:"event-driven",name:"Event Driven",description:"Models state changes as immutable events.",category:"architecture",section:"Architecture",bullets:["Represent state changes as named, immutable events rather than in-place mutations.","Derive current state by folding over events; never lose history.","Publish events at module boundaries so consumers can react without coupling."],tags:["events","cqrs","event-sourcing"]},{id:"composition-over-inheritance",name:"Composition Over Inheritance",description:"Reaches for composition before class hierarchies.",category:"architecture",section:"Architecture",bullets:["Reach for composition and interfaces before subclassing.","Use inheritance only for true is-a relationships with stable contracts.","Never extend a class just to reuse a few of its methods."],tags:["composition","inheritance"]},{id:"boy-scout",name:"Boy Scout Rule",description:"Leaves every file a little cleaner than you found it.",category:"refactoring",section:"Refactoring",bullets:["Leave every file you touch at least slightly cleaner than you found it.","Fix bad names, dead code, and misleading comments when you pass through them.","Keep cleanup scoped to what you touched; do not sprawl."],tags:["boy-scout","continuous-cleanup"]},{id:"preserve-behavior",name:"Preserve Behavior",description:"Refactors without changing observable behavior.",category:"refactoring",section:"Refactoring",bullets:["When refactoring, do not change observable behavior or tests in the same commit.","Run the full test suite before and after each refactoring step.","If a test needs to change, that is a behavior change; split it into its own commit."],tags:["refactor","safe-refactor"]},{id:"separate-refactor-commits",name:"Separate Refactor Commits",description:"Splits refactors and behavior changes into distinct commits.",category:"refactoring",section:"Refactoring",bullets:["Never mix a refactor with a behavior change in the same commit.",'Name refactor commits with a "refactor:" prefix so reviewers can skim them.',"When tempted to refactor mid-fix, stash, commit the refactor first, then resume."],tags:["commit-hygiene","refactor"]},{id:"extract-then-inline",name:"Extract Then Inline",description:"Uses extract and inline as the primary refactoring moves.",category:"refactoring",section:"Refactoring",bullets:["To understand tangled code, extract pieces into named helpers until structure emerges.","Once structure is clear, inline helpers that no longer earn their name.","Let naming drive the structure, not the other way around."],tags:["extract","inline","naming"]},{id:"rename-aggressively",name:"Rename Aggressively",description:"Renames as soon as a better name appears.",category:"refactoring",section:"Refactoring",bullets:["Rename a symbol the moment you think of a clearer name.","Names should describe intent and units, not implementation.","Commit renames separately so diffs stay reviewable."],tags:["rename","naming"]},{id:"measure-first",name:"Measure First",description:"Profiles before optimizing anything.",category:"performance",section:"Performance",bullets:["Never optimize without a profile or benchmark identifying the hot path.","Record a baseline measurement before any performance change.","Reject performance claims that are not backed by numbers."],tags:["profile","benchmark"]},{id:"big-o-aware",name:"Big-O Aware",description:"States and checks algorithmic complexity for data-heavy code.",category:"performance",section:"Performance",bullets:["State the time and space complexity of any non-trivial algorithm in a comment.","Flag any nested loop over user-scaled data as a complexity hazard.","Prefer O(n) solutions over O(n log n) only when n is provably small or constant."],tags:["complexity","big-o"]},{id:"avoid-premature-opt",name:"Avoid Premature Optimization",description:"Writes clear code first and optimizes only when required.",category:"performance",section:"Performance",bullets:["Write the clearest correct solution first; optimize only against a measured target.","Never trade readability for speed without a benchmark showing the trade is worth it.","Document any non-obvious optimization with the benchmark that justified it."],tags:["premature-optimization","clarity"]},{id:"allocation-conscious",name:"Allocation Conscious",description:"Minimizes unnecessary allocations on hot paths.",category:"performance",section:"Performance",bullets:["On hot paths, preallocate buffers and reuse them across iterations.","Avoid constructing intermediate collections just to transform them.","Prefer streaming and iterators over materializing entire datasets."],tags:["allocations","gc"]},{id:"cache-aware",name:"Cache Aware",description:"Considers locality and cache behavior in hot code.",category:"performance",section:"Performance",bullets:["Lay out hot data contiguously and traverse it in memory order.","Prefer arrays of structs or structs of arrays based on actual access patterns.","Avoid pointer-chasing in inner loops on large datasets."],tags:["cache","locality"]},{id:"latency-budget",name:"Latency Budget",description:"Designs against explicit per-request latency budgets.",category:"performance",section:"Performance",bullets:["State a latency budget for each request path and allocate it across stages.","Measure p50, p95, and p99 latencies, not just averages.","Reject any change that silently blows the budget at p95."],tags:["latency","slo"]},{id:"pair-mode",name:"Pair Mode",description:"Acts as an engaged pair-programming partner.",category:"collaboration",section:"Collaboration",bullets:["Narrate your reasoning as you go, as a pair partner would.","Before typing, state what you intend to do and why.","Pause at natural checkpoints and invite the user to drive or object."],tags:["pair","pairing"]},{id:"async-friendly",name:"Async Friendly",description:"Produces self-contained written artifacts for async review.",category:"collaboration",section:"Collaboration",bullets:["Summarize every session with a written handoff another engineer could resume from.","Include open questions, known gotchas, and next steps in every summary.","Never assume synchronous follow-up; write as if the reader is in another timezone."],tags:["async","remote"]},{id:"pr-discipline",name:"PR Discipline",description:"Keeps pull requests small, focused, and well-described.",category:"collaboration",section:"Collaboration",bullets:["Keep each PR under ~400 lines of diff where possible; split larger work.","Every PR has one purpose stated in its title and described in its body.","PR descriptions explain motivation, approach, and testing performed."],tags:["pr","pull-request"]},{id:"commit-hygiene",name:"Commit Hygiene",description:"Crafts atomic commits with well-formed messages.",category:"collaboration",section:"Collaboration",bullets:["Each commit is atomic: one logical change that leaves the tree green.","Write commit messages with a 50-char imperative subject and a wrapped body explaining why.","Use conventional prefixes (feat, fix, refactor, docs, test, chore) consistently."],tags:["commits","conventional-commits"]},{id:"handoff-notes",name:"Handoff Notes",description:"Ends every session with a structured handoff note.",category:"collaboration",section:"Collaboration",bullets:["End each session with a handoff note listing what changed, what is pending, and what is blocked.","List every file touched and why in the handoff.","Capture commands needed to resume work in a runnable form."],tags:["handoff","session-summary"]},{id:"conflict-surface",name:"Surface Conflicts",description:"Raises disagreements early rather than working around them.",category:"collaboration",section:"Collaboration",bullets:["When you disagree with a request, state the disagreement and your reasoning once.","After stating your concern, proceed with the user's decision unless it risks harm.","Never silently sandbag a task you disagree with."],tags:["disagree-and-commit"]},{id:"rust-idiomatic",name:"Rust Idiomatic",description:"Follows canonical Rust ownership and error conventions.",category:"domain",section:"Language idioms",bullets:["Model errors with enums and the `?` operator; never use `unwrap` in library code.","Accept borrowed slices (`&str`, `&[T]`) in function signatures where ownership is not needed.","Use iterators and combinators over explicit index loops.","Run `cargo clippy` and address every lint before declaring work done."],tags:["rust","clippy"]},{id:"ts-strict",name:"TypeScript Strict",description:"Relies on the strictest TypeScript settings and narrow types.",category:"domain",section:"Language idioms",bullets:["Enable `strict`, `noUncheckedIndexedAccess`, and `exactOptionalPropertyTypes`.","Never use `any`; use `unknown` with narrowing or generics instead.","Prefer discriminated unions over optional fields for state modeling.","Type function boundaries explicitly; let inference handle locals."],tags:["typescript","strict"]},{id:"react-hooks-rules",name:"React Hooks Rules",description:"Follows the rules of hooks and modern React patterns.",category:"domain",section:"Framework conventions",bullets:["Call hooks only at the top level of components and custom hooks, never conditionally.","Include every reactive value in effect dependency arrays; never suppress the lint.","Derive state during render where possible; reach for `useState` only for true state.","Extract reusable stateful logic into custom hooks named `use*`."],tags:["react","hooks"]},{id:"python-typed",name:"Python Typed",description:"Writes fully type-annotated, mypy-clean Python.",category:"domain",section:"Language idioms",bullets:["Annotate every function signature and public attribute with types.","Run `mypy --strict` (or equivalent) and fix every error.","Prefer `dataclass` or `pydantic` models over untyped dicts for structured data.","Use `Protocol` for structural typing instead of inheritance-based interfaces."],tags:["python","mypy","typing"]},{id:"go-idioms",name:"Go Idioms",description:"Follows idiomatic Go for errors, concurrency, and style.",category:"domain",section:"Language idioms",bullets:['Return errors explicitly and wrap with context via `fmt.Errorf("...: %w", err)`.',"Accept interfaces, return concrete types.","Pass `context.Context` as the first argument to any function that blocks or does I/O.","Run `go vet` and `staticcheck` and address every finding."],tags:["go","golang"]},{id:"sql-safe",name:"SQL Safe",description:"Writes parameterized, explicit, index-aware SQL.",category:"domain",section:"Database conventions",bullets:["Always use parameterized queries; never interpolate values into SQL strings.","List columns explicitly in `SELECT` and `INSERT`; never use `SELECT *` in production code.","Check the query plan for any new query touching a large table.","Wrap multi-statement writes in an explicit transaction."],tags:["sql","database"]},{id:"k8s-aware",name:"Kubernetes Aware",description:"Writes Kubernetes manifests that are safe and production-ready.",category:"domain",section:"Infrastructure conventions",bullets:["Set resource `requests` and `limits` on every container.","Define readiness and liveness probes for every workload.","Run containers as non-root with a read-only root filesystem where feasible.","Pin images by digest, not tag, for reproducible deploys."],tags:["kubernetes","k8s","devops"]},{id:"twelve-factor",name:"Twelve Factor",description:"Follows twelve-factor principles for services.",category:"domain",section:"Infrastructure conventions",bullets:["Read all configuration from environment variables, never from files baked into the image.","Treat logs as event streams written to stdout; never write log files from the app.","Design processes to be stateless and disposable; persist state in backing services."],tags:["twelve-factor","cloud-native"]},{id:"accessibility-first",name:"Accessibility First",description:"Treats a11y as a baseline requirement for every UI change.",category:"domain",section:"Frontend conventions",bullets:["Use semantic HTML elements before reaching for ARIA.","Ensure every interactive element is reachable and operable by keyboard.","Provide accessible names for icons, buttons, and form controls.","Verify color contrast meets WCAG AA for all text."],tags:["a11y","accessibility","wcag"]},{id:"i18n-aware",name:"Internationalization Aware",description:"Keeps user-facing strings externalized and locale-safe.",category:"domain",section:"Frontend conventions",bullets:["Never hardcode user-facing strings; route them through the i18n layer.","Format dates, numbers, and currencies through locale-aware APIs.","Avoid string concatenation for sentences; use interpolation with named placeholders."],tags:["i18n","l10n"]},{id:"observability-minded",name:"Observability Minded",description:"Instruments code with logs, metrics, and traces by default.",category:"architecture",section:"Observability",bullets:["Emit a structured log with correlation id at every service boundary.","Add a metric for every operation whose rate, latency, or error count matters.","Propagate trace context across async boundaries and external calls."],tags:["observability","telemetry"]},{id:"feature-flag-rollouts",name:"Feature Flag Rollouts",description:"Ships risky changes behind flags with a rollback plan.",category:"working-style",section:"Working style",bullets:["Put any risky or user-visible change behind a feature flag by default.","Document the rollout and rollback plan in the PR description.","Remove flags promptly once the change is fully rolled out."],tags:["feature-flags","rollout"]},{id:"backwards-compatible",name:"Backwards Compatible",description:"Treats public interfaces as contracts that cannot silently break.",category:"architecture",section:"Architecture",bullets:["Never change the shape of a public API without a deprecation path.","Add new optional fields rather than renaming or removing existing ones.","Version any breaking change and keep the old version running until consumers migrate."],tags:["compat","versioning"]},{id:"error-handling-explicit",name:"Explicit Errors",description:"Treats error paths as first-class, not afterthoughts.",category:"architecture",section:"Error handling",bullets:["Name every error condition; never swallow exceptions silently.","Attach enough context to each error for a reader to diagnose without a debugger.","Distinguish expected failures (return them) from bugs (raise/panic)."],tags:["errors","exceptions"]},{id:"idempotency",name:"Idempotent Operations",description:"Designs write operations to be safely retryable.",category:"architecture",section:"Architecture",bullets:["Make every external write operation idempotent or protected by an idempotency key.","Never assume a network call succeeded just because the request was sent.","Design retries with exponential backoff and a cap on attempts."],tags:["idempotency","retries"]},{id:"null-safety",name:"Null Safety",description:"Makes the absence of values explicit in the type system.",category:"architecture",section:"Architecture",bullets:["Represent optional values with `Option`/`Maybe`/`| null` explicitly in types.","Handle the absent case at the boundary, not deep in business logic.","Never use null as a sentinel for error or default."],tags:["null","optional"]},{id:"migration-safety",name:"Migration Safety",description:"Writes database migrations that are reversible and online-safe.",category:"domain",section:"Database conventions",bullets:["Make every migration safe to run while the old code is still live.","Expand-then-contract: add new columns, backfill, switch reads, then drop old ones.","Provide a tested down-migration for every up-migration."],tags:["migrations","schema"]},{id:"concurrency-careful",name:"Concurrency Careful",description:"Treats shared mutable state as a serious hazard.",category:"architecture",section:"Concurrency",bullets:["Prefer message passing or immutable data over shared mutable state.","Document the locking order for every mutex to prevent deadlocks.","Never hold a lock across I/O or an await point."],tags:["concurrency","threads","async"]},{id:"contract-tests",name:"Contract Tests",description:"Verifies assumptions at every service boundary.",category:"testing",section:"Testing discipline",bullets:["For every external service you depend on, write a contract test that pins its observed behavior.","Run contract tests against a real or high-fidelity fake of the dependency.","Fail loudly when a contract drifts; do not paper over it in the client."],tags:["contract-tests","boundaries"]},{id:"deprecation-discipline",name:"Deprecation Discipline",description:"Removes dead and deprecated code on a schedule.",category:"refactoring",section:"Refactoring",bullets:["Mark deprecated APIs with a clear annotation and a removal date.","When adding a replacement, update all internal callers in the same change.","Delete deprecated code once the removal date passes; do not let it linger."],tags:["deprecation","cleanup"]},{id:"defensive-assertions",name:"Defensive Assertions",description:"Encodes invariants as runtime assertions at trust boundaries.",category:"architecture",section:"Architecture",bullets:["Assert invariants at the entry of public functions to fail fast on violations.","Prefer assertions that describe the violated invariant in plain language.","Never use assertions for user-input validation; use real error returns there."],tags:["assertions","invariants","fail-fast"]}],In=/<!--\s*claude-presets:start(?:\s+id=([^>]*?))?\s*-->/,Qr="<!-- claude-presets:end -->";function rl(l){const m=l.match(In);if(!m)return[];const p=(m[1]??"").trim();return p?p.split(",").map(k=>k.trim()).filter(Boolean):[]}function vg(l){if(l.length===0)return`<!-- claude-presets:start -->
|
|
82
|
-
<!-- claude-presets:end -->`;const m=[],p=new Map;for(const O of l){const R=O.section.trim().toLowerCase();let i=p.get(R);i===void 0&&(i=m.length,p.set(R,i),m.push({section:O.section.trim(),bullets:[]})),m[i].bullets.push(...O.bullets)}const k=m.map(O=>`# ${O.section}
|
|
83
|
-
|
|
84
|
-
${O.bullets.map(R=>`- ${R.trim()}`).join(`
|
|
85
|
-
`)}`).join(`
|
|
86
|
-
|
|
87
|
-
`);return`<!-- claude-presets:start id=${l.map(O=>O.id).join(",")} -->
|
|
88
|
-
${k}
|
|
89
|
-
<!-- claude-presets:end -->`}function _g(l,m){const p=vg(m),k=l.match(In);if(k&&k.index!==void 0){const P=k.index,O=l.indexOf(Qr,P);if(O>=0){const R=l.slice(0,P),i=l.slice(O+Qr.length),c=R.replace(/\s*$/,""),g=i.replace(/^\s*/,"");return`${c}${c?`
|
|
90
|
-
|
|
91
|
-
`:""}${p}${g?`
|
|
92
|
-
|
|
93
|
-
`:`
|
|
94
|
-
`}${g}`}}return l.trim()?`${p}
|
|
95
|
-
|
|
96
|
-
${l.replace(/^\s+/,"")}`:p+`
|
|
97
|
-
`}function yg(l,m,p){const k=rl(l),P=k.includes(m)?k.filter(i=>i!==m):[...k,m],O=new Map(p.map(i=>[i.id,i])),R=P.map(i=>O.get(i)).filter(i=>i!==void 0);return _g(l,R)}function Sg(l,m){let p=l;const k=p.match(In);if(k&&k.index!==void 0){const R=p.indexOf(Qr,k.index);R>=0&&(p=p.slice(0,k.index)+p.slice(R+Qr.length))}const P=new Set(m.map(R=>R.section.trim().toLowerCase())),O=new Set;for(const R of p.split(`
|
|
98
|
-
`)){const i=R.match(/^#\s+(.+?)\s*$/);if(!i)continue;const c=i[1].trim();P.has(c.toLowerCase())&&O.add(c)}return Array.from(O)}function wg(l,m){if(m.length===0)return l;const p=new Set(m.map(g=>g.trim().toLowerCase())),k=l.match(In);let P=l,O="",R="";if(k&&k.index!==void 0){const g=l.indexOf(Qr,k.index);g>=0&&(P=l.slice(0,k.index),O=l.slice(k.index,g+Qr.length),R=l.slice(g+Qr.length))}const i=g=>{const y=g.split(`
|
|
99
|
-
`),h=[];let _=!1;for(const x of y){const C=x.match(/^#\s+(.+?)\s*$/);if(C){if(_=p.has(C[1].trim().toLowerCase()),_)continue}else if(_)continue;h.push(x)}return h.join(`
|
|
100
|
-
`).replace(/\n{3,}/g,`
|
|
101
|
-
|
|
102
|
-
`)},c=(O?i(P).replace(/\s*$/,"")+(P.trim()?`
|
|
103
|
-
|
|
104
|
-
`:"")+O+(R.trim()?`
|
|
105
|
-
|
|
106
|
-
`:`
|
|
107
|
-
`)+i(R).replace(/^\s*/,""):i(P)).replace(/^\s*\n+/,"").replace(/\n{3,}/g,`
|
|
108
|
-
|
|
109
|
-
`);return c.endsWith(`
|
|
110
|
-
`)?c:c+`
|
|
111
|
-
`}function xg(l,m,p){const k=rl(l);if(k.includes(m.id))return 0;const P=new Map(p.map(R=>[R.id,R])),O=m.section.trim().toLowerCase();return k.map(R=>P.get(R)).filter(R=>!!R).filter(R=>R.section.trim().toLowerCase()===O).length}function Xr(l,...m){if(!l.trim())return!0;const p=l.toLowerCase();return m.some(k=>k.toLowerCase().includes(p))}function bg(){const l=Ke(),[m,p]=J.useState(new Set),[k,P]=J.useState(null),[O,R]=J.useState(null),[i,c]=J.useState(null),[g,y]=J.useState(""),h=async()=>{var d;if(!l)return;const n=((d=(await window.api.config.readJson(`${l}/.claude.json`)).data)==null?void 0:d.mcpServers)??{};p(new Set(Object.keys(n)))};J.useEffect(()=>{h()},[l]);const _=J.useMemo(()=>pd.filter(v=>Xr(g,v.id,v.name,v.description)),[g]),x=async v=>{if(!l)return;P(v.id),R(null);const n=`${l}/.claude.json`,d=await window.api.config.readJson(n),o=(d.data&&typeof d.data=="object"?d.data:{})??{},a={...o.mcpServers??{}};a[v.id]={..."command"in v.config?{type:"stdio"}:{},...v.config};const S=await window.api.config.writeJson(n,{...o,mcpServers:a});if(P(null),!S.ok){R(S.error??"write failed");return}c(`installed ${v.id} — switch to Installed to edit placeholders`),setTimeout(()=>c(null),4e3),h()},C=async v=>{if(!l)return;P(v),R(null);const n=`${l}/.claude.json`,d=await window.api.config.readJson(n),o=(d.data&&typeof d.data=="object"?d.data:{})??{},a={...o.mcpServers??{}};delete a[v];const S=await window.api.config.writeJson(n,{...o,mcpServers:a});if(P(null),!S.ok){R(S.error??"write failed");return}h()};return l?u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(Es,{query:g,onQueryChange:y,count:_.length,total:pd.length}),(i||O)&&u.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${O?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:O??i}),u.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[_.map(v=>{const n=m.has(v.id);return u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg text-xs font-medium",children:v.name}),v.official&&u.jsx(it,{children:"official"}),n&&u.jsx(it,{tone:"accent",children:"installed"}),v.envVars.length>0&&u.jsxs(it,{tone:"warn",children:[v.envVars.length," env"]})]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:v.description}),u.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:"command"in v.config?`${v.config.command} ${(v.config.args??[]).join(" ")}`:v.config.url})]}),u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsx(sl,{href:v.homepage,children:"docs"}),n?u.jsx("button",{disabled:k===v.id,onClick:()=>C(v.id),className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-red-400",children:"remove"}):u.jsx("button",{disabled:k===v.id,onClick:()=>x(v),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:k===v.id?"…":"install"})]})]},v.id)}),_.length===0&&u.jsx(xe,{title:"no matches"})]})]}):u.jsx(xe,{title:"loading…"})}function Cg(){const l=Ke(),[m,p]=J.useState(new Set),[k,P]=J.useState(""),O=async()=>{if(!l)return;const i=await window.api.config.listDir(`${l}/.claude/skills`,{dirsOnly:!0});p(new Set(i.entries.map(c=>c.name)))};J.useEffect(()=>{O()},[l]);const R=J.useMemo(()=>md.filter(i=>Xr(k,i.id,i.name,i.description)),[k]);return l?u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(Es,{query:k,onQueryChange:P,count:R.length,total:md.length}),u.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[R.map(i=>{const c=m.has(i.id),g=`mkdir -p ~/.claude/skills && cd ~/.claude/skills && git clone --depth 1 --filter=blob:none --sparse https://github.com/anthropics/skills _tmp-${i.id} && cd _tmp-${i.id} && git sparse-checkout set skills/${i.id} && mv skills/${i.id} ../${i.id} && cd .. && rm -rf _tmp-${i.id}`;return u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg text-xs font-medium",children:i.name}),i.official&&u.jsx(it,{children:"official"}),c&&u.jsx(it,{tone:"accent",children:"installed"})]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:i.description}),u.jsxs("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:["~/.claude/skills/",i.id,"/"]})]}),u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsx(sl,{href:i.source,children:"source"}),u.jsx(zd,{text:g,label:c?"reinstall cmd":"copy install"})]})]},i.id)}),R.length===0&&u.jsx(xe,{title:"no matches"})]})]}):u.jsx(xe,{title:"loading…"})}function kg(){const l=Ke(),[m,p]=J.useState(new Set),[k,P]=J.useState(""),O=async()=>{if(!l)return;const i=await window.api.config.listDir(`${l}/.claude/plugins`,{dirsOnly:!0});p(new Set(i.entries.map(c=>c.name)))};J.useEffect(()=>{O()},[l]);const R=J.useMemo(()=>gd.filter(i=>Xr(k,i.id,i.name,i.description)),[k]);return l?u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(Es,{query:k,onQueryChange:P,count:R.length,total:gd.length}),u.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[R.map(i=>{const c=m.has(i.id),g=`/plugin install ${i.id}@anthropics/claude-plugins-official`;return u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg text-xs font-medium",children:i.name}),i.official&&u.jsx(it,{children:"official"}),c&&u.jsx(it,{tone:"accent",children:"installed"}),i.bundles.map(y=>u.jsx(it,{tone:"dim",children:y},y))]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:i.description}),u.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:g})]}),u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsx(sl,{href:i.source,children:"source"}),u.jsx(zd,{text:g,label:"copy install"})]})]},i.id)}),R.length===0&&u.jsx(xe,{title:"no matches"})]})]}):u.jsx(xe,{title:"loading…"})}function Eg(l,m){return(l[m.event]??[]).some(k=>(k.hooks??[]).some(P=>P.type==="command"&&P.command===m.command))}function Lg(){const l=Ke(),[m,p]=J.useState({}),[k,P]=J.useState(null),[O,R]=J.useState(null),[i,c]=J.useState(null),[g,y]=J.useState(""),h=l?`${l}/.claude/settings.json`:null,_=async()=>{if(!h)return;const n=await window.api.config.readJson(h),d=(n.data&&typeof n.data=="object"?n.data:{})??{};p(d.hooks??{})};J.useEffect(()=>{_()},[h]);const x=J.useMemo(()=>vd.filter(n=>Xr(g,n.id,n.name,n.description,n.event)),[g]),C=async n=>{if(!h)return;P(n.id),c(null);const d=await window.api.config.readJson(h),o=(d.data&&typeof d.data=="object"?d.data:{})??{},a={...o.hooks??{}},S=(a[n.event]??[]).slice();S.push({...n.matcher?{matcher:n.matcher}:{},hooks:[{type:"command",command:n.command,...n.timeout?{timeout:n.timeout}:{}}]}),a[n.event]=S;const E=await window.api.config.writeJson(h,{...o,hooks:a});if(P(null),!E.ok){c(E.error??"write failed");return}R(`installed ${n.id}`),setTimeout(()=>R(null),2500),_()},v=async n=>{if(!h)return;P(n.id),c(null);const d=await window.api.config.readJson(h),o=(d.data&&typeof d.data=="object"?d.data:{})??{},a={...o.hooks??{}},S=(a[n.event]??[]).map(L=>({...L,hooks:(L.hooks??[]).filter(j=>!(j.type==="command"&&j.command===n.command))})).filter(L=>(L.hooks??[]).length>0);S.length?a[n.event]=S:delete a[n.event];const E=await window.api.config.writeJson(h,{...o,hooks:a});if(P(null),!E.ok){c(E.error??"write failed");return}_()};return l?u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(Es,{query:g,onQueryChange:y,count:x.length,total:vd.length}),(O||i)&&u.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${i?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:i??O}),u.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[x.map(n=>{const d=Eg(m,n);return u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg text-xs font-medium",children:n.name}),u.jsx(it,{tone:"dim",children:n.event}),n.matcher&&u.jsxs(it,{tone:"dim",children:["match: ",n.matcher]}),d&&u.jsx(it,{tone:"accent",children:"installed"})]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:n.description}),u.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:n.command})]}),u.jsx("div",{className:"flex gap-1 shrink-0",children:d?u.jsx("button",{disabled:k===n.id,onClick:()=>v(n),className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-red-400",children:"remove"}):u.jsx("button",{disabled:k===n.id,onClick:()=>C(n),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:k===n.id?"…":"install"})})]},n.id)}),x.length===0&&u.jsx(xe,{title:"no matches"})]})]}):u.jsx(xe,{title:"loading…"})}function Rg(){const l=Ke(),[m,p]=J.useState(new Set),[k,P]=J.useState(null),[O,R]=J.useState(null),[i,c]=J.useState(null),[g,y]=J.useState(""),h=async()=>{if(!l)return;const C=await window.api.config.listDir(`${l}/.claude/agents`,{filesOnly:!0}),v=new Set;for(const n of C.entries)n.name.endsWith(".md")&&v.add(n.name.replace(/\.md$/,""));p(v)};J.useEffect(()=>{h()},[l]);const _=J.useMemo(()=>_d.filter(C=>Xr(g,C.id,C.name,C.description)),[g]),x=async C=>{if(!l)return;P(C.id),c(null);const v=`${l}/.claude/agents/${C.id}.md`,n=await window.api.config.writeText(v,C.content);if(P(null),!n.ok){c(n.error??"write failed");return}R(`installed ${C.id}`),setTimeout(()=>R(null),2500),h()};return l?u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(Es,{query:g,onQueryChange:y,count:_.length,total:_d.length}),(O||i)&&u.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${i?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:i??O}),u.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[_.map(C=>{const v=m.has(C.id);return u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg text-xs font-medium",children:C.name}),C.tools&&u.jsxs(it,{tone:"dim",children:[C.tools.split(",").length," tools"]}),v&&u.jsx(it,{tone:"accent",children:"installed"})]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:C.description}),u.jsxs("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:["~/.claude/agents/",C.id,".md"]})]}),u.jsx("div",{className:"flex gap-1 shrink-0",children:u.jsx("button",{disabled:k===C.id,onClick:()=>x(C),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:k===C.id?"…":v?"overwrite":"install"})})]},C.id)}),_.length===0&&u.jsx(xe,{title:"no matches"})]})]}):u.jsx(xe,{title:"loading…"})}function jg(){const l=Ke(),[m,p]=J.useState(""),[k,P]=J.useState(null),[O,R]=J.useState(null),[i,c]=J.useState(null),[g,y]=J.useState(""),h=l?`${l}/.claude/settings.json`:null,_=async()=>{if(!h)return;const v=await window.api.config.readJson(h),n=(v.data&&typeof v.data=="object"?v.data:{})??{};p(JSON.stringify(n.permissions??{}))};J.useEffect(()=>{_()},[h]);const x=J.useMemo(()=>yd.filter(v=>Xr(g,v.id,v.name,v.description)),[g]),C=async v=>{if(!h)return;P(v.id),c(null);const n=await window.api.config.readJson(h),d=(n.data&&typeof n.data=="object"?n.data:{})??{},o=await window.api.config.writeJson(h,{...d,permissions:v.permissions});if(P(null),!o.ok){c(o.error??"write failed");return}R(`applied ${v.id} — replaces existing permissions block`),setTimeout(()=>R(null),3e3),_()};return l?u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(Es,{query:g,onQueryChange:y,count:x.length,total:yd.length}),(O||i)&&u.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${i?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:i??O}),u.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[x.map(v=>{const n=m===JSON.stringify(v.permissions),d=[];return v.permissions.allow&&d.push(`${v.permissions.allow.length} allow`),v.permissions.deny&&d.push(`${v.permissions.deny.length} deny`),v.permissions.ask&&d.push(`${v.permissions.ask.length} ask`),v.permissions.defaultMode&&d.push(`mode: ${v.permissions.defaultMode}`),u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg text-xs font-medium",children:v.name}),n&&u.jsx(it,{tone:"accent",children:"active"}),u.jsx(it,{tone:"warn",children:"replaces permissions"})]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:v.description}),u.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:d.join(" · ")})]}),u.jsx("div",{className:"flex gap-1 shrink-0",children:u.jsx("button",{disabled:k===v.id,onClick:()=>C(v),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:k===v.id?"…":"apply"})})]},v.id)}),x.length===0&&u.jsx(xe,{title:"no matches"})]})]}):u.jsx(xe,{title:"loading…"})}const Dg={communication:"Communication","working-style":"Working style",security:"Security",testing:"Testing",review:"Code review",documentation:"Documentation",debugging:"Debugging",architecture:"Architecture",refactoring:"Refactoring",performance:"Performance",collaboration:"Collaboration",domain:"Domain / stack"};function Pg(){const l=Ke(),[m,p]=J.useState(""),[k,P]=J.useState(null),[O,R]=J.useState(null),[i,c]=J.useState(null),[g,y]=J.useState(""),h=l?`${l}/.claude/CLAUDE.md`:null,_=async()=>{if(!h)return;const E=await window.api.config.readText(h);p(E.text)};J.useEffect(()=>{_()},[h]);const x=J.useMemo(()=>new Set(rl(m)),[m]),C=J.useMemo(()=>Sg(m,Gr),[m]),v=async()=>{if(!h||C.length===0)return;c(null);const E=wg(m,C),L=await window.api.config.writeText(h,E);if(!L.ok){c(L.error??"write failed");return}R(`removed ${C.length} unmanaged section(s)`),setTimeout(()=>R(null),3e3),_()},n=J.useMemo(()=>Gr.filter(E=>Xr(g,E.id,E.name,E.description,E.section,...E.tags??[])),[g]),d=J.useMemo(()=>{const E=new Map;for(const L of n){const j=E.get(L.category)??[];j.push(L),E.set(L.category,j)}return E},[n]),o=async E=>{if(!h)return;P(E.id),c(null);const L=yg(m,E.id,Gr),j=await window.api.config.writeText(h,L);if(P(null),!j.ok){c(j.error??"write failed");return}const w=!x.has(E.id);R(w?`enabled "${E.name}"`:`disabled "${E.name}"`),setTimeout(()=>R(null),2500),_()};if(!l)return u.jsx(xe,{title:"loading…"});const a=x.size,S=["communication","working-style","testing","review","security","debugging","architecture","refactoring","performance","documentation","collaboration","domain"];return u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[u.jsx("span",{className:"text-fg-faint",children:a>0?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-fg-dim font-medium",children:a})," active · managed in"," ",u.jsx("code",{className:"text-fg-faint",children:"~/.claude/CLAUDE.md"})]}):u.jsx(u.Fragment,{children:"nothing active — toggle presets below to stack them in your CLAUDE.md"})}),u.jsx("div",{className:"flex-1"}),u.jsx("span",{className:"text-fg-faint",children:n.length===Gr.length?`${Gr.length} available`:`${n.length} of ${Gr.length}`}),u.jsx("input",{value:g,onChange:E=>y(E.target.value),placeholder:"search presets…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-56"})]}),(O||i)&&u.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${i?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:i??O}),C.length>0&&u.jsxs("div",{className:"px-4 py-2 text-xs border-b border-line bg-yellow-950/20 flex items-start gap-3",children:[u.jsxs("div",{className:"flex-1 text-yellow-500/90",children:[u.jsx("div",{className:"font-medium",children:"Your CLAUDE.md has unmanaged sections that will collide with presets:"}),u.jsx("div",{className:"text-yellow-500/70 mt-0.5",children:C.map(E=>`# ${E}`).join(" · ")}),u.jsx("div",{className:"text-fg-faint mt-1",children:"These were probably added before presets were toggleable. Clean them out so the managed block owns those sections."})]}),u.jsxs("button",{onClick:v,className:"shrink-0 px-3 py-1 text-xs border border-yellow-600/60 rounded text-yellow-400 hover:bg-yellow-600 hover:text-bg",children:["remove ",C.length," section",C.length>1?"s":""]})]}),u.jsxs("div",{className:"flex-1 overflow-auto",children:[S.map(E=>({cat:E,presets:d.get(E)??[]})).filter(E=>E.presets.length>0).map(({cat:E,presets:L})=>u.jsx(Tg,{title:Dg[E],presets:L,activeIds:x,existing:m,busy:k,onToggle:o},E)),n.length===0&&u.jsx(xe,{title:"no matches"})]})]})}function Tg({title:l,presets:m,activeIds:p,existing:k,busy:P,onToggle:O}){const[R,i]=J.useState(!0),c=m.filter(g=>p.has(g.id)).length;return u.jsxs("section",{className:"border-b border-line",children:[u.jsxs("header",{className:"px-4 py-2 bg-bg-elev/40 cursor-pointer hover:bg-bg-elev flex items-center gap-3",onClick:()=>i(!R),children:[u.jsx("span",{className:"text-fg-faint w-3",children:R?"▾":"▸"}),u.jsx("h2",{className:"text-fg text-sm font-medium flex-1",children:l}),u.jsx("span",{className:"text-fg-faint text-xs",children:c>0?`${c}/${m.length} active`:`${m.length}`})]}),R&&u.jsx("div",{className:"divide-y divide-line/60",children:m.map(g=>{const y=p.has(g.id),h=xg(k,g,Gr);return u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/20",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("span",{className:"text-fg text-sm",children:g.name}),y&&u.jsx(it,{tone:"accent",children:"active"}),u.jsxs("span",{className:"text-[10px] px-1 py-0 rounded border border-line bg-bg-elev text-fg-faint uppercase tracking-wide",children:["→ # ",g.section]}),!y&&h>0&&u.jsxs("span",{className:"text-[10px] px-1 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:["merges with ",h]})]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:g.description}),u.jsxs("ul",{className:"text-fg-faint text-[11px] mt-1 space-y-0.5 list-disc list-inside",children:[g.bullets.slice(0,2).map((_,x)=>u.jsx("li",{className:"truncate",children:_},x)),g.bullets.length>2&&u.jsxs("li",{className:"text-fg-faint italic",children:["+",g.bullets.length-2," more"]})]})]}),u.jsx("div",{className:"flex gap-1 shrink-0",children:u.jsx("button",{disabled:P===g.id,onClick:()=>O(g),className:`px-3 py-0.5 text-xs rounded border transition-colors ${y?"bg-accent text-bg border-accent hover:bg-transparent hover:text-fg-dim":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,title:y?"remove from CLAUDE.md":"add to CLAUDE.md",children:P===g.id?"…":y?"on":"off"})})]},g.id)})})]})}function Gt({active:l,onChange:m,installedLabel:p="Installed",libraryLabel:k="Library"}){return u.jsx("div",{className:"flex rounded border border-line overflow-hidden",children:[["installed",p],["library",k]].map(([P,O])=>u.jsx("button",{onClick:()=>m(P),className:`px-2 py-0.5 text-xs ${l===P?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:O},P))})}function Es({query:l,onQueryChange:m,count:p,total:k}){return u.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[u.jsx("span",{className:"text-fg-faint",children:p===k?`${k} available`:`${p} of ${k}`}),u.jsx("div",{className:"flex-1"}),u.jsx("input",{value:l,onChange:P=>m(P.target.value),placeholder:"filter…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-48"})]})}function it({children:l,tone:m="default"}){const p={default:"bg-bg-hi text-fg-dim border-line",accent:"bg-accent/15 text-accent border-accent/30",warn:"bg-yellow-950/30 text-yellow-500/80 border-yellow-900/40",dim:"bg-bg-elev text-fg-faint border-line"}[m];return u.jsx("span",{className:`text-[10px] px-1.5 py-0 rounded border uppercase tracking-wide ${p}`,children:l})}function sl({href:l,children:m}){return u.jsx("a",{href:l,target:"_blank",rel:"noreferrer",className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:m})}function zd({text:l,label:m}){const[p,k]=J.useState(!1);return u.jsx("button",{onClick:()=>{navigator.clipboard.writeText(l),k(!0),setTimeout(()=>k(!1),1500)},className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:p?"copied!":m})}function Ag(l){return Math.round(l.length/4)}function Mg(){const l=Ke(),m=je(w=>w.tabs),p=je(w=>w.activeTabId),k=m.find(w=>w.id===p)??null,P=(k==null?void 0:k.cwd)??null,[O,R]=J.useState("user"),[i,c]=J.useState("installed"),g=J.useMemo(()=>{const w={};for(const D of Ba.scopes){const H=Ba.resolve(D,l??"",P);H&&(w[D]=H)}return w},[l,P]),y=g[O]??null,h=ye(w=>w.files),_=ye(w=>w.loadText),x=ye(w=>w.setDraft),C=ye(w=>w.saveText),v=ye(w=>w.revert),n=ye(w=>w.watchFile),d=ye(w=>w.unwatchFile);J.useEffect(()=>{const w=Object.values(g).filter(Boolean);return w.forEach(D=>{h[D]||_(D),n(D)}),()=>{w.forEach(D=>d(D))}},[JSON.stringify(g)]);const[o,a]=J.useState(null);if(!l)return u.jsx(xe,{title:"loading…"});if(i==="library")return u.jsx(Pe,{toolbar:u.jsx(Gt,{active:i,onChange:c,installedLabel:"Editor",libraryLabel:"Presets"}),children:u.jsx(Pg,{})});const S=y?h[y]:null,E=w=>w!=="user"&&!P,L=S?Ag(S.draftRaw):0,j=(S==null?void 0:S.draftRaw.length)??0;return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Gt,{active:i,onChange:c,installedLabel:"Editor",libraryLabel:"Presets"}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Jt,{scopes:Ba.scopes,active:O,onChange:R,annotate:w=>{if(E(w))return{exists:!1};const D=g[w];if(!D)return null;const H=h[D];return{exists:(H==null?void 0:H.exists)??!1,dirty:(H==null?void 0:H.dirty)??!1}}}),u.jsx("span",{className:"ml-3 text-fg-faint truncate",children:y??"—"}),u.jsx("div",{className:"flex-1"}),u.jsxs("span",{className:"text-fg-faint",children:[j.toLocaleString()," chars · ~",L.toLocaleString()," tokens"]})]}),footer:y&&S?u.jsx(Dr,{dirty:S.dirty,busy:S.busy,parseError:o,lastSavedAt:S.lastSavedAt,leading:S.exists?null:u.jsx("span",{children:"file will be created on save"}),onSave:async()=>{a(null);const w=await C(y);w.ok||a(w.error??"save failed")},onRevert:()=>{a(null),v(y)}}):null,children:E(O)?u.jsx(xe,{title:"no active project",hint:"open a tab in a project directory to edit project or local CLAUDE.md"}):y&&S?u.jsx(tl,{path:y,value:S.draftRaw,onChange:w=>{a(null),x(y,w)}}):u.jsx(xe,{title:"resolving…"})})}const Og=`{
|
|
112
|
-
"$schema": "https://json.schemastore.org/claude-code-keybindings.json",
|
|
113
|
-
"bindings": []
|
|
114
|
-
}
|
|
115
|
-
`;function Ng(){const l=Ke(),m=ye(_=>_.files),p=ye(_=>_.loadJson),k=ye(_=>_.setDraft),P=ye(_=>_.saveJson),O=ye(_=>_.revert),R=ye(_=>_.watchFile),i=ye(_=>_.unwatchFile),c=l?wp.resolve("user",l,null):null;J.useEffect(()=>{if(c)return m[c]||p(c),R(c),()=>i(c)},[c]);const[g,y]=J.useState(null);if(!l||!c)return u.jsx(xe,{title:"loading…"});const h=m[c];return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-fg-faint truncate",children:c}),u.jsx("div",{className:"flex-1"}),u.jsx("a",{href:"https://code.claude.com/docs/en/keybindings",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"reference ↗"})]}),footer:h?u.jsx(Dr,{dirty:h.dirty,busy:h.busy,parseError:g||h.parseError,lastSavedAt:h.lastSavedAt,leading:h.exists?u.jsx("span",{children:"restart Claude Code to apply changes"}):u.jsx("span",{children:"file will be created on save"}),onSave:async()=>{y(null);const _=await P(c);_.ok||y(_.error??"save failed")},onRevert:()=>{y(null),O(c)}}):null,children:h?u.jsx(Nd,{path:c,value:h.draftRaw===""&&!h.exists?Og:h.draftRaw,onChange:_=>{y(null),k(c,_)}}):u.jsx(xe,{title:"loading…"})})}function Pr(){const l=je(p=>p.tabs),m=je(p=>p.activeTabId);return l.find(p=>p.id===m)??null}const Ig=["allow","deny","ask"];function Bg(l){if(l.trim()==="")return{perms:{},full:{},err:null};try{const m=JSON.parse(l);return{perms:m.permissions??{},full:m,err:null}}catch(m){return{perms:{},full:{},err:m.message}}}function Fg(l,m){const p={...l,permissions:m};return JSON.stringify(p,null,2)+`
|
|
116
|
-
`}function Hg(){const l=Ke(),m=Pr(),p=(m==null?void 0:m.cwd)??null,[k,P]=J.useState("user"),[O,R]=J.useState("effective"),i=J.useMemo(()=>{const I={};for(const Q of Fa.scopes){const q=Fa.resolve(Q,l??"",p);q&&(I[Q]=q)}return I},[l,p]),c=i[k]??null,g=ye(I=>I.files),y=ye(I=>I.loadJson),h=ye(I=>I.setDraft),_=ye(I=>I.saveJson),x=ye(I=>I.revert),C=ye(I=>I.watchFile),v=ye(I=>I.unwatchFile);J.useEffect(()=>{const I=Object.values(i).filter(Boolean);return I.forEach(Q=>{g[Q]||y(Q),C(Q)}),()=>I.forEach(Q=>v(Q))},[JSON.stringify(i)]);const[n,d]=J.useState(null),o=u.jsx(Xa,{options:[{key:"effective",label:"Effective"},{key:"rules",label:"Rules"},{key:"presets",label:"Presets"}],active:O,onChange:R}),a=J.useMemo(()=>{const I=Ya(el(g,i));return Za(I,["permissions"])??{kind:"object",children:{}}},[g,i]),S=(I,Q)=>{var B;const q=i[k];if(!q)return;d(null);const z=((B=g[q])==null?void 0:B.draftRaw)??"";let re={};if(z.trim())try{re=JSON.parse(z)}catch{re={}}const X=Nn(re.permissions??{},I,Q),A={...re,permissions:X};h(q,JSON.stringify(A,null,2)+`
|
|
117
|
-
`)};if(!l)return u.jsx(xe,{title:"loading…"});if(O==="presets")return u.jsx(Pe,{toolbar:o,children:u.jsx(jg,{})});const E=I=>I!=="user"&&!p,L=c?g[c]:null,{perms:j,full:w,err:D}=L?Bg(L.draftRaw):{perms:{},full:{},err:null},H=I=>{c&&(d(null),h(c,Fg(w,I)))},U=(I,Q)=>{const q=Q.trim();if(!q)return;const z=j[I]??[];z.includes(q)||H({...j,[I]:[...z,q]})},W=(I,Q)=>{const q=j[I]??[];H({...j,[I]:q.filter((z,re)=>re!==Q)})};return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[o,u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Jt,{scopes:Fa.scopes,active:k,onChange:P,annotate:I=>{if(E(I))return{exists:!1};const Q=i[I];if(!Q)return null;const q=g[Q];return{exists:(q==null?void 0:q.exists)??!1,dirty:(q==null?void 0:q.dirty)??!1}}}),u.jsx("span",{className:"ml-3 text-fg-faint truncate",children:c??"—"}),u.jsx("div",{className:"flex-1"}),u.jsx("a",{href:"https://code.claude.com/docs/en/settings#permissions",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"rule syntax ↗"})]}),footer:c&&L?u.jsx(Dr,{dirty:L.dirty,busy:L.busy,parseError:n||D||L.parseError,lastSavedAt:L.lastSavedAt,onSave:async()=>{d(null);const I=await _(c);I.ok||d(I.error??"save failed")},onRevert:()=>{d(null),x(c)}}):null,children:E(k)?u.jsx(xe,{title:"no active project",hint:"open a tab in a project directory to edit project or local permissions"}):O==="effective"?u.jsx(Qa,{node:a,targetScope:k,onOverride:S,schema:Mn().rootedAt(["permissions"]),rootLabel:"permissions"}):c&&L?u.jsxs("div",{className:"p-4 space-y-5 max-w-3xl",children:[u.jsx(Ug,{value:j.defaultMode??"default",onChange:I=>H({...j,defaultMode:I})}),Ig.map(I=>u.jsx($g,{list:I,rules:j[I]??[],onAdd:Q=>U(I,Q),onRemove:Q=>W(I,Q)},I)),u.jsx(Wg,{dirs:j.additionalDirectories??[],onChange:I=>H({...j,additionalDirectories:I})})]}):u.jsx(xe,{title:"resolving…"})})}function Ug({value:l,onChange:m}){const p=["default","acceptEdits","plan","bypassPermissions"];return u.jsxs("section",{children:[u.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Default Mode"}),u.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:p.map(k=>u.jsx("button",{onClick:()=>m(k),className:`px-2.5 py-1 text-xs transition-colors ${l===k?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:k},k))})]})}function $g({list:l,rules:m,onAdd:p,onRemove:k}){const[P,O]=J.useState(""),R=l==="allow"?"text-green-400":l==="deny"?"text-red-400":"text-yellow-400";return u.jsxs("section",{children:[u.jsx("h3",{className:`text-xs uppercase tracking-wider mb-2 ${R}`,children:l}),u.jsxs("div",{className:"flex gap-2 mb-2",children:[u.jsx("input",{value:P,onChange:i=>O(i.target.value),onKeyDown:i=>{i.key==="Enter"&&(p(P),O(""))},placeholder:l==="allow"?"e.g. Bash(ls:*) or Read(~/.claude/**)":"e.g. Write(/etc/**)",className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint"}),u.jsx("button",{onClick:()=>{p(P),O("")},disabled:!P.trim(),className:"px-2.5 py-1 border border-line rounded text-xs text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-40",children:"add"})]}),m.length===0?u.jsx("div",{className:"text-fg-faint text-xs",children:"no rules"}):u.jsx("ul",{className:"space-y-0.5",children:m.map((i,c)=>u.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[u.jsx("span",{className:"flex-1 text-fg-dim truncate",children:i}),u.jsx("button",{onClick:()=>k(c),className:"text-fg-faint hover:text-red-400",title:"remove",children:"×"})]},`${c}-${i}`))})]})}function Wg({dirs:l,onChange:m}){const[p,k]=J.useState("");return u.jsxs("section",{children:[u.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Additional Directories"}),u.jsx("div",{className:"flex gap-2 mb-2",children:u.jsx("input",{value:p,onChange:P=>k(P.target.value),onKeyDown:P=>{P.key==="Enter"&&p.trim()&&(m([...l,p.trim()]),k(""))},placeholder:"/absolute/path/to/dir",className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint"})}),u.jsx("ul",{className:"space-y-0.5",children:l.map((P,O)=>u.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[u.jsx("span",{className:"flex-1 text-fg-dim truncate",children:P}),u.jsx("button",{onClick:()=>m(l.filter((R,i)=>i!==O)),className:"text-fg-faint hover:text-red-400",children:"×"})]},`${O}-${P}`))})]})}function Bn({sidebar:l,detail:m,sidebarWidth:p="18rem"}){return u.jsxs("div",{className:"h-full flex",children:[u.jsx("div",{className:"shrink-0 border-r border-line overflow-y-auto",style:{width:p},children:l}),u.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:m})]})}function zg(l,m){return{user:{skills:`${l}/.claude/skills`,commands:`${l}/.claude/commands`},project:m?{skills:`${m}/.claude/skills`,commands:`${m}/.claude/commands`}:null}}function Vg(){const l=Ke(),m=Pr(),p=(m==null?void 0:m.cwd)??null,[k,P]=J.useState("user"),[O,R]=J.useState([]),[i,c]=J.useState(null),[g,y]=J.useState("installed"),[h,_]=J.useState(""),x=J.useMemo(()=>l?zg(l,p):null,[l,p]);J.useEffect(()=>{if(!x)return;let D=!1;const H=k==="user"?x.user:x.project;if(!H){R([]);return}return(async()=>{var Q;const U=[],W=await window.api.config.listDir(H.skills,{dirsOnly:!0});for(const q of W.entries)if((await window.api.config.readText(`${q.path}/SKILL.md`)).exists)U.push({kind:"skills",scope:k,name:q.name,path:`${q.path}/SKILL.md`,dir:q.path});else{const re=await window.api.config.listDir(q.path,{dirsOnly:!0});for(const X of re.entries)(await window.api.config.readText(`${X.path}/SKILL.md`)).exists&&U.push({kind:"skills",scope:k,name:X.name,path:`${X.path}/SKILL.md`,dir:X.path})}const I=await window.api.config.listDir(H.commands,{filesOnly:!0});for(const q of I.entries)q.name.endsWith(".md")&&U.push({kind:"commands",scope:k,name:q.name.replace(/\.md$/,""),path:q.path,dir:null});D||(U.sort((q,z)=>q.kind===z.kind?q.name.localeCompare(z.name):q.kind==="skills"?-1:1),R(U),U.find(q=>q.path===i)||c(((Q=U[0])==null?void 0:Q.path)??null))})(),()=>{D=!0}},[k,x]);const C=ye(D=>D.files),v=ye(D=>D.loadText),n=ye(D=>D.setDraft),d=ye(D=>D.saveText),o=ye(D=>D.revert),a=ye(D=>D.watchFile),S=ye(D=>D.unwatchFile);J.useEffect(()=>{if(i)return C[i]||v(i),a(i),()=>S(i)},[i]);const[E,L]=J.useState(null);if(!l)return u.jsx(xe,{title:"loading…"});if(g==="library")return u.jsx(Pe,{toolbar:u.jsx(Gt,{active:g,onChange:y,installedLabel:"Installed",libraryLabel:"Library"}),children:u.jsx(Cg,{})});if(k==="project"&&!p)return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Gt,{active:g,onChange:y}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Jt,{scopes:["user","project"],active:k,onChange:P})]}),children:u.jsx(xe,{title:"no active project",hint:"open a tab in a project directory to view project skills & commands"})});const j=O.find(D=>D.path===i)??null,w=i?C[i]:null;return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Gt,{active:g,onChange:y}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Jt,{scopes:["user","project"],active:k,onChange:P}),u.jsxs("span",{className:"ml-3 text-fg-faint",children:[O.length," ",O.length===1?"item":"items"]}),u.jsx("div",{className:"flex-1"}),u.jsx("span",{className:"text-fg-faint truncate",children:(j==null?void 0:j.path)??""})]}),footer:i&&w?u.jsx(Dr,{dirty:w.dirty,busy:w.busy,parseError:E,lastSavedAt:w.lastSavedAt,onSave:async()=>{L(null);const D=await d(i);D.ok||L(D.error??"save failed")},onRevert:()=>{L(null),o(i)}}):null,children:u.jsx(Bn,{sidebar:u.jsxs("div",{className:"py-1",children:[u.jsx("div",{className:"px-2 pb-1",children:u.jsx("input",{value:h,onChange:D=>_(D.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),["skills","commands"].map(D=>{const H=h.toLowerCase(),U=O.filter(W=>W.kind===D&&(!H||W.name.toLowerCase().includes(H)));return u.jsxs("div",{className:"mb-3",children:[u.jsx("div",{className:"px-3 py-1 text-xs uppercase tracking-wider text-fg-faint",children:D==="skills"?"Skills":"Slash Commands"}),U.length===0?u.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"none"}):U.map(W=>{var I;return u.jsxs("button",{onClick:()=>c(W.path),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${i===W.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[u.jsxs("span",{className:"truncate",children:[W.kind==="commands"?"/":"",W.name]}),((I=C[W.path])==null?void 0:I.dirty)&&u.jsx("span",{className:"w-1 h-1 rounded-full bg-accent shrink-0 ml-2"})]},W.path)})]},D)})]}),detail:i&&w?u.jsx("div",{className:"h-full",children:u.jsx(tl,{path:i,value:w.draftRaw,onChange:D=>{L(null),n(i,D)}})}):u.jsx(xe,{title:O.length===0?"no skills or commands":"select an item"})})})}function il({columns:l,rows:m,getKey:p,onRowClick:k,activeKey:P,empty:O}){return m.length===0?u.jsx("div",{className:"p-6 text-fg-faint text-xs text-center",children:O??"no entries"}):u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{className:"sticky top-0 bg-bg-elev text-fg-faint uppercase tracking-wider",children:u.jsx("tr",{className:"border-b border-line",children:l.map(R=>u.jsx("th",{className:`text-left font-normal px-3 py-1.5 ${R.className??""}`,style:R.width?{width:R.width}:void 0,children:R.header},R.key))})}),u.jsx("tbody",{children:m.map(R=>{const i=p(R),c=P===i;return u.jsx("tr",{onClick:()=>k==null?void 0:k(R),className:`border-b border-line/50 transition-colors ${k?"cursor-pointer":""} ${c?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg-hi/50"}`,children:l.map(g=>u.jsx("td",{className:`px-3 py-1 ${g.className??""}`,children:g.render(R)},g.key))},i)})})]})}function qg(){const l=Ke(),[m,p]=J.useState([]),[k,P]=J.useState(!0),[O,R]=J.useState(null),[i,c]=J.useState("installed");J.useEffect(()=>{if(!l)return;let y=!1;return(async()=>{P(!0);const h=await window.api.config.listDir(`${l}/.claude/plugins`,{dirsOnly:!0});if(y)return;const _=[];for(const x of h.entries){const C=await window.api.config.exists(`${x.path}/plugin.json`);_.push({name:x.name,path:x.path,mtimeMs:x.mtimeMs,hasManifest:C})}_.sort((x,C)=>x.name.localeCompare(C.name)),y||(p(_),P(!1))})(),()=>{y=!0}},[l]);const g=[{key:"name",header:"name",render:y=>y.name,width:"12rem"},{key:"manifest",header:"manifest",render:y=>y.hasManifest?"plugin.json":u.jsx("span",{className:"text-fg-faint",children:"—"}),width:"8rem"},{key:"path",header:"path",render:y=>u.jsx("span",{className:"font-mono text-fg-faint truncate",children:y.path})}];return i==="library"?u.jsx(Pe,{toolbar:u.jsx(Gt,{active:i,onChange:c}),children:u.jsx(kg,{})}):u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Gt,{active:i,onChange:c}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsxs("span",{className:"text-fg-faint",children:[m.length," plugins"]}),u.jsx("div",{className:"flex-1"}),u.jsx("span",{className:"text-fg-faint font-mono truncate",children:"~/.claude/plugins/"})]}),children:k?u.jsx(xe,{title:"scanning plugins…"}):u.jsx(il,{columns:g,rows:m,getKey:y=>y.path,activeKey:O,onRowClick:y=>R(y.path),empty:u.jsxs(u.Fragment,{children:["no plugins installed",u.jsxs("div",{className:"mt-2 text-fg-faint",children:["drop a plugin into ",u.jsx("code",{children:"~/.claude/plugins/"})]})]})})})}function Kg(l,m,p){return l==="user"?`${m}/.claude.json`:p?`${p}/.mcp.json`:null}function Gg(l){if(l.trim()==="")return{full:{},servers:{},err:null};try{const m=JSON.parse(l),p=m.mcpServers??{};return{full:m,servers:p,err:null}}catch(m){return{full:{},servers:{},err:m.message}}}function Jg(l,m){return JSON.stringify({...l,mcpServers:m},null,2)+`
|
|
118
|
-
`}function Qg(){const l=Ke(),m=Pr(),p=(m==null?void 0:m.cwd)??null,[k,P]=J.useState("user"),[O,R]=J.useState(null),[i,c]=J.useState("installed"),[g,y]=J.useState(""),h=J.useMemo(()=>l?Kg(k,l,p):null,[l,k,p]),_=ye(z=>z.files),x=ye(z=>z.loadJson),C=ye(z=>z.setDraft),v=ye(z=>z.saveJson),n=ye(z=>z.revert),d=ye(z=>z.watchFile),o=ye(z=>z.unwatchFile);J.useEffect(()=>{if(h)return _[h]||x(h),d(h),()=>o(h)},[h]);const[a,S]=J.useState(null);if(!l)return u.jsx(xe,{title:"loading…"});if(i==="library")return u.jsx(Pe,{toolbar:u.jsx(Gt,{active:i,onChange:c}),children:u.jsx(bg,{})});if(k==="project"&&!p)return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Gt,{active:i,onChange:c}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Jt,{scopes:["user","project"],active:k,onChange:P})]}),children:u.jsx(xe,{title:"no active project"})});if(!h)return u.jsx(xe,{title:"loading…"});const E=_[h],{full:L,servers:j,err:w}=E?Gg(E.draftRaw):{full:{},servers:{},err:null},D=Object.keys(j).sort(),H=O?j[O]:null,U=z=>{S(null),C(h,Jg(L,z))},W=()=>{const z=`server-${Object.keys(j).length+1}`;U({...j,[z]:{type:"stdio",command:"",args:[]}}),R(z)},I=z=>{const re={...j};delete re[z],U(re),O===z&&R(null)},Q=(z,re)=>{if(!re||re===z||j[re])return;const X={};for(const A of Object.keys(j))X[A===z?re:A]=j[A];U(X),R(re)},q=(z,re)=>{U({...j,[z]:re})};return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Gt,{active:i,onChange:c}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Jt,{scopes:["user","project"],active:k,onChange:P}),u.jsx("span",{className:"ml-3 text-fg-faint truncate",children:h}),u.jsx("div",{className:"flex-1"}),u.jsx("button",{onClick:W,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+ new server"})]}),footer:E?u.jsx(Dr,{dirty:E.dirty,busy:E.busy,parseError:a||w||E.parseError,lastSavedAt:E.lastSavedAt,onSave:async()=>{S(null);const z=await v(h);z.ok||S(z.error??"save failed")},onRevert:()=>{S(null),n(h)}}):null,children:u.jsx(Bn,{sidebar:u.jsxs("div",{className:"py-2",children:[u.jsx("div",{className:"px-2 pb-1",children:u.jsx("input",{value:g,onChange:z=>y(z.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),D.length===0?u.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no servers"}):D.filter(z=>!g||z.toLowerCase().includes(g.toLowerCase())).map(z=>u.jsxs("button",{onClick:()=>R(z),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${O===z?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[u.jsx("span",{className:"truncate",children:z}),u.jsx("span",{className:"text-fg-faint ml-2 shrink-0",children:j[z].type??"stdio"})]},z))]}),detail:O&&H?u.jsx(Xg,{name:O,server:H,onRename:z=>Q(O,z),onChange:z=>q(O,z),onRemove:()=>I(O)}):u.jsx(xe,{title:"select a server or click + new"})})})}function Xg({name:l,server:m,onRename:p,onChange:k,onRemove:P}){const O=m.type??"stdio";return u.jsxs("div",{className:"p-4 space-y-4 max-w-2xl",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("label",{className:"text-xs text-fg-faint w-20",children:"name"}),u.jsx("input",{defaultValue:l,onBlur:R=>p(R.target.value.trim()),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"}),u.jsx("button",{onClick:P,className:"text-xs text-fg-faint hover:text-red-400 px-2 py-1 border border-line rounded",children:"delete"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("label",{className:"text-xs text-fg-faint w-20",children:"type"}),u.jsxs("select",{value:O,onChange:R=>k({...m,type:R.target.value}),className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg",children:[u.jsx("option",{value:"stdio",children:"stdio"}),u.jsx("option",{value:"http",children:"http"}),u.jsx("option",{value:"sse",children:"sse"})]})]}),O==="stdio"?u.jsxs(u.Fragment,{children:[u.jsx(Va,{label:"command",value:m.command??"",onChange:R=>k({...m,command:R}),placeholder:"npx / node / python …"}),u.jsx(Va,{label:"args",value:(m.args??[]).join(" "),onChange:R=>k({...m,args:R.split(/\s+/).filter(Boolean)}),placeholder:"space-separated args"}),u.jsx(Sd,{label:"env",value:m.env??{},onChange:R=>k({...m,env:R})})]}):u.jsxs(u.Fragment,{children:[u.jsx(Va,{label:"url",value:m.url??"",onChange:R=>k({...m,url:R}),placeholder:"https://…"}),u.jsx(Sd,{label:"headers",value:m.headers??{},onChange:R=>k({...m,headers:R})})]})]})}function Va({label:l,value:m,onChange:p,placeholder:k}){return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("label",{className:"text-xs text-fg-faint w-20",children:l}),u.jsx("input",{value:m,onChange:P=>p(P.target.value),placeholder:k,className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"})]})}function Sd({label:l,value:m,onChange:p}){const[k,P]=J.useState(""),[O,R]=J.useState(""),i=Object.entries(m);return u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("label",{className:"text-xs text-fg-faint w-20 pt-1",children:l}),u.jsxs("div",{className:"flex-1 space-y-1",children:[i.map(([c,g])=>u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{value:c,onChange:y=>{const h={...m};delete h[c],h[y.target.value]=g,p(h)},className:"w-32 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),u.jsx("input",{value:g,onChange:y=>p({...m,[c]:y.target.value}),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),u.jsx("button",{onClick:()=>{const y={...m};delete y[c],p(y)},className:"text-fg-faint hover:text-red-400 text-xs px-1",children:"×"})]},c)),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{value:k,onChange:c=>P(c.target.value),placeholder:"key",className:"w-32 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim font-mono"}),u.jsx("input",{value:O,onChange:c=>R(c.target.value),placeholder:"value",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim font-mono"}),u.jsx("button",{onClick:()=>{k.trim()&&(p({...m,[k.trim()]:O}),P(""),R(""))},className:"px-2 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+"})]})]})]})}const Yg=["PreToolUse","PostToolUse","UserPromptSubmit","Notification","Stop","SubagentStop","SessionStart","SessionEnd","PreCompact","PostCompact","PreBash","PostBash","PreEdit","PostEdit","PreRead","PostRead","PreWrite","PostWrite","PreGlob","PreGrep","PreTaskCreate","PreTaskUpdate","PreWebFetch","PreWebSearch","PreMcpToolUse","PostMcpToolUse"],Zg=["command","http","prompt","agent"];function ev(l){if(l.trim()==="")return{full:{},hooks:{},err:null};try{const m=JSON.parse(l);return{full:m,hooks:m.hooks??{},err:null}}catch(m){return{full:{},hooks:{},err:m.message}}}function tv(l,m){return JSON.stringify({...l,hooks:m},null,2)+`
|
|
119
|
-
`}function rv(l,m){return(l[m]??[]).reduce((p,k)=>{var P;return p+(((P=k.hooks)==null?void 0:P.length)??0)},0)}function sv(){const l=Ke(),m=Pr(),p=(m==null?void 0:m.cwd)??null,[k,P]=J.useState("user"),[O,R]=J.useState("PreToolUse"),[i,c]=J.useState("effective"),g=J.useMemo(()=>{const z={};for(const re of Cs.scopes){const X=Cs.resolve(re,l??"",p);X&&(z[re]=X)}return z},[l,p]),y=g[k]??null,h=ye(z=>z.files),_=ye(z=>z.loadJson),x=ye(z=>z.setDraft),C=ye(z=>z.saveJson),v=ye(z=>z.revert),n=ye(z=>z.watchFile),d=ye(z=>z.unwatchFile);J.useEffect(()=>{const z=Object.values(g).filter(Boolean);return z.forEach(re=>{h[re]||_(re),n(re)}),()=>z.forEach(re=>d(re))},[JSON.stringify(g)]);const[o,a]=J.useState(null),S=u.jsx(Xa,{options:[{key:"effective",label:"Effective"},{key:"events",label:"Events"},{key:"library",label:"Library"}],active:i,onChange:c}),E=J.useMemo(()=>{const z=Ya(el(h,g));return Za(z,["hooks"])??{kind:"object",children:{}}},[h,g]),L=(z,re)=>{var ee;const X=g[k];if(!X)return;a(null);const A=((ee=h[X])==null?void 0:ee.draftRaw)??"";let B={};if(A.trim())try{B=JSON.parse(A)}catch{B={}}const T=Nn(B.hooks??{},z,re),F={...B,hooks:T};x(X,JSON.stringify(F,null,2)+`
|
|
120
|
-
`)};if(!l)return u.jsx(xe,{title:"loading…"});if(i==="library")return u.jsx(Pe,{toolbar:S,children:u.jsx(Lg,{})});if(k!=="user"&&!p)return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[S,u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Jt,{scopes:["user","project","local"],active:k,onChange:P})]}),children:u.jsx(xe,{title:"no active project"})});if(!y)return u.jsx(xe,{title:"loading…"});const j=h[y],{full:w,hooks:D,err:H}=j?ev(j.draftRaw):{full:{},hooks:{},err:null},U=z=>{a(null),x(y,tv(w,z))},W=D[O]??[],I=()=>{U({...D,[O]:[...W,{matcher:"",hooks:[{type:"command",command:""}]}]})},Q=(z,re)=>{const X=W.slice();X[z]=re,U({...D,[O]:X})},q=z=>{U({...D,[O]:W.filter((re,X)=>X!==z)})};return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[S,u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Jt,{scopes:["user","project","local"],active:k,onChange:P}),u.jsx("span",{className:"ml-3 text-fg-faint truncate",children:i==="effective"?`overrides → ${y}`:y}),u.jsx("div",{className:"flex-1"}),u.jsx("a",{href:"https://code.claude.com/docs/en/hooks",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"hook reference ↗"})]}),footer:j?u.jsx(Dr,{dirty:j.dirty,busy:j.busy,parseError:o||H||j.parseError,lastSavedAt:j.lastSavedAt,onSave:async()=>{a(null);const z=await C(y);z.ok||a(z.error??"save failed")},onRevert:()=>{a(null),v(y)}}):null,children:i==="effective"?u.jsx(Qa,{node:E,targetScope:k,onOverride:L,schema:Mn().rootedAt(["hooks"]),rootLabel:"hooks"}):u.jsx(Bn,{sidebarWidth:"14rem",sidebar:u.jsx("div",{className:"py-1",children:Yg.map(z=>{const re=rv(D,z);return u.jsxs("button",{onClick:()=>R(z),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${O===z?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[u.jsx("span",{className:"truncate",children:z}),re>0&&u.jsx("span",{className:"text-accent shrink-0 ml-2",children:re})]},z)})}),detail:u.jsxs("div",{className:"p-4 space-y-3 max-w-3xl",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg",children:O}),u.jsx("button",{onClick:I,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+ add group"})]}),W.length===0?u.jsx("div",{className:"text-fg-faint text-xs",children:"no hooks for this event"}):W.map((z,re)=>u.jsx(iv,{group:z,onChange:X=>Q(re,X),onRemove:()=>q(re)},re))]})})})}function iv({group:l,onChange:m,onRemove:p}){const k=()=>m({...l,hooks:[...l.hooks??[],{type:"command",command:""}]}),P=(R,i)=>{const c=l.hooks.slice();c[R]=i,m({...l,hooks:c})},O=R=>m({...l,hooks:l.hooks.filter((i,c)=>c!==R)});return u.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-xs text-fg-faint w-16",children:"matcher"}),u.jsx("input",{value:l.matcher??"",onChange:R=>m({...l,matcher:R.target.value}),placeholder:"tool name regex or exact match (optional)",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),u.jsx("button",{onClick:p,className:"text-fg-faint hover:text-red-400 text-xs",title:"remove group",children:"× group"})]}),(l.hooks??[]).map((R,i)=>u.jsx(nv,{rule:R,onChange:c=>P(i,c),onRemove:()=>O(i)},i)),u.jsx("button",{onClick:k,className:"text-xs text-fg-faint hover:text-fg",children:"+ add hook"})]})}function nv({rule:l,onChange:m,onRemove:p}){const k=R=>({command:"e.g. node ./scripts/lint.js $FILE",http:"e.g. https://hooks.example.com/notify",prompt:"e.g. Review this change for security issues",agent:"e.g. security-reviewer"})[R],P=l.type==="command"?"command":l.type==="http"?"url":l.type==="prompt"?"prompt":"agent",O=l[P]??"";return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("select",{value:l.type,onChange:R=>m({type:R.target.value}),className:"bg-bg border border-line rounded px-1 py-0.5 text-xs text-fg",children:Zg.map(R=>u.jsx("option",{value:R,children:R},R))}),u.jsx("input",{value:O,onChange:R=>m({...l,[P]:R.target.value}),placeholder:k(l.type),className:`flex-1 bg-bg border rounded px-2 py-0.5 text-xs text-fg font-mono ${O.trim()?"border-line":"border-yellow-600/50"}`}),u.jsx("input",{value:l.timeout??"",onChange:R=>m({...l,timeout:R.target.value?Number(R.target.value):void 0}),placeholder:"timeout ms",className:"w-20 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),u.jsx("button",{onClick:p,className:"text-fg-faint hover:text-red-400 text-xs",children:"×"})]})}function ov(l,m,p){return{tabId:l,sessionUuid:p,cwd:m,path:null,todos:[],lastToolUses:[],plans:[],agents:[],usage:{inputTokens:0,outputTokens:0}}}const Pt=Ja((l,m)=>({tabs:{},refs:{},unsubs:{},subscribe:(p,k,P)=>{const O={...m().refs};if(O[p]=(O[p]??0)+1,l({refs:O}),O[p]>1)return;l({tabs:{...m().tabs,[p]:ov(p,k,P)}});const R=window.api.transcripts.onEvent(p,i=>m().ingest(p,i));l({unsubs:{...m().unsubs,[p]:R}}),window.api.transcripts.subscribe({tabId:p,cwd:k,sessionUuid:P}).then(async i=>{const c=m().tabs[p];if(!c)return;l({tabs:{...m().tabs,[p]:{...c,path:i.path}}});const g=await window.api.transcripts.buffer(p);for(const y of g)m().ingest(p,y)}).catch(i=>console.error("[live] transcripts.subscribe failed:",p,i))},unsubscribe:p=>{const k={...m().refs};if(!k[p])return;if(k[p]--,k[p]>0){l({refs:k});return}delete k[p];const P=m().unsubs[p];P==null||P();const O={...m().unsubs};delete O[p];const R={...m().tabs};delete R[p],window.api.transcripts.unsubscribe(p),l({refs:k,unsubs:O,tabs:R})},ingest:(p,k)=>{const P=m().tabs[p];if(!P)return;const O={...P};switch(k.kind){case"todo_write":{const R=Array.isArray(k.data)?k.data:[];O.todos=R;break}case"tool_use":{const R=k.data;O.lastToolUses=[{id:R.id,name:R.name,input:R.input,at:Date.now()},...P.lastToolUses].slice(0,50);break}case"plan":{const R=k.data,i=typeof R=="string"?R:(R==null?void 0:R.plan)??JSON.stringify(R);O.plans=[{at:Date.now(),content:i??""},...P.plans].slice(0,20);break}case"agent_spawn":{const R=k.data;O.agents=[{at:Date.now(),subagentType:R==null?void 0:R.subagent_type,description:R==null?void 0:R.description},...P.agents].slice(0,50);break}case"usage":{const R=k.data;O.usage={inputTokens:(P.usage.inputTokens||0)+(R.input_tokens??R.inputTokens??0),outputTokens:(P.usage.outputTokens||0)+(R.output_tokens??R.outputTokens??0),cacheCreationInputTokens:(P.usage.cacheCreationInputTokens||0)+(R.cache_creation_input_tokens??R.cacheCreationInputTokens??0),cacheReadInputTokens:(P.usage.cacheReadInputTokens||0)+(R.cache_read_input_tokens??R.cacheReadInputTokens??0)};break}default:return}l({tabs:{...m().tabs,[p]:O}})}}));function av(l,m,p){return p==="user"?`${l}/.claude/agents`:m?`${m}/.claude/agents`:null}function lv(){const l=Ke(),m=Pr(),p=(m==null?void 0:m.cwd)??null,[k,P]=J.useState("user"),[O,R]=J.useState([]),[i,c]=J.useState(null),[g,y]=J.useState("configured"),[h,_]=J.useState(""),x=J.useMemo(()=>l?av(l,p,k):null,[l,p,k]);J.useEffect(()=>{if(!x){R([]);return}let U=!1;return(async()=>{var W;try{const I=await window.api.config.listDir(x,{filesOnly:!0});if(U)return;const Q=I.entries.filter(q=>q.name.endsWith(".md")).map(q=>({scope:k,name:q.name.replace(/\.md$/,""),path:q.path})).sort((q,z)=>q.name.localeCompare(z.name));R(Q),Q.find(q=>q.path===i)||c(((W=Q[0])==null?void 0:W.path)??null)}catch(I){console.error("[Subagents] listDir failed:",x,I),U||R([])}})(),()=>{U=!0}},[x]);const C=ye(U=>U.files),v=ye(U=>U.loadText),n=ye(U=>U.setDraft),d=ye(U=>U.saveText),o=ye(U=>U.revert),a=ye(U=>U.watchFile),S=ye(U=>U.unwatchFile);J.useEffect(()=>{if(i)return C[i]||v(i),a(i),()=>S(i)},[i]);const E=Pt(U=>U.subscribe),L=Pt(U=>U.unsubscribe),j=Pt(U=>U.tabs);J.useEffect(()=>{if(!(g!=="live"||!m))return E(m.id,m.cwd,m.claudeSessionId),()=>L(m.id)},[g,m,E,L]);const[w,D]=J.useState(null);if(!l)return u.jsx(xe,{title:"loading…"});const H=i?C[i]:null;return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:["configured","live","library"].map(U=>u.jsx("button",{onClick:()=>y(U),className:`px-2.5 py-1 text-xs ${g===U?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:U},U))}),g==="configured"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"ml-2",children:u.jsx(Jt,{scopes:["user","project"],active:k,onChange:P})}),u.jsxs("span",{className:"ml-3 text-fg-faint",children:[O.length," agents"]})]}),u.jsx("div",{className:"flex-1"})]}),footer:g==="configured"&&i&&H?u.jsx(Dr,{dirty:H.dirty,busy:H.busy,parseError:w,lastSavedAt:H.lastSavedAt,onSave:async()=>{D(null);const U=await d(i);U.ok||D(U.error??"save failed")},onRevert:()=>{D(null),o(i)}}):null,children:g==="library"?u.jsx(Rg,{}):g==="configured"?k==="project"&&!p?u.jsx(xe,{title:"no active project"}):u.jsx(Bn,{sidebar:u.jsxs("div",{className:"py-2",children:[u.jsx("div",{className:"px-2 pb-1",children:u.jsx("input",{value:h,onChange:U=>_(U.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),O.length===0?u.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no agents defined"}):O.filter(U=>!h||U.name.toLowerCase().includes(h.toLowerCase())).map(U=>u.jsx("button",{onClick:()=>c(U.path),className:`w-full text-left px-3 py-1 text-xs ${i===U.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:U.name},U.path))]}),detail:i&&H?u.jsx(tl,{path:i,value:H.draftRaw,onChange:U=>{D(null),n(i,U)}}):u.jsx(xe,{title:"select an agent"})}):m?u.jsx(cv,{tabId:m.id,live:j[m.id]}):u.jsx(xe,{title:"no active session",hint:"open a terminal tab to watch live subagents"})})}function cv({tabId:l,live:m}){return m?m.agents.length===0?u.jsx(xe,{title:"no subagent spawns observed yet",hint:"this updates in real-time"}):u.jsx("div",{className:"p-4 space-y-2 max-w-3xl",children:m.agents.map((p,k)=>u.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsx("span",{className:"text-xs font-medium text-fg",children:p.subagentType??"general-purpose"}),u.jsx("span",{className:"text-xs text-fg-faint",children:new Date(p.at).toLocaleTimeString()})]}),p.description&&u.jsx("div",{className:"text-xs text-fg-dim",children:p.description})]},k))}):u.jsx(xe,{title:`waiting for transcript (tab ${l.slice(0,8)})`})}function uv(){const l=Pr(),m=Pt(O=>O.subscribe),p=Pt(O=>O.unsubscribe),k=Pt(O=>l?O.tabs[l.id]:void 0);if(J.useEffect(()=>{if(l)return m(l.id,l.cwd,l.claudeSessionId),()=>p(l.id)},[l,m,p]),!l)return u.jsx(Pe,{children:u.jsx(xe,{title:"no active session"})});const P=(k==null?void 0:k.plans)??[];return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-fg-faint",children:["session ",l.claudeSessionId.slice(0,8)]}),u.jsx("div",{className:"flex-1"}),u.jsxs("span",{className:"text-fg-faint",children:[P.length," plans"]})]}),children:P.length===0?u.jsx(xe,{title:"no plans captured",hint:"plans appear when claude uses ExitPlanMode"}):u.jsx("div",{className:"p-4 space-y-4 max-w-4xl",children:P.map((O,R)=>u.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[u.jsx("div",{className:"text-xs text-fg-faint mb-2",children:new Date(O.at).toLocaleString()}),u.jsx("pre",{className:"text-xs text-fg-dim whitespace-pre-wrap font-mono",children:O.content})]},R))})})}function dv(){const l=Pr(),m=Pt(R=>R.subscribe),p=Pt(R=>R.unsubscribe),k=Pt(R=>l?R.tabs[l.id]:void 0);if(J.useEffect(()=>{if(l)return m(l.id,l.cwd,l.claudeSessionId),()=>p(l.id)},[l,m,p]),!l)return u.jsx(Pe,{children:u.jsx(xe,{title:"no active session",hint:"open a terminal tab and run claude to see tasks"})});const P=(k==null?void 0:k.todos)??[],O={completed:P.filter(R=>R.status==="completed").length,in_progress:P.filter(R=>R.status==="in_progress").length,pending:P.filter(R=>R.status==="pending").length};return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-fg-faint",children:["session ",l.claudeSessionId.slice(0,8)]}),u.jsx("div",{className:"flex-1"}),u.jsxs("span",{className:"text-fg-faint",children:[u.jsx("span",{className:"text-green-400",children:O.completed})," done ·"," ",u.jsx("span",{className:"text-accent",children:O.in_progress})," active ·"," ",u.jsx("span",{className:"text-fg-dim",children:O.pending})," pending"]})]}),children:P.length===0?u.jsx(xe,{title:"no todos yet",hint:"todos appear when claude calls TodoWrite"}):u.jsx("ul",{className:"p-4 space-y-1 max-w-3xl",children:P.map((R,i)=>u.jsxs("li",{className:`flex items-start gap-3 py-1.5 px-2 rounded text-xs ${R.status==="in_progress"?"bg-bg-elev":""}`,children:[u.jsx(hv,{status:R.status}),u.jsx("span",{className:`flex-1 ${R.status==="completed"?"text-fg-faint line-through":R.status==="in_progress"?"text-fg":"text-fg-dim"}`,children:R.status==="in_progress"&&R.activeForm?R.activeForm:R.content})]},i))})})}function hv({status:l}){return l==="completed"?u.jsx("span",{className:"text-green-400 w-4 shrink-0",children:"✓"}):l==="in_progress"?u.jsx("span",{className:"text-accent w-4 shrink-0",children:u.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-accent animate-pulse"})}):u.jsx("span",{className:"text-fg-faint w-4 shrink-0",children:"○"})}function fv(l){return l.replace(/-/g,"/")}async function pv(l){const p=(await window.api.config.listDir(l,{filesOnly:!0})).entries.filter(k=>k.name.endsWith(".jsonl")).sort((k,P)=>k.size-P.size);for(const k of p){const P=await window.api.config.readText(k.path);if(!(!P.exists||!P.text)){for(const O of P.text.split(`
|
|
121
|
-
`))if(O.includes('"cwd"'))try{const R=JSON.parse(O);if(typeof R.cwd=="string"&&R.cwd.length>0)return R.cwd}catch{}}}return null}function mv(){const l=Ke(),[m,p]=J.useState([]),[k,P]=J.useState(!0),O=je(c=>c.addTab);J.useEffect(()=>{if(!l)return;let c=!1;return(async()=>{P(!0);try{const g=await window.api.config.listDir(`${l}/.claude/projects`,{dirsOnly:!0});if(c)return;const y=[];for(const h of g.entries){if(c)return;const x=(await window.api.config.listDir(h.path,{filesOnly:!0})).entries.filter(v=>v.name.endsWith(".jsonl")),C=x.reduce((v,n)=>Math.max(v,n.mtimeMs),0);y.push({encoded:h.name,displayPath:fv(h.name),sessionCount:x.length,lastSession:C,path:h.path})}y.sort((h,_)=>_.lastSession-h.lastSession),c||p(y)}catch(g){console.error("[Projects] scan failed:",g)}finally{c||P(!1)}})(),()=>{c=!0}},[l]);const R=async c=>{let g=await pv(c.path);if(!g&&(g=await window.api.app.pickDirectory(),!g))return;const y=crypto.randomUUID();O({id:y,cwd:g,startupCommand:`claude --dangerously-skip-permissions --session-id ${Ht(y)}`,presetId:"projects-tab"})},i=[{key:"path",header:"project",render:c=>u.jsxs("span",{className:"font-mono text-fg-dim truncate",children:["/",c.displayPath]})},{key:"count",header:"sessions",render:c=>c.sessionCount,width:"6rem"},{key:"last",header:"last active",render:c=>c.lastSession?new Date(c.lastSession).toLocaleString():"—",width:"12rem"},{key:"action",header:"",render:c=>u.jsx("button",{onClick:g=>{g.stopPropagation(),R(c)},className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"open"}),width:"4rem"}];return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-fg-faint",children:[m.length," projects"]}),u.jsx("div",{className:"flex-1"}),u.jsx("span",{className:"text-fg-faint font-mono truncate",children:"~/.claude/projects/"})]}),children:k?u.jsx(xe,{title:"scanning projects…"}):u.jsx(il,{columns:i,rows:m,getKey:c=>c.encoded,empty:"no projects with claude session history"})})}function gv(){const l=Ke(),[m,p]=J.useState([]),[k,P]=J.useState(!0),[O,R]=J.useState(""),i=je(h=>h.addTab);J.useEffect(()=>{if(!l)return;let h=!1;return(async()=>{P(!0);try{const _=await window.api.config.listDir(`${l}/.claude/projects`,{dirsOnly:!0}),x=[];for(const C of _.entries){if(h)return;const v=await window.api.config.listDir(C.path,{filesOnly:!0});for(const n of v.entries)n.name.endsWith(".jsonl")&&x.push({sessionId:n.name.replace(/\.jsonl$/,""),projectEncoded:C.name,path:n.path,mtimeMs:n.mtimeMs,sizeBytes:n.size})}x.sort((C,v)=>v.mtimeMs-C.mtimeMs),h||p(x)}catch(_){console.error("[History] scan failed:",_)}finally{h||P(!1)}})(),()=>{h=!0}},[l]);const c=J.useMemo(()=>{if(!O.trim())return m;const h=O.toLowerCase();return m.filter(_=>_.sessionId.toLowerCase().includes(h)||_.projectEncoded.toLowerCase().includes(h))},[m,O]),g=async h=>{const _=await window.api.app.pickDirectory();_&&i({cwd:_,startupCommand:`claude --resume ${Ht(h.sessionId)}`,presetId:"history-resume"})},y=[{key:"id",header:"session",render:h=>u.jsx("span",{className:"font-mono text-fg-dim",children:h.sessionId.slice(0,8)}),width:"7rem"},{key:"proj",header:"project",render:h=>u.jsxs("span",{className:"font-mono text-fg-faint truncate",children:["/",h.projectEncoded.replace(/-/g,"/")]})},{key:"size",header:"size",render:h=>`${Math.round(h.sizeBytes/1024)}k`,width:"5rem"},{key:"when",header:"when",render:h=>new Date(h.mtimeMs).toLocaleString(),width:"12rem"},{key:"action",header:"",render:h=>u.jsx("button",{onClick:_=>{_.stopPropagation(),g(h)},className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"resume"}),width:"5rem"}];return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx("input",{value:O,onChange:h=>R(h.target.value),placeholder:"filter by id or project",className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint w-64"}),u.jsxs("span",{className:"ml-2 text-fg-faint",children:[c.length,"/",m.length]}),u.jsx("div",{className:"flex-1"})]}),children:k?u.jsx(xe,{title:"scanning transcripts…"}):u.jsx(il,{columns:y,rows:c,getKey:h=>h.path,empty:"no session transcripts found"})})}const wd={"opus-4.6":{input:5,output:25},"sonnet-4.6":{input:3,output:15},"haiku-4.5":{input:1,output:5}};function vv(){const l=Pr(),m=Pt(_=>_.subscribe),p=Pt(_=>_.unsubscribe),k=Pt(_=>l?_.tabs[l.id]:void 0),[P,O]=J.useState("opus-4.6"),[R,i]=J.useState(()=>{try{const _=localStorage.getItem("sm:pricing");if(_)return{...wd,...JSON.parse(_)}}catch{}return wd}),c=_=>{i(_);try{localStorage.setItem("sm:pricing",JSON.stringify(_))}catch{}};if(J.useEffect(()=>{if(l)return m(l.id,l.cwd,l.claudeSessionId),()=>p(l.id)},[l,m,p]),!l)return u.jsx(Pe,{children:u.jsx(xe,{title:"no active session"})});const g=(k==null?void 0:k.usage)??{inputTokens:0,outputTokens:0},y=R[P],h=g.inputTokens*y.input/1e6+g.outputTokens*y.output/1e6;return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-fg-faint",children:["session ",l.claudeSessionId.slice(0,8)]}),u.jsx("div",{className:"flex-1"}),u.jsxs("label",{className:"text-fg-faint flex items-center gap-2",children:["model",u.jsx("select",{value:P,onChange:_=>O(_.target.value),className:"bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg",children:Object.keys(R).map(_=>u.jsx("option",{value:_,children:_},_))})]})]}),children:u.jsxs("div",{className:"p-6 max-w-2xl space-y-6",children:[u.jsxs("section",{className:"grid grid-cols-2 gap-4",children:[u.jsx(di,{label:"input tokens",value:g.inputTokens.toLocaleString()}),u.jsx(di,{label:"output tokens",value:g.outputTokens.toLocaleString()}),g.cacheCreationInputTokens!=null&&u.jsx(di,{label:"cache creation",value:g.cacheCreationInputTokens.toLocaleString()}),g.cacheReadInputTokens!=null&&u.jsx(di,{label:"cache read",value:g.cacheReadInputTokens.toLocaleString()}),u.jsx(di,{label:"estimated cost",value:`$${h.toFixed(4)}`,highlight:!0})]}),u.jsxs("section",{children:[u.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg mb-2",children:"Pricing ($/MTok)"}),u.jsxs("table",{className:"text-xs",children:[u.jsx("thead",{className:"text-fg-faint",children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left px-2 py-1",children:"model"}),u.jsx("th",{className:"text-left px-2 py-1",children:"input"}),u.jsx("th",{className:"text-left px-2 py-1",children:"output"})]})}),u.jsx("tbody",{children:Object.entries(R).map(([_,x])=>u.jsxs("tr",{className:"border-t border-line",children:[u.jsx("td",{className:"px-2 py-1 text-fg-dim",children:_}),u.jsx("td",{className:"px-2 py-1",children:u.jsx("input",{type:"number",step:"0.1",value:x.input,onChange:C=>c({...R,[_]:{...x,input:Number(C.target.value)}}),className:"w-16 bg-bg-elev border border-line rounded px-1 py-0.5 text-fg"})}),u.jsx("td",{className:"px-2 py-1",children:u.jsx("input",{type:"number",step:"0.1",value:x.output,onChange:C=>c({...R,[_]:{...x,output:Number(C.target.value)}}),className:"w-16 bg-bg-elev border border-line rounded px-1 py-0.5 text-fg"})})]},_))})]}),u.jsx("div",{className:"mt-2 text-fg-faint text-xs",children:"edits are saved locally and persist across sessions."})]})]})})}function di({label:l,value:m,highlight:p}){return u.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[u.jsx("div",{className:"text-xs text-fg-faint uppercase tracking-wider mb-1",children:l}),u.jsx("div",{className:`text-lg font-mono ${p?"text-accent":"text-fg"}`,children:m})]})}class _v extends J.Component{constructor(){super(...arguments);Ra(this,"state",{error:null});Ra(this,"reset",()=>this.setState({error:null}))}static getDerivedStateFromError(p){return{error:p}}componentDidCatch(p,k){console.error("[ErrorBoundary]",p,k)}render(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.reset):u.jsxs("div",{className:"p-6 text-xs",children:[u.jsx("div",{className:"text-red-400 mb-2",children:"something broke in this panel"}),u.jsx("pre",{className:"text-fg-faint whitespace-pre-wrap mb-3",children:this.state.error.message}),u.jsx("button",{onClick:this.reset,className:"px-2 py-0.5 border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"retry"})]}):this.props.children}}const yv={overview:"Overview",terminal:"Terminal","system-prompt":"System Prompt / Personality",settings:"Settings",permissions:"Permissions",skills:"Skills",plugins:"Plugins",mcp:"MCP Servers",hooks:"Hooks",subagents:"Subagents",plans:"Plans",tasks:"Tasks / Todos",projects:"Projects",history:"History",keybindings:"Keybindings",usage:"Usage"};function Sv(l){switch(l){case"overview":return u.jsx(Sp,{});case"system-prompt":return u.jsx(Mg,{});case"settings":return u.jsx(gg,{});case"permissions":return u.jsx(Hg,{});case"skills":return u.jsx(Vg,{});case"plugins":return u.jsx(qg,{});case"mcp":return u.jsx(Qg,{});case"hooks":return u.jsx(sv,{});case"subagents":return u.jsx(lv,{});case"plans":return u.jsx(uv,{});case"tasks":return u.jsx(dv,{});case"projects":return u.jsx(mv,{});case"history":return u.jsx(gv,{});case"keybindings":return u.jsx(Ng,{});case"usage":return u.jsx(vv,{});default:return null}}function wv({active:l}){const m=je(O=>O.tabs),p=je(O=>O.activeTabId),k=je(O=>O.restartTab),P=m.find(O=>O.id===p)??null;return u.jsxs("main",{className:"flex-1 min-w-0 bg-bg flex flex-col",children:[u.jsxs("header",{className:"h-9 border-b border-line px-4 flex items-center shrink-0",children:[u.jsx("h1",{className:"text-xs text-fg-dim uppercase tracking-wider",children:yv[l]}),P&&u.jsx("span",{className:"ml-4 text-xs text-fg-faint truncate",children:P.cwd}),u.jsx("div",{className:"flex-1"}),P&&l==="terminal"&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:()=>k(P.id),className:"px-2 py-0.5 text-[10px] text-fg-faint hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",title:"Kill claude and start a fresh session in the same directory (picks up config changes)",children:"Restart Session"}),u.jsx("button",{onClick:()=>window.api.app.rebootApp(),className:"px-2 py-0.5 text-[10px] text-fg-faint hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",title:"Kill all sessions, quit the app, and relaunch — all tabs restore automatically",children:"Restart App"})]})]}),u.jsxs("div",{className:"flex-1 min-h-0 relative",children:[u.jsx("div",{className:"absolute inset-0",style:{visibility:l==="terminal"?"visible":"hidden"},children:P?m.map(O=>u.jsx("div",{className:"absolute inset-0",style:{visibility:O.id===p?"visible":"hidden"},children:u.jsx(_p,{tabId:O.id,cwd:O.cwd})},`${O.id}-${O.generation}`)):u.jsx(xv,{})}),l!=="terminal"&&u.jsx("div",{className:"absolute inset-0 bg-bg overflow-auto",children:u.jsx(_v,{children:Sv(l)})})]})]})}function xv(){return u.jsx("div",{className:"h-full flex items-center justify-center text-fg-faint text-xs",children:u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"mb-2",children:"no active session"}),u.jsxs("div",{children:["click ",u.jsx("span",{className:"text-fg-dim",children:"+ new"})," in the tab bar to start one"]})]})})}async function xd(){const l=await window.api.app.pickDirectory();if(!l)return;const m=crypto.randomUUID(),p=`claude --dangerously-skip-permissions --session-id ${Ht(m)}`;je.getState().addTab({id:m,cwd:l,startupCommand:p,presetId:"pick-dangerous"})}function bv(){const[l,m]=J.useState("terminal"),p=J.useCallback(()=>{m("terminal"),xd().catch(k=>console.error("[App] new session failed:",k))},[]);return J.useEffect(()=>{ap().then(()=>{if(je.getState().tabs.length>0)return;const R=Cd[0];np(R).then(i=>{if(!i||je.getState().tabs.length>0)return;const c=crypto.randomUUID(),g=kd(R,{sessionId:c,cwd:i});je.setState(y=>({tabs:[...y.tabs,{id:c,claudeSessionId:c,label:i.split("/").filter(Boolean).pop()||i,cwd:i,pid:null,status:"spawning",exitCode:null,startupCommand:g,presetId:R.id,generation:0}],activeTabId:c}))}).catch(i=>console.warn("[App] failed to create initial tab:",i))});const k=window.api.app.onNewSession(()=>{xd().catch(R=>console.error("[App] new-session from menu failed:",R))}),P=window.api.app.onRebootSession(()=>{const{activeTabId:R}=je.getState();R&&je.getState().restartTab(R)}),O=tg();return Mm([{uri:"https://json.schemastore.org/claude-code-settings.json",fileMatch:["**/settings.json","**/settings.local.json"]},{uri:"https://json.schemastore.org/claude-code-keybindings.json",fileMatch:["**/keybindings.json"]}]).catch(R=>console.warn("[monaco] schema install failed:",R)),()=>{O(),k(),P()}},[]),u.jsxs("div",{className:"h-full w-full flex flex-col bg-bg text-fg text-sm",children:[u.jsx(lp,{}),u.jsxs("div",{className:"flex-1 flex min-h-0",children:[u.jsx(up,{active:l,onChange:m,onNewSession:p}),u.jsx(wv,{active:l})]}),u.jsx(dp,{})]})}window.addEventListener("unhandledrejection",l=>{const m=l.reason instanceof Error?l.reason.stack??l.reason.message:String(l.reason);console.error("[renderer] unhandled rejection:",m)});window.addEventListener("error",l=>{l.error&&console.error("[renderer] uncaught error:",l.error.stack??l.error.message??l.error)});typeof window.api>"u"&&console.error("[renderer] window.api is undefined — preload script failed to load. Check main/index.cjs BrowserWindow webPreferences.preload path.");Yf.createRoot(document.getElementById("root")).render(u.jsx(bv,{}));export{kp as _};
|