claude-code-session-manager 0.2.1 → 0.2.3
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-DbVwjtsF.js → cssMode-CdmadnXw.js} +1 -1
- package/dist/assets/{editor.main-BnrhL2Ub.js → editor.main-B4ZYzZWy.js} +3 -3
- package/dist/assets/{freemarker2-BSEwnssm.js → freemarker2-BVGa0Mxt.js} +1 -1
- package/dist/assets/{handlebars-2A6Ao-MM.js → handlebars-CUZhmknt.js} +1 -1
- package/dist/assets/{html-D5SHl8IM.js → html-B6gDWNcY.js} +1 -1
- package/dist/assets/{htmlMode-BsfbJLaF.js → htmlMode-CD1B3Ebo.js} +1 -1
- package/dist/assets/index-CvEzNZ2z.css +32 -0
- package/dist/assets/index-DX0jNGEB.js +135 -0
- package/dist/assets/{javascript-D7ns9sFV.js → javascript-cFIfxWp6.js} +1 -1
- package/dist/assets/{jsonMode-D8BOjEqQ.js → jsonMode-V8DattiO.js} +1 -1
- package/dist/assets/{liquid-DqFRm1iO.js → liquid-p0pes3Y3.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-DFWVu75j.js → lspLanguageFeatures-Cy_lEGCj.js} +1 -1
- package/dist/assets/{mdx-Brygho1C.js → mdx-DppEA141.js} +1 -1
- package/dist/assets/{python-AViopZds.js → python-C6WPqjoR.js} +1 -1
- package/dist/assets/{razor-DASVnUhs.js → razor-BOjk1pTu.js} +1 -1
- package/dist/assets/{tsMode-C-wV5DBK.js → tsMode-msuFIs2U.js} +1 -1
- package/dist/assets/{typescript-C0eDfVuQ.js → typescript-Bpmb6c9D.js} +1 -1
- package/dist/assets/{xml-EMOZDtWW.js → xml-CLRvkzxn.js} +1 -1
- package/dist/assets/{yaml-BRUujrQC.js → yaml-D09HXPMY.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +2 -1
- package/src/main/index.cjs +104 -6
- package/dist/assets/index-BH5PBjYe.css +0 -32
- package/dist/assets/index-BQcSEEpz.js +0 -122
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editor.main-B4ZYzZWy.js","./editor-BTnBOi8r.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var X_=Object.defineProperty;var J_=(t,s,i)=>s in t?X_(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i;var hc=(t,s,i)=>J_(t,typeof s!="symbol"?s+"":s,i);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const w of d)if(w.type==="childList")for(const g of w.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&o(g)}).observe(document,{childList:!0,subtree:!0});function i(d){const w={};return d.integrity&&(w.integrity=d.integrity),d.referrerPolicy&&(w.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?w.credentials="include":d.crossOrigin==="anonymous"?w.credentials="omit":w.credentials="same-origin",w}function o(d){if(d.ep)return;d.ep=!0;const w=i(d);fetch(d.href,w)}})();function zm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fc={exports:{}},en={},pc={exports:{}},Te={};/**
|
|
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 Wf;function Y_(){if(Wf)return Te;Wf=1;var t=Symbol.for("react.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),g=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),u=Symbol.iterator;function x(M){return M===null||typeof M!="object"?null:(M=u&&M[u]||M["@@iterator"],typeof M=="function"?M:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,S={};function c(M,U,ee){this.props=M,this.context=U,this.refs=S,this.updater=ee||b}c.prototype.isReactComponent={},c.prototype.setState=function(M,U){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,U,"setState")},c.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function y(){}y.prototype=c.prototype;function h(M,U,ee){this.props=M,this.context=U,this.refs=S,this.updater=ee||b}var v=h.prototype=new y;v.constructor=h,E(v,c.prototype),v.isPureReactComponent=!0;var C=Array.isArray,R=Object.prototype.hasOwnProperty,L={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function T(M,U,ee){var ne,ce={},de=null,X=null;if(U!=null)for(ne in U.ref!==void 0&&(X=U.ref),U.key!==void 0&&(de=""+U.key),U)R.call(U,ne)&&!D.hasOwnProperty(ne)&&(ce[ne]=U[ne]);var B=arguments.length-2;if(B===1)ce.children=ee;else if(1<B){for(var ie=Array(B),se=0;se<B;se++)ie[se]=arguments[se+2];ce.children=ie}if(M&&M.defaultProps)for(ne in B=M.defaultProps,B)ce[ne]===void 0&&(ce[ne]=B[ne]);return{$$typeof:t,type:M,key:de,ref:X,props:ce,_owner:L.current}}function A(M,U){return{$$typeof:t,type:M.type,key:U,ref:M.ref,props:M.props,_owner:M._owner}}function I(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function H(M){var U={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(ee){return U[ee]})}var $=/\/+/g;function N(M,U){return typeof M=="object"&&M!==null&&M.key!=null?H(""+M.key):U.toString(36)}function J(M,U,ee,ne,ce){var de=typeof M;(de==="undefined"||de==="boolean")&&(M=null);var X=!1;if(M===null)X=!0;else switch(de){case"string":case"number":X=!0;break;case"object":switch(M.$$typeof){case t:case s:X=!0}}if(X)return X=M,ce=ce(X),M=ne===""?"."+N(X,0):ne,C(ce)?(ee="",M!=null&&(ee=M.replace($,"$&/")+"/"),J(ce,U,ee,"",function(se){return se})):ce!=null&&(I(ce)&&(ce=A(ce,ee+(!ce.key||X&&X.key===ce.key?"":(""+ce.key).replace($,"$&/")+"/")+M)),U.push(ce)),1;if(X=0,ne=ne===""?".":ne+":",C(M))for(var B=0;B<M.length;B++){de=M[B];var ie=ne+N(de,B);X+=J(de,U,ee,ie,ce)}else if(ie=x(M),typeof ie=="function")for(M=ie.call(M),B=0;!(de=M.next()).done;)de=de.value,ie=ne+N(de,B++),X+=J(de,U,ee,ie,ce);else if(de==="object")throw U=String(M),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return X}function K(M,U,ee){if(M==null)return M;var ne=[],ce=0;return J(M,ne,"","",function(de){return U.call(ee,de,ce++)}),ne}function z(M){if(M._status===-1){var U=M._result;U=U(),U.then(function(ee){(M._status===0||M._status===-1)&&(M._status=1,M._result=ee)},function(ee){(M._status===0||M._status===-1)&&(M._status=2,M._result=ee)}),M._status===-1&&(M._status=0,M._result=U)}if(M._status===1)return M._result.default;throw M._result}var re={current:null},G={transition:null},j={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:G,ReactCurrentOwner:L};function F(){throw Error("act(...) is not supported in production builds of React.")}return Te.Children={map:K,forEach:function(M,U,ee){K(M,function(){U.apply(this,arguments)},ee)},count:function(M){var U=0;return K(M,function(){U++}),U},toArray:function(M){return K(M,function(U){return U})||[]},only:function(M){if(!I(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Te.Component=c,Te.Fragment=i,Te.Profiler=d,Te.PureComponent=h,Te.StrictMode=o,Te.Suspense=l,Te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,Te.act=F,Te.cloneElement=function(M,U,ee){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var ne=E({},M.props),ce=M.key,de=M.ref,X=M._owner;if(U!=null){if(U.ref!==void 0&&(de=U.ref,X=L.current),U.key!==void 0&&(ce=""+U.key),M.type&&M.type.defaultProps)var B=M.type.defaultProps;for(ie in U)R.call(U,ie)&&!D.hasOwnProperty(ie)&&(ne[ie]=U[ie]===void 0&&B!==void 0?B[ie]:U[ie])}var ie=arguments.length-2;if(ie===1)ne.children=ee;else if(1<ie){B=Array(ie);for(var se=0;se<ie;se++)B[se]=arguments[se+2];ne.children=B}return{$$typeof:t,type:M.type,key:ce,ref:de,props:ne,_owner:X}},Te.createContext=function(M){return M={$$typeof:g,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:w,_context:M},M.Consumer=M},Te.createElement=T,Te.createFactory=function(M){var U=T.bind(null,M);return U.type=M,U},Te.createRef=function(){return{current:null}},Te.forwardRef=function(M){return{$$typeof:a,render:M}},Te.isValidElement=I,Te.lazy=function(M){return{$$typeof:m,_payload:{_status:-1,_result:M},_init:z}},Te.memo=function(M,U){return{$$typeof:p,type:M,compare:U===void 0?null:U}},Te.startTransition=function(M){var U=G.transition;G.transition={};try{M()}finally{G.transition=U}},Te.unstable_act=F,Te.useCallback=function(M,U){return re.current.useCallback(M,U)},Te.useContext=function(M){return re.current.useContext(M)},Te.useDebugValue=function(){},Te.useDeferredValue=function(M){return re.current.useDeferredValue(M)},Te.useEffect=function(M,U){return re.current.useEffect(M,U)},Te.useId=function(){return re.current.useId()},Te.useImperativeHandle=function(M,U,ee){return re.current.useImperativeHandle(M,U,ee)},Te.useInsertionEffect=function(M,U){return re.current.useInsertionEffect(M,U)},Te.useLayoutEffect=function(M,U){return re.current.useLayoutEffect(M,U)},Te.useMemo=function(M,U){return re.current.useMemo(M,U)},Te.useReducer=function(M,U,ee){return re.current.useReducer(M,U,ee)},Te.useRef=function(M){return re.current.useRef(M)},Te.useState=function(M){return re.current.useState(M)},Te.useSyncExternalStore=function(M,U,ee){return re.current.useSyncExternalStore(M,U,ee)},Te.useTransition=function(){return re.current.useTransition()},Te.version="18.3.1",Te}var Vf;function yu(){return Vf||(Vf=1,pc.exports=Y_()),pc.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 $f;function Q_(){if($f)return en;$f=1;var t=yu(),s=Symbol.for("react.element"),i=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,d=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w={key:!0,ref:!0,__self:!0,__source:!0};function g(a,l,p){var m,u={},x=null,b=null;p!==void 0&&(x=""+p),l.key!==void 0&&(x=""+l.key),l.ref!==void 0&&(b=l.ref);for(m in l)o.call(l,m)&&!w.hasOwnProperty(m)&&(u[m]=l[m]);if(a&&a.defaultProps)for(m in l=a.defaultProps,l)u[m]===void 0&&(u[m]=l[m]);return{$$typeof:s,type:a,key:x,ref:b,props:u,_owner:d.current}}return en.Fragment=i,en.jsx=g,en.jsxs=g,en}var zf;function Z_(){return zf||(zf=1,fc.exports=Q_()),fc.exports}var _=Z_(),jo={},mc={exports:{}},Tt={},gc={exports:{}},vc={};/**
|
|
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 Kf;function e0(){return Kf||(Kf=1,(function(t){function s(G,j){var F=G.length;G.push(j);e:for(;0<F;){var M=F-1>>>1,U=G[M];if(0<d(U,j))G[M]=j,G[F]=U,F=M;else break e}}function i(G){return G.length===0?null:G[0]}function o(G){if(G.length===0)return null;var j=G[0],F=G.pop();if(F!==j){G[0]=F;e:for(var M=0,U=G.length,ee=U>>>1;M<ee;){var ne=2*(M+1)-1,ce=G[ne],de=ne+1,X=G[de];if(0>d(ce,F))de<U&&0>d(X,ce)?(G[M]=X,G[de]=F,M=de):(G[M]=ce,G[ne]=F,M=ne);else if(de<U&&0>d(X,F))G[M]=X,G[de]=F,M=de;else break e}}return j}function d(G,j){var F=G.sortIndex-j.sortIndex;return F!==0?F:G.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var w=performance;t.unstable_now=function(){return w.now()}}else{var g=Date,a=g.now();t.unstable_now=function(){return g.now()-a}}var l=[],p=[],m=1,u=null,x=3,b=!1,E=!1,S=!1,c=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(G){for(var j=i(p);j!==null;){if(j.callback===null)o(p);else if(j.startTime<=G)o(p),j.sortIndex=j.expirationTime,s(l,j);else break;j=i(p)}}function C(G){if(S=!1,v(G),!E)if(i(l)!==null)E=!0,z(R);else{var j=i(p);j!==null&&re(C,j.startTime-G)}}function R(G,j){E=!1,S&&(S=!1,y(T),T=-1),b=!0;var F=x;try{for(v(j),u=i(l);u!==null&&(!(u.expirationTime>j)||G&&!H());){var M=u.callback;if(typeof M=="function"){u.callback=null,x=u.priorityLevel;var U=M(u.expirationTime<=j);j=t.unstable_now(),typeof U=="function"?u.callback=U:u===i(l)&&o(l),v(j)}else o(l);u=i(l)}if(u!==null)var ee=!0;else{var ne=i(p);ne!==null&&re(C,ne.startTime-j),ee=!1}return ee}finally{u=null,x=F,b=!1}}var L=!1,D=null,T=-1,A=5,I=-1;function H(){return!(t.unstable_now()-I<A)}function $(){if(D!==null){var G=t.unstable_now();I=G;var j=!0;try{j=D(!0,G)}finally{j?N():(L=!1,D=null)}}else L=!1}var N;if(typeof h=="function")N=function(){h($)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,K=J.port2;J.port1.onmessage=$,N=function(){K.postMessage(null)}}else N=function(){c($,0)};function z(G){D=G,L||(L=!0,N())}function re(G,j){T=c(function(){G(t.unstable_now())},j)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(G){G.callback=null},t.unstable_continueExecution=function(){E||b||(E=!0,z(R))},t.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<G?Math.floor(1e3/G):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_getFirstCallbackNode=function(){return i(l)},t.unstable_next=function(G){switch(x){case 1:case 2:case 3:var j=3;break;default:j=x}var F=x;x=j;try{return G()}finally{x=F}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(G,j){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var F=x;x=G;try{return j()}finally{x=F}},t.unstable_scheduleCallback=function(G,j,F){var M=t.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?M+F:M):F=M,G){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=F+U,G={id:m++,callback:j,priorityLevel:G,startTime:F,expirationTime:U,sortIndex:-1},F>M?(G.sortIndex=F,s(p,G),i(l)===null&&G===i(p)&&(S?(y(T),T=-1):S=!0,re(C,F-M))):(G.sortIndex=U,s(l,G),E||b||(E=!0,z(R))),G},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(G){var j=x;return function(){var F=x;x=j;try{return G.apply(this,arguments)}finally{x=F}}}})(vc)),vc}var qf;function t0(){return qf||(qf=1,gc.exports=e0()),gc.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 Gf;function r0(){if(Gf)return Tt;Gf=1;var t=yu(),s=t0();function i(e){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)r+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,d={};function w(e,r){g(e,r),g(e+"Capture",r)}function g(e,r){for(d[e]=r,e=0;e<r.length;e++)o.add(r[e])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),l=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},u={};function x(e){return l.call(u,e)?!0:l.call(m,e)?!1:p.test(e)?u[e]=!0:(m[e]=!0,!1)}function b(e,r,n,f){if(n!==null&&n.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return f?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function E(e,r,n,f){if(r===null||typeof r>"u"||b(e,r,n,f))return!0;if(f)return!1;if(n!==null)switch(n.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function S(e,r,n,f,k,P,O){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=f,this.attributeNamespace=k,this.mustUseProperty=n,this.propertyName=e,this.type=r,this.sanitizeURL=P,this.removeEmptyString=O}var c={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){c[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var r=e[0];c[r]=new S(r,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){c[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){c[e]=new S(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){c[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){c[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){c[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){c[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){c[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function h(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 r=e.replace(y,h);c[r]=new S(r,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var r=e.replace(y,h);c[r]=new S(r,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var r=e.replace(y,h);c[r]=new S(r,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){c[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),c.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){c[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function v(e,r,n,f){var k=c.hasOwnProperty(r)?c[r]:null;(k!==null?k.type!==0:f||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(E(r,n,k,f)&&(n=null),f||k===null?x(r)&&(n===null?e.removeAttribute(r):e.setAttribute(r,""+n)):k.mustUseProperty?e[k.propertyName]=n===null?k.type===3?!1:"":n:(r=k.attributeName,f=k.attributeNamespace,n===null?e.removeAttribute(r):(k=k.type,n=k===3||k===4&&n===!0?"":""+n,f?e.setAttributeNS(f,r,n):e.setAttribute(r,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),L=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),H=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),re=Symbol.for("react.offscreen"),G=Symbol.iterator;function j(e){return e===null||typeof e!="object"?null:(e=G&&e[G]||e["@@iterator"],typeof e=="function"?e:null)}var F=Object.assign,M;function U(e){if(M===void 0)try{throw Error()}catch(n){var r=n.stack.trim().match(/\n( *(at )?)/);M=r&&r[1]||""}return`
|
|
35
|
+
`+M+e}var ee=!1;function ne(e,r){if(!e||ee)return"";ee=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(te){var f=te}Reflect.construct(e,[],r)}else{try{r.call()}catch(te){f=te}e.call(r.prototype)}else{try{throw Error()}catch(te){f=te}e()}}catch(te){if(te&&f&&typeof te.stack=="string"){for(var k=te.stack.split(`
|
|
36
|
+
`),P=f.stack.split(`
|
|
37
|
+
`),O=k.length-1,V=P.length-1;1<=O&&0<=V&&k[O]!==P[V];)V--;for(;1<=O&&0<=V;O--,V--)if(k[O]!==P[V]){if(O!==1||V!==1)do if(O--,V--,0>V||k[O]!==P[V]){var q=`
|
|
38
|
+
`+k[O].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=O&&0<=V);break}}}finally{ee=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?U(e):""}function ce(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("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 D:return"Fragment";case L:return"Portal";case A:return"Profiler";case T:return"StrictMode";case N:return"Suspense";case J:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case H:return(e.displayName||"Context")+".Consumer";case I:return(e._context.displayName||"Context")+".Provider";case $:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return r=e.displayName||null,r!==null?r:de(e.type)||"Memo";case z:r=e._payload,e=e._init;try{return de(e(r))}catch{}}return null}function X(e){var r=e.type;switch(e.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=r.render,e=e.displayName||e.name||"",r.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(r);case 8:return r===T?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function B(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ie(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function se(e){var r=ie(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),f=""+e[r];if(!e.hasOwnProperty(r)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var k=n.get,P=n.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return k.call(this)},set:function(O){f=""+O,P.call(this,O)}}),Object.defineProperty(e,r,{enumerable:n.enumerable}),{getValue:function(){return f},setValue:function(O){f=""+O},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function fe(e){e._valueTracker||(e._valueTracker=se(e))}function he(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var n=r.getValue(),f="";return e&&(f=ie(e)?e.checked?"true":"false":e.value),e=f,e!==n?(r.setValue(e),!0):!1}function Ee(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Me(e,r){var n=r.checked;return F({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ie(e,r){var n=r.defaultValue==null?"":r.defaultValue,f=r.checked!=null?r.checked:r.defaultChecked;n=B(r.value!=null?r.value:n),e._wrapperState={initialChecked:f,initialValue:n,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function it(e,r){r=r.checked,r!=null&&v(e,"checked",r,!1)}function Ce(e,r){it(e,r);var n=B(r.value),f=r.type;if(n!=null)f==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(f==="submit"||f==="reset"){e.removeAttribute("value");return}r.hasOwnProperty("value")?as(e,r.type,n):r.hasOwnProperty("defaultValue")&&as(e,r.type,B(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}function Rr(e,r,n){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var f=r.type;if(!(f!=="submit"&&f!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+e._wrapperState.initialValue,n||r===e.value||(e.value=r),e.defaultValue=r}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function as(e,r,n){(r!=="number"||Ee(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var yr=Array.isArray;function nr(e,r,n,f){if(e=e.options,r){r={};for(var k=0;k<n.length;k++)r["$"+n[k]]=!0;for(n=0;n<e.length;n++)k=r.hasOwnProperty("$"+e[n].value),e[n].selected!==k&&(e[n].selected=k),k&&f&&(e[n].defaultSelected=!0)}else{for(n=""+B(n),r=null,k=0;k<e.length;k++){if(e[k].value===n){e[k].selected=!0,f&&(e[k].defaultSelected=!0);return}r!==null||e[k].disabled||(r=e[k])}r!==null&&(r.selected=!0)}}function Pr(e,r){if(r.dangerouslySetInnerHTML!=null)throw Error(i(91));return F({},r,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function pt(e,r){var n=r.value;if(n==null){if(n=r.children,r=r.defaultValue,n!=null){if(r!=null)throw Error(i(92));if(yr(n)){if(1<n.length)throw Error(i(93));n=n[0]}r=n}r==null&&(r=""),n=r}e._wrapperState={initialValue:B(n)}}function Lr(e,r){var n=B(r.value),f=B(r.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),r.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),f!=null&&(e.defaultValue=""+f)}function Rt(e){var r=e.textContent;r===e._wrapperState.initialValue&&r!==""&&r!==null&&(e.value=r)}function Dr(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 ls(e,r){return e==null||e==="http://www.w3.org/1999/xhtml"?Dr(r):e==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Pt,cs=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,n,f,k){MSApp.execUnsafeLocalFunction(function(){return e(r,n,f,k)})}:e})(function(e,r){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=r;else{for(Pt=Pt||document.createElement("div"),Pt.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=Pt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;r.firstChild;)e.appendChild(r.firstChild)}});function wt(e,r){if(r){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=r;return}}e.textContent=r}var qt={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},Ne=["Webkit","ms","Moz","O"];Object.keys(qt).forEach(function(e){Ne.forEach(function(r){r=r+e.charAt(0).toUpperCase()+e.substring(1),qt[r]=qt[e]})});function Cn(e,r,n){return r==null||typeof r=="boolean"||r===""?"":n||typeof r!="number"||r===0||qt.hasOwnProperty(e)&&qt[e]?(""+r).trim():r+"px"}function sd(e,r){e=e.style;for(var n in r)if(r.hasOwnProperty(n)){var f=n.indexOf("--")===0,k=Cn(n,r[n],f);n==="float"&&(n="cssFloat"),f?e.setProperty(n,k):e[n]=k}}var ey=F({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 Ca(e,r){if(r){if(ey[e]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(i(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(i(61))}if(r.style!=null&&typeof r.style!="object")throw Error(i(62))}}function ka(e,r){if(e.indexOf("-")===-1)return typeof r.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 Ea=null;function Ta(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ra=null,Ms=null,Os=null;function id(e){if(e=Fi(e)){if(typeof Ra!="function")throw Error(i(280));var r=e.stateNode;r&&(r=qn(r),Ra(e.stateNode,e.type,r))}}function nd(e){Ms?Os?Os.push(e):Os=[e]:Ms=e}function od(){if(Ms){var e=Ms,r=Os;if(Os=Ms=null,id(e),r)for(e=0;e<r.length;e++)id(r[e])}}function ad(e,r){return e(r)}function ld(){}var Pa=!1;function cd(e,r,n){if(Pa)return e(r,n);Pa=!0;try{return ad(e,r,n)}finally{Pa=!1,(Ms!==null||Os!==null)&&(ld(),od())}}function yi(e,r){var n=e.stateNode;if(n===null)return null;var f=qn(n);if(f===null)return null;n=f[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(e=e.type,f=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!f;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(i(231,r,typeof n));return n}var La=!1;if(a)try{var _i={};Object.defineProperty(_i,"passive",{get:function(){La=!0}}),window.addEventListener("test",_i,_i),window.removeEventListener("test",_i,_i)}catch{La=!1}function ty(e,r,n,f,k,P,O,V,q){var te=Array.prototype.slice.call(arguments,3);try{r.apply(n,te)}catch(ae){this.onError(ae)}}var xi=!1,kn=null,En=!1,Da=null,ry={onError:function(e){xi=!0,kn=e}};function sy(e,r,n,f,k,P,O,V,q){xi=!1,kn=null,ty.apply(ry,arguments)}function iy(e,r,n,f,k,P,O,V,q){if(sy.apply(this,arguments),xi){if(xi){var te=kn;xi=!1,kn=null}else throw Error(i(198));En||(En=!0,Da=te)}}function us(e){var r=e,n=e;if(e.alternate)for(;r.return;)r=r.return;else{e=r;do r=e,(r.flags&4098)!==0&&(n=r.return),e=r.return;while(e)}return r.tag===3?n:null}function ud(e){if(e.tag===13){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function dd(e){if(us(e)!==e)throw Error(i(188))}function ny(e){var r=e.alternate;if(!r){if(r=us(e),r===null)throw Error(i(188));return r!==e?null:e}for(var n=e,f=r;;){var k=n.return;if(k===null)break;var P=k.alternate;if(P===null){if(f=k.return,f!==null){n=f;continue}break}if(k.child===P.child){for(P=k.child;P;){if(P===n)return dd(k),e;if(P===f)return dd(k),r;P=P.sibling}throw Error(i(188))}if(n.return!==f.return)n=k,f=P;else{for(var O=!1,V=k.child;V;){if(V===n){O=!0,n=k,f=P;break}if(V===f){O=!0,f=k,n=P;break}V=V.sibling}if(!O){for(V=P.child;V;){if(V===n){O=!0,n=P,f=k;break}if(V===f){O=!0,f=P,n=k;break}V=V.sibling}if(!O)throw Error(i(189))}}if(n.alternate!==f)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:r}function hd(e){return e=ny(e),e!==null?fd(e):null}function fd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var r=fd(e);if(r!==null)return r;e=e.sibling}return null}var pd=s.unstable_scheduleCallback,md=s.unstable_cancelCallback,oy=s.unstable_shouldYield,ay=s.unstable_requestPaint,qe=s.unstable_now,ly=s.unstable_getCurrentPriorityLevel,Aa=s.unstable_ImmediatePriority,gd=s.unstable_UserBlockingPriority,Tn=s.unstable_NormalPriority,cy=s.unstable_LowPriority,vd=s.unstable_IdlePriority,Rn=null,or=null;function uy(e){if(or&&typeof or.onCommitFiberRoot=="function")try{or.onCommitFiberRoot(Rn,e,void 0,(e.current.flags&128)===128)}catch{}}var Gt=Math.clz32?Math.clz32:fy,dy=Math.log,hy=Math.LN2;function fy(e){return e>>>=0,e===0?32:31-(dy(e)/hy|0)|0}var Pn=64,Ln=4194304;function wi(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 Dn(e,r){var n=e.pendingLanes;if(n===0)return 0;var f=0,k=e.suspendedLanes,P=e.pingedLanes,O=n&268435455;if(O!==0){var V=O&~k;V!==0?f=wi(V):(P&=O,P!==0&&(f=wi(P)))}else O=n&~k,O!==0?f=wi(O):P!==0&&(f=wi(P));if(f===0)return 0;if(r!==0&&r!==f&&(r&k)===0&&(k=f&-f,P=r&-r,k>=P||k===16&&(P&4194240)!==0))return r;if((f&4)!==0&&(f|=n&16),r=e.entangledLanes,r!==0)for(e=e.entanglements,r&=f;0<r;)n=31-Gt(r),k=1<<n,f|=e[n],r&=~k;return f}function py(e,r){switch(e){case 1:case 2:case 4:return r+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 r+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 my(e,r){for(var n=e.suspendedLanes,f=e.pingedLanes,k=e.expirationTimes,P=e.pendingLanes;0<P;){var O=31-Gt(P),V=1<<O,q=k[O];q===-1?((V&n)===0||(V&f)!==0)&&(k[O]=py(V,r)):q<=r&&(e.expiredLanes|=V),P&=~V}}function ja(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function yd(){var e=Pn;return Pn<<=1,(Pn&4194240)===0&&(Pn=64),e}function Ma(e){for(var r=[],n=0;31>n;n++)r.push(e);return r}function Si(e,r,n){e.pendingLanes|=r,r!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,r=31-Gt(r),e[r]=n}function gy(e,r){var n=e.pendingLanes&~r;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=r,e.mutableReadLanes&=r,e.entangledLanes&=r,r=e.entanglements;var f=e.eventTimes;for(e=e.expirationTimes;0<n;){var k=31-Gt(n),P=1<<k;r[k]=0,f[k]=-1,e[k]=-1,n&=~P}}function Oa(e,r){var n=e.entangledLanes|=r;for(e=e.entanglements;n;){var f=31-Gt(n),k=1<<f;k&r|e[f]&r&&(e[f]|=r),n&=~k}}var De=0;function _d(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var xd,Ia,wd,Sd,bd,Na=!1,An=[],Ar=null,jr=null,Mr=null,bi=new Map,Ci=new Map,Or=[],vy="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 Cd(e,r){switch(e){case"focusin":case"focusout":Ar=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":Mr=null;break;case"pointerover":case"pointerout":bi.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ci.delete(r.pointerId)}}function ki(e,r,n,f,k,P){return e===null||e.nativeEvent!==P?(e={blockedOn:r,domEventName:n,eventSystemFlags:f,nativeEvent:P,targetContainers:[k]},r!==null&&(r=Fi(r),r!==null&&Ia(r)),e):(e.eventSystemFlags|=f,r=e.targetContainers,k!==null&&r.indexOf(k)===-1&&r.push(k),e)}function yy(e,r,n,f,k){switch(r){case"focusin":return Ar=ki(Ar,e,r,n,f,k),!0;case"dragenter":return jr=ki(jr,e,r,n,f,k),!0;case"mouseover":return Mr=ki(Mr,e,r,n,f,k),!0;case"pointerover":var P=k.pointerId;return bi.set(P,ki(bi.get(P)||null,e,r,n,f,k)),!0;case"gotpointercapture":return P=k.pointerId,Ci.set(P,ki(Ci.get(P)||null,e,r,n,f,k)),!0}return!1}function kd(e){var r=ds(e.target);if(r!==null){var n=us(r);if(n!==null){if(r=n.tag,r===13){if(r=ud(n),r!==null){e.blockedOn=r,bd(e.priority,function(){wd(n)});return}}else if(r===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jn(e){if(e.blockedOn!==null)return!1;for(var r=e.targetContainers;0<r.length;){var n=Fa(e.domEventName,e.eventSystemFlags,r[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var f=new n.constructor(n.type,n);Ea=f,n.target.dispatchEvent(f),Ea=null}else return r=Fi(n),r!==null&&Ia(r),e.blockedOn=n,!1;r.shift()}return!0}function Ed(e,r,n){jn(e)&&n.delete(r)}function _y(){Na=!1,Ar!==null&&jn(Ar)&&(Ar=null),jr!==null&&jn(jr)&&(jr=null),Mr!==null&&jn(Mr)&&(Mr=null),bi.forEach(Ed),Ci.forEach(Ed)}function Ei(e,r){e.blockedOn===r&&(e.blockedOn=null,Na||(Na=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,_y)))}function Ti(e){function r(k){return Ei(k,e)}if(0<An.length){Ei(An[0],e);for(var n=1;n<An.length;n++){var f=An[n];f.blockedOn===e&&(f.blockedOn=null)}}for(Ar!==null&&Ei(Ar,e),jr!==null&&Ei(jr,e),Mr!==null&&Ei(Mr,e),bi.forEach(r),Ci.forEach(r),n=0;n<Or.length;n++)f=Or[n],f.blockedOn===e&&(f.blockedOn=null);for(;0<Or.length&&(n=Or[0],n.blockedOn===null);)kd(n),n.blockedOn===null&&Or.shift()}var Is=C.ReactCurrentBatchConfig,Mn=!0;function xy(e,r,n,f){var k=De,P=Is.transition;Is.transition=null;try{De=1,Ba(e,r,n,f)}finally{De=k,Is.transition=P}}function wy(e,r,n,f){var k=De,P=Is.transition;Is.transition=null;try{De=4,Ba(e,r,n,f)}finally{De=k,Is.transition=P}}function Ba(e,r,n,f){if(Mn){var k=Fa(e,r,n,f);if(k===null)rl(e,r,f,On,n),Cd(e,f);else if(yy(k,e,r,n,f))f.stopPropagation();else if(Cd(e,f),r&4&&-1<vy.indexOf(e)){for(;k!==null;){var P=Fi(k);if(P!==null&&xd(P),P=Fa(e,r,n,f),P===null&&rl(e,r,f,On,n),P===k)break;k=P}k!==null&&f.stopPropagation()}else rl(e,r,f,null,n)}}var On=null;function Fa(e,r,n,f){if(On=null,e=Ta(f),e=ds(e),e!==null)if(r=us(e),r===null)e=null;else if(n=r.tag,n===13){if(e=ud(r),e!==null)return e;e=null}else if(n===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;e=null}else r!==e&&(e=null);return On=e,null}function Td(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(ly()){case Aa:return 1;case gd:return 4;case Tn:case cy:return 16;case vd:return 536870912;default:return 16}default:return 16}}var Ir=null,Ha=null,In=null;function Rd(){if(In)return In;var e,r=Ha,n=r.length,f,k="value"in Ir?Ir.value:Ir.textContent,P=k.length;for(e=0;e<n&&r[e]===k[e];e++);var O=n-e;for(f=1;f<=O&&r[n-f]===k[P-f];f++);return In=k.slice(e,1<f?1-f:void 0)}function Nn(e){var r=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&r===13&&(e=13)):e=r,e===10&&(e=13),32<=e||e===13?e:0}function Bn(){return!0}function Pd(){return!1}function Lt(e){function r(n,f,k,P,O){this._reactName=n,this._targetInst=k,this.type=f,this.nativeEvent=P,this.target=O,this.currentTarget=null;for(var V in e)e.hasOwnProperty(V)&&(n=e[V],this[V]=n?n(P):P[V]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?Bn:Pd,this.isPropagationStopped=Pd,this}return F(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Bn)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Bn)},persist:function(){},isPersistent:Bn}),r}var Ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ua=Lt(Ns),Ri=F({},Ns,{view:0,detail:0}),Sy=Lt(Ri),Wa,Va,Pi,Fn=F({},Ri,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:za,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!==Pi&&(Pi&&e.type==="mousemove"?(Wa=e.screenX-Pi.screenX,Va=e.screenY-Pi.screenY):Va=Wa=0,Pi=e),Wa)},movementY:function(e){return"movementY"in e?e.movementY:Va}}),Ld=Lt(Fn),by=F({},Fn,{dataTransfer:0}),Cy=Lt(by),ky=F({},Ri,{relatedTarget:0}),$a=Lt(ky),Ey=F({},Ns,{animationName:0,elapsedTime:0,pseudoElement:0}),Ty=Lt(Ey),Ry=F({},Ns,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Py=Lt(Ry),Ly=F({},Ns,{data:0}),Dd=Lt(Ly),Dy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ay={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"},jy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function My(e){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(e):(e=jy[e])?!!r[e]:!1}function za(){return My}var Oy=F({},Ri,{key:function(e){if(e.key){var r=Dy[e.key]||e.key;if(r!=="Unidentified")return r}return e.type==="keypress"?(e=Nn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ay[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:za,charCode:function(e){return e.type==="keypress"?Nn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Nn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Iy=Lt(Oy),Ny=F({},Fn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ad=Lt(Ny),By=F({},Ri,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:za}),Fy=Lt(By),Hy=F({},Ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),Uy=Lt(Hy),Wy=F({},Fn,{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}),Vy=Lt(Wy),$y=[9,13,27,32],Ka=a&&"CompositionEvent"in window,Li=null;a&&"documentMode"in document&&(Li=document.documentMode);var zy=a&&"TextEvent"in window&&!Li,jd=a&&(!Ka||Li&&8<Li&&11>=Li),Md=" ",Od=!1;function Id(e,r){switch(e){case"keyup":return $y.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bs=!1;function Ky(e,r){switch(e){case"compositionend":return Nd(r);case"keypress":return r.which!==32?null:(Od=!0,Md);case"textInput":return e=r.data,e===Md&&Od?null:e;default:return null}}function qy(e,r){if(Bs)return e==="compositionend"||!Ka&&Id(e,r)?(e=Rd(),In=Ha=Ir=null,Bs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return jd&&r.locale!=="ko"?null:r.data;default:return null}}var Gy={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 Bd(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r==="input"?!!Gy[e.type]:r==="textarea"}function Fd(e,r,n,f){nd(f),r=$n(r,"onChange"),0<r.length&&(n=new Ua("onChange","change",null,n,f),e.push({event:n,listeners:r}))}var Di=null,Ai=null;function Xy(e){sh(e,0)}function Hn(e){var r=Vs(e);if(he(r))return e}function Jy(e,r){if(e==="change")return r}var Hd=!1;if(a){var qa;if(a){var Ga="oninput"in document;if(!Ga){var Ud=document.createElement("div");Ud.setAttribute("oninput","return;"),Ga=typeof Ud.oninput=="function"}qa=Ga}else qa=!1;Hd=qa&&(!document.documentMode||9<document.documentMode)}function Wd(){Di&&(Di.detachEvent("onpropertychange",Vd),Ai=Di=null)}function Vd(e){if(e.propertyName==="value"&&Hn(Ai)){var r=[];Fd(r,Ai,e,Ta(e)),cd(Xy,r)}}function Yy(e,r,n){e==="focusin"?(Wd(),Di=r,Ai=n,Di.attachEvent("onpropertychange",Vd)):e==="focusout"&&Wd()}function Qy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hn(Ai)}function Zy(e,r){if(e==="click")return Hn(r)}function e_(e,r){if(e==="input"||e==="change")return Hn(r)}function t_(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var Xt=typeof Object.is=="function"?Object.is:t_;function ji(e,r){if(Xt(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;var n=Object.keys(e),f=Object.keys(r);if(n.length!==f.length)return!1;for(f=0;f<n.length;f++){var k=n[f];if(!l.call(r,k)||!Xt(e[k],r[k]))return!1}return!0}function $d(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zd(e,r){var n=$d(e);e=0;for(var f;n;){if(n.nodeType===3){if(f=e+n.textContent.length,e<=r&&f>=r)return{node:n,offset:r-e};e=f}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$d(n)}}function Kd(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?Kd(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function qd(){for(var e=window,r=Ee();r instanceof e.HTMLIFrameElement;){try{var n=typeof r.contentWindow.location.href=="string"}catch{n=!1}if(n)e=r.contentWindow;else break;r=Ee(e.document)}return r}function Xa(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}function r_(e){var r=qd(),n=e.focusedElem,f=e.selectionRange;if(r!==n&&n&&n.ownerDocument&&Kd(n.ownerDocument.documentElement,n)){if(f!==null&&Xa(n)){if(r=f.start,e=f.end,e===void 0&&(e=r),"selectionStart"in n)n.selectionStart=r,n.selectionEnd=Math.min(e,n.value.length);else if(e=(r=n.ownerDocument||document)&&r.defaultView||window,e.getSelection){e=e.getSelection();var k=n.textContent.length,P=Math.min(f.start,k);f=f.end===void 0?P:Math.min(f.end,k),!e.extend&&P>f&&(k=f,f=P,P=k),k=zd(n,P);var O=zd(n,f);k&&O&&(e.rangeCount!==1||e.anchorNode!==k.node||e.anchorOffset!==k.offset||e.focusNode!==O.node||e.focusOffset!==O.offset)&&(r=r.createRange(),r.setStart(k.node,k.offset),e.removeAllRanges(),P>f?(e.addRange(r),e.extend(O.node,O.offset)):(r.setEnd(O.node,O.offset),e.addRange(r)))}}for(r=[],e=n;e=e.parentNode;)e.nodeType===1&&r.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<r.length;n++)e=r[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var s_=a&&"documentMode"in document&&11>=document.documentMode,Fs=null,Ja=null,Mi=null,Ya=!1;function Gd(e,r,n){var f=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ya||Fs==null||Fs!==Ee(f)||(f=Fs,"selectionStart"in f&&Xa(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Mi&&ji(Mi,f)||(Mi=f,f=$n(Ja,"onSelect"),0<f.length&&(r=new Ua("onSelect","select",null,r,n),e.push({event:r,listeners:f}),r.target=Fs)))}function Un(e,r){var n={};return n[e.toLowerCase()]=r.toLowerCase(),n["Webkit"+e]="webkit"+r,n["Moz"+e]="moz"+r,n}var Hs={animationend:Un("Animation","AnimationEnd"),animationiteration:Un("Animation","AnimationIteration"),animationstart:Un("Animation","AnimationStart"),transitionend:Un("Transition","TransitionEnd")},Qa={},Xd={};a&&(Xd=document.createElement("div").style,"AnimationEvent"in window||(delete Hs.animationend.animation,delete Hs.animationiteration.animation,delete Hs.animationstart.animation),"TransitionEvent"in window||delete Hs.transitionend.transition);function Wn(e){if(Qa[e])return Qa[e];if(!Hs[e])return e;var r=Hs[e],n;for(n in r)if(r.hasOwnProperty(n)&&n in Xd)return Qa[e]=r[n];return e}var Jd=Wn("animationend"),Yd=Wn("animationiteration"),Qd=Wn("animationstart"),Zd=Wn("transitionend"),eh=new Map,th="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 Nr(e,r){eh.set(e,r),w(r,[e])}for(var Za=0;Za<th.length;Za++){var el=th[Za],i_=el.toLowerCase(),n_=el[0].toUpperCase()+el.slice(1);Nr(i_,"on"+n_)}Nr(Jd,"onAnimationEnd"),Nr(Yd,"onAnimationIteration"),Nr(Qd,"onAnimationStart"),Nr("dblclick","onDoubleClick"),Nr("focusin","onFocus"),Nr("focusout","onBlur"),Nr(Zd,"onTransitionEnd"),g("onMouseEnter",["mouseout","mouseover"]),g("onMouseLeave",["mouseout","mouseover"]),g("onPointerEnter",["pointerout","pointerover"]),g("onPointerLeave",["pointerout","pointerover"]),w("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),w("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),w("onBeforeInput",["compositionend","keypress","textInput","paste"]),w("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),w("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),w("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oi="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(" "),o_=new Set("cancel close invalid load scroll toggle".split(" ").concat(Oi));function rh(e,r,n){var f=e.type||"unknown-event";e.currentTarget=n,iy(f,r,void 0,e),e.currentTarget=null}function sh(e,r){r=(r&4)!==0;for(var n=0;n<e.length;n++){var f=e[n],k=f.event;f=f.listeners;e:{var P=void 0;if(r)for(var O=f.length-1;0<=O;O--){var V=f[O],q=V.instance,te=V.currentTarget;if(V=V.listener,q!==P&&k.isPropagationStopped())break e;rh(k,V,te),P=q}else for(O=0;O<f.length;O++){if(V=f[O],q=V.instance,te=V.currentTarget,V=V.listener,q!==P&&k.isPropagationStopped())break e;rh(k,V,te),P=q}}}if(En)throw e=Da,En=!1,Da=null,e}function Be(e,r){var n=r[ll];n===void 0&&(n=r[ll]=new Set);var f=e+"__bubble";n.has(f)||(ih(r,e,2,!1),n.add(f))}function tl(e,r,n){var f=0;r&&(f|=4),ih(n,e,f,r)}var Vn="_reactListening"+Math.random().toString(36).slice(2);function Ii(e){if(!e[Vn]){e[Vn]=!0,o.forEach(function(n){n!=="selectionchange"&&(o_.has(n)||tl(n,!1,e),tl(n,!0,e))});var r=e.nodeType===9?e:e.ownerDocument;r===null||r[Vn]||(r[Vn]=!0,tl("selectionchange",!1,r))}}function ih(e,r,n,f){switch(Td(r)){case 1:var k=xy;break;case 4:k=wy;break;default:k=Ba}n=k.bind(null,r,n,e),k=void 0,!La||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(k=!0),f?k!==void 0?e.addEventListener(r,n,{capture:!0,passive:k}):e.addEventListener(r,n,!0):k!==void 0?e.addEventListener(r,n,{passive:k}):e.addEventListener(r,n,!1)}function rl(e,r,n,f,k){var P=f;if((r&1)===0&&(r&2)===0&&f!==null)e:for(;;){if(f===null)return;var O=f.tag;if(O===3||O===4){var V=f.stateNode.containerInfo;if(V===k||V.nodeType===8&&V.parentNode===k)break;if(O===4)for(O=f.return;O!==null;){var q=O.tag;if((q===3||q===4)&&(q=O.stateNode.containerInfo,q===k||q.nodeType===8&&q.parentNode===k))return;O=O.return}for(;V!==null;){if(O=ds(V),O===null)return;if(q=O.tag,q===5||q===6){f=P=O;continue e}V=V.parentNode}}f=f.return}cd(function(){var te=P,ae=Ta(n),le=[];e:{var oe=eh.get(e);if(oe!==void 0){var pe=Ua,ge=e;switch(e){case"keypress":if(Nn(n)===0)break e;case"keydown":case"keyup":pe=Iy;break;case"focusin":ge="focus",pe=$a;break;case"focusout":ge="blur",pe=$a;break;case"beforeblur":case"afterblur":pe=$a;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Ld;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=Cy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=Fy;break;case Jd:case Yd:case Qd:pe=Ty;break;case Zd:pe=Uy;break;case"scroll":pe=Sy;break;case"wheel":pe=Vy;break;case"copy":case"cut":case"paste":pe=Py;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Ad}var ye=(r&4)!==0,Ge=!ye&&e==="scroll",Q=ye?oe!==null?oe+"Capture":null:oe;ye=[];for(var Y=te,Z;Y!==null;){Z=Y;var ue=Z.stateNode;if(Z.tag===5&&ue!==null&&(Z=ue,Q!==null&&(ue=yi(Y,Q),ue!=null&&ye.push(Ni(Y,ue,Z)))),Ge)break;Y=Y.return}0<ye.length&&(oe=new pe(oe,ge,null,n,ae),le.push({event:oe,listeners:ye}))}}if((r&7)===0){e:{if(oe=e==="mouseover"||e==="pointerover",pe=e==="mouseout"||e==="pointerout",oe&&n!==Ea&&(ge=n.relatedTarget||n.fromElement)&&(ds(ge)||ge[_r]))break e;if((pe||oe)&&(oe=ae.window===ae?ae:(oe=ae.ownerDocument)?oe.defaultView||oe.parentWindow:window,pe?(ge=n.relatedTarget||n.toElement,pe=te,ge=ge?ds(ge):null,ge!==null&&(Ge=us(ge),ge!==Ge||ge.tag!==5&&ge.tag!==6)&&(ge=null)):(pe=null,ge=te),pe!==ge)){if(ye=Ld,ue="onMouseLeave",Q="onMouseEnter",Y="mouse",(e==="pointerout"||e==="pointerover")&&(ye=Ad,ue="onPointerLeave",Q="onPointerEnter",Y="pointer"),Ge=pe==null?oe:Vs(pe),Z=ge==null?oe:Vs(ge),oe=new ye(ue,Y+"leave",pe,n,ae),oe.target=Ge,oe.relatedTarget=Z,ue=null,ds(ae)===te&&(ye=new ye(Q,Y+"enter",ge,n,ae),ye.target=Z,ye.relatedTarget=Ge,ue=ye),Ge=ue,pe&&ge)t:{for(ye=pe,Q=ge,Y=0,Z=ye;Z;Z=Us(Z))Y++;for(Z=0,ue=Q;ue;ue=Us(ue))Z++;for(;0<Y-Z;)ye=Us(ye),Y--;for(;0<Z-Y;)Q=Us(Q),Z--;for(;Y--;){if(ye===Q||Q!==null&&ye===Q.alternate)break t;ye=Us(ye),Q=Us(Q)}ye=null}else ye=null;pe!==null&&nh(le,oe,pe,ye,!1),ge!==null&&Ge!==null&&nh(le,Ge,ge,ye,!0)}}e:{if(oe=te?Vs(te):window,pe=oe.nodeName&&oe.nodeName.toLowerCase(),pe==="select"||pe==="input"&&oe.type==="file")var _e=Jy;else if(Bd(oe))if(Hd)_e=e_;else{_e=Qy;var we=Yy}else(pe=oe.nodeName)&&pe.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(_e=Zy);if(_e&&(_e=_e(e,te))){Fd(le,_e,n,ae);break e}we&&we(e,oe,te),e==="focusout"&&(we=oe._wrapperState)&&we.controlled&&oe.type==="number"&&as(oe,"number",oe.value)}switch(we=te?Vs(te):window,e){case"focusin":(Bd(we)||we.contentEditable==="true")&&(Fs=we,Ja=te,Mi=null);break;case"focusout":Mi=Ja=Fs=null;break;case"mousedown":Ya=!0;break;case"contextmenu":case"mouseup":case"dragend":Ya=!1,Gd(le,n,ae);break;case"selectionchange":if(s_)break;case"keydown":case"keyup":Gd(le,n,ae)}var Se;if(Ka)e:{switch(e){case"compositionstart":var ke="onCompositionStart";break e;case"compositionend":ke="onCompositionEnd";break e;case"compositionupdate":ke="onCompositionUpdate";break e}ke=void 0}else Bs?Id(e,n)&&(ke="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ke="onCompositionStart");ke&&(jd&&n.locale!=="ko"&&(Bs||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&Bs&&(Se=Rd()):(Ir=ae,Ha="value"in Ir?Ir.value:Ir.textContent,Bs=!0)),we=$n(te,ke),0<we.length&&(ke=new Dd(ke,e,null,n,ae),le.push({event:ke,listeners:we}),Se?ke.data=Se:(Se=Nd(n),Se!==null&&(ke.data=Se)))),(Se=zy?Ky(e,n):qy(e,n))&&(te=$n(te,"onBeforeInput"),0<te.length&&(ae=new Dd("onBeforeInput","beforeinput",null,n,ae),le.push({event:ae,listeners:te}),ae.data=Se))}sh(le,r)})}function Ni(e,r,n){return{instance:e,listener:r,currentTarget:n}}function $n(e,r){for(var n=r+"Capture",f=[];e!==null;){var k=e,P=k.stateNode;k.tag===5&&P!==null&&(k=P,P=yi(e,n),P!=null&&f.unshift(Ni(e,P,k)),P=yi(e,r),P!=null&&f.push(Ni(e,P,k))),e=e.return}return f}function Us(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function nh(e,r,n,f,k){for(var P=r._reactName,O=[];n!==null&&n!==f;){var V=n,q=V.alternate,te=V.stateNode;if(q!==null&&q===f)break;V.tag===5&&te!==null&&(V=te,k?(q=yi(n,P),q!=null&&O.unshift(Ni(n,q,V))):k||(q=yi(n,P),q!=null&&O.push(Ni(n,q,V)))),n=n.return}O.length!==0&&e.push({event:r,listeners:O})}var a_=/\r\n?/g,l_=/\u0000|\uFFFD/g;function oh(e){return(typeof e=="string"?e:""+e).replace(a_,`
|
|
39
|
+
`).replace(l_,"")}function zn(e,r,n){if(r=oh(r),oh(e)!==r&&n)throw Error(i(425))}function Kn(){}var sl=null,il=null;function nl(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var ol=typeof setTimeout=="function"?setTimeout:void 0,c_=typeof clearTimeout=="function"?clearTimeout:void 0,ah=typeof Promise=="function"?Promise:void 0,u_=typeof queueMicrotask=="function"?queueMicrotask:typeof ah<"u"?function(e){return ah.resolve(null).then(e).catch(d_)}:ol;function d_(e){setTimeout(function(){throw e})}function al(e,r){var n=r,f=0;do{var k=n.nextSibling;if(e.removeChild(n),k&&k.nodeType===8)if(n=k.data,n==="/$"){if(f===0){e.removeChild(k),Ti(r);return}f--}else n!=="$"&&n!=="$?"&&n!=="$!"||f++;n=k}while(n);Ti(r)}function Br(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return e}function lh(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(r===0)return e;r--}else n==="/$"&&r++}e=e.previousSibling}return null}var Ws=Math.random().toString(36).slice(2),ar="__reactFiber$"+Ws,Bi="__reactProps$"+Ws,_r="__reactContainer$"+Ws,ll="__reactEvents$"+Ws,h_="__reactListeners$"+Ws,f_="__reactHandles$"+Ws;function ds(e){var r=e[ar];if(r)return r;for(var n=e.parentNode;n;){if(r=n[_r]||n[ar]){if(n=r.alternate,r.child!==null||n!==null&&n.child!==null)for(e=lh(e);e!==null;){if(n=e[ar])return n;e=lh(e)}return r}e=n,n=e.parentNode}return null}function Fi(e){return e=e[ar]||e[_r],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Vs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function qn(e){return e[Bi]||null}var cl=[],$s=-1;function Fr(e){return{current:e}}function Fe(e){0>$s||(e.current=cl[$s],cl[$s]=null,$s--)}function Oe(e,r){$s++,cl[$s]=e.current,e.current=r}var Hr={},ut=Fr(Hr),St=Fr(!1),hs=Hr;function zs(e,r){var n=e.type.contextTypes;if(!n)return Hr;var f=e.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===r)return f.__reactInternalMemoizedMaskedChildContext;var k={},P;for(P in n)k[P]=r[P];return f&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=k),k}function bt(e){return e=e.childContextTypes,e!=null}function Gn(){Fe(St),Fe(ut)}function ch(e,r,n){if(ut.current!==Hr)throw Error(i(168));Oe(ut,r),Oe(St,n)}function uh(e,r,n){var f=e.stateNode;if(r=r.childContextTypes,typeof f.getChildContext!="function")return n;f=f.getChildContext();for(var k in f)if(!(k in r))throw Error(i(108,X(e)||"Unknown",k));return F({},n,f)}function Xn(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Hr,hs=ut.current,Oe(ut,e),Oe(St,St.current),!0}function dh(e,r,n){var f=e.stateNode;if(!f)throw Error(i(169));n?(e=uh(e,r,hs),f.__reactInternalMemoizedMergedChildContext=e,Fe(St),Fe(ut),Oe(ut,e)):Fe(St),Oe(St,n)}var xr=null,Jn=!1,ul=!1;function hh(e){xr===null?xr=[e]:xr.push(e)}function p_(e){Jn=!0,hh(e)}function Ur(){if(!ul&&xr!==null){ul=!0;var e=0,r=De;try{var n=xr;for(De=1;e<n.length;e++){var f=n[e];do f=f(!0);while(f!==null)}xr=null,Jn=!1}catch(k){throw xr!==null&&(xr=xr.slice(e+1)),pd(Aa,Ur),k}finally{De=r,ul=!1}}return null}var Ks=[],qs=0,Yn=null,Qn=0,Nt=[],Bt=0,fs=null,wr=1,Sr="";function ps(e,r){Ks[qs++]=Qn,Ks[qs++]=Yn,Yn=e,Qn=r}function fh(e,r,n){Nt[Bt++]=wr,Nt[Bt++]=Sr,Nt[Bt++]=fs,fs=e;var f=wr;e=Sr;var k=32-Gt(f)-1;f&=~(1<<k),n+=1;var P=32-Gt(r)+k;if(30<P){var O=k-k%5;P=(f&(1<<O)-1).toString(32),f>>=O,k-=O,wr=1<<32-Gt(r)+k|n<<k|f,Sr=P+e}else wr=1<<P|n<<k|f,Sr=e}function dl(e){e.return!==null&&(ps(e,1),fh(e,1,0))}function hl(e){for(;e===Yn;)Yn=Ks[--qs],Ks[qs]=null,Qn=Ks[--qs],Ks[qs]=null;for(;e===fs;)fs=Nt[--Bt],Nt[Bt]=null,Sr=Nt[--Bt],Nt[Bt]=null,wr=Nt[--Bt],Nt[Bt]=null}var Dt=null,At=null,We=!1,Jt=null;function ph(e,r){var n=Wt(5,null,null,0);n.elementType="DELETED",n.stateNode=r,n.return=e,r=e.deletions,r===null?(e.deletions=[n],e.flags|=16):r.push(n)}function mh(e,r){switch(e.tag){case 5:var n=e.type;return r=r.nodeType!==1||n.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(e.stateNode=r,Dt=e,At=Br(r.firstChild),!0):!1;case 6:return r=e.pendingProps===""||r.nodeType!==3?null:r,r!==null?(e.stateNode=r,Dt=e,At=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(n=fs!==null?{id:wr,overflow:Sr}:null,e.memoizedState={dehydrated:r,treeContext:n,retryLane:1073741824},n=Wt(18,null,null,0),n.stateNode=r,n.return=e,e.child=n,Dt=e,At=null,!0):!1;default:return!1}}function fl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function pl(e){if(We){var r=At;if(r){var n=r;if(!mh(e,r)){if(fl(e))throw Error(i(418));r=Br(n.nextSibling);var f=Dt;r&&mh(e,r)?ph(f,n):(e.flags=e.flags&-4097|2,We=!1,Dt=e)}}else{if(fl(e))throw Error(i(418));e.flags=e.flags&-4097|2,We=!1,Dt=e}}}function gh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Dt=e}function Zn(e){if(e!==Dt)return!1;if(!We)return gh(e),We=!0,!1;var r;if((r=e.tag!==3)&&!(r=e.tag!==5)&&(r=e.type,r=r!=="head"&&r!=="body"&&!nl(e.type,e.memoizedProps)),r&&(r=At)){if(fl(e))throw vh(),Error(i(418));for(;r;)ph(e,r),r=Br(r.nextSibling)}if(gh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,r=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(r===0){At=Br(e.nextSibling);break e}r--}else n!=="$"&&n!=="$!"&&n!=="$?"||r++}e=e.nextSibling}At=null}}else At=Dt?Br(e.stateNode.nextSibling):null;return!0}function vh(){for(var e=At;e;)e=Br(e.nextSibling)}function Gs(){At=Dt=null,We=!1}function ml(e){Jt===null?Jt=[e]:Jt.push(e)}var m_=C.ReactCurrentBatchConfig;function Hi(e,r,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(i(309));var f=n.stateNode}if(!f)throw Error(i(147,e));var k=f,P=""+e;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===P?r.ref:(r=function(O){var V=k.refs;O===null?delete V[P]:V[P]=O},r._stringRef=P,r)}if(typeof e!="string")throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function eo(e,r){throw e=Object.prototype.toString.call(r),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e))}function yh(e){var r=e._init;return r(e._payload)}function _h(e){function r(Q,Y){if(e){var Z=Q.deletions;Z===null?(Q.deletions=[Y],Q.flags|=16):Z.push(Y)}}function n(Q,Y){if(!e)return null;for(;Y!==null;)r(Q,Y),Y=Y.sibling;return null}function f(Q,Y){for(Q=new Map;Y!==null;)Y.key!==null?Q.set(Y.key,Y):Q.set(Y.index,Y),Y=Y.sibling;return Q}function k(Q,Y){return Q=Xr(Q,Y),Q.index=0,Q.sibling=null,Q}function P(Q,Y,Z){return Q.index=Z,e?(Z=Q.alternate,Z!==null?(Z=Z.index,Z<Y?(Q.flags|=2,Y):Z):(Q.flags|=2,Y)):(Q.flags|=1048576,Y)}function O(Q){return e&&Q.alternate===null&&(Q.flags|=2),Q}function V(Q,Y,Z,ue){return Y===null||Y.tag!==6?(Y=oc(Z,Q.mode,ue),Y.return=Q,Y):(Y=k(Y,Z),Y.return=Q,Y)}function q(Q,Y,Z,ue){var _e=Z.type;return _e===D?ae(Q,Y,Z.props.children,ue,Z.key):Y!==null&&(Y.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===z&&yh(_e)===Y.type)?(ue=k(Y,Z.props),ue.ref=Hi(Q,Y,Z),ue.return=Q,ue):(ue=ko(Z.type,Z.key,Z.props,null,Q.mode,ue),ue.ref=Hi(Q,Y,Z),ue.return=Q,ue)}function te(Q,Y,Z,ue){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==Z.containerInfo||Y.stateNode.implementation!==Z.implementation?(Y=ac(Z,Q.mode,ue),Y.return=Q,Y):(Y=k(Y,Z.children||[]),Y.return=Q,Y)}function ae(Q,Y,Z,ue,_e){return Y===null||Y.tag!==7?(Y=Ss(Z,Q.mode,ue,_e),Y.return=Q,Y):(Y=k(Y,Z),Y.return=Q,Y)}function le(Q,Y,Z){if(typeof Y=="string"&&Y!==""||typeof Y=="number")return Y=oc(""+Y,Q.mode,Z),Y.return=Q,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case R:return Z=ko(Y.type,Y.key,Y.props,null,Q.mode,Z),Z.ref=Hi(Q,null,Y),Z.return=Q,Z;case L:return Y=ac(Y,Q.mode,Z),Y.return=Q,Y;case z:var ue=Y._init;return le(Q,ue(Y._payload),Z)}if(yr(Y)||j(Y))return Y=Ss(Y,Q.mode,Z,null),Y.return=Q,Y;eo(Q,Y)}return null}function oe(Q,Y,Z,ue){var _e=Y!==null?Y.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number")return _e!==null?null:V(Q,Y,""+Z,ue);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case R:return Z.key===_e?q(Q,Y,Z,ue):null;case L:return Z.key===_e?te(Q,Y,Z,ue):null;case z:return _e=Z._init,oe(Q,Y,_e(Z._payload),ue)}if(yr(Z)||j(Z))return _e!==null?null:ae(Q,Y,Z,ue,null);eo(Q,Z)}return null}function pe(Q,Y,Z,ue,_e){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return Q=Q.get(Z)||null,V(Y,Q,""+ue,_e);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case R:return Q=Q.get(ue.key===null?Z:ue.key)||null,q(Y,Q,ue,_e);case L:return Q=Q.get(ue.key===null?Z:ue.key)||null,te(Y,Q,ue,_e);case z:var we=ue._init;return pe(Q,Y,Z,we(ue._payload),_e)}if(yr(ue)||j(ue))return Q=Q.get(Z)||null,ae(Y,Q,ue,_e,null);eo(Y,ue)}return null}function ge(Q,Y,Z,ue){for(var _e=null,we=null,Se=Y,ke=Y=0,st=null;Se!==null&&ke<Z.length;ke++){Se.index>ke?(st=Se,Se=null):st=Se.sibling;var Le=oe(Q,Se,Z[ke],ue);if(Le===null){Se===null&&(Se=st);break}e&&Se&&Le.alternate===null&&r(Q,Se),Y=P(Le,Y,ke),we===null?_e=Le:we.sibling=Le,we=Le,Se=st}if(ke===Z.length)return n(Q,Se),We&&ps(Q,ke),_e;if(Se===null){for(;ke<Z.length;ke++)Se=le(Q,Z[ke],ue),Se!==null&&(Y=P(Se,Y,ke),we===null?_e=Se:we.sibling=Se,we=Se);return We&&ps(Q,ke),_e}for(Se=f(Q,Se);ke<Z.length;ke++)st=pe(Se,Q,ke,Z[ke],ue),st!==null&&(e&&st.alternate!==null&&Se.delete(st.key===null?ke:st.key),Y=P(st,Y,ke),we===null?_e=st:we.sibling=st,we=st);return e&&Se.forEach(function(Jr){return r(Q,Jr)}),We&&ps(Q,ke),_e}function ye(Q,Y,Z,ue){var _e=j(Z);if(typeof _e!="function")throw Error(i(150));if(Z=_e.call(Z),Z==null)throw Error(i(151));for(var we=_e=null,Se=Y,ke=Y=0,st=null,Le=Z.next();Se!==null&&!Le.done;ke++,Le=Z.next()){Se.index>ke?(st=Se,Se=null):st=Se.sibling;var Jr=oe(Q,Se,Le.value,ue);if(Jr===null){Se===null&&(Se=st);break}e&&Se&&Jr.alternate===null&&r(Q,Se),Y=P(Jr,Y,ke),we===null?_e=Jr:we.sibling=Jr,we=Jr,Se=st}if(Le.done)return n(Q,Se),We&&ps(Q,ke),_e;if(Se===null){for(;!Le.done;ke++,Le=Z.next())Le=le(Q,Le.value,ue),Le!==null&&(Y=P(Le,Y,ke),we===null?_e=Le:we.sibling=Le,we=Le);return We&&ps(Q,ke),_e}for(Se=f(Q,Se);!Le.done;ke++,Le=Z.next())Le=pe(Se,Q,ke,Le.value,ue),Le!==null&&(e&&Le.alternate!==null&&Se.delete(Le.key===null?ke:Le.key),Y=P(Le,Y,ke),we===null?_e=Le:we.sibling=Le,we=Le);return e&&Se.forEach(function(G_){return r(Q,G_)}),We&&ps(Q,ke),_e}function Ge(Q,Y,Z,ue){if(typeof Z=="object"&&Z!==null&&Z.type===D&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case R:e:{for(var _e=Z.key,we=Y;we!==null;){if(we.key===_e){if(_e=Z.type,_e===D){if(we.tag===7){n(Q,we.sibling),Y=k(we,Z.props.children),Y.return=Q,Q=Y;break e}}else if(we.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===z&&yh(_e)===we.type){n(Q,we.sibling),Y=k(we,Z.props),Y.ref=Hi(Q,we,Z),Y.return=Q,Q=Y;break e}n(Q,we);break}else r(Q,we);we=we.sibling}Z.type===D?(Y=Ss(Z.props.children,Q.mode,ue,Z.key),Y.return=Q,Q=Y):(ue=ko(Z.type,Z.key,Z.props,null,Q.mode,ue),ue.ref=Hi(Q,Y,Z),ue.return=Q,Q=ue)}return O(Q);case L:e:{for(we=Z.key;Y!==null;){if(Y.key===we)if(Y.tag===4&&Y.stateNode.containerInfo===Z.containerInfo&&Y.stateNode.implementation===Z.implementation){n(Q,Y.sibling),Y=k(Y,Z.children||[]),Y.return=Q,Q=Y;break e}else{n(Q,Y);break}else r(Q,Y);Y=Y.sibling}Y=ac(Z,Q.mode,ue),Y.return=Q,Q=Y}return O(Q);case z:return we=Z._init,Ge(Q,Y,we(Z._payload),ue)}if(yr(Z))return ge(Q,Y,Z,ue);if(j(Z))return ye(Q,Y,Z,ue);eo(Q,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"?(Z=""+Z,Y!==null&&Y.tag===6?(n(Q,Y.sibling),Y=k(Y,Z),Y.return=Q,Q=Y):(n(Q,Y),Y=oc(Z,Q.mode,ue),Y.return=Q,Q=Y),O(Q)):n(Q,Y)}return Ge}var Xs=_h(!0),xh=_h(!1),to=Fr(null),ro=null,Js=null,gl=null;function vl(){gl=Js=ro=null}function yl(e){var r=to.current;Fe(to),e._currentValue=r}function _l(e,r,n){for(;e!==null;){var f=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,f!==null&&(f.childLanes|=r)):f!==null&&(f.childLanes&r)!==r&&(f.childLanes|=r),e===n)break;e=e.return}}function Ys(e,r){ro=e,gl=Js=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&r)!==0&&(Ct=!0),e.firstContext=null)}function Ft(e){var r=e._currentValue;if(gl!==e)if(e={context:e,memoizedValue:r,next:null},Js===null){if(ro===null)throw Error(i(308));Js=e,ro.dependencies={lanes:0,firstContext:e}}else Js=Js.next=e;return r}var ms=null;function xl(e){ms===null?ms=[e]:ms.push(e)}function wh(e,r,n,f){var k=r.interleaved;return k===null?(n.next=n,xl(r)):(n.next=k.next,k.next=n),r.interleaved=n,br(e,f)}function br(e,r){e.lanes|=r;var n=e.alternate;for(n!==null&&(n.lanes|=r),n=e,e=e.return;e!==null;)e.childLanes|=r,n=e.alternate,n!==null&&(n.childLanes|=r),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Wr=!1;function wl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sh(e,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Cr(e,r){return{eventTime:e,lane:r,tag:0,payload:null,callback:null,next:null}}function Vr(e,r,n){var f=e.updateQueue;if(f===null)return null;if(f=f.shared,(Pe&2)!==0){var k=f.pending;return k===null?r.next=r:(r.next=k.next,k.next=r),f.pending=r,br(e,n)}return k=f.interleaved,k===null?(r.next=r,xl(f)):(r.next=k.next,k.next=r),f.interleaved=r,br(e,n)}function so(e,r,n){if(r=r.updateQueue,r!==null&&(r=r.shared,(n&4194240)!==0)){var f=r.lanes;f&=e.pendingLanes,n|=f,r.lanes=n,Oa(e,n)}}function bh(e,r){var n=e.updateQueue,f=e.alternate;if(f!==null&&(f=f.updateQueue,n===f)){var k=null,P=null;if(n=n.firstBaseUpdate,n!==null){do{var O={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};P===null?k=P=O:P=P.next=O,n=n.next}while(n!==null);P===null?k=P=r:P=P.next=r}else k=P=r;n={baseState:f.baseState,firstBaseUpdate:k,lastBaseUpdate:P,shared:f.shared,effects:f.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=r:e.next=r,n.lastBaseUpdate=r}function io(e,r,n,f){var k=e.updateQueue;Wr=!1;var P=k.firstBaseUpdate,O=k.lastBaseUpdate,V=k.shared.pending;if(V!==null){k.shared.pending=null;var q=V,te=q.next;q.next=null,O===null?P=te:O.next=te,O=q;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,V=ae.lastBaseUpdate,V!==O&&(V===null?ae.firstBaseUpdate=te:V.next=te,ae.lastBaseUpdate=q))}if(P!==null){var le=k.baseState;O=0,ae=te=q=null,V=P;do{var oe=V.lane,pe=V.eventTime;if((f&oe)===oe){ae!==null&&(ae=ae.next={eventTime:pe,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var ge=e,ye=V;switch(oe=r,pe=n,ye.tag){case 1:if(ge=ye.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=ye.payload,oe=typeof ge=="function"?ge.call(pe,le,oe):ge,oe==null)break e;le=F({},le,oe);break e;case 2:Wr=!0}}V.callback!==null&&V.lane!==0&&(e.flags|=64,oe=k.effects,oe===null?k.effects=[V]:oe.push(V))}else pe={eventTime:pe,lane:oe,tag:V.tag,payload:V.payload,callback:V.callback,next:null},ae===null?(te=ae=pe,q=le):ae=ae.next=pe,O|=oe;if(V=V.next,V===null){if(V=k.shared.pending,V===null)break;oe=V,V=oe.next,oe.next=null,k.lastBaseUpdate=oe,k.shared.pending=null}}while(!0);if(ae===null&&(q=le),k.baseState=q,k.firstBaseUpdate=te,k.lastBaseUpdate=ae,r=k.shared.interleaved,r!==null){k=r;do O|=k.lane,k=k.next;while(k!==r)}else P===null&&(k.shared.lanes=0);ys|=O,e.lanes=O,e.memoizedState=le}}function Ch(e,r,n){if(e=r.effects,r.effects=null,e!==null)for(r=0;r<e.length;r++){var f=e[r],k=f.callback;if(k!==null){if(f.callback=null,f=n,typeof k!="function")throw Error(i(191,k));k.call(f)}}}var Ui={},lr=Fr(Ui),Wi=Fr(Ui),Vi=Fr(Ui);function gs(e){if(e===Ui)throw Error(i(174));return e}function Sl(e,r){switch(Oe(Vi,r),Oe(Wi,e),Oe(lr,Ui),e=r.nodeType,e){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:ls(null,"");break;default:e=e===8?r.parentNode:r,r=e.namespaceURI||null,e=e.tagName,r=ls(r,e)}Fe(lr),Oe(lr,r)}function Qs(){Fe(lr),Fe(Wi),Fe(Vi)}function kh(e){gs(Vi.current);var r=gs(lr.current),n=ls(r,e.type);r!==n&&(Oe(Wi,e),Oe(lr,n))}function bl(e){Wi.current===e&&(Fe(lr),Fe(Wi))}var Ve=Fr(0);function no(e){for(var r=e;r!==null;){if(r.tag===13){var n=r.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Cl=[];function kl(){for(var e=0;e<Cl.length;e++)Cl[e]._workInProgressVersionPrimary=null;Cl.length=0}var oo=C.ReactCurrentDispatcher,El=C.ReactCurrentBatchConfig,vs=0,$e=null,Ye=null,tt=null,ao=!1,$i=!1,zi=0,g_=0;function dt(){throw Error(i(321))}function Tl(e,r){if(r===null)return!1;for(var n=0;n<r.length&&n<e.length;n++)if(!Xt(e[n],r[n]))return!1;return!0}function Rl(e,r,n,f,k,P){if(vs=P,$e=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,oo.current=e===null||e.memoizedState===null?x_:w_,e=n(f,k),$i){P=0;do{if($i=!1,zi=0,25<=P)throw Error(i(301));P+=1,tt=Ye=null,r.updateQueue=null,oo.current=S_,e=n(f,k)}while($i)}if(oo.current=uo,r=Ye!==null&&Ye.next!==null,vs=0,tt=Ye=$e=null,ao=!1,r)throw Error(i(300));return e}function Pl(){var e=zi!==0;return zi=0,e}function cr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?$e.memoizedState=tt=e:tt=tt.next=e,tt}function Ht(){if(Ye===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var r=tt===null?$e.memoizedState:tt.next;if(r!==null)tt=r,Ye=e;else{if(e===null)throw Error(i(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},tt===null?$e.memoizedState=tt=e:tt=tt.next=e}return tt}function Ki(e,r){return typeof r=="function"?r(e):r}function Ll(e){var r=Ht(),n=r.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var f=Ye,k=f.baseQueue,P=n.pending;if(P!==null){if(k!==null){var O=k.next;k.next=P.next,P.next=O}f.baseQueue=k=P,n.pending=null}if(k!==null){P=k.next,f=f.baseState;var V=O=null,q=null,te=P;do{var ae=te.lane;if((vs&ae)===ae)q!==null&&(q=q.next={lane:0,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),f=te.hasEagerState?te.eagerState:e(f,te.action);else{var le={lane:ae,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null};q===null?(V=q=le,O=f):q=q.next=le,$e.lanes|=ae,ys|=ae}te=te.next}while(te!==null&&te!==P);q===null?O=f:q.next=V,Xt(f,r.memoizedState)||(Ct=!0),r.memoizedState=f,r.baseState=O,r.baseQueue=q,n.lastRenderedState=f}if(e=n.interleaved,e!==null){k=e;do P=k.lane,$e.lanes|=P,ys|=P,k=k.next;while(k!==e)}else k===null&&(n.lanes=0);return[r.memoizedState,n.dispatch]}function Dl(e){var r=Ht(),n=r.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var f=n.dispatch,k=n.pending,P=r.memoizedState;if(k!==null){n.pending=null;var O=k=k.next;do P=e(P,O.action),O=O.next;while(O!==k);Xt(P,r.memoizedState)||(Ct=!0),r.memoizedState=P,r.baseQueue===null&&(r.baseState=P),n.lastRenderedState=P}return[P,f]}function Eh(){}function Th(e,r){var n=$e,f=Ht(),k=r(),P=!Xt(f.memoizedState,k);if(P&&(f.memoizedState=k,Ct=!0),f=f.queue,Al(Lh.bind(null,n,f,e),[e]),f.getSnapshot!==r||P||tt!==null&&tt.memoizedState.tag&1){if(n.flags|=2048,qi(9,Ph.bind(null,n,f,k,r),void 0,null),rt===null)throw Error(i(349));(vs&30)!==0||Rh(n,r,k)}return k}function Rh(e,r,n){e.flags|=16384,e={getSnapshot:r,value:n},r=$e.updateQueue,r===null?(r={lastEffect:null,stores:null},$e.updateQueue=r,r.stores=[e]):(n=r.stores,n===null?r.stores=[e]:n.push(e))}function Ph(e,r,n,f){r.value=n,r.getSnapshot=f,Dh(r)&&Ah(e)}function Lh(e,r,n){return n(function(){Dh(r)&&Ah(e)})}function Dh(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!Xt(e,n)}catch{return!0}}function Ah(e){var r=br(e,1);r!==null&&er(r,e,1,-1)}function jh(e){var r=cr();return typeof e=="function"&&(e=e()),r.memoizedState=r.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ki,lastRenderedState:e},r.queue=e,e=e.dispatch=__.bind(null,$e,e),[r.memoizedState,e]}function qi(e,r,n,f){return e={tag:e,create:r,destroy:n,deps:f,next:null},r=$e.updateQueue,r===null?(r={lastEffect:null,stores:null},$e.updateQueue=r,r.lastEffect=e.next=e):(n=r.lastEffect,n===null?r.lastEffect=e.next=e:(f=n.next,n.next=e,e.next=f,r.lastEffect=e)),e}function Mh(){return Ht().memoizedState}function lo(e,r,n,f){var k=cr();$e.flags|=e,k.memoizedState=qi(1|r,n,void 0,f===void 0?null:f)}function co(e,r,n,f){var k=Ht();f=f===void 0?null:f;var P=void 0;if(Ye!==null){var O=Ye.memoizedState;if(P=O.destroy,f!==null&&Tl(f,O.deps)){k.memoizedState=qi(r,n,P,f);return}}$e.flags|=e,k.memoizedState=qi(1|r,n,P,f)}function Oh(e,r){return lo(8390656,8,e,r)}function Al(e,r){return co(2048,8,e,r)}function Ih(e,r){return co(4,2,e,r)}function Nh(e,r){return co(4,4,e,r)}function Bh(e,r){if(typeof r=="function")return e=e(),r(e),function(){r(null)};if(r!=null)return e=e(),r.current=e,function(){r.current=null}}function Fh(e,r,n){return n=n!=null?n.concat([e]):null,co(4,4,Bh.bind(null,r,e),n)}function jl(){}function Hh(e,r){var n=Ht();r=r===void 0?null:r;var f=n.memoizedState;return f!==null&&r!==null&&Tl(r,f[1])?f[0]:(n.memoizedState=[e,r],e)}function Uh(e,r){var n=Ht();r=r===void 0?null:r;var f=n.memoizedState;return f!==null&&r!==null&&Tl(r,f[1])?f[0]:(e=e(),n.memoizedState=[e,r],e)}function Wh(e,r,n){return(vs&21)===0?(e.baseState&&(e.baseState=!1,Ct=!0),e.memoizedState=n):(Xt(n,r)||(n=yd(),$e.lanes|=n,ys|=n,e.baseState=!0),r)}function v_(e,r){var n=De;De=n!==0&&4>n?n:4,e(!0);var f=El.transition;El.transition={};try{e(!1),r()}finally{De=n,El.transition=f}}function Vh(){return Ht().memoizedState}function y_(e,r,n){var f=qr(e);if(n={lane:f,action:n,hasEagerState:!1,eagerState:null,next:null},$h(e))zh(r,n);else if(n=wh(e,r,n,f),n!==null){var k=gt();er(n,e,f,k),Kh(n,r,f)}}function __(e,r,n){var f=qr(e),k={lane:f,action:n,hasEagerState:!1,eagerState:null,next:null};if($h(e))zh(r,k);else{var P=e.alternate;if(e.lanes===0&&(P===null||P.lanes===0)&&(P=r.lastRenderedReducer,P!==null))try{var O=r.lastRenderedState,V=P(O,n);if(k.hasEagerState=!0,k.eagerState=V,Xt(V,O)){var q=r.interleaved;q===null?(k.next=k,xl(r)):(k.next=q.next,q.next=k),r.interleaved=k;return}}catch{}finally{}n=wh(e,r,k,f),n!==null&&(k=gt(),er(n,e,f,k),Kh(n,r,f))}}function $h(e){var r=e.alternate;return e===$e||r!==null&&r===$e}function zh(e,r){$i=ao=!0;var n=e.pending;n===null?r.next=r:(r.next=n.next,n.next=r),e.pending=r}function Kh(e,r,n){if((n&4194240)!==0){var f=r.lanes;f&=e.pendingLanes,n|=f,r.lanes=n,Oa(e,n)}}var uo={readContext:Ft,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},x_={readContext:Ft,useCallback:function(e,r){return cr().memoizedState=[e,r===void 0?null:r],e},useContext:Ft,useEffect:Oh,useImperativeHandle:function(e,r,n){return n=n!=null?n.concat([e]):null,lo(4194308,4,Bh.bind(null,r,e),n)},useLayoutEffect:function(e,r){return lo(4194308,4,e,r)},useInsertionEffect:function(e,r){return lo(4,2,e,r)},useMemo:function(e,r){var n=cr();return r=r===void 0?null:r,e=e(),n.memoizedState=[e,r],e},useReducer:function(e,r,n){var f=cr();return r=n!==void 0?n(r):r,f.memoizedState=f.baseState=r,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},f.queue=e,e=e.dispatch=y_.bind(null,$e,e),[f.memoizedState,e]},useRef:function(e){var r=cr();return e={current:e},r.memoizedState=e},useState:jh,useDebugValue:jl,useDeferredValue:function(e){return cr().memoizedState=e},useTransition:function(){var e=jh(!1),r=e[0];return e=v_.bind(null,e[1]),cr().memoizedState=e,[r,e]},useMutableSource:function(){},useSyncExternalStore:function(e,r,n){var f=$e,k=cr();if(We){if(n===void 0)throw Error(i(407));n=n()}else{if(n=r(),rt===null)throw Error(i(349));(vs&30)!==0||Rh(f,r,n)}k.memoizedState=n;var P={value:n,getSnapshot:r};return k.queue=P,Oh(Lh.bind(null,f,P,e),[e]),f.flags|=2048,qi(9,Ph.bind(null,f,P,n,r),void 0,null),n},useId:function(){var e=cr(),r=rt.identifierPrefix;if(We){var n=Sr,f=wr;n=(f&~(1<<32-Gt(f)-1)).toString(32)+n,r=":"+r+"R"+n,n=zi++,0<n&&(r+="H"+n.toString(32)),r+=":"}else n=g_++,r=":"+r+"r"+n.toString(32)+":";return e.memoizedState=r},unstable_isNewReconciler:!1},w_={readContext:Ft,useCallback:Hh,useContext:Ft,useEffect:Al,useImperativeHandle:Fh,useInsertionEffect:Ih,useLayoutEffect:Nh,useMemo:Uh,useReducer:Ll,useRef:Mh,useState:function(){return Ll(Ki)},useDebugValue:jl,useDeferredValue:function(e){var r=Ht();return Wh(r,Ye.memoizedState,e)},useTransition:function(){var e=Ll(Ki)[0],r=Ht().memoizedState;return[e,r]},useMutableSource:Eh,useSyncExternalStore:Th,useId:Vh,unstable_isNewReconciler:!1},S_={readContext:Ft,useCallback:Hh,useContext:Ft,useEffect:Al,useImperativeHandle:Fh,useInsertionEffect:Ih,useLayoutEffect:Nh,useMemo:Uh,useReducer:Dl,useRef:Mh,useState:function(){return Dl(Ki)},useDebugValue:jl,useDeferredValue:function(e){var r=Ht();return Ye===null?r.memoizedState=e:Wh(r,Ye.memoizedState,e)},useTransition:function(){var e=Dl(Ki)[0],r=Ht().memoizedState;return[e,r]},useMutableSource:Eh,useSyncExternalStore:Th,useId:Vh,unstable_isNewReconciler:!1};function Yt(e,r){if(e&&e.defaultProps){r=F({},r),e=e.defaultProps;for(var n in e)r[n]===void 0&&(r[n]=e[n]);return r}return r}function Ml(e,r,n,f){r=e.memoizedState,n=n(f,r),n=n==null?r:F({},r,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ho={isMounted:function(e){return(e=e._reactInternals)?us(e)===e:!1},enqueueSetState:function(e,r,n){e=e._reactInternals;var f=gt(),k=qr(e),P=Cr(f,k);P.payload=r,n!=null&&(P.callback=n),r=Vr(e,P,k),r!==null&&(er(r,e,k,f),so(r,e,k))},enqueueReplaceState:function(e,r,n){e=e._reactInternals;var f=gt(),k=qr(e),P=Cr(f,k);P.tag=1,P.payload=r,n!=null&&(P.callback=n),r=Vr(e,P,k),r!==null&&(er(r,e,k,f),so(r,e,k))},enqueueForceUpdate:function(e,r){e=e._reactInternals;var n=gt(),f=qr(e),k=Cr(n,f);k.tag=2,r!=null&&(k.callback=r),r=Vr(e,k,f),r!==null&&(er(r,e,f,n),so(r,e,f))}};function qh(e,r,n,f,k,P,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(f,P,O):r.prototype&&r.prototype.isPureReactComponent?!ji(n,f)||!ji(k,P):!0}function Gh(e,r,n){var f=!1,k=Hr,P=r.contextType;return typeof P=="object"&&P!==null?P=Ft(P):(k=bt(r)?hs:ut.current,f=r.contextTypes,P=(f=f!=null)?zs(e,k):Hr),r=new r(n,P),e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=ho,e.stateNode=r,r._reactInternals=e,f&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=k,e.__reactInternalMemoizedMaskedChildContext=P),r}function Xh(e,r,n,f){e=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(n,f),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(n,f),r.state!==e&&ho.enqueueReplaceState(r,r.state,null)}function Ol(e,r,n,f){var k=e.stateNode;k.props=n,k.state=e.memoizedState,k.refs={},wl(e);var P=r.contextType;typeof P=="object"&&P!==null?k.context=Ft(P):(P=bt(r)?hs:ut.current,k.context=zs(e,P)),k.state=e.memoizedState,P=r.getDerivedStateFromProps,typeof P=="function"&&(Ml(e,r,P,n),k.state=e.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(r=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),r!==k.state&&ho.enqueueReplaceState(k,k.state,null),io(e,n,k,f),k.state=e.memoizedState),typeof k.componentDidMount=="function"&&(e.flags|=4194308)}function Zs(e,r){try{var n="",f=r;do n+=ce(f),f=f.return;while(f);var k=n}catch(P){k=`
|
|
40
|
+
Error generating stack: `+P.message+`
|
|
41
|
+
`+P.stack}return{value:e,source:r,stack:k,digest:null}}function Il(e,r,n){return{value:e,source:null,stack:n??null,digest:r??null}}function Nl(e,r){try{console.error(r.value)}catch(n){setTimeout(function(){throw n})}}var b_=typeof WeakMap=="function"?WeakMap:Map;function Jh(e,r,n){n=Cr(-1,n),n.tag=3,n.payload={element:null};var f=r.value;return n.callback=function(){_o||(_o=!0,Ql=f),Nl(e,r)},n}function Yh(e,r,n){n=Cr(-1,n),n.tag=3;var f=e.type.getDerivedStateFromError;if(typeof f=="function"){var k=r.value;n.payload=function(){return f(k)},n.callback=function(){Nl(e,r)}}var P=e.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(n.callback=function(){Nl(e,r),typeof f!="function"&&(zr===null?zr=new Set([this]):zr.add(this));var O=r.stack;this.componentDidCatch(r.value,{componentStack:O!==null?O:""})}),n}function Qh(e,r,n){var f=e.pingCache;if(f===null){f=e.pingCache=new b_;var k=new Set;f.set(r,k)}else k=f.get(r),k===void 0&&(k=new Set,f.set(r,k));k.has(n)||(k.add(n),e=N_.bind(null,e,r,n),r.then(e,e))}function Zh(e){do{var r;if((r=e.tag===13)&&(r=e.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return e;e=e.return}while(e!==null);return null}function ef(e,r,n,f,k){return(e.mode&1)===0?(e===r?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(r=Cr(-1,1),r.tag=2,Vr(n,r,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=k,e)}var C_=C.ReactCurrentOwner,Ct=!1;function mt(e,r,n,f){r.child=e===null?xh(r,null,n,f):Xs(r,e.child,n,f)}function tf(e,r,n,f,k){n=n.render;var P=r.ref;return Ys(r,k),f=Rl(e,r,n,f,P,k),n=Pl(),e!==null&&!Ct?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~k,kr(e,r,k)):(We&&n&&dl(r),r.flags|=1,mt(e,r,f,k),r.child)}function rf(e,r,n,f,k){if(e===null){var P=n.type;return typeof P=="function"&&!nc(P)&&P.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(r.tag=15,r.type=P,sf(e,r,P,f,k)):(e=ko(n.type,null,f,r,r.mode,k),e.ref=r.ref,e.return=r,r.child=e)}if(P=e.child,(e.lanes&k)===0){var O=P.memoizedProps;if(n=n.compare,n=n!==null?n:ji,n(O,f)&&e.ref===r.ref)return kr(e,r,k)}return r.flags|=1,e=Xr(P,f),e.ref=r.ref,e.return=r,r.child=e}function sf(e,r,n,f,k){if(e!==null){var P=e.memoizedProps;if(ji(P,f)&&e.ref===r.ref)if(Ct=!1,r.pendingProps=f=P,(e.lanes&k)!==0)(e.flags&131072)!==0&&(Ct=!0);else return r.lanes=e.lanes,kr(e,r,k)}return Bl(e,r,n,f,k)}function nf(e,r,n){var f=r.pendingProps,k=f.children,P=e!==null?e.memoizedState:null;if(f.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},Oe(ti,jt),jt|=n;else{if((n&1073741824)===0)return e=P!==null?P.baseLanes|n:n,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:e,cachePool:null,transitions:null},r.updateQueue=null,Oe(ti,jt),jt|=e,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=P!==null?P.baseLanes:n,Oe(ti,jt),jt|=f}else P!==null?(f=P.baseLanes|n,r.memoizedState=null):f=n,Oe(ti,jt),jt|=f;return mt(e,r,k,n),r.child}function of(e,r){var n=r.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(r.flags|=512,r.flags|=2097152)}function Bl(e,r,n,f,k){var P=bt(n)?hs:ut.current;return P=zs(r,P),Ys(r,k),n=Rl(e,r,n,f,P,k),f=Pl(),e!==null&&!Ct?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~k,kr(e,r,k)):(We&&f&&dl(r),r.flags|=1,mt(e,r,n,k),r.child)}function af(e,r,n,f,k){if(bt(n)){var P=!0;Xn(r)}else P=!1;if(Ys(r,k),r.stateNode===null)po(e,r),Gh(r,n,f),Ol(r,n,f,k),f=!0;else if(e===null){var O=r.stateNode,V=r.memoizedProps;O.props=V;var q=O.context,te=n.contextType;typeof te=="object"&&te!==null?te=Ft(te):(te=bt(n)?hs:ut.current,te=zs(r,te));var ae=n.getDerivedStateFromProps,le=typeof ae=="function"||typeof O.getSnapshotBeforeUpdate=="function";le||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(V!==f||q!==te)&&Xh(r,O,f,te),Wr=!1;var oe=r.memoizedState;O.state=oe,io(r,f,O,k),q=r.memoizedState,V!==f||oe!==q||St.current||Wr?(typeof ae=="function"&&(Ml(r,n,ae,f),q=r.memoizedState),(V=Wr||qh(r,n,V,f,oe,q,te))?(le||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(r.flags|=4194308)):(typeof O.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=f,r.memoizedState=q),O.props=f,O.state=q,O.context=te,f=V):(typeof O.componentDidMount=="function"&&(r.flags|=4194308),f=!1)}else{O=r.stateNode,Sh(e,r),V=r.memoizedProps,te=r.type===r.elementType?V:Yt(r.type,V),O.props=te,le=r.pendingProps,oe=O.context,q=n.contextType,typeof q=="object"&&q!==null?q=Ft(q):(q=bt(n)?hs:ut.current,q=zs(r,q));var pe=n.getDerivedStateFromProps;(ae=typeof pe=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(V!==le||oe!==q)&&Xh(r,O,f,q),Wr=!1,oe=r.memoizedState,O.state=oe,io(r,f,O,k);var ge=r.memoizedState;V!==le||oe!==ge||St.current||Wr?(typeof pe=="function"&&(Ml(r,n,pe,f),ge=r.memoizedState),(te=Wr||qh(r,n,te,f,oe,ge,q)||!1)?(ae||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(f,ge,q),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(f,ge,q)),typeof O.componentDidUpdate=="function"&&(r.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof O.componentDidUpdate!="function"||V===e.memoizedProps&&oe===e.memoizedState||(r.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||V===e.memoizedProps&&oe===e.memoizedState||(r.flags|=1024),r.memoizedProps=f,r.memoizedState=ge),O.props=f,O.state=ge,O.context=q,f=te):(typeof O.componentDidUpdate!="function"||V===e.memoizedProps&&oe===e.memoizedState||(r.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||V===e.memoizedProps&&oe===e.memoizedState||(r.flags|=1024),f=!1)}return Fl(e,r,n,f,P,k)}function Fl(e,r,n,f,k,P){of(e,r);var O=(r.flags&128)!==0;if(!f&&!O)return k&&dh(r,n,!1),kr(e,r,P);f=r.stateNode,C_.current=r;var V=O&&typeof n.getDerivedStateFromError!="function"?null:f.render();return r.flags|=1,e!==null&&O?(r.child=Xs(r,e.child,null,P),r.child=Xs(r,null,V,P)):mt(e,r,V,P),r.memoizedState=f.state,k&&dh(r,n,!0),r.child}function lf(e){var r=e.stateNode;r.pendingContext?ch(e,r.pendingContext,r.pendingContext!==r.context):r.context&&ch(e,r.context,!1),Sl(e,r.containerInfo)}function cf(e,r,n,f,k){return Gs(),ml(k),r.flags|=256,mt(e,r,n,f),r.child}var Hl={dehydrated:null,treeContext:null,retryLane:0};function Ul(e){return{baseLanes:e,cachePool:null,transitions:null}}function uf(e,r,n){var f=r.pendingProps,k=Ve.current,P=!1,O=(r.flags&128)!==0,V;if((V=O)||(V=e!==null&&e.memoizedState===null?!1:(k&2)!==0),V?(P=!0,r.flags&=-129):(e===null||e.memoizedState!==null)&&(k|=1),Oe(Ve,k&1),e===null)return pl(r),e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((r.mode&1)===0?r.lanes=1:e.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(O=f.children,e=f.fallback,P?(f=r.mode,P=r.child,O={mode:"hidden",children:O},(f&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=O):P=Eo(O,f,0,null),e=Ss(e,f,n,null),P.return=r,e.return=r,P.sibling=e,r.child=P,r.child.memoizedState=Ul(n),r.memoizedState=Hl,e):Wl(r,O));if(k=e.memoizedState,k!==null&&(V=k.dehydrated,V!==null))return k_(e,r,O,f,V,k,n);if(P){P=f.fallback,O=r.mode,k=e.child,V=k.sibling;var q={mode:"hidden",children:f.children};return(O&1)===0&&r.child!==k?(f=r.child,f.childLanes=0,f.pendingProps=q,r.deletions=null):(f=Xr(k,q),f.subtreeFlags=k.subtreeFlags&14680064),V!==null?P=Xr(V,P):(P=Ss(P,O,n,null),P.flags|=2),P.return=r,f.return=r,f.sibling=P,r.child=f,f=P,P=r.child,O=e.child.memoizedState,O=O===null?Ul(n):{baseLanes:O.baseLanes|n,cachePool:null,transitions:O.transitions},P.memoizedState=O,P.childLanes=e.childLanes&~n,r.memoizedState=Hl,f}return P=e.child,e=P.sibling,f=Xr(P,{mode:"visible",children:f.children}),(r.mode&1)===0&&(f.lanes=n),f.return=r,f.sibling=null,e!==null&&(n=r.deletions,n===null?(r.deletions=[e],r.flags|=16):n.push(e)),r.child=f,r.memoizedState=null,f}function Wl(e,r){return r=Eo({mode:"visible",children:r},e.mode,0,null),r.return=e,e.child=r}function fo(e,r,n,f){return f!==null&&ml(f),Xs(r,e.child,null,n),e=Wl(r,r.pendingProps.children),e.flags|=2,r.memoizedState=null,e}function k_(e,r,n,f,k,P,O){if(n)return r.flags&256?(r.flags&=-257,f=Il(Error(i(422))),fo(e,r,O,f)):r.memoizedState!==null?(r.child=e.child,r.flags|=128,null):(P=f.fallback,k=r.mode,f=Eo({mode:"visible",children:f.children},k,0,null),P=Ss(P,k,O,null),P.flags|=2,f.return=r,P.return=r,f.sibling=P,r.child=f,(r.mode&1)!==0&&Xs(r,e.child,null,O),r.child.memoizedState=Ul(O),r.memoizedState=Hl,P);if((r.mode&1)===0)return fo(e,r,O,null);if(k.data==="$!"){if(f=k.nextSibling&&k.nextSibling.dataset,f)var V=f.dgst;return f=V,P=Error(i(419)),f=Il(P,f,void 0),fo(e,r,O,f)}if(V=(O&e.childLanes)!==0,Ct||V){if(f=rt,f!==null){switch(O&-O){case 4:k=2;break;case 16:k=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:k=32;break;case 536870912:k=268435456;break;default:k=0}k=(k&(f.suspendedLanes|O))!==0?0:k,k!==0&&k!==P.retryLane&&(P.retryLane=k,br(e,k),er(f,e,k,-1))}return ic(),f=Il(Error(i(421))),fo(e,r,O,f)}return k.data==="$?"?(r.flags|=128,r.child=e.child,r=B_.bind(null,e),k._reactRetry=r,null):(e=P.treeContext,At=Br(k.nextSibling),Dt=r,We=!0,Jt=null,e!==null&&(Nt[Bt++]=wr,Nt[Bt++]=Sr,Nt[Bt++]=fs,wr=e.id,Sr=e.overflow,fs=r),r=Wl(r,f.children),r.flags|=4096,r)}function df(e,r,n){e.lanes|=r;var f=e.alternate;f!==null&&(f.lanes|=r),_l(e.return,r,n)}function Vl(e,r,n,f,k){var P=e.memoizedState;P===null?e.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:f,tail:n,tailMode:k}:(P.isBackwards=r,P.rendering=null,P.renderingStartTime=0,P.last=f,P.tail=n,P.tailMode=k)}function hf(e,r,n){var f=r.pendingProps,k=f.revealOrder,P=f.tail;if(mt(e,r,f.children,n),f=Ve.current,(f&2)!==0)f=f&1|2,r.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=r.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&df(e,n,r);else if(e.tag===19)df(e,n,r);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break e;for(;e.sibling===null;){if(e.return===null||e.return===r)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}f&=1}if(Oe(Ve,f),(r.mode&1)===0)r.memoizedState=null;else switch(k){case"forwards":for(n=r.child,k=null;n!==null;)e=n.alternate,e!==null&&no(e)===null&&(k=n),n=n.sibling;n=k,n===null?(k=r.child,r.child=null):(k=n.sibling,n.sibling=null),Vl(r,!1,k,n,P);break;case"backwards":for(n=null,k=r.child,r.child=null;k!==null;){if(e=k.alternate,e!==null&&no(e)===null){r.child=k;break}e=k.sibling,k.sibling=n,n=k,k=e}Vl(r,!0,n,null,P);break;case"together":Vl(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function po(e,r){(r.mode&1)===0&&e!==null&&(e.alternate=null,r.alternate=null,r.flags|=2)}function kr(e,r,n){if(e!==null&&(r.dependencies=e.dependencies),ys|=r.lanes,(n&r.childLanes)===0)return null;if(e!==null&&r.child!==e.child)throw Error(i(153));if(r.child!==null){for(e=r.child,n=Xr(e,e.pendingProps),r.child=n,n.return=r;e.sibling!==null;)e=e.sibling,n=n.sibling=Xr(e,e.pendingProps),n.return=r;n.sibling=null}return r.child}function E_(e,r,n){switch(r.tag){case 3:lf(r),Gs();break;case 5:kh(r);break;case 1:bt(r.type)&&Xn(r);break;case 4:Sl(r,r.stateNode.containerInfo);break;case 10:var f=r.type._context,k=r.memoizedProps.value;Oe(to,f._currentValue),f._currentValue=k;break;case 13:if(f=r.memoizedState,f!==null)return f.dehydrated!==null?(Oe(Ve,Ve.current&1),r.flags|=128,null):(n&r.child.childLanes)!==0?uf(e,r,n):(Oe(Ve,Ve.current&1),e=kr(e,r,n),e!==null?e.sibling:null);Oe(Ve,Ve.current&1);break;case 19:if(f=(n&r.childLanes)!==0,(e.flags&128)!==0){if(f)return hf(e,r,n);r.flags|=128}if(k=r.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),Oe(Ve,Ve.current),f)break;return null;case 22:case 23:return r.lanes=0,nf(e,r,n)}return kr(e,r,n)}var ff,$l,pf,mf;ff=function(e,r){for(var n=r.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break;for(;n.sibling===null;){if(n.return===null||n.return===r)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},$l=function(){},pf=function(e,r,n,f){var k=e.memoizedProps;if(k!==f){e=r.stateNode,gs(lr.current);var P=null;switch(n){case"input":k=Me(e,k),f=Me(e,f),P=[];break;case"select":k=F({},k,{value:void 0}),f=F({},f,{value:void 0}),P=[];break;case"textarea":k=Pr(e,k),f=Pr(e,f),P=[];break;default:typeof k.onClick!="function"&&typeof f.onClick=="function"&&(e.onclick=Kn)}Ca(n,f);var O;n=null;for(te in k)if(!f.hasOwnProperty(te)&&k.hasOwnProperty(te)&&k[te]!=null)if(te==="style"){var V=k[te];for(O in V)V.hasOwnProperty(O)&&(n||(n={}),n[O]="")}else te!=="dangerouslySetInnerHTML"&&te!=="children"&&te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&te!=="autoFocus"&&(d.hasOwnProperty(te)?P||(P=[]):(P=P||[]).push(te,null));for(te in f){var q=f[te];if(V=k!=null?k[te]:void 0,f.hasOwnProperty(te)&&q!==V&&(q!=null||V!=null))if(te==="style")if(V){for(O in V)!V.hasOwnProperty(O)||q&&q.hasOwnProperty(O)||(n||(n={}),n[O]="");for(O in q)q.hasOwnProperty(O)&&V[O]!==q[O]&&(n||(n={}),n[O]=q[O])}else n||(P||(P=[]),P.push(te,n)),n=q;else te==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,V=V?V.__html:void 0,q!=null&&V!==q&&(P=P||[]).push(te,q)):te==="children"?typeof q!="string"&&typeof q!="number"||(P=P||[]).push(te,""+q):te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&(d.hasOwnProperty(te)?(q!=null&&te==="onScroll"&&Be("scroll",e),P||V===q||(P=[])):(P=P||[]).push(te,q))}n&&(P=P||[]).push("style",n);var te=P;(r.updateQueue=te)&&(r.flags|=4)}},mf=function(e,r,n,f){n!==f&&(r.flags|=4)};function Gi(e,r){if(!We)switch(e.tailMode){case"hidden":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var f=null;n!==null;)n.alternate!==null&&(f=n),n=n.sibling;f===null?r||e.tail===null?e.tail=null:e.tail.sibling=null:f.sibling=null}}function ht(e){var r=e.alternate!==null&&e.alternate.child===e.child,n=0,f=0;if(r)for(var k=e.child;k!==null;)n|=k.lanes|k.childLanes,f|=k.subtreeFlags&14680064,f|=k.flags&14680064,k.return=e,k=k.sibling;else for(k=e.child;k!==null;)n|=k.lanes|k.childLanes,f|=k.subtreeFlags,f|=k.flags,k.return=e,k=k.sibling;return e.subtreeFlags|=f,e.childLanes=n,r}function T_(e,r,n){var f=r.pendingProps;switch(hl(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ht(r),null;case 1:return bt(r.type)&&Gn(),ht(r),null;case 3:return f=r.stateNode,Qs(),Fe(St),Fe(ut),kl(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(e===null||e.child===null)&&(Zn(r)?r.flags|=4:e===null||e.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Jt!==null&&(tc(Jt),Jt=null))),$l(e,r),ht(r),null;case 5:bl(r);var k=gs(Vi.current);if(n=r.type,e!==null&&r.stateNode!=null)pf(e,r,n,f,k),e.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!f){if(r.stateNode===null)throw Error(i(166));return ht(r),null}if(e=gs(lr.current),Zn(r)){f=r.stateNode,n=r.type;var P=r.memoizedProps;switch(f[ar]=r,f[Bi]=P,e=(r.mode&1)!==0,n){case"dialog":Be("cancel",f),Be("close",f);break;case"iframe":case"object":case"embed":Be("load",f);break;case"video":case"audio":for(k=0;k<Oi.length;k++)Be(Oi[k],f);break;case"source":Be("error",f);break;case"img":case"image":case"link":Be("error",f),Be("load",f);break;case"details":Be("toggle",f);break;case"input":Ie(f,P),Be("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!P.multiple},Be("invalid",f);break;case"textarea":pt(f,P),Be("invalid",f)}Ca(n,P),k=null;for(var O in P)if(P.hasOwnProperty(O)){var V=P[O];O==="children"?typeof V=="string"?f.textContent!==V&&(P.suppressHydrationWarning!==!0&&zn(f.textContent,V,e),k=["children",V]):typeof V=="number"&&f.textContent!==""+V&&(P.suppressHydrationWarning!==!0&&zn(f.textContent,V,e),k=["children",""+V]):d.hasOwnProperty(O)&&V!=null&&O==="onScroll"&&Be("scroll",f)}switch(n){case"input":fe(f),Rr(f,P,!0);break;case"textarea":fe(f),Rt(f);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(f.onclick=Kn)}f=k,r.updateQueue=f,f!==null&&(r.flags|=4)}else{O=k.nodeType===9?k:k.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Dr(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=O.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof f.is=="string"?e=O.createElement(n,{is:f.is}):(e=O.createElement(n),n==="select"&&(O=e,f.multiple?O.multiple=!0:f.size&&(O.size=f.size))):e=O.createElementNS(e,n),e[ar]=r,e[Bi]=f,ff(e,r,!1,!1),r.stateNode=e;e:{switch(O=ka(n,f),n){case"dialog":Be("cancel",e),Be("close",e),k=f;break;case"iframe":case"object":case"embed":Be("load",e),k=f;break;case"video":case"audio":for(k=0;k<Oi.length;k++)Be(Oi[k],e);k=f;break;case"source":Be("error",e),k=f;break;case"img":case"image":case"link":Be("error",e),Be("load",e),k=f;break;case"details":Be("toggle",e),k=f;break;case"input":Ie(e,f),k=Me(e,f),Be("invalid",e);break;case"option":k=f;break;case"select":e._wrapperState={wasMultiple:!!f.multiple},k=F({},f,{value:void 0}),Be("invalid",e);break;case"textarea":pt(e,f),k=Pr(e,f),Be("invalid",e);break;default:k=f}Ca(n,k),V=k;for(P in V)if(V.hasOwnProperty(P)){var q=V[P];P==="style"?sd(e,q):P==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,q!=null&&cs(e,q)):P==="children"?typeof q=="string"?(n!=="textarea"||q!=="")&&wt(e,q):typeof q=="number"&&wt(e,""+q):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(d.hasOwnProperty(P)?q!=null&&P==="onScroll"&&Be("scroll",e):q!=null&&v(e,P,q,O))}switch(n){case"input":fe(e),Rr(e,f,!1);break;case"textarea":fe(e),Rt(e);break;case"option":f.value!=null&&e.setAttribute("value",""+B(f.value));break;case"select":e.multiple=!!f.multiple,P=f.value,P!=null?nr(e,!!f.multiple,P,!1):f.defaultValue!=null&&nr(e,!!f.multiple,f.defaultValue,!0);break;default:typeof k.onClick=="function"&&(e.onclick=Kn)}switch(n){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return ht(r),null;case 6:if(e&&r.stateNode!=null)mf(e,r,e.memoizedProps,f);else{if(typeof f!="string"&&r.stateNode===null)throw Error(i(166));if(n=gs(Vi.current),gs(lr.current),Zn(r)){if(f=r.stateNode,n=r.memoizedProps,f[ar]=r,(P=f.nodeValue!==n)&&(e=Dt,e!==null))switch(e.tag){case 3:zn(f.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&zn(f.nodeValue,n,(e.mode&1)!==0)}P&&(r.flags|=4)}else f=(n.nodeType===9?n:n.ownerDocument).createTextNode(f),f[ar]=r,r.stateNode=f}return ht(r),null;case 13:if(Fe(Ve),f=r.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(We&&At!==null&&(r.mode&1)!==0&&(r.flags&128)===0)vh(),Gs(),r.flags|=98560,P=!1;else if(P=Zn(r),f!==null&&f.dehydrated!==null){if(e===null){if(!P)throw Error(i(318));if(P=r.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(i(317));P[ar]=r}else Gs(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ht(r),P=!1}else Jt!==null&&(tc(Jt),Jt=null),P=!0;if(!P)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=n,r):(f=f!==null,f!==(e!==null&&e.memoizedState!==null)&&f&&(r.child.flags|=8192,(r.mode&1)!==0&&(e===null||(Ve.current&1)!==0?Qe===0&&(Qe=3):ic())),r.updateQueue!==null&&(r.flags|=4),ht(r),null);case 4:return Qs(),$l(e,r),e===null&&Ii(r.stateNode.containerInfo),ht(r),null;case 10:return yl(r.type._context),ht(r),null;case 17:return bt(r.type)&&Gn(),ht(r),null;case 19:if(Fe(Ve),P=r.memoizedState,P===null)return ht(r),null;if(f=(r.flags&128)!==0,O=P.rendering,O===null)if(f)Gi(P,!1);else{if(Qe!==0||e!==null&&(e.flags&128)!==0)for(e=r.child;e!==null;){if(O=no(e),O!==null){for(r.flags|=128,Gi(P,!1),f=O.updateQueue,f!==null&&(r.updateQueue=f,r.flags|=4),r.subtreeFlags=0,f=n,n=r.child;n!==null;)P=n,e=f,P.flags&=14680066,O=P.alternate,O===null?(P.childLanes=0,P.lanes=e,P.child=null,P.subtreeFlags=0,P.memoizedProps=null,P.memoizedState=null,P.updateQueue=null,P.dependencies=null,P.stateNode=null):(P.childLanes=O.childLanes,P.lanes=O.lanes,P.child=O.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=O.memoizedProps,P.memoizedState=O.memoizedState,P.updateQueue=O.updateQueue,P.type=O.type,e=O.dependencies,P.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Oe(Ve,Ve.current&1|2),r.child}e=e.sibling}P.tail!==null&&qe()>ri&&(r.flags|=128,f=!0,Gi(P,!1),r.lanes=4194304)}else{if(!f)if(e=no(O),e!==null){if(r.flags|=128,f=!0,n=e.updateQueue,n!==null&&(r.updateQueue=n,r.flags|=4),Gi(P,!0),P.tail===null&&P.tailMode==="hidden"&&!O.alternate&&!We)return ht(r),null}else 2*qe()-P.renderingStartTime>ri&&n!==1073741824&&(r.flags|=128,f=!0,Gi(P,!1),r.lanes=4194304);P.isBackwards?(O.sibling=r.child,r.child=O):(n=P.last,n!==null?n.sibling=O:r.child=O,P.last=O)}return P.tail!==null?(r=P.tail,P.rendering=r,P.tail=r.sibling,P.renderingStartTime=qe(),r.sibling=null,n=Ve.current,Oe(Ve,f?n&1|2:n&1),r):(ht(r),null);case 22:case 23:return sc(),f=r.memoizedState!==null,e!==null&&e.memoizedState!==null!==f&&(r.flags|=8192),f&&(r.mode&1)!==0?(jt&1073741824)!==0&&(ht(r),r.subtreeFlags&6&&(r.flags|=8192)):ht(r),null;case 24:return null;case 25:return null}throw Error(i(156,r.tag))}function R_(e,r){switch(hl(r),r.tag){case 1:return bt(r.type)&&Gn(),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 3:return Qs(),Fe(St),Fe(ut),kl(),e=r.flags,(e&65536)!==0&&(e&128)===0?(r.flags=e&-65537|128,r):null;case 5:return bl(r),null;case 13:if(Fe(Ve),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(i(340));Gs()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return Fe(Ve),null;case 4:return Qs(),null;case 10:return yl(r.type._context),null;case 22:case 23:return sc(),null;case 24:return null;default:return null}}var mo=!1,ft=!1,P_=typeof WeakSet=="function"?WeakSet:Set,me=null;function ei(e,r){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(f){ze(e,r,f)}else n.current=null}function zl(e,r,n){try{n()}catch(f){ze(e,r,f)}}var gf=!1;function L_(e,r){if(sl=Mn,e=qd(),Xa(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var f=n.getSelection&&n.getSelection();if(f&&f.rangeCount!==0){n=f.anchorNode;var k=f.anchorOffset,P=f.focusNode;f=f.focusOffset;try{n.nodeType,P.nodeType}catch{n=null;break e}var O=0,V=-1,q=-1,te=0,ae=0,le=e,oe=null;t:for(;;){for(var pe;le!==n||k!==0&&le.nodeType!==3||(V=O+k),le!==P||f!==0&&le.nodeType!==3||(q=O+f),le.nodeType===3&&(O+=le.nodeValue.length),(pe=le.firstChild)!==null;)oe=le,le=pe;for(;;){if(le===e)break t;if(oe===n&&++te===k&&(V=O),oe===P&&++ae===f&&(q=O),(pe=le.nextSibling)!==null)break;le=oe,oe=le.parentNode}le=pe}n=V===-1||q===-1?null:{start:V,end:q}}else n=null}n=n||{start:0,end:0}}else n=null;for(il={focusedElem:e,selectionRange:n},Mn=!1,me=r;me!==null;)if(r=me,e=r.child,(r.subtreeFlags&1028)!==0&&e!==null)e.return=r,me=e;else for(;me!==null;){r=me;try{var ge=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(ge!==null){var ye=ge.memoizedProps,Ge=ge.memoizedState,Q=r.stateNode,Y=Q.getSnapshotBeforeUpdate(r.elementType===r.type?ye:Yt(r.type,ye),Ge);Q.__reactInternalSnapshotBeforeUpdate=Y}break;case 3:var Z=r.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(i(163))}}catch(ue){ze(r,r.return,ue)}if(e=r.sibling,e!==null){e.return=r.return,me=e;break}me=r.return}return ge=gf,gf=!1,ge}function Xi(e,r,n){var f=r.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var k=f=f.next;do{if((k.tag&e)===e){var P=k.destroy;k.destroy=void 0,P!==void 0&&zl(r,n,P)}k=k.next}while(k!==f)}}function go(e,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var n=r=r.next;do{if((n.tag&e)===e){var f=n.create;n.destroy=f()}n=n.next}while(n!==r)}}function Kl(e){var r=e.ref;if(r!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof r=="function"?r(e):r.current=e}}function vf(e){var r=e.alternate;r!==null&&(e.alternate=null,vf(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&(delete r[ar],delete r[Bi],delete r[ll],delete r[h_],delete r[f_])),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 yf(e){return e.tag===5||e.tag===3||e.tag===4}function _f(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yf(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 ql(e,r,n){var f=e.tag;if(f===5||f===6)e=e.stateNode,r?n.nodeType===8?n.parentNode.insertBefore(e,r):n.insertBefore(e,r):(n.nodeType===8?(r=n.parentNode,r.insertBefore(e,n)):(r=n,r.appendChild(e)),n=n._reactRootContainer,n!=null||r.onclick!==null||(r.onclick=Kn));else if(f!==4&&(e=e.child,e!==null))for(ql(e,r,n),e=e.sibling;e!==null;)ql(e,r,n),e=e.sibling}function Gl(e,r,n){var f=e.tag;if(f===5||f===6)e=e.stateNode,r?n.insertBefore(e,r):n.appendChild(e);else if(f!==4&&(e=e.child,e!==null))for(Gl(e,r,n),e=e.sibling;e!==null;)Gl(e,r,n),e=e.sibling}var nt=null,Qt=!1;function $r(e,r,n){for(n=n.child;n!==null;)xf(e,r,n),n=n.sibling}function xf(e,r,n){if(or&&typeof or.onCommitFiberUnmount=="function")try{or.onCommitFiberUnmount(Rn,n)}catch{}switch(n.tag){case 5:ft||ei(n,r);case 6:var f=nt,k=Qt;nt=null,$r(e,r,n),nt=f,Qt=k,nt!==null&&(Qt?(e=nt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):nt.removeChild(n.stateNode));break;case 18:nt!==null&&(Qt?(e=nt,n=n.stateNode,e.nodeType===8?al(e.parentNode,n):e.nodeType===1&&al(e,n),Ti(e)):al(nt,n.stateNode));break;case 4:f=nt,k=Qt,nt=n.stateNode.containerInfo,Qt=!0,$r(e,r,n),nt=f,Qt=k;break;case 0:case 11:case 14:case 15:if(!ft&&(f=n.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){k=f=f.next;do{var P=k,O=P.destroy;P=P.tag,O!==void 0&&((P&2)!==0||(P&4)!==0)&&zl(n,r,O),k=k.next}while(k!==f)}$r(e,r,n);break;case 1:if(!ft&&(ei(n,r),f=n.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=n.memoizedProps,f.state=n.memoizedState,f.componentWillUnmount()}catch(V){ze(n,r,V)}$r(e,r,n);break;case 21:$r(e,r,n);break;case 22:n.mode&1?(ft=(f=ft)||n.memoizedState!==null,$r(e,r,n),ft=f):$r(e,r,n);break;default:$r(e,r,n)}}function wf(e){var r=e.updateQueue;if(r!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new P_),r.forEach(function(f){var k=F_.bind(null,e,f);n.has(f)||(n.add(f),f.then(k,k))})}}function Zt(e,r){var n=r.deletions;if(n!==null)for(var f=0;f<n.length;f++){var k=n[f];try{var P=e,O=r,V=O;e:for(;V!==null;){switch(V.tag){case 5:nt=V.stateNode,Qt=!1;break e;case 3:nt=V.stateNode.containerInfo,Qt=!0;break e;case 4:nt=V.stateNode.containerInfo,Qt=!0;break e}V=V.return}if(nt===null)throw Error(i(160));xf(P,O,k),nt=null,Qt=!1;var q=k.alternate;q!==null&&(q.return=null),k.return=null}catch(te){ze(k,r,te)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)Sf(r,e),r=r.sibling}function Sf(e,r){var n=e.alternate,f=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Zt(r,e),ur(e),f&4){try{Xi(3,e,e.return),go(3,e)}catch(ye){ze(e,e.return,ye)}try{Xi(5,e,e.return)}catch(ye){ze(e,e.return,ye)}}break;case 1:Zt(r,e),ur(e),f&512&&n!==null&&ei(n,n.return);break;case 5:if(Zt(r,e),ur(e),f&512&&n!==null&&ei(n,n.return),e.flags&32){var k=e.stateNode;try{wt(k,"")}catch(ye){ze(e,e.return,ye)}}if(f&4&&(k=e.stateNode,k!=null)){var P=e.memoizedProps,O=n!==null?n.memoizedProps:P,V=e.type,q=e.updateQueue;if(e.updateQueue=null,q!==null)try{V==="input"&&P.type==="radio"&&P.name!=null&&it(k,P),ka(V,O);var te=ka(V,P);for(O=0;O<q.length;O+=2){var ae=q[O],le=q[O+1];ae==="style"?sd(k,le):ae==="dangerouslySetInnerHTML"?cs(k,le):ae==="children"?wt(k,le):v(k,ae,le,te)}switch(V){case"input":Ce(k,P);break;case"textarea":Lr(k,P);break;case"select":var oe=k._wrapperState.wasMultiple;k._wrapperState.wasMultiple=!!P.multiple;var pe=P.value;pe!=null?nr(k,!!P.multiple,pe,!1):oe!==!!P.multiple&&(P.defaultValue!=null?nr(k,!!P.multiple,P.defaultValue,!0):nr(k,!!P.multiple,P.multiple?[]:"",!1))}k[Bi]=P}catch(ye){ze(e,e.return,ye)}}break;case 6:if(Zt(r,e),ur(e),f&4){if(e.stateNode===null)throw Error(i(162));k=e.stateNode,P=e.memoizedProps;try{k.nodeValue=P}catch(ye){ze(e,e.return,ye)}}break;case 3:if(Zt(r,e),ur(e),f&4&&n!==null&&n.memoizedState.isDehydrated)try{Ti(r.containerInfo)}catch(ye){ze(e,e.return,ye)}break;case 4:Zt(r,e),ur(e);break;case 13:Zt(r,e),ur(e),k=e.child,k.flags&8192&&(P=k.memoizedState!==null,k.stateNode.isHidden=P,!P||k.alternate!==null&&k.alternate.memoizedState!==null||(Yl=qe())),f&4&&wf(e);break;case 22:if(ae=n!==null&&n.memoizedState!==null,e.mode&1?(ft=(te=ft)||ae,Zt(r,e),ft=te):Zt(r,e),ur(e),f&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:Xi(4,oe,oe.return);break;case 1:ei(oe,oe.return);var ge=oe.stateNode;if(typeof ge.componentWillUnmount=="function"){f=oe,n=oe.return;try{r=f,ge.props=r.memoizedProps,ge.state=r.memoizedState,ge.componentWillUnmount()}catch(ye){ze(f,n,ye)}}break;case 5:ei(oe,oe.return);break;case 22:if(oe.memoizedState!==null){kf(le);continue}}pe!==null?(pe.return=oe,me=pe):kf(le)}ae=ae.sibling}e:for(ae=null,le=e;;){if(le.tag===5){if(ae===null){ae=le;try{k=le.stateNode,te?(P=k.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(V=le.stateNode,q=le.memoizedProps.style,O=q!=null&&q.hasOwnProperty("display")?q.display:null,V.style.display=Cn("display",O))}catch(ye){ze(e,e.return,ye)}}}else if(le.tag===6){if(ae===null)try{le.stateNode.nodeValue=te?"":le.memoizedProps}catch(ye){ze(e,e.return,ye)}}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:Zt(r,e),ur(e),f&4&&wf(e);break;case 21:break;default:Zt(r,e),ur(e)}}function ur(e){var r=e.flags;if(r&2){try{e:{for(var n=e.return;n!==null;){if(yf(n)){var f=n;break e}n=n.return}throw Error(i(160))}switch(f.tag){case 5:var k=f.stateNode;f.flags&32&&(wt(k,""),f.flags&=-33);var P=_f(e);Gl(e,P,k);break;case 3:case 4:var O=f.stateNode.containerInfo,V=_f(e);ql(e,V,O);break;default:throw Error(i(161))}}catch(q){ze(e,e.return,q)}e.flags&=-3}r&4096&&(e.flags&=-4097)}function D_(e,r,n){me=e,bf(e)}function bf(e,r,n){for(var f=(e.mode&1)!==0;me!==null;){var k=me,P=k.child;if(k.tag===22&&f){var O=k.memoizedState!==null||mo;if(!O){var V=k.alternate,q=V!==null&&V.memoizedState!==null||ft;V=mo;var te=ft;if(mo=O,(ft=q)&&!te)for(me=k;me!==null;)O=me,q=O.child,O.tag===22&&O.memoizedState!==null?Ef(k):q!==null?(q.return=O,me=q):Ef(k);for(;P!==null;)me=P,bf(P),P=P.sibling;me=k,mo=V,ft=te}Cf(e)}else(k.subtreeFlags&8772)!==0&&P!==null?(P.return=k,me=P):Cf(e)}}function Cf(e){for(;me!==null;){var r=me;if((r.flags&8772)!==0){var n=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:ft||go(5,r);break;case 1:var f=r.stateNode;if(r.flags&4&&!ft)if(n===null)f.componentDidMount();else{var k=r.elementType===r.type?n.memoizedProps:Yt(r.type,n.memoizedProps);f.componentDidUpdate(k,n.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var P=r.updateQueue;P!==null&&Ch(r,P,f);break;case 3:var O=r.updateQueue;if(O!==null){if(n=null,r.child!==null)switch(r.child.tag){case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}Ch(r,O,n)}break;case 5:var V=r.stateNode;if(n===null&&r.flags&4){n=V;var q=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":q.autoFocus&&n.focus();break;case"img":q.src&&(n.src=q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var te=r.alternate;if(te!==null){var ae=te.memoizedState;if(ae!==null){var le=ae.dehydrated;le!==null&&Ti(le)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}ft||r.flags&512&&Kl(r)}catch(oe){ze(r,r.return,oe)}}if(r===e){me=null;break}if(n=r.sibling,n!==null){n.return=r.return,me=n;break}me=r.return}}function kf(e){for(;me!==null;){var r=me;if(r===e){me=null;break}var n=r.sibling;if(n!==null){n.return=r.return,me=n;break}me=r.return}}function Ef(e){for(;me!==null;){var r=me;try{switch(r.tag){case 0:case 11:case 15:var n=r.return;try{go(4,r)}catch(q){ze(r,n,q)}break;case 1:var f=r.stateNode;if(typeof f.componentDidMount=="function"){var k=r.return;try{f.componentDidMount()}catch(q){ze(r,k,q)}}var P=r.return;try{Kl(r)}catch(q){ze(r,P,q)}break;case 5:var O=r.return;try{Kl(r)}catch(q){ze(r,O,q)}}}catch(q){ze(r,r.return,q)}if(r===e){me=null;break}var V=r.sibling;if(V!==null){V.return=r.return,me=V;break}me=r.return}}var A_=Math.ceil,vo=C.ReactCurrentDispatcher,Xl=C.ReactCurrentOwner,Ut=C.ReactCurrentBatchConfig,Pe=0,rt=null,Xe=null,ot=0,jt=0,ti=Fr(0),Qe=0,Ji=null,ys=0,yo=0,Jl=0,Yi=null,kt=null,Yl=0,ri=1/0,Er=null,_o=!1,Ql=null,zr=null,xo=!1,Kr=null,wo=0,Qi=0,Zl=null,So=-1,bo=0;function gt(){return(Pe&6)!==0?qe():So!==-1?So:So=qe()}function qr(e){return(e.mode&1)===0?1:(Pe&2)!==0&&ot!==0?ot&-ot:m_.transition!==null?(bo===0&&(bo=yd()),bo):(e=De,e!==0||(e=window.event,e=e===void 0?16:Td(e.type)),e)}function er(e,r,n,f){if(50<Qi)throw Qi=0,Zl=null,Error(i(185));Si(e,n,f),((Pe&2)===0||e!==rt)&&(e===rt&&((Pe&2)===0&&(yo|=n),Qe===4&&Gr(e,ot)),Et(e,f),n===1&&Pe===0&&(r.mode&1)===0&&(ri=qe()+500,Jn&&Ur()))}function Et(e,r){var n=e.callbackNode;my(e,r);var f=Dn(e,e===rt?ot:0);if(f===0)n!==null&&md(n),e.callbackNode=null,e.callbackPriority=0;else if(r=f&-f,e.callbackPriority!==r){if(n!=null&&md(n),r===1)e.tag===0?p_(Rf.bind(null,e)):hh(Rf.bind(null,e)),u_(function(){(Pe&6)===0&&Ur()}),n=null;else{switch(_d(f)){case 1:n=Aa;break;case 4:n=gd;break;case 16:n=Tn;break;case 536870912:n=vd;break;default:n=Tn}n=If(n,Tf.bind(null,e))}e.callbackPriority=r,e.callbackNode=n}}function Tf(e,r){if(So=-1,bo=0,(Pe&6)!==0)throw Error(i(327));var n=e.callbackNode;if(si()&&e.callbackNode!==n)return null;var f=Dn(e,e===rt?ot:0);if(f===0)return null;if((f&30)!==0||(f&e.expiredLanes)!==0||r)r=Co(e,f);else{r=f;var k=Pe;Pe|=2;var P=Lf();(rt!==e||ot!==r)&&(Er=null,ri=qe()+500,xs(e,r));do try{O_();break}catch(V){Pf(e,V)}while(!0);vl(),vo.current=P,Pe=k,Xe!==null?r=0:(rt=null,ot=0,r=Qe)}if(r!==0){if(r===2&&(k=ja(e),k!==0&&(f=k,r=ec(e,k))),r===1)throw n=Ji,xs(e,0),Gr(e,f),Et(e,qe()),n;if(r===6)Gr(e,f);else{if(k=e.current.alternate,(f&30)===0&&!j_(k)&&(r=Co(e,f),r===2&&(P=ja(e),P!==0&&(f=P,r=ec(e,P))),r===1))throw n=Ji,xs(e,0),Gr(e,f),Et(e,qe()),n;switch(e.finishedWork=k,e.finishedLanes=f,r){case 0:case 1:throw Error(i(345));case 2:ws(e,kt,Er);break;case 3:if(Gr(e,f),(f&130023424)===f&&(r=Yl+500-qe(),10<r)){if(Dn(e,0)!==0)break;if(k=e.suspendedLanes,(k&f)!==f){gt(),e.pingedLanes|=e.suspendedLanes&k;break}e.timeoutHandle=ol(ws.bind(null,e,kt,Er),r);break}ws(e,kt,Er);break;case 4:if(Gr(e,f),(f&4194240)===f)break;for(r=e.eventTimes,k=-1;0<f;){var O=31-Gt(f);P=1<<O,O=r[O],O>k&&(k=O),f&=~P}if(f=k,f=qe()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*A_(f/1960))-f,10<f){e.timeoutHandle=ol(ws.bind(null,e,kt,Er),f);break}ws(e,kt,Er);break;case 5:ws(e,kt,Er);break;default:throw Error(i(329))}}}return Et(e,qe()),e.callbackNode===n?Tf.bind(null,e):null}function ec(e,r){var n=Yi;return e.current.memoizedState.isDehydrated&&(xs(e,r).flags|=256),e=Co(e,r),e!==2&&(r=kt,kt=n,r!==null&&tc(r)),e}function tc(e){kt===null?kt=e:kt.push.apply(kt,e)}function j_(e){for(var r=e;;){if(r.flags&16384){var n=r.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var f=0;f<n.length;f++){var k=n[f],P=k.getSnapshot;k=k.value;try{if(!Xt(P(),k))return!1}catch{return!1}}}if(n=r.child,r.subtreeFlags&16384&&n!==null)n.return=r,r=n;else{if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Gr(e,r){for(r&=~Jl,r&=~yo,e.suspendedLanes|=r,e.pingedLanes&=~r,e=e.expirationTimes;0<r;){var n=31-Gt(r),f=1<<n;e[n]=-1,r&=~f}}function Rf(e){if((Pe&6)!==0)throw Error(i(327));si();var r=Dn(e,0);if((r&1)===0)return Et(e,qe()),null;var n=Co(e,r);if(e.tag!==0&&n===2){var f=ja(e);f!==0&&(r=f,n=ec(e,f))}if(n===1)throw n=Ji,xs(e,0),Gr(e,r),Et(e,qe()),n;if(n===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=r,ws(e,kt,Er),Et(e,qe()),null}function rc(e,r){var n=Pe;Pe|=1;try{return e(r)}finally{Pe=n,Pe===0&&(ri=qe()+500,Jn&&Ur())}}function _s(e){Kr!==null&&Kr.tag===0&&(Pe&6)===0&&si();var r=Pe;Pe|=1;var n=Ut.transition,f=De;try{if(Ut.transition=null,De=1,e)return e()}finally{De=f,Ut.transition=n,Pe=r,(Pe&6)===0&&Ur()}}function sc(){jt=ti.current,Fe(ti)}function xs(e,r){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,c_(n)),Xe!==null)for(n=Xe.return;n!==null;){var f=n;switch(hl(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&Gn();break;case 3:Qs(),Fe(St),Fe(ut),kl();break;case 5:bl(f);break;case 4:Qs();break;case 13:Fe(Ve);break;case 19:Fe(Ve);break;case 10:yl(f.type._context);break;case 22:case 23:sc()}n=n.return}if(rt=e,Xe=e=Xr(e.current,null),ot=jt=r,Qe=0,Ji=null,Jl=yo=ys=0,kt=Yi=null,ms!==null){for(r=0;r<ms.length;r++)if(n=ms[r],f=n.interleaved,f!==null){n.interleaved=null;var k=f.next,P=n.pending;if(P!==null){var O=P.next;P.next=k,f.next=O}n.pending=f}ms=null}return e}function Pf(e,r){do{var n=Xe;try{if(vl(),oo.current=uo,ao){for(var f=$e.memoizedState;f!==null;){var k=f.queue;k!==null&&(k.pending=null),f=f.next}ao=!1}if(vs=0,tt=Ye=$e=null,$i=!1,zi=0,Xl.current=null,n===null||n.return===null){Qe=1,Ji=r,Xe=null;break}e:{var P=e,O=n.return,V=n,q=r;if(r=ot,V.flags|=32768,q!==null&&typeof q=="object"&&typeof q.then=="function"){var te=q,ae=V,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=Zh(O);if(pe!==null){pe.flags&=-257,ef(pe,O,V,P,r),pe.mode&1&&Qh(P,te,r),r=pe,q=te;var ge=r.updateQueue;if(ge===null){var ye=new Set;ye.add(q),r.updateQueue=ye}else ge.add(q);break e}else{if((r&1)===0){Qh(P,te,r),ic();break e}q=Error(i(426))}}else if(We&&V.mode&1){var Ge=Zh(O);if(Ge!==null){(Ge.flags&65536)===0&&(Ge.flags|=256),ef(Ge,O,V,P,r),ml(Zs(q,V));break e}}P=q=Zs(q,V),Qe!==4&&(Qe=2),Yi===null?Yi=[P]:Yi.push(P),P=O;do{switch(P.tag){case 3:P.flags|=65536,r&=-r,P.lanes|=r;var Q=Jh(P,q,r);bh(P,Q);break e;case 1:V=q;var Y=P.type,Z=P.stateNode;if((P.flags&128)===0&&(typeof Y.getDerivedStateFromError=="function"||Z!==null&&typeof Z.componentDidCatch=="function"&&(zr===null||!zr.has(Z)))){P.flags|=65536,r&=-r,P.lanes|=r;var ue=Yh(P,V,r);bh(P,ue);break e}}P=P.return}while(P!==null)}Af(n)}catch(_e){r=_e,Xe===n&&n!==null&&(Xe=n=n.return);continue}break}while(!0)}function Lf(){var e=vo.current;return vo.current=uo,e===null?uo:e}function ic(){(Qe===0||Qe===3||Qe===2)&&(Qe=4),rt===null||(ys&268435455)===0&&(yo&268435455)===0||Gr(rt,ot)}function Co(e,r){var n=Pe;Pe|=2;var f=Lf();(rt!==e||ot!==r)&&(Er=null,xs(e,r));do try{M_();break}catch(k){Pf(e,k)}while(!0);if(vl(),Pe=n,vo.current=f,Xe!==null)throw Error(i(261));return rt=null,ot=0,Qe}function M_(){for(;Xe!==null;)Df(Xe)}function O_(){for(;Xe!==null&&!oy();)Df(Xe)}function Df(e){var r=Of(e.alternate,e,jt);e.memoizedProps=e.pendingProps,r===null?Af(e):Xe=r,Xl.current=null}function Af(e){var r=e;do{var n=r.alternate;if(e=r.return,(r.flags&32768)===0){if(n=T_(n,r,jt),n!==null){Xe=n;return}}else{if(n=R_(n,r),n!==null){n.flags&=32767,Xe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qe=6,Xe=null;return}}if(r=r.sibling,r!==null){Xe=r;return}Xe=r=e}while(r!==null);Qe===0&&(Qe=5)}function ws(e,r,n){var f=De,k=Ut.transition;try{Ut.transition=null,De=1,I_(e,r,n,f)}finally{Ut.transition=k,De=f}return null}function I_(e,r,n,f){do si();while(Kr!==null);if((Pe&6)!==0)throw Error(i(327));n=e.finishedWork;var k=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var P=n.lanes|n.childLanes;if(gy(e,P),e===rt&&(Xe=rt=null,ot=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||xo||(xo=!0,If(Tn,function(){return si(),null})),P=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||P){P=Ut.transition,Ut.transition=null;var O=De;De=1;var V=Pe;Pe|=4,Xl.current=null,L_(e,n),Sf(n,e),r_(il),Mn=!!sl,il=sl=null,e.current=n,D_(n),ay(),Pe=V,De=O,Ut.transition=P}else e.current=n;if(xo&&(xo=!1,Kr=e,wo=k),P=e.pendingLanes,P===0&&(zr=null),uy(n.stateNode),Et(e,qe()),r!==null)for(f=e.onRecoverableError,n=0;n<r.length;n++)k=r[n],f(k.value,{componentStack:k.stack,digest:k.digest});if(_o)throw _o=!1,e=Ql,Ql=null,e;return(wo&1)!==0&&e.tag!==0&&si(),P=e.pendingLanes,(P&1)!==0?e===Zl?Qi++:(Qi=0,Zl=e):Qi=0,Ur(),null}function si(){if(Kr!==null){var e=_d(wo),r=Ut.transition,n=De;try{if(Ut.transition=null,De=16>e?16:e,Kr===null)var f=!1;else{if(e=Kr,Kr=null,wo=0,(Pe&6)!==0)throw Error(i(331));var k=Pe;for(Pe|=4,me=e.current;me!==null;){var P=me,O=P.child;if((me.flags&16)!==0){var V=P.deletions;if(V!==null){for(var q=0;q<V.length;q++){var te=V[q];for(me=te;me!==null;){var ae=me;switch(ae.tag){case 0:case 11:case 15:Xi(8,ae,P)}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(vf(ae),ae===te){me=null;break}if(oe!==null){oe.return=pe,me=oe;break}me=pe}}}var ge=P.alternate;if(ge!==null){var ye=ge.child;if(ye!==null){ge.child=null;do{var Ge=ye.sibling;ye.sibling=null,ye=Ge}while(ye!==null)}}me=P}}if((P.subtreeFlags&2064)!==0&&O!==null)O.return=P,me=O;else e:for(;me!==null;){if(P=me,(P.flags&2048)!==0)switch(P.tag){case 0:case 11:case 15:Xi(9,P,P.return)}var Q=P.sibling;if(Q!==null){Q.return=P.return,me=Q;break e}me=P.return}}var Y=e.current;for(me=Y;me!==null;){O=me;var Z=O.child;if((O.subtreeFlags&2064)!==0&&Z!==null)Z.return=O,me=Z;else e:for(O=Y;me!==null;){if(V=me,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:go(9,V)}}catch(_e){ze(V,V.return,_e)}if(V===O){me=null;break e}var ue=V.sibling;if(ue!==null){ue.return=V.return,me=ue;break e}me=V.return}}if(Pe=k,Ur(),or&&typeof or.onPostCommitFiberRoot=="function")try{or.onPostCommitFiberRoot(Rn,e)}catch{}f=!0}return f}finally{De=n,Ut.transition=r}}return!1}function jf(e,r,n){r=Zs(n,r),r=Jh(e,r,1),e=Vr(e,r,1),r=gt(),e!==null&&(Si(e,1,r),Et(e,r))}function ze(e,r,n){if(e.tag===3)jf(e,e,n);else for(;r!==null;){if(r.tag===3){jf(r,e,n);break}else if(r.tag===1){var f=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(zr===null||!zr.has(f))){e=Zs(n,e),e=Yh(r,e,1),r=Vr(r,e,1),e=gt(),r!==null&&(Si(r,1,e),Et(r,e));break}}r=r.return}}function N_(e,r,n){var f=e.pingCache;f!==null&&f.delete(r),r=gt(),e.pingedLanes|=e.suspendedLanes&n,rt===e&&(ot&n)===n&&(Qe===4||Qe===3&&(ot&130023424)===ot&&500>qe()-Yl?xs(e,0):Jl|=n),Et(e,r)}function Mf(e,r){r===0&&((e.mode&1)===0?r=1:(r=Ln,Ln<<=1,(Ln&130023424)===0&&(Ln=4194304)));var n=gt();e=br(e,r),e!==null&&(Si(e,r,n),Et(e,n))}function B_(e){var r=e.memoizedState,n=0;r!==null&&(n=r.retryLane),Mf(e,n)}function F_(e,r){var n=0;switch(e.tag){case 13:var f=e.stateNode,k=e.memoizedState;k!==null&&(n=k.retryLane);break;case 19:f=e.stateNode;break;default:throw Error(i(314))}f!==null&&f.delete(r),Mf(e,n)}var Of;Of=function(e,r,n){if(e!==null)if(e.memoizedProps!==r.pendingProps||St.current)Ct=!0;else{if((e.lanes&n)===0&&(r.flags&128)===0)return Ct=!1,E_(e,r,n);Ct=(e.flags&131072)!==0}else Ct=!1,We&&(r.flags&1048576)!==0&&fh(r,Qn,r.index);switch(r.lanes=0,r.tag){case 2:var f=r.type;po(e,r),e=r.pendingProps;var k=zs(r,ut.current);Ys(r,n),k=Rl(null,r,f,e,k,n);var P=Pl();return r.flags|=1,typeof k=="object"&&k!==null&&typeof k.render=="function"&&k.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,bt(f)?(P=!0,Xn(r)):P=!1,r.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,wl(r),k.updater=ho,r.stateNode=k,k._reactInternals=r,Ol(r,f,e,n),r=Fl(null,r,f,!0,P,n)):(r.tag=0,We&&P&&dl(r),mt(null,r,k,n),r=r.child),r;case 16:f=r.elementType;e:{switch(po(e,r),e=r.pendingProps,k=f._init,f=k(f._payload),r.type=f,k=r.tag=U_(f),e=Yt(f,e),k){case 0:r=Bl(null,r,f,e,n);break e;case 1:r=af(null,r,f,e,n);break e;case 11:r=tf(null,r,f,e,n);break e;case 14:r=rf(null,r,f,Yt(f.type,e),n);break e}throw Error(i(306,f,""))}return r;case 0:return f=r.type,k=r.pendingProps,k=r.elementType===f?k:Yt(f,k),Bl(e,r,f,k,n);case 1:return f=r.type,k=r.pendingProps,k=r.elementType===f?k:Yt(f,k),af(e,r,f,k,n);case 3:e:{if(lf(r),e===null)throw Error(i(387));f=r.pendingProps,P=r.memoizedState,k=P.element,Sh(e,r),io(r,f,null,n);var O=r.memoizedState;if(f=O.element,P.isDehydrated)if(P={element:f,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},r.updateQueue.baseState=P,r.memoizedState=P,r.flags&256){k=Zs(Error(i(423)),r),r=cf(e,r,f,n,k);break e}else if(f!==k){k=Zs(Error(i(424)),r),r=cf(e,r,f,n,k);break e}else for(At=Br(r.stateNode.containerInfo.firstChild),Dt=r,We=!0,Jt=null,n=xh(r,null,f,n),r.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Gs(),f===k){r=kr(e,r,n);break e}mt(e,r,f,n)}r=r.child}return r;case 5:return kh(r),e===null&&pl(r),f=r.type,k=r.pendingProps,P=e!==null?e.memoizedProps:null,O=k.children,nl(f,k)?O=null:P!==null&&nl(f,P)&&(r.flags|=32),of(e,r),mt(e,r,O,n),r.child;case 6:return e===null&&pl(r),null;case 13:return uf(e,r,n);case 4:return Sl(r,r.stateNode.containerInfo),f=r.pendingProps,e===null?r.child=Xs(r,null,f,n):mt(e,r,f,n),r.child;case 11:return f=r.type,k=r.pendingProps,k=r.elementType===f?k:Yt(f,k),tf(e,r,f,k,n);case 7:return mt(e,r,r.pendingProps,n),r.child;case 8:return mt(e,r,r.pendingProps.children,n),r.child;case 12:return mt(e,r,r.pendingProps.children,n),r.child;case 10:e:{if(f=r.type._context,k=r.pendingProps,P=r.memoizedProps,O=k.value,Oe(to,f._currentValue),f._currentValue=O,P!==null)if(Xt(P.value,O)){if(P.children===k.children&&!St.current){r=kr(e,r,n);break e}}else for(P=r.child,P!==null&&(P.return=r);P!==null;){var V=P.dependencies;if(V!==null){O=P.child;for(var q=V.firstContext;q!==null;){if(q.context===f){if(P.tag===1){q=Cr(-1,n&-n),q.tag=2;var te=P.updateQueue;if(te!==null){te=te.shared;var ae=te.pending;ae===null?q.next=q:(q.next=ae.next,ae.next=q),te.pending=q}}P.lanes|=n,q=P.alternate,q!==null&&(q.lanes|=n),_l(P.return,n,r),V.lanes|=n;break}q=q.next}}else if(P.tag===10)O=P.type===r.type?null:P.child;else if(P.tag===18){if(O=P.return,O===null)throw Error(i(341));O.lanes|=n,V=O.alternate,V!==null&&(V.lanes|=n),_l(O,n,r),O=P.sibling}else O=P.child;if(O!==null)O.return=P;else for(O=P;O!==null;){if(O===r){O=null;break}if(P=O.sibling,P!==null){P.return=O.return,O=P;break}O=O.return}P=O}mt(e,r,k.children,n),r=r.child}return r;case 9:return k=r.type,f=r.pendingProps.children,Ys(r,n),k=Ft(k),f=f(k),r.flags|=1,mt(e,r,f,n),r.child;case 14:return f=r.type,k=Yt(f,r.pendingProps),k=Yt(f.type,k),rf(e,r,f,k,n);case 15:return sf(e,r,r.type,r.pendingProps,n);case 17:return f=r.type,k=r.pendingProps,k=r.elementType===f?k:Yt(f,k),po(e,r),r.tag=1,bt(f)?(e=!0,Xn(r)):e=!1,Ys(r,n),Gh(r,f,k),Ol(r,f,k,n),Fl(null,r,f,!0,e,n);case 19:return hf(e,r,n);case 22:return nf(e,r,n)}throw Error(i(156,r.tag))};function If(e,r){return pd(e,r)}function H_(e,r,n,f){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wt(e,r,n,f){return new H_(e,r,n,f)}function nc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function U_(e){if(typeof e=="function")return nc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===$)return 11;if(e===K)return 14}return 2}function Xr(e,r){var n=e.alternate;return n===null?(n=Wt(e.tag,r,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=r,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,r=e.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ko(e,r,n,f,k,P){var O=2;if(f=e,typeof e=="function")nc(e)&&(O=1);else if(typeof e=="string")O=5;else e:switch(e){case D:return Ss(n.children,k,P,r);case T:O=8,k|=8;break;case A:return e=Wt(12,n,r,k|2),e.elementType=A,e.lanes=P,e;case N:return e=Wt(13,n,r,k),e.elementType=N,e.lanes=P,e;case J:return e=Wt(19,n,r,k),e.elementType=J,e.lanes=P,e;case re:return Eo(n,k,P,r);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I:O=10;break e;case H:O=9;break e;case $:O=11;break e;case K:O=14;break e;case z:O=16,f=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return r=Wt(O,n,r,k),r.elementType=e,r.type=f,r.lanes=P,r}function Ss(e,r,n,f){return e=Wt(7,e,f,r),e.lanes=n,e}function Eo(e,r,n,f){return e=Wt(22,e,f,r),e.elementType=re,e.lanes=n,e.stateNode={isHidden:!1},e}function oc(e,r,n){return e=Wt(6,e,null,r),e.lanes=n,e}function ac(e,r,n){return r=Wt(4,e.children!==null?e.children:[],e.key,r),r.lanes=n,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}function W_(e,r,n,f,k){this.tag=r,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=Ma(0),this.expirationTimes=Ma(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ma(0),this.identifierPrefix=f,this.onRecoverableError=k,this.mutableSourceEagerHydrationData=null}function lc(e,r,n,f,k,P,O,V,q){return e=new W_(e,r,n,V,q),r===1?(r=1,P===!0&&(r|=8)):r=0,P=Wt(3,null,null,r),e.current=P,P.stateNode=e,P.memoizedState={element:f,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wl(P),e}function V_(e,r,n){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:f==null?null:""+f,children:e,containerInfo:r,implementation:n}}function Nf(e){if(!e)return Hr;e=e._reactInternals;e:{if(us(e)!==e||e.tag!==1)throw Error(i(170));var r=e;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(bt(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(i(171))}if(e.tag===1){var n=e.type;if(bt(n))return uh(e,n,r)}return r}function Bf(e,r,n,f,k,P,O,V,q){return e=lc(n,f,!0,e,k,P,O,V,q),e.context=Nf(null),n=e.current,f=gt(),k=qr(n),P=Cr(f,k),P.callback=r??null,Vr(n,P,k),e.current.lanes=k,Si(e,k,f),Et(e,f),e}function To(e,r,n,f){var k=r.current,P=gt(),O=qr(k);return n=Nf(n),r.context===null?r.context=n:r.pendingContext=n,r=Cr(P,O),r.payload={element:e},f=f===void 0?null:f,f!==null&&(r.callback=f),e=Vr(k,r,O),e!==null&&(er(e,k,O,P),so(e,k,O)),O}function Ro(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 Ff(e,r){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<r?n:r}}function cc(e,r){Ff(e,r),(e=e.alternate)&&Ff(e,r)}function $_(){return null}var Hf=typeof reportError=="function"?reportError:function(e){console.error(e)};function uc(e){this._internalRoot=e}Po.prototype.render=uc.prototype.render=function(e){var r=this._internalRoot;if(r===null)throw Error(i(409));To(e,r,null,null)},Po.prototype.unmount=uc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var r=e.containerInfo;_s(function(){To(null,e,null,null)}),r[_r]=null}};function Po(e){this._internalRoot=e}Po.prototype.unstable_scheduleHydration=function(e){if(e){var r=Sd();e={blockedOn:null,target:e,priority:r};for(var n=0;n<Or.length&&r!==0&&r<Or[n].priority;n++);Or.splice(n,0,e),n===0&&kd(e)}};function dc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Lo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Uf(){}function z_(e,r,n,f,k){if(k){if(typeof f=="function"){var P=f;f=function(){var te=Ro(O);P.call(te)}}var O=Bf(r,f,e,0,null,!1,!1,"",Uf);return e._reactRootContainer=O,e[_r]=O.current,Ii(e.nodeType===8?e.parentNode:e),_s(),O}for(;k=e.lastChild;)e.removeChild(k);if(typeof f=="function"){var V=f;f=function(){var te=Ro(q);V.call(te)}}var q=lc(e,0,!1,null,null,!1,!1,"",Uf);return e._reactRootContainer=q,e[_r]=q.current,Ii(e.nodeType===8?e.parentNode:e),_s(function(){To(r,q,n,f)}),q}function Do(e,r,n,f,k){var P=n._reactRootContainer;if(P){var O=P;if(typeof k=="function"){var V=k;k=function(){var q=Ro(O);V.call(q)}}To(r,O,e,k)}else O=z_(n,r,e,k,f);return Ro(O)}xd=function(e){switch(e.tag){case 3:var r=e.stateNode;if(r.current.memoizedState.isDehydrated){var n=wi(r.pendingLanes);n!==0&&(Oa(r,n|1),Et(r,qe()),(Pe&6)===0&&(ri=qe()+500,Ur()))}break;case 13:_s(function(){var f=br(e,1);if(f!==null){var k=gt();er(f,e,1,k)}}),cc(e,1)}},Ia=function(e){if(e.tag===13){var r=br(e,134217728);if(r!==null){var n=gt();er(r,e,134217728,n)}cc(e,134217728)}},wd=function(e){if(e.tag===13){var r=qr(e),n=br(e,r);if(n!==null){var f=gt();er(n,e,r,f)}cc(e,r)}},Sd=function(){return De},bd=function(e,r){var n=De;try{return De=e,r()}finally{De=n}},Ra=function(e,r,n){switch(r){case"input":if(Ce(e,n),r=n.name,n.type==="radio"&&r!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<n.length;r++){var f=n[r];if(f!==e&&f.form===e.form){var k=qn(f);if(!k)throw Error(i(90));he(f),Ce(f,k)}}}break;case"textarea":Lr(e,n);break;case"select":r=n.value,r!=null&&nr(e,!!n.multiple,r,!1)}},ad=rc,ld=_s;var K_={usingClientEntryPoint:!1,Events:[Fi,Vs,qn,nd,od,rc]},Zi={findFiberByHostInstance:ds,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},q_={bundleType:Zi.bundleType,version:Zi.version,rendererPackageName:Zi.rendererPackageName,rendererConfig:Zi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=hd(e),e===null?null:e.stateNode},findFiberByHostInstance:Zi.findFiberByHostInstance||$_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ao=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ao.isDisabled&&Ao.supportsFiber)try{Rn=Ao.inject(q_),or=Ao}catch{}}return Tt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K_,Tt.createPortal=function(e,r){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dc(r))throw Error(i(200));return V_(e,r,null,n)},Tt.createRoot=function(e,r){if(!dc(e))throw Error(i(299));var n=!1,f="",k=Hf;return r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onRecoverableError!==void 0&&(k=r.onRecoverableError)),r=lc(e,1,!1,null,null,n,!1,f,k),e[_r]=r.current,Ii(e.nodeType===8?e.parentNode:e),new uc(r)},Tt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var r=e._reactInternals;if(r===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=hd(r),e=e===null?null:e.stateNode,e},Tt.flushSync=function(e){return _s(e)},Tt.hydrate=function(e,r,n){if(!Lo(r))throw Error(i(200));return Do(null,e,r,!0,n)},Tt.hydrateRoot=function(e,r,n){if(!dc(e))throw Error(i(405));var f=n!=null&&n.hydratedSources||null,k=!1,P="",O=Hf;if(n!=null&&(n.unstable_strictMode===!0&&(k=!0),n.identifierPrefix!==void 0&&(P=n.identifierPrefix),n.onRecoverableError!==void 0&&(O=n.onRecoverableError)),r=Bf(r,null,e,1,n??null,k,!1,P,O),e[_r]=r.current,Ii(e),f)for(e=0;e<f.length;e++)n=f[e],k=n._getVersion,k=k(n._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[n,k]:r.mutableSourceEagerHydrationData.push(n,k);return new Po(r)},Tt.render=function(e,r,n){if(!Lo(r))throw Error(i(200));return Do(null,e,r,!1,n)},Tt.unmountComponentAtNode=function(e){if(!Lo(e))throw Error(i(40));return e._reactRootContainer?(_s(function(){Do(null,null,e,!1,function(){e._reactRootContainer=null,e[_r]=null})}),!0):!1},Tt.unstable_batchedUpdates=rc,Tt.unstable_renderSubtreeIntoContainer=function(e,r,n,f){if(!Lo(n))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Do(e,r,n,!1,f)},Tt.version="18.3.1-next-f1338f8080-20240426",Tt}var Xf;function s0(){if(Xf)return mc.exports;Xf=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(s){console.error(s)}}return t(),mc.exports=r0(),mc.exports}var Jf;function i0(){if(Jf)return jo;Jf=1;var t=s0();return jo.createRoot=t.createRoot,jo.hydrateRoot=t.hydrateRoot,jo}var n0=i0();const o0=zm(n0);var W=yu();const fr=zm(W),Yf=t=>{let s;const i=new Set,o=(p,m)=>{const u=typeof p=="function"?p(s):p;if(!Object.is(u,s)){const x=s;s=m??(typeof u!="object"||u===null)?u:Object.assign({},s,u),i.forEach(b=>b(s,x))}},d=()=>s,a={setState:o,getState:d,getInitialState:()=>l,subscribe:p=>(i.add(p),()=>i.delete(p))},l=s=t(o,d,a);return a},a0=(t=>t?Yf(t):Yf),l0=t=>t;function c0(t,s=l0){const i=fr.useSyncExternalStore(t.subscribe,fr.useCallback(()=>s(t.getState()),[t,s]),fr.useCallback(()=>s(t.getInitialState()),[t,s]));return fr.useDebugValue(i),i}const Qf=t=>{const s=a0(t),i=o=>c0(s,o);return Object.assign(i,s),i},pa=(t=>t?Qf(t):Qf);function ir(t){return"'"+t.replace(/'/g,"'\\''")+"'"}const yc=({sessionId:t})=>`claude --dangerously-skip-permissions --session-id ${ir(t)}`,Zf=({sessionId:t})=>`claude --session-id ${ir(t)}`,u0=()=>"claude --resume",Km=[{id:"sm-dangerous",label:"Session Manager (skip perms)",description:"claude --dangerously-skip-permissions in this project",category:"build",cwd:"app-cwd",command:yc},{id:"sm-safe",label:"Session Manager (safe)",description:"claude with normal permission prompts in this project",category:"build",cwd:"app-cwd",command:Zf},{id:"home-dangerous",label:"Home (skip perms)",description:"claude --dangerously-skip-permissions in ~",category:"build",cwd:"home",command:yc},{id:"pick-dangerous",label:"Pick directory (skip perms)…",description:"Choose a folder, launch claude --dangerously-skip-permissions",category:"build",cwd:"pick",command:yc},{id:"pick-safe",label:"Pick directory (safe)…",description:"Choose a folder, launch claude with normal prompts",category:"build",cwd:"pick",command:Zf},{id:"pick-resume",label:"Pick directory + resume…",description:"Choose a folder, then pick a past session to resume",category:"build",cwd:"pick",command:u0},{id:"pick-shell",label:"Pick directory (shell only)…",description:"Bare interactive shell, no claude auto-launch",category:"build",cwd:"pick",command:null}];let Vt=null;async function d0(){if(Vt)return Vt;try{const t=await window.api.app.engageRulesPath();if(!t)return Vt=[],Vt;const s=await window.api.config.readJson(t);if(!s.exists||s.parseError||!s.data)return Vt=[],Vt;const i=s.data;if(!i.presets||!Array.isArray(i.presets))return Vt=[],Vt;const o=i.projectPath;return Vt=i.presets.map(d=>({id:d.id,label:d.label,description:d.description,category:"engage",cwd:o,platform:d.platform,pipeline:d.pipeline,rules:d.rules,command:()=>`cd ${ir(o)} && ${d.cliEntry}`})),Vt}catch(t){return console.warn("[presets] Failed to load engage presets:",t),Vt=[],Vt}}async function h0(t){const s=Km.find(o=>o.id===t);return s||((await d0()).find(o=>o.id===t)??null)}async function f0(t){return t.cwd==="app-cwd"?window.api.app.cwd():t.cwd==="home"?window.api.app.homeDir():t.cwd==="pick"?window.api.app.pickDirectory():t.cwd}function qm(t,s){return t.command?t.command(s):null}function p0(t){const s=t.split("/").filter(Boolean);return s[s.length-1]||t}const Re=pa((t,s)=>({tabs:[],activeTabId:null,hydrated:!1,addTab:({id:i,cwd:o,startupCommand:d,presetId:w=null,label:g})=>{const a=i??crypto.randomUUID();if(s().tabs.find(m=>m.id===a))return t({activeTabId:a}),a;const p={id:a,claudeSessionId:a,label:g??p0(o),cwd:o,pid:null,status:"spawning",exitCode:null,startupCommand:d,presetId:w,generation:0};return t({tabs:[...s().tabs,p],activeTabId:a}),a},setTabRunning:(i,o)=>t({tabs:s().tabs.map(d=>d.id===i?{...d,pid:o,status:"running"}:d)}),setTabExited:(i,o)=>t({tabs:s().tabs.map(d=>d.id===i?{...d,status:"exited",exitCode:o}:d)}),closeTab:i=>{var w;window.api.pty.kill(i);const o=s().tabs.filter(g=>g.id!==i),d=s().activeTabId===i?((w=o[o.length-1])==null?void 0:w.id)??null:s().activeTabId;t({tabs:o,activeTabId:d})},setActive:i=>t({activeTabId:i}),restartTab:i=>{const o=s().tabs.find(g=>g.id===i);if(!o)return;window.api.pty.kill(i);const d=crypto.randomUUID(),w=g=>{t({tabs:s().tabs.map(a=>a.id===i?{...a,claudeSessionId:d,pid:null,status:"spawning",exitCode:null,startupCommand:g,generation:a.generation+1}:a)})};o.presetId?h0(o.presetId).then(g=>{w(g?qm(g,{sessionId:d,cwd:o.cwd}):`claude --dangerously-skip-permissions --session-id ${ir(d)}`)}):w(`claude --dangerously-skip-permissions --session-id ${ir(d)}`)},reorderTab:(i,o)=>{const d=[...s().tabs];if(i<0||i>=d.length||o<0||o>=d.length||i===o)return;const[w]=d.splice(i,1);d.splice(o,0,w),t({tabs:d})},restoreTabs:(i,o)=>t({tabs:i,activeTabId:o,hydrated:!0})}));async function m0(){var i;if(Re.getState().hydrated)return;try{const{tabs:o,activeTabId:d,freshStart:w}=await window.api.sessions.load();if(o.length>0){const g=await Promise.all(o.map(async l=>{let p=!w;if(p){const u=await window.api.transcripts.pathFor(l.cwd,l.claudeSessionId);p=await window.api.config.exists(u)}const m=p?l.claudeSessionId:crypto.randomUUID();return{id:l.id,claudeSessionId:m,cwd:l.cwd,label:l.label,presetId:l.presetId,pid:null,status:"spawning",exitCode:null,startupCommand:p?`claude --dangerously-skip-permissions --resume ${ir(m)}`:`claude --dangerously-skip-permissions --session-id ${ir(m)}`,generation:0}})),a=d&&g.find(l=>l.id===d)?d:((i=g[0])==null?void 0:i.id)??null;Re.getState().restoreTabs(g,a)}else Re.setState({hydrated:!0})}catch(o){console.warn("[sessions] hydrate failed:",o),Re.setState({hydrated:!0})}const t=()=>{const{tabs:o,activeTabId:d}=Re.getState(),w=o.map(g=>({id:g.id,claudeSessionId:g.claudeSessionId,cwd:g.cwd,label:g.label,presetId:g.presetId}));window.api.sessions.save({tabs:w,activeTabId:d}).catch(g=>{console.warn("[sessions] save failed:",g)})};let s=null;Re.subscribe((o,d)=>{o.hydrated&&(o.tabs===d.tabs&&o.activeTabId===d.activeTabId||(s!==null&&window.clearTimeout(s),s=window.setTimeout(t,200)))}),t()}const g0=4,ep=40,tp=6;function v0(t){const{onReorder:s,onActivate:i}=t,o=W.useRef(null),d=W.useRef(null),w=W.useRef(0),g=W.useRef(0),[a,l]=W.useState(!1),[,p]=W.useState(0),m=W.useRef(i);m.current=i;const u=W.useCallback(()=>o.current?Array.from(o.current.querySelectorAll("[data-drag-index]")):[],[]),x=W.useCallback((c,y,h)=>{for(let v=0;v<y.length;v++){const C=y[v].left+y[v].width/2;if(c<C)return v<=h?v:v-1}return y.length-1},[]),b=W.useCallback(()=>{const c=d.current,y=o.current;if(!(c!=null&&c.active)||!y)return;const h=y.getBoundingClientRect(),v=c.startX+c.deltaX,C=v-h.left,R=h.right-v;C<ep?y.scrollLeft-=tp:R<ep&&(y.scrollLeft+=tp),w.current=requestAnimationFrame(b)},[]);W.useEffect(()=>{const c=o.current;if(!c)return;let y=!1;const h=()=>{y||(y=!0,g.current=requestAnimationFrame(()=>{y=!1,p(R=>R+1)}))},v=R=>{var I;const L=d.current;if(!L)return;const D=R.clientX-L.startX;if(!L.active&&Math.abs(D)<g0)return;if(!L.active){L.active=!0,L.tabRects=u().map(H=>H.getBoundingClientRect()),l(!0);try{(I=o.current)==null||I.setPointerCapture(L.pointerId)}catch{}w.current=requestAnimationFrame(b)}L.deltaX=D;const T=L.tabRects[L.fromIndex],A=T.left+T.width/2+D;L.currentIndex=x(A,L.tabRects,L.fromIndex),h()},C=R=>{const L=d.current;if(L&&L.pointerId===R.pointerId){cancelAnimationFrame(w.current),cancelAnimationFrame(g.current);try{c.releasePointerCapture(L.pointerId)}catch{}L.active&&L.fromIndex!==L.currentIndex?s(L.fromIndex,L.currentIndex):m.current(L.fromIndex),d.current=null,l(!1),p(D=>D+1)}};return c.addEventListener("pointermove",v),c.addEventListener("pointerup",C),c.addEventListener("pointercancel",C),()=>{c.removeEventListener("pointermove",v),c.removeEventListener("pointerup",C),c.removeEventListener("pointercancel",C),cancelAnimationFrame(w.current),cancelAnimationFrame(g.current)}},[s,u,x,b]);const E=W.useCallback((c,y)=>{c.button!==0||c.target.closest("button")||(d.current={active:!1,fromIndex:y,currentIndex:y,startX:c.clientX,deltaX:0,tabRects:[],pointerId:c.pointerId})},[]);return{getTabDragProps:W.useCallback(c=>{var v;const y=d.current,h={};if(y!=null&&y.active)if(c===y.fromIndex)h.transform=`translateX(${y.deltaX}px) scale(1.03)`,h.zIndex=10,h.opacity=.85,h.boxShadow="0 2px 8px rgba(0,0,0,0.4)",h.position="relative",h.pointerEvents="none";else{const C=y.fromIndex,R=y.currentIndex,D=(((v=y.tabRects[C])==null?void 0:v.width)??0)+4;h.transition="transform 0.15s ease",C<R&&c>C&&c<=R?h.transform=`translateX(-${D}px)`:C>R&&c>=R&&c<C?h.transform=`translateX(${D}px)`:h.transform="translateX(0)"}return{onPointerDown:C=>E(C,c),style:h,"data-drag-index":c}},[E]),isDragging:a,containerRef:o}}function y0(){const{tabs:t,activeTabId:s,addTab:i,closeTab:o,setActive:d,reorderTab:w}=Re(),[g,a]=W.useState(null),{getTabDragProps:l,isDragging:p,containerRef:m}=v0({tabCount:t.length,onReorder:w,onActivate:x=>{const b=t[x];b&&d(b.id)}}),u=async()=>{a(null);try{const x=await window.api.app.pickDirectory();if(!x)return;const b=crypto.randomUUID(),E=`claude --dangerously-skip-permissions --session-id ${ir(b)}`;i({id:b,cwd:x,startupCommand:E,presetId:"pick-dangerous"})}catch(x){const b=x instanceof Error?x.message:String(x);a(b),console.error("[TabBar] createPickedSession failed:",x)}};return _.jsxs("div",{className:"h-9 bg-bg-elev border-b border-line flex items-center px-2 gap-1 shrink-0",children:[_.jsx("div",{ref:m,className:`flex items-center gap-1 overflow-x-auto min-w-0 flex-1 select-none ${p?"cursor-grabbing":""}`,children:t.map((x,b)=>{const E=x.id===s,S=l(b);return _.jsxs("div",{...S,style:S.style,className:`group px-3 py-1 flex items-center gap-2 border border-line rounded-t text-xs shrink-0 ${p?"":"cursor-grab"} ${E?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg"}`,title:x.cwd,children:[_.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${x.status==="running"?"bg-green-500":x.status==="spawning"?"bg-yellow-500 animate-pulse":"bg-fg-faint"}`}),_.jsx("span",{children:x.label}),_.jsx("button",{onClick:c=>{c.stopPropagation(),o(x.id)},className:"text-fg-faint opacity-0 group-hover:opacity-100 hover:text-fg ml-1",title:"Close session",children:"×"})]},x.id)})}),_.jsx("div",{className:"shrink-0",children:_.jsx("button",{onClick:u,className:"px-2 py-1 text-fg-dim hover:text-fg text-xs",title:"New session — pick a project directory",children:"+ new"})}),g&&_.jsx("div",{className:"text-red-400 text-xs px-2 shrink-0",children:g}),_.jsx("div",{className:"text-fg-faint text-xs px-2 shrink-0",children:"Claude Session Manager"})]})}const _0=5e3,$o=16e3;let Mo=null,ta=!1,Es=!1;function Gm(){return Mo||(Mo=new Worker(new URL(""+new URL("whisperWorker-BhZpQ_3S.js",import.meta.url).href,import.meta.url),{type:"module"}),Mo)}function x0(t){if(ta||Es)return;Es=!0;const s=Gm(),i=o=>{o.data.type==="status"&&(t==null||t(o.data.status,o.data.message),o.data.status==="ready"&&(ta=!0,Es=!1)),o.data.type==="error"&&(Es=!1,t==null||t("error",o.data.error))};s.addEventListener("message",i),s.postMessage({type:"load"})}function w0(){var t;return typeof Worker<"u"&&!!((t=navigator.mediaDevices)!=null&&t.getUserMedia)}async function S0(t){const s=await t.arrayBuffer(),o=await new OfflineAudioContext(1,1,$o).decodeAudioData(s),d=new OfflineAudioContext(1,Math.ceil(o.duration*$o),$o),w=d.createBufferSource();return w.buffer=o,w.connect(d.destination),w.start(),(await d.startRendering()).getChannelData(0)}function b0(t){const s=Gm();let i=!1,o=null,d=null,w=[],g=null;const a=async()=>{if(w.length===0)return;const p=new Blob(w,{type:w[0].type});w=[];try{const m=await S0(p);s.postMessage({type:"transcribe",audio:m},[m.buffer])}catch{}},l=p=>{var m;if(!i)if(p.data.type==="result"){const u=p.data.text;u&&t.onFinal(u)}else p.data.type==="error"?t.onError(p.data.error):p.data.type==="status"&&((m=t.onModelStatus)==null||m.call(t,p.data.status,p.data.message),p.data.status==="ready"&&(ta=!0,Es=!1))};return s.addEventListener("message",l),{start:async()=>{if(!i){!ta&&!Es&&(Es=!0,t.onInterim("Loading speech model..."),s.postMessage({type:"load"}));try{d=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:$o,channelCount:1,echoCancellation:!0}})}catch(p){const m=p instanceof Error?p.message:"Microphone access denied";t.onError(m);return}o=new MediaRecorder(d,{mimeType:MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm"}),o.ondataavailable=p=>{p.data.size>0&&w.push(p.data)},o.start(1e3),t.onInterim("Listening..."),g=setInterval(()=>{!i&&w.length>0&&(t.onInterim("Transcribing..."),a())},_0)}},stop:()=>{g&&(clearInterval(g),g=null),o&&o.state!=="inactive"&&o.stop(),w.length>0&&(t.onInterim("Transcribing..."),a()),d==null||d.getTracks().forEach(p=>p.stop()),d=null,o=null},destroy:()=>{if(i=!0,g&&(clearInterval(g),g=null),o&&o.state!=="inactive")try{o.stop()}catch{}d==null||d.getTracks().forEach(p=>p.stop()),d=null,o=null,s.removeEventListener("message",l)}}}let Tr=null;const Ot=pa((t,s)=>({isRecording:!1,ttsEnabled:!1,autoSend:!1,lastTranscript:"",error:null,modelStatus:"idle",initModel:()=>{s().modelStatus==="idle"&&(t({modelStatus:"loading"}),x0(i=>{t(i==="ready"?{modelStatus:"ready"}:i==="error"?{modelStatus:"error"}:{modelStatus:"loading"})}))},startRecording:i=>{if(!s().isRecording){if(!w0()){t({error:"Microphone or Web Worker not available"});return}try{const o=b0({onInterim:d=>t({lastTranscript:d}),onFinal:d=>{const w=s().autoSend?d+`
|
|
42
|
+
`:d;window.api.pty.write({tabId:i,data:w}),t({lastTranscript:""})},onError:d=>{t({error:d,isRecording:!1}),Tr==null||Tr.destroy(),Tr=null},onModelStatus:d=>{d==="ready"?t({modelStatus:"ready"}):d==="loading"&&t({modelStatus:"loading"})}});o.start(),Tr=o,t({isRecording:!0,error:null,lastTranscript:""})}catch(o){t({error:o instanceof Error?o.message:"Failed to start recording"})}}},stopRecording:()=>{Tr&&(Tr.stop(),Tr.destroy(),Tr=null),t({isRecording:!1,lastTranscript:""})},toggleTTS:()=>t(i=>({ttsEnabled:!i.ttsEnabled})),setAutoSend:i=>t({autoSend:i}),clearError:()=>t({error:null})}));function C0(){const t=Ot(m=>m.isRecording),s=Ot(m=>m.error),i=Ot(m=>m.modelStatus),o=Ot(m=>m.startRecording),d=Ot(m=>m.stopRecording),w=Ot(m=>m.initModel),g=Re(m=>m.activeTabId);W.useEffect(()=>{w()},[w]);const a=()=>{t?d():g&&o(g)},l=i==="loading",p=s||(l?"Downloading speech model...":t?"Stop recording":"Voice input (local Whisper, fully offline)");return _.jsx("button",{onClick:a,disabled:l,title:p,className:`p-1.5 rounded transition-colors ${l?"text-fg-faint animate-pulse cursor-wait":t?"text-red-400 ring-2 ring-red-400 animate-pulse":"text-fg-dim hover:text-fg"}`,children:_.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("rect",{x:"9",y:"1",width:"6",height:"12",rx:"3"}),_.jsx("path",{d:"M5 10a7 7 0 0 0 14 0"}),_.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"}),_.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"})]})})}function k0(){const t=Ot(i=>i.ttsEnabled),s=Ot(i=>i.toggleTTS);return _.jsx("button",{onClick:s,title:t?"Disable TTS":"Enable TTS",className:`p-1.5 rounded transition-colors ${t?"text-accent":"text-fg-dim hover:text-fg"}`,children:_.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),t?_.jsxs(_.Fragment,{children:[_.jsx("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"}),_.jsx("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14"})]}):_.jsxs(_.Fragment,{children:[_.jsx("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),_.jsx("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]})]})})}const E0=[{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"},{key:"agent-view",label:"Agent-View",live:!0}];function T0({active:t,onChange:s,onNewSession:i}){return _.jsxs("nav",{className:"w-52 bg-bg-elev border-r border-line shrink-0 overflow-y-auto py-2 flex flex-col",children:[_.jsx("div",{className:"flex-1",children:E0.map(o=>_.jsxs("button",{onClick:()=>s(o.key),className:`w-full text-left px-4 py-1.5 text-xs flex items-center justify-between transition-colors ${t===o.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:[_.jsx("span",{children:o.label}),o.live&&_.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent animate-pulse"})]},o.key))}),i&&_.jsxs("div",{className:"px-3 py-3 border-t border-line flex items-center gap-2",children:[_.jsx(C0,{}),_.jsx(k0,{}),_.jsx("button",{onClick:i,className:"flex-1 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 R0(){const t=Re(d=>d.tabs),s=Re(d=>d.activeTabId),i=Re(d=>d.restartTab),o=t.find(d=>d.id===s)??null;return _.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:[_.jsxs("span",{children:["status: ",_.jsx("span",{className:"text-fg-dim",children:(o==null?void 0:o.status)??"—"})]}),_.jsxs("span",{children:["pid: ",_.jsx("span",{className:"text-fg-dim",children:(o==null?void 0:o.pid)??"—"})]}),_.jsx("span",{children:"tokens: — in / — out"}),_.jsx("span",{children:"cost: $—"}),_.jsx("div",{className:"flex-1"}),o&&o.status==="running"&&_.jsx("button",{onClick:()=>i(o.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"}),_.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"}),_.jsxs("span",{className:"truncate max-w-md",children:["cwd: ",_.jsx("span",{className:"text-fg-dim",children:(o==null?void 0:o.cwd)??"—"})]})]})}var _c={exports:{}},rp;function P0(){return rp||(rp=1,(function(t,s){(function(i,o){t.exports=o()})(globalThis,(()=>(()=>{var i={4567:function(g,a,l){var p=this&&this.__decorate||function(h,v,C,R){var L,D=arguments.length,T=D<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,C):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,v,C,R);else for(var A=h.length-1;A>=0;A--)(L=h[A])&&(T=(D<3?L(T):D>3?L(v,C,T):L(v,C))||T);return D>3&&T&&Object.defineProperty(v,C,T),T},m=this&&this.__param||function(h,v){return function(C,R){v(C,R,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const u=l(9042),x=l(9924),b=l(844),E=l(4725),S=l(2585),c=l(3656);let y=a.AccessibilityManager=class extends b.Disposable{constructor(h,v,C,R){super(),this._terminal=h,this._coreBrowserService=C,this._renderService=R,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let 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 x.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((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(`
|
|
43
|
+
`)))),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,c.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(h){for(let v=0;v<h;v++)this._handleChar(" ")}_handleChar(h){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==h&&(this._charsToAnnounce+=h):this._charsToAnnounce+=h,h===`
|
|
44
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(h){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(h)||this._charsToConsume.push(h)}_refreshRows(h,v){this._liveRegionDebouncer.refresh(h,v,this._terminal.rows)}_renderRows(h,v){const C=this._terminal.buffer,R=C.lines.length.toString();for(let L=h;L<=v;L++){const D=C.lines.get(C.ydisp+L),T=[],A=(D==null?void 0:D.translateToString(!0,void 0,void 0,T))||"",I=(C.ydisp+L+1).toString(),H=this._rowElements[L];H&&(A.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=A,this._rowColumns.set(H,T)),H.setAttribute("aria-posinset",I),H.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(h,v){const C=h.target,R=this._rowElements[v===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||h.relatedTarget!==R)return;let L,D;if(v===0?(L=C,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(L=this._rowElements.shift(),D=C,this._rowContainer.removeChild(L)),L.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),v===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(v===0?-1:1),this._rowElements[v===0?1:this._rowElements.length-2].focus(),h.preventDefault(),h.stopImmediatePropagation()}_handleSelectionChange(){var A;if(this._rowElements.length===0)return;const h=document.getSelection();if(!h)return;if(h.isCollapsed)return void(this._rowContainer.contains(h.anchorNode)&&this._terminal.clearSelection());if(!h.anchorNode||!h.focusNode)return void console.error("anchorNode and/or focusNode are null");let v={node:h.anchorNode,offset:h.anchorOffset},C={node:h.focusNode,offset:h.focusOffset};if((v.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===C.node&&v.offset>C.offset)&&([v,C]=[C,v]),v.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(v={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(v.node))return;const R=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:R,offset:((A=R.textContent)==null?void 0:A.length)??0}),!this._rowContainer.contains(C.node))return;const L=({node:I,offset:H})=>{const $=I instanceof Text?I.parentNode:I;let N=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(N))return console.warn("row is invalid. Race condition?"),null;const J=this._rowColumns.get($);if(!J)return console.warn("columns is null. Race condition?"),null;let K=H<J.length?J[H]:J.slice(-1)[0]+1;return K>=this._terminal.cols&&(++N,K=0),{row:N,column:K}},D=L(v),T=L(C);if(D&&T){if(D.row>T.row||D.row===T.row&&D.column>=T.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(T.row-D.row)*this._terminal.cols-D.column+T.column)}}_handleResize(h){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let v=this._rowContainer.children.length;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);for(;this._rowElements.length>h;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const h=this._coreBrowserService.mainDocument.createElement("div");return h.setAttribute("role","listitem"),h.tabIndex=-1,this._refreshRowDimensions(h),h}_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 h=0;h<this._terminal.rows;h++)this._refreshRowDimensions(this._rowElements[h])}}_refreshRowDimensions(h){h.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=y=p([m(1,S.IInstantiationService),m(2,E.ICoreBrowserService),m(3,E.IRenderService)],y)},3614:(g,a)=>{function l(x){return x.replace(/\r?\n/g,"\r")}function p(x,b){return b?"\x1B[200~"+x+"\x1B[201~":x}function m(x,b,E,S){x=p(x=l(x),E.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(x,!0),b.value=""}function u(x,b,E){const S=E.getBoundingClientRect(),c=x.clientX-S.left-10,y=x.clientY-S.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${c}px`,b.style.top=`${y}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=l,a.bracketTextForPaste=p,a.copyHandler=function(x,b){x.clipboardData&&x.clipboardData.setData("text/plain",b.selectionText),x.preventDefault()},a.handlePasteEvent=function(x,b,E,S){x.stopPropagation(),x.clipboardData&&m(x.clipboardData.getData("text/plain"),b,E,S)},a.paste=m,a.moveTextAreaUnderMouseCursor=u,a.rightClickHandler=function(x,b,E,S,c){u(x,b,E),c&&S.rightClickSelect(x),b.value=S.selectionText,b.select()}},7239:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const p=l(1505);a.ColorContrastCache=class{constructor(){this._color=new p.TwoKeyMap,this._css=new p.TwoKeyMap}setCss(m,u,x){this._css.set(m,u,x)}getCss(m,u){return this._css.get(m,u)}setColor(m,u,x){this._color.set(m,u,x)}getColor(m,u){return this._color.get(m,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(l,p,m,u){l.addEventListener(p,m,u);let x=!1;return{dispose:()=>{x||(x=!0,l.removeEventListener(p,m,u))}}}},3551:function(g,a,l){var p=this&&this.__decorate||function(y,h,v,C){var R,L=arguments.length,D=L<3?h:C===null?C=Object.getOwnPropertyDescriptor(h,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,h,v,C);else for(var T=y.length-1;T>=0;T--)(R=y[T])&&(D=(L<3?R(D):L>3?R(h,v,D):R(h,v))||D);return L>3&&D&&Object.defineProperty(h,v,D),D},m=this&&this.__param||function(y,h){return function(v,C){h(v,C,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const u=l(3656),x=l(8460),b=l(844),E=l(2585),S=l(4725);let c=a.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(y,h,v,C,R){super(),this._element=y,this._mouseService=h,this._renderService=v,this._bufferService=C,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new x.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new x.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.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,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(y){this._lastMouseEvent=y;const h=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!h)return;this._isMouseOut=!1;const v=y.composedPath();for(let C=0;C<v.length;C++){const R=v[C];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&h.x===this._lastBufferCell.x&&h.y===this._lastBufferCell.y||(this._handleHover(h),this._lastBufferCell=h)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,h){var C,R;this._activeProviderReplies&&h||((C=this._activeProviderReplies)==null||C.forEach((L=>{L==null||L.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let v=!1;for(const[L,D]of this._linkProviderService.linkProviders.entries())h?(R=this._activeProviderReplies)!=null&&R.get(L)&&(v=this._checkLinkProviderResult(L,y,v)):D.provideLinks(y.y,(T=>{var I,H;if(this._isMouseOut)return;const A=T==null?void 0:T.map(($=>({link:$})));(I=this._activeProviderReplies)==null||I.set(L,A),v=this._checkLinkProviderResult(L,y,v),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,h){const v=new Set;for(let C=0;C<h.size;C++){const R=h.get(C);if(R)for(let L=0;L<R.length;L++){const D=R[L],T=D.link.range.start.y<y?0:D.link.range.start.x,A=D.link.range.end.y>y?this._bufferService.cols:D.link.range.end.x;for(let I=T;I<=A;I++){if(v.has(I)){R.splice(L--,1);break}v.add(I)}}}}_checkLinkProviderResult(y,h,v){var L;if(!this._activeProviderReplies)return v;const C=this._activeProviderReplies.get(y);let R=!1;for(let D=0;D<y;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(R=!0);if(!R&&C){const D=C.find((T=>this._linkAtPosition(T.link,h)));D&&(v=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!v)for(let D=0;D<this._activeProviderReplies.size;D++){const T=(L=this._activeProviderReplies.get(D))==null?void 0:L.find((A=>this._linkAtPosition(A.link,h)));if(T){v=!0,this._handleNewLink(T);break}}return v}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const h=this._positionFromMouseEvent(y,this._element,this._mouseService);h&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,h)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,h){this._currentLink&&this._lastMouseEvent&&(!y||!h||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=h)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._linkAtPosition(y.link,h)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>{var v,C;return(C=(v=this._currentLink)==null?void 0:v.state)==null?void 0:C.decorations.pointerCursor},set:v=>{var C;(C=this._currentLink)!=null&&C.state&&this._currentLink.state.decorations.pointerCursor!==v&&(this._currentLink.state.decorations.pointerCursor=v,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",v))}},underline:{get:()=>{var v,C;return(C=(v=this._currentLink)==null?void 0:v.state)==null?void 0:C.decorations.underline},set:v=>{var C,R,L;(C=this._currentLink)!=null&&C.state&&((L=(R=this._currentLink)==null?void 0:R.state)==null?void 0:L.decorations.underline)!==v&&(this._currentLink.state.decorations.underline=v,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,v))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((v=>{if(!this._currentLink)return;const C=v.start===0?0:v.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+v.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(C,R),this._lastMouseEvent)){const L=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);L&&this._askForLink(L,!1)}}))))}_linkHover(y,h,v){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),h.hover&&h.hover(v,h.text)}_fireUnderlineEvent(y,h){const v=y.range,C=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(v.start.x-1,v.start.y-C-1,v.end.x,v.end.y-C-1,void 0);(h?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(y,h,v){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),h.leave&&h.leave(v,h.text)}_linkAtPosition(y,h){const v=y.range.start.y*this._bufferService.cols+y.range.start.x,C=y.range.end.y*this._bufferService.cols+y.range.end.x,R=h.y*this._bufferService.cols+h.x;return v<=R&&R<=C}_positionFromMouseEvent(y,h,v){const C=v.getCoords(y,h,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,h,v,C,R){return{x1:y,y1:h,x2:v,y2:C,cols:this._bufferService.cols,fg:R}}};a.Linkifier=c=p([m(1,S.IMouseService),m(2,S.IRenderService),m(3,E.IBufferService),m(4,S.ILinkProviderService)],c)},9042:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(g,a,l){var p=this&&this.__decorate||function(S,c,y,h){var v,C=arguments.length,R=C<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,y):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(S,c,y,h);else for(var L=S.length-1;L>=0;L--)(v=S[L])&&(R=(C<3?v(R):C>3?v(c,y,R):v(c,y))||R);return C>3&&R&&Object.defineProperty(c,y,R),R},m=this&&this.__param||function(S,c){return function(y,h){c(y,h,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const u=l(511),x=l(2585);let b=a.OscLinkProvider=class{constructor(S,c,y){this._bufferService=S,this._optionsService=c,this._oscLinkService=y}provideLinks(S,c){var A;const y=this._bufferService.buffer.lines.get(S-1);if(!y)return void c(void 0);const h=[],v=this._optionsService.rawOptions.linkHandler,C=new u.CellData,R=y.getTrimmedLength();let L=-1,D=-1,T=!1;for(let I=0;I<R;I++)if(D!==-1||y.hasContent(I)){if(y.loadCell(I,C),C.hasExtendedAttrs()&&C.extended.urlId){if(D===-1){D=I,L=C.extended.urlId;continue}T=C.extended.urlId!==L}else D!==-1&&(T=!0);if(T||D!==-1&&I===R-1){const H=(A=this._oscLinkService.getLinkData(L))==null?void 0:A.uri;if(H){const $={start:{x:D+1,y:S},end:{x:I+(T||I!==R-1?0:1),y:S}};let N=!1;if(!(v!=null&&v.allowNonHttpProtocols))try{const J=new URL(H);["http:","https:"].includes(J.protocol)||(N=!0)}catch{N=!0}N||h.push({text:H,range:$,activate:(J,K)=>v?v.activate(J,K,$):E(0,K),hover:(J,K)=>{var z;return(z=v==null?void 0:v.hover)==null?void 0:z.call(v,J,K,$)},leave:(J,K)=>{var z;return(z=v==null?void 0:v.leave)==null?void 0:z.call(v,J,K,$)}})}T=!1,C.hasExtendedAttrs()&&C.extended.urlId?(D=I,L=C.extended.urlId):(D=-1,L=-1)}}c(h)}};function E(S,c){if(confirm(`Do you want to navigate to ${c}?
|
|
45
|
+
|
|
46
|
+
WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=b=p([m(0,x.IBufferService),m(1,x.IOptionsService),m(2,x.IOscLinkService)],b)},6193:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(l,p){this._renderCallback=l,this._coreBrowserService=p,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,p,m){this._rowCount=m,l=l!==void 0?l:0,p=p!==void 0?p:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,p):p,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,p),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const p=l(3614),m=l(3656),u=l(3551),x=l(9042),b=l(3730),E=l(1680),S=l(3107),c=l(5744),y=l(2950),h=l(1296),v=l(428),C=l(4269),R=l(5114),L=l(8934),D=l(3230),T=l(9312),A=l(4725),I=l(6731),H=l(8055),$=l(8969),N=l(8460),J=l(844),K=l(6114),z=l(8437),re=l(2584),G=l(7399),j=l(5941),F=l(9074),M=l(2585),U=l(5435),ee=l(4567),ne=l(779);class ce extends $.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(X={}){super(X),this.browser=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new J.MutableDisposable),this._onCursorMove=this.register(new N.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new N.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new N.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new N.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new N.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new N.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new N.EventEmitter),this._onBlur=this.register(new N.EventEmitter),this._onA11yCharEmitter=this.register(new N.EventEmitter),this._onA11yTabEmitter=this.register(new N.EventEmitter),this._onWillOpen=this.register(new N.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(F.DecorationService),this._instantiationService.setService(M.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(A.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((B,ie)=>this.refresh(B,ie)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((B=>this._reportWindowsOptions(B)))),this.register(this._inputHandler.onColor((B=>this._handleColorEvent(B)))),this.register((0,N.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,N.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((B=>this._afterResize(B.cols,B.rows)))),this.register((0,J.toDisposable)((()=>{var B,ie;this._customKeyEventHandler=void 0,(ie=(B=this.element)==null?void 0:B.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const B of X){let ie,se="";switch(B.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;"+B.index}switch(B.type){case 0:const fe=H.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${re.C0.ESC}]${se};${(0,j.toRgbString)(fe)}${re.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors((he=>he.ansi[B.index]=H.channels.toColor(...B.color)));else{const he=ie;this._themeService.modifyColors((Ee=>Ee[he]=H.channels.toColor(...B.color)))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ee.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(re.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var X;return(X=this.textarea)==null?void 0:X.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 X=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(X);if(!B)return;const ie=Math.min(this.buffer.x,this.cols-1),se=this._renderService.dimensions.css.cell.height,fe=B.getWidth(ie),he=this._renderService.dimensions.css.cell.width*fe,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,Me=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Me+"px",this.textarea.style.top=Ee+"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,m.addDisposableDomListener)(this.element,"copy",(B=>{this.hasSelection()&&(0,p.copyHandler)(B,this._selectionService)})));const X=B=>(0,p.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,m.addDisposableDomListener)(this.element,"paste",X)),K.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(B=>{B.button===2&&(0,p.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(B=>{(0,p.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),K.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(B=>{B.button===1&&(0,p.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){var ie;if(!X)throw new Error("Terminal requires a parent element.");if(X.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=X.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"),X.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.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,m.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),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",x.promptLabel),K.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(R.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(A.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(v.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(A.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(A.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(A.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(A.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(y.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(L.MouseService),this._instantiationService.setService(A.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(E.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((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(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(A.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,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,m.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(c.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(h.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,B=this.element;function ie(he){const Ee=X._mouseService.getMouseReportCoords(he,X.screenElement);if(!Ee)return!1;let Me,Ie;switch(he.overrideType||he.type){case"mousemove":Ie=32,he.buttons===void 0?(Me=3,he.button!==void 0&&(Me=he.button<3?he.button:3)):Me=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":Ie=0,Me=he.button<3?he.button:3;break;case"mousedown":Ie=1,Me=he.button<3?he.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(he)===!1||X.viewport.getLinesScrolled(he)===0)return!1;Ie=he.deltaY<0?0:1,Me=4;break;default:return!1}return!(Ie===void 0||Me===void 0||Me>4)&&X.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:Me,action:Ie,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||(B.addEventListener("mousemove",fe.mousemove),se.mousemove=fe.mousemove):(B.removeEventListener("mousemove",se.mousemove),se.mousemove=null),16&he?se.wheel||(B.addEventListener("wheel",fe.wheel,{passive:!1}),se.wheel=fe.wheel):(B.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,m.addDisposableDomListener)(B,"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,m.addDisposableDomListener)(B,"wheel",(he=>{if(!se.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const Ee=this.viewport.getLinesScrolled(he);if(Ee===0)return;const Me=re.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let Ie="";for(let it=0;it<Math.abs(Ee);it++)Ie+=Me;return this.coreService.triggerDataEvent(Ie,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(B,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(B,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(X,B){var ie;(ie=this._renderService)==null||ie.refreshRows(X,B)}updateCursorStyle(X){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect(X)?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(X,B,ie=0){var se;ie===1?(super.scrollLines(X,B,ie),this.refresh(0,this.rows-1)):(se=this.viewport)==null||se.scrollLines(X)}paste(X){(0,p.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,B,ie){this._selectionService.setSelection(X,B,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 X;(X=this._selectionService)==null||X.clearSelection()}selectAll(){var X;(X=this._selectionService)==null||X.selectAll()}selectLines(X,B){var ie;(ie=this._selectionService)==null||ie.selectLines(X,B)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!B&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,G.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),ie.type===3||ie.type===2){const se=this.rows-1;return this.scrollLines(ie.type===2?-se:se),this.cancel(X,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(ie.cancel&&this.cancel(X,!0),!ie.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.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:X}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,B){const ie=X.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||X.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||X.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?ie:ie&&(!B.keyCode||B.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)B=X.charCode;else if(X.which===null||X.which===void 0)B=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;B=X.which}return!(!B||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=X.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(X),!0}return!1}resize(X,B){X!==this.cols||B!==this.rows?super.resize(X,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,B){var ie,se;(ie=this._charSizeService)==null||ie.measure(),(se=this.viewport)==null||se.syncScrollArea(!0)}clear(){var X;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 B=1;B<this.rows;B++)this.buffer.lines.push(this.buffer.getBlankLine(z.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(X=this.viewport)==null||X.reset(),this.refresh(0,this.rows-1)}}reset(){var B,ie;this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),(B=this._selectionService)==null||B.reset(),this._decorationService.reset(),(ie=this.viewport)==null||ie.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){var X;(X=this._renderService)==null||X.clearTextureAtlas()}_reportFocus(){var X;(X=this.element)!=null&&X.classList.contains("focus")?this.coreService.triggerDataEvent(re.C0.ESC+"[I"):this.coreService.triggerDataEvent(re.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case U.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const B=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};${B}t`);break;case U.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(X,B){if(this.options.cancelEvents||B)return X.preventDefault(),X.stopPropagation(),!1}}a.Terminal=ce},9924:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(l,p=1e3){this._renderCallback=l,this._debounceThresholdMS=p,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,p,m){this._rowCount=m,l=l!==void 0?l:0,p=p!==void 0?p:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,p):p;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const x=u-this._lastRefreshMs,b=this._debounceThresholdMS-x;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,p)}}},1680:function(g,a,l){var p=this&&this.__decorate||function(y,h,v,C){var R,L=arguments.length,D=L<3?h:C===null?C=Object.getOwnPropertyDescriptor(h,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,h,v,C);else for(var T=y.length-1;T>=0;T--)(R=y[T])&&(D=(L<3?R(D):L>3?R(h,v,D):R(h,v))||D);return L>3&&D&&Object.defineProperty(h,v,D),D},m=this&&this.__param||function(y,h){return function(v,C){h(v,C,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const u=l(3656),x=l(4725),b=l(8460),E=l(844),S=l(2585);let c=a.Viewport=class extends E.Disposable{constructor(y,h,v,C,R,L,D,T){super(),this._viewportElement=y,this._scrollArea=h,this._bufferService=v,this._optionsService=C,this._charSizeService=R,this._renderService=L,this._coreBrowserService=D,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 b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((A=>this._activeBuffer=A.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((A=>this._renderDimensions=A))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((A=>this._handleThemeChange(A)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.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(y){if(y)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 h=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==h&&(this._lastRecordedBufferHeight=h,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){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 h=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<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(y,h){const v=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(h<0&&this._viewportElement.scrollTop!==0||h>0&&v<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const h=this._getPixelsScrolled(y);return h!==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+h:this._smoothScrollState.target+=h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=h,this._bubbleScroll(y,h))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const h=y*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let h=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?h*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._currentRowHeight*this._bufferService.rows),h}getBufferElements(y,h){var T;let v,C="";const R=[],L=h??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let A=y;A<L;A++){const I=D.get(A);if(!I)continue;const H=(T=D.get(A+1))==null?void 0:T.isWrapped;if(C+=I.translateToString(!H),!H||A===D.length-1){const $=document.createElement("div");$.textContent=C,R.push($),C.length>0&&(v=$),C=""}}return{bufferElements:R,cursorElement:v}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let h=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(h/=this._currentRowHeight+0,this._wheelPartialScroll+=h,h=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._bufferService.rows),h}_applyScrollModifier(y,h){const v=this._optionsService.rawOptions.fastScrollModifier;return v==="alt"&&h.altKey||v==="ctrl"&&h.ctrlKey||v==="shift"&&h.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const h=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,h!==0&&(this._viewportElement.scrollTop+=h,this._bubbleScroll(y,h))}};a.Viewport=c=p([m(2,S.IBufferService),m(3,S.IOptionsService),m(4,x.ICharSizeService),m(5,x.IRenderService),m(6,x.ICoreBrowserService),m(7,x.IThemeService)],c)},3107:function(g,a,l){var p=this&&this.__decorate||function(S,c,y,h){var v,C=arguments.length,R=C<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,y):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(S,c,y,h);else for(var L=S.length-1;L>=0;L--)(v=S[L])&&(R=(C<3?v(R):C>3?v(c,y,R):v(c,y))||R);return C>3&&R&&Object.defineProperty(c,y,R),R},m=this&&this.__param||function(S,c){return function(y,h){c(y,h,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const u=l(4725),x=l(844),b=l(2585);let E=a.BufferDecorationRenderer=class extends x.Disposable{constructor(S,c,y,h,v){super(),this._screenElement=S,this._bufferService=c,this._coreBrowserService=y,this._decorationService=h,this._renderService=v,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((C=>this._removeDecoration(C)))),this.register((0,x.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){var h;const c=this._coreBrowserService.mainDocument.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((h=S==null?void 0:S.options)==null?void 0:h.layer)==="top"),c.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=S.options.x??0;return y&&y>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(S,c),c}_refreshStyle(S){const c=S.marker.line-this._bufferService.buffers.active.ydisp;if(c<0||c>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let y=this._decorationElements.get(S);y||(y=this._createElement(S),S.element=y,this._decorationElements.set(S,y),this._container.appendChild(y),S.onDispose((()=>{this._decorationElements.delete(S),y.remove()}))),y.style.top=c*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(y)}}_refreshXPosition(S,c=S.element){if(!c)return;const y=S.options.x??0;(S.options.anchor||"left")==="right"?c.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":c.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var c;(c=this._decorationElements.get(S))==null||c.remove(),this._decorationElements.delete(S),S.dispose()}};a.BufferDecorationRenderer=E=p([m(1,b.IBufferService),m(2,u.ICoreBrowserService),m(3,b.IDecorationService),m(4,u.IRenderService)],E)},5871:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(l){if(l.options.overviewRulerOptions){for(const p of this._zones)if(p.color===l.options.overviewRulerOptions.color&&p.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(p,l.marker.line))return;if(this._lineAdjacentToZone(p,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(p,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,p){return p>=l.startBufferLine&&p<=l.endBufferLine}_lineAdjacentToZone(l,p,m){return p>=l.startBufferLine-this._linePadding[m||"full"]&&p<=l.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(l,p){l.startBufferLine=Math.min(l.startBufferLine,p),l.endBufferLine=Math.max(l.endBufferLine,p)}}},5744:function(g,a,l){var p=this&&this.__decorate||function(v,C,R,L){var D,T=arguments.length,A=T<3?C:L===null?L=Object.getOwnPropertyDescriptor(C,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(v,C,R,L);else for(var I=v.length-1;I>=0;I--)(D=v[I])&&(A=(T<3?D(A):T>3?D(C,R,A):D(C,R))||A);return T>3&&A&&Object.defineProperty(C,R,A),A},m=this&&this.__param||function(v,C){return function(R,L){C(R,L,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const u=l(5871),x=l(4725),b=l(844),E=l(2585),S={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let h=a.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(v,C,R,L,D,T,A){var H;super(),this._viewportElement=v,this._screenElement=C,this._bufferService=R,this._decorationService=L,this._renderService=D,this._optionsService=T,this._coreBrowserService=A,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(H=this._viewportElement.parentElement)==null||H.insertBefore(this._canvas,this._viewportElement);const I=this._canvas.getContext("2d");if(!I)throw new Error("Ctx cannot be null");this._ctx=I,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var $;($=this._canvas)==null||$.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const v=Math.floor(this._canvas.width/3),C=Math.ceil(this._canvas.width/3);c.full=this._canvas.width,c.left=v,c.center=C,c.right=v,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=c.left,y.right=c.left+c.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowserService.dpr);S.left=C,S.center=C,S.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const v=this._colorZoneStore.zones;for(const C of v)C.position!=="full"&&this._renderColorZone(C);for(const C of v)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(v){this._ctx.fillStyle=v.color,this._ctx.fillRect(y[v.position||"full"],Math.round((this._canvas.height-1)*(v.startBufferLine/this._bufferService.buffers.active.lines.length)-S[v.position||"full"]/2),c[v.position||"full"],Math.round((this._canvas.height-1)*((v.endBufferLine-v.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[v.position||"full"]))}_queueRefresh(v,C){this._shouldUpdateDimensions=v||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=h=p([m(2,E.IBufferService),m(3,E.IDecorationService),m(4,x.IRenderService),m(5,E.IOptionsService),m(6,x.ICoreBrowserService)],h)},2950:function(g,a,l){var p=this&&this.__decorate||function(S,c,y,h){var v,C=arguments.length,R=C<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,y):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(S,c,y,h);else for(var L=S.length-1;L>=0;L--)(v=S[L])&&(R=(C<3?v(R):C>3?v(c,y,R):v(c,y))||R);return C>3&&R&&Object.defineProperty(c,y,R),R},m=this&&this.__param||function(S,c){return function(y,h){c(y,h,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const u=l(4725),x=l(2585),b=l(2584);let E=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,c,y,h,v,C){this._textarea=S,this._compositionView=c,this._bufferService=y,this._optionsService=h,this._coreService=v,this._renderService=C,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const c={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,c.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(c.start,c.end):this._textarea.value.substring(c.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const c=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(c,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const c=this._textarea.value,y=c.replace(S,"");this._dataAlreadySent=y,c.length>S.length?this._coreService.triggerDataEvent(y,!0):c.length<S.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):c.length===S.length&&c!==S&&this._coreService.triggerDataEvent(c,!0)}}),0)}updateCompositionElements(S){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const c=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,h=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,v=c*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=v+"px",this._compositionView.style.top=h+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const C=this._compositionView.getBoundingClientRect();this._textarea.style.left=v+"px",this._textarea.style.top=h+"px",this._textarea.style.width=Math.max(C.width,1)+"px",this._textarea.style.height=Math.max(C.height,1)+"px",this._textarea.style.lineHeight=C.height+"px"}S||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=E=p([m(2,x.IBufferService),m(3,x.IOptionsService),m(4,x.ICoreService),m(5,u.IRenderService)],E)},9806:(g,a)=>{function l(p,m,u){const x=u.getBoundingClientRect(),b=p.getComputedStyle(u),E=parseInt(b.getPropertyValue("padding-left")),S=parseInt(b.getPropertyValue("padding-top"));return[m.clientX-x.left-E,m.clientY-x.top-S]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=l,a.getCoords=function(p,m,u,x,b,E,S,c,y){if(!E)return;const h=l(p,m,u);return h?(h[0]=Math.ceil((h[0]+(y?S/2:0))/S),h[1]=Math.ceil(h[1]/c),h[0]=Math.min(Math.max(h[0],1),x+(y?1:0)),h[1]=Math.min(Math.max(h[1],1),b),h):void 0}},9504:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const p=l(2584);function m(c,y,h,v){const C=c-u(c,h),R=y-u(y,h),L=Math.abs(C-R)-(function(D,T,A){let I=0;const H=D-u(D,A),$=T-u(T,A);for(let N=0;N<Math.abs(H-$);N++){const J=x(D,T)==="A"?-1:1,K=A.buffer.lines.get(H+J*N);K!=null&&K.isWrapped&&I++}return I})(c,y,h);return S(L,E(x(c,y),v))}function u(c,y){let h=0,v=y.buffer.lines.get(c),C=v==null?void 0:v.isWrapped;for(;C&&c>=0&&c<y.rows;)h++,v=y.buffer.lines.get(--c),C=v==null?void 0:v.isWrapped;return h}function x(c,y){return c>y?"A":"B"}function b(c,y,h,v,C,R){let L=c,D=y,T="";for(;L!==h||D!==v;)L+=C?1:-1,C&&L>R.cols-1?(T+=R.buffer.translateBufferLineToString(D,!1,c,L),L=0,c=0,D++):!C&&L<0&&(T+=R.buffer.translateBufferLineToString(D,!1,0,c+1),L=R.cols-1,c=L,D--);return T+R.buffer.translateBufferLineToString(D,!1,c,L)}function E(c,y){const h=y?"O":"[";return p.C0.ESC+h+c}function S(c,y){c=Math.floor(c);let h="";for(let v=0;v<c;v++)h+=y;return h}a.moveToCellSequence=function(c,y,h,v){const C=h.buffer.x,R=h.buffer.y;if(!h.buffer.hasScrollback)return(function(T,A,I,H,$,N){return m(A,H,$,N).length===0?"":S(b(T,A,T,A-u(A,$),!1,$).length,E("D",N))})(C,R,0,y,h,v)+m(R,y,h,v)+(function(T,A,I,H,$,N){let J;J=m(A,H,$,N).length>0?H-u(H,$):A;const K=H,z=(function(re,G,j,F,M,U){let ee;return ee=m(j,F,M,U).length>0?F-u(F,M):G,re<j&&ee<=F||re>=j&&ee<F?"C":"D"})(T,A,I,H,$,N);return S(b(T,J,I,K,z==="C",$).length,E(z,N))})(C,R,c,y,h,v);let L;if(R===y)return L=C>c?"D":"C",S(Math.abs(C-c),E(L,v));L=R>y?"D":"C";const D=Math.abs(R-y);return S((function(T,A){return A.cols-T})(R>y?c:C,h)+(D-1)*h.cols+1+((R>y?C:c)-1),E(L,v))}},1296:function(g,a,l){var p=this&&this.__decorate||function(N,J,K,z){var re,G=arguments.length,j=G<3?J:z===null?z=Object.getOwnPropertyDescriptor(J,K):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(N,J,K,z);else for(var F=N.length-1;F>=0;F--)(re=N[F])&&(j=(G<3?re(j):G>3?re(J,K,j):re(J,K))||j);return G>3&&j&&Object.defineProperty(J,K,j),j},m=this&&this.__param||function(N,J){return function(K,z){J(K,z,N)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const u=l(3787),x=l(2550),b=l(2223),E=l(6171),S=l(6052),c=l(4725),y=l(8055),h=l(8460),v=l(844),C=l(2585),R="xterm-dom-renderer-owner-",L="xterm-rows",D="xterm-fg-",T="xterm-bg-",A="xterm-focus",I="xterm-selection";let H=1,$=a.DomRenderer=class extends v.Disposable{constructor(N,J,K,z,re,G,j,F,M,U,ee,ne,ce){super(),this._terminal=N,this._document=J,this._element=K,this._screenElement=z,this._viewportElement=re,this._helperContainer=G,this._linkifier2=j,this._charSizeService=M,this._optionsService=U,this._bufferService=ee,this._coreBrowserService=ne,this._themeService=ce,this._terminalClass=H++,this._rowElements=[],this._selectionRenderModel=(0,S.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new h.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(I),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,E.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((de=>this._injectCss(de)))),this._injectCss(this._themeService.colors),this._rowFactory=F.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(R+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,v.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new x.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const N=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*N,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*N),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/N),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/N),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 K of this._rowElements)K.style.width=`${this.dimensions.css.canvas.width}px`,K.style.height=`${this.dimensions.css.cell.height}px`,K.style.lineHeight=`${this.dimensions.css.cell.height}px`,K.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const J=`${this._terminalSelector} .${L} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=J,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(N){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let J=`${this._terminalSelector} .${L} { color: ${N.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;J+=`${this._terminalSelector} .${L} .xterm-dim { color: ${y.color.multiplyOpacity(N.foreground,.5).css};}`,J+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const K=`blink_underline_${this._terminalClass}`,z=`blink_bar_${this._terminalClass}`,re=`blink_block_${this._terminalClass}`;J+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,J+=`@keyframes ${z} { 50% { box-shadow: none; }}`,J+=`@keyframes ${re} { 0% { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css}; } 50% { background-color: inherit; color: ${N.cursor.css}; }}`,J+=`${this._terminalSelector} .${L}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${L}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${L}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${re} 1s step-end infinite;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css};}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${N.cursor.css} !important; color: ${N.cursorAccent.css} !important;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${N.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${N.cursor.css} inset;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${N.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,J+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${N.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${N.selectionInactiveBackgroundOpaque.css};}`;for(const[G,j]of N.ansi.entries())J+=`${this._terminalSelector} .${D}${G} { color: ${j.css}; }${this._terminalSelector} .${D}${G}.xterm-dim { color: ${y.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${T}${G} { background-color: ${j.css}; }`;J+=`${this._terminalSelector} .${D}${b.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(N.background).css}; }${this._terminalSelector} .${D}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(N.background),.5).css}; }${this._terminalSelector} .${T}${b.INVERTED_DEFAULT_COLOR} { background-color: ${N.foreground.css}; }`,this._themeStyleElement.textContent=J}_setDefaultSpacing(){const N=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${N}px`,this._rowFactory.defaultSpacing=N}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(N,J){for(let K=this._rowElements.length;K<=J;K++){const z=this._document.createElement("div");this._rowContainer.appendChild(z),this._rowElements.push(z)}for(;this._rowElements.length>J;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(N,J){this._refreshRowElements(N,J),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(A),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(A),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(N,J,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(N,J,K),this.renderRows(0,this._bufferService.rows-1),!N||!J)return;this._selectionRenderModel.update(this._terminal,N,J,K);const z=this._selectionRenderModel.viewportStartRow,re=this._selectionRenderModel.viewportEndRow,G=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(G>=this._bufferService.rows||j<0)return;const F=this._document.createDocumentFragment();if(K){const M=N[0]>J[0];F.appendChild(this._createSelectionElement(G,M?J[0]:N[0],M?N[0]:J[0],j-G+1))}else{const M=z===G?N[0]:0,U=G===re?J[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(G,M,U));const ee=j-G-1;if(F.appendChild(this._createSelectionElement(G+1,0,this._bufferService.cols,ee)),G!==j){const ne=re===j?J[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(j,0,ne))}}this._selectionContainer.appendChild(F)}_createSelectionElement(N,J,K,z=1){const re=this._document.createElement("div"),G=J*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(K-J);return G+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-G),re.style.height=z*this.dimensions.css.cell.height+"px",re.style.top=N*this.dimensions.css.cell.height+"px",re.style.left=`${G}px`,re.style.width=`${j}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 N of this._rowElements)N.replaceChildren()}renderRows(N,J){const K=this._bufferService.buffer,z=K.ybase+K.y,re=Math.min(K.x,this._bufferService.cols-1),G=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,F=this._optionsService.rawOptions.cursorInactiveStyle;for(let M=N;M<=J;M++){const U=M+K.ydisp,ee=this._rowElements[M],ne=K.lines.get(U);if(!ee||!ne)break;ee.replaceChildren(...this._rowFactory.createRow(ne,U,U===z,j,F,re,G,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!0)}_handleLinkLeave(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!1)}_setCellUnderline(N,J,K,z,re,G){K<0&&(N=0),z<0&&(J=0);const j=this._bufferService.rows-1;K=Math.max(Math.min(K,j),0),z=Math.max(Math.min(z,j),0),re=Math.min(re,this._bufferService.cols);const F=this._bufferService.buffer,M=F.ybase+F.y,U=Math.min(F.x,re-1),ee=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let de=K;de<=z;++de){const X=de+F.ydisp,B=this._rowElements[de],ie=F.lines.get(X);if(!B||!ie)break;B.replaceChildren(...this._rowFactory.createRow(ie,X,X===M,ne,ce,U,ee,this.dimensions.css.cell.width,this._widthCache,G?de===K?N:0:-1,G?(de===z?J:re)-1:-1))}}};a.DomRenderer=$=p([m(7,C.IInstantiationService),m(8,c.ICharSizeService),m(9,C.IOptionsService),m(10,C.IBufferService),m(11,c.ICoreBrowserService),m(12,c.IThemeService)],$)},3787:function(g,a,l){var p=this&&this.__decorate||function(L,D,T,A){var I,H=arguments.length,$=H<3?D:A===null?A=Object.getOwnPropertyDescriptor(D,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(L,D,T,A);else for(var N=L.length-1;N>=0;N--)(I=L[N])&&($=(H<3?I($):H>3?I(D,T,$):I(D,T))||$);return H>3&&$&&Object.defineProperty(D,T,$),$},m=this&&this.__param||function(L,D){return function(T,A){D(T,A,L)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const u=l(2223),x=l(643),b=l(511),E=l(2585),S=l(8055),c=l(4725),y=l(4269),h=l(6171),v=l(3734);let C=a.DomRendererRowFactory=class{constructor(L,D,T,A,I,H,$){this._document=L,this._characterJoinerService=D,this._optionsService=T,this._coreBrowserService=A,this._coreService=I,this._decorationService=H,this._themeService=$,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(L,D,T){this._selectionStart=L,this._selectionEnd=D,this._columnSelectMode=T}createRow(L,D,T,A,I,H,$,N,J,K,z){const re=[],G=this._characterJoinerService.getJoinedCharacters(D),j=this._themeService.colors;let F,M=L.getNoBgTrimmedLength();T&&M<H+1&&(M=H+1);let U=0,ee="",ne=0,ce=0,de=0,X=!1,B=0,ie=!1,se=0;const fe=[],he=K!==-1&&z!==-1;for(let Ee=0;Ee<M;Ee++){L.loadCell(Ee,this._workCell);let Me=this._workCell.getWidth();if(Me===0)continue;let Ie=!1,it=Ee,Ce=this._workCell;if(G.length>0&&Ee===G[0][0]){Ie=!0;const Ne=G.shift();Ce=new y.JoinedCellData(this._workCell,L.translateToString(!0,Ne[0],Ne[1]),Ne[1]-Ne[0]),it=Ne[1]-1,Me=Ce.getWidth()}const Rr=this._isCellInSelection(Ee,D),as=T&&Ee===H,yr=he&&Ee>=K&&Ee<=z;let nr=!1;this._decorationService.forEachDecorationAtCell(Ee,D,void 0,(Ne=>{nr=!0}));let Pr=Ce.getChars()||x.WHITESPACE_CELL_CHAR;if(Pr===" "&&(Ce.isUnderline()||Ce.isOverline())&&(Pr=" "),se=Me*N-J.get(Pr,Ce.isBold(),Ce.isItalic()),F){if(U&&(Rr&&ie||!Rr&&!ie&&Ce.bg===ne)&&(Rr&&ie&&j.selectionForeground||Ce.fg===ce)&&Ce.extended.ext===de&&yr===X&&se===B&&!as&&!Ie&&!nr){Ce.isInvisible()?ee+=x.WHITESPACE_CELL_CHAR:ee+=Pr,U++;continue}U&&(F.textContent=ee),F=this._document.createElement("span"),U=0,ee=""}else F=this._document.createElement("span");if(ne=Ce.bg,ce=Ce.fg,de=Ce.extended.ext,X=yr,B=se,ie=Rr,Ie&&H>=Ee&&H<=it&&(H=Ee),!this._coreService.isCursorHidden&&as&&this._coreService.isCursorInitialized){if(fe.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&fe.push("xterm-cursor-blink"),fe.push(A==="bar"?"xterm-cursor-bar":A==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){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(Ce.isBold()&&fe.push("xterm-bold"),Ce.isItalic()&&fe.push("xterm-italic"),Ce.isDim()&&fe.push("xterm-dim"),ee=Ce.isInvisible()?x.WHITESPACE_CELL_CHAR:Ce.getChars()||x.WHITESPACE_CELL_CHAR,Ce.isUnderline()&&(fe.push(`xterm-underline-${Ce.extended.underlineStyle}`),ee===" "&&(ee=" "),!Ce.isUnderlineColorDefault()))if(Ce.isUnderlineColorRGB())F.style.textDecorationColor=`rgb(${v.AttributeData.toColorRGB(Ce.getUnderlineColor()).join(",")})`;else{let Ne=Ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ce.isBold()&&Ne<8&&(Ne+=8),F.style.textDecorationColor=j.ansi[Ne].css}Ce.isOverline()&&(fe.push("xterm-overline"),ee===" "&&(ee=" ")),Ce.isStrikethrough()&&fe.push("xterm-strikethrough"),yr&&(F.style.textDecoration="underline");let pt=Ce.getFgColor(),Lr=Ce.getFgColorMode(),Rt=Ce.getBgColor(),Dr=Ce.getBgColorMode();const ls=!!Ce.isInverse();if(ls){const Ne=pt;pt=Rt,Rt=Ne;const Cn=Lr;Lr=Dr,Dr=Cn}let Pt,cs,wt,qt=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,D,void 0,(Ne=>{Ne.options.layer!=="top"&&qt||(Ne.backgroundColorRGB&&(Dr=50331648,Rt=Ne.backgroundColorRGB.rgba>>8&16777215,Pt=Ne.backgroundColorRGB),Ne.foregroundColorRGB&&(Lr=50331648,pt=Ne.foregroundColorRGB.rgba>>8&16777215,cs=Ne.foregroundColorRGB),qt=Ne.options.layer==="top")})),!qt&&Rr&&(Pt=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,Rt=Pt.rgba>>8&16777215,Dr=50331648,qt=!0,j.selectionForeground&&(Lr=50331648,pt=j.selectionForeground.rgba>>8&16777215,cs=j.selectionForeground)),qt&&fe.push("xterm-decoration-top"),Dr){case 16777216:case 33554432:wt=j.ansi[Rt],fe.push(`xterm-bg-${Rt}`);break;case 50331648:wt=S.channels.toColor(Rt>>16,Rt>>8&255,255&Rt),this._addStyle(F,`background-color:#${R((Rt>>>0).toString(16),"0",6)}`);break;default:ls?(wt=j.foreground,fe.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):wt=j.background}switch(Pt||Ce.isDim()&&(Pt=S.color.multiplyOpacity(wt,.5)),Lr){case 16777216:case 33554432:Ce.isBold()&&pt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(pt+=8),this._applyMinimumContrast(F,wt,j.ansi[pt],Ce,Pt,void 0)||fe.push(`xterm-fg-${pt}`);break;case 50331648:const Ne=S.channels.toColor(pt>>16&255,pt>>8&255,255&pt);this._applyMinimumContrast(F,wt,Ne,Ce,Pt,cs)||this._addStyle(F,`color:#${R(pt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(F,wt,j.foreground,Ce,Pt,cs)||ls&&fe.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}fe.length&&(F.className=fe.join(" "),fe.length=0),as||Ie||nr?F.textContent=ee:U++,se!==this.defaultSpacing&&(F.style.letterSpacing=`${se}px`),re.push(F),Ee=it}return F&&U&&(F.textContent=ee),re}_applyMinimumContrast(L,D,T,A,I,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,h.treatGlyphAsBackgroundColor)(A.getCode()))return!1;const $=this._getContrastCache(A);let N;if(I||H||(N=$.getColor(D.rgba,T.rgba)),N===void 0){const J=this._optionsService.rawOptions.minimumContrastRatio/(A.isDim()?2:1);N=S.color.ensureContrastRatio(I||D,H||T,J),$.setColor((I||D).rgba,(H||T).rgba,N??null)}return!!N&&(this._addStyle(L,`color:${N.css}`),!0)}_getContrastCache(L){return L.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(L,D){L.setAttribute("style",`${L.getAttribute("style")||""}${D};`)}_isCellInSelection(L,D){const T=this._selectionStart,A=this._selectionEnd;return!(!T||!A)&&(this._columnSelectMode?T[0]<=A[0]?L>=T[0]&&D>=T[1]&&L<A[0]&&D<=A[1]:L<T[0]&&D>=T[1]&&L>=A[0]&&D<=A[1]:D>T[1]&&D<A[1]||T[1]===A[1]&&D===T[1]&&L>=T[0]&&L<A[0]||T[1]<A[1]&&D===A[1]&&L<A[0]||T[1]<A[1]&&D===T[1]&&L>=T[0])}};function R(L,D,T){for(;L.length<T;)L=D+L;return L}a.DomRendererRowFactory=C=p([m(1,c.ICharacterJoinerService),m(2,E.IOptionsService),m(3,c.ICoreBrowserService),m(4,E.ICoreService),m(5,E.IDecorationService),m(6,c.IThemeService)],C)},2550:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(l,p){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=l.createElement("span");m.classList.add("xterm-char-measure-element");const u=l.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const x=l.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontStyle="italic";const b=l.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[m,u,x,b],this._container.appendChild(m),this._container.appendChild(u),this._container.appendChild(x),this._container.appendChild(b),p.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(l,p,m,u){l===this._font&&p===this._fontSize&&m===this._weight&&u===this._weightBold||(this._font=l,this._fontSize=p,this._weight=m,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(l,p,m){let u=0;if(!p&&!m&&l.length===1&&(u=l.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const E=this._measure(l,0);return E>0&&(this._flat[u]=E),E}let x=l;p&&(x+="B"),m&&(x+="I");let b=this._holey.get(x);if(b===void 0){let E=0;p&&(E|=1),m&&(E|=2),b=this._measure(l,E),b>0&&this._holey.set(x,b)}return b}_measure(l,p){const m=this._measureElements[p];return m.textContent=l.repeat(32),m.offsetWidth/32}}},2223:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const p=l(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=p.isFirefox||p.isLegacyEdge?"bottom":"ideographic"},6171:(g,a)=>{function l(m){return 57508<=m&&m<=57558}function p(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},a.isPowerlineGlyph=l,a.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},a.isEmoji=p,a.allowRescaling=function(m,u,x,b){return u===1&&x>Math.ceil(1.5*b)&&m!==void 0&&m>255&&!p(m)&&!l(m)&&!(function(E){return 57344<=E&&E<=63743})(m)},a.treatGlyphAsBackgroundColor=function(m){return l(m)||(function(u){return 9472<=u&&u<=9631})(m)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(m,u,x=0){return(m-(2*Math.round(u)-x))%(2*Math.round(u))}},6052:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,u,x,b=!1){if(this.selectionStart=u,this.selectionEnd=x,!u||!x||u[0]===x[0]&&u[1]===x[1])return void this.clear();const E=m.buffers.active.ydisp,S=u[1]-E,c=x[1]-E,y=Math.max(S,0),h=Math.min(c,m.rows-1);y>=m.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=S,this.viewportEndRow=c,this.viewportCappedStartRow=y,this.viewportCappedEndRow=h,this.startCol=u[0],this.endCol=x[0])}isCellSelected(m,u,x){return!!this.hasSelection&&(x-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&x>=this.viewportCappedStartRow&&u<this.endCol&&x<=this.viewportCappedEndRow:u<this.startCol&&x>=this.viewportCappedStartRow&&u>=this.endCol&&x<=this.viewportCappedEndRow:x>this.viewportStartRow&&x<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&x===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&x===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&x===this.viewportStartRow&&u>=this.startCol)}}a.createSelectionRenderModel=function(){return new l}},456:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(l){this._bufferService=l,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,p=this.selectionEnd;return!(!l||!p)&&(l[1]>p[1]||l[1]===p[1]&&l[0]>p[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(g,a,l){var p=this&&this.__decorate||function(h,v,C,R){var L,D=arguments.length,T=D<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,C):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,v,C,R);else for(var A=h.length-1;A>=0;A--)(L=h[A])&&(T=(D<3?L(T):D>3?L(v,C,T):L(v,C))||T);return D>3&&T&&Object.defineProperty(v,C,T),T},m=this&&this.__param||function(h,v){return function(C,R){v(C,R,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const u=l(2585),x=l(8460),b=l(844);let E=a.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,v,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new x.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new y(this._optionsService))}catch{this._measureStrategy=this.register(new c(h,v,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};a.CharSizeService=E=p([m(2,u.IOptionsService)],E);class S extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(v,C){v!==void 0&&v>0&&C!==void 0&&C>0&&(this._result.width=v,this._result.height=C)}}class c extends S{constructor(v,C,R){super(),this._document=v,this._parentElement=C,this._optionsService=R,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class y extends S{constructor(v){super(),this._optionsService=v,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const v=this._ctx.measureText("W");return this._validateAndSet(v.width,v.fontBoundingBoxAscent+v.fontBoundingBoxDescent),this._result}}},4269:function(g,a,l){var p=this&&this.__decorate||function(y,h,v,C){var R,L=arguments.length,D=L<3?h:C===null?C=Object.getOwnPropertyDescriptor(h,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,h,v,C);else for(var T=y.length-1;T>=0;T--)(R=y[T])&&(D=(L<3?R(D):L>3?R(h,v,D):R(h,v))||D);return L>3&&D&&Object.defineProperty(h,v,D),D},m=this&&this.__param||function(y,h){return function(v,C){h(v,C,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const u=l(3734),x=l(643),b=l(511),E=l(2585);class S extends u.AttributeData{constructor(h,v,C){super(),this.content=0,this.combinedData="",this.fg=h.fg,this.bg=h.bg,this.combinedData=v,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(h){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=S;let c=a.CharacterJoinerService=class Xm{constructor(h){this._bufferService=h,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(h){const v={id:this._nextCharacterJoinerId++,handler:h};return this._characterJoiners.push(v),v.id}deregister(h){for(let v=0;v<this._characterJoiners.length;v++)if(this._characterJoiners[v].id===h)return this._characterJoiners.splice(v,1),!0;return!1}getJoinedCharacters(h){if(this._characterJoiners.length===0)return[];const v=this._bufferService.buffer.lines.get(h);if(!v||v.length===0)return[];const C=[],R=v.translateToString(!0);let L=0,D=0,T=0,A=v.getFg(0),I=v.getBg(0);for(let H=0;H<v.getTrimmedLength();H++)if(v.loadCell(H,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==A||this._workCell.bg!==I){if(H-L>1){const $=this._getJoinedRanges(R,T,D,v,L);for(let N=0;N<$.length;N++)C.push($[N])}L=H,T=D,A=this._workCell.fg,I=this._workCell.bg}D+=this._workCell.getChars().length||x.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-L>1){const H=this._getJoinedRanges(R,T,D,v,L);for(let $=0;$<H.length;$++)C.push(H[$])}return C}_getJoinedRanges(h,v,C,R,L){const D=h.substring(v,C);let T=[];try{T=this._characterJoiners[0].handler(D)}catch(A){console.error(A)}for(let A=1;A<this._characterJoiners.length;A++)try{const I=this._characterJoiners[A].handler(D);for(let H=0;H<I.length;H++)Xm._mergeRanges(T,I[H])}catch(I){console.error(I)}return this._stringRangesToCellRanges(T,R,L),T}_stringRangesToCellRanges(h,v,C){let R=0,L=!1,D=0,T=h[R];if(T){for(let A=C;A<this._bufferService.cols;A++){const I=v.getWidth(A),H=v.getString(A).length||x.WHITESPACE_CELL_CHAR.length;if(I!==0){if(!L&&T[0]<=D&&(T[0]=A,L=!0),T[1]<=D){if(T[1]=A,T=h[++R],!T)break;T[0]<=D?(T[0]=A,L=!0):L=!1}D+=H}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(h,v){let C=!1;for(let R=0;R<h.length;R++){const L=h[R];if(C){if(v[1]<=L[0])return h[R-1][1]=v[1],h;if(v[1]<=L[1])return h[R-1][1]=Math.max(v[1],L[1]),h.splice(R,1),h;h.splice(R,1),R--}else{if(v[1]<=L[0])return h.splice(R,0,v),h;if(v[1]<=L[1])return L[0]=Math.min(v[0],L[0]),h;v[0]<L[1]&&(L[0]=Math.min(v[0],L[0]),C=!0)}}return C?h[h.length-1][1]=v[1]:h.push(v),h}};a.CharacterJoinerService=c=p([m(0,E.IBufferService)],c)},5114:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const p=l(844),m=l(8460),u=l(3656);class x extends p.Disposable{constructor(S,c,y){super(),this._textarea=S,this._window=c,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((h=>this._screenDprMonitor.setWindow(h)))),this.register((0,m.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(S){this._window!==S&&(this._window=S,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}a.CoreBrowserService=x;class b extends p.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new p.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,p.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var S;this._outerListener&&((S=this._resolutionMediaMatchList)==null||S.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:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const p=l(844);class m extends p.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,p.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(x){return this.linkProviders.push(x),{dispose:()=>{const b=this.linkProviders.indexOf(x);b!==-1&&this.linkProviders.splice(b,1)}}}}a.LinkProviderService=m},8934:function(g,a,l){var p=this&&this.__decorate||function(E,S,c,y){var h,v=arguments.length,C=v<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,c):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(E,S,c,y);else for(var R=E.length-1;R>=0;R--)(h=E[R])&&(C=(v<3?h(C):v>3?h(S,c,C):h(S,c))||C);return v>3&&C&&Object.defineProperty(S,c,C),C},m=this&&this.__param||function(E,S){return function(c,y){S(c,y,E)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const u=l(4725),x=l(9806);let b=a.MouseService=class{constructor(E,S){this._renderService=E,this._charSizeService=S}getCoords(E,S,c,y,h){return(0,x.getCoords)(window,E,S,c,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,h)}getMouseReportCoords(E,S){const c=(0,x.getCoordsRelativeToElement)(window,E,S);if(this._charSizeService.hasValidSize)return c[0]=Math.min(Math.max(c[0],0),this._renderService.dimensions.css.canvas.width-1),c[1]=Math.min(Math.max(c[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(c[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(c[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(c[0]),y:Math.floor(c[1])}}};a.MouseService=b=p([m(0,u.IRenderService),m(1,u.ICharSizeService)],b)},3230:function(g,a,l){var p=this&&this.__decorate||function(h,v,C,R){var L,D=arguments.length,T=D<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,C):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,v,C,R);else for(var A=h.length-1;A>=0;A--)(L=h[A])&&(T=(D<3?L(T):D>3?L(v,C,T):L(v,C))||T);return D>3&&T&&Object.defineProperty(v,C,T),T},m=this&&this.__param||function(h,v){return function(C,R){v(C,R,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const u=l(6193),x=l(4725),b=l(8460),E=l(844),S=l(7226),c=l(2585);let y=a.RenderService=class extends E.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(h,v,C,R,L,D,T,A){super(),this._rowCount=h,this._charSizeService=R,this._renderer=this.register(new E.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new E.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((I,H)=>this._renderRows(I,H)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(L.onDecorationRegistered((()=>this._fullRefresh()))),this.register(L.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(A.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,v),this.register(T.onWindowChange((I=>this._registerIntersectionObserver(I,v))))}_registerIntersectionObserver(h,v){if("IntersectionObserver"in h){const C=new h.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});C.observe(v),this._observerDisposable.value=(0,E.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(h){this._isPaused=h.isIntersecting===void 0?h.intersectionRatio===0:!h.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(h,v,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(h,v,this._rowCount))}_renderRows(h,v){this._renderer.value&&(h=Math.min(h,this._rowCount-1),v=Math.min(v,this._rowCount-1),this._renderer.value.renderRows(h,v),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:h,end:v}),this._onRender.fire({start:h,end:v}),this._isNextRenderRedrawOnly=!0)}resize(h,v){this._rowCount=v,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(h){this._renderer.value=h,this._renderer.value&&(this._renderer.value.onRequestRedraw((v=>this.refreshRows(v.start,v.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(h){return this._renderDebouncer.addRefreshCallback(h)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var h,v;this._renderer.value&&((v=(h=this._renderer.value).clearTextureAtlas)==null||v.call(h),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(h,v){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(h,v)})):this._renderer.value.handleResize(h,v),this._fullRefresh())}handleCharSizeChanged(){var h;(h=this._renderer.value)==null||h.handleCharSizeChanged()}handleBlur(){var h;(h=this._renderer.value)==null||h.handleBlur()}handleFocus(){var h;(h=this._renderer.value)==null||h.handleFocus()}handleSelectionChanged(h,v,C){var R;this._selectionState.start=h,this._selectionState.end=v,this._selectionState.columnSelectMode=C,(R=this._renderer.value)==null||R.handleSelectionChanged(h,v,C)}handleCursorMove(){var h;(h=this._renderer.value)==null||h.handleCursorMove()}clear(){var h;(h=this._renderer.value)==null||h.clear()}};a.RenderService=y=p([m(2,c.IOptionsService),m(3,x.ICharSizeService),m(4,c.IDecorationService),m(5,c.IBufferService),m(6,x.ICoreBrowserService),m(7,x.IThemeService)],y)},9312:function(g,a,l){var p=this&&this.__decorate||function(T,A,I,H){var $,N=arguments.length,J=N<3?A:H===null?H=Object.getOwnPropertyDescriptor(A,I):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(T,A,I,H);else for(var K=T.length-1;K>=0;K--)($=T[K])&&(J=(N<3?$(J):N>3?$(A,I,J):$(A,I))||J);return N>3&&J&&Object.defineProperty(A,I,J),J},m=this&&this.__param||function(T,A){return function(I,H){A(I,H,T)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const u=l(9806),x=l(9504),b=l(456),E=l(4725),S=l(8460),c=l(844),y=l(6114),h=l(4841),v=l(511),C=l(2585),R=" ",L=new RegExp(R,"g");let D=a.SelectionService=class extends c.Disposable{constructor(T,A,I,H,$,N,J,K,z){super(),this._element=T,this._screenElement=A,this._linkifier=I,this._bufferService=H,this._coreService=$,this._mouseService=N,this._optionsService=J,this._renderService=K,this._coreBrowserService=z,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new v.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.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 b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,c.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 T=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!T||!A||T[0]===A[0]&&T[1]===A[1])}get selectionText(){const T=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;if(!T||!A)return"";const I=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(T[0]===A[0])return"";const $=T[0]<A[0]?T[0]:A[0],N=T[0]<A[0]?A[0]:T[0];for(let J=T[1];J<=A[1];J++){const K=I.translateBufferLineToString(J,!0,$,N);H.push(K)}}else{const $=T[1]===A[1]?A[0]:void 0;H.push(I.translateBufferLineToString(T[1],!0,T[0],$));for(let N=T[1]+1;N<=A[1]-1;N++){const J=I.lines.get(N),K=I.translateBufferLineToString(N,!0);J!=null&&J.isWrapped?H[H.length-1]+=K:H.push(K)}if(T[1]!==A[1]){const N=I.lines.get(A[1]),J=I.translateBufferLineToString(A[1],!0,0,A[0]);N&&N.isWrapped?H[H.length-1]+=J:H.push(J)}}return H.map(($=>$.replace(L," "))).join(y.isWindows?`\r
|
|
47
|
+
`:`
|
|
48
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.isLinux&&T&&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(T){const A=this._getMouseBufferCoords(T),I=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(I&&H&&A)&&this._areCoordsInSelection(A,I,H)}isCellInSelection(T,A){const I=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!I||!H)&&this._areCoordsInSelection([T,A],I,H)}_areCoordsInSelection(T,A,I){return T[1]>A[1]&&T[1]<I[1]||A[1]===I[1]&&T[1]===A[1]&&T[0]>=A[0]&&T[0]<I[0]||A[1]<I[1]&&T[1]===I[1]&&T[0]<I[0]||A[1]<I[1]&&T[1]===A[1]&&T[0]>=A[0]}_selectWordAtCursor(T,A){var $,N;const I=(N=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:N.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,h.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(T);return!!H&&(this._selectWordAt(H,A),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,A){this._model.clearSelection(),T=Math.max(T,0),A=Math.min(A,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,A],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const A=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(A)return A[0]--,A[1]--,A[1]+=this._bufferService.buffer.ydisp,A}_getMouseEventScrollAmount(T){let A=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return A>=0&&A<=I?0:(A>I&&(A-=I),A=Math.min(Math.max(A,-50),50),A/=50,A/Math.abs(A)+Math.round(14*A))}shouldForceSelection(T){return y.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),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(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const A=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);A&&A.length!==this._model.selectionStart[0]&&A.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const A=this._getMouseBufferCoords(T);A&&(this._activeSelectionMode=2,this._selectLineAt(A[1]))}shouldColumnSelect(T){return T.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const A=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(T),!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(T),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const I=this._bufferService.buffer;if(this._model.selectionEnd[1]<I.lines.length){const H=I.lines.get(this._model.selectionEnd[1]);H&&H.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}A&&A[0]===this._model.selectionEnd[0]&&A[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 T=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const A=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&A<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const I=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const H=(0,x.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,A=this._model.finalSelectionEnd,I=!(!T||!A||T[0]===A[0]&&T[1]===A[1]);I?T&&A&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&A[0]===this._oldSelectionEnd[0]&&A[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,A,I)):this._oldHasSelection&&this._fireOnSelectionChange(T,A,I)}_fireOnSelectionChange(T,A,I){this._oldSelectionStart=T,this._oldSelectionEnd=A,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((A=>this._handleTrim(A)))}_convertViewportColToCharacterIndex(T,A){let I=A;for(let H=0;A>=H;H++){const $=T.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:$>1&&A!==H&&(I+=$-1)}return I}setSelection(T,A,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,A],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,A,I=!0,H=!0){if(T[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,N=$.lines.get(T[1]);if(!N)return;const J=$.translateBufferLineToString(T[1],!1);let K=this._convertViewportColToCharacterIndex(N,T[0]),z=K;const re=T[0]-K;let G=0,j=0,F=0,M=0;if(J.charAt(K)===" "){for(;K>0&&J.charAt(K-1)===" ";)K--;for(;z<J.length&&J.charAt(z+1)===" ";)z++}else{let ne=T[0],ce=T[0];N.getWidth(ne)===0&&(G++,ne--),N.getWidth(ce)===2&&(j++,ce++);const de=N.getString(ce).length;for(de>1&&(M+=de-1,z+=de-1);ne>0&&K>0&&!this._isCharWordSeparator(N.loadCell(ne-1,this._workCell));){N.loadCell(ne-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(G++,ne--):X>1&&(F+=X-1,K-=X-1),K--,ne--}for(;ce<N.length&&z+1<J.length&&!this._isCharWordSeparator(N.loadCell(ce+1,this._workCell));){N.loadCell(ce+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,ce++):X>1&&(M+=X-1,z+=X-1),z++,ce++}}z++;let U=K+re-G+F,ee=Math.min(this._bufferService.cols,z-K+G+j-F-M);if(A||J.slice(K,z).trim()!==""){if(I&&U===0&&N.getCodePoint(0)!==32){const ne=$.lines.get(T[1]-1);if(ne&&N.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(ce){const de=this._bufferService.cols-ce.start;U-=de,ee+=de}}}if(H&&U+ee===this._bufferService.cols&&N.getCodePoint(this._bufferService.cols-1)!==32){const ne=$.lines.get(T[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const ce=this._getWordAt([0,T[1]+1],!1,!1,!0);ce&&(ee+=ce.length)}}return{start:U,length:ee}}}_selectWordAt(T,A){const I=this._getWordAt(T,A);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[I.start,T[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(T){const A=this._getWordAt(T,!0);if(A){let I=T[1];for(;A.start<0;)A.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;A.start+A.length>this._bufferService.cols;)A.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?A.start:A.start+A.length,I]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const A=this._bufferService.buffer.getWrappedRangeForLine(T),I={start:{x:0,y:A.first},end:{x:this._bufferService.cols-1,y:A.last}};this._model.selectionStart=[0,A.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,h.getRangeLength)(I,this._bufferService.cols)}};a.SelectionService=D=p([m(3,C.IBufferService),m(4,C.ICoreService),m(5,E.IMouseService),m(6,C.IOptionsService),m(7,E.IRenderService),m(8,E.ICoreBrowserService)],D)},4725:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const p=l(8343);a.ICharSizeService=(0,p.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,p.createDecorator)("CoreBrowserService"),a.IMouseService=(0,p.createDecorator)("MouseService"),a.IRenderService=(0,p.createDecorator)("RenderService"),a.ISelectionService=(0,p.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,p.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,p.createDecorator)("ThemeService"),a.ILinkProviderService=(0,p.createDecorator)("LinkProviderService")},6731:function(g,a,l){var p=this&&this.__decorate||function(D,T,A,I){var H,$=arguments.length,N=$<3?T:I===null?I=Object.getOwnPropertyDescriptor(T,A):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(D,T,A,I);else for(var J=D.length-1;J>=0;J--)(H=D[J])&&(N=($<3?H(N):$>3?H(T,A,N):H(T,A))||N);return $>3&&N&&Object.defineProperty(T,A,N),N},m=this&&this.__param||function(D,T){return function(A,I){T(A,I,D)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const u=l(7239),x=l(8055),b=l(8460),E=l(844),S=l(2585),c=x.css.toColor("#ffffff"),y=x.css.toColor("#000000"),h=x.css.toColor("#ffffff"),v=x.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[x.css.toColor("#2e3436"),x.css.toColor("#cc0000"),x.css.toColor("#4e9a06"),x.css.toColor("#c4a000"),x.css.toColor("#3465a4"),x.css.toColor("#75507b"),x.css.toColor("#06989a"),x.css.toColor("#d3d7cf"),x.css.toColor("#555753"),x.css.toColor("#ef2929"),x.css.toColor("#8ae234"),x.css.toColor("#fce94f"),x.css.toColor("#729fcf"),x.css.toColor("#ad7fa8"),x.css.toColor("#34e2e2"),x.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let A=0;A<216;A++){const I=T[A/36%6|0],H=T[A/6%6|0],$=T[A%6];D.push({css:x.channels.toCss(I,H,$),rgba:x.channels.toRgba(I,H,$)})}for(let A=0;A<24;A++){const I=8+10*A;D.push({css:x.channels.toCss(I,I,I),rgba:x.channels.toRgba(I,I,I)})}return D})());let R=a.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:c,background:y,cursor:h,cursorAccent:v,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:x.color.blend(y,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:x.color.blend(y,C),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const T=this._colors;if(T.foreground=L(D.foreground,c),T.background=L(D.background,y),T.cursor=L(D.cursor,h),T.cursorAccent=L(D.cursorAccent,v),T.selectionBackgroundTransparent=L(D.selectionBackground,C),T.selectionBackgroundOpaque=x.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=L(D.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=x.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=D.selectionForeground?L(D.selectionForeground,x.NULL_COLOR):void 0,T.selectionForeground===x.NULL_COLOR&&(T.selectionForeground=void 0),x.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=x.color.opacity(T.selectionBackgroundTransparent,.3)),x.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=x.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=a.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=L(D.black,a.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=L(D.red,a.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=L(D.green,a.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=L(D.yellow,a.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=L(D.blue,a.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=L(D.magenta,a.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=L(D.cyan,a.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=L(D.white,a.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=L(D.brightBlack,a.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=L(D.brightRed,a.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=L(D.brightGreen,a.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=L(D.brightYellow,a.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=L(D.brightBlue,a.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=L(D.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=L(D.brightCyan,a.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=L(D.brightWhite,a.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const A=Math.min(T.ansi.length-16,D.extendedAnsi.length);for(let I=0;I<A;I++)T.ansi[I+16]=L(D.extendedAnsi[I],a.DEFAULT_ANSI_COLORS[I+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){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[D]=this._restoreColors.ansi[D]}else for(let T=0;T<this._restoreColors.ansi.length;++T)this._colors.ansi[T]=this._restoreColors.ansi[T]}modifyColors(D){D(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(D,T){if(D!==void 0)try{return x.css.toColor(D)}catch{}return T}a.ThemeService=R=p([m(0,S.IOptionsService)],R)},6349:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const p=l(8460),m=l(844);class u extends m.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new p.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new p.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new p.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(b){if(this._maxLength===b)return;const E=new Array(b);for(let S=0;S<Math.min(b,this.length);S++)E[S]=this._array[this._getCyclicIndex(S)];this._array=E,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let E=this._length;E<b;E++)this._array[E]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,E){this._array[this._getCyclicIndex(b)]=E}push(b){this._array[this._getCyclicIndex(this._length)]=b,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(b,E,...S){if(E){for(let c=b;c<this._length-E;c++)this._array[this._getCyclicIndex(c)]=this._array[this._getCyclicIndex(c+E)];this._length-=E,this.onDeleteEmitter.fire({index:b,amount:E})}for(let c=this._length-1;c>=b;c--)this._array[this._getCyclicIndex(c+S.length)]=this._array[this._getCyclicIndex(c)];for(let c=0;c<S.length;c++)this._array[this._getCyclicIndex(b+c)]=S[c];if(S.length&&this.onInsertEmitter.fire({index:b,amount:S.length}),this._length+S.length>this._maxLength){const c=this._length+S.length-this._maxLength;this._startIndex+=c,this._length=this._maxLength,this.onTrimEmitter.fire(c)}else this._length+=S.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,E,S){if(!(E<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let y=E-1;y>=0;y--)this.set(b+y+S,this.get(b+y));const c=b+E+S-this._length;if(c>0)for(this._length+=c;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let c=0;c<E;c++)this.set(b+c+S,this.get(b+c))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}a.CircularList=u},1439:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function l(p,m=5){if(typeof p!="object")return p;const u=Array.isArray(p)?[]:{};for(const x in p)u[x]=m<=1?p[x]:p[x]&&l(p[x],m-1);return u}},8055:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let l=0,p=0,m=0,u=0;var x,b,E,S,c;function y(v){const C=v.toString(16);return C.length<2?"0"+C:C}function h(v,C){return v<C?(C+.05)/(v+.05):(v+.05)/(C+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(v){v.toCss=function(C,R,L,D){return D!==void 0?`#${y(C)}${y(R)}${y(L)}${y(D)}`:`#${y(C)}${y(R)}${y(L)}`},v.toRgba=function(C,R,L,D=255){return(C<<24|R<<16|L<<8|D)>>>0},v.toColor=function(C,R,L,D){return{css:v.toCss(C,R,L,D),rgba:v.toRgba(C,R,L,D)}}})(x||(a.channels=x={})),(function(v){function C(R,L){return u=Math.round(255*L),[l,p,m]=c.toChannels(R.rgba),{css:x.toCss(l,p,m,u),rgba:x.toRgba(l,p,m,u)}}v.blend=function(R,L){if(u=(255&L.rgba)/255,u===1)return{css:L.css,rgba:L.rgba};const D=L.rgba>>24&255,T=L.rgba>>16&255,A=L.rgba>>8&255,I=R.rgba>>24&255,H=R.rgba>>16&255,$=R.rgba>>8&255;return l=I+Math.round((D-I)*u),p=H+Math.round((T-H)*u),m=$+Math.round((A-$)*u),{css:x.toCss(l,p,m),rgba:x.toRgba(l,p,m)}},v.isOpaque=function(R){return(255&R.rgba)==255},v.ensureContrastRatio=function(R,L,D){const T=c.ensureContrastRatio(R.rgba,L.rgba,D);if(T)return x.toColor(T>>24&255,T>>16&255,T>>8&255)},v.opaque=function(R){const L=(255|R.rgba)>>>0;return[l,p,m]=c.toChannels(L),{css:x.toCss(l,p,m),rgba:L}},v.opacity=C,v.multiplyOpacity=function(R,L){return u=255&R.rgba,C(R,u*L/255)},v.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(b||(a.color=b={})),(function(v){let C,R;try{const L=document.createElement("canvas");L.width=1,L.height=1;const D=L.getContext("2d",{willReadFrequently:!0});D&&(C=D,C.globalCompositeOperation="copy",R=C.createLinearGradient(0,0,1,1))}catch{}v.toColor=function(L){if(L.match(/#[\da-f]{3,8}/i))switch(L.length){case 4:return l=parseInt(L.slice(1,2).repeat(2),16),p=parseInt(L.slice(2,3).repeat(2),16),m=parseInt(L.slice(3,4).repeat(2),16),x.toColor(l,p,m);case 5:return l=parseInt(L.slice(1,2).repeat(2),16),p=parseInt(L.slice(2,3).repeat(2),16),m=parseInt(L.slice(3,4).repeat(2),16),u=parseInt(L.slice(4,5).repeat(2),16),x.toColor(l,p,m,u);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 D=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(D)return l=parseInt(D[1]),p=parseInt(D[2]),m=parseInt(D[3]),u=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),x.toColor(l,p,m,u);if(!C||!R)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=R,C.fillStyle=L,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[l,p,m,u]=C.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:x.toRgba(l,p,m,u),css:L}}})(E||(a.css=E={})),(function(v){function C(R,L,D){const T=R/255,A=L/255,I=D/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}v.relativeLuminance=function(R){return C(R>>16&255,R>>8&255,255&R)},v.relativeLuminance2=C})(S||(a.rgb=S={})),(function(v){function C(L,D,T){const A=L>>24&255,I=L>>16&255,H=L>>8&255;let $=D>>24&255,N=D>>16&255,J=D>>8&255,K=h(S.relativeLuminance2($,N,J),S.relativeLuminance2(A,I,H));for(;K<T&&($>0||N>0||J>0);)$-=Math.max(0,Math.ceil(.1*$)),N-=Math.max(0,Math.ceil(.1*N)),J-=Math.max(0,Math.ceil(.1*J)),K=h(S.relativeLuminance2($,N,J),S.relativeLuminance2(A,I,H));return($<<24|N<<16|J<<8|255)>>>0}function R(L,D,T){const A=L>>24&255,I=L>>16&255,H=L>>8&255;let $=D>>24&255,N=D>>16&255,J=D>>8&255,K=h(S.relativeLuminance2($,N,J),S.relativeLuminance2(A,I,H));for(;K<T&&($<255||N<255||J<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),N=Math.min(255,N+Math.ceil(.1*(255-N))),J=Math.min(255,J+Math.ceil(.1*(255-J))),K=h(S.relativeLuminance2($,N,J),S.relativeLuminance2(A,I,H));return($<<24|N<<16|J<<8|255)>>>0}v.blend=function(L,D){if(u=(255&D)/255,u===1)return D;const T=D>>24&255,A=D>>16&255,I=D>>8&255,H=L>>24&255,$=L>>16&255,N=L>>8&255;return l=H+Math.round((T-H)*u),p=$+Math.round((A-$)*u),m=N+Math.round((I-N)*u),x.toRgba(l,p,m)},v.ensureContrastRatio=function(L,D,T){const A=S.relativeLuminance(L>>8),I=S.relativeLuminance(D>>8);if(h(A,I)<T){if(I<A){const N=C(L,D,T),J=h(A,S.relativeLuminance(N>>8));if(J<T){const K=R(L,D,T);return J>h(A,S.relativeLuminance(K>>8))?N:K}return N}const H=R(L,D,T),$=h(A,S.relativeLuminance(H>>8));if($<T){const N=C(L,D,T);return $>h(A,S.relativeLuminance(N>>8))?H:N}return H}},v.reduceLuminance=C,v.increaseLuminance=R,v.toChannels=function(L){return[L>>24&255,L>>16&255,L>>8&255,255&L]}})(c||(a.rgba=c={})),a.toPaddedHex=y,a.contrastRatio=h},8969:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const p=l(844),m=l(2585),u=l(4348),x=l(7866),b=l(744),E=l(7302),S=l(6975),c=l(8460),y=l(1753),h=l(1480),v=l(7994),C=l(9282),R=l(5435),L=l(5981),D=l(2660);let T=!1;class A extends p.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new c.EventEmitter),this._onScroll.event((H=>{var $;($=this._onScrollApi)==null||$.fire(H.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(H){for(const $ in H)this.optionsService.options[$]=H[$]}constructor(H){super(),this._windowsWrappingHeuristics=this.register(new p.MutableDisposable),this._onBinary=this.register(new c.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new c.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new c.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new E.OptionsService(H)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(x.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(h.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(v.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,c.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,c.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,c.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,c.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(($=>{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(($=>{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((($,N)=>this._inputHandler.parse($,N)))),this.register((0,c.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,$){this._writeBuffer.write(H,$)}writeSync(H,$){this._logService.logLevel<=m.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(H,$)}input(H,$=!0){this.coreService.triggerDataEvent(H,$)}resize(H,$){isNaN(H)||isNaN($)||(H=Math.max(H,b.MINIMUM_COLS),$=Math.max($,b.MINIMUM_ROWS),this._bufferService.resize(H,$))}scroll(H,$=!1){this._bufferService.scroll(H,$)}scrollLines(H,$,N){this._bufferService.scrollLines(H,$,N)}scrollPages(H){this.scrollLines(H*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(H){const $=H-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(H,$){return this._inputHandler.registerEscHandler(H,$)}registerDcsHandler(H,$){return this._inputHandler.registerDcsHandler(H,$)}registerCsiHandler(H,$){return this._inputHandler.registerCsiHandler(H,$)}registerOscHandler(H,$){return this._inputHandler.registerOscHandler(H,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let H=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?H=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(H=!0),H?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const H=[];H.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,p.toDisposable)((()=>{for(const $ of H)$.dispose()}))}}}a.CoreTerminal=A},8460:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let p=0;p<this._listeners.length;p++)if(this._listeners[p]===l)return void this._listeners.splice(p,1)}}})),this._event}fire(l,p){const m=[];for(let u=0;u<this._listeners.length;u++)m.push(this._listeners[u]);for(let u=0;u<m.length;u++)m[u].call(void 0,l,p)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(l,p){return l((m=>p.fire(m)))},a.runAndSubscribe=function(l,p){return p(void 0),l((m=>p(m)))}},5435:function(g,a,l){var p=this&&this.__decorate||function(G,j,F,M){var U,ee=arguments.length,ne=ee<3?j:M===null?M=Object.getOwnPropertyDescriptor(j,F):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(G,j,F,M);else for(var ce=G.length-1;ce>=0;ce--)(U=G[ce])&&(ne=(ee<3?U(ne):ee>3?U(j,F,ne):U(j,F))||ne);return ee>3&&ne&&Object.defineProperty(j,F,ne),ne},m=this&&this.__param||function(G,j){return function(F,M){j(F,M,G)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const u=l(2584),x=l(7116),b=l(2015),E=l(844),S=l(482),c=l(8437),y=l(8460),h=l(643),v=l(511),C=l(3734),R=l(2585),L=l(1480),D=l(6242),T=l(6351),A=l(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function $(G,j){if(G>24)return j.setWinLines||!1;switch(G){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var N;(function(G){G[G.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",G[G.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(N||(a.WindowsOptionsReportType=N={}));let J=0;class K extends E.Disposable{getAttrData(){return this._curAttrData}constructor(j,F,M,U,ee,ne,ce,de,X=new b.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=F,this._coreService=M,this._logService=U,this._optionsService=ee,this._oscLinkService=ne,this._coreMouseService=ce,this._unicodeService=de,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new v.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.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((B=>this._activeBuffer=B.activeBuffer))),this._parser.setCsiHandlerFallback(((B,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:ie.toArray()})})),this._parser.setEscHandlerFallback((B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})})),this._parser.setExecuteHandlerFallback((B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})})),this._parser.setOscHandlerFallback(((B,ie,se)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:ie,data:se})})),this._parser.setDcsHandlerFallback(((B,ie,se)=>{ie==="HOOK"&&(se=se.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:ie,payload:se})})),this._parser.setPrintHandler(((B,ie,se)=>this.print(B,ie,se))),this._parser.registerCsiHandler({final:"@"},(B=>this.insertChars(B))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(B=>this.scrollLeft(B))),this._parser.registerCsiHandler({final:"A"},(B=>this.cursorUp(B))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(B=>this.scrollRight(B))),this._parser.registerCsiHandler({final:"B"},(B=>this.cursorDown(B))),this._parser.registerCsiHandler({final:"C"},(B=>this.cursorForward(B))),this._parser.registerCsiHandler({final:"D"},(B=>this.cursorBackward(B))),this._parser.registerCsiHandler({final:"E"},(B=>this.cursorNextLine(B))),this._parser.registerCsiHandler({final:"F"},(B=>this.cursorPrecedingLine(B))),this._parser.registerCsiHandler({final:"G"},(B=>this.cursorCharAbsolute(B))),this._parser.registerCsiHandler({final:"H"},(B=>this.cursorPosition(B))),this._parser.registerCsiHandler({final:"I"},(B=>this.cursorForwardTab(B))),this._parser.registerCsiHandler({final:"J"},(B=>this.eraseInDisplay(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(B=>this.eraseInDisplay(B,!0))),this._parser.registerCsiHandler({final:"K"},(B=>this.eraseInLine(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(B=>this.eraseInLine(B,!0))),this._parser.registerCsiHandler({final:"L"},(B=>this.insertLines(B))),this._parser.registerCsiHandler({final:"M"},(B=>this.deleteLines(B))),this._parser.registerCsiHandler({final:"P"},(B=>this.deleteChars(B))),this._parser.registerCsiHandler({final:"S"},(B=>this.scrollUp(B))),this._parser.registerCsiHandler({final:"T"},(B=>this.scrollDown(B))),this._parser.registerCsiHandler({final:"X"},(B=>this.eraseChars(B))),this._parser.registerCsiHandler({final:"Z"},(B=>this.cursorBackwardTab(B))),this._parser.registerCsiHandler({final:"`"},(B=>this.charPosAbsolute(B))),this._parser.registerCsiHandler({final:"a"},(B=>this.hPositionRelative(B))),this._parser.registerCsiHandler({final:"b"},(B=>this.repeatPrecedingCharacter(B))),this._parser.registerCsiHandler({final:"c"},(B=>this.sendDeviceAttributesPrimary(B))),this._parser.registerCsiHandler({prefix:">",final:"c"},(B=>this.sendDeviceAttributesSecondary(B))),this._parser.registerCsiHandler({final:"d"},(B=>this.linePosAbsolute(B))),this._parser.registerCsiHandler({final:"e"},(B=>this.vPositionRelative(B))),this._parser.registerCsiHandler({final:"f"},(B=>this.hVPosition(B))),this._parser.registerCsiHandler({final:"g"},(B=>this.tabClear(B))),this._parser.registerCsiHandler({final:"h"},(B=>this.setMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(B=>this.setModePrivate(B))),this._parser.registerCsiHandler({final:"l"},(B=>this.resetMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(B=>this.resetModePrivate(B))),this._parser.registerCsiHandler({final:"m"},(B=>this.charAttributes(B))),this._parser.registerCsiHandler({final:"n"},(B=>this.deviceStatus(B))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(B=>this.deviceStatusPrivate(B))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(B=>this.softReset(B))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(B=>this.setCursorStyle(B))),this._parser.registerCsiHandler({final:"r"},(B=>this.setScrollRegion(B))),this._parser.registerCsiHandler({final:"s"},(B=>this.saveCursor(B))),this._parser.registerCsiHandler({final:"t"},(B=>this.windowOptions(B))),this._parser.registerCsiHandler({final:"u"},(B=>this.restoreCursor(B))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(B=>this.insertColumns(B))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(B=>this.deleteColumns(B))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(B=>this.selectProtected(B))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(B=>this.requestMode(B,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(B=>this.requestMode(B,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((B=>(this.setTitle(B),this.setIconName(B),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((B=>this.setIconName(B)))),this._parser.registerOscHandler(2,new D.OscHandler((B=>this.setTitle(B)))),this._parser.registerOscHandler(4,new D.OscHandler((B=>this.setOrReportIndexedColor(B)))),this._parser.registerOscHandler(8,new D.OscHandler((B=>this.setHyperlink(B)))),this._parser.registerOscHandler(10,new D.OscHandler((B=>this.setOrReportFgColor(B)))),this._parser.registerOscHandler(11,new D.OscHandler((B=>this.setOrReportBgColor(B)))),this._parser.registerOscHandler(12,new D.OscHandler((B=>this.setOrReportCursorColor(B)))),this._parser.registerOscHandler(104,new D.OscHandler((B=>this.restoreIndexedColor(B)))),this._parser.registerOscHandler(110,new D.OscHandler((B=>this.restoreFgColor(B)))),this._parser.registerOscHandler(111,new D.OscHandler((B=>this.restoreBgColor(B)))),this._parser.registerOscHandler(112,new D.OscHandler((B=>this.restoreCursorColor(B)))),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 B in x.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},(()=>this.selectCharset("("+B))),this._parser.registerEscHandler({intermediates:")",final:B},(()=>this.selectCharset(")"+B))),this._parser.registerEscHandler({intermediates:"*",final:B},(()=>this.selectCharset("*"+B))),this._parser.registerEscHandler({intermediates:"+",final:B},(()=>this.selectCharset("+"+B))),this._parser.registerEscHandler({intermediates:"-",final:B},(()=>this.selectCharset("-"+B))),this._parser.registerEscHandler({intermediates:".",final:B},(()=>this.selectCharset("."+B))),this._parser.registerEscHandler({intermediates:"/",final:B},(()=>this.selectCharset("/"+B)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((B=>(this._logService.error("Parsing error: ",B),B))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((B,ie)=>this.requestStatusString(B,ie))))}_preserveStack(j,F,M,U){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=F,this._parseStack.decodedLength=M,this._parseStack.position=U}_logSlowResolvingAsync(j){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([j,new Promise(((F,M)=>setTimeout((()=>M("#SLOW_TIMEOUT")),5e3)))]).catch((F=>{if(F!=="#SLOW_TIMEOUT")throw F;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,F){let M,U=this._activeBuffer.x,ee=this._activeBuffer.y,ne=0;const ce=this._parseStack.paused;if(ce){if(M=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,F))return this._logSlowResolvingAsync(M),M;U=this._parseStack.cursorStartX,ee=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>H&&(ne=this._parseStack.position+H)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(B=>String.fromCharCode(B))).join("")}"`),typeof j=="string"?j.split("").map((B=>B.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<H&&(this._parseBuffer=new Uint32Array(Math.min(j.length,H))),ce||this._dirtyRowTracker.clearRange(),j.length>H)for(let B=ne;B<j.length;B+=H){const ie=B+H<j.length?B+H:j.length,se=typeof j=="string"?this._stringDecoder.decode(j.substring(B,ie),this._parseBuffer):this._utf8Decoder.decode(j.subarray(B,ie),this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,se))return this._preserveStack(U,ee,se,B),this._logSlowResolvingAsync(M),M}else if(!ce){const B=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,B))return this._preserveStack(U,ee,B,0),this._logSlowResolvingAsync(M),M}this._activeBuffer.x===U&&this._activeBuffer.y===ee||this._onCursorMove.fire();const de=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(de,this._bufferService.rows-1))}print(j,F,M){let U,ee;const ne=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,de=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,B=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&&M-F>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=F;he<M;++he){if(U=j[he],U<127&&ne){const it=ne[String.fromCharCode(U)];it&&(U=it.charCodeAt(0))}const Ee=this._unicodeService.charProperties(U,fe);ee=L.UnicodeService.extractWidth(Ee);const Me=L.UnicodeService.extractShouldJoin(Ee),Ie=Me?L.UnicodeService.extractWidth(fe):0;if(fe=Ee,ce&&this._onA11yChar.fire((0,S.stringFromCodePoint)(U)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+ee-Ie>de){if(X){const it=se;let Ce=this._activeBuffer.x-Ie;for(this._activeBuffer.x=Ie,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),Ie>0&&se instanceof c.BufferLine&&se.copyCellsFrom(it,Ce,0,Ie,!1);Ce<de;)it.setCellFromCodepoint(Ce++,0,1,ie)}else if(this._activeBuffer.x=de-1,ee===2)continue}if(Me&&this._activeBuffer.x){const it=se.getWidth(this._activeBuffer.x-1)?1:2;se.addCodepointToCell(this._activeBuffer.x-it,U,ee);for(let Ce=ee-Ie;--Ce>=0;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(B&&(se.insertCells(this._activeBuffer.x,ee-Ie,this._activeBuffer.getNullCell(ie)),se.getWidth(de-1)===2&&se.setCellFromCodepoint(de-1,h.NULL_CELL_CODE,h.NULL_CELL_WIDTH,ie)),se.setCellFromCodepoint(this._activeBuffer.x++,U,ee,ie),ee>0)for(;--ee;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=fe,this._activeBuffer.x<de&&M-F>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(j,F){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,F):this._parser.registerCsiHandler(j,(M=>!$(M.params[0],this._optionsService.rawOptions.windowOptions)||F(M)))}registerDcsHandler(j,F){return this._parser.registerDcsHandler(j,new T.DcsHandler(F))}registerEscHandler(j,F){return this._parser.registerEscHandler(j,F)}registerOscHandler(j,F){return this._parser.registerOscHandler(j,new D.OscHandler(F))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var j;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&j.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);F.hasWidth(this._activeBuffer.x)&&!F.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(j,F){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+F):(this._activeBuffer.x=j,this._activeBuffer.y=F),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,F){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+F)}cursorUp(j){const F=this._activeBuffer.y-this._activeBuffer.scrollTop;return F>=0?this._moveCursor(0,-Math.min(F,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const F=this._activeBuffer.scrollBottom-this._activeBuffer.y;return F>=0?this._moveCursor(0,Math.min(F,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const F=j.params[0];return F===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:F===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let F=j.params[0]||1;for(;F--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let F=j.params[0]||1;for(;F--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const F=j.params[0];return F===1&&(this._curAttrData.bg|=536870912),F!==2&&F!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,F,M,U=!1,ee=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);ne.replaceCells(F,M,this._activeBuffer.getNullCell(this._eraseAttrData()),ee),U&&(ne.isWrapped=!1)}_resetBufferLine(j,F=!1){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);M&&(M.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),F),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),M.isWrapped=!1)}eraseInDisplay(j,F=!1){let M;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,F);M<this._bufferService.rows;M++)this._resetBufferLine(M,F);this._dirtyRowTracker.markDirty(M);break;case 1:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M,0,this._activeBuffer.x+1,!0,F),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(M+1).isWrapped=!1);M--;)this._resetBufferLine(M,F);this._dirtyRowTracker.markDirty(0);break;case 2:for(M=this._bufferService.rows,this._dirtyRowTracker.markDirty(M-1);M--;)this._resetBufferLine(M,F);this._dirtyRowTracker.markDirty(0);break;case 3:const U=this._activeBuffer.lines.length-this._bufferService.rows;U>0&&(this._activeBuffer.lines.trimStart(U),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-U,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-U,0),this._onScroll.fire(0))}return!0}eraseInLine(j,F=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,F);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,F);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,F)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let F=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y,U=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ee=this._bufferService.rows-1+this._activeBuffer.ybase-U+1;for(;F--;)this._activeBuffer.lines.splice(ee-1,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let F=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y;let U;for(U=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-U;F--;)this._activeBuffer.lines.splice(M,1),this._activeBuffer.lines.splice(U,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let F=j.params[0]||1;for(;F--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(j){let F=j.params[0]||1;for(;F--;)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(c.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=j.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);U.deleteCells(0,F,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=j.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);U.insertCells(0,F,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=j.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);U.insertCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=j.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);U.deleteCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const F=this._parser.precedingJoinState;if(!F)return!0;const M=j.params[0]||1,U=L.UnicodeService.extractWidth(F),ee=this._activeBuffer.x-U,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(ee),ce=new Uint32Array(ne.length*M);let de=0;for(let B=0;B<ne.length;){const ie=ne.codePointAt(B)||0;ce[de++]=ie,B+=ie>65535?2:1}let X=de;for(let B=1;B<M;++B)ce.copyWithin(X,0,de),X+=de;return this.print(ce,0,X),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let F=0;F<j.length;F++)switch(j.params[F]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let F=0;F<j.length;F++)switch(j.params[F]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,x.DEFAULT_CHARSET),this._charsetService.setgCharset(1,x.DEFAULT_CHARSET),this._charsetService.setgCharset(2,x.DEFAULT_CHARSET),this._charsetService.setgCharset(3,x.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(j){for(let F=0;F<j.length;F++)switch(j.params[F]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let F=0;F<j.length;F++)switch(j.params[F]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),j.params[F]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(j,F){const M=this._coreService.decPrivateModes,{activeProtocol:U,activeEncoding:ee}=this._coreMouseService,ne=this._coreService,{buffers:ce,cols:de}=this._bufferService,{active:X,alt:B}=ce,ie=this._optionsService.rawOptions,se=Me=>Me?1:2,fe=j.params[0];return he=fe,Ee=F?fe===2?4:fe===4?se(ne.modes.insertMode):fe===12?3:fe===20?se(ie.convertEol):0:fe===1?se(M.applicationCursorKeys):fe===3?ie.windowOptions.setWinLines?de===80?2:de===132?1:0:0:fe===6?se(M.origin):fe===7?se(M.wraparound):fe===8?3:fe===9?se(U==="X10"):fe===12?se(ie.cursorBlink):fe===25?se(!ne.isCursorHidden):fe===45?se(M.reverseWraparound):fe===66?se(M.applicationKeypad):fe===67?4:fe===1e3?se(U==="VT200"):fe===1002?se(U==="DRAG"):fe===1003?se(U==="ANY"):fe===1004?se(M.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(X===B):fe===2004?se(M.bracketedPasteMode):0,ne.triggerDataEvent(`${u.C0.ESC}[${F?"":"?"}${he};${Ee}$y`),!0;var he,Ee}_updateAttrColor(j,F,M,U,ee){return F===2?(j|=50331648,j&=-16777216,j|=C.AttributeData.fromColorRGB([M,U,ee])):F===5&&(j&=-50331904,j|=33554432|255&M),j}_extractColor(j,F,M){const U=[0,0,-1,0,0,0];let ee=0,ne=0;do{if(U[ne+ee]=j.params[F+ne],j.hasSubParams(F+ne)){const ce=j.getSubParams(F+ne);let de=0;do U[1]===5&&(ee=1),U[ne+de+1+ee]=ce[de];while(++de<ce.length&&de+ne+1+ee<U.length);break}if(U[1]===5&&ne+ee>=2||U[1]===2&&ne+ee>=5)break;U[1]&&(ee=1)}while(++ne+F<j.length&&ne+ee<U.length);for(let ce=2;ce<U.length;++ce)U[ce]===-1&&(U[ce]=0);switch(U[0]){case 38:M.fg=this._updateAttrColor(M.fg,U[1],U[3],U[4],U[5]);break;case 48:M.bg=this._updateAttrColor(M.bg,U[1],U[3],U[4],U[5]);break;case 58:M.extended=M.extended.clone(),M.extended.underlineColor=this._updateAttrColor(M.extended.underlineColor,U[1],U[3],U[4],U[5])}return ne}_processUnderline(j,F){F.extended=F.extended.clone(),(!~j||j>5)&&(j=1),F.extended.underlineStyle=j,F.fg|=268435456,j===0&&(F.fg&=-268435457),F.updateExtended()}_processSGR0(j){j.fg=c.DEFAULT_ATTR_DATA.fg,j.bg=c.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const F=j.length;let M;const U=this._curAttrData;for(let ee=0;ee<F;ee++)M=j.params[ee],M>=30&&M<=37?(U.fg&=-50331904,U.fg|=16777216|M-30):M>=40&&M<=47?(U.bg&=-50331904,U.bg|=16777216|M-40):M>=90&&M<=97?(U.fg&=-50331904,U.fg|=16777224|M-90):M>=100&&M<=107?(U.bg&=-50331904,U.bg|=16777224|M-100):M===0?this._processSGR0(U):M===1?U.fg|=134217728:M===3?U.bg|=67108864:M===4?(U.fg|=268435456,this._processUnderline(j.hasSubParams(ee)?j.getSubParams(ee)[0]:1,U)):M===5?U.fg|=536870912:M===7?U.fg|=67108864:M===8?U.fg|=1073741824:M===9?U.fg|=2147483648:M===2?U.bg|=134217728:M===21?this._processUnderline(2,U):M===22?(U.fg&=-134217729,U.bg&=-134217729):M===23?U.bg&=-67108865:M===24?(U.fg&=-268435457,this._processUnderline(0,U)):M===25?U.fg&=-536870913:M===27?U.fg&=-67108865:M===28?U.fg&=-1073741825:M===29?U.fg&=2147483647:M===39?(U.fg&=-67108864,U.fg|=16777215&c.DEFAULT_ATTR_DATA.fg):M===49?(U.bg&=-67108864,U.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):M===38||M===48||M===58?ee+=this._extractColor(j,ee,U):M===53?U.bg|=1073741824:M===55?U.bg&=-1073741825:M===59?(U.extended=U.extended.clone(),U.extended.underlineColor=-1,U.updateExtended()):M===100?(U.fg&=-67108864,U.fg|=16777215&c.DEFAULT_ATTR_DATA.fg,U.bg&=-67108864,U.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",M);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const F=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${F};${M}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const F=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${F};${M}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(j){const F=j.params[0]||1;switch(F){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 M=F%2==1;return this._optionsService.options.cursorBlink=M,!0}setScrollRegion(j){const F=j.params[0]||1;let M;return(j.length<2||(M=j.params[1])>this._bufferService.rows||M===0)&&(M=this._bufferService.rows),M>F&&(this._activeBuffer.scrollTop=F-1,this._activeBuffer.scrollBottom=M-1,this._setCursor(0,0)),!0}windowOptions(j){if(!$(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const F=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:F!==2&&this._onRequestWindowsOptionsReport.fire(N.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(N.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:F!==0&&F!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),F!==0&&F!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:F!==0&&F!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),F!==0&&F!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(j){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const F=[],M=j.split(";");for(;M.length>1;){const U=M.shift(),ee=M.shift();if(/^\d+$/.exec(U)){const ne=parseInt(U);if(re(ne))if(ee==="?")F.push({type:0,index:ne});else{const ce=(0,A.parseColor)(ee);ce&&F.push({type:1,index:ne,color:ce})}}}return F.length&&this._onColor.fire(F),!0}setHyperlink(j){const F=j.split(";");return!(F.length<2)&&(F[1]?this._createHyperlink(F[0],F[1]):!F[0]&&this._finishHyperlink())}_createHyperlink(j,F){this._getCurrentLinkId()&&this._finishHyperlink();const M=j.split(":");let U;const ee=M.findIndex((ne=>ne.startsWith("id=")));return ee!==-1&&(U=M[ee].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:U,uri:F}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,F){const M=j.split(";");for(let U=0;U<M.length&&!(F>=this._specialColors.length);++U,++F)if(M[U]==="?")this._onColor.fire([{type:0,index:this._specialColors[F]}]);else{const ee=(0,A.parseColor)(M[U]);ee&&this._onColor.fire([{type:1,index:this._specialColors[F],color:ee}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const F=[],M=j.split(";");for(let U=0;U<M.length;++U)if(/^\d+$/.exec(M[U])){const ee=parseInt(M[U]);re(ee)&&F.push({type:2,index:ee})}return F.length&&this._onColor.fire(F),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,x.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(I[j[0]],x.CHARSETS[j[1]]||x.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new v.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let F=0;F<this._bufferService.rows;++F){const M=this._activeBuffer.ybase+this._activeBuffer.y+F,U=this._activeBuffer.lines.get(M);U&&(U.fill(j),U.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,F){const M=this._bufferService.buffer,U=this._optionsService.rawOptions;return(ee=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${ee}${u.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${M.scrollTop+1};${M.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[U.cursorStyle]-(U.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,F){this._dirtyRowTracker.markRangeDirty(j,F)}}a.InputHandler=K;let z=class{constructor(G){this._bufferService=G,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(G){G<this.start?this.start=G:G>this.end&&(this.end=G)}markRangeDirty(G,j){G>j&&(J=G,G=j,j=J),G<this.start&&(this.start=G),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function re(G){return 0<=G&&G<256}z=p([m(0,R.IBufferService)],z)},844:(g,a)=>{function l(p){for(const m of p)m.dispose();p.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const p of this._disposables)p.dispose();this._disposables.length=0}register(p){return this._disposables.push(p),p}unregister(p){const m=this._disposables.indexOf(p);m!==-1&&this._disposables.splice(m,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(p){var m;this._isDisposed||p===this._value||((m=this._value)==null||m.dispose(),this._value=p)}clear(){this.value=void 0}dispose(){var p;this._isDisposed=!0,(p=this._value)==null||p.dispose(),this._value=void 0}},a.toDisposable=function(p){return{dispose:p}},a.disposeArray=l,a.getDisposeArrayDisposable=function(p){return{dispose:()=>l(p)}}},1505:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(m,u,x){this._data[m]||(this._data[m]={}),this._data[m][u]=x}get(m,u){return this._data[m]?this._data[m][u]:void 0}clear(){this._data={}}}a.TwoKeyMap=l,a.FourKeyMap=class{constructor(){this._data=new l}set(p,m,u,x,b){this._data.get(p,m)||this._data.set(p,m,new l),this._data.get(p,m).set(u,x,b)}get(p,m,u,x){var b;return(b=this._data.get(p,m))==null?void 0:b.get(u,x)}clear(){this._data.clear()}}},6114:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const l=a.isNode?"node":navigator.userAgent,p=a.isNode?"node":navigator.platform;a.isFirefox=l.includes("Firefox"),a.isLegacyEdge=l.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(l),a.getSafariVersion=function(){if(!a.isSafari)return 0;const m=l.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(p),a.isIpad=p==="iPad",a.isIphone=p==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(p),a.isLinux=p.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(l)},6106:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let l=0;a.SortedList=class{constructor(p){this._getKey=p,this._array=[]}clear(){this._array.length=0}insert(p){this._array.length!==0?(l=this._search(this._getKey(p)),this._array.splice(l,0,p)):this._array.push(p)}delete(p){if(this._array.length===0)return!1;const m=this._getKey(p);if(m===void 0||(l=this._search(m),l===-1)||this._getKey(this._array[l])!==m)return!1;do if(this._array[l]===p)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===m);return!1}*getKeyIterator(p){if(this._array.length!==0&&(l=this._search(p),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===p))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===p)}forEachByKey(p,m){if(this._array.length!==0&&(l=this._search(p),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===p))do m(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===p)}values(){return[...this._array].values()}_search(p){let m=0,u=this._array.length-1;for(;u>=m;){let x=m+u>>1;const b=this._getKey(this._array[x]);if(b>p)u=x-1;else{if(!(b<p)){for(;x>0&&this._getKey(this._array[x-1])===p;)x--;return x}m=x+1}}return m}}},7226:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const p=l(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let E=0,S=0,c=b.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),S=Math.max(E,S),y=b.timeRemaining(),1.5*S>y)return c-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(c-E))}ms`),void this._start();c=y}this.clear()}}class u extends m{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const E=Date.now()+b;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}a.PriorityTaskQueue=u,a.IdleTaskQueue=!p.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(x){return requestIdleCallback(x)}_cancelCallback(x){cancelIdleCallback(x)}}:u,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(x){this._queue.clear(),this._queue.enqueue(x)}flush(){this._queue.flush()}}},9282:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const p=l(643);a.updateWindowsModeWrappedState=function(m){const u=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),x=u==null?void 0:u.get(m.cols-1),b=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);b&&x&&(b.isWrapped=x[p.CHAR_DATA_CODE_INDEX]!==p.NULL_CELL_CODE&&x[p.CHAR_DATA_CODE_INDEX]!==p.WHITESPACE_CELL_CODE)}},3734:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new p}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=l;class p{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,x=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=x}clone(){return new p(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=p},9092:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const p=l(6349),m=l(7226),u=l(3734),x=l(8437),b=l(4634),E=l(511),S=l(643),c=l(4863),y=l(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(h,v,C){this._hasScrollback=h,this._optionsService=v,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=x.DEFAULT_ATTR_DATA.clone(),this.savedCharset=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=E.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=E.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(h){return h?(this._nullCell.fg=h.fg,this._nullCell.bg=h.bg,this._nullCell.extended=h.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(h){return h?(this._whitespaceCell.fg=h.fg,this._whitespaceCell.bg=h.bg,this._whitespaceCell.extended=h.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(h,v){return new x.BufferLine(this._bufferService.cols,this.getNullCell(h),v)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const h=this.ybase+this.y-this.ydisp;return h>=0&&h<this._rows}_getCorrectBufferLength(h){if(!this._hasScrollback)return h;const v=h+this._optionsService.rawOptions.scrollback;return v>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:v}fillViewportRows(h){if(this.lines.length===0){h===void 0&&(h=x.DEFAULT_ATTR_DATA);let v=this._rows;for(;v--;)this.lines.push(this.getBlankLine(h))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(h,v){const C=this.getNullCell(x.DEFAULT_ATTR_DATA);let R=0;const L=this._getCorrectBufferLength(v);if(L>this.lines.maxLength&&(this.lines.maxLength=L),this.lines.length>0){if(this._cols<h)for(let T=0;T<this.lines.length;T++)R+=+this.lines.get(T).resize(h,C);let D=0;if(this._rows<v)for(let T=this._rows;T<v;T++)this.lines.length<v+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new x.BufferLine(h,C)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new x.BufferLine(h,C)));else for(let T=this._rows;T>v;T--)this.lines.length>v+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(L<this.lines.maxLength){const T=this.lines.length-L;T>0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=L}this.x=Math.min(this.x,h-1),this.y=Math.min(this.y,v-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,h-1),this.scrollTop=0}if(this.scrollBottom=v-1,this._isReflowEnabled&&(this._reflow(h,v),this._cols>h))for(let D=0;D<this.lines.length;D++)R+=+this.lines.get(D).resize(h,C);this._cols=h,this._rows=v,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let h=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,h=!1);let v=0;for(;this._memoryCleanupPosition<this.lines.length;)if(v+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),v>100)return!0;return h}get _isReflowEnabled(){const h=this._optionsService.rawOptions.windowsPty;return h&&h.buildNumber?this._hasScrollback&&h.backend==="conpty"&&h.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(h,v){this._cols!==h&&(h>this._cols?this._reflowLarger(h,v):this._reflowSmaller(h,v))}_reflowLarger(h,v){const C=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,h,this.ybase+this.y,this.getNullCell(x.DEFAULT_ATTR_DATA));if(C.length>0){const R=(0,b.reflowLargerCreateNewLayout)(this.lines,C);(0,b.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(h,v,R.countRemoved)}}_reflowLargerAdjustViewport(h,v,C){const R=this.getNullCell(x.DEFAULT_ATTR_DATA);let L=C;for(;L-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<v&&this.lines.push(new x.BufferLine(h,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-C,0)}_reflowSmaller(h,v){const C=this.getNullCell(x.DEFAULT_ATTR_DATA),R=[];let L=0;for(let D=this.lines.length-1;D>=0;D--){let T=this.lines.get(D);if(!T||!T.isWrapped&&T.getTrimmedLength()<=h)continue;const A=[T];for(;T.isWrapped&&D>0;)T=this.lines.get(--D),A.unshift(T);const I=this.ybase+this.y;if(I>=D&&I<D+A.length)continue;const H=A[A.length-1].getTrimmedLength(),$=(0,b.reflowSmallerGetNewLineLengths)(A,this._cols,h),N=$.length-A.length;let J;J=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+N):Math.max(0,this.lines.length-this.lines.maxLength+N);const K=[];for(let M=0;M<N;M++){const U=this.getBlankLine(x.DEFAULT_ATTR_DATA,!0);K.push(U)}K.length>0&&(R.push({start:D+A.length+L,newLines:K}),L+=K.length),A.push(...K);let z=$.length-1,re=$[z];re===0&&(z--,re=$[z]);let G=A.length-N-1,j=H;for(;G>=0;){const M=Math.min(j,re);if(A[z]===void 0)break;if(A[z].copyCellsFrom(A[G],j-M,re-M,M,!0),re-=M,re===0&&(z--,re=$[z]),j-=M,j===0){G--;const U=Math.max(G,0);j=(0,b.getWrappedLineTrimmedLength)(A,U,this._cols)}}for(let M=0;M<A.length;M++)$[M]<h&&A[M].setCell($[M],C);let F=N-J;for(;F-- >0;)this.ybase===0?this.y<v-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+L)-v&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+N,this.ybase+v-1)}if(R.length>0){const D=[],T=[];for(let z=0;z<this.lines.length;z++)T.push(this.lines.get(z));const A=this.lines.length;let I=A-1,H=0,$=R[H];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+L);let N=0;for(let z=Math.min(this.lines.maxLength-1,A+L-1);z>=0;z--)if($&&$.start>I+N){for(let re=$.newLines.length-1;re>=0;re--)this.lines.set(z--,$.newLines[re]);z++,D.push({index:I+1,amount:$.newLines.length}),N+=$.newLines.length,$=R[++H]}else this.lines.set(z,T[I--]);let J=0;for(let z=D.length-1;z>=0;z--)D[z].index+=J,this.lines.onInsertEmitter.fire(D[z]),J+=D[z].amount;const K=Math.max(0,A+L-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(h,v,C=0,R){const L=this.lines.get(h);return L?L.translateToString(v,C,R):""}getWrappedRangeForLine(h){let v=h,C=h;for(;v>0&&this.lines.get(v).isWrapped;)v--;for(;C+1<this.lines.length&&this.lines.get(C+1).isWrapped;)C++;return{first:v,last:C}}setupTabStops(h){for(h!=null?this.tabs[h]||(h=this.prevStop(h)):(this.tabs={},h=0);h<this._cols;h+=this._optionsService.rawOptions.tabStopWidth)this.tabs[h]=!0}prevStop(h){for(h==null&&(h=this.x);!this.tabs[--h]&&h>0;);return h>=this._cols?this._cols-1:h<0?0:h}nextStop(h){for(h==null&&(h=this.x);!this.tabs[++h]&&h<this._cols;);return h>=this._cols?this._cols-1:h<0?0:h}clearMarkers(h){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].line===h&&(this.markers[v].dispose(),this.markers.splice(v--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].dispose(),this.markers.splice(h--,1);this._isClearing=!1}addMarker(h){const v=new c.Marker(h);return this.markers.push(v),v.register(this.lines.onTrim((C=>{v.line-=C,v.line<0&&v.dispose()}))),v.register(this.lines.onInsert((C=>{v.line>=C.index&&(v.line+=C.amount)}))),v.register(this.lines.onDelete((C=>{v.line>=C.index&&v.line<C.index+C.amount&&v.dispose(),v.line>C.index&&(v.line-=C.amount)}))),v.register(v.onDispose((()=>this._removeMarker(v)))),v}_removeMarker(h){this._isClearing||this.markers.splice(this.markers.indexOf(h),1)}}},8437:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const p=l(3734),m=l(511),u=l(643),x=l(482);a.DEFAULT_ATTR_DATA=Object.freeze(new p.AttributeData);let b=0;class E{constructor(c,y,h=!1){this.isWrapped=h,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*c);const v=y||m.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let C=0;C<c;++C)this.setCell(C,v);this.length=c}get(c){const y=this._data[3*c+0],h=2097151&y;return[this._data[3*c+1],2097152&y?this._combined[c]:h?(0,x.stringFromCodePoint)(h):"",y>>22,2097152&y?this._combined[c].charCodeAt(this._combined[c].length-1):h]}set(c,y){this._data[3*c+1]=y[u.CHAR_DATA_ATTR_INDEX],y[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[c]=y[1],this._data[3*c+0]=2097152|c|y[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*c+0]=y[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(c){return this._data[3*c+0]>>22}hasWidth(c){return 12582912&this._data[3*c+0]}getFg(c){return this._data[3*c+1]}getBg(c){return this._data[3*c+2]}hasContent(c){return 4194303&this._data[3*c+0]}getCodePoint(c){const y=this._data[3*c+0];return 2097152&y?this._combined[c].charCodeAt(this._combined[c].length-1):2097151&y}isCombined(c){return 2097152&this._data[3*c+0]}getString(c){const y=this._data[3*c+0];return 2097152&y?this._combined[c]:2097151&y?(0,x.stringFromCodePoint)(2097151&y):""}isProtected(c){return 536870912&this._data[3*c+2]}loadCell(c,y){return b=3*c,y.content=this._data[b+0],y.fg=this._data[b+1],y.bg=this._data[b+2],2097152&y.content&&(y.combinedData=this._combined[c]),268435456&y.bg&&(y.extended=this._extendedAttrs[c]),y}setCell(c,y){2097152&y.content&&(this._combined[c]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[c]=y.extended),this._data[3*c+0]=y.content,this._data[3*c+1]=y.fg,this._data[3*c+2]=y.bg}setCellFromCodepoint(c,y,h,v){268435456&v.bg&&(this._extendedAttrs[c]=v.extended),this._data[3*c+0]=y|h<<22,this._data[3*c+1]=v.fg,this._data[3*c+2]=v.bg}addCodepointToCell(c,y,h){let v=this._data[3*c+0];2097152&v?this._combined[c]+=(0,x.stringFromCodePoint)(y):2097151&v?(this._combined[c]=(0,x.stringFromCodePoint)(2097151&v)+(0,x.stringFromCodePoint)(y),v&=-2097152,v|=2097152):v=y|4194304,h&&(v&=-12582913,v|=h<<22),this._data[3*c+0]=v}insertCells(c,y,h){if((c%=this.length)&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,h),y<this.length-c){const v=new m.CellData;for(let C=this.length-c-y-1;C>=0;--C)this.setCell(c+y+C,this.loadCell(c+C,v));for(let C=0;C<y;++C)this.setCell(c+C,h)}else for(let v=c;v<this.length;++v)this.setCell(v,h);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,h)}deleteCells(c,y,h){if(c%=this.length,y<this.length-c){const v=new m.CellData;for(let C=0;C<this.length-c-y;++C)this.setCell(c+C,this.loadCell(c+y+C,v));for(let C=this.length-y;C<this.length;++C)this.setCell(C,h)}else for(let v=c;v<this.length;++v)this.setCell(v,h);c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,h),this.getWidth(c)!==0||this.hasContent(c)||this.setCellFromCodepoint(c,0,1,h)}replaceCells(c,y,h,v=!1){if(v)for(c&&this.getWidth(c-1)===2&&!this.isProtected(c-1)&&this.setCellFromCodepoint(c-1,0,1,h),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,h);c<y&&c<this.length;)this.isProtected(c)||this.setCell(c,h),c++;else for(c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,h),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,h);c<y&&c<this.length;)this.setCell(c++,h)}resize(c,y){if(c===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const h=3*c;if(c>this.length){if(this._data.buffer.byteLength>=4*h)this._data=new Uint32Array(this._data.buffer,0,h);else{const v=new Uint32Array(h);v.set(this._data),this._data=v}for(let v=this.length;v<c;++v)this.setCell(v,y)}else{this._data=this._data.subarray(0,h);const v=Object.keys(this._combined);for(let R=0;R<v.length;R++){const L=parseInt(v[R],10);L>=c&&delete this._combined[L]}const C=Object.keys(this._extendedAttrs);for(let R=0;R<C.length;R++){const L=parseInt(C[R],10);L>=c&&delete this._extendedAttrs[L]}}return this.length=c,4*h*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const c=new Uint32Array(this._data.length);return c.set(this._data),this._data=c,1}return 0}fill(c,y=!1){if(y)for(let h=0;h<this.length;++h)this.isProtected(h)||this.setCell(h,c);else{this._combined={},this._extendedAttrs={};for(let h=0;h<this.length;++h)this.setCell(h,c)}}copyFrom(c){this.length!==c.length?this._data=new Uint32Array(c._data):this._data.set(c._data),this.length=c.length,this._combined={};for(const y in c._combined)this._combined[y]=c._combined[y];this._extendedAttrs={};for(const y in c._extendedAttrs)this._extendedAttrs[y]=c._extendedAttrs[y];this.isWrapped=c.isWrapped}clone(){const c=new E(0);c._data=new Uint32Array(this._data),c.length=this.length;for(const y in this._combined)c._combined[y]=this._combined[y];for(const y in this._extendedAttrs)c._extendedAttrs[y]=this._extendedAttrs[y];return c.isWrapped=this.isWrapped,c}getTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0])return c+(this._data[3*c+0]>>22);return 0}getNoBgTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0]||50331648&this._data[3*c+2])return c+(this._data[3*c+0]>>22);return 0}copyCellsFrom(c,y,h,v,C){const R=c._data;if(C)for(let D=v-1;D>=0;D--){for(let T=0;T<3;T++)this._data[3*(h+D)+T]=R[3*(y+D)+T];268435456&R[3*(y+D)+2]&&(this._extendedAttrs[h+D]=c._extendedAttrs[y+D])}else for(let D=0;D<v;D++){for(let T=0;T<3;T++)this._data[3*(h+D)+T]=R[3*(y+D)+T];268435456&R[3*(y+D)+2]&&(this._extendedAttrs[h+D]=c._extendedAttrs[y+D])}const L=Object.keys(c._combined);for(let D=0;D<L.length;D++){const T=parseInt(L[D],10);T>=y&&(this._combined[T-y+h]=c._combined[T])}}translateToString(c,y,h,v){y=y??0,h=h??this.length,c&&(h=Math.min(h,this.getTrimmedLength())),v&&(v.length=0);let C="";for(;y<h;){const R=this._data[3*y+0],L=2097151&R,D=2097152&R?this._combined[y]:L?(0,x.stringFromCodePoint)(L):u.WHITESPACE_CELL_CHAR;if(C+=D,v)for(let T=0;T<D.length;++T)v.push(y);y+=R>>22||1}return v&&v.push(y),C}}a.BufferLine=E},4841:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(l,p){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return p*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(g,a)=>{function l(p,m,u){if(m===p.length-1)return p[m].getTrimmedLength();const x=!p[m].hasContent(u-1)&&p[m].getWidth(u-1)===1,b=p[m+1].getWidth(0)===2;return x&&b?u-1:u}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(p,m,u,x,b){const E=[];for(let S=0;S<p.length-1;S++){let c=S,y=p.get(++c);if(!y.isWrapped)continue;const h=[p.get(S)];for(;c<p.length&&y.isWrapped;)h.push(y),y=p.get(++c);if(x>=S&&x<c){S+=h.length-1;continue}let v=0,C=l(h,v,m),R=1,L=0;for(;R<h.length;){const T=l(h,R,m),A=T-L,I=u-C,H=Math.min(A,I);h[v].copyCellsFrom(h[R],L,C,H,!1),C+=H,C===u&&(v++,C=0),L+=H,L===T&&(R++,L=0),C===0&&v!==0&&h[v-1].getWidth(u-1)===2&&(h[v].copyCellsFrom(h[v-1],u-1,C++,1,!1),h[v-1].setCell(u-1,b))}h[v].replaceCells(C,u,b);let D=0;for(let T=h.length-1;T>0&&(T>v||h[T].getTrimmedLength()===0);T--)D++;D>0&&(E.push(S+h.length-D),E.push(D)),S+=h.length-1}return E},a.reflowLargerCreateNewLayout=function(p,m){const u=[];let x=0,b=m[x],E=0;for(let S=0;S<p.length;S++)if(b===S){const c=m[++x];p.onDeleteEmitter.fire({index:S-E,amount:c}),S+=c-1,E+=c,b=m[++x]}else u.push(S);return{layout:u,countRemoved:E}},a.reflowLargerApplyNewLayout=function(p,m){const u=[];for(let x=0;x<m.length;x++)u.push(p.get(m[x]));for(let x=0;x<u.length;x++)p.set(x,u[x]);p.length=m.length},a.reflowSmallerGetNewLineLengths=function(p,m,u){const x=[],b=p.map(((y,h)=>l(p,h,m))).reduce(((y,h)=>y+h));let E=0,S=0,c=0;for(;c<b;){if(b-c<u){x.push(b-c);break}E+=u;const y=l(p,S,m);E>y&&(E-=y,S++);const h=p[S].getWidth(E-1)===2;h&&E--;const v=h?u-1:u;x.push(v),c+=v}return x},a.getWrappedLineTrimmedLength=l},5295:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const p=l(8460),m=l(844),u=l(9092);class x extends m.Disposable{constructor(E,S){super(),this._optionsService=E,this._bufferService=S,this._onBufferActivate=this.register(new p.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(E){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(E),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(E,S){this._normal.resize(E,S),this._alt.resize(E,S),this.setupTabStops(E)}setupTabStops(E){this._normal.setupTabStops(E),this._alt.setupTabStops(E)}}a.BufferSet=x},511:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const p=l(482),m=l(643),u=l(3734);class x extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const S=new x;return S.setFromCharData(E),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,p.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(E){this.fg=E[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(E[m.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(E[m.CHAR_DATA_CHAR_INDEX].length===2){const c=E[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&c<=56319){const y=E[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(c-55296)+y-56320+65536|E[m.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=E[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[m.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=E[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=x},643:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const p=l(8460),m=l(844);class u{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}a.Marker=u,u._nextId=1},7116:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(g,a)=>{var l,p,m;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
49
|
+
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(l||(a.C0=l={})),(function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""})(p||(a.C1=p={})),(function(u){u.ST=`${l.ESC}\\`})(m||(a.C1_ESCAPED=m={}))},7399:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const p=l(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(u,x,b,E){const S={type:0,cancel:!1,key:void 0},c=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?S.key=x?p.C0.ESC+"OA":p.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?S.key=x?p.C0.ESC+"OD":p.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?S.key=x?p.C0.ESC+"OC":p.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(S.key=x?p.C0.ESC+"OB":p.C0.ESC+"[B");break;case 8:S.key=u.ctrlKey?"\b":p.C0.DEL,u.altKey&&(S.key=p.C0.ESC+S.key);break;case 9:if(u.shiftKey){S.key=p.C0.ESC+"[Z";break}S.key=p.C0.HT,S.cancel=!0;break;case 13:S.key=u.altKey?p.C0.ESC+p.C0.CR:p.C0.CR,S.cancel=!0;break;case 27:S.key=p.C0.ESC,u.altKey&&(S.key=p.C0.ESC+p.C0.ESC),S.cancel=!0;break;case 37:if(u.metaKey)break;c?(S.key=p.C0.ESC+"[1;"+(c+1)+"D",S.key===p.C0.ESC+"[1;3D"&&(S.key=p.C0.ESC+(b?"b":"[1;5D"))):S.key=x?p.C0.ESC+"OD":p.C0.ESC+"[D";break;case 39:if(u.metaKey)break;c?(S.key=p.C0.ESC+"[1;"+(c+1)+"C",S.key===p.C0.ESC+"[1;3C"&&(S.key=p.C0.ESC+(b?"f":"[1;5C"))):S.key=x?p.C0.ESC+"OC":p.C0.ESC+"[C";break;case 38:if(u.metaKey)break;c?(S.key=p.C0.ESC+"[1;"+(c+1)+"A",b||S.key!==p.C0.ESC+"[1;3A"||(S.key=p.C0.ESC+"[1;5A")):S.key=x?p.C0.ESC+"OA":p.C0.ESC+"[A";break;case 40:if(u.metaKey)break;c?(S.key=p.C0.ESC+"[1;"+(c+1)+"B",b||S.key!==p.C0.ESC+"[1;3B"||(S.key=p.C0.ESC+"[1;5B")):S.key=x?p.C0.ESC+"OB":p.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(S.key=p.C0.ESC+"[2~");break;case 46:S.key=c?p.C0.ESC+"[3;"+(c+1)+"~":p.C0.ESC+"[3~";break;case 36:S.key=c?p.C0.ESC+"[1;"+(c+1)+"H":x?p.C0.ESC+"OH":p.C0.ESC+"[H";break;case 35:S.key=c?p.C0.ESC+"[1;"+(c+1)+"F":x?p.C0.ESC+"OF":p.C0.ESC+"[F";break;case 33:u.shiftKey?S.type=2:u.ctrlKey?S.key=p.C0.ESC+"[5;"+(c+1)+"~":S.key=p.C0.ESC+"[5~";break;case 34:u.shiftKey?S.type=3:u.ctrlKey?S.key=p.C0.ESC+"[6;"+(c+1)+"~":S.key=p.C0.ESC+"[6~";break;case 112:S.key=c?p.C0.ESC+"[1;"+(c+1)+"P":p.C0.ESC+"OP";break;case 113:S.key=c?p.C0.ESC+"[1;"+(c+1)+"Q":p.C0.ESC+"OQ";break;case 114:S.key=c?p.C0.ESC+"[1;"+(c+1)+"R":p.C0.ESC+"OR";break;case 115:S.key=c?p.C0.ESC+"[1;"+(c+1)+"S":p.C0.ESC+"OS";break;case 116:S.key=c?p.C0.ESC+"[15;"+(c+1)+"~":p.C0.ESC+"[15~";break;case 117:S.key=c?p.C0.ESC+"[17;"+(c+1)+"~":p.C0.ESC+"[17~";break;case 118:S.key=c?p.C0.ESC+"[18;"+(c+1)+"~":p.C0.ESC+"[18~";break;case 119:S.key=c?p.C0.ESC+"[19;"+(c+1)+"~":p.C0.ESC+"[19~";break;case 120:S.key=c?p.C0.ESC+"[20;"+(c+1)+"~":p.C0.ESC+"[20~";break;case 121:S.key=c?p.C0.ESC+"[21;"+(c+1)+"~":p.C0.ESC+"[21~";break;case 122:S.key=c?p.C0.ESC+"[23;"+(c+1)+"~":p.C0.ESC+"[23~";break;case 123:S.key=c?p.C0.ESC+"[24;"+(c+1)+"~":p.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(b&&!E||!u.altKey||u.metaKey)!b||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?S.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(S.key=p.C0.US),u.key==="@"&&(S.key=p.C0.NUL)):u.keyCode===65&&(S.type=1);else{const y=m[u.keyCode],h=y==null?void 0:y[u.shiftKey?1:0];if(h)S.key=p.C0.ESC+h;else if(u.keyCode>=65&&u.keyCode<=90){const v=u.ctrlKey?u.keyCode-64:u.keyCode+32;let C=String.fromCharCode(v);u.shiftKey&&(C=C.toUpperCase()),S.key=p.C0.ESC+C}else if(u.keyCode===32)S.key=p.C0.ESC+(u.ctrlKey?p.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let v=u.code.slice(3,4);u.shiftKey||(v=v.toLowerCase()),S.key=p.C0.ESC+v,S.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?S.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?S.key=p.C0.NUL:u.keyCode>=51&&u.keyCode<=55?S.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?S.key=p.C0.DEL:u.keyCode===219?S.key=p.C0.ESC:u.keyCode===220?S.key=p.C0.FS:u.keyCode===221&&(S.key=p.C0.GS)}return S}},482:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},a.utf32ToString=function(l,p=0,m=l.length){let u="";for(let x=p;x<m;++x){let b=l[x];b>65535?(b-=65536,u+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):u+=String.fromCharCode(b)}return u},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,p){const m=l.length;if(!m)return 0;let u=0,x=0;if(this._interim){const b=l.charCodeAt(x++);56320<=b&&b<=57343?p[u++]=1024*(this._interim-55296)+b-56320+65536:(p[u++]=this._interim,p[u++]=b),this._interim=0}for(let b=x;b<m;++b){const E=l.charCodeAt(b);if(55296<=E&&E<=56319){if(++b>=m)return this._interim=E,u;const S=l.charCodeAt(b);56320<=S&&S<=57343?p[u++]=1024*(E-55296)+S-56320+65536:(p[u++]=E,p[u++]=S)}else E!==65279&&(p[u++]=E)}return u}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,p){const m=l.length;if(!m)return 0;let u,x,b,E,S=0,c=0,y=0;if(this.interim[0]){let C=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let L,D=0;for(;(L=63&this.interim[++D])&&D<4;)R<<=6,R|=L;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,A=T-D;for(;y<A;){if(y>=m)return 0;if(L=l[y++],(192&L)!=128){y--,C=!0;break}this.interim[D++]=L,R<<=6,R|=63&L}C||(T===2?R<128?y--:p[S++]=R:T===3?R<2048||R>=55296&&R<=57343||R===65279||(p[S++]=R):R<65536||R>1114111||(p[S++]=R)),this.interim.fill(0)}const h=m-4;let v=y;for(;v<m;){for(;!(!(v<h)||128&(u=l[v])||128&(x=l[v+1])||128&(b=l[v+2])||128&(E=l[v+3]));)p[S++]=u,p[S++]=x,p[S++]=b,p[S++]=E,v+=4;if(u=l[v++],u<128)p[S++]=u;else if((224&u)==192){if(v>=m)return this.interim[0]=u,S;if(x=l[v++],(192&x)!=128){v--;continue}if(c=(31&u)<<6|63&x,c<128){v--;continue}p[S++]=c}else if((240&u)==224){if(v>=m)return this.interim[0]=u,S;if(x=l[v++],(192&x)!=128){v--;continue}if(v>=m)return this.interim[0]=u,this.interim[1]=x,S;if(b=l[v++],(192&b)!=128){v--;continue}if(c=(15&u)<<12|(63&x)<<6|63&b,c<2048||c>=55296&&c<=57343||c===65279)continue;p[S++]=c}else if((248&u)==240){if(v>=m)return this.interim[0]=u,S;if(x=l[v++],(192&x)!=128){v--;continue}if(v>=m)return this.interim[0]=u,this.interim[1]=x,S;if(b=l[v++],(192&b)!=128){v--;continue}if(v>=m)return this.interim[0]=u,this.interim[1]=x,this.interim[2]=b,S;if(E=l[v++],(192&E)!=128){v--;continue}if(c=(7&u)<<18|(63&x)<<12|(63&b)<<6|63&E,c<65536||c>1114111)continue;p[S++]=c}}return S}}},225:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const p=l(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let x;a.UnicodeV6=class{constructor(){if(this.version="6",!x){x=new Uint8Array(65536),x.fill(1),x[0]=0,x.fill(0,1,32),x.fill(0,127,160),x.fill(2,4352,4448),x[9001]=2,x[9002]=2,x.fill(2,11904,42192),x[12351]=1,x.fill(2,44032,55204),x.fill(2,63744,64256),x.fill(2,65040,65050),x.fill(2,65072,65136),x.fill(2,65280,65377),x.fill(2,65504,65511);for(let b=0;b<m.length;++b)x.fill(0,m[b][0],m[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?x[b]:(function(E,S){let c,y=0,h=S.length-1;if(E<S[0][0]||E>S[h][1])return!1;for(;h>=y;)if(c=y+h>>1,E>S[c][1])y=c+1;else{if(!(E<S[c][0]))return!0;h=c-1}return!1})(b,u)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,E){let S=this.wcwidth(b),c=S===0&&E!==0;if(c){const y=p.UnicodeService.extractWidth(E);y===0?c=!1:y>S&&(S=y)}return p.UnicodeService.createPropertyValue(0,S,c)}}},5981:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const p=l(8460),m=l(844);class u extends m.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const c=this._callbacks.shift();c&&c()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,E){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(E)}_innerWrite(b=0,E=!0){const S=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const c=this._writeBuffer[this._bufferOffset],y=this._action(c,E);if(y){const v=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void y.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(v)}const h=this._callbacks[this._bufferOffset];if(h&&h(),this._bufferOffset++,this._pendingData-=c.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=u},5941:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,p=/^[\da-f]+$/;function m(u,x){const b=u.toString(16),E=b.length<2?"0"+b:b;switch(x){case 4:return b[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}a.parseColor=function(u){if(!u)return;let x=u.toLowerCase();if(x.indexOf("rgb:")===0){x=x.slice(4);const b=l.exec(x);if(b){const E=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/E*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/E*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/E*255)]}}else if(x.indexOf("#")===0&&(x=x.slice(1),p.exec(x)&&[3,6,9,12].includes(x.length))){const b=x.length/3,E=[0,0,0];for(let S=0;S<3;++S){const c=parseInt(x.slice(b*S,b*S+b),16);E[S]=b===1?c<<4:b===2?c:b===3?c>>4:c>>8}return E}},a.toRgbString=function(u,x=16){const[b,E,S]=u;return`rgb:${m(b,x)}/${m(E,x)}/${m(S,x)}`}},5770:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const p=l(482),m=l(8742),u=l(5770),x=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=x,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=x}registerHandler(E,S){this._handlers[E]===void 0&&(this._handlers[E]=[]);const c=this._handlers[E];return c.push(S),{dispose:()=>{const y=c.indexOf(S);y!==-1&&c.splice(y,1)}}}clearHandler(E){this._handlers[E]&&delete this._handlers[E]}setHandlerFallback(E){this._handlerFb=E}reset(){if(this._active.length)for(let E=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;E>=0;--E)this._active[E].unhook(!1);this._stack.paused=!1,this._active=x,this._ident=0}hook(E,S){if(this.reset(),this._ident=E,this._active=this._handlers[E]||x,this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(E,S,c){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(E,S,c);else this._handlerFb(this._ident,"PUT",(0,p.utf32ToString)(E,S,c))}unhook(E,S=!0){if(this._active.length){let c=!1,y=this._active.length-1,h=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,c=S,h=this._stack.fallThrough,this._stack.paused=!1),!h&&c===!1){for(;y>=0&&(c=this._active[y].unhook(E),c!==!0);y--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,c;y--}for(;y>=0;y--)if(c=this._active[y].unhook(!1),c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,c}else this._handlerFb(this._ident,"UNHOOK",E);this._active=x,this._ident=0}};const b=new m.Params;b.addParam(0),a.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=b,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():b,this._data="",this._hitLimit=!1}put(E,S,c){this._hitLimit||(this._data+=(0,p.utf32ToString)(E,S,c),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let S=!1;if(this._hitLimit)S=!1;else if(E&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((c=>(this._params=b,this._data="",this._hitLimit=!1,c)));return this._params=b,this._data="",this._hitLimit=!1,S}}},2015:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const p=l(844),m=l(8742),u=l(6242),x=l(6351);class b{constructor(y){this.table=new Uint8Array(y)}setDefault(y,h){this.table.fill(y<<4|h)}add(y,h,v,C){this.table[h<<8|y]=v<<4|C}addMany(y,h,v,C){for(let R=0;R<y.length;R++)this.table[h<<8|y[R]]=v<<4|C}}a.TransitionTable=b;const E=160;a.VT500_TRANSITION_TABLE=(function(){const c=new b(4095),y=Array.apply(null,Array(256)).map(((D,T)=>T)),h=(D,T)=>y.slice(D,T),v=h(32,127),C=h(0,24);C.push(25),C.push.apply(C,h(28,32));const R=h(0,14);let L;for(L in c.setDefault(1,0),c.addMany(v,0,2,0),R)c.addMany([24,26,153,154],L,3,0),c.addMany(h(128,144),L,3,0),c.addMany(h(144,152),L,3,0),c.add(156,L,0,0),c.add(27,L,11,1),c.add(157,L,4,8),c.addMany([152,158,159],L,0,7),c.add(155,L,11,3),c.add(144,L,11,9);return c.addMany(C,0,3,0),c.addMany(C,1,3,1),c.add(127,1,0,1),c.addMany(C,8,0,8),c.addMany(C,3,3,3),c.add(127,3,0,3),c.addMany(C,4,3,4),c.add(127,4,0,4),c.addMany(C,6,3,6),c.addMany(C,5,3,5),c.add(127,5,0,5),c.addMany(C,2,3,2),c.add(127,2,0,2),c.add(93,1,4,8),c.addMany(v,8,5,8),c.add(127,8,5,8),c.addMany([156,27,24,26,7],8,6,0),c.addMany(h(28,32),8,0,8),c.addMany([88,94,95],1,0,7),c.addMany(v,7,0,7),c.addMany(C,7,0,7),c.add(156,7,0,0),c.add(127,7,0,7),c.add(91,1,11,3),c.addMany(h(64,127),3,7,0),c.addMany(h(48,60),3,8,4),c.addMany([60,61,62,63],3,9,4),c.addMany(h(48,60),4,8,4),c.addMany(h(64,127),4,7,0),c.addMany([60,61,62,63],4,0,6),c.addMany(h(32,64),6,0,6),c.add(127,6,0,6),c.addMany(h(64,127),6,0,0),c.addMany(h(32,48),3,9,5),c.addMany(h(32,48),5,9,5),c.addMany(h(48,64),5,0,6),c.addMany(h(64,127),5,7,0),c.addMany(h(32,48),4,9,5),c.addMany(h(32,48),1,9,2),c.addMany(h(32,48),2,9,2),c.addMany(h(48,127),2,10,0),c.addMany(h(48,80),1,10,0),c.addMany(h(81,88),1,10,0),c.addMany([89,90,92],1,10,0),c.addMany(h(96,127),1,10,0),c.add(80,1,11,9),c.addMany(C,9,0,9),c.add(127,9,0,9),c.addMany(h(28,32),9,0,9),c.addMany(h(32,48),9,9,12),c.addMany(h(48,60),9,8,10),c.addMany([60,61,62,63],9,9,10),c.addMany(C,11,0,11),c.addMany(h(32,128),11,0,11),c.addMany(h(28,32),11,0,11),c.addMany(C,10,0,10),c.add(127,10,0,10),c.addMany(h(28,32),10,0,10),c.addMany(h(48,60),10,8,10),c.addMany([60,61,62,63],10,0,11),c.addMany(h(32,48),10,9,12),c.addMany(C,12,0,12),c.add(127,12,0,12),c.addMany(h(28,32),12,0,12),c.addMany(h(32,48),12,9,12),c.addMany(h(48,64),12,0,11),c.addMany(h(64,127),12,12,13),c.addMany(h(64,127),10,12,13),c.addMany(h(64,127),9,12,13),c.addMany(C,13,13,13),c.addMany(v,13,13,13),c.add(127,13,0,13),c.addMany([27,156,24,26],13,14,0),c.add(E,0,2,0),c.add(E,8,5,8),c.add(E,6,0,6),c.add(E,11,0,11),c.add(E,13,13,13),c})();class S extends p.Disposable{constructor(y=a.VT500_TRANSITION_TABLE){super(),this._transitions=y,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(h,v,C)=>{},this._executeHandlerFb=h=>{},this._csiHandlerFb=(h,v)=>{},this._escHandlerFb=h=>{},this._errorHandlerFb=h=>h,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,p.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new x.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,h=[64,126]){let v=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(v=y.prefix.charCodeAt(0),v&&60>v||v>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<y.intermediates.length;++R){const L=y.intermediates.charCodeAt(R);if(32>L||L>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");v<<=8,v|=L}}if(y.final.length!==1)throw new Error("final must be a single byte");const C=y.final.charCodeAt(0);if(h[0]>C||C>h[1])throw new Error(`final must be in range ${h[0]} .. ${h[1]}`);return v<<=8,v|=C,v}identToString(y){const h=[];for(;y;)h.push(String.fromCharCode(255&y)),y>>=8;return h.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,h){const v=this._identifier(y,[48,126]);this._escHandlers[v]===void 0&&(this._escHandlers[v]=[]);const C=this._escHandlers[v];return C.push(h),{dispose:()=>{const R=C.indexOf(h);R!==-1&&C.splice(R,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,h){this._executeHandlers[y.charCodeAt(0)]=h}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,h){const v=this._identifier(y);this._csiHandlers[v]===void 0&&(this._csiHandlers[v]=[]);const C=this._csiHandlers[v];return C.push(h),{dispose:()=>{const R=C.indexOf(h);R!==-1&&C.splice(R,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,h){return this._dcsParser.registerHandler(this._identifier(y),h)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,h){return this._oscParser.registerHandler(y,h)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}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(y,h,v,C,R){this._parseStack.state=y,this._parseStack.handlers=h,this._parseStack.handlerPos=v,this._parseStack.transition=C,this._parseStack.chunkPos=R}parse(y,h,v){let C,R=0,L=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(v===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const T=this._parseStack.handlers;let A=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(v===!1&&A>-1){for(;A>=0&&(C=T[A](this._params),C!==!0);A--)if(C instanceof Promise)return this._parseStack.handlerPos=A,C}this._parseStack.handlers=[];break;case 4:if(v===!1&&A>-1){for(;A>=0&&(C=T[A](),C!==!0);A--)if(C instanceof Promise)return this._parseStack.handlerPos=A,C}this._parseStack.handlers=[];break;case 6:if(R=y[this._parseStack.chunkPos],C=this._dcsParser.unhook(R!==24&&R!==26,v),C)return C;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=y[this._parseStack.chunkPos],C=this._oscParser.end(R!==24&&R!==26,v),C)return C;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=D;T<h;++T){switch(R=y[T],L=this._transitions.table[this.currentState<<8|(R<160?R:E)],L>>4){case 2:for(let N=T+1;;++N){if(N>=h||(R=y[N])<32||R>126&&R<E){this._printHandler(y,T,N),T=N-1;break}if(++N>=h||(R=y[N])<32||R>126&&R<E){this._printHandler(y,T,N),T=N-1;break}if(++N>=h||(R=y[N])<32||R>126&&R<E){this._printHandler(y,T,N),T=N-1;break}if(++N>=h||(R=y[N])<32||R>126&&R<E){this._printHandler(y,T,N),T=N-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:T,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const A=this._csiHandlers[this._collect<<8|R];let I=A?A.length-1:-1;for(;I>=0&&(C=A[I](this._params),C!==!0);I--)if(C instanceof Promise)return this._preserveStack(3,A,I,L,T),C;I<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++T<h&&(R=y[T])>47&&R<60);T--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const H=this._escHandlers[this._collect<<8|R];let $=H?H.length-1:-1;for(;$>=0&&(C=H[$](),C!==!0);$--)if(C instanceof Promise)return this._preserveStack(4,H,$,L,T),C;$<0&&this._escHandlerFb(this._collect<<8|R),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|R,this._params);break;case 13:for(let N=T+1;;++N)if(N>=h||(R=y[N])===24||R===26||R===27||R>127&&R<E){this._dcsParser.put(y,T,N),T=N-1;break}break;case 14:if(C=this._dcsParser.unhook(R!==24&&R!==26),C)return this._preserveStack(6,[],0,L,T),C;R===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 N=T+1;;N++)if(N>=h||(R=y[N])<32||R>127&&R<E){this._oscParser.put(y,T,N),T=N-1;break}break;case 6:if(C=this._oscParser.end(R!==24&&R!==26),C)return this._preserveStack(5,[],0,L,T),C;R===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&L}}}a.EscapeSequenceParser=S},6242:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const p=l(5770),m=l(482),u=[];a.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(x,b){this._handlers[x]===void 0&&(this._handlers[x]=[]);const E=this._handlers[x];return E.push(b),{dispose:()=>{const S=E.indexOf(b);S!==-1&&E.splice(S,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].start();else this._handlerFb(this._id,"START")}_put(x,b,E){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(x,b,E);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(x,b,E))}start(){this.reset(),this._state=1}put(x,b,E){if(this._state!==3){if(this._state===1)for(;b<E;){const S=x[b++];if(S===59){this._state=2,this._start();break}if(S<48||57<S)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+S-48}this._state===2&&E-b>0&&this._put(x,b,E)}}end(x,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,S=this._active.length-1,c=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,E=b,c=this._stack.fallThrough,this._stack.paused=!1),!c&&E===!1){for(;S>=0&&(E=this._active[S].end(x),E!==!0);S--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,E;S--}for(;S>=0;S--)if(E=this._active[S].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",x);this._active=u,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(x){this._handler=x,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(x,b,E){this._hitLimit||(this._data+=(0,m.utf32ToString)(x,b,E),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(x){let b=!1;if(this._hitLimit)b=!1;else if(x&&(b=this._handler(this._data),b instanceof Promise))return b.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,b}}},8742:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const l=2147483647;class p{static fromArray(u){const x=new p;if(!u.length)return x;for(let b=Array.isArray(u[0])?1:0;b<u.length;++b){const E=u[b];if(Array.isArray(E))for(let S=0;S<E.length;++S)x.addSubParam(E[S]);else x.addParam(E)}return x}constructor(u=32,x=32){if(this.maxLength=u,this.maxSubParamsLength=x,x>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(x),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new p(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let x=0;x<this.length;++x){u.push(this.params[x]);const b=this._subParamsIdx[x]>>8,E=255&this._subParamsIdx[x];E-b>0&&u.push(Array.prototype.slice.call(this._subParams,b,E))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>l?l:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>l?l:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const x=this._subParamsIdx[u]>>8,b=255&this._subParamsIdx[u];return b-x>0?this._subParams.subarray(x,b):null}getSubParamsAll(){const u={};for(let x=0;x<this.length;++x){const b=this._subParamsIdx[x]>>8,E=255&this._subParamsIdx[x];E-b>0&&(u[x]=this._subParams.slice(b,E))}return u}addDigit(u){let x;if(this._rejectDigits||!(x=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,E=b[x-1];b[x-1]=~E?Math.min(10*E+u,l):u}}a.Params=p},5741:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,p){const m={instance:p,dispose:p.dispose,isDisposed:!1};this._addons.push(m),p.dispose=()=>this._wrappedAddonDispose(m),p.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let p=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===l){p=m;break}if(p===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(p,1)}}},8771:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const p=l(3785),m=l(511);a.BufferApiView=class{constructor(u,x){this._buffer=u,this.type=x}init(u){return this._buffer=u,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(u){const x=this._buffer.lines.get(u);if(x)return new p.BufferLineApiView(x)}getNullCell(){return new m.CellData}}},3785:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const p=l(511);a.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,u){if(!(m<0||m>=this._line.length))return u?(this._line.loadCell(m,u),u):this._line.loadCell(m,new p.CellData)}translateToString(m,u,x){return this._line.translateToString(m,u,x)}}},8285:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const p=l(8771),m=l(8460),u=l(844);class x extends u.Disposable{constructor(E){super(),this._core=E,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new p.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new p.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=x},7975:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,p){return this._core.registerCsiHandler(l,(m=>p(m.toArray())))}addCsiHandler(l,p){return this.registerCsiHandler(l,p)}registerDcsHandler(l,p){return this._core.registerDcsHandler(l,((m,u)=>p(m,u.toArray())))}addDcsHandler(l,p){return this.registerDcsHandler(l,p)}registerEscHandler(l,p){return this._core.registerEscHandler(l,p)}addEscHandler(l,p){return this.registerEscHandler(l,p)}registerOscHandler(l,p){return this._core.registerOscHandler(l,p)}addOscHandler(l,p){return this.registerOscHandler(l,p)}}},7090:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(g,a,l){var p=this&&this.__decorate||function(c,y,h,v){var C,R=arguments.length,L=R<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(c,y,h,v);else for(var D=c.length-1;D>=0;D--)(C=c[D])&&(L=(R<3?C(L):R>3?C(y,h,L):C(y,h))||L);return R>3&&L&&Object.defineProperty(y,h,L),L},m=this&&this.__param||function(c,y){return function(h,v){y(h,v,c)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const u=l(8460),x=l(844),b=l(5295),E=l(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let S=a.BufferService=class extends x.Disposable{get buffer(){return this.buffers.active}constructor(c){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(c.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(c.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(c,this))}resize(c,y){this.cols=c,this.rows=y,this.buffers.resize(c,y),this._onResize.fire({cols:c,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(c,y=!1){const h=this.buffer;let v;v=this._cachedBlankLine,v&&v.length===this.cols&&v.getFg(0)===c.fg&&v.getBg(0)===c.bg||(v=h.getBlankLine(c,y),this._cachedBlankLine=v),v.isWrapped=y;const C=h.ybase+h.scrollTop,R=h.ybase+h.scrollBottom;if(h.scrollTop===0){const L=h.lines.isFull;R===h.lines.length-1?L?h.lines.recycle().copyFrom(v):h.lines.push(v.clone()):h.lines.splice(R+1,0,v.clone()),L?this.isUserScrolling&&(h.ydisp=Math.max(h.ydisp-1,0)):(h.ybase++,this.isUserScrolling||h.ydisp++)}else{const L=R-C+1;h.lines.shiftElements(C+1,L-1,-1),h.lines.set(R,v.clone())}this.isUserScrolling||(h.ydisp=h.ybase),this._onScroll.fire(h.ydisp)}scrollLines(c,y,h){const v=this.buffer;if(c<0){if(v.ydisp===0)return;this.isUserScrolling=!0}else c+v.ydisp>=v.ybase&&(this.isUserScrolling=!1);const C=v.ydisp;v.ydisp=Math.max(Math.min(v.ydisp+c,v.ybase),0),C!==v.ydisp&&(y||this._onScroll.fire(v.ydisp))}};a.BufferService=S=p([m(0,E.IOptionsService)],S)},7994:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,p){this._charsets[l]=p,this.glevel===l&&(this.charset=p)}}},1753:function(g,a,l){var p=this&&this.__decorate||function(v,C,R,L){var D,T=arguments.length,A=T<3?C:L===null?L=Object.getOwnPropertyDescriptor(C,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(v,C,R,L);else for(var I=v.length-1;I>=0;I--)(D=v[I])&&(A=(T<3?D(A):T>3?D(C,R,A):D(C,R))||A);return T>3&&A&&Object.defineProperty(C,R,A),A},m=this&&this.__param||function(v,C){return function(R,L){C(R,L,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const u=l(2585),x=l(8460),b=l(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:v=>v.button!==4&&v.action===1&&(v.ctrl=!1,v.alt=!1,v.shift=!1,!0)},VT200:{events:19,restrict:v=>v.action!==32},DRAG:{events:23,restrict:v=>v.action!==32||v.button!==3},ANY:{events:31,restrict:v=>!0}};function S(v,C){let R=(v.ctrl?16:0)|(v.shift?4:0)|(v.alt?8:0);return v.button===4?(R|=64,R|=v.action):(R|=3&v.button,4&v.button&&(R|=64),8&v.button&&(R|=128),v.action===32?R|=32:v.action!==0||C||(R|=3)),R}const c=String.fromCharCode,y={DEFAULT:v=>{const C=[S(v,!1)+32,v.col+32,v.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${c(C[0])}${c(C[1])}${c(C[2])}`},SGR:v=>{const C=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${S(v,!0)};${v.col};${v.row}${C}`},SGR_PIXELS:v=>{const C=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${S(v,!0)};${v.x};${v.y}${C}`}};let h=a.CoreMouseService=class extends b.Disposable{constructor(v,C){super(),this._bufferService=v,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new x.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(E))this.addProtocol(R,E[R]);for(const R of Object.keys(y))this.addEncoding(R,y[R]);this.reset()}addProtocol(v,C){this._protocols[v]=C}addEncoding(v,C){this._encodings[v]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(v){if(!this._protocols[v])throw new Error(`unknown protocol "${v}"`);this._activeProtocol=v,this._onProtocolChange.fire(this._protocols[v].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(v){if(!this._encodings[v])throw new Error(`unknown encoding "${v}"`);this._activeEncoding=v}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(v){if(v.col<0||v.col>=this._bufferService.cols||v.row<0||v.row>=this._bufferService.rows||v.button===4&&v.action===32||v.button===3&&v.action!==32||v.button!==4&&(v.action===2||v.action===3)||(v.col++,v.row++,v.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,v,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(v))return!1;const C=this._encodings[this._activeEncoding](v);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=v,!0}explainEvents(v){return{down:!!(1&v),up:!!(2&v),drag:!!(4&v),move:!!(8&v),wheel:!!(16&v)}}_equalEvents(v,C,R){if(R){if(v.x!==C.x||v.y!==C.y)return!1}else if(v.col!==C.col||v.row!==C.row)return!1;return v.button===C.button&&v.action===C.action&&v.ctrl===C.ctrl&&v.alt===C.alt&&v.shift===C.shift}};a.CoreMouseService=h=p([m(0,u.IBufferService),m(1,u.ICoreService)],h)},6975:function(g,a,l){var p=this&&this.__decorate||function(h,v,C,R){var L,D=arguments.length,T=D<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,C):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,v,C,R);else for(var A=h.length-1;A>=0;A--)(L=h[A])&&(T=(D<3?L(T):D>3?L(v,C,T):L(v,C))||T);return D>3&&T&&Object.defineProperty(v,C,T),T},m=this&&this.__param||function(h,v){return function(C,R){v(C,R,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const u=l(1439),x=l(8460),b=l(844),E=l(2585),S=Object.freeze({insertMode:!1}),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=a.CoreService=class extends b.Disposable{constructor(h,v,C){super(),this._bufferService=h,this._logService=v,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new x.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new x.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(S),this.decPrivateModes=(0,u.clone)(c)}reset(){this.modes=(0,u.clone)(S),this.decPrivateModes=(0,u.clone)(c)}triggerDataEvent(h,v=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;v&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),v&&this._onUserInput.fire(),this._logService.debug(`sending data "${h}"`,(()=>h.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(h)}triggerBinaryEvent(h){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${h}"`,(()=>h.split("").map((v=>v.charCodeAt(0))))),this._onBinary.fire(h))}};a.CoreService=y=p([m(0,E.IBufferService),m(1,E.ILogService),m(2,E.IOptionsService)],y)},9074:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const p=l(8055),m=l(8460),u=l(844),x=l(6106);let b=0,E=0;class S extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new x.SortedList((h=>h==null?void 0:h.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(h){if(h.marker.isDisposed)return;const v=new c(h);if(v){const C=v.marker.onDispose((()=>v.dispose()));v.onDispose((()=>{v&&(this._decorations.delete(v)&&this._onDecorationRemoved.fire(v),C.dispose())})),this._decorations.insert(v),this._onDecorationRegistered.fire(v)}return v}reset(){for(const h of this._decorations.values())h.dispose();this._decorations.clear()}*getDecorationsAtCell(h,v,C){let R=0,L=0;for(const D of this._decorations.getKeyIterator(v))R=D.options.x??0,L=R+(D.options.width??1),h>=R&&h<L&&(!C||(D.options.layer??"bottom")===C)&&(yield D)}forEachDecorationAtCell(h,v,C,R){this._decorations.forEachByKey(v,(L=>{b=L.options.x??0,E=b+(L.options.width??1),h>=b&&h<E&&(!C||(L.options.layer??"bottom")===C)&&R(L)}))}}a.DecorationService=S;class c extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=p.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=p.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(h){super(),this.options=h,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=h.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const p=l(2585),m=l(8343);class u{constructor(...b){this._entries=new Map;for(const[E,S]of b)this.set(E,S)}set(b,E){const S=this._entries.get(b);return this._entries.set(b,E),S}forEach(b){for(const[E,S]of this._entries.entries())b(E,S)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}a.ServiceCollection=u,a.InstantiationService=class{constructor(){this._services=new u,this._services.set(p.IInstantiationService,this)}setService(x,b){this._services.set(x,b)}getService(x){return this._services.get(x)}createInstance(x,...b){const E=(0,m.getServiceDependencies)(x).sort(((y,h)=>y.index-h.index)),S=[];for(const y of E){const h=this._services.get(y.id);if(!h)throw new Error(`[createInstance] ${x.name} depends on UNKNOWN service ${y.id}.`);S.push(h)}const c=E.length>0?E[0].index:b.length;if(b.length!==c)throw new Error(`[createInstance] First service dependency of ${x.name} at position ${c+1} conflicts with ${b.length} static arguments`);return new x(...b,...S)}}},7866:function(g,a,l){var p=this&&this.__decorate||function(c,y,h,v){var C,R=arguments.length,L=R<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(c,y,h,v);else for(var D=c.length-1;D>=0;D--)(C=c[D])&&(L=(R<3?C(L):R>3?C(y,h,L):C(y,h))||L);return R>3&&L&&Object.defineProperty(y,h,L),L},m=this&&this.__param||function(c,y){return function(h,v){y(h,v,c)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const u=l(844),x=l(2585),b={trace:x.LogLevelEnum.TRACE,debug:x.LogLevelEnum.DEBUG,info:x.LogLevelEnum.INFO,warn:x.LogLevelEnum.WARN,error:x.LogLevelEnum.ERROR,off:x.LogLevelEnum.OFF};let E,S=a.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(c){super(),this._optionsService=c,this._logLevel=x.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(c){for(let y=0;y<c.length;y++)typeof c[y]=="function"&&(c[y]=c[y]())}_log(c,y,h){this._evalLazyOptionalParams(h),c.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...h)}trace(c,...y){var h;this._logLevel<=x.LogLevelEnum.TRACE&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.trace.bind(this._optionsService.options.logger))??console.log,c,y)}debug(c,...y){var h;this._logLevel<=x.LogLevelEnum.DEBUG&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.debug.bind(this._optionsService.options.logger))??console.log,c,y)}info(c,...y){var h;this._logLevel<=x.LogLevelEnum.INFO&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.info.bind(this._optionsService.options.logger))??console.info,c,y)}warn(c,...y){var h;this._logLevel<=x.LogLevelEnum.WARN&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.warn.bind(this._optionsService.options.logger))??console.warn,c,y)}error(c,...y){var h;this._logLevel<=x.LogLevelEnum.ERROR&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.error.bind(this._optionsService.options.logger))??console.error,c,y)}};a.LogService=S=p([m(0,x.IOptionsService)],S),a.setTraceLogger=function(c){E=c},a.traceCall=function(c,y,h){if(typeof h.value!="function")throw new Error("not supported");const v=h.value;h.value=function(...C){if(E.logLevel!==x.LogLevelEnum.TRACE)return v.apply(this,C);E.trace(`GlyphRenderer#${v.name}(${C.map((L=>JSON.stringify(L))).join(", ")})`);const R=v.apply(this,C);return E.trace(`GlyphRenderer#${v.name} return`,R),R}}},7302:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const p=l(8460),m=l(844),u=l(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const x=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends m.Disposable{constructor(S){super(),this._onOptionChange=this.register(new p.EventEmitter),this.onOptionChange=this._onOptionChange.event;const c={...a.DEFAULT_OPTIONS};for(const y in S)if(y in c)try{const h=S[y];c[y]=this._sanitizeAndValidateOption(y,h)}catch(h){console.error(h)}this.rawOptions=c,this.options={...c},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,c){return this.onOptionChange((y=>{y===S&&c(this.rawOptions[S])}))}onMultipleOptionChange(S,c){return this.onOptionChange((y=>{S.indexOf(y)!==-1&&c()}))}_setupOptions(){const S=y=>{if(!(y in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},c=(y,h)=>{if(!(y in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);h=this._sanitizeAndValidateOption(y,h),this.rawOptions[y]!==h&&(this.rawOptions[y]=h,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const h={get:S.bind(this,y),set:c.bind(this,y)};Object.defineProperty(this.options,y,h)}}_sanitizeAndValidateOption(S,c){switch(S){case"cursorStyle":if(c||(c=a.DEFAULT_OPTIONS[S]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(c))throw new Error(`"${c}" is not a valid value for ${S}`);break;case"wordSeparator":c||(c=a.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof c=="number"&&1<=c&&c<=1e3)break;c=x.includes(c)?c:a.DEFAULT_OPTIONS[S];break;case"cursorWidth":c=Math.floor(c);case"lineHeight":case"tabStopWidth":if(c<1)throw new Error(`${S} cannot be less than 1, value: ${c}`);break;case"minimumContrastRatio":c=Math.max(1,Math.min(21,Math.round(10*c)/10));break;case"scrollback":if((c=Math.min(c,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${c}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(c<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${c}`);break;case"rows":case"cols":if(!c&&c!==0)throw new Error(`${S} must be numeric, value: ${c}`);break;case"windowsPty":c=c??{}}return c}}a.OptionsService=b},2660:function(g,a,l){var p=this&&this.__decorate||function(b,E,S,c){var y,h=arguments.length,v=h<3?E:c===null?c=Object.getOwnPropertyDescriptor(E,S):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(b,E,S,c);else for(var C=b.length-1;C>=0;C--)(y=b[C])&&(v=(h<3?y(v):h>3?y(E,S,v):y(E,S))||v);return h>3&&v&&Object.defineProperty(E,S,v),v},m=this&&this.__param||function(b,E){return function(S,c){E(S,c,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const u=l(2585);let x=a.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const E=this._bufferService.buffer;if(b.id===void 0){const C=E.addMarker(E.ybase+E.y),R={data:b,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(R,C))),this._dataByLinkId.set(R.id,R),R.id}const S=b,c=this._getEntryIdKey(S),y=this._entriesWithId.get(c);if(y)return this.addLineToLink(y.id,E.ybase+E.y),y.id;const h=E.addMarker(E.ybase+E.y),v={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[h]};return h.onDispose((()=>this._removeMarkerFromLink(v,h))),this._entriesWithId.set(v.key,v),this._dataByLinkId.set(v.id,v),v.id}addLineToLink(b,E){const S=this._dataByLinkId.get(b);if(S&&S.lines.every((c=>c.line!==E))){const c=this._bufferService.buffer.addMarker(E);S.lines.push(c),c.onDispose((()=>this._removeMarkerFromLink(S,c)))}}getLinkData(b){var E;return(E=this._dataByLinkId.get(b))==null?void 0:E.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,E){const S=b.lines.indexOf(E);S!==-1&&(b.lines.splice(S,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};a.OscLinkService=x=p([m(0,u.IBufferService)],x)},8343:(g,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const l="di$target",p="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(m){return m[p]||[]},a.createDecorator=function(m){if(a.serviceRegistry.has(m))return a.serviceRegistry.get(m);const u=function(x,b,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,c,y){c[l]===c?c[p].push({id:S,index:y}):(c[p]=[{id:S,index:y}],c[l]=c)})(u,x,E)};return u.toString=()=>m,a.serviceRegistry.set(m,u),u}},2585:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const p=l(8343);var m;a.IBufferService=(0,p.createDecorator)("BufferService"),a.ICoreMouseService=(0,p.createDecorator)("CoreMouseService"),a.ICoreService=(0,p.createDecorator)("CoreService"),a.ICharsetService=(0,p.createDecorator)("CharsetService"),a.IInstantiationService=(0,p.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(m||(a.LogLevelEnum=m={})),a.ILogService=(0,p.createDecorator)("LogService"),a.IOptionsService=(0,p.createDecorator)("OptionsService"),a.IOscLinkService=(0,p.createDecorator)("OscLinkService"),a.IUnicodeService=(0,p.createDecorator)("UnicodeService"),a.IDecorationService=(0,p.createDecorator)("DecorationService")},1480:(g,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const p=l(8460),m=l(225);class u{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,E,S=!1){return(16777215&b)<<3|(3&E)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new p.EventEmitter,this.onChange=this._onChange.event;const b=new m.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let E=0,S=0;const c=b.length;for(let y=0;y<c;++y){let h=b.charCodeAt(y);if(55296<=h&&h<=56319){if(++y>=c)return E+this.wcwidth(h);const R=b.charCodeAt(y);56320<=R&&R<=57343?h=1024*(h-55296)+R-56320+65536:E+=this.wcwidth(R)}const v=this.charProperties(h,S);let C=u.extractWidth(v);u.extractShouldJoin(v)&&(C-=u.extractWidth(S)),E+=C,S=v}return E}charProperties(b,E){return this._activeProvider.charProperties(b,E)}}a.UnicodeService=u}},o={};function d(g){var a=o[g];if(a!==void 0)return a.exports;var l=o[g]={exports:{}};return i[g].call(l.exports,l,l.exports,d),l.exports}var w={};return(()=>{var g=w;Object.defineProperty(g,"__esModule",{value:!0}),g.Terminal=void 0;const a=d(9042),l=d(3236),p=d(844),m=d(5741),u=d(8285),x=d(7975),b=d(7090),E=["cols","rows"];class S extends p.Disposable{constructor(y){super(),this._core=this.register(new l.Terminal(y)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const h=C=>this._core.options[C],v=(C,R)=>{this._checkReadonlyOptions(C),this._core.options[C]=R};for(const C in this._core.options){const R={get:h.bind(this,C),set:v.bind(this,C)};Object.defineProperty(this._publicOptions,C,R)}}_checkReadonlyOptions(y){if(E.includes(y))throw new Error(`Option "${y}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new x.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let h="none";switch(this._core.coreMouseService.activeProtocol){case"X10":h="x10";break;case"VT200":h="vt200";break;case"DRAG":h="drag";break;case"ANY":h="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:h,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const h in y)this._publicOptions[h]=y[h]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,h=!0){this._core.input(y,h)}resize(y,h){this._verifyIntegers(y,h),this._core.resize(y,h)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,h,v){this._verifyIntegers(y,h,v),this._core.select(y,h,v)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,h){this._verifyIntegers(y,h),this._core.selectLines(y,h)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,h){this._core.write(y,h)}writeln(y,h){this._core.write(y),this._core.write(`\r
|
|
50
|
+
`,h)}paste(y){this._core.paste(y)}refresh(y,h){this._verifyIntegers(y,h),this._core.refresh(y,h)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return a}_verifyIntegers(...y){for(const h of y)if(h===1/0||isNaN(h)||h%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const h of y)if(h&&(h===1/0||isNaN(h)||h%1!=0||h<0))throw new Error("This API only accepts positive integers")}}g.Terminal=S})(),w})()))})(_c)),_c.exports}var L0=P0(),xc={exports:{}},sp;function D0(){return sp||(sp=1,(function(t,s){(function(i,o){t.exports=o()})(self,(()=>(()=>{var i={};return(()=>{var o=i;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(d){this._terminal=d}dispose(){}fit(){const d=this.proposeDimensions();if(!d||!this._terminal||isNaN(d.cols)||isNaN(d.rows))return;const w=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(w._renderService.clear(),this._terminal.resize(d.cols,d.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const d=this._terminal._core,w=d._renderService.dimensions;if(w.css.cell.width===0||w.css.cell.height===0)return;const g=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(a.getPropertyValue("height")),p=Math.max(0,parseInt(a.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),u=l-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),x=p-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-g;return{cols:Math.max(2,Math.floor(x/w.css.cell.width)),rows:Math.max(1,Math.floor(u/w.css.cell.height))}}}})(),i})()))})(xc)),xc.exports}var A0=D0(),wc={exports:{}},ip;function j0(){return ip||(ip=1,(function(t,s){(function(i,o){t.exports=o()})(self,(()=>(()=>{var i={6:(g,a)=>{function l(m){try{const u=new URL(m),x=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return m.toLocaleLowerCase().startsWith(x.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(m,u,x,b={}){this._terminal=m,this._regex=u,this._handler=x,this._options=b}provideLinks(m,u){const x=p.computeLink(m,this._regex,this._terminal,this._handler);u(this._addCallbacks(x))}_addCallbacks(m){return m.map((u=>(u.leave=this._options.leave,u.hover=(x,b)=>{if(this._options.hover){const{range:E}=u;this._options.hover(x,b,E)}},u)))}};class p{static computeLink(u,x,b,E){const S=new RegExp(x.source,(x.flags||"")+"g"),[c,y]=p._getWindowedLineStrings(u-1,b),h=c.join("");let v;const C=[];for(;v=S.exec(h);){const R=v[0];if(!l(R))continue;const[L,D]=p._mapStrIdx(b,y,0,v.index),[T,A]=p._mapStrIdx(b,L,D,R.length);if(L===-1||D===-1||T===-1||A===-1)continue;const I={start:{x:D+1,y:L+1},end:{x:A,y:T+1}};C.push({range:I,text:R,activate:E})}return C}static _getWindowedLineStrings(u,x){let b,E=u,S=u,c=0,y="";const h=[];if(b=x.buffer.active.getLine(u)){const v=b.translateToString(!0);if(b.isWrapped&&v[0]!==" "){for(c=0;(b=x.buffer.active.getLine(--E))&&c<2048&&(y=b.translateToString(!0),c+=y.length,h.push(y),b.isWrapped&&y.indexOf(" ")===-1););h.reverse()}for(h.push(v),c=0;(b=x.buffer.active.getLine(++S))&&b.isWrapped&&c<2048&&(y=b.translateToString(!0),c+=y.length,h.push(y),y.indexOf(" ")===-1););}return[h,E]}static _mapStrIdx(u,x,b,E){const S=u.buffer.active,c=S.getNullCell();let y=b;for(;E;){const h=S.getLine(x);if(!h)return[-1,-1];for(let v=y;v<h.length;++v){h.getCell(v,c);const C=c.getChars();if(c.getWidth()&&(E-=C.length||1,v===h.length-1&&C==="")){const R=S.getLine(x+1);R&&R.isWrapped&&(R.getCell(0,c),c.getWidth()===2&&(E+=1))}if(E<0)return[x,v]}x++,y=0}return[x,y]}}a.LinkComputer=p}},o={};function d(g){var a=o[g];if(a!==void 0)return a.exports;var l=o[g]={exports:{}};return i[g](l,l.exports,d),l.exports}var w={};return(()=>{var g=w;Object.defineProperty(g,"__esModule",{value:!0}),g.WebLinksAddon=void 0;const a=d(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function p(m,u){const x=window.open();if(x){try{x.opener=null}catch{}x.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}g.WebLinksAddon=class{constructor(m=p,u={}){this._handler=m,this._options=u}activate(m){this._terminal=m;const u=this._options,x=u.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,x,this._handler,u))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),w})()))})(wc)),wc.exports}var M0=j0();function O0({tabId:t,cwd:s}){const i=W.useRef(null),o=W.useRef(null),d=W.useRef(null),w=W.useRef(!1);return W.useEffect(()=>{if(console.log("[Terminal] mount effect running, tabId=",t,"cwd=",s,"alreadySpawned=",w.current),!i.current||w.current)return;w.current=!0;const g=new L0.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"}}),a=new A0.FitAddon;g.loadAddon(a),g.loadAddon(new M0.WebLinksAddon),g.open(i.current),a.fit(),g.focus(),o.current=g,d.current=a;const{cols:l,rows:p}=g,m=window.api.pty.onData(t,E=>g.write(E)),u=window.api.pty.onExit(t,({exitCode:E})=>{g.write(`\r
|
|
51
|
+
\x1B[38;5;240m[session exited code=${E}]\x1B[0m\r
|
|
52
|
+
`),Re.getState().setTabExited(t,E)});g.onData(E=>window.api.pty.write({tabId:t,data:E})),g.onResize(({cols:E,rows:S})=>window.api.pty.resize({tabId:t,cols:E,rows:S})),console.log("[Terminal] calling pty.spawn",{tabId:t,cwd:s,cols:l,rows:p}),window.api.pty.spawn({tabId:t,cwd:s,cols:l,rows:p}).then(({pid:E,reattached:S})=>{if(console.log("[Terminal] pty.spawn resolved, pid=",E,"tabId=",t,"reattached=",S),Re.getState().setTabRunning(t,E),S)return;const{startupCommand:c}=Re.getState().tabs.find(y=>y.id===t)??{};c&&setTimeout(()=>{window.api.pty.write({tabId:t,data:`${c}
|
|
53
|
+
`})},350)}).catch(E=>{console.error("[Terminal] pty.spawn rejected for tabId=",t,E),g.write(`\r
|
|
54
|
+
\x1B[31mfailed to spawn: ${E.message}\x1B[0m\r
|
|
55
|
+
`),Re.getState().setTabExited(t,-1)});const x=()=>a.fit();window.addEventListener("resize",x);const b=new ResizeObserver(()=>a.fit());return b.observe(i.current),()=>{window.removeEventListener("resize",x),b.disconnect(),m(),u(),g.dispose()}},[t,s]),_.jsx("div",{ref:i,onMouseDown:()=>{var g;return(g=o.current)==null?void 0:g.focus()},className:"h-full w-full bg-bg"})}function je({toolbar:t,footer:s,children:i}){return _.jsxs("div",{className:"h-full flex flex-col",children:[t&&_.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:t}),_.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:i}),s&&_.jsx("div",{className:"shrink-0 border-t border-line bg-bg-elev",children:s})]})}function be({title:t,hint:s}){return _.jsx("div",{className:"h-full flex items-center justify-center text-fg-faint text-xs",children:_.jsxs("div",{className:"text-center max-w-md",children:[_.jsx("div",{className:"mb-2 text-fg-dim",children:t}),s&&_.jsx("div",{className:"text-fg-faint",children:s})]})})}let ci=null;const Kc=new Set;let Oo=null;function I0(){return ci?Promise.resolve(ci):Oo||(Oo=window.api.app.homeDir().then(t=>(ci=t,Kc.forEach(s=>s(t)),t)),Oo)}function et(){const[t,s]=W.useState(ci);return W.useEffect(()=>{if(ci){s(ci);return}const i=o=>s(o);return Kc.add(i),I0(),()=>{Kc.delete(i)}},[]),t}function N0(){const t=et(),s=Re(d=>d.tabs),[i,o]=W.useState(null);return W.useEffect(()=>{if(!t)return;let d=!1;return(async()=>{try{const[w,g,a,l,p,m,u]=await Promise.all([window.api.config.listDir(`${t}/.claude/projects`,{dirsOnly:!0}),window.api.config.listDir(`${t}/.claude/skills`,{dirsOnly:!0}),window.api.config.listDir(`${t}/.claude/agents`,{filesOnly:!0}),window.api.config.listDir(`${t}/.claude/plugins`,{dirsOnly:!0}),window.api.config.exists(`${t}/.claude/settings.json`),window.api.config.exists(`${t}/.claude/CLAUDE.md`),window.api.config.readJson(`${t}/.claude.json`)]);let x=0;for(const E of w.entries){if(d)return;const S=await window.api.config.listDir(E.path,{filesOnly:!0});x+=S.entries.filter(c=>c.name.endsWith(".jsonl")).length}const b=u.data&&typeof u.data=="object"&&"mcpServers"in u.data?Object.keys(u.data.mcpServers??{}).length:0;d||o({projects:w.entries.length,sessions:x,skills:g.entries.length,agents:a.entries.filter(E=>E.name.endsWith(".md")).length,mcpServers:b,plugins:l.entries.length,settingsExists:p,claudeMdExists:m})}catch(w){console.error("[Overview] scan failed:",w)}})(),()=>{d=!0}},[t]),t?_.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"text-fg-faint",children:"home"}),_.jsx("span",{className:"ml-2 text-fg-dim font-mono truncate",children:t}),_.jsx("div",{className:"flex-1"}),_.jsxs("span",{className:"text-fg-faint",children:[s.length," open tabs"]})]}),children:i?_.jsxs("div",{className:"p-6 max-w-4xl space-y-6",children:[_.jsxs("section",{children:[_.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg mb-3",children:"User Configuration"}),_.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[_.jsx(Yr,{label:"settings.json",value:i.settingsExists?"exists":"not created",dim:!i.settingsExists}),_.jsx(Yr,{label:"CLAUDE.md",value:i.claudeMdExists?"exists":"not created",dim:!i.claudeMdExists}),_.jsx(Yr,{label:"skills",value:i.skills.toString()}),_.jsx(Yr,{label:"subagents",value:i.agents.toString()}),_.jsx(Yr,{label:"MCP servers",value:i.mcpServers.toString()}),_.jsx(Yr,{label:"plugins",value:i.plugins.toString()})]})]}),_.jsxs("section",{children:[_.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg mb-3",children:"Session History"}),_.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[_.jsx(Yr,{label:"projects with history",value:i.projects.toString()}),_.jsx(Yr,{label:"total transcripts",value:i.sessions.toString()})]})]})]}):_.jsx(be,{title:"scanning ~/.claude…"})}):_.jsx(be,{title:"loading…"})}function Yr({label:t,value:s,dim:i}){return _.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[_.jsx("div",{className:"text-xs text-fg-faint uppercase tracking-wider mb-1",children:t}),_.jsx("div",{className:`text-base font-mono ${i?"text-fg-faint":"text-fg"}`,children:s})]})}function Ps(...t){return t.filter(Boolean).map((s,i)=>i===0?s.replace(/\/+$/,""):s.replace(/^\/+|\/+$/g,"")).join("/")}const ui={scopes:["user","project","local"],resolve:(t,s,i)=>t==="user"?Ps(s,".claude","settings.json"):i?t==="project"?Ps(i,".claude","settings.json"):Ps(i,".claude","settings.local.json"):null},Sc={scopes:["user","project","local"],resolve:(t,s,i)=>t==="user"?Ps(s,".claude","CLAUDE.md"):i?t==="project"?Ps(i,"CLAUDE.md"):Ps(i,"CLAUDE.local.md"):null},bc=ui,B0={scopes:["user"],resolve:(t,s)=>t==="user"?Ps(s,".claude","keybindings.json"):null},vt={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 gr({scopes:t,active:s,onChange:i,annotate:o}){return _.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:t.map(d=>{const w=vt[d],g=o==null?void 0:o(d),a=d===s;return _.jsxs("button",{title:w.hint,onClick:()=>i(d),className:`px-2.5 py-1 text-xs flex items-center gap-1.5 transition-colors ${a?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[_.jsx("span",{children:w.label}),(g==null?void 0:g.dirty)&&_.jsx("span",{className:"w-1 h-1 rounded-full bg-accent",title:"unsaved edits"}),g&&g.exists===!1&&!g.dirty&&_.jsx("span",{className:"w-1 h-1 rounded-full bg-fg-faint",title:"not yet created"})]},d)})})}function F0(t){if(!t)return"";const s=Math.max(0,Date.now()-t);return s<6e4?`saved ${Math.round(s/1e3)}s ago`:s<36e5?`saved ${Math.round(s/6e4)}m ago`:`saved ${Math.round(s/36e5)}h ago`}function is({dirty:t,busy:s,parseError:i,lastSavedAt:o,onSave:d,onRevert:w,leading:g}){const a=t&&!s&&!i;return _.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-2 text-xs",children:[_.jsx("div",{className:"flex-1 min-w-0 truncate text-fg-faint",children:g}),i&&_.jsx("span",{className:"text-red-400 truncate max-w-xs",title:i,children:i}),!t&&!i&&o&&_.jsx("span",{className:"text-fg-faint",children:F0(o)}),t&&!i&&_.jsx("span",{className:"text-accent",children:"unsaved"}),_.jsx("button",{onClick:w,disabled:!t||s,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"}),_.jsx("button",{onClick:d,disabled:!a,className:`px-2.5 py-0.5 rounded border ${a?"border-accent bg-accent/15 text-accent hover:bg-accent/25":"border-line text-fg-faint opacity-50 cursor-not-allowed"}`,children:s?"Saving…":"Save"})]})}const H0="modulepreload",U0=function(t,s){return new URL(t,s).href},np={},W0=function(s,i,o){let d=Promise.resolve();if(i&&i.length>0){let g=function(m){return Promise.all(m.map(u=>Promise.resolve(u).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};const a=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),p=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));d=g(i.map(m=>{if(m=U0(m,o),m in np)return;np[m]=!0;const u=m.endsWith(".css"),x=u?'[rel="stylesheet"]':"";if(!!o)for(let S=a.length-1;S>=0;S--){const c=a[S];if(c.href===m&&(!u||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${x}`))return;const E=document.createElement("link");if(E.rel=u?"stylesheet":H0,u||(E.as="script"),E.crossOrigin="",E.href=m,p&&E.setAttribute("nonce",p),document.head.appendChild(E),u)return new Promise((S,c)=>{E.addEventListener("load",S),E.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${m}`)))})}))}function w(g){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=g,window.dispatchEvent(a),!a.defaultPrevented)throw g}return d.then(g=>{for(const a of g||[])a.status==="rejected"&&w(a.reason);return s().catch(w)})};function op(t,s){(s==null||s>t.length)&&(s=t.length);for(var i=0,o=Array(s);i<s;i++)o[i]=t[i];return o}function V0(t){if(Array.isArray(t))return t}function $0(t,s,i){return(s=Y0(s))in t?Object.defineProperty(t,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[s]=i,t}function z0(t,s){var i=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(i!=null){var o,d,w,g,a=[],l=!0,p=!1;try{if(w=(i=i.call(t)).next,s!==0)for(;!(l=(o=w.call(i)).done)&&(a.push(o.value),a.length!==s);l=!0);}catch(m){p=!0,d=m}finally{try{if(!l&&i.return!=null&&(g=i.return(),Object(g)!==g))return}finally{if(p)throw d}}return a}}function K0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
56
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ap(t,s){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);s&&(o=o.filter(function(d){return Object.getOwnPropertyDescriptor(t,d).enumerable})),i.push.apply(i,o)}return i}function lp(t){for(var s=1;s<arguments.length;s++){var i=arguments[s]!=null?arguments[s]:{};s%2?ap(Object(i),!0).forEach(function(o){$0(t,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ap(Object(i)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(i,o))})}return t}function q0(t,s){if(t==null)return{};var i,o,d=G0(t,s);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(t);for(o=0;o<w.length;o++)i=w[o],s.indexOf(i)===-1&&{}.propertyIsEnumerable.call(t,i)&&(d[i]=t[i])}return d}function G0(t,s){if(t==null)return{};var i={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(s.indexOf(o)!==-1)continue;i[o]=t[o]}return i}function X0(t,s){return V0(t)||z0(t,s)||Q0(t,s)||K0()}function J0(t,s){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var o=i.call(t,s);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(t)}function Y0(t){var s=J0(t,"string");return typeof s=="symbol"?s:s+""}function Q0(t,s){if(t){if(typeof t=="string")return op(t,s);var i={}.toString.call(t).slice(8,-1);return i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set"?Array.from(t):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?op(t,s):void 0}}function Z0(t,s,i){return s in t?Object.defineProperty(t,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[s]=i,t}function cp(t,s){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);s&&(o=o.filter(function(d){return Object.getOwnPropertyDescriptor(t,d).enumerable})),i.push.apply(i,o)}return i}function up(t){for(var s=1;s<arguments.length;s++){var i=arguments[s]!=null?arguments[s]:{};s%2?cp(Object(i),!0).forEach(function(o){Z0(t,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):cp(Object(i)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(i,o))})}return t}function ex(){for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];return function(o){return s.reduceRight(function(d,w){return w(d)},o)}}function on(t){return function s(){for(var i=this,o=arguments.length,d=new Array(o),w=0;w<o;w++)d[w]=arguments[w];return d.length>=t.length?t.apply(this,d):function(){for(var g=arguments.length,a=new Array(g),l=0;l<g;l++)a[l]=arguments[l];return s.apply(i,[].concat(d,a))}}}function ra(t){return{}.toString.call(t).includes("Object")}function tx(t){return!Object.keys(t).length}function fn(t){return typeof t=="function"}function rx(t,s){return Object.prototype.hasOwnProperty.call(t,s)}function sx(t,s){return ra(s)||ts("changeType"),Object.keys(s).some(function(i){return!rx(t,i)})&&ts("changeField"),s}function ix(t){fn(t)||ts("selectorType")}function nx(t){fn(t)||ra(t)||ts("handlerType"),ra(t)&&Object.values(t).some(function(s){return!fn(s)})&&ts("handlersType")}function ox(t){t||ts("initialIsRequired"),ra(t)||ts("initialType"),tx(t)&&ts("initialContent")}function ax(t,s){throw new Error(t[s]||t.default)}var lx={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"},ts=on(ax)(lx),Io={changes:sx,selector:ix,handler:nx,initial:ox};function cx(t){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Io.initial(t),Io.handler(s);var i={current:t},o=on(hx)(i,s),d=on(dx)(i),w=on(Io.changes)(t),g=on(ux)(i);function a(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(m){return m};return Io.selector(p),p(i.current)}function l(p){ex(o,d,w,g)(p)}return[a,l]}function ux(t,s){return fn(s)?s(t.current):s}function dx(t,s){return t.current=up(up({},t.current),s),s}function hx(t,s,i){return fn(s)?s(t.current):Object.keys(i).forEach(function(o){var d;return(d=s[o])===null||d===void 0?void 0:d.call(s,t.current[o])}),i}var fx={create:cx},px={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function mx(t){return function s(){for(var i=this,o=arguments.length,d=new Array(o),w=0;w<o;w++)d[w]=arguments[w];return d.length>=t.length?t.apply(this,d):function(){for(var g=arguments.length,a=new Array(g),l=0;l<g;l++)a[l]=arguments[l];return s.apply(i,[].concat(d,a))}}}function gx(t){return{}.toString.call(t).includes("Object")}function vx(t){return t||dp("configIsRequired"),gx(t)||dp("configType"),t.urls?(yx(),{paths:{vs:t.urls.monacoBase}}):t}function yx(){console.warn(Jm.deprecation)}function _x(t,s){throw new Error(t[s]||t.default)}var Jm={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!
|
|
57
|
+
You are using deprecated way of configuration.
|
|
58
|
+
|
|
59
|
+
Instead of using
|
|
60
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
61
|
+
use
|
|
62
|
+
monaco.config({ paths: { vs: '...' } })
|
|
63
|
+
|
|
64
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
65
|
+
`},dp=mx(_x)(Jm),xx={config:vx},wx=function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];return function(d){return i.reduceRight(function(w,g){return g(w)},d)}};function Ym(t,s){return Object.keys(s).forEach(function(i){s[i]instanceof Object&&t[i]&&Object.assign(s[i],Ym(t[i],s[i]))}),lp(lp({},t),s)}var Sx={type:"cancelation",msg:"operation is manually canceled"};function Cc(t){var s=!1,i=new Promise(function(o,d){t.then(function(w){return s?d(Sx):o(w)}),t.catch(d)});return i.cancel=function(){return s=!0},i}var bx=["monaco"],Cx=fx.create({config:px,isInitialized:!1,resolve:null,reject:null,monaco:null}),Qm=X0(Cx,2),_n=Qm[0],ma=Qm[1];function kx(t){var s=xx.config(t),i=s.monaco,o=q0(s,bx);ma(function(d){return{config:Ym(d.config,o),monaco:i}})}function Ex(){var t=_n(function(s){var i=s.monaco,o=s.isInitialized,d=s.resolve;return{monaco:i,isInitialized:o,resolve:d}});if(!t.isInitialized){if(ma({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),Cc(kc);if(window.monaco&&window.monaco.editor)return Zm(window.monaco),t.resolve(window.monaco),Cc(kc);wx(Tx,Px)(Lx)}return Cc(kc)}function Tx(t){return document.body.appendChild(t)}function Rx(t){var s=document.createElement("script");return t&&(s.src=t),s}function Px(t){var s=_n(function(o){var d=o.config,w=o.reject;return{config:d,reject:w}}),i=Rx("".concat(s.config.paths.vs,"/loader.js"));return i.onload=function(){return t()},i.onerror=s.reject,i}function Lx(){var t=_n(function(i){var o=i.config,d=i.resolve,w=i.reject;return{config:o,resolve:d,reject:w}}),s=window.require;s.config(t.config),s(["vs/editor/editor.main"],function(i){var o=i.m||i;Zm(o),t.resolve(o)},function(i){t.reject(i)})}function Zm(t){_n().monaco||ma({monaco:t})}function Dx(){return _n(function(t){var s=t.monaco;return s})}var kc=new Promise(function(t,s){return ma({resolve:t,reject:s})}),eg={config:kx,init:Ex,__getMonacoInstance:Dx},Ax={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ec=Ax,jx={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Mx=jx;function Ox({children:t}){return fr.createElement("div",{style:Mx.container},t)}var Ix=Ox,Nx=Ix;function Bx({width:t,height:s,isEditorReady:i,loading:o,_ref:d,className:w,wrapperProps:g}){return fr.createElement("section",{style:{...Ec.wrapper,width:t,height:s},...g},!i&&fr.createElement(Nx,null,o),fr.createElement("div",{ref:d,style:{...Ec.fullWidth,...!i&&Ec.hide},className:w}))}var Fx=Bx,tg=W.memo(Fx);function Hx(t){W.useEffect(t,[])}var rg=Hx;function Ux(t,s,i=!0){let o=W.useRef(!0);W.useEffect(o.current||!i?()=>{o.current=!1}:t,s)}var Mt=Ux;function ln(){}function ni(t,s,i,o){return Wx(t,o)||Vx(t,s,i,o)}function Wx(t,s){return t.editor.getModel(sg(t,s))}function Vx(t,s,i,o){return t.editor.createModel(s,i,o?sg(t,o):void 0)}function sg(t,s){return t.Uri.parse(s)}function $x({original:t,modified:s,language:i,originalLanguage:o,modifiedLanguage:d,originalModelPath:w,modifiedModelPath:g,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:p="light",loading:m="Loading...",options:u={},height:x="100%",width:b="100%",className:E,wrapperProps:S={},beforeMount:c=ln,onMount:y=ln}){let[h,v]=W.useState(!1),[C,R]=W.useState(!0),L=W.useRef(null),D=W.useRef(null),T=W.useRef(null),A=W.useRef(y),I=W.useRef(c),H=W.useRef(!1);rg(()=>{let K=eg.init();return K.then(z=>(D.current=z)&&R(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>L.current?J():K.cancel()}),Mt(()=>{if(L.current&&D.current){let K=L.current.getOriginalEditor(),z=ni(D.current,t||"",o||i||"text",w||"");z!==K.getModel()&&K.setModel(z)}},[w],h),Mt(()=>{if(L.current&&D.current){let K=L.current.getModifiedEditor(),z=ni(D.current,s||"",d||i||"text",g||"");z!==K.getModel()&&K.setModel(z)}},[g],h),Mt(()=>{let K=L.current.getModifiedEditor();K.getOption(D.current.editor.EditorOption.readOnly)?K.setValue(s||""):s!==K.getValue()&&(K.executeEdits("",[{range:K.getModel().getFullModelRange(),text:s||"",forceMoveMarkers:!0}]),K.pushUndoStop())},[s],h),Mt(()=>{var K,z;(z=(K=L.current)==null?void 0:K.getModel())==null||z.original.setValue(t||"")},[t],h),Mt(()=>{let{original:K,modified:z}=L.current.getModel();D.current.editor.setModelLanguage(K,o||i||"text"),D.current.editor.setModelLanguage(z,d||i||"text")},[i,o,d],h),Mt(()=>{var K;(K=D.current)==null||K.editor.setTheme(p)},[p],h),Mt(()=>{var K;(K=L.current)==null||K.updateOptions(u)},[u],h);let $=W.useCallback(()=>{var re;if(!D.current)return;I.current(D.current);let K=ni(D.current,t||"",o||i||"text",w||""),z=ni(D.current,s||"",d||i||"text",g||"");(re=L.current)==null||re.setModel({original:K,modified:z})},[i,s,d,t,o,w,g]),N=W.useCallback(()=>{var K;!H.current&&T.current&&(L.current=D.current.editor.createDiffEditor(T.current,{automaticLayout:!0,...u}),$(),(K=D.current)==null||K.editor.setTheme(p),v(!0),H.current=!0)},[u,p,$]);W.useEffect(()=>{h&&A.current(L.current,D.current)},[h]),W.useEffect(()=>{!C&&!h&&N()},[C,h,N]);function J(){var z,re,G,j;let K=(z=L.current)==null?void 0:z.getModel();a||((re=K==null?void 0:K.original)==null||re.dispose()),l||((G=K==null?void 0:K.modified)==null||G.dispose()),(j=L.current)==null||j.dispose()}return fr.createElement(tg,{width:b,height:x,isEditorReady:h,loading:m,_ref:T,className:E,wrapperProps:S})}var zx=$x;W.memo(zx);function Kx(t){let s=W.useRef();return W.useEffect(()=>{s.current=t},[t]),s.current}var qx=Kx,No=new Map;function Gx({defaultValue:t,defaultLanguage:s,defaultPath:i,value:o,language:d,path:w,theme:g="light",line:a,loading:l="Loading...",options:p={},overrideServices:m={},saveViewState:u=!0,keepCurrentModel:x=!1,width:b="100%",height:E="100%",className:S,wrapperProps:c={},beforeMount:y=ln,onMount:h=ln,onChange:v,onValidate:C=ln}){let[R,L]=W.useState(!1),[D,T]=W.useState(!0),A=W.useRef(null),I=W.useRef(null),H=W.useRef(null),$=W.useRef(h),N=W.useRef(y),J=W.useRef(),K=W.useRef(o),z=qx(w),re=W.useRef(!1),G=W.useRef(!1);rg(()=>{let M=eg.init();return M.then(U=>(A.current=U)&&T(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>I.current?F():M.cancel()}),Mt(()=>{var U,ee,ne,ce;let M=ni(A.current,t||o||"",s||d||"",w||i||"");M!==((U=I.current)==null?void 0:U.getModel())&&(u&&No.set(z,(ee=I.current)==null?void 0:ee.saveViewState()),(ne=I.current)==null||ne.setModel(M),u&&((ce=I.current)==null||ce.restoreViewState(No.get(w))))},[w],R),Mt(()=>{var M;(M=I.current)==null||M.updateOptions(p)},[p],R),Mt(()=>{!I.current||o===void 0||(I.current.getOption(A.current.editor.EditorOption.readOnly)?I.current.setValue(o):o!==I.current.getValue()&&(G.current=!0,I.current.executeEdits("",[{range:I.current.getModel().getFullModelRange(),text:o,forceMoveMarkers:!0}]),I.current.pushUndoStop(),G.current=!1))},[o],R),Mt(()=>{var U,ee;let M=(U=I.current)==null?void 0:U.getModel();M&&d&&((ee=A.current)==null||ee.editor.setModelLanguage(M,d))},[d],R),Mt(()=>{var M;a!==void 0&&((M=I.current)==null||M.revealLine(a))},[a],R),Mt(()=>{var M;(M=A.current)==null||M.editor.setTheme(g)},[g],R);let j=W.useCallback(()=>{var M;if(!(!H.current||!A.current)&&!re.current){N.current(A.current);let U=w||i,ee=ni(A.current,o||t||"",s||d||"",U||"");I.current=(M=A.current)==null?void 0:M.editor.create(H.current,{model:ee,automaticLayout:!0,...p},m),u&&I.current.restoreViewState(No.get(U)),A.current.editor.setTheme(g),a!==void 0&&I.current.revealLine(a),L(!0),re.current=!0}},[t,s,i,o,d,w,p,m,u,g,a]);W.useEffect(()=>{R&&$.current(I.current,A.current)},[R]),W.useEffect(()=>{!D&&!R&&j()},[D,R,j]),K.current=o,W.useEffect(()=>{var M,U;R&&v&&((M=J.current)==null||M.dispose(),J.current=(U=I.current)==null?void 0:U.onDidChangeModelContent(ee=>{G.current||v(I.current.getValue(),ee)}))},[R,v]),W.useEffect(()=>{if(R){let M=A.current.editor.onDidChangeMarkers(U=>{var ne;let ee=(ne=I.current.getModel())==null?void 0:ne.uri;if(ee&&U.find(ce=>ce.path===ee.path)){let ce=A.current.editor.getModelMarkers({resource:ee});C==null||C(ce)}});return()=>{M==null||M.dispose()}}return()=>{}},[R,C]);function F(){var M,U;(M=J.current)==null||M.dispose(),x?u&&No.set(w,I.current.saveViewState()):(U=I.current.getModel())==null||U.dispose(),I.current.dispose()}return fr.createElement(tg,{width:b,height:E,isEditorReady:R,loading:l,_ref:H,className:S,wrapperProps:c})}var Xx=Gx,Jx=W.memo(Xx),ig=Jx;function ng({value:t,onChange:s,path:i,readOnly:o}){const d=W.useRef(null),w=g=>{d.current=g};return _.jsx(ig,{path:`file://${i}`,defaultLanguage:"json",value:t,onChange:g=>s(g??""),onMount:w,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:o,automaticLayout:!0,bracketPairColorization:{enabled:!0},wordWrap:"on"}})}let hp=!1;async function Yx(t){if(hp)return;const s=await W0(()=>import("./editor.main-B4ZYzZWy.js").then(d=>d.b),__vite__mapDeps([0,1]),import.meta.url),i=await Promise.all(t.map(async d=>{let w=d.schema;if(!w){const g=["https://json.schemastore.org","https://www.schemastore.org","https://code.claude.com"];try{const a=new URL(d.uri).origin;if(!g.includes(a))throw new Error("untrusted origin");const l=await fetch(d.uri);l.ok&&(w=await l.json())}catch{}}return{uri:d.uri,fileMatch:d.fileMatch,schema:w}}));s.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,allowComments:!1,schemas:i.filter(d=>d.schema),enableSchemaRequest:!0}),hp=!0}function _u({node:t,targetScope:s,onOverride:i,schema:o,rootLabel:d}){const[w,g]=W.useState(""),[a,l]=W.useState(!0),p=[],m=t.kind==="object"&&Object.keys(t.children).length===0,x=((o==null?void 0:o.rootKeys())??[]).length>0;return _.jsxs("div",{className:"h-full flex flex-col",children:[_.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:[_.jsxs("span",{className:"text-fg-faint",children:["merged · overrides → ",_.jsx("span",{className:"text-fg-dim",children:vt[s].label})]}),x&&_.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[_.jsx("input",{type:"checkbox",checked:a,onChange:b=>l(b.target.checked),className:"accent-accent"}),"show unset keys"]}),_.jsx("div",{className:"flex-1"}),_.jsx("input",{value:w,onChange:b=>g(b.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"})]}),_.jsx("div",{className:"flex-1 overflow-auto px-3 py-2 font-mono text-xs",children:m&&!a?_.jsx("div",{className:"text-fg-faint italic px-2 py-4",children:"no settings resolved — all scope files empty or missing"}):_.jsx(og,{node:t,path:p,label:d??"(root)",targetScope:s,onOverride:i,filter:w,depth:0,schema:o,showGhosts:a,defaultOpen:!0})})]})}function og(t){return t.node.kind==="object"?_.jsx(Qx,{...t,node:t.node}):t.node.kind==="array"?_.jsx(Zx,{...t,node:t.node}):_.jsx(ew,{...t,node:t.node})}function fp(t,s){return s.trim()?t.toLowerCase().includes(s.toLowerCase()):!0}function di(t,s,i){return!!(!i.trim()||t.some(o=>fp(o,i))||s!=null&&s.description&&fp(s.description,i))}function Qx({node:t,path:s,label:i,targetScope:o,onOverride:d,filter:w,depth:g,schema:a,showGhosts:l,defaultOpen:p}){const[m,u]=W.useState(p??g<2),x=(a==null?void 0:a.at(s))??null,b=new Set(Object.keys(t.children)),E=l?(x==null?void 0:x.knownChildren)??[]:[],S=Array.from(new Set([...b,...E])).sort(),c=W.useMemo(()=>w.trim()?S.filter(h=>{const v=(a==null?void 0:a.at([...s,h]))??null;return di([...s,h],v,w)?!0:b.has(h)?ag(t.children[h],[...s,h],w,a):!1}):S,[S.join(","),w,t,s.join("."),a]);if(w.trim()&&c.length===0&&!di(s,x,w))return null;if(s.length===0)return _.jsx("div",{children:c.map(h=>y(h))});return _.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:g*14},onClick:()=>u(!m),children:[_.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:m?"▾":"▸"}),_.jsx("span",{className:"text-fg",children:i}),_.jsxs("span",{className:"text-fg-faint",children:[" {",b.size,E.length>b.size?`/${new Set([...b,...E]).size}`:"","}"]}),(x==null?void 0:x.description)&&_.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:x.description,children:["— ",x.description]})]}),m&&c.map(h=>y(h))]});function y(h){if(b.has(h))return _.jsx(og,{node:t.children[h],path:[...s,h],label:h,targetScope:o,onOverride:d,filter:w,depth:g+1,schema:a,showGhosts:l},h);const v=(a==null?void 0:a.at([...s,h]))??null;return v?_.jsx(tw,{path:[...s,h],label:h,info:v,targetScope:o,onSet:d,depth:g+1,filter:w},h):null}}function ag(t,s,i,o){const d=(o==null?void 0:o.at(s))??null;if(di(s,d,i))return!0;if(t.kind!=="object")return!1;for(const w of Object.keys(t.children))if(ag(t.children[w],[...s,w],i,o))return!0;return!1}function Zx({node:t,path:s,label:i,filter:o,depth:d,schema:w}){const[g,a]=W.useState(!0),l=(w==null?void 0:w.at(s))??null;return di(s,l,o)?_.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:d*14},onClick:()=>a(!g),children:[_.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:g?"▾":"▸"}),_.jsx("span",{className:"text-fg",children:i}),_.jsxs("span",{className:"text-fg-faint",children:[" [",t.items.length,"]"]}),_.jsx(pn,{tone:"warn",children:"accumulated"}),(l==null?void 0:l.description)&&_.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:l.description,children:["— ",l.description]})]}),g&&t.items.map((p,m)=>_.jsxs("div",{className:"flex items-start gap-2 py-0.5",style:{paddingLeft:(d+1)*14},children:[_.jsx("span",{className:"text-fg-faint w-3 shrink-0"}),_.jsxs("span",{className:"text-fg-faint",children:[m,":"]}),_.jsx("span",{className:"text-fg-dim truncate max-w-xl",children:sa(p.value)}),_.jsx(qc,{scope:p.fromScope})]},m))]}):null}function ew({node:t,path:s,label:i,targetScope:o,onOverride:d,filter:w,depth:g,schema:a}){const[l,p]=W.useState(!1),m=(a==null?void 0:a.at(s))??null;if(!di(s,m,w))return null;const u=t.winner!==o,x=t.shadowed.length>0;return _.jsxs("div",{children:[_.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded",style:{paddingLeft:g*14},children:[_.jsx("span",{className:`w-3 shrink-0 ${x?"text-fg-faint cursor-pointer":""}`,onClick:()=>x&&p(!l),children:x?l?"▾":"▸":""}),_.jsxs("span",{className:"text-fg",children:[i,":"]}),_.jsx("span",{className:"text-fg-dim truncate max-w-md",children:sa(t.value)}),_.jsx(qc,{scope:t.winner}),(m==null?void 0:m.deprecated)&&_.jsx(pn,{tone:"warn",children:"deprecated"}),(m==null?void 0:m.default)!==void 0&&rw(t.value,m.default)&&_.jsx(pn,{tone:"dim",children:"= default"}),t.typeMismatch&&_.jsx("span",{className:"text-yellow-500/80",title:"shadowed scopes have a different value type",children:"⚠"}),(m==null?void 0:m.description)&&_.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:m.description,children:["— ",m.description]}),_.jsx("div",{className:"flex-1"}),(m==null?void 0:m.enum)&&_.jsx(lg,{values:m.enum}),_.jsx("button",{disabled:!u,onClick:()=>d(s,t.value),className:`opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border rounded transition-opacity ${u?"border-accent/50 text-accent hover:bg-accent hover:text-bg":"border-line text-fg-faint cursor-not-allowed"}`,title:u?`copy into ${vt[o].label} draft`:`already winning in ${vt[o].label}`,children:"override"})]}),l&&t.shadowed.map((b,E)=>_.jsxs("div",{className:"flex items-center gap-2 py-0.5 text-fg-faint line-through",style:{paddingLeft:(g+1)*14+12},children:[_.jsx("span",{children:"shadowed:"}),_.jsx("span",{className:"truncate max-w-xl",children:sa(b.value)}),_.jsx(qc,{scope:b.scope,dim:!0})]},E))]})}function tw({path:t,label:s,info:i,targetScope:o,onSet:d,depth:w,filter:g}){if(!di(t,i,g))return null;const a=i.default!==void 0?i.default:sw(i.type),l=Array.isArray(i.type)?i.type.join("|"):i.type??"?";return _.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded opacity-60",style:{paddingLeft:w*14},children:[_.jsx("span",{className:"w-3 shrink-0"}),_.jsx("span",{className:"text-fg-dim",children:s}),_.jsx(pn,{tone:"dim",children:l}),i.required&&_.jsx(pn,{tone:"warn",children:"required"}),i.default!==void 0&&_.jsxs("span",{className:"text-fg-faint",children:["default: ",sa(i.default)]}),i.description&&_.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:i.description,children:["— ",i.description]}),_.jsx("div",{className:"flex-1"}),i.enum&&_.jsx(lg,{values:i.enum}),_.jsx("button",{onClick:()=>d(t,a),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 ${vt[o].label} draft`,children:"set"})]})}function rw(t,s){return t===s?!0:typeof t!=typeof s?!1:t&&s&&typeof t=="object"?JSON.stringify(t)===JSON.stringify(s):!1}function sw(t){switch(Array.isArray(t)?t[0]:t){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 sa(t){if(typeof t=="string")return JSON.stringify(t);if(t===null)return"null";if(typeof t=="object"){const s=JSON.stringify(t);return s.length>100?s.slice(0,100)+"…":s}return String(t)}function qc({scope:t,dim:s}){const i=t==="user"?"bg-bg-hi text-fg-dim border-line":t==="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 _.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${i} ${s?"opacity-60":""}`,children:vt[t].label})}function pn({children:t,tone:s="default"}){const i={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"}[s];return _.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${i}`,children:t})}function lg({values:t}){const s=t.map(i=>String(i)).join(" | ");return _.jsxs("span",{className:"text-[10px] text-fg-faint truncate max-w-xs",title:`allowed: ${s}`,children:["∈ ",s.length>30?s.slice(0,30)+"…":s]})}const iw=[{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"]}],nw={mcp:"MCP",url:"URL",urls:"URLs",http:"HTTP",ui:"UI",id:"ID",uuid:"UUID",api:"API",aws:"AWS",otel:"OTel",json:"JSON"};function cg(t){return t.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((o,d)=>{const w=nw[o];return w||(d===0?o.charAt(0).toUpperCase()+o.slice(1):o)}).join(" ")}function ow(t){const s=new Set,i=[];for(const d of iw){const w=d.keys.filter(g=>t.has(g));w.forEach(g=>s.add(g)),w.length!==0&&i.push({id:d.id,title:d.title,summary:d.summary,advanced:!!d.advanced,keys:w})}const o=Array.from(t).filter(d=>!s.has(d)&&d!=="$schema").sort();return o.length>0&&i.push({id:"other",title:"Other",summary:"Keys not yet grouped.",advanced:!1,keys:o}),i}function aw({node:t,targetScope:s,onOverride:i,schema:o}){const[d,w]=W.useState(""),[g,a]=W.useState(!1),[l,p]=W.useState(!0),m=t.kind==="object"?t:null,u=m?Object.keys(m.children):[],x=o.rootKeys(),b=new Set([...u,...x]),E=W.useMemo(()=>ow(b),[Array.from(b).sort().join(",")]),S=W.useMemo(()=>E.filter(c=>g||!c.advanced).map(c=>({...c,keys:c.keys.filter(y=>{const h=(m==null?void 0:m.children[y])!==void 0;if(!l&&!h)return!1;if(!d.trim())return!0;const v=o.at([y]);return[y,cg(y),(v==null?void 0:v.description)??""].join(" ").toLowerCase().includes(d.toLowerCase())})})).filter(c=>c.keys.length>0),[E,d,g,l,m,o]);return _.jsxs("div",{className:"h-full flex flex-col",children:[_.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:[_.jsxs("span",{className:"text-fg-faint",children:["writing overrides to"," ",_.jsx("span",{className:"text-fg-dim font-medium",children:vt[s].label})]}),_.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[_.jsx("input",{type:"checkbox",checked:l,onChange:c=>p(c.target.checked),className:"accent-accent"}),"show not-yet-configured"]}),_.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[_.jsx("input",{type:"checkbox",checked:g,onChange:c=>a(c.target.checked),className:"accent-accent"}),"show advanced"]}),_.jsx("div",{className:"flex-1"}),_.jsx("input",{value:d,onChange:c=>w(c.target.value),placeholder:"search settings…",className:"bg-bg border border-line rounded px-2 py-1 text-xs text-fg w-64"})]}),_.jsxs("div",{className:"flex-1 overflow-auto",children:[S.map(c=>_.jsx(lw,{title:c.title,summary:c.summary,advanced:c.advanced,children:c.keys.map(y=>{const h=m==null?void 0:m.children[y],v=o.at([y]);return _.jsx(cw,{keyName:y,node:h,info:v,targetScope:s,onOverride:C=>i([y],C)},y)})},c.id)),S.length===0&&_.jsxs("div",{className:"px-6 py-12 text-center text-fg-faint text-sm",children:['no settings match "',d,'"']})]})]})}function lw({title:t,summary:s,advanced:i,children:o}){const[d,w]=W.useState(!0);return _.jsxs("section",{className:"border-b border-line",children:[_.jsxs("header",{className:"px-4 py-2.5 bg-bg-elev/40 cursor-pointer hover:bg-bg-elev flex items-center gap-3",onClick:()=>w(!d),children:[_.jsx("span",{className:"text-fg-faint w-3",children:d?"▾":"▸"}),_.jsxs("div",{className:"flex-1",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("h2",{className:"text-fg text-sm font-medium",children:t}),i&&_.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"})]}),_.jsx("p",{className:"text-fg-faint text-xs",children:s})]})]}),d&&_.jsx("div",{className:"divide-y divide-line/60",children:o})]})}function cw({keyName:t,node:s,info:i,targetScope:o,onOverride:d}){const[w,g]=W.useState(!1),a=cg(t),l=s!==void 0,m=(s==null?void 0:s.kind)==="leaf"?s:null,u=(s==null?void 0:s.kind)==="object"||(s==null?void 0:s.kind)==="array",x=i==null?void 0:i.default,b=m&&x!==void 0&&dg(m.value,x),E=mw({isSet:l,leafNode:m,defaultVal:x,isDefault:!!b,node:s});return _.jsx("div",{className:"px-4 py-3 hover:bg-bg-elev/20",children:_.jsxs("div",{className:"flex items-start gap-3",children:[_.jsx("button",{onClick:()=>g(!w),className:"text-fg-faint hover:text-fg w-3 mt-0.5",title:w?"collapse":"expand",children:w?"▾":"▸"}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[_.jsx("h3",{className:"text-fg text-sm",children:a}),_.jsx(gw,{kind:E.kind,label:E.label}),(i==null?void 0:i.deprecated)&&_.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"}),(i==null?void 0:i.required)&&!l&&_.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"})]}),(i==null?void 0:i.description)&&_.jsx("p",{className:"text-fg-dim text-xs mt-0.5 leading-relaxed",children:vw(i.description)}),w&&_.jsx(uw,{keyName:t,node:s,info:i,targetScope:o,onOverride:d})]}),_.jsx("div",{className:"shrink-0",children:!w&&_.jsx(pw,{node:s,info:i,onSet:S=>{d(S)},disabled:u&&l})})]})})}function uw({keyName:t,node:s,info:i,targetScope:o,onOverride:d}){const g=(s==null?void 0:s.kind)==="leaf"?s:null;return _.jsxs("div",{className:"mt-3 space-y-2 text-xs",children:[(i==null?void 0:i.description)&&_.jsx("p",{className:"text-fg-dim leading-relaxed whitespace-pre-wrap",children:i.description}),_.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-fg-faint",children:[(i==null?void 0:i.type)&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Type"}),_.jsx("dd",{className:"text-fg-dim font-mono",children:Array.isArray(i.type)?i.type.join(" | "):i.type})]}),(i==null?void 0:i.default)!==void 0&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Default"}),_.jsx("dd",{className:"text-fg-dim font-mono",children:zo(i.default)})]}),(i==null?void 0:i.enum)&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Options"}),_.jsx("dd",{className:"text-fg-dim font-mono",children:i.enum.map(a=>String(a)).join(" | ")})]}),g&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Current"}),_.jsxs("dd",{className:"font-mono",children:[_.jsx("span",{className:"text-fg-dim",children:zo(g.value)}),_.jsxs("span",{className:"ml-2 text-fg-faint",children:["from ",vt[g.winner].label]})]})]}),g&&g.shadowed.length>0&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Shadowed"}),_.jsx("dd",{className:"space-y-0.5",children:g.shadowed.map((a,l)=>_.jsxs("div",{className:"font-mono text-fg-faint line-through",children:[zo(a.value)," —"," ",_.jsx("span",{className:"no-underline",children:vt[a.scope].label})]},l))})]}),(s==null?void 0:s.kind)==="array"&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Accumulated"}),_.jsxs("dd",{className:"text-fg-dim",children:[s.items.length," items across all scopes"]})]})]}),_.jsx("div",{className:"pt-2 flex items-center gap-2 flex-wrap border-t border-line/60",children:_.jsx(dw,{keyName:t,node:s,info:i,onChange:d,targetScope:o})})]})}function dw({node:t,info:s,onChange:i,targetScope:o}){const w=(t==null?void 0:t.kind)==="leaf"?t.value:s==null?void 0:s.default,g=ug(s==null?void 0:s.type);if(g==="boolean"){const a=w===!0;return _.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-fg-faint",children:"Set to:"}),_.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:[{v:!0,label:"on"},{v:!1,label:"off"}].map(({v:l,label:p})=>_.jsx("button",{onClick:()=>i(l),className:`px-3 py-0.5 text-xs transition-colors ${a===l?"bg-accent text-bg":"bg-bg-elev text-fg-dim hover:bg-bg-hi hover:text-fg"}`,children:p},p))}),_.jsxs("span",{className:"text-fg-faint",children:["→ ",vt[o].label]})]})}return s!=null&&s.enum?_.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[_.jsx("span",{className:"text-fg-faint",children:"Choose:"}),s.enum.map(a=>{const l=dg(w,a);return _.jsx("button",{onClick:()=>i(a),className:`px-2 py-0.5 text-xs rounded border ${l?"bg-accent text-bg border-accent":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,children:String(a)},String(a))}),_.jsxs("span",{className:"text-fg-faint",children:["→ ",vt[o].label]})]}):g==="integer"||g==="number"?_.jsx(hw,{value:typeof w=="number"?w:void 0,integer:g==="integer",onCommit:i,target:vt[o].label}):g==="string"?_.jsx(fw,{value:typeof w=="string"?w:"",onCommit:i,target:vt[o].label}):_.jsxs("div",{className:"text-fg-faint",children:["Complex value (",g??"object/array",") — use the"," ",_.jsx("span",{className:"text-fg-dim",children:"Raw"})," tab to edit."]})}function hw({value:t,integer:s,onCommit:i,target:o}){const[d,w]=W.useState(t!==void 0?String(t):""),g=()=>{const a=s?parseInt(d,10):parseFloat(d);Number.isNaN(a)||i(a)};return _.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-fg-faint",children:"Set to:"}),_.jsx("input",{type:"number",value:d,onChange:a=>w(a.target.value),onBlur:g,onKeyDown:a=>{a.key==="Enter"&&a.target.blur()},className:"w-24 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),_.jsxs("button",{onClick:g,className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",o]})]})}function fw({value:t,onCommit:s,target:i}){const[o,d]=W.useState(t);return _.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[_.jsx("span",{className:"text-fg-faint shrink-0",children:"Set to:"}),_.jsx("input",{type:"text",value:o,onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Enter"&&s(o)},className:"flex-1 min-w-0 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),_.jsxs("button",{onClick:()=>s(o),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 → ",i]})]})}function pw({node:t,info:s,onSet:i,disabled:o}){const d=(t==null?void 0:t.kind)==="leaf",w=ug(s==null?void 0:s.type);if(o)return null;if(w==="boolean"){const g=d&&t.value===!0;return _.jsx("button",{onClick:()=>i(!g),className:`px-2.5 py-0.5 text-xs rounded border transition-colors ${g?"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:g?"on":"off"})}return null}function mw({isSet:t,leafNode:s,defaultVal:i,isDefault:o,node:d}){return t?(d==null?void 0:d.kind)==="array"?{kind:"accumulated",label:`${d.items.length} items`}:(d==null?void 0:d.kind)==="object"?{kind:"set",label:"configured"}:s?o?{kind:"default",label:`= default · ${vt[s.winner].label}`}:s.shadowed.length>0?{kind:"override",label:`overriding ${s.shadowed.length} scope(s)`}:{kind:"set",label:`set in ${vt[s.winner].label}`}:{kind:"set",label:"configured"}:i!==void 0?{kind:"default",label:`using default: ${zo(i)}`}:{kind:"unset",label:"not configured"}}function gw({kind:t,label:s}){const i={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"}[t];return _.jsx("span",{className:`text-[9px] px-1.5 py-0 rounded border uppercase tracking-wide ${i}`,children:s})}function ug(t){if(t)return Array.isArray(t)?t.find(i=>i!=="null")??t[0]:t}function dg(t,s){return t===s?!0:typeof t!=typeof s?!1:t&&s&&typeof t=="object"?JSON.stringify(t)===JSON.stringify(s):!1}function vw(t){const s=t.trim().split(`
|
|
66
|
+
`)[0],i=s.match(/^([^.!?]+[.!?])/);return i?i[1]:s.length>120?s.slice(0,120)+"…":s}function zo(t){if(typeof t=="string")return t===""?'""':JSON.stringify(t);if(t===null)return"null";if(t===void 0)return"—";if(typeof t=="object"){const s=JSON.stringify(t);return s.length>60?s.slice(0,60)+"…":s}return String(t)}function xu({options:t,active:s,onChange:i}){return _.jsx("div",{className:"flex rounded border border-line overflow-hidden",children:t.map(({key:o,label:d})=>_.jsx("button",{onClick:()=>i(o),className:`px-2 py-0.5 text-xs ${s===o?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:d},o))})}function tn(t){return{path:t,diskRaw:"",draftRaw:"",diskData:null,exists:!1,parseError:null,loadError:null,mtimeMs:0,dirty:!1,busy:!1,lastSavedAt:null}}function Tc(t,s,i){const o={...t,diskRaw:s.raw,diskData:s.data,exists:s.exists,parseError:s.parseError,loadError:s.error,mtimeMs:s.mtimeMs,busy:!1};return!i||!t.dirty?(o.draftRaw=s.raw,o.dirty=!1):o.dirty=o.draftRaw!==o.diskRaw,o}function pp(t,s,i){const o={...t,diskRaw:s.text,diskData:null,exists:s.exists,parseError:null,loadError:s.error,mtimeMs:s.mtimeMs,busy:!1};return o.draftRaw=s.text,o.dirty=!1,o}const xe=pa((t,s)=>({files:{},watchRefs:{},loadJson:async i=>{const o=s().files[i];t({files:{...s().files,[i]:{...o??tn(i),busy:!0}}});const d=await window.api.config.readJson(i),w=s().files[i]??tn(i);t({files:{...s().files,[i]:Tc(w,d,!1)}})},loadText:async i=>{const o=s().files[i];t({files:{...s().files,[i]:{...o??tn(i),busy:!0}}});const d=await window.api.config.readText(i),w=s().files[i]??tn(i);t({files:{...s().files,[i]:pp(w,d)}})},setDraft:(i,o)=>{const d=s().files[i]??tn(i),w=o!==d.diskRaw;t({files:{...s().files,[i]:{...d,draftRaw:o,dirty:w}}})},revert:i=>{const o=s().files[i];o&&t({files:{...s().files,[i]:{...o,draftRaw:o.diskRaw,dirty:!1}}})},saveJson:async i=>{const o=s().files[i];if(!o)return{ok:!1,error:"not loaded"};let d;try{d=o.draftRaw.trim()===""?{}:JSON.parse(o.draftRaw)}catch(l){return{ok:!1,error:`invalid JSON: ${l.message}`}}t({files:{...s().files,[i]:{...o,busy:!0}}});const w=await window.api.config.writeJson(i,d);if(!w.ok)return t({files:{...s().files,[i]:{...o,busy:!1}}}),{ok:!1,error:w.error};const g=await window.api.config.readJson(i),a=Tc({...o,busy:!1},g,!1);return t({files:{...s().files,[i]:{...a,lastSavedAt:Date.now()}}}),{ok:!0}},saveText:async i=>{const o=s().files[i];if(!o)return{ok:!1,error:"not loaded"};t({files:{...s().files,[i]:{...o,busy:!0}}});const d=await window.api.config.writeText(i,o.draftRaw);if(!d.ok)return t({files:{...s().files,[i]:{...o,busy:!1}}}),{ok:!1,error:d.error};const w=await window.api.config.readText(i),g=pp({...o,busy:!1},w);return t({files:{...s().files,[i]:{...g,lastSavedAt:Date.now()}}}),{ok:!0}},watchFile:i=>{const o={...s().watchRefs};o[i]=(o[i]??0)+1,t({watchRefs:o}),o[i]===1&&window.api.config.watch([i])},unwatchFile:i=>{const o={...s().watchRefs};o[i]&&(o[i]--,o[i]<=0&&(delete o[i],window.api.config.unwatch([i])),t({watchRefs:o}))},onExternalChange:i=>{s().files[i]&&window.api.config.readJson(i).then(d=>{const w=s().files[i];w&&t({files:{...s().files,[i]:Tc(w,d,!0)}})})}}));function yw(){return window.api.config.onChanged(({path:t})=>{xe.getState().onExternalChange(t)})}const _w=[];function Bo(t){return Array.isArray(t)?"array":t!==null&&typeof t=="object"?"object":"scalar"}function wu(t){const s=t.filter(i=>i.data!==void 0);return s.length===0?{kind:"object",children:{}}:hg(s,[])}function hg(t,s){const i=_w.includes(s.join(".")),o=t.every(m=>Bo(m.data)==="object"),d=t.every(m=>Bo(m.data)==="array");if(o){const m=new Set;for(const x of t)for(const b of Object.keys(x.data))m.add(b);const u={};for(const x of m){const b=t.filter(E=>x in E.data).map(E=>({scope:E.scope,data:E.data[x]}));u[x]=hg(b,[...s,x])}return{kind:"object",children:u}}if(d&&!i){const m=[];for(const u of[...t].reverse())for(const x of u.data)m.push({value:x,fromScope:u.scope,index:m.length});return{kind:"array",items:m}}const w=[...t].reverse(),g=w[0],a=w.slice(1).map(m=>({scope:m.scope,value:m.data})),l=Bo(g.data),p=a.some(m=>Bo(m.value)!==l);return{kind:"leaf",value:g.data,winner:g.scope,shadowed:a,...p?{typeMismatch:!0}:{}}}function Su(t,s){if(s.length===0)return t;if(t.kind!=="object")return null;const[i,...o]=s,d=t.children[i];return d?Su(d,o):null}function ga(t,s,i){if(s.length===0)return i;const[o,...d]=s,w=t&&typeof t=="object"&&!Array.isArray(t)?{...t}:{};return w[o]=ga(w[o],d,i),w}const xw=["user","project","local"];function bu(t,s){const i=[];for(const o of xw){const d=s[o];if(!d)continue;const w=t[d];if(!w||!w.exists)continue;const g=w.draftRaw??"";if(g.trim())try{i.push({scope:o,data:JSON.parse(g)})}catch{}}return i}const ww="http://json-schema.org/draft-07/schema#",Sw="https://json.schemastore.org/claude-code-settings.json",bw={permissionRule:{type:"string",description:`Tool permission rule.
|
|
67
|
+
See https://code.claude.com/docs/en/settings#permission-rule-syntax
|
|
68
|
+
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"}}}}},Cw="Configuration settings for Claude Code. Learn more: https://code.claude.com/docs/en/settings",kw=!0,Ew=!0,Tw="object",Rw=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"]}]}}}`),Pw="Claude Code Settings",Lw={$schema:ww,$id:Sw,$defs:bw,description:Cw,allowTrailingCommas:kw,additionalProperties:Ew,type:Tw,properties:Rw,title:Pw};function Dw(t){const s=t??{},i={...s.$defs??{},...s.definitions??{}},o=b=>{if(!b)return{};if(!b.$ref)return g(b);const E=/^#\/(\$defs|definitions)\/(.+)$/.exec(b.$ref);if(!E)return g(b);const S=i[E[2]];return S?o({...S,...a(b)}):g(b)},d=new Set(["__proto__","constructor","prototype"]),w=b=>{if(!b)return{};const E={};for(const[S,c]of Object.entries(b))d.has(S)||(E[S]=c);return E},g=b=>{if(!b.allOf||b.allOf.length===0)return b;const E={...b};delete E.allOf;for(const S of b.allOf){const c=o(S);Object.assign(E,{properties:{...w(E.properties),...w(c.properties)},required:Aw([...E.required??[],...c.required??[]])}),!E.description&&c.description&&(E.description=c.description),E.default===void 0&&c.default!==void 0&&(E.default=c.default),!E.type&&c.type&&(E.type=c.type)}return E},a=b=>{const{$ref:E,...S}=b;return S},l=(b,E)=>{let S=o(b);for(const c of E){if(!S)return null;if(/^\d+$/.test(c)){const v=Array.isArray(S.items)?S.items[Number(c)]:S.items;S=v?o(v):null;continue}const y=S.properties;if(y&&!d.has(c)&&c in y){S=o(y[c]);continue}const h=S.additionalProperties;if(h&&typeof h=="object"){S=o(h);continue}return null}return S},p=(b,E,S)=>{if(!b)return null;const c={};if(b.description&&(c.description=b.description),b.type&&(c.type=b.type),b.default!==void 0&&(c.default=b.default),b.enum&&(c.enum=b.enum),b.const!==void 0&&(c.const=b.const),b.deprecated&&(c.deprecated=!0),b.examples&&(c.examples=b.examples),b.properties&&(c.knownChildren=Object.keys(b.properties)),S&&(E!=null&&E.includes(S))&&(c.required=!0),b.items&&!Array.isArray(b.items)){const y=o(b.items),h=p(y,void 0,null);h&&(c.itemsInfo=h)}return(b.additionalProperties===!0||typeof b.additionalProperties=="object")&&(c.open=!0),c},m=b=>E=>{if(E.length===0)return p(o(b),void 0,null);const S=l(b,E.slice(0,-1));if(!S)return null;const c=E[E.length-1],y=l(S,[c]);return p(y,S.required,c)},u=b=>{const E=o(b);return Object.keys(E.properties??{})},x=b=>({at:m(b),rootKeys:()=>u(b),rootedAt:E=>{const S=l(b,E);return x(S??{})}});return x(s)}function Aw(t){return Array.from(new Set(t))}let Rc=null;function ia(){return Rc||(Rc=Dw(Lw)),Rc}function jw(){const t=et(),s=Re(T=>T.tabs),i=Re(T=>T.activeTabId),o=s.find(T=>T.id===i)??null,d=(o==null?void 0:o.cwd)??null,[w,g]=W.useState("user"),[a,l]=W.useState("effective"),p=W.useMemo(()=>{const T={};for(const A of ui.scopes){const I=ui.resolve(A,t??"",d);I&&(T[A]=I)}return T},[t,d]),m=p[w]??null,u=xe(T=>T.files),x=xe(T=>T.loadJson),b=xe(T=>T.setDraft),E=xe(T=>T.saveJson),S=xe(T=>T.revert),c=xe(T=>T.watchFile),y=xe(T=>T.unwatchFile);W.useEffect(()=>{const T=Object.values(p).filter(Boolean);return T.forEach(A=>{u[A]||x(A),c(A)}),()=>{T.forEach(A=>y(A))}},[JSON.stringify(p)]);const[h,v]=W.useState(null),C=W.useMemo(()=>wu(bu(u,p)),[u,p]),R=(T,A)=>{var J;const I=p[w];if(!I)return;v(null);const H=((J=u[I])==null?void 0:J.draftRaw)??"";let $={};if(H.trim())try{$=JSON.parse(H)}catch{$={}}const N=ga($,T,A);b(I,JSON.stringify(N,null,2)+`
|
|
69
|
+
`)};if(!t)return _.jsx(be,{title:"loading…"});const L=m?u[m]:null,D=T=>T!=="user"&&!d;return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx(xu,{options:[{key:"effective",label:"Guided"},{key:"tree",label:"Tree"},{key:"raw",label:"Raw"}],active:a,onChange:l}),_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:ui.scopes,active:w,onChange:g,annotate:T=>{if(D(T))return{exists:!1};const A=p[T];if(!A)return null;const I=u[A];return{exists:(I==null?void 0:I.exists)??!1,dirty:(I==null?void 0:I.dirty)??!1}}}),_.jsx("span",{className:"ml-3 text-fg-faint truncate",children:a==="effective"?`overrides → ${m??"—"}`:m??"—"}),_.jsx("div",{className:"flex-1"}),_.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:m&&L?_.jsx(is,{dirty:L.dirty,busy:L.busy,parseError:h||L.parseError,lastSavedAt:L.lastSavedAt,leading:L.exists?null:_.jsx("span",{children:"file will be created on save"}),onSave:async()=>{v(null);const T=await E(m);T.ok||v(T.error??"save failed")},onRevert:()=>{v(null),S(m)}}):null,children:D(w)?_.jsx(be,{title:"no active project",hint:"open a tab in a project directory to edit project or local settings"}):a==="effective"?_.jsx(aw,{node:C,targetScope:w,onOverride:R,schema:ia()}):a==="tree"?_.jsx(_u,{node:C,targetScope:w,onOverride:R,schema:ia()}):m&&L?_.jsx(ng,{path:m,value:L.draftRaw,onChange:T=>{v(null),b(m,T)}}):_.jsx(be,{title:"resolving…"})})}function Cu({value:t,onChange:s,path:i,readOnly:o}){return _.jsx(ig,{path:`file://${i}`,defaultLanguage:"markdown",value:t,onChange:d=>s(d??""),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:o,automaticLayout:!0}})}const mp=[{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"]}],gp=[{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:"playwright-e2e",name:"Playwright E2E",description:"End-to-end browser tests — navigation, forms, assertions, waiting strategies",official:!1,source:"local"},{id:"playwright-visual-testing",name:"Playwright Visual Testing",description:"Visual regression testing — screenshot comparison, pixel diffs, responsive layouts",official:!1,source:"local"},{id:"playwright-accessibility",name:"Playwright Accessibility",description:"Accessibility testing — WCAG compliance, axe-core scans, keyboard navigation",official:!1,source:"local"},{id:"playwright-api-testing",name:"Playwright API Testing",description:"API testing with Playwright request context — REST endpoints, auth flows, contracts",official:!1,source:"local"},{id:"playwright-debug",name:"Playwright Debug",description:"Debug failing tests — trace viewer, inspector, headed mode, flaky test fixes",official:!1,source:"local"},{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"}],vp=[{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"]}],yp=[{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`}],$t=(t,s,i,o)=>`---
|
|
70
|
+
name: ${t}
|
|
71
|
+
description: ${s}
|
|
72
|
+
tools: ${i}
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
${o}
|
|
76
|
+
`,_p=[{id:"code-reviewer",name:"Code Reviewer",description:"Review staged changes for bugs, style, and maintainability",tools:"Read, Grep, Glob, Bash",content:$t("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:
|
|
77
|
+
- correctness issues (bugs, edge cases, race conditions)
|
|
78
|
+
- security issues (injection, auth, secrets)
|
|
79
|
+
- maintainability issues (naming, duplication, abstractions)
|
|
80
|
+
- style / convention deviations vs the rest of the repo
|
|
81
|
+
|
|
82
|
+
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:$t("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:$t("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:$t("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:$t("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:$t("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:$t("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:$t("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:$t("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:$t("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:$t("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:$t("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.")}],xp=[{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"}}],Cs=[{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"]}],va=/<!--\s*claude-presets:start(?:\s+id=([^>]*?))?\s*-->/,Ls="<!-- claude-presets:end -->";function ku(t){const s=t.match(va);if(!s)return[];const i=(s[1]??"").trim();return i?i.split(",").map(o=>o.trim()).filter(Boolean):[]}function Mw(t){if(t.length===0)return`<!-- claude-presets:start -->
|
|
83
|
+
<!-- claude-presets:end -->`;const s=[],i=new Map;for(const w of t){const g=w.section.trim().toLowerCase();let a=i.get(g);a===void 0&&(a=s.length,i.set(g,a),s.push({section:w.section.trim(),bullets:[]})),s[a].bullets.push(...w.bullets)}const o=s.map(w=>`# ${w.section}
|
|
84
|
+
|
|
85
|
+
${w.bullets.map(g=>`- ${g.trim()}`).join(`
|
|
86
|
+
`)}`).join(`
|
|
87
|
+
|
|
88
|
+
`);return`<!-- claude-presets:start id=${t.map(w=>w.id).join(",")} -->
|
|
89
|
+
${o}
|
|
90
|
+
<!-- claude-presets:end -->`}function Ow(t,s){const i=Mw(s),o=t.match(va);if(o&&o.index!==void 0){const d=o.index,w=t.indexOf(Ls,d);if(w>=0){const g=t.slice(0,d),a=t.slice(w+Ls.length),l=g.replace(/\s*$/,""),p=a.replace(/^\s*/,"");return`${l}${l?`
|
|
91
|
+
|
|
92
|
+
`:""}${i}${p?`
|
|
93
|
+
|
|
94
|
+
`:`
|
|
95
|
+
`}${p}`}}return t.trim()?`${i}
|
|
96
|
+
|
|
97
|
+
${t.replace(/^\s+/,"")}`:i+`
|
|
98
|
+
`}function Iw(t,s,i){const o=ku(t),d=o.includes(s)?o.filter(a=>a!==s):[...o,s],w=new Map(i.map(a=>[a.id,a])),g=d.map(a=>w.get(a)).filter(a=>a!==void 0);return Ow(t,g)}function Nw(t,s){let i=t;const o=i.match(va);if(o&&o.index!==void 0){const g=i.indexOf(Ls,o.index);g>=0&&(i=i.slice(0,o.index)+i.slice(g+Ls.length))}const d=new Set(s.map(g=>g.section.trim().toLowerCase())),w=new Set;for(const g of i.split(`
|
|
99
|
+
`)){const a=g.match(/^#\s+(.+?)\s*$/);if(!a)continue;const l=a[1].trim();d.has(l.toLowerCase())&&w.add(l)}return Array.from(w)}function Bw(t,s){if(s.length===0)return t;const i=new Set(s.map(p=>p.trim().toLowerCase())),o=t.match(va);let d=t,w="",g="";if(o&&o.index!==void 0){const p=t.indexOf(Ls,o.index);p>=0&&(d=t.slice(0,o.index),w=t.slice(o.index,p+Ls.length),g=t.slice(p+Ls.length))}const a=p=>{const m=p.split(`
|
|
100
|
+
`),u=[];let x=!1;for(const b of m){const E=b.match(/^#\s+(.+?)\s*$/);if(E){if(x=i.has(E[1].trim().toLowerCase()),x)continue}else if(x)continue;u.push(b)}return u.join(`
|
|
101
|
+
`).replace(/\n{3,}/g,`
|
|
102
|
+
|
|
103
|
+
`)},l=(w?a(d).replace(/\s*$/,"")+(d.trim()?`
|
|
104
|
+
|
|
105
|
+
`:"")+w+(g.trim()?`
|
|
106
|
+
|
|
107
|
+
`:`
|
|
108
|
+
`)+a(g).replace(/^\s*/,""):a(d)).replace(/^\s*\n+/,"").replace(/\n{3,}/g,`
|
|
109
|
+
|
|
110
|
+
`);return l.endsWith(`
|
|
111
|
+
`)?l:l+`
|
|
112
|
+
`}function Fw(t,s,i){const o=ku(t);if(o.includes(s.id))return 0;const d=new Map(i.map(g=>[g.id,g])),w=s.section.trim().toLowerCase();return o.map(g=>d.get(g)).filter(g=>!!g).filter(g=>g.section.trim().toLowerCase()===w).length}function js(t,...s){if(!t.trim())return!0;const i=t.toLowerCase();return s.some(o=>o.toLowerCase().includes(i))}function Hw(){const t=et(),[s,i]=W.useState(new Set),[o,d]=W.useState(null),[w,g]=W.useState(null),[a,l]=W.useState(null),[p,m]=W.useState(""),u=async()=>{var y;if(!t)return;const c=((y=(await window.api.config.readJson(`${t}/.claude.json`)).data)==null?void 0:y.mcpServers)??{};i(new Set(Object.keys(c)))};W.useEffect(()=>{u()},[t]);const x=W.useMemo(()=>mp.filter(S=>js(p,S.id,S.name,S.description)),[p]),b=async S=>{if(!t)return;d(S.id),g(null);const c=`${t}/.claude.json`,y=await window.api.config.readJson(c),h=(y.data&&typeof y.data=="object"?y.data:{})??{},v={...h.mcpServers??{}};v[S.id]={..."command"in S.config?{type:"stdio"}:{},...S.config};const C=await window.api.config.writeJson(c,{...h,mcpServers:v});if(d(null),!C.ok){g(C.error??"write failed");return}l(`installed ${S.id} — switch to Installed to edit placeholders`),setTimeout(()=>l(null),4e3),u()},E=async S=>{if(!t)return;d(S),g(null);const c=`${t}/.claude.json`,y=await window.api.config.readJson(c),h=(y.data&&typeof y.data=="object"?y.data:{})??{},v={...h.mcpServers??{}};delete v[S];const C=await window.api.config.writeJson(c,{...h,mcpServers:v});if(d(null),!C.ok){g(C.error??"write failed");return}u()};return t?_.jsxs("div",{className:"h-full flex flex-col",children:[_.jsx(pi,{query:p,onQueryChange:m,count:x.length,total:mp.length}),(a||w)&&_.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${w?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:w??a}),_.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[x.map(S=>{const c=s.has(S.id);return _.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-fg text-xs font-medium",children:S.name}),S.official&&_.jsx(ct,{children:"official"}),c&&_.jsx(ct,{tone:"accent",children:"installed"}),S.envVars.length>0&&_.jsxs(ct,{tone:"warn",children:[S.envVars.length," env"]})]}),_.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:S.description}),_.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:"command"in S.config?`${S.config.command} ${(S.config.args??[]).join(" ")}`:S.config.url})]}),_.jsxs("div",{className:"flex gap-1 shrink-0",children:[_.jsx(Eu,{href:S.homepage,children:"docs"}),c?_.jsx("button",{disabled:o===S.id,onClick:()=>E(S.id),className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-red-400",children:"remove"}):_.jsx("button",{disabled:o===S.id,onClick:()=>b(S),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:o===S.id?"…":"install"})]})]},S.id)}),x.length===0&&_.jsx(be,{title:"no matches"})]})]}):_.jsx(be,{title:"loading…"})}function Uw(){const t=et(),[s,i]=W.useState(new Set),[o,d]=W.useState(""),w=async()=>{if(!t)return;const a=await window.api.config.listDir(`${t}/.claude/skills`,{dirsOnly:!0});i(new Set(a.entries.map(l=>l.name)))};W.useEffect(()=>{w()},[t]);const g=W.useMemo(()=>gp.filter(a=>js(o,a.id,a.name,a.description)),[o]);return t?_.jsxs("div",{className:"h-full flex flex-col",children:[_.jsx(pi,{query:o,onQueryChange:d,count:g.length,total:gp.length}),_.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[g.map(a=>{const l=s.has(a.id),p=a.source==="local",m=p?"":`mkdir -p ~/.claude/skills && cd ~/.claude/skills && git clone --depth 1 --filter=blob:none --sparse https://github.com/anthropics/skills _tmp-${a.id} && cd _tmp-${a.id} && git sparse-checkout set skills/${a.id} && mv skills/${a.id} ../${a.id} && cd .. && rm -rf _tmp-${a.id}`;return _.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-fg text-xs font-medium",children:a.name}),a.official&&_.jsx(ct,{children:"official"}),p&&_.jsx(ct,{tone:"warn",children:"local"}),l&&_.jsx(ct,{tone:"accent",children:"installed"})]}),_.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:a.description}),_.jsxs("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:["~/.claude/skills/",a.id,"/"]})]}),_.jsxs("div",{className:"flex gap-1 shrink-0",children:[!p&&_.jsx(Eu,{href:a.source,children:"source"}),!p&&_.jsx(fg,{text:m,label:l?"reinstall cmd":"copy install"})]})]},a.id)}),g.length===0&&_.jsx(be,{title:"no matches"})]})]}):_.jsx(be,{title:"loading…"})}function Ww(){const t=et(),[s,i]=W.useState(new Set),[o,d]=W.useState(""),w=async()=>{if(!t)return;const a=await window.api.config.listDir(`${t}/.claude/plugins`,{dirsOnly:!0});i(new Set(a.entries.map(l=>l.name)))};W.useEffect(()=>{w()},[t]);const g=W.useMemo(()=>vp.filter(a=>js(o,a.id,a.name,a.description)),[o]);return t?_.jsxs("div",{className:"h-full flex flex-col",children:[_.jsx(pi,{query:o,onQueryChange:d,count:g.length,total:vp.length}),_.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[g.map(a=>{const l=s.has(a.id),p=`/plugin install ${a.id}@anthropics/claude-plugins-official`;return _.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-fg text-xs font-medium",children:a.name}),a.official&&_.jsx(ct,{children:"official"}),l&&_.jsx(ct,{tone:"accent",children:"installed"}),a.bundles.map(m=>_.jsx(ct,{tone:"dim",children:m},m))]}),_.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:a.description}),_.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:p})]}),_.jsxs("div",{className:"flex gap-1 shrink-0",children:[_.jsx(Eu,{href:a.source,children:"source"}),_.jsx(fg,{text:p,label:"copy install"})]})]},a.id)}),g.length===0&&_.jsx(be,{title:"no matches"})]})]}):_.jsx(be,{title:"loading…"})}function Vw(t,s){return(t[s.event]??[]).some(o=>(o.hooks??[]).some(d=>d.type==="command"&&d.command===s.command))}function $w(){const t=et(),[s,i]=W.useState({}),[o,d]=W.useState(null),[w,g]=W.useState(null),[a,l]=W.useState(null),[p,m]=W.useState(""),u=t?`${t}/.claude/settings.json`:null,x=async()=>{if(!u)return;const c=await window.api.config.readJson(u),y=(c.data&&typeof c.data=="object"?c.data:{})??{};i(y.hooks??{})};W.useEffect(()=>{x()},[u]);const b=W.useMemo(()=>yp.filter(c=>js(p,c.id,c.name,c.description,c.event)),[p]),E=async c=>{if(!u)return;d(c.id),l(null);const y=await window.api.config.readJson(u),h=(y.data&&typeof y.data=="object"?y.data:{})??{},v={...h.hooks??{}},C=(v[c.event]??[]).slice();C.push({...c.matcher?{matcher:c.matcher}:{},hooks:[{type:"command",command:c.command,...c.timeout?{timeout:c.timeout}:{}}]}),v[c.event]=C;const R=await window.api.config.writeJson(u,{...h,hooks:v});if(d(null),!R.ok){l(R.error??"write failed");return}g(`installed ${c.id}`),setTimeout(()=>g(null),2500),x()},S=async c=>{if(!u)return;d(c.id),l(null);const y=await window.api.config.readJson(u),h=(y.data&&typeof y.data=="object"?y.data:{})??{},v={...h.hooks??{}},C=(v[c.event]??[]).map(L=>({...L,hooks:(L.hooks??[]).filter(D=>!(D.type==="command"&&D.command===c.command))})).filter(L=>(L.hooks??[]).length>0);C.length?v[c.event]=C:delete v[c.event];const R=await window.api.config.writeJson(u,{...h,hooks:v});if(d(null),!R.ok){l(R.error??"write failed");return}x()};return t?_.jsxs("div",{className:"h-full flex flex-col",children:[_.jsx(pi,{query:p,onQueryChange:m,count:b.length,total:yp.length}),(w||a)&&_.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${a?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:a??w}),_.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[b.map(c=>{const y=Vw(s,c);return _.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-fg text-xs font-medium",children:c.name}),_.jsx(ct,{tone:"dim",children:c.event}),c.matcher&&_.jsxs(ct,{tone:"dim",children:["match: ",c.matcher]}),y&&_.jsx(ct,{tone:"accent",children:"installed"})]}),_.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:c.description}),_.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:c.command})]}),_.jsx("div",{className:"flex gap-1 shrink-0",children:y?_.jsx("button",{disabled:o===c.id,onClick:()=>S(c),className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-red-400",children:"remove"}):_.jsx("button",{disabled:o===c.id,onClick:()=>E(c),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:o===c.id?"…":"install"})})]},c.id)}),b.length===0&&_.jsx(be,{title:"no matches"})]})]}):_.jsx(be,{title:"loading…"})}function zw(){const t=et(),[s,i]=W.useState(new Set),[o,d]=W.useState(null),[w,g]=W.useState(null),[a,l]=W.useState(null),[p,m]=W.useState(""),u=async()=>{if(!t)return;const E=await window.api.config.listDir(`${t}/.claude/agents`,{filesOnly:!0}),S=new Set;for(const c of E.entries)c.name.endsWith(".md")&&S.add(c.name.replace(/\.md$/,""));i(S)};W.useEffect(()=>{u()},[t]);const x=W.useMemo(()=>_p.filter(E=>js(p,E.id,E.name,E.description)),[p]),b=async E=>{if(!t)return;d(E.id),l(null);const S=`${t}/.claude/agents/${E.id}.md`,c=await window.api.config.writeText(S,E.content);if(d(null),!c.ok){l(c.error??"write failed");return}g(`installed ${E.id}`),setTimeout(()=>g(null),2500),u()};return t?_.jsxs("div",{className:"h-full flex flex-col",children:[_.jsx(pi,{query:p,onQueryChange:m,count:x.length,total:_p.length}),(w||a)&&_.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${a?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:a??w}),_.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[x.map(E=>{const S=s.has(E.id);return _.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-fg text-xs font-medium",children:E.name}),E.tools&&_.jsxs(ct,{tone:"dim",children:[E.tools.split(",").length," tools"]}),S&&_.jsx(ct,{tone:"accent",children:"installed"})]}),_.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:E.description}),_.jsxs("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:["~/.claude/agents/",E.id,".md"]})]}),_.jsx("div",{className:"flex gap-1 shrink-0",children:_.jsx("button",{disabled:o===E.id,onClick:()=>b(E),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:o===E.id?"…":S?"overwrite":"install"})})]},E.id)}),x.length===0&&_.jsx(be,{title:"no matches"})]})]}):_.jsx(be,{title:"loading…"})}function Kw(){const t=et(),[s,i]=W.useState(""),[o,d]=W.useState(null),[w,g]=W.useState(null),[a,l]=W.useState(null),[p,m]=W.useState(""),u=t?`${t}/.claude/settings.json`:null,x=async()=>{if(!u)return;const S=await window.api.config.readJson(u),c=(S.data&&typeof S.data=="object"?S.data:{})??{};i(JSON.stringify(c.permissions??{}))};W.useEffect(()=>{x()},[u]);const b=W.useMemo(()=>xp.filter(S=>js(p,S.id,S.name,S.description)),[p]),E=async S=>{if(!u)return;d(S.id),l(null);const c=await window.api.config.readJson(u),y=(c.data&&typeof c.data=="object"?c.data:{})??{},h=await window.api.config.writeJson(u,{...y,permissions:S.permissions});if(d(null),!h.ok){l(h.error??"write failed");return}g(`applied ${S.id} — replaces existing permissions block`),setTimeout(()=>g(null),3e3),x()};return t?_.jsxs("div",{className:"h-full flex flex-col",children:[_.jsx(pi,{query:p,onQueryChange:m,count:b.length,total:xp.length}),(w||a)&&_.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${a?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:a??w}),_.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[b.map(S=>{const c=s===JSON.stringify(S.permissions),y=[];return S.permissions.allow&&y.push(`${S.permissions.allow.length} allow`),S.permissions.deny&&y.push(`${S.permissions.deny.length} deny`),S.permissions.ask&&y.push(`${S.permissions.ask.length} ask`),S.permissions.defaultMode&&y.push(`mode: ${S.permissions.defaultMode}`),_.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-fg text-xs font-medium",children:S.name}),c&&_.jsx(ct,{tone:"accent",children:"active"}),_.jsx(ct,{tone:"warn",children:"replaces permissions"})]}),_.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:S.description}),_.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:y.join(" · ")})]}),_.jsx("div",{className:"flex gap-1 shrink-0",children:_.jsx("button",{disabled:o===S.id,onClick:()=>E(S),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:o===S.id?"…":"apply"})})]},S.id)}),b.length===0&&_.jsx(be,{title:"no matches"})]})]}):_.jsx(be,{title:"loading…"})}const qw={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 Gw(){const t=et(),[s,i]=W.useState(""),[o,d]=W.useState(null),[w,g]=W.useState(null),[a,l]=W.useState(null),[p,m]=W.useState(""),u=t?`${t}/.claude/CLAUDE.md`:null,x=async()=>{if(!u)return;const R=await window.api.config.readText(u);i(R.text)};W.useEffect(()=>{x()},[u]);const b=W.useMemo(()=>new Set(ku(s)),[s]),E=W.useMemo(()=>Nw(s,Cs),[s]),S=async()=>{if(!u||E.length===0)return;l(null);const R=Bw(s,E),L=await window.api.config.writeText(u,R);if(!L.ok){l(L.error??"write failed");return}g(`removed ${E.length} unmanaged section(s)`),setTimeout(()=>g(null),3e3),x()},c=W.useMemo(()=>Cs.filter(R=>js(p,R.id,R.name,R.description,R.section,...R.tags??[])),[p]),y=W.useMemo(()=>{const R=new Map;for(const L of c){const D=R.get(L.category)??[];D.push(L),R.set(L.category,D)}return R},[c]),h=async R=>{if(!u)return;d(R.id),l(null);const L=Iw(s,R.id,Cs),D=await window.api.config.writeText(u,L);if(d(null),!D.ok){l(D.error??"write failed");return}const T=!b.has(R.id);g(T?`enabled "${R.name}"`:`disabled "${R.name}"`),setTimeout(()=>g(null),2500),x()};if(!t)return _.jsx(be,{title:"loading…"});const v=b.size,C=["communication","working-style","testing","review","security","debugging","architecture","refactoring","performance","documentation","collaboration","domain"];return _.jsxs("div",{className:"h-full flex flex-col",children:[_.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:[_.jsx("span",{className:"text-fg-faint",children:v>0?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"text-fg-dim font-medium",children:v})," active · managed in"," ",_.jsx("code",{className:"text-fg-faint",children:"~/.claude/CLAUDE.md"})]}):_.jsx(_.Fragment,{children:"nothing active — toggle presets below to stack them in your CLAUDE.md"})}),_.jsx("div",{className:"flex-1"}),_.jsx("span",{className:"text-fg-faint",children:c.length===Cs.length?`${Cs.length} available`:`${c.length} of ${Cs.length}`}),_.jsx("input",{value:p,onChange:R=>m(R.target.value),placeholder:"search presets…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-56"})]}),(w||a)&&_.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${a?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:a??w}),E.length>0&&_.jsxs("div",{className:"px-4 py-2 text-xs border-b border-line bg-yellow-950/20 flex items-start gap-3",children:[_.jsxs("div",{className:"flex-1 text-yellow-500/90",children:[_.jsx("div",{className:"font-medium",children:"Your CLAUDE.md has unmanaged sections that will collide with presets:"}),_.jsx("div",{className:"text-yellow-500/70 mt-0.5",children:E.map(R=>`# ${R}`).join(" · ")}),_.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."})]}),_.jsxs("button",{onClick:S,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 ",E.length," section",E.length>1?"s":""]})]}),_.jsxs("div",{className:"flex-1 overflow-auto",children:[C.map(R=>({cat:R,presets:y.get(R)??[]})).filter(R=>R.presets.length>0).map(({cat:R,presets:L})=>_.jsx(Xw,{title:qw[R],presets:L,activeIds:b,existing:s,busy:o,onToggle:h},R)),c.length===0&&_.jsx(be,{title:"no matches"})]})]})}function Xw({title:t,presets:s,activeIds:i,existing:o,busy:d,onToggle:w}){const[g,a]=W.useState(!0),l=s.filter(p=>i.has(p.id)).length;return _.jsxs("section",{className:"border-b border-line",children:[_.jsxs("header",{className:"px-4 py-2 bg-bg-elev/40 cursor-pointer hover:bg-bg-elev flex items-center gap-3",onClick:()=>a(!g),children:[_.jsx("span",{className:"text-fg-faint w-3",children:g?"▾":"▸"}),_.jsx("h2",{className:"text-fg text-sm font-medium flex-1",children:t}),_.jsx("span",{className:"text-fg-faint text-xs",children:l>0?`${l}/${s.length} active`:`${s.length}`})]}),g&&_.jsx("div",{className:"divide-y divide-line/60",children:s.map(p=>{const m=i.has(p.id),u=Fw(o,p,Cs);return _.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/20",children:[_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[_.jsx("span",{className:"text-fg text-sm",children:p.name}),m&&_.jsx(ct,{tone:"accent",children:"active"}),_.jsxs("span",{className:"text-[10px] px-1 py-0 rounded border border-line bg-bg-elev text-fg-faint uppercase tracking-wide",children:["→ # ",p.section]}),!m&&u>0&&_.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 ",u]})]}),_.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:p.description}),_.jsxs("ul",{className:"text-fg-faint text-[11px] mt-1 space-y-0.5 list-disc list-inside",children:[p.bullets.slice(0,2).map((x,b)=>_.jsx("li",{className:"truncate",children:x},b)),p.bullets.length>2&&_.jsxs("li",{className:"text-fg-faint italic",children:["+",p.bullets.length-2," more"]})]})]}),_.jsx("div",{className:"flex gap-1 shrink-0",children:_.jsx("button",{disabled:d===p.id,onClick:()=>w(p),className:`px-3 py-0.5 text-xs rounded border transition-colors ${m?"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:m?"remove from CLAUDE.md":"add to CLAUDE.md",children:d===p.id?"…":m?"on":"off"})})]},p.id)})})]})}function pr({active:t,onChange:s,installedLabel:i="Installed",libraryLabel:o="Library"}){return _.jsx("div",{className:"flex rounded border border-line overflow-hidden",children:[["installed",i],["library",o]].map(([d,w])=>_.jsx("button",{onClick:()=>s(d),className:`px-2 py-0.5 text-xs ${t===d?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:w},d))})}function pi({query:t,onQueryChange:s,count:i,total:o}){return _.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:[_.jsx("span",{className:"text-fg-faint",children:i===o?`${o} available`:`${i} of ${o}`}),_.jsx("div",{className:"flex-1"}),_.jsx("input",{value:t,onChange:d=>s(d.target.value),placeholder:"filter…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-48"})]})}function ct({children:t,tone:s="default"}){const i={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"}[s];return _.jsx("span",{className:`text-[10px] px-1.5 py-0 rounded border uppercase tracking-wide ${i}`,children:t})}function Eu({href:t,children:s}){return _.jsx("a",{href:t,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:s})}function fg({text:t,label:s}){const[i,o]=W.useState(!1);return _.jsx("button",{onClick:()=>{navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),1500)},className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:i?"copied!":s})}function Jw(t){return Math.round(t.length/4)}function Yw(){const t=et(),s=Re(T=>T.tabs),i=Re(T=>T.activeTabId),o=s.find(T=>T.id===i)??null,d=(o==null?void 0:o.cwd)??null,[w,g]=W.useState("user"),[a,l]=W.useState("installed"),p=W.useMemo(()=>{const T={};for(const A of Sc.scopes){const I=Sc.resolve(A,t??"",d);I&&(T[A]=I)}return T},[t,d]),m=p[w]??null,u=xe(T=>T.files),x=xe(T=>T.loadText),b=xe(T=>T.setDraft),E=xe(T=>T.saveText),S=xe(T=>T.revert),c=xe(T=>T.watchFile),y=xe(T=>T.unwatchFile);W.useEffect(()=>{const T=Object.values(p).filter(Boolean);return T.forEach(A=>{u[A]||x(A),c(A)}),()=>{T.forEach(A=>y(A))}},[JSON.stringify(p)]);const[h,v]=W.useState(null);if(!t)return _.jsx(be,{title:"loading…"});if(a==="library")return _.jsx(je,{toolbar:_.jsx(pr,{active:a,onChange:l,installedLabel:"Editor",libraryLabel:"Presets"}),children:_.jsx(Gw,{})});const C=m?u[m]:null,R=T=>T!=="user"&&!d,L=C?Jw(C.draftRaw):0,D=(C==null?void 0:C.draftRaw.length)??0;return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx(pr,{active:a,onChange:l,installedLabel:"Editor",libraryLabel:"Presets"}),_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:Sc.scopes,active:w,onChange:g,annotate:T=>{if(R(T))return{exists:!1};const A=p[T];if(!A)return null;const I=u[A];return{exists:(I==null?void 0:I.exists)??!1,dirty:(I==null?void 0:I.dirty)??!1}}}),_.jsx("span",{className:"ml-3 text-fg-faint truncate",children:m??"—"}),_.jsx("div",{className:"flex-1"}),_.jsxs("span",{className:"text-fg-faint",children:[D.toLocaleString()," chars · ~",L.toLocaleString()," tokens"]})]}),footer:m&&C?_.jsx(is,{dirty:C.dirty,busy:C.busy,parseError:h,lastSavedAt:C.lastSavedAt,leading:C.exists?null:_.jsx("span",{children:"file will be created on save"}),onSave:async()=>{v(null);const T=await E(m);T.ok||v(T.error??"save failed")},onRevert:()=>{v(null),S(m)}}):null,children:R(w)?_.jsx(be,{title:"no active project",hint:"open a tab in a project directory to edit project or local CLAUDE.md"}):m&&C?_.jsx(Cu,{path:m,value:C.draftRaw,onChange:T=>{v(null),b(m,T)}}):_.jsx(be,{title:"resolving…"})})}const Qw=`{
|
|
113
|
+
"$schema": "https://json.schemastore.org/claude-code-keybindings.json",
|
|
114
|
+
"bindings": []
|
|
115
|
+
}
|
|
116
|
+
`;function Zw(){const t=et(),s=xe(x=>x.files),i=xe(x=>x.loadJson),o=xe(x=>x.setDraft),d=xe(x=>x.saveJson),w=xe(x=>x.revert),g=xe(x=>x.watchFile),a=xe(x=>x.unwatchFile),l=t?B0.resolve("user",t,null):null;W.useEffect(()=>{if(l)return s[l]||i(l),g(l),()=>a(l)},[l]);const[p,m]=W.useState(null);if(!t||!l)return _.jsx(be,{title:"loading…"});const u=s[l];return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"text-fg-faint truncate",children:l}),_.jsx("div",{className:"flex-1"}),_.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:u?_.jsx(is,{dirty:u.dirty,busy:u.busy,parseError:p||u.parseError,lastSavedAt:u.lastSavedAt,leading:u.exists?_.jsx("span",{children:"restart Claude Code to apply changes"}):_.jsx("span",{children:"file will be created on save"}),onSave:async()=>{m(null);const x=await d(l);x.ok||m(x.error??"save failed")},onRevert:()=>{m(null),w(l)}}):null,children:u?_.jsx(ng,{path:l,value:u.draftRaw===""&&!u.exists?Qw:u.draftRaw,onChange:x=>{m(null),o(l,x)}}):_.jsx(be,{title:"loading…"})})}function ns(){const t=Re(i=>i.tabs),s=Re(i=>i.activeTabId);return t.find(i=>i.id===s)??null}const eS=["allow","deny","ask"];function tS(t){if(t.trim()==="")return{perms:{},full:{},err:null};try{const s=JSON.parse(t);return{perms:s.permissions??{},full:s,err:null}}catch(s){return{perms:{},full:{},err:s.message}}}function rS(t,s){const i={...t,permissions:s};return JSON.stringify(i,null,2)+`
|
|
117
|
+
`}function sS(){const t=et(),s=ns(),i=(s==null?void 0:s.cwd)??null,[o,d]=W.useState("user"),[w,g]=W.useState("effective"),a=W.useMemo(()=>{const N={};for(const J of bc.scopes){const K=bc.resolve(J,t??"",i);K&&(N[J]=K)}return N},[t,i]),l=a[o]??null,p=xe(N=>N.files),m=xe(N=>N.loadJson),u=xe(N=>N.setDraft),x=xe(N=>N.saveJson),b=xe(N=>N.revert),E=xe(N=>N.watchFile),S=xe(N=>N.unwatchFile);W.useEffect(()=>{const N=Object.values(a).filter(Boolean);return N.forEach(J=>{p[J]||m(J),E(J)}),()=>N.forEach(J=>S(J))},[JSON.stringify(a)]);const[c,y]=W.useState(null),h=_.jsx(xu,{options:[{key:"effective",label:"Effective"},{key:"rules",label:"Rules"},{key:"presets",label:"Presets"}],active:w,onChange:g}),v=W.useMemo(()=>{const N=wu(bu(p,a));return Su(N,["permissions"])??{kind:"object",children:{}}},[p,a]),C=(N,J)=>{var F;const K=a[o];if(!K)return;y(null);const z=((F=p[K])==null?void 0:F.draftRaw)??"";let re={};if(z.trim())try{re=JSON.parse(z)}catch{re={}}const G=ga(re.permissions??{},N,J),j={...re,permissions:G};u(K,JSON.stringify(j,null,2)+`
|
|
118
|
+
`)};if(!t)return _.jsx(be,{title:"loading…"});if(w==="presets")return _.jsx(je,{toolbar:h,children:_.jsx(Kw,{})});const R=N=>N!=="user"&&!i,L=l?p[l]:null,{perms:D,full:T,err:A}=L?tS(L.draftRaw):{perms:{},full:{},err:null},I=N=>{l&&(y(null),u(l,rS(T,N)))},H=(N,J)=>{const K=J.trim();if(!K)return;const z=D[N]??[];z.includes(K)||I({...D,[N]:[...z,K]})},$=(N,J)=>{const K=D[N]??[];I({...D,[N]:K.filter((z,re)=>re!==J)})};return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[h,_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:bc.scopes,active:o,onChange:d,annotate:N=>{if(R(N))return{exists:!1};const J=a[N];if(!J)return null;const K=p[J];return{exists:(K==null?void 0:K.exists)??!1,dirty:(K==null?void 0:K.dirty)??!1}}}),_.jsx("span",{className:"ml-3 text-fg-faint truncate",children:l??"—"}),_.jsx("div",{className:"flex-1"}),_.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:l&&L?_.jsx(is,{dirty:L.dirty,busy:L.busy,parseError:c||A||L.parseError,lastSavedAt:L.lastSavedAt,onSave:async()=>{y(null);const N=await x(l);N.ok||y(N.error??"save failed")},onRevert:()=>{y(null),b(l)}}):null,children:R(o)?_.jsx(be,{title:"no active project",hint:"open a tab in a project directory to edit project or local permissions"}):w==="effective"?_.jsx(_u,{node:v,targetScope:o,onOverride:C,schema:ia().rootedAt(["permissions"]),rootLabel:"permissions"}):l&&L?_.jsxs("div",{className:"p-4 space-y-5 max-w-3xl",children:[_.jsx(iS,{value:D.defaultMode??"default",onChange:N=>I({...D,defaultMode:N})}),eS.map(N=>_.jsx(nS,{list:N,rules:D[N]??[],onAdd:J=>H(N,J),onRemove:J=>$(N,J)},N)),_.jsx(oS,{dirs:D.additionalDirectories??[],onChange:N=>I({...D,additionalDirectories:N})})]}):_.jsx(be,{title:"resolving…"})})}function iS({value:t,onChange:s}){const i=["default","acceptEdits","plan","bypassPermissions"];return _.jsxs("section",{children:[_.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Default Mode"}),_.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:i.map(o=>_.jsx("button",{onClick:()=>s(o),className:`px-2.5 py-1 text-xs transition-colors ${t===o?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:o},o))})]})}function nS({list:t,rules:s,onAdd:i,onRemove:o}){const[d,w]=W.useState(""),g=t==="allow"?"text-green-400":t==="deny"?"text-red-400":"text-yellow-400";return _.jsxs("section",{children:[_.jsx("h3",{className:`text-xs uppercase tracking-wider mb-2 ${g}`,children:t}),_.jsxs("div",{className:"flex gap-2 mb-2",children:[_.jsx("input",{value:d,onChange:a=>w(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(i(d),w(""))},placeholder:t==="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"}),_.jsx("button",{onClick:()=>{i(d),w("")},disabled:!d.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"})]}),s.length===0?_.jsx("div",{className:"text-fg-faint text-xs",children:"no rules"}):_.jsx("ul",{className:"space-y-0.5",children:s.map((a,l)=>_.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[_.jsx("span",{className:"flex-1 text-fg-dim truncate",children:a}),_.jsx("button",{onClick:()=>o(l),className:"text-fg-faint hover:text-red-400",title:"remove",children:"×"})]},`${l}-${a}`))})]})}function oS({dirs:t,onChange:s}){const[i,o]=W.useState("");return _.jsxs("section",{children:[_.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Additional Directories"}),_.jsx("div",{className:"flex gap-2 mb-2",children:_.jsx("input",{value:i,onChange:d=>o(d.target.value),onKeyDown:d=>{d.key==="Enter"&&i.trim()&&(s([...t,i.trim()]),o(""))},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"})}),_.jsx("ul",{className:"space-y-0.5",children:t.map((d,w)=>_.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[_.jsx("span",{className:"flex-1 text-fg-dim truncate",children:d}),_.jsx("button",{onClick:()=>s(t.filter((g,a)=>a!==w)),className:"text-fg-faint hover:text-red-400",children:"×"})]},`${w}-${d}`))})]})}function ya({sidebar:t,detail:s,sidebarWidth:i="18rem"}){return _.jsxs("div",{className:"h-full flex",children:[_.jsx("div",{className:"shrink-0 border-r border-line overflow-y-auto",style:{width:i},children:t}),_.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:s})]})}function aS(t,s){return{user:{skills:`${t}/.claude/skills`,commands:`${t}/.claude/commands`},project:s?{skills:`${s}/.claude/skills`,commands:`${s}/.claude/commands`}:null}}function lS(){const t=et(),s=ns(),i=(s==null?void 0:s.cwd)??null,[o,d]=W.useState("user"),[w,g]=W.useState([]),[a,l]=W.useState(null),[p,m]=W.useState("installed"),[u,x]=W.useState(""),b=W.useMemo(()=>t?aS(t,i):null,[t,i]);W.useEffect(()=>{if(!b)return;let A=!1;const I=o==="user"?b.user:b.project;if(!I){g([]);return}return(async()=>{var J;const H=[],$=await window.api.config.listDir(I.skills,{dirsOnly:!0});for(const K of $.entries)if((await window.api.config.readText(`${K.path}/SKILL.md`)).exists)H.push({kind:"skills",scope:o,name:K.name,path:`${K.path}/SKILL.md`,dir:K.path});else{const re=await window.api.config.listDir(K.path,{dirsOnly:!0});for(const G of re.entries)(await window.api.config.readText(`${G.path}/SKILL.md`)).exists&&H.push({kind:"skills",scope:o,name:G.name,path:`${G.path}/SKILL.md`,dir:G.path})}const N=await window.api.config.listDir(I.commands,{filesOnly:!0});for(const K of N.entries)K.name.endsWith(".md")&&H.push({kind:"commands",scope:o,name:K.name.replace(/\.md$/,""),path:K.path,dir:null});A||(H.sort((K,z)=>K.kind===z.kind?K.name.localeCompare(z.name):K.kind==="skills"?-1:1),g(H),H.find(K=>K.path===a)||l(((J=H[0])==null?void 0:J.path)??null))})(),()=>{A=!0}},[o,b]);const E=xe(A=>A.files),S=xe(A=>A.loadText),c=xe(A=>A.setDraft),y=xe(A=>A.saveText),h=xe(A=>A.revert),v=xe(A=>A.watchFile),C=xe(A=>A.unwatchFile);W.useEffect(()=>{if(a)return E[a]||S(a),v(a),()=>C(a)},[a]);const[R,L]=W.useState(null);if(!t)return _.jsx(be,{title:"loading…"});if(p==="library")return _.jsx(je,{toolbar:_.jsx(pr,{active:p,onChange:m,installedLabel:"Installed",libraryLabel:"Library"}),children:_.jsx(Uw,{})});if(o==="project"&&!i)return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx(pr,{active:p,onChange:m}),_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project"],active:o,onChange:d})]}),children:_.jsx(be,{title:"no active project",hint:"open a tab in a project directory to view project skills & commands"})});const D=w.find(A=>A.path===a)??null,T=a?E[a]:null;return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx(pr,{active:p,onChange:m}),_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project"],active:o,onChange:d}),_.jsxs("span",{className:"ml-3 text-fg-faint",children:[w.length," ",w.length===1?"item":"items"]}),_.jsx("div",{className:"flex-1"}),_.jsx("span",{className:"text-fg-faint truncate",children:(D==null?void 0:D.path)??""})]}),footer:a&&T?_.jsx(is,{dirty:T.dirty,busy:T.busy,parseError:R,lastSavedAt:T.lastSavedAt,onSave:async()=>{L(null);const A=await y(a);A.ok||L(A.error??"save failed")},onRevert:()=>{L(null),h(a)}}):null,children:_.jsx(ya,{sidebar:_.jsxs("div",{className:"py-1",children:[_.jsx("div",{className:"px-2 pb-1",children:_.jsx("input",{value:u,onChange:A=>x(A.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(A=>{const I=u.toLowerCase(),H=w.filter($=>$.kind===A&&(!I||$.name.toLowerCase().includes(I)));return _.jsxs("div",{className:"mb-3",children:[_.jsx("div",{className:"px-3 py-1 text-xs uppercase tracking-wider text-fg-faint",children:A==="skills"?"Skills":"Slash Commands"}),H.length===0?_.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"none"}):H.map($=>{var N;return _.jsxs("button",{onClick:()=>l($.path),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${a===$.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[_.jsxs("span",{className:"truncate",children:[$.kind==="commands"?"/":"",$.name]}),((N=E[$.path])==null?void 0:N.dirty)&&_.jsx("span",{className:"w-1 h-1 rounded-full bg-accent shrink-0 ml-2"})]},$.path)})]},A)})]}),detail:a&&T?_.jsx("div",{className:"h-full",children:_.jsx(Cu,{path:a,value:T.draftRaw,onChange:A=>{L(null),c(a,A)}})}):_.jsx(be,{title:w.length===0?"no skills or commands":"select an item"})})})}function Tu({columns:t,rows:s,getKey:i,onRowClick:o,activeKey:d,empty:w}){return s.length===0?_.jsx("div",{className:"p-6 text-fg-faint text-xs text-center",children:w??"no entries"}):_.jsxs("table",{className:"w-full text-xs",children:[_.jsx("thead",{className:"sticky top-0 bg-bg-elev text-fg-faint uppercase tracking-wider",children:_.jsx("tr",{className:"border-b border-line",children:t.map(g=>_.jsx("th",{className:`text-left font-normal px-3 py-1.5 ${g.className??""}`,style:g.width?{width:g.width}:void 0,children:g.header},g.key))})}),_.jsx("tbody",{children:s.map(g=>{const a=i(g),l=d===a;return _.jsx("tr",{onClick:()=>o==null?void 0:o(g),className:`border-b border-line/50 transition-colors ${o?"cursor-pointer":""} ${l?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg-hi/50"}`,children:t.map(p=>_.jsx("td",{className:`px-3 py-1 ${p.className??""}`,children:p.render(g)},p.key))},a)})})]})}function cS(){const t=et(),[s,i]=W.useState([]),[o,d]=W.useState(!0),[w,g]=W.useState(null),[a,l]=W.useState("installed");W.useEffect(()=>{if(!t)return;let m=!1;return(async()=>{d(!0);const u=await window.api.config.listDir(`${t}/.claude/plugins`,{dirsOnly:!0});if(m)return;const x=[];for(const b of u.entries){const E=await window.api.config.exists(`${b.path}/plugin.json`);x.push({name:b.name,path:b.path,mtimeMs:b.mtimeMs,hasManifest:E})}x.sort((b,E)=>b.name.localeCompare(E.name)),m||(i(x),d(!1))})(),()=>{m=!0}},[t]);const p=[{key:"name",header:"name",render:m=>m.name,width:"12rem"},{key:"manifest",header:"manifest",render:m=>m.hasManifest?"plugin.json":_.jsx("span",{className:"text-fg-faint",children:"—"}),width:"8rem"},{key:"path",header:"path",render:m=>_.jsx("span",{className:"font-mono text-fg-faint truncate",children:m.path})}];return a==="library"?_.jsx(je,{toolbar:_.jsx(pr,{active:a,onChange:l}),children:_.jsx(Ww,{})}):_.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx(pr,{active:a,onChange:l}),_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsxs("span",{className:"text-fg-faint",children:[s.length," plugins"]}),_.jsx("div",{className:"flex-1"}),_.jsx("span",{className:"text-fg-faint font-mono truncate",children:"~/.claude/plugins/"})]}),children:o?_.jsx(be,{title:"scanning plugins…"}):_.jsx(Tu,{columns:p,rows:s,getKey:m=>m.path,activeKey:w,onRowClick:m=>g(m.path),empty:_.jsxs(_.Fragment,{children:["no plugins installed",_.jsxs("div",{className:"mt-2 text-fg-faint",children:["drop a plugin into ",_.jsx("code",{children:"~/.claude/plugins/"})]})]})})})}function uS(t,s,i){return t==="user"?`${s}/.claude.json`:i?`${i}/.mcp.json`:null}function dS(t){if(t.trim()==="")return{full:{},servers:{},err:null};try{const s=JSON.parse(t),i=s.mcpServers??{};return{full:s,servers:i,err:null}}catch(s){return{full:{},servers:{},err:s.message}}}function hS(t,s){return JSON.stringify({...t,mcpServers:s},null,2)+`
|
|
119
|
+
`}function fS(){const t=et(),s=ns(),i=(s==null?void 0:s.cwd)??null,[o,d]=W.useState("user"),[w,g]=W.useState(null),[a,l]=W.useState("installed"),[p,m]=W.useState(""),u=W.useMemo(()=>t?uS(o,t,i):null,[t,o,i]),x=xe(z=>z.files),b=xe(z=>z.loadJson),E=xe(z=>z.setDraft),S=xe(z=>z.saveJson),c=xe(z=>z.revert),y=xe(z=>z.watchFile),h=xe(z=>z.unwatchFile);W.useEffect(()=>{if(u)return x[u]||b(u),y(u),()=>h(u)},[u]);const[v,C]=W.useState(null);if(!t)return _.jsx(be,{title:"loading…"});if(a==="library")return _.jsx(je,{toolbar:_.jsx(pr,{active:a,onChange:l}),children:_.jsx(Hw,{})});if(o==="project"&&!i)return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx(pr,{active:a,onChange:l}),_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project"],active:o,onChange:d})]}),children:_.jsx(be,{title:"no active project"})});if(!u)return _.jsx(be,{title:"loading…"});const R=x[u],{full:L,servers:D,err:T}=R?dS(R.draftRaw):{full:{},servers:{},err:null},A=Object.keys(D).sort(),I=w?D[w]:null,H=z=>{C(null),E(u,hS(L,z))},$=()=>{const z=`server-${Object.keys(D).length+1}`;H({...D,[z]:{type:"stdio",command:"",args:[]}}),g(z)},N=z=>{const re={...D};delete re[z],H(re),w===z&&g(null)},J=(z,re)=>{if(!re||re===z||D[re])return;const G={};for(const j of Object.keys(D))G[j===z?re:j]=D[j];H(G),g(re)},K=(z,re)=>{H({...D,[z]:re})};return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx(pr,{active:a,onChange:l}),_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project"],active:o,onChange:d}),_.jsx("span",{className:"ml-3 text-fg-faint truncate",children:u}),_.jsx("div",{className:"flex-1"}),_.jsx("button",{onClick:$,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:R?_.jsx(is,{dirty:R.dirty,busy:R.busy,parseError:v||T||R.parseError,lastSavedAt:R.lastSavedAt,onSave:async()=>{C(null);const z=await S(u);z.ok||C(z.error??"save failed")},onRevert:()=>{C(null),c(u)}}):null,children:_.jsx(ya,{sidebar:_.jsxs("div",{className:"py-2",children:[_.jsx("div",{className:"px-2 pb-1",children:_.jsx("input",{value:p,onChange:z=>m(z.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),A.length===0?_.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no servers"}):A.filter(z=>!p||z.toLowerCase().includes(p.toLowerCase())).map(z=>_.jsxs("button",{onClick:()=>g(z),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${w===z?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[_.jsx("span",{className:"truncate",children:z}),_.jsx("span",{className:"text-fg-faint ml-2 shrink-0",children:D[z].type??"stdio"})]},z))]}),detail:w&&I?_.jsx(pS,{name:w,server:I,onRename:z=>J(w,z),onChange:z=>K(w,z),onRemove:()=>N(w)}):_.jsx(be,{title:"select a server or click + new"})})})}function pS({name:t,server:s,onRename:i,onChange:o,onRemove:d}){const w=s.type??"stdio";return _.jsxs("div",{className:"p-4 space-y-4 max-w-2xl",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("label",{className:"text-xs text-fg-faint w-20",children:"name"}),_.jsx("input",{defaultValue:t,onBlur:g=>i(g.target.value.trim()),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"}),_.jsx("button",{onClick:d,className:"text-xs text-fg-faint hover:text-red-400 px-2 py-1 border border-line rounded",children:"delete"})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("label",{className:"text-xs text-fg-faint w-20",children:"type"}),_.jsxs("select",{value:w,onChange:g=>o({...s,type:g.target.value}),className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg",children:[_.jsx("option",{value:"stdio",children:"stdio"}),_.jsx("option",{value:"http",children:"http"}),_.jsx("option",{value:"sse",children:"sse"})]})]}),w==="stdio"?_.jsxs(_.Fragment,{children:[_.jsx(Pc,{label:"command",value:s.command??"",onChange:g=>o({...s,command:g}),placeholder:"npx / node / python …"}),_.jsx(Pc,{label:"args",value:(s.args??[]).join(" "),onChange:g=>o({...s,args:g.split(/\s+/).filter(Boolean)}),placeholder:"space-separated args"}),_.jsx(wp,{label:"env",value:s.env??{},onChange:g=>o({...s,env:g})})]}):_.jsxs(_.Fragment,{children:[_.jsx(Pc,{label:"url",value:s.url??"",onChange:g=>o({...s,url:g}),placeholder:"https://…"}),_.jsx(wp,{label:"headers",value:s.headers??{},onChange:g=>o({...s,headers:g})})]})]})}function Pc({label:t,value:s,onChange:i,placeholder:o}){return _.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("label",{className:"text-xs text-fg-faint w-20",children:t}),_.jsx("input",{value:s,onChange:d=>i(d.target.value),placeholder:o,className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"})]})}function wp({label:t,value:s,onChange:i}){const[o,d]=W.useState(""),[w,g]=W.useState(""),a=Object.entries(s);return _.jsxs("div",{className:"flex items-start gap-2",children:[_.jsx("label",{className:"text-xs text-fg-faint w-20 pt-1",children:t}),_.jsxs("div",{className:"flex-1 space-y-1",children:[a.map(([l,p])=>_.jsxs("div",{className:"flex gap-2",children:[_.jsx("input",{value:l,onChange:m=>{const u={...s};delete u[l],u[m.target.value]=p,i(u)},className:"w-32 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),_.jsx("input",{value:p,onChange:m=>i({...s,[l]:m.target.value}),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),_.jsx("button",{onClick:()=>{const m={...s};delete m[l],i(m)},className:"text-fg-faint hover:text-red-400 text-xs px-1",children:"×"})]},l)),_.jsxs("div",{className:"flex gap-2",children:[_.jsx("input",{value:o,onChange:l=>d(l.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"}),_.jsx("input",{value:w,onChange:l=>g(l.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"}),_.jsx("button",{onClick:()=>{o.trim()&&(i({...s,[o.trim()]:w}),d(""),g(""))},className:"px-2 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+"})]})]})]})}const mS=["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"],gS=["command","http","prompt","agent"];function vS(t){if(t.trim()==="")return{full:{},hooks:{},err:null};try{const s=JSON.parse(t);return{full:s,hooks:s.hooks??{},err:null}}catch(s){return{full:{},hooks:{},err:s.message}}}function yS(t,s){return JSON.stringify({...t,hooks:s},null,2)+`
|
|
120
|
+
`}function _S(t,s){return(t[s]??[]).reduce((i,o)=>{var d;return i+(((d=o.hooks)==null?void 0:d.length)??0)},0)}function xS(){const t=et(),s=ns(),i=(s==null?void 0:s.cwd)??null,[o,d]=W.useState("user"),[w,g]=W.useState("PreToolUse"),[a,l]=W.useState("effective"),p=W.useMemo(()=>{const z={};for(const re of ui.scopes){const G=ui.resolve(re,t??"",i);G&&(z[re]=G)}return z},[t,i]),m=p[o]??null,u=xe(z=>z.files),x=xe(z=>z.loadJson),b=xe(z=>z.setDraft),E=xe(z=>z.saveJson),S=xe(z=>z.revert),c=xe(z=>z.watchFile),y=xe(z=>z.unwatchFile);W.useEffect(()=>{const z=Object.values(p).filter(Boolean);return z.forEach(re=>{u[re]||x(re),c(re)}),()=>z.forEach(re=>y(re))},[JSON.stringify(p)]);const[h,v]=W.useState(null),C=_.jsx(xu,{options:[{key:"effective",label:"Effective"},{key:"events",label:"Events"},{key:"library",label:"Library"}],active:a,onChange:l}),R=W.useMemo(()=>{const z=wu(bu(u,p));return Su(z,["hooks"])??{kind:"object",children:{}}},[u,p]),L=(z,re)=>{var ee;const G=p[o];if(!G)return;v(null);const j=((ee=u[G])==null?void 0:ee.draftRaw)??"";let F={};if(j.trim())try{F=JSON.parse(j)}catch{F={}}const M=ga(F.hooks??{},z,re),U={...F,hooks:M};b(G,JSON.stringify(U,null,2)+`
|
|
121
|
+
`)};if(!t)return _.jsx(be,{title:"loading…"});if(a==="library")return _.jsx(je,{toolbar:C,children:_.jsx($w,{})});if(o!=="user"&&!i)return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[C,_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project","local"],active:o,onChange:d})]}),children:_.jsx(be,{title:"no active project"})});if(!m)return _.jsx(be,{title:"loading…"});const D=u[m],{full:T,hooks:A,err:I}=D?vS(D.draftRaw):{full:{},hooks:{},err:null},H=z=>{v(null),b(m,yS(T,z))},$=A[w]??[],N=()=>{H({...A,[w]:[...$,{matcher:"",hooks:[{type:"command",command:""}]}]})},J=(z,re)=>{const G=$.slice();G[z]=re,H({...A,[w]:G})},K=z=>{H({...A,[w]:$.filter((re,G)=>G!==z)})};return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[C,_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project","local"],active:o,onChange:d}),_.jsx("span",{className:"ml-3 text-fg-faint truncate",children:a==="effective"?`overrides → ${m}`:m}),_.jsx("div",{className:"flex-1"}),_.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:D?_.jsx(is,{dirty:D.dirty,busy:D.busy,parseError:h||I||D.parseError,lastSavedAt:D.lastSavedAt,onSave:async()=>{v(null);const z=await E(m);z.ok||v(z.error??"save failed")},onRevert:()=>{v(null),S(m)}}):null,children:a==="effective"?_.jsx(_u,{node:R,targetScope:o,onOverride:L,schema:ia().rootedAt(["hooks"]),rootLabel:"hooks"}):_.jsx(ya,{sidebarWidth:"14rem",sidebar:_.jsx("div",{className:"py-1",children:mS.map(z=>{const re=_S(A,z);return _.jsxs("button",{onClick:()=>g(z),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${w===z?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[_.jsx("span",{className:"truncate",children:z}),re>0&&_.jsx("span",{className:"text-accent shrink-0 ml-2",children:re})]},z)})}),detail:_.jsxs("div",{className:"p-4 space-y-3 max-w-3xl",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg",children:w}),_.jsx("button",{onClick:N,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"})]}),$.length===0?_.jsx("div",{className:"text-fg-faint text-xs",children:"no hooks for this event"}):$.map((z,re)=>_.jsx(wS,{group:z,onChange:G=>J(re,G),onRemove:()=>K(re)},re))]})})})}function wS({group:t,onChange:s,onRemove:i}){const o=()=>s({...t,hooks:[...t.hooks??[],{type:"command",command:""}]}),d=(g,a)=>{const l=t.hooks.slice();l[g]=a,s({...t,hooks:l})},w=g=>s({...t,hooks:t.hooks.filter((a,l)=>l!==g)});return _.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev space-y-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-xs text-fg-faint w-16",children:"matcher"}),_.jsx("input",{value:t.matcher??"",onChange:g=>s({...t,matcher:g.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"}),_.jsx("button",{onClick:i,className:"text-fg-faint hover:text-red-400 text-xs",title:"remove group",children:"× group"})]}),(t.hooks??[]).map((g,a)=>_.jsx(SS,{rule:g,onChange:l=>d(a,l),onRemove:()=>w(a)},a)),_.jsx("button",{onClick:o,className:"text-xs text-fg-faint hover:text-fg",children:"+ add hook"})]})}function SS({rule:t,onChange:s,onRemove:i}){const o=g=>({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"})[g],d=t.type==="command"?"command":t.type==="http"?"url":t.type==="prompt"?"prompt":"agent",w=t[d]??"";return _.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("select",{value:t.type,onChange:g=>s({type:g.target.value}),className:"bg-bg border border-line rounded px-1 py-0.5 text-xs text-fg",children:gS.map(g=>_.jsx("option",{value:g,children:g},g))}),_.jsx("input",{value:w,onChange:g=>s({...t,[d]:g.target.value}),placeholder:o(t.type),className:`flex-1 bg-bg border rounded px-2 py-0.5 text-xs text-fg font-mono ${w.trim()?"border-line":"border-yellow-600/50"}`}),_.jsx("input",{value:t.timeout??"",onChange:g=>s({...t,timeout:g.target.value?Number(g.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"}),_.jsx("button",{onClick:i,className:"text-fg-faint hover:text-red-400 text-xs",children:"×"})]})}function bS(t,s,i){return{tabId:t,sessionUuid:i,cwd:s,path:null,todos:[],lastToolUses:[],plans:[],agents:[],usage:{inputTokens:0,outputTokens:0},lastEventAt:0}}const xt=pa((t,s)=>({tabs:{},refs:{},unsubs:{},subscribe:(i,o,d)=>{const w={...s().refs};if(w[i]=(w[i]??0)+1,t({refs:w}),w[i]>1)return;t({tabs:{...s().tabs,[i]:bS(i,o,d)}});const g=window.api.transcripts.onEvent(i,a=>s().ingest(i,a));t({unsubs:{...s().unsubs,[i]:g}}),window.api.transcripts.subscribe({tabId:i,cwd:o,sessionUuid:d}).then(async a=>{const l=s().tabs[i];if(!l)return;t({tabs:{...s().tabs,[i]:{...l,path:a.path}}});const p=await window.api.transcripts.buffer(i);for(const m of p)s().ingest(i,m)}).catch(a=>console.error("[live] transcripts.subscribe failed:",i,a))},unsubscribe:i=>{const o={...s().refs};if(!o[i])return;if(o[i]--,o[i]>0){t({refs:o});return}delete o[i];const d=s().unsubs[i];d==null||d();const w={...s().unsubs};delete w[i];const g={...s().tabs};delete g[i],window.api.transcripts.unsubscribe(i),t({refs:o,unsubs:w,tabs:g})},ingest:(i,o)=>{const d=s().tabs[i];if(!d)return;const w={...d,lastEventAt:Date.now()};switch(o.kind){case"todo_write":{const g=Array.isArray(o.data)?o.data:[];w.todos=g;break}case"tool_use":{const g=o.data;w.lastToolUses=[{id:g.id,name:g.name,input:g.input,at:Date.now()},...d.lastToolUses].slice(0,50);break}case"plan":{const g=o.data,a=typeof g=="string"?g:(g==null?void 0:g.plan)??JSON.stringify(g);w.plans=[{at:Date.now(),content:a??""},...d.plans].slice(0,20);break}case"agent_spawn":{const g=o.data;w.agents=[{at:Date.now(),subagentType:g==null?void 0:g.subagent_type,description:g==null?void 0:g.description},...d.agents].slice(0,50);break}case"usage":{const g=o.data;w.usage={inputTokens:(d.usage.inputTokens||0)+(g.input_tokens??g.inputTokens??0),outputTokens:(d.usage.outputTokens||0)+(g.output_tokens??g.outputTokens??0),cacheCreationInputTokens:(d.usage.cacheCreationInputTokens||0)+(g.cache_creation_input_tokens??g.cacheCreationInputTokens??0),cacheReadInputTokens:(d.usage.cacheReadInputTokens||0)+(g.cache_read_input_tokens??g.cacheReadInputTokens??0)};break}default:return}t({tabs:{...s().tabs,[i]:w}})}}));function CS(t,s,i){return i==="user"?`${t}/.claude/agents`:s?`${s}/.claude/agents`:null}function kS(){const t=et(),s=ns(),i=(s==null?void 0:s.cwd)??null,[o,d]=W.useState("user"),[w,g]=W.useState([]),[a,l]=W.useState(null),[p,m]=W.useState("configured"),[u,x]=W.useState(""),b=W.useMemo(()=>t?CS(t,i,o):null,[t,i,o]);W.useEffect(()=>{if(!b){g([]);return}let H=!1;return(async()=>{var $;try{const N=await window.api.config.listDir(b,{filesOnly:!0});if(H)return;const J=N.entries.filter(K=>K.name.endsWith(".md")).map(K=>({scope:o,name:K.name.replace(/\.md$/,""),path:K.path})).sort((K,z)=>K.name.localeCompare(z.name));g(J),J.find(K=>K.path===a)||l((($=J[0])==null?void 0:$.path)??null)}catch(N){console.error("[Subagents] listDir failed:",b,N),H||g([])}})(),()=>{H=!0}},[b]);const E=xe(H=>H.files),S=xe(H=>H.loadText),c=xe(H=>H.setDraft),y=xe(H=>H.saveText),h=xe(H=>H.revert),v=xe(H=>H.watchFile),C=xe(H=>H.unwatchFile);W.useEffect(()=>{if(a)return E[a]||S(a),v(a),()=>C(a)},[a]);const R=xt(H=>H.subscribe),L=xt(H=>H.unsubscribe),D=xt(H=>H.tabs);W.useEffect(()=>{if(!(p!=="live"||!s))return R(s.id,s.cwd,s.claudeSessionId),()=>L(s.id)},[p,s,R,L]);const[T,A]=W.useState(null);if(!t)return _.jsx(be,{title:"loading…"});const I=a?E[a]:null;return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:["configured","live","library"].map(H=>_.jsx("button",{onClick:()=>m(H),className:`px-2.5 py-1 text-xs ${p===H?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:H},H))}),p==="configured"&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"ml-2",children:_.jsx(gr,{scopes:["user","project"],active:o,onChange:d})}),_.jsxs("span",{className:"ml-3 text-fg-faint",children:[w.length," agents"]})]}),_.jsx("div",{className:"flex-1"})]}),footer:p==="configured"&&a&&I?_.jsx(is,{dirty:I.dirty,busy:I.busy,parseError:T,lastSavedAt:I.lastSavedAt,onSave:async()=>{A(null);const H=await y(a);H.ok||A(H.error??"save failed")},onRevert:()=>{A(null),h(a)}}):null,children:p==="library"?_.jsx(zw,{}):p==="configured"?o==="project"&&!i?_.jsx(be,{title:"no active project"}):_.jsx(ya,{sidebar:_.jsxs("div",{className:"py-2",children:[_.jsx("div",{className:"px-2 pb-1",children:_.jsx("input",{value:u,onChange:H=>x(H.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),w.length===0?_.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no agents defined"}):w.filter(H=>!u||H.name.toLowerCase().includes(u.toLowerCase())).map(H=>_.jsx("button",{onClick:()=>l(H.path),className:`w-full text-left px-3 py-1 text-xs ${a===H.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:H.name},H.path))]}),detail:a&&I?_.jsx(Cu,{path:a,value:I.draftRaw,onChange:H=>{A(null),c(a,H)}}):_.jsx(be,{title:"select an agent"})}):s?_.jsx(ES,{tabId:s.id,live:D[s.id]}):_.jsx(be,{title:"no active session",hint:"open a terminal tab to watch live subagents"})})}function ES({tabId:t,live:s}){return s?s.agents.length===0?_.jsx(be,{title:"no subagent spawns observed yet",hint:"this updates in real-time"}):_.jsx("div",{className:"p-4 space-y-2 max-w-3xl",children:s.agents.map((i,o)=>_.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[_.jsxs("div",{className:"flex items-center justify-between mb-1",children:[_.jsx("span",{className:"text-xs font-medium text-fg",children:i.subagentType??"general-purpose"}),_.jsx("span",{className:"text-xs text-fg-faint",children:new Date(i.at).toLocaleTimeString()})]}),i.description&&_.jsx("div",{className:"text-xs text-fg-dim",children:i.description})]},o))}):_.jsx(be,{title:`waiting for transcript (tab ${t.slice(0,8)})`})}function TS(){const t=ns(),s=xt(w=>w.subscribe),i=xt(w=>w.unsubscribe),o=xt(w=>t?w.tabs[t.id]:void 0);if(W.useEffect(()=>{if(t)return s(t.id,t.cwd,t.claudeSessionId),()=>i(t.id)},[t,s,i]),!t)return _.jsx(je,{children:_.jsx(be,{title:"no active session"})});const d=(o==null?void 0:o.plans)??[];return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-fg-faint",children:["session ",t.claudeSessionId.slice(0,8)]}),_.jsx("div",{className:"flex-1"}),_.jsxs("span",{className:"text-fg-faint",children:[d.length," plans"]})]}),children:d.length===0?_.jsx(be,{title:"no plans captured",hint:"plans appear when claude uses ExitPlanMode"}):_.jsx("div",{className:"p-4 space-y-4 max-w-4xl",children:d.map((w,g)=>_.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[_.jsx("div",{className:"text-xs text-fg-faint mb-2",children:new Date(w.at).toLocaleString()}),_.jsx("pre",{className:"text-xs text-fg-dim whitespace-pre-wrap font-mono",children:w.content})]},g))})})}function RS(){const t=ns(),s=xt(g=>g.subscribe),i=xt(g=>g.unsubscribe),o=xt(g=>t?g.tabs[t.id]:void 0);if(W.useEffect(()=>{if(t)return s(t.id,t.cwd,t.claudeSessionId),()=>i(t.id)},[t,s,i]),!t)return _.jsx(je,{children:_.jsx(be,{title:"no active session",hint:"open a terminal tab and run claude to see tasks"})});const d=(o==null?void 0:o.todos)??[],w={completed:d.filter(g=>g.status==="completed").length,in_progress:d.filter(g=>g.status==="in_progress").length,pending:d.filter(g=>g.status==="pending").length};return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-fg-faint",children:["session ",t.claudeSessionId.slice(0,8)]}),_.jsx("div",{className:"flex-1"}),_.jsxs("span",{className:"text-fg-faint",children:[_.jsx("span",{className:"text-green-400",children:w.completed})," done ·"," ",_.jsx("span",{className:"text-accent",children:w.in_progress})," active ·"," ",_.jsx("span",{className:"text-fg-dim",children:w.pending})," pending"]})]}),children:d.length===0?_.jsx(be,{title:"no todos yet",hint:"todos appear when claude calls TodoWrite"}):_.jsx("ul",{className:"p-4 space-y-1 max-w-3xl",children:d.map((g,a)=>_.jsxs("li",{className:`flex items-start gap-3 py-1.5 px-2 rounded text-xs ${g.status==="in_progress"?"bg-bg-elev":""}`,children:[_.jsx(PS,{status:g.status}),_.jsx("span",{className:`flex-1 ${g.status==="completed"?"text-fg-faint line-through":g.status==="in_progress"?"text-fg":"text-fg-dim"}`,children:g.status==="in_progress"&&g.activeForm?g.activeForm:g.content})]},a))})})}function PS({status:t}){return t==="completed"?_.jsx("span",{className:"text-green-400 w-4 shrink-0",children:"✓"}):t==="in_progress"?_.jsx("span",{className:"text-accent w-4 shrink-0",children:_.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-accent animate-pulse"})}):_.jsx("span",{className:"text-fg-faint w-4 shrink-0",children:"○"})}function LS(t){return t.replace(/-/g,"/")}async function DS(t){const i=(await window.api.config.listDir(t,{filesOnly:!0})).entries.filter(o=>o.name.endsWith(".jsonl")).sort((o,d)=>o.size-d.size);for(const o of i){const d=await window.api.config.readText(o.path);if(!(!d.exists||!d.text)){for(const w of d.text.split(`
|
|
122
|
+
`))if(w.includes('"cwd"'))try{const g=JSON.parse(w);if(typeof g.cwd=="string"&&g.cwd.length>0)return g.cwd}catch{}}}return null}function AS(){const t=et(),[s,i]=W.useState([]),[o,d]=W.useState(!0),w=Re(l=>l.addTab);W.useEffect(()=>{if(!t)return;let l=!1;return(async()=>{d(!0);try{const p=await window.api.config.listDir(`${t}/.claude/projects`,{dirsOnly:!0});if(l)return;const m=[];for(const u of p.entries){if(l)return;const b=(await window.api.config.listDir(u.path,{filesOnly:!0})).entries.filter(S=>S.name.endsWith(".jsonl")),E=b.reduce((S,c)=>Math.max(S,c.mtimeMs),0);m.push({encoded:u.name,displayPath:LS(u.name),sessionCount:b.length,lastSession:E,path:u.path})}m.sort((u,x)=>x.lastSession-u.lastSession),l||i(m)}catch(p){console.error("[Projects] scan failed:",p)}finally{l||d(!1)}})(),()=>{l=!0}},[t]);const g=async l=>{let p=await DS(l.path);if(!p&&(p=await window.api.app.pickDirectory(),!p))return;const m=crypto.randomUUID();w({id:m,cwd:p,startupCommand:`claude --dangerously-skip-permissions --session-id ${ir(m)}`,presetId:"projects-tab"})},a=[{key:"path",header:"project",render:l=>_.jsxs("span",{className:"font-mono text-fg-dim truncate",children:["/",l.displayPath]})},{key:"count",header:"sessions",render:l=>l.sessionCount,width:"6rem"},{key:"last",header:"last active",render:l=>l.lastSession?new Date(l.lastSession).toLocaleString():"—",width:"12rem"},{key:"action",header:"",render:l=>_.jsx("button",{onClick:p=>{p.stopPropagation(),g(l)},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 _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-fg-faint",children:[s.length," projects"]}),_.jsx("div",{className:"flex-1"}),_.jsx("span",{className:"text-fg-faint font-mono truncate",children:"~/.claude/projects/"})]}),children:o?_.jsx(be,{title:"scanning projects…"}):_.jsx(Tu,{columns:a,rows:s,getKey:l=>l.encoded,empty:"no projects with claude session history"})})}function jS(){const t=et(),[s,i]=W.useState([]),[o,d]=W.useState(!0),[w,g]=W.useState(""),a=Re(u=>u.addTab);W.useEffect(()=>{if(!t)return;let u=!1;return(async()=>{d(!0);try{const x=await window.api.config.listDir(`${t}/.claude/projects`,{dirsOnly:!0}),b=[];for(const E of x.entries){if(u)return;const S=await window.api.config.listDir(E.path,{filesOnly:!0});for(const c of S.entries)c.name.endsWith(".jsonl")&&b.push({sessionId:c.name.replace(/\.jsonl$/,""),projectEncoded:E.name,path:c.path,mtimeMs:c.mtimeMs,sizeBytes:c.size})}b.sort((E,S)=>S.mtimeMs-E.mtimeMs),u||i(b)}catch(x){console.error("[History] scan failed:",x)}finally{u||d(!1)}})(),()=>{u=!0}},[t]);const l=W.useMemo(()=>{if(!w.trim())return s;const u=w.toLowerCase();return s.filter(x=>x.sessionId.toLowerCase().includes(u)||x.projectEncoded.toLowerCase().includes(u))},[s,w]),p=async u=>{const x=await window.api.app.pickDirectory();x&&a({cwd:x,startupCommand:`claude --resume ${ir(u.sessionId)}`,presetId:"history-resume"})},m=[{key:"id",header:"session",render:u=>_.jsx("span",{className:"font-mono text-fg-dim",children:u.sessionId.slice(0,8)}),width:"7rem"},{key:"proj",header:"project",render:u=>_.jsxs("span",{className:"font-mono text-fg-faint truncate",children:["/",u.projectEncoded.replace(/-/g,"/")]})},{key:"size",header:"size",render:u=>`${Math.round(u.sizeBytes/1024)}k`,width:"5rem"},{key:"when",header:"when",render:u=>new Date(u.mtimeMs).toLocaleString(),width:"12rem"},{key:"action",header:"",render:u=>_.jsx("button",{onClick:x=>{x.stopPropagation(),p(u)},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 _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx("input",{value:w,onChange:u=>g(u.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"}),_.jsxs("span",{className:"ml-2 text-fg-faint",children:[l.length,"/",s.length]}),_.jsx("div",{className:"flex-1"})]}),children:o?_.jsx(be,{title:"scanning transcripts…"}):_.jsx(Tu,{columns:m,rows:l,getKey:u=>u.path,empty:"no session transcripts found"})})}const Sp={"opus-4.6":{input:5,output:25},"sonnet-4.6":{input:3,output:15},"haiku-4.5":{input:1,output:5}};function MS(){const t=ns(),s=xt(x=>x.subscribe),i=xt(x=>x.unsubscribe),o=xt(x=>t?x.tabs[t.id]:void 0),[d,w]=W.useState("opus-4.6"),[g,a]=W.useState(()=>{try{const x=localStorage.getItem("sm:pricing");if(x)return{...Sp,...JSON.parse(x)}}catch{}return Sp}),l=x=>{a(x);try{localStorage.setItem("sm:pricing",JSON.stringify(x))}catch{}};if(W.useEffect(()=>{if(t)return s(t.id,t.cwd,t.claudeSessionId),()=>i(t.id)},[t,s,i]),!t)return _.jsx(je,{children:_.jsx(be,{title:"no active session"})});const p=(o==null?void 0:o.usage)??{inputTokens:0,outputTokens:0},m=g[d],u=p.inputTokens*m.input/1e6+p.outputTokens*m.output/1e6;return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-fg-faint",children:["session ",t.claudeSessionId.slice(0,8)]}),_.jsx("div",{className:"flex-1"}),_.jsxs("label",{className:"text-fg-faint flex items-center gap-2",children:["model",_.jsx("select",{value:d,onChange:x=>w(x.target.value),className:"bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg",children:Object.keys(g).map(x=>_.jsx("option",{value:x,children:x},x))})]})]}),children:_.jsxs("div",{className:"p-6 max-w-2xl space-y-6",children:[_.jsxs("section",{className:"grid grid-cols-2 gap-4",children:[_.jsx(rn,{label:"input tokens",value:p.inputTokens.toLocaleString()}),_.jsx(rn,{label:"output tokens",value:p.outputTokens.toLocaleString()}),p.cacheCreationInputTokens!=null&&_.jsx(rn,{label:"cache creation",value:p.cacheCreationInputTokens.toLocaleString()}),p.cacheReadInputTokens!=null&&_.jsx(rn,{label:"cache read",value:p.cacheReadInputTokens.toLocaleString()}),_.jsx(rn,{label:"estimated cost",value:`$${u.toFixed(4)}`,highlight:!0})]}),_.jsxs("section",{children:[_.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg mb-2",children:"Pricing ($/MTok)"}),_.jsxs("table",{className:"text-xs",children:[_.jsx("thead",{className:"text-fg-faint",children:_.jsxs("tr",{children:[_.jsx("th",{className:"text-left px-2 py-1",children:"model"}),_.jsx("th",{className:"text-left px-2 py-1",children:"input"}),_.jsx("th",{className:"text-left px-2 py-1",children:"output"})]})}),_.jsx("tbody",{children:Object.entries(g).map(([x,b])=>_.jsxs("tr",{className:"border-t border-line",children:[_.jsx("td",{className:"px-2 py-1 text-fg-dim",children:x}),_.jsx("td",{className:"px-2 py-1",children:_.jsx("input",{type:"number",step:"0.1",value:b.input,onChange:E=>l({...g,[x]:{...b,input:Number(E.target.value)}}),className:"w-16 bg-bg-elev border border-line rounded px-1 py-0.5 text-fg"})}),_.jsx("td",{className:"px-2 py-1",children:_.jsx("input",{type:"number",step:"0.1",value:b.output,onChange:E=>l({...g,[x]:{...b,output:Number(E.target.value)}}),className:"w-16 bg-bg-elev border border-line rounded px-1 py-0.5 text-fg"})})]},x))})]}),_.jsx("div",{className:"mt-2 text-fg-faint text-xs",children:"edits are saved locally and persist across sessions."})]})]})})}function rn({label:t,value:s,highlight:i}){return _.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[_.jsx("div",{className:"text-xs text-fg-faint uppercase tracking-wider mb-1",children:t}),_.jsx("div",{className:`text-lg font-mono ${i?"text-accent":"text-fg"}`,children:s})]})}const Ru=W.createContext({});function Pu(t){const s=W.useRef(null);return s.current===null&&(s.current=t()),s.current}const OS=typeof window<"u",pg=OS?W.useLayoutEffect:W.useEffect,_a=W.createContext(null);function Lu(t,s){t.indexOf(s)===-1&&t.push(s)}function na(t,s){const i=t.indexOf(s);i>-1&&t.splice(i,1)}const vr=(t,s,i)=>i>s?s:i<t?t:i;let Du=()=>{};const rs={},mg=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function gg(t){return typeof t=="object"&&t!==null}const vg=t=>/^0[^.\s]+$/u.test(t);function yg(t){let s;return()=>(s===void 0&&(s=t()),s)}const Kt=t=>t,IS=(t,s)=>i=>s(t(i)),xn=(...t)=>t.reduce(IS),mn=(t,s,i)=>{const o=s-t;return o===0?1:(i-t)/o};class Au{constructor(){this.subscriptions=[]}add(s){return Lu(this.subscriptions,s),()=>na(this.subscriptions,s)}notify(s,i,o){const d=this.subscriptions.length;if(d)if(d===1)this.subscriptions[0](s,i,o);else for(let w=0;w<d;w++){const g=this.subscriptions[w];g&&g(s,i,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const It=t=>t*1e3,zt=t=>t/1e3;function _g(t,s){return s?t*(1e3/s):0}const xg=(t,s,i)=>(((1-3*i+3*s)*t+(3*i-6*s))*t+3*s)*t,NS=1e-7,BS=12;function FS(t,s,i,o,d){let w,g,a=0;do g=s+(i-s)/2,w=xg(g,o,d)-t,w>0?i=g:s=g;while(Math.abs(w)>NS&&++a<BS);return g}function wn(t,s,i,o){if(t===s&&i===o)return Kt;const d=w=>FS(w,0,1,t,i);return w=>w===0||w===1?w:xg(d(w),s,o)}const wg=t=>s=>s<=.5?t(2*s)/2:(2-t(2*(1-s)))/2,Sg=t=>s=>1-t(1-s),bg=wn(.33,1.53,.69,.99),ju=Sg(bg),Cg=wg(ju),kg=t=>t>=1?1:(t*=2)<1?.5*ju(t):.5*(2-Math.pow(2,-10*(t-1))),Mu=t=>1-Math.sin(Math.acos(t)),Eg=Sg(Mu),Tg=wg(Mu),HS=wn(.42,0,1,1),US=wn(0,0,.58,1),Rg=wn(.42,0,.58,1),WS=t=>Array.isArray(t)&&typeof t[0]!="number",Pg=t=>Array.isArray(t)&&typeof t[0]=="number",VS={linear:Kt,easeIn:HS,easeInOut:Rg,easeOut:US,circIn:Mu,circInOut:Tg,circOut:Eg,backIn:ju,backInOut:Cg,backOut:bg,anticipate:kg},$S=t=>typeof t=="string",bp=t=>{if(Pg(t)){Du(t.length===4);const[s,i,o,d]=t;return wn(s,i,o,d)}else if($S(t))return VS[t];return t},Fo=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function zS(t,s){let i=new Set,o=new Set,d=!1,w=!1;const g=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(m){g.has(m)&&(p.schedule(m),t()),m(a)}const p={schedule:(m,u=!1,x=!1)=>{const E=x&&d?i:o;return u&&g.add(m),E.add(m),m},cancel:m=>{o.delete(m),g.delete(m)},process:m=>{if(a=m,d){w=!0;return}d=!0;const u=i;i=o,o=u,i.forEach(l),i.clear(),d=!1,w&&(w=!1,p.process(m))}};return p}const KS=40;function Lg(t,s){let i=!1,o=!0;const d={delta:0,timestamp:0,isProcessing:!1},w=()=>i=!0,g=Fo.reduce((v,C)=>(v[C]=zS(w),v),{}),{setup:a,read:l,resolveKeyframes:p,preUpdate:m,update:u,preRender:x,render:b,postRender:E}=g,S=()=>{const v=rs.useManualTiming,C=v?d.timestamp:performance.now();i=!1,v||(d.delta=o?1e3/60:Math.max(Math.min(C-d.timestamp,KS),1)),d.timestamp=C,d.isProcessing=!0,a.process(d),l.process(d),p.process(d),m.process(d),u.process(d),x.process(d),b.process(d),E.process(d),d.isProcessing=!1,i&&s&&(o=!1,t(S))},c=()=>{i=!0,o=!0,d.isProcessing||t(S)};return{schedule:Fo.reduce((v,C)=>{const R=g[C];return v[C]=(L,D=!1,T=!1)=>(i||c(),R.schedule(L,D,T)),v},{}),cancel:v=>{for(let C=0;C<Fo.length;C++)g[Fo[C]].cancel(v)},state:d,steps:g}}const{schedule:Ae,cancel:ss,state:at,steps:Lc}=Lg(typeof requestAnimationFrame<"u"?requestAnimationFrame:Kt,!0);let Ko;function qS(){Ko=void 0}const yt={now:()=>(Ko===void 0&&yt.set(at.isProcessing||rs.useManualTiming?at.timestamp:performance.now()),Ko),set:t=>{Ko=t,queueMicrotask(qS)}},Dg=t=>s=>typeof s=="string"&&s.startsWith(t),Ag=Dg("--"),GS=Dg("var(--"),Ou=t=>GS(t)?XS.test(t.split("/*")[0].trim()):!1,XS=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Cp(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const mi={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},gn={...mi,transform:t=>vr(0,1,t)},Ho={...mi,default:1},cn=t=>Math.round(t*1e5)/1e5,Iu=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function JS(t){return t==null}const YS=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Nu=(t,s)=>i=>!!(typeof i=="string"&&YS.test(i)&&i.startsWith(t)||s&&!JS(i)&&Object.prototype.hasOwnProperty.call(i,s)),jg=(t,s,i)=>o=>{if(typeof o!="string")return o;const[d,w,g,a]=o.match(Iu);return{[t]:parseFloat(d),[s]:parseFloat(w),[i]:parseFloat(g),alpha:a!==void 0?parseFloat(a):1}},QS=t=>vr(0,255,t),Dc={...mi,transform:t=>Math.round(QS(t))},Ts={test:Nu("rgb","red"),parse:jg("red","green","blue"),transform:({red:t,green:s,blue:i,alpha:o=1})=>"rgba("+Dc.transform(t)+", "+Dc.transform(s)+", "+Dc.transform(i)+", "+cn(gn.transform(o))+")"};function ZS(t){let s="",i="",o="",d="";return t.length>5?(s=t.substring(1,3),i=t.substring(3,5),o=t.substring(5,7),d=t.substring(7,9)):(s=t.substring(1,2),i=t.substring(2,3),o=t.substring(3,4),d=t.substring(4,5),s+=s,i+=i,o+=o,d+=d),{red:parseInt(s,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:d?parseInt(d,16)/255:1}}const Gc={test:Nu("#"),parse:ZS,transform:Ts.transform},Sn=t=>({test:s=>typeof s=="string"&&s.endsWith(t)&&s.split(" ").length===1,parse:parseFloat,transform:s=>`${s}${t}`}),Qr=Sn("deg"),mr=Sn("%"),ve=Sn("px"),eb=Sn("vh"),tb=Sn("vw"),kp={...mr,parse:t=>mr.parse(t)/100,transform:t=>mr.transform(t*100)},oi={test:Nu("hsl","hue"),parse:jg("hue","saturation","lightness"),transform:({hue:t,saturation:s,lightness:i,alpha:o=1})=>"hsla("+Math.round(t)+", "+mr.transform(cn(s))+", "+mr.transform(cn(i))+", "+cn(gn.transform(o))+")"},Je={test:t=>Ts.test(t)||Gc.test(t)||oi.test(t),parse:t=>Ts.test(t)?Ts.parse(t):oi.test(t)?oi.parse(t):Gc.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ts.transform(t):oi.transform(t),getAnimatableNone:t=>{const s=Je.parse(t);return s.alpha=0,Je.transform(s)}},rb=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sb(t){var s,i;return isNaN(t)&&typeof t=="string"&&(((s=t.match(Iu))==null?void 0:s.length)||0)+(((i=t.match(rb))==null?void 0:i.length)||0)>0}const Mg="number",Og="color",ib="var",nb="var(",Ep="${}",ob=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function hi(t){const s=t.toString(),i=[],o={color:[],number:[],var:[]},d=[];let w=0;const a=s.replace(ob,l=>(Je.test(l)?(o.color.push(w),d.push(Og),i.push(Je.parse(l))):l.startsWith(nb)?(o.var.push(w),d.push(ib),i.push(l)):(o.number.push(w),d.push(Mg),i.push(parseFloat(l))),++w,Ep)).split(Ep);return{values:i,split:a,indexes:o,types:d}}function ab(t){return hi(t).values}function Ig({split:t,types:s}){const i=t.length;return o=>{let d="";for(let w=0;w<i;w++)if(d+=t[w],o[w]!==void 0){const g=s[w];g===Mg?d+=cn(o[w]):g===Og?d+=Je.transform(o[w]):d+=o[w]}return d}}function lb(t){return Ig(hi(t))}const cb=t=>typeof t=="number"?0:Je.test(t)?Je.getAnimatableNone(t):t,ub=(t,s)=>typeof t=="number"?s!=null&&s.trim().endsWith("/")?t:0:cb(t);function db(t){const s=hi(t);return Ig(s)(s.values.map((o,d)=>ub(o,s.split[d])))}const sr={test:sb,parse:ab,createTransformer:lb,getAnimatableNone:db};function Ac(t,s,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+(s-t)*6*i:i<1/2?s:i<2/3?t+(s-t)*(2/3-i)*6:t}function hb({hue:t,saturation:s,lightness:i,alpha:o}){t/=360,s/=100,i/=100;let d=0,w=0,g=0;if(!s)d=w=g=i;else{const a=i<.5?i*(1+s):i+s-i*s,l=2*i-a;d=Ac(l,a,t+1/3),w=Ac(l,a,t),g=Ac(l,a,t-1/3)}return{red:Math.round(d*255),green:Math.round(w*255),blue:Math.round(g*255),alpha:o}}function oa(t,s){return i=>i>0?s:t}const Ue=(t,s,i)=>t+(s-t)*i,jc=(t,s,i)=>{const o=t*t,d=i*(s*s-o)+o;return d<0?0:Math.sqrt(d)},fb=[Gc,Ts,oi],pb=t=>fb.find(s=>s.test(t));function Tp(t){const s=pb(t);if(!s)return!1;let i=s.parse(t);return s===oi&&(i=hb(i)),i}const Rp=(t,s)=>{const i=Tp(t),o=Tp(s);if(!i||!o)return oa(t,s);const d={...i};return w=>(d.red=jc(i.red,o.red,w),d.green=jc(i.green,o.green,w),d.blue=jc(i.blue,o.blue,w),d.alpha=Ue(i.alpha,o.alpha,w),Ts.transform(d))},Xc=new Set(["none","hidden"]);function mb(t,s){return Xc.has(t)?i=>i<=0?t:s:i=>i>=1?s:t}function gb(t,s){return i=>Ue(t,s,i)}function Bu(t){return typeof t=="number"?gb:typeof t=="string"?Ou(t)?oa:Je.test(t)?Rp:_b:Array.isArray(t)?Ng:typeof t=="object"?Je.test(t)?Rp:vb:oa}function Ng(t,s){const i=[...t],o=i.length,d=t.map((w,g)=>Bu(w)(w,s[g]));return w=>{for(let g=0;g<o;g++)i[g]=d[g](w);return i}}function vb(t,s){const i={...t,...s},o={};for(const d in i)t[d]!==void 0&&s[d]!==void 0&&(o[d]=Bu(t[d])(t[d],s[d]));return d=>{for(const w in o)i[w]=o[w](d);return i}}function yb(t,s){const i=[],o={color:0,var:0,number:0};for(let d=0;d<s.values.length;d++){const w=s.types[d],g=t.indexes[w][o[w]],a=t.values[g]??0;i[d]=a,o[w]++}return i}const _b=(t,s)=>{const i=sr.createTransformer(s),o=hi(t),d=hi(s);return o.indexes.var.length===d.indexes.var.length&&o.indexes.color.length===d.indexes.color.length&&o.indexes.number.length>=d.indexes.number.length?Xc.has(t)&&!d.values.length||Xc.has(s)&&!o.values.length?mb(t,s):xn(Ng(yb(o,d),d.values),i):oa(t,s)};function Bg(t,s,i){return typeof t=="number"&&typeof s=="number"&&typeof i=="number"?Ue(t,s,i):Bu(t)(t,s)}const xb=t=>{const s=({timestamp:i})=>t(i);return{start:(i=!0)=>Ae.update(s,i),stop:()=>ss(s),now:()=>at.isProcessing?at.timestamp:yt.now()}},Fg=(t,s,i=10)=>{let o="";const d=Math.max(Math.round(s/i),2);for(let w=0;w<d;w++)o+=Math.round(t(w/(d-1))*1e4)/1e4+", ";return`linear(${o.substring(0,o.length-2)})`},aa=2e4;function Fu(t){let s=0;const i=50;let o=t.next(s);for(;!o.done&&s<aa;)s+=i,o=t.next(s);return s>=aa?1/0:s}function wb(t,s=100,i){const o=i({...t,keyframes:[0,s]}),d=Math.min(Fu(o),aa);return{type:"keyframes",ease:w=>o.next(d*w).value/s,duration:zt(d)}}const Ke={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Jc(t,s){return t*Math.sqrt(1-s*s)}const Sb=12;function bb(t,s,i){let o=i;for(let d=1;d<Sb;d++)o=o-t(o)/s(o);return o}const Mc=.001;function Cb({duration:t=Ke.duration,bounce:s=Ke.bounce,velocity:i=Ke.velocity,mass:o=Ke.mass}){let d,w,g=1-s;g=vr(Ke.minDamping,Ke.maxDamping,g),t=vr(Ke.minDuration,Ke.maxDuration,zt(t)),g<1?(d=p=>{const m=p*g,u=m*t,x=m-i,b=Jc(p,g),E=Math.exp(-u);return Mc-x/b*E},w=p=>{const u=p*g*t,x=u*i+i,b=Math.pow(g,2)*Math.pow(p,2)*t,E=Math.exp(-u),S=Jc(Math.pow(p,2),g);return(-d(p)+Mc>0?-1:1)*((x-b)*E)/S}):(d=p=>{const m=Math.exp(-p*t),u=(p-i)*t+1;return-Mc+m*u},w=p=>{const m=Math.exp(-p*t),u=(i-p)*(t*t);return m*u});const a=5/t,l=bb(d,w,a);if(t=It(t),isNaN(l))return{stiffness:Ke.stiffness,damping:Ke.damping,duration:t};{const p=Math.pow(l,2)*o;return{stiffness:p,damping:g*2*Math.sqrt(o*p),duration:t}}}const kb=["duration","bounce"],Eb=["stiffness","damping","mass"];function Pp(t,s){return s.some(i=>t[i]!==void 0)}function Tb(t){let s={velocity:Ke.velocity,stiffness:Ke.stiffness,damping:Ke.damping,mass:Ke.mass,isResolvedFromDuration:!1,...t};if(!Pp(t,Eb)&&Pp(t,kb))if(s.velocity=0,t.visualDuration){const i=t.visualDuration,o=2*Math.PI/(i*1.2),d=o*o,w=2*vr(.05,1,1-(t.bounce||0))*Math.sqrt(d);s={...s,mass:Ke.mass,stiffness:d,damping:w}}else{const i=Cb({...t,velocity:0});s={...s,...i,mass:Ke.mass},s.isResolvedFromDuration=!0}return s}function la(t=Ke.visualDuration,s=Ke.bounce){const i=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:s}:t;let{restSpeed:o,restDelta:d}=i;const w=i.keyframes[0],g=i.keyframes[i.keyframes.length-1],a={done:!1,value:w},{stiffness:l,damping:p,mass:m,duration:u,velocity:x,isResolvedFromDuration:b}=Tb({...i,velocity:-zt(i.velocity||0)}),E=x||0,S=p/(2*Math.sqrt(l*m)),c=g-w,y=zt(Math.sqrt(l/m)),h=Math.abs(c)<5;o||(o=h?Ke.restSpeed.granular:Ke.restSpeed.default),d||(d=h?Ke.restDelta.granular:Ke.restDelta.default);let v,C,R,L,D,T;if(S<1)R=Jc(y,S),L=(E+S*y*c)/R,v=I=>{const H=Math.exp(-S*y*I);return g-H*(L*Math.sin(R*I)+c*Math.cos(R*I))},D=S*y*L+c*R,T=S*y*c-L*R,C=I=>Math.exp(-S*y*I)*(D*Math.sin(R*I)+T*Math.cos(R*I));else if(S===1){v=H=>g-Math.exp(-y*H)*(c+(E+y*c)*H);const I=E+y*c;C=H=>Math.exp(-y*H)*(y*I*H-E)}else{const I=y*Math.sqrt(S*S-1);v=J=>{const K=Math.exp(-S*y*J),z=Math.min(I*J,300);return g-K*((E+S*y*c)*Math.sinh(z)+I*c*Math.cosh(z))/I};const H=(E+S*y*c)/I,$=S*y*H-c*I,N=S*y*c-H*I;C=J=>{const K=Math.exp(-S*y*J),z=Math.min(I*J,300);return K*($*Math.sinh(z)+N*Math.cosh(z))}}const A={calculatedDuration:b&&u||null,velocity:I=>It(C(I)),next:I=>{if(!b&&S<1){const $=Math.exp(-S*y*I),N=Math.sin(R*I),J=Math.cos(R*I),K=g-$*(L*N+c*J),z=It($*(D*N+T*J));return a.done=Math.abs(z)<=o&&Math.abs(g-K)<=d,a.value=a.done?g:K,a}const H=v(I);if(b)a.done=I>=u;else{const $=It(C(I));a.done=Math.abs($)<=o&&Math.abs(g-H)<=d}return a.value=a.done?g:H,a},toString:()=>{const I=Math.min(Fu(A),aa),H=Fg($=>A.next(I*$).value,I,30);return I+"ms "+H},toTransition:()=>{}};return A}la.applyToOptions=t=>{const s=wb(t,100,la);return t.ease=s.ease,t.duration=It(s.duration),t.type="keyframes",t};const Rb=5;function Hg(t,s,i){const o=Math.max(s-Rb,0);return _g(i-t(o),s-o)}function Yc({keyframes:t,velocity:s=0,power:i=.8,timeConstant:o=325,bounceDamping:d=10,bounceStiffness:w=500,modifyTarget:g,min:a,max:l,restDelta:p=.5,restSpeed:m}){const u=t[0],x={done:!1,value:u},b=T=>a!==void 0&&T<a||l!==void 0&&T>l,E=T=>a===void 0?l:l===void 0||Math.abs(a-T)<Math.abs(l-T)?a:l;let S=i*s;const c=u+S,y=g===void 0?c:g(c);y!==c&&(S=y-u);const h=T=>-S*Math.exp(-T/o),v=T=>y+h(T),C=T=>{const A=h(T),I=v(T);x.done=Math.abs(A)<=p,x.value=x.done?y:I};let R,L;const D=T=>{b(x.value)&&(R=T,L=la({keyframes:[x.value,E(x.value)],velocity:Hg(v,T,x.value),damping:d,stiffness:w,restDelta:p,restSpeed:m}))};return D(0),{calculatedDuration:null,next:T=>{let A=!1;return!L&&R===void 0&&(A=!0,C(T),D(T)),R!==void 0&&T>=R?L.next(T-R):(!A&&C(T),x)}}}function Pb(t,s,i){const o=[],d=i||rs.mix||Bg,w=t.length-1;for(let g=0;g<w;g++){let a=d(t[g],t[g+1]);if(s){const l=Array.isArray(s)?s[g]||Kt:s;a=xn(l,a)}o.push(a)}return o}function Lb(t,s,{clamp:i=!0,ease:o,mixer:d}={}){const w=t.length;if(Du(w===s.length),w===1)return()=>s[0];if(w===2&&s[0]===s[1])return()=>s[1];const g=t[0]===t[1];t[0]>t[w-1]&&(t=[...t].reverse(),s=[...s].reverse());const a=Pb(s,o,d),l=a.length,p=m=>{if(g&&m<t[0])return s[0];let u=0;if(l>1)for(;u<t.length-2&&!(m<t[u+1]);u++);const x=mn(t[u],t[u+1],m);return a[u](x)};return i?m=>p(vr(t[0],t[w-1],m)):p}function Db(t,s){const i=t[t.length-1];for(let o=1;o<=s;o++){const d=mn(0,s,o);t.push(Ue(i,1,d))}}function Ab(t){const s=[0];return Db(s,t.length-1),s}function jb(t,s){return t.map(i=>i*s)}function Mb(t,s){return t.map(()=>s||Rg).splice(0,t.length-1)}function un({duration:t=300,keyframes:s,times:i,ease:o="easeInOut"}){const d=WS(o)?o.map(bp):bp(o),w={done:!1,value:s[0]},g=jb(i&&i.length===s.length?i:Ab(s),t),a=Lb(g,s,{ease:Array.isArray(d)?d:Mb(s,d)});return{calculatedDuration:t,next:l=>(w.value=a(l),w.done=l>=t,w)}}const Ob=t=>t!==null;function xa(t,{repeat:s,repeatType:i="loop"},o,d=1){const w=t.filter(Ob),a=d<0||s&&i!=="loop"&&s%2===1?0:w.length-1;return!a||o===void 0?w[a]:o}const Ib={decay:Yc,inertia:Yc,tween:un,keyframes:un,spring:la};function Ug(t){typeof t.type=="string"&&(t.type=Ib[t.type])}class Hu{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(s=>{this.resolve=s})}notifyFinished(){this.resolve()}then(s,i){return this.finished.then(s,i)}}const Nb=t=>t/100;class ca extends Hu{constructor(s){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var o,d;const{motionValue:i}=this.options;i&&i.updatedAt!==yt.now()&&this.tick(yt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(d=(o=this.options).onStop)==null||d.call(o))},this.options=s,this.initAnimation(),this.play(),s.autoplay===!1&&this.pause()}initAnimation(){const{options:s}=this;Ug(s);const{type:i=un,repeat:o=0,repeatDelay:d=0,repeatType:w,velocity:g=0}=s;let{keyframes:a}=s;const l=i||un;l!==un&&typeof a[0]!="number"&&(this.mixKeyframes=xn(Nb,Bg(a[0],a[1])),a=[0,100]);const p=l({...s,keyframes:a});w==="mirror"&&(this.mirroredGenerator=l({...s,keyframes:[...a].reverse(),velocity:-g})),p.calculatedDuration===null&&(p.calculatedDuration=Fu(p));const{calculatedDuration:m}=p;this.calculatedDuration=m,this.resolvedDuration=m+d,this.totalDuration=this.resolvedDuration*(o+1)-d,this.generator=p}updateTime(s){const i=Math.round(s-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(s,i=!1){const{generator:o,totalDuration:d,mixKeyframes:w,mirroredGenerator:g,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return o.next(0);const{delay:p=0,keyframes:m,repeat:u,repeatType:x,repeatDelay:b,type:E,onUpdate:S,finalKeyframe:c}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,s):this.speed<0&&(this.startTime=Math.min(s-d/this.speed,this.startTime)),i?this.currentTime=s:this.updateTime(s);const y=this.currentTime-p*(this.playbackSpeed>=0?1:-1),h=this.playbackSpeed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let v=this.currentTime,C=o;if(u){const T=Math.min(this.currentTime,d)/a;let A=Math.floor(T),I=T%1;!I&&T>=1&&(I=1),I===1&&A--,A=Math.min(A,u+1),!!(A%2)&&(x==="reverse"?(I=1-I,b&&(I-=b/a)):x==="mirror"&&(C=g)),v=vr(0,1,I)*a}let R;h?(this.delayState.value=m[0],R=this.delayState):R=C.next(v),w&&!h&&(R.value=w(R.value));let{done:L}=R;!h&&l!==null&&(L=this.playbackSpeed>=0?this.currentTime>=d:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&L);return D&&E!==Yc&&(R.value=xa(m,this.options,c,this.speed)),S&&S(R.value),D&&this.finish(),R}then(s,i){return this.finished.then(s,i)}get duration(){return zt(this.calculatedDuration)}get iterationDuration(){const{delay:s=0}=this.options||{};return this.duration+zt(s)}get time(){return zt(this.currentTime)}set time(s){s=It(s),this.currentTime=s,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=s:this.driver&&(this.startTime=this.driver.now()-s/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=s,this.tick(s))}getGeneratorVelocity(){const s=this.currentTime;if(s<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(s);const i=this.generator.next(s).value;return Hg(o=>this.generator.next(o).value,s,i)}get speed(){return this.playbackSpeed}set speed(s){const i=this.playbackSpeed!==s;i&&this.driver&&this.updateTime(yt.now()),this.playbackSpeed=s,i&&this.driver&&(this.time=zt(this.currentTime))}play(){var d,w;if(this.isStopped)return;const{driver:s=xb,startTime:i}=this.options;this.driver||(this.driver=s(g=>this.tick(g))),(w=(d=this.options).onPlay)==null||w.call(d);const o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=i??o),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(yt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var s,i;this.notifyFinished(),this.teardown(),this.state="finished",(i=(s=this.options).onComplete)==null||i.call(s)}cancel(){var s,i;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(i=(s=this.options).onCancel)==null||i.call(s)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(s){return this.startTime=0,this.tick(s,!0)}attachTimeline(s){var i;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(i=this.driver)==null||i.stop(),s.observe(this)}}function Bb(t){for(let s=1;s<t.length;s++)t[s]??(t[s]=t[s-1])}const Rs=t=>t*180/Math.PI,Qc=t=>{const s=Rs(Math.atan2(t[1],t[0]));return Zc(s)},Fb={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Qc,rotateZ:Qc,skewX:t=>Rs(Math.atan(t[1])),skewY:t=>Rs(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Zc=t=>(t=t%360,t<0&&(t+=360),t),Lp=Qc,Dp=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ap=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Hb={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Dp,scaleY:Ap,scale:t=>(Dp(t)+Ap(t))/2,rotateX:t=>Zc(Rs(Math.atan2(t[6],t[5]))),rotateY:t=>Zc(Rs(Math.atan2(-t[2],t[0]))),rotateZ:Lp,rotate:Lp,skewX:t=>Rs(Math.atan(t[4])),skewY:t=>Rs(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function eu(t){return t.includes("scale")?1:0}function tu(t,s){if(!t||t==="none")return eu(s);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,d;if(i)o=Hb,d=i;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=Fb,d=a}if(!d)return eu(s);const w=o[s],g=d[1].split(",").map(Wb);return typeof w=="function"?w(g):g[w]}const Ub=(t,s)=>{const{transform:i="none"}=getComputedStyle(t);return tu(i,s)};function Wb(t){return parseFloat(t.trim())}const gi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vi=new Set(gi),jp=t=>t===mi||t===ve,Vb=new Set(["x","y","z"]),$b=gi.filter(t=>!Vb.has(t));function zb(t){const s=[];return $b.forEach(i=>{const o=t.getValue(i);o!==void 0&&(s.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),s}const es={width:({x:t},{paddingLeft:s="0",paddingRight:i="0",boxSizing:o})=>{const d=t.max-t.min;return o==="border-box"?d:d-parseFloat(s)-parseFloat(i)},height:({y:t},{paddingTop:s="0",paddingBottom:i="0",boxSizing:o})=>{const d=t.max-t.min;return o==="border-box"?d:d-parseFloat(s)-parseFloat(i)},top:(t,{top:s})=>parseFloat(s),left:(t,{left:s})=>parseFloat(s),bottom:({y:t},{top:s})=>parseFloat(s)+(t.max-t.min),right:({x:t},{left:s})=>parseFloat(s)+(t.max-t.min),x:(t,{transform:s})=>tu(s,"x"),y:(t,{transform:s})=>tu(s,"y")};es.translateX=es.x;es.translateY=es.y;const Ds=new Set;let ru=!1,su=!1,iu=!1;function Wg(){if(su){const t=Array.from(Ds).filter(o=>o.needsMeasurement),s=new Set(t.map(o=>o.element)),i=new Map;s.forEach(o=>{const d=zb(o);d.length&&(i.set(o,d),o.render())}),t.forEach(o=>o.measureInitialState()),s.forEach(o=>{o.render();const d=i.get(o);d&&d.forEach(([w,g])=>{var a;(a=o.getValue(w))==null||a.set(g)})}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}su=!1,ru=!1,Ds.forEach(t=>t.complete(iu)),Ds.clear()}function Vg(){Ds.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(su=!0)})}function Kb(){iu=!0,Vg(),Wg(),iu=!1}class Uu{constructor(s,i,o,d,w,g=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...s],this.onComplete=i,this.name=o,this.motionValue=d,this.element=w,this.isAsync=g}scheduleResolve(){this.state="scheduled",this.isAsync?(Ds.add(this),ru||(ru=!0,Ae.read(Vg),Ae.resolveKeyframes(Wg))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:s,name:i,element:o,motionValue:d}=this;if(s[0]===null){const w=d==null?void 0:d.get(),g=s[s.length-1];if(w!==void 0)s[0]=w;else if(o&&i){const a=o.readValue(i,g);a!=null&&(s[0]=a)}s[0]===void 0&&(s[0]=g),d&&w===void 0&&d.set(s[0])}Bb(s)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(s=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,s),Ds.delete(this)}cancel(){this.state==="scheduled"&&(Ds.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qb=t=>t.startsWith("--");function $g(t,s,i){qb(s)?t.style.setProperty(s,i):t.style[s]=i}const Gb={};function zg(t,s){const i=yg(t);return()=>Gb[s]??i()}const Xb=zg(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Kg=zg(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),an=([t,s,i,o])=>`cubic-bezier(${t}, ${s}, ${i}, ${o})`,Mp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:an([0,.65,.55,1]),circOut:an([.55,0,1,.45]),backIn:an([.31,.01,.66,-.59]),backOut:an([.33,1.53,.69,.99])};function qg(t,s){if(t)return typeof t=="function"?Kg()?Fg(t,s):"ease-out":Pg(t)?an(t):Array.isArray(t)?t.map(i=>qg(i,s)||Mp.easeOut):Mp[t]}function Jb(t,s,i,{delay:o=0,duration:d=300,repeat:w=0,repeatType:g="loop",ease:a="easeOut",times:l}={},p=void 0){const m={[s]:i};l&&(m.offset=l);const u=qg(a,d);Array.isArray(u)&&(m.easing=u);const x={delay:o,duration:d,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:w+1,direction:g==="reverse"?"alternate":"normal"};return p&&(x.pseudoElement=p),t.animate(m,x)}function Gg(t){return typeof t=="function"&&"applyToOptions"in t}function Yb({type:t,...s}){return Gg(t)&&Kg()?t.applyToOptions(s):(s.duration??(s.duration=300),s.ease??(s.ease="easeOut"),s)}class Xg extends Hu{constructor(s){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!s)return;const{element:i,name:o,keyframes:d,pseudoElement:w,allowFlatten:g=!1,finalKeyframe:a,onComplete:l}=s;this.isPseudoElement=!!w,this.allowFlatten=g,this.options=s,Du(typeof s.type!="string");const p=Yb(s);this.animation=Jb(i,o,d,p,w),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!w){const m=xa(d,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(m),$g(i,o,m),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var s,i;(i=(s=this.animation).finish)==null||i.call(s)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:s}=this;s==="idle"||s==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var i,o,d;const s=(i=this.options)==null?void 0:i.element;!this.isPseudoElement&&(s!=null&&s.isConnected)&&((d=(o=this.animation).commitStyles)==null||d.call(o))}get duration(){var i,o;const s=((o=(i=this.animation.effect)==null?void 0:i.getComputedTiming)==null?void 0:o.call(i).duration)||0;return zt(Number(s))}get iterationDuration(){const{delay:s=0}=this.options||{};return this.duration+zt(s)}get time(){return zt(Number(this.animation.currentTime)||0)}set time(s){const i=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=It(s),i&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(s){s<0&&(this.finishedTime=null),this.animation.playbackRate=s}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(s){this.manualStartTime=this.animation.startTime=s}attachTimeline({timeline:s,rangeStart:i,rangeEnd:o,observe:d}){var w;return this.allowFlatten&&((w=this.animation.effect)==null||w.updateTiming({easing:"linear"})),this.animation.onfinish=null,s&&Xb()?(this.animation.timeline=s,i&&(this.animation.rangeStart=i),o&&(this.animation.rangeEnd=o),Kt):d(this)}}const Jg={anticipate:kg,backInOut:Cg,circInOut:Tg};function Qb(t){return t in Jg}function Zb(t){typeof t.ease=="string"&&Qb(t.ease)&&(t.ease=Jg[t.ease])}const Oc=10;class e1 extends Xg{constructor(s){Zb(s),Ug(s),super(s),s.startTime!==void 0&&s.autoplay!==!1&&(this.startTime=s.startTime),this.options=s}updateMotionValue(s){const{motionValue:i,onUpdate:o,onComplete:d,element:w,...g}=this.options;if(!i)return;if(s!==void 0){i.set(s);return}const a=new ca({...g,autoplay:!1}),l=Math.max(Oc,yt.now()-this.startTime),p=vr(0,Oc,l-Oc),m=a.sample(l).value,{name:u}=this.options;w&&u&&$g(w,u,m),i.setWithVelocity(a.sample(Math.max(0,l-p)).value,m,p),a.stop()}}const Op=(t,s)=>s==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(sr.test(t)||t==="0")&&!t.startsWith("url("));function t1(t){const s=t[0];if(t.length===1)return!0;for(let i=0;i<t.length;i++)if(t[i]!==s)return!0}function r1(t,s,i,o){const d=t[0];if(d===null)return!1;if(s==="display"||s==="visibility")return!0;const w=t[t.length-1],g=Op(d,s),a=Op(w,s);return!g||!a?!1:t1(t)||(i==="spring"||Gg(i))&&o}function nu(t){t.duration=0,t.type="keyframes"}const Yg=new Set(["opacity","clipPath","filter","transform"]),s1=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function i1(t){for(let s=0;s<t.length;s++)if(typeof t[s]=="string"&&s1.test(t[s]))return!0;return!1}const n1=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),o1=yg(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function a1(t){var u;const{motionValue:s,name:i,repeatDelay:o,repeatType:d,damping:w,type:g,keyframes:a}=t;if(!(((u=s==null?void 0:s.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:p,transformTemplate:m}=s.owner.getProps();return o1()&&i&&(Yg.has(i)||n1.has(i)&&i1(a))&&(i!=="transform"||!m)&&!p&&!o&&d!=="mirror"&&w!==0&&g!=="inertia"}const l1=40;class c1 extends Hu{constructor({autoplay:s=!0,delay:i=0,type:o="keyframes",repeat:d=0,repeatDelay:w=0,repeatType:g="loop",keyframes:a,name:l,motionValue:p,element:m,...u}){var E;super(),this.stop=()=>{var S,c;this._animation&&(this._animation.stop(),(S=this.stopTimeline)==null||S.call(this)),(c=this.keyframeResolver)==null||c.cancel()},this.createdAt=yt.now();const x={autoplay:s,delay:i,type:o,repeat:d,repeatDelay:w,repeatType:g,name:l,motionValue:p,element:m,...u},b=(m==null?void 0:m.KeyframeResolver)||Uu;this.keyframeResolver=new b(a,(S,c,y)=>this.onKeyframesResolved(S,c,x,!y),l,p,m),(E=this.keyframeResolver)==null||E.scheduleResolve()}onKeyframesResolved(s,i,o,d){var y,h;this.keyframeResolver=void 0;const{name:w,type:g,velocity:a,delay:l,isHandoff:p,onUpdate:m}=o;this.resolvedAt=yt.now();let u=!0;r1(s,w,g,a)||(u=!1,(rs.instantAnimations||!l)&&(m==null||m(xa(s,o,i))),s[0]=s[s.length-1],nu(o),o.repeat=0);const b={startTime:d?this.resolvedAt?this.resolvedAt-this.createdAt>l1?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...o,keyframes:s},E=u&&!p&&a1(b),S=(h=(y=b.motionValue)==null?void 0:y.owner)==null?void 0:h.current;let c;if(E)try{c=new e1({...b,element:S})}catch{c=new ca(b)}else c=new ca(b);c.finished.then(()=>{this.notifyFinished()}).catch(Kt),this.pendingTimeline&&(this.stopTimeline=c.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=c}get finished(){return this._animation?this.animation.finished:this._finished}then(s,i){return this.finished.finally(s).then(()=>{})}get animation(){var s;return this._animation||((s=this.keyframeResolver)==null||s.resume(),Kb()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(s){this.animation.time=s}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(s){this.animation.speed=s}get startTime(){return this.animation.startTime}attachTimeline(s){return this._animation?this.stopTimeline=this.animation.attachTimeline(s):this.pendingTimeline=s,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var s;this._animation&&this.animation.cancel(),(s=this.keyframeResolver)==null||s.cancel()}}function Qg(t,s,i,o=0,d=1){const w=Array.from(t).sort((p,m)=>p.sortNodePosition(m)).indexOf(s),g=t.size,a=(g-1)*o;return typeof i=="function"?i(w,g):d===1?w*o:a-w*o}const u1=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function d1(t){const s=u1.exec(t);if(!s)return[,];const[,i,o,d]=s;return[`--${i??o}`,d]}function Zg(t,s,i=1){const[o,d]=d1(t);if(!o)return;const w=window.getComputedStyle(s).getPropertyValue(o);if(w){const g=w.trim();return mg(g)?parseFloat(g):g}return Ou(d)?Zg(d,s,i+1):d}const h1={type:"spring",stiffness:500,damping:25,restSpeed:10},f1=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),p1={type:"keyframes",duration:.8},m1={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},g1=(t,{keyframes:s})=>s.length>2?p1:vi.has(t)?t.startsWith("scale")?f1(s[1]):h1:m1;function ev(t,s){if(t!=null&&t.inherit&&s){const{inherit:i,...o}=t;return{...s,...o}}return t}function Wu(t,s){const i=(t==null?void 0:t[s])??(t==null?void 0:t.default)??t;return i!==t?ev(i,t):i}const v1=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function y1(t){for(const s in t)if(!v1.has(s))return!0;return!1}const Vu=(t,s,i,o={},d,w)=>g=>{const a=Wu(o,t)||{},l=a.delay||o.delay||0;let{elapsed:p=0}=o;p=p-It(l);const m={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:s.getVelocity(),...a,delay:-p,onUpdate:x=>{s.set(x),a.onUpdate&&a.onUpdate(x)},onComplete:()=>{g(),a.onComplete&&a.onComplete()},name:t,motionValue:s,element:w?void 0:d};y1(a)||Object.assign(m,g1(t,m)),m.duration&&(m.duration=It(m.duration)),m.repeatDelay&&(m.repeatDelay=It(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let u=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(nu(m),m.delay===0&&(u=!0)),(rs.instantAnimations||rs.skipAnimations||d!=null&&d.shouldSkipAnimations)&&(u=!0,nu(m),m.delay=0),m.allowFlatten=!a.type&&!a.ease,u&&!w&&s.get()!==void 0){const x=xa(m.keyframes,a);if(x!==void 0){Ae.update(()=>{m.onUpdate(x),m.onComplete()});return}}return a.isSync?new ca(m):new c1(m)};function Ip(t){const s=[{},{}];return t==null||t.values.forEach((i,o)=>{s[0][o]=i.get(),s[1][o]=i.getVelocity()}),s}function $u(t,s,i,o){if(typeof s=="function"){const[d,w]=Ip(o);s=s(i!==void 0?i:t.custom,d,w)}if(typeof s=="string"&&(s=t.variants&&t.variants[s]),typeof s=="function"){const[d,w]=Ip(o);s=s(i!==void 0?i:t.custom,d,w)}return s}function As(t,s,i){const o=t.getProps();return $u(o,s,i!==void 0?i:o.custom,t)}const tv=new Set(["width","height","top","left","right","bottom",...gi]),Np=30,_1=t=>!isNaN(parseFloat(t));class x1{constructor(s,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{var w;const d=yt.now();if(this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&((w=this.events.change)==null||w.notify(this.current),this.dependents))for(const g of this.dependents)g.dirty()},this.hasAnimated=!1,this.setCurrent(s),this.owner=i.owner}setCurrent(s){this.current=s,this.updatedAt=yt.now(),this.canTrackVelocity===null&&s!==void 0&&(this.canTrackVelocity=_1(this.current))}setPrevFrameValue(s=this.current){this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt}onChange(s){return this.on("change",s)}on(s,i){this.events[s]||(this.events[s]=new Au);const o=this.events[s].add(i);return s==="change"?()=>{o(),Ae.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const s in this.events)this.events[s].clear()}attach(s,i){this.passiveEffect=s,this.stopPassiveEffect=i}set(s){this.passiveEffect?this.passiveEffect(s,this.updateAndNotify):this.updateAndNotify(s)}setWithVelocity(s,i,o){this.set(i),this.prev=void 0,this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt-o}jump(s,i=!0){this.updateAndNotify(s),this.prev=s,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var s;(s=this.events.change)==null||s.notify(this.current)}addDependent(s){this.dependents||(this.dependents=new Set),this.dependents.add(s)}removeDependent(s){this.dependents&&this.dependents.delete(s)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const s=yt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||s-this.updatedAt>Np)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Np);return _g(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(s){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=s(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var s,i;(s=this.dependents)==null||s.clear(),(i=this.events.destroy)==null||i.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function fi(t,s){return new x1(t,s)}const ou=t=>Array.isArray(t);function w1(t,s,i){t.hasValue(s)?t.getValue(s).set(i):t.addValue(s,fi(i))}function S1(t){return ou(t)?t[t.length-1]||0:t}function b1(t,s){const i=As(t,s);let{transitionEnd:o={},transition:d={},...w}=i||{};w={...w,...o};for(const g in w){const a=S1(w[g]);w1(t,g,a)}}const lt=t=>!!(t&&t.getVelocity);function C1(t){return!!(lt(t)&&t.add)}function au(t,s){const i=t.getValue("willChange");if(C1(i))return i.add(s);if(!i&&rs.WillChange){const o=new rs.WillChange("auto");t.addValue("willChange",o),o.add(s)}}function zu(t){return t.replace(/([A-Z])/g,s=>`-${s.toLowerCase()}`)}const k1="framerAppearId",rv="data-"+zu(k1);function sv(t){return t.props[rv]}function E1({protectedKeys:t,needsAnimating:s},i){const o=t.hasOwnProperty(i)&&s[i]!==!0;return s[i]=!1,o}function iv(t,s,{delay:i=0,transitionOverride:o,type:d}={}){let{transition:w,transitionEnd:g,...a}=s;const l=t.getDefaultTransition();w=w?ev(w,l):l;const p=w==null?void 0:w.reduceMotion;o&&(w=o);const m=[],u=d&&t.animationState&&t.animationState.getState()[d];for(const x in a){const b=t.getValue(x,t.latestValues[x]??null),E=a[x];if(E===void 0||u&&E1(u,x))continue;const S={delay:i,...Wu(w||{},x)},c=b.get();if(c!==void 0&&!b.isAnimating()&&!Array.isArray(E)&&E===c&&!S.velocity){Ae.update(()=>b.set(E));continue}let y=!1;if(window.MotionHandoffAnimation){const C=sv(t);if(C){const R=window.MotionHandoffAnimation(C,x,Ae);R!==null&&(S.startTime=R,y=!0)}}au(t,x);const h=p??t.shouldReduceMotion;b.start(Vu(x,b,E,h&&tv.has(x)?{type:!1}:S,t,y));const v=b.animation;v&&m.push(v)}if(g){const x=()=>Ae.update(()=>{g&&b1(t,g)});m.length?Promise.all(m).then(x):x()}return m}function lu(t,s,i={}){var l;const o=As(t,s,i.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:d=t.getDefaultTransition()||{}}=o||{};i.transitionOverride&&(d=i.transitionOverride);const w=o?()=>Promise.all(iv(t,o,i)):()=>Promise.resolve(),g=t.variantChildren&&t.variantChildren.size?(p=0)=>{const{delayChildren:m=0,staggerChildren:u,staggerDirection:x}=d;return T1(t,s,p,m,u,x,i)}:()=>Promise.resolve(),{when:a}=d;if(a){const[p,m]=a==="beforeChildren"?[w,g]:[g,w];return p().then(()=>m())}else return Promise.all([w(),g(i.delay)])}function T1(t,s,i=0,o=0,d=0,w=1,g){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",s),a.push(lu(l,s,{...g,delay:i+(typeof o=="function"?0:o)+Qg(t.variantChildren,l,o,d,w)}).then(()=>l.notify("AnimationComplete",s)));return Promise.all(a)}function R1(t,s,i={}){t.notify("AnimationStart",s);let o;if(Array.isArray(s)){const d=s.map(w=>lu(t,w,i));o=Promise.all(d)}else if(typeof s=="string")o=lu(t,s,i);else{const d=typeof s=="function"?As(t,s,i.custom):s;o=Promise.all(iv(t,d,i))}return o.then(()=>{t.notify("AnimationComplete",s)})}const P1={test:t=>t==="auto",parse:t=>t},nv=t=>s=>s.test(t),ov=[mi,ve,mr,Qr,tb,eb,P1],Bp=t=>ov.find(nv(t));function L1(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||vg(t):!0}const D1=new Set(["brightness","contrast","saturate","opacity"]);function A1(t){const[s,i]=t.slice(0,-1).split("(");if(s==="drop-shadow")return t;const[o]=i.match(Iu)||[];if(!o)return t;const d=i.replace(o,"");let w=D1.has(s)?1:0;return o!==i&&(w*=100),s+"("+w+d+")"}const j1=/\b([a-z-]*)\(.*?\)/gu,cu={...sr,getAnimatableNone:t=>{const s=t.match(j1);return s?s.map(A1).join(" "):t}},uu={...sr,getAnimatableNone:t=>{const s=sr.parse(t);return sr.createTransformer(t)(s.map(o=>typeof o=="number"?0:typeof o=="object"?{...o,alpha:1}:o))}},Fp={...mi,transform:Math.round},M1={rotate:Qr,rotateX:Qr,rotateY:Qr,rotateZ:Qr,scale:Ho,scaleX:Ho,scaleY:Ho,scaleZ:Ho,skew:Qr,skewX:Qr,skewY:Qr,distance:ve,translateX:ve,translateY:ve,translateZ:ve,x:ve,y:ve,z:ve,perspective:ve,transformPerspective:ve,opacity:gn,originX:kp,originY:kp,originZ:ve},Ku={borderWidth:ve,borderTopWidth:ve,borderRightWidth:ve,borderBottomWidth:ve,borderLeftWidth:ve,borderRadius:ve,borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomRightRadius:ve,borderBottomLeftRadius:ve,width:ve,maxWidth:ve,height:ve,maxHeight:ve,top:ve,right:ve,bottom:ve,left:ve,inset:ve,insetBlock:ve,insetBlockStart:ve,insetBlockEnd:ve,insetInline:ve,insetInlineStart:ve,insetInlineEnd:ve,padding:ve,paddingTop:ve,paddingRight:ve,paddingBottom:ve,paddingLeft:ve,paddingBlock:ve,paddingBlockStart:ve,paddingBlockEnd:ve,paddingInline:ve,paddingInlineStart:ve,paddingInlineEnd:ve,margin:ve,marginTop:ve,marginRight:ve,marginBottom:ve,marginLeft:ve,marginBlock:ve,marginBlockStart:ve,marginBlockEnd:ve,marginInline:ve,marginInlineStart:ve,marginInlineEnd:ve,fontSize:ve,backgroundPositionX:ve,backgroundPositionY:ve,...M1,zIndex:Fp,fillOpacity:gn,strokeOpacity:gn,numOctaves:Fp},O1={...Ku,color:Je,backgroundColor:Je,outlineColor:Je,fill:Je,stroke:Je,borderColor:Je,borderTopColor:Je,borderRightColor:Je,borderBottomColor:Je,borderLeftColor:Je,filter:cu,WebkitFilter:cu,mask:uu,WebkitMask:uu},av=t=>O1[t],I1=new Set([cu,uu]);function lv(t,s){let i=av(t);return I1.has(i)||(i=sr),i.getAnimatableNone?i.getAnimatableNone(s):void 0}const N1=new Set(["auto","none","0"]);function B1(t,s,i){let o=0,d;for(;o<t.length&&!d;){const w=t[o];typeof w=="string"&&!N1.has(w)&&hi(w).values.length&&(d=t[o]),o++}if(d&&i)for(const w of s)t[w]=lv(i,d)}class F1 extends Uu{constructor(s,i,o,d,w){super(s,i,o,d,w,!0)}readKeyframes(){const{unresolvedKeyframes:s,element:i,name:o}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<s.length;m++){let u=s[m];if(typeof u=="string"&&(u=u.trim(),Ou(u))){const x=Zg(u,i.current);x!==void 0&&(s[m]=x),m===s.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!tv.has(o)||s.length!==2)return;const[d,w]=s,g=Bp(d),a=Bp(w),l=Cp(d),p=Cp(w);if(l!==p&&es[o]){this.needsMeasurement=!0;return}if(g!==a)if(jp(g)&&jp(a))for(let m=0;m<s.length;m++){const u=s[m];typeof u=="string"&&(s[m]=parseFloat(u))}else es[o]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:s,name:i}=this,o=[];for(let d=0;d<s.length;d++)(s[d]===null||L1(s[d]))&&o.push(d);o.length&&B1(s,o,i)}measureInitialState(){const{element:s,unresolvedKeyframes:i,name:o}=this;if(!s||!s.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=es[o](s.measureViewportBox(),window.getComputedStyle(s.current)),i[0]=this.measuredOrigin;const d=i[i.length-1];d!==void 0&&s.getValue(o,d).jump(d,!1)}measureEndState(){var a;const{element:s,name:i,unresolvedKeyframes:o}=this;if(!s||!s.current)return;const d=s.getValue(i);d&&d.jump(this.measuredOrigin,!1);const w=o.length-1,g=o[w];o[w]=es[i](s.measureViewportBox(),window.getComputedStyle(s.current)),g!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=g),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,p])=>{s.getValue(l).set(p)}),this.resolveNoneKeyframes()}}function cv(t,s,i){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let o=document;const d=(i==null?void 0:i[t])??o.querySelectorAll(t);return d?Array.from(d):[]}return Array.from(t).filter(o=>o!=null)}const uv=(t,s)=>s&&typeof t=="number"?s.transform(t):t;function qo(t){return gg(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:qu}=Lg(queueMicrotask,!1),rr={x:!1,y:!1};function dv(){return rr.x||rr.y}function H1(t){return t==="x"||t==="y"?rr[t]?null:(rr[t]=!0,()=>{rr[t]=!1}):rr.x||rr.y?null:(rr.x=rr.y=!0,()=>{rr.x=rr.y=!1})}function hv(t,s){const i=cv(t),o=new AbortController,d={passive:!0,...s,signal:o.signal};return[i,d,()=>o.abort()]}function U1(t){return!(t.pointerType==="touch"||dv())}function W1(t,s,i={}){const[o,d,w]=hv(t,i);return o.forEach(g=>{let a=!1,l=!1,p;const m=()=>{g.removeEventListener("pointerleave",E)},u=c=>{p&&(p(c),p=void 0),m()},x=c=>{a=!1,window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),l&&(l=!1,u(c))},b=()=>{a=!0,window.addEventListener("pointerup",x,d),window.addEventListener("pointercancel",x,d)},E=c=>{if(c.pointerType!=="touch"){if(a){l=!0;return}u(c)}},S=c=>{if(!U1(c))return;l=!1;const y=s(g,c);typeof y=="function"&&(p=y,g.addEventListener("pointerleave",E,d))};g.addEventListener("pointerenter",S,d),g.addEventListener("pointerdown",b,d)}),w}const fv=(t,s)=>s?t===s?!0:fv(t,s.parentElement):!1,Gu=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,V1=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function $1(t){return V1.has(t.tagName)||t.isContentEditable===!0}const z1=new Set(["INPUT","SELECT","TEXTAREA"]);function K1(t){return z1.has(t.tagName)||t.isContentEditable===!0}const Go=new WeakSet;function Hp(t){return s=>{s.key==="Enter"&&t(s)}}function Ic(t,s){t.dispatchEvent(new PointerEvent("pointer"+s,{isPrimary:!0,bubbles:!0}))}const q1=(t,s)=>{const i=t.currentTarget;if(!i)return;const o=Hp(()=>{if(Go.has(i))return;Ic(i,"down");const d=Hp(()=>{Ic(i,"up")}),w=()=>Ic(i,"cancel");i.addEventListener("keyup",d,s),i.addEventListener("blur",w,s)});i.addEventListener("keydown",o,s),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),s)};function Up(t){return Gu(t)&&!dv()}const Wp=new WeakSet;function G1(t,s,i={}){const[o,d,w]=hv(t,i),g=a=>{const l=a.currentTarget;if(!Up(a)||Wp.has(a))return;Go.add(l),i.stopPropagation&&Wp.add(a);const p=s(l,a),m=(b,E)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",x),Go.has(l)&&Go.delete(l),Up(b)&&typeof p=="function"&&p(b,{success:E})},u=b=>{m(b,l===window||l===document||i.useGlobalTarget||fv(l,b.target))},x=b=>{m(b,!1)};window.addEventListener("pointerup",u,d),window.addEventListener("pointercancel",x,d)};return o.forEach(a=>{(i.useGlobalTarget?window:a).addEventListener("pointerdown",g,d),qo(a)&&(a.addEventListener("focus",p=>q1(p,d)),!$1(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),w}function Xu(t){return gg(t)&&"ownerSVGElement"in t}const Xo=new WeakMap;let Zr;const pv=(t,s,i)=>(o,d)=>d&&d[0]?d[0][t+"Size"]:Xu(o)&&"getBBox"in o?o.getBBox()[s]:o[i],X1=pv("inline","width","offsetWidth"),J1=pv("block","height","offsetHeight");function Y1({target:t,borderBoxSize:s}){var i;(i=Xo.get(t))==null||i.forEach(o=>{o(t,{get width(){return X1(t,s)},get height(){return J1(t,s)}})})}function Q1(t){t.forEach(Y1)}function Z1(){typeof ResizeObserver>"u"||(Zr=new ResizeObserver(Q1))}function eC(t,s){Zr||Z1();const i=cv(t);return i.forEach(o=>{let d=Xo.get(o);d||(d=new Set,Xo.set(o,d)),d.add(s),Zr==null||Zr.observe(o)}),()=>{i.forEach(o=>{const d=Xo.get(o);d==null||d.delete(s),d!=null&&d.size||Zr==null||Zr.unobserve(o)})}}const Jo=new Set;let ai;function tC(){ai=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Jo.forEach(s=>s(t))},window.addEventListener("resize",ai)}function rC(t){return Jo.add(t),ai||tC(),()=>{Jo.delete(t),!Jo.size&&typeof ai=="function"&&(window.removeEventListener("resize",ai),ai=void 0)}}function Vp(t,s){return typeof t=="function"?rC(t):eC(t,s)}function sC(t){return Xu(t)&&t.tagName==="svg"}const iC=[...ov,Je,sr],nC=t=>iC.find(nv(t)),$p=()=>({translate:0,scale:1,origin:0,originPoint:0}),li=()=>({x:$p(),y:$p()}),zp=()=>({min:0,max:0}),Ze=()=>({x:zp(),y:zp()}),oC=new WeakMap;function wa(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function vn(t){return typeof t=="string"||Array.isArray(t)}const Ju=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Yu=["initial",...Ju];function Sa(t){return wa(t.animate)||Yu.some(s=>vn(t[s]))}function mv(t){return!!(Sa(t)||t.variants)}function aC(t,s,i){for(const o in s){const d=s[o],w=i[o];if(lt(d))t.addValue(o,d);else if(lt(w))t.addValue(o,fi(d,{owner:t}));else if(w!==d)if(t.hasValue(o)){const g=t.getValue(o);g.liveStyle===!0?g.jump(d):g.hasAnimated||g.set(d)}else{const g=t.getStaticValue(o);t.addValue(o,fi(g!==void 0?g:d,{owner:t}))}}for(const o in i)s[o]===void 0&&t.removeValue(o);return s}const du={current:null},gv={current:!1},lC=typeof window<"u";function cC(){if(gv.current=!0,!!lC)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),s=()=>du.current=t.matches;t.addEventListener("change",s),s()}else du.current=!1}const Kp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ua={};function vv(t){ua=t}function uC(){return ua}class dC{scrapeMotionValuesFromProps(s,i,o){return{}}constructor({parent:s,props:i,presenceContext:o,reducedMotionConfig:d,skipAnimations:w,blockInitialAnimation:g,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Uu,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=yt.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,Ae.render(this.render,!1,!0))};const{latestValues:p,renderState:m}=a;this.latestValues=p,this.baseTarget={...p},this.initialValues=i.initial?{...p}:{},this.renderState=m,this.parent=s,this.props=i,this.presenceContext=o,this.depth=s?s.depth+1:0,this.reducedMotionConfig=d,this.skipAnimationsConfig=w,this.options=l,this.blockInitialAnimation=!!g,this.isControllingVariants=Sa(i),this.isVariantNode=mv(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(s&&s.current);const{willChange:u,...x}=this.scrapeMotionValuesFromProps(i,{},this);for(const b in x){const E=x[b];p[b]!==void 0&<(E)&&E.set(p[b])}}mount(s){var i,o;if(this.hasBeenMounted)for(const d in this.initialValues)(i=this.values.get(d))==null||i.jump(this.initialValues[d]),this.latestValues[d]=this.initialValues[d];this.current=s,oC.set(s,this),this.projection&&!this.projection.instance&&this.projection.mount(s),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((d,w)=>this.bindToMotionValue(w,d)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(gv.current||cC(),this.shouldReduceMotion=du.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(o=this.parent)==null||o.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var s;this.projection&&this.projection.unmount(),ss(this.notifyUpdate),ss(this.render),this.valueSubscriptions.forEach(i=>i()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(s=this.parent)==null||s.removeChild(this);for(const i in this.events)this.events[i].clear();for(const i in this.features){const o=this.features[i];o&&(o.unmount(),o.isMounted=!1)}this.current=null}addChild(s){this.children.add(s),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(s)}removeChild(s){this.children.delete(s),this.enteringChildren&&this.enteringChildren.delete(s)}bindToMotionValue(s,i){if(this.valueSubscriptions.has(s)&&this.valueSubscriptions.get(s)(),i.accelerate&&Yg.has(s)&&this.current instanceof HTMLElement){const{factory:g,keyframes:a,times:l,ease:p,duration:m}=i.accelerate,u=new Xg({element:this.current,name:s,keyframes:a,times:l,ease:p,duration:It(m)}),x=g(u);this.valueSubscriptions.set(s,()=>{x(),u.cancel()});return}const o=vi.has(s);o&&this.onBindTransform&&this.onBindTransform();const d=i.on("change",g=>{this.latestValues[s]=g,this.props.onUpdate&&Ae.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let w;typeof window<"u"&&window.MotionCheckAppearSync&&(w=window.MotionCheckAppearSync(this,s,i)),this.valueSubscriptions.set(s,()=>{d(),w&&w(),i.owner&&i.stop()})}sortNodePosition(s){return!this.current||!this.sortInstanceNodePosition||this.type!==s.type?0:this.sortInstanceNodePosition(this.current,s.current)}updateFeatures(){let s="animation";for(s in ua){const i=ua[s];if(!i)continue;const{isEnabled:o,Feature:d}=i;if(!this.features[s]&&d&&o(this.props)&&(this.features[s]=new d(this)),this.features[s]){const w=this.features[s];w.isMounted?w.update():(w.mount(),w.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ze()}getStaticValue(s){return this.latestValues[s]}setStaticValue(s,i){this.latestValues[s]=i}update(s,i){(s.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=s,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let o=0;o<Kp.length;o++){const d=Kp[o];this.propEventSubscriptions[d]&&(this.propEventSubscriptions[d](),delete this.propEventSubscriptions[d]);const w="on"+d,g=s[w];g&&(this.propEventSubscriptions[d]=this.on(d,g))}this.prevMotionValues=aC(this,this.scrapeMotionValuesFromProps(s,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(s){return this.props.variants?this.props.variants[s]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(s){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(s),()=>i.variantChildren.delete(s)}addValue(s,i){const o=this.values.get(s);i!==o&&(o&&this.removeValue(s),this.bindToMotionValue(s,i),this.values.set(s,i),this.latestValues[s]=i.get())}removeValue(s){this.values.delete(s);const i=this.valueSubscriptions.get(s);i&&(i(),this.valueSubscriptions.delete(s)),delete this.latestValues[s],this.removeValueFromRenderState(s,this.renderState)}hasValue(s){return this.values.has(s)}getValue(s,i){if(this.props.values&&this.props.values[s])return this.props.values[s];let o=this.values.get(s);return o===void 0&&i!==void 0&&(o=fi(i===null?void 0:i,{owner:this}),this.addValue(s,o)),o}readValue(s,i){let o=this.latestValues[s]!==void 0||!this.current?this.latestValues[s]:this.getBaseTargetFromProps(this.props,s)??this.readValueFromInstance(this.current,s,this.options);return o!=null&&(typeof o=="string"&&(mg(o)||vg(o))?o=parseFloat(o):!nC(o)&&sr.test(i)&&(o=lv(s,i)),this.setBaseTarget(s,lt(o)?o.get():o)),lt(o)?o.get():o}setBaseTarget(s,i){this.baseTarget[s]=i}getBaseTarget(s){var w;const{initial:i}=this.props;let o;if(typeof i=="string"||typeof i=="object"){const g=$u(this.props,i,(w=this.presenceContext)==null?void 0:w.custom);g&&(o=g[s])}if(i&&o!==void 0)return o;const d=this.getBaseTargetFromProps(this.props,s);return d!==void 0&&!lt(d)?d:this.initialValues[s]!==void 0&&o===void 0?void 0:this.baseTarget[s]}on(s,i){return this.events[s]||(this.events[s]=new Au),this.events[s].add(i)}notify(s,...i){this.events[s]&&this.events[s].notify(...i)}scheduleRenderMicrotask(){qu.render(this.render)}}class yv extends dC{constructor(){super(...arguments),this.KeyframeResolver=F1}sortInstanceNodePosition(s,i){return s.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(s,i){const o=s.style;return o?o[i]:void 0}removeValueFromRenderState(s,{vars:i,style:o}){delete i[s],delete o[s]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:s}=this.props;lt(s)&&(this.childSubscription=s.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class os{constructor(s){this.isMounted=!1,this.node=s}update(){}}function _v({top:t,left:s,right:i,bottom:o}){return{x:{min:s,max:i},y:{min:t,max:o}}}function hC({x:t,y:s}){return{top:s.min,right:t.max,bottom:s.max,left:t.min}}function fC(t,s){if(!s)return t;const i=s({x:t.left,y:t.top}),o=s({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function Nc(t){return t===void 0||t===1}function hu({scale:t,scaleX:s,scaleY:i}){return!Nc(t)||!Nc(s)||!Nc(i)}function ks(t){return hu(t)||xv(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function xv(t){return qp(t.x)||qp(t.y)}function qp(t){return t&&t!=="0%"}function da(t,s,i){const o=t-i,d=s*o;return i+d}function Gp(t,s,i,o,d){return d!==void 0&&(t=da(t,d,o)),da(t,i,o)+s}function fu(t,s=0,i=1,o,d){t.min=Gp(t.min,s,i,o,d),t.max=Gp(t.max,s,i,o,d)}function wv(t,{x:s,y:i}){fu(t.x,s.translate,s.scale,s.originPoint),fu(t.y,i.translate,i.scale,i.originPoint)}const Xp=.999999999999,Jp=1.0000000000001;function pC(t,s,i,o=!1){var a;const d=i.length;if(!d)return;s.x=s.y=1;let w,g;for(let l=0;l<d;l++){w=i[l],g=w.projectionDelta;const{visualElement:p}=w.options;p&&p.props.style&&p.props.style.display==="contents"||(o&&w.options.layoutScroll&&w.scroll&&w!==w.root&&(hr(t.x,-w.scroll.offset.x),hr(t.y,-w.scroll.offset.y)),g&&(s.x*=g.x.scale,s.y*=g.y.scale,wv(t,g)),o&&ks(w.latestValues)&&Yo(t,w.latestValues,(a=w.layout)==null?void 0:a.layoutBox))}s.x<Jp&&s.x>Xp&&(s.x=1),s.y<Jp&&s.y>Xp&&(s.y=1)}function hr(t,s){t.min+=s,t.max+=s}function Yp(t,s,i,o,d=.5){const w=Ue(t.min,t.max,d);fu(t,s,i,w,o)}function Qp(t,s){return typeof t=="string"?parseFloat(t)/100*(s.max-s.min):t}function Yo(t,s,i){const o=i??t;Yp(t.x,Qp(s.x,o.x),s.scaleX,s.scale,s.originX),Yp(t.y,Qp(s.y,o.y),s.scaleY,s.scale,s.originY)}function Sv(t,s){return _v(fC(t.getBoundingClientRect(),s))}function mC(t,s,i){const o=Sv(t,i),{scroll:d}=s;return d&&(hr(o.x,d.offset.x),hr(o.y,d.offset.y)),o}const gC={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vC=gi.length;function yC(t,s,i){let o="",d=!0;for(let w=0;w<vC;w++){const g=gi[w],a=t[g];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(g.startsWith("scale")?1:0);else{const p=parseFloat(a);l=g.startsWith("scale")?p===1:p===0}if(!l||i){const p=uv(a,Ku[g]);if(!l){d=!1;const m=gC[g]||g;o+=`${m}(${p}) `}i&&(s[g]=p)}}return o=o.trim(),i?o=i(s,d?"":o):d&&(o="none"),o}function Qu(t,s,i){const{style:o,vars:d,transformOrigin:w}=t;let g=!1,a=!1;for(const l in s){const p=s[l];if(vi.has(l)){g=!0;continue}else if(Ag(l)){d[l]=p;continue}else{const m=uv(p,Ku[l]);l.startsWith("origin")?(a=!0,w[l]=m):o[l]=m}}if(s.transform||(g||i?o.transform=yC(s,t.transform,i):o.transform&&(o.transform="none")),a){const{originX:l="50%",originY:p="50%",originZ:m=0}=w;o.transformOrigin=`${l} ${p} ${m}`}}function bv(t,{style:s,vars:i},o,d){const w=t.style;let g;for(g in s)w[g]=s[g];d==null||d.applyProjectionStyles(w,o);for(g in i)w.setProperty(g,i[g])}function Zp(t,s){return s.max===s.min?0:t/(s.max-s.min)*100}const sn={correct:(t,s)=>{if(!s.target)return t;if(typeof t=="string")if(ve.test(t))t=parseFloat(t);else return t;const i=Zp(t,s.target.x),o=Zp(t,s.target.y);return`${i}% ${o}%`}},_C={correct:(t,{treeScale:s,projectionDelta:i})=>{const o=t,d=sr.parse(t);if(d.length>5)return o;const w=sr.createTransformer(t),g=typeof d[0]!="number"?1:0,a=i.x.scale*s.x,l=i.y.scale*s.y;d[0+g]/=a,d[1+g]/=l;const p=Ue(a,l,.5);return typeof d[2+g]=="number"&&(d[2+g]/=p),typeof d[3+g]=="number"&&(d[3+g]/=p),w(d)}},pu={borderRadius:{...sn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:sn,borderTopRightRadius:sn,borderBottomLeftRadius:sn,borderBottomRightRadius:sn,boxShadow:_C};function Cv(t,{layout:s,layoutId:i}){return vi.has(t)||t.startsWith("origin")||(s||i!==void 0)&&(!!pu[t]||t==="opacity")}function Zu(t,s,i){var g;const o=t.style,d=s==null?void 0:s.style,w={};if(!o)return w;for(const a in o)(lt(o[a])||d&<(d[a])||Cv(a,t)||((g=i==null?void 0:i.getValue(a))==null?void 0:g.liveStyle)!==void 0)&&(w[a]=o[a]);return w}function xC(t){return window.getComputedStyle(t)}class wC extends yv{constructor(){super(...arguments),this.type="html",this.renderInstance=bv}readValueFromInstance(s,i){var o;if(vi.has(i))return(o=this.projection)!=null&&o.isProjecting?eu(i):Ub(s,i);{const d=xC(s),w=(Ag(i)?d.getPropertyValue(i):d[i])||0;return typeof w=="string"?w.trim():w}}measureInstanceViewportBox(s,{transformPagePoint:i}){return Sv(s,i)}build(s,i,o){Qu(s,i,o.transformTemplate)}scrapeMotionValuesFromProps(s,i,o){return Zu(s,i,o)}}const SC={offset:"stroke-dashoffset",array:"stroke-dasharray"},bC={offset:"strokeDashoffset",array:"strokeDasharray"};function CC(t,s,i=1,o=0,d=!0){t.pathLength=1;const w=d?SC:bC;t[w.offset]=`${-o}`,t[w.array]=`${s} ${i}`}const kC=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function kv(t,{attrX:s,attrY:i,attrScale:o,pathLength:d,pathSpacing:w=1,pathOffset:g=0,...a},l,p,m){if(Qu(t,a,p),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:u,style:x}=t;u.transform&&(x.transform=u.transform,delete u.transform),(x.transform||u.transformOrigin)&&(x.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),x.transform&&(x.transformBox=(m==null?void 0:m.transformBox)??"fill-box",delete u.transformBox);for(const b of kC)u[b]!==void 0&&(x[b]=u[b],delete u[b]);s!==void 0&&(u.x=s),i!==void 0&&(u.y=i),o!==void 0&&(u.scale=o),d!==void 0&&CC(u,d,w,g,!1)}const Ev=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Tv=t=>typeof t=="string"&&t.toLowerCase()==="svg";function EC(t,s,i,o){bv(t,s,void 0,o);for(const d in s.attrs)t.setAttribute(Ev.has(d)?d:zu(d),s.attrs[d])}function Rv(t,s,i){const o=Zu(t,s,i);for(const d in t)if(lt(t[d])||lt(s[d])){const w=gi.indexOf(d)!==-1?"attr"+d.charAt(0).toUpperCase()+d.substring(1):d;o[w]=t[d]}return o}class TC extends yv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ze}getBaseTargetFromProps(s,i){return s[i]}readValueFromInstance(s,i){if(vi.has(i)){const o=av(i);return o&&o.default||0}return i=Ev.has(i)?i:zu(i),s.getAttribute(i)}scrapeMotionValuesFromProps(s,i,o){return Rv(s,i,o)}build(s,i,o){kv(s,i,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(s,i,o,d){EC(s,i,o,d)}mount(s){this.isSVGTag=Tv(s.tagName),super.mount(s)}}const RC=Yu.length;function Pv(t){if(!t)return;if(!t.isControllingVariants){const i=t.parent?Pv(t.parent)||{}:{};return t.props.initial!==void 0&&(i.initial=t.props.initial),i}const s={};for(let i=0;i<RC;i++){const o=Yu[i],d=t.props[o];(vn(d)||d===!1)&&(s[o]=d)}return s}function Lv(t,s){if(!Array.isArray(s))return!1;const i=s.length;if(i!==t.length)return!1;for(let o=0;o<i;o++)if(s[o]!==t[o])return!1;return!0}const PC=[...Ju].reverse(),LC=Ju.length;function DC(t){return s=>Promise.all(s.map(({animation:i,options:o})=>R1(t,i,o)))}function AC(t){let s=DC(t),i=em(),o=!0,d=!1;const w=p=>(m,u)=>{var b;const x=As(t,u,p==="exit"?(b=t.presenceContext)==null?void 0:b.custom:void 0);if(x){const{transition:E,transitionEnd:S,...c}=x;m={...m,...c,...S}}return m};function g(p){s=p(t)}function a(p){const{props:m}=t,u=Pv(t.parent)||{},x=[],b=new Set;let E={},S=1/0;for(let y=0;y<LC;y++){const h=PC[y],v=i[h],C=m[h]!==void 0?m[h]:u[h],R=vn(C),L=h===p?v.isActive:null;L===!1&&(S=y);let D=C===u[h]&&C!==m[h]&&R;if(D&&(o||d)&&t.manuallyAnimateOnMount&&(D=!1),v.protectedKeys={...E},!v.isActive&&L===null||!C&&!v.prevProp||wa(C)||typeof C=="boolean")continue;if(h==="exit"&&v.isActive&&L!==!0){v.prevResolvedValues&&(E={...E,...v.prevResolvedValues});continue}const T=jC(v.prevProp,C);let A=T||h===p&&v.isActive&&!D&&R||y>S&&R,I=!1;const H=Array.isArray(C)?C:[C];let $=H.reduce(w(h),{});L===!1&&($={});const{prevResolvedValues:N={}}=v,J={...N,...$},K=G=>{A=!0,b.has(G)&&(I=!0,b.delete(G)),v.needsAnimating[G]=!0;const j=t.getValue(G);j&&(j.liveStyle=!1)};for(const G in J){const j=$[G],F=N[G];if(E.hasOwnProperty(G))continue;let M=!1;ou(j)&&ou(F)?M=!Lv(j,F):M=j!==F,M?j!=null?K(G):b.add(G):j!==void 0&&b.has(G)?K(G):v.protectedKeys[G]=!0}v.prevProp=C,v.prevResolvedValues=$,v.isActive&&(E={...E,...$}),(o||d)&&t.blockInitialAnimation&&(A=!1);const z=D&&T;A&&(!z||I)&&x.push(...H.map(G=>{const j={type:h};if(typeof G=="string"&&(o||d)&&!z&&t.manuallyAnimateOnMount&&t.parent){const{parent:F}=t,M=As(F,G);if(F.enteringChildren&&M){const{delayChildren:U}=M.transition||{};j.delay=Qg(F.enteringChildren,t,U)}}return{animation:G,options:j}}))}if(b.size){const y={};if(typeof m.initial!="boolean"){const h=As(t,Array.isArray(m.initial)?m.initial[0]:m.initial);h&&h.transition&&(y.transition=h.transition)}b.forEach(h=>{const v=t.getBaseTarget(h),C=t.getValue(h);C&&(C.liveStyle=!0),y[h]=v??null}),x.push({animation:y})}let c=!!x.length;return o&&(m.initial===!1||m.initial===m.animate)&&!t.manuallyAnimateOnMount&&(c=!1),o=!1,d=!1,c?s(x):Promise.resolve()}function l(p,m){var x;if(i[p].isActive===m)return Promise.resolve();(x=t.variantChildren)==null||x.forEach(b=>{var E;return(E=b.animationState)==null?void 0:E.setActive(p,m)}),i[p].isActive=m;const u=a(p);for(const b in i)i[b].protectedKeys={};return u}return{animateChanges:a,setActive:l,setAnimateFunction:g,getState:()=>i,reset:()=>{i=em(),d=!0}}}function jC(t,s){return typeof s=="string"?s!==t:Array.isArray(s)?!Lv(s,t):!1}function bs(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function em(){return{animate:bs(!0),whileInView:bs(),whileHover:bs(),whileTap:bs(),whileDrag:bs(),whileFocus:bs(),exit:bs()}}function mu(t,s){t.min=s.min,t.max=s.max}function tr(t,s){mu(t.x,s.x),mu(t.y,s.y)}function tm(t,s){t.translate=s.translate,t.scale=s.scale,t.originPoint=s.originPoint,t.origin=s.origin}const Dv=1e-4,MC=1-Dv,OC=1+Dv,Av=.01,IC=0-Av,NC=0+Av;function _t(t){return t.max-t.min}function BC(t,s,i){return Math.abs(t-s)<=i}function rm(t,s,i,o=.5){t.origin=o,t.originPoint=Ue(s.min,s.max,t.origin),t.scale=_t(i)/_t(s),t.translate=Ue(i.min,i.max,t.origin)-t.originPoint,(t.scale>=MC&&t.scale<=OC||isNaN(t.scale))&&(t.scale=1),(t.translate>=IC&&t.translate<=NC||isNaN(t.translate))&&(t.translate=0)}function dn(t,s,i,o){rm(t.x,s.x,i.x,o?o.originX:void 0),rm(t.y,s.y,i.y,o?o.originY:void 0)}function sm(t,s,i,o=0){const d=o?Ue(i.min,i.max,o):i.min;t.min=d+s.min,t.max=t.min+_t(s)}function FC(t,s,i,o){sm(t.x,s.x,i.x,o==null?void 0:o.x),sm(t.y,s.y,i.y,o==null?void 0:o.y)}function im(t,s,i,o=0){const d=o?Ue(i.min,i.max,o):i.min;t.min=s.min-d,t.max=t.min+_t(s)}function ha(t,s,i,o){im(t.x,s.x,i.x,o==null?void 0:o.x),im(t.y,s.y,i.y,o==null?void 0:o.y)}function nm(t,s,i,o,d){return t-=s,t=da(t,1/i,o),d!==void 0&&(t=da(t,1/d,o)),t}function HC(t,s=0,i=1,o=.5,d,w=t,g=t){if(mr.test(s)&&(s=parseFloat(s),s=Ue(g.min,g.max,s/100)-g.min),typeof s!="number")return;let a=Ue(w.min,w.max,o);t===w&&(a-=s),t.min=nm(t.min,s,i,a,d),t.max=nm(t.max,s,i,a,d)}function om(t,s,[i,o,d],w,g){HC(t,s[i],s[o],s[d],s.scale,w,g)}const UC=["x","scaleX","originX"],WC=["y","scaleY","originY"];function am(t,s,i,o){om(t.x,s,UC,i?i.x:void 0,o?o.x:void 0),om(t.y,s,WC,i?i.y:void 0,o?o.y:void 0)}function lm(t){return t.translate===0&&t.scale===1}function jv(t){return lm(t.x)&&lm(t.y)}function cm(t,s){return t.min===s.min&&t.max===s.max}function VC(t,s){return cm(t.x,s.x)&&cm(t.y,s.y)}function um(t,s){return Math.round(t.min)===Math.round(s.min)&&Math.round(t.max)===Math.round(s.max)}function Mv(t,s){return um(t.x,s.x)&&um(t.y,s.y)}function dm(t){return _t(t.x)/_t(t.y)}function hm(t,s){return t.translate===s.translate&&t.scale===s.scale&&t.originPoint===s.originPoint}function dr(t){return[t("x"),t("y")]}function $C(t,s,i){let o="";const d=t.x.translate/s.x,w=t.y.translate/s.y,g=(i==null?void 0:i.z)||0;if((d||w||g)&&(o=`translate3d(${d}px, ${w}px, ${g}px) `),(s.x!==1||s.y!==1)&&(o+=`scale(${1/s.x}, ${1/s.y}) `),i){const{transformPerspective:p,rotate:m,rotateX:u,rotateY:x,skewX:b,skewY:E}=i;p&&(o=`perspective(${p}px) ${o}`),m&&(o+=`rotate(${m}deg) `),u&&(o+=`rotateX(${u}deg) `),x&&(o+=`rotateY(${x}deg) `),b&&(o+=`skewX(${b}deg) `),E&&(o+=`skewY(${E}deg) `)}const a=t.x.scale*s.x,l=t.y.scale*s.y;return(a!==1||l!==1)&&(o+=`scale(${a}, ${l})`),o||"none"}const Ov=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],zC=Ov.length,fm=t=>typeof t=="string"?parseFloat(t):t,pm=t=>typeof t=="number"||ve.test(t);function KC(t,s,i,o,d,w){d?(t.opacity=Ue(0,i.opacity??1,qC(o)),t.opacityExit=Ue(s.opacity??1,0,GC(o))):w&&(t.opacity=Ue(s.opacity??1,i.opacity??1,o));for(let g=0;g<zC;g++){const a=Ov[g];let l=mm(s,a),p=mm(i,a);if(l===void 0&&p===void 0)continue;l||(l=0),p||(p=0),l===0||p===0||pm(l)===pm(p)?(t[a]=Math.max(Ue(fm(l),fm(p),o),0),(mr.test(p)||mr.test(l))&&(t[a]+="%")):t[a]=p}(s.rotate||i.rotate)&&(t.rotate=Ue(s.rotate||0,i.rotate||0,o))}function mm(t,s){return t[s]!==void 0?t[s]:t.borderRadius}const qC=Iv(0,.5,Eg),GC=Iv(.5,.95,Kt);function Iv(t,s,i){return o=>o<t?0:o>s?1:i(mn(t,s,o))}function XC(t,s,i){const o=lt(t)?t:fi(t);return o.start(Vu("",o,s,i)),o.animation}function yn(t,s,i,o={passive:!0}){return t.addEventListener(s,i,o),()=>t.removeEventListener(s,i)}const JC=(t,s)=>t.depth-s.depth;class YC{constructor(){this.children=[],this.isDirty=!1}add(s){Lu(this.children,s),this.isDirty=!0}remove(s){na(this.children,s),this.isDirty=!0}forEach(s){this.isDirty&&this.children.sort(JC),this.isDirty=!1,this.children.forEach(s)}}function QC(t,s){const i=yt.now(),o=({timestamp:d})=>{const w=d-i;w>=s&&(ss(o),t(w-s))};return Ae.setup(o,!0),()=>ss(o)}function Qo(t){return lt(t)?t.get():t}class ZC{constructor(){this.members=[]}add(s){Lu(this.members,s);for(let i=this.members.length-1;i>=0;i--){const o=this.members[i];if(o===s||o===this.lead||o===this.prevLead)continue;const d=o.instance;(!d||d.isConnected===!1)&&!o.snapshot&&(na(this.members,o),o.unmount())}s.scheduleRender()}remove(s){if(na(this.members,s),s===this.prevLead&&(this.prevLead=void 0),s===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(s){var i;for(let o=this.members.indexOf(s)-1;o>=0;o--){const d=this.members[o];if(d.isPresent!==!1&&((i=d.instance)==null?void 0:i.isConnected)!==!1)return this.promote(d),!0}return!1}promote(s,i){var d;const o=this.lead;if(s!==o&&(this.prevLead=o,this.lead=s,s.show(),o)){o.updateSnapshot(),s.scheduleRender();const{layoutDependency:w}=o.options,{layoutDependency:g}=s.options;(w===void 0||w!==g)&&(s.resumeFrom=o,i&&(o.preserveOpacity=!0),o.snapshot&&(s.snapshot=o.snapshot,s.snapshot.latestValues=o.animationValues||o.latestValues),(d=s.root)!=null&&d.isUpdating&&(s.isLayoutDirty=!0)),s.options.crossfade===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(s=>{var i,o,d,w,g;(o=(i=s.options).onExitComplete)==null||o.call(i),(g=(d=s.resumingFrom)==null?void 0:(w=d.options).onExitComplete)==null||g.call(w)})}scheduleRender(){this.members.forEach(s=>s.instance&&s.scheduleRender(!1))}removeLeadSnapshot(){var s;(s=this.lead)!=null&&s.snapshot&&(this.lead.snapshot=void 0)}}const Zo={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Bc=["","X","Y","Z"],ek=1e3;let tk=0;function Fc(t,s,i,o){const{latestValues:d}=s;d[t]&&(i[t]=d[t],s.setStaticValue(t,0),o&&(o[t]=0))}function Nv(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:s}=t.options;if(!s)return;const i=sv(s);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:d,layoutId:w}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",Ae,!(d||w))}const{parent:o}=t;o&&!o.hasCheckedOptimisedAppear&&Nv(o)}function Bv({attachResizeListener:t,defaultParent:s,measureScroll:i,checkIsScrollRoot:o,resetTransform:d}){return class{constructor(g={},a=s==null?void 0:s()){this.id=tk++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ik),this.nodes.forEach(uk),this.nodes.forEach(dk),this.nodes.forEach(nk)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=g,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new YC)}addEventListener(g,a){return this.eventHandlers.has(g)||this.eventHandlers.set(g,new Au),this.eventHandlers.get(g).add(a)}notifyListeners(g,...a){const l=this.eventHandlers.get(g);l&&l.notify(...a)}hasListeners(g){return this.eventHandlers.has(g)}mount(g){if(this.instance)return;this.isSVG=Xu(g)&&!sC(g),this.instance=g;const{layoutId:a,layout:l,visualElement:p}=this.options;if(p&&!p.current&&p.mount(g),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let m,u=0;const x=()=>this.root.updateBlockedByResize=!1;Ae.read(()=>{u=window.innerWidth}),t(g,()=>{const b=window.innerWidth;b!==u&&(u=b,this.root.updateBlockedByResize=!0,m&&m(),m=QC(x,250),Zo.hasAnimatedSinceResize&&(Zo.hasAnimatedSinceResize=!1,this.nodes.forEach(ym)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&p&&(a||l)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:u,hasRelativeLayoutChanged:x,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const E=this.options.transition||p.getDefaultTransition()||gk,{onLayoutAnimationStart:S,onLayoutAnimationComplete:c}=p.getProps(),y=!this.targetLayout||!Mv(this.targetLayout,b),h=!u&&x;if(this.options.layoutRoot||this.resumeFrom||h||u&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Wu(E,"layout"),onPlay:S,onComplete:c};(p.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(m,h)}else u||ym(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const g=this.getStack();g&&g.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ss(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(hk),this.animationId++)}getTransformTemplate(){const{visualElement:g}=this.options;return g&&g.getProps().transformTemplate}willUpdate(g=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Nv(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const u=this.path[m];u.shouldResetTransform=!0,(typeof u.latestValues.x=="string"||typeof u.latestValues.y=="string")&&(u.isLayoutDirty=!0),u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const p=this.getTransformTemplate();this.prevTransformTemplateValue=p?p(this.latestValues,""):void 0,this.updateSnapshot(),g&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(ak),this.nodes.forEach(gm);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(vm);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(lk),this.nodes.forEach(ck),this.nodes.forEach(rk),this.nodes.forEach(sk)):this.nodes.forEach(vm),this.clearAllSnapshots();const a=yt.now();at.delta=vr(0,1e3/60,a-at.timestamp),at.timestamp=a,at.isProcessing=!0,Lc.update.process(at),Lc.preRender.process(at),Lc.render.process(at),at.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ok),this.sharedNodes.forEach(fk)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ae.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ae.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!_t(this.snapshot.measuredBox.x)&&!_t(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const g=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Ze()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,g?g.layoutBox:void 0)}updateScroll(g="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===g&&(a=!1),a&&this.instance){const l=o(this.instance);this.scroll={animationId:this.root.animationId,phase:g,isRoot:l,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!d)return;const g=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!jv(this.projectionDelta),l=this.getTransformTemplate(),p=l?l(this.latestValues,""):void 0,m=p!==this.prevTransformTemplateValue;g&&this.instance&&(a||ks(this.latestValues)||m)&&(d(this.instance,p),this.shouldResetTransform=!1,this.scheduleRender())}measure(g=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return g&&(l=this.removeTransform(l)),vk(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var p;const{visualElement:g}=this.options;if(!g)return Ze();const a=g.measureViewportBox();if(!(((p=this.scroll)==null?void 0:p.wasRoot)||this.path.some(yk))){const{scroll:m}=this.root;m&&(hr(a.x,m.offset.x),hr(a.y,m.offset.y))}return a}removeElementScroll(g){var l;const a=Ze();if(tr(a,g),(l=this.scroll)!=null&&l.wasRoot)return a;for(let p=0;p<this.path.length;p++){const m=this.path[p],{scroll:u,options:x}=m;m!==this.root&&u&&x.layoutScroll&&(u.wasRoot&&tr(a,g),hr(a.x,u.offset.x),hr(a.y,u.offset.y))}return a}applyTransform(g,a=!1,l){var m,u;const p=l||Ze();tr(p,g);for(let x=0;x<this.path.length;x++){const b=this.path[x];!a&&b.options.layoutScroll&&b.scroll&&b!==b.root&&(hr(p.x,-b.scroll.offset.x),hr(p.y,-b.scroll.offset.y)),ks(b.latestValues)&&Yo(p,b.latestValues,(m=b.layout)==null?void 0:m.layoutBox)}return ks(this.latestValues)&&Yo(p,this.latestValues,(u=this.layout)==null?void 0:u.layoutBox),p}removeTransform(g){var l;const a=Ze();tr(a,g);for(let p=0;p<this.path.length;p++){const m=this.path[p];if(!ks(m.latestValues))continue;let u;m.instance&&(hu(m.latestValues)&&m.updateSnapshot(),u=Ze(),tr(u,m.measurePageBox())),am(a,m.latestValues,(l=m.snapshot)==null?void 0:l.layoutBox,u)}return ks(this.latestValues)&&am(a,this.latestValues),a}setTargetDelta(g){this.targetDelta=g,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(g){this.options={...this.options,...g,crossfade:g.crossfade!==void 0?g.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==at.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(g=!1){var b;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(g||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(b=this.parent)!=null&&b.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:u}=this.options;if(!this.layout||!(m||u))return;this.resolvedRelativeTargetAt=at.timestamp;const x=this.getClosestProjectingParent();x&&this.linkedParentVersion!==x.layoutVersion&&!x.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&x&&x.layout?this.createRelativeTarget(x,this.layout.layoutBox,x.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ze(),this.targetWithTransforms=Ze()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),FC(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):tr(this.target,this.layout.layoutBox),wv(this.target,this.targetDelta)):tr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?this.createRelativeTarget(x,this.target,x.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||hu(this.parent.latestValues)||xv(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(g,a,l){this.relativeParent=g,this.linkedParentVersion=g.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ze(),this.relativeTargetOrigin=Ze(),ha(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),tr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var E;const g=this.getLead(),a=!!this.resumingFrom||this!==g;let l=!0;if((this.isProjectionDirty||(E=this.parent)!=null&&E.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===at.timestamp&&(l=!1),l)return;const{layout:p,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||m))return;tr(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,x=this.treeScale.y;pC(this.layoutCorrected,this.treeScale,this.path,a),g.layout&&!g.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(g.target=g.layout.layoutBox,g.targetWithTransforms=Ze());const{target:b}=g;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(tm(this.prevProjectionDelta.x,this.projectionDelta.x),tm(this.prevProjectionDelta.y,this.projectionDelta.y)),dn(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==x||!hm(this.projectionDelta.x,this.prevProjectionDelta.x)||!hm(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(g=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),g){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=li(),this.projectionDelta=li(),this.projectionDeltaWithTransform=li()}setAnimationOrigin(g,a=!1){const l=this.snapshot,p=l?l.latestValues:{},m={...this.latestValues},u=li();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const x=Ze(),b=l?l.source:void 0,E=this.layout?this.layout.source:void 0,S=b!==E,c=this.getStack(),y=!c||c.members.length<=1,h=!!(S&&!y&&this.options.crossfade===!0&&!this.path.some(mk));this.animationProgress=0;let v;this.mixTargetDelta=C=>{const R=C/1e3;_m(u.x,g.x,R),_m(u.y,g.y,R),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ha(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),pk(this.relativeTarget,this.relativeTargetOrigin,x,R),v&&VC(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=Ze()),tr(v,this.relativeTarget)),S&&(this.animationValues=m,KC(m,p,this.latestValues,R,h,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(g){var a,l,p;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(p=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||p.stop(),this.pendingAnimation&&(ss(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ae.update(()=>{Zo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=fi(0)),this.motionValue.jump(0,!1),this.currentAnimation=XC(this.motionValue,[0,1e3],{...g,velocity:0,isSync:!0,onUpdate:m=>{this.mixTargetDelta(m),g.onUpdate&&g.onUpdate(m)},onStop:()=>{},onComplete:()=>{g.onComplete&&g.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const g=this.getStack();g&&g.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ek),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const g=this.getLead();let{targetWithTransforms:a,target:l,layout:p,latestValues:m}=g;if(!(!a||!l||!p)){if(this!==g&&this.layout&&p&&Fv(this.options.animationType,this.layout.layoutBox,p.layoutBox)){l=this.target||Ze();const u=_t(this.layout.layoutBox.x);l.x.min=g.target.x.min,l.x.max=l.x.min+u;const x=_t(this.layout.layoutBox.y);l.y.min=g.target.y.min,l.y.max=l.y.min+x}tr(a,l),Yo(a,m),dn(this.projectionDeltaWithTransform,this.layoutCorrected,a,m)}}registerSharedNode(g,a){this.sharedNodes.has(g)||this.sharedNodes.set(g,new ZC),this.sharedNodes.get(g).add(a);const p=a.options.initialPromotionConfig;a.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(a):void 0})}isLead(){const g=this.getStack();return g?g.lead===this:!0}getLead(){var a;const{layoutId:g}=this.options;return g?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:g}=this.options;return g?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:g}=this.options;if(g)return this.root.sharedNodes.get(g)}promote({needsReset:g,transition:a,preserveFollowOpacity:l}={}){const p=this.getStack();p&&p.promote(this,l),g&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const g=this.getStack();return g?g.relegate(this):!1}resetSkewAndRotation(){const{visualElement:g}=this.options;if(!g)return;let a=!1;const{latestValues:l}=g;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const p={};l.z&&Fc("z",g,p,this.animationValues);for(let m=0;m<Bc.length;m++)Fc(`rotate${Bc[m]}`,g,p,this.animationValues),Fc(`skew${Bc[m]}`,g,p,this.animationValues);g.render();for(const m in p)g.setStaticValue(m,p[m]),this.animationValues&&(this.animationValues[m]=p[m]);g.scheduleRender()}applyProjectionStyles(g,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){g.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,g.visibility="",g.opacity="",g.pointerEvents=Qo(a==null?void 0:a.pointerEvents)||"",g.transform=l?l(this.latestValues,""):"none";return}const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Qo(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ks(this.latestValues)&&(g.transform=l?l({},""):"none",this.hasProjected=!1);return}g.visibility="";const m=p.animationValues||p.latestValues;this.applyTransformsToTarget();let u=$C(this.projectionDeltaWithTransform,this.treeScale,m);l&&(u=l(m,u)),g.transform=u;const{x,y:b}=this.projectionDelta;g.transformOrigin=`${x.origin*100}% ${b.origin*100}% 0`,p.animationValues?g.opacity=p===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:g.opacity=p===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const E in pu){if(m[E]===void 0)continue;const{correct:S,applyTo:c,isCSSVariable:y}=pu[E],h=u==="none"?m[E]:S(m[E],p);if(c){const v=c.length;for(let C=0;C<v;C++)g[c[C]]=h}else y?this.options.visualElement.renderState.vars[E]=h:g[E]=h}this.options.layoutId&&(g.pointerEvents=p===this?Qo(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(g=>{var a;return(a=g.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(gm),this.root.sharedNodes.clear()}}}function rk(t){t.updateLayout()}function sk(t){var i;const s=((i=t.resumeFrom)==null?void 0:i.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&s&&t.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:d}=t.layout,{animationType:w}=t.options,g=s.source!==t.layout.source;if(w==="size")dr(u=>{const x=g?s.measuredBox[u]:s.layoutBox[u],b=_t(x);x.min=o[u].min,x.max=x.min+b});else if(w==="x"||w==="y"){const u=w==="x"?"y":"x";mu(g?s.measuredBox[u]:s.layoutBox[u],o[u])}else Fv(w,s.layoutBox,o)&&dr(u=>{const x=g?s.measuredBox[u]:s.layoutBox[u],b=_t(o[u]);x.max=x.min+b,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+b)});const a=li();dn(a,o,s.layoutBox);const l=li();g?dn(l,t.applyTransform(d,!0),s.measuredBox):dn(l,o,s.layoutBox);const p=!jv(a);let m=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:x,layout:b}=u;if(x&&b){const E=t.options.layoutAnchor||void 0,S=Ze();ha(S,s.layoutBox,x.layoutBox,E);const c=Ze();ha(c,o,b.layoutBox,E),Mv(S,c)||(m=!0),u.options.layoutRoot&&(t.relativeTarget=c,t.relativeTargetOrigin=S,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:o,snapshot:s,delta:l,layoutDelta:a,hasLayoutChanged:p,hasRelativeLayoutChanged:m})}else if(t.isLead()){const{onExitComplete:o}=t.options;o&&o()}t.options.transition=void 0}function ik(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function nk(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ok(t){t.clearSnapshot()}function gm(t){t.clearMeasurements()}function ak(t){t.isLayoutDirty=!0,t.updateLayout()}function vm(t){t.isLayoutDirty=!1}function lk(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function ck(t){const{visualElement:s}=t.options;s&&s.getProps().onBeforeLayoutMeasure&&s.notify("BeforeLayoutMeasure"),t.resetTransform()}function ym(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function uk(t){t.resolveTargetDelta()}function dk(t){t.calcProjection()}function hk(t){t.resetSkewAndRotation()}function fk(t){t.removeLeadSnapshot()}function _m(t,s,i){t.translate=Ue(s.translate,0,i),t.scale=Ue(s.scale,1,i),t.origin=s.origin,t.originPoint=s.originPoint}function xm(t,s,i,o){t.min=Ue(s.min,i.min,o),t.max=Ue(s.max,i.max,o)}function pk(t,s,i,o){xm(t.x,s.x,i.x,o),xm(t.y,s.y,i.y,o)}function mk(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const gk={duration:.45,ease:[.4,0,.1,1]},wm=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Sm=wm("applewebkit/")&&!wm("chrome/")?Math.round:Kt;function bm(t){t.min=Sm(t.min),t.max=Sm(t.max)}function vk(t){bm(t.x),bm(t.y)}function Fv(t,s,i){return t==="position"||t==="preserve-aspect"&&!BC(dm(s),dm(i),.2)}function yk(t){var s;return t!==t.root&&((s=t.scroll)==null?void 0:s.wasRoot)}const _k=Bv({attachResizeListener:(t,s)=>yn(t,"resize",s),measureScroll:()=>{var t,s;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((s=document.body)==null?void 0:s.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Hc={current:void 0},Hv=Bv({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Hc.current){const t=new _k({});t.mount(window),t.setOptions({layoutScroll:!0}),Hc.current=t}return Hc.current},resetTransform:(t,s)=>{t.style.transform=s!==void 0?s:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ed=W.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Cm(t,s){if(typeof t=="function")return t(s);t!=null&&(t.current=s)}function xk(...t){return s=>{let i=!1;const o=t.map(d=>{const w=Cm(d,s);return!i&&typeof w=="function"&&(i=!0),w});if(i)return()=>{for(let d=0;d<o.length;d++){const w=o[d];typeof w=="function"?w():Cm(t[d],null)}}}}function wk(...t){return W.useCallback(xk(...t),t)}class Sk extends W.Component{getSnapshotBeforeUpdate(s){const i=this.props.childRef.current;if(qo(i)&&s.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const o=i.offsetParent,d=qo(o)&&o.offsetWidth||0,w=qo(o)&&o.offsetHeight||0,g=getComputedStyle(i),a=this.props.sizeRef.current;a.height=parseFloat(g.height),a.width=parseFloat(g.width),a.top=i.offsetTop,a.left=i.offsetLeft,a.right=d-a.width-a.left,a.bottom=w-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function bk({children:t,isPresent:s,anchorX:i,anchorY:o,root:d,pop:w}){var x;const g=W.useId(),a=W.useRef(null),l=W.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:p}=W.useContext(ed),m=((x=t.props)==null?void 0:x.ref)??(t==null?void 0:t.ref),u=wk(a,m);return W.useInsertionEffect(()=>{const{width:b,height:E,top:S,left:c,right:y,bottom:h}=l.current;if(s||w===!1||!a.current||!b||!E)return;const v=i==="left"?`left: ${c}`:`right: ${y}`,C=o==="bottom"?`bottom: ${h}`:`top: ${S}`;a.current.dataset.motionPopId=g;const R=document.createElement("style");p&&(R.nonce=p);const L=d??document.head;return L.appendChild(R),R.sheet&&R.sheet.insertRule(`
|
|
123
|
+
[data-motion-pop-id="${g}"] {
|
|
124
|
+
position: absolute !important;
|
|
125
|
+
width: ${b}px !important;
|
|
126
|
+
height: ${E}px !important;
|
|
127
|
+
${v}px !important;
|
|
128
|
+
${C}px !important;
|
|
129
|
+
}
|
|
130
|
+
`),()=>{var D;(D=a.current)==null||D.removeAttribute("data-motion-pop-id"),L.contains(R)&&L.removeChild(R)}},[s]),_.jsx(Sk,{isPresent:s,childRef:a,sizeRef:l,pop:w,children:w===!1?t:W.cloneElement(t,{ref:u})})}const Ck=({children:t,initial:s,isPresent:i,onExitComplete:o,custom:d,presenceAffectsLayout:w,mode:g,anchorX:a,anchorY:l,root:p})=>{const m=Pu(kk),u=W.useId();let x=!0,b=W.useMemo(()=>(x=!1,{id:u,initial:s,isPresent:i,custom:d,onExitComplete:E=>{m.set(E,!0);for(const S of m.values())if(!S)return;o&&o()},register:E=>(m.set(E,!1),()=>m.delete(E))}),[i,m,o]);return w&&x&&(b={...b}),W.useMemo(()=>{m.forEach((E,S)=>m.set(S,!1))},[i]),W.useEffect(()=>{!i&&!m.size&&o&&o()},[i]),t=_.jsx(bk,{pop:g==="popLayout",isPresent:i,anchorX:a,anchorY:l,root:p,children:t}),_.jsx(_a.Provider,{value:b,children:t})};function kk(){return new Map}function Uv(t=!0){const s=W.useContext(_a);if(s===null)return[!0,null];const{isPresent:i,onExitComplete:o,register:d}=s,w=W.useId();W.useEffect(()=>{if(t)return d(w)},[t]);const g=W.useCallback(()=>t&&o&&o(w),[w,o,t]);return!i&&o?[!1,g]:[!0]}const Uo=t=>t.key||"";function km(t){const s=[];return W.Children.forEach(t,i=>{W.isValidElement(i)&&s.push(i)}),s}const ea=({children:t,custom:s,initial:i=!0,onExitComplete:o,presenceAffectsLayout:d=!0,mode:w="sync",propagate:g=!1,anchorX:a="left",anchorY:l="top",root:p})=>{const[m,u]=Uv(g),x=W.useMemo(()=>km(t),[t]),b=g&&!m?[]:x.map(Uo),E=W.useRef(!0),S=W.useRef(x),c=Pu(()=>new Map),y=W.useRef(new Set),[h,v]=W.useState(x),[C,R]=W.useState(x);pg(()=>{E.current=!1,S.current=x;for(let T=0;T<C.length;T++){const A=Uo(C[T]);b.includes(A)?(c.delete(A),y.current.delete(A)):c.get(A)!==!0&&c.set(A,!1)}},[C,b.length,b.join("-")]);const L=[];if(x!==h){let T=[...x];for(let A=0;A<C.length;A++){const I=C[A],H=Uo(I);b.includes(H)||(T.splice(A,0,I),L.push(I))}return w==="wait"&&L.length&&(T=L),R(km(T)),v(x),null}const{forceRender:D}=W.useContext(Ru);return _.jsx(_.Fragment,{children:C.map(T=>{const A=Uo(T),I=g&&!m?!1:x===C||b.includes(A),H=()=>{if(y.current.has(A))return;if(c.has(A))y.current.add(A),c.set(A,!0);else return;let $=!0;c.forEach(N=>{N||($=!1)}),$&&(D==null||D(),R(S.current),g&&(u==null||u()),o&&o())};return _.jsx(Ck,{isPresent:I,initial:!E.current||i?void 0:!1,custom:s,presenceAffectsLayout:d,mode:w,root:p,onExitComplete:I?void 0:H,anchorX:a,anchorY:l,children:T},A)})})},Wv=W.createContext({strict:!1}),Em={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Tm=!1;function Ek(){if(Tm)return;const t={};for(const s in Em)t[s]={isEnabled:i=>Em[s].some(o=>!!i[o])};vv(t),Tm=!0}function Vv(){return Ek(),uC()}function Tk(t){const s=Vv();for(const i in t)s[i]={...s[i],...t[i]};vv(s)}const Rk=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function fa(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Rk.has(t)}let $v=t=>!fa(t);function Pk(t){typeof t=="function"&&($v=s=>s.startsWith("on")?!fa(s):t(s))}try{Pk(require("@emotion/is-prop-valid").default)}catch{}function Lk(t,s,i){const o={};for(const d in t)d==="values"&&typeof t.values=="object"||lt(t[d])||($v(d)||i===!0&&fa(d)||!s&&!fa(d)||t.draggable&&d.startsWith("onDrag"))&&(o[d]=t[d]);return o}const ba=W.createContext({});function Dk(t,s){if(Sa(t)){const{initial:i,animate:o}=t;return{initial:i===!1||vn(i)?i:void 0,animate:vn(o)?o:void 0}}return t.inherit!==!1?s:{}}function Ak(t){const{initial:s,animate:i}=Dk(t,W.useContext(ba));return W.useMemo(()=>({initial:s,animate:i}),[Rm(s),Rm(i)])}function Rm(t){return Array.isArray(t)?t.join(" "):t}const td=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function zv(t,s,i){for(const o in s)!lt(s[o])&&!Cv(o,i)&&(t[o]=s[o])}function jk({transformTemplate:t},s){return W.useMemo(()=>{const i=td();return Qu(i,s,t),Object.assign({},i.vars,i.style)},[s])}function Mk(t,s){const i=t.style||{},o={};return zv(o,i,t),Object.assign(o,jk(t,s)),o}function Ok(t,s){const i={},o=Mk(t,s);return t.drag&&t.dragListener!==!1&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=o,i}const Kv=()=>({...td(),attrs:{}});function Ik(t,s,i,o){const d=W.useMemo(()=>{const w=Kv();return kv(w,s,Tv(o),t.transformTemplate,t.style),{...w.attrs,style:{...w.style}}},[s]);if(t.style){const w={};zv(w,t.style,t),d.style={...w,...d.style}}return d}const Nk=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function rd(t){return typeof t!="string"||t.includes("-")?!1:!!(Nk.indexOf(t)>-1||/[A-Z]/u.test(t))}function Bk(t,s,i,{latestValues:o},d,w=!1,g){const l=(g??rd(t)?Ik:Ok)(s,o,d,t),p=Lk(s,typeof t=="string",w),m=t!==W.Fragment?{...p,...l,ref:i}:{},{children:u}=s,x=W.useMemo(()=>lt(u)?u.get():u,[u]);return W.createElement(t,{...m,children:x})}function Fk({scrapeMotionValuesFromProps:t,createRenderState:s},i,o,d){return{latestValues:Hk(i,o,d,t),renderState:s()}}function Hk(t,s,i,o){const d={},w=o(t,{});for(const x in w)d[x]=Qo(w[x]);let{initial:g,animate:a}=t;const l=Sa(t),p=mv(t);s&&p&&!l&&t.inherit!==!1&&(g===void 0&&(g=s.initial),a===void 0&&(a=s.animate));let m=i?i.initial===!1:!1;m=m||g===!1;const u=m?a:g;if(u&&typeof u!="boolean"&&!wa(u)){const x=Array.isArray(u)?u:[u];for(let b=0;b<x.length;b++){const E=$u(t,x[b]);if(E){const{transitionEnd:S,transition:c,...y}=E;for(const h in y){let v=y[h];if(Array.isArray(v)){const C=m?v.length-1:0;v=v[C]}v!==null&&(d[h]=v)}for(const h in S)d[h]=S[h]}}}return d}const qv=t=>(s,i)=>{const o=W.useContext(ba),d=W.useContext(_a),w=()=>Fk(t,s,o,d);return i?w():Pu(w)},Uk=qv({scrapeMotionValuesFromProps:Zu,createRenderState:td}),Wk=qv({scrapeMotionValuesFromProps:Rv,createRenderState:Kv}),Vk=Symbol.for("motionComponentSymbol");function $k(t,s,i){const o=W.useRef(i);W.useInsertionEffect(()=>{o.current=i});const d=W.useRef(null);return W.useCallback(w=>{var a;w&&((a=t.onMount)==null||a.call(t,w));const g=o.current;if(typeof g=="function")if(w){const l=g(w);typeof l=="function"&&(d.current=l)}else d.current?(d.current(),d.current=null):g(w);else g&&(g.current=w);s&&(w?s.mount(w):s.unmount())},[s])}const Gv=W.createContext({});function ii(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function zk(t,s,i,o,d,w){var v,C;const{visualElement:g}=W.useContext(ba),a=W.useContext(Wv),l=W.useContext(_a),p=W.useContext(ed),m=p.reducedMotion,u=p.skipAnimations,x=W.useRef(null),b=W.useRef(!1);o=o||a.renderer,!x.current&&o&&(x.current=o(t,{visualState:s,parent:g,props:i,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:m,skipAnimations:u,isSVG:w}),b.current&&x.current&&(x.current.manuallyAnimateOnMount=!0));const E=x.current,S=W.useContext(Gv);E&&!E.projection&&d&&(E.type==="html"||E.type==="svg")&&Kk(x.current,i,d,S);const c=W.useRef(!1);W.useInsertionEffect(()=>{E&&c.current&&E.update(i,l)});const y=i[rv],h=W.useRef(!!y&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,y))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,y)));return pg(()=>{b.current=!0,E&&(c.current=!0,window.MotionIsMounted=!0,E.updateFeatures(),E.scheduleRenderMicrotask(),h.current&&E.animationState&&E.animationState.animateChanges())}),W.useEffect(()=>{E&&(!h.current&&E.animationState&&E.animationState.animateChanges(),h.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,y)}),h.current=!1),E.enteringChildren=void 0)}),E}function Kk(t,s,i,o){const{layoutId:d,layout:w,drag:g,dragConstraints:a,layoutScroll:l,layoutRoot:p,layoutAnchor:m,layoutCrossfade:u}=s;t.projection=new i(t.latestValues,s["data-framer-portal-id"]?void 0:Xv(t.parent)),t.projection.setOptions({layoutId:d,layout:w,alwaysMeasureLayout:!!g||a&&ii(a),visualElement:t,animationType:typeof w=="string"?w:"both",initialPromotionConfig:o,crossfade:u,layoutScroll:l,layoutRoot:p,layoutAnchor:m})}function Xv(t){if(t)return t.options.allowProjection!==!1?t.projection:Xv(t.parent)}function Uc(t,{forwardMotionProps:s=!1,type:i}={},o,d){o&&Tk(o);const w=i?i==="svg":rd(t),g=w?Wk:Uk;function a(p,m){let u;const x={...W.useContext(ed),...p,layoutId:qk(p)},{isStatic:b}=x,E=Ak(p),S=g(p,b);if(!b&&typeof window<"u"){Gk();const c=Xk(x);u=c.MeasureLayout,E.visualElement=zk(t,S,x,d,c.ProjectionNode,w)}return _.jsxs(ba.Provider,{value:E,children:[u&&E.visualElement?_.jsx(u,{visualElement:E.visualElement,...x}):null,Bk(t,p,$k(S,E.visualElement,m),S,b,s,w)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=W.forwardRef(a);return l[Vk]=t,l}function qk({layoutId:t}){const s=W.useContext(Ru).id;return s&&t!==void 0?s+"-"+t:t}function Gk(t,s){W.useContext(Wv).strict}function Xk(t){const s=Vv(),{drag:i,layout:o}=s;if(!i&&!o)return{};const d={...i,...o};return{MeasureLayout:i!=null&&i.isEnabled(t)||o!=null&&o.isEnabled(t)?d.MeasureLayout:void 0,ProjectionNode:d.ProjectionNode}}function Jk(t,s){if(typeof Proxy>"u")return Uc;const i=new Map,o=(w,g)=>Uc(w,g,t,s),d=(w,g)=>o(w,g);return new Proxy(d,{get:(w,g)=>g==="create"?o:(i.has(g)||i.set(g,Uc(g,void 0,t,s)),i.get(g))})}const Yk=(t,s)=>s.isSVG??rd(t)?new TC(s):new wC(s,{allowProjection:t!==W.Fragment});class Qk extends os{constructor(s){super(s),s.animationState||(s.animationState=AC(s))}updateAnimationControlsSubscription(){const{animate:s}=this.node.getProps();wa(s)&&(this.unmountControls=s.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:s}=this.node.getProps(),{animate:i}=this.node.prevProps||{};s!==i&&this.updateAnimationControlsSubscription()}unmount(){var s;this.node.animationState.reset(),(s=this.unmountControls)==null||s.call(this)}}let Zk=0;class eE extends os{constructor(){super(...arguments),this.id=Zk++,this.isExitComplete=!1}update(){var w;if(!this.node.presenceContext)return;const{isPresent:s,onExitComplete:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||s===o)return;if(s&&o===!1){if(this.isExitComplete){const{initial:g,custom:a}=this.node.getProps();if(typeof g=="string"){const l=As(this.node,g,a);if(l){const{transition:p,transitionEnd:m,...u}=l;for(const x in u)(w=this.node.getValue(x))==null||w.jump(u[x])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const d=this.node.animationState.setActive("exit",!s);i&&!s&&d.then(()=>{this.isExitComplete=!0,i(this.id)})}mount(){const{register:s,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),s&&(this.unmount=s(this.id))}unmount(){}}const tE={animation:{Feature:Qk},exit:{Feature:eE}};function bn(t){return{point:{x:t.pageX,y:t.pageY}}}const rE=t=>s=>Gu(s)&&t(s,bn(s));function hn(t,s,i,o){return yn(t,s,rE(i),o)}const Jv=({current:t})=>t?t.ownerDocument.defaultView:null,Pm=(t,s)=>Math.abs(t-s);function sE(t,s){const i=Pm(t.x,s.x),o=Pm(t.y,s.y);return Math.sqrt(i**2+o**2)}const Lm=new Set(["auto","scroll"]);class Yv{constructor(s,i,{transformPagePoint:o,contextWindow:d=window,dragSnapToOrigin:w=!1,distanceThreshold:g=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Wo(this.lastRawMoveEventInfo,this.transformPagePoint));const b=Wc(this.lastMoveEventInfo,this.history),E=this.startEvent!==null,S=sE(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!E&&!S)return;const{point:c}=b,{timestamp:y}=at;this.history.push({...c,timestamp:y});const{onStart:h,onMove:v}=this.handlers;E||(h&&h(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,b)},this.handlePointerMove=(b,E)=>{this.lastMoveEvent=b,this.lastRawMoveEventInfo=E,this.lastMoveEventInfo=Wo(E,this.transformPagePoint),Ae.update(this.updatePoint,!0)},this.handlePointerUp=(b,E)=>{this.end();const{onEnd:S,onSessionEnd:c,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=Wc(b.type==="pointercancel"?this.lastMoveEventInfo:Wo(E,this.transformPagePoint),this.history);this.startEvent&&S&&S(b,h),c&&c(b,h)},!Gu(s))return;this.dragSnapToOrigin=w,this.handlers=i,this.transformPagePoint=o,this.distanceThreshold=g,this.contextWindow=d||window;const l=bn(s),p=Wo(l,this.transformPagePoint),{point:m}=p,{timestamp:u}=at;this.history=[{...m,timestamp:u}];const{onSessionStart:x}=i;x&&x(s,Wc(p,this.history)),this.removeListeners=xn(hn(this.contextWindow,"pointermove",this.handlePointerMove),hn(this.contextWindow,"pointerup",this.handlePointerUp),hn(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(s){let i=s.parentElement;for(;i;){const o=getComputedStyle(i);(Lm.has(o.overflowX)||Lm.has(o.overflowY))&&this.scrollPositions.set(i,{x:i.scrollLeft,y:i.scrollTop}),i=i.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(s){const i=this.scrollPositions.get(s);if(!i)return;const o=s===window,d=o?{x:window.scrollX,y:window.scrollY}:{x:s.scrollLeft,y:s.scrollTop},w={x:d.x-i.x,y:d.y-i.y};w.x===0&&w.y===0||(o?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=w.x,this.lastMoveEventInfo.point.y+=w.y):this.history.length>0&&(this.history[0].x-=w.x,this.history[0].y-=w.y),this.scrollPositions.set(s,d),Ae.update(this.updatePoint,!0))}updateHandlers(s){this.handlers=s}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ss(this.updatePoint)}}function Wo(t,s){return s?{point:s(t.point)}:t}function Dm(t,s){return{x:t.x-s.x,y:t.y-s.y}}function Wc({point:t},s){return{point:t,delta:Dm(t,Qv(s)),offset:Dm(t,iE(s)),velocity:nE(s,.1)}}function iE(t){return t[0]}function Qv(t){return t[t.length-1]}function nE(t,s){if(t.length<2)return{x:0,y:0};let i=t.length-1,o=null;const d=Qv(t);for(;i>=0&&(o=t[i],!(d.timestamp-o.timestamp>It(s)));)i--;if(!o)return{x:0,y:0};o===t[0]&&t.length>2&&d.timestamp-o.timestamp>It(s)*2&&(o=t[1]);const w=zt(d.timestamp-o.timestamp);if(w===0)return{x:0,y:0};const g={x:(d.x-o.x)/w,y:(d.y-o.y)/w};return g.x===1/0&&(g.x=0),g.y===1/0&&(g.y=0),g}function oE(t,{min:s,max:i},o){return s!==void 0&&t<s?t=o?Ue(s,t,o.min):Math.max(t,s):i!==void 0&&t>i&&(t=o?Ue(i,t,o.max):Math.min(t,i)),t}function Am(t,s,i){return{min:s!==void 0?t.min+s:void 0,max:i!==void 0?t.max+i-(t.max-t.min):void 0}}function aE(t,{top:s,left:i,bottom:o,right:d}){return{x:Am(t.x,i,d),y:Am(t.y,s,o)}}function jm(t,s){let i=s.min-t.min,o=s.max-t.max;return s.max-s.min<t.max-t.min&&([i,o]=[o,i]),{min:i,max:o}}function lE(t,s){return{x:jm(t.x,s.x),y:jm(t.y,s.y)}}function cE(t,s){let i=.5;const o=_t(t),d=_t(s);return d>o?i=mn(s.min,s.max-o,t.min):o>d&&(i=mn(t.min,t.max-d,s.min)),vr(0,1,i)}function uE(t,s){const i={};return s.min!==void 0&&(i.min=s.min-t.min),s.max!==void 0&&(i.max=s.max-t.min),i}const gu=.35;function dE(t=gu){return t===!1?t=0:t===!0&&(t=gu),{x:Mm(t,"left","right"),y:Mm(t,"top","bottom")}}function Mm(t,s,i){return{min:Om(t,s),max:Om(t,i)}}function Om(t,s){return typeof t=="number"?t:t[s]||0}const hE=new WeakMap;class fE{constructor(s){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ze(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=s}start(s,{snapToCursor:i=!1,distanceThreshold:o}={}){const{presenceContext:d}=this.visualElement;if(d&&d.isPresent===!1)return;const w=u=>{i&&this.snapToCursor(bn(u).point),this.stopAnimation()},g=(u,x)=>{const{drag:b,dragPropagation:E,onDragStart:S}=this.getProps();if(b&&!E&&(this.openDragLock&&this.openDragLock(),this.openDragLock=H1(b),!this.openDragLock))return;this.latestPointerEvent=u,this.latestPanInfo=x,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),dr(y=>{let h=this.getAxisMotionValue(y).get()||0;if(mr.test(h)){const{projection:v}=this.visualElement;if(v&&v.layout){const C=v.layout.layoutBox[y];C&&(h=_t(C)*(parseFloat(h)/100))}}this.originPoint[y]=h}),S&&Ae.update(()=>S(u,x),!1,!0),au(this.visualElement,"transform");const{animationState:c}=this.visualElement;c&&c.setActive("whileDrag",!0)},a=(u,x)=>{this.latestPointerEvent=u,this.latestPanInfo=x;const{dragPropagation:b,dragDirectionLock:E,onDirectionLock:S,onDrag:c}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:y}=x;if(E&&this.currentDirection===null){this.currentDirection=mE(y),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",x.point,y),this.updateAxis("y",x.point,y),this.visualElement.render(),c&&Ae.update(()=>c(u,x),!1,!0)},l=(u,x)=>{this.latestPointerEvent=u,this.latestPanInfo=x,this.stop(u,x),this.latestPointerEvent=null,this.latestPanInfo=null},p=()=>{const{dragSnapToOrigin:u}=this.getProps();(u||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new Yv(s,{onSessionStart:w,onStart:g,onMove:a,onSessionEnd:l,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:o,contextWindow:Jv(this.visualElement),element:this.visualElement.current})}stop(s,i){const o=s||this.latestPointerEvent,d=i||this.latestPanInfo,w=this.isDragging;if(this.cancel(),!w||!d||!o)return;const{velocity:g}=d;this.startAnimation(g);const{onDragEnd:a}=this.getProps();a&&Ae.postRender(()=>a(o,d))}cancel(){this.isDragging=!1;const{projection:s,animationState:i}=this.visualElement;s&&(s.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(s,i,o){const{drag:d}=this.getProps();if(!o||!Vo(s,d,this.currentDirection))return;const w=this.getAxisMotionValue(s);let g=this.originPoint[s]+o[s];this.constraints&&this.constraints[s]&&(g=oE(g,this.constraints[s],this.elastic[s])),w.set(g)}resolveConstraints(){var w;const{dragConstraints:s,dragElastic:i}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(w=this.visualElement.projection)==null?void 0:w.layout,d=this.constraints;s&&ii(s)?this.constraints||(this.constraints=this.resolveRefConstraints()):s&&o?this.constraints=aE(o.layoutBox,s):this.constraints=!1,this.elastic=dE(i),d!==this.constraints&&!ii(s)&&o&&this.constraints&&!this.hasMutatedConstraints&&dr(g=>{this.constraints!==!1&&this.getAxisMotionValue(g)&&(this.constraints[g]=uE(o.layoutBox[g],this.constraints[g]))})}resolveRefConstraints(){const{dragConstraints:s,onMeasureDragConstraints:i}=this.getProps();if(!s||!ii(s))return!1;const o=s.current,{projection:d}=this.visualElement;if(!d||!d.layout)return!1;const w=mC(o,d.root,this.visualElement.getTransformPagePoint());let g=lE(d.layout.layoutBox,w);if(i){const a=i(hC(g));this.hasMutatedConstraints=!!a,a&&(g=_v(a))}return g}startAnimation(s){const{drag:i,dragMomentum:o,dragElastic:d,dragTransition:w,dragSnapToOrigin:g,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},p=dr(m=>{if(!Vo(m,i,this.currentDirection))return;let u=l&&l[m]||{};(g===!0||g===m)&&(u={min:0,max:0});const x=d?200:1e6,b=d?40:1e7,E={type:"inertia",velocity:o?s[m]:0,bounceStiffness:x,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...w,...u};return this.startAxisValueAnimation(m,E)});return Promise.all(p).then(a)}startAxisValueAnimation(s,i){const o=this.getAxisMotionValue(s);return au(this.visualElement,s),o.start(Vu(s,o,0,i,this.visualElement,!1))}stopAnimation(){dr(s=>this.getAxisMotionValue(s).stop())}getAxisMotionValue(s){const i=`_drag${s.toUpperCase()}`,o=this.visualElement.getProps(),d=o[i];return d||this.visualElement.getValue(s,(o.initial?o.initial[s]:void 0)||0)}snapToCursor(s){dr(i=>{const{drag:o}=this.getProps();if(!Vo(i,o,this.currentDirection))return;const{projection:d}=this.visualElement,w=this.getAxisMotionValue(i);if(d&&d.layout){const{min:g,max:a}=d.layout.layoutBox[i],l=w.get()||0;w.set(s[i]-Ue(g,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:s,dragConstraints:i}=this.getProps(),{projection:o}=this.visualElement;if(!ii(i)||!o||!this.constraints)return;this.stopAnimation();const d={x:0,y:0};dr(g=>{const a=this.getAxisMotionValue(g);if(a&&this.constraints!==!1){const l=a.get();d[g]=cE({min:l,max:l},this.constraints[g])}});const{transformTemplate:w}=this.visualElement.getProps();this.visualElement.current.style.transform=w?w({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.constraints=!1,this.resolveConstraints(),dr(g=>{if(!Vo(g,s,null))return;const a=this.getAxisMotionValue(g),{min:l,max:p}=this.constraints[g];a.set(Ue(l,p,d[g]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;hE.set(this.visualElement,this);const s=this.visualElement.current,i=hn(s,"pointerdown",p=>{const{drag:m,dragListener:u=!0}=this.getProps(),x=p.target,b=x!==s&&K1(x);m&&u&&!b&&this.start(p)});let o;const d=()=>{const{dragConstraints:p}=this.getProps();ii(p)&&p.current&&(this.constraints=this.resolveRefConstraints(),o||(o=pE(s,p.current,()=>this.scalePositionWithinConstraints())))},{projection:w}=this.visualElement,g=w.addEventListener("measure",d);w&&!w.layout&&(w.root&&w.root.updateScroll(),w.updateLayout()),Ae.read(d);const a=yn(window,"resize",()=>this.scalePositionWithinConstraints()),l=w.addEventListener("didUpdate",(({delta:p,hasLayoutChanged:m})=>{this.isDragging&&m&&(dr(u=>{const x=this.getAxisMotionValue(u);x&&(this.originPoint[u]+=p[u].translate,x.set(x.get()+p[u].translate))}),this.visualElement.render())}));return()=>{a(),i(),g(),l&&l(),o&&o()}}getProps(){const s=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:o=!1,dragPropagation:d=!1,dragConstraints:w=!1,dragElastic:g=gu,dragMomentum:a=!0}=s;return{...s,drag:i,dragDirectionLock:o,dragPropagation:d,dragConstraints:w,dragElastic:g,dragMomentum:a}}}function Im(t){let s=!0;return()=>{if(s){s=!1;return}t()}}function pE(t,s,i){const o=Vp(t,Im(i)),d=Vp(s,Im(i));return()=>{o(),d()}}function Vo(t,s,i){return(s===!0||s===t)&&(i===null||i===t)}function mE(t,s=10){let i=null;return Math.abs(t.y)>s?i="y":Math.abs(t.x)>s&&(i="x"),i}class gE extends os{constructor(s){super(s),this.removeGroupControls=Kt,this.removeListeners=Kt,this.controls=new fE(s)}mount(){const{dragControls:s}=this.node.getProps();s&&(this.removeGroupControls=s.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Kt}update(){const{dragControls:s}=this.node.getProps(),{dragControls:i}=this.node.prevProps||{};s!==i&&(this.removeGroupControls(),s&&(this.removeGroupControls=s.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Vc=t=>(s,i)=>{t&&Ae.update(()=>t(s,i),!1,!0)};class vE extends os{constructor(){super(...arguments),this.removePointerDownListener=Kt}onPointerDown(s){this.session=new Yv(s,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jv(this.node)})}createPanHandlers(){const{onPanSessionStart:s,onPanStart:i,onPan:o,onPanEnd:d}=this.node.getProps();return{onSessionStart:Vc(s),onStart:Vc(i),onMove:Vc(o),onEnd:(w,g)=>{delete this.session,d&&Ae.postRender(()=>d(w,g))}}}mount(){this.removePointerDownListener=hn(this.node.current,"pointerdown",s=>this.onPointerDown(s))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let $c=!1;class yE extends W.Component{componentDidMount(){const{visualElement:s,layoutGroup:i,switchLayoutGroup:o,layoutId:d}=this.props,{projection:w}=s;w&&(i.group&&i.group.add(w),o&&o.register&&d&&o.register(w),$c&&w.root.didUpdate(),w.addEventListener("animationComplete",()=>{this.safeToRemove()}),w.setOptions({...w.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Zo.hasEverUpdated=!0}getSnapshotBeforeUpdate(s){const{layoutDependency:i,visualElement:o,drag:d,isPresent:w}=this.props,{projection:g}=o;return g&&(g.isPresent=w,s.layoutDependency!==i&&g.setOptions({...g.options,layoutDependency:i}),$c=!0,d||s.layoutDependency!==i||i===void 0||s.isPresent!==w?g.willUpdate():this.safeToRemove(),s.isPresent!==w&&(w?g.promote():g.relegate()||Ae.postRender(()=>{const a=g.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:s,layoutAnchor:i}=this.props,{projection:o}=s;o&&(o.options.layoutAnchor=i,o.root.didUpdate(),qu.postRender(()=>{!o.currentAnimation&&o.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:s,layoutGroup:i,switchLayoutGroup:o}=this.props,{projection:d}=s;$c=!0,d&&(d.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(d),o&&o.deregister&&o.deregister(d))}safeToRemove(){const{safeToRemove:s}=this.props;s&&s()}render(){return null}}function Zv(t){const[s,i]=Uv(),o=W.useContext(Ru);return _.jsx(yE,{...t,layoutGroup:o,switchLayoutGroup:W.useContext(Gv),isPresent:s,safeToRemove:i})}const _E={pan:{Feature:vE},drag:{Feature:gE,ProjectionNode:Hv,MeasureLayout:Zv}};function Nm(t,s,i){const{props:o}=t;t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",i==="Start");const d="onHover"+i,w=o[d];w&&Ae.postRender(()=>w(s,bn(s)))}class xE extends os{mount(){const{current:s}=this.node;s&&(this.unmount=W1(s,(i,o)=>(Nm(this.node,o,"Start"),d=>Nm(this.node,d,"End"))))}unmount(){}}class wE extends os{constructor(){super(...arguments),this.isActive=!1}onFocus(){let s=!1;try{s=this.node.current.matches(":focus-visible")}catch{s=!0}!s||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=xn(yn(this.node.current,"focus",()=>this.onFocus()),yn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Bm(t,s,i){const{props:o}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap",i==="Start");const d="onTap"+(i==="End"?"":i),w=o[d];w&&Ae.postRender(()=>w(s,bn(s)))}class SE extends os{mount(){const{current:s}=this.node;if(!s)return;const{globalTapTarget:i,propagate:o}=this.node.props;this.unmount=G1(s,(d,w)=>(Bm(this.node,w,"Start"),(g,{success:a})=>Bm(this.node,g,a?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:(o==null?void 0:o.tap)===!1})}unmount(){}}const vu=new WeakMap,zc=new WeakMap,bE=t=>{const s=vu.get(t.target);s&&s(t)},CE=t=>{t.forEach(bE)};function kE({root:t,...s}){const i=t||document;zc.has(i)||zc.set(i,{});const o=zc.get(i),d=JSON.stringify(s);return o[d]||(o[d]=new IntersectionObserver(CE,{root:t,...s})),o[d]}function EE(t,s,i){const o=kE(s);return vu.set(t,i),o.observe(t),()=>{vu.delete(t),o.unobserve(t)}}const TE={some:0,all:1};class RE extends os{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:s={}}=this.node.getProps(),{root:i,margin:o,amount:d="some",once:w}=s,g={root:i?i.current:void 0,rootMargin:o,threshold:typeof d=="number"?d:TE[d]},a=p=>{const{isIntersecting:m}=p;if(this.isInView===m||(this.isInView=m,w&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:u,onViewportLeave:x}=this.node.getProps(),b=m?u:x;b&&b(p)};this.stopObserver=EE(this.node.current,g,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:s,prevProps:i}=this.node;["amount","margin","root"].some(PE(s,i))&&this.startObserver()}unmount(){var s;(s=this.stopObserver)==null||s.call(this),this.hasEnteredView=!1,this.isInView=!1}}function PE({viewport:t={}},{viewport:s={}}={}){return i=>t[i]!==s[i]}const LE={inView:{Feature:RE},tap:{Feature:SE},focus:{Feature:wE},hover:{Feature:xE}},DE={layout:{ProjectionNode:Hv,MeasureLayout:Zv}},AE={...tE,...LE,..._E,...DE},He=Jk(AE,Yk),Fm=["Discombobulating","Moseying","Pondering","Ruminating","Noodling","Cogitating","Woolgathering","Percolating","Tinkering","Conjuring","Scheming","Divining","Brewing","Untangling","Transmuting","Pontificating"],jE=3e3,ME=2e3,OE=6e3,IE=3e3;function NE(){const t=Re(C=>C.tabs),s=Re(C=>C.activeTabId),i=xt(C=>C.subscribe),o=xt(C=>C.unsubscribe),d=xt(C=>s?C.tabs[s]:void 0),w=t.find(C=>C.id===s)??null;W.useEffect(()=>{if(w)return i(w.id,w.cwd,w.claudeSessionId),()=>o(w.id)},[w==null?void 0:w.id,w==null?void 0:w.cwd,w==null?void 0:w.claudeSessionId,i,o]);const[g,a]=W.useState(()=>Date.now());W.useEffect(()=>{const C=window.setInterval(()=>a(Date.now()),500);return()=>window.clearInterval(C)},[]);const l=(w==null?void 0:w.status)==="running",p=(d==null?void 0:d.lastEventAt)??0,m=l?p>0&&g-p<jE?"working":"idle":"offline",[u,x]=W.useState(0);W.useEffect(()=>{if(m!=="working")return;const C=window.setInterval(()=>x(R=>(R+1)%Fm.length),ME);return()=>window.clearInterval(C)},[m]);const[b,E]=W.useState(50),[S,c]=W.useState("right"),[y,h]=W.useState(!1);W.useEffect(()=>{if(m!=="idle")return;let C=!1,R=null;const L=()=>{const T=OE+Math.random()*IE;return window.setTimeout(()=>{if(C)return;const A=14+Math.random()*72;E(I=>{const H=A>=I?"right":"left";return c(H),h(!0),R=window.setTimeout(()=>h(!1),280),A}),D=L()},T)};let D=L();return()=>{C=!0,window.clearTimeout(D),R!==null&&window.clearTimeout(R)}},[m]);const v=m==="offline"?w?`session: ${w.status}`:"no session":m==="working"?"session: working":"session: idle";return _.jsxs("div",{className:"h-full w-full relative overflow-hidden select-none bg-gradient-to-b from-bg via-bg to-bg-elev",children:[_.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-30",children:zE.map((C,R)=>_.jsx("span",{className:"absolute rounded-full bg-fg-dim",style:{left:`${C.x}%`,top:`${C.y}%`,width:C.size,height:C.size,animation:`agent-twinkle ${C.dur}s ease-in-out ${C.delay}s infinite`}},R))}),_.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-24 bg-bg-hi/30 border-t border-line"}),_.jsx("div",{className:"absolute bottom-[88px] left-0 right-0 h-px bg-line/60"}),_.jsx("style",{children:`
|
|
131
|
+
@keyframes agent-twinkle {
|
|
132
|
+
0%, 100% { opacity: 0.15; }
|
|
133
|
+
50% { opacity: 0.9; }
|
|
134
|
+
}
|
|
135
|
+
`}),_.jsxs(He.div,{className:"absolute top-4 left-1/2 flex items-center gap-2 px-3 py-1 rounded-full bg-bg-elev/80 border border-line text-[10px] text-fg-faint uppercase tracking-widest",initial:!1,animate:{x:"-50%"},children:[_.jsx(He.span,{className:"inline-block w-1.5 h-1.5 rounded-full",animate:{backgroundColor:m==="offline"?"#6b7280":m==="working"?"#fbbf24":"#34d399",scale:m==="working"?[1,1.4,1]:1},transition:m==="working"?{duration:.9,repeat:1/0,ease:"easeInOut"}:{duration:.3}}),v]}),_.jsxs(He.div,{className:"absolute bottom-24",style:{transform:"translateX(-50%)"},animate:{left:`${b}%`},transition:{left:m==="idle"?{type:"spring",stiffness:22,damping:14,mass:1.2}:{duration:0}},children:[_.jsx(ea,{children:m==="working"&&_.jsx(VE,{verb:Fm[u]},"bubble")}),_.jsx(ea,{children:m==="idle"&&_.jsx($E,{},"zzz")}),_.jsx(ea,{children:m==="offline"&&_.jsx(He.div,{className:"absolute left-1/2 -top-28 z-10",style:{translateX:"-50%"},initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:6},transition:{duration:.25},children:_.jsxs("div",{className:"relative px-4 py-2 rounded-xl bg-bg-elev/80 border border-line text-xs text-fg-faint whitespace-nowrap",children:["offline",_.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 -bottom-[5px] w-2 h-2 bg-bg-elev/80 border-r border-b border-line rotate-45"})]})},"offline")}),_.jsx(WE,{state:m,facing:S,anticipating:y})]}),_.jsx("div",{className:"absolute bottom-3 left-4 text-[10px] text-fg-faint",children:"robot reflects session state · no input, read-only"})]})}const BE={offline:{scaleY:.97,y:2,transition:{type:"spring",stiffness:80,damping:18}},idle:{scaleY:[1,.985,1],y:[0,-3,0],transition:{duration:3,repeat:1/0,ease:"easeInOut"}},working:{scaleY:[1,.94,1.04,1],scaleX:[1,1.04,.98,1],y:[0,2,-2,0],transition:{duration:.6,times:[0,.3,.6,1],ease:"easeOut"}}},FE={offline:{transition:{staggerChildren:.04}},idle:{transition:{staggerChildren:.04}},working:{transition:{staggerChildren:.08,delayChildren:.1}}},Hm={offline:{rotate:4,y:2,transition:{type:"spring",stiffness:70,damping:16}},idle:{rotate:0,y:0,transition:{type:"spring",stiffness:90,damping:18}},working:{rotate:[0,-4,3,0],y:[0,-1,0],transition:{duration:1.2,repeat:1/0,ease:"easeInOut"}}},HE={offline:{scale:1,fill:"#6b7280",transition:{duration:.3}},idle:{scale:[1,1.15,1],fill:"#22c55e",transition:{scale:{duration:2.8,repeat:1/0,ease:"easeInOut"}}},working:{scale:[1,1.6,1],fill:"#f59e0b",transition:{scale:{duration:.7,repeat:1/0,ease:"easeInOut"}}}},UE={offline:{rotate:-6,transition:{type:"spring",stiffness:40,damping:14}},idle:{rotate:[-3,3,-3],transition:{duration:4,repeat:1/0,ease:"easeInOut"}},working:{rotate:[0,2,0,-2,0],transition:{duration:1.1,repeat:1/0,ease:"easeInOut"}}},nn={offline:{opacity:.25,fill:"#6b7280",transition:{duration:.3}},idle:{opacity:.95,fill:"#22c55e",transition:{duration:.35}},working:{opacity:[.3,1,.3],fill:"#f59e0b",transition:{opacity:{duration:.9,repeat:1/0,ease:"easeInOut"}}}},Um={offline:{rotate:0,transition:{duration:.3}},idle:{rotate:0,transition:{duration:.3}},working:{rotate:[0,4,-2,0],transition:{duration:1.6,repeat:1/0,ease:"easeInOut"}}};function WE({state:t,facing:s,anticipating:i}){const o=i?s==="right"?-6:6:0;return _.jsx(He.div,{animate:{scaleX:s==="left"?-1:1},transition:{type:"spring",stiffness:120,damping:14},style:{transformOrigin:"bottom center"},children:_.jsxs(He.svg,{width:"160",height:"200",viewBox:"0 0 160 200",className:"drop-shadow-2xl overflow-visible",animate:t,variants:FE,initial:!1,children:[_.jsx(He.ellipse,{cx:"80",cy:"194",rx:"42",ry:"4",fill:"#000",animate:{opacity:t==="offline"?.2:.4,rx:t==="working"?[42,44,42]:42},transition:t==="working"?{rx:{duration:.9,repeat:1/0,ease:"easeInOut"}}:{duration:.3}}),_.jsxs(He.g,{variants:BE,style:{transformOrigin:"80px 190px"},children:[_.jsx("rect",{x:"58",y:"158",width:"12",height:"28",rx:"3",fill:"#9ca3af"}),_.jsx("rect",{x:"90",y:"158",width:"12",height:"28",rx:"3",fill:"#9ca3af"}),_.jsx("rect",{x:"54",y:"182",width:"20",height:"6",rx:"2",fill:"#6b7280"}),_.jsx("rect",{x:"86",y:"182",width:"20",height:"6",rx:"2",fill:"#6b7280"}),_.jsx("rect",{x:"38",y:"78",width:"84",height:"84",rx:"14",fill:"#4b5563",stroke:"#1f2937",strokeWidth:"2"}),_.jsx("rect",{x:"52",y:"98",width:"56",height:"32",rx:"6",fill:"#0b0d10",stroke:"#1f2937",strokeWidth:"1.5"}),_.jsx(He.circle,{cx:"64",cy:"114",r:"3.5",variants:nn,style:{transformOrigin:"64px 114px"}}),_.jsx(He.circle,{cx:"80",cy:"114",r:"3.5",variants:{...nn,working:{...nn.working,transition:{opacity:{duration:.9,repeat:1/0,ease:"easeInOut",delay:.15}}}},style:{transformOrigin:"80px 114px"}}),_.jsx(He.circle,{cx:"96",cy:"114",r:"3.5",variants:{...nn,working:{...nn.working,transition:{opacity:{duration:.9,repeat:1/0,ease:"easeInOut",delay:.3}}}},style:{transformOrigin:"96px 114px"}}),_.jsx("line",{x1:"38",y1:"146",x2:"122",y2:"146",stroke:"#1f2937",strokeWidth:"1.5"})]}),_.jsxs(He.g,{variants:Um,style:{transformOrigin:"30px 88px"},children:[_.jsx("rect",{x:"22",y:"88",width:"12",height:"56",rx:"5",fill:"#6b7280"}),_.jsx("rect",{x:"20",y:"140",width:"16",height:"12",rx:"4",fill:"#9ca3af"})]}),_.jsxs(He.g,{variants:{...Um,working:{rotate:[0,-4,2,0],transition:{duration:1.6,repeat:1/0,ease:"easeInOut",delay:.3}}},style:{transformOrigin:"130px 88px"},children:[_.jsx("rect",{x:"126",y:"88",width:"12",height:"56",rx:"5",fill:"#6b7280"}),_.jsx("rect",{x:"124",y:"140",width:"16",height:"12",rx:"4",fill:"#9ca3af"})]}),_.jsx(He.g,{variants:Hm,animate:{rotate:o},transition:{type:"spring",stiffness:200,damping:16},style:{transformOrigin:"80px 76px"},children:_.jsxs(He.g,{variants:Hm,style:{transformOrigin:"80px 76px"},children:[_.jsx("rect",{x:"44",y:"30",width:"72",height:"56",rx:"10",fill:"#6b7280",stroke:"#1f2937",strokeWidth:"2"}),_.jsx("rect",{x:"52",y:"42",width:"56",height:"22",rx:"4",fill:"#0b0d10"}),_.jsx(Wm,{state:t,cx:62,cy:53}),_.jsx(Wm,{state:t,cx:98,cy:53}),_.jsx("rect",{x:"66",y:"74",width:"28",height:"4",rx:"1",fill:"#1f2937"}),Array.from({length:6}).map((d,w)=>_.jsx("rect",{x:68+w*4,y:"75.5",width:"2",height:"1",fill:"#9ca3af"},w)),_.jsxs(He.g,{variants:UE,style:{transformOrigin:"80px 30px"},children:[_.jsx("line",{x1:"80",y1:"30",x2:"80",y2:"14",stroke:"#6b7280",strokeWidth:"2.5"}),_.jsx(He.circle,{cx:"80",cy:"11",r:"4.5",variants:HE,style:{transformOrigin:"80px 11px"}})]})]})})]})})}function Wm({state:t,cx:s,cy:i}){const[o,d]=W.useState(()=>1500+Math.random()*3500),[w,g]=W.useState(!1);W.useEffect(()=>{let l,p;const m=()=>{l=window.setTimeout(()=>{g(!0),p=window.setTimeout(()=>{g(!1),d(2e3+Math.random()*3500),m()},140)},o)};return m(),()=>{window.clearTimeout(l),window.clearTimeout(p)}},[]);const a=t!=="offline"&&!w;return _.jsx(He.rect,{x:s-5,width:10,rx:2,fill:t==="working"?"#fbbf24":t==="offline"?"#4b5563":"#22d3ee",animate:{height:a?10:1.5,y:a?i-5:i-.75,opacity:t==="offline"?.5:1},transition:{duration:.09,ease:"easeOut"}})}function VE({verb:t}){return _.jsx(He.div,{className:"absolute left-1/2 -top-48 z-10",style:{translateX:"-50%"},initial:{opacity:0,y:10,scale:.9},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.92},transition:{type:"spring",stiffness:260,damping:20},children:_.jsxs(He.div,{className:"relative px-8 py-5 rounded-2xl bg-bg-elev border border-line shadow-2xl",initial:"hidden",animate:"shown",variants:{hidden:{},shown:{transition:{staggerChildren:.08}}},children:[_.jsx(ea,{mode:"wait",children:_.jsxs(He.div,{className:"text-3xl font-mono text-fg tracking-wide whitespace-nowrap",initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.22,ease:"easeOut"},children:[t,_.jsx(He.span,{className:"text-amber-400",animate:{opacity:[.3,1,.3]},transition:{duration:1.1,repeat:1/0,ease:"easeInOut"},children:"…"})]},t)}),_.jsx(He.div,{className:"absolute left-1/2 -translate-x-1/2 -bottom-[7px] w-3 h-3 bg-bg-elev border-r border-b border-line rotate-45",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},transition:{delay:.08,duration:.2}})]})})}function $E(){return _.jsx(He.div,{className:"absolute left-[72%] -top-20 pointer-events-none select-none","aria-hidden":!0,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:[0,.6,1.2].map((t,s)=>_.jsx(He.span,{className:"inline-block font-mono text-fg-faint",style:{fontSize:16+s*6,marginLeft:s*2},animate:{y:[6,-22],x:[0,10],opacity:[0,.8,0]},transition:{duration:3,delay:t,repeat:1/0,ease:"easeOut",times:[0,.25,1]},children:"z"},s))})}const zE=Array.from({length:40},(t,s)=>({x:(s*37+11)%100,y:s*53%58+2,size:s%3+1,dur:3+s%5,delay:s%7*.4}));class KE extends W.Component{constructor(){super(...arguments);hc(this,"state",{error:null});hc(this,"reset",()=>this.setState({error:null}))}static getDerivedStateFromError(i){return{error:i}}componentDidCatch(i,o){console.error("[ErrorBoundary]",i,o)}render(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.reset):_.jsxs("div",{className:"p-6 text-xs",children:[_.jsx("div",{className:"text-red-400 mb-2",children:"something broke in this panel"}),_.jsx("pre",{className:"text-fg-faint whitespace-pre-wrap mb-3",children:this.state.error.message}),_.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 qE={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","agent-view":"Agent-View"};function GE(t){switch(t){case"overview":return _.jsx(N0,{});case"system-prompt":return _.jsx(Yw,{});case"settings":return _.jsx(jw,{});case"permissions":return _.jsx(sS,{});case"skills":return _.jsx(lS,{});case"plugins":return _.jsx(cS,{});case"mcp":return _.jsx(fS,{});case"hooks":return _.jsx(xS,{});case"subagents":return _.jsx(kS,{});case"plans":return _.jsx(TS,{});case"tasks":return _.jsx(RS,{});case"projects":return _.jsx(AS,{});case"history":return _.jsx(jS,{});case"keybindings":return _.jsx(Zw,{});case"usage":return _.jsx(MS,{});case"agent-view":return _.jsx(NE,{});default:return null}}function XE({active:t}){const s=Re(w=>w.tabs),i=Re(w=>w.activeTabId),o=Re(w=>w.restartTab),d=s.find(w=>w.id===i)??null;return _.jsxs("main",{className:"flex-1 min-w-0 bg-bg flex flex-col",children:[_.jsxs("header",{className:"h-9 border-b border-line px-4 flex items-center shrink-0",children:[_.jsx("h1",{className:"text-xs text-fg-dim uppercase tracking-wider",children:qE[t]}),d&&_.jsx("span",{className:"ml-4 text-xs text-fg-faint truncate",children:d.cwd}),_.jsx("div",{className:"flex-1"}),d&&t==="terminal"&&_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("button",{onClick:()=>o(d.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"}),_.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"})]})]}),_.jsxs("div",{className:"flex-1 min-h-0 relative",children:[_.jsx("div",{className:"absolute inset-0",style:{visibility:t==="terminal"?"visible":"hidden"},children:d?s.map(w=>_.jsx("div",{className:"absolute inset-0",style:{visibility:w.id===i?"visible":"hidden"},children:_.jsx(O0,{tabId:w.id,cwd:w.cwd})},`${w.id}-${w.generation}`)):_.jsx(JE,{})}),t!=="terminal"&&_.jsx("div",{className:"absolute inset-0 bg-bg overflow-auto",children:_.jsx(KE,{children:GE(t)})})]})]})}function JE(){return _.jsx("div",{className:"h-full flex items-center justify-center text-fg-faint text-xs",children:_.jsxs("div",{className:"text-center",children:[_.jsx("div",{className:"mb-2",children:"no active session"}),_.jsxs("div",{children:["click ",_.jsx("span",{className:"text-fg-dim",children:"+ new"})," in the tab bar to start one"]})]})})}function YE(){const t=Ot(i=>i.isRecording),s=Ot(i=>i.lastTranscript);return!t||!s?null:_.jsxs("div",{className:"fixed bottom-12 left-1/2 -translate-x-1/2 z-50 px-4 py-2 rounded-lg bg-bg-elev/90 border border-line text-xs text-fg-dim max-w-md truncate shadow-lg",children:[_.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-red-400 animate-pulse mr-2"}),s]})}function QE(t){return t.replace(/```[\s\S]*?```/g,"").replace(/`([^`]+)`/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/\*{1,3}([^*]+)\*{1,3}/g,"$1").replace(/_{1,3}([^_]+)_{1,3}/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/^[-*_]{3,}\s*$/gm,"").replace(/^>\s?/gm,"").replace(/^[\s]*[-*+]\s/gm,"").replace(/^[\s]*\d+\.\s/gm,"").trim()}function Vm(t){if(!window.speechSynthesis)return;const s=QE(t);if(!s)return;const i=new SpeechSynthesisUtterance(s);i.rate=1,i.pitch=1,window.speechSynthesis.speak(i)}function ZE(){window.speechSynthesis&&window.speechSynthesis.cancel()}function e2(t){const s=Ot(o=>o.ttsEnabled),i=Ot(o=>o.isRecording);W.useEffect(()=>!t||!s?void 0:window.api.transcripts.onEvent(t,d=>{if(d.kind!=="message")return;const w=d.data;if((w==null?void 0:w.role)!=="assistant"||Ot.getState().isRecording)return;const g=w==null?void 0:w.content;if(typeof g=="string")Vm(g);else if(Array.isArray(g)){const a=g.filter(l=>l.type==="text").map(l=>l.text).join(" ");a&&Vm(a)}}),[t,s]),W.useEffect(()=>{i&&ZE()},[i])}async function $m(){const t=await window.api.app.pickDirectory();if(!t)return;const s=crypto.randomUUID(),i=`claude --dangerously-skip-permissions --session-id ${ir(s)}`;Re.getState().addTab({id:s,cwd:t,startupCommand:i,presetId:"pick-dangerous"})}function t2(){const[t,s]=W.useState("terminal"),i=Re(d=>d.activeTabId);e2(i);const o=W.useCallback(()=>{s("terminal"),$m().catch(d=>console.error("[App] new session failed:",d))},[]);return W.useEffect(()=>{m0().then(()=>{if(Re.getState().tabs.length>0)return;const a=Km[0];f0(a).then(l=>{if(!l||Re.getState().tabs.length>0)return;const p=crypto.randomUUID(),m=qm(a,{sessionId:p,cwd:l});Re.setState(u=>({tabs:[...u.tabs,{id:p,claudeSessionId:p,label:l.split("/").filter(Boolean).pop()||l,cwd:l,pid:null,status:"spawning",exitCode:null,startupCommand:m,presetId:a.id,generation:0}],activeTabId:p}))}).catch(l=>console.warn("[App] failed to create initial tab:",l))});const d=window.api.app.onNewSession(()=>{$m().catch(a=>console.error("[App] new-session from menu failed:",a))}),w=window.api.app.onRebootSession(()=>{const{activeTabId:a}=Re.getState();a&&Re.getState().restartTab(a)}),g=yw();return Yx([{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(a=>console.warn("[monaco] schema install failed:",a)),()=>{g(),d(),w()}},[]),_.jsxs("div",{className:"h-full w-full flex flex-col bg-bg text-fg text-sm",children:[_.jsx(y0,{}),_.jsxs("div",{className:"flex-1 flex min-h-0",children:[_.jsx(T0,{active:t,onChange:s,onNewSession:o}),_.jsx(XE,{active:t})]}),_.jsx(R0,{}),_.jsx(YE,{})]})}window.addEventListener("unhandledrejection",t=>{const s=t.reason instanceof Error?t.reason.stack??t.reason.message:String(t.reason);console.error("[renderer] unhandled rejection:",s)});window.addEventListener("error",t=>{t.error&&console.error("[renderer] uncaught error:",t.error.stack??t.error.message??t.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.");o0.createRoot(document.getElementById("root")).render(_.jsx(t2,{}));export{W0 as _};
|