nomoreide 0.1.45 → 0.1.47
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/cli/git.js +4 -1
- package/dist/cli/git.js.map +1 -1
- package/dist/core/agent-runtime.d.ts +15 -0
- package/dist/core/agent-runtime.js +39 -3
- package/dist/core/agent-runtime.js.map +1 -1
- package/dist/core/config-store.d.ts +4 -0
- package/dist/core/config-store.js +20 -0
- package/dist/core/config-store.js.map +1 -1
- package/dist/core/git-actions.d.ts +30 -0
- package/dist/core/git-actions.js +58 -0
- package/dist/core/git-actions.js.map +1 -0
- package/dist/core/git-manager.d.ts +12 -0
- package/dist/core/git-manager.js +34 -1
- package/dist/core/git-manager.js.map +1 -1
- package/dist/core/github-manager.d.ts +35 -0
- package/dist/core/github-manager.js +20 -0
- package/dist/core/github-manager.js.map +1 -1
- package/dist/core/repo-onboard.d.ts +2 -2
- package/dist/core/types.d.ts +3 -0
- package/dist/core/workflows.d.ts +204 -0
- package/dist/core/workflows.js +146 -0
- package/dist/core/workflows.js.map +1 -0
- package/dist/mcp/tools/context.d.ts +3 -0
- package/dist/mcp/tools/context.js +5 -0
- package/dist/mcp/tools/context.js.map +1 -1
- package/dist/mcp/tools/git.d.ts +1 -1
- package/dist/mcp/tools/git.js +10 -1
- package/dist/mcp/tools/git.js.map +1 -1
- package/dist/mcp/tools/github.d.ts +1 -1
- package/dist/mcp/tools/github.js +15 -0
- package/dist/mcp/tools/github.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +1 -1
- package/dist/web/agent-info.d.ts +12 -0
- package/dist/web/agent-info.js +101 -2
- package/dist/web/agent-info.js.map +1 -1
- package/dist/web/client/assets/{code-editor-B5xQq21I.js → code-editor-DOyUkvuQ.js} +1 -1
- package/dist/web/client/assets/index-BpLowAcO.js +204 -0
- package/dist/web/client/assets/index-Df0RBiTt.css +1 -0
- package/dist/web/client/index.html +2 -2
- package/dist/web/routes/agent-chat-routes.js +3 -0
- package/dist/web/routes/agent-chat-routes.js.map +1 -1
- package/dist/web/routes/git-routes.js +60 -0
- package/dist/web/routes/git-routes.js.map +1 -1
- package/dist/web/routes/github-routes.js +42 -2
- package/dist/web/routes/github-routes.js.map +1 -1
- package/dist/web/routes/index.js +2 -0
- package/dist/web/routes/index.js.map +1 -1
- package/dist/web/routes/workflow-routes.d.ts +8 -0
- package/dist/web/routes/workflow-routes.js +45 -0
- package/dist/web/routes/workflow-routes.js.map +1 -0
- package/package.json +1 -1
- package/dist/web/client/assets/index-D6O1I2RP.css +0 -1
- package/dist/web/client/assets/index-DApri4U3.js +0 -197
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function s(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(a){if(a.ep)return;a.ep=!0;const o=s(a);fetch(a.href,o)}})();function aA(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ap={exports:{}},lc={};var W1;function oA(){if(W1)return lc;W1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(i,a,o){var u=null;if(o!==void 0&&(u=""+o),a.key!==void 0&&(u=""+a.key),"key"in a){o={};for(var h in a)h!=="key"&&(o[h]=a[h])}else o=a;return a=o.ref,{$$typeof:e,type:i,key:u,ref:a!==void 0?a:null,props:o}}return lc.Fragment=t,lc.jsx=s,lc.jsxs=s,lc}var Y1;function lA(){return Y1||(Y1=1,ap.exports=oA()),ap.exports}var l=lA(),op={exports:{}},Fe={};var X1;function cA(){if(X1)return Fe;X1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),x=Symbol.iterator;function _(D){return D===null||typeof D!="object"?null:(D=x&&D[x]||D["@@iterator"],typeof D=="function"?D:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function E(D,W,he){this.props=D,this.context=W,this.refs=C,this.updater=he||y}E.prototype.isReactComponent={},E.prototype.setState=function(D,W){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,W,"setState")},E.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function T(){}T.prototype=E.prototype;function N(D,W,he){this.props=D,this.context=W,this.refs=C,this.updater=he||y}var M=N.prototype=new T;M.constructor=N,S(M,E.prototype),M.isPureReactComponent=!0;var R=Array.isArray;function z(){}var L={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function H(D,W,he){var le=he.ref;return{$$typeof:e,type:D,key:W,ref:le!==void 0?le:null,props:he}}function P(D,W){return H(D.type,W,D.props)}function F(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function K(D){var W={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(he){return W[he]})}var Y=/\/+/g;function Q(D,W){return typeof D=="object"&&D!==null&&D.key!=null?K(""+D.key):W.toString(36)}function q(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(z,z):(D.status="pending",D.then(function(W){D.status==="pending"&&(D.status="fulfilled",D.value=W)},function(W){D.status==="pending"&&(D.status="rejected",D.reason=W)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function O(D,W,he,le,me){var ne=typeof D;(ne==="undefined"||ne==="boolean")&&(D=null);var fe=!1;if(D===null)fe=!0;else switch(ne){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(D.$$typeof){case e:case t:fe=!0;break;case p:return fe=D._init,O(fe(D._payload),W,he,le,me)}}if(fe)return me=me(D),fe=le===""?"."+Q(D,0):le,R(me)?(he="",fe!=null&&(he=fe.replace(Y,"$&/")+"/"),O(me,W,he,"",function(Ze){return Ze})):me!=null&&(F(me)&&(me=P(me,he+(me.key==null||D&&D.key===me.key?"":(""+me.key).replace(Y,"$&/")+"/")+fe)),W.push(me)),1;fe=0;var we=le===""?".":le+":";if(R(D))for(var ye=0;ye<D.length;ye++)le=D[ye],ne=we+Q(le,ye),fe+=O(le,W,he,ne,me);else if(ye=_(D),typeof ye=="function")for(D=ye.call(D),ye=0;!(le=D.next()).done;)le=le.value,ne=we+Q(le,ye++),fe+=O(le,W,he,ne,me);else if(ne==="object"){if(typeof D.then=="function")return O(q(D),W,he,le,me);throw W=String(D),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return fe}function X(D,W,he){if(D==null)return D;var le=[],me=0;return O(D,le,"","",function(ne){return W.call(he,ne,me++)}),le}function Z(D){if(D._status===-1){var W=D._result;W=W(),W.then(function(he){(D._status===0||D._status===-1)&&(D._status=1,D._result=he)},function(he){(D._status===0||D._status===-1)&&(D._status=2,D._result=he)}),D._status===-1&&(D._status=0,D._result=W)}if(D._status===1)return D._result.default;throw D._result}var V=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},$={map:X,forEach:function(D,W,he){X(D,function(){W.apply(this,arguments)},he)},count:function(D){var W=0;return X(D,function(){W++}),W},toArray:function(D){return X(D,function(W){return W})||[]},only:function(D){if(!F(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Fe.Activity=b,Fe.Children=$,Fe.Component=E,Fe.Fragment=s,Fe.Profiler=a,Fe.PureComponent=N,Fe.StrictMode=i,Fe.Suspense=m,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(D){return L.H.useMemoCache(D)}},Fe.cache=function(D){return function(){return D.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(D,W,he){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var le=S({},D.props),me=D.key;if(W!=null)for(ne in W.key!==void 0&&(me=""+W.key),W)!j.call(W,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&W.ref===void 0||(le[ne]=W[ne]);var ne=arguments.length-2;if(ne===1)le.children=he;else if(1<ne){for(var fe=Array(ne),we=0;we<ne;we++)fe[we]=arguments[we+2];le.children=fe}return H(D.type,me,le)},Fe.createContext=function(D){return D={$$typeof:u,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:o,_context:D},D},Fe.createElement=function(D,W,he){var le,me={},ne=null;if(W!=null)for(le in W.key!==void 0&&(ne=""+W.key),W)j.call(W,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(me[le]=W[le]);var fe=arguments.length-2;if(fe===1)me.children=he;else if(1<fe){for(var we=Array(fe),ye=0;ye<fe;ye++)we[ye]=arguments[ye+2];me.children=we}if(D&&D.defaultProps)for(le in fe=D.defaultProps,fe)me[le]===void 0&&(me[le]=fe[le]);return H(D,ne,me)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(D){return{$$typeof:h,render:D}},Fe.isValidElement=F,Fe.lazy=function(D){return{$$typeof:p,_payload:{_status:-1,_result:D},_init:Z}},Fe.memo=function(D,W){return{$$typeof:f,type:D,compare:W===void 0?null:W}},Fe.startTransition=function(D){var W=L.T,he={};L.T=he;try{var le=D(),me=L.S;me!==null&&me(he,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(z,V)}catch(ne){V(ne)}finally{W!==null&&he.types!==null&&(W.types=he.types),L.T=W}},Fe.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Fe.use=function(D){return L.H.use(D)},Fe.useActionState=function(D,W,he){return L.H.useActionState(D,W,he)},Fe.useCallback=function(D,W){return L.H.useCallback(D,W)},Fe.useContext=function(D){return L.H.useContext(D)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(D,W){return L.H.useDeferredValue(D,W)},Fe.useEffect=function(D,W){return L.H.useEffect(D,W)},Fe.useEffectEvent=function(D){return L.H.useEffectEvent(D)},Fe.useId=function(){return L.H.useId()},Fe.useImperativeHandle=function(D,W,he){return L.H.useImperativeHandle(D,W,he)},Fe.useInsertionEffect=function(D,W){return L.H.useInsertionEffect(D,W)},Fe.useLayoutEffect=function(D,W){return L.H.useLayoutEffect(D,W)},Fe.useMemo=function(D,W){return L.H.useMemo(D,W)},Fe.useOptimistic=function(D,W){return L.H.useOptimistic(D,W)},Fe.useReducer=function(D,W,he){return L.H.useReducer(D,W,he)},Fe.useRef=function(D){return L.H.useRef(D)},Fe.useState=function(D){return L.H.useState(D)},Fe.useSyncExternalStore=function(D,W,he){return L.H.useSyncExternalStore(D,W,he)},Fe.useTransition=function(){return L.H.useTransition()},Fe.version="19.2.6",Fe}var Z1;function ib(){return Z1||(Z1=1,op.exports=cA()),op.exports}var w=ib(),lp={exports:{}},cc={},cp={exports:{}},up={};var Q1;function uA(){return Q1||(Q1=1,(function(e){function t(O,X){var Z=O.length;O.push(X);e:for(;0<Z;){var V=Z-1>>>1,$=O[V];if(0<a($,X))O[V]=X,O[Z]=$,Z=V;else break e}}function s(O){return O.length===0?null:O[0]}function i(O){if(O.length===0)return null;var X=O[0],Z=O.pop();if(Z!==X){O[0]=Z;e:for(var V=0,$=O.length,D=$>>>1;V<D;){var W=2*(V+1)-1,he=O[W],le=W+1,me=O[le];if(0>a(he,Z))le<$&&0>a(me,he)?(O[V]=me,O[le]=Z,V=le):(O[V]=he,O[W]=Z,V=W);else if(le<$&&0>a(me,Z))O[V]=me,O[le]=Z,V=le;else break e}}return X}function a(O,X){var Z=O.sortIndex-X.sortIndex;return Z!==0?Z:O.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,h=u.now();e.unstable_now=function(){return u.now()-h}}var m=[],f=[],p=1,b=null,x=3,_=!1,y=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function M(O){for(var X=s(f);X!==null;){if(X.callback===null)i(f);else if(X.startTime<=O)i(f),X.sortIndex=X.expirationTime,t(m,X);else break;X=s(f)}}function R(O){if(S=!1,M(O),!y)if(s(m)!==null)y=!0,z||(z=!0,K());else{var X=s(f);X!==null&&q(R,X.startTime-O)}}var z=!1,L=-1,j=5,H=-1;function P(){return C?!0:!(e.unstable_now()-H<j)}function F(){if(C=!1,z){var O=e.unstable_now();H=O;var X=!0;try{e:{y=!1,S&&(S=!1,T(L),L=-1),_=!0;var Z=x;try{t:{for(M(O),b=s(m);b!==null&&!(b.expirationTime>O&&P());){var V=b.callback;if(typeof V=="function"){b.callback=null,x=b.priorityLevel;var $=V(b.expirationTime<=O);if(O=e.unstable_now(),typeof $=="function"){b.callback=$,M(O),X=!0;break t}b===s(m)&&i(m),M(O)}else i(m);b=s(m)}if(b!==null)X=!0;else{var D=s(f);D!==null&&q(R,D.startTime-O),X=!1}}break e}finally{b=null,x=Z,_=!1}X=void 0}}finally{X?K():z=!1}}}var K;if(typeof N=="function")K=function(){N(F)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,Q=Y.port2;Y.port1.onmessage=F,K=function(){Q.postMessage(null)}}else K=function(){E(F,0)};function q(O,X){L=E(function(){O(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(O){switch(x){case 1:case 2:case 3:var X=3;break;default:X=x}var Z=x;x=X;try{return O()}finally{x=Z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(O,X){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var Z=x;x=O;try{return X()}finally{x=Z}},e.unstable_scheduleCallback=function(O,X,Z){var V=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?V+Z:V):Z=V,O){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=Z+$,O={id:p++,callback:X,priorityLevel:O,startTime:Z,expirationTime:$,sortIndex:-1},Z>V?(O.sortIndex=Z,t(f,O),s(m)===null&&O===s(f)&&(S?(T(L),L=-1):S=!0,q(R,Z-V))):(O.sortIndex=$,t(m,O),y||_||(y=!0,z||(z=!0,K()))),O},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(O){var X=x;return function(){var Z=x;x=X;try{return O.apply(this,arguments)}finally{x=Z}}}})(up)),up}var J1;function dA(){return J1||(J1=1,cp.exports=uA()),cp.exports}var dp={exports:{}},$s={};var ey;function hA(){if(ey)return $s;ey=1;var e=ib();function t(m){var f="https://react.dev/errors/"+m;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+m+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(m,f,p){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:b==null?null:""+b,children:m,containerInfo:f,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(m,f){if(m==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return $s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,$s.createPortal=function(m,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return o(m,f,null,p)},$s.flushSync=function(m){var f=u.T,p=i.p;try{if(u.T=null,i.p=2,m)return m()}finally{u.T=f,i.p=p,i.d.f()}},$s.preconnect=function(m,f){typeof m=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,i.d.C(m,f))},$s.prefetchDNS=function(m){typeof m=="string"&&i.d.D(m)},$s.preinit=function(m,f){if(typeof m=="string"&&f&&typeof f.as=="string"){var p=f.as,b=h(p,f.crossOrigin),x=typeof f.integrity=="string"?f.integrity:void 0,_=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?i.d.S(m,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:b,integrity:x,fetchPriority:_}):p==="script"&&i.d.X(m,{crossOrigin:b,integrity:x,fetchPriority:_,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},$s.preinitModule=function(m,f){if(typeof m=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=h(f.as,f.crossOrigin);i.d.M(m,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&i.d.M(m)},$s.preload=function(m,f){if(typeof m=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,b=h(p,f.crossOrigin);i.d.L(m,p,{crossOrigin:b,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},$s.preloadModule=function(m,f){if(typeof m=="string")if(f){var p=h(f.as,f.crossOrigin);i.d.m(m,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else i.d.m(m)},$s.requestFormReset=function(m){i.d.r(m)},$s.unstable_batchedUpdates=function(m,f){return m(f)},$s.useFormState=function(m,f,p){return u.H.useFormState(m,f,p)},$s.useFormStatus=function(){return u.H.useHostTransitionStatus()},$s.version="19.2.6",$s}var ty;function bk(){if(ty)return dp.exports;ty=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),dp.exports=hA(),dp.exports}var sy;function fA(){if(sy)return cc;sy=1;var e=dA(),t=ib(),s=bk();function i(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)r+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function o(n){var r=n,c=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(c=r.return),n=r.return;while(n)}return r.tag===3?c:null}function u(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function h(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function m(n){if(o(n)!==n)throw Error(i(188))}function f(n){var r=n.alternate;if(!r){if(r=o(n),r===null)throw Error(i(188));return r!==n?null:n}for(var c=n,d=r;;){var g=c.return;if(g===null)break;var v=g.alternate;if(v===null){if(d=g.return,d!==null){c=d;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===c)return m(g),n;if(v===d)return m(g),r;v=v.sibling}throw Error(i(188))}if(c.return!==d.return)c=g,d=v;else{for(var k=!1,A=g.child;A;){if(A===c){k=!0,c=g,d=v;break}if(A===d){k=!0,d=g,c=v;break}A=A.sibling}if(!k){for(A=v.child;A;){if(A===c){k=!0,c=v,d=g;break}if(A===d){k=!0,d=v,c=g;break}A=A.sibling}if(!k)throw Error(i(189))}}if(c.alternate!==d)throw Error(i(190))}if(c.tag!==3)throw Error(i(188));return c.stateNode.current===c?n:r}function p(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=p(n),r!==null)return r;n=n.sibling}return null}var b=Object.assign,x=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),N=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function K(n){return n===null||typeof n!="object"?null:(n=F&&n[F]||n["@@iterator"],typeof n=="function"?n:null)}var Y=Symbol.for("react.client.reference");function Q(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Y?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case R:return"Suspense";case z:return"SuspenseList";case H:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case y:return"Portal";case N:return n.displayName||"Context";case T:return(n._context.displayName||"Context")+".Consumer";case M:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case L:return r=n.displayName||null,r!==null?r:Q(n.type)||"Memo";case j:r=n._payload,n=n._init;try{return Q(n(r))}catch{}}return null}var q=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},V=[],$=-1;function D(n){return{current:n}}function W(n){0>$||(n.current=V[$],V[$]=null,$--)}function he(n,r){$++,V[$]=n.current,n.current=r}var le=D(null),me=D(null),ne=D(null),fe=D(null);function we(n,r){switch(he(ne,r),he(me,n),he(le,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?b1(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=b1(r),n=v1(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}W(le),he(le,n)}function ye(){W(le),W(me),W(ne)}function Ze(n){n.memoizedState!==null&&he(fe,n);var r=le.current,c=v1(r,n.type);r!==c&&(he(me,n),he(le,c))}function lt(n){me.current===n&&(W(le),W(me)),fe.current===n&&(W(fe),ic._currentValue=Z)}var ct,ze;function Lt(n){if(ct===void 0)try{throw Error()}catch(c){var r=c.stack.trim().match(/\n( *(at )?)/);ct=r&&r[1]||"",ze=-1<c.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+ct+n+ze}var Oi=!1;function Jn(n,r){if(!n||Oi)return"";Oi=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(r){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(se){var te=se}Reflect.construct(n,[],ce)}else{try{ce.call()}catch(se){te=se}n.call(ce.prototype)}}else{try{throw Error()}catch(se){te=se}(ce=n())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(se){if(se&&te&&typeof se.stack=="string")return[se.stack,te.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),k=v[0],A=v[1];if(k&&A){var B=k.split(`
|
|
4
|
-
`),ee=A.split(`
|
|
5
|
-
`);for(g=d=0;d<B.length&&!B[d].includes("DetermineComponentFrameRoot");)d++;for(;g<ee.length&&!ee[g].includes("DetermineComponentFrameRoot");)g++;if(d===B.length||g===ee.length)for(d=B.length-1,g=ee.length-1;1<=d&&0<=g&&B[d]!==ee[g];)g--;for(;1<=d&&0<=g;d--,g--)if(B[d]!==ee[g]){if(d!==1||g!==1)do if(d--,g--,0>g||B[d]!==ee[g]){var ie=`
|
|
6
|
-
`+B[d].replace(" at new "," at ");return n.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",n.displayName)),ie}while(1<=d&&0<=g);break}}}finally{Oi=!1,Error.prepareStackTrace=c}return(c=n?n.displayName||n.name:"")?Lt(c):""}function xe(n,r){switch(n.tag){case 26:case 27:case 5:return Lt(n.type);case 16:return Lt("Lazy");case 13:return n.child!==r&&r!==null?Lt("Suspense Fallback"):Lt("Suspense");case 19:return Lt("SuspenseList");case 0:case 15:return Jn(n.type,!1);case 11:return Jn(n.type.render,!1);case 1:return Jn(n.type,!0);case 31:return Lt("Activity");default:return""}}function mt(n){try{var r="",c=null;do r+=xe(n,c),c=n,n=n.return;while(n);return r}catch(d){return`
|
|
7
|
-
Error generating stack: `+d.message+`
|
|
8
|
-
`+d.stack}}var qs=Object.prototype.hasOwnProperty,ls=e.unstable_scheduleCallback,Gs=e.unstable_cancelCallback,oa=e.unstable_shouldYield,mr=e.unstable_requestPaint,Bt=e.unstable_now,Li=e.unstable_getCurrentPriorityLevel,ws=e.unstable_ImmediatePriority,Bi=e.unstable_UserBlockingPriority,zi=e.unstable_NormalPriority,Qa=e.unstable_LowPriority,pr=e.unstable_IdlePriority,fl=e.log,Ja=e.unstable_setDisableYieldValue,Ii=null,gs=null;function Mn(n){if(typeof fl=="function"&&Ja(n),gs&&typeof gs.setStrictMode=="function")try{gs.setStrictMode(Ii,n)}catch{}}var ks=Math.clz32?Math.clz32:eo,ml=Math.log,la=Math.LN2;function eo(n){return n>>>=0,n===0?32:31-(ml(n)/la|0)|0}var at=256,ei=262144,gn=4194304;function zs(n){var r=n&42;if(r!==0)return r;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function I(n,r,c){var d=n.pendingLanes;if(d===0)return 0;var g=0,v=n.suspendedLanes,k=n.pingedLanes;n=n.warmLanes;var A=d&134217727;return A!==0?(d=A&~v,d!==0?g=zs(d):(k&=A,k!==0?g=zs(k):c||(c=A&~n,c!==0&&(g=zs(c))))):(A=d&~v,A!==0?g=zs(A):k!==0?g=zs(k):c||(c=d&~n,c!==0&&(g=zs(c)))),g===0?0:r!==0&&r!==g&&(r&v)===0&&(v=g&-g,c=r&-r,v>=c||v===32&&(c&4194048)!==0)?r:g}function ae(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function _e(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function He(){var n=gn;return gn<<=1,(gn&62914560)===0&&(gn=4194304),n}function Nt(n){for(var r=[],c=0;31>c;c++)r.push(n);return r}function wt(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Ae(n,r,c,d,g,v){var k=n.pendingLanes;n.pendingLanes=c,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=c,n.entangledLanes&=c,n.errorRecoveryDisabledLanes&=c,n.shellSuspendCounter=0;var A=n.entanglements,B=n.expirationTimes,ee=n.hiddenUpdates;for(c=k&~c;0<c;){var ie=31-ks(c),ce=1<<ie;A[ie]=0,B[ie]=-1;var te=ee[ie];if(te!==null)for(ee[ie]=null,ie=0;ie<te.length;ie++){var se=te[ie];se!==null&&(se.lane&=-536870913)}c&=~ce}d!==0&&ke(n,d,0),v!==0&&g===0&&n.tag!==0&&(n.suspendedLanes|=v&~(k&~r))}function ke(n,r,c){n.pendingLanes|=r,n.suspendedLanes&=~r;var d=31-ks(r);n.entangledLanes|=r,n.entanglements[d]=n.entanglements[d]|1073741824|c&261930}function Pe(n,r){var c=n.entangledLanes|=r;for(n=n.entanglements;c;){var d=31-ks(c),g=1<<d;g&r|n[d]&r&&(n[d]|=r),c&=~g}}function qt(n,r){var c=r&-r;return c=(c&42)!==0?1:Rt(c),(c&(n.suspendedLanes|r))!==0?0:c}function Rt(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Pi(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function to(){var n=X.p;return n!==0?n:(n=window.event,n===void 0?32:H1(n.type))}function so(n,r){var c=X.p;try{return X.p=n,r()}finally{X.p=c}}var di=Math.random().toString(36).slice(2),Gt="__reactFiber$"+di,Is="__reactProps$"+di,gr="__reactContainer$"+di,pl="__reactEvents$"+di,mu="__reactListeners$"+di,no="__reactHandles$"+di,pu="__reactResources$"+di,ca="__reactMarker$"+di;function gl(n){delete n[Gt],delete n[Is],delete n[pl],delete n[mu],delete n[no]}function Ks(n){var r=n[Gt];if(r)return r;for(var c=n.parentNode;c;){if(r=c[gr]||c[Gt]){if(c=r.alternate,r.child!==null||c!==null&&c.child!==null)for(n=C1(n);n!==null;){if(c=n[Gt])return c;n=C1(n)}return r}n=c,c=n.parentNode}return null}function $i(n){if(n=n[Gt]||n[gr]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function br(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(i(33))}function vr(n){var r=n[pu];return r||(r=n[pu]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Zt(n){n[ca]=!0}var gu=new Set,ua={};function Hi(n,r){ge(n,r),ge(n+"Capture",r)}function ge(n,r){for(ua[n]=r,n=0;n<r.length;n++)gu.add(r[n])}var Re=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Xe={},pt={};function Kt(n){return qs.call(pt,n)?!0:qs.call(Xe,n)?!1:Re.test(n)?pt[n]=!0:(Xe[n]=!0,!1)}function Ps(n,r,c){if(Kt(r))if(c===null)n.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var d=r.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,""+c)}}function bn(n,r,c){if(c===null)n.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+c)}}function sn(n,r,c,d){if(d===null)n.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(c);return}n.setAttributeNS(r,c,""+d)}}function Et(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function vn(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function bu(n,r,c){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var g=d.get,v=d.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return g.call(this)},set:function(k){c=""+k,v.call(this,k)}}),Object.defineProperty(n,r,{enumerable:d.enumerable}),{getValue:function(){return c},setValue:function(k){c=""+k},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function io(n){if(!n._valueTracker){var r=vn(n)?"checked":"value";n._valueTracker=bu(n,r,""+n[r])}}function bl(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var c=r.getValue(),d="";return n&&(d=vn(n)?n.checked?"true":"false":n.value),n=d,n!==c?(r.setValue(n),!0):!1}function ro(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var rf=/[\n"\\]/g;function nn(n){return n.replace(rf,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function vl(n,r,c,d,g,v,k,A){n.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?n.type=k:n.removeAttribute("type"),r!=null?k==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+Et(r)):n.value!==""+Et(r)&&(n.value=""+Et(r)):k!=="submit"&&k!=="reset"||n.removeAttribute("value"),r!=null?ao(n,k,Et(r)):c!=null?ao(n,k,Et(c)):d!=null&&n.removeAttribute("value"),g==null&&v!=null&&(n.defaultChecked=!!v),g!=null&&(n.checked=g&&typeof g!="function"&&typeof g!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?n.name=""+Et(A):n.removeAttribute("name")}function da(n,r,c,d,g,v,k,A){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(n.type=v),r!=null||c!=null){if(!(v!=="submit"&&v!=="reset"||r!=null)){io(n);return}c=c!=null?""+Et(c):"",r=r!=null?""+Et(r):c,A||r===n.value||(n.value=r),n.defaultValue=r}d=d??g,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=A?n.checked:!!d,n.defaultChecked=!!d,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(n.name=k),io(n)}function ao(n,r,c){r==="number"&&ro(n.ownerDocument)===n||n.defaultValue===""+c||(n.defaultValue=""+c)}function Cs(n,r,c,d){if(n=n.options,r){r={};for(var g=0;g<c.length;g++)r["$"+c[g]]=!0;for(c=0;c<n.length;c++)g=r.hasOwnProperty("$"+n[c].value),n[c].selected!==g&&(n[c].selected=g),g&&d&&(n[c].defaultSelected=!0)}else{for(c=""+Et(c),r=null,g=0;g<n.length;g++){if(n[g].value===c){n[g].selected=!0,d&&(n[g].defaultSelected=!0);return}r!==null||n[g].disabled||(r=n[g])}r!==null&&(r.selected=!0)}}function vu(n,r,c){if(r!=null&&(r=""+Et(r),r!==n.value&&(n.value=r),c==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=c!=null?""+Et(c):""}function oo(n,r,c,d){if(r==null){if(d!=null){if(c!=null)throw Error(i(92));if(q(d)){if(1<d.length)throw Error(i(93));d=d[0]}c=d}c==null&&(c=""),r=c}c=Et(r),n.defaultValue=c,d=n.textContent,d===c&&d!==""&&d!==null&&(n.value=d),io(n)}function Ie(n,r){if(r){var c=n.firstChild;if(c&&c===n.lastChild&&c.nodeType===3){c.nodeValue=r;return}}n.textContent=r}var xu=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Qt(n,r,c){var d=r.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?d?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":d?n.setProperty(r,c):typeof c!="number"||c===0||xu.has(r)?r==="float"?n.cssFloat=c:n[r]=(""+c).trim():n[r]=c+"px"}function gt(n,r,c){if(r!=null&&typeof r!="object")throw Error(i(62));if(n=n.style,c!=null){for(var d in c)!c.hasOwnProperty(d)||r!=null&&r.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var g in r)d=r[g],r.hasOwnProperty(g)&&c[g]!==d&&Qt(n,g,d)}else for(var v in r)r.hasOwnProperty(v)&&Qt(n,v,r[v])}function xr(n){if(n.indexOf("-")===-1)return!1;switch(n){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 Ui=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),xl=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function _r(n){return xl.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ve(){}var Me=null;function Ve(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var tt=null,zt=null;function jn(n){var r=$i(n);if(r&&(n=r.stateNode)){var c=n[Is]||null;e:switch(n=r.stateNode,r.type){case"input":if(vl(n,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),r=c.name,c.type==="radio"&&r!=null){for(c=n;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+nn(""+r)+'"][type="radio"]'),r=0;r<c.length;r++){var d=c[r];if(d!==n&&d.form===n.form){var g=d[Is]||null;if(!g)throw Error(i(90));vl(d,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(r=0;r<c.length;r++)d=c[r],d.form===n.form&&bl(d)}break e;case"textarea":vu(n,c.value,c.defaultValue);break e;case"select":r=c.value,r!=null&&Cs(n,!!c.multiple,r,!1)}}}var _l=!1;function _u(n,r,c){if(_l)return n(r,c);_l=!0;try{var d=n(r);return d}finally{if(_l=!1,(tt!==null||zt!==null)&&(od(),tt&&(r=tt,n=zt,zt=tt=null,jn(r),n)))for(r=0;r<n.length;r++)jn(n[r])}}function yl(n,r){var c=n.stateNode;if(c===null)return null;var d=c[Is]||null;if(d===null)return null;c=d[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":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(c&&typeof c!="function")throw Error(i(231,r,typeof c));return c}var Fi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),af=!1;if(Fi)try{var Sl={};Object.defineProperty(Sl,"passive",{get:function(){af=!0}}),window.addEventListener("test",Sl,Sl),window.removeEventListener("test",Sl,Sl)}catch{af=!1}var yr=null,of=null,yu=null;function vv(){if(yu)return yu;var n,r=of,c=r.length,d,g="value"in yr?yr.value:yr.textContent,v=g.length;for(n=0;n<c&&r[n]===g[n];n++);var k=c-n;for(d=1;d<=k&&r[c-d]===g[v-d];d++);return yu=g.slice(n,1<d?1-d:void 0)}function Su(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function wu(){return!0}function xv(){return!1}function rn(n){function r(c,d,g,v,k){this._reactName=c,this._targetInst=g,this.type=d,this.nativeEvent=v,this.target=k,this.currentTarget=null;for(var A in n)n.hasOwnProperty(A)&&(c=n[A],this[A]=c?c(v):v[A]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?wu:xv,this.isPropagationStopped=xv,this}return b(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=wu)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=wu)},persist:function(){},isPersistent:wu}),r}var ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ku=rn(ha),wl=b({},ha,{view:0,detail:0}),i5=rn(wl),lf,cf,kl,Cu=b({},wl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:df,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==kl&&(kl&&n.type==="mousemove"?(lf=n.screenX-kl.screenX,cf=n.screenY-kl.screenY):cf=lf=0,kl=n),lf)},movementY:function(n){return"movementY"in n?n.movementY:cf}}),_v=rn(Cu),r5=b({},Cu,{dataTransfer:0}),a5=rn(r5),o5=b({},wl,{relatedTarget:0}),uf=rn(o5),l5=b({},ha,{animationName:0,elapsedTime:0,pseudoElement:0}),c5=rn(l5),u5=b({},ha,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),d5=rn(u5),h5=b({},ha,{data:0}),yv=rn(h5),f5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},m5={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"},p5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function g5(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=p5[n])?!!r[n]:!1}function df(){return g5}var b5=b({},wl,{key:function(n){if(n.key){var r=f5[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=Su(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?m5[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:df,charCode:function(n){return n.type==="keypress"?Su(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Su(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),v5=rn(b5),x5=b({},Cu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sv=rn(x5),_5=b({},wl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:df}),y5=rn(_5),S5=b({},ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),w5=rn(S5),k5=b({},Cu,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),C5=rn(k5),E5=b({},ha,{newState:0,oldState:0}),N5=rn(E5),T5=[9,13,27,32],hf=Fi&&"CompositionEvent"in window,Cl=null;Fi&&"documentMode"in document&&(Cl=document.documentMode);var A5=Fi&&"TextEvent"in window&&!Cl,wv=Fi&&(!hf||Cl&&8<Cl&&11>=Cl),kv=" ",Cv=!1;function Ev(n,r){switch(n){case"keyup":return T5.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nv(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var lo=!1;function M5(n,r){switch(n){case"compositionend":return Nv(r);case"keypress":return r.which!==32?null:(Cv=!0,kv);case"textInput":return n=r.data,n===kv&&Cv?null:n;default:return null}}function j5(n,r){if(lo)return n==="compositionend"||!hf&&Ev(n,r)?(n=vv(),yu=of=yr=null,lo=!1,n):null;switch(n){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 wv&&r.locale!=="ko"?null:r.data;default:return null}}var R5={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 Tv(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!R5[n.type]:r==="textarea"}function Av(n,r,c,d){tt?zt?zt.push(d):zt=[d]:tt=d,r=md(r,"onChange"),0<r.length&&(c=new ku("onChange","change",null,c,d),n.push({event:c,listeners:r}))}var El=null,Nl=null;function D5(n){d1(n,0)}function Eu(n){var r=br(n);if(bl(r))return n}function Mv(n,r){if(n==="change")return r}var jv=!1;if(Fi){var ff;if(Fi){var mf="oninput"in document;if(!mf){var Rv=document.createElement("div");Rv.setAttribute("oninput","return;"),mf=typeof Rv.oninput=="function"}ff=mf}else ff=!1;jv=ff&&(!document.documentMode||9<document.documentMode)}function Dv(){El&&(El.detachEvent("onpropertychange",Ov),Nl=El=null)}function Ov(n){if(n.propertyName==="value"&&Eu(Nl)){var r=[];Av(r,Nl,n,Ve(n)),_u(D5,r)}}function O5(n,r,c){n==="focusin"?(Dv(),El=r,Nl=c,El.attachEvent("onpropertychange",Ov)):n==="focusout"&&Dv()}function L5(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Eu(Nl)}function B5(n,r){if(n==="click")return Eu(r)}function z5(n,r){if(n==="input"||n==="change")return Eu(r)}function I5(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var xn=typeof Object.is=="function"?Object.is:I5;function Tl(n,r){if(xn(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var c=Object.keys(n),d=Object.keys(r);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++){var g=c[d];if(!qs.call(r,g)||!xn(n[g],r[g]))return!1}return!0}function Lv(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Bv(n,r){var c=Lv(n);n=0;for(var d;c;){if(c.nodeType===3){if(d=n+c.textContent.length,n<=r&&d>=r)return{node:c,offset:r-n};n=d}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Lv(c)}}function zv(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?zv(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Iv(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=ro(n.document);r instanceof n.HTMLIFrameElement;){try{var c=typeof r.contentWindow.location.href=="string"}catch{c=!1}if(c)n=r.contentWindow;else break;r=ro(n.document)}return r}function pf(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var P5=Fi&&"documentMode"in document&&11>=document.documentMode,co=null,gf=null,Al=null,bf=!1;function Pv(n,r,c){var d=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;bf||co==null||co!==ro(d)||(d=co,"selectionStart"in d&&pf(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Al&&Tl(Al,d)||(Al=d,d=md(gf,"onSelect"),0<d.length&&(r=new ku("onSelect","select",null,r,c),n.push({event:r,listeners:d}),r.target=co)))}function fa(n,r){var c={};return c[n.toLowerCase()]=r.toLowerCase(),c["Webkit"+n]="webkit"+r,c["Moz"+n]="moz"+r,c}var uo={animationend:fa("Animation","AnimationEnd"),animationiteration:fa("Animation","AnimationIteration"),animationstart:fa("Animation","AnimationStart"),transitionrun:fa("Transition","TransitionRun"),transitionstart:fa("Transition","TransitionStart"),transitioncancel:fa("Transition","TransitionCancel"),transitionend:fa("Transition","TransitionEnd")},vf={},$v={};Fi&&($v=document.createElement("div").style,"AnimationEvent"in window||(delete uo.animationend.animation,delete uo.animationiteration.animation,delete uo.animationstart.animation),"TransitionEvent"in window||delete uo.transitionend.transition);function ma(n){if(vf[n])return vf[n];if(!uo[n])return n;var r=uo[n],c;for(c in r)if(r.hasOwnProperty(c)&&c in $v)return vf[n]=r[c];return n}var Hv=ma("animationend"),Uv=ma("animationiteration"),Fv=ma("animationstart"),$5=ma("transitionrun"),H5=ma("transitionstart"),U5=ma("transitioncancel"),Vv=ma("transitionend"),qv=new Map,xf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");xf.push("scrollEnd");function ti(n,r){qv.set(n,r),Hi(r,[n])}var Nu=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Rn=[],ho=0,_f=0;function Tu(){for(var n=ho,r=_f=ho=0;r<n;){var c=Rn[r];Rn[r++]=null;var d=Rn[r];Rn[r++]=null;var g=Rn[r];Rn[r++]=null;var v=Rn[r];if(Rn[r++]=null,d!==null&&g!==null){var k=d.pending;k===null?g.next=g:(g.next=k.next,k.next=g),d.pending=g}v!==0&&Gv(c,g,v)}}function Au(n,r,c,d){Rn[ho++]=n,Rn[ho++]=r,Rn[ho++]=c,Rn[ho++]=d,_f|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function yf(n,r,c,d){return Au(n,r,c,d),Mu(n)}function pa(n,r){return Au(n,null,null,r),Mu(n)}function Gv(n,r,c){n.lanes|=c;var d=n.alternate;d!==null&&(d.lanes|=c);for(var g=!1,v=n.return;v!==null;)v.childLanes|=c,d=v.alternate,d!==null&&(d.childLanes|=c),v.tag===22&&(n=v.stateNode,n===null||n._visibility&1||(g=!0)),n=v,v=v.return;return n.tag===3?(v=n.stateNode,g&&r!==null&&(g=31-ks(c),n=v.hiddenUpdates,d=n[g],d===null?n[g]=[r]:d.push(r),r.lane=c|536870912),v):null}function Mu(n){if(50<Zl)throw Zl=0,Mm=null,Error(i(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var fo={};function F5(n,r,c,d){this.tag=n,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(n,r,c,d){return new F5(n,r,c,d)}function Sf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Vi(n,r){var c=n.alternate;return c===null?(c=_n(n.tag,r,n.key,n.mode),c.elementType=n.elementType,c.type=n.type,c.stateNode=n.stateNode,c.alternate=n,n.alternate=c):(c.pendingProps=r,c.type=n.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=n.flags&65011712,c.childLanes=n.childLanes,c.lanes=n.lanes,c.child=n.child,c.memoizedProps=n.memoizedProps,c.memoizedState=n.memoizedState,c.updateQueue=n.updateQueue,r=n.dependencies,c.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},c.sibling=n.sibling,c.index=n.index,c.ref=n.ref,c.refCleanup=n.refCleanup,c}function Kv(n,r){n.flags&=65011714;var c=n.alternate;return c===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=c.childLanes,n.lanes=c.lanes,n.child=c.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=c.memoizedProps,n.memoizedState=c.memoizedState,n.updateQueue=c.updateQueue,n.type=c.type,r=c.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function ju(n,r,c,d,g,v){var k=0;if(d=n,typeof n=="function")Sf(n)&&(k=1);else if(typeof n=="string")k=WT(n,c,le.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case H:return n=_n(31,c,r,g),n.elementType=H,n.lanes=v,n;case S:return ga(c.children,g,v,r);case C:k=8,g|=24;break;case E:return n=_n(12,c,r,g|2),n.elementType=E,n.lanes=v,n;case R:return n=_n(13,c,r,g),n.elementType=R,n.lanes=v,n;case z:return n=_n(19,c,r,g),n.elementType=z,n.lanes=v,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case N:k=10;break e;case T:k=9;break e;case M:k=11;break e;case L:k=14;break e;case j:k=16,d=null;break e}k=29,c=Error(i(130,n===null?"null":typeof n,"")),d=null}return r=_n(k,c,r,g),r.elementType=n,r.type=d,r.lanes=v,r}function ga(n,r,c,d){return n=_n(7,n,d,r),n.lanes=c,n}function wf(n,r,c){return n=_n(6,n,null,r),n.lanes=c,n}function Wv(n){var r=_n(18,null,null,0);return r.stateNode=n,r}function kf(n,r,c){return r=_n(4,n.children!==null?n.children:[],n.key,r),r.lanes=c,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var Yv=new WeakMap;function Dn(n,r){if(typeof n=="object"&&n!==null){var c=Yv.get(n);return c!==void 0?c:(r={value:n,source:r,stack:mt(r)},Yv.set(n,r),r)}return{value:n,source:r,stack:mt(r)}}var mo=[],po=0,Ru=null,Ml=0,On=[],Ln=0,Sr=null,hi=1,fi="";function qi(n,r){mo[po++]=Ml,mo[po++]=Ru,Ru=n,Ml=r}function Xv(n,r,c){On[Ln++]=hi,On[Ln++]=fi,On[Ln++]=Sr,Sr=n;var d=hi;n=fi;var g=32-ks(d)-1;d&=~(1<<g),c+=1;var v=32-ks(r)+g;if(30<v){var k=g-g%5;v=(d&(1<<k)-1).toString(32),d>>=k,g-=k,hi=1<<32-ks(r)+g|c<<g|d,fi=v+n}else hi=1<<v|c<<g|d,fi=n}function Cf(n){n.return!==null&&(qi(n,1),Xv(n,1,0))}function Ef(n){for(;n===Ru;)Ru=mo[--po],mo[po]=null,Ml=mo[--po],mo[po]=null;for(;n===Sr;)Sr=On[--Ln],On[Ln]=null,fi=On[--Ln],On[Ln]=null,hi=On[--Ln],On[Ln]=null}function Zv(n,r){On[Ln++]=hi,On[Ln++]=fi,On[Ln++]=Sr,hi=r.id,fi=r.overflow,Sr=n}var Es=null,Tt=null,rt=!1,wr=null,Bn=!1,Nf=Error(i(519));function kr(n){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw jl(Dn(r,n)),Nf}function Qv(n){var r=n.stateNode,c=n.type,d=n.memoizedProps;switch(r[Gt]=n,r[Is]=d,c){case"dialog":Je("cancel",r),Je("close",r);break;case"iframe":case"object":case"embed":Je("load",r);break;case"video":case"audio":for(c=0;c<Jl.length;c++)Je(Jl[c],r);break;case"source":Je("error",r);break;case"img":case"image":case"link":Je("error",r),Je("load",r);break;case"details":Je("toggle",r);break;case"input":Je("invalid",r),da(r,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Je("invalid",r);break;case"textarea":Je("invalid",r),oo(r,d.value,d.defaultValue,d.children)}c=d.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||r.textContent===""+c||d.suppressHydrationWarning===!0||p1(r.textContent,c)?(d.popover!=null&&(Je("beforetoggle",r),Je("toggle",r)),d.onScroll!=null&&Je("scroll",r),d.onScrollEnd!=null&&Je("scrollend",r),d.onClick!=null&&(r.onclick=ve),r=!0):r=!1,r||kr(n,!0)}function Jv(n){for(Es=n.return;Es;)switch(Es.tag){case 5:case 31:case 13:Bn=!1;return;case 27:case 3:Bn=!0;return;default:Es=Es.return}}function go(n){if(n!==Es)return!1;if(!rt)return Jv(n),rt=!0,!1;var r=n.tag,c;if((c=r!==3&&r!==27)&&((c=r===5)&&(c=n.type,c=!(c!=="form"&&c!=="button")||qm(n.type,n.memoizedProps)),c=!c),c&&Tt&&kr(n),Jv(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));Tt=k1(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));Tt=k1(n)}else r===27?(r=Tt,Ir(n.type)?(n=Xm,Xm=null,Tt=n):Tt=r):Tt=Es?In(n.stateNode.nextSibling):null;return!0}function ba(){Tt=Es=null,rt=!1}function Tf(){var n=wr;return n!==null&&(cn===null?cn=n:cn.push.apply(cn,n),wr=null),n}function jl(n){wr===null?wr=[n]:wr.push(n)}var Af=D(null),va=null,Gi=null;function Cr(n,r,c){he(Af,r._currentValue),r._currentValue=c}function Ki(n){n._currentValue=Af.current,W(Af)}function Mf(n,r,c){for(;n!==null;){var d=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,d!==null&&(d.childLanes|=r)):d!==null&&(d.childLanes&r)!==r&&(d.childLanes|=r),n===c)break;n=n.return}}function jf(n,r,c,d){var g=n.child;for(g!==null&&(g.return=n);g!==null;){var v=g.dependencies;if(v!==null){var k=g.child;v=v.firstContext;e:for(;v!==null;){var A=v;v=g;for(var B=0;B<r.length;B++)if(A.context===r[B]){v.lanes|=c,A=v.alternate,A!==null&&(A.lanes|=c),Mf(v.return,c,n),d||(k=null);break e}v=A.next}}else if(g.tag===18){if(k=g.return,k===null)throw Error(i(341));k.lanes|=c,v=k.alternate,v!==null&&(v.lanes|=c),Mf(k,c,n),k=null}else k=g.child;if(k!==null)k.return=g;else for(k=g;k!==null;){if(k===n){k=null;break}if(g=k.sibling,g!==null){g.return=k.return,k=g;break}k=k.return}g=k}}function bo(n,r,c,d){n=null;for(var g=r,v=!1;g!==null;){if(!v){if((g.flags&524288)!==0)v=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var k=g.alternate;if(k===null)throw Error(i(387));if(k=k.memoizedProps,k!==null){var A=g.type;xn(g.pendingProps.value,k.value)||(n!==null?n.push(A):n=[A])}}else if(g===fe.current){if(k=g.alternate,k===null)throw Error(i(387));k.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(n!==null?n.push(ic):n=[ic])}g=g.return}n!==null&&jf(r,n,c,d),r.flags|=262144}function Du(n){for(n=n.firstContext;n!==null;){if(!xn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function xa(n){va=n,Gi=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Ns(n){return ex(va,n)}function Ou(n,r){return va===null&&xa(n),ex(n,r)}function ex(n,r){var c=r._currentValue;if(r={context:r,memoizedValue:c,next:null},Gi===null){if(n===null)throw Error(i(308));Gi=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else Gi=Gi.next=r;return c}var V5=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(c,d){n.push(d)}};this.abort=function(){r.aborted=!0,n.forEach(function(c){return c()})}},q5=e.unstable_scheduleCallback,G5=e.unstable_NormalPriority,Jt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rf(){return{controller:new V5,data:new Map,refCount:0}}function Rl(n){n.refCount--,n.refCount===0&&q5(G5,function(){n.controller.abort()})}var Dl=null,Df=0,vo=0,xo=null;function K5(n,r){if(Dl===null){var c=Dl=[];Df=0,vo=Bm(),xo={status:"pending",value:void 0,then:function(d){c.push(d)}}}return Df++,r.then(tx,tx),r}function tx(){if(--Df===0&&Dl!==null){xo!==null&&(xo.status="fulfilled");var n=Dl;Dl=null,vo=0,xo=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function W5(n,r){var c=[],d={status:"pending",value:null,reason:null,then:function(g){c.push(g)}};return n.then(function(){d.status="fulfilled",d.value=r;for(var g=0;g<c.length;g++)(0,c[g])(r)},function(g){for(d.status="rejected",d.reason=g,g=0;g<c.length;g++)(0,c[g])(void 0)}),d}var sx=O.S;O.S=function(n,r){P_=Bt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&K5(n,r),sx!==null&&sx(n,r)};var _a=D(null);function Of(){var n=_a.current;return n!==null?n:kt.pooledCache}function Lu(n,r){r===null?he(_a,_a.current):he(_a,r.pool)}function nx(){var n=Of();return n===null?null:{parent:Jt._currentValue,pool:n}}var _o=Error(i(460)),Lf=Error(i(474)),Bu=Error(i(542)),zu={then:function(){}};function ix(n){return n=n.status,n==="fulfilled"||n==="rejected"}function rx(n,r,c){switch(c=n[c],c===void 0?n.push(r):c!==r&&(r.then(ve,ve),r=c),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,ox(n),n;default:if(typeof r.status=="string")r.then(ve,ve);else{if(n=kt,n!==null&&100<n.shellSuspendCounter)throw Error(i(482));n=r,n.status="pending",n.then(function(d){if(r.status==="pending"){var g=r;g.status="fulfilled",g.value=d}},function(d){if(r.status==="pending"){var g=r;g.status="rejected",g.reason=d}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,ox(n),n}throw Sa=r,_o}}function ya(n){try{var r=n._init;return r(n._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Sa=c,_o):c}}var Sa=null;function ax(){if(Sa===null)throw Error(i(459));var n=Sa;return Sa=null,n}function ox(n){if(n===_o||n===Bu)throw Error(i(483))}var yo=null,Ol=0;function Iu(n){var r=Ol;return Ol+=1,yo===null&&(yo=[]),rx(yo,n,r)}function Ll(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Pu(n,r){throw r.$$typeof===x?Error(i(525)):(n=Object.prototype.toString.call(r),Error(i(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function lx(n){function r(G,U){if(n){var J=G.deletions;J===null?(G.deletions=[U],G.flags|=16):J.push(U)}}function c(G,U){if(!n)return null;for(;U!==null;)r(G,U),U=U.sibling;return null}function d(G){for(var U=new Map;G!==null;)G.key!==null?U.set(G.key,G):U.set(G.index,G),G=G.sibling;return U}function g(G,U){return G=Vi(G,U),G.index=0,G.sibling=null,G}function v(G,U,J){return G.index=J,n?(J=G.alternate,J!==null?(J=J.index,J<U?(G.flags|=67108866,U):J):(G.flags|=67108866,U)):(G.flags|=1048576,U)}function k(G){return n&&G.alternate===null&&(G.flags|=67108866),G}function A(G,U,J,oe){return U===null||U.tag!==6?(U=wf(J,G.mode,oe),U.return=G,U):(U=g(U,J),U.return=G,U)}function B(G,U,J,oe){var Oe=J.type;return Oe===S?ie(G,U,J.props.children,oe,J.key):U!==null&&(U.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===j&&ya(Oe)===U.type)?(U=g(U,J.props),Ll(U,J),U.return=G,U):(U=ju(J.type,J.key,J.props,null,G.mode,oe),Ll(U,J),U.return=G,U)}function ee(G,U,J,oe){return U===null||U.tag!==4||U.stateNode.containerInfo!==J.containerInfo||U.stateNode.implementation!==J.implementation?(U=kf(J,G.mode,oe),U.return=G,U):(U=g(U,J.children||[]),U.return=G,U)}function ie(G,U,J,oe,Oe){return U===null||U.tag!==7?(U=ga(J,G.mode,oe,Oe),U.return=G,U):(U=g(U,J),U.return=G,U)}function ce(G,U,J){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=wf(""+U,G.mode,J),U.return=G,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case _:return J=ju(U.type,U.key,U.props,null,G.mode,J),Ll(J,U),J.return=G,J;case y:return U=kf(U,G.mode,J),U.return=G,U;case j:return U=ya(U),ce(G,U,J)}if(q(U)||K(U))return U=ga(U,G.mode,J,null),U.return=G,U;if(typeof U.then=="function")return ce(G,Iu(U),J);if(U.$$typeof===N)return ce(G,Ou(G,U),J);Pu(G,U)}return null}function te(G,U,J,oe){var Oe=U!==null?U.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Oe!==null?null:A(G,U,""+J,oe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case _:return J.key===Oe?B(G,U,J,oe):null;case y:return J.key===Oe?ee(G,U,J,oe):null;case j:return J=ya(J),te(G,U,J,oe)}if(q(J)||K(J))return Oe!==null?null:ie(G,U,J,oe,null);if(typeof J.then=="function")return te(G,U,Iu(J),oe);if(J.$$typeof===N)return te(G,U,Ou(G,J),oe);Pu(G,J)}return null}function se(G,U,J,oe,Oe){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return G=G.get(J)||null,A(U,G,""+oe,Oe);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case _:return G=G.get(oe.key===null?J:oe.key)||null,B(U,G,oe,Oe);case y:return G=G.get(oe.key===null?J:oe.key)||null,ee(U,G,oe,Oe);case j:return oe=ya(oe),se(G,U,J,oe,Oe)}if(q(oe)||K(oe))return G=G.get(J)||null,ie(U,G,oe,Oe,null);if(typeof oe.then=="function")return se(G,U,J,Iu(oe),Oe);if(oe.$$typeof===N)return se(G,U,J,Ou(U,oe),Oe);Pu(U,oe)}return null}function Ne(G,U,J,oe){for(var Oe=null,ut=null,je=U,Ge=U=0,nt=null;je!==null&&Ge<J.length;Ge++){je.index>Ge?(nt=je,je=null):nt=je.sibling;var dt=te(G,je,J[Ge],oe);if(dt===null){je===null&&(je=nt);break}n&&je&&dt.alternate===null&&r(G,je),U=v(dt,U,Ge),ut===null?Oe=dt:ut.sibling=dt,ut=dt,je=nt}if(Ge===J.length)return c(G,je),rt&&qi(G,Ge),Oe;if(je===null){for(;Ge<J.length;Ge++)je=ce(G,J[Ge],oe),je!==null&&(U=v(je,U,Ge),ut===null?Oe=je:ut.sibling=je,ut=je);return rt&&qi(G,Ge),Oe}for(je=d(je);Ge<J.length;Ge++)nt=se(je,G,Ge,J[Ge],oe),nt!==null&&(n&&nt.alternate!==null&&je.delete(nt.key===null?Ge:nt.key),U=v(nt,U,Ge),ut===null?Oe=nt:ut.sibling=nt,ut=nt);return n&&je.forEach(function(Fr){return r(G,Fr)}),rt&&qi(G,Ge),Oe}function Be(G,U,J,oe){if(J==null)throw Error(i(151));for(var Oe=null,ut=null,je=U,Ge=U=0,nt=null,dt=J.next();je!==null&&!dt.done;Ge++,dt=J.next()){je.index>Ge?(nt=je,je=null):nt=je.sibling;var Fr=te(G,je,dt.value,oe);if(Fr===null){je===null&&(je=nt);break}n&&je&&Fr.alternate===null&&r(G,je),U=v(Fr,U,Ge),ut===null?Oe=Fr:ut.sibling=Fr,ut=Fr,je=nt}if(dt.done)return c(G,je),rt&&qi(G,Ge),Oe;if(je===null){for(;!dt.done;Ge++,dt=J.next())dt=ce(G,dt.value,oe),dt!==null&&(U=v(dt,U,Ge),ut===null?Oe=dt:ut.sibling=dt,ut=dt);return rt&&qi(G,Ge),Oe}for(je=d(je);!dt.done;Ge++,dt=J.next())dt=se(je,G,Ge,dt.value,oe),dt!==null&&(n&&dt.alternate!==null&&je.delete(dt.key===null?Ge:dt.key),U=v(dt,U,Ge),ut===null?Oe=dt:ut.sibling=dt,ut=dt);return n&&je.forEach(function(rA){return r(G,rA)}),rt&&qi(G,Ge),Oe}function yt(G,U,J,oe){if(typeof J=="object"&&J!==null&&J.type===S&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case _:e:{for(var Oe=J.key;U!==null;){if(U.key===Oe){if(Oe=J.type,Oe===S){if(U.tag===7){c(G,U.sibling),oe=g(U,J.props.children),oe.return=G,G=oe;break e}}else if(U.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===j&&ya(Oe)===U.type){c(G,U.sibling),oe=g(U,J.props),Ll(oe,J),oe.return=G,G=oe;break e}c(G,U);break}else r(G,U);U=U.sibling}J.type===S?(oe=ga(J.props.children,G.mode,oe,J.key),oe.return=G,G=oe):(oe=ju(J.type,J.key,J.props,null,G.mode,oe),Ll(oe,J),oe.return=G,G=oe)}return k(G);case y:e:{for(Oe=J.key;U!==null;){if(U.key===Oe)if(U.tag===4&&U.stateNode.containerInfo===J.containerInfo&&U.stateNode.implementation===J.implementation){c(G,U.sibling),oe=g(U,J.children||[]),oe.return=G,G=oe;break e}else{c(G,U);break}else r(G,U);U=U.sibling}oe=kf(J,G.mode,oe),oe.return=G,G=oe}return k(G);case j:return J=ya(J),yt(G,U,J,oe)}if(q(J))return Ne(G,U,J,oe);if(K(J)){if(Oe=K(J),typeof Oe!="function")throw Error(i(150));return J=Oe.call(J),Be(G,U,J,oe)}if(typeof J.then=="function")return yt(G,U,Iu(J),oe);if(J.$$typeof===N)return yt(G,U,Ou(G,J),oe);Pu(G,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,U!==null&&U.tag===6?(c(G,U.sibling),oe=g(U,J),oe.return=G,G=oe):(c(G,U),oe=wf(J,G.mode,oe),oe.return=G,G=oe),k(G)):c(G,U)}return function(G,U,J,oe){try{Ol=0;var Oe=yt(G,U,J,oe);return yo=null,Oe}catch(je){if(je===_o||je===Bu)throw je;var ut=_n(29,je,null,G.mode);return ut.lanes=oe,ut.return=G,ut}}}var wa=lx(!0),cx=lx(!1),Er=!1;function Bf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zf(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Nr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Tr(n,r,c){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(ht&2)!==0){var g=d.pending;return g===null?r.next=r:(r.next=g.next,g.next=r),d.pending=r,r=Mu(n),Gv(n,null,c),r}return Au(n,d,r,c),Mu(n)}function Bl(n,r,c){if(r=r.updateQueue,r!==null&&(r=r.shared,(c&4194048)!==0)){var d=r.lanes;d&=n.pendingLanes,c|=d,r.lanes=c,Pe(n,c)}}function If(n,r){var c=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,c===d)){var g=null,v=null;if(c=c.firstBaseUpdate,c!==null){do{var k={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};v===null?g=v=k:v=v.next=k,c=c.next}while(c!==null);v===null?g=v=r:v=v.next=r}else g=v=r;c={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},n.updateQueue=c;return}n=c.lastBaseUpdate,n===null?c.firstBaseUpdate=r:n.next=r,c.lastBaseUpdate=r}var Pf=!1;function zl(){if(Pf){var n=xo;if(n!==null)throw n}}function Il(n,r,c,d){Pf=!1;var g=n.updateQueue;Er=!1;var v=g.firstBaseUpdate,k=g.lastBaseUpdate,A=g.shared.pending;if(A!==null){g.shared.pending=null;var B=A,ee=B.next;B.next=null,k===null?v=ee:k.next=ee,k=B;var ie=n.alternate;ie!==null&&(ie=ie.updateQueue,A=ie.lastBaseUpdate,A!==k&&(A===null?ie.firstBaseUpdate=ee:A.next=ee,ie.lastBaseUpdate=B))}if(v!==null){var ce=g.baseState;k=0,ie=ee=B=null,A=v;do{var te=A.lane&-536870913,se=te!==A.lane;if(se?(st&te)===te:(d&te)===te){te!==0&&te===vo&&(Pf=!0),ie!==null&&(ie=ie.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var Ne=n,Be=A;te=r;var yt=c;switch(Be.tag){case 1:if(Ne=Be.payload,typeof Ne=="function"){ce=Ne.call(yt,ce,te);break e}ce=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Be.payload,te=typeof Ne=="function"?Ne.call(yt,ce,te):Ne,te==null)break e;ce=b({},ce,te);break e;case 2:Er=!0}}te=A.callback,te!==null&&(n.flags|=64,se&&(n.flags|=8192),se=g.callbacks,se===null?g.callbacks=[te]:se.push(te))}else se={lane:te,tag:A.tag,payload:A.payload,callback:A.callback,next:null},ie===null?(ee=ie=se,B=ce):ie=ie.next=se,k|=te;if(A=A.next,A===null){if(A=g.shared.pending,A===null)break;se=A,A=se.next,se.next=null,g.lastBaseUpdate=se,g.shared.pending=null}}while(!0);ie===null&&(B=ce),g.baseState=B,g.firstBaseUpdate=ee,g.lastBaseUpdate=ie,v===null&&(g.shared.lanes=0),Dr|=k,n.lanes=k,n.memoizedState=ce}}function ux(n,r){if(typeof n!="function")throw Error(i(191,n));n.call(r)}function dx(n,r){var c=n.callbacks;if(c!==null)for(n.callbacks=null,n=0;n<c.length;n++)ux(c[n],r)}var So=D(null),$u=D(0);function hx(n,r){n=sr,he($u,n),he(So,r),sr=n|r.baseLanes}function $f(){he($u,sr),he(So,So.current)}function Hf(){sr=$u.current,W(So),W($u)}var yn=D(null),zn=null;function Ar(n){var r=n.alternate;he(Wt,Wt.current&1),he(yn,n),zn===null&&(r===null||So.current!==null||r.memoizedState!==null)&&(zn=n)}function Uf(n){he(Wt,Wt.current),he(yn,n),zn===null&&(zn=n)}function fx(n){n.tag===22?(he(Wt,Wt.current),he(yn,n),zn===null&&(zn=n)):Mr()}function Mr(){he(Wt,Wt.current),he(yn,yn.current)}function Sn(n){W(yn),zn===n&&(zn=null),W(Wt)}var Wt=D(0);function Hu(n){for(var r=n;r!==null;){if(r.tag===13){var c=r.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Wm(c)||Ym(c)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Wi=0,qe=null,xt=null,es=null,Uu=!1,wo=!1,ka=!1,Fu=0,Pl=0,ko=null,Y5=0;function $t(){throw Error(i(321))}function Ff(n,r){if(r===null)return!1;for(var c=0;c<r.length&&c<n.length;c++)if(!xn(n[c],r[c]))return!1;return!0}function Vf(n,r,c,d,g,v){return Wi=v,qe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,O.H=n===null||n.memoizedState===null?Xx:rm,ka=!1,v=c(d,g),ka=!1,wo&&(v=px(r,c,d,g)),mx(n),v}function mx(n){O.H=Ul;var r=xt!==null&&xt.next!==null;if(Wi=0,es=xt=qe=null,Uu=!1,Pl=0,ko=null,r)throw Error(i(300));n===null||ts||(n=n.dependencies,n!==null&&Du(n)&&(ts=!0))}function px(n,r,c,d){qe=n;var g=0;do{if(wo&&(ko=null),Pl=0,wo=!1,25<=g)throw Error(i(301));if(g+=1,es=xt=null,n.updateQueue!=null){var v=n.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}O.H=Zx,v=r(c,d)}while(wo);return v}function X5(){var n=O.H,r=n.useState()[0];return r=typeof r.then=="function"?$l(r):r,n=n.useState()[0],(xt!==null?xt.memoizedState:null)!==n&&(qe.flags|=1024),r}function qf(){var n=Fu!==0;return Fu=0,n}function Gf(n,r,c){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~c}function Kf(n){if(Uu){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}Uu=!1}Wi=0,es=xt=qe=null,wo=!1,Pl=Fu=0,ko=null}function Ws(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return es===null?qe.memoizedState=es=n:es=es.next=n,es}function Yt(){if(xt===null){var n=qe.alternate;n=n!==null?n.memoizedState:null}else n=xt.next;var r=es===null?qe.memoizedState:es.next;if(r!==null)es=r,xt=n;else{if(n===null)throw qe.alternate===null?Error(i(467)):Error(i(310));xt=n,n={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},es===null?qe.memoizedState=es=n:es=es.next=n}return es}function Vu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $l(n){var r=Pl;return Pl+=1,ko===null&&(ko=[]),n=rx(ko,n,r),r=qe,(es===null?r.memoizedState:es.next)===null&&(r=r.alternate,O.H=r===null||r.memoizedState===null?Xx:rm),n}function qu(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return $l(n);if(n.$$typeof===N)return Ns(n)}throw Error(i(438,String(n)))}function Wf(n){var r=null,c=qe.updateQueue;if(c!==null&&(r=c.memoCache),r==null){var d=qe.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(r={data:d.data.map(function(g){return g.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),c===null&&(c=Vu(),qe.updateQueue=c),c.memoCache=r,c=r.data[r.index],c===void 0)for(c=r.data[r.index]=Array(n),d=0;d<n;d++)c[d]=P;return r.index++,c}function Yi(n,r){return typeof r=="function"?r(n):r}function Gu(n){var r=Yt();return Yf(r,xt,n)}function Yf(n,r,c){var d=n.queue;if(d===null)throw Error(i(311));d.lastRenderedReducer=c;var g=n.baseQueue,v=d.pending;if(v!==null){if(g!==null){var k=g.next;g.next=v.next,v.next=k}r.baseQueue=g=v,d.pending=null}if(v=n.baseState,g===null)n.memoizedState=v;else{r=g.next;var A=k=null,B=null,ee=r,ie=!1;do{var ce=ee.lane&-536870913;if(ce!==ee.lane?(st&ce)===ce:(Wi&ce)===ce){var te=ee.revertLane;if(te===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),ce===vo&&(ie=!0);else if((Wi&te)===te){ee=ee.next,te===vo&&(ie=!0);continue}else ce={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},B===null?(A=B=ce,k=v):B=B.next=ce,qe.lanes|=te,Dr|=te;ce=ee.action,ka&&c(v,ce),v=ee.hasEagerState?ee.eagerState:c(v,ce)}else te={lane:ce,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},B===null?(A=B=te,k=v):B=B.next=te,qe.lanes|=ce,Dr|=ce;ee=ee.next}while(ee!==null&&ee!==r);if(B===null?k=v:B.next=A,!xn(v,n.memoizedState)&&(ts=!0,ie&&(c=xo,c!==null)))throw c;n.memoizedState=v,n.baseState=k,n.baseQueue=B,d.lastRenderedState=v}return g===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function Xf(n){var r=Yt(),c=r.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=n;var d=c.dispatch,g=c.pending,v=r.memoizedState;if(g!==null){c.pending=null;var k=g=g.next;do v=n(v,k.action),k=k.next;while(k!==g);xn(v,r.memoizedState)||(ts=!0),r.memoizedState=v,r.baseQueue===null&&(r.baseState=v),c.lastRenderedState=v}return[v,d]}function gx(n,r,c){var d=qe,g=Yt(),v=rt;if(v){if(c===void 0)throw Error(i(407));c=c()}else c=r();var k=!xn((xt||g).memoizedState,c);if(k&&(g.memoizedState=c,ts=!0),g=g.queue,Jf(xx.bind(null,d,g,n),[n]),g.getSnapshot!==r||k||es!==null&&es.memoizedState.tag&1){if(d.flags|=2048,Co(9,{destroy:void 0},vx.bind(null,d,g,c,r),null),kt===null)throw Error(i(349));v||(Wi&127)!==0||bx(d,r,c)}return c}function bx(n,r,c){n.flags|=16384,n={getSnapshot:r,value:c},r=qe.updateQueue,r===null?(r=Vu(),qe.updateQueue=r,r.stores=[n]):(c=r.stores,c===null?r.stores=[n]:c.push(n))}function vx(n,r,c,d){r.value=c,r.getSnapshot=d,_x(r)&&yx(n)}function xx(n,r,c){return c(function(){_x(r)&&yx(n)})}function _x(n){var r=n.getSnapshot;n=n.value;try{var c=r();return!xn(n,c)}catch{return!0}}function yx(n){var r=pa(n,2);r!==null&&un(r,n,2)}function Zf(n){var r=Ws();if(typeof n=="function"){var c=n;if(n=c(),ka){Mn(!0);try{c()}finally{Mn(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yi,lastRenderedState:n},r}function Sx(n,r,c,d){return n.baseState=c,Yf(n,xt,typeof d=="function"?d:Yi)}function Z5(n,r,c,d,g){if(Yu(n))throw Error(i(485));if(n=r.action,n!==null){var v={payload:g,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){v.listeners.push(k)}};O.T!==null?c(!0):v.isTransition=!1,d(v),c=r.pending,c===null?(v.next=r.pending=v,wx(r,v)):(v.next=c.next,r.pending=c.next=v)}}function wx(n,r){var c=r.action,d=r.payload,g=n.state;if(r.isTransition){var v=O.T,k={};O.T=k;try{var A=c(g,d),B=O.S;B!==null&&B(k,A),kx(n,r,A)}catch(ee){Qf(n,r,ee)}finally{v!==null&&k.types!==null&&(v.types=k.types),O.T=v}}else try{v=c(g,d),kx(n,r,v)}catch(ee){Qf(n,r,ee)}}function kx(n,r,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(d){Cx(n,r,d)},function(d){return Qf(n,r,d)}):Cx(n,r,c)}function Cx(n,r,c){r.status="fulfilled",r.value=c,Ex(r),n.state=c,r=n.pending,r!==null&&(c=r.next,c===r?n.pending=null:(c=c.next,r.next=c,wx(n,c)))}function Qf(n,r,c){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do r.status="rejected",r.reason=c,Ex(r),r=r.next;while(r!==d)}n.action=null}function Ex(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function Nx(n,r){return r}function Tx(n,r){if(rt){var c=kt.formState;if(c!==null){e:{var d=qe;if(rt){if(Tt){t:{for(var g=Tt,v=Bn;g.nodeType!==8;){if(!v){g=null;break t}if(g=In(g.nextSibling),g===null){g=null;break t}}v=g.data,g=v==="F!"||v==="F"?g:null}if(g){Tt=In(g.nextSibling),d=g.data==="F!";break e}}kr(d)}d=!1}d&&(r=c[0])}}return c=Ws(),c.memoizedState=c.baseState=r,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nx,lastRenderedState:r},c.queue=d,c=Kx.bind(null,qe,d),d.dispatch=c,d=Zf(!1),v=im.bind(null,qe,!1,d.queue),d=Ws(),g={state:r,dispatch:null,action:n,pending:null},d.queue=g,c=Z5.bind(null,qe,g,v,c),g.dispatch=c,d.memoizedState=n,[r,c,!1]}function Ax(n){var r=Yt();return Mx(r,xt,n)}function Mx(n,r,c){if(r=Yf(n,r,Nx)[0],n=Gu(Yi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var d=$l(r)}catch(k){throw k===_o?Bu:k}else d=r;r=Yt();var g=r.queue,v=g.dispatch;return c!==r.memoizedState&&(qe.flags|=2048,Co(9,{destroy:void 0},Q5.bind(null,g,c),null)),[d,v,n]}function Q5(n,r){n.action=r}function jx(n){var r=Yt(),c=xt;if(c!==null)return Mx(r,c,n);Yt(),r=r.memoizedState,c=Yt();var d=c.queue.dispatch;return c.memoizedState=n,[r,d,!1]}function Co(n,r,c,d){return n={tag:n,create:c,deps:d,inst:r,next:null},r=qe.updateQueue,r===null&&(r=Vu(),qe.updateQueue=r),c=r.lastEffect,c===null?r.lastEffect=n.next=n:(d=c.next,c.next=n,n.next=d,r.lastEffect=n),n}function Rx(){return Yt().memoizedState}function Ku(n,r,c,d){var g=Ws();qe.flags|=n,g.memoizedState=Co(1|r,{destroy:void 0},c,d===void 0?null:d)}function Wu(n,r,c,d){var g=Yt();d=d===void 0?null:d;var v=g.memoizedState.inst;xt!==null&&d!==null&&Ff(d,xt.memoizedState.deps)?g.memoizedState=Co(r,v,c,d):(qe.flags|=n,g.memoizedState=Co(1|r,v,c,d))}function Dx(n,r){Ku(8390656,8,n,r)}function Jf(n,r){Wu(2048,8,n,r)}function J5(n){qe.flags|=4;var r=qe.updateQueue;if(r===null)r=Vu(),qe.updateQueue=r,r.events=[n];else{var c=r.events;c===null?r.events=[n]:c.push(n)}}function Ox(n){var r=Yt().memoizedState;return J5({ref:r,nextImpl:n}),function(){if((ht&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function Lx(n,r){return Wu(4,2,n,r)}function Bx(n,r){return Wu(4,4,n,r)}function zx(n,r){if(typeof r=="function"){n=n();var c=r(n);return function(){typeof c=="function"?c():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function Ix(n,r,c){c=c!=null?c.concat([n]):null,Wu(4,4,zx.bind(null,r,n),c)}function em(){}function Px(n,r){var c=Yt();r=r===void 0?null:r;var d=c.memoizedState;return r!==null&&Ff(r,d[1])?d[0]:(c.memoizedState=[n,r],n)}function $x(n,r){var c=Yt();r=r===void 0?null:r;var d=c.memoizedState;if(r!==null&&Ff(r,d[1]))return d[0];if(d=n(),ka){Mn(!0);try{n()}finally{Mn(!1)}}return c.memoizedState=[d,r],d}function tm(n,r,c){return c===void 0||(Wi&1073741824)!==0&&(st&261930)===0?n.memoizedState=r:(n.memoizedState=c,n=H_(),qe.lanes|=n,Dr|=n,c)}function Hx(n,r,c,d){return xn(c,r)?c:So.current!==null?(n=tm(n,c,d),xn(n,r)||(ts=!0),n):(Wi&42)===0||(Wi&1073741824)!==0&&(st&261930)===0?(ts=!0,n.memoizedState=c):(n=H_(),qe.lanes|=n,Dr|=n,r)}function Ux(n,r,c,d,g){var v=X.p;X.p=v!==0&&8>v?v:8;var k=O.T,A={};O.T=A,im(n,!1,r,c);try{var B=g(),ee=O.S;if(ee!==null&&ee(A,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ie=W5(B,d);Hl(n,r,ie,Cn(n))}else Hl(n,r,d,Cn(n))}catch(ce){Hl(n,r,{then:function(){},status:"rejected",reason:ce},Cn())}finally{X.p=v,k!==null&&A.types!==null&&(k.types=A.types),O.T=k}}function eT(){}function sm(n,r,c,d){if(n.tag!==5)throw Error(i(476));var g=Fx(n).queue;Ux(n,g,r,Z,c===null?eT:function(){return Vx(n),c(d)})}function Fx(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yi,lastRenderedState:Z},next:null};var c={};return r.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yi,lastRenderedState:c},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function Vx(n){var r=Fx(n);r.next===null&&(r=n.alternate.memoizedState),Hl(n,r.next.queue,{},Cn())}function nm(){return Ns(ic)}function qx(){return Yt().memoizedState}function Gx(){return Yt().memoizedState}function tT(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var c=Cn();n=Nr(c);var d=Tr(r,n,c);d!==null&&(un(d,r,c),Bl(d,r,c)),r={cache:Rf()},n.payload=r;return}r=r.return}}function sT(n,r,c){var d=Cn();c={lane:d,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Yu(n)?Wx(r,c):(c=yf(n,r,c,d),c!==null&&(un(c,n,d),Yx(c,r,d)))}function Kx(n,r,c){var d=Cn();Hl(n,r,c,d)}function Hl(n,r,c,d){var g={lane:d,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Yu(n))Wx(r,g);else{var v=n.alternate;if(n.lanes===0&&(v===null||v.lanes===0)&&(v=r.lastRenderedReducer,v!==null))try{var k=r.lastRenderedState,A=v(k,c);if(g.hasEagerState=!0,g.eagerState=A,xn(A,k))return Au(n,r,g,0),kt===null&&Tu(),!1}catch{}if(c=yf(n,r,g,d),c!==null)return un(c,n,d),Yx(c,r,d),!0}return!1}function im(n,r,c,d){if(d={lane:2,revertLane:Bm(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Yu(n)){if(r)throw Error(i(479))}else r=yf(n,c,d,2),r!==null&&un(r,n,2)}function Yu(n){var r=n.alternate;return n===qe||r!==null&&r===qe}function Wx(n,r){wo=Uu=!0;var c=n.pending;c===null?r.next=r:(r.next=c.next,c.next=r),n.pending=r}function Yx(n,r,c){if((c&4194048)!==0){var d=r.lanes;d&=n.pendingLanes,c|=d,r.lanes=c,Pe(n,c)}}var Ul={readContext:Ns,use:qu,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};Ul.useEffectEvent=$t;var Xx={readContext:Ns,use:qu,useCallback:function(n,r){return Ws().memoizedState=[n,r===void 0?null:r],n},useContext:Ns,useEffect:Dx,useImperativeHandle:function(n,r,c){c=c!=null?c.concat([n]):null,Ku(4194308,4,zx.bind(null,r,n),c)},useLayoutEffect:function(n,r){return Ku(4194308,4,n,r)},useInsertionEffect:function(n,r){Ku(4,2,n,r)},useMemo:function(n,r){var c=Ws();r=r===void 0?null:r;var d=n();if(ka){Mn(!0);try{n()}finally{Mn(!1)}}return c.memoizedState=[d,r],d},useReducer:function(n,r,c){var d=Ws();if(c!==void 0){var g=c(r);if(ka){Mn(!0);try{c(r)}finally{Mn(!1)}}}else g=r;return d.memoizedState=d.baseState=g,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:g},d.queue=n,n=n.dispatch=sT.bind(null,qe,n),[d.memoizedState,n]},useRef:function(n){var r=Ws();return n={current:n},r.memoizedState=n},useState:function(n){n=Zf(n);var r=n.queue,c=Kx.bind(null,qe,r);return r.dispatch=c,[n.memoizedState,c]},useDebugValue:em,useDeferredValue:function(n,r){var c=Ws();return tm(c,n,r)},useTransition:function(){var n=Zf(!1);return n=Ux.bind(null,qe,n.queue,!0,!1),Ws().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,c){var d=qe,g=Ws();if(rt){if(c===void 0)throw Error(i(407));c=c()}else{if(c=r(),kt===null)throw Error(i(349));(st&127)!==0||bx(d,r,c)}g.memoizedState=c;var v={value:c,getSnapshot:r};return g.queue=v,Dx(xx.bind(null,d,v,n),[n]),d.flags|=2048,Co(9,{destroy:void 0},vx.bind(null,d,v,c,r),null),c},useId:function(){var n=Ws(),r=kt.identifierPrefix;if(rt){var c=fi,d=hi;c=(d&~(1<<32-ks(d)-1)).toString(32)+c,r="_"+r+"R_"+c,c=Fu++,0<c&&(r+="H"+c.toString(32)),r+="_"}else c=Y5++,r="_"+r+"r_"+c.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:nm,useFormState:Tx,useActionState:Tx,useOptimistic:function(n){var r=Ws();r.memoizedState=r.baseState=n;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=c,r=im.bind(null,qe,!0,c),c.dispatch=r,[n,r]},useMemoCache:Wf,useCacheRefresh:function(){return Ws().memoizedState=tT.bind(null,qe)},useEffectEvent:function(n){var r=Ws(),c={impl:n};return r.memoizedState=c,function(){if((ht&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}},rm={readContext:Ns,use:qu,useCallback:Px,useContext:Ns,useEffect:Jf,useImperativeHandle:Ix,useInsertionEffect:Lx,useLayoutEffect:Bx,useMemo:$x,useReducer:Gu,useRef:Rx,useState:function(){return Gu(Yi)},useDebugValue:em,useDeferredValue:function(n,r){var c=Yt();return Hx(c,xt.memoizedState,n,r)},useTransition:function(){var n=Gu(Yi)[0],r=Yt().memoizedState;return[typeof n=="boolean"?n:$l(n),r]},useSyncExternalStore:gx,useId:qx,useHostTransitionStatus:nm,useFormState:Ax,useActionState:Ax,useOptimistic:function(n,r){var c=Yt();return Sx(c,xt,n,r)},useMemoCache:Wf,useCacheRefresh:Gx};rm.useEffectEvent=Ox;var Zx={readContext:Ns,use:qu,useCallback:Px,useContext:Ns,useEffect:Jf,useImperativeHandle:Ix,useInsertionEffect:Lx,useLayoutEffect:Bx,useMemo:$x,useReducer:Xf,useRef:Rx,useState:function(){return Xf(Yi)},useDebugValue:em,useDeferredValue:function(n,r){var c=Yt();return xt===null?tm(c,n,r):Hx(c,xt.memoizedState,n,r)},useTransition:function(){var n=Xf(Yi)[0],r=Yt().memoizedState;return[typeof n=="boolean"?n:$l(n),r]},useSyncExternalStore:gx,useId:qx,useHostTransitionStatus:nm,useFormState:jx,useActionState:jx,useOptimistic:function(n,r){var c=Yt();return xt!==null?Sx(c,xt,n,r):(c.baseState=n,[n,c.queue.dispatch])},useMemoCache:Wf,useCacheRefresh:Gx};Zx.useEffectEvent=Ox;function am(n,r,c,d){r=n.memoizedState,c=c(d,r),c=c==null?r:b({},r,c),n.memoizedState=c,n.lanes===0&&(n.updateQueue.baseState=c)}var om={enqueueSetState:function(n,r,c){n=n._reactInternals;var d=Cn(),g=Nr(d);g.payload=r,c!=null&&(g.callback=c),r=Tr(n,g,d),r!==null&&(un(r,n,d),Bl(r,n,d))},enqueueReplaceState:function(n,r,c){n=n._reactInternals;var d=Cn(),g=Nr(d);g.tag=1,g.payload=r,c!=null&&(g.callback=c),r=Tr(n,g,d),r!==null&&(un(r,n,d),Bl(r,n,d))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var c=Cn(),d=Nr(c);d.tag=2,r!=null&&(d.callback=r),r=Tr(n,d,c),r!==null&&(un(r,n,c),Bl(r,n,c))}};function Qx(n,r,c,d,g,v,k){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,v,k):r.prototype&&r.prototype.isPureReactComponent?!Tl(c,d)||!Tl(g,v):!0}function Jx(n,r,c,d){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(c,d),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(c,d),r.state!==n&&om.enqueueReplaceState(r,r.state,null)}function Ca(n,r){var c=r;if("ref"in r){c={};for(var d in r)d!=="ref"&&(c[d]=r[d])}if(n=n.defaultProps){c===r&&(c=b({},c));for(var g in n)c[g]===void 0&&(c[g]=n[g])}return c}function e_(n){Nu(n)}function t_(n){console.error(n)}function s_(n){Nu(n)}function Xu(n,r){try{var c=n.onUncaughtError;c(r.value,{componentStack:r.stack})}catch(d){setTimeout(function(){throw d})}}function n_(n,r,c){try{var d=n.onCaughtError;d(c.value,{componentStack:c.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function lm(n,r,c){return c=Nr(c),c.tag=3,c.payload={element:null},c.callback=function(){Xu(n,r)},c}function i_(n){return n=Nr(n),n.tag=3,n}function r_(n,r,c,d){var g=c.type.getDerivedStateFromError;if(typeof g=="function"){var v=d.value;n.payload=function(){return g(v)},n.callback=function(){n_(r,c,d)}}var k=c.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(n.callback=function(){n_(r,c,d),typeof g!="function"&&(Or===null?Or=new Set([this]):Or.add(this));var A=d.stack;this.componentDidCatch(d.value,{componentStack:A!==null?A:""})})}function nT(n,r,c,d,g){if(c.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(r=c.alternate,r!==null&&bo(r,c,g,!0),c=yn.current,c!==null){switch(c.tag){case 31:case 13:return zn===null?ld():c.alternate===null&&Ht===0&&(Ht=3),c.flags&=-257,c.flags|=65536,c.lanes=g,d===zu?c.flags|=16384:(r=c.updateQueue,r===null?c.updateQueue=new Set([d]):r.add(d),Dm(n,d,g)),!1;case 22:return c.flags|=65536,d===zu?c.flags|=16384:(r=c.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([d])},c.updateQueue=r):(c=r.retryQueue,c===null?r.retryQueue=new Set([d]):c.add(d)),Dm(n,d,g)),!1}throw Error(i(435,c.tag))}return Dm(n,d,g),ld(),!1}if(rt)return r=yn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=g,d!==Nf&&(n=Error(i(422),{cause:d}),jl(Dn(n,c)))):(d!==Nf&&(r=Error(i(423),{cause:d}),jl(Dn(r,c))),n=n.current.alternate,n.flags|=65536,g&=-g,n.lanes|=g,d=Dn(d,c),g=lm(n.stateNode,d,g),If(n,g),Ht!==4&&(Ht=2)),!1;var v=Error(i(520),{cause:d});if(v=Dn(v,c),Xl===null?Xl=[v]:Xl.push(v),Ht!==4&&(Ht=2),r===null)return!0;d=Dn(d,c),c=r;do{switch(c.tag){case 3:return c.flags|=65536,n=g&-g,c.lanes|=n,n=lm(c.stateNode,d,n),If(c,n),!1;case 1:if(r=c.type,v=c.stateNode,(c.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Or===null||!Or.has(v))))return c.flags|=65536,g&=-g,c.lanes|=g,g=i_(g),r_(g,n,c,d),If(c,g),!1}c=c.return}while(c!==null);return!1}var cm=Error(i(461)),ts=!1;function Ts(n,r,c,d){r.child=n===null?cx(r,null,c,d):wa(r,n.child,c,d)}function a_(n,r,c,d,g){c=c.render;var v=r.ref;if("ref"in d){var k={};for(var A in d)A!=="ref"&&(k[A]=d[A])}else k=d;return xa(r),d=Vf(n,r,c,k,v,g),A=qf(),n!==null&&!ts?(Gf(n,r,g),Xi(n,r,g)):(rt&&A&&Cf(r),r.flags|=1,Ts(n,r,d,g),r.child)}function o_(n,r,c,d,g){if(n===null){var v=c.type;return typeof v=="function"&&!Sf(v)&&v.defaultProps===void 0&&c.compare===null?(r.tag=15,r.type=v,l_(n,r,v,d,g)):(n=ju(c.type,null,d,r,r.mode,g),n.ref=r.ref,n.return=r,r.child=n)}if(v=n.child,!bm(n,g)){var k=v.memoizedProps;if(c=c.compare,c=c!==null?c:Tl,c(k,d)&&n.ref===r.ref)return Xi(n,r,g)}return r.flags|=1,n=Vi(v,d),n.ref=r.ref,n.return=r,r.child=n}function l_(n,r,c,d,g){if(n!==null){var v=n.memoizedProps;if(Tl(v,d)&&n.ref===r.ref)if(ts=!1,r.pendingProps=d=v,bm(n,g))(n.flags&131072)!==0&&(ts=!0);else return r.lanes=n.lanes,Xi(n,r,g)}return um(n,r,c,d,g)}function c_(n,r,c,d){var g=d.children,v=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((r.flags&128)!==0){if(v=v!==null?v.baseLanes|c:c,n!==null){for(d=r.child=n.child,g=0;d!==null;)g=g|d.lanes|d.childLanes,d=d.sibling;d=g&~v}else d=0,r.child=null;return u_(n,r,v,c,d)}if((c&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&Lu(r,v!==null?v.cachePool:null),v!==null?hx(r,v):$f(),fx(r);else return d=r.lanes=536870912,u_(n,r,v!==null?v.baseLanes|c:c,c,d)}else v!==null?(Lu(r,v.cachePool),hx(r,v),Mr(),r.memoizedState=null):(n!==null&&Lu(r,null),$f(),Mr());return Ts(n,r,g,c),r.child}function Fl(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function u_(n,r,c,d,g){var v=Of();return v=v===null?null:{parent:Jt._currentValue,pool:v},r.memoizedState={baseLanes:c,cachePool:v},n!==null&&Lu(r,null),$f(),fx(r),n!==null&&bo(n,r,d,!0),r.childLanes=g,null}function Zu(n,r){return r=Ju({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function d_(n,r,c){return wa(r,n.child,null,c),n=Zu(r,r.pendingProps),n.flags|=2,Sn(r),r.memoizedState=null,n}function iT(n,r,c){var d=r.pendingProps,g=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(rt){if(d.mode==="hidden")return n=Zu(r,d),r.lanes=536870912,Fl(null,n);if(Uf(r),(n=Tt)?(n=w1(n,Bn),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Sr!==null?{id:hi,overflow:fi}:null,retryLane:536870912,hydrationErrors:null},c=Wv(n),c.return=r,r.child=c,Es=r,Tt=null)):n=null,n===null)throw kr(r);return r.lanes=536870912,null}return Zu(r,d)}var v=n.memoizedState;if(v!==null){var k=v.dehydrated;if(Uf(r),g)if(r.flags&256)r.flags&=-257,r=d_(n,r,c);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(i(558));else if(ts||bo(n,r,c,!1),g=(c&n.childLanes)!==0,ts||g){if(d=kt,d!==null&&(k=qt(d,c),k!==0&&k!==v.retryLane))throw v.retryLane=k,pa(n,k),un(d,n,k),cm;ld(),r=d_(n,r,c)}else n=v.treeContext,Tt=In(k.nextSibling),Es=r,rt=!0,wr=null,Bn=!1,n!==null&&Zv(r,n),r=Zu(r,d),r.flags|=4096;return r}return n=Vi(n.child,{mode:d.mode,children:d.children}),n.ref=r.ref,r.child=n,n.return=r,n}function Qu(n,r){var c=r.ref;if(c===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(i(284));(n===null||n.ref!==c)&&(r.flags|=4194816)}}function um(n,r,c,d,g){return xa(r),c=Vf(n,r,c,d,void 0,g),d=qf(),n!==null&&!ts?(Gf(n,r,g),Xi(n,r,g)):(rt&&d&&Cf(r),r.flags|=1,Ts(n,r,c,g),r.child)}function h_(n,r,c,d,g,v){return xa(r),r.updateQueue=null,c=px(r,d,c,g),mx(n),d=qf(),n!==null&&!ts?(Gf(n,r,v),Xi(n,r,v)):(rt&&d&&Cf(r),r.flags|=1,Ts(n,r,c,v),r.child)}function f_(n,r,c,d,g){if(xa(r),r.stateNode===null){var v=fo,k=c.contextType;typeof k=="object"&&k!==null&&(v=Ns(k)),v=new c(d,v),r.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=om,r.stateNode=v,v._reactInternals=r,v=r.stateNode,v.props=d,v.state=r.memoizedState,v.refs={},Bf(r),k=c.contextType,v.context=typeof k=="object"&&k!==null?Ns(k):fo,v.state=r.memoizedState,k=c.getDerivedStateFromProps,typeof k=="function"&&(am(r,c,k,d),v.state=r.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(k=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),k!==v.state&&om.enqueueReplaceState(v,v.state,null),Il(r,d,v,g),zl(),v.state=r.memoizedState),typeof v.componentDidMount=="function"&&(r.flags|=4194308),d=!0}else if(n===null){v=r.stateNode;var A=r.memoizedProps,B=Ca(c,A);v.props=B;var ee=v.context,ie=c.contextType;k=fo,typeof ie=="object"&&ie!==null&&(k=Ns(ie));var ce=c.getDerivedStateFromProps;ie=typeof ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",A=r.pendingProps!==A,ie||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(A||ee!==k)&&Jx(r,v,d,k),Er=!1;var te=r.memoizedState;v.state=te,Il(r,d,v,g),zl(),ee=r.memoizedState,A||te!==ee||Er?(typeof ce=="function"&&(am(r,c,ce,d),ee=r.memoizedState),(B=Er||Qx(r,c,B,d,te,ee,k))?(ie||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(r.flags|=4194308)):(typeof v.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=d,r.memoizedState=ee),v.props=d,v.state=ee,v.context=k,d=B):(typeof v.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{v=r.stateNode,zf(n,r),k=r.memoizedProps,ie=Ca(c,k),v.props=ie,ce=r.pendingProps,te=v.context,ee=c.contextType,B=fo,typeof ee=="object"&&ee!==null&&(B=Ns(ee)),A=c.getDerivedStateFromProps,(ee=typeof A=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(k!==ce||te!==B)&&Jx(r,v,d,B),Er=!1,te=r.memoizedState,v.state=te,Il(r,d,v,g),zl();var se=r.memoizedState;k!==ce||te!==se||Er||n!==null&&n.dependencies!==null&&Du(n.dependencies)?(typeof A=="function"&&(am(r,c,A,d),se=r.memoizedState),(ie=Er||Qx(r,c,ie,d,te,se,B)||n!==null&&n.dependencies!==null&&Du(n.dependencies))?(ee||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,se,B),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,se,B)),typeof v.componentDidUpdate=="function"&&(r.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof v.componentDidUpdate!="function"||k===n.memoizedProps&&te===n.memoizedState||(r.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||k===n.memoizedProps&&te===n.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=se),v.props=d,v.state=se,v.context=B,d=ie):(typeof v.componentDidUpdate!="function"||k===n.memoizedProps&&te===n.memoizedState||(r.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||k===n.memoizedProps&&te===n.memoizedState||(r.flags|=1024),d=!1)}return v=d,Qu(n,r),d=(r.flags&128)!==0,v||d?(v=r.stateNode,c=d&&typeof c.getDerivedStateFromError!="function"?null:v.render(),r.flags|=1,n!==null&&d?(r.child=wa(r,n.child,null,g),r.child=wa(r,null,c,g)):Ts(n,r,c,g),r.memoizedState=v.state,n=r.child):n=Xi(n,r,g),n}function m_(n,r,c,d){return ba(),r.flags|=256,Ts(n,r,c,d),r.child}var dm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hm(n){return{baseLanes:n,cachePool:nx()}}function fm(n,r,c){return n=n!==null?n.childLanes&~c:0,r&&(n|=kn),n}function p_(n,r,c){var d=r.pendingProps,g=!1,v=(r.flags&128)!==0,k;if((k=v)||(k=n!==null&&n.memoizedState===null?!1:(Wt.current&2)!==0),k&&(g=!0,r.flags&=-129),k=(r.flags&32)!==0,r.flags&=-33,n===null){if(rt){if(g?Ar(r):Mr(),(n=Tt)?(n=w1(n,Bn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Sr!==null?{id:hi,overflow:fi}:null,retryLane:536870912,hydrationErrors:null},c=Wv(n),c.return=r,r.child=c,Es=r,Tt=null)):n=null,n===null)throw kr(r);return Ym(n)?r.lanes=32:r.lanes=536870912,null}var A=d.children;return d=d.fallback,g?(Mr(),g=r.mode,A=Ju({mode:"hidden",children:A},g),d=ga(d,g,c,null),A.return=r,d.return=r,A.sibling=d,r.child=A,d=r.child,d.memoizedState=hm(c),d.childLanes=fm(n,k,c),r.memoizedState=dm,Fl(null,d)):(Ar(r),mm(r,A))}var B=n.memoizedState;if(B!==null&&(A=B.dehydrated,A!==null)){if(v)r.flags&256?(Ar(r),r.flags&=-257,r=pm(n,r,c)):r.memoizedState!==null?(Mr(),r.child=n.child,r.flags|=128,r=null):(Mr(),A=d.fallback,g=r.mode,d=Ju({mode:"visible",children:d.children},g),A=ga(A,g,c,null),A.flags|=2,d.return=r,A.return=r,d.sibling=A,r.child=d,wa(r,n.child,null,c),d=r.child,d.memoizedState=hm(c),d.childLanes=fm(n,k,c),r.memoizedState=dm,r=Fl(null,d));else if(Ar(r),Ym(A)){if(k=A.nextSibling&&A.nextSibling.dataset,k)var ee=k.dgst;k=ee,d=Error(i(419)),d.stack="",d.digest=k,jl({value:d,source:null,stack:null}),r=pm(n,r,c)}else if(ts||bo(n,r,c,!1),k=(c&n.childLanes)!==0,ts||k){if(k=kt,k!==null&&(d=qt(k,c),d!==0&&d!==B.retryLane))throw B.retryLane=d,pa(n,d),un(k,n,d),cm;Wm(A)||ld(),r=pm(n,r,c)}else Wm(A)?(r.flags|=192,r.child=n.child,r=null):(n=B.treeContext,Tt=In(A.nextSibling),Es=r,rt=!0,wr=null,Bn=!1,n!==null&&Zv(r,n),r=mm(r,d.children),r.flags|=4096);return r}return g?(Mr(),A=d.fallback,g=r.mode,B=n.child,ee=B.sibling,d=Vi(B,{mode:"hidden",children:d.children}),d.subtreeFlags=B.subtreeFlags&65011712,ee!==null?A=Vi(ee,A):(A=ga(A,g,c,null),A.flags|=2),A.return=r,d.return=r,d.sibling=A,r.child=d,Fl(null,d),d=r.child,A=n.child.memoizedState,A===null?A=hm(c):(g=A.cachePool,g!==null?(B=Jt._currentValue,g=g.parent!==B?{parent:B,pool:B}:g):g=nx(),A={baseLanes:A.baseLanes|c,cachePool:g}),d.memoizedState=A,d.childLanes=fm(n,k,c),r.memoizedState=dm,Fl(n.child,d)):(Ar(r),c=n.child,n=c.sibling,c=Vi(c,{mode:"visible",children:d.children}),c.return=r,c.sibling=null,n!==null&&(k=r.deletions,k===null?(r.deletions=[n],r.flags|=16):k.push(n)),r.child=c,r.memoizedState=null,c)}function mm(n,r){return r=Ju({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function Ju(n,r){return n=_n(22,n,null,r),n.lanes=0,n}function pm(n,r,c){return wa(r,n.child,null,c),n=mm(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function g_(n,r,c){n.lanes|=r;var d=n.alternate;d!==null&&(d.lanes|=r),Mf(n.return,r,c)}function gm(n,r,c,d,g,v){var k=n.memoizedState;k===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:g,treeForkCount:v}:(k.isBackwards=r,k.rendering=null,k.renderingStartTime=0,k.last=d,k.tail=c,k.tailMode=g,k.treeForkCount=v)}function b_(n,r,c){var d=r.pendingProps,g=d.revealOrder,v=d.tail;d=d.children;var k=Wt.current,A=(k&2)!==0;if(A?(k=k&1|2,r.flags|=128):k&=1,he(Wt,k),Ts(n,r,d,c),d=rt?Ml:0,!A&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&g_(n,c,r);else if(n.tag===19)g_(n,c,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(g){case"forwards":for(c=r.child,g=null;c!==null;)n=c.alternate,n!==null&&Hu(n)===null&&(g=c),c=c.sibling;c=g,c===null?(g=r.child,r.child=null):(g=c.sibling,c.sibling=null),gm(r,!1,g,c,v,d);break;case"backwards":case"unstable_legacy-backwards":for(c=null,g=r.child,r.child=null;g!==null;){if(n=g.alternate,n!==null&&Hu(n)===null){r.child=g;break}n=g.sibling,g.sibling=c,c=g,g=n}gm(r,!0,c,null,v,d);break;case"together":gm(r,!1,null,null,void 0,d);break;default:r.memoizedState=null}return r.child}function Xi(n,r,c){if(n!==null&&(r.dependencies=n.dependencies),Dr|=r.lanes,(c&r.childLanes)===0)if(n!==null){if(bo(n,r,c,!1),(c&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(i(153));if(r.child!==null){for(n=r.child,c=Vi(n,n.pendingProps),r.child=c,c.return=r;n.sibling!==null;)n=n.sibling,c=c.sibling=Vi(n,n.pendingProps),c.return=r;c.sibling=null}return r.child}function bm(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&Du(n)))}function rT(n,r,c){switch(r.tag){case 3:we(r,r.stateNode.containerInfo),Cr(r,Jt,n.memoizedState.cache),ba();break;case 27:case 5:Ze(r);break;case 4:we(r,r.stateNode.containerInfo);break;case 10:Cr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Uf(r),null;break;case 13:var d=r.memoizedState;if(d!==null)return d.dehydrated!==null?(Ar(r),r.flags|=128,null):(c&r.child.childLanes)!==0?p_(n,r,c):(Ar(r),n=Xi(n,r,c),n!==null?n.sibling:null);Ar(r);break;case 19:var g=(n.flags&128)!==0;if(d=(c&r.childLanes)!==0,d||(bo(n,r,c,!1),d=(c&r.childLanes)!==0),g){if(d)return b_(n,r,c);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),he(Wt,Wt.current),d)break;return null;case 22:return r.lanes=0,c_(n,r,c,r.pendingProps);case 24:Cr(r,Jt,n.memoizedState.cache)}return Xi(n,r,c)}function v_(n,r,c){if(n!==null)if(n.memoizedProps!==r.pendingProps)ts=!0;else{if(!bm(n,c)&&(r.flags&128)===0)return ts=!1,rT(n,r,c);ts=(n.flags&131072)!==0}else ts=!1,rt&&(r.flags&1048576)!==0&&Xv(r,Ml,r.index);switch(r.lanes=0,r.tag){case 16:e:{var d=r.pendingProps;if(n=ya(r.elementType),r.type=n,typeof n=="function")Sf(n)?(d=Ca(n,d),r.tag=1,r=f_(null,r,n,d,c)):(r.tag=0,r=um(null,r,n,d,c));else{if(n!=null){var g=n.$$typeof;if(g===M){r.tag=11,r=a_(null,r,n,d,c);break e}else if(g===L){r.tag=14,r=o_(null,r,n,d,c);break e}}throw r=Q(n)||n,Error(i(306,r,""))}}return r;case 0:return um(n,r,r.type,r.pendingProps,c);case 1:return d=r.type,g=Ca(d,r.pendingProps),f_(n,r,d,g,c);case 3:e:{if(we(r,r.stateNode.containerInfo),n===null)throw Error(i(387));d=r.pendingProps;var v=r.memoizedState;g=v.element,zf(n,r),Il(r,d,null,c);var k=r.memoizedState;if(d=k.cache,Cr(r,Jt,d),d!==v.cache&&jf(r,[Jt],c,!0),zl(),d=k.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:k.cache},r.updateQueue.baseState=v,r.memoizedState=v,r.flags&256){r=m_(n,r,d,c);break e}else if(d!==g){g=Dn(Error(i(424)),r),jl(g),r=m_(n,r,d,c);break e}else for(n=r.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,Tt=In(n.firstChild),Es=r,rt=!0,wr=null,Bn=!0,c=cx(r,null,d,c),r.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(ba(),d===g){r=Xi(n,r,c);break e}Ts(n,r,d,c)}r=r.child}return r;case 26:return Qu(n,r),n===null?(c=A1(r.type,null,r.pendingProps,null))?r.memoizedState=c:rt||(c=r.type,n=r.pendingProps,d=pd(ne.current).createElement(c),d[Gt]=r,d[Is]=n,As(d,c,n),Zt(d),r.stateNode=d):r.memoizedState=A1(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return Ze(r),n===null&&rt&&(d=r.stateNode=E1(r.type,r.pendingProps,ne.current),Es=r,Bn=!0,g=Tt,Ir(r.type)?(Xm=g,Tt=In(d.firstChild)):Tt=g),Ts(n,r,r.pendingProps.children,c),Qu(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&rt&&((g=d=Tt)&&(d=LT(d,r.type,r.pendingProps,Bn),d!==null?(r.stateNode=d,Es=r,Tt=In(d.firstChild),Bn=!1,g=!0):g=!1),g||kr(r)),Ze(r),g=r.type,v=r.pendingProps,k=n!==null?n.memoizedProps:null,d=v.children,qm(g,v)?d=null:k!==null&&qm(g,k)&&(r.flags|=32),r.memoizedState!==null&&(g=Vf(n,r,X5,null,null,c),ic._currentValue=g),Qu(n,r),Ts(n,r,d,c),r.child;case 6:return n===null&&rt&&((n=c=Tt)&&(c=BT(c,r.pendingProps,Bn),c!==null?(r.stateNode=c,Es=r,Tt=null,n=!0):n=!1),n||kr(r)),null;case 13:return p_(n,r,c);case 4:return we(r,r.stateNode.containerInfo),d=r.pendingProps,n===null?r.child=wa(r,null,d,c):Ts(n,r,d,c),r.child;case 11:return a_(n,r,r.type,r.pendingProps,c);case 7:return Ts(n,r,r.pendingProps,c),r.child;case 8:return Ts(n,r,r.pendingProps.children,c),r.child;case 12:return Ts(n,r,r.pendingProps.children,c),r.child;case 10:return d=r.pendingProps,Cr(r,r.type,d.value),Ts(n,r,d.children,c),r.child;case 9:return g=r.type._context,d=r.pendingProps.children,xa(r),g=Ns(g),d=d(g),r.flags|=1,Ts(n,r,d,c),r.child;case 14:return o_(n,r,r.type,r.pendingProps,c);case 15:return l_(n,r,r.type,r.pendingProps,c);case 19:return b_(n,r,c);case 31:return iT(n,r,c);case 22:return c_(n,r,c,r.pendingProps);case 24:return xa(r),d=Ns(Jt),n===null?(g=Of(),g===null&&(g=kt,v=Rf(),g.pooledCache=v,v.refCount++,v!==null&&(g.pooledCacheLanes|=c),g=v),r.memoizedState={parent:d,cache:g},Bf(r),Cr(r,Jt,g)):((n.lanes&c)!==0&&(zf(n,r),Il(r,null,null,c),zl()),g=n.memoizedState,v=r.memoizedState,g.parent!==d?(g={parent:d,cache:d},r.memoizedState=g,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=g),Cr(r,Jt,d)):(d=v.cache,Cr(r,Jt,d),d!==g.cache&&jf(r,[Jt],c,!0))),Ts(n,r,r.pendingProps.children,c),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function Zi(n){n.flags|=4}function vm(n,r,c,d,g){if((r=(n.mode&32)!==0)&&(r=!1),r){if(n.flags|=16777216,(g&335544128)===g)if(n.stateNode.complete)n.flags|=8192;else if(q_())n.flags|=8192;else throw Sa=zu,Lf}else n.flags&=-16777217}function x_(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!O1(r))if(q_())n.flags|=8192;else throw Sa=zu,Lf}function ed(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?He():536870912,n.lanes|=r,Ao|=r)}function Vl(n,r){if(!rt)switch(n.tailMode){case"hidden":r=n.tail;for(var c=null;r!==null;)r.alternate!==null&&(c=r),r=r.sibling;c===null?n.tail=null:c.sibling=null;break;case"collapsed":c=n.tail;for(var d=null;c!==null;)c.alternate!==null&&(d=c),c=c.sibling;d===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function At(n){var r=n.alternate!==null&&n.alternate.child===n.child,c=0,d=0;if(r)for(var g=n.child;g!==null;)c|=g.lanes|g.childLanes,d|=g.subtreeFlags&65011712,d|=g.flags&65011712,g.return=n,g=g.sibling;else for(g=n.child;g!==null;)c|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=n,g=g.sibling;return n.subtreeFlags|=d,n.childLanes=c,r}function aT(n,r,c){var d=r.pendingProps;switch(Ef(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return At(r),null;case 1:return At(r),null;case 3:return c=r.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),r.memoizedState.cache!==d&&(r.flags|=2048),Ki(Jt),ye(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(n===null||n.child===null)&&(go(r)?Zi(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Tf())),At(r),null;case 26:var g=r.type,v=r.memoizedState;return n===null?(Zi(r),v!==null?(At(r),x_(r,v)):(At(r),vm(r,g,null,d,c))):v?v!==n.memoizedState?(Zi(r),At(r),x_(r,v)):(At(r),r.flags&=-16777217):(n=n.memoizedProps,n!==d&&Zi(r),At(r),vm(r,g,n,d,c)),null;case 27:if(lt(r),c=ne.current,g=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==d&&Zi(r);else{if(!d){if(r.stateNode===null)throw Error(i(166));return At(r),null}n=le.current,go(r)?Qv(r):(n=E1(g,d,c),r.stateNode=n,Zi(r))}return At(r),null;case 5:if(lt(r),g=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==d&&Zi(r);else{if(!d){if(r.stateNode===null)throw Error(i(166));return At(r),null}if(v=le.current,go(r))Qv(r);else{var k=pd(ne.current);switch(v){case 1:v=k.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:v=k.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":v=k.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":v=k.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":v=k.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?k.createElement("select",{is:d.is}):k.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?k.createElement(g,{is:d.is}):k.createElement(g)}}v[Gt]=r,v[Is]=d;e:for(k=r.child;k!==null;){if(k.tag===5||k.tag===6)v.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===r)break e;for(;k.sibling===null;){if(k.return===null||k.return===r)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}r.stateNode=v;e:switch(As(v,g,d),g){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Zi(r)}}return At(r),vm(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,c),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==d&&Zi(r);else{if(typeof d!="string"&&r.stateNode===null)throw Error(i(166));if(n=ne.current,go(r)){if(n=r.stateNode,c=r.memoizedProps,d=null,g=Es,g!==null)switch(g.tag){case 27:case 5:d=g.memoizedProps}n[Gt]=r,n=!!(n.nodeValue===c||d!==null&&d.suppressHydrationWarning===!0||p1(n.nodeValue,c)),n||kr(r,!0)}else n=pd(n).createTextNode(d),n[Gt]=r,r.stateNode=n}return At(r),null;case 31:if(c=r.memoizedState,n===null||n.memoizedState!==null){if(d=go(r),c!==null){if(n===null){if(!d)throw Error(i(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[Gt]=r}else ba(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;At(r),n=!1}else c=Tf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=c),n=!0;if(!n)return r.flags&256?(Sn(r),r):(Sn(r),null);if((r.flags&128)!==0)throw Error(i(558))}return At(r),null;case 13:if(d=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(g=go(r),d!==null&&d.dehydrated!==null){if(n===null){if(!g)throw Error(i(318));if(g=r.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[Gt]=r}else ba(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;At(r),g=!1}else g=Tf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=g),g=!0;if(!g)return r.flags&256?(Sn(r),r):(Sn(r),null)}return Sn(r),(r.flags&128)!==0?(r.lanes=c,r):(c=d!==null,n=n!==null&&n.memoizedState!==null,c&&(d=r.child,g=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(g=d.alternate.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==g&&(d.flags|=2048)),c!==n&&c&&(r.child.flags|=8192),ed(r,r.updateQueue),At(r),null);case 4:return ye(),n===null&&$m(r.stateNode.containerInfo),At(r),null;case 10:return Ki(r.type),At(r),null;case 19:if(W(Wt),d=r.memoizedState,d===null)return At(r),null;if(g=(r.flags&128)!==0,v=d.rendering,v===null)if(g)Vl(d,!1);else{if(Ht!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(v=Hu(n),v!==null){for(r.flags|=128,Vl(d,!1),n=v.updateQueue,r.updateQueue=n,ed(r,n),r.subtreeFlags=0,n=c,c=r.child;c!==null;)Kv(c,n),c=c.sibling;return he(Wt,Wt.current&1|2),rt&&qi(r,d.treeForkCount),r.child}n=n.sibling}d.tail!==null&&Bt()>rd&&(r.flags|=128,g=!0,Vl(d,!1),r.lanes=4194304)}else{if(!g)if(n=Hu(v),n!==null){if(r.flags|=128,g=!0,n=n.updateQueue,r.updateQueue=n,ed(r,n),Vl(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!rt)return At(r),null}else 2*Bt()-d.renderingStartTime>rd&&c!==536870912&&(r.flags|=128,g=!0,Vl(d,!1),r.lanes=4194304);d.isBackwards?(v.sibling=r.child,r.child=v):(n=d.last,n!==null?n.sibling=v:r.child=v,d.last=v)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=Bt(),n.sibling=null,c=Wt.current,he(Wt,g?c&1|2:c&1),rt&&qi(r,d.treeForkCount),n):(At(r),null);case 22:case 23:return Sn(r),Hf(),d=r.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(r.flags|=8192):d&&(r.flags|=8192),d?(c&536870912)!==0&&(r.flags&128)===0&&(At(r),r.subtreeFlags&6&&(r.flags|=8192)):At(r),c=r.updateQueue,c!==null&&ed(r,c.retryQueue),c=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==c&&(r.flags|=2048),n!==null&&W(_a),null;case 24:return c=null,n!==null&&(c=n.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),Ki(Jt),At(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function oT(n,r){switch(Ef(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return Ki(Jt),ye(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return lt(r),null;case 31:if(r.memoizedState!==null){if(Sn(r),r.alternate===null)throw Error(i(340));ba()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(Sn(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(i(340));ba()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return W(Wt),null;case 4:return ye(),null;case 10:return Ki(r.type),null;case 22:case 23:return Sn(r),Hf(),n!==null&&W(_a),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return Ki(Jt),null;case 25:return null;default:return null}}function __(n,r){switch(Ef(r),r.tag){case 3:Ki(Jt),ye();break;case 26:case 27:case 5:lt(r);break;case 4:ye();break;case 31:r.memoizedState!==null&&Sn(r);break;case 13:Sn(r);break;case 19:W(Wt);break;case 10:Ki(r.type);break;case 22:case 23:Sn(r),Hf(),n!==null&&W(_a);break;case 24:Ki(Jt)}}function ql(n,r){try{var c=r.updateQueue,d=c!==null?c.lastEffect:null;if(d!==null){var g=d.next;c=g;do{if((c.tag&n)===n){d=void 0;var v=c.create,k=c.inst;d=v(),k.destroy=d}c=c.next}while(c!==g)}}catch(A){vt(r,r.return,A)}}function jr(n,r,c){try{var d=r.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var v=g.next;d=v;do{if((d.tag&n)===n){var k=d.inst,A=k.destroy;if(A!==void 0){k.destroy=void 0,g=r;var B=c,ee=A;try{ee()}catch(ie){vt(g,B,ie)}}}d=d.next}while(d!==v)}}catch(ie){vt(r,r.return,ie)}}function y_(n){var r=n.updateQueue;if(r!==null){var c=n.stateNode;try{dx(r,c)}catch(d){vt(n,n.return,d)}}}function S_(n,r,c){c.props=Ca(n.type,n.memoizedProps),c.state=n.memoizedState;try{c.componentWillUnmount()}catch(d){vt(n,r,d)}}function Gl(n,r){try{var c=n.ref;if(c!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof c=="function"?n.refCleanup=c(d):c.current=d}}catch(g){vt(n,r,g)}}function mi(n,r){var c=n.ref,d=n.refCleanup;if(c!==null)if(typeof d=="function")try{d()}catch(g){vt(n,r,g)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(g){vt(n,r,g)}else c.current=null}function w_(n){var r=n.type,c=n.memoizedProps,d=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":c.autoFocus&&d.focus();break e;case"img":c.src?d.src=c.src:c.srcSet&&(d.srcset=c.srcSet)}}catch(g){vt(n,n.return,g)}}function xm(n,r,c){try{var d=n.stateNode;AT(d,n.type,c,r),d[Is]=r}catch(g){vt(n,n.return,g)}}function k_(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Ir(n.type)||n.tag===4}function _m(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||k_(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Ir(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function ym(n,r,c){var d=n.tag;if(d===5||d===6)n=n.stateNode,r?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(n,r):(r=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,r.appendChild(n),c=c._reactRootContainer,c!=null||r.onclick!==null||(r.onclick=ve));else if(d!==4&&(d===27&&Ir(n.type)&&(c=n.stateNode,r=null),n=n.child,n!==null))for(ym(n,r,c),n=n.sibling;n!==null;)ym(n,r,c),n=n.sibling}function td(n,r,c){var d=n.tag;if(d===5||d===6)n=n.stateNode,r?c.insertBefore(n,r):c.appendChild(n);else if(d!==4&&(d===27&&Ir(n.type)&&(c=n.stateNode),n=n.child,n!==null))for(td(n,r,c),n=n.sibling;n!==null;)td(n,r,c),n=n.sibling}function C_(n){var r=n.stateNode,c=n.memoizedProps;try{for(var d=n.type,g=r.attributes;g.length;)r.removeAttributeNode(g[0]);As(r,d,c),r[Gt]=n,r[Is]=c}catch(v){vt(n,n.return,v)}}var Qi=!1,ss=!1,Sm=!1,E_=typeof WeakSet=="function"?WeakSet:Set,bs=null;function lT(n,r){if(n=n.containerInfo,Fm=Sd,n=Iv(n),pf(n)){if("selectionStart"in n)var c={start:n.selectionStart,end:n.selectionEnd};else e:{c=(c=n.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&d.rangeCount!==0){c=d.anchorNode;var g=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{c.nodeType,v.nodeType}catch{c=null;break e}var k=0,A=-1,B=-1,ee=0,ie=0,ce=n,te=null;t:for(;;){for(var se;ce!==c||g!==0&&ce.nodeType!==3||(A=k+g),ce!==v||d!==0&&ce.nodeType!==3||(B=k+d),ce.nodeType===3&&(k+=ce.nodeValue.length),(se=ce.firstChild)!==null;)te=ce,ce=se;for(;;){if(ce===n)break t;if(te===c&&++ee===g&&(A=k),te===v&&++ie===d&&(B=k),(se=ce.nextSibling)!==null)break;ce=te,te=ce.parentNode}ce=se}c=A===-1||B===-1?null:{start:A,end:B}}else c=null}c=c||{start:0,end:0}}else c=null;for(Vm={focusedElem:n,selectionRange:c},Sd=!1,bs=r;bs!==null;)if(r=bs,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,bs=n;else for(;bs!==null;){switch(r=bs,v=r.alternate,n=r.flags,r.tag){case 0:if((n&4)!==0&&(n=r.updateQueue,n=n!==null?n.events:null,n!==null))for(c=0;c<n.length;c++)g=n[c],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&v!==null){n=void 0,c=r,g=v.memoizedProps,v=v.memoizedState,d=c.stateNode;try{var Ne=Ca(c.type,g);n=d.getSnapshotBeforeUpdate(Ne,v),d.__reactInternalSnapshotBeforeUpdate=n}catch(Be){vt(c,c.return,Be)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,c=n.nodeType,c===9)Km(n);else if(c===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Km(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(i(163))}if(n=r.sibling,n!==null){n.return=r.return,bs=n;break}bs=r.return}}function N_(n,r,c){var d=c.flags;switch(c.tag){case 0:case 11:case 15:er(n,c),d&4&&ql(5,c);break;case 1:if(er(n,c),d&4)if(n=c.stateNode,r===null)try{n.componentDidMount()}catch(k){vt(c,c.return,k)}else{var g=Ca(c.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(g,r,n.__reactInternalSnapshotBeforeUpdate)}catch(k){vt(c,c.return,k)}}d&64&&y_(c),d&512&&Gl(c,c.return);break;case 3:if(er(n,c),d&64&&(n=c.updateQueue,n!==null)){if(r=null,c.child!==null)switch(c.child.tag){case 27:case 5:r=c.child.stateNode;break;case 1:r=c.child.stateNode}try{dx(n,r)}catch(k){vt(c,c.return,k)}}break;case 27:r===null&&d&4&&C_(c);case 26:case 5:er(n,c),r===null&&d&4&&w_(c),d&512&&Gl(c,c.return);break;case 12:er(n,c);break;case 31:er(n,c),d&4&&M_(n,c);break;case 13:er(n,c),d&4&&j_(n,c),d&64&&(n=c.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(c=bT.bind(null,c),zT(n,c))));break;case 22:if(d=c.memoizedState!==null||Qi,!d){r=r!==null&&r.memoizedState!==null||ss,g=Qi;var v=ss;Qi=d,(ss=r)&&!v?tr(n,c,(c.subtreeFlags&8772)!==0):er(n,c),Qi=g,ss=v}break;case 30:break;default:er(n,c)}}function T_(n){var r=n.alternate;r!==null&&(n.alternate=null,T_(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&gl(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Dt=null,an=!1;function Ji(n,r,c){for(c=c.child;c!==null;)A_(n,r,c),c=c.sibling}function A_(n,r,c){if(gs&&typeof gs.onCommitFiberUnmount=="function")try{gs.onCommitFiberUnmount(Ii,c)}catch{}switch(c.tag){case 26:ss||mi(c,r),Ji(n,r,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:ss||mi(c,r);var d=Dt,g=an;Ir(c.type)&&(Dt=c.stateNode,an=!1),Ji(n,r,c),tc(c.stateNode),Dt=d,an=g;break;case 5:ss||mi(c,r);case 6:if(d=Dt,g=an,Dt=null,Ji(n,r,c),Dt=d,an=g,Dt!==null)if(an)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(c.stateNode)}catch(v){vt(c,r,v)}else try{Dt.removeChild(c.stateNode)}catch(v){vt(c,r,v)}break;case 18:Dt!==null&&(an?(n=Dt,y1(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,c.stateNode),zo(n)):y1(Dt,c.stateNode));break;case 4:d=Dt,g=an,Dt=c.stateNode.containerInfo,an=!0,Ji(n,r,c),Dt=d,an=g;break;case 0:case 11:case 14:case 15:jr(2,c,r),ss||jr(4,c,r),Ji(n,r,c);break;case 1:ss||(mi(c,r),d=c.stateNode,typeof d.componentWillUnmount=="function"&&S_(c,r,d)),Ji(n,r,c);break;case 21:Ji(n,r,c);break;case 22:ss=(d=ss)||c.memoizedState!==null,Ji(n,r,c),ss=d;break;default:Ji(n,r,c)}}function M_(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{zo(n)}catch(c){vt(r,r.return,c)}}}function j_(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{zo(n)}catch(c){vt(r,r.return,c)}}function cT(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new E_),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new E_),r;default:throw Error(i(435,n.tag))}}function sd(n,r){var c=cT(n);r.forEach(function(d){if(!c.has(d)){c.add(d);var g=vT.bind(null,n,d);d.then(g,g)}})}function on(n,r){var c=r.deletions;if(c!==null)for(var d=0;d<c.length;d++){var g=c[d],v=n,k=r,A=k;e:for(;A!==null;){switch(A.tag){case 27:if(Ir(A.type)){Dt=A.stateNode,an=!1;break e}break;case 5:Dt=A.stateNode,an=!1;break e;case 3:case 4:Dt=A.stateNode.containerInfo,an=!0;break e}A=A.return}if(Dt===null)throw Error(i(160));A_(v,k,g),Dt=null,an=!1,v=g.alternate,v!==null&&(v.return=null),g.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)R_(r,n),r=r.sibling}var si=null;function R_(n,r){var c=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:on(r,n),ln(n),d&4&&(jr(3,n,n.return),ql(3,n),jr(5,n,n.return));break;case 1:on(r,n),ln(n),d&512&&(ss||c===null||mi(c,c.return)),d&64&&Qi&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(c=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=c===null?d:c.concat(d))));break;case 26:var g=si;if(on(r,n),ln(n),d&512&&(ss||c===null||mi(c,c.return)),d&4){var v=c!==null?c.memoizedState:null;if(d=n.memoizedState,c===null)if(d===null)if(n.stateNode===null){e:{d=n.type,c=n.memoizedProps,g=g.ownerDocument||g;t:switch(d){case"title":v=g.getElementsByTagName("title")[0],(!v||v[ca]||v[Gt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=g.createElement(d),g.head.insertBefore(v,g.querySelector("head > title"))),As(v,d,c),v[Gt]=n,Zt(v),d=v;break e;case"link":var k=R1("link","href",g).get(d+(c.href||""));if(k){for(var A=0;A<k.length;A++)if(v=k[A],v.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&v.getAttribute("rel")===(c.rel==null?null:c.rel)&&v.getAttribute("title")===(c.title==null?null:c.title)&&v.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){k.splice(A,1);break t}}v=g.createElement(d),As(v,d,c),g.head.appendChild(v);break;case"meta":if(k=R1("meta","content",g).get(d+(c.content||""))){for(A=0;A<k.length;A++)if(v=k[A],v.getAttribute("content")===(c.content==null?null:""+c.content)&&v.getAttribute("name")===(c.name==null?null:c.name)&&v.getAttribute("property")===(c.property==null?null:c.property)&&v.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&v.getAttribute("charset")===(c.charSet==null?null:c.charSet)){k.splice(A,1);break t}}v=g.createElement(d),As(v,d,c),g.head.appendChild(v);break;default:throw Error(i(468,d))}v[Gt]=n,Zt(v),d=v}n.stateNode=d}else D1(g,n.type,n.stateNode);else n.stateNode=j1(g,d,n.memoizedProps);else v!==d?(v===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):v.count--,d===null?D1(g,n.type,n.stateNode):j1(g,d,n.memoizedProps)):d===null&&n.stateNode!==null&&xm(n,n.memoizedProps,c.memoizedProps)}break;case 27:on(r,n),ln(n),d&512&&(ss||c===null||mi(c,c.return)),c!==null&&d&4&&xm(n,n.memoizedProps,c.memoizedProps);break;case 5:if(on(r,n),ln(n),d&512&&(ss||c===null||mi(c,c.return)),n.flags&32){g=n.stateNode;try{Ie(g,"")}catch(Ne){vt(n,n.return,Ne)}}d&4&&n.stateNode!=null&&(g=n.memoizedProps,xm(n,g,c!==null?c.memoizedProps:g)),d&1024&&(Sm=!0);break;case 6:if(on(r,n),ln(n),d&4){if(n.stateNode===null)throw Error(i(162));d=n.memoizedProps,c=n.stateNode;try{c.nodeValue=d}catch(Ne){vt(n,n.return,Ne)}}break;case 3:if(vd=null,g=si,si=gd(r.containerInfo),on(r,n),si=g,ln(n),d&4&&c!==null&&c.memoizedState.isDehydrated)try{zo(r.containerInfo)}catch(Ne){vt(n,n.return,Ne)}Sm&&(Sm=!1,D_(n));break;case 4:d=si,si=gd(n.stateNode.containerInfo),on(r,n),ln(n),si=d;break;case 12:on(r,n),ln(n);break;case 31:on(r,n),ln(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,sd(n,d)));break;case 13:on(r,n),ln(n),n.child.flags&8192&&n.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(id=Bt()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,sd(n,d)));break;case 22:g=n.memoizedState!==null;var B=c!==null&&c.memoizedState!==null,ee=Qi,ie=ss;if(Qi=ee||g,ss=ie||B,on(r,n),ss=ie,Qi=ee,ln(n),d&8192)e:for(r=n.stateNode,r._visibility=g?r._visibility&-2:r._visibility|1,g&&(c===null||B||Qi||ss||Ea(n)),c=null,r=n;;){if(r.tag===5||r.tag===26){if(c===null){B=c=r;try{if(v=B.stateNode,g)k=v.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{A=B.stateNode;var ce=B.memoizedProps.style,te=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;A.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(Ne){vt(B,B.return,Ne)}}}else if(r.tag===6){if(c===null){B=r;try{B.stateNode.nodeValue=g?"":B.memoizedProps}catch(Ne){vt(B,B.return,Ne)}}}else if(r.tag===18){if(c===null){B=r;try{var se=B.stateNode;g?S1(se,!0):S1(B.stateNode,!1)}catch(Ne){vt(B,B.return,Ne)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===n)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;c===r&&(c=null),r=r.return}c===r&&(c=null),r.sibling.return=r.return,r=r.sibling}d&4&&(d=n.updateQueue,d!==null&&(c=d.retryQueue,c!==null&&(d.retryQueue=null,sd(n,c))));break;case 19:on(r,n),ln(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,sd(n,d)));break;case 30:break;case 21:break;default:on(r,n),ln(n)}}function ln(n){var r=n.flags;if(r&2){try{for(var c,d=n.return;d!==null;){if(k_(d)){c=d;break}d=d.return}if(c==null)throw Error(i(160));switch(c.tag){case 27:var g=c.stateNode,v=_m(n);td(n,v,g);break;case 5:var k=c.stateNode;c.flags&32&&(Ie(k,""),c.flags&=-33);var A=_m(n);td(n,A,k);break;case 3:case 4:var B=c.stateNode.containerInfo,ee=_m(n);ym(n,ee,B);break;default:throw Error(i(161))}}catch(ie){vt(n,n.return,ie)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function D_(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;D_(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function er(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)N_(n,r.alternate,r),r=r.sibling}function Ea(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:jr(4,r,r.return),Ea(r);break;case 1:mi(r,r.return);var c=r.stateNode;typeof c.componentWillUnmount=="function"&&S_(r,r.return,c),Ea(r);break;case 27:tc(r.stateNode);case 26:case 5:mi(r,r.return),Ea(r);break;case 22:r.memoizedState===null&&Ea(r);break;case 30:Ea(r);break;default:Ea(r)}n=n.sibling}}function tr(n,r,c){for(c=c&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var d=r.alternate,g=n,v=r,k=v.flags;switch(v.tag){case 0:case 11:case 15:tr(g,v,c),ql(4,v);break;case 1:if(tr(g,v,c),d=v,g=d.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(ee){vt(d,d.return,ee)}if(d=v,g=d.updateQueue,g!==null){var A=d.stateNode;try{var B=g.shared.hiddenCallbacks;if(B!==null)for(g.shared.hiddenCallbacks=null,g=0;g<B.length;g++)ux(B[g],A)}catch(ee){vt(d,d.return,ee)}}c&&k&64&&y_(v),Gl(v,v.return);break;case 27:C_(v);case 26:case 5:tr(g,v,c),c&&d===null&&k&4&&w_(v),Gl(v,v.return);break;case 12:tr(g,v,c);break;case 31:tr(g,v,c),c&&k&4&&M_(g,v);break;case 13:tr(g,v,c),c&&k&4&&j_(g,v);break;case 22:v.memoizedState===null&&tr(g,v,c),Gl(v,v.return);break;case 30:break;default:tr(g,v,c)}r=r.sibling}}function wm(n,r){var c=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==c&&(n!=null&&n.refCount++,c!=null&&Rl(c))}function km(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Rl(n))}function ni(n,r,c,d){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)O_(n,r,c,d),r=r.sibling}function O_(n,r,c,d){var g=r.flags;switch(r.tag){case 0:case 11:case 15:ni(n,r,c,d),g&2048&&ql(9,r);break;case 1:ni(n,r,c,d);break;case 3:ni(n,r,c,d),g&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Rl(n)));break;case 12:if(g&2048){ni(n,r,c,d),n=r.stateNode;try{var v=r.memoizedProps,k=v.id,A=v.onPostCommit;typeof A=="function"&&A(k,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(B){vt(r,r.return,B)}}else ni(n,r,c,d);break;case 31:ni(n,r,c,d);break;case 13:ni(n,r,c,d);break;case 23:break;case 22:v=r.stateNode,k=r.alternate,r.memoizedState!==null?v._visibility&2?ni(n,r,c,d):Kl(n,r):v._visibility&2?ni(n,r,c,d):(v._visibility|=2,Eo(n,r,c,d,(r.subtreeFlags&10256)!==0||!1)),g&2048&&wm(k,r);break;case 24:ni(n,r,c,d),g&2048&&km(r.alternate,r);break;default:ni(n,r,c,d)}}function Eo(n,r,c,d,g){for(g=g&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var v=n,k=r,A=c,B=d,ee=k.flags;switch(k.tag){case 0:case 11:case 15:Eo(v,k,A,B,g),ql(8,k);break;case 23:break;case 22:var ie=k.stateNode;k.memoizedState!==null?ie._visibility&2?Eo(v,k,A,B,g):Kl(v,k):(ie._visibility|=2,Eo(v,k,A,B,g)),g&&ee&2048&&wm(k.alternate,k);break;case 24:Eo(v,k,A,B,g),g&&ee&2048&&km(k.alternate,k);break;default:Eo(v,k,A,B,g)}r=r.sibling}}function Kl(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var c=n,d=r,g=d.flags;switch(d.tag){case 22:Kl(c,d),g&2048&&wm(d.alternate,d);break;case 24:Kl(c,d),g&2048&&km(d.alternate,d);break;default:Kl(c,d)}r=r.sibling}}var Wl=8192;function No(n,r,c){if(n.subtreeFlags&Wl)for(n=n.child;n!==null;)L_(n,r,c),n=n.sibling}function L_(n,r,c){switch(n.tag){case 26:No(n,r,c),n.flags&Wl&&n.memoizedState!==null&&YT(c,si,n.memoizedState,n.memoizedProps);break;case 5:No(n,r,c);break;case 3:case 4:var d=si;si=gd(n.stateNode.containerInfo),No(n,r,c),si=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=Wl,Wl=16777216,No(n,r,c),Wl=d):No(n,r,c));break;default:No(n,r,c)}}function B_(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function Yl(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var c=0;c<r.length;c++){var d=r[c];bs=d,I_(d,n)}B_(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)z_(n),n=n.sibling}function z_(n){switch(n.tag){case 0:case 11:case 15:Yl(n),n.flags&2048&&jr(9,n,n.return);break;case 3:Yl(n);break;case 12:Yl(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,nd(n)):Yl(n);break;default:Yl(n)}}function nd(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var c=0;c<r.length;c++){var d=r[c];bs=d,I_(d,n)}B_(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:jr(8,r,r.return),nd(r);break;case 22:c=r.stateNode,c._visibility&2&&(c._visibility&=-3,nd(r));break;default:nd(r)}n=n.sibling}}function I_(n,r){for(;bs!==null;){var c=bs;switch(c.tag){case 0:case 11:case 15:jr(8,c,r);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var d=c.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Rl(c.memoizedState.cache)}if(d=c.child,d!==null)d.return=c,bs=d;else e:for(c=n;bs!==null;){d=bs;var g=d.sibling,v=d.return;if(T_(d),d===c){bs=null;break e}if(g!==null){g.return=v,bs=g;break e}bs=v}}}var uT={getCacheForType:function(n){var r=Ns(Jt),c=r.data.get(n);return c===void 0&&(c=n(),r.data.set(n,c)),c},cacheSignal:function(){return Ns(Jt).controller.signal}},dT=typeof WeakMap=="function"?WeakMap:Map,ht=0,kt=null,Qe=null,st=0,bt=0,wn=null,Rr=!1,To=!1,Cm=!1,sr=0,Ht=0,Dr=0,Na=0,Em=0,kn=0,Ao=0,Xl=null,cn=null,Nm=!1,id=0,P_=0,rd=1/0,ad=null,Or=null,cs=0,Lr=null,Mo=null,nr=0,Tm=0,Am=null,$_=null,Zl=0,Mm=null;function Cn(){return(ht&2)!==0&&st!==0?st&-st:O.T!==null?Bm():to()}function H_(){if(kn===0)if((st&536870912)===0||rt){var n=ei;ei<<=1,(ei&3932160)===0&&(ei=262144),kn=n}else kn=536870912;return n=yn.current,n!==null&&(n.flags|=32),kn}function un(n,r,c){(n===kt&&(bt===2||bt===9)||n.cancelPendingCommit!==null)&&(jo(n,0),Br(n,st,kn,!1)),wt(n,c),((ht&2)===0||n!==kt)&&(n===kt&&((ht&2)===0&&(Na|=c),Ht===4&&Br(n,st,kn,!1)),pi(n))}function U_(n,r,c){if((ht&6)!==0)throw Error(i(327));var d=!c&&(r&127)===0&&(r&n.expiredLanes)===0||ae(n,r),g=d?mT(n,r):Rm(n,r,!0),v=d;do{if(g===0){To&&!d&&Br(n,r,0,!1);break}else{if(c=n.current.alternate,v&&!hT(c)){g=Rm(n,r,!1),v=!1;continue}if(g===2){if(v=r,n.errorRecoveryDisabledLanes&v)var k=0;else k=n.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){r=k;e:{var A=n;g=Xl;var B=A.current.memoizedState.isDehydrated;if(B&&(jo(A,k).flags|=256),k=Rm(A,k,!1),k!==2){if(Cm&&!B){A.errorRecoveryDisabledLanes|=v,Na|=v,g=4;break e}v=cn,cn=g,v!==null&&(cn===null?cn=v:cn.push.apply(cn,v))}g=k}if(v=!1,g!==2)continue}}if(g===1){jo(n,0),Br(n,r,0,!0);break}e:{switch(d=n,v=g,v){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r)break;case 6:Br(d,r,kn,!Rr);break e;case 2:cn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(g=id+300-Bt(),10<g)){if(Br(d,r,kn,!Rr),I(d,0,!0)!==0)break e;nr=r,d.timeoutHandle=x1(F_.bind(null,d,c,cn,ad,Nm,r,kn,Na,Ao,Rr,v,"Throttled",-0,0),g);break e}F_(d,c,cn,ad,Nm,r,kn,Na,Ao,Rr,v,null,-0,0)}}break}while(!0);pi(n)}function F_(n,r,c,d,g,v,k,A,B,ee,ie,ce,te,se){if(n.timeoutHandle=-1,ce=r.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ve},L_(r,v,ce);var Ne=(v&62914560)===v?id-Bt():(v&4194048)===v?P_-Bt():0;if(Ne=XT(ce,Ne),Ne!==null){nr=v,n.cancelPendingCommit=Ne(Z_.bind(null,n,r,v,c,d,g,k,A,B,ie,ce,null,te,se)),Br(n,v,k,!ee);return}}Z_(n,r,v,c,d,g,k,A,B)}function hT(n){for(var r=n;;){var c=r.tag;if((c===0||c===11||c===15)&&r.flags&16384&&(c=r.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var d=0;d<c.length;d++){var g=c[d],v=g.getSnapshot;g=g.value;try{if(!xn(v(),g))return!1}catch{return!1}}if(c=r.child,r.subtreeFlags&16384&&c!==null)c.return=r,r=c;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Br(n,r,c,d){r&=~Em,r&=~Na,n.suspendedLanes|=r,n.pingedLanes&=~r,d&&(n.warmLanes|=r),d=n.expirationTimes;for(var g=r;0<g;){var v=31-ks(g),k=1<<v;d[v]=-1,g&=~k}c!==0&&ke(n,c,r)}function od(){return(ht&6)===0?(Ql(0),!1):!0}function jm(){if(Qe!==null){if(bt===0)var n=Qe.return;else n=Qe,Gi=va=null,Kf(n),yo=null,Ol=0,n=Qe;for(;n!==null;)__(n.alternate,n),n=n.return;Qe=null}}function jo(n,r){var c=n.timeoutHandle;c!==-1&&(n.timeoutHandle=-1,RT(c)),c=n.cancelPendingCommit,c!==null&&(n.cancelPendingCommit=null,c()),nr=0,jm(),kt=n,Qe=c=Vi(n.current,null),st=r,bt=0,wn=null,Rr=!1,To=ae(n,r),Cm=!1,Ao=kn=Em=Na=Dr=Ht=0,cn=Xl=null,Nm=!1,(r&8)!==0&&(r|=r&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=r;0<d;){var g=31-ks(d),v=1<<g;r|=n[g],d&=~v}return sr=r,Tu(),c}function V_(n,r){qe=null,O.H=Ul,r===_o||r===Bu?(r=ax(),bt=3):r===Lf?(r=ax(),bt=4):bt=r===cm?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,wn=r,Qe===null&&(Ht=1,Xu(n,Dn(r,n.current)))}function q_(){var n=yn.current;return n===null?!0:(st&4194048)===st?zn===null:(st&62914560)===st||(st&536870912)!==0?n===zn:!1}function G_(){var n=O.H;return O.H=Ul,n===null?Ul:n}function K_(){var n=O.A;return O.A=uT,n}function ld(){Ht=4,Rr||(st&4194048)!==st&&yn.current!==null||(To=!0),(Dr&134217727)===0&&(Na&134217727)===0||kt===null||Br(kt,st,kn,!1)}function Rm(n,r,c){var d=ht;ht|=2;var g=G_(),v=K_();(kt!==n||st!==r)&&(ad=null,jo(n,r)),r=!1;var k=Ht;e:do try{if(bt!==0&&Qe!==null){var A=Qe,B=wn;switch(bt){case 8:jm(),k=6;break e;case 3:case 2:case 9:case 6:yn.current===null&&(r=!0);var ee=bt;if(bt=0,wn=null,Ro(n,A,B,ee),c&&To){k=0;break e}break;default:ee=bt,bt=0,wn=null,Ro(n,A,B,ee)}}fT(),k=Ht;break}catch(ie){V_(n,ie)}while(!0);return r&&n.shellSuspendCounter++,Gi=va=null,ht=d,O.H=g,O.A=v,Qe===null&&(kt=null,st=0,Tu()),k}function fT(){for(;Qe!==null;)W_(Qe)}function mT(n,r){var c=ht;ht|=2;var d=G_(),g=K_();kt!==n||st!==r?(ad=null,rd=Bt()+500,jo(n,r)):To=ae(n,r);e:do try{if(bt!==0&&Qe!==null){r=Qe;var v=wn;t:switch(bt){case 1:bt=0,wn=null,Ro(n,r,v,1);break;case 2:case 9:if(ix(v)){bt=0,wn=null,Y_(r);break}r=function(){bt!==2&&bt!==9||kt!==n||(bt=7),pi(n)},v.then(r,r);break e;case 3:bt=7;break e;case 4:bt=5;break e;case 7:ix(v)?(bt=0,wn=null,Y_(r)):(bt=0,wn=null,Ro(n,r,v,7));break;case 5:var k=null;switch(Qe.tag){case 26:k=Qe.memoizedState;case 5:case 27:var A=Qe;if(k?O1(k):A.stateNode.complete){bt=0,wn=null;var B=A.sibling;if(B!==null)Qe=B;else{var ee=A.return;ee!==null?(Qe=ee,cd(ee)):Qe=null}break t}}bt=0,wn=null,Ro(n,r,v,5);break;case 6:bt=0,wn=null,Ro(n,r,v,6);break;case 8:jm(),Ht=6;break e;default:throw Error(i(462))}}pT();break}catch(ie){V_(n,ie)}while(!0);return Gi=va=null,O.H=d,O.A=g,ht=c,Qe!==null?0:(kt=null,st=0,Tu(),Ht)}function pT(){for(;Qe!==null&&!oa();)W_(Qe)}function W_(n){var r=v_(n.alternate,n,sr);n.memoizedProps=n.pendingProps,r===null?cd(n):Qe=r}function Y_(n){var r=n,c=r.alternate;switch(r.tag){case 15:case 0:r=h_(c,r,r.pendingProps,r.type,void 0,st);break;case 11:r=h_(c,r,r.pendingProps,r.type.render,r.ref,st);break;case 5:Kf(r);default:__(c,r),r=Qe=Kv(r,sr),r=v_(c,r,sr)}n.memoizedProps=n.pendingProps,r===null?cd(n):Qe=r}function Ro(n,r,c,d){Gi=va=null,Kf(r),yo=null,Ol=0;var g=r.return;try{if(nT(n,g,r,c,st)){Ht=1,Xu(n,Dn(c,n.current)),Qe=null;return}}catch(v){if(g!==null)throw Qe=g,v;Ht=1,Xu(n,Dn(c,n.current)),Qe=null;return}r.flags&32768?(rt||d===1?n=!0:To||(st&536870912)!==0?n=!1:(Rr=n=!0,(d===2||d===9||d===3||d===6)&&(d=yn.current,d!==null&&d.tag===13&&(d.flags|=16384))),X_(r,n)):cd(r)}function cd(n){var r=n;do{if((r.flags&32768)!==0){X_(r,Rr);return}n=r.return;var c=aT(r.alternate,r,sr);if(c!==null){Qe=c;return}if(r=r.sibling,r!==null){Qe=r;return}Qe=r=n}while(r!==null);Ht===0&&(Ht=5)}function X_(n,r){do{var c=oT(n.alternate,n);if(c!==null){c.flags&=32767,Qe=c;return}if(c=n.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!r&&(n=n.sibling,n!==null)){Qe=n;return}Qe=n=c}while(n!==null);Ht=6,Qe=null}function Z_(n,r,c,d,g,v,k,A,B){n.cancelPendingCommit=null;do ud();while(cs!==0);if((ht&6)!==0)throw Error(i(327));if(r!==null){if(r===n.current)throw Error(i(177));if(v=r.lanes|r.childLanes,v|=_f,Ae(n,c,v,k,A,B),n===kt&&(Qe=kt=null,st=0),Mo=r,Lr=n,nr=c,Tm=v,Am=g,$_=d,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,xT(zi,function(){return s1(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||d){d=O.T,O.T=null,g=X.p,X.p=2,k=ht,ht|=4;try{lT(n,r,c)}finally{ht=k,X.p=g,O.T=d}}cs=1,Q_(),J_(),e1()}}function Q_(){if(cs===1){cs=0;var n=Lr,r=Mo,c=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||c){c=O.T,O.T=null;var d=X.p;X.p=2;var g=ht;ht|=4;try{R_(r,n);var v=Vm,k=Iv(n.containerInfo),A=v.focusedElem,B=v.selectionRange;if(k!==A&&A&&A.ownerDocument&&zv(A.ownerDocument.documentElement,A)){if(B!==null&&pf(A)){var ee=B.start,ie=B.end;if(ie===void 0&&(ie=ee),"selectionStart"in A)A.selectionStart=ee,A.selectionEnd=Math.min(ie,A.value.length);else{var ce=A.ownerDocument||document,te=ce&&ce.defaultView||window;if(te.getSelection){var se=te.getSelection(),Ne=A.textContent.length,Be=Math.min(B.start,Ne),yt=B.end===void 0?Be:Math.min(B.end,Ne);!se.extend&&Be>yt&&(k=yt,yt=Be,Be=k);var G=Bv(A,Be),U=Bv(A,yt);if(G&&U&&(se.rangeCount!==1||se.anchorNode!==G.node||se.anchorOffset!==G.offset||se.focusNode!==U.node||se.focusOffset!==U.offset)){var J=ce.createRange();J.setStart(G.node,G.offset),se.removeAllRanges(),Be>yt?(se.addRange(J),se.extend(U.node,U.offset)):(J.setEnd(U.node,U.offset),se.addRange(J))}}}}for(ce=[],se=A;se=se.parentNode;)se.nodeType===1&&ce.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<ce.length;A++){var oe=ce[A];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Sd=!!Fm,Vm=Fm=null}finally{ht=g,X.p=d,O.T=c}}n.current=r,cs=2}}function J_(){if(cs===2){cs=0;var n=Lr,r=Mo,c=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||c){c=O.T,O.T=null;var d=X.p;X.p=2;var g=ht;ht|=4;try{N_(n,r.alternate,r)}finally{ht=g,X.p=d,O.T=c}}cs=3}}function e1(){if(cs===4||cs===3){cs=0,mr();var n=Lr,r=Mo,c=nr,d=$_;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?cs=5:(cs=0,Mo=Lr=null,t1(n,n.pendingLanes));var g=n.pendingLanes;if(g===0&&(Or=null),Pi(c),r=r.stateNode,gs&&typeof gs.onCommitFiberRoot=="function")try{gs.onCommitFiberRoot(Ii,r,void 0,(r.current.flags&128)===128)}catch{}if(d!==null){r=O.T,g=X.p,X.p=2,O.T=null;try{for(var v=n.onRecoverableError,k=0;k<d.length;k++){var A=d[k];v(A.value,{componentStack:A.stack})}}finally{O.T=r,X.p=g}}(nr&3)!==0&&ud(),pi(n),g=n.pendingLanes,(c&261930)!==0&&(g&42)!==0?n===Mm?Zl++:(Zl=0,Mm=n):Zl=0,Ql(0)}}function t1(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,Rl(r)))}function ud(){return Q_(),J_(),e1(),s1()}function s1(){if(cs!==5)return!1;var n=Lr,r=Tm;Tm=0;var c=Pi(nr),d=O.T,g=X.p;try{X.p=32>c?32:c,O.T=null,c=Am,Am=null;var v=Lr,k=nr;if(cs=0,Mo=Lr=null,nr=0,(ht&6)!==0)throw Error(i(331));var A=ht;if(ht|=4,z_(v.current),O_(v,v.current,k,c),ht=A,Ql(0,!1),gs&&typeof gs.onPostCommitFiberRoot=="function")try{gs.onPostCommitFiberRoot(Ii,v)}catch{}return!0}finally{X.p=g,O.T=d,t1(n,r)}}function n1(n,r,c){r=Dn(c,r),r=lm(n.stateNode,r,2),n=Tr(n,r,2),n!==null&&(wt(n,2),pi(n))}function vt(n,r,c){if(n.tag===3)n1(n,n,c);else for(;r!==null;){if(r.tag===3){n1(r,n,c);break}else if(r.tag===1){var d=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Or===null||!Or.has(d))){n=Dn(c,n),c=i_(2),d=Tr(r,c,2),d!==null&&(r_(c,d,r,n),wt(d,2),pi(d));break}}r=r.return}}function Dm(n,r,c){var d=n.pingCache;if(d===null){d=n.pingCache=new dT;var g=new Set;d.set(r,g)}else g=d.get(r),g===void 0&&(g=new Set,d.set(r,g));g.has(c)||(Cm=!0,g.add(c),n=gT.bind(null,n,r,c),r.then(n,n))}function gT(n,r,c){var d=n.pingCache;d!==null&&d.delete(r),n.pingedLanes|=n.suspendedLanes&c,n.warmLanes&=~c,kt===n&&(st&c)===c&&(Ht===4||Ht===3&&(st&62914560)===st&&300>Bt()-id?(ht&2)===0&&jo(n,0):Em|=c,Ao===st&&(Ao=0)),pi(n)}function i1(n,r){r===0&&(r=He()),n=pa(n,r),n!==null&&(wt(n,r),pi(n))}function bT(n){var r=n.memoizedState,c=0;r!==null&&(c=r.retryLane),i1(n,c)}function vT(n,r){var c=0;switch(n.tag){case 31:case 13:var d=n.stateNode,g=n.memoizedState;g!==null&&(c=g.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(i(314))}d!==null&&d.delete(r),i1(n,c)}function xT(n,r){return ls(n,r)}var dd=null,Do=null,Om=!1,hd=!1,Lm=!1,zr=0;function pi(n){n!==Do&&n.next===null&&(Do===null?dd=Do=n:Do=Do.next=n),hd=!0,Om||(Om=!0,yT())}function Ql(n,r){if(!Lm&&hd){Lm=!0;do for(var c=!1,d=dd;d!==null;){if(n!==0){var g=d.pendingLanes;if(g===0)var v=0;else{var k=d.suspendedLanes,A=d.pingedLanes;v=(1<<31-ks(42|n)+1)-1,v&=g&~(k&~A),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(c=!0,l1(d,v))}else v=st,v=I(d,d===kt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||ae(d,v)||(c=!0,l1(d,v));d=d.next}while(c);Lm=!1}}function _T(){r1()}function r1(){hd=Om=!1;var n=0;zr!==0&&jT()&&(n=zr);for(var r=Bt(),c=null,d=dd;d!==null;){var g=d.next,v=a1(d,r);v===0?(d.next=null,c===null?dd=g:c.next=g,g===null&&(Do=c)):(c=d,(n!==0||(v&3)!==0)&&(hd=!0)),d=g}cs!==0&&cs!==5||Ql(n),zr!==0&&(zr=0)}function a1(n,r){for(var c=n.suspendedLanes,d=n.pingedLanes,g=n.expirationTimes,v=n.pendingLanes&-62914561;0<v;){var k=31-ks(v),A=1<<k,B=g[k];B===-1?((A&c)===0||(A&d)!==0)&&(g[k]=_e(A,r)):B<=r&&(n.expiredLanes|=A),v&=~A}if(r=kt,c=st,c=I(n,n===r?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,c===0||n===r&&(bt===2||bt===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&Gs(d),n.callbackNode=null,n.callbackPriority=0;if((c&3)===0||ae(n,c)){if(r=c&-c,r===n.callbackPriority)return r;switch(d!==null&&Gs(d),Pi(c)){case 2:case 8:c=Bi;break;case 32:c=zi;break;case 268435456:c=pr;break;default:c=zi}return d=o1.bind(null,n),c=ls(c,d),n.callbackPriority=r,n.callbackNode=c,r}return d!==null&&d!==null&&Gs(d),n.callbackPriority=2,n.callbackNode=null,2}function o1(n,r){if(cs!==0&&cs!==5)return n.callbackNode=null,n.callbackPriority=0,null;var c=n.callbackNode;if(ud()&&n.callbackNode!==c)return null;var d=st;return d=I(n,n===kt?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(U_(n,d,r),a1(n,Bt()),n.callbackNode!=null&&n.callbackNode===c?o1.bind(null,n):null)}function l1(n,r){if(ud())return null;U_(n,r,!0)}function yT(){DT(function(){(ht&6)!==0?ls(ws,_T):r1()})}function Bm(){if(zr===0){var n=vo;n===0&&(n=at,at<<=1,(at&261888)===0&&(at=256)),zr=n}return zr}function c1(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:_r(""+n)}function u1(n,r){var c=r.ownerDocument.createElement("input");return c.name=r.name,c.value=r.value,n.id&&c.setAttribute("form",n.id),r.parentNode.insertBefore(c,r),n=new FormData(n),c.parentNode.removeChild(c),n}function ST(n,r,c,d,g){if(r==="submit"&&c&&c.stateNode===g){var v=c1((g[Is]||null).action),k=d.submitter;k&&(r=(r=k[Is]||null)?c1(r.formAction):k.getAttribute("formAction"),r!==null&&(v=r,k=null));var A=new ku("action","action",null,d,g);n.push({event:A,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(zr!==0){var B=k?u1(g,k):new FormData(g);sm(c,{pending:!0,data:B,method:g.method,action:v},null,B)}}else typeof v=="function"&&(A.preventDefault(),B=k?u1(g,k):new FormData(g),sm(c,{pending:!0,data:B,method:g.method,action:v},v,B))},currentTarget:g}]})}}for(var zm=0;zm<xf.length;zm++){var Im=xf[zm],wT=Im.toLowerCase(),kT=Im[0].toUpperCase()+Im.slice(1);ti(wT,"on"+kT)}ti(Hv,"onAnimationEnd"),ti(Uv,"onAnimationIteration"),ti(Fv,"onAnimationStart"),ti("dblclick","onDoubleClick"),ti("focusin","onFocus"),ti("focusout","onBlur"),ti($5,"onTransitionRun"),ti(H5,"onTransitionStart"),ti(U5,"onTransitionCancel"),ti(Vv,"onTransitionEnd"),ge("onMouseEnter",["mouseout","mouseover"]),ge("onMouseLeave",["mouseout","mouseover"]),ge("onPointerEnter",["pointerout","pointerover"]),ge("onPointerLeave",["pointerout","pointerover"]),Hi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Hi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Hi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Hi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Hi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Hi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jl="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(" "),CT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jl));function d1(n,r){r=(r&4)!==0;for(var c=0;c<n.length;c++){var d=n[c],g=d.event;d=d.listeners;e:{var v=void 0;if(r)for(var k=d.length-1;0<=k;k--){var A=d[k],B=A.instance,ee=A.currentTarget;if(A=A.listener,B!==v&&g.isPropagationStopped())break e;v=A,g.currentTarget=ee;try{v(g)}catch(ie){Nu(ie)}g.currentTarget=null,v=B}else for(k=0;k<d.length;k++){if(A=d[k],B=A.instance,ee=A.currentTarget,A=A.listener,B!==v&&g.isPropagationStopped())break e;v=A,g.currentTarget=ee;try{v(g)}catch(ie){Nu(ie)}g.currentTarget=null,v=B}}}}function Je(n,r){var c=r[pl];c===void 0&&(c=r[pl]=new Set);var d=n+"__bubble";c.has(d)||(h1(r,n,2,!1),c.add(d))}function Pm(n,r,c){var d=0;r&&(d|=4),h1(c,n,d,r)}var fd="_reactListening"+Math.random().toString(36).slice(2);function $m(n){if(!n[fd]){n[fd]=!0,gu.forEach(function(c){c!=="selectionchange"&&(CT.has(c)||Pm(c,!1,n),Pm(c,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[fd]||(r[fd]=!0,Pm("selectionchange",!1,r))}}function h1(n,r,c,d){switch(H1(r)){case 2:var g=JT;break;case 8:g=eA;break;default:g=tp}c=g.bind(null,r,c,n),g=void 0,!af||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(g=!0),d?g!==void 0?n.addEventListener(r,c,{capture:!0,passive:g}):n.addEventListener(r,c,!0):g!==void 0?n.addEventListener(r,c,{passive:g}):n.addEventListener(r,c,!1)}function Hm(n,r,c,d,g){var v=d;if((r&1)===0&&(r&2)===0&&d!==null)e:for(;;){if(d===null)return;var k=d.tag;if(k===3||k===4){var A=d.stateNode.containerInfo;if(A===g)break;if(k===4)for(k=d.return;k!==null;){var B=k.tag;if((B===3||B===4)&&k.stateNode.containerInfo===g)return;k=k.return}for(;A!==null;){if(k=Ks(A),k===null)return;if(B=k.tag,B===5||B===6||B===26||B===27){d=v=k;continue e}A=A.parentNode}}d=d.return}_u(function(){var ee=v,ie=Ve(c),ce=[];e:{var te=qv.get(n);if(te!==void 0){var se=ku,Ne=n;switch(n){case"keypress":if(Su(c)===0)break e;case"keydown":case"keyup":se=v5;break;case"focusin":Ne="focus",se=uf;break;case"focusout":Ne="blur",se=uf;break;case"beforeblur":case"afterblur":se=uf;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=_v;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=a5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=y5;break;case Hv:case Uv:case Fv:se=c5;break;case Vv:se=w5;break;case"scroll":case"scrollend":se=i5;break;case"wheel":se=C5;break;case"copy":case"cut":case"paste":se=d5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=Sv;break;case"toggle":case"beforetoggle":se=N5}var Be=(r&4)!==0,yt=!Be&&(n==="scroll"||n==="scrollend"),G=Be?te!==null?te+"Capture":null:te;Be=[];for(var U=ee,J;U!==null;){var oe=U;if(J=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||J===null||G===null||(oe=yl(U,G),oe!=null&&Be.push(ec(U,oe,J))),yt)break;U=U.return}0<Be.length&&(te=new se(te,Ne,null,c,ie),ce.push({event:te,listeners:Be}))}}if((r&7)===0){e:{if(te=n==="mouseover"||n==="pointerover",se=n==="mouseout"||n==="pointerout",te&&c!==Me&&(Ne=c.relatedTarget||c.fromElement)&&(Ks(Ne)||Ne[gr]))break e;if((se||te)&&(te=ie.window===ie?ie:(te=ie.ownerDocument)?te.defaultView||te.parentWindow:window,se?(Ne=c.relatedTarget||c.toElement,se=ee,Ne=Ne?Ks(Ne):null,Ne!==null&&(yt=o(Ne),Be=Ne.tag,Ne!==yt||Be!==5&&Be!==27&&Be!==6)&&(Ne=null)):(se=null,Ne=ee),se!==Ne)){if(Be=_v,oe="onMouseLeave",G="onMouseEnter",U="mouse",(n==="pointerout"||n==="pointerover")&&(Be=Sv,oe="onPointerLeave",G="onPointerEnter",U="pointer"),yt=se==null?te:br(se),J=Ne==null?te:br(Ne),te=new Be(oe,U+"leave",se,c,ie),te.target=yt,te.relatedTarget=J,oe=null,Ks(ie)===ee&&(Be=new Be(G,U+"enter",Ne,c,ie),Be.target=J,Be.relatedTarget=yt,oe=Be),yt=oe,se&&Ne)t:{for(Be=ET,G=se,U=Ne,J=0,oe=G;oe;oe=Be(oe))J++;oe=0;for(var Oe=U;Oe;Oe=Be(Oe))oe++;for(;0<J-oe;)G=Be(G),J--;for(;0<oe-J;)U=Be(U),oe--;for(;J--;){if(G===U||U!==null&&G===U.alternate){Be=G;break t}G=Be(G),U=Be(U)}Be=null}else Be=null;se!==null&&f1(ce,te,se,Be,!1),Ne!==null&&yt!==null&&f1(ce,yt,Ne,Be,!0)}}e:{if(te=ee?br(ee):window,se=te.nodeName&&te.nodeName.toLowerCase(),se==="select"||se==="input"&&te.type==="file")var ut=Mv;else if(Tv(te))if(jv)ut=z5;else{ut=L5;var je=O5}else se=te.nodeName,!se||se.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ee&&xr(ee.elementType)&&(ut=Mv):ut=B5;if(ut&&(ut=ut(n,ee))){Av(ce,ut,c,ie);break e}je&&je(n,te,ee),n==="focusout"&&ee&&te.type==="number"&&ee.memoizedProps.value!=null&&ao(te,"number",te.value)}switch(je=ee?br(ee):window,n){case"focusin":(Tv(je)||je.contentEditable==="true")&&(co=je,gf=ee,Al=null);break;case"focusout":Al=gf=co=null;break;case"mousedown":bf=!0;break;case"contextmenu":case"mouseup":case"dragend":bf=!1,Pv(ce,c,ie);break;case"selectionchange":if(P5)break;case"keydown":case"keyup":Pv(ce,c,ie)}var Ge;if(hf)e:{switch(n){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else lo?Ev(n,c)&&(nt="onCompositionEnd"):n==="keydown"&&c.keyCode===229&&(nt="onCompositionStart");nt&&(wv&&c.locale!=="ko"&&(lo||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&lo&&(Ge=vv()):(yr=ie,of="value"in yr?yr.value:yr.textContent,lo=!0)),je=md(ee,nt),0<je.length&&(nt=new yv(nt,n,null,c,ie),ce.push({event:nt,listeners:je}),Ge?nt.data=Ge:(Ge=Nv(c),Ge!==null&&(nt.data=Ge)))),(Ge=A5?M5(n,c):j5(n,c))&&(nt=md(ee,"onBeforeInput"),0<nt.length&&(je=new yv("onBeforeInput","beforeinput",null,c,ie),ce.push({event:je,listeners:nt}),je.data=Ge)),ST(ce,n,ee,c,ie)}d1(ce,r)})}function ec(n,r,c){return{instance:n,listener:r,currentTarget:c}}function md(n,r){for(var c=r+"Capture",d=[];n!==null;){var g=n,v=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||v===null||(g=yl(n,c),g!=null&&d.unshift(ec(n,g,v)),g=yl(n,r),g!=null&&d.push(ec(n,g,v))),n.tag===3)return d;n=n.return}return[]}function ET(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function f1(n,r,c,d,g){for(var v=r._reactName,k=[];c!==null&&c!==d;){var A=c,B=A.alternate,ee=A.stateNode;if(A=A.tag,B!==null&&B===d)break;A!==5&&A!==26&&A!==27||ee===null||(B=ee,g?(ee=yl(c,v),ee!=null&&k.unshift(ec(c,ee,B))):g||(ee=yl(c,v),ee!=null&&k.push(ec(c,ee,B)))),c=c.return}k.length!==0&&n.push({event:r,listeners:k})}var NT=/\r\n?/g,TT=/\u0000|\uFFFD/g;function m1(n){return(typeof n=="string"?n:""+n).replace(NT,`
|
|
9
|
-
`).replace(TT,"")}function p1(n,r){return r=m1(r),m1(n)===r}function _t(n,r,c,d,g,v){switch(c){case"children":typeof d=="string"?r==="body"||r==="textarea"&&d===""||Ie(n,d):(typeof d=="number"||typeof d=="bigint")&&r!=="body"&&Ie(n,""+d);break;case"className":bn(n,"class",d);break;case"tabIndex":bn(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":bn(n,c,d);break;case"style":gt(n,d,v);break;case"data":if(r!=="object"){bn(n,"data",d);break}case"src":case"href":if(d===""&&(r!=="a"||c!=="href")){n.removeAttribute(c);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(c);break}d=_r(""+d),n.setAttribute(c,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(c==="formAction"?(r!=="input"&&_t(n,r,"name",g.name,g,null),_t(n,r,"formEncType",g.formEncType,g,null),_t(n,r,"formMethod",g.formMethod,g,null),_t(n,r,"formTarget",g.formTarget,g,null)):(_t(n,r,"encType",g.encType,g,null),_t(n,r,"method",g.method,g,null),_t(n,r,"target",g.target,g,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(c);break}d=_r(""+d),n.setAttribute(c,d);break;case"onClick":d!=null&&(n.onclick=ve);break;case"onScroll":d!=null&&Je("scroll",n);break;case"onScrollEnd":d!=null&&Je("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(i(61));if(c=d.__html,c!=null){if(g.children!=null)throw Error(i(60));n.innerHTML=c}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}c=_r(""+d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(c,""+d):n.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(c,""):n.removeAttribute(c);break;case"capture":case"download":d===!0?n.setAttribute(c,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(c,d):n.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(c,d):n.removeAttribute(c);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(c):n.setAttribute(c,d);break;case"popover":Je("beforetoggle",n),Je("toggle",n),Ps(n,"popover",d);break;case"xlinkActuate":sn(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":sn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":sn(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":sn(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":sn(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":sn(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":sn(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":sn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":sn(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Ps(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=Ui.get(c)||c,Ps(n,c,d))}}function Um(n,r,c,d,g,v){switch(c){case"style":gt(n,d,v);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(i(61));if(c=d.__html,c!=null){if(g.children!=null)throw Error(i(60));n.innerHTML=c}}break;case"children":typeof d=="string"?Ie(n,d):(typeof d=="number"||typeof d=="bigint")&&Ie(n,""+d);break;case"onScroll":d!=null&&Je("scroll",n);break;case"onScrollEnd":d!=null&&Je("scrollend",n);break;case"onClick":d!=null&&(n.onclick=ve);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ua.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(g=c.endsWith("Capture"),r=c.slice(2,g?c.length-7:void 0),v=n[Is]||null,v=v!=null?v[c]:null,typeof v=="function"&&n.removeEventListener(r,v,g),typeof d=="function")){typeof v!="function"&&v!==null&&(c in n?n[c]=null:n.hasAttribute(c)&&n.removeAttribute(c)),n.addEventListener(r,d,g);break e}c in n?n[c]=d:d===!0?n.setAttribute(c,""):Ps(n,c,d)}}}function As(n,r,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",n),Je("load",n);var d=!1,g=!1,v;for(v in c)if(c.hasOwnProperty(v)){var k=c[v];if(k!=null)switch(v){case"src":d=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:_t(n,r,v,k,c,null)}}g&&_t(n,r,"srcSet",c.srcSet,c,null),d&&_t(n,r,"src",c.src,c,null);return;case"input":Je("invalid",n);var A=v=k=g=null,B=null,ee=null;for(d in c)if(c.hasOwnProperty(d)){var ie=c[d];if(ie!=null)switch(d){case"name":g=ie;break;case"type":k=ie;break;case"checked":B=ie;break;case"defaultChecked":ee=ie;break;case"value":v=ie;break;case"defaultValue":A=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,r));break;default:_t(n,r,d,ie,c,null)}}da(n,v,A,B,ee,k,g,!1);return;case"select":Je("invalid",n),d=k=v=null;for(g in c)if(c.hasOwnProperty(g)&&(A=c[g],A!=null))switch(g){case"value":v=A;break;case"defaultValue":k=A;break;case"multiple":d=A;default:_t(n,r,g,A,c,null)}r=v,c=k,n.multiple=!!d,r!=null?Cs(n,!!d,r,!1):c!=null&&Cs(n,!!d,c,!0);return;case"textarea":Je("invalid",n),v=g=d=null;for(k in c)if(c.hasOwnProperty(k)&&(A=c[k],A!=null))switch(k){case"value":d=A;break;case"defaultValue":g=A;break;case"children":v=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(i(91));break;default:_t(n,r,k,A,c,null)}oo(n,d,g,v);return;case"option":for(B in c)c.hasOwnProperty(B)&&(d=c[B],d!=null)&&(B==="selected"?n.selected=d&&typeof d!="function"&&typeof d!="symbol":_t(n,r,B,d,c,null));return;case"dialog":Je("beforetoggle",n),Je("toggle",n),Je("cancel",n),Je("close",n);break;case"iframe":case"object":Je("load",n);break;case"video":case"audio":for(d=0;d<Jl.length;d++)Je(Jl[d],n);break;case"image":Je("error",n),Je("load",n);break;case"details":Je("toggle",n);break;case"embed":case"source":case"link":Je("error",n),Je("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in c)if(c.hasOwnProperty(ee)&&(d=c[ee],d!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:_t(n,r,ee,d,c,null)}return;default:if(xr(r)){for(ie in c)c.hasOwnProperty(ie)&&(d=c[ie],d!==void 0&&Um(n,r,ie,d,c,void 0));return}}for(A in c)c.hasOwnProperty(A)&&(d=c[A],d!=null&&_t(n,r,A,d,c,null))}function AT(n,r,c,d){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,v=null,k=null,A=null,B=null,ee=null,ie=null;for(se in c){var ce=c[se];if(c.hasOwnProperty(se)&&ce!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":B=ce;default:d.hasOwnProperty(se)||_t(n,r,se,null,d,ce)}}for(var te in d){var se=d[te];if(ce=c[te],d.hasOwnProperty(te)&&(se!=null||ce!=null))switch(te){case"type":v=se;break;case"name":g=se;break;case"checked":ee=se;break;case"defaultChecked":ie=se;break;case"value":k=se;break;case"defaultValue":A=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(i(137,r));break;default:se!==ce&&_t(n,r,te,se,d,ce)}}vl(n,k,A,B,ee,ie,v,g);return;case"select":se=k=A=te=null;for(v in c)if(B=c[v],c.hasOwnProperty(v)&&B!=null)switch(v){case"value":break;case"multiple":se=B;default:d.hasOwnProperty(v)||_t(n,r,v,null,d,B)}for(g in d)if(v=d[g],B=c[g],d.hasOwnProperty(g)&&(v!=null||B!=null))switch(g){case"value":te=v;break;case"defaultValue":A=v;break;case"multiple":k=v;default:v!==B&&_t(n,r,g,v,d,B)}r=A,c=k,d=se,te!=null?Cs(n,!!c,te,!1):!!d!=!!c&&(r!=null?Cs(n,!!c,r,!0):Cs(n,!!c,c?[]:"",!1));return;case"textarea":se=te=null;for(A in c)if(g=c[A],c.hasOwnProperty(A)&&g!=null&&!d.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:_t(n,r,A,null,d,g)}for(k in d)if(g=d[k],v=c[k],d.hasOwnProperty(k)&&(g!=null||v!=null))switch(k){case"value":te=g;break;case"defaultValue":se=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(i(91));break;default:g!==v&&_t(n,r,k,g,d,v)}vu(n,te,se);return;case"option":for(var Ne in c)te=c[Ne],c.hasOwnProperty(Ne)&&te!=null&&!d.hasOwnProperty(Ne)&&(Ne==="selected"?n.selected=!1:_t(n,r,Ne,null,d,te));for(B in d)te=d[B],se=c[B],d.hasOwnProperty(B)&&te!==se&&(te!=null||se!=null)&&(B==="selected"?n.selected=te&&typeof te!="function"&&typeof te!="symbol":_t(n,r,B,te,d,se));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Be in c)te=c[Be],c.hasOwnProperty(Be)&&te!=null&&!d.hasOwnProperty(Be)&&_t(n,r,Be,null,d,te);for(ee in d)if(te=d[ee],se=c[ee],d.hasOwnProperty(ee)&&te!==se&&(te!=null||se!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(i(137,r));break;default:_t(n,r,ee,te,d,se)}return;default:if(xr(r)){for(var yt in c)te=c[yt],c.hasOwnProperty(yt)&&te!==void 0&&!d.hasOwnProperty(yt)&&Um(n,r,yt,void 0,d,te);for(ie in d)te=d[ie],se=c[ie],!d.hasOwnProperty(ie)||te===se||te===void 0&&se===void 0||Um(n,r,ie,te,d,se);return}}for(var G in c)te=c[G],c.hasOwnProperty(G)&&te!=null&&!d.hasOwnProperty(G)&&_t(n,r,G,null,d,te);for(ce in d)te=d[ce],se=c[ce],!d.hasOwnProperty(ce)||te===se||te==null&&se==null||_t(n,r,ce,te,d,se)}function g1(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function MT(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,c=performance.getEntriesByType("resource"),d=0;d<c.length;d++){var g=c[d],v=g.transferSize,k=g.initiatorType,A=g.duration;if(v&&A&&g1(k)){for(k=0,A=g.responseEnd,d+=1;d<c.length;d++){var B=c[d],ee=B.startTime;if(ee>A)break;var ie=B.transferSize,ce=B.initiatorType;ie&&g1(ce)&&(B=B.responseEnd,k+=ie*(B<A?1:(A-ee)/(B-ee)))}if(--d,r+=8*(v+k)/(g.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Fm=null,Vm=null;function pd(n){return n.nodeType===9?n:n.ownerDocument}function b1(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function v1(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function qm(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Gm=null;function jT(){var n=window.event;return n&&n.type==="popstate"?n===Gm?!1:(Gm=n,!0):(Gm=null,!1)}var x1=typeof setTimeout=="function"?setTimeout:void 0,RT=typeof clearTimeout=="function"?clearTimeout:void 0,_1=typeof Promise=="function"?Promise:void 0,DT=typeof queueMicrotask=="function"?queueMicrotask:typeof _1<"u"?function(n){return _1.resolve(null).then(n).catch(OT)}:x1;function OT(n){setTimeout(function(){throw n})}function Ir(n){return n==="head"}function y1(n,r){var c=r,d=0;do{var g=c.nextSibling;if(n.removeChild(c),g&&g.nodeType===8)if(c=g.data,c==="/$"||c==="/&"){if(d===0){n.removeChild(g),zo(r);return}d--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")d++;else if(c==="html")tc(n.ownerDocument.documentElement);else if(c==="head"){c=n.ownerDocument.head,tc(c);for(var v=c.firstChild;v;){var k=v.nextSibling,A=v.nodeName;v[ca]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&v.rel.toLowerCase()==="stylesheet"||c.removeChild(v),v=k}}else c==="body"&&tc(n.ownerDocument.body);c=g}while(c);zo(r)}function S1(n,r){var c=n;n=0;do{var d=c.nextSibling;if(c.nodeType===1?r?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(r?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),d&&d.nodeType===8)if(c=d.data,c==="/$"){if(n===0)break;n--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||n++;c=d}while(c)}function Km(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var c=r;switch(r=r.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Km(c),gl(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}n.removeChild(c)}}function LT(n,r,c,d){for(;n.nodeType===1;){var g=c;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[ca])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(v=n.getAttribute("rel"),v==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(v!==g.rel||n.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||n.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||n.getAttribute("title")!==(g.title==null?null:g.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(v=n.getAttribute("src"),(v!==(g.src==null?null:g.src)||n.getAttribute("type")!==(g.type==null?null:g.type)||n.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&v&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var v=g.name==null?null:""+g.name;if(g.type==="hidden"&&n.getAttribute("name")===v)return n}else return n;if(n=In(n.nextSibling),n===null)break}return null}function BT(n,r,c){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!c||(n=In(n.nextSibling),n===null))return null;return n}function w1(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=In(n.nextSibling),n===null))return null;return n}function Wm(n){return n.data==="$?"||n.data==="$~"}function Ym(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function zT(n,r){var c=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||c.readyState!=="loading")r();else{var d=function(){r(),c.removeEventListener("DOMContentLoaded",d)};c.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function In(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var Xm=null;function k1(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var c=n.data;if(c==="/$"||c==="/&"){if(r===0)return In(n.nextSibling);r--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||r++}n=n.nextSibling}return null}function C1(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var c=n.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(r===0)return n;r--}else c!=="/$"&&c!=="/&"||r++}n=n.previousSibling}return null}function E1(n,r,c){switch(r=pd(c),n){case"html":if(n=r.documentElement,!n)throw Error(i(452));return n;case"head":if(n=r.head,!n)throw Error(i(453));return n;case"body":if(n=r.body,!n)throw Error(i(454));return n;default:throw Error(i(451))}}function tc(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);gl(n)}var Pn=new Map,N1=new Set;function gd(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var ir=X.d;X.d={f:IT,r:PT,D:$T,C:HT,L:UT,m:FT,X:qT,S:VT,M:GT};function IT(){var n=ir.f(),r=od();return n||r}function PT(n){var r=$i(n);r!==null&&r.tag===5&&r.type==="form"?Vx(r):ir.r(n)}var Oo=typeof document>"u"?null:document;function T1(n,r,c){var d=Oo;if(d&&typeof r=="string"&&r){var g=nn(r);g='link[rel="'+n+'"][href="'+g+'"]',typeof c=="string"&&(g+='[crossorigin="'+c+'"]'),N1.has(g)||(N1.add(g),n={rel:n,crossOrigin:c,href:r},d.querySelector(g)===null&&(r=d.createElement("link"),As(r,"link",n),Zt(r),d.head.appendChild(r)))}}function $T(n){ir.D(n),T1("dns-prefetch",n,null)}function HT(n,r){ir.C(n,r),T1("preconnect",n,r)}function UT(n,r,c){ir.L(n,r,c);var d=Oo;if(d&&n&&r){var g='link[rel="preload"][as="'+nn(r)+'"]';r==="image"&&c&&c.imageSrcSet?(g+='[imagesrcset="'+nn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(g+='[imagesizes="'+nn(c.imageSizes)+'"]')):g+='[href="'+nn(n)+'"]';var v=g;switch(r){case"style":v=Lo(n);break;case"script":v=Bo(n)}Pn.has(v)||(n=b({rel:"preload",href:r==="image"&&c&&c.imageSrcSet?void 0:n,as:r},c),Pn.set(v,n),d.querySelector(g)!==null||r==="style"&&d.querySelector(sc(v))||r==="script"&&d.querySelector(nc(v))||(r=d.createElement("link"),As(r,"link",n),Zt(r),d.head.appendChild(r)))}}function FT(n,r){ir.m(n,r);var c=Oo;if(c&&n){var d=r&&typeof r.as=="string"?r.as:"script",g='link[rel="modulepreload"][as="'+nn(d)+'"][href="'+nn(n)+'"]',v=g;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Bo(n)}if(!Pn.has(v)&&(n=b({rel:"modulepreload",href:n},r),Pn.set(v,n),c.querySelector(g)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(nc(v)))return}d=c.createElement("link"),As(d,"link",n),Zt(d),c.head.appendChild(d)}}}function VT(n,r,c){ir.S(n,r,c);var d=Oo;if(d&&n){var g=vr(d).hoistableStyles,v=Lo(n);r=r||"default";var k=g.get(v);if(!k){var A={loading:0,preload:null};if(k=d.querySelector(sc(v)))A.loading=5;else{n=b({rel:"stylesheet",href:n,"data-precedence":r},c),(c=Pn.get(v))&&Zm(n,c);var B=k=d.createElement("link");Zt(B),As(B,"link",n),B._p=new Promise(function(ee,ie){B.onload=ee,B.onerror=ie}),B.addEventListener("load",function(){A.loading|=1}),B.addEventListener("error",function(){A.loading|=2}),A.loading|=4,bd(k,r,d)}k={type:"stylesheet",instance:k,count:1,state:A},g.set(v,k)}}}function qT(n,r){ir.X(n,r);var c=Oo;if(c&&n){var d=vr(c).hoistableScripts,g=Bo(n),v=d.get(g);v||(v=c.querySelector(nc(g)),v||(n=b({src:n,async:!0},r),(r=Pn.get(g))&&Qm(n,r),v=c.createElement("script"),Zt(v),As(v,"link",n),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(g,v))}}function GT(n,r){ir.M(n,r);var c=Oo;if(c&&n){var d=vr(c).hoistableScripts,g=Bo(n),v=d.get(g);v||(v=c.querySelector(nc(g)),v||(n=b({src:n,async:!0,type:"module"},r),(r=Pn.get(g))&&Qm(n,r),v=c.createElement("script"),Zt(v),As(v,"link",n),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(g,v))}}function A1(n,r,c,d){var g=(g=ne.current)?gd(g):null;if(!g)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(r=Lo(c.href),c=vr(g).hoistableStyles,d=c.get(r),d||(d={type:"style",instance:null,count:0,state:null},c.set(r,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){n=Lo(c.href);var v=vr(g).hoistableStyles,k=v.get(n);if(k||(g=g.ownerDocument||g,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(n,k),(v=g.querySelector(sc(n)))&&!v._p&&(k.instance=v,k.state.loading=5),Pn.has(n)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Pn.set(n,c),v||KT(g,n,c,k.state))),r&&d===null)throw Error(i(528,""));return k}if(r&&d!==null)throw Error(i(529,""));return null;case"script":return r=c.async,c=c.src,typeof c=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Bo(c),c=vr(g).hoistableScripts,d=c.get(r),d||(d={type:"script",instance:null,count:0,state:null},c.set(r,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function Lo(n){return'href="'+nn(n)+'"'}function sc(n){return'link[rel="stylesheet"]['+n+"]"}function M1(n){return b({},n,{"data-precedence":n.precedence,precedence:null})}function KT(n,r,c,d){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?d.loading=1:(r=n.createElement("link"),d.preload=r,r.addEventListener("load",function(){return d.loading|=1}),r.addEventListener("error",function(){return d.loading|=2}),As(r,"link",c),Zt(r),n.head.appendChild(r))}function Bo(n){return'[src="'+nn(n)+'"]'}function nc(n){return"script[async]"+n}function j1(n,r,c){if(r.count++,r.instance===null)switch(r.type){case"style":var d=n.querySelector('style[data-href~="'+nn(c.href)+'"]');if(d)return r.instance=d,Zt(d),d;var g=b({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),Zt(d),As(d,"style",g),bd(d,c.precedence,n),r.instance=d;case"stylesheet":g=Lo(c.href);var v=n.querySelector(sc(g));if(v)return r.state.loading|=4,r.instance=v,Zt(v),v;d=M1(c),(g=Pn.get(g))&&Zm(d,g),v=(n.ownerDocument||n).createElement("link"),Zt(v);var k=v;return k._p=new Promise(function(A,B){k.onload=A,k.onerror=B}),As(v,"link",d),r.state.loading|=4,bd(v,c.precedence,n),r.instance=v;case"script":return v=Bo(c.src),(g=n.querySelector(nc(v)))?(r.instance=g,Zt(g),g):(d=c,(g=Pn.get(v))&&(d=b({},c),Qm(d,g)),n=n.ownerDocument||n,g=n.createElement("script"),Zt(g),As(g,"link",d),n.head.appendChild(g),r.instance=g);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(d=r.instance,r.state.loading|=4,bd(d,c.precedence,n));return r.instance}function bd(n,r,c){for(var d=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=d.length?d[d.length-1]:null,v=g,k=0;k<d.length;k++){var A=d[k];if(A.dataset.precedence===r)v=A;else if(v!==g)break}v?v.parentNode.insertBefore(n,v.nextSibling):(r=c.nodeType===9?c.head:c,r.insertBefore(n,r.firstChild))}function Zm(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function Qm(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var vd=null;function R1(n,r,c){if(vd===null){var d=new Map,g=vd=new Map;g.set(c,d)}else g=vd,d=g.get(c),d||(d=new Map,g.set(c,d));if(d.has(n))return d;for(d.set(n,null),c=c.getElementsByTagName(n),g=0;g<c.length;g++){var v=c[g];if(!(v[ca]||v[Gt]||n==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var k=v.getAttribute(r)||"";k=n+k;var A=d.get(k);A?A.push(v):d.set(k,[v])}}return d}function D1(n,r,c){n=n.ownerDocument||n,n.head.insertBefore(c,r==="title"?n.querySelector("head > title"):null)}function WT(n,r,c){if(c===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(n=r.disabled,typeof r.precedence=="string"&&n==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function O1(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function YT(n,r,c,d){if(c.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var g=Lo(d.href),v=r.querySelector(sc(g));if(v){r=v._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=xd.bind(n),r.then(n,n)),c.state.loading|=4,c.instance=v,Zt(v);return}v=r.ownerDocument||r,d=M1(d),(g=Pn.get(g))&&Zm(d,g),v=v.createElement("link"),Zt(v);var k=v;k._p=new Promise(function(A,B){k.onload=A,k.onerror=B}),As(v,"link",d),c.instance=v}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(c,r),(r=c.state.preload)&&(c.state.loading&3)===0&&(n.count++,c=xd.bind(n),r.addEventListener("load",c),r.addEventListener("error",c))}}var Jm=0;function XT(n,r){return n.stylesheets&&n.count===0&&yd(n,n.stylesheets),0<n.count||0<n.imgCount?function(c){var d=setTimeout(function(){if(n.stylesheets&&yd(n,n.stylesheets),n.unsuspend){var v=n.unsuspend;n.unsuspend=null,v()}},6e4+r);0<n.imgBytes&&Jm===0&&(Jm=62500*MT());var g=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&yd(n,n.stylesheets),n.unsuspend)){var v=n.unsuspend;n.unsuspend=null,v()}},(n.imgBytes>Jm?50:800)+r);return n.unsuspend=c,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(g)}}:null}function xd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)yd(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var _d=null;function yd(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,_d=new Map,r.forEach(ZT,n),_d=null,xd.call(n))}function ZT(n,r){if(!(r.state.loading&4)){var c=_d.get(n);if(c)var d=c.get(null);else{c=new Map,_d.set(n,c);for(var g=n.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<g.length;v++){var k=g[v];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(c.set(k.dataset.precedence,k),d=k)}d&&c.set(null,d)}g=r.instance,k=g.getAttribute("data-precedence"),v=c.get(k)||d,v===d&&c.set(null,g),c.set(k,g),this.count++,d=xd.bind(this),g.addEventListener("load",d),g.addEventListener("error",d),v?v.parentNode.insertBefore(g,v.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(g,n.firstChild)),r.state.loading|=4}}var ic={$$typeof:N,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function QT(n,r,c,d,g,v,k,A,B){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nt(0),this.hiddenUpdates=Nt(null),this.identifierPrefix=d,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function L1(n,r,c,d,g,v,k,A,B,ee,ie,ce){return n=new QT(n,r,c,k,B,ee,ie,ce,A),r=1,v===!0&&(r|=24),v=_n(3,null,null,r),n.current=v,v.stateNode=n,r=Rf(),r.refCount++,n.pooledCache=r,r.refCount++,v.memoizedState={element:d,isDehydrated:c,cache:r},Bf(v),n}function B1(n){return n?(n=fo,n):fo}function z1(n,r,c,d,g,v){g=B1(g),d.context===null?d.context=g:d.pendingContext=g,d=Nr(r),d.payload={element:c},v=v===void 0?null:v,v!==null&&(d.callback=v),c=Tr(n,d,r),c!==null&&(un(c,n,r),Bl(c,n,r))}function I1(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var c=n.retryLane;n.retryLane=c!==0&&c<r?c:r}}function ep(n,r){I1(n,r),(n=n.alternate)&&I1(n,r)}function P1(n){if(n.tag===13||n.tag===31){var r=pa(n,67108864);r!==null&&un(r,n,67108864),ep(n,67108864)}}function $1(n){if(n.tag===13||n.tag===31){var r=Cn();r=Rt(r);var c=pa(n,r);c!==null&&un(c,n,r),ep(n,r)}}var Sd=!0;function JT(n,r,c,d){var g=O.T;O.T=null;var v=X.p;try{X.p=2,tp(n,r,c,d)}finally{X.p=v,O.T=g}}function eA(n,r,c,d){var g=O.T;O.T=null;var v=X.p;try{X.p=8,tp(n,r,c,d)}finally{X.p=v,O.T=g}}function tp(n,r,c,d){if(Sd){var g=sp(d);if(g===null)Hm(n,r,d,wd,c),U1(n,d);else if(sA(g,n,r,c,d))d.stopPropagation();else if(U1(n,d),r&4&&-1<tA.indexOf(n)){for(;g!==null;){var v=$i(g);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var k=zs(v.pendingLanes);if(k!==0){var A=v;for(A.pendingLanes|=2,A.entangledLanes|=2;k;){var B=1<<31-ks(k);A.entanglements[1]|=B,k&=~B}pi(v),(ht&6)===0&&(rd=Bt()+500,Ql(0))}}break;case 31:case 13:A=pa(v,2),A!==null&&un(A,v,2),od(),ep(v,2)}if(v=sp(d),v===null&&Hm(n,r,d,wd,c),v===g)break;g=v}g!==null&&d.stopPropagation()}else Hm(n,r,d,null,c)}}function sp(n){return n=Ve(n),np(n)}var wd=null;function np(n){if(wd=null,n=Ks(n),n!==null){var r=o(n);if(r===null)n=null;else{var c=r.tag;if(c===13){if(n=u(r),n!==null)return n;n=null}else if(c===31){if(n=h(r),n!==null)return n;n=null}else if(c===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return wd=n,null}function H1(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Li()){case ws:return 2;case Bi:return 8;case zi:case Qa:return 32;case pr:return 268435456;default:return 32}default:return 32}}var ip=!1,Pr=null,$r=null,Hr=null,rc=new Map,ac=new Map,Ur=[],tA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function U1(n,r){switch(n){case"focusin":case"focusout":Pr=null;break;case"dragenter":case"dragleave":$r=null;break;case"mouseover":case"mouseout":Hr=null;break;case"pointerover":case"pointerout":rc.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":ac.delete(r.pointerId)}}function oc(n,r,c,d,g,v){return n===null||n.nativeEvent!==v?(n={blockedOn:r,domEventName:c,eventSystemFlags:d,nativeEvent:v,targetContainers:[g]},r!==null&&(r=$i(r),r!==null&&P1(r)),n):(n.eventSystemFlags|=d,r=n.targetContainers,g!==null&&r.indexOf(g)===-1&&r.push(g),n)}function sA(n,r,c,d,g){switch(r){case"focusin":return Pr=oc(Pr,n,r,c,d,g),!0;case"dragenter":return $r=oc($r,n,r,c,d,g),!0;case"mouseover":return Hr=oc(Hr,n,r,c,d,g),!0;case"pointerover":var v=g.pointerId;return rc.set(v,oc(rc.get(v)||null,n,r,c,d,g)),!0;case"gotpointercapture":return v=g.pointerId,ac.set(v,oc(ac.get(v)||null,n,r,c,d,g)),!0}return!1}function F1(n){var r=Ks(n.target);if(r!==null){var c=o(r);if(c!==null){if(r=c.tag,r===13){if(r=u(c),r!==null){n.blockedOn=r,so(n.priority,function(){$1(c)});return}}else if(r===31){if(r=h(c),r!==null){n.blockedOn=r,so(n.priority,function(){$1(c)});return}}else if(r===3&&c.stateNode.current.memoizedState.isDehydrated){n.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}n.blockedOn=null}function kd(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var c=sp(n.nativeEvent);if(c===null){c=n.nativeEvent;var d=new c.constructor(c.type,c);Me=d,c.target.dispatchEvent(d),Me=null}else return r=$i(c),r!==null&&P1(r),n.blockedOn=c,!1;r.shift()}return!0}function V1(n,r,c){kd(n)&&c.delete(r)}function nA(){ip=!1,Pr!==null&&kd(Pr)&&(Pr=null),$r!==null&&kd($r)&&($r=null),Hr!==null&&kd(Hr)&&(Hr=null),rc.forEach(V1),ac.forEach(V1)}function Cd(n,r){n.blockedOn===r&&(n.blockedOn=null,ip||(ip=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,nA)))}var Ed=null;function q1(n){Ed!==n&&(Ed=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ed===n&&(Ed=null);for(var r=0;r<n.length;r+=3){var c=n[r],d=n[r+1],g=n[r+2];if(typeof d!="function"){if(np(d||c)===null)continue;break}var v=$i(c);v!==null&&(n.splice(r,3),r-=3,sm(v,{pending:!0,data:g,method:c.method,action:d},d,g))}}))}function zo(n){function r(B){return Cd(B,n)}Pr!==null&&Cd(Pr,n),$r!==null&&Cd($r,n),Hr!==null&&Cd(Hr,n),rc.forEach(r),ac.forEach(r);for(var c=0;c<Ur.length;c++){var d=Ur[c];d.blockedOn===n&&(d.blockedOn=null)}for(;0<Ur.length&&(c=Ur[0],c.blockedOn===null);)F1(c),c.blockedOn===null&&Ur.shift();if(c=(n.ownerDocument||n).$$reactFormReplay,c!=null)for(d=0;d<c.length;d+=3){var g=c[d],v=c[d+1],k=g[Is]||null;if(typeof v=="function")k||q1(c);else if(k){var A=null;if(v&&v.hasAttribute("formAction")){if(g=v,k=v[Is]||null)A=k.formAction;else if(np(g)!==null)continue}else A=k.action;typeof A=="function"?c[d+1]=A:(c.splice(d,3),d-=3),q1(c)}}}function G1(){function n(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(k){return g=k})},focusReset:"manual",scroll:"manual"})}function r(){g!==null&&(g(),g=null),d||setTimeout(c,20)}function c(){if(!d&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,g=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(c,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),g!==null&&(g(),g=null)}}}function rp(n){this._internalRoot=n}Nd.prototype.render=rp.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(i(409));var c=r.current,d=Cn();z1(c,d,n,r,null,null)},Nd.prototype.unmount=rp.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;z1(n.current,2,null,n,null,null),od(),r[gr]=null}};function Nd(n){this._internalRoot=n}Nd.prototype.unstable_scheduleHydration=function(n){if(n){var r=to();n={blockedOn:null,target:n,priority:r};for(var c=0;c<Ur.length&&r!==0&&r<Ur[c].priority;c++);Ur.splice(c,0,n),c===0&&F1(n)}};var K1=t.version;if(K1!=="19.2.6")throw Error(i(527,K1,"19.2.6"));X.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(i(188)):(n=Object.keys(n).join(","),Error(i(268,n)));return n=f(r),n=n!==null?p(n):null,n=n===null?null:n.stateNode,n};var iA={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Td=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Td.isDisabled&&Td.supportsFiber)try{Ii=Td.inject(iA),gs=Td}catch{}}return cc.createRoot=function(n,r){if(!a(n))throw Error(i(299));var c=!1,d="",g=e_,v=t_,k=s_;return r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(g=r.onUncaughtError),r.onCaughtError!==void 0&&(v=r.onCaughtError),r.onRecoverableError!==void 0&&(k=r.onRecoverableError)),r=L1(n,1,!1,null,null,c,d,null,g,v,k,G1),n[gr]=r.current,$m(n),new rp(r)},cc.hydrateRoot=function(n,r,c){if(!a(n))throw Error(i(299));var d=!1,g="",v=e_,k=t_,A=s_,B=null;return c!=null&&(c.unstable_strictMode===!0&&(d=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(v=c.onUncaughtError),c.onCaughtError!==void 0&&(k=c.onCaughtError),c.onRecoverableError!==void 0&&(A=c.onRecoverableError),c.formState!==void 0&&(B=c.formState)),r=L1(n,1,!0,r,c??null,d,g,B,v,k,A,G1),r.context=B1(null),c=r.current,d=Cn(),d=Rt(d),g=Nr(d),g.callback=null,Tr(c,g,d),c=d,r.current.lanes=c,wt(r,c),pi(r),n[gr]=r.current,$m(n),new Nd(r)},cc.version="19.2.6",cc}var ny;function mA(){if(ny)return lp.exports;ny=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),lp.exports=fA(),lp.exports}var vk=mA();const xk=(...e)=>e.filter((t,s,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===s).join(" ").trim();const pA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const gA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,i)=>i?i.toUpperCase():s.toLowerCase());const iy=e=>{const t=gA(e);return t.charAt(0).toUpperCase()+t.slice(1)};var hp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const bA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},vA=w.createContext({}),xA=()=>w.useContext(vA),_A=w.forwardRef(({color:e,size:t,strokeWidth:s,absoluteStrokeWidth:i,className:a="",children:o,iconNode:u,...h},m)=>{const{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:b=!1,color:x="currentColor",className:_=""}=xA()??{},y=i??b?Number(s??p)*24/Number(t??f):s??p;return w.createElement("svg",{ref:m,...hp,width:t??f??hp.width,height:t??f??hp.height,stroke:e??x,strokeWidth:y,className:xk("lucide",_,a),...!o&&!bA(h)&&{"aria-hidden":"true"},...h},[...u.map(([S,C])=>w.createElement(S,C)),...Array.isArray(o)?o:[o]])});const pe=(e,t)=>{const s=w.forwardRef(({className:i,...a},o)=>w.createElement(_A,{ref:o,iconNode:t,className:xk(`lucide-${pA(iy(e))}`,`lucide-${e}`,i),...a}));return s.displayName=iy(e),s};const yA=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Pa=pe("activity",yA);const SA=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],wA=pe("arrow-down",SA);const kA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],_k=pe("arrow-left",kA);const CA=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],yk=pe("arrow-up",CA);const EA=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],NA=pe("blocks",EA);const TA=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],AA=pe("book-open",TA);const MA=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],jA=pe("bot",MA);const RA=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Sk=pe("box",RA);const DA=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],OA=pe("braces",DA);const LA=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],wk=pe("brain",LA);const BA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],il=pe("check",BA);const zA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Yn=pe("chevron-down",zA);const IA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],PA=pe("chevron-left",IA);const $A=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ia=pe("chevron-right",$A);const HA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Uh=pe("chevron-up",HA);const UA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],kk=pe("circle-check-big",UA);const FA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],VA=pe("circle-dot",FA);const qA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],GA=pe("circle-x",qA);const KA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ry=pe("circle",KA);const WA=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Ck=pe("code-xml",WA);const YA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],zg=pe("copy",YA);const XA=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],ZA=pe("corner-down-left",XA);const QA=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],JA=pe("corner-down-right",QA);const e4=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],t4=pe("cpu",e4);const s4=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],ui=pe("database",s4);const n4=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Ek=pe("download",n4);const i4=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],r4=pe("earth",i4);const a4=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Nk=pe("ellipsis",a4);const o4=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Jc=pe("external-link",o4);const l4=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Tk=pe("eye-off",l4);const c4=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],rb=pe("eye",c4);const u4=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],Ak=pe("file-code-corner",u4);const d4=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Mk=pe("file-exclamation-point",d4);const h4=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],f4=pe("file-spreadsheet",h4);const m4=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],jk=pe("file-text",m4);const p4=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Rk=pe("file",p4);const g4=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],b4=pe("flask-conical",g4);const v4=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],x4=pe("folder-git-2",v4);const _4=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Fh=pe("folder-open",_4);const y4=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],S4=pe("folder-plus",y4);const w4=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ka=pe("folder",w4);const k4=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],C4=pe("funnel",k4);const E4=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Dk=pe("gauge",E4);const N4=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Wn=pe("git-branch",N4);const T4=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]],ay=pe("git-fork",T4);const A4=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],M4=pe("git-merge",A4);const j4=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 9v12",key:"1sc30k"}],["path",{d:"m21 3-6 6",key:"16nqsk"}],["path",{d:"m21 9-6-6",key:"9j17rh"}],["path",{d:"M18 11.5V15",key:"65xf6f"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]],R4=pe("git-pull-request-closed",j4);const D4=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 9v12",key:"1sc30k"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v3",key:"1jb6z3"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]],O4=pe("git-pull-request-create",D4);const L4=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],B4=pe("git-pull-request",L4);const z4=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],I4=pe("heart",z4);const P4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],$4=pe("image",P4);const H4=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],uh=pe("inbox",H4);const U4=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Ok=pe("key-round",U4);const F4=[["path",{d:"M10 5h11",key:"1hkqpe"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 19h11",key:"14g2nv"}],["path",{d:"m3 10 3-3-3-3",key:"i7pm08"}],["path",{d:"m3 20 3-3-3-3",key:"20gx1n"}]],V4=pe("list-collapse",F4);const q4=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],G4=pe("list-tree",q4);const K4=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Os=pe("loader-circle",K4);const W4=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],oy=pe("loader",W4);const Y4=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],X4=pe("lock-keyhole",Y4);const Z4=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Lk=pe("maximize-2",Z4);const Q4=[["path",{d:"M12 12v-2",key:"fwoke6"}],["path",{d:"M12 18v-2",key:"qj6yno"}],["path",{d:"M16 12v-2",key:"heuere"}],["path",{d:"M16 18v-2",key:"s1ct0w"}],["path",{d:"M2 11h1.5",key:"15p63e"}],["path",{d:"M20 18v-2",key:"12ehxp"}],["path",{d:"M20.5 11H22",key:"khsy7a"}],["path",{d:"M4 18v-2",key:"1c3oqr"}],["path",{d:"M8 12v-2",key:"1mwtfd"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["rect",{x:"2",y:"6",width:"20",height:"10",rx:"2",key:"1qcswk"}]],J4=pe("memory-stick",Q4);const eM=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],tM=pe("message-circle-warning",eM);const sM=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],Bk=pe("minimize-2",sM);const nM=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],iM=pe("moon",nM);const rM=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],aM=pe("network",rM);const oM=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],lM=pe("palette",oM);const cM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],uM=pe("panel-left-close",cM);const dM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],hM=pe("panel-left-open",dM);const fM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],mM=pe("panel-left",fM);const pM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],gM=pe("panel-top",pM);const bM=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],vM=pe("paperclip",bM);const xM=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Pc=pe("pencil",xM);const _M=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Vh=pe("play",_M);const yM=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],zk=pe("plug",yM);const SM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],mn=pe("plus",SM);const wM=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],kM=pe("radio",wM);const CM=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],eu=pe("refresh-cw",CM);const EM=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],ab=pe("rotate-ccw",EM);const NM=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Ik=pe("save",NM);const TM=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Pk=pe("scroll-text",TM);const AM=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],MM=pe("search",AM);const jM=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],RM=pe("send-horizontal",jM);const DM=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],$k=pe("server",DM);const OM=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],LM=pe("settings-2",OM);const BM=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],zM=pe("shield-alert",BM);const IM=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Wa=pe("sparkles",IM);const PM=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],$M=pe("square-terminal",PM);const HM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],qh=pe("square",HM);const UM=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],FM=pe("sun",UM);const VM=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],qM=pe("table-2",VM);const GM=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Hk=pe("terminal",GM);const KM=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],rl=pe("trash-2",KM);const WM=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],YM=pe("triangle-alert",WM);const XM=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],ZM=pe("wand-sparkles",XM);const QM=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],JM=pe("wrench",QM);const ej=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Js=pe("x",ej);const tj=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],sj=pe("zap",tj);class Uk extends Error{conflict;constructor(t,s){super(t),this.name="PortConflictResponseError",this.conflict=s}}async function Le(e,t){const s=await fetch(e,t),i=await s.json().catch(()=>{});if(!s.ok)throw s.status===409&&i?.conflict?.code==="PORT_IN_USE"?new Uk(i?.error||"Port already in use",i.conflict):new Error(i?.error||s.statusText);return i}async function pn(e,t){const s=new URLSearchParams;for(const[i,a]of Object.entries(t))a!==void 0&&String(a).trim()&&s.set(i,String(a));await Le(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:s})}async function tu(e,t){const s=new URLSearchParams;for(const[i,a]of Object.entries(t))a!==void 0&&String(a).trim()&&s.set(i,String(a));return Le(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:s})}async function nj(){return(await Le("/api/agent")).agent}async function ij(e){return(await Le(`/api/agent/mcp-status?agent=${encodeURIComponent(e)}`)).statuses}async function rj(){return(await Le("/api/agent/usage")).usage}async function aj(){return(await Le("/api/agent/claude-settings")).settings}async function oj(e){return(await Le("/api/agent/claude-settings",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})).settings}async function lj(){const e=await Le("/api/agent/chat/status");return{configured:e.configured,approvals:e.approvals,provider:e.provider}}async function cj(e,t,s){await Le("/api/agent/chat/approve",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:e,requestId:t,decision:s})})}async function uj(e,t,s,i){const a=await fetch("/api/agent/chat",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({message:e,resumeSessionId:t}),signal:i});if(!a.ok||!a.body){const m=await a.json().catch(()=>{});throw new Error(m?.error||a.statusText||"Agent request failed")}const o=a.body.getReader(),u=new TextDecoder;let h="";for(;;){const{done:m,value:f}=await o.read();if(m)break;h+=u.decode(f,{stream:!0});let p=h.indexOf(`
|
|
10
|
-
|
|
11
|
-
`);for(;p!==-1;){const b=h.slice(0,p);h=h.slice(p+2);const x=b.split(`
|
|
12
|
-
`).find(_=>_.startsWith("data:"));if(x){const _=x.slice(5).trim();if(_)try{s(JSON.parse(_))}catch{}}p=h.indexOf(`
|
|
13
|
-
|
|
14
|
-
`)}}}async function Fk(){return(await Le("/api/databases")).connections}async function dj(){return(await Le("/api/databases/detect")).detected}async function hj(e){await tu("/api/databases",e)}async function fj(e){return tu("/api/databases/test",e)}async function mj(e){await Le(`/api/databases/${encodeURIComponent(e)}`,{method:"DELETE"})}async function pj(e){return(await Le(`/api/databases/${encodeURIComponent(e)}/tables`)).tables}async function gj(e,t,s=100,i=0){return Le(`/api/databases/${encodeURIComponent(e)}/rows?table=${encodeURIComponent(t)}&limit=${s}&offset=${i}`)}async function Vk(e=100){return(await Le(`/api/errors?limit=${e}`)).incidents}async function bj(e){return Le(`/api/errors/${e}/prompt`)}async function vj(e=200){return(await Le(`/api/git/graph?limit=${e}`)).commits}async function xj(e,t){const s=new URLSearchParams({hash:e});t&&s.set("file",t);const i=await fetch(`/api/git/commit?${s.toString()}`);if(!i.ok){const a=await i.json().catch(()=>({error:i.statusText}));throw new Error(a.error||"Unable to load commit diff")}return i.text()}async function _j(e){return(await Le(`/api/git/commit/files?hash=${encodeURIComponent(e)}`)).files}async function yj(){return(await Le("/api/git/files")).files}async function Sj(){return(await Le("/api/git/file-sizes")).files}async function wj(e){const t=await Le(`/api/git/file?path=${encodeURIComponent(e)}`);return{content:t.content,truncated:t.truncated,binary:t.binary,size:t.size}}async function kj(e,t){await Le("/api/git/file",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,content:t})})}async function Cj(e){const t=await fetch(`/api/git/diff?file=${encodeURIComponent(e)}`);if(!t.ok){const s=await t.json().catch(()=>({error:t.statusText}));throw new Error(s.error||"Unable to load diff")}return t.text()}async function Ej(e){await Le(`/api/git/repositories/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Nj(){return Le("/api/github/token")}async function Tj(){return await Le("/api/github/oauth/start",{method:"POST"})}async function Aj(e){const t=await Le("/api/github/oauth/poll",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({device_code:e})});return{done:t.done,slowDown:t.slowDown}}async function Mj(e,t){const s=new URLSearchParams({host:e,token:t});await Le("/api/github/token",{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:s})}async function ly(e="open",t=1){return(await Le(`/api/github/prs?state=${e}&page=${t}`)).prs}async function jj(e){return(await Le(`/api/github/prs/${e}`)).pr}async function Rj(e){const t=await fetch(`/api/github/prs/${e}/diff`);if(!t.ok){const s=await t.json().catch(()=>({error:t.statusText}));throw new Error(s.error||"Unable to load PR diff")}return t.text()}async function Dj(e){return(await Le("/api/github/prs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})).pr}async function cy(e="open",t=1){return(await Le(`/api/github/issues?state=${e}&page=${t}`)).issues}async function Oj(e){return(await Le(`/api/github/issues/${e}`)).issue}async function Lj(e){return(await Le(`/api/github/issues/${e}/comments`)).comments}async function Bj(e,t){return(await Le(`/api/github/issues/${e}/comments`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({body:t})})).comment}async function zj(e){return(await Le(`/api/github/ci/${encodeURIComponent(e)}`)).status}async function Ij(e,t=1){const s=new URLSearchParams({page:String(t)});return(await Le(`/api/github/runs?${s}`)).runs}async function Pj(){return(await Le("/api/log-sources")).sources}async function $j(e){return(await tu("/api/log-sources",e)).sources}async function qk(e,t={}){const s=new URLSearchParams;return s.set("lines",String(t.lines??500)),t.since&&s.set("since",t.since),t.until&&s.set("until",t.until),t.grep&&s.set("grep",t.grep),t.level&&s.set("level",t.level),t.cursor&&s.set("cursor",t.cursor),t.before&&s.set("before",t.before),(await Le(`/api/log-sources/${encodeURIComponent(e)}/logs?${s.toString()}`)).logs}const ob={"content-type":"application/json"};async function Hj(e){const t=await Le("/api/onboard/scan",{method:"POST",headers:ob,body:JSON.stringify({url:e})});return{profile:t.profile,proposals:t.proposals,databases:t.databases??[]}}async function Uj(e,t,s){const i=s?{name:s.name,engine:s.engine,url:s.url}:void 0;await Le("/api/onboard/register",{method:"POST",headers:ob,body:JSON.stringify({...e,start:t,database:i})})}async function Fj(e,t){const s=await fetch("/api/onboard/install/stream",{method:"POST",headers:ob,body:JSON.stringify(e)});if(!s.ok||!s.body){const u=await s.json().catch(()=>{});t.onError(u?.error||s.statusText);return}const i=s.body.getReader(),a=new TextDecoder;let o="";for(;;){const{done:u,value:h}=await i.read();if(u)break;o+=a.decode(h,{stream:!0});const m=o.split(`
|
|
15
|
-
|
|
16
|
-
`);o=m.pop()??"";for(const f of m)Vj(f,t)}}function Vj(e,t){let s="message",i="";for(const a of e.split(`
|
|
17
|
-
`))a.startsWith("event:")?s=a.slice(6).trim():a.startsWith("data:")&&(i+=a.slice(5).trim());if(i)try{const a=JSON.parse(i);s==="output"?t.onLine(a):s==="done"?t.onDone(a.exitCode??null):s==="error"&&t.onError(a.error??"Install failed.")}catch{}}async function qj(){return Le("/api/dashboard")}async function Gj(e){await Le(`/api/services/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Kj(e,t,s){t.includes(s)||await pn("/api/bundles",{name:e,originalName:e,services:[...t,s].join(",")})}async function Wj(e,t,s){t.includes(s)&&await pn("/api/bundles",{name:e,originalName:e,services:t.filter(i=>i!==s).join(",")})}async function Gk(e,{files:t=!1}={}){const s=new URLSearchParams({path:e});return t&&s.set("files","1"),Le(`/api/fs/directories?${s.toString()}`)}async function Kk(e,t={}){const s=new URLSearchParams;s.set("lines",String(t.lines??500)),t.since&&s.set("since",t.since),t.until&&s.set("until",t.until),t.grep&&s.set("grep",t.grep),t.level&&s.set("level",t.level),t.cursor&&s.set("cursor",t.cursor),t.before&&s.set("before",t.before);const i=await Le(`/api/services/${encodeURIComponent(e)}/logs?${s.toString()}`);return{logs:i.logs,queryable:!!i.queryable}}async function Yj(e,t){const s=t?`?path=${encodeURIComponent(t)}`:"";return Le(`/api/services/${encodeURIComponent(e)}/config-browse${s}`)}async function Xj(e){const t=await Le(`/api/services/${encodeURIComponent(e)}/config-files`);return{cwd:t.cwd,files:t.files}}async function uy(e,t){return Le(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`)}async function Zj(e,t,s){return Le(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({entries:s})})}async function Qj(e,t,s){return Le(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:s})})}async function Jj(e){return(await Le(`/api/services/${encodeURIComponent(e)}/metrics`)).metrics}async function e6(e){return tu("/api/services/test",e)}async function t6(e,t){return tu(`/api/services/${encodeURIComponent(e)}/test`,t?{pattern:t}:{})}async function s6(){return(await Le("/api/terminal/sessions")).sessions}async function Yd(e){return(await Le("/api/terminal/sessions",{method:"POST",...e?.serviceName?{headers:{"content-type":"application/json"},body:JSON.stringify({serviceName:e.serviceName})}:{}})).session}async function n6(e){await Le(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}function Wk(e){var t,s,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(s=Wk(e[t]))&&(i&&(i+=" "),i+=s)}else for(s in e)e[s]&&(i&&(i+=" "),i+=s);return i}function $c(){for(var e,t,s=0,i="",a=arguments.length;s<a;s++)(e=arguments[s])&&(t=Wk(e))&&(i&&(i+=" "),i+=t);return i}const dy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hy=$c,Yk=(e,t)=>s=>{var i;if(t?.variants==null)return hy(e,s?.class,s?.className);const{variants:a,defaultVariants:o}=t,u=Object.keys(a).map(f=>{const p=s?.[f],b=o?.[f];if(p===null)return null;const x=dy(p)||dy(b);return a[f][x]}),h=s&&Object.entries(s).reduce((f,p)=>{let[b,x]=p;return x===void 0||(f[b]=x),f},{}),m=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((f,p)=>{let{class:b,className:x,..._}=p;return Object.entries(_).every(y=>{let[S,C]=y;return Array.isArray(C)?C.includes({...o,...h}[S]):{...o,...h}[S]===C})?[...f,b,x]:f},[]);return hy(e,u,m,s?.class,s?.className)},i6=(e,t)=>{const s=new Array(e.length+t.length);for(let i=0;i<e.length;i++)s[i]=e[i];for(let i=0;i<t.length;i++)s[e.length+i]=t[i];return s},r6=(e,t)=>({classGroupId:e,validator:t}),Xk=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),dh="-",fy=[],a6="arbitrary..",o6=e=>{const t=c6(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return l6(u);const h=u.split(dh),m=h[0]===""&&h.length>1?1:0;return Zk(h,m,t)},getConflictingClassGroupIds:(u,h)=>{if(h){const m=i[u],f=s[u];return m?f?i6(f,m):m:f||fy}return s[u]||fy}}},Zk=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const a=e[t],o=s.nextPart.get(a);if(o){const f=Zk(e,t+1,o);if(f)return f}const u=s.validators;if(u===null)return;const h=t===0?e.join(dh):e.slice(t).join(dh),m=u.length;for(let f=0;f<m;f++){const p=u[f];if(p.validator(h))return p.classGroupId}},l6=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),i=t.slice(0,s);return i?a6+i:void 0})(),c6=e=>{const{theme:t,classGroups:s}=e;return u6(s,t)},u6=(e,t)=>{const s=Xk();for(const i in e){const a=e[i];lb(a,s,i,t)}return s},lb=(e,t,s,i)=>{const a=e.length;for(let o=0;o<a;o++){const u=e[o];d6(u,t,s,i)}},d6=(e,t,s,i)=>{if(typeof e=="string"){h6(e,t,s);return}if(typeof e=="function"){f6(e,t,s,i);return}m6(e,t,s,i)},h6=(e,t,s)=>{const i=e===""?t:Qk(t,e);i.classGroupId=s},f6=(e,t,s,i)=>{if(p6(e)){lb(e(i),t,s,i);return}t.validators===null&&(t.validators=[]),t.validators.push(r6(s,e))},m6=(e,t,s,i)=>{const a=Object.entries(e),o=a.length;for(let u=0;u<o;u++){const[h,m]=a[u];lb(m,Qk(t,h),s,i)}},Qk=(e,t)=>{let s=e;const i=t.split(dh),a=i.length;for(let o=0;o<a;o++){const u=i[o];let h=s.nextPart.get(u);h||(h=Xk(),s.nextPart.set(u,h)),s=h}return s},p6=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,g6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),i=Object.create(null);const a=(o,u)=>{s[o]=u,t++,t>e&&(t=0,i=s,s=Object.create(null))};return{get(o){let u=s[o];if(u!==void 0)return u;if((u=i[o])!==void 0)return a(o,u),u},set(o,u){o in s?s[o]=u:a(o,u)}}},Ig="!",my=":",b6=[],py=(e,t,s,i,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:i,isExternal:a}),v6=e=>{const{prefix:t,experimentalParseClassName:s}=e;let i=a=>{const o=[];let u=0,h=0,m=0,f;const p=a.length;for(let S=0;S<p;S++){const C=a[S];if(u===0&&h===0){if(C===my){o.push(a.slice(m,S)),m=S+1;continue}if(C==="/"){f=S;continue}}C==="["?u++:C==="]"?u--:C==="("?h++:C===")"&&h--}const b=o.length===0?a:a.slice(m);let x=b,_=!1;b.endsWith(Ig)?(x=b.slice(0,-1),_=!0):b.startsWith(Ig)&&(x=b.slice(1),_=!0);const y=f&&f>m?f-m:void 0;return py(o,_,x,y)};if(t){const a=t+my,o=i;i=u=>u.startsWith(a)?o(u.slice(a.length)):py(b6,!1,u,void 0,!0)}if(s){const a=i;i=o=>s({className:o,parseClassName:a})}return i},x6=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,i)=>{t.set(s,1e6+i)}),s=>{const i=[];let a=[];for(let o=0;o<s.length;o++){const u=s[o],h=u[0]==="[",m=t.has(u);h||m?(a.length>0&&(a.sort(),i.push(...a),a=[]),i.push(u)):a.push(u)}return a.length>0&&(a.sort(),i.push(...a)),i}},_6=e=>({cache:g6(e.cacheSize),parseClassName:v6(e),sortModifiers:x6(e),postfixLookupClassGroupIds:y6(e),...o6(e)}),y6=e=>{const t=Object.create(null),s=e.postfixLookupClassGroups;if(s)for(let i=0;i<s.length;i++)t[s[i]]=!0;return t},S6=/\s+/,w6=(e,t)=>{const{parseClassName:s,getClassGroupId:i,getConflictingClassGroupIds:a,sortModifiers:o,postfixLookupClassGroupIds:u}=t,h=[],m=e.trim().split(S6);let f="";for(let p=m.length-1;p>=0;p-=1){const b=m[p],{isExternal:x,modifiers:_,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:C}=s(b);if(x){f=b+(f.length>0?" "+f:f);continue}let E=!!C,T;if(E){const L=S.substring(0,C);T=i(L);const j=T&&u[T]?i(S):void 0;j&&j!==T&&(T=j,E=!1)}else T=i(S);if(!T){if(!E){f=b+(f.length>0?" "+f:f);continue}if(T=i(S),!T){f=b+(f.length>0?" "+f:f);continue}E=!1}const N=_.length===0?"":_.length===1?_[0]:o(_).join(":"),M=y?N+Ig:N,R=M+T;if(h.indexOf(R)>-1)continue;h.push(R);const z=a(T,E);for(let L=0;L<z.length;++L){const j=z[L];h.push(M+j)}f=b+(f.length>0?" "+f:f)}return f},k6=(...e)=>{let t=0,s,i,a="";for(;t<e.length;)(s=e[t++])&&(i=Jk(s))&&(a&&(a+=" "),a+=i);return a},Jk=e=>{if(typeof e=="string")return e;let t,s="";for(let i=0;i<e.length;i++)e[i]&&(t=Jk(e[i]))&&(s&&(s+=" "),s+=t);return s},C6=(e,...t)=>{let s,i,a,o;const u=m=>{const f=t.reduce((p,b)=>b(p),e());return s=_6(f),i=s.cache.get,a=s.cache.set,o=h,h(m)},h=m=>{const f=i(m);if(f)return f;const p=w6(m,s);return a(m,p),p};return o=u,(...m)=>o(k6(...m))},E6=[],us=e=>{const t=s=>s[e]||E6;return t.isThemeGetter=!0,t},eC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,N6=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,T6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,A6=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,M6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,j6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,R6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vr=e=>N6.test(e),We=e=>!!e&&!Number.isNaN(Number(e)),gi=e=>!!e&&Number.isInteger(Number(e)),fp=e=>e.endsWith("%")&&We(e.slice(0,-1)),rr=e=>T6.test(e),sC=()=>!0,D6=e=>A6.test(e)&&!M6.test(e),cb=()=>!1,O6=e=>j6.test(e),L6=e=>R6.test(e),B6=e=>!Ce(e)&&!Ee(e),z6=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),I6=e=>ra(e,rC,cb),Ce=e=>eC.test(e),Ta=e=>ra(e,aC,D6),gy=e=>ra(e,G6,We),P6=e=>ra(e,lC,sC),$6=e=>ra(e,oC,cb),by=e=>ra(e,nC,cb),H6=e=>ra(e,iC,L6),Ad=e=>ra(e,cC,O6),Ee=e=>tC.test(e),uc=e=>Ya(e,aC),U6=e=>Ya(e,oC),vy=e=>Ya(e,nC),F6=e=>Ya(e,rC),V6=e=>Ya(e,iC),Md=e=>Ya(e,cC,!0),q6=e=>Ya(e,lC,!0),ra=(e,t,s)=>{const i=eC.exec(e);return i?i[1]?t(i[1]):s(i[2]):!1},Ya=(e,t,s=!1)=>{const i=tC.exec(e);return i?i[1]?t(i[1]):s:!1},nC=e=>e==="position"||e==="percentage",iC=e=>e==="image"||e==="url",rC=e=>e==="length"||e==="size"||e==="bg-size",aC=e=>e==="length",G6=e=>e==="number",oC=e=>e==="family-name",lC=e=>e==="number"||e==="weight",cC=e=>e==="shadow",K6=()=>{const e=us("color"),t=us("font"),s=us("text"),i=us("font-weight"),a=us("tracking"),o=us("leading"),u=us("breakpoint"),h=us("container"),m=us("spacing"),f=us("radius"),p=us("shadow"),b=us("inset-shadow"),x=us("text-shadow"),_=us("drop-shadow"),y=us("blur"),S=us("perspective"),C=us("aspect"),E=us("ease"),T=us("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...M(),Ee,Ce],z=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],j=()=>[Ee,Ce,m],H=()=>[Vr,"full","auto",...j()],P=()=>[gi,"none","subgrid",Ee,Ce],F=()=>["auto",{span:["full",gi,Ee,Ce]},gi,Ee,Ce],K=()=>[gi,"auto",Ee,Ce],Y=()=>["auto","min","max","fr",Ee,Ce],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...j()],X=()=>[Vr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],Z=()=>[Vr,"screen","full","dvw","lvw","svw","min","max","fit",...j()],V=()=>[Vr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],$=()=>[e,Ee,Ce],D=()=>[...M(),vy,by,{position:[Ee,Ce]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],he=()=>["auto","cover","contain",F6,I6,{size:[Ee,Ce]}],le=()=>[fp,uc,Ta],me=()=>["","none","full",f,Ee,Ce],ne=()=>["",We,uc,Ta],fe=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[We,fp,vy,by],Ze=()=>["","none",y,Ee,Ce],lt=()=>["none",We,Ee,Ce],ct=()=>["none",We,Ee,Ce],ze=()=>[We,Ee,Ce],Lt=()=>[Vr,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rr],breakpoint:[rr],color:[sC],container:[rr],"drop-shadow":[rr],ease:["in","out","in-out"],font:[B6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rr],shadow:[rr],spacing:["px",We],text:[rr],"text-shadow":[rr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vr,Ce,Ee,C]}],container:["container"],"container-type":[{"@container":["","normal","size",Ee,Ce]}],"container-named":[z6],columns:[{columns:[We,Ce,Ee,h]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{"inset-s":H(),start:H()}],end:[{"inset-e":H(),end:H()}],"inset-bs":[{"inset-bs":H()}],"inset-be":[{"inset-be":H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[gi,"auto",Ee,Ce]}],basis:[{basis:[Vr,"full","auto",h,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[We,Vr,"auto","initial","none",Ce]}],grow:[{grow:["",We,Ee,Ce]}],shrink:[{shrink:["",We,Ee,Ce]}],order:[{order:[gi,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...Q(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...Q()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":Q()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[h,"screen",...X()]}],"min-w":[{"min-w":[h,"screen","none",...X()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[u]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",s,uc,Ta]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,q6,P6]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",fp,Ce]}],"font-family":[{font:[U6,$6,t]}],"font-features":[{"font-features":[Ce]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Ee,Ce]}],"line-clamp":[{"line-clamp":[We,"none",Ee,gy]}],leading:[{leading:[o,...j()]}],"list-image":[{"list-image":["none",Ee,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[We,"from-font","auto",Ee,Ta]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[We,"auto",Ee,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[gi,Ee,Ce]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:he()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gi,Ee,Ce],radial:["",Ee,Ce],conic:[gi,Ee,Ce]},V6,H6]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:me()}],"rounded-s":[{"rounded-s":me()}],"rounded-e":[{"rounded-e":me()}],"rounded-t":[{"rounded-t":me()}],"rounded-r":[{"rounded-r":me()}],"rounded-b":[{"rounded-b":me()}],"rounded-l":[{"rounded-l":me()}],"rounded-ss":[{"rounded-ss":me()}],"rounded-se":[{"rounded-se":me()}],"rounded-ee":[{"rounded-ee":me()}],"rounded-es":[{"rounded-es":me()}],"rounded-tl":[{"rounded-tl":me()}],"rounded-tr":[{"rounded-tr":me()}],"rounded-br":[{"rounded-br":me()}],"rounded-bl":[{"rounded-bl":me()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-bs":[{"border-bs":$()}],"border-color-be":[{"border-be":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[We,Ee,Ce]}],"outline-w":[{outline:["",We,uc,Ta]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",p,Md,Ad]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",b,Md,Ad]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[We,Ta]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",x,Md,Ad]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[We,Ee,Ce]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[We]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Ee,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[We]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:he()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:Ze()}],brightness:[{brightness:[We,Ee,Ce]}],contrast:[{contrast:[We,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",_,Md,Ad]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",We,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[We,Ee,Ce]}],invert:[{invert:["",We,Ee,Ce]}],saturate:[{saturate:[We,Ee,Ce]}],sepia:[{sepia:["",We,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":Ze()}],"backdrop-brightness":[{"backdrop-brightness":[We,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[We,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",We,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[We,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",We,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[We,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[We,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",We,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[We,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",E,Ee,Ce]}],delay:[{delay:[We,Ee,Ce]}],animate:[{animate:["none",T,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ee,Ce]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:lt()}],"rotate-x":[{"rotate-x":lt()}],"rotate-y":[{"rotate-y":lt()}],"rotate-z":[{"rotate-z":lt()}],scale:[{scale:ct()}],"scale-x":[{"scale-x":ct()}],"scale-y":[{"scale-y":ct()}],"scale-z":[{"scale-z":ct()}],"scale-3d":["scale-3d"],skew:[{skew:ze()}],"skew-x":[{"skew-x":ze()}],"skew-y":[{"skew-y":ze()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Lt()}],"translate-x":[{"translate-x":Lt()}],"translate-y":[{"translate-y":Lt()}],"translate-z":[{"translate-z":Lt()}],"translate-none":["translate-none"],zoom:[{zoom:[gi,Ee,Ce]}],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":$()}],"scrollbar-track-color":[{"scrollbar-track":$()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee,Ce]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[We,uc,Ta,gy]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},W6=C6(K6);function de(...e){return W6($c(e))}const Y6=Yk("inline-flex h-9 shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md border border-transparent px-3 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",outline:"border-border bg-background hover:bg-muted",ghost:"hover:bg-muted",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90"},size:{default:"h-9 px-3",sm:"h-8 px-2.5 text-xs",icon:"size-9 p-0"}},defaultVariants:{variant:"default",size:"default"}});function re({className:e,variant:t,size:s,...i}){return l.jsx("button",{className:de(Y6({variant:t,size:s,className:e})),...i})}const uC=w.createContext({});function X6(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Z6=typeof window<"u",Q6=Z6?w.useLayoutEffect:w.useEffect,ub=w.createContext(null);function db(e,t){e.indexOf(t)===-1&&e.push(t)}function hh(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}const Ni=(e,t,s)=>s>t?t:s<e?e:s;let hb=()=>{};const ta={},dC=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function hC(e){return typeof e=="object"&&e!==null}const fC=e=>/^0[^.\s]+$/u.test(e);function mC(e){let t;return()=>(t===void 0&&(t=e()),t)}const Gn=e=>e,J6=(e,t)=>s=>t(e(s)),su=(...e)=>e.reduce(J6),Hc=(e,t,s)=>{const i=t-e;return i===0?1:(s-e)/i};class fb{constructor(){this.subscriptions=[]}add(t){return db(this.subscriptions,t),()=>hh(this.subscriptions,t)}notify(t,s,i){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,s,i);else for(let o=0;o<a;o++){const u=this.subscriptions[o];u&&u(t,s,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const An=e=>e*1e3,qn=e=>e/1e3;function pC(e,t){return t?e*(1e3/t):0}const gC=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,eR=1e-7,tR=12;function sR(e,t,s,i,a){let o,u,h=0;do u=t+(s-t)/2,o=gC(u,i,a)-e,o>0?s=u:t=u;while(Math.abs(o)>eR&&++h<tR);return u}function nu(e,t,s,i){if(e===t&&s===i)return Gn;const a=o=>sR(o,0,1,e,s);return o=>o===0||o===1?o:gC(a(o),t,i)}const bC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,vC=e=>t=>1-e(1-t),xC=nu(.33,1.53,.69,.99),mb=vC(xC),_C=bC(mb),yC=e=>e>=1?1:(e*=2)<1?.5*mb(e):.5*(2-Math.pow(2,-10*(e-1))),pb=e=>1-Math.sin(Math.acos(e)),SC=vC(pb),wC=bC(pb),nR=nu(.42,0,1,1),iR=nu(0,0,.58,1),kC=nu(.42,0,.58,1),rR=e=>Array.isArray(e)&&typeof e[0]!="number",CC=e=>Array.isArray(e)&&typeof e[0]=="number",aR={linear:Gn,easeIn:nR,easeInOut:kC,easeOut:iR,circIn:pb,circInOut:wC,circOut:SC,backIn:mb,backInOut:_C,backOut:xC,anticipate:yC},oR=e=>typeof e=="string",xy=e=>{if(CC(e)){hb(e.length===4);const[t,s,i,a]=e;return nu(t,s,i,a)}else if(oR(e))return aR[e];return e},jd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function lR(e,t){let s=new Set,i=new Set,a=!1,o=!1;const u=new WeakSet;let h={delta:0,timestamp:0,isProcessing:!1};function m(p){u.has(p)&&(f.schedule(p),e()),p(h)}const f={schedule:(p,b=!1,x=!1)=>{const y=x&&a?s:i;return b&&u.add(p),y.add(p),p},cancel:p=>{i.delete(p),u.delete(p)},process:p=>{if(h=p,a){o=!0;return}a=!0;const b=s;s=i,i=b,s.forEach(m),s.clear(),a=!1,o&&(o=!1,f.process(p))}};return f}const cR=40;function EC(e,t){let s=!1,i=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>s=!0,u=jd.reduce((N,M)=>(N[M]=lR(o),N),{}),{setup:h,read:m,resolveKeyframes:f,preUpdate:p,update:b,preRender:x,render:_,postRender:y}=u,S=()=>{const N=ta.useManualTiming,M=N?a.timestamp:performance.now();s=!1,N||(a.delta=i?1e3/60:Math.max(Math.min(M-a.timestamp,cR),1)),a.timestamp=M,a.isProcessing=!0,h.process(a),m.process(a),f.process(a),p.process(a),b.process(a),x.process(a),_.process(a),y.process(a),a.isProcessing=!1,s&&t&&(i=!1,e(S))},C=()=>{s=!0,i=!0,a.isProcessing||e(S)};return{schedule:jd.reduce((N,M)=>{const R=u[M];return N[M]=(z,L=!1,j=!1)=>(s||C(),R.schedule(z,L,j)),N},{}),cancel:N=>{for(let M=0;M<jd.length;M++)u[jd[M]].cancel(N)},state:a,steps:u}}const{schedule:Ct,cancel:sa,state:Ms,steps:mp}=EC(typeof requestAnimationFrame<"u"?requestAnimationFrame:Gn,!0);let Xd;function uR(){Xd=void 0}const Zs={now:()=>(Xd===void 0&&Zs.set(Ms.isProcessing||ta.useManualTiming?Ms.timestamp:performance.now()),Xd),set:e=>{Xd=e,queueMicrotask(uR)}},NC=e=>t=>typeof t=="string"&&t.startsWith(e),TC=NC("--"),dR=NC("var(--"),gb=e=>dR(e)?hR.test(e.split("/*")[0].trim()):!1,hR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _y(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const al={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Uc={...al,transform:e=>Ni(0,1,e)},Rd={...al,default:1},Rc=e=>Math.round(e*1e5)/1e5,bb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function fR(e){return e==null}const mR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vb=(e,t)=>s=>!!(typeof s=="string"&&mR.test(s)&&s.startsWith(e)||t&&!fR(s)&&Object.prototype.hasOwnProperty.call(s,t)),AC=(e,t,s)=>i=>{if(typeof i!="string")return i;const[a,o,u,h]=i.match(bb);return{[e]:parseFloat(a),[t]:parseFloat(o),[s]:parseFloat(u),alpha:h!==void 0?parseFloat(h):1}},pR=e=>Ni(0,255,e),pp={...al,transform:e=>Math.round(pR(e))},Ba={test:vb("rgb","red"),parse:AC("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:i=1})=>"rgba("+pp.transform(e)+", "+pp.transform(t)+", "+pp.transform(s)+", "+Rc(Uc.transform(i))+")"};function gR(e){let t="",s="",i="",a="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),i=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),i=e.substring(3,4),a=e.substring(4,5),t+=t,s+=s,i+=i,a+=a),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(i,16),alpha:a?parseInt(a,16)/255:1}}const Pg={test:vb("#"),parse:gR,transform:Ba.transform},iu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Yr=iu("deg"),ki=iu("%"),Te=iu("px"),bR=iu("vh"),vR=iu("vw"),yy={...ki,parse:e=>ki.parse(e)/100,transform:e=>ki.transform(e*100)},Go={test:vb("hsl","hue"),parse:AC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:i=1})=>"hsla("+Math.round(e)+", "+ki.transform(Rc(t))+", "+ki.transform(Rc(s))+", "+Rc(Uc.transform(i))+")"},is={test:e=>Ba.test(e)||Pg.test(e)||Go.test(e),parse:e=>Ba.test(e)?Ba.parse(e):Go.test(e)?Go.parse(e):Pg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ba.transform(e):Go.transform(e),getAnimatableNone:e=>{const t=is.parse(e);return t.alpha=0,is.transform(t)}},xR=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function _R(e){return isNaN(e)&&typeof e=="string"&&(e.match(bb)?.length||0)+(e.match(xR)?.length||0)>0}const MC="number",jC="color",yR="var",SR="var(",Sy="${}",wR=/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 Jo(e){const t=e.toString(),s=[],i={color:[],number:[],var:[]},a=[];let o=0;const h=t.replace(wR,m=>(is.test(m)?(i.color.push(o),a.push(jC),s.push(is.parse(m))):m.startsWith(SR)?(i.var.push(o),a.push(yR),s.push(m)):(i.number.push(o),a.push(MC),s.push(parseFloat(m))),++o,Sy)).split(Sy);return{values:s,split:h,indexes:i,types:a}}function kR(e){return Jo(e).values}function RC({split:e,types:t}){const s=e.length;return i=>{let a="";for(let o=0;o<s;o++)if(a+=e[o],i[o]!==void 0){const u=t[o];u===MC?a+=Rc(i[o]):u===jC?a+=is.transform(i[o]):a+=i[o]}return a}}function CR(e){return RC(Jo(e))}const ER=e=>typeof e=="number"?0:is.test(e)?is.getAnimatableNone(e):e,NR=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:ER(e);function TR(e){const t=Jo(e);return RC(t)(t.values.map((i,a)=>NR(i,t.split[a])))}const li={test:_R,parse:kR,createTransformer:CR,getAnimatableNone:TR};function gp(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function AR({hue:e,saturation:t,lightness:s,alpha:i}){e/=360,t/=100,s/=100;let a=0,o=0,u=0;if(!t)a=o=u=s;else{const h=s<.5?s*(1+t):s+t-s*t,m=2*s-h;a=gp(m,h,e+1/3),o=gp(m,h,e),u=gp(m,h,e-1/3)}return{red:Math.round(a*255),green:Math.round(o*255),blue:Math.round(u*255),alpha:i}}function fh(e,t){return s=>s>0?t:e}const jt=(e,t,s)=>e+(t-e)*s,bp=(e,t,s)=>{const i=e*e,a=s*(t*t-i)+i;return a<0?0:Math.sqrt(a)},MR=[Pg,Ba,Go],jR=e=>MR.find(t=>t.test(e));function wy(e){const t=jR(e);if(!t)return!1;let s=t.parse(e);return t===Go&&(s=AR(s)),s}const ky=(e,t)=>{const s=wy(e),i=wy(t);if(!s||!i)return fh(e,t);const a={...s};return o=>(a.red=bp(s.red,i.red,o),a.green=bp(s.green,i.green,o),a.blue=bp(s.blue,i.blue,o),a.alpha=jt(s.alpha,i.alpha,o),Ba.transform(a))},$g=new Set(["none","hidden"]);function RR(e,t){return $g.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function DR(e,t){return s=>jt(e,t,s)}function xb(e){return typeof e=="number"?DR:typeof e=="string"?gb(e)?fh:is.test(e)?ky:BR:Array.isArray(e)?DC:typeof e=="object"?is.test(e)?ky:OR:fh}function DC(e,t){const s=[...e],i=s.length,a=e.map((o,u)=>xb(o)(o,t[u]));return o=>{for(let u=0;u<i;u++)s[u]=a[u](o);return s}}function OR(e,t){const s={...e,...t},i={};for(const a in s)e[a]!==void 0&&t[a]!==void 0&&(i[a]=xb(e[a])(e[a],t[a]));return a=>{for(const o in i)s[o]=i[o](a);return s}}function LR(e,t){const s=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],u=e.indexes[o][i[o]],h=e.values[u]??0;s[a]=h,i[o]++}return s}const BR=(e,t)=>{const s=li.createTransformer(t),i=Jo(e),a=Jo(t);return i.indexes.var.length===a.indexes.var.length&&i.indexes.color.length===a.indexes.color.length&&i.indexes.number.length>=a.indexes.number.length?$g.has(e)&&!a.values.length||$g.has(t)&&!i.values.length?RR(e,t):su(DC(LR(i,a),a.values),s):fh(e,t)};function OC(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?jt(e,t,s):xb(e)(e,t)}const zR=e=>{const t=({timestamp:s})=>e(s);return{start:(s=!0)=>Ct.update(t,s),stop:()=>sa(t),now:()=>Ms.isProcessing?Ms.timestamp:Zs.now()}},LC=(e,t,s=10)=>{let i="";const a=Math.max(Math.round(t/s),2);for(let o=0;o<a;o++)i+=Math.round(e(o/(a-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},mh=2e4;function _b(e){let t=0;const s=50;let i=e.next(t);for(;!i.done&&t<mh;)t+=s,i=e.next(t);return t>=mh?1/0:t}function IR(e,t=100,s){const i=s({...e,keyframes:[0,t]}),a=Math.min(_b(i),mh);return{type:"keyframes",ease:o=>i.next(a*o).value/t,duration:qn(a)}}const Ut={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 Hg(e,t){return e*Math.sqrt(1-t*t)}const PR=12;function $R(e,t,s){let i=s;for(let a=1;a<PR;a++)i=i-e(i)/t(i);return i}const vp=.001;function HR({duration:e=Ut.duration,bounce:t=Ut.bounce,velocity:s=Ut.velocity,mass:i=Ut.mass}){let a,o,u=1-t;u=Ni(Ut.minDamping,Ut.maxDamping,u),e=Ni(Ut.minDuration,Ut.maxDuration,qn(e)),u<1?(a=f=>{const p=f*u,b=p*e,x=p-s,_=Hg(f,u),y=Math.exp(-b);return vp-x/_*y},o=f=>{const b=f*u*e,x=b*s+s,_=Math.pow(u,2)*Math.pow(f,2)*e,y=Math.exp(-b),S=Hg(Math.pow(f,2),u);return(-a(f)+vp>0?-1:1)*((x-_)*y)/S}):(a=f=>{const p=Math.exp(-f*e),b=(f-s)*e+1;return-vp+p*b},o=f=>{const p=Math.exp(-f*e),b=(s-f)*(e*e);return p*b});const h=5/e,m=$R(a,o,h);if(e=An(e),isNaN(m))return{stiffness:Ut.stiffness,damping:Ut.damping,duration:e};{const f=Math.pow(m,2)*i;return{stiffness:f,damping:u*2*Math.sqrt(i*f),duration:e}}}const UR=["duration","bounce"],FR=["stiffness","damping","mass"];function Cy(e,t){return t.some(s=>e[s]!==void 0)}function VR(e){let t={velocity:Ut.velocity,stiffness:Ut.stiffness,damping:Ut.damping,mass:Ut.mass,isResolvedFromDuration:!1,...e};if(!Cy(e,FR)&&Cy(e,UR))if(t.velocity=0,e.visualDuration){const s=e.visualDuration,i=2*Math.PI/(s*1.2),a=i*i,o=2*Ni(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Ut.mass,stiffness:a,damping:o}}else{const s=HR({...e,velocity:0});t={...t,...s,mass:Ut.mass},t.isResolvedFromDuration=!0}return t}function ph(e=Ut.visualDuration,t=Ut.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:a}=s;const o=s.keyframes[0],u=s.keyframes[s.keyframes.length-1],h={done:!1,value:o},{stiffness:m,damping:f,mass:p,duration:b,velocity:x,isResolvedFromDuration:_}=VR({...s,velocity:-qn(s.velocity||0)}),y=x||0,S=f/(2*Math.sqrt(m*p)),C=u-o,E=qn(Math.sqrt(m/p)),T=Math.abs(C)<5;i||(i=T?Ut.restSpeed.granular:Ut.restSpeed.default),a||(a=T?Ut.restDelta.granular:Ut.restDelta.default);let N,M,R,z,L,j;if(S<1)R=Hg(E,S),z=(y+S*E*C)/R,N=P=>{const F=Math.exp(-S*E*P);return u-F*(z*Math.sin(R*P)+C*Math.cos(R*P))},L=S*E*z+C*R,j=S*E*C-z*R,M=P=>Math.exp(-S*E*P)*(L*Math.sin(R*P)+j*Math.cos(R*P));else if(S===1){N=F=>u-Math.exp(-E*F)*(C+(y+E*C)*F);const P=y+E*C;M=F=>Math.exp(-E*F)*(E*P*F-y)}else{const P=E*Math.sqrt(S*S-1);N=Q=>{const q=Math.exp(-S*E*Q),O=Math.min(P*Q,300);return u-q*((y+S*E*C)*Math.sinh(O)+P*C*Math.cosh(O))/P};const F=(y+S*E*C)/P,K=S*E*F-C*P,Y=S*E*C-F*P;M=Q=>{const q=Math.exp(-S*E*Q),O=Math.min(P*Q,300);return q*(K*Math.sinh(O)+Y*Math.cosh(O))}}const H={calculatedDuration:_&&b||null,velocity:P=>An(M(P)),next:P=>{if(!_&&S<1){const K=Math.exp(-S*E*P),Y=Math.sin(R*P),Q=Math.cos(R*P),q=u-K*(z*Y+C*Q),O=An(K*(L*Y+j*Q));return h.done=Math.abs(O)<=i&&Math.abs(u-q)<=a,h.value=h.done?u:q,h}const F=N(P);if(_)h.done=P>=b;else{const K=An(M(P));h.done=Math.abs(K)<=i&&Math.abs(u-F)<=a}return h.value=h.done?u:F,h},toString:()=>{const P=Math.min(_b(H),mh),F=LC(K=>H.next(P*K).value,P,30);return P+"ms "+F},toTransition:()=>{}};return H}ph.applyToOptions=e=>{const t=IR(e,100,ph);return e.ease=t.ease,e.duration=An(t.duration),e.type="keyframes",e};const qR=5;function BC(e,t,s){const i=Math.max(t-qR,0);return pC(s-e(i),t-i)}function Ug({keyframes:e,velocity:t=0,power:s=.8,timeConstant:i=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:u,min:h,max:m,restDelta:f=.5,restSpeed:p}){const b=e[0],x={done:!1,value:b},_=j=>h!==void 0&&j<h||m!==void 0&&j>m,y=j=>h===void 0?m:m===void 0||Math.abs(h-j)<Math.abs(m-j)?h:m;let S=s*t;const C=b+S,E=u===void 0?C:u(C);E!==C&&(S=E-b);const T=j=>-S*Math.exp(-j/i),N=j=>E+T(j),M=j=>{const H=T(j),P=N(j);x.done=Math.abs(H)<=f,x.value=x.done?E:P};let R,z;const L=j=>{_(x.value)&&(R=j,z=ph({keyframes:[x.value,y(x.value)],velocity:BC(N,j,x.value),damping:a,stiffness:o,restDelta:f,restSpeed:p}))};return L(0),{calculatedDuration:null,next:j=>{let H=!1;return!z&&R===void 0&&(H=!0,M(j),L(j)),R!==void 0&&j>=R?z.next(j-R):(!H&&M(j),x)}}}function GR(e,t,s){const i=[],a=s||ta.mix||OC,o=e.length-1;for(let u=0;u<o;u++){let h=a(e[u],e[u+1]);if(t){const m=Array.isArray(t)?t[u]||Gn:t;h=su(m,h)}i.push(h)}return i}function KR(e,t,{clamp:s=!0,ease:i,mixer:a}={}){const o=e.length;if(hb(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const u=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const h=GR(t,i,a),m=h.length,f=p=>{if(u&&p<e[0])return t[0];let b=0;if(m>1)for(;b<e.length-2&&!(p<e[b+1]);b++);const x=Hc(e[b],e[b+1],p);return h[b](x)};return s?p=>f(Ni(e[0],e[o-1],p)):f}function WR(e,t){const s=e[e.length-1];for(let i=1;i<=t;i++){const a=Hc(0,t,i);e.push(jt(s,1,a))}}function YR(e){const t=[0];return WR(t,e.length-1),t}function XR(e,t){return e.map(s=>s*t)}function ZR(e,t){return e.map(()=>t||kC).splice(0,e.length-1)}function Dc({duration:e=300,keyframes:t,times:s,ease:i="easeInOut"}){const a=rR(i)?i.map(xy):xy(i),o={done:!1,value:t[0]},u=XR(s&&s.length===t.length?s:YR(t),e),h=KR(u,t,{ease:Array.isArray(a)?a:ZR(t,a)});return{calculatedDuration:e,next:m=>(o.value=h(m),o.done=m>=e,o)}}const QR=e=>e!==null;function Gh(e,{repeat:t,repeatType:s="loop"},i,a=1){const o=e.filter(QR),h=a<0||t&&s!=="loop"&&t%2===1?0:o.length-1;return!h||i===void 0?o[h]:i}const JR={decay:Ug,inertia:Ug,tween:Dc,keyframes:Dc,spring:ph};function zC(e){typeof e.type=="string"&&(e.type=JR[e.type])}class yb{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,s){return this.finished.then(t,s)}}const e8=e=>e/100;class gh extends yb{constructor(t){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=()=>{const{motionValue:s}=this.options;s&&s.updatedAt!==Zs.now()&&this.tick(Zs.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;zC(t);const{type:s=Dc,repeat:i=0,repeatDelay:a=0,repeatType:o,velocity:u=0}=t;let{keyframes:h}=t;const m=s||Dc;m!==Dc&&typeof h[0]!="number"&&(this.mixKeyframes=su(e8,OC(h[0],h[1])),h=[0,100]);const f=m({...t,keyframes:h});o==="mirror"&&(this.mirroredGenerator=m({...t,keyframes:[...h].reverse(),velocity:-u})),f.calculatedDuration===null&&(f.calculatedDuration=_b(f));const{calculatedDuration:p}=f;this.calculatedDuration=p,this.resolvedDuration=p+a,this.totalDuration=this.resolvedDuration*(i+1)-a,this.generator=f}updateTime(t){const s=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(t,s=!1){const{generator:i,totalDuration:a,mixKeyframes:o,mirroredGenerator:u,resolvedDuration:h,calculatedDuration:m}=this;if(this.startTime===null)return i.next(0);const{delay:f=0,keyframes:p,repeat:b,repeatType:x,repeatDelay:_,type:y,onUpdate:S,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),s?this.currentTime=t:this.updateTime(t);const E=this.currentTime-f*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?E<0:E>a;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let N=this.currentTime,M=i;if(b){const j=Math.min(this.currentTime,a)/h;let H=Math.floor(j),P=j%1;!P&&j>=1&&(P=1),P===1&&H--,H=Math.min(H,b+1),H%2&&(x==="reverse"?(P=1-P,_&&(P-=_/h)):x==="mirror"&&(M=u)),N=Ni(0,1,P)*h}let R;T?(this.delayState.value=p[0],R=this.delayState):R=M.next(N),o&&!T&&(R.value=o(R.value));let{done:z}=R;!T&&m!==null&&(z=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&z);return L&&y!==Ug&&(R.value=Gh(p,this.options,C,this.speed)),S&&S(R.value),L&&this.finish(),R}then(t,s){return this.finished.then(t,s)}get duration(){return qn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+qn(t)}get time(){return qn(this.currentTime)}set time(t){t=An(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const s=this.generator.next(t).value;return BC(i=>this.generator.next(i).value,t,s)}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;s&&this.driver&&this.updateTime(Zs.now()),this.playbackSpeed=t,s&&this.driver&&(this.time=qn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=zR,startTime:s}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=s??i),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(Zs.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function t8(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const za=e=>e*180/Math.PI,Fg=e=>{const t=za(Math.atan2(e[1],e[0]));return Vg(t)},s8={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Fg,rotateZ:Fg,skewX:e=>za(Math.atan(e[1])),skewY:e=>za(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Vg=e=>(e=e%360,e<0&&(e+=360),e),Ey=Fg,Ny=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ty=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),n8={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ny,scaleY:Ty,scale:e=>(Ny(e)+Ty(e))/2,rotateX:e=>Vg(za(Math.atan2(e[6],e[5]))),rotateY:e=>Vg(za(Math.atan2(-e[2],e[0]))),rotateZ:Ey,rotate:Ey,skewX:e=>za(Math.atan(e[4])),skewY:e=>za(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function qg(e){return e.includes("scale")?1:0}function Gg(e,t){if(!e||e==="none")return qg(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,a;if(s)i=n8,a=s;else{const h=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=s8,a=h}if(!a)return qg(t);const o=i[t],u=a[1].split(",").map(r8);return typeof o=="function"?o(u):u[o]}const i8=(e,t)=>{const{transform:s="none"}=getComputedStyle(e);return Gg(s,t)};function r8(e){return parseFloat(e.trim())}const ol=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ll=new Set(ol),Ay=e=>e===al||e===Te,a8=new Set(["x","y","z"]),o8=ol.filter(e=>!a8.has(e));function l8(e){const t=[];return o8.forEach(s=>{const i=e.getValue(s);i!==void 0&&(t.push([s,i.get()]),i.set(s.startsWith("scale")?1:0))}),t}const Zr={width:({x:e},{paddingLeft:t="0",paddingRight:s="0",boxSizing:i})=>{const a=e.max-e.min;return i==="border-box"?a:a-parseFloat(t)-parseFloat(s)},height:({y:e},{paddingTop:t="0",paddingBottom:s="0",boxSizing:i})=>{const a=e.max-e.min;return i==="border-box"?a:a-parseFloat(t)-parseFloat(s)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Gg(t,"x"),y:(e,{transform:t})=>Gg(t,"y")};Zr.translateX=Zr.x;Zr.translateY=Zr.y;const $a=new Set;let Kg=!1,Wg=!1,Yg=!1;function IC(){if(Wg){const e=Array.from($a).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),s=new Map;t.forEach(i=>{const a=l8(i);a.length&&(s.set(i,a),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const a=s.get(i);a&&a.forEach(([o,u])=>{i.getValue(o)?.set(u)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Wg=!1,Kg=!1,$a.forEach(e=>e.complete(Yg)),$a.clear()}function PC(){$a.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Wg=!0)})}function c8(){Yg=!0,PC(),IC(),Yg=!1}class Sb{constructor(t,s,i,a,o,u=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=i,this.motionValue=a,this.element=o,this.isAsync=u}scheduleResolve(){this.state="scheduled",this.isAsync?($a.add(this),Kg||(Kg=!0,Ct.read(PC),Ct.resolveKeyframes(IC))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:i,motionValue:a}=this;if(t[0]===null){const o=a?.get(),u=t[t.length-1];if(o!==void 0)t[0]=o;else if(i&&s){const h=i.readValue(s,u);h!=null&&(t[0]=h)}t[0]===void 0&&(t[0]=u),a&&o===void 0&&a.set(t[0])}t8(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),$a.delete(this)}cancel(){this.state==="scheduled"&&($a.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const u8=e=>e.startsWith("--");function $C(e,t,s){u8(t)?e.style.setProperty(t,s):e.style[t]=s}const d8={};function HC(e,t){const s=mC(e);return()=>d8[t]??s()}const h8=HC(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),UC=HC(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Sc=([e,t,s,i])=>`cubic-bezier(${e}, ${t}, ${s}, ${i})`,My={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Sc([0,.65,.55,1]),circOut:Sc([.55,0,1,.45]),backIn:Sc([.31,.01,.66,-.59]),backOut:Sc([.33,1.53,.69,.99])};function FC(e,t){if(e)return typeof e=="function"?UC()?LC(e,t):"ease-out":CC(e)?Sc(e):Array.isArray(e)?e.map(s=>FC(s,t)||My.easeOut):My[e]}function f8(e,t,s,{delay:i=0,duration:a=300,repeat:o=0,repeatType:u="loop",ease:h="easeOut",times:m}={},f=void 0){const p={[t]:s};m&&(p.offset=m);const b=FC(h,a);Array.isArray(b)&&(p.easing=b);const x={delay:i,duration:a,easing:Array.isArray(b)?"linear":b,fill:"both",iterations:o+1,direction:u==="reverse"?"alternate":"normal"};return f&&(x.pseudoElement=f),e.animate(p,x)}function VC(e){return typeof e=="function"&&"applyToOptions"in e}function m8({type:e,...t}){return VC(e)&&UC()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class qC extends yb{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:i,keyframes:a,pseudoElement:o,allowFlatten:u=!1,finalKeyframe:h,onComplete:m}=t;this.isPseudoElement=!!o,this.allowFlatten=u,this.options=t,hb(typeof t.type!="string");const f=m8(t);this.animation=f8(s,i,a,f,o),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const p=Gh(a,this.options,h,this.speed);this.updateMotionValue&&this.updateMotionValue(p),$C(s,i,p),this.animation.cancel()}m?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return qn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+qn(t)}get time(){return qn(Number(this.animation.currentTime)||0)}set time(t){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=An(t),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:s,rangeEnd:i,observe:a}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&h8()?(this.animation.timeline=t,s&&(this.animation.rangeStart=s),i&&(this.animation.rangeEnd=i),Gn):a(this)}}const GC={anticipate:yC,backInOut:_C,circInOut:wC};function p8(e){return e in GC}function g8(e){typeof e.ease=="string"&&p8(e.ease)&&(e.ease=GC[e.ease])}const xp=10;class b8 extends qC{constructor(t){g8(t),zC(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:s,onUpdate:i,onComplete:a,element:o,...u}=this.options;if(!s)return;if(t!==void 0){s.set(t);return}const h=new gh({...u,autoplay:!1}),m=Math.max(xp,Zs.now()-this.startTime),f=Ni(0,xp,m-xp),p=h.sample(m).value,{name:b}=this.options;o&&b&&$C(o,b,p),s.setWithVelocity(h.sample(Math.max(0,m-f)).value,p,f),h.stop()}}const jy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(li.test(e)||e==="0")&&!e.startsWith("url("));function v8(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}function x8(e,t,s,i){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],u=jy(a,t),h=jy(o,t);return!u||!h?!1:v8(e)||(s==="spring"||VC(s))&&i}function Xg(e){e.duration=0,e.type="keyframes"}const KC=new Set(["opacity","clipPath","filter","transform"]),_8=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function y8(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&_8.test(e[t]))return!0;return!1}const S8=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),w8=mC(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function k8(e){const{motionValue:t,name:s,repeatDelay:i,repeatType:a,damping:o,type:u,keyframes:h}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:p}=t.owner.getProps();return w8()&&s&&(KC.has(s)||S8.has(s)&&y8(h))&&(s!=="transform"||!p)&&!f&&!i&&a!=="mirror"&&o!==0&&u!=="inertia"}const C8=40;class E8 extends yb{constructor({autoplay:t=!0,delay:s=0,type:i="keyframes",repeat:a=0,repeatDelay:o=0,repeatType:u="loop",keyframes:h,name:m,motionValue:f,element:p,...b}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Zs.now();const x={autoplay:t,delay:s,type:i,repeat:a,repeatDelay:o,repeatType:u,name:m,motionValue:f,element:p,...b},_=p?.KeyframeResolver||Sb;this.keyframeResolver=new _(h,(y,S,C)=>this.onKeyframesResolved(y,S,x,!C),m,f,p),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,s,i,a){this.keyframeResolver=void 0;const{name:o,type:u,velocity:h,delay:m,isHandoff:f,onUpdate:p}=i;this.resolvedAt=Zs.now();let b=!0;x8(t,o,u,h)||(b=!1,(ta.instantAnimations||!m)&&p?.(Gh(t,i,s)),t[0]=t[t.length-1],Xg(i),i.repeat=0);const _={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>C8?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...i,keyframes:t},y=b&&!f&&k8(_),S=_.motionValue?.owner?.current;let C;if(y)try{C=new b8({..._,element:S})}catch{C=new gh(_)}else C=new gh(_);C.finished.then(()=>{this.notifyFinished()}).catch(Gn),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(t,s){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),c8()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function WC(e,t,s,i=0,a=1){const o=Array.from(e).sort((f,p)=>f.sortNodePosition(p)).indexOf(t),u=e.size,h=(u-1)*i;return typeof s=="function"?s(o,u):a===1?o*i:h-o*i}const N8=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function T8(e){const t=N8.exec(e);if(!t)return[,];const[,s,i,a]=t;return[`--${s??i}`,a]}function YC(e,t,s=1){const[i,a]=T8(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const u=o.trim();return dC(u)?parseFloat(u):u}return gb(a)?YC(a,t,s+1):a}const A8={type:"spring",stiffness:500,damping:25,restSpeed:10},M8=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),j8={type:"keyframes",duration:.8},R8={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},D8=(e,{keyframes:t})=>t.length>2?j8:ll.has(e)?e.startsWith("scale")?M8(t[1]):A8:R8;function XC(e,t){if(e?.inherit&&t){const{inherit:s,...i}=e;return{...t,...i}}return e}function wb(e,t){const s=e?.[t]??e?.default??e;return s!==e?XC(s,e):s}const O8=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function L8(e){for(const t in e)if(!O8.has(t))return!0;return!1}const kb=(e,t,s,i={},a,o)=>u=>{const h=wb(i,e)||{},m=h.delay||i.delay||0;let{elapsed:f=0}=i;f=f-An(m);const p={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...h,delay:-f,onUpdate:x=>{t.set(x),h.onUpdate&&h.onUpdate(x)},onComplete:()=>{u(),h.onComplete&&h.onComplete()},name:e,motionValue:t,element:o?void 0:a};L8(h)||Object.assign(p,D8(e,p)),p.duration&&(p.duration=An(p.duration)),p.repeatDelay&&(p.repeatDelay=An(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let b=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(Xg(p),p.delay===0&&(b=!0)),(ta.instantAnimations||ta.skipAnimations||a?.shouldSkipAnimations)&&(b=!0,Xg(p),p.delay=0),p.allowFlatten=!h.type&&!h.ease,b&&!o&&t.get()!==void 0){const x=Gh(p.keyframes,h);if(x!==void 0){Ct.update(()=>{p.onUpdate(x),p.onComplete()});return}}return h.isSync?new gh(p):new E8(p)};function Ry(e){const t=[{},{}];return e?.values.forEach((s,i)=>{t[0][i]=s.get(),t[1][i]=s.getVelocity()}),t}function Cb(e,t,s,i){if(typeof t=="function"){const[a,o]=Ry(i);t=t(s!==void 0?s:e.custom,a,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,o]=Ry(i);t=t(s!==void 0?s:e.custom,a,o)}return t}function Ha(e,t,s){const i=e.getProps();return Cb(i,t,s!==void 0?s:i.custom,e)}const ZC=new Set(["width","height","top","left","right","bottom",...ol]),Dy=30,B8=e=>!isNaN(parseFloat(e));class z8{constructor(t,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const a=Zs.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=s.owner}setCurrent(t){this.current=t,this.updatedAt=Zs.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=B8(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new fb);const i=this.events[t].add(s);return t==="change"?()=>{i(),Ct.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,s){this.passiveEffect=t,this.stopPassiveEffect=s}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,s,i){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,s=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Zs.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Dy)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,Dy);return pC(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(t){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=t(s),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(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function el(e,t){return new z8(e,t)}const Zg=e=>Array.isArray(e);function I8(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,el(s))}function P8(e){return Zg(e)?e[e.length-1]||0:e}function $8(e,t){const s=Ha(e,t);let{transitionEnd:i={},transition:a={},...o}=s||{};o={...o,...i};for(const u in o){const h=P8(o[u]);I8(e,u,h)}}const Rs=e=>!!(e&&e.getVelocity);function H8(e){return!!(Rs(e)&&e.add)}function Qg(e,t){const s=e.getValue("willChange");if(H8(s))return s.add(t);if(!s&&ta.WillChange){const i=new ta.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function Eb(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const U8="framerAppearId",QC="data-"+Eb(U8);function JC(e){return e.props[QC]}function F8({protectedKeys:e,needsAnimating:t},s){const i=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,i}function eE(e,t,{delay:s=0,transitionOverride:i,type:a}={}){let{transition:o,transitionEnd:u,...h}=t;const m=e.getDefaultTransition();o=o?XC(o,m):m;const f=o?.reduceMotion;i&&(o=i);const p=[],b=a&&e.animationState&&e.animationState.getState()[a];for(const x in h){const _=e.getValue(x,e.latestValues[x]??null),y=h[x];if(y===void 0||b&&F8(b,x))continue;const S={delay:s,...wb(o||{},x)},C=_.get();if(C!==void 0&&!_.isAnimating()&&!Array.isArray(y)&&y===C&&!S.velocity){Ct.update(()=>_.set(y));continue}let E=!1;if(window.MotionHandoffAnimation){const M=JC(e);if(M){const R=window.MotionHandoffAnimation(M,x,Ct);R!==null&&(S.startTime=R,E=!0)}}Qg(e,x);const T=f??e.shouldReduceMotion;_.start(kb(x,_,y,T&&ZC.has(x)?{type:!1}:S,e,E));const N=_.animation;N&&p.push(N)}if(u){const x=()=>Ct.update(()=>{u&&$8(e,u)});p.length?Promise.all(p).then(x):x()}return p}function Jg(e,t,s={}){const i=Ha(e,t,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};s.transitionOverride&&(a=s.transitionOverride);const o=i?()=>Promise.all(eE(e,i,s)):()=>Promise.resolve(),u=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:b}=a;return V8(e,t,m,f,p,b,s)}:()=>Promise.resolve(),{when:h}=a;if(h){const[m,f]=h==="beforeChildren"?[o,u]:[u,o];return m().then(()=>f())}else return Promise.all([o(),u(s.delay)])}function V8(e,t,s=0,i=0,a=0,o=1,u){const h=[];for(const m of e.variantChildren)m.notify("AnimationStart",t),h.push(Jg(m,t,{...u,delay:s+(typeof i=="function"?0:i)+WC(e.variantChildren,m,i,a,o)}).then(()=>m.notify("AnimationComplete",t)));return Promise.all(h)}function q8(e,t,s={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const a=t.map(o=>Jg(e,o,s));i=Promise.all(a)}else if(typeof t=="string")i=Jg(e,t,s);else{const a=typeof t=="function"?Ha(e,t,s.custom):t;i=Promise.all(eE(e,a,s))}return i.then(()=>{e.notify("AnimationComplete",t)})}const G8={test:e=>e==="auto",parse:e=>e},tE=e=>t=>t.test(e),sE=[al,Te,ki,Yr,vR,bR,G8],Oy=e=>sE.find(tE(e));function K8(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||fC(e):!0}const W8=new Set(["brightness","contrast","saturate","opacity"]);function Y8(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=s.match(bb)||[];if(!i)return e;const a=s.replace(i,"");let o=W8.has(t)?1:0;return i!==s&&(o*=100),t+"("+o+a+")"}const X8=/\b([a-z-]*)\(.*?\)/gu,e0={...li,getAnimatableNone:e=>{const t=e.match(X8);return t?t.map(Y8).join(" "):e}},t0={...li,getAnimatableNone:e=>{const t=li.parse(e);return li.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},Ly={...al,transform:Math.round},Z8={rotate:Yr,rotateX:Yr,rotateY:Yr,rotateZ:Yr,scale:Rd,scaleX:Rd,scaleY:Rd,scaleZ:Rd,skew:Yr,skewX:Yr,skewY:Yr,distance:Te,translateX:Te,translateY:Te,translateZ:Te,x:Te,y:Te,z:Te,perspective:Te,transformPerspective:Te,opacity:Uc,originX:yy,originY:yy,originZ:Te},Nb={borderWidth:Te,borderTopWidth:Te,borderRightWidth:Te,borderBottomWidth:Te,borderLeftWidth:Te,borderRadius:Te,borderTopLeftRadius:Te,borderTopRightRadius:Te,borderBottomRightRadius:Te,borderBottomLeftRadius:Te,width:Te,maxWidth:Te,height:Te,maxHeight:Te,top:Te,right:Te,bottom:Te,left:Te,inset:Te,insetBlock:Te,insetBlockStart:Te,insetBlockEnd:Te,insetInline:Te,insetInlineStart:Te,insetInlineEnd:Te,padding:Te,paddingTop:Te,paddingRight:Te,paddingBottom:Te,paddingLeft:Te,paddingBlock:Te,paddingBlockStart:Te,paddingBlockEnd:Te,paddingInline:Te,paddingInlineStart:Te,paddingInlineEnd:Te,margin:Te,marginTop:Te,marginRight:Te,marginBottom:Te,marginLeft:Te,marginBlock:Te,marginBlockStart:Te,marginBlockEnd:Te,marginInline:Te,marginInlineStart:Te,marginInlineEnd:Te,fontSize:Te,backgroundPositionX:Te,backgroundPositionY:Te,...Z8,zIndex:Ly,fillOpacity:Uc,strokeOpacity:Uc,numOctaves:Ly},Q8={...Nb,color:is,backgroundColor:is,outlineColor:is,fill:is,stroke:is,borderColor:is,borderTopColor:is,borderRightColor:is,borderBottomColor:is,borderLeftColor:is,filter:e0,WebkitFilter:e0,mask:t0,WebkitMask:t0},nE=e=>Q8[e],J8=new Set([e0,t0]);function iE(e,t){let s=nE(e);return J8.has(s)||(s=li),s.getAnimatableNone?s.getAnimatableNone(t):void 0}const eD=new Set(["auto","none","0"]);function tD(e,t,s){let i=0,a;for(;i<e.length&&!a;){const o=e[i];typeof o=="string"&&!eD.has(o)&&Jo(o).values.length&&(a=e[i]),i++}if(a&&s)for(const o of t)e[o]=iE(s,a)}class sD extends Sb{constructor(t,s,i,a,o){super(t,s,i,a,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:i}=this;if(!s||!s.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let b=t[p];if(typeof b=="string"&&(b=b.trim(),gb(b))){const x=YC(b,s.current);x!==void 0&&(t[p]=x),p===t.length-1&&(this.finalKeyframe=b)}}if(this.resolveNoneKeyframes(),!ZC.has(i)||t.length!==2)return;const[a,o]=t,u=Oy(a),h=Oy(o),m=_y(a),f=_y(o);if(m!==f&&Zr[i]){this.needsMeasurement=!0;return}if(u!==h)if(Ay(u)&&Ay(h))for(let p=0;p<t.length;p++){const b=t[p];typeof b=="string"&&(t[p]=parseFloat(b))}else Zr[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,i=[];for(let a=0;a<t.length;a++)(t[a]===null||K8(t[a]))&&i.push(a);i.length&&tD(t,i,s)}measureInitialState(){const{element:t,unresolvedKeyframes:s,name:i}=this;if(!t||!t.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Zr[i](t.measureViewportBox(),window.getComputedStyle(t.current)),s[0]=this.measuredOrigin;const a=s[s.length-1];a!==void 0&&t.getValue(i,a).jump(a,!1)}measureEndState(){const{element:t,name:s,unresolvedKeyframes:i}=this;if(!t||!t.current)return;const a=t.getValue(s);a&&a.jump(this.measuredOrigin,!1);const o=i.length-1,u=i[o];i[o]=Zr[s](t.measureViewportBox(),window.getComputedStyle(t.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),this.removedTransforms?.length&&this.removedTransforms.forEach(([h,m])=>{t.getValue(h).set(m)}),this.resolveNoneKeyframes()}}function rE(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;const a=s?.[e]??i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(i=>i!=null)}const aE=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function nD(e){return hC(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Tb}=EC(queueMicrotask,!1),ri={x:!1,y:!1};function oE(){return ri.x||ri.y}function iD(e){return e==="x"||e==="y"?ri[e]?null:(ri[e]=!0,()=>{ri[e]=!1}):ri.x||ri.y?null:(ri.x=ri.y=!0,()=>{ri.x=ri.y=!1})}function lE(e,t){const s=rE(e),i=new AbortController,a={passive:!0,...t,signal:i.signal};return[s,a,()=>i.abort()]}function rD(e){return!(e.pointerType==="touch"||oE())}function aD(e,t,s={}){const[i,a,o]=lE(e,s);return i.forEach(u=>{let h=!1,m=!1,f;const p=()=>{u.removeEventListener("pointerleave",y)},b=C=>{f&&(f(C),f=void 0),p()},x=C=>{h=!1,window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),m&&(m=!1,b(C))},_=()=>{h=!0,window.addEventListener("pointerup",x,a),window.addEventListener("pointercancel",x,a)},y=C=>{if(C.pointerType!=="touch"){if(h){m=!0;return}b(C)}},S=C=>{if(!rD(C))return;m=!1;const E=t(u,C);typeof E=="function"&&(f=E,u.addEventListener("pointerleave",y,a))};u.addEventListener("pointerenter",S,a),u.addEventListener("pointerdown",_,a)}),o}const cE=(e,t)=>t?e===t?!0:cE(e,t.parentElement):!1,Ab=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,oD=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function lD(e){return oD.has(e.tagName)||e.isContentEditable===!0}const cD=new Set(["INPUT","SELECT","TEXTAREA"]);function uD(e){return cD.has(e.tagName)||e.isContentEditable===!0}const Zd=new WeakSet;function By(e){return t=>{t.key==="Enter"&&e(t)}}function _p(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const dD=(e,t)=>{const s=e.currentTarget;if(!s)return;const i=By(()=>{if(Zd.has(s))return;_p(s,"down");const a=By(()=>{_p(s,"up")}),o=()=>_p(s,"cancel");s.addEventListener("keyup",a,t),s.addEventListener("blur",o,t)});s.addEventListener("keydown",i,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",i),t)};function zy(e){return Ab(e)&&!oE()}const Iy=new WeakSet;function hD(e,t,s={}){const[i,a,o]=lE(e,s),u=h=>{const m=h.currentTarget;if(!zy(h)||Iy.has(h))return;Zd.add(m),s.stopPropagation&&Iy.add(h);const f=t(m,h),p=(_,y)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",x),Zd.has(m)&&Zd.delete(m),zy(_)&&typeof f=="function"&&f(_,{success:y})},b=_=>{p(_,m===window||m===document||s.useGlobalTarget||cE(m,_.target))},x=_=>{p(_,!1)};window.addEventListener("pointerup",b,a),window.addEventListener("pointercancel",x,a)};return i.forEach(h=>{(s.useGlobalTarget?window:h).addEventListener("pointerdown",u,a),nD(h)&&(h.addEventListener("focus",f=>dD(f,a)),!lD(h)&&!h.hasAttribute("tabindex")&&(h.tabIndex=0))}),o}function Mb(e){return hC(e)&&"ownerSVGElement"in e}const Qd=new WeakMap;let Jd;const uE=(e,t,s)=>(i,a)=>a&&a[0]?a[0][e+"Size"]:Mb(i)&&"getBBox"in i?i.getBBox()[t]:i[s],fD=uE("inline","width","offsetWidth"),mD=uE("block","height","offsetHeight");function pD({target:e,borderBoxSize:t}){Qd.get(e)?.forEach(s=>{s(e,{get width(){return fD(e,t)},get height(){return mD(e,t)}})})}function gD(e){e.forEach(pD)}function bD(){typeof ResizeObserver>"u"||(Jd=new ResizeObserver(gD))}function vD(e,t){Jd||bD();const s=rE(e);return s.forEach(i=>{let a=Qd.get(i);a||(a=new Set,Qd.set(i,a)),a.add(t),Jd?.observe(i)}),()=>{s.forEach(i=>{const a=Qd.get(i);a?.delete(t),a?.size||Jd?.unobserve(i)})}}const eh=new Set;let Ko;function xD(){Ko=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};eh.forEach(t=>t(e))},window.addEventListener("resize",Ko)}function _D(e){return eh.add(e),Ko||xD(),()=>{eh.delete(e),!eh.size&&typeof Ko=="function"&&(window.removeEventListener("resize",Ko),Ko=void 0)}}function Py(e,t){return typeof e=="function"?_D(e):vD(e,t)}function yD(e){return Mb(e)&&e.tagName==="svg"}const SD=[...sE,is,li],wD=e=>SD.find(tE(e)),$y=()=>({translate:0,scale:1,origin:0,originPoint:0}),Wo=()=>({x:$y(),y:$y()}),Hy=()=>({min:0,max:0}),fs=()=>({x:Hy(),y:Hy()}),kD=new WeakMap;function Kh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Fc(e){return typeof e=="string"||Array.isArray(e)}const jb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Rb=["initial",...jb];function Wh(e){return Kh(e.animate)||Rb.some(t=>Fc(e[t]))}function dE(e){return!!(Wh(e)||e.variants)}function CD(e,t,s){for(const i in t){const a=t[i],o=s[i];if(Rs(a))e.addValue(i,a);else if(Rs(o))e.addValue(i,el(a,{owner:e}));else if(o!==a)if(e.hasValue(i)){const u=e.getValue(i);u.liveStyle===!0?u.jump(a):u.hasAnimated||u.set(a)}else{const u=e.getStaticValue(i);e.addValue(i,el(u!==void 0?u:a,{owner:e}))}}for(const i in s)t[i]===void 0&&e.removeValue(i);return t}const s0={current:null},hE={current:!1},ED=typeof window<"u";function ND(){if(hE.current=!0,!!ED)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>s0.current=e.matches;e.addEventListener("change",t),t()}else s0.current=!1}const Uy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let bh={};function fE(e){bh=e}function TD(){return bh}class AD{scrapeMotionValuesFromProps(t,s,i){return{}}constructor({parent:t,props:s,presenceContext:i,reducedMotionConfig:a,skipAnimations:o,blockInitialAnimation:u,visualState:h},m={}){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=Sb,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 _=Zs.now();this.renderScheduledAt<_&&(this.renderScheduledAt=_,Ct.render(this.render,!1,!0))};const{latestValues:f,renderState:p}=h;this.latestValues=f,this.baseTarget={...f},this.initialValues=s.initial?{...f}:{},this.renderState=p,this.parent=t,this.props=s,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.skipAnimationsConfig=o,this.options=m,this.blockInitialAnimation=!!u,this.isControllingVariants=Wh(s),this.isVariantNode=dE(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:b,...x}=this.scrapeMotionValuesFromProps(s,{},this);for(const _ in x){const y=x[_];f[_]!==void 0&&Rs(y)&&y.set(f[_])}}mount(t){if(this.hasBeenMounted)for(const s in this.initialValues)this.values.get(s)?.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,kD.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(hE.current||ND(),this.shouldReduceMotion=s0.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),sa(this.notifyUpdate),sa(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const s=this.features[t];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,s){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),s.accelerate&&KC.has(t)&&this.current instanceof HTMLElement){const{factory:u,keyframes:h,times:m,ease:f,duration:p}=s.accelerate,b=new qC({element:this.current,name:t,keyframes:h,times:m,ease:f,duration:An(p)}),x=u(b);this.valueSubscriptions.set(t,()=>{x(),b.cancel()});return}const i=ll.has(t);i&&this.onBindTransform&&this.onBindTransform();const a=s.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&&Ct.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,s)),this.valueSubscriptions.set(t,()=>{a(),o&&o(),s.owner&&s.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in bh){const s=bh[t];if(!s)continue;const{isEnabled:i,Feature:a}=s;if(!this.features[t]&&a&&i(this.props)&&(this.features[t]=new a(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fs()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,s){this.latestValues[t]=s}update(t,s){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let i=0;i<Uy.length;i++){const a=Uy[i];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const o="on"+a,u=t[o];u&&(this.propEventSubscriptions[a]=this.on(a,u))}this.prevMotionValues=CD(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(t),()=>s.variantChildren.delete(t)}addValue(t,s){const i=this.values.get(t);s!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,s),this.values.set(t,s),this.latestValues[t]=s.get())}removeValue(t){this.values.delete(t);const s=this.valueSubscriptions.get(t);s&&(s(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,s){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&s!==void 0&&(i=el(s===null?void 0:s,{owner:this}),this.addValue(t,i)),i}readValue(t,s){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(dC(i)||fC(i))?i=parseFloat(i):!wD(i)&&li.test(s)&&(i=iE(t,s)),this.setBaseTarget(t,Rs(i)?i.get():i)),Rs(i)?i.get():i}setBaseTarget(t,s){this.baseTarget[t]=s}getBaseTarget(t){const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=Cb(this.props,s,this.presenceContext?.custom);o&&(i=o[t])}if(s&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Rs(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,s){return this.events[t]||(this.events[t]=new fb),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}scheduleRenderMicrotask(){Tb.render(this.render)}}class mE extends AD{constructor(){super(...arguments),this.KeyframeResolver=sD}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){const i=t.style;return i?i[s]:void 0}removeValueFromRenderState(t,{vars:s,style:i}){delete s[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Rs(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class aa{constructor(t){this.isMounted=!1,this.node=t}update(){}}function pE({top:e,left:t,right:s,bottom:i}){return{x:{min:t,max:s},y:{min:e,max:i}}}function MD({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function jD(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:i.y,right:i.x}}function yp(e){return e===void 0||e===1}function n0({scale:e,scaleX:t,scaleY:s}){return!yp(e)||!yp(t)||!yp(s)}function Ra(e){return n0(e)||gE(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function gE(e){return Fy(e.x)||Fy(e.y)}function Fy(e){return e&&e!=="0%"}function vh(e,t,s){const i=e-s,a=t*i;return s+a}function Vy(e,t,s,i,a){return a!==void 0&&(e=vh(e,a,i)),vh(e,s,i)+t}function i0(e,t=0,s=1,i,a){e.min=Vy(e.min,t,s,i,a),e.max=Vy(e.max,t,s,i,a)}function bE(e,{x:t,y:s}){i0(e.x,t.translate,t.scale,t.originPoint),i0(e.y,s.translate,s.scale,s.originPoint)}const qy=.999999999999,Gy=1.0000000000001;function RD(e,t,s,i=!1){const a=s.length;if(!a)return;t.x=t.y=1;let o,u;for(let h=0;h<a;h++){o=s[h],u=o.projectionDelta;const{visualElement:m}=o.options;m&&m.props.style&&m.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(Si(e.x,-o.scroll.offset.x),Si(e.y,-o.scroll.offset.y)),u&&(t.x*=u.x.scale,t.y*=u.y.scale,bE(e,u)),i&&Ra(o.latestValues)&&th(e,o.latestValues,o.layout?.layoutBox))}t.x<Gy&&t.x>qy&&(t.x=1),t.y<Gy&&t.y>qy&&(t.y=1)}function Si(e,t){e.min+=t,e.max+=t}function Ky(e,t,s,i,a=.5){const o=jt(e.min,e.max,a);i0(e,t,s,o,i)}function Wy(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function th(e,t,s){const i=s??e;Ky(e.x,Wy(t.x,i.x),t.scaleX,t.scale,t.originX),Ky(e.y,Wy(t.y,i.y),t.scaleY,t.scale,t.originY)}function vE(e,t){return pE(jD(e.getBoundingClientRect(),t))}function DD(e,t,s){const i=vE(e,s),{scroll:a}=t;return a&&(Si(i.x,a.offset.x),Si(i.y,a.offset.y)),i}const OD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},LD=ol.length;function BD(e,t,s){let i="",a=!0;for(let o=0;o<LD;o++){const u=ol[o],h=e[u];if(h===void 0)continue;let m=!0;if(typeof h=="number")m=h===(u.startsWith("scale")?1:0);else{const f=parseFloat(h);m=u.startsWith("scale")?f===1:f===0}if(!m||s){const f=aE(h,Nb[u]);if(!m){a=!1;const p=OD[u]||u;i+=`${p}(${f}) `}s&&(t[u]=f)}}return i=i.trim(),s?i=s(t,a?"":i):a&&(i="none"),i}function Db(e,t,s){const{style:i,vars:a,transformOrigin:o}=e;let u=!1,h=!1;for(const m in t){const f=t[m];if(ll.has(m)){u=!0;continue}else if(TC(m)){a[m]=f;continue}else{const p=aE(f,Nb[m]);m.startsWith("origin")?(h=!0,o[m]=p):i[m]=p}}if(t.transform||(u||s?i.transform=BD(t,e.transform,s):i.transform&&(i.transform="none")),h){const{originX:m="50%",originY:f="50%",originZ:p=0}=o;i.transformOrigin=`${m} ${f} ${p}`}}function xE(e,{style:t,vars:s},i,a){const o=e.style;let u;for(u in t)o[u]=t[u];a?.applyProjectionStyles(o,i);for(u in s)o.setProperty(u,s[u])}function Yy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const dc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Te.test(e))e=parseFloat(e);else return e;const s=Yy(e,t.target.x),i=Yy(e,t.target.y);return`${s}% ${i}%`}},zD={correct:(e,{treeScale:t,projectionDelta:s})=>{const i=e,a=li.parse(e);if(a.length>5)return i;const o=li.createTransformer(e),u=typeof a[0]!="number"?1:0,h=s.x.scale*t.x,m=s.y.scale*t.y;a[0+u]/=h,a[1+u]/=m;const f=jt(h,m,.5);return typeof a[2+u]=="number"&&(a[2+u]/=f),typeof a[3+u]=="number"&&(a[3+u]/=f),o(a)}},r0={borderRadius:{...dc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:dc,borderTopRightRadius:dc,borderBottomLeftRadius:dc,borderBottomRightRadius:dc,boxShadow:zD};function _E(e,{layout:t,layoutId:s}){return ll.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!r0[e]||e==="opacity")}function Ob(e,t,s){const i=e.style,a=t?.style,o={};if(!i)return o;for(const u in i)(Rs(i[u])||a&&Rs(a[u])||_E(u,e)||s?.getValue(u)?.liveStyle!==void 0)&&(o[u]=i[u]);return o}function ID(e){return window.getComputedStyle(e)}class PD extends mE{constructor(){super(...arguments),this.type="html",this.renderInstance=xE}readValueFromInstance(t,s){if(ll.has(s))return this.projection?.isProjecting?qg(s):i8(t,s);{const i=ID(t),a=(TC(s)?i.getPropertyValue(s):i[s])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:s}){return vE(t,s)}build(t,s,i){Db(t,s,i.transformTemplate)}scrapeMotionValuesFromProps(t,s,i){return Ob(t,s,i)}}const $D={offset:"stroke-dashoffset",array:"stroke-dasharray"},HD={offset:"strokeDashoffset",array:"strokeDasharray"};function UD(e,t,s=1,i=0,a=!0){e.pathLength=1;const o=a?$D:HD;e[o.offset]=`${-i}`,e[o.array]=`${t} ${s}`}const FD=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function yE(e,{attrX:t,attrY:s,attrScale:i,pathLength:a,pathSpacing:o=1,pathOffset:u=0,...h},m,f,p){if(Db(e,h,f),m){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:b,style:x}=e;b.transform&&(x.transform=b.transform,delete b.transform),(x.transform||b.transformOrigin)&&(x.transformOrigin=b.transformOrigin??"50% 50%",delete b.transformOrigin),x.transform&&(x.transformBox=p?.transformBox??"fill-box",delete b.transformBox);for(const _ of FD)b[_]!==void 0&&(x[_]=b[_],delete b[_]);t!==void 0&&(b.x=t),s!==void 0&&(b.y=s),i!==void 0&&(b.scale=i),a!==void 0&&UD(b,a,o,u,!1)}const SE=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"]),wE=e=>typeof e=="string"&&e.toLowerCase()==="svg";function VD(e,t,s,i){xE(e,t,void 0,i);for(const a in t.attrs)e.setAttribute(SE.has(a)?a:Eb(a),t.attrs[a])}function kE(e,t,s){const i=Ob(e,t,s);for(const a in e)if(Rs(e[a])||Rs(t[a])){const o=ol.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;i[o]=e[a]}return i}class qD extends mE{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fs}getBaseTargetFromProps(t,s){return t[s]}readValueFromInstance(t,s){if(ll.has(s)){const i=nE(s);return i&&i.default||0}return s=SE.has(s)?s:Eb(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,i){return kE(t,s,i)}build(t,s,i){yE(t,s,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,s,i,a){VD(t,s,i,a)}mount(t){this.isSVGTag=wE(t.tagName),super.mount(t)}}const GD=Rb.length;function CE(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?CE(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<GD;s++){const i=Rb[s],a=e.props[i];(Fc(a)||a===!1)&&(t[i]=a)}return t}function EE(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let i=0;i<s;i++)if(t[i]!==e[i])return!1;return!0}const KD=[...jb].reverse(),WD=jb.length;function YD(e){return t=>Promise.all(t.map(({animation:s,options:i})=>q8(e,s,i)))}function XD(e){let t=YD(e),s=Xy(),i=!0,a=!1;const o=f=>(p,b)=>{const x=Ha(e,b,f==="exit"?e.presenceContext?.custom:void 0);if(x){const{transition:_,transitionEnd:y,...S}=x;p={...p,...S,...y}}return p};function u(f){t=f(e)}function h(f){const{props:p}=e,b=CE(e.parent)||{},x=[],_=new Set;let y={},S=1/0;for(let E=0;E<WD;E++){const T=KD[E],N=s[T],M=p[T]!==void 0?p[T]:b[T],R=Fc(M),z=T===f?N.isActive:null;z===!1&&(S=E);let L=M===b[T]&&M!==p[T]&&R;if(L&&(i||a)&&e.manuallyAnimateOnMount&&(L=!1),N.protectedKeys={...y},!N.isActive&&z===null||!M&&!N.prevProp||Kh(M)||typeof M=="boolean")continue;if(T==="exit"&&N.isActive&&z!==!0){N.prevResolvedValues&&(y={...y,...N.prevResolvedValues});continue}const j=ZD(N.prevProp,M);let H=j||T===f&&N.isActive&&!L&&R||E>S&&R,P=!1;const F=Array.isArray(M)?M:[M];let K=F.reduce(o(T),{});z===!1&&(K={});const{prevResolvedValues:Y={}}=N,Q={...Y,...K},q=Z=>{H=!0,_.has(Z)&&(P=!0,_.delete(Z)),N.needsAnimating[Z]=!0;const V=e.getValue(Z);V&&(V.liveStyle=!1)};for(const Z in Q){const V=K[Z],$=Y[Z];if(y.hasOwnProperty(Z))continue;let D=!1;Zg(V)&&Zg($)?D=!EE(V,$):D=V!==$,D?V!=null?q(Z):_.add(Z):V!==void 0&&_.has(Z)?q(Z):N.protectedKeys[Z]=!0}N.prevProp=M,N.prevResolvedValues=K,N.isActive&&(y={...y,...K}),(i||a)&&e.blockInitialAnimation&&(H=!1);const O=L&&j;H&&(!O||P)&&x.push(...F.map(Z=>{const V={type:T};if(typeof Z=="string"&&(i||a)&&!O&&e.manuallyAnimateOnMount&&e.parent){const{parent:$}=e,D=Ha($,Z);if($.enteringChildren&&D){const{delayChildren:W}=D.transition||{};V.delay=WC($.enteringChildren,e,W)}}return{animation:Z,options:V}}))}if(_.size){const E={};if(typeof p.initial!="boolean"){const T=Ha(e,Array.isArray(p.initial)?p.initial[0]:p.initial);T&&T.transition&&(E.transition=T.transition)}_.forEach(T=>{const N=e.getBaseTarget(T),M=e.getValue(T);M&&(M.liveStyle=!0),E[T]=N??null}),x.push({animation:E})}let C=!!x.length;return i&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(C=!1),i=!1,a=!1,C?t(x):Promise.resolve()}function m(f,p){if(s[f].isActive===p)return Promise.resolve();e.variantChildren?.forEach(x=>x.animationState?.setActive(f,p)),s[f].isActive=p;const b=h(f);for(const x in s)s[x].protectedKeys={};return b}return{animateChanges:h,setActive:m,setAnimateFunction:u,getState:()=>s,reset:()=>{s=Xy(),a=!0}}}function ZD(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!EE(t,e):!1}function Aa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Xy(){return{animate:Aa(!0),whileInView:Aa(),whileHover:Aa(),whileTap:Aa(),whileDrag:Aa(),whileFocus:Aa(),exit:Aa()}}function a0(e,t){e.min=t.min,e.max=t.max}function ii(e,t){a0(e.x,t.x),a0(e.y,t.y)}function Zy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const NE=1e-4,QD=1-NE,JD=1+NE,TE=.01,eO=0-TE,tO=0+TE;function Qs(e){return e.max-e.min}function sO(e,t,s){return Math.abs(e-t)<=s}function Qy(e,t,s,i=.5){e.origin=i,e.originPoint=jt(t.min,t.max,e.origin),e.scale=Qs(s)/Qs(t),e.translate=jt(s.min,s.max,e.origin)-e.originPoint,(e.scale>=QD&&e.scale<=JD||isNaN(e.scale))&&(e.scale=1),(e.translate>=eO&&e.translate<=tO||isNaN(e.translate))&&(e.translate=0)}function Oc(e,t,s,i){Qy(e.x,t.x,s.x,i?i.originX:void 0),Qy(e.y,t.y,s.y,i?i.originY:void 0)}function Jy(e,t,s,i=0){const a=i?jt(s.min,s.max,i):s.min;e.min=a+t.min,e.max=e.min+Qs(t)}function nO(e,t,s,i){Jy(e.x,t.x,s.x,i?.x),Jy(e.y,t.y,s.y,i?.y)}function eS(e,t,s,i=0){const a=i?jt(s.min,s.max,i):s.min;e.min=t.min-a,e.max=e.min+Qs(t)}function xh(e,t,s,i){eS(e.x,t.x,s.x,i?.x),eS(e.y,t.y,s.y,i?.y)}function tS(e,t,s,i,a){return e-=t,e=vh(e,1/s,i),a!==void 0&&(e=vh(e,1/a,i)),e}function iO(e,t=0,s=1,i=.5,a,o=e,u=e){if(ki.test(t)&&(t=parseFloat(t),t=jt(u.min,u.max,t/100)-u.min),typeof t!="number")return;let h=jt(o.min,o.max,i);e===o&&(h-=t),e.min=tS(e.min,t,s,h,a),e.max=tS(e.max,t,s,h,a)}function sS(e,t,[s,i,a],o,u){iO(e,t[s],t[i],t[a],t.scale,o,u)}const rO=["x","scaleX","originX"],aO=["y","scaleY","originY"];function nS(e,t,s,i){sS(e.x,t,rO,s?s.x:void 0,i?i.x:void 0),sS(e.y,t,aO,s?s.y:void 0,i?i.y:void 0)}function iS(e){return e.translate===0&&e.scale===1}function AE(e){return iS(e.x)&&iS(e.y)}function rS(e,t){return e.min===t.min&&e.max===t.max}function oO(e,t){return rS(e.x,t.x)&&rS(e.y,t.y)}function aS(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ME(e,t){return aS(e.x,t.x)&&aS(e.y,t.y)}function oS(e){return Qs(e.x)/Qs(e.y)}function lS(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function yi(e){return[e("x"),e("y")]}function lO(e,t,s){let i="";const a=e.x.translate/t.x,o=e.y.translate/t.y,u=s?.z||0;if((a||o||u)&&(i=`translate3d(${a}px, ${o}px, ${u}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:f,rotate:p,rotateX:b,rotateY:x,skewX:_,skewY:y}=s;f&&(i=`perspective(${f}px) ${i}`),p&&(i+=`rotate(${p}deg) `),b&&(i+=`rotateX(${b}deg) `),x&&(i+=`rotateY(${x}deg) `),_&&(i+=`skewX(${_}deg) `),y&&(i+=`skewY(${y}deg) `)}const h=e.x.scale*t.x,m=e.y.scale*t.y;return(h!==1||m!==1)&&(i+=`scale(${h}, ${m})`),i||"none"}const jE=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],cO=jE.length,cS=e=>typeof e=="string"?parseFloat(e):e,uS=e=>typeof e=="number"||Te.test(e);function uO(e,t,s,i,a,o){a?(e.opacity=jt(0,s.opacity??1,dO(i)),e.opacityExit=jt(t.opacity??1,0,hO(i))):o&&(e.opacity=jt(t.opacity??1,s.opacity??1,i));for(let u=0;u<cO;u++){const h=jE[u];let m=dS(t,h),f=dS(s,h);if(m===void 0&&f===void 0)continue;m||(m=0),f||(f=0),m===0||f===0||uS(m)===uS(f)?(e[h]=Math.max(jt(cS(m),cS(f),i),0),(ki.test(f)||ki.test(m))&&(e[h]+="%")):e[h]=f}(t.rotate||s.rotate)&&(e.rotate=jt(t.rotate||0,s.rotate||0,i))}function dS(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const dO=RE(0,.5,SC),hO=RE(.5,.95,Gn);function RE(e,t,s){return i=>i<e?0:i>t?1:s(Hc(e,t,i))}function fO(e,t,s){const i=Rs(e)?e:el(e);return i.start(kb("",i,t,s)),i.animation}function Vc(e,t,s,i={passive:!0}){return e.addEventListener(t,s,i),()=>e.removeEventListener(t,s)}const mO=(e,t)=>e.depth-t.depth;class pO{constructor(){this.children=[],this.isDirty=!1}add(t){db(this.children,t),this.isDirty=!0}remove(t){hh(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(mO),this.isDirty=!1,this.children.forEach(t)}}function gO(e,t){const s=Zs.now(),i=({timestamp:a})=>{const o=a-s;o>=t&&(sa(i),e(o-t))};return Ct.setup(i,!0),()=>sa(i)}function sh(e){return Rs(e)?e.get():e}class bO{constructor(){this.members=[]}add(t){db(this.members,t);for(let s=this.members.length-1;s>=0;s--){const i=this.members[s];if(i===t||i===this.lead||i===this.prevLead)continue;const a=i.instance;(!a||a.isConnected===!1)&&!i.snapshot&&(hh(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(hh(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){for(let s=this.members.indexOf(t)-1;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1&&i.instance?.isConnected!==!1)return this.promote(i),!0}return!1}promote(t,s){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:a}=i.options,{layoutDependency:o}=t.options;(a===void 0||a!==o)&&(t.resumeFrom=i,s&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const nh={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Sp=["","X","Y","Z"],vO=1e3;let xO=0;function wp(e,t,s,i){const{latestValues:a}=t;a[e]&&(s[e]=a[e],t.setStaticValue(e,0),i&&(i[e]=0))}function DE(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=JC(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:a,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",Ct,!(a||o))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&DE(i)}function OE({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:i,resetTransform:a}){return class{constructor(u={},h=t?.()){this.id=xO++,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(SO),this.nodes.forEach(TO),this.nodes.forEach(AO),this.nodes.forEach(wO)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=h?h.root||h:this,this.path=h?[...h.path,h]:[],this.parent=h,this.depth=h?h.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new pO)}addEventListener(u,h){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new fb),this.eventHandlers.get(u).add(h)}notifyListeners(u,...h){const m=this.eventHandlers.get(u);m&&m.notify(...h)}hasListeners(u){return this.eventHandlers.has(u)}mount(u){if(this.instance)return;this.isSVG=Mb(u)&&!yD(u),this.instance=u;const{layoutId:h,layout:m,visualElement:f}=this.options;if(f&&!f.current&&f.mount(u),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(m||h)&&(this.isLayoutDirty=!0),e){let p,b=0;const x=()=>this.root.updateBlockedByResize=!1;Ct.read(()=>{b=window.innerWidth}),e(u,()=>{const _=window.innerWidth;_!==b&&(b=_,this.root.updateBlockedByResize=!0,p&&p(),p=gO(x,250),nh.hasAnimatedSinceResize&&(nh.hasAnimatedSinceResize=!1,this.nodes.forEach(mS)))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&f&&(h||m)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:b,hasRelativeLayoutChanged:x,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||f.getDefaultTransition()||OO,{onLayoutAnimationStart:S,onLayoutAnimationComplete:C}=f.getProps(),E=!this.targetLayout||!ME(this.targetLayout,_),T=!b&&x;if(this.options.layoutRoot||this.resumeFrom||T||b&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const N={...wb(y,"layout"),onPlay:S,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N),this.setAnimationOrigin(p,T)}else b||mS(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),sa(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(MO),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&DE(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const b=this.path[p];b.shouldResetTransform=!0,(typeof b.latestValues.x=="string"||typeof b.latestValues.y=="string")&&(b.isLayoutDirty=!0),b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}const{layoutId:h,layout:m}=this.options;if(h===void 0&&!m)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),u&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const m=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),m&&this.nodes.forEach(CO),this.nodes.forEach(hS);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(fS);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(EO),this.nodes.forEach(NO),this.nodes.forEach(_O),this.nodes.forEach(yO)):this.nodes.forEach(fS),this.clearAllSnapshots();const h=Zs.now();Ms.delta=Ni(0,1e3/60,h-Ms.timestamp),Ms.timestamp=h,Ms.isProcessing=!0,mp.update.process(Ms),mp.preRender.process(Ms),mp.render.process(Ms),Ms.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Tb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(kO),this.sharedNodes.forEach(jO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ct.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Qs(this.snapshot.measuredBox.x)&&!Qs(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 m=0;m<this.path.length;m++)this.path[m].updateScroll();const u=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=fs()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:h}=this.options;h&&h.notify("LayoutMeasure",this.layout.layoutBox,u?u.layoutBox:void 0)}updateScroll(u="measure"){let h=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(h=!1),h&&this.instance){const m=i(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:m,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!a)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,h=this.projectionDelta&&!AE(this.projectionDelta),m=this.getTransformTemplate(),f=m?m(this.latestValues,""):void 0,p=f!==this.prevTransformTemplateValue;u&&this.instance&&(h||Ra(this.latestValues)||p)&&(a(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const h=this.measurePageBox();let m=this.removeElementScroll(h);return u&&(m=this.removeTransform(m)),LO(m),{animationId:this.root.animationId,measuredBox:h,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:u}=this.options;if(!u)return fs();const h=u.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(BO))){const{scroll:f}=this.root;f&&(Si(h.x,f.offset.x),Si(h.y,f.offset.y))}return h}removeElementScroll(u){const h=fs();if(ii(h,u),this.scroll?.wasRoot)return h;for(let m=0;m<this.path.length;m++){const f=this.path[m],{scroll:p,options:b}=f;f!==this.root&&p&&b.layoutScroll&&(p.wasRoot&&ii(h,u),Si(h.x,p.offset.x),Si(h.y,p.offset.y))}return h}applyTransform(u,h=!1,m){const f=m||fs();ii(f,u);for(let p=0;p<this.path.length;p++){const b=this.path[p];!h&&b.options.layoutScroll&&b.scroll&&b!==b.root&&(Si(f.x,-b.scroll.offset.x),Si(f.y,-b.scroll.offset.y)),Ra(b.latestValues)&&th(f,b.latestValues,b.layout?.layoutBox)}return Ra(this.latestValues)&&th(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(u){const h=fs();ii(h,u);for(let m=0;m<this.path.length;m++){const f=this.path[m];if(!Ra(f.latestValues))continue;let p;f.instance&&(n0(f.latestValues)&&f.updateSnapshot(),p=fs(),ii(p,f.measurePageBox())),nS(h,f.latestValues,f.snapshot?.layoutBox,p)}return Ra(this.latestValues)&&nS(h,this.latestValues),h}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.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!==Ms.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!1){const h=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=h.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=h.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=h.isSharedProjectionDirty);const m=!!this.resumingFrom||this!==h;if(!(u||m&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:b}=this.options;if(!this.layout||!(p||b))return;this.resolvedRelativeTargetAt=Ms.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=fs(),this.targetWithTransforms=fs()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),nO(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ii(this.target,this.layout.layoutBox),bE(this.target,this.targetDelta)):ii(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||n0(this.parent.latestValues)||gE(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(u,h,m){this.relativeParent=u,this.linkedParentVersion=u.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fs(),this.relativeTargetOrigin=fs(),xh(this.relativeTargetOrigin,h,m,this.options.layoutAnchor||void 0),ii(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const u=this.getLead(),h=!!this.resumingFrom||this!==u;let m=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(m=!1),h&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(m=!1),this.resolvedRelativeTargetAt===Ms.timestamp&&(m=!1),m)return;const{layout:f,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||p))return;ii(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,x=this.treeScale.y;RD(this.layoutCorrected,this.treeScale,this.path,h),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=fs());const{target:_}=u;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Zy(this.prevProjectionDelta.x,this.projectionDelta.x),Zy(this.prevProjectionDelta.y,this.projectionDelta.y)),Oc(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==x||!lS(this.projectionDelta.x,this.prevProjectionDelta.x)||!lS(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){if(this.options.visualElement?.scheduleRender(),u){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Wo(),this.projectionDelta=Wo(),this.projectionDeltaWithTransform=Wo()}setAnimationOrigin(u,h=!1){const m=this.snapshot,f=m?m.latestValues:{},p={...this.latestValues},b=Wo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!h;const x=fs(),_=m?m.source:void 0,y=this.layout?this.layout.source:void 0,S=_!==y,C=this.getStack(),E=!C||C.members.length<=1,T=!!(S&&!E&&this.options.crossfade===!0&&!this.path.some(DO));this.animationProgress=0;let N;this.mixTargetDelta=M=>{const R=M/1e3;pS(b.x,u.x,R),pS(b.y,u.y,R),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xh(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),RO(this.relativeTarget,this.relativeTargetOrigin,x,R),N&&oO(this.relativeTarget,N)&&(this.isProjectionDirty=!1),N||(N=fs()),ii(N,this.relativeTarget)),S&&(this.animationValues=p,uO(p,f,this.latestValues,R,T,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(sa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ct.update(()=>{nh.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=el(0)),this.motionValue.jump(0,!1),this.currentAnimation=fO(this.motionValue,[0,1e3],{...u,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),u.onUpdate&&u.onUpdate(h)},onStop:()=>{},onComplete:()=>{u.onComplete&&u.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 u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(vO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead();let{targetWithTransforms:h,target:m,layout:f,latestValues:p}=u;if(!(!h||!m||!f)){if(this!==u&&this.layout&&f&&LE(this.options.animationType,this.layout.layoutBox,f.layoutBox)){m=this.target||fs();const b=Qs(this.layout.layoutBox.x);m.x.min=u.target.x.min,m.x.max=m.x.min+b;const x=Qs(this.layout.layoutBox.y);m.y.min=u.target.y.min,m.y.max=m.y.min+x}ii(h,m),th(h,p),Oc(this.projectionDeltaWithTransform,this.layoutCorrected,h,p)}}registerSharedNode(u,h){this.sharedNodes.has(u)||this.sharedNodes.set(u,new bO),this.sharedNodes.get(u).add(h);const f=h.options.initialPromotionConfig;h.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(h):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){const{layoutId:u}=this.options;return u?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:u}=this.options;return u?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:h,preserveFollowOpacity:m}={}){const f=this.getStack();f&&f.promote(this,m),u&&(this.projectionDelta=void 0,this.needsReset=!0),h&&this.setOptions({transition:h})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let h=!1;const{latestValues:m}=u;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(h=!0),!h)return;const f={};m.z&&wp("z",u,f,this.animationValues);for(let p=0;p<Sp.length;p++)wp(`rotate${Sp[p]}`,u,f,this.animationValues),wp(`skew${Sp[p]}`,u,f,this.animationValues);u.render();for(const p in f)u.setStaticValue(p,f[p]),this.animationValues&&(this.animationValues[p]=f[p]);u.scheduleRender()}applyProjectionStyles(u,h){if(!this.instance||this.isSVG)return;if(!this.isVisible){u.visibility="hidden";return}const m=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,u.visibility="",u.opacity="",u.pointerEvents=sh(h?.pointerEvents)||"",u.transform=m?m(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(u.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,u.pointerEvents=sh(h?.pointerEvents)||""),this.hasProjected&&!Ra(this.latestValues)&&(u.transform=m?m({},""):"none",this.hasProjected=!1);return}u.visibility="";const p=f.animationValues||f.latestValues;this.applyTransformsToTarget();let b=lO(this.projectionDeltaWithTransform,this.treeScale,p);m&&(b=m(p,b)),u.transform=b;const{x,y:_}=this.projectionDelta;u.transformOrigin=`${x.origin*100}% ${_.origin*100}% 0`,f.animationValues?u.opacity=f===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:u.opacity=f===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const y in r0){if(p[y]===void 0)continue;const{correct:S,applyTo:C,isCSSVariable:E}=r0[y],T=b==="none"?p[y]:S(p[y],f);if(C){const N=C.length;for(let M=0;M<N;M++)u[C[M]]=T}else E?this.options.visualElement.renderState.vars[y]=T:u[y]=T}this.options.layoutId&&(u.pointerEvents=f===this?sh(h?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>u.currentAnimation?.stop()),this.root.nodes.forEach(hS),this.root.sharedNodes.clear()}}}function _O(e){e.updateLayout()}function yO(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;if(a==="size")yi(p=>{const b=o?t.measuredBox[p]:t.layoutBox[p],x=Qs(b);b.min=s[p].min,b.max=b.min+x});else if(a==="x"||a==="y"){const p=a==="x"?"y":"x";a0(o?t.measuredBox[p]:t.layoutBox[p],s[p])}else LE(a,t.layoutBox,s)&&yi(p=>{const b=o?t.measuredBox[p]:t.layoutBox[p],x=Qs(s[p]);b.max=b.min+x,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+x)});const u=Wo();Oc(u,s,t.layoutBox);const h=Wo();o?Oc(h,e.applyTransform(i,!0),t.measuredBox):Oc(h,s,t.layoutBox);const m=!AE(u);let f=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:b,layout:x}=p;if(b&&x){const _=e.options.layoutAnchor||void 0,y=fs();xh(y,t.layoutBox,b.layoutBox,_);const S=fs();xh(S,s,x.layoutBox,_),ME(y,S)||(f=!0),p.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=y,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:h,layoutDelta:u,hasLayoutChanged:m,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function SO(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function wO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function kO(e){e.clearSnapshot()}function hS(e){e.clearMeasurements()}function CO(e){e.isLayoutDirty=!0,e.updateLayout()}function fS(e){e.isLayoutDirty=!1}function EO(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function NO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function mS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function TO(e){e.resolveTargetDelta()}function AO(e){e.calcProjection()}function MO(e){e.resetSkewAndRotation()}function jO(e){e.removeLeadSnapshot()}function pS(e,t,s){e.translate=jt(t.translate,0,s),e.scale=jt(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function gS(e,t,s,i){e.min=jt(t.min,s.min,i),e.max=jt(t.max,s.max,i)}function RO(e,t,s,i){gS(e.x,t.x,s.x,i),gS(e.y,t.y,s.y,i)}function DO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const OO={duration:.45,ease:[.4,0,.1,1]},bS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),vS=bS("applewebkit/")&&!bS("chrome/")?Math.round:Gn;function xS(e){e.min=vS(e.min),e.max=vS(e.max)}function LO(e){xS(e.x),xS(e.y)}function LE(e,t,s){return e==="position"||e==="preserve-aspect"&&!sO(oS(t),oS(s),.2)}function BO(e){return e!==e.root&&e.scroll?.wasRoot}const zO=OE({attachResizeListener:(e,t)=>Vc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),kp={current:void 0},BE=OE({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!kp.current){const e=new zO({});e.mount(window),e.setOptions({layoutScroll:!0}),kp.current=e}return kp.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),zE=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function IO(e=!0){const t=w.useContext(ub);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:i,register:a}=t,o=w.useId();w.useEffect(()=>{if(e)return a(o)},[e]);const u=w.useCallback(()=>e&&i&&i(o),[o,i,e]);return!s&&i?[!1,u]:[!0]}const IE=w.createContext({strict:!1}),_S={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 yS=!1;function PO(){if(yS)return;const e={};for(const t in _S)e[t]={isEnabled:s=>_S[t].some(i=>!!s[i])};fE(e),yS=!0}function PE(){return PO(),TD()}function $O(e){const t=PE();for(const s in e)t[s]={...t[s],...e[s]};fE(t)}const HO=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 _h(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||HO.has(e)}let $E=e=>!_h(e);function UO(e){typeof e=="function"&&($E=t=>t.startsWith("on")?!_h(t):e(t))}try{UO(require("@emotion/is-prop-valid").default)}catch{}function FO(e,t,s){const i={};for(const a in e)a==="values"&&typeof e.values=="object"||Rs(e[a])||($E(a)||s===!0&&_h(a)||!t&&!_h(a)||e.draggable&&a.startsWith("onDrag"))&&(i[a]=e[a]);return i}const Yh=w.createContext({});function VO(e,t){if(Wh(e)){const{initial:s,animate:i}=e;return{initial:s===!1||Fc(s)?s:void 0,animate:Fc(i)?i:void 0}}return e.inherit!==!1?t:{}}function qO(e){const{initial:t,animate:s}=VO(e,w.useContext(Yh));return w.useMemo(()=>({initial:t,animate:s}),[SS(t),SS(s)])}function SS(e){return Array.isArray(e)?e.join(" "):e}const Lb=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function HE(e,t,s){for(const i in t)!Rs(t[i])&&!_E(i,s)&&(e[i]=t[i])}function GO({transformTemplate:e},t){return w.useMemo(()=>{const s=Lb();return Db(s,t,e),Object.assign({},s.vars,s.style)},[t])}function KO(e,t){const s=e.style||{},i={};return HE(i,s,e),Object.assign(i,GO(e,t)),i}function WO(e,t){const s={},i=KO(e,t);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=i,s}const UE=()=>({...Lb(),attrs:{}});function YO(e,t,s,i){const a=w.useMemo(()=>{const o=UE();return yE(o,t,wE(i),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};HE(o,e.style,e),a.style={...o,...a.style}}return a}const XO=["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 Bb(e){return typeof e!="string"||e.includes("-")?!1:!!(XO.indexOf(e)>-1||/[A-Z]/u.test(e))}function ZO(e,t,s,{latestValues:i},a,o=!1,u){const m=(u??Bb(e)?YO:WO)(t,i,a,e),f=FO(t,typeof e=="string",o),p=e!==w.Fragment?{...f,...m,ref:s}:{},{children:b}=t,x=w.useMemo(()=>Rs(b)?b.get():b,[b]);return w.createElement(e,{...p,children:x})}function QO({scrapeMotionValuesFromProps:e,createRenderState:t},s,i,a){return{latestValues:JO(s,i,a,e),renderState:t()}}function JO(e,t,s,i){const a={},o=i(e,{});for(const x in o)a[x]=sh(o[x]);let{initial:u,animate:h}=e;const m=Wh(e),f=dE(e);t&&f&&!m&&e.inherit!==!1&&(u===void 0&&(u=t.initial),h===void 0&&(h=t.animate));let p=s?s.initial===!1:!1;p=p||u===!1;const b=p?h:u;if(b&&typeof b!="boolean"&&!Kh(b)){const x=Array.isArray(b)?b:[b];for(let _=0;_<x.length;_++){const y=Cb(e,x[_]);if(y){const{transitionEnd:S,transition:C,...E}=y;for(const T in E){let N=E[T];if(Array.isArray(N)){const M=p?N.length-1:0;N=N[M]}N!==null&&(a[T]=N)}for(const T in S)a[T]=S[T]}}}return a}const FE=e=>(t,s)=>{const i=w.useContext(Yh),a=w.useContext(ub),o=()=>QO(e,t,i,a);return s?o():X6(o)},eL=FE({scrapeMotionValuesFromProps:Ob,createRenderState:Lb}),tL=FE({scrapeMotionValuesFromProps:kE,createRenderState:UE}),sL=Symbol.for("motionComponentSymbol");function nL(e,t,s){const i=w.useRef(s);w.useInsertionEffect(()=>{i.current=s});const a=w.useRef(null);return w.useCallback(o=>{o&&e.onMount?.(o);const u=i.current;if(typeof u=="function")if(o){const h=u(o);typeof h=="function"&&(a.current=h)}else a.current?(a.current(),a.current=null):u(o);else u&&(u.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const VE=w.createContext({});function Vo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function iL(e,t,s,i,a,o){const{visualElement:u}=w.useContext(Yh),h=w.useContext(IE),m=w.useContext(ub),f=w.useContext(zE),p=f.reducedMotion,b=f.skipAnimations,x=w.useRef(null),_=w.useRef(!1);i=i||h.renderer,!x.current&&i&&(x.current=i(e,{visualState:t,parent:u,props:s,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:p,skipAnimations:b,isSVG:o}),_.current&&x.current&&(x.current.manuallyAnimateOnMount=!0));const y=x.current,S=w.useContext(VE);y&&!y.projection&&a&&(y.type==="html"||y.type==="svg")&&rL(x.current,s,a,S);const C=w.useRef(!1);w.useInsertionEffect(()=>{y&&C.current&&y.update(s,m)});const E=s[QC],T=w.useRef(!!E&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(E)&&window.MotionHasOptimisedAnimation?.(E));return Q6(()=>{_.current=!0,y&&(C.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),T.current&&y.animationState&&y.animationState.animateChanges())}),w.useEffect(()=>{y&&(!T.current&&y.animationState&&y.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(E)}),T.current=!1),y.enteringChildren=void 0)}),y}function rL(e,t,s,i){const{layoutId:a,layout:o,drag:u,dragConstraints:h,layoutScroll:m,layoutRoot:f,layoutAnchor:p,layoutCrossfade:b}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:qE(e.parent)),e.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:!!u||h&&Vo(h),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:b,layoutScroll:m,layoutRoot:f,layoutAnchor:p})}function qE(e){if(e)return e.options.allowProjection!==!1?e.projection:qE(e.parent)}function Cp(e,{forwardMotionProps:t=!1,type:s}={},i,a){i&&$O(i);const o=s?s==="svg":Bb(e),u=o?tL:eL;function h(f,p){let b;const x={...w.useContext(zE),...f,layoutId:aL(f)},{isStatic:_}=x,y=qO(f),S=u(f,_);if(!_&&typeof window<"u"){oL();const C=lL(x);b=C.MeasureLayout,y.visualElement=iL(e,S,x,a,C.ProjectionNode,o)}return l.jsxs(Yh.Provider,{value:y,children:[b&&y.visualElement?l.jsx(b,{visualElement:y.visualElement,...x}):null,ZO(e,f,nL(S,y.visualElement,p),S,_,t,o)]})}h.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const m=w.forwardRef(h);return m[sL]=e,m}function aL({layoutId:e}){const t=w.useContext(uC).id;return t&&e!==void 0?t+"-"+e:e}function oL(e,t){w.useContext(IE).strict}function lL(e){const t=PE(),{drag:s,layout:i}=t;if(!s&&!i)return{};const a={...s,...i};return{MeasureLayout:s?.isEnabled(e)||i?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function cL(e,t){if(typeof Proxy>"u")return Cp;const s=new Map,i=(o,u)=>Cp(o,u,e,t),a=(o,u)=>i(o,u);return new Proxy(a,{get:(o,u)=>u==="create"?i:(s.has(u)||s.set(u,Cp(u,void 0,e,t)),s.get(u))})}const uL=(e,t)=>t.isSVG??Bb(e)?new qD(t):new PD(t,{allowProjection:e!==w.Fragment});class dL extends aa{constructor(t){super(t),t.animationState||(t.animationState=XD(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Kh(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let hL=0;class fL extends aa{constructor(){super(...arguments),this.id=hL++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;if(t&&i===!1){if(this.isExitComplete){const{initial:o,custom:u}=this.node.getProps();if(typeof o=="string"){const h=Ha(this.node,o,u);if(h){const{transition:m,transitionEnd:f,...p}=h;for(const b in p)this.node.getValue(b)?.jump(p[b])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const a=this.node.animationState.setActive("exit",!t);s&&!t&&a.then(()=>{this.isExitComplete=!0,s(this.id)})}mount(){const{register:t,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const mL={animation:{Feature:dL},exit:{Feature:fL}};function ru(e){return{point:{x:e.pageX,y:e.pageY}}}const pL=e=>t=>Ab(t)&&e(t,ru(t));function Lc(e,t,s,i){return Vc(e,t,pL(s),i)}const GE=({current:e})=>e?e.ownerDocument.defaultView:null,wS=(e,t)=>Math.abs(e-t);function gL(e,t){const s=wS(e.x,t.x),i=wS(e.y,t.y);return Math.sqrt(s**2+i**2)}const kS=new Set(["auto","scroll"]);class KE{constructor(t,s,{transformPagePoint:i,contextWindow:a=window,dragSnapToOrigin:o=!1,distanceThreshold:u=3,element:h}={}){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=_=>{this.handleScroll(_.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Dd(this.lastRawMoveEventInfo,this.transformPagePoint));const _=Ep(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,S=gL(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!S)return;const{point:C}=_,{timestamp:E}=Ms;this.history.push({...C,timestamp:E});const{onStart:T,onMove:N}=this.handlers;y||(T&&T(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,_)},this.handlePointerMove=(_,y)=>{this.lastMoveEvent=_,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=Dd(y,this.transformPagePoint),Ct.update(this.updatePoint,!0)},this.handlePointerUp=(_,y)=>{this.end();const{onEnd:S,onSessionEnd:C,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=Ep(_.type==="pointercancel"?this.lastMoveEventInfo:Dd(y,this.transformPagePoint),this.history);this.startEvent&&S&&S(_,T),C&&C(_,T)},!Ab(t))return;this.dragSnapToOrigin=o,this.handlers=s,this.transformPagePoint=i,this.distanceThreshold=u,this.contextWindow=a||window;const m=ru(t),f=Dd(m,this.transformPagePoint),{point:p}=f,{timestamp:b}=Ms;this.history=[{...p,timestamp:b}];const{onSessionStart:x}=s;x&&x(t,Ep(f,this.history)),this.removeListeners=su(Lc(this.contextWindow,"pointermove",this.handlePointerMove),Lc(this.contextWindow,"pointerup",this.handlePointerUp),Lc(this.contextWindow,"pointercancel",this.handlePointerUp)),h&&this.startScrollTracking(h)}startScrollTracking(t){let s=t.parentElement;for(;s;){const i=getComputedStyle(s);(kS.has(i.overflowX)||kS.has(i.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.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(t){const s=this.scrollPositions.get(t);if(!s)return;const i=t===window,a=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:a.x-s.x,y:a.y-s.y};o.x===0&&o.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,a),Ct.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),sa(this.updatePoint)}}function Dd(e,t){return t?{point:t(e.point)}:e}function CS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ep({point:e},t){return{point:e,delta:CS(e,WE(t)),offset:CS(e,bL(t)),velocity:vL(t,.1)}}function bL(e){return e[0]}function WE(e){return e[e.length-1]}function vL(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,i=null;const a=WE(e);for(;s>=0&&(i=e[s],!(a.timestamp-i.timestamp>An(t)));)s--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&a.timestamp-i.timestamp>An(t)*2&&(i=e[1]);const o=qn(a.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const u={x:(a.x-i.x)/o,y:(a.y-i.y)/o};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}function xL(e,{min:t,max:s},i){return t!==void 0&&e<t?e=i?jt(t,e,i.min):Math.max(e,t):s!==void 0&&e>s&&(e=i?jt(s,e,i.max):Math.min(e,s)),e}function ES(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function _L(e,{top:t,left:s,bottom:i,right:a}){return{x:ES(e.x,s,a),y:ES(e.y,t,i)}}function NS(e,t){let s=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,i]=[i,s]),{min:s,max:i}}function yL(e,t){return{x:NS(e.x,t.x),y:NS(e.y,t.y)}}function SL(e,t){let s=.5;const i=Qs(e),a=Qs(t);return a>i?s=Hc(t.min,t.max-i,e.min):i>a&&(s=Hc(e.min,e.max-a,t.min)),Ni(0,1,s)}function wL(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const o0=.35;function kL(e=o0){return e===!1?e=0:e===!0&&(e=o0),{x:TS(e,"left","right"),y:TS(e,"top","bottom")}}function TS(e,t,s){return{min:AS(e,t),max:AS(e,s)}}function AS(e,t){return typeof e=="number"?e:e[t]||0}const CL=new WeakMap;class EL{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fs(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:i}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const o=b=>{s&&this.snapToCursor(ru(b).point),this.stopAnimation()},u=(b,x)=>{const{drag:_,dragPropagation:y,onDragStart:S}=this.getProps();if(_&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=iD(_),!this.openDragLock))return;this.latestPointerEvent=b,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),yi(E=>{let T=this.getAxisMotionValue(E).get()||0;if(ki.test(T)){const{projection:N}=this.visualElement;if(N&&N.layout){const M=N.layout.layoutBox[E];M&&(T=Qs(M)*(parseFloat(T)/100))}}this.originPoint[E]=T}),S&&Ct.update(()=>S(b,x),!1,!0),Qg(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},h=(b,x)=>{this.latestPointerEvent=b,this.latestPanInfo=x;const{dragPropagation:_,dragDirectionLock:y,onDirectionLock:S,onDrag:C}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:E}=x;if(y&&this.currentDirection===null){this.currentDirection=TL(E),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",x.point,E),this.updateAxis("y",x.point,E),this.visualElement.render(),C&&Ct.update(()=>C(b,x),!1,!0)},m=(b,x)=>{this.latestPointerEvent=b,this.latestPanInfo=x,this.stop(b,x),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:b}=this.getProps();(b||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new KE(t,{onSessionStart:o,onStart:u,onMove:h,onSessionEnd:m,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:i,contextWindow:GE(this.visualElement),element:this.visualElement.current})}stop(t,s){const i=t||this.latestPointerEvent,a=s||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!a||!i)return;const{velocity:u}=a;this.startAnimation(u);const{onDragEnd:h}=this.getProps();h&&Ct.postRender(()=>h(i,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,i){const{drag:a}=this.getProps();if(!i||!Od(t,a,this.currentDirection))return;const o=this.getAxisMotionValue(t);let u=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(u=xL(u,this.constraints[t],this.elastic[t])),o.set(u)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,a=this.constraints;t&&Vo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=_L(i.layoutBox,t):this.constraints=!1,this.elastic=kL(s),a!==this.constraints&&!Vo(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&yi(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=wL(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!Vo(t))return!1;const i=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const o=DD(i,a.root,this.visualElement.getTransformPagePoint());let u=yL(a.layout.layoutBox,o);if(s){const h=s(MD(u));this.hasMutatedConstraints=!!h,h&&(u=pE(h))}return u}startAnimation(t){const{drag:s,dragMomentum:i,dragElastic:a,dragTransition:o,dragSnapToOrigin:u,onDragTransitionEnd:h}=this.getProps(),m=this.constraints||{},f=yi(p=>{if(!Od(p,s,this.currentDirection))return;let b=m&&m[p]||{};(u===!0||u===p)&&(b={min:0,max:0});const x=a?200:1e6,_=a?40:1e7,y={type:"inertia",velocity:i?t[p]:0,bounceStiffness:x,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...o,...b};return this.startAxisValueAnimation(p,y)});return Promise.all(f).then(h)}startAxisValueAnimation(t,s){const i=this.getAxisMotionValue(t);return Qg(this.visualElement,t),i.start(kb(t,i,0,s,this.visualElement,!1))}stopAnimation(){yi(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),a=i[s];return a||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){yi(s=>{const{drag:i}=this.getProps();if(!Od(s,i,this.currentDirection))return;const{projection:a}=this.visualElement,o=this.getAxisMotionValue(s);if(a&&a.layout){const{min:u,max:h}=a.layout.layoutBox[s],m=o.get()||0;o.set(t[s]-jt(u,h,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:i}=this.visualElement;if(!Vo(s)||!i||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};yi(u=>{const h=this.getAxisMotionValue(u);if(h&&this.constraints!==!1){const m=h.get();a[u]=SL({min:m,max:m},this.constraints[u])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),yi(u=>{if(!Od(u,t,null))return;const h=this.getAxisMotionValue(u),{min:m,max:f}=this.constraints[u];h.set(jt(m,f,a[u]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;CL.set(this.visualElement,this);const t=this.visualElement.current,s=Lc(t,"pointerdown",f=>{const{drag:p,dragListener:b=!0}=this.getProps(),x=f.target,_=x!==t&&uD(x);p&&b&&!_&&this.start(f)});let i;const a=()=>{const{dragConstraints:f}=this.getProps();Vo(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),i||(i=NL(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,u=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Ct.read(a);const h=Vc(window,"resize",()=>this.scalePositionWithinConstraints()),m=o.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:p})=>{this.isDragging&&p&&(yi(b=>{const x=this.getAxisMotionValue(b);x&&(this.originPoint[b]+=f[b].translate,x.set(x.get()+f[b].translate))}),this.visualElement.render())}));return()=>{h(),s(),u(),m&&m(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:i=!1,dragPropagation:a=!1,dragConstraints:o=!1,dragElastic:u=o0,dragMomentum:h=!0}=t;return{...t,drag:s,dragDirectionLock:i,dragPropagation:a,dragConstraints:o,dragElastic:u,dragMomentum:h}}}function MS(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function NL(e,t,s){const i=Py(e,MS(s)),a=Py(t,MS(s));return()=>{i(),a()}}function Od(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function TL(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class AL extends aa{constructor(t){super(t),this.removeGroupControls=Gn,this.removeListeners=Gn,this.controls=new EL(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Gn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Np=e=>(t,s)=>{e&&Ct.update(()=>e(t,s),!1,!0)};class ML extends aa{constructor(){super(...arguments),this.removePointerDownListener=Gn}onPointerDown(t){this.session=new KE(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:GE(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:i,onPanEnd:a}=this.node.getProps();return{onSessionStart:Np(t),onStart:Np(s),onMove:Np(i),onEnd:(o,u)=>{delete this.session,a&&Ct.postRender(()=>a(o,u))}}}mount(){this.removePointerDownListener=Lc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Tp=!1;class jL extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:i,layoutId:a}=this.props,{projection:o}=t;o&&(s.group&&s.group.add(o),i&&i.register&&a&&i.register(o),Tp&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),nh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:i,drag:a,isPresent:o}=this.props,{projection:u}=i;return u&&(u.isPresent=o,t.layoutDependency!==s&&u.setOptions({...u.options,layoutDependency:s}),Tp=!0,a||t.layoutDependency!==s||s===void 0||t.isPresent!==o?u.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?u.promote():u.relegate()||Ct.postRender(()=>{const h=u.getStack();(!h||!h.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:s}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=s,i.root.didUpdate(),Tb.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:i}=this.props,{projection:a}=t;Tp=!0,a&&(a.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(a),i&&i.deregister&&i.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function YE(e){const[t,s]=IO(),i=w.useContext(uC);return l.jsx(jL,{...e,layoutGroup:i,switchLayoutGroup:w.useContext(VE),isPresent:t,safeToRemove:s})}const RL={pan:{Feature:ML},drag:{Feature:AL,ProjectionNode:BE,MeasureLayout:YE}};function jS(e,t,s){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",s==="Start");const a="onHover"+s,o=i[a];o&&Ct.postRender(()=>o(t,ru(t)))}class DL extends aa{mount(){const{current:t}=this.node;t&&(this.unmount=aD(t,(s,i)=>(jS(this.node,i,"Start"),a=>jS(this.node,a,"End"))))}unmount(){}}class OL extends aa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=su(Vc(this.node.current,"focus",()=>this.onFocus()),Vc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function RS(e,t,s){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",s==="Start");const a="onTap"+(s==="End"?"":s),o=i[a];o&&Ct.postRender(()=>o(t,ru(t)))}class LL extends aa{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:s,propagate:i}=this.node.props;this.unmount=hD(t,(a,o)=>(RS(this.node,o,"Start"),(u,{success:h})=>RS(this.node,u,h?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:i?.tap===!1})}unmount(){}}const l0=new WeakMap,Ap=new WeakMap,BL=e=>{const t=l0.get(e.target);t&&t(e)},zL=e=>{e.forEach(BL)};function IL({root:e,...t}){const s=e||document;Ap.has(s)||Ap.set(s,{});const i=Ap.get(s),a=JSON.stringify(t);return i[a]||(i[a]=new IntersectionObserver(zL,{root:e,...t})),i[a]}function PL(e,t,s){const i=IL(t);return l0.set(e,s),i.observe(e),()=>{l0.delete(e),i.unobserve(e)}}const $L={some:0,all:1};class HL extends aa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:s,margin:i,amount:a="some",once:o}=t,u={root:s?s.current:void 0,rootMargin:i,threshold:typeof a=="number"?a:$L[a]},h=m=>{const{isIntersecting:f}=m;if(this.isInView===f||(this.isInView=f,o&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:b}=this.node.getProps(),x=f?p:b;x&&x(m)};this.stopObserver=PL(this.node.current,u,h)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(UL(t,s))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function UL({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const FL={inView:{Feature:HL},tap:{Feature:LL},focus:{Feature:OL},hover:{Feature:DL}},VL={layout:{ProjectionNode:BE,MeasureLayout:YE}},qL={...mL,...FL,...RL,...VL},Mp=cL(qL,uL),$e=({label:e,children:t,variant:s="primary",size:i="medium",icon:a,onClick:o,removable:u=!1,className:h,maxWidth:m,appearance:f,onRemove:p,isLoading:b=!1})=>{const x=GL(s),_=f??(s==="outline"?"outline":"solid"),y=e??t,S=!!o,C={primary:{solid:"border border-transparent bg-primary text-primary-foreground dark:border-zinc-700/80 dark:bg-zinc-900/80 dark:text-zinc-100",outline:"border-2 border-primary/60 text-foreground dark:border-zinc-700/80 dark:bg-zinc-900/80 dark:text-zinc-100",subtle:"border border-transparent bg-primary/15 text-foreground dark:border-zinc-700/70 dark:bg-zinc-900/70 dark:text-zinc-200"},secondary:{solid:"border border-transparent bg-secondary text-secondary-foreground dark:border-zinc-700/80 dark:bg-zinc-900/80 dark:text-zinc-200",outline:"border-2 border-border bg-card text-foreground dark:border-zinc-700/80 dark:bg-zinc-900/80 dark:text-zinc-200",subtle:"border border-border bg-muted text-foreground dark:border-zinc-700/70 dark:bg-zinc-900/70 dark:text-zinc-200"},success:{solid:"border border-transparent bg-emerald-600 text-white dark:border-emerald-400/30 dark:bg-emerald-500/15 dark:text-emerald-300",outline:"border-2 border-emerald-600 text-emerald-700 dark:border-emerald-400/40 dark:bg-emerald-500/10 dark:text-emerald-300",subtle:"border border-transparent bg-emerald-500/15 text-emerald-700 dark:border-emerald-400/25 dark:bg-emerald-500/15 dark:text-emerald-300"},warning:{solid:"border border-transparent bg-amber-500 text-white dark:border-amber-400/30 dark:bg-amber-500/15 dark:text-amber-300",outline:"border-2 border-amber-500 text-amber-700 dark:border-amber-400/40 dark:bg-amber-500/10 dark:text-amber-300",subtle:"border border-transparent bg-amber-500/15 text-amber-700 dark:border-amber-400/25 dark:bg-amber-500/15 dark:text-amber-300"},error:{solid:"border border-transparent bg-destructive text-destructive-foreground dark:border-red-400/30 dark:bg-red-500/15 dark:text-red-300",outline:"border-2 border-destructive text-destructive dark:border-red-400/40 dark:bg-red-500/10 dark:text-red-300",subtle:"border border-transparent bg-destructive/20 text-destructive dark:border-red-400/25 dark:bg-red-500/15 dark:text-red-300"}},E={small:"text-xs px-2 py-1",medium:"text-xs px-2.5 py-1",large:"text-sm px-3 py-1.5"},T=M=>{M.stopPropagation(),o?.()},N=M=>{M.stopPropagation(),p?.()};return l.jsxs(Mp.div,{initial:{opacity:0,scale:.95,y:8,filter:"blur(8px)"},animate:{opacity:1,scale:1,y:0,filter:"blur(0px)"},transition:{duration:.32,ease:"easeInOut",type:"spring"},whileHover:{scale:S?1.04:1,transition:{duration:.2,ease:"easeInOut",type:"spring"}},onClick:T,style:{maxWidth:m},className:de("inline-flex max-w-full items-center gap-1.5 rounded-lg font-medium shadow-[0_0_16px_rgba(0,0,0,0.14)] backdrop-blur-sm",C[x][_],E[i],S&&"cursor-pointer",h),children:[b?l.jsx(Mp.div,{animate:{rotate:360},transition:{duration:1,ease:"linear",repeat:1/0},className:"flex-shrink-0",children:l.jsx(Os,{className:"size-3.5"})}):a&&l.jsx("span",{className:"flex-shrink-0",children:a}),l.jsx("span",{className:"min-w-0 truncate",children:y}),u&&l.jsx(Mp.button,{initial:{opacity:0,scale:.95,filter:"blur(8px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},whileHover:{scale:1.1,opacity:1,transition:{duration:.2,ease:"easeInOut",type:"spring"}},className:"flex items-center justify-center rounded-md bg-foreground/15 p-1 opacity-70 hover:opacity-100",onClick:N,type:"button",children:l.jsx(Js,{className:"size-3.5"})})]})};function GL(e){return e==="danger"?"error":e==="default"||e==="outline"?"primary":e}const KL=Yk("rounded-lg border p-4 text-sm",{variants:{variant:{default:"border-border bg-card text-card-foreground",muted:"border-border bg-muted text-muted-foreground",destructive:"border-destructive/40 bg-destructive/10 text-destructive dark:text-red-300"}},defaultVariants:{variant:"default"}});function it({className:e,variant:t,...s}){return l.jsx("div",{className:de(KL({variant:t,className:e})),...s})}function yh(e){return de("group/header-action inline-flex h-8 w-8 items-center overflow-hidden rounded-md text-sm font-medium text-muted-foreground transition-[width,background-color,color] duration-200 hover:w-24 hover:bg-muted hover:text-foreground focus:w-24 focus:bg-muted focus:text-foreground focus-visible:w-24 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",e)}function Sh(e){return de("flex size-8 shrink-0 items-center justify-center [&_svg]:size-4 [&_svg]:shrink-0",e)}function wh(e){return de("max-w-0 overflow-hidden whitespace-nowrap text-left opacity-0 transition-[max-width,opacity] duration-200 group-hover/header-action:max-w-20 group-hover/header-action:opacity-100 group-focus/header-action:max-w-20 group-focus/header-action:opacity-100",e)}function Mi({className:e,...t}){return l.jsx("div",{className:de("rounded-lg border border-border bg-card text-card-foreground",e),...t})}function ji({className:e,...t}){return l.jsx("div",{className:de("grid gap-1.5 p-4",e),...t})}function Ri({className:e,...t}){return l.jsx("h3",{className:de("text-sm font-semibold tracking-tight",e),...t})}function dr({className:e,...t}){return l.jsx("p",{className:de("text-sm text-muted-foreground",e),...t})}function Di({className:e,...t}){return l.jsx("div",{className:de("p-4 pt-0",e),...t})}const DS=100;function WL(){const[e,t]=w.useState([]),[s,i]=w.useState(!1),a=w.useRef(new Set);w.useEffect(()=>{const u=new EventSource("/api/agent/tool-calls/stream");return u.addEventListener("open",()=>i(!0)),u.addEventListener("error",()=>i(!1)),u.addEventListener("tool-call",h=>{try{const m=JSON.parse(h.data);t(f=>{if(a.current.has(m.id))return f;a.current.add(m.id);const p=[...f,m];return p.length>DS&&p.splice(0,p.length-DS),p})}catch{}}),()=>{u.close()}},[]);const o=[...e].reverse();return l.jsxs(Mi,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[l.jsxs(ji,{className:"border-b border-border px-3 py-2",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Pa,{className:"size-4 text-muted-foreground"}),l.jsx(Ri,{children:"Live MCP Tool Calls"}),l.jsx($e,{variant:"outline",size:"small",children:e.length})]}),l.jsx($e,{variant:"outline",size:"small",icon:l.jsx("span",{className:de("inline-block size-1.5 rounded-full",s?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:s?"live":"reconnecting…"})]}),l.jsx(dr,{className:"text-xs",children:"Streamed from this NoMoreIDE MCP server. Newest at the top."})]}),l.jsx(Di,{className:"p-0",children:o.length?l.jsx("ul",{className:"max-h-96 divide-y divide-border overflow-auto",children:o.map(u=>l.jsxs("li",{className:"px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:u.tool}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[l.jsxs("span",{children:[u.durationMs," ms"]}),l.jsx($e,{variant:u.status==="ok"?"success":"error",appearance:"outline",size:"small",children:u.status})]})]}),u.args?l.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px] text-muted-foreground",children:u.args}):null,u.error?l.jsx("div",{className:"mt-0.5 font-mono text-[11px] text-destructive",children:u.error}):null,l.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/80",children:new Date(u.startedAt).toLocaleTimeString()})]},u.id))}):l.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No tool calls yet. Invoke a NoMoreIDE MCP tool from your agent and it will appear here."})})]})}function YL({agent:e}){return l.jsxs(l.Fragment,{children:[l.jsx(WL,{}),l.jsxs(Mi,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[l.jsxs(ji,{className:"border-b border-border px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Fh,{className:"size-4 text-muted-foreground"}),l.jsx(Ri,{children:"Recent Projects"})]}),l.jsx($e,{variant:"outline",size:"small",children:e.projects.length})]}),l.jsx(dr,{className:"text-xs",children:"Most recently active projects known to the agent."})]}),l.jsx(Di,{className:"p-0",children:e.projects.length?l.jsx("ul",{className:"divide-y divide-border",children:e.projects.map(t=>l.jsxs("li",{className:de("flex items-start justify-between gap-3 px-3 py-2",t.current&&"bg-primary/5"),children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:t.path}),t.current?l.jsx($e,{variant:"outline",size:"small",children:"current"}):null]}),t.lastSessionFirstPrompt?l.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:t.lastSessionFirstPrompt}):null]}),l.jsxs("div",{className:"shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:[t.mcpServerCount?l.jsxs("div",{children:[t.mcpServerCount," mcp"]}):null,t.lastSessionModified?l.jsx("div",{children:XL(t.lastSessionModified)}):null]})]},t.path))}):l.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No known projects."})})]})]})}function XL(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function cl({className:e}){return l.jsx("svg",{className:de("size-3.5",e),viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:l.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})})}function au({className:e}){return l.jsx("svg",{className:de("size-3.5",e),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0,children:l.jsx("path",{d:"M11.248 18.25q-.825 0-1.568-.314a4.3 4.3 0 0 1-1.32-.874 4 4 0 0 1-1.304.214 4 4 0 0 1-2.046-.544 4.27 4.27 0 0 1-1.518-1.485 4 4 0 0 1-.56-2.095q0-.48.131-1.04A4.4 4.4 0 0 1 2.04 10.71a4.07 4.07 0 0 1 .017-3.4 4.2 4.2 0 0 1 1.056-1.418 3.8 3.8 0 0 1 1.6-.842 3.9 3.9 0 0 1 .76-1.683q.593-.759 1.451-1.188a4.04 4.04 0 0 1 1.832-.429q.825 0 1.567.313.742.314 1.32.875a4 4 0 0 1 1.304-.215q1.106 0 2.046.545a4.14 4.14 0 0 1 1.501 1.485q.578.941.578 2.095 0 .48-.132 1.04.66.61 1.023 1.419.363.792.363 1.666 0 .892-.38 1.717a4.3 4.3 0 0 1-1.072 1.435 3.8 3.8 0 0 1-1.584.825 3.8 3.8 0 0 1-.775 1.683 4.06 4.06 0 0 1-1.436 1.188 4.04 4.04 0 0 1-1.832.429m-4.076-2.062q.825 0 1.435-.347l3.103-1.782a.36.36 0 0 0 .164-.313v-1.42L7.881 14.62a.67.67 0 0 1-.726 0l-3.118-1.798a.5.5 0 0 1-.017.115v.198q0 .841.396 1.551.413.693 1.139 1.089a3.2 3.2 0 0 0 1.617.412m.165-2.69a.4.4 0 0 0 .181.05q.083 0 .165-.05l1.238-.71-3.977-2.31a.7.7 0 0 1-.363-.643v-3.58q-.825.362-1.32 1.122a2.9 2.9 0 0 0-.495 1.65q0 .809.413 1.55.412.743 1.072 1.123zm3.91 3.663q.875 0 1.585-.396a2.96 2.96 0 0 0 1.534-2.64v-3.564a.32.32 0 0 0-.165-.297l-1.254-.726v4.604a.7.7 0 0 1-.363.643l-3.119 1.799a3 3 0 0 0 1.783.577m.627-6.039V8.878L10.01 7.822 8.129 8.878v2.244l1.881 1.056zM7.057 5.859a.7.7 0 0 1 .363-.644l3.119-1.798a3 3 0 0 0-1.782-.578q-.874 0-1.584.396A2.96 2.96 0 0 0 6.05 4.324a3.07 3.07 0 0 0-.396 1.551v3.547q0 .199.165.314l1.237.726zm8.383 7.887q.825-.364 1.303-1.123.495-.758.495-1.65a3.15 3.15 0 0 0-.412-1.55q-.413-.743-1.073-1.123l-3.086-1.782q-.099-.065-.181-.049a.3.3 0 0 0-.165.05l-1.238.692 3.993 2.327a.6.6 0 0 1 .264.264.64.64 0 0 1 .1.363zm-3.317-8.382a.63.63 0 0 1 .726 0l3.135 1.831v-.297q0-.792-.396-1.501a2.86 2.86 0 0 0-1.105-1.155q-.71-.43-1.65-.43-.825 0-1.436.347L8.294 5.941a.36.36 0 0 0-.165.314v1.418z"})})}function ZL({className:e}){return l.jsx("svg",{className:de("size-3.5",e),viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:l.jsx("path",{d:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"})})}let OS=0;const LS=()=>(OS+=1,`t${Date.now()}-${OS}`);function QL(){const[e,t]=w.useState([]),[s,i]=w.useState(!1),[a,o]=w.useState(null),[u,h]=w.useState(null),[m,f]=w.useState(null),[p,b]=w.useState([]),x=w.useRef(null),_=w.useRef(void 0);w.useEffect(()=>{lj().then(T=>{h(T.configured),f(T.provider)}).catch(()=>h(!1))},[]);const y=w.useCallback(async(T,N)=>{b(R=>R.filter(z=>z.requestId!==T));const M=_.current;if(M)try{await cj(M,T,N)}catch{}},[]),S=w.useCallback(()=>{x.current?.abort(),x.current=null,i(!1)},[]),C=w.useCallback(async(T,N)=>{const M=T.trim();if(!M||s)return;o(null);const R={id:LS(),createdAt:Date.now(),role:"user",text:M,label:N?.label,tools:[]},z=LS(),L={id:z,createdAt:Date.now(),role:"assistant",text:"",tools:[]};t(P=>[...P,R,L]);const j=P=>t(F=>F.map(K=>K.id===z?P(K):K)),H=new AbortController;x.current=H,i(!0);try{await uj(M,_.current,P=>{switch(P.type){case"session":_.current=P.sessionId;break;case"text":j(F=>({...F,text:F.text+P.text}));break;case"tool_use":j(F=>({...F,tools:[...F.tools,{id:P.id,name:P.name,input:P.input,status:"running"}]}));break;case"tool_result":j(F=>({...F,tools:F.tools.map(K=>K.id===P.id?{...K,preview:P.preview,isError:P.isError,status:"done"}:K)}));break;case"approval_request":b(F=>[...F,{requestId:P.requestId,name:P.name,input:P.input}]);break;case"error":o(P.message);break;case"done":break}},H.signal)}catch(P){H.signal.aborted||o(P instanceof Error?P.message:String(P))}finally{x.current=null,i(!1)}},[s]),E=w.useCallback(()=>{S(),_.current=void 0,t([]),b([]),o(null)},[S]);return{turns:e,streaming:s,error:a,configured:u,provider:m,approvals:p,send:C,stop:S,clear:E,respond:y}}const XE=w.createContext(null);function JL({children:e}){const t=QL(),{streaming:s}=t,[i,a]=w.useState(!1),[o,u]=w.useState(""),[h,m]=w.useState(null),[f,p]=w.useState(0),[b,x]=w.useState(0),[_,y]=w.useState(!1),S=w.useRef([]),C=w.useCallback(()=>p(H=>H+1),[]),E=w.useCallback(()=>x(H=>H+1),[]),T=w.useCallback((H,P)=>(E(),t.send(H,P)),[t,E]),N=w.useCallback(()=>m(null),[]),M=w.useCallback(()=>{a(!0),y(!0)},[]),R=w.useCallback(H=>{a(!0),u(P=>P.trim()?`${P.replace(/\s*$/,"")}
|
|
18
|
-
${H}`:H),C()},[C]);w.useEffect(()=>{if(s)return;const H=S.current.shift();H&&T(H.prompt,{label:H.label})},[s,T]);const z=w.useCallback(({prompt:H,source:P,mode:F="send",label:K})=>(a(!0),m(P??null),E(),F==="draft"?(u(H),C(),{queued:!1}):s?(S.current.push({prompt:H,label:K}),{queued:!0}):(T(H,{label:K}),{queued:!1})),[s,T,C,E]),L=w.useCallback(()=>{S.current=[],m(null),t.clear()},[t]),j={...t,send:T,clear:L,open:i,setOpen:a,draft:o,setDraft:u,insertPath:R,activeSource:h,clearSource:N,focusNonce:f,stickNonce:b,sendToAgent:z,onboarding:_,setOnboarding:y,startOnboard:M};return l.jsx(XE.Provider,{value:j,children:e})}function Ls(){const e=w.useContext(XE);if(!e)throw new Error("useAgentDock must be used within an AgentProvider");return e}function e7(e){const t=Math.max(0,Math.floor(e/6e4));if(t<60)return`${t}m`;const s=Math.floor(t/60),i=t%60;return`${s}h ${String(i).padStart(2,"0")}m`}function t7(e,t=Date.now()){const s=e[0],i=s?t-s.createdAt:0,a=e.length,o=i>=60*6e4||a>=30,u=i>=30*6e4||a>=16,h=o?"heavy":u?"long":"fresh";return{durationLabel:s?e7(i):"0m",recommendation:h==="fresh"?null:"Consider starting a new chat for a cleaner context.",status:h,statusLabel:h==="heavy"?"Heavy context":h==="long"?"Long":"Fresh",turnCount:a}}function s7({now:e,onNewChat:t,turns:s}){const[i,a]=w.useState(()=>Date.now());w.useEffect(()=>{const h=window.setInterval(()=>a(Date.now()),3e4);return()=>window.clearInterval(h)},[]);const o=t7(s,e??i),u=s.length>0;return l.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border bg-background/55 px-3 py-2 text-xs",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx(tM,{className:de("size-4 shrink-0",o.status==="heavy"?"text-amber-500":o.status==="long"?"text-yellow-500":"text-muted-foreground")}),l.jsx("span",{className:"font-medium",children:"Conversation"}),l.jsx("span",{className:"font-mono text-muted-foreground",children:u?o.durationLabel:"not started"}),u?l.jsxs("span",{className:"font-mono text-muted-foreground",children:[o.turnCount," turns"]}):null]}),l.jsx($e,{appearance:o.status==="fresh"?"subtle":"solid",size:"small",variant:o.status==="heavy"?"warning":o.status==="long"?"secondary":"outline",children:o.statusLabel}),o.recommendation?l.jsx("span",{className:"min-w-0 flex-1 text-muted-foreground",children:o.recommendation}):l.jsx("span",{className:"min-w-0 flex-1 text-muted-foreground",children:"Short chats usually give the agent cleaner context."}),l.jsxs(re,{className:"h-7 gap-1.5 px-2 text-xs",disabled:!u,onClick:t,size:"sm",type:"button",variant:"outline",children:[l.jsx(ab,{className:"size-3.5"}),"New chat"]})]})}function n7({agent:e,agentId:t}){const s=e.project.instructionFileName??(e.project.claudeMdPath?"CLAUDE.md":void 0),i=e.project.instructionFilePreview??e.project.claudeMdPreview,a=e.project.memoryFiles.length+(s?1:0);return l.jsxs(Mi,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[l.jsxs(ji,{className:"border-b border-border px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(wk,{className:"size-4 text-muted-foreground"}),l.jsx(Ri,{children:"Project Memory"})]}),l.jsx($e,{variant:"outline",size:"small",children:a})]}),l.jsx(dr,{className:"truncate text-xs",children:e.project.memoryDir??(t==="codex"?"No Codex memory directory found for this project.":"No memory directory found for this project.")})]}),l.jsxs(Di,{className:"space-y-2 p-3",children:[s?l.jsx(BS,{title:s,preview:i,defaultOpen:!0}):null,e.project.memoryFiles.length?e.project.memoryFiles.map(o=>l.jsx(BS,{title:o.name,subtitle:`${o.size} B`,preview:o.preview,defaultOpen:o.name==="MEMORY.md"},o.path)):s?null:l.jsx("p",{className:"text-xs text-muted-foreground",children:"No memory files persisted yet for this project."})]})]})}function BS({title:e,subtitle:t,preview:s,defaultOpen:i=!1}){const[a,o]=w.useState(i);return l.jsxs("div",{className:"rounded-md border border-border bg-background/40",children:[l.jsxs("button",{type:"button",onClick:()=>o(!a),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-xs font-semibold",children:[l.jsx(ia,{className:de("size-3.5 text-muted-foreground transition-transform",a&&"rotate-90")}),l.jsx("span",{children:e}),t?l.jsx("span",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:t}):null]}),a&&s?l.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap border-t border-border px-2.5 py-2 font-mono text-[11px] leading-relaxed text-muted-foreground",children:s}):null]})}const i7=[{animationDelay:"-1.2s",transform:"rotate(.0001deg) translate(146%)"},{animationDelay:"-1.1s",transform:"rotate(30deg) translate(146%)"},{animationDelay:"-1.0s",transform:"rotate(60deg) translate(146%)"},{animationDelay:"-0.9s",transform:"rotate(90deg) translate(146%)"},{animationDelay:"-0.8s",transform:"rotate(120deg) translate(146%)"},{animationDelay:"-0.7s",transform:"rotate(150deg) translate(146%)"},{animationDelay:"-0.6s",transform:"rotate(180deg) translate(146%)"},{animationDelay:"-0.5s",transform:"rotate(210deg) translate(146%)"},{animationDelay:"-0.4s",transform:"rotate(240deg) translate(146%)"},{animationDelay:"-0.3s",transform:"rotate(270deg) translate(146%)"},{animationDelay:"-0.2s",transform:"rotate(300deg) translate(146%)"},{animationDelay:"-0.1s",transform:"rotate(330deg) translate(146%)"}],r7=({size:e=20,color:t="#8f8f8f"})=>l.jsx("div",{style:{width:e,height:e},children:l.jsx("div",{className:"relative left-1/2 top-1/2",style:{width:e,height:e},children:i7.map(s=>l.jsx("div",{className:"absolute -left-[10%] -top-[3.9%] h-[8%] w-[24%] animate-fade-spin rounded-[5px]",style:{backgroundColor:t,...s}},s.transform))})}),a7=[{tiny:"px-1.5 h-6 text-sm",small:"px-1.5 h-8 text-sm",medium:"px-2.5 h-10 text-sm",large:"px-3.5 h-12 text-base"},{tiny:"w-6 h-6 text-sm",small:"w-8 h-8 text-sm",medium:"w-10 h-10 text-sm",large:"w-12 h-12 text-base"}],o7={primary:"bg-gray-1000 hover:bg-gray-1000-h text-background-100 fill-background-100",secondary:"bg-background-100 hover:bg-gray-alpha-200 text-gray-1000 fill-gray-1000 border border-gray-alpha-400",tertiary:"bg-none hover:bg-gray-alpha-200 text-gray-1000 fill-gray-1000",error:"bg-red-800 hover:bg-red-900 text-white fill-white",warning:"bg-amber-800 hover:bg-amber-850 text-black fill-black"},l7={square:{tiny:"rounded",small:"rounded-md",medium:"rounded-md",large:"rounded-lg"},circle:{tiny:"rounded-[100%]",small:"rounded-[100%]",medium:"rounded-[100%]",large:"rounded-[100%]"},rounded:{tiny:"rounded-[100px]",small:"rounded-[100px]",medium:"rounded-[100px]",large:"rounded-[100px]"}},Ld=({size:e="medium",type:t="primary",variant:s="styled",shape:i="square",svgOnly:a=!1,children:o,prefix:u,suffix:h,shadow:m=!1,loading:f=!1,disabled:p=!1,fullWidth:b=!1,className:x,..._})=>l.jsxs("button",{disabled:p,tabIndex:0,className:$c("flex items-center justify-center gap-0.5 duration-150",a7[+a][e],p||f?"cursor-not-allowed border border-gray-400 bg-gray-100 text-gray-700":o7[t],l7[i][e],m&&"shadow-border-small border-none",b&&"w-full",s==="unstyled"?"h-fit bg-transparent px-0 text-gray-1000 outline-none hover:bg-transparent":"focus:shadow-focus-ring focus:outline-0",x),type:"button",..._,children:[f?l.jsx(r7,{size:e==="large"?24:16}):u,l.jsx("span",{className:$c("relative overflow-hidden overflow-ellipsis whitespace-nowrap font-sans",e!=="tiny"&&s!=="unstyled"&&"px-1.5"),children:o}),!f&&h]}),c7=({className:e})=>l.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z"})}),u7=()=>l.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:"fill-gray-1000",children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z"})});let jp=null,d7=0;const rs={toasts:[],listeners:new Set,add(e,t,s,i,a,o){const u=d7++,h={id:u,text:e,preserve:s,action:i,onAction:a,onUndoAction:o,type:t};if(!h.preserve){h.remaining=3e3,h.start=Date.now();const m=()=>{this.toasts=this.toasts.filter(f=>f.id!==u),this.notify()};h.timeout=setTimeout(m,h.remaining),h.pause=()=>{h.timeout&&(clearTimeout(h.timeout),h.timeout=void 0,h.remaining-=Date.now()-h.start)},h.resume=()=>{h.timeout||(h.start=Date.now(),h.timeout=setTimeout(m,h.remaining))}}this.toasts.push(h),this.notify()},remove(e){rs.toasts=rs.toasts.filter(t=>t.id!==e),rs.notify()},subscribe(e){return rs.listeners.add(e),()=>{rs.listeners.delete(e)}},notify(){rs.listeners.forEach(e=>{e()})}},h7=()=>{const[e,t]=w.useState([]),[s,i]=w.useState([]),[a,o]=w.useState(!1),u=y=>S=>{S&&y.measuredHeight==null&&(y.measuredHeight=S.getBoundingClientRect().height,rs.notify())};w.useEffect(()=>(t([...rs.toasts]),rs.subscribe(()=>{t([...rs.toasts])})),[]),w.useEffect(()=>{const y=e.filter(S=>!s.includes(S.id)).map(S=>S.id);y.length>0&&requestAnimationFrame(()=>{i(S=>[...S,...y])})},[s,e]);const m=Math.max(0,e.length-3),f=(y,S)=>{if(y===S-1)return"none";const C=S-1-y;let E=e[S-1]?.measuredHeight||63;for(let M=S-1;M>y;M--)a?E+=(e[M-1]?.measuredHeight||63)+10:E+=20;const T=-C,N=a?1:1-.05*C;return`translate3d(0, calc(100% - ${E}px), ${T}px) scale(${N})`},p=()=>{o(!0),rs.toasts.forEach(y=>{y.pause?.()})},b=()=>{o(!1),rs.toasts.forEach(y=>{y.resume?.()})},_=e.slice(m).reduce((y,S)=>y+(S.measuredHeight??63),0);return l.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[9999] w-[min(420px,calc(100vw-2rem))]",style:{height:_},children:l.jsx("div",{className:"pointer-events-auto relative w-full",style:{height:_},onMouseEnter:p,onMouseLeave:b,children:e.map((y,S)=>{const C=S>=m;return l.jsx("div",{ref:u(y),className:$c("absolute bottom-0 right-0 h-fit rounded-xl p-4 leading-[21px] shadow-menu",{message:"bg-geist-background text-gray-1000",success:"bg-blue-700 text-contrast-fg",warning:"bg-amber-800 text-gray-1000 dark:text-gray-100",error:"bg-red-800 text-contrast-fg"}[y.type],C?"opacity-100":"opacity-0",S<m&&"pointer-events-none"),style:{width:"100%",transition:"all .35s cubic-bezier(.25,.75,.6,.98)",transform:s.includes(y.id)?f(S,e.length):"translate3d(0, 100%, 150px) scale(1)"},children:l.jsxs("div",{className:"flex flex-col items-center justify-between text-[.875rem]",children:[l.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[l.jsx("span",{children:y.text}),!y.action&&l.jsxs("div",{className:"flex gap-1",children:[y.onUndoAction&&l.jsx(Ld,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>{y.onUndoAction?.(),rs.remove(y.id)},children:l.jsx(u7,{})}),l.jsx(Ld,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>rs.remove(y.id),children:l.jsx(c7,{className:{message:"fill-gray-1000",success:"fill-contrast-fg",warning:"fill-gray-1000 dark:fill-gray-100",error:"fill-contrast-fg"}[y.type]})})]})]}),y.action&&l.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[l.jsx(Ld,{type:"tertiary",size:"small",onClick:()=>rs.remove(y.id),children:"Dismiss"}),l.jsx(Ld,{type:"primary",size:"small",onClick:()=>{y.onAction?.(),rs.remove(y.id)},children:y.action})]})]})},y.id)})})})},Bd=()=>{if(jp)return;const e=document.createElement("div");e.className="fixed bottom-4 right-4 z-[9999]",document.body.appendChild(e),jp=vk.createRoot(e),jp.render(l.jsx(h7,{}))},Bs=()=>({message:w.useCallback(({text:e,preserve:t,action:s,onAction:i,onUndoAction:a})=>{Bd(),rs.add(e,"message",t,s,i,a)},[]),success:w.useCallback(e=>{Bd(),rs.add(e,"success")},[]),warning:w.useCallback(e=>{Bd(),rs.add(e,"warning")},[]),error:w.useCallback(e=>{Bd(),rs.add(e,"error")},[])});function f7({usage:e}){const t=e.inputTokens+e.cacheCreationInputTokens+e.cacheReadInputTokens,s=t>0?e.cacheReadInputTokens/t*100:0;return l.jsxs("div",{className:"rounded-md border border-border",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(cl,{className:"size-3.5 text-amber-700"}),l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Claude Code · last session"}),e.sessionId?l.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.sessionId.slice(0,8)}):null]}),l.jsxs("span",{className:"font-mono text-sm font-semibold text-emerald-700",children:["$",e.costUSD.toFixed(4)]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1.5 px-3 py-2 text-[11px] sm:grid-cols-4",children:[l.jsx(Us,{label:"Input",value:Fn(e.inputTokens)}),l.jsx(Us,{label:"Output",value:Fn(e.outputTokens)}),l.jsx(Us,{label:"Cache read",value:Fn(e.cacheReadInputTokens)}),l.jsx(Us,{label:"Cache create",value:Fn(e.cacheCreationInputTokens)}),l.jsx(Us,{label:"Lines +",value:String(e.linesAdded)}),l.jsx(Us,{label:"Lines −",value:String(e.linesRemoved)}),l.jsx(Us,{label:"Wall",value:IS(e.durationMs)}),l.jsx(Us,{label:"API",value:IS(e.apiDurationMs)})]}),l.jsxs("div",{className:"border-t border-border px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[l.jsx("span",{children:"Cache read share of input"}),l.jsxs("span",{className:"font-mono",children:[s.toFixed(1),"%"]})]}),l.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:l.jsx("div",{className:"h-full bg-emerald-500",style:{width:`${Math.min(100,s).toFixed(2)}%`}})})]}),e.fiveHour||e.weekly?l.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.fiveHour?l.jsx(kh,{label:"5h block",window:e.fiveHour}):null,e.weekly?l.jsx(kh,{label:"This week",window:e.weekly}):null]}):null,e.models.length?l.jsxs("div",{className:"space-y-1 border-t border-border px-3 py-2",children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"By model"}),e.models.map(i=>l.jsxs("div",{className:"flex items-center justify-between gap-2 font-mono text-[11px]",children:[l.jsx("span",{className:"truncate",children:i.model}),l.jsxs("span",{className:"shrink-0 text-muted-foreground",children:[Fn(i.inputTokens+i.outputTokens)," tok ·"," ",l.jsxs("span",{className:"text-emerald-700",children:["$",i.costUSD.toFixed(4)]})]})]},i.model))]}):null]})}function m7({usage:e}){const t=e.inputTokens>0?e.cachedInputTokens/e.inputTokens*100:0,s=e.contextWindow&&e.contextWindow>0?e.lastTotalTokens/e.contextWindow*100:0;return l.jsxs("div",{className:"rounded-md border border-border",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(au,{className:"size-3.5 text-foreground"}),l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Codex · last session"})]}),e.timestamp?l.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:new Date(e.timestamp).toLocaleString()}):null]}),l.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1.5 px-3 py-2 text-[11px] sm:grid-cols-4",children:[l.jsx(Us,{label:"Input",value:Fn(e.inputTokens)}),l.jsx(Us,{label:"Output",value:Fn(e.outputTokens)}),l.jsx(Us,{label:"Cache read",value:Fn(e.cachedInputTokens)}),l.jsx(Us,{label:"Reasoning",value:Fn(e.reasoningOutputTokens)}),l.jsx(Us,{label:"Total",value:Fn(e.totalTokens)}),l.jsx(Us,{label:"Last turn",value:Fn(e.lastTotalTokens)}),l.jsx(Us,{label:"Context",value:e.contextWindow?Fn(e.contextWindow):"n/a"}),l.jsx(Us,{label:"Cost",value:"n/a"})]}),l.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[l.jsx(zS,{label:"Cache read share of input",value:t,tone:"bg-emerald-500"}),e.contextWindow?l.jsx(zS,{label:"Last turn context share",value:s,tone:"bg-sky-500"}):null]}),e.primary||e.secondary?l.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.primary?l.jsx(kh,{label:"5h window",window:e.primary}):null,e.secondary?l.jsx(kh,{label:"Weekly window",window:e.secondary}):null]}):null]})}function zS({label:e,value:t,tone:s}){const i=Math.min(100,Math.max(0,t));return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[l.jsx("span",{children:e}),l.jsxs("span",{className:"font-mono",children:[i.toFixed(1),"%"]})]}),l.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:l.jsx("div",{className:de("h-full",s),style:{width:`${i.toFixed(2)}%`}})})]})}function kh({label:e,window:t}){const s=Math.min(100,Math.max(0,t.usedPercent)),i=t.resetsAtUnix?new Date(t.resetsAtUnix*1e3).toLocaleString():null,a=s>=90?"bg-red-500":s>=70?"bg-amber-500":"bg-emerald-500";return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[l.jsx("span",{className:"text-muted-foreground",children:e}),l.jsxs("span",{className:"font-mono",children:[s.toFixed(1),"%"]})]}),l.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:l.jsx("div",{className:de("h-full",a),style:{width:`${s.toFixed(2)}%`}})}),i?l.jsxs("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:["resets ",i]}):null]})}function Us({label:e,value:t}){return l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),l.jsx("div",{className:"font-mono text-xs font-semibold",children:t})]})}function Fn(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function IS(e){if(!e)return"0s";if(e<1e3)return`${e}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const s=Math.floor(t/60),i=Math.round(t-s*60);return`${s}m ${i}s`}function p7(e=1e4){const[t,s]=w.useState(null),[i,a]=w.useState(null);return w.useEffect(()=>{let o=!0;const u=()=>{rj().then(m=>{o&&(s(m),a(null))}).catch(m=>{o&&a(m instanceof Error?m.message:String(m))})};u();const h=window.setInterval(u,e);return()=>{o=!1,window.clearInterval(h)}},[e]),{usage:t,error:i}}const g7={"claude-code":{label:"Claude Code",icon:l.jsx(cl,{})},codex:{label:"Codex",icon:l.jsx(au,{})}};function b7({agent:e,agentId:t,isDetected:s}){const{usage:i,error:a}=p7(),o=g7[t],u=t==="codex";return l.jsxs(Mi,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[l.jsxs(ji,{className:"border-b border-border px-3 py-2",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(Dk,{className:"size-4 text-muted-foreground"}),l.jsx(Ri,{children:u?"Token Usage & Rate Limits":"Token & Cost Usage"}),l.jsx($e,{variant:"outline",size:"small",icon:o.icon,children:o.label}),s?l.jsx($e,{variant:"outline",size:"small",children:"active session"}):l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Not the active agent in this session"}),u?null:l.jsx(v7,{className:"ml-auto"})]}),l.jsxs(dr,{className:"truncate text-xs",children:[u?l.jsxs(l.Fragment,{children:["Session metrics from ",l.jsx("code",{className:"font-mono",children:"~/.codex/sessions"})]}):l.jsxs(l.Fragment,{children:["Last-session metrics from ",l.jsx("code",{className:"font-mono",children:"~/.claude.json"})]})," · ",l.jsx("span",{className:"font-mono",children:e.project.cwd})]})]}),l.jsxs(Di,{className:"p-3",children:[a?l.jsx("p",{className:"text-xs text-destructive",children:a}):null,u?i?.codex?l.jsx(m7,{usage:i.codex}):a?null:l.jsx(PS,{agent:"Codex CLI"}):i?.claude?l.jsx(f7,{usage:i.claude}):a?null:l.jsx(PS,{agent:"Claude Code"})]})]})}function v7({className:e}){const[t,s]=w.useState(!0),[i,a]=w.useState(!0),[o,u]=w.useState(!1),h=Bs();w.useEffect(()=>{let f=!0;return aj().then(p=>f&&s(p.coAuthorWithClaude)).catch(()=>{}).finally(()=>f&&a(!1)),()=>{f=!1}},[]);const m=async()=>{const f=!t;u(!0),s(f);try{const p=await oj({coAuthorWithClaude:f});s(p.coAuthorWithClaude),h.success(p.coAuthorWithClaude?"Claude co-author trailer enabled for commits":"Claude co-author trailer disabled for commits")}catch(p){s(!f),h.error(p instanceof Error?p.message:"Failed to update setting")}finally{u(!1)}};return l.jsxs(re,{type:"button",variant:t?"default":"outline",size:"sm",onClick:m,disabled:i||o,"aria-pressed":t,title:t?"Claude will be added as commit co-author. Click to disable.":"Co-author trailer disabled. Click to enable.",className:de("gap-1.5",e),children:[l.jsx(cl,{className:"size-3.5"}),"Co-author"]})}function PS({agent:e}){return l.jsxs("p",{className:"text-xs text-muted-foreground",children:["No usage data yet. Run a session with ",e," in this project."]})}const x7=["I want to add a new service to NoMoreIDE. Walk me through it one step at a time —","ask a single question per message and give me options to choose from where it helps.","","Whenever you offer me a set of choices, end that message with a fenced block","labelled `options`, one choice per line, so I can click them. For example:","```options","Local","Docker Compose","SSH (remote)","```","","When the answer is free text (not a pick-list), always show a concrete example","in the question so I know the format — e.g. ask for the SSH host as","'What SSH host alias should I use? (for example: `devbox`)', the command as","'(for example: `npm run dev`)', the directory as '(for example: `/srv/app`)',","and the name as '(for example: `backend`)'. Never ask for a value without an example.","","1. First ask whether it's local, a Docker Compose service, or remote over SSH.","2. For local or Docker: ask which folder it lives in — and remind me I can click"," the paperclip (attach) button at the bottom-left of this chat to browse and"," insert the folder path. Then look inside it (package.json scripts,"," docker-compose.yml, go.mod, etc.) and propose the start command and port —"," confirm with me, don't assume."," For SSH: ask for the host alias, the remote command, and the remote directory.","3. Confirm a short name for it.","","Once I've confirmed everything, register it by running the nomoreide CLI:",' nomoreide add service <name> --command "<cmd>" --cwd "<dir>" [--port <n>] [--description "<text>"]'," Docker: --kind docker-compose --compose-service <svc> [--compose-file <file>] --cwd <dir>",' SSH: --kind ssh --host <alias> --command "<cmd>" --cwd "<remote dir>"',"After it registers successfully, end your final message with the service name in a","fenced `service` block so I get Start / Open buttons for it, e.g.:","```service","backend","```"].join(`
|
|
19
|
-
`),_7=["I want to connect a database to NoMoreIDE so I can browse it in the Database tab.","Walk me through it one step at a time — ask a single question per message and give","me options to choose from where it helps.","","Whenever you offer me a set of choices, end that message with a fenced block","labelled `options`, one choice per line, so I can click them. For example:","```options","Postgres","MySQL","SQLite","```","","First, look at what's already here before asking me to type things:","- Call `nomoreide_list_services` and check for a database service (a docker-compose"," or local service using a postgres / pgvector / mysql / mariadb image).","- If I just onboarded a repo, prefer the database it exposed.","","Then confirm the connection details with me: engine, host, port, user, password,","and database name. When the answer is free text, show a concrete example in the","question — e.g. the host as '(for example: `127.0.0.1`)' and the port as","'(for example: `5432`)'. For a docker-compose database, use the published host","port (the left side of a `5433:5432` mapping), not the in-container port.","","Once I've confirmed everything, register it with the `nomoreide_register_database`","tool — pass name, engine (postgres|mysql|sqlite), and a connection url, e.g.","`postgres://user:password@127.0.0.1:5433/dbname` (or an absolute file path for","sqlite). After it registers, tell me it's ready to browse in the Database tab."].join(`
|
|
20
|
-
`);function y7(e){const t=e?.trim();return[t?`Onboard this repository into NoMoreIDE and get it running: ${t}`:"I want to add a project to NoMoreIDE from a Git URL. First ask me for the repository URL (for example: `https://github.com/owner/repo`).","","Then set it up end-to-end yourself — don't make me fill in a form:","1. Call the `nomoreide_onboard_repo` tool with the URL to clone and analyze it."," It returns the clone path, a profile (manifests, Docker/compose, env keys,"," README excerpt), and ranked proposals with install-command hints.","2. Pick the best proposal straight from that result. Trust the profile — don't"," crawl the repo with Read/Glob/Grep or shell file reads; it already has what"," you need. Only ask me if it's genuinely ambiguous (e.g. several equally-likely"," apps in a monorepo) — otherwise choose sensible defaults.","3. Install dependencies if needed (run the install command in the clone path).","4. Register it with `nomoreide_register_service` using the returned clone path as"," the cwd, then register it as a git repo with `nomoreide_git_register_repository`"," so it shows in the Git tab."," If the onboard result includes any `databases`, register each one with"," `nomoreide_register_database` (use its name, engine, and url) so it shows in the"," Database tab.","5. Start it with `nomoreide_start_service` and confirm it came up (check its logs).","","Keep me posted as you go, but keep decisions to yourself unless you're truly stuck.","When it's running, end your message with the service name in a fenced `service`","block so I get Start / Open buttons for it, e.g.:","```service","backend","```"].join(`
|
|
21
|
-
`)}function S7(e,t,s,i,a){const o=i.map(u=>`- ${u.name}: ${u.dataType}${u.primaryKey?" (PK)":""}${u.nullable?"":" NOT NULL"}`).join(`
|
|
22
|
-
`);return[`I'm looking at a row in my ${t} database (connection "${e}", table \`${s.qualifiedName}\`).`,"","## Table schema",o,"","## Row","```json",JSON.stringify(a,null,2),"```","","Explain what this row represents and anything notable about its values."].join(`
|
|
23
|
-
`)}function $S(e,t,s){const i=s?.engine?`my ${s.engine} database (connection "${e}")`:`my database (connection "${e}")`,a=[`I'm looking at the table \`${t.qualifiedName}\` in ${i}.`,""];return s?.columns?.length&&(a.push("## Table schema"),a.push(s.columns.map(o=>`- ${o.name}: ${o.dataType}${o.primaryKey?" (PK)":""}${o.nullable?"":" NOT NULL"}`).join(`
|
|
24
|
-
`)),a.push("")),a.push("My question: "),a.join(`
|
|
25
|
-
`)}function w7({absolutePath:e,lines:t,relativePath:s}){return[`Please structurally split this large file and preserve behavior: ${s}`,"",`Absolute path: ${e}`,`Current size: ${t.toLocaleString()} lines`,"","First read the file and nearby imports/tests, then propose the smallest safe decomposition.","Prefer extracting cohesive responsibilities into focused modules over mechanical slicing.","Keep public APIs stable where possible, update imports, and run the relevant tests after editing."].join(`
|
|
26
|
-
`)}function k7(e,t){return[`About commit \`${e.hash.slice(0,7)}\` — "${e.subject}" by ${e.author}:`,"",t,"",`Run \`git show ${e.hash}\` to see the diff if you need it.`].join(`
|
|
27
|
-
`)}function C7(e){return["I have these ungrouped services in NoMoreIDE and I'd like to organise them into groups","(groups let me start/stop related services together):","",e.length?e.map(s=>{const i=[`- ${s.name}`];return s.command&&i.push(`command: \`${s.command}\``),s.cwd&&i.push(`cwd: \`${s.cwd}\``),typeof s.port=="number"&&i.push(`port: ${s.port}`),s.description&&i.push(s.description),i.join(" — ")}).join(`
|
|
28
|
-
`):"- (none — all services are already grouped)","","Look at their names, commands, directories and ports and propose how to group them —","for example a frontend + backend that share a repo, or services that boot together.","Group only the ones that genuinely belong together; it's fine to leave some ungrouped.","","Present your proposal as a short list of `group name → services` and end that message","with a fenced `options` block so I can confirm, e.g.:","```options","Yes, create these groups","Let me adjust them first","```","","Do NOT create anything until I confirm. Once I say yes, register each group by running:"," nomoreide add bundle <group-name> <service> <service> ...","Then tell me which groups you created."].join(`
|
|
29
|
-
`)}function E7({service:e,context:t}){return[`Here's the current debug context for my \`${e}\` service. Take a look at its`,"state and recent logs, tell me what stands out, and help me fix anything that's wrong.","",t].join(`
|
|
30
|
-
`)}function HS(){return{serviceNames:[],databaseNames:[],errorIds:[],repositoryPaths:[]}}function N7(e){return e.serviceNames.length>0||e.databaseNames.length>0||e.errorIds.length>0||e.repositoryPaths.length>0}function T7({dashboard:e,databases:t,incidents:s,note:i,selection:a}){const o=[M7(e,a.serviceNames),j7(t,a.databaseNames),R7(s,a.errorIds),D7(e,a.repositoryPaths)].filter(Boolean);return["Diagnose this NoMoreIDE workspace context.","Use the selected services, databases, incidents, and repositories together. Tell me what stands out, likely root causes, and the safest next steps.","",`Workspace: ${e.cwd}`,i?.trim()?`Extra user context:
|
|
31
|
-
${i.trim()}`:null,"",o.join(`
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
`)].filter(Boolean).join(`
|
|
36
|
-
`)}function A7({note:e,selection:t}){const s=[zd(t.serviceNames.length,"service"),zd(t.databaseNames.length,"database"),zd(t.errorIds.length,"error"),zd(t.repositoryPaths.length,"repo")].filter(Boolean),i=e?.trim().replace(/\s+/g," ");return i?`Diagnose: ${s.join(", ")}. Note: ${i.slice(0,80)}`:`Diagnose: ${s.join(", ")}`}function M7(e,t){return t.length?["Services",t.map(i=>{const a=e.config.services.find(m=>m.name===i),o=e.runtime.services[i],u=e.health[i],h=e.logs.filter(m=>m.service===i).slice(-8).map(m=>`${m.timestamp} ${m.stream}: ${m.text}`);return[`Service: ${i}`,a?.kind?`kind: ${a.kind}`:null,a?.command?`command: ${a.command}`:null,a?.cwd?`cwd: ${a.cwd}`:null,a?.port?`port: ${a.port}`:null,o?`state: ${o.state}`:"state: unknown",o?.pid?`pid: ${o.pid}`:null,o?.url?`url: ${o.url}`:null,o?.exitCode!==void 0&&o.exitCode!==null?`exitCode: ${o.exitCode}`:null,u?`health: ${u.status} - ${u.summary}`:null,u?.agentContext?`agent debug context:
|
|
37
|
-
${u.agentContext}`:null,h.length?`recent logs:
|
|
38
|
-
${h.join(`
|
|
39
|
-
`)}`:null].filter(Boolean).join(`
|
|
40
|
-
`)}).join(`
|
|
41
|
-
|
|
42
|
-
`)].join(`
|
|
43
|
-
`):null}function j7(e,t){return t.length?["Databases",t.map(i=>{const a=e.find(o=>o.name===i);return[`Database: ${i}`,a?.engine?`engine: ${a.engine}`:null,a?.url?`url: ${a.url}`:null].filter(Boolean).join(`
|
|
44
|
-
`)}).join(`
|
|
45
|
-
|
|
46
|
-
`)].join(`
|
|
47
|
-
`):null}function R7(e,t){return t.length?["Error Inbox",t.map(i=>{const a=e.find(o=>o.id===i);return a?[`Incident #${a.id}`,`service: ${a.service}`,`level: ${a.level}`,`title: ${a.title}`,a.file?`file: ${a.file}${a.line?`:${a.line}`:""}`:null,`count: ${a.count}`,`firstSeen: ${a.firstSeen}`,`lastSeen: ${a.lastSeen}`,a.logExcerpt.length?`log excerpt:
|
|
48
|
-
${a.logExcerpt.join(`
|
|
49
|
-
`)}`:null].filter(Boolean).join(`
|
|
50
|
-
`):`Incident #${i}`}).join(`
|
|
51
|
-
|
|
52
|
-
`)].join(`
|
|
53
|
-
`):null}function D7(e,t){if(!t.length)return null;const s=O7(e),i=e.git.selectedRepository?.path??e.git.cwd,a=e.git.status?.files.map(u=>`${u.status}: ${u.path}`)??[];return["Git Repositories",t.map(u=>{const h=s.find(f=>f.path===u),m=u===i;return[`Repository: ${h?.name??u.split("/").pop()??u}`,`path: ${u}`,m?"current: yes":"current: no",m?a.length?`changed files:
|
|
54
|
-
${a.join(`
|
|
55
|
-
`)}`:"changed files: none":"changed files: not loaded for this repository in the current dashboard view"].join(`
|
|
56
|
-
`)}).join(`
|
|
57
|
-
|
|
58
|
-
`)].join(`
|
|
59
|
-
`)}function O7(e){return e.config.gitRepositories.length?e.config.gitRepositories:e.git.selectedRepository?[e.git.selectedRepository]:[{name:e.git.cwd.split("/").pop()??"repository",path:e.git.cwd}]}function zd(e,t){return e?`${e} ${t}${e===1?"":"s"}`:null}function zb(e){return e==="codex"?"Codex":"Claude Code"}function L7(e,t){const s=e==="codex"?"`~/.codex/skills/<name>/SKILL.md` (user) or `.codex/skills/<name>/SKILL.md` (project)":"`~/.claude/skills/<name>/SKILL.md` (user) or `.claude/skills/<name>/SKILL.md` (project)";return[`Add a new skill for ${zb(e)} from this:`,"",t,"",`Scaffold it at ${s} with valid frontmatter (\`name\`, \`description\`) and a short body, then confirm it's discovered. If the input is a URL or repo, fetch and adapt it.`].join(`
|
|
60
|
-
`)}function B7(e){return[`Remove the ${e.scope} skill \`${e.name}\`${e.path?` (at \`${e.path}\`)`:""}.`,"","Delete its directory and confirm it's no longer registered. Check nothing else references it first."].join(`
|
|
61
|
-
`)}function z7(e){const t=[`I'm looking at the ${e.scope} skill \`${e.name}\`${e.path?` (at \`${e.path}\`)`:""}.`];return e.description&&t.push("",`Its description: ${e.description}`),t.push("","My question: "),t.join(`
|
|
62
|
-
`)}function I7(e,t){const s=e==="codex"?"by adding an `[mcp_servers.<name>]` section to `~/.codex/config.toml`":"with `claude mcp add` (or by editing `~/.claude.json`)";return[`Register a new MCP server for ${zb(e)} from this:`,"",t,"",`Set it up ${s}, then verify it connects. Parse the name, command/URL, and any env/args from the input above.`].join(`
|
|
63
|
-
`)}function P7(e,t){const s=t==="codex"?`Remove the \`[mcp_servers.${e.name}]\` section from \`~/.codex/config.toml\`.`:`Run \`claude mcp remove ${e.name}\` (scope: ${e.scope}).`;return[`Remove the ${e.scope} MCP server \`${e.name}\`.`,"",`${s} Then confirm it no longer appears in the server list.`].join(`
|
|
64
|
-
`)}function $7(e){const t=[`I'm looking at the ${e.scope} MCP server \`${e.name}\`.`],s=e.command?[e.command,...e.args??[]].join(" "):e.url??e.type;return s&&t.push("",`It points at: \`${s}\``),t.push("","My question: "),t.join(`
|
|
65
|
-
`)}function H7(e,t){return[`Install a plugin for ${zb(e)} from this:`,"",t,"","Use the `/plugin` command or `claude plugin install <name>@<marketplace>` (add the marketplace first if needed), then confirm its skills, commands, and MCP servers are available."].join(`
|
|
66
|
-
`)}function U7(e){const t=e.marketplace?` (from \`${e.marketplace}\`)`:"";return[`Uninstall the plugin \`${e.name}\`${t}.`,"","Use `claude plugin uninstall` or the `/plugin` command, then confirm its skills, commands, and MCP servers are gone."].join(`
|
|
67
|
-
`)}function F7(e){const t=[`I'm looking at the plugin \`${e.name}\`${e.marketplace?` from \`${e.marketplace}\``:""}${e.version?` (v${e.version})`:""}.`];e.description&&t.push("",e.description);const s=[];return e.skills.length&&s.push(`skills: ${e.skills.join(", ")}`),e.commands.length&&s.push(`commands: ${e.commands.join(", ")}`),e.agents.length&&s.push(`agents: ${e.agents.join(", ")}`),e.mcpServers.length&&s.push(`MCP servers: ${e.mcpServers.join(", ")}`),s.length&&(t.push("","It contributes —"),t.push(...s.map(i=>`- ${i}`))),t.push("","My question: "),t.join(`
|
|
68
|
-
`)}function ZE({id:e,className:t}){return e==="codex"?l.jsx(au,{className:de("text-foreground",t)}):e==="gemini"?l.jsx(ZL,{className:de("text-[#1A73E8]",t)}):l.jsx(cl,{className:de("text-[#D97757]",t)})}function ci({className:e}){const{provider:t}=Ls();return l.jsx(ZE,{id:t?.id,className:e})}function tl({onAsk:e,label:t,className:s}){const{provider:i}=Ls(),a=t??`Ask ${i?.label??"Claude"}`;return l.jsx("button",{"aria-label":a,className:de("flex size-6 items-center justify-center rounded-md opacity-0 transition-all duration-150 hover:bg-muted group-hover:opacity-100",s),onClick:e,title:a,type:"button",children:l.jsx(ZE,{id:i?.id,className:"size-3.5"})})}function Xh({placeholder:e,onSubmit:t,onCancel:s,className:i}){const[a,o]=w.useState(""),u=()=>{const h=a.trim();h&&t(h)};return l.jsxs("form",{className:de("flex items-center gap-1.5 rounded-md border border-primary/40 bg-primary/5 px-1.5 py-1",i),onSubmit:h=>{h.preventDefault(),u()},children:[l.jsx(tl,{className:"size-5 opacity-100",label:"Send to the agent",onAsk:u}),l.jsx("input",{autoFocus:!0,className:"min-w-0 flex-1 bg-transparent text-xs outline-none placeholder:text-muted-foreground",onChange:h=>o(h.target.value),onKeyDown:h=>{h.key==="Escape"&&s()},placeholder:e,value:a}),l.jsx(re,{type:"submit",size:"icon",className:"size-6",disabled:!a.trim(),title:"Send",children:l.jsx(il,{className:"size-3.5"})}),l.jsx(re,{type:"button",size:"icon",variant:"ghost",className:"size-6",onClick:s,"aria-label":"Cancel",title:"Cancel",children:l.jsx(Js,{className:"size-3.5"})})]})}function Ib({label:e,onClick:t}){return l.jsxs(re,{type:"button",variant:"ghost",size:"sm",className:"h-6 gap-1 px-1.5 text-[11px] font-medium",onClick:t,title:e,"aria-label":e,children:[l.jsx(mn,{className:"size-3.5"}),"Add"]})}function Pb({askLabel:e,removeLabel:t,onAsk:s,onRemove:i}){return l.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[l.jsx(tl,{label:e,onAsk:s}),l.jsx(V7,{label:t,onConfirm:i})]})}function V7({label:e,onConfirm:t}){const[s,i]=w.useState(!1);return s?l.jsxs("span",{className:"flex items-center gap-0.5",children:[l.jsx("button",{type:"button","aria-label":e,title:e,onClick:()=>{i(!1),t()},className:"flex size-6 items-center justify-center rounded-md text-emerald-600 transition-colors hover:bg-emerald-500/10",children:l.jsx(il,{className:"size-3.5"})}),l.jsx("button",{type:"button","aria-label":"Cancel",title:"Cancel",onClick:()=>i(!1),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted",children:l.jsx(Js,{className:"size-3.5"})})]}):l.jsx("button",{type:"button","aria-label":e,title:e,onClick:()=>i(!0),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-all duration-150 hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100",children:l.jsx(rl,{className:"size-3.5"})})}function q7({agent:e,agentId:t}){const{sendToAgent:s}=Ls(),[i,a]=w.useState([]),[o,u]=w.useState(!1),[h,m]=w.useState(!1),f=w.useCallback(async()=>{u(!0);try{a(await ij(t))}catch{a([])}finally{u(!1)}},[t]);w.useEffect(()=>{f()},[f]);const p=w.useMemo(()=>{const S={};for(const C of i)S[C.name]=C.state;return S},[i]),b=w.useMemo(()=>{const S=new Set(e.mcpServers.map(E=>E.name)),C=i.filter(E=>!S.has(E.name)).map(E=>({name:E.name,scope:"user",synthetic:!0}));return[...e.mcpServers,...C]},[e.mcpServers,i]);function x(S){m(!1),s({prompt:I7(t,S),source:{type:"agent-mcp",label:"New MCP server"},label:`Add MCP server: ${S}`})}function _(S){s({prompt:$7(S),source:{type:"agent-mcp",label:`${S.name} server`},mode:"draft"})}function y(S){s({prompt:P7(S,t),source:{type:"agent-mcp",label:`Remove ${S.name}`},label:`Remove MCP server: ${S.name}`})}return l.jsxs(Mi,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[l.jsxs(ji,{className:"border-b border-border px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(zk,{className:"size-4 text-muted-foreground"}),l.jsx(Ri,{children:"MCP Servers"})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx($e,{variant:"outline",size:"small",children:b.length}),l.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"size-6",onClick:()=>{f()},disabled:o,title:"Re-check authentication status","aria-label":"Re-check authentication status",children:l.jsx(eu,{className:o?"animate-spin":void 0})}),l.jsx(Ib,{label:"Register an MCP server with AI",onClick:()=>m(S=>!S)})]})]}),h?l.jsx(Xh,{className:"mt-1.5",placeholder:"Paste the MCP install command or URL…",onSubmit:x,onCancel:()=>m(!1)}):l.jsxs(dr,{className:"text-xs",children:["From"," ",l.jsx("code",{className:"font-mono",children:t==="codex"?"~/.codex/config.toml":"~/.claude.json"}),t==="codex"?"":" + claude.ai connectors",". Status via"," ",l.jsxs("code",{className:"font-mono",children:[t==="codex"?"codex":"claude"," mcp list"]})," ","(fresh health check)."]})]}),l.jsx(Di,{className:"p-0",children:b.length?l.jsx("ul",{className:"divide-y divide-border",children:b.map(S=>l.jsxs("li",{className:"group px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:S.name}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[l.jsx(K7,{state:p[S.name],loading:o}),l.jsx($e,{variant:"outline",size:"small",children:S.synthetic?"connector":S.scope}),l.jsx(Pb,{askLabel:`Ask AI about the ${S.name} server`,removeLabel:`Remove the ${S.name} server`,onAsk:()=>_(S),onRemove:()=>y(S)})]})]}),l.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted-foreground",children:S.synthetic?"claude.ai managed connector":W7(S)})]},`${S.scope}:${S.name}`))}):l.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No MCP servers configured."})})]})}const G7={connected:{label:"Connected",dot:"bg-emerald-500"},"needs-auth":{label:"Needs auth",dot:"bg-amber-500"},failed:{label:"Failed",dot:"bg-red-500"},"no-auth":{label:"local",dot:"bg-muted-foreground/50"}};function K7({state:e,loading:t}){if(!e)return t?l.jsx(Os,{className:"size-3 animate-spin text-muted-foreground"}):null;const s=e==="unknown"?void 0:G7[e];return s?l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[l.jsx("span",{className:de("size-1.5 shrink-0 rounded-full",s.dot),"aria-hidden":!0}),s.label]}):null}function W7(e){return e.command?[e.command,...e.args??[]].join(" "):e.url??e.type??"-"}function Y7({agent:e,agentId:t}){const{sendToAgent:s}=Ls(),[i,a]=w.useState(!1),o=e.plugins??[];function u(f){a(!1),s({prompt:H7(t,f),source:{type:"agent-plugin",label:"New plugin"},label:`Install plugin: ${f}`})}function h(f){s({prompt:F7(f),source:{type:"agent-plugin",label:`${f.name} plugin`},mode:"draft"})}function m(f){s({prompt:U7(f),source:{type:"agent-plugin",label:`Remove ${f.name}`},label:`Uninstall plugin: ${f.name}`})}return l.jsxs(Mi,{className:"min-w-0 rounded-none border-0 border-t border-border bg-transparent xl:border-t",children:[l.jsxs(ji,{className:"border-b border-border px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(NA,{className:"size-4 text-muted-foreground"}),l.jsx(Ri,{children:"Plugins"})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx($e,{variant:"outline",size:"small",children:o.length}),l.jsx(Ib,{label:"Install a plugin with AI",onClick:()=>a(f=>!f)})]})]}),i?l.jsx(Xh,{className:"mt-1.5",placeholder:"Paste a plugin name, marketplace, or install command…",onSubmit:u,onCancel:()=>a(!1)}):l.jsx(dr,{className:"text-xs",children:t==="codex"?"Codex doesn't expose an installed-plugin registry here yet.":"Installed from marketplaces (~/.claude/plugins). Each bundles skills, commands, agents, and MCP servers."})]}),l.jsx(Di,{className:"p-0",children:o.length?l.jsx("ul",{className:"divide-y divide-border",children:o.map(f=>l.jsxs("li",{className:"group px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:f.name}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[f.version&&f.version!=="unknown"?l.jsxs($e,{variant:"outline",size:"small",children:["v",f.version]}):null,f.marketplace?l.jsx($e,{variant:"outline",size:"small",children:f.marketplace}):null,l.jsx(Pb,{askLabel:`Ask AI about the ${f.name} plugin`,removeLabel:`Uninstall the ${f.name} plugin`,onAsk:()=>h(f),onRemove:()=>m(f)})]})]}),f.description?l.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:f.description}):null,l.jsx(X7,{plugin:f})]},`${f.name}@${f.marketplace??""}`))}):l.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No plugins installed."})})]})}function X7({plugin:e}){const t=[];return e.skills.length&&t.push(`${e.skills.length} skill${Id(e.skills.length)}`),e.commands.length&&t.push(`${e.commands.length} command${Id(e.commands.length)}`),e.agents.length&&t.push(`${e.agents.length} agent${Id(e.agents.length)}`),e.mcpServers.length&&t.push(`${e.mcpServers.length} MCP server${Id(e.mcpServers.length)}`),t.length?l.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:t.map(s=>l.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[10px] text-muted-foreground",children:s},s))}):null}function Id(e){return e===1?"":"s"}function Z7({agent:e,agentId:t}){const{sendToAgent:s}=Ls(),[i,a]=w.useState(!1);function o(m){a(!1),s({prompt:L7(t,m),source:{type:"agent-skill",label:"New skill"},label:`Add skill: ${m}`})}function u(m){s({prompt:z7(m),source:{type:"agent-skill",label:`${m.name} skill`},mode:"draft"})}function h(m){s({prompt:B7(m),source:{type:"agent-skill",label:`Remove ${m.name}`},label:`Remove skill: ${m.name}`})}return l.jsxs(Mi,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[l.jsxs(ji,{className:"border-b border-border px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Wa,{className:"size-4 text-muted-foreground"}),l.jsx(Ri,{children:"Skills"})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx($e,{variant:"outline",size:"small",children:e.skills.length}),l.jsx(Ib,{label:"Add a skill with AI",onClick:()=>a(m=>!m)})]})]}),i?l.jsx(Xh,{className:"mt-1.5",placeholder:"Paste a skill URL/repo, or describe the skill…",onSubmit:o,onCancel:()=>a(!1)}):l.jsx(dr,{className:"text-xs",children:t==="codex"?"User, project, and system skills discovered for Codex.":"User and project skills discovered for the active agent."})]}),l.jsx(Di,{className:"p-0",children:e.skills.length?l.jsx("ul",{className:"divide-y divide-border",children:e.skills.map(m=>l.jsxs("li",{className:"group px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:m.name}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[l.jsx($e,{variant:"outline",size:"small",children:m.scope}),l.jsx(Pb,{askLabel:`Ask AI about the ${m.name} skill`,removeLabel:`Remove the ${m.name} skill`,onAsk:()=>u(m),onRemove:()=>h(m)})]})]}),m.description?l.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:m.description}):null]},`${m.scope}:${m.name}`))}):l.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No skills found."})})]})}function Q7({agent:e,agentId:t}){return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:"grid grid-cols-1 divide-y divide-border xl:grid-cols-2 xl:divide-x xl:divide-y-0",children:[l.jsx(Z7,{agent:e,agentId:t}),l.jsx(q7,{agent:e,agentId:t})]}),l.jsx(Y7,{agent:e,agentId:t})]})}const J7=[{id:"claude-code",label:"Claude Code",icon:l.jsx(cl,{className:"size-4"})},{id:"codex",label:"Codex",icon:l.jsx(au,{className:"size-4"})}],e9=[{id:"overview",label:"Overview",icon:l.jsx(Dk,{className:"size-3.5"})},{id:"memory",label:"Memory",icon:l.jsx(wk,{className:"size-3.5"})},{id:"tools",label:"Skills, MCPs & Plugins",icon:l.jsx(zk,{className:"size-3.5"})},{id:"activity",label:"Activity",icon:l.jsx(Pa,{className:"size-3.5"})}];function t9(){const[e,t]=w.useState(null),[s,i]=w.useState(null),[a,o]=w.useState("claude-code"),[u,h]=w.useState("overview"),{clear:m,turns:f}=Ls();if(w.useEffect(()=>{let b=!0;return nj().then(x=>{b&&(t(x),x.detected.name==="codex"&&o("codex"))}).catch(x=>{b&&i(x instanceof Error?x.message:String(x))}),()=>{b=!1}},[]),s)return l.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:l.jsxs(it,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load agent info: ",s]})});if(!e)return l.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:l.jsx(it,{variant:"muted",children:"Loading agent info…"})});const p=e.agents?.[a]??e;return l.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[l.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-card/90 px-3 py-2",children:J7.map(b=>{const x=a===b.id,_=e.detected.name===b.id;return l.jsxs("button",{type:"button",onClick:()=>o(b.id),className:de("flex items-center gap-2 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors",x?"border-border bg-background text-foreground shadow-sm":"border-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[b.icon,b.label,_?l.jsx("span",{className:"size-1.5 rounded-full bg-emerald-500","aria-label":"active session"}):null]},b.id)})}),l.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/90 px-3",children:e9.map(b=>l.jsxs("button",{type:"button",onClick:()=>h(b.id),className:de("relative flex items-center gap-1.5 px-2.5 py-2 text-xs font-medium transition-colors",u===b.id?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[b.icon,b.label,u===b.id?l.jsx("span",{className:"absolute inset-x-1 -bottom-px h-0.5 bg-primary"}):null]},b.id))}),l.jsx(s7,{onNewChat:m,turns:f}),l.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[u==="overview"?l.jsx(b7,{agent:p,agentId:a,isDetected:e.detected.name===a}):null,u==="memory"?l.jsx(n7,{agent:p,agentId:a}):null,u==="tools"?l.jsx(Q7,{agent:p,agentId:a}):null,u==="activity"?l.jsx(YL,{agent:p,agentId:a}):null]})]})}var ou=bk();function Ti({children:e,icon:t,onClose:s,title:i,size:a="md"}){return w.useEffect(()=>{function o(u){u.key==="Escape"&&s()}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s]),ou.createPortal(l.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",onMouseDown:s,children:l.jsxs("div",{"aria-modal":"true",className:`flex max-h-[min(820px,calc(100vh-2rem))] w-full flex-col overflow-hidden rounded-lg border border-border bg-card shadow-xl ${a==="xl"?"max-w-[min(1400px,calc(100vw-2rem))]":a==="lg"?"max-w-3xl":"max-w-lg"}`,onMouseDown:o=>o.stopPropagation(),role:"dialog",children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[l.jsx("div",{className:"flex size-8 items-center justify-center rounded-md border border-border bg-background text-foreground [&_svg]:size-4",children:t}),l.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:i}),l.jsx(re,{"aria-label":"Close dialog",onClick:s,size:"icon",type:"button",variant:"ghost",children:l.jsx(Js,{})})]}),l.jsx("div",{className:"min-h-0 overflow-auto p-4",children:e})]})}),document.body)}function et({className:e,type:t,...s}){return l.jsx("input",{type:t,className:de("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...s})}const s9={top:"bottom-full left-1/2 mb-1.5 -translate-x-1/2",bottom:"top-full left-1/2 mt-1.5 -translate-x-1/2",left:"right-full top-1/2 mr-1.5 -translate-y-1/2",right:"left-full top-1/2 ml-1.5 -translate-y-1/2"};function Qo({label:e,children:t,side:s="bottom",className:i}){return l.jsxs("span",{className:de("group/tt relative inline-flex",i),children:[t,l.jsx("span",{role:"tooltip",className:de("pointer-events-none absolute z-[1100] whitespace-nowrap rounded-md bg-foreground px-2 py-1 text-xs font-medium text-background shadow-md","opacity-0 transition-opacity duration-150 group-hover/tt:opacity-100",s9[s]),children:e})]})}const $b="application/x-nomoreide-path";function lu(e,t){return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`}function QE(e,t){e.setData($b,t)}function US(e){return e.types.includes($b)}function n9(e){return e.getData($b)||null}function JE(e){return{draggable:!0,onDragStart:t=>{QE(t.dataTransfer,e),t.dataTransfer.effectAllowed="copy"}}}const Xn='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>',Zn='</title><path d="',Qn='"/></svg>',i9={title:".NET",slug:"dotnet",get svg(){return Xn+".NET"+Zn+this.path+Qn},path:"M24 8.77h-2.468v7.565h-1.425V8.77h-2.462V7.53H24zm-6.852 7.565h-4.821V7.53h4.63v1.24h-3.205v2.494h2.953v1.234h-2.953v2.604h3.396zm-6.708 0H8.882L4.78 9.863a2.896 2.896 0 0 1-.258-.51h-.036c.032.189.048.592.048 1.21v5.772H3.157V7.53h1.659l3.965 6.32c.167.261.275.442.323.54h.024c-.04-.233-.06-.629-.06-1.185V7.529h1.372zm-8.703-.693a.868.829 0 0 1-.869.829.868.829 0 0 1-.868-.83.868.829 0 0 1 .868-.828.868.829 0 0 1 .869.829Z",source:"https://github.com/dotnet/brand/blob/c7d0f51b8ec59531332d05fb27a5b758a7a3d689/logo/dotnet-logo.svg",hex:"512BD4",guidelines:"https://github.com/dotnet/brand/blob/c7d0f51b8ec59531332d05fb27a5b758a7a3d689/dotnet-styleGuide-2024.pdf",license:{type:"CC0-1.0",url:"https://spdx.org/licenses/CC0-1.0"}},r9={title:"Bun",slug:"bun",get svg(){return Xn+"Bun"+Zn+this.path+Qn},path:"M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083 5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z",source:"https://bun.sh/press-kit",hex:"000000"},a9={title:"Deno",slug:"deno",get svg(){return Xn+"Deno"+Zn+this.path+Qn},path:"M1.105 18.02A11.9 11.9 0 0 1 0 12.985q0-.698.078-1.376a12 12 0 0 1 .231-1.34A12 12 0 0 1 4.025 4.02a12 12 0 0 1 5.46-2.771 12 12 0 0 1 3.428-.23c1.452.112 2.825.477 4.077 1.05a12 12 0 0 1 2.78 1.774 12.02 12.02 0 0 1 4.053 7.078A12 12 0 0 1 24 12.985q0 .454-.036.914a12 12 0 0 1-.728 3.305 12 12 0 0 1-2.38 3.875c-1.33 1.357-3.02 1.962-4.43 1.936a4.4 4.4 0 0 1-2.724-1.024c-.99-.853-1.391-1.83-1.53-2.919a5 5 0 0 1 .128-1.518c.105-.38.37-1.116.76-1.437-.455-.197-1.04-.624-1.226-.829-.045-.05-.04-.13 0-.183a.155.155 0 0 1 .177-.053c.392.134.869.267 1.372.35.66.111 1.484.25 2.317.292 2.03.1 4.153-.813 4.812-2.627s.403-3.609-1.96-4.685-3.454-2.356-5.363-3.128c-1.247-.505-2.636-.205-4.06.582-3.838 2.121-7.277 8.822-5.69 15.032a.191.191 0 0 1-.315.19 12 12 0 0 1-1.25-1.634 12 12 0 0 1-.769-1.404M11.57 6.087c.649-.051 1.214.501 1.31 1.236.13.979-.228 1.99-1.41 2.013-1.01.02-1.315-.997-1.248-1.614.066-.616.574-1.575 1.35-1.635",source:"https://github.com/denoland/docs/blob/5dee713844c7447f80acd4093caa9d350d80bf36/static/img/logo.svg",hex:"000000",guidelines:"https://deno.com/brand",license:{type:"MIT",url:"https://spdx.org/licenses/MIT"}},o9={title:"Docker",slug:"docker",get svg(){return Xn+"Docker"+Zn+this.path+Qn},path:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z",source:"https://www.docker.com/company/newsroom/media-resources",hex:"2496ED"},l9={title:"Go",slug:"go",get svg(){return Xn+"Go"+Zn+this.path+Qn},path:"M1.811 10.231c-.047 0-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046 0 .058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047 11.306c-.047 0-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047 0 .07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828 1.075c-.047 0-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047 0 .07.035.07.082l-.023.28c0 .047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514-.176.046-.187.058-.34-.117-.174-.199-.303-.327-.548-.444-.737-.362-1.45-.257-2.115.175-.795.514-1.204 1.274-1.192 2.22.011.935.654 1.706 1.577 1.835.795.105 1.46-.175 1.987-.77.105-.13.198-.27.315-.434H10.47c-.245 0-.304-.152-.222-.35.152-.362.432-.97.596-1.274a.315.315 0 01.292-.187h4.253c-.023.316-.023.631-.07.947a4.983 4.983 0 01-.958 2.29c-.841 1.11-1.94 1.8-3.33 1.986-1.145.152-2.209-.07-3.143-.77-.865-.655-1.356-1.52-1.484-2.595-.152-1.274.222-2.419.993-3.424.83-1.086 1.928-1.776 3.272-2.02 1.098-.2 2.15-.07 3.096.571.62.41 1.063.97 1.356 1.648.07.105.023.164-.117.2m3.868 6.461c-1.064-.024-2.034-.328-2.852-1.029a3.665 3.665 0 01-1.262-2.255c-.21-1.32.152-2.489.947-3.529.853-1.122 1.881-1.706 3.272-1.95 1.192-.21 2.314-.095 3.33.595.923.63 1.496 1.484 1.648 2.605.198 1.578-.257 2.863-1.344 3.962-.771.783-1.718 1.273-2.805 1.495-.315.06-.63.07-.934.106zm2.78-4.72c-.011-.153-.011-.27-.034-.387-.21-1.157-1.274-1.81-2.384-1.554-1.087.245-1.788.935-2.045 2.033-.21.912.234 1.835 1.075 2.21.643.28 1.285.244 1.905-.07.923-.48 1.425-1.228 1.484-2.233z",source:"https://blog.golang.org/go-brand",hex:"00ADD8",guidelines:"https://blog.golang.org/go-brand"},c9={title:"Node.js",slug:"nodedotjs",get svg(){return Xn+"Node.js"+Zn+this.path+Qn},path:"M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383 c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076 c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0 L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392 c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021 c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921 c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603 v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z M19.099,13.993 c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233 c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081 c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833 c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402 c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253 c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z",source:"https://nodejs.org/en/about/branding",hex:"5FA04E",guidelines:"https://nodejs.org/en/about/branding"},u9={title:"npm",slug:"npm",get svg(){return Xn+"npm"+Zn+this.path+Qn},path:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z",source:"https://www.npmjs.com",hex:"CB3837",guidelines:"https://docs.npmjs.com/policies/logos-and-usage"},d9={title:"pnpm",slug:"pnpm",get svg(){return Xn+"pnpm"+Zn+this.path+Qn},path:"M0 0v7.5h7.5V0zm8.25 0v7.5h7.498V0zm8.25 0v7.5H24V0zM2 2h3.5v3.5H2zm8.25 0h3.498v3.5H10.25zm8.25 0H22v3.5h-3.5zM8.25 8.25v7.5h7.498v-7.5zm8.25 0v7.5H24v-7.5zm2 2H22v3.5h-3.5zM0 16.5V24h7.5v-7.5zm8.25 0V24h7.498v-7.5zm8.25 0V24H24v-7.5z",source:"https://pnpm.io/logos",hex:"F69220"},h9={title:"Python",slug:"python",get svg(){return Xn+"Python"+Zn+this.path+Qn},path:"M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z",source:"https://www.python.org/community/logos/",hex:"3776AB",guidelines:"https://www.python.org/community/logos/"},FS={title:"Rust",slug:"rust",get svg(){return Xn+"Rust"+Zn+this.path+Qn},path:"M23.8346 11.7033l-1.0073-.6236a13.7268 13.7268 0 00-.0283-.2936l.8656-.8069a.3483.3483 0 00-.1154-.578l-1.1066-.414a8.4958 8.4958 0 00-.087-.2856l.6904-.9587a.3462.3462 0 00-.2257-.5446l-1.1663-.1894a9.3574 9.3574 0 00-.1407-.2622l.49-1.0761a.3437.3437 0 00-.0274-.3361.3486.3486 0 00-.3006-.154l-1.1845.0416a6.7444 6.7444 0 00-.1873-.2268l.2723-1.153a.3472.3472 0 00-.417-.4172l-1.1532.2724a14.0183 14.0183 0 00-.2278-.1873l.0415-1.1845a.3442.3442 0 00-.49-.328l-1.076.491c-.0872-.0476-.1742-.0952-.2623-.1407l-.1903-1.1673A.3483.3483 0 0016.256.955l-.9597.6905a8.4867 8.4867 0 00-.2855-.086l-.414-1.1066a.3483.3483 0 00-.5781-.1154l-.8069.8666a9.2936 9.2936 0 00-.2936-.0284L12.2946.1683a.3462.3462 0 00-.5892 0l-.6236 1.0073a13.7383 13.7383 0 00-.2936.0284L9.9803.3374a.3462.3462 0 00-.578.1154l-.4141 1.1065c-.0962.0274-.1903.0567-.2855.086L7.744.955a.3483.3483 0 00-.5447.2258L7.009 2.348a9.3574 9.3574 0 00-.2622.1407l-1.0762-.491a.3462.3462 0 00-.49.328l.0416 1.1845a7.9826 7.9826 0 00-.2278.1873L3.8413 3.425a.3472.3472 0 00-.4171.4171l.2713 1.1531c-.0628.075-.1255.1509-.1863.2268l-1.1845-.0415a.3462.3462 0 00-.328.49l.491 1.0761a9.167 9.167 0 00-.1407.2622l-1.1662.1894a.3483.3483 0 00-.2258.5446l.6904.9587a13.303 13.303 0 00-.087.2855l-1.1065.414a.3483.3483 0 00-.1155.5781l.8656.807a9.2936 9.2936 0 00-.0283.2935l-1.0073.6236a.3442.3442 0 000 .5892l1.0073.6236c.008.0982.0182.1964.0283.2936l-.8656.8079a.3462.3462 0 00.1155.578l1.1065.4141c.0273.0962.0567.1914.087.2855l-.6904.9587a.3452.3452 0 00.2268.5447l1.1662.1893c.0456.088.0922.1751.1408.2622l-.491 1.0762a.3462.3462 0 00.328.49l1.1834-.0415c.0618.0769.1235.1528.1873.2277l-.2713 1.1541a.3462.3462 0 00.4171.4161l1.153-.2713c.075.0638.151.1255.2279.1863l-.0415 1.1845a.3442.3442 0 00.49.327l1.0761-.49c.087.0486.1741.0951.2622.1407l.1903 1.1662a.3483.3483 0 00.5447.2268l.9587-.6904a9.299 9.299 0 00.2855.087l.414 1.1066a.3452.3452 0 00.5781.1154l.8079-.8656c.0972.0111.1954.0203.2936.0294l.6236 1.0073a.3472.3472 0 00.5892 0l.6236-1.0073c.0982-.0091.1964-.0183.2936-.0294l.8069.8656a.3483.3483 0 00.578-.1154l.4141-1.1066a8.4626 8.4626 0 00.2855-.087l.9587.6904a.3452.3452 0 00.5447-.2268l.1903-1.1662c.088-.0456.1751-.0931.2622-.1407l1.0762.49a.3472.3472 0 00.49-.327l-.0415-1.1845a6.7267 6.7267 0 00.2267-.1863l1.1531.2713a.3472.3472 0 00.4171-.416l-.2713-1.1542c.0628-.0749.1255-.1508.1863-.2278l1.1845.0415a.3442.3442 0 00.328-.49l-.49-1.076c.0475-.0872.0951-.1742.1407-.2623l1.1662-.1893a.3483.3483 0 00.2258-.5447l-.6904-.9587.087-.2855 1.1066-.414a.3462.3462 0 00.1154-.5781l-.8656-.8079c.0101-.0972.0202-.1954.0283-.2936l1.0073-.6236a.3442.3442 0 000-.5892zm-6.7413 8.3551a.7138.7138 0 01.2986-1.396.714.714 0 11-.2997 1.396zm-.3422-2.3142a.649.649 0 00-.7715.5l-.3573 1.6685c-1.1035.501-2.3285.7795-3.6193.7795a8.7368 8.7368 0 01-3.6951-.814l-.3574-1.6684a.648.648 0 00-.7714-.499l-1.473.3158a8.7216 8.7216 0 01-.7613-.898h7.1676c.081 0 .1356-.0141.1356-.088v-2.536c0-.074-.0536-.0881-.1356-.0881h-2.0966v-1.6077h2.2677c.2065 0 1.1065.0587 1.394 1.2088.0901.3533.2875 1.5044.4232 1.8729.1346.413.6833 1.2381 1.2685 1.2381h3.5716a.7492.7492 0 00.1296-.0131 8.7874 8.7874 0 01-.8119.9526zM6.8369 20.024a.714.714 0 11-.2997-1.396.714.714 0 01.2997 1.396zM4.1177 8.9972a.7137.7137 0 11-1.304.5791.7137.7137 0 011.304-.579zm-.8352 1.9813l1.5347-.6824a.65.65 0 00.33-.8585l-.3158-.7147h1.2432v5.6025H3.5669a8.7753 8.7753 0 01-.2834-3.348zm6.7343-.5437V8.7836h2.9601c.153 0 1.0792.1772 1.0792.8697 0 .575-.7107.7815-1.2948.7815zm10.7574 1.4862c0 .2187-.008.4363-.0243.651h-.9c-.09 0-.1265.0586-.1265.1477v.413c0 .973-.5487 1.1846-1.0296 1.2382-.4576.0517-.9648-.1913-1.0275-.4717-.2704-1.5186-.7198-1.8436-1.4305-2.4034.8817-.5599 1.799-1.386 1.799-2.4915 0-1.1936-.819-1.9458-1.3769-2.3153-.7825-.5163-1.6491-.6195-1.883-.6195H5.4682a8.7651 8.7651 0 014.907-2.7699l1.0974 1.151a.648.648 0 00.9182.0213l1.227-1.1743a8.7753 8.7753 0 016.0044 4.2762l-.8403 1.8982a.652.652 0 00.33.8585l1.6178.7188c.0283.2875.0425.577.0425.8717zm-9.3006-9.5993a.7128.7128 0 11.984 1.0316.7137.7137 0 01-.984-1.0316zm8.3389 6.71a.7107.7107 0 01.9395-.3625.7137.7137 0 11-.9405.3635z",source:"https://www.rust-lang.org",hex:"000000",guidelines:"https://www.rust-lang.org/policies/media-guide",license:{type:"CC-BY-SA-4.0",url:"https://spdx.org/licenses/CC-BY-SA-4.0"}},f9={title:"Vite",slug:"vite",get svg(){return Xn+"Vite"+Zn+this.path+Qn},path:"M13.056 23.238a.57.57 0 0 1-1.02-.355v-5.202c0-.63-.512-1.143-1.144-1.143H5.148a.57.57 0 0 1-.464-.903l3.777-5.29c.54-.753 0-1.804-.93-1.804H.57a.574.574 0 0 1-.543-.746.6.6 0 0 1 .08-.157L5.008.78a.57.57 0 0 1 .467-.24h14.589a.57.57 0 0 1 .466.903l-3.778 5.29c-.54.755 0 1.806.93 1.806h5.745c.238 0 .424.138.513.322a.56.56 0 0 1-.063.603z",source:"https://github.com/voidzero-dev/community-design-resources/blob/55902097229cf01cf2a4ceb376f992f5cf306756/brand-assets/vite/vite-icon-color-bracketless.svg",hex:"9135FF"},m9={title:"Yarn",slug:"yarn",get svg(){return Xn+"Yarn"+Zn+this.path+Qn},path:"M12 0C5.375 0 0 5.375 0 12s5.375 12 12 12 12-5.375 12-12S18.625 0 12 0zm.768 4.105c.183 0 .363.053.525.157.125.083.287.185.755 1.154.31-.088.468-.042.551-.019.204.056.366.19.463.375.477.917.542 2.553.334 3.605-.241 1.232-.755 2.029-1.131 2.576.324.329.778.899 1.117 1.825.278.774.31 1.478.273 2.015a5.51 5.51 0 0 0 .602-.329c.593-.366 1.487-.917 2.553-.931.714-.009 1.269.445 1.353 1.103a1.23 1.23 0 0 1-.945 1.362c-.649.158-.95.278-1.821.843-1.232.797-2.539 1.242-3.012 1.39a1.686 1.686 0 0 1-.704.343c-.737.181-3.266.315-3.466.315h-.046c-.783 0-1.214-.241-1.45-.491-.658.329-1.51.19-2.122-.134a1.078 1.078 0 0 1-.58-1.153 1.243 1.243 0 0 1-.153-.195c-.162-.25-.528-.936-.454-1.946.056-.723.556-1.367.88-1.71a5.522 5.522 0 0 1 .408-2.256c.306-.727.885-1.348 1.32-1.737-.32-.537-.644-1.367-.329-2.21.227-.602.412-.936.82-1.08h-.005c.199-.074.389-.153.486-.259a3.418 3.418 0 0 1 2.298-1.103c.037-.093.079-.185.125-.283.31-.658.639-1.029 1.024-1.168a.94.94 0 0 1 .328-.06zm.006.7c-.507.016-1.001 1.519-1.001 1.519s-1.27-.204-2.266.871c-.199.218-.468.334-.746.44-.079.028-.176.023-.417.672-.371.991.625 2.094.625 2.094s-1.186.839-1.626 1.881c-.486 1.144-.338 2.261-.338 2.261s-.843.732-.899 1.487c-.051.663.139 1.2.343 1.515.227.343.51.176.51.176s-.561.653-.037.931c.477.25 1.283.394 1.71-.037.31-.31.371-1.001.486-1.283.028-.065.12.111.209.199.097.093.264.195.264.195s-.755.324-.445 1.066c.102.246.468.403 1.066.398.222-.005 2.664-.139 3.313-.296.375-.088.505-.283.505-.283s1.566-.431 2.998-1.357c.917-.598 1.293-.76 2.034-.936.612-.148.57-1.098-.241-1.084-.839.009-1.575.44-2.196.825-1.163.718-1.742.672-1.742.672l-.018-.032c-.079-.13.371-1.293-.134-2.678-.547-1.515-1.413-1.881-1.344-1.997.297-.5 1.038-1.297 1.334-2.78.176-.899.13-2.377-.269-3.151-.074-.144-.732.241-.732.241s-.616-1.371-.788-1.483a.271.271 0 0 0-.157-.046z",source:"https://github.com/yarnpkg/assets/blob/76d30ca2aebed5b73ea8131d972218fb860bd32d/yarn-kitten-circle.svg",hex:"2C8EBB",guidelines:"https://github.com/yarnpkg/assets/tree/76d30ca2aebed5b73ea8131d972218fb860bd32d",license:{type:"CC-BY-4.0",url:"https://spdx.org/licenses/CC-BY-4.0"}};function p9(e){const t=e.toLowerCase();return/\bvite\b/.test(t)?dn.vite:/\bcargo\s+/.test(t)?dn.cargo:/\brustc\b/.test(t)?dn.rust:/\bdotnet\b/.test(t)?dn.dotnet:/\bdocker(?:\s+compose|-compose|\s+)/.test(t)?dn.docker:/\bpython3?\b|\buvicorn\b|\bfastapi\b/.test(t)?dn.python:/\bgo\s+(run|test|build)\b|\bair\b/.test(t)?dn.go:/\bbun\b/.test(t)?dn.bun:/\bdeno\b/.test(t)?dn.deno:/\bpnpm\b/.test(t)?dn.pnpm:/\byarn\b/.test(t)?dn.yarn:/\bnpm\b/.test(t)?dn.npm:/\bnode\b/.test(t)?dn.node:dn.generic}const dn={bun:{kind:"bun",label:"Bun"},cargo:{kind:"cargo",label:"Cargo"},deno:{kind:"deno",label:"Deno"},dotnet:{kind:"dotnet",label:".NET"},docker:{kind:"docker",label:"Docker"},generic:{kind:"generic",label:"Process"},go:{kind:"go",label:"Go"},node:{kind:"node",label:"Node"},npm:{kind:"npm",label:"npm"},pnpm:{kind:"pnpm",label:"pnpm"},python:{kind:"python",label:"Python"},rust:{kind:"rust",label:"Rust"},vite:{kind:"vite",label:"Vite"},yarn:{kind:"yarn",label:"Yarn"}};function Hb({command:e,compact:t}){const s=p9(e),i=g9[s.kind];return l.jsx("span",{"aria-label":`${s.label} process`,className:de("inline-flex shrink-0 items-center justify-center rounded-md border bg-card shadow-sm dark:border-zinc-700/80 dark:bg-zinc-100",t?"size-6":"size-7",i?"border-border":"border-border bg-muted text-muted-foreground dark:bg-zinc-100 dark:text-zinc-700"),style:i?{color:`#${i.hex}`}:void 0,title:s.label,children:i?l.jsx("svg",{"aria-hidden":"true",className:t?"size-3.5":"size-4",fill:"currentColor",role:"img",viewBox:"0 0 24 24",children:l.jsx("path",{d:i.path})}):l.jsx(Hk,{className:t?"size-3.5":"size-4"})})}const g9={bun:r9,cargo:FS,deno:a9,dotnet:i9,docker:o9,generic:null,go:l9,node:c9,npm:u9,pnpm:d9,python:h9,rust:FS,vite:f9,yarn:m9};function Hn({className:e,...t}){return l.jsx("label",{className:de("grid gap-1.5 text-xs font-medium text-muted-foreground",e),...t})}const b9=[{label:"npm",command:"npm run dev",description:"Node dev server"},{label:"pnpm",command:"pnpm dev",description:"pnpm dev server"},{label:"yarn",command:"yarn dev",description:"Yarn dev server"},{label:"bun",command:"bun dev",description:"Bun dev server"},{label:"Deno",command:"deno task dev",description:"Deno dev task"},{label:"Vite",badgeCommand:"vite",command:"npm run dev -- --host 127.0.0.1",description:"Vite app"},{label:"Go",command:"go run .",description:"Go app"},{label:"Rust",command:"cargo run",description:"Rust app"},{label:".NET",command:"dotnet watch run",description:".NET app"},{label:"Python",command:"python manage.py runserver",description:"Python app"},{label:"Docker",command:"docker compose up",description:"Docker Compose stack"}],VS=[{value:"local",label:"Local",hint:"Run a command in a local working directory."},{value:"docker-compose",label:"Docker Compose",hint:"Bring up a service defined in a docker-compose.yml file."},{value:"ssh",label:"SSH (remote)",hint:"Run a command on a remote host using your local ~/.ssh/config + ssh-agent."}];function v9({result:e}){const t=[...e.stdout,...e.stderr].slice(0,4);return l.jsxs(it,{variant:e.ok?"default":"destructive",children:[l.jsx("div",{className:"font-medium",children:e.ok?"Command test passed":"Command test failed"}),l.jsx("div",{className:"mt-1 text-xs",children:e.message}),t.length?l.jsx("pre",{className:"mt-2 max-h-24 overflow-auto rounded-md bg-background/80 p-2 font-mono text-[11px] leading-4",children:t.join(`
|
|
69
|
-
`)}):null]})}function Ub({active:e,baseUrl:t,compact:s=!1,onRefresh:i,onStarted:a,restartAction:o,solidStart:u=!1,targetLabel:h}){return e?l.jsxs(l.Fragment,{children:[l.jsx(Rp,{compact:s,intent:"restart",icon:l.jsx(ab,{}),label:"Restart",action:o,targetLabel:h,url:`${t}/restart`,onRefresh:i,onSuccess:a}),l.jsx(Rp,{compact:s,intent:"stop",icon:l.jsx(qh,{}),label:"Stop",targetLabel:h,url:`${t}/stop`,onRefresh:i})]}):l.jsx(Rp,{compact:s,intent:u?"startSolid":"start",icon:l.jsx(Vh,{}),label:"Start",targetLabel:h,url:`${t}/start`,onRefresh:i,onSuccess:a})}function Ch(e,t,s){const i=s instanceof Error?s.message:String(s);return`${e} failed for ${t}: ${i}`}function Rp({action:e,compact:t=!1,intent:s="neutral",icon:i,label:a,targetLabel:o,url:u,onRefresh:h,onSuccess:m}){const[f,p]=w.useState(!1),[b,x]=w.useState(null),{error:_,success:y}=Bs();async function S(E={}){p(!0);try{e?await e():await pn(u,E),y(`${a} requested for ${o}.`),await h(),x(null),m?.()}catch(T){T instanceof Uk?x(T.conflict):_(Ch(a,o,T))}finally{p(!1)}}const C=l.jsxs(re,{"aria-label":a,className:`${_9[s]} ${t?"size-7":""}`.trim(),disabled:f,onClick:()=>S(),size:t?"icon":"sm",variant:"outline",children:[i,t?null:a]});return l.jsxs(l.Fragment,{children:[t?l.jsx(Qo,{label:a,children:C}):C,b?l.jsx(x9,{busy:f,conflict:b,onCancel:()=>x(null),onKillAndStart:()=>S({strategy:"killHolder"}),targetLabel:o}):null]})}function x9({busy:e,conflict:t,onCancel:s,onKillAndStart:i,targetLabel:a}){const o=t.holder,u=`http://localhost:${t.port}/`;return l.jsx(Ti,{icon:l.jsx(sj,{}),onClose:e?()=>{}:s,title:`Port ${t.port} is already in use`,children:l.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:a})," wants port"," ",l.jsx("span",{className:"font-mono",children:t.port}),", but it's already held by:"]}),l.jsx("pre",{className:"overflow-auto whitespace-pre-wrap rounded border border-border bg-background p-3 font-mono text-xs",children:o?`pid ${o.pid}${o.pgid?` (pgid ${o.pgid})`:""}
|
|
70
|
-
${o.command}`:"unknown process"}),l.jsxs("div",{className:"flex flex-wrap justify-end gap-2 pt-2",children:[l.jsx(re,{onClick:s,size:"sm",type:"button",variant:"outline",disabled:e,children:"Cancel"}),l.jsxs(re,{onClick:()=>window.open(u,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",disabled:e,children:[l.jsx(Jc,{}),"Open in browser"]}),l.jsx(re,{className:"border-red-600 bg-red-600 text-white hover:bg-red-700",disabled:e||!o,onClick:i,size:"sm",type:"button",children:"Stop holder & start"})]})]})})}const _9={neutral:"",restart:"border-amber-600 bg-amber-600 text-white hover:bg-amber-700",start:"",startSolid:"border-emerald-600 bg-emerald-600 text-white hover:bg-emerald-700",stop:"border-red-600 bg-red-600 text-white hover:bg-red-700"};function y9({cwd:e,onRefresh:t,onSaved:s,initialService:i}){const{error:a,success:o}=Bs(),u=!!i,[h,m]=w.useState(i?.kind??"local"),[f,p]=w.useState(i?.name??""),[b,x]=w.useState(i?.command??""),[_,y]=w.useState(i?.cwd??e),[S,C]=w.useState(i?.port?String(i.port):""),[E,T]=w.useState(i?.description??""),[N,M]=w.useState(i?.composeFile??""),[R,z]=w.useState(i?.composeService??""),[L,j]=w.useState(i?.host??""),[H,P]=w.useState(null),[F,K]=w.useState(!1);w.useEffect(()=>{P(null)},[b,_,S,h]);function Y(){p(""),x(""),y(e),C(""),T(""),M(""),z(""),j(""),P(null)}async function Q(O){O.preventDefault();try{const X={name:f,kind:h,cwd:_,port:S,description:E};(h==="local"||h==="ssh")&&(X.command=b),h==="docker-compose"&&(X.composeFile=N,X.composeService=R),h==="ssh"&&(X.host=L),await pn("/api/services",X),u||Y(),o(u?`${f} updated.`:`${f} added.`),await t(),s?.()}catch(X){a(Ch(u?"Update service":"Add service",f||"service",X))}}async function q(){if(!b.trim()){a("Test command failed for service: command is required.");return}K(!0);try{P(await e6({command:b,cwd:_,port:S}))}catch(O){a(Ch("Test command",f||"service",O))}finally{K(!1)}}return{editing:u,kind:h,setKind:m,name:f,setName:p,command:b,setCommand:x,formCwd:_,setFormCwd:y,port:S,setPort:C,description:E,setDescription:T,composeFile:N,setComposeFile:M,composeService:R,setComposeService:z,host:L,setHost:j,testResult:H,testing:F,submit:Q,testCommand:q}}function qS({cwd:e,onRefresh:t,onSaved:s,initialService:i}){const{editing:a,kind:o,setKind:u,name:h,setName:m,command:f,setCommand:p,formCwd:b,setFormCwd:x,port:_,setPort:y,description:S,setDescription:C,composeFile:E,setComposeFile:T,composeService:N,setComposeService:M,host:R,setHost:z,testResult:L,testing:j,submit:H,testCommand:P}=y9({cwd:e,onRefresh:t,onSaved:s,initialService:i}),F=VS.find(q=>q.value===o),K=o==="local"&&f.trim().length>0&&b.trim().length>0,Y="grid gap-2 rounded-md border border-border bg-muted/30 p-3",Q="px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground";return l.jsxs("form",{className:"grid gap-3",onSubmit:H,children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[l.jsxs("fieldset",{className:`${Y} sm:col-span-2`,children:[l.jsx("legend",{className:Q,children:"Step 1 · Service kind"}),l.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:VS.map(q=>l.jsx(re,{className:"justify-center",disabled:a,onClick:()=>u(q.value),size:"sm",type:"button",variant:o===q.value?"default":"outline",children:q.label},q.value))}),l.jsx("p",{className:"text-[11px] text-muted-foreground",children:F.hint})]}),l.jsxs("div",{className:"grid gap-3 sm:col-start-1 sm:row-start-2 sm:self-start",children:[l.jsxs("fieldset",{className:Y,children:[l.jsx("legend",{className:Q,children:"Step 2 · Identity"}),l.jsxs(Hn,{children:["Name",l.jsx(et,{className:"h-8 text-sm",name:"name",onChange:q=>m(q.target.value),placeholder:"backend",readOnly:a,required:!0,value:h}),a?l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Name is the service key and can't be changed here."}):null]}),l.jsxs(Hn,{children:["Description",l.jsx(et,{className:"h-8 text-sm",name:"description",onChange:q=>C(q.target.value),placeholder:"API server",value:S})]})]}),l.jsxs("fieldset",{className:Y,children:[l.jsx("legend",{className:Q,children:"Step 4 · Networking (optional)"}),l.jsxs(Hn,{children:["Port",l.jsx(et,{className:"h-8 text-sm",inputMode:"numeric",name:"port",onChange:q=>y(q.target.value),placeholder:"3001",value:_})]})]})]}),o==="local"?l.jsxs("fieldset",{className:`${Y} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[l.jsx("legend",{className:Q,children:"Step 3 · Local command"}),l.jsx("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-4",children:b9.map(q=>l.jsxs(re,{className:"justify-start gap-1.5",onClick:()=>{p(q.command),C(q.description)},size:"sm",type:"button",variant:"outline",children:[l.jsx(Hb,{command:q.badgeCommand??q.command,compact:!0}),l.jsx("span",{className:"truncate",children:q.label})]},q.label))}),l.jsxs(Hn,{children:["Command",l.jsx(et,{className:"h-8 font-mono text-sm",name:"command",onChange:q=>p(q.target.value),placeholder:"npm run dev",required:!0,value:f})]}),l.jsxs(Hn,{children:["Working Directory",l.jsx(et,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>x(q.target.value),required:!0,value:b})]})]}):null,o==="docker-compose"?l.jsxs("fieldset",{className:`${Y} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[l.jsx("legend",{className:Q,children:"Step 3 · Docker Compose target"}),l.jsxs(Hn,{children:["Compose Service",l.jsx(et,{className:"h-8 font-mono text-sm",name:"composeService",onChange:q=>M(q.target.value),placeholder:"api",required:!0,value:N})]}),l.jsxs(Hn,{children:["Compose File (optional)",l.jsx(et,{className:"h-8 font-mono text-sm",name:"composeFile",onChange:q=>T(q.target.value),placeholder:"docker-compose.yml",value:E})]}),l.jsxs(Hn,{children:["Working Directory (where compose file lives)",l.jsx(et,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>x(q.target.value),required:!0,value:b})]})]}):null,o==="ssh"?l.jsxs("fieldset",{className:`${Y} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[l.jsx("legend",{className:Q,children:"Step 3 · SSH connection"}),l.jsxs(Hn,{children:["SSH Host (alias from ~/.ssh/config)",l.jsx(et,{className:"h-8 font-mono text-sm",name:"host",onChange:q=>z(q.target.value),placeholder:"devbox",required:!0,value:R})]}),l.jsxs(Hn,{children:["Remote Command",l.jsx(et,{className:"h-8 font-mono text-sm",name:"command",onChange:q=>p(q.target.value),placeholder:"npm run dev",required:!0,value:f})]}),l.jsxs(Hn,{children:["Remote Working Directory",l.jsx(et,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>x(q.target.value),placeholder:"/srv/app",required:!0,value:b})]}),l.jsxs(it,{variant:"muted",children:[l.jsx("div",{className:"font-medium",children:"SSH key handling"}),l.jsxs("div",{className:"mt-1 text-xs",children:["NoMoreIDE never stores key files. Add a ",l.jsxs("code",{children:["Host ",R||"<alias>"]})," entry to",l.jsx("code",{children:" ~/.ssh/config"})," with ",l.jsx("code",{children:"HostName"}),", ",l.jsx("code",{children:"User"}),", and"," ",l.jsx("code",{children:"IdentityFile ~/.ssh/your-key.pem"})," (chmod 0600). Make sure"," ",l.jsx("code",{children:"ssh-agent"})," is running or your key is loaded (",l.jsx("code",{children:"ssh-add ~/.ssh/your-key.pem"}),"). NoMoreIDE will run"," ",l.jsxs("code",{children:["ssh ",R||"<alias>"]})," using that config."]})]})]}):null]}),L?l.jsx(v9,{result:L}):null,l.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[o==="local"?l.jsxs(re,{disabled:j||!K,onClick:P,type:"button",variant:"outline",children:[l.jsx(Hk,{}),j?"Testing...":"Test Command"]}):null,l.jsx(re,{type:"submit",children:a?"Save Service":"Add Service"})]})]})}function eN({initialName:e="",initialServices:t=[],onSaved:s,onRefresh:i,originalName:a,services:o,submitLabel:u="Save Group"}){const{error:h,success:m}=Bs();async function f(p){p.preventDefault();const b=p.currentTarget,x=new FormData(b),_=String(x.get("name")??""),y=x.getAll("services").map(S=>String(S)).filter(Boolean);try{await pn("/api/bundles",{name:_,originalName:a,services:y.join(",")}),b.reset(),m(`${_} group saved.`),await i(),s?.()}catch(S){h(Ch("Save group",_||"group",S))}}return l.jsxs("form",{className:"grid gap-2.5",onSubmit:f,children:[l.jsxs(Hn,{children:["Group name",l.jsx(et,{className:"h-8 text-sm",defaultValue:e,name:"name",placeholder:"full-stack",required:!0})]}),l.jsxs("fieldset",{className:"grid gap-1.5",children:[l.jsx("legend",{className:"text-xs font-medium",children:"Services"}),o.length?o.map(p=>l.jsxs("label",{className:"flex items-center gap-2 overflow-hidden rounded-md border border-border px-2.5 py-1.5 text-sm",children:[l.jsx("input",{className:"size-4 shrink-0 accent-primary",defaultChecked:t.includes(p.name),name:"services",type:"checkbox",value:p.name}),l.jsx(Hb,{command:p.command??"",compact:!0}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block truncate text-sm font-medium",children:p.name}),l.jsx("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:p.command??p.kind??""})]})]},p.name)):l.jsx(it,{variant:"muted",children:"All services are already grouped, or none registered."})]}),l.jsx(re,{className:"h-8",disabled:!o.length,type:"submit",children:u})]})}function S9({allServices:e,group:t,onRefresh:s,ports:i,services:a,health:o,statuses:u,timeline:h,selectedService:m,onSelectService:f,onDropService:p}){const[b,x]=w.useState(!1),[_,y]=w.useState(!1),[S,C]=w.useState(!1),E=a.some(M=>Bc(u[M.name]?.state));function T(M){!p||!M.dataTransfer.types.includes(qc)||(M.preventDefault(),M.dataTransfer.dropEffect="copy",C(!0))}function N(M){if(!p)return;M.preventDefault(),C(!1);const R=M.dataTransfer.getData(qc);R&&p(R)}return l.jsxs("section",{className:de("transition-colors",S&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:T,onDragLeave:()=>C(!1),onDrop:N,children:[l.jsxs("div",{className:"flex items-center gap-1.5 bg-muted/35 px-3 py-1.5",children:[l.jsxs("button",{"aria-expanded":!_,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left",onClick:()=>y(M=>!M),type:"button",children:[l.jsx(Yn,{className:de("size-3.5 shrink-0 text-muted-foreground transition-transform",_&&"-rotate-90")}),l.jsx("span",{className:"truncate text-sm font-medium",children:t.name}),t.services.length?l.jsx($e,{size:"small",variant:"secondary",children:t.services.length}):null]}),l.jsx(Qo,{label:"Edit group",children:l.jsx(re,{"aria-expanded":b,"aria-label":`Edit ${t.name}`,className:"size-7",onClick:()=>x(M=>!M),size:"icon",type:"button",variant:"ghost",children:l.jsx(Pc,{})})}),l.jsx(Ub,{active:E,baseUrl:`/api/bundles/${encodeURIComponent(t.name)}`,compact:!0,restartAction:async()=>{await pn(`/api/bundles/${encodeURIComponent(t.name)}/stop`,{}),await pn(`/api/bundles/${encodeURIComponent(t.name)}/start`,{})},solidStart:!0,targetLabel:`group ${t.name}`,onRefresh:s,onStarted:()=>{const M=a[0];M&&f(M.name)}})]}),b?l.jsx("div",{className:"border-t border-border bg-background/65 p-3",children:l.jsx(eN,{initialName:t.name,initialServices:t.services,onRefresh:s,onSaved:()=>x(!1),originalName:t.name,services:e,submitLabel:"Save Group"})}):null,_?null:l.jsx("div",{className:"divide-y divide-border border-t border-border bg-background/45",children:a.length?a.map(M=>l.jsx(tN,{service:M,status:u[M.name],health:o[M.name],ports:i,onRefresh:s,timeline:h,selected:m===M.name,onSelect:()=>f(M.name)},M.name)):l.jsx(it,{variant:"muted",className:"m-4",children:"This group does not match any registered services."})})]})}function tN({service:e,status:t,onRefresh:s,selected:i=!1,onSelect:a}){const o=t?.state??"stopped",u=Bc(o),[h,m]=w.useState(!1);return l.jsxs("div",{"aria-selected":i,draggable:!0,onDragStart:f=>{f.dataTransfer.setData(qc,e.name),e.cwd&&QE(f.dataTransfer,e.cwd),f.dataTransfer.effectAllowed="copyMove",m(!0)},onDragEnd:()=>m(!1),className:de("group grid cursor-pointer grid-cols-[1.75rem_minmax(0,1fr)_auto_auto] items-center gap-2 border-l-2 px-3 py-1.5 transition-colors",h&&"opacity-50",i?"border-l-primary bg-primary/10":"border-l-transparent hover:bg-muted"),onClick:a,role:"option",children:[l.jsx(Hb,{command:e.command??""}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"truncate text-sm font-medium",children:e.name}),l.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[l.jsx(w9,{kind:e.kind}),e.port?l.jsxs("span",{children:[":",e.port]}):null]})]}),l.jsx(Fb,{state:o}),l.jsx("span",{className:"flex items-center gap-1",onClick:f=>f.stopPropagation(),children:l.jsx(Ub,{active:u,baseUrl:`/api/services/${encodeURIComponent(e.name)}`,compact:!0,targetLabel:e.name,onRefresh:s,onStarted:a})})]})}const qc="application/x-nomoreide-service",GS={local:{label:"local",className:"border-border bg-muted text-muted-foreground"},"docker-compose":{label:"docker",className:"border-sky-500/40 bg-sky-500/10 text-sky-700 dark:text-sky-300"},ssh:{label:"ssh",className:"border-violet-500/40 bg-violet-500/10 text-violet-700 dark:text-violet-300"}};function w9({kind:e}){const t=GS[e??"local"]??GS.local;return l.jsx("span",{className:de("rounded border px-1 py-px text-[9px] font-semibold uppercase leading-none tracking-wide",t.className),children:t.label})}function Bc(e){return e==="running"||e==="starting"}function k9(e){return`http://127.0.0.1:${e}`}function Fb({state:e}){return l.jsx($e,{variant:e==="running"?"success":e==="exited"?"danger":e==="starting"?"warning":"outline",className:de(e==="running"&&"font-mono"),children:e})}function C9({data:e}){const[t,s]=w.useState(!1),[i,a]=w.useState(()=>HS()),[o,u]=w.useState(""),[h,m]=w.useState([]),[f,p]=w.useState([]),[b,x]=w.useState(null),{sendToAgent:_}=Ls();w.useEffect(()=>{if(!t)return;let N=!0;return x(null),Promise.allSettled([Fk(),Vk(20)]).then(M=>{if(!N)return;const[R,z]=M;R.status==="fulfilled"&&m(R.value),z.status==="fulfilled"&&p(z.value),M.filter(j=>j.status==="rejected").length&&x("Some AI context could not be loaded. You can still send available context.")}),()=>{N=!1}},[t]);const y=w.useMemo(()=>E9(e),[e]),S=N7(i),C=w.useMemo(()=>i.serviceNames.length+i.databaseNames.length+i.errorIds.length+i.repositoryPaths.length,[i]);function E(N,M){a(R=>{const z=R[N],L=z.includes(M)?z.filter(j=>j!==M):[...z,M];return{...R,[N]:L}})}function T(){S&&(_({prompt:T7({dashboard:e,databases:h,incidents:f,note:o,selection:i}),source:{type:"workspace-context",label:"AI Diagnose"},label:A7({note:o,selection:i})}),s(!1),u(""),a(HS()))}return l.jsxs(l.Fragment,{children:[l.jsxs("button",{"aria-label":"Open AI Diagnose",className:yh(),onClick:()=>s(!0),title:"Open AI Diagnose",type:"button",children:[l.jsx("span",{className:Sh(),children:l.jsx(ci,{className:"size-4"})}),l.jsx("span",{className:wh(),children:"Diagnose"})]}),t?l.jsx(Ti,{icon:l.jsx(ci,{}),onClose:()=>s(!1),size:"xl",title:"AI Diagnose",children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium",children:"Pick the context the agent should inspect"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"Combine services, databases, incidents, and repositories into one focused prompt."})]}),l.jsxs($e,{variant:C?"secondary":"outline",children:[C," selected"]})]}),b?l.jsx(it,{variant:"muted",children:b}):null,l.jsxs("div",{className:"grid min-h-0 gap-3 overflow-hidden lg:grid-cols-4",children:[l.jsx(Pd,{count:e.config.services.length,icon:l.jsx($k,{}),title:"Services",children:l.jsx("div",{className:"grid gap-2",children:e.config.services.map(N=>{const M=i.serviceNames.includes(N.name),R=e.runtime.services[N.name],z=e.health[N.name];return l.jsxs($d,{selected:M,onClick:()=>E("serviceNames",N.name),children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[l.jsx("span",{className:"min-w-0 flex-1 truncate font-semibold",children:N.name}),l.jsx("span",{className:"shrink-0",children:l.jsx(Fb,{state:R?.state??"stopped"})})]}),l.jsxs("span",{className:"mt-1 flex flex-wrap gap-1.5 text-[11px] text-muted-foreground",children:[N.kind?l.jsx("span",{children:N.kind}):null,N.port?l.jsxs("span",{children:[":",N.port]}):null,z?.status?l.jsx("span",{children:z.status}):null]})]},N.name)})})}),l.jsx(Pd,{count:h.length,icon:l.jsx(ui,{}),title:"Databases",children:h.length?l.jsx("div",{className:"grid gap-2",children:h.map(N=>l.jsxs($d,{selected:i.databaseNames.includes(N.name),onClick:()=>E("databaseNames",N.name),children:[l.jsx("span",{className:"truncate font-semibold",children:N.name}),l.jsx("span",{className:"mt-1 block truncate text-[11px] text-muted-foreground",children:N.engine})]},N.name))}):l.jsx(KS,{text:"No database connections detected."})}),l.jsx(Pd,{count:f.length,icon:l.jsx(uh,{}),title:"Error Inbox",children:f.length?l.jsx("div",{className:"grid gap-2",children:f.map(N=>l.jsxs($d,{selected:i.errorIds.includes(N.id),onClick:()=>E("errorIds",N.id),children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[l.jsx("span",{className:"min-w-0 flex-1 truncate font-semibold",children:N.title}),l.jsx($e,{appearance:"subtle",size:"small",variant:N.level==="error"?"danger":"secondary",children:N.level})]}),l.jsxs("span",{className:"mt-1 block min-w-0 truncate font-mono text-[11px] text-muted-foreground",children:[N.service," x",N.count]})]},N.id))}):l.jsx(KS,{text:"No recent incidents."})}),l.jsx(Pd,{count:y.length,icon:l.jsx(Wn,{}),title:"Git Repositories",children:l.jsx("div",{className:"grid gap-2",children:y.map(N=>{const M=i.repositoryPaths.includes(N.path),R=N.path===(e.git.selectedRepository?.path??e.git.cwd),z=R?e.git.status?.files.length??0:void 0;return l.jsxs($d,{selected:M,onClick:()=>E("repositoryPaths",N.path),children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[l.jsx("span",{className:"min-w-0 flex-1 truncate font-semibold",children:N.name}),R?l.jsx($e,{className:"shrink-0",size:"small",variant:"outline",children:"current"}):null]}),l.jsx("span",{className:"mt-1 block min-w-0 truncate font-mono text-[11px] text-muted-foreground",children:N.path}),z!==void 0?l.jsx("span",{className:"mt-1 block truncate text-[11px] text-muted-foreground",children:z?`${z} changed file${z===1?"":"s"}`:"No changed files"}):null]},N.path)})})})]}),l.jsxs("label",{className:"block space-y-2",children:[l.jsx("span",{className:"text-sm font-medium",children:"Extra context"}),l.jsx("textarea",{className:"min-h-24 w-full resize-y rounded-md border border-border bg-background px-3 py-2 text-sm outline-none transition-colors placeholder:text-muted-foreground focus:border-foreground/40 focus:ring-2 focus:ring-ring",onChange:N=>u(N.target.value),placeholder:"Example: checkout is failing after login, API exits when DB is selected...",value:o})]}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(re,{onClick:()=>s(!1),type:"button",variant:"outline",children:"Cancel"}),l.jsxs(re,{className:"gap-2",disabled:!S,onClick:T,type:"button",children:[l.jsx(RM,{className:"size-4"}),"Send"]})]})]})}):null]})}function Pd({children:e,count:t,icon:s,title:i}){return l.jsxs("section",{className:"flex max-h-[min(520px,calc(100vh-18rem))] min-h-0 min-w-0 flex-col space-y-2 rounded-md border border-border bg-background/45 p-3",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-sm font-semibold",children:[l.jsx("span",{className:"flex size-6 items-center justify-center rounded-md border border-border bg-background text-muted-foreground [&_svg]:size-3.5",children:s}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:i}),l.jsx($e,{className:"shrink-0",size:"small",variant:"outline",children:t})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-auto pr-1",children:e})]})}function $d({children:e,onClick:t,selected:s}){return l.jsx("button",{"aria-pressed":s,className:de("min-h-16 min-w-0 rounded-md border p-3 text-left text-sm transition-colors",s?"border-primary bg-primary/10 text-foreground":"border-border bg-background hover:border-foreground/30 hover:bg-muted/60"),onClick:t,type:"button",children:e})}function KS({text:e}){return l.jsx("div",{className:"rounded-md border border-dashed border-border bg-background/60 px-3 py-3 text-xs text-muted-foreground",children:e})}function E9(e){return e.config.gitRepositories.length?e.config.gitRepositories:e.git.selectedRepository?[e.git.selectedRepository]:[{name:e.git.cwd.split("/").pop()??"repository",path:e.git.cwd}]}const N9=new Set(["c","cpp","cs","go","java","js","jsx","kt","mjs","py","rs","swift","ts","tsx"]),T9=new Set([".env",".gitignore","components.json","dockerfile","package.json","tsconfig.json","vite.config.ts"]),A9=new Set(["conf","config","ini","toml","yaml","yml"]),M9=new Set(["csv","json","sql","xml"]),j9=new Set(["md","mdx","rst","txt"]),R9=new Set(["gif","jpeg","jpg","png","svg","webp"]),D9=new Set(["package-lock.json","pnpm-lock.yaml","yarn.lock"]),O9=new Set(["css","less","sass","scss"]);function L9(e){const t=e.split("/").pop()?.toLowerCase()??e.toLowerCase(),s=t.includes(".")?t.split(".").pop()??"":"";return D9.has(t)||t.endsWith(".lock")?"lock":B9(t)?"test":T9.has(t)||A9.has(s)?"config":O9.has(s)?"style":R9.has(s)?"image":j9.has(s)?"document":M9.has(s)?"data":N9.has(s)?"code":"generic"}function B9(e){return e.includes(".test.")||e.includes(".spec.")||e.endsWith("_test.go")}function Vb({path:e,className:t}){const s=L9(e),i=z9[s];return l.jsx(i,{"aria-label":`${s} file`,className:de("size-3.5 shrink-0",I9[s],t)})}const z9={code:Ak,config:LM,data:ui,document:jk,generic:Rk,image:$4,lock:X4,style:lM,test:b4},I9={code:"text-sky-600",config:"text-zinc-600",data:"text-emerald-700",document:"text-blue-700",generic:"text-muted-foreground",image:"text-fuchsia-700",lock:"text-amber-700",style:"text-rose-700",test:"text-violet-700"};function P9(e){const t=e.lastIndexOf(".");return t>0?e.slice(t):""}function $9({onPick:e,onClose:t}){const[s,i]=w.useState(""),[a,o]=w.useState(null),[u,h]=w.useState(null),[m,f]=w.useState(!1),p=w.useRef(null),b=a?a.parent!==a.path:!1;return w.useEffect(()=>{function x(_){p.current&&!p.current.contains(_.target)&&t()}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[t]),w.useEffect(()=>{let x=!0;return f(!0),h(null),Gk(s,{files:!0}).then(_=>x&&o(_)).catch(_=>x&&h(_ instanceof Error?_.message:String(_))).finally(()=>x&&f(!1)),()=>{x=!1}},[s]),l.jsxs("div",{ref:p,className:"absolute bottom-full left-2 z-10 mb-2 w-[22rem] max-w-[calc(100vw-1rem)] overflow-hidden rounded-md border border-border bg-card shadow-lg",children:[l.jsxs("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1.5",children:[l.jsx(re,{"aria-label":"Parent folder",className:"size-7",disabled:!b,onClick:()=>a&&i(a.parent),size:"icon",type:"button",variant:"ghost",children:l.jsx(Uh,{})}),l.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",title:a?.path,children:a?.path??"…"}),m?l.jsx(Os,{className:"size-3.5 animate-spin text-muted-foreground"}):null,a?l.jsxs(re,{className:"h-7 px-2 text-[11px]",onClick:()=>e(a.path),size:"sm",title:"Attach this folder",type:"button",variant:"outline",children:[l.jsx(JA,{})," This folder"]}):null,l.jsx(re,{"aria-label":"Close",className:"size-7",onClick:t,size:"icon",type:"button",variant:"ghost",children:l.jsx(Js,{})})]}),l.jsx("div",{className:"max-h-64 overflow-auto p-1",children:u?l.jsx(it,{variant:"destructive",className:"m-1",children:u}):a&&a.entries.length===0?l.jsx(it,{variant:"muted",className:"m-1 text-center",children:"Empty folder."}):a?.entries.map(x=>{const _=x.isDir?"":P9(x.name);return l.jsxs("button",{className:"flex w-full items-center gap-1.5 rounded-sm px-2 py-1 text-left text-[12px] hover:bg-muted",onClick:()=>x.isDir?i(x.path):e(x.path),title:x.path,type:"button",children:[x.isDir?l.jsx(Ka,{className:"size-3.5 shrink-0 text-amber-600"}):l.jsx(Vb,{path:x.path}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:x.name}),_?l.jsx("span",{className:"shrink-0 rounded bg-muted px-1 font-mono text-[10px] text-muted-foreground",children:_}):null]},x.path)})})]})}const H9=/```options[^\n]*\n([\s\S]*?)```/g,U9=/```service[^\n]*\n([\s\S]*?)```/g,F9=/```(?:options|service)[^\n]*\n[\s\S]*$/;function V9(e){const t=[];let s=null,i=e.replace(H9,(a,o)=>{for(const u of o.split(`
|
|
71
|
-
`)){const h=u.replace(/^[-*\d.)\s]+/,"").trim();h&&t.push(h)}return""});return i=i.replace(U9,(a,o)=>{const u=o.split(`
|
|
72
|
-
`).map(h=>h.trim()).find(Boolean);return u&&(s=u),""}),i=i.replace(F9,""),{body:i.trim(),options:t,service:s}}function q9({options:e,disabled:t,onChoose:s}){return l.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map(i=>l.jsx(re,{className:"h-7",disabled:t,onClick:()=>s(i),size:"sm",type:"button",variant:"outline",children:i},i))})}function G9({service:e,onStart:t,onOpen:s}){return l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[l.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["Added ",l.jsx("span",{className:"font-medium text-foreground",children:e})]}),l.jsxs("div",{className:"ml-auto flex gap-1.5",children:[l.jsxs(re,{className:"h-7",onClick:()=>t(e),size:"sm",type:"button",children:[l.jsx(Vh,{})," Start"]}),s?l.jsxs(re,{className:"h-7",onClick:()=>s(e),size:"sm",type:"button",variant:"outline",children:[l.jsx(Jc,{})," Open"]}):null]})]})}function qb(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Xa=qb();function sN(e){Xa=e}var La={exec:()=>null};function Io(e){let t=[];return s=>{let i=Math.max(0,Math.min(3,s-1)),a=t[i];return a||(a=e(i),t[i]=a),a}}function ot(e,t=""){let s=typeof e=="string"?e:e.source,i={replace:(a,o)=>{let u=typeof o=="string"?o:o.source;return u=u.replace(Fs.caret,"$1"),s=s.replace(a,u),i},getRegex:()=>new RegExp(s,t)};return i}var K9=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),Fs={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Io(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Io(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Io(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Io(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Io(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Io(e=>new RegExp(`^ {0,${e}}>`))},W9=/^(?:[ \t]*(?:\n|$))+/,Y9=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,X9=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,cu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Z9=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gb=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,nN=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,iN=ot(nN).replace(/bull/g,Gb).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Q9=ot(nN).replace(/bull/g,Gb).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Kb=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,J9=/^[^\n]+/,Wb=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,eB=ot(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wb).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tB=ot(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Gb).getRegex(),Zh="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Yb=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sB=ot("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Yb).replace("tag",Zh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rN=ot(Kb).replace("hr",cu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zh).getRegex(),nB=ot(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rN).getRegex(),Xb={blockquote:nB,code:Y9,def:eB,fences:X9,heading:Z9,hr:cu,html:sB,lheading:iN,list:tB,newline:W9,paragraph:rN,table:La,text:J9},WS=ot("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",cu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zh).getRegex(),iB={...Xb,lheading:Q9,table:WS,paragraph:ot(Kb).replace("hr",cu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",WS).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zh).getRegex()},rB={...Xb,html:ot(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Yb).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:La,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ot(Kb).replace("hr",cu).replace("heading",` *#{1,6} *[^
|
|
73
|
-
]`).replace("lheading",iN).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},aB=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,oB=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,aN=/^( {2,}|\\)\n(?!\s*$)/,lB=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ul=/[\p{P}\p{S}]/u,Qh=/[\s\p{P}\p{S}]/u,Zb=/[^\s\p{P}\p{S}]/u,cB=ot(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Qh).getRegex(),oN=/(?!~)[\p{P}\p{S}]/u,uB=/(?!~)[\s\p{P}\p{S}]/u,dB=/(?:[^\s\p{P}\p{S}]|~)/u,hB=ot(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",K9?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),lN=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,fB=ot(lN,"u").replace(/punct/g,ul).getRegex(),mB=ot(lN,"u").replace(/punct/g,oN).getRegex(),cN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pB=ot(cN,"gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Qh).replace(/punct/g,ul).getRegex(),gB=ot(cN,"gu").replace(/notPunctSpace/g,dB).replace(/punctSpace/g,uB).replace(/punct/g,oN).getRegex(),bB=ot("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Qh).replace(/punct/g,ul).getRegex(),vB=ot(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ul).getRegex(),xB="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",_B=ot(xB,"gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Qh).replace(/punct/g,ul).getRegex(),yB=ot(/\\(punct)/,"gu").replace(/punct/g,ul).getRegex(),SB=ot(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),wB=ot(Yb).replace("(?:-->|$)","-->").getRegex(),kB=ot("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",wB).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Eh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,CB=ot(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Eh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),uN=ot(/^!?\[(label)\]\[(ref)\]/).replace("label",Eh).replace("ref",Wb).getRegex(),dN=ot(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wb).getRegex(),EB=ot("reflink|nolink(?!\\()","g").replace("reflink",uN).replace("nolink",dN).getRegex(),YS=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Qb={_backpedal:La,anyPunctuation:yB,autolink:SB,blockSkip:hB,br:aN,code:oB,del:La,delLDelim:La,delRDelim:La,emStrongLDelim:fB,emStrongRDelimAst:pB,emStrongRDelimUnd:bB,escape:aB,link:CB,nolink:dN,punctuation:cB,reflink:uN,reflinkSearch:EB,tag:kB,text:lB,url:La},NB={...Qb,link:ot(/^!?\[(label)\]\((.*?)\)/).replace("label",Eh).getRegex(),reflink:ot(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Eh).getRegex()},c0={...Qb,emStrongRDelimAst:gB,emStrongLDelim:mB,delLDelim:vB,delRDelim:_B,url:ot(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",YS).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ot(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",YS).getRegex()},TB={...c0,br:ot(aN).replace("{2,}","*").getRegex(),text:ot(c0.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Hd={normal:Xb,gfm:iB,pedantic:rB},hc={normal:Qb,gfm:c0,breaks:TB,pedantic:NB},AB={"&":"&","<":"<",">":">",'"':""","'":"'"},XS=e=>AB[e];function xi(e,t){if(t){if(Fs.escapeTest.test(e))return e.replace(Fs.escapeReplace,XS)}else if(Fs.escapeTestNoEncode.test(e))return e.replace(Fs.escapeReplaceNoEncode,XS);return e}function ZS(e){try{e=encodeURI(e).replace(Fs.percentDecode,"%")}catch{return null}return e}function QS(e,t){let s=e.replace(Fs.findPipe,(o,u,h)=>{let m=!1,f=u;for(;--f>=0&&h[f]==="\\";)m=!m;return m?"|":" |"}),i=s.split(Fs.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;a<i.length;a++)i[a]=i[a].trim().replace(Fs.slashPipe,"|");return i}function qr(e,t,s){let i=e.length;if(i===0)return"";let a=0;for(;a<i&&e.charAt(i-a-1)===t;)a++;return e.slice(0,i-a)}function JS(e){let t=e.split(`
|
|
74
|
-
`),s=t.length-1;for(;s>=0&&Fs.blankLine.test(t[s]);)s--;return t.length-s<=2?e:t.slice(0,s+1).join(`
|
|
75
|
-
`)}function MB(e,t){if(e.indexOf(t[1])===-1)return-1;let s=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])s++;else if(e[i]===t[1]&&(s--,s<0))return i;return s>0?-2:-1}function jB(e,t=0){let s=t,i="";for(let a of e)if(a===" "){let o=4-s%4;i+=" ".repeat(o),s+=o}else i+=a,s++;return i}function ew(e,t,s,i,a){let o=t.href,u=t.title||null,h=e[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let m={type:e[0].charAt(0)==="!"?"image":"link",raw:s,href:o,title:u,text:h,tokens:i.inlineTokens(h)};return i.state.inLink=!1,m}function RB(e,t,s){let i=e.match(s.other.indentCodeCompensation);if(i===null)return t;let a=i[1];return t.split(`
|
|
76
|
-
`).map(o=>{let u=o.match(s.other.beginningSpace);if(u===null)return o;let[h]=u;return h.length>=a.length?o.slice(a.length):o}).join(`
|
|
77
|
-
`)}var Nh=class{options;rules;lexer;constructor(e){this.options=e||Xa}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let s=this.options.pedantic?t[0]:JS(t[0]),i=s.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s,codeBlockStyle:"indented",text:i}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let s=t[0],i=RB(s,t[3]||"",this.rules);return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(this.rules.other.endingHash.test(s)){let i=qr(s,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(s=i.trim())}return{type:"heading",raw:qr(t[0],`
|
|
78
|
-
`),depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:qr(t[0],`
|
|
79
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let s=qr(t[0],`
|
|
80
|
-
`).split(`
|
|
81
|
-
`),i="",a="",o=[];for(;s.length>0;){let u=!1,h=[],m;for(m=0;m<s.length;m++)if(this.rules.other.blockquoteStart.test(s[m]))h.push(s[m]),u=!0;else if(!u)h.push(s[m]);else break;s=s.slice(m);let f=h.join(`
|
|
82
|
-
`),p=f.replace(this.rules.other.blockquoteSetextReplace,`
|
|
83
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
84
|
-
${f}`:f,a=a?`${a}
|
|
85
|
-
${p}`:p;let b=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,o,!0),this.lexer.state.top=b,s.length===0)break;let x=o.at(-1);if(x?.type==="code")break;if(x?.type==="blockquote"){let _=x,y=_.raw+`
|
|
86
|
-
`+s.join(`
|
|
87
|
-
`),S=this.blockquote(y);o[o.length-1]=S,i=i.substring(0,i.length-_.raw.length)+S.raw,a=a.substring(0,a.length-_.text.length)+S.text;break}else if(x?.type==="list"){let _=x,y=_.raw+`
|
|
88
|
-
`+s.join(`
|
|
89
|
-
`),S=this.list(y);o[o.length-1]=S,i=i.substring(0,i.length-x.raw.length)+S.raw,a=a.substring(0,a.length-_.raw.length)+S.raw,s=y.substring(o.at(-1).raw.length).split(`
|
|
90
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:o,text:a}}}list(e){let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim(),i=s.length>1,a={type:"list",raw:"",ordered:i,start:i?+s.slice(0,-1):"",loose:!1,items:[]};s=i?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=i?s:"[*+-]");let o=this.rules.other.listItemRegex(s),u=!1;for(;e;){let m=!1,f="",p="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;f=t[0],e=e.substring(f.length);let b=jB(t[2].split(`
|
|
91
|
-
`,1)[0],t[1].length),x=e.split(`
|
|
92
|
-
`,1)[0],_=!b.trim(),y=0;if(this.options.pedantic?(y=2,p=b.trimStart()):_?y=t[1].length+1:(y=b.search(this.rules.other.nonSpaceChar),y=y>4?1:y,p=b.slice(y),y+=t[1].length),_&&this.rules.other.blankLine.test(x)&&(f+=x+`
|
|
93
|
-
`,e=e.substring(x.length+1),m=!0),!m){let S=this.rules.other.nextBulletRegex(y),C=this.rules.other.hrRegex(y),E=this.rules.other.fencesBeginRegex(y),T=this.rules.other.headingBeginRegex(y),N=this.rules.other.htmlBeginRegex(y),M=this.rules.other.blockquoteBeginRegex(y);for(;e;){let R=e.split(`
|
|
94
|
-
`,1)[0],z;if(x=R,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),z=x):z=x.replace(this.rules.other.tabCharGlobal," "),E.test(x)||T.test(x)||N.test(x)||M.test(x)||S.test(x)||C.test(x))break;if(z.search(this.rules.other.nonSpaceChar)>=y||!x.trim())p+=`
|
|
95
|
-
`+z.slice(y);else{if(_||b.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(b)||T.test(b)||C.test(b))break;p+=`
|
|
96
|
-
`+x}_=!x.trim(),f+=R+`
|
|
97
|
-
`,e=e.substring(R.length+1),b=z.slice(y)}}a.loose||(u?a.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(u=!0)),a.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),a.raw+=f}let h=a.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let m of a.items){this.lexer.state.top=!1,m.tokens=this.lexer.blockTokens(m.text,[]);let f=m.tokens[0];if(m.task&&(f?.type==="text"||f?.type==="paragraph")){m.text=m.text.replace(this.rules.other.listReplaceTask,""),f.raw=f.raw.replace(this.rules.other.listReplaceTask,""),f.text=f.text.replace(this.rules.other.listReplaceTask,"");for(let b=this.lexer.inlineQueue.length-1;b>=0;b--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[b].src)){this.lexer.inlineQueue[b].src=this.lexer.inlineQueue[b].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(m.raw);if(p){let b={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};m.checked=b.checked,a.loose?m.tokens[0]&&["paragraph","text"].includes(m.tokens[0].type)&&"tokens"in m.tokens[0]&&m.tokens[0].tokens?(m.tokens[0].raw=b.raw+m.tokens[0].raw,m.tokens[0].text=b.raw+m.tokens[0].text,m.tokens[0].tokens.unshift(b)):m.tokens.unshift({type:"paragraph",raw:b.raw,text:b.raw,tokens:[b]}):m.tokens.unshift(b)}}else m.task&&(m.task=!1);if(!a.loose){let p=m.tokens.filter(x=>x.type==="space"),b=p.length>0&&p.some(x=>this.rules.other.anyLine.test(x.raw));a.loose=b}}if(a.loose)for(let m of a.items){m.loose=!0;for(let f of m.tokens)f.type==="text"&&(f.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t){let s=JS(t[0]);return{type:"html",block:!0,raw:s,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:s}}}def(e){let t=this.rules.block.def.exec(e);if(t){let s=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:s,raw:qr(t[0],`
|
|
98
|
-
`),href:i,title:a}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let s=QS(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
99
|
-
`):[],o={type:"table",raw:qr(t[0],`
|
|
100
|
-
`),header:[],align:[],rows:[]};if(s.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?o.align.push("right"):this.rules.other.tableAlignCenter.test(u)?o.align.push("center"):this.rules.other.tableAlignLeft.test(u)?o.align.push("left"):o.align.push(null);for(let u=0;u<s.length;u++)o.header.push({text:s[u],tokens:this.lexer.inline(s[u]),header:!0,align:o.align[u]});for(let u of a)o.rows.push(QS(u,o.header.length).map((h,m)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:o.align[m]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let s=t[1].trim();return{type:"heading",raw:qr(t[0],`
|
|
101
|
-
`),depth:t[2].charAt(0)==="="?1:2,text:s,tokens:this.lexer.inline(s)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let s=t[1].charAt(t[1].length-1)===`
|
|
102
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let s=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=qr(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=MB(t[2],"()");if(o===-2)return;if(o>-1){let u=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let i=t[2],a="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],a=o[3])}else a=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),ew(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){let i=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=t[i.toLowerCase()];if(!a){let o=s[0].charAt(0);return{type:"text",raw:o,text:o}}return ew(s,a,s[0],this.lexer,this.rules)}}emStrong(e,t,s=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!s||this.rules.inline.punctuation.exec(s))){let a=[...i[0]].length-1,o,u,h=a,m=0,f=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+a);(i=f.exec(t))!==null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(u=[...o].length,i[3]||i[4]){h+=u;continue}else if((i[5]||i[6])&&a%3&&!((a+u)%3)){m+=u;continue}if(h-=u,h>0)continue;u=Math.min(u,u+h+m);let p=[...i[0]][0].length,b=e.slice(0,a+i.index+p+u);if(Math.min(a,u)%2){let _=b.slice(1,-1);return{type:"em",raw:b,text:_,tokens:this.lexer.inlineTokens(_)}}let x=b.slice(2,-2);return{type:"strong",raw:b,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(s),a=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return i&&a&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:t[0],text:s}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,s=""){let i=this.rules.inline.delLDelim.exec(e);if(i&&(!i[1]||!s||this.rules.inline.punctuation.exec(s))){let a=[...i[0]].length-1,o,u,h=a,m=this.rules.inline.delRDelim;for(m.lastIndex=0,t=t.slice(-1*e.length+a);(i=m.exec(t))!==null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o||(u=[...o].length,u!==a))continue;if(i[3]||i[4]){h+=u;continue}if(h-=u,h>0)continue;u=Math.min(u,u+h);let f=[...i[0]][0].length,p=e.slice(0,a+i.index+f+u),b=p.slice(a,-a);return{type:"del",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let s,i;return t[2]==="@"?(s=t[1],i="mailto:"+s):(s=t[1],i=s),{type:"link",raw:t[0],text:s,href:i,tokens:[{type:"text",raw:s,text:s}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let s,i;if(t[2]==="@")s=t[0],i="mailto:"+s;else{let a;do a=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(a!==t[0]);s=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:s,href:i,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let s=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:s}}}},ai=class u0{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Xa,this.options.tokenizer=this.options.tokenizer||new Nh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let s={other:Fs,block:Hd.normal,inline:hc.normal};this.options.pedantic?(s.block=Hd.pedantic,s.inline=hc.pedantic):this.options.gfm&&(s.block=Hd.gfm,this.options.breaks?s.inline=hc.breaks:s.inline=hc.gfm),this.tokenizer.rules=s}static get rules(){return{block:Hd,inline:hc}}static lex(t,s){return new u0(s).lex(t)}static lexInline(t,s){return new u0(s).inlineTokens(t)}lex(t){t=t.replace(Fs.carriageReturn,`
|
|
103
|
-
`),this.blockTokens(t,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let i=this.inlineQueue[s];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,s=[],i=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Fs.tabCharGlobal," ").replace(Fs.spaceLine,""));let a=1/0;for(;t;){if(t.length<a)a=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let o;if(this.options.extensions?.block?.some(h=>(o=h.call({lexer:this},t,s))?(t=t.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let h=s.at(-1);o.raw.length===1&&h!==void 0?h.raw+=`
|
|
104
|
-
`:s.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let h=s.at(-1);h?.type==="paragraph"||h?.type==="text"?(h.raw+=(h.raw.endsWith(`
|
|
105
|
-
`)?"":`
|
|
106
|
-
`)+o.raw,h.text+=`
|
|
107
|
-
`+o.text,this.inlineQueue.at(-1).src=h.text):s.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let h=s.at(-1);h?.type==="paragraph"||h?.type==="text"?(h.raw+=(h.raw.endsWith(`
|
|
108
|
-
`)?"":`
|
|
109
|
-
`)+o.raw,h.text+=`
|
|
110
|
-
`+o.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},s.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),s.push(o);continue}let u=t;if(this.options.extensions?.startBlock){let h=1/0,m=t.slice(1),f;this.options.extensions.startBlock.forEach(p=>{f=p.call({lexer:this},m),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(u=t.substring(0,h+1))}if(this.state.top&&(o=this.tokenizer.paragraph(u))){let h=s.at(-1);i&&h?.type==="paragraph"?(h.raw+=(h.raw.endsWith(`
|
|
111
|
-
`)?"":`
|
|
112
|
-
`)+o.raw,h.text+=`
|
|
113
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):s.push(o),i=u.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let h=s.at(-1);h?.type==="text"?(h.raw+=(h.raw.endsWith(`
|
|
114
|
-
`)?"":`
|
|
115
|
-
`)+o.raw,h.text+=`
|
|
116
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):s.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,s}inline(t,s=[]){return this.inlineQueue.push({src:t,tokens:s}),s}inlineTokens(t,s=[]){this.tokenizer.lexer=this;let i=t,a=null;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)f.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)o=a[2]?a[2].length:0,i=i.slice(0,a.index+o)+"["+"a".repeat(a[0].length-o-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let u=!1,h="",m=1/0;for(;t;){if(t.length<m)m=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}u||(h=""),u=!1;let f;if(this.options.extensions?.inline?.some(b=>(f=b.call({lexer:this},t,s))?(t=t.substring(f.raw.length),s.push(f),!0):!1))continue;if(f=this.tokenizer.escape(t)){t=t.substring(f.raw.length),s.push(f);continue}if(f=this.tokenizer.tag(t)){t=t.substring(f.raw.length),s.push(f);continue}if(f=this.tokenizer.link(t)){t=t.substring(f.raw.length),s.push(f);continue}if(f=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(f.raw.length);let b=s.at(-1);f.type==="text"&&b?.type==="text"?(b.raw+=f.raw,b.text+=f.text):s.push(f);continue}if(f=this.tokenizer.emStrong(t,i,h)){t=t.substring(f.raw.length),s.push(f);continue}if(f=this.tokenizer.codespan(t)){t=t.substring(f.raw.length),s.push(f);continue}if(f=this.tokenizer.br(t)){t=t.substring(f.raw.length),s.push(f);continue}if(f=this.tokenizer.del(t,i,h)){t=t.substring(f.raw.length),s.push(f);continue}if(f=this.tokenizer.autolink(t)){t=t.substring(f.raw.length),s.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(t))){t=t.substring(f.raw.length),s.push(f);continue}let p=t;if(this.options.extensions?.startInline){let b=1/0,x=t.slice(1),_;this.options.extensions.startInline.forEach(y=>{_=y.call({lexer:this},x),typeof _=="number"&&_>=0&&(b=Math.min(b,_))}),b<1/0&&b>=0&&(p=t.substring(0,b+1))}if(f=this.tokenizer.inlineText(p)){t=t.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(h=f.raw.slice(-1)),u=!0;let b=s.at(-1);b?.type==="text"?(b.raw+=f.raw,b.text+=f.text):s.push(f);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return s}infiniteLoopError(t){let s="Infinite loop on byte: "+t;if(this.options.silent)console.error(s);else throw new Error(s)}},Th=class{options;parser;constructor(e){this.options=e||Xa}space(e){return""}code({text:e,lang:t,escaped:s}){let i=(t||"").match(Fs.notSpaceStart)?.[0],a=e.replace(Fs.endingNewline,"")+`
|
|
117
|
-
`;return i?'<pre><code class="language-'+xi(i)+'">'+(s?a:xi(a,!0))+`</code></pre>
|
|
118
|
-
`:"<pre><code>"+(s?a:xi(a,!0))+`</code></pre>
|
|
119
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
120
|
-
${this.parser.parse(e)}</blockquote>
|
|
121
|
-
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
122
|
-
`}hr(e){return`<hr>
|
|
123
|
-
`}list(e){let t=e.ordered,s=e.start,i="";for(let u=0;u<e.items.length;u++){let h=e.items[u];i+=this.listitem(h)}let a=t?"ol":"ul",o=t&&s!==1?' start="'+s+'"':"";return"<"+a+o+`>
|
|
124
|
-
`+i+"</"+a+`>
|
|
125
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
126
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
127
|
-
`}table(e){let t="",s="";for(let a=0;a<e.header.length;a++)s+=this.tablecell(e.header[a]);t+=this.tablerow({text:s});let i="";for(let a=0;a<e.rows.length;a++){let o=e.rows[a];s="";for(let u=0;u<o.length;u++)s+=this.tablecell(o[u]);i+=this.tablerow({text:s})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
128
|
-
<thead>
|
|
129
|
-
`+t+`</thead>
|
|
130
|
-
`+i+`</table>
|
|
131
|
-
`}tablerow({text:e}){return`<tr>
|
|
132
|
-
${e}</tr>
|
|
133
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+t+`</${s}>
|
|
134
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${xi(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:s}){let i=this.parser.parseInline(s),a=ZS(e);if(a===null)return i;e=a;let o='<a href="'+e+'"';return t&&(o+=' title="'+xi(t)+'"'),o+=">"+i+"</a>",o}image({href:e,title:t,text:s,tokens:i}){i&&(s=this.parser.parseInline(i,this.parser.textRenderer));let a=ZS(e);if(a===null)return xi(s);e=a;let o=`<img src="${e}" alt="${xi(s)}"`;return t&&(o+=` title="${xi(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:xi(e.text)}},Jb=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},oi=class d0{options;renderer;textRenderer;constructor(t){this.options=t||Xa,this.options.renderer=this.options.renderer||new Th,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Jb}static parse(t,s){return new d0(s).parse(t)}static parseInline(t,s){return new d0(s).parseInline(t)}parse(t){this.renderer.parser=this;let s="";for(let i=0;i<t.length;i++){let a=t[i];if(this.options.extensions?.renderers?.[a.type]){let u=a,h=this.options.extensions.renderers[u.type].call({parser:this},u);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){s+=h||"";continue}}let o=a;switch(o.type){case"space":{s+=this.renderer.space(o);break}case"hr":{s+=this.renderer.hr(o);break}case"heading":{s+=this.renderer.heading(o);break}case"code":{s+=this.renderer.code(o);break}case"table":{s+=this.renderer.table(o);break}case"blockquote":{s+=this.renderer.blockquote(o);break}case"list":{s+=this.renderer.list(o);break}case"checkbox":{s+=this.renderer.checkbox(o);break}case"html":{s+=this.renderer.html(o);break}case"def":{s+=this.renderer.def(o);break}case"paragraph":{s+=this.renderer.paragraph(o);break}case"text":{s+=this.renderer.text(o);break}default:{let u='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return s}parseInline(t,s=this.renderer){this.renderer.parser=this;let i="";for(let a=0;a<t.length;a++){let o=t[a];if(this.options.extensions?.renderers?.[o.type]){let h=this.options.extensions.renderers[o.type].call({parser:this},o);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){i+=h||"";continue}}let u=o;switch(u.type){case"escape":{i+=s.text(u);break}case"html":{i+=s.html(u);break}case"link":{i+=s.link(u);break}case"image":{i+=s.image(u);break}case"checkbox":{i+=s.checkbox(u);break}case"strong":{i+=s.strong(u);break}case"em":{i+=s.em(u);break}case"codespan":{i+=s.codespan(u);break}case"br":{i+=s.br(u);break}case"del":{i+=s.del(u);break}case"text":{i+=s.text(u);break}default:{let h='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return i}},wc=class{options;block;constructor(e){this.options=e||Xa}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ai.lex:ai.lexInline}provideParser(e=this.block){return e?oi.parse:oi.parseInline}},DB=class{defaults=qb();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=oi;Renderer=Th;TextRenderer=Jb;Lexer=ai;Tokenizer=Nh;Hooks=wc;constructor(...t){this.use(...t)}walkTokens(t,s){let i=[];for(let a of t)switch(i=i.concat(s.call(this,a)),a.type){case"table":{let o=a;for(let u of o.header)i=i.concat(this.walkTokens(u.tokens,s));for(let u of o.rows)for(let h of u)i=i.concat(this.walkTokens(h.tokens,s));break}case"list":{let o=a;i=i.concat(this.walkTokens(o.items,s));break}default:{let o=a;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(u=>{let h=o[u].flat(1/0);i=i.concat(this.walkTokens(h,s))}):o.tokens&&(i=i.concat(this.walkTokens(o.tokens,s)))}}return i}use(...t){let s=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let a={...i};if(a.async=this.defaults.async||a.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let u=s.renderers[o.name];u?s.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=u.apply(this,h)),m}:s.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let u=s[o.level];u?u.unshift(o.tokenizer):s[o.level]=[o.tokenizer],o.start&&(o.level==="block"?s.startBlock?s.startBlock.push(o.start):s.startBlock=[o.start]:o.level==="inline"&&(s.startInline?s.startInline.push(o.start):s.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(s.childTokens[o.name]=o.childTokens)}),a.extensions=s),i.renderer){let o=this.defaults.renderer||new Th(this.defaults);for(let u in i.renderer){if(!(u in o))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;let h=u,m=i.renderer[h],f=o[h];o[h]=(...p)=>{let b=m.apply(o,p);return b===!1&&(b=f.apply(o,p)),b||""}}a.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new Nh(this.defaults);for(let u in i.tokenizer){if(!(u in o))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;let h=u,m=i.tokenizer[h],f=o[h];o[h]=(...p)=>{let b=m.apply(o,p);return b===!1&&(b=f.apply(o,p)),b}}a.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new wc;for(let u in i.hooks){if(!(u in o))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;let h=u,m=i.hooks[h],f=o[h];wc.passThroughHooks.has(u)?o[h]=p=>{if(this.defaults.async&&wc.passThroughHooksRespectAsync.has(u))return(async()=>{let x=await m.call(o,p);return f.call(o,x)})();let b=m.call(o,p);return f.call(o,b)}:o[h]=(...p)=>{if(this.defaults.async)return(async()=>{let x=await m.apply(o,p);return x===!1&&(x=await f.apply(o,p)),x})();let b=m.apply(o,p);return b===!1&&(b=f.apply(o,p)),b}}a.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,u=i.walkTokens;a.walkTokens=function(h){let m=[];return m.push(u.call(this,h)),o&&(m=m.concat(o.call(this,h))),m}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,s){return ai.lex(t,s??this.defaults)}parser(t,s){return oi.parse(t,s??this.defaults)}parseMarkdown(t){return(s,i)=>{let a={...i},o={...this.defaults,...a},u=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&a.async===!1)return u(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return u(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return u(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(s):s,m=await(o.hooks?await o.hooks.provideLexer(t):t?ai.lex:ai.lexInline)(h,o),f=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(f,o.walkTokens));let p=await(o.hooks?await o.hooks.provideParser(t):t?oi.parse:oi.parseInline)(f,o);return o.hooks?await o.hooks.postprocess(p):p})().catch(u);try{o.hooks&&(s=o.hooks.preprocess(s));let h=(o.hooks?o.hooks.provideLexer(t):t?ai.lex:ai.lexInline)(s,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(t):t?oi.parse:oi.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return u(h)}}}onError(t,s){return i=>{if(i.message+=`
|
|
135
|
-
Please report this to https://github.com/markedjs/marked.`,t){let a="<p>An error occurred:</p><pre>"+xi(i.message+"",!0)+"</pre>";return s?Promise.resolve(a):a}if(s)return Promise.reject(i);throw i}}},Va=new DB;function ft(e,t){return Va.parse(e,t)}ft.options=ft.setOptions=function(e){return Va.setOptions(e),ft.defaults=Va.defaults,sN(ft.defaults),ft};ft.getDefaults=qb;ft.defaults=Xa;ft.use=function(...e){return Va.use(...e),ft.defaults=Va.defaults,sN(ft.defaults),ft};ft.walkTokens=function(e,t){return Va.walkTokens(e,t)};ft.parseInline=Va.parseInline;ft.Parser=oi;ft.parser=oi.parse;ft.Renderer=Th;ft.TextRenderer=Jb;ft.Lexer=ai;ft.lexer=ai.lex;ft.Tokenizer=Nh;ft.Hooks=wc;ft.parse=ft;ft.options;ft.setOptions;ft.use;ft.walkTokens;ft.parseInline;oi.parse;ai.lex;function OB(e){return e.replace(/<\/?(script|style|iframe|object|embed)\b[^>]*>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/(href|src)\s*=\s*("|')\s*javascript:[^"']*\2/gi,"$1=$2#$2")}function LB({content:e}){const t=w.useMemo(()=>{const s=ft.parse(e,{async:!1,gfm:!0,breaks:!0});return OB(s)},[e]);return l.jsx("div",{className:"chat-md",dangerouslySetInnerHTML:{__html:t}})}function BB(e){return Math.min(e,Math.max(1,Math.ceil(e/22)))}function zB(e){const[t,s]=w.useState(e),i=w.useRef(e),a=w.useRef(e);return a.current=e,w.useEffect(()=>{e.startsWith(i.current)||(i.current=e,s(e))},[e]),w.useEffect(()=>{if(i.current.length>=a.current.length)return;const o=requestAnimationFrame(()=>{const u=a.current,h=u.slice(0,i.current.length+BB(u.length-i.current.length));i.current=h,s(h)});return()=>cancelAnimationFrame(o)},[t,e]),t}function IB(){return l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",role:"status",children:[l.jsx(Os,{className:"size-3.5 animate-spin"}),l.jsx("span",{children:"Thinking…"})]})}function PB({onOpenAgentPage:e,onOpenService:t}){const{error:s,success:i}=Bs(),{turns:a,streaming:o,error:u,configured:h,provider:m,approvals:f,send:p,stop:b,clear:x,respond:_,open:y,setOpen:S,draft:C,setDraft:E,insertPath:T,activeSource:N,clearSource:M,focusNonce:R,stickNonce:z,sendToAgent:L,onboarding:j,setOnboarding:H}=Ls(),[P,F]=w.useState(""),[K,Y]=w.useState(!1),[Q,q]=w.useState(!1),[O,X]=w.useState(!1),[Z,V]=w.useState(null),[$,D]=w.useState(!1),W=w.useRef(null),he=w.useRef(null),le=w.useRef(null),me=w.useRef(null);w.useEffect(()=>{if(!y||j)return;let xe=0,mt=0;const qs=()=>{const ls=he.current;if(!ls||C&&ls.value!==C){mt++<10&&(xe=requestAnimationFrame(qs));return}ls.focus();const Gs=ls.value.length;ls.setSelectionRange(Gs,Gs),ls.scrollTop=ls.scrollHeight};return xe=requestAnimationFrame(qs),()=>cancelAnimationFrame(xe)},[y,R,j]),w.useLayoutEffect(()=>{const xe=he.current;xe&&(xe.style.height="auto",xe.style.height=`${xe.scrollHeight}px`)},[C]),w.useEffect(()=>{!y||!j||requestAnimationFrame(()=>le.current?.focus())},[y,j]),w.useEffect(()=>{if(!y)return;const xe=mt=>{me.current?.contains(mt.target)||S(!1)};return document.addEventListener("pointerdown",xe),()=>document.removeEventListener("pointerdown",xe)},[y,S]),w.useEffect(()=>{const xe=qs=>{qs.dataTransfer&&US(qs.dataTransfer)&&Y(!0)},mt=()=>{Y(!1),q(!1)};return document.addEventListener("dragstart",xe),document.addEventListener("dragend",mt),document.addEventListener("drop",mt),()=>{document.removeEventListener("dragstart",xe),document.removeEventListener("dragend",mt),document.removeEventListener("drop",mt)}},[]);const ne=w.useRef(!0);function fe(){const xe=W.current;xe&&(ne.current=xe.scrollHeight-xe.scrollTop-xe.clientHeight<48)}w.useEffect(()=>{const xe=W.current;xe&&ne.current&&(xe.scrollTop=xe.scrollHeight)},[a,y]),w.useEffect(()=>{ne.current=!0;const xe=W.current;if(!xe)return;const mt=requestAnimationFrame(()=>{xe.scrollTop=xe.scrollHeight});return()=>cancelAnimationFrame(mt)},[z]);async function we(){const xe=C;E(""),ne.current=!0,await p(xe)}function ye(xe){xe.trim()&&(E(""),H(!1),F(""),ne.current=!0,L({prompt:y7(xe),source:{type:"repo-onboard",label:"Onboard repo"},label:`Onboard and run this repo: ${xe}`}))}function Ze(xe){ne.current=!0,p(xe)}async function lt(xe){try{await pn(`/api/services/${encodeURIComponent(xe)}/start`,{}),i(`Starting ${xe}…`)}catch(mt){s(mt instanceof Error?mt.message:`Could not start ${xe}.`)}}function ct(xe){xe.key==="Enter"&&!xe.shiftKey&&(xe.preventDefault(),we())}function ze(xe){US(xe.dataTransfer)&&(xe.preventDefault(),xe.dataTransfer.dropEffect="copy",y||S(!0),q(!0))}function Lt(xe){xe.currentTarget.contains(xe.relatedTarget)||q(!1)}function Oi(xe){q(!1);const mt=n9(xe.dataTransfer);mt&&(xe.preventDefault(),T(mt))}function Jn(xe){if(!y)return;xe.preventDefault(),xe.currentTarget.setPointerCapture(xe.pointerId),D(!0);const mt=160,qs=window.innerHeight-48;function ls(oa){const mr=window.innerHeight-oa.clientY;V(Math.max(mt,Math.min(qs,mr)))}function Gs(){D(!1),window.removeEventListener("pointermove",ls),window.removeEventListener("pointerup",Gs)}window.addEventListener("pointermove",ls),window.addEventListener("pointerup",Gs)}return l.jsx("div",{ref:me,className:de("fixed inset-x-0 bottom-0 z-50 flex flex-col border-t border-border bg-card/95 shadow-[0_-8px_24px_-12px_rgba(0,0,0,0.25)] backdrop-blur",$?"select-none":"transition-[height] duration-200",y?Z===null?"h-[50vh]":"":K?"h-12":"h-9",K&&!Q&&"border-primary/60 bg-primary/5",Q&&"outline-dashed outline-2 -outline-offset-2 outline-primary/70"),style:y&&Z!==null?{height:Z}:void 0,onDragOver:ze,onDragLeave:Lt,onDrop:Oi,children:y?l.jsxs(l.Fragment,{children:[l.jsx("div",{"aria-hidden":!0,className:"absolute inset-x-0 -top-1 z-10 h-2 cursor-ns-resize",onDoubleClick:()=>V(null),onPointerDown:Jn}),l.jsxs("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-20 flex items-start justify-between gap-2 px-2 pt-1.5",children:[l.jsxs("div",{className:"pointer-events-auto flex items-center gap-2",children:[l.jsx(tw,{provider:m,className:"size-4 text-primary"}),l.jsx("span",{className:"text-sm font-medium",children:m?.label??"Agent"}),N?l.jsxs("span",{className:"flex items-center gap-1 rounded-full border border-primary/30 bg-primary/10 px-2 py-0.5 text-[11px] text-primary",children:[l.jsx(Wa,{className:"size-3"}),l.jsx("span",{className:"max-w-40 truncate",children:N.label}),l.jsx("button",{"aria-label":"Clear source",className:"opacity-60 hover:opacity-100",onClick:M,type:"button",children:l.jsx(Js,{className:"size-3"})})]}):null]}),l.jsxs("div",{className:"pointer-events-auto flex items-center gap-1",children:[e?l.jsx(re,{"aria-label":"Open agent page",className:"size-7",onClick:e,size:"icon",title:"Open the full agent page",type:"button",variant:"ghost",children:l.jsx(gM,{})}):null,l.jsx(re,{"aria-label":"Clear conversation",className:"size-7",disabled:a.length===0,onClick:x,size:"icon",title:"Clear conversation",type:"button",variant:"ghost",children:l.jsx(rl,{})}),l.jsx(re,{"aria-label":"Collapse agent",className:"size-7",onClick:()=>S(!1),size:"icon",title:"Collapse",type:"button",variant:"ghost",children:l.jsx(Yn,{})})]})]}),l.jsx("div",{ref:W,className:"min-h-0 flex-1 overflow-auto px-3 py-3",onScroll:fe,children:l.jsxs("div",{className:"mx-auto w-full max-w-4xl space-y-3",children:[a.length===0?l.jsx($B,{configured:h,provider:m,onOnboard:()=>H(!0)}):a.map((xe,mt)=>l.jsx(VB,{turn:xe,streaming:o&&mt===a.length-1,isLast:mt===a.length-1,onChoose:Ze,onStartService:lt,onOpenService:t},xe.id)),u?l.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[l.jsx(YM,{className:"mt-px size-3.5 shrink-0"}),l.jsx("span",{className:"min-w-0 break-words",children:u})]}):null]})}),f.length>0?l.jsx("div",{className:"shrink-0 space-y-1.5 border-t border-amber-500/25 bg-amber-500/[0.04] px-3 py-2",children:f.map(xe=>l.jsx(GB,{prompt:xe,onRespond:_},xe.requestId))}):null,l.jsxs("div",{className:de("relative shrink-0 p-2 transition-colors",K&&"bg-primary/5"),children:[O?l.jsx($9,{onClose:()=>X(!1),onPick:xe=>{X(!1),T(xe)}}):null,l.jsxs("div",{className:"mx-auto w-full max-w-4xl",children:[j?l.jsxs("form",{className:"mb-2 flex items-center gap-2 rounded-md border border-primary/40 bg-primary/5 p-1.5",onSubmit:xe=>{xe.preventDefault(),ye(P)},children:[l.jsx(Wn,{className:"size-4 shrink-0 text-primary"}),l.jsx("input",{ref:le,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onChange:xe=>F(xe.target.value),placeholder:"Paste a repo URL — e.g. https://github.com/owner/repo",value:P}),l.jsx(re,{disabled:!P.trim(),size:"sm",type:"submit",children:"Onboard"}),l.jsx(re,{"aria-label":"Cancel onboarding",className:"size-7",onClick:()=>{H(!1),F("")},size:"icon",type:"button",variant:"ghost",children:l.jsx(Js,{})})]}):UB(C)&&!o?l.jsxs("button",{className:"mb-2 flex w-full items-center gap-2 rounded-md border border-primary/40 bg-primary/5 px-3 py-1.5 text-left text-xs text-primary transition-colors hover:bg-primary/10",onClick:()=>ye(C),type:"button",children:[l.jsx(Wn,{className:"size-3.5 shrink-0"}),l.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["Onboard ",l.jsx("span",{className:"font-mono",children:C.trim()})," as a service"]}),l.jsx(ZA,{className:"size-3.5 shrink-0 opacity-60"})]}):null,l.jsxs("div",{className:"flex items-end gap-1.5 rounded-2xl border border-border bg-background px-1.5 py-1.5 shadow-sm transition-colors hover:border-foreground/25 focus-within:border-foreground/40 focus-within:ring-1 focus-within:ring-ring",children:[l.jsx(re,{"aria-label":"Attach a file or folder",className:"size-8 shrink-0 rounded-full text-muted-foreground hover:text-foreground",disabled:h===!1,onClick:()=>X(!0),size:"icon",title:"Attach a file or folder",type:"button",variant:O?"secondary":"ghost",children:l.jsx(vM,{})}),l.jsx("textarea",{ref:he,className:"max-h-32 min-h-8 flex-1 resize-none self-center overflow-y-auto bg-transparent px-1 py-1.5 text-sm outline-none placeholder:text-muted-foreground",disabled:h===!1,onChange:xe=>E(xe.target.value),onKeyDown:ct,placeholder:h===!1?`${m?.label??"Agent"} (\`${m?.commandName??"agent"}\`) is not installed`:`Ask ${m?.label??"the agent"} anything about this project...`,rows:1,value:C}),o?l.jsx(re,{"aria-label":"Stop generating",className:"size-8 shrink-0 rounded-full",onClick:b,size:"icon",title:"Stop",type:"button",variant:"secondary",children:l.jsx(qh,{className:"size-3.5 fill-current"})}):l.jsx(re,{"aria-label":"Send message",className:"size-8 shrink-0 rounded-full",disabled:!C.trim()||h===!1,onClick:()=>{we()},size:"icon",title:"Send",type:"button",children:l.jsx(yk,{className:"size-4"})})]})]})]})]}):l.jsx("button",{className:de("flex h-full w-full items-center gap-2 px-3 text-left text-sm hover:bg-muted/50",K?"font-medium text-primary":"text-muted-foreground"),onClick:()=>S(!0),type:"button",children:K?l.jsxs(l.Fragment,{children:[l.jsx(Ek,{className:"size-4 animate-bounce text-primary"}),l.jsx("span",{children:"Drop here to add it to your message"})]}):l.jsxs(l.Fragment,{children:[l.jsx(tw,{provider:m,className:"size-4 text-primary"}),o?l.jsxs("span",{className:"flex items-center gap-2 text-foreground",children:[l.jsx(Os,{className:"size-3.5 animate-spin"})," ",m?.label??"Agent"," is thinking…"]}):l.jsxs("span",{children:["Ask ",m?.label??"the agent","..."]}),l.jsx("span",{className:"ml-auto text-xs text-muted-foreground/70",children:"click to expand"})]})})})}function tw({provider:e,className:t}){return e?.id==="claude"?l.jsx(cl,{className:t}):e?.id==="codex"?l.jsx(au,{className:t}):l.jsx(Wa,{className:t})}function $B({configured:e,provider:t,onOnboard:s}){return e===!1?l.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:["This dock runs the ",l.jsx("code",{className:"font-mono",children:t?.commandName??"agent"})," ","CLI. ",t?.installHint??"Install the active agent CLI, then reload."]}):l.jsxs("div",{className:"space-y-2 text-xs text-muted-foreground",children:[l.jsx("p",{children:t?.intro??'This is the active agent, running in your workspace with full tools - e.g. "restart the api and tail its logs", "what changed in git and why?", "fix the failing test".'}),l.jsxs("button",{className:"inline-flex items-center gap-1.5 rounded-full border border-primary/40 bg-primary/5 px-2.5 py-1 text-primary transition-colors hover:bg-primary/10",onClick:s,type:"button",children:[l.jsx(Wn,{className:"size-3.5"}),"Onboard a repo from a URL"]})]})}const HB=/^(?:https?:\/\/|git@|ssh:\/\/)\S+$/i;function UB(e){const t=e.trim();return t.includes(`
|
|
136
|
-
`)||t.includes(" ")||!HB.test(t)?!1:/github\.com|gitlab\.|bitbucket\.|\.git$/i.test(t)}function FB({turn:e}){const[t,s]=w.useState(!1),i=!!e.label&&e.label!==e.text,a=i&&!t?e.label:e.text;return l.jsx("div",{className:"flex justify-end",children:l.jsxs("div",{className:"flex max-w-[85%] flex-col items-end gap-0.5",children:[l.jsx("div",{className:"whitespace-pre-wrap break-words rounded-2xl rounded-br-sm bg-muted px-3.5 py-2 text-sm text-foreground",children:a}),i?l.jsxs("button",{className:"flex items-center gap-0.5 px-1 text-[11px] text-muted-foreground transition-colors hover:text-foreground",onClick:()=>s(o=>!o),type:"button",children:[t?l.jsx(Uh,{className:"size-3"}):l.jsx(Yn,{className:"size-3"}),t?"Hide full prompt":"Show full prompt"]}):null]})})}function VB({turn:e,streaming:t,isLast:s,onChoose:i,onStartService:a,onOpenService:o}){const u=zB(e.text);if(e.role==="user")return l.jsx(FB,{turn:e});const{body:h,options:m,service:f}=V9(u);return l.jsxs("div",{className:"space-y-1.5",children:[e.tools.map(p=>l.jsx(qB,{tool:p},p.id)),h?l.jsx("div",{className:"break-words px-0.5 text-sm text-foreground",children:l.jsx(LB,{content:h})}):null,m.length>0&&s&&!t?l.jsx(q9,{options:m,onChoose:i}):null,f&&!t?l.jsx(G9,{service:f,onStart:a,onOpen:o}):null,t&&!h?l.jsx(IB,{}):null]})}function qB({tool:e}){const t=hN(e.input);return l.jsxs("div",{className:de("inline-flex max-w-[85%] items-center gap-1.5 rounded-md border px-2 py-1 font-mono text-[11px]",e.isError?"border-destructive/40 bg-destructive/5 text-destructive":"border-border bg-background text-muted-foreground"),children:[e.status==="running"?l.jsx(Os,{className:"size-3 animate-spin"}):l.jsx(JM,{className:"size-3"}),l.jsx("span",{className:"font-semibold",children:e.name}),t?l.jsx("span",{className:"truncate",children:t}):null]})}function GB({prompt:e,onRespond:t}){const s=hN(e.input).slice(0,140);return l.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-amber-500/30 bg-amber-500/5 px-2.5 py-2 text-xs",children:[l.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-amber-500/15 text-amber-600 dark:text-amber-400",children:l.jsx(zM,{className:"size-4"})}),l.jsxs("div",{className:"min-w-0 flex-1 leading-tight",children:[l.jsx("div",{className:"mb-0.5 text-[10px] font-semibold uppercase tracking-wider text-amber-600 dark:text-amber-400/90",children:"Permission needed"}),l.jsxs("div",{className:"truncate font-mono text-[11px]",children:[l.jsx("span",{className:"font-semibold text-foreground",children:e.name}),s?l.jsx("span",{className:"ml-1 text-muted-foreground",children:s}):null]})]}),l.jsxs(re,{className:"h-7 gap-1 text-muted-foreground hover:border-destructive/40 hover:bg-destructive/10 hover:text-destructive",onClick:()=>t(e.requestId,"deny"),size:"sm",type:"button",variant:"outline",children:[l.jsx(Js,{className:"size-3.5"})," Deny"]}),l.jsxs(re,{className:"h-7 gap-1",onClick:()=>t(e.requestId,"allow"),size:"sm",type:"button",children:[l.jsx(il,{className:"size-3.5"})," Allow"]})]})}function hN(e){return!e||typeof e!="object"?"":Object.values(e).filter(s=>s!==void 0&&s!=="").map(s=>String(s)).join(" ")}const Dp={host:"",port:"",user:"",password:"",database:"",ssl:!1},KB="localhost";function h0(e,t,{includePassword:s=!0}={}){const i=e==="mysql"?"mysql":"postgres",a=t.host.trim()||KB,o=t.port.trim(),u=t.database.trim().replace(/^\//,""),h=t.user.trim(),m=s&&t.password,f=h?`${encodeURIComponent(h)}${m?`:${encodeURIComponent(t.password)}`:""}@`:"",p=o?`:${o}`:"",b=e==="postgres"&&t.ssl?"?sslmode=require":"";return`${i}://${f}${a}${p}/${u}${b}`}function f0(e){if(!e.trim())return null;let t;try{t=new URL(e.trim())}catch{return null}return{host:t.hostname,port:t.port,user:sw(t.username),password:sw(t.password),database:t.pathname.replace(/^\//,""),ssl:t.searchParams.get("sslmode")==="require"||t.searchParams.has("ssl")}}function WB(e){const t=/^([a-z0-9+]+):\/\//i.exec(e.trim());if(!t)return null;const s=t[1].toLowerCase();return s.startsWith("postgres")?"postgres":s.startsWith("mysql")?"mysql":s.startsWith("sqlite")||s==="file"?"sqlite":null}function sw(e){try{return decodeURIComponent(e)}catch{return e}}const YB=[{value:"postgres",label:"Postgres"},{value:"mysql",label:"MySQL"},{value:"sqlite",label:"SQLite"}];function XB({onClose:e,onSaved:t,initial:s}){const{error:i,success:a}=Bs(),o=!!s,u=w.useMemo(()=>ZB(s),[s]),[h,m]=w.useState(u.engine),[f,p]=w.useState(u.name),[b,x]=w.useState(u.url),[_,y]=w.useState(u.fields),[S,C]=w.useState([]),[E,T]=w.useState({status:"idle"}),[N,M]=w.useState(!1),[R,z]=w.useState(!1);w.useEffect(()=>{o||dj().then(C).catch(()=>C([]))},[o]);const L=h==="sqlite",j=L?b.trim():h0(h,_),H=L?!!b.trim():!!(_.host.trim()&&_.database.trim());function P(){T({status:"idle"})}function F(V,$){return h0(V,$,{includePassword:!1})}function K(V){m(V),P(),V!=="sqlite"&&x(F(V,_))}function Y(V){const $={..._,...V};y($),x(F(h,$)),P()}function Q(V){P();const $=WB(V),D=$??h;$&&$!==h&&m($);const W=$==="sqlite"?null:f0(V);if(!W){x(V);return}W.password?(y(W),x(F(D,W))):(y({...W,password:_.password}),x(V))}function q(V){m(V.engine);const $=V.engine==="sqlite"?null:f0(V.url);$?(y($),x(F(V.engine,$))):x(V.url),P(),f.trim()||p(QB(V))}function O(){return f.trim()?L?b.trim()?null:"Database file path is required.":_.host.trim()?_.database.trim()?null:"Database name is required.":"Host is required.":"Name is required."}async function X(){if(H){M(!0),P();try{const V=await fj({engine:h,url:j});T(V.ok?{status:"ok",message:"Connected"}:{status:"fail",message:V.error??"Connection failed"})}catch(V){T({status:"fail",message:V instanceof Error?V.message:String(V)})}finally{M(!1)}}}async function Z(){const V=O();if(V){i(V);return}z(!0);try{await hj({name:f.trim(),engine:h,url:j}),a(`Saved connection "${f.trim()}".`),t(),e()}catch($){i($ instanceof Error?$.message:String($))}finally{z(!1)}}return l.jsx(Ti,{icon:l.jsx(ui,{}),onClose:e,title:o?"Edit database connection":"Add database connection",children:l.jsxs("div",{className:"flex flex-col gap-4",children:[S.length>0?l.jsxs("section",{children:[l.jsxs("p",{className:"mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[l.jsx(ZM,{className:"size-3.5"}),"Found in your services"]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:S.map(V=>l.jsxs("button",{type:"button",onClick:()=>q(V),className:"group flex items-center gap-1.5 rounded-md border border-border bg-background px-2 py-1 text-left text-xs transition-colors hover:border-primary hover:bg-muted",title:V.maskedUrl,children:[l.jsx($e,{variant:"outline",size:"small",children:V.engine}),l.jsx("span",{className:"font-mono",children:V.service}),l.jsxs("span",{className:"font-mono text-muted-foreground",children:["·",V.key]})]},`${V.service}:${V.key}`))})]}):null,l.jsxs("section",{children:[l.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Engine"}),l.jsx("div",{className:"flex gap-1.5",children:YB.map(V=>l.jsx(re,{size:"sm",variant:h===V.value?"default":"outline",onClick:()=>K(V.value),disabled:o,type:"button",children:V.label},V.value))})]}),l.jsxs("label",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),l.jsx(et,{value:f,onChange:V=>p(V.target.value),placeholder:"e.g. shop-db",disabled:o}),o?l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"The name identifies the connection and can't be changed here."}):null]}),L?null:l.jsxs("section",{className:"flex flex-col gap-3",children:[l.jsxs("div",{className:"flex gap-3",children:[l.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Host"}),l.jsx(et,{value:_.host,onChange:V=>Y({host:V.target.value}),placeholder:"localhost",className:"font-mono text-xs"})]}),l.jsxs("label",{className:"flex w-24 flex-col gap-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Port"}),l.jsx(et,{value:_.port,onChange:V=>Y({port:V.target.value}),placeholder:h==="mysql"?"3306":"5432",className:"font-mono text-xs"})]})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"User"}),l.jsx(et,{value:_.user,onChange:V=>Y({user:V.target.value}),placeholder:"postgres",className:"font-mono text-xs"})]}),l.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Password"}),l.jsx(et,{type:"password",value:_.password,onChange:V=>Y({password:V.target.value}),placeholder:o?"leave blank to keep current":"••••••••",className:"font-mono text-xs"})]})]}),l.jsxs("label",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Database"}),l.jsx(et,{value:_.database,onChange:V=>Y({database:V.target.value}),placeholder:"app",className:"font-mono text-xs"})]}),h==="postgres"?l.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx("input",{type:"checkbox",checked:_.ssl,onChange:V=>Y({ssl:V.target.checked}),className:"size-3.5 accent-primary"}),"Require SSL (adds ",l.jsx("span",{className:"font-mono",children:"?sslmode=require"}),")"]}):null]}),l.jsxs("label",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:L?"Database file path":"Connection URL"}),l.jsx(et,{value:b,onChange:V=>Q(V.target.value),placeholder:L?"/abs/path/to/app.db":h==="mysql"?"mysql://user:pass@host:3306/db":"postgres://user:pass@host:5432/db",className:"font-mono text-xs"}),l.jsx("span",{className:"text-[11px] text-muted-foreground",children:L?"Read-only. Stored like a secret and masked in the UI and API.":"Synced with the fields above; the password stays in its field and is never shown here. Stored like a secret and masked in the UI and API."})]}),E.status!=="idle"?l.jsxs("div",{className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs ${E.status==="ok"?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400":"border-destructive/40 text-destructive"}`,children:[E.status==="ok"?l.jsx(il,{className:"size-3.5"}):l.jsx(Js,{className:"size-3.5"}),l.jsx("span",{className:"break-all font-mono",children:E.message})]}):null,l.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border pt-3",children:[l.jsxs(re,{variant:"outline",size:"sm",onClick:()=>{X()},disabled:N||!H,type:"button",children:[N?l.jsx(Os,{className:"animate-spin"}):null,"Test connection"]}),l.jsxs(re,{size:"sm",onClick:()=>{Z()},disabled:R,type:"button",children:[R?l.jsx(Os,{className:"animate-spin"}):null,o?"Save changes":"Save"]})]})]})})}function ZB(e){if(!e)return{engine:"postgres",name:"",fields:Dp,url:""};if(e.engine==="sqlite")return{engine:"sqlite",name:e.name,fields:Dp,url:e.url};const t=f0(e.url),s=t?{...t,password:""}:Dp;return{engine:e.engine,name:e.name,fields:s,url:h0(e.engine,s,{includePassword:!1})}}function QB(e){try{const s=new URL(e.url).pathname.replace(/^\//,"");if(s)return`${e.service}-${s}`}catch{}return`${e.service}-${e.engine}`}function JB({connections:e,selected:t,onSelect:s,onAdd:i,onEdit:a,onRemove:o}){const[u,h]=w.useState(!1),m=w.useRef(null),f=e.find(p=>p.name===t);return w.useEffect(()=>{if(!u)return;function p(b){m.current&&b.target instanceof Node&&!m.current.contains(b.target)&&h(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[u]),l.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:m,children:[l.jsxs(re,{className:"max-w-[240px] justify-start gap-2 rounded-md border-border bg-card",onClick:()=>h(p=>!p),size:"sm",type:"button",variant:"outline",children:[l.jsx(ui,{className:"text-muted-foreground"}),l.jsx("span",{className:"truncate",children:f?.name??"Select connection"}),f?l.jsx($e,{variant:"outline",size:"small",children:f.engine}):null,l.jsx(Yn,{className:de("ml-auto transition-transform",u&&"rotate-180")})]}),u?l.jsxs("div",{className:"absolute right-0 top-10 z-50 w-[min(420px,calc(100vw-2rem))] overflow-hidden rounded-lg border border-border bg-card shadow-lg",children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[l.jsx(ui,{className:"size-3.5 text-muted-foreground"}),l.jsx("div",{className:"text-xs font-semibold",children:"Connections"}),l.jsx($e,{className:"ml-auto",variant:"outline",size:"small",children:e.length})]}),l.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?l.jsx("div",{className:"divide-y divide-border",children:e.map(p=>{const b=p.name===t;return l.jsxs("div",{className:de("group grid w-full grid-cols-[1fr_auto_auto_auto] items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted",b&&"bg-muted/70"),children:[l.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{s(p.name),h(!1)},type:"button",children:[l.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:p.name}),l.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:p.url})]}),b?l.jsx(il,{className:"size-3.5"}):l.jsx("span",{className:"size-3.5"}),l.jsx(re,{"aria-label":`Edit ${p.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{a(p),h(!1)},size:"icon",title:`Edit ${p.name}`,type:"button",variant:"ghost",children:l.jsx(Pc,{className:"size-3.5"})}),l.jsx(re,{"aria-label":`Remove ${p.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>o(p.name),size:"icon",title:`Remove ${p.name}`,type:"button",variant:"ghost",children:l.jsx(rl,{className:"size-3.5 text-destructive"})})]},p.name)})}):l.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved connections yet."})}),l.jsx("div",{className:"border-t border-border bg-muted/20 p-2",children:l.jsxs(re,{className:"w-full",onClick:()=>{i(),h(!1)},size:"sm",type:"button",children:[l.jsx(mn,{className:"size-3"}),"Add connection"]})})]}):null]})}function ez({onAddManual:e,onAddWithAi:t}){const[s,i]=w.useState(!1),a=w.useRef(null);w.useEffect(()=>{if(!s)return;function u(h){a.current&&h.target instanceof Node&&!a.current.contains(h.target)&&i(!1)}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[s]);function o(u){i(!1),u()}return l.jsxs("div",{className:"relative",ref:a,children:[l.jsxs(re,{"aria-label":"Add database connection",onClick:()=>i(u=>!u),size:"sm",type:"button",children:[l.jsx(mn,{className:"size-3.5"}),"Add"]}),s?l.jsxs("div",{className:"absolute right-0 top-9 z-50 w-56 overflow-hidden rounded-lg border border-border bg-card shadow-lg",children:[l.jsxs("button",{className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors hover:bg-muted",onClick:()=>o(e),type:"button",children:[l.jsx(ui,{className:"size-3.5 text-muted-foreground"}),"Add connection"]}),l.jsxs("button",{className:"flex w-full items-center gap-2 border-t border-border px-3 py-2 text-left text-sm transition-colors hover:bg-muted",onClick:()=>o(t),type:"button",children:[l.jsx(Wa,{className:"size-3.5 text-muted-foreground"}),"Add with AI"]})]}):null]})}function fN({items:e,label:t="More actions",className:s}){const[i,a]=w.useState(!1),[o,u]=w.useState({top:0,right:0}),h=w.useRef(null),m=w.useRef(null);function f(){const p=h.current?.getBoundingClientRect();p&&u({top:p.bottom+4,right:window.innerWidth-p.right}),a(b=>!b)}return w.useEffect(()=>{if(!i)return;function p(_){const y=_.target;h.current?.contains(y)||m.current?.contains(y)||a(!1)}function b(_){_.key==="Escape"&&a(!1)}const x=()=>a(!1);return document.addEventListener("mousedown",p),document.addEventListener("keydown",b),window.addEventListener("scroll",x,!0),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",b),window.removeEventListener("scroll",x,!0)}},[i]),l.jsxs(l.Fragment,{children:[l.jsx("button",{"aria-label":t,className:de("flex size-6 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-all duration-150 hover:bg-muted hover:text-foreground group-hover:opacity-100",i&&"opacity-100",s),onClick:f,ref:h,title:t,type:"button",children:l.jsx(Nk,{className:"size-3.5"})}),i?ou.createPortal(l.jsx("div",{className:"fixed z-50 min-w-44 overflow-hidden rounded-md border border-border bg-card p-1 shadow-md",ref:m,style:{top:o.top,right:o.right},children:e.map(p=>l.jsxs("button",{className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-foreground transition-colors hover:bg-muted",onClick:()=>{a(!1),p.onSelect()},type:"button",children:[p.icon?l.jsx("span",{className:"text-muted-foreground",children:p.icon}):null,p.label]},p.label))}),document.body):null]})}function tz({connection:e,sample:t}){const{sendToAgent:s}=Ls(),{success:i,error:a}=Bs(),o=t.columns.map(p=>p.name);function u(p){s({prompt:S7(e,t.engine,t.table,t.columns,p),source:{type:"database-row",label:`${t.table} row`},label:`Explain this row from \`${t.table.qualifiedName}\`.`,mode:"send"})}async function h(p,b){try{await navigator.clipboard.writeText(p),i(`Copied ${b}.`)}catch(x){a(x instanceof Error?x.message:String(x))}}function m(p){const b=x=>{const _=Op(x);return/[",\n]/.test(_)?`"${_.replace(/"/g,'""')}"`:_};return`${o.join(",")}
|
|
137
|
-
${o.map(x=>b(p[x])).join(",")}`}function f(p){const b=_=>_==null?"NULL":typeof _=="number"||typeof _=="boolean"?String(_):`'${(typeof _=="object"?JSON.stringify(_):String(_)).replace(/'/g,"''")}'`,x=o.map(_=>b(p[_])).join(", ");return`INSERT INTO ${t.table} (${o.join(", ")}) VALUES (${x});`}return t.columns.length===0?l.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"This table has no columns."}):l.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:l.jsxs("table",{className:"w-max min-w-full border-collapse text-left font-mono text-[11px]",children:[l.jsx("thead",{className:"sticky top-0 z-10 bg-card",children:l.jsxs("tr",{className:"border-b border-border",children:[t.columns.map(p=>l.jsxs("th",{className:"whitespace-nowrap px-3 py-2 font-semibold text-foreground",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[p.primaryKey?l.jsx(Ok,{className:"size-3 text-amber-500"}):null,p.name]}),l.jsx("span",{className:"block text-[10px] font-normal text-muted-foreground",children:p.dataType})]},p.name)),l.jsx("th",{className:"w-16 px-2 py-2"})]})}),l.jsxs("tbody",{children:[t.rows.map((p,b)=>l.jsxs("tr",{className:"group border-b border-border/60 hover:bg-muted/40",children:[t.columns.map(x=>l.jsx("td",{className:"max-w-[320px] truncate px-3 py-1 align-top text-muted-foreground",title:Op(p[x.name]),children:Op(p[x.name])},x.name)),l.jsx("td",{className:"px-2 py-1 align-top",children:l.jsxs("div",{className:"flex items-center justify-end gap-0.5",children:[l.jsx(tl,{label:"Ask AI about this row",onAsk:()=>u(p)}),l.jsx(fN,{label:"Row actions",items:[{label:"Copy as JSON",icon:l.jsx(OA,{className:"size-3.5"}),onSelect:()=>{h(JSON.stringify(p,null,2),"row as JSON")}},{label:"Copy as CSV",icon:l.jsx(f4,{className:"size-3.5"}),onSelect:()=>{h(m(p),"row as CSV")}},{label:"Copy as SQL INSERT",icon:l.jsx(ui,{className:"size-3.5"}),onSelect:()=>{h(f(p),"INSERT statement")}}]})]})})]},b)),t.rows.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:t.columns.length+1,className:"px-3 py-6 text-center text-muted-foreground",children:"No rows."})}):null]})]})})}function Op(e){return e==null?"NULL":typeof e=="object"?JSON.stringify(e):String(e)}function sz(){const[e,t]=w.useState([]),[s,i]=w.useState(!0),[a,o]=w.useState(null),u=w.useCallback(async()=>{i(!0),o(null);try{t(await Fk())}catch(h){o(h instanceof Error?h.message:String(h))}finally{i(!1)}},[]);return w.useEffect(()=>{u()},[u]),{connections:e,loading:s,error:a,refresh:u}}const nz=[50,100,500,1e3];function iz(e){const[t,s]=w.useState([]),[i,a]=w.useState(null),[o,u]=w.useState(null),[h,m]=w.useState(null),[f,p]=w.useState(null),[b,x]=w.useState(!1),[_,y]=w.useState(!1),[S,C]=w.useState(100),[E,T]=w.useState(0);w.useEffect(()=>{T(0)},[e,i]),w.useEffect(()=>{if(s([]),a(null),u(null),m(null),p(null),!e)return;let j=!1;return x(!0),pj(e).then(H=>{j||(s(H),a(H[0]?.qualifiedName??null))}).catch(H=>{j||m(H instanceof Error?H.message:String(H))}).finally(()=>{j||x(!1)}),()=>{j=!0}},[e]),w.useEffect(()=>{if(u(null),p(null),!e||!i)return;let j=!1;return y(!0),gj(e,i,S,E).then(H=>{j||u(H)}).catch(H=>{j||p(H instanceof Error?H.message:String(H))}).finally(()=>{j||y(!1)}),()=>{j=!0}},[e,i,S,E]);const N=E>0,M=o?o.rowCount===S:!1;function R(j){C(j),T(0)}function z(){M&&T(j=>j+S)}function L(){T(j=>Math.max(0,j-S))}return{tables:t,selectedTable:i,setSelectedTable:a,sample:o,tablesError:h,rowsError:f,loadingTables:b,loadingRows:_,limit:S,offset:E,canPrev:N,canNext:M,changePageSize:R,nextPage:z,prevPage:L}}function rz(){const{connections:e,loading:t,error:s,refresh:i}=sz(),{error:a,success:o}=Bs(),{sendToAgent:u}=Ls(),[h,m]=w.useState(null),[f,p]=w.useState(null);function b(){u({prompt:_7,source:{type:"database-setup",label:"Add a database"},label:"Help me connect a database, one step at a time."})}w.useEffect(()=>{if(e.length===0){m(null);return}m(y=>y&&e.some(S=>S.name===y)?y:e[0].name)},[e]);async function x(y){try{await mj(y),o(`Removed connection "${y}".`),await i()}catch(S){a(S instanceof Error?S.message:String(S))}}function _(y){p({mode:"edit",target:y})}return l.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[l.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ui,{className:"size-4 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-semibold",children:"Databases"}),t&&e.length===0?l.jsx(Os,{className:"size-3.5 animate-spin text-muted-foreground"}):null]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(JB,{connections:e,selected:h,onSelect:m,onAdd:()=>p({mode:"add"}),onEdit:_,onRemove:y=>{x(y)}}),l.jsx(ez,{onAddManual:()=>p({mode:"add"}),onAddWithAi:b})]})]}),l.jsx("div",{className:"min-h-0 flex-1",children:s?l.jsx("div",{className:"p-4",children:l.jsx(it,{variant:"muted",className:"border-destructive/40 text-destructive",children:s})}):h?l.jsx(az,{connection:h}):l.jsx(oz,{onAdd:()=>p({mode:"add"}),onAddWithAi:b})}),f?l.jsx(XB,{initial:f.mode==="edit"?f.target:void 0,onClose:()=>p(null),onSaved:i}):null]})}function az({connection:e}){const{sendToAgent:t}=Ls(),{tables:s,selectedTable:i,setSelectedTable:a,sample:o,tablesError:u,rowsError:h,loadingTables:m,loadingRows:f,limit:p,offset:b,canPrev:x,canNext:_,changePageSize:y,nextPage:S,prevPage:C}=iz(e);function E(N){t({prompt:$S(e,N.table,{engine:N.engine,columns:N.columns}),source:{type:"database-table",label:`${N.table.name} table`},mode:"draft"})}function T(N){t({prompt:$S(e,N),source:{type:"database-table",label:`${N.name} table`},mode:"draft"})}return l.jsxs("div",{className:"flex h-full min-h-0",children:[l.jsxs("div",{className:"flex w-56 shrink-0 flex-col border-r border-border",children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[l.jsx(qM,{className:"size-4 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-semibold",children:"Tables"}),l.jsx($e,{variant:"outline",size:"small",children:s.length}),m?l.jsx(Os,{className:"size-3.5 animate-spin"}):null]}),u?l.jsx("div",{className:"p-3",children:l.jsx(it,{variant:"muted",className:"border-destructive/40 text-destructive",children:u})}):l.jsxs("ul",{className:"min-h-0 flex-1 overflow-auto",children:[s.map(N=>l.jsxs("li",{className:de("group flex items-center gap-1 pr-1 transition-colors hover:bg-muted/50",N.qualifiedName===i&&"bg-muted/70"),children:[l.jsx("button",{type:"button",onClick:()=>a(N.qualifiedName),className:de("min-w-0 flex-1 truncate px-3 py-1.5 text-left font-mono text-[11px]",N.qualifiedName===i&&"font-semibold"),children:N.qualifiedName}),l.jsx(tl,{label:`Ask AI about \`${N.qualifiedName}\``,onAsk:()=>T(N)})]},N.qualifiedName)),!m&&s.length===0?l.jsx("li",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No tables."}):null]})]}),l.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[l.jsxs("div",{className:"group flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[l.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:i??"Select a table"}),o?l.jsx(tl,{label:`Ask AI about \`${o.table.qualifiedName}\``,onAsk:()=>E(o)}):null]}),o?l.jsxs("div",{className:"flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[l.jsx("span",{className:"tabular-nums",children:o.rowCount===0?"no rows":`rows ${b+1}–${b+o.rowCount}`}),l.jsx("select",{"aria-label":"Rows per page",className:"rounded-md border border-border bg-background px-1.5 py-0.5 text-[11px]",value:p,onChange:N=>y(Number(N.target.value)),children:nz.map(N=>l.jsxs("option",{value:N,children:[N," / page"]},N))}),l.jsx(re,{size:"sm",variant:"outline",className:"h-6 px-2",onClick:C,disabled:!x,type:"button",children:"Prev"}),l.jsx(re,{size:"sm",variant:"outline",className:"h-6 px-2",onClick:S,disabled:!_,type:"button",children:"Next"})]}):null]}),h?l.jsx("div",{className:"p-4",children:l.jsx(it,{variant:"muted",className:"border-destructive/40 text-destructive",children:h})}):f?l.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[l.jsx(Os,{className:"mr-2 size-4 animate-spin"}),"Loading rows…"]}):o?l.jsx(tz,{connection:e,sample:o}):l.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:"Pick a table to sample its rows."})]})]})}function oz({onAdd:e,onAddWithAi:t}){return l.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:l.jsxs("div",{className:"max-w-sm",children:[l.jsx(ui,{className:"mx-auto size-8 text-muted-foreground/50"}),l.jsx("p",{className:"mt-3 text-sm font-medium",children:"No connections yet"}),l.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Add a read-only Postgres, MySQL, or SQLite connection to browse tables and sample rows. NoMoreIDE can auto-detect connection strings from your services' ",l.jsx("code",{children:".env"})," files."]}),l.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2",children:[l.jsxs(re,{size:"sm",onClick:e,type:"button",children:[l.jsx(mn,{}),"Add connection"]}),l.jsxs(re,{size:"sm",variant:"outline",onClick:t,type:"button",children:[l.jsx(Wa,{}),"Add with AI"]})]})]})})}function lz({incident:e}){const{error:t}=Bs(),{sendToAgent:s}=Ls(),[i,a]=w.useState(!1);async function o(){a(!0);try{const{prompt:u}=await bj(e.id);s({prompt:u,source:{type:"error",label:`${e.service} — ${e.level}`},label:`Help me debug this ${e.level} in \`${e.service}\`: ${e.title}`})}catch(u){t(u instanceof Error?u.message:String(u))}finally{a(!1)}}return l.jsxs("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[l.jsxs("div",{className:"shrink-0 border-b border-border px-4 py-3",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx($e,{variant:e.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:e.level}),l.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:e.service}),e.count>1?l.jsxs($e,{variant:"outline",size:"small",children:["×",e.count]}):null]}),l.jsxs(re,{onClick:()=>{o()},disabled:i,size:"sm",variant:"outline",children:[l.jsx(ci,{className:"size-3.5"}),i?"Sending…":"Fix with AI"]})]}),l.jsx("p",{className:"mt-1.5 break-words font-mono text-xs text-foreground",children:e.title}),e.file?l.jsxs("p",{className:"mt-1 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[l.jsx(Mk,{className:"size-3.5"}),e.file,e.line?`:${e.line}`:""]}):null,l.jsxs("p",{className:"mt-1 font-mono text-[10px] text-muted-foreground/80",children:["first ",new Date(e.firstSeen).toLocaleString()," · last"," ",new Date(e.lastSeen).toLocaleTimeString()]})]}),l.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[l.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Log excerpt"}),l.jsx("pre",{className:"overflow-x-auto rounded-md border border-border bg-muted/40 p-3 font-mono text-[11px] leading-relaxed",children:e.logExcerpt.join(`
|
|
138
|
-
`)}),l.jsx("p",{className:"mt-3 text-[11px] text-muted-foreground",children:`"Fix with AI" sends the agent this excerpt with the affected file's diff and the last 40 log lines, so it can start debugging right away.`})]})]})}function nw(e){return[...e].sort((t,s)=>t.lastSeen<s.lastSeen?1:t.lastSeen>s.lastSeen?-1:s.id-t.id)}function cz(){const[e,t]=w.useState([]),[s,i]=w.useState(!1),[a,o]=w.useState(null),u=w.useCallback(h=>{t(m=>nw([...m.filter(f=>f.id!==h.id),h]))},[]);return w.useEffect(()=>{let h=!0;Vk().then(f=>{h&&t(nw(f))}).catch(f=>{h&&o(f instanceof Error?f.message:String(f))});const m=new EventSource("/api/errors/stream");return m.addEventListener("open",()=>i(!0)),m.addEventListener("error",()=>i(!1)),m.addEventListener("incident",f=>{try{const p=JSON.parse(f.data);u(p)}catch{}}),()=>{h=!1,m.close()}},[u]),{incidents:e,connected:s,error:a}}function uz(){const{incidents:e,connected:t,error:s}=cz(),[i,a]=w.useState(null);w.useEffect(()=>{if(e.length===0){a(null);return}a(u=>u!==null&&e.some(h=>h.id===u)?u:e[0].id)},[e]);const o=w.useMemo(()=>e.find(u=>u.id===i)??null,[e,i]);return l.jsxs("div",{className:"flex h-full min-h-0 bg-card/85",children:[l.jsxs("div",{className:"flex w-72 shrink-0 flex-col border-r border-border",children:[l.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(uh,{className:"size-4 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-semibold",children:"Incidents"}),l.jsx($e,{variant:"outline",size:"small",children:e.length})]}),l.jsx($e,{variant:"outline",size:"small",icon:l.jsx("span",{className:de("inline-block size-1.5 rounded-full",t?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:t?"live":"reconnecting…"})]}),l.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border overflow-auto",children:e.map(u=>l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:()=>a(u.id),className:de("flex w-full flex-col gap-1 px-3 py-2 text-left transition-colors hover:bg-muted/50",u.id===i&&"bg-muted/70"),children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"truncate font-mono text-[11px] font-semibold",children:u.service}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.count>1?l.jsxs($e,{variant:"outline",size:"small",children:["×",u.count]}):null,l.jsx($e,{variant:u.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:u.level})]})]}),l.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:u.title}),l.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:new Date(u.lastSeen).toLocaleTimeString()})]})},u.id))})]}),l.jsx("div",{className:"min-h-0 min-w-0 flex-1",children:s?l.jsx("div",{className:"p-4",children:l.jsxs(it,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load incidents: ",s]})}):o?l.jsx(lz,{incident:o}):l.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:l.jsxs("div",{className:"max-w-sm",children:[l.jsx(uh,{className:"mx-auto size-8 text-muted-foreground/50"}),l.jsx("p",{className:"mt-3 text-sm font-medium",children:"No incidents yet"}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Errors and stack traces from your running services land here automatically. Each one becomes a one-click prompt for your agent."})]})})})]})}function Ah({label:e}){return l.jsx(it,{variant:"muted",className:"m-4 text-center",children:e})}const dz=900*1e3,kc=12,Lp=200;function hz({events:e}){const[t,s]=w.useState(null),[i,a]=w.useState(null),{rows:o,windowStart:u,windowEnd:h}=w.useMemo(()=>fz(e),[e]),m=t?o.find(f=>f.service===t)??null:null;return l.jsxs(l.Fragment,{children:[l.jsxs(Mi,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[l.jsxs(ji,{className:"border-b border-border px-3 py-2",children:[l.jsxs(Ri,{className:"flex items-center gap-2",children:[l.jsx(Pa,{className:"size-3.5"}),"Runtime Monitor"]}),l.jsx(dr,{className:"text-xs",children:e.length===0?"No events yet":`${e.length} event${e.length===1?"":"s"} · last 15 min`})]}),l.jsx(Di,{className:"p-0",children:o.length===0?l.jsx(Ah,{label:"No runtime timeline events yet."}):l.jsxs("div",{className:"divide-y divide-border",children:[o.map(f=>l.jsx(pz,{onClick:()=>s(f.service),row:f,windowEnd:h,windowStart:u},f.service)),l.jsxs("div",{className:"flex justify-between px-3 py-1.5 font-mono text-[10px] text-muted-foreground",children:[l.jsx("span",{children:Mh(u)}),l.jsx("span",{children:"now"})]})]})})]}),m?l.jsx(Ti,{icon:l.jsx(Pa,{}),onClose:()=>s(null),title:m.service,children:l.jsx(bz,{onSelect:a,row:m})}):null,i?l.jsx(Ti,{icon:l.jsx(Pa,{}),onClose:()=>a(null),title:i.title,children:l.jsx(vz,{event:i})}):null]})}function fz(e){const t=Date.now(),s=t,i=t-dz;let a=e.filter(m=>{if(m.kind==="service.http")return!1;const f=new Date(m.timestamp).getTime();return!Number.isNaN(f)&&f>=i});a.length===0&&e.length>0?a=e.slice(-Lp):a.length>Lp&&(a=a.slice(-Lp));const o=new Map;for(const m of a){const f=m.service||"·system",p=o.get(f)??[];p.push(m),o.set(f,p)}const u=Math.max(s-i,1);return{rows:Array.from(o.entries()).map(([m,f])=>{const p=[...f].sort((T,N)=>T.timestamp.localeCompare(N.timestamp)),b=new Array(kc).fill(0),x=new Array(kc).fill(null);for(const T of p){const N=new Date(T.timestamp).getTime(),M=Math.max(i,Math.min(s,N)),R=Math.min(kc-1,Math.floor((M-i)/u*kc));b[R]+=1;const z=x[R];x[R]=mz(z,T.severity)}const _=p.filter(T=>T.severity==="error").length,y=p.filter(T=>T.severity==="warning").length,S=p.length-_-y,C=[...p].reverse().find(T=>T.severity!=="info")??null,E=_>0?"error":y>0?"warning":"info";return{service:m,events:p,errors:_,warnings:y,infos:S,buckets:b,bucketSeverity:x,lastNotable:C,worstSeverity:E}}).sort((m,f)=>{const p=x=>x.errors*1e3+x.warnings,b=p(f)-p(m);return b!==0?b:m.service.localeCompare(f.service)}),windowStart:i,windowEnd:s}}function mz(e,t){return e==="error"||t==="error"?"error":e==="warning"||t==="warning"?"warning":"info"}function pz({onClick:e,row:t,windowEnd:s,windowStart:i}){const a=Math.max(1,...t.buckets);return l.jsxs("button",{className:"timeline-service-row block w-full px-3 py-2 text-left transition-colors hover:bg-muted/40 focus:outline-none focus-visible:bg-muted/40","data-testid":"timeline-service-row",onClick:e,type:"button",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx("span",{className:de("size-2 shrink-0 rounded-full",mN(t.worstSeverity))}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",dir:"rtl",children:l.jsx("bdi",{children:t.service})}),t.errors>0?l.jsxs("span",{className:"rounded bg-red-500/15 px-1 font-mono text-[10px] text-red-500",children:[t.errors,"E"]}):null,t.warnings>0?l.jsxs("span",{className:"rounded bg-amber-500/15 px-1 font-mono text-[10px] text-amber-500",children:[t.warnings,"W"]}):null,l.jsx(ia,{className:"size-3 text-muted-foreground"})]}),l.jsx("div",{className:"timeline-density mt-1.5 grid h-3 gap-px","data-testid":"timeline-density",style:{gridTemplateColumns:`repeat(${kc}, minmax(0, 1fr))`},children:t.buckets.map((o,u)=>l.jsx(gz,{count:o,max:a,severity:t.bucketSeverity[u]},u))}),t.lastNotable?l.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:t.lastNotable.detail??t.lastNotable.title}):l.jsxs("div",{className:"mt-1 truncate text-[10px] text-muted-foreground",children:[t.infos," info ",t.infos===1?"event":"events"]}),l.jsxs("div",{className:"mt-0.5 flex justify-between font-mono text-[9px] text-muted-foreground/60",children:[l.jsx("span",{children:Mh(i)}),l.jsx("span",{children:Mh(s)})]})]})}function gz({count:e,max:t,severity:s}){if(e===0)return l.jsx("span",{className:"rounded-sm bg-border/60"});const i=Math.min(1,.35+e/t*.65);return l.jsx("span",{className:de("rounded-sm",xz(s)),style:{opacity:i},title:`${e} event${e===1?"":"s"}`})}function bz({onSelect:e,row:t}){const s=[...t.events].sort((i,a)=>a.timestamp.localeCompare(i.timestamp));return l.jsxs("div",{className:"flex max-h-[480px] flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2 text-xs text-muted-foreground",children:[l.jsxs("span",{children:[t.events.length," events"]}),l.jsx("span",{children:"·"}),l.jsxs("span",{children:[t.errors," error",t.errors===1?"":"s"]}),l.jsx("span",{children:"·"}),l.jsxs("span",{children:[t.warnings," warning",t.warnings===1?"":"s"]})]}),l.jsx("ul",{className:"min-h-0 divide-y divide-border overflow-auto",children:s.map(i=>l.jsx("li",{children:l.jsxs("button",{className:"block w-full px-4 py-2 text-left hover:bg-muted/40 focus:outline-none focus-visible:bg-muted/40",onClick:()=>e(i),type:"button",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:de("size-2 shrink-0 rounded-full",mN(i.severity))}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",children:i.title}),l.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:Mh(i.timestamp)})]}),i.detail?l.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:i.detail}):null]})},i.id))})]})}function vz({event:e}){const t=new Date(e.timestamp);return l.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:de("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",_z(e.severity)),children:e.severity}),l.jsx("span",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.kind}),e.service?l.jsx("span",{className:"rounded border border-border bg-background px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:e.service}):null]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"When"}),l.jsx("div",{className:"font-mono text-xs",children:Number.isNaN(t.getTime())?e.timestamp:t.toLocaleString()})]}),e.detail?l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Detail"}),l.jsx("pre",{className:"mt-1 max-h-72 overflow-auto whitespace-pre-wrap rounded border border-border bg-background p-3 font-mono text-xs",children:e.detail})]}):null]})}function mN(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-400"}function xz(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-500"}function _z(e){return e==="error"?"bg-red-600":e==="warning"?"bg-amber-600":"bg-zinc-700"}function Mh(e){const t=typeof e=="number"?new Date(e):new Date(e);return Number.isNaN(t.getTime())?"--:--:--":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function yz({health:e}){if(!e)return null;const t=e.processTree,s=e.status==="healthy"||e.status==="unknown"?void 0:Cz(e.summary);return l.jsxs("div",{className:"mt-1.5 grid min-w-0 gap-2 text-[11px] text-muted-foreground sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsxs("span",{className:de("inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2.5 font-medium",Sz(e.status)),children:[l.jsx("span",{className:"inline-flex shrink-0",children:l.jsx(Pa,{className:"size-3"})}),l.jsx("span",{className:"whitespace-nowrap",children:e.status})]}),s?l.jsx("span",{className:"min-w-0 truncate",children:s}):null]}),t?l.jsxs("div",{className:"health-metrics flex min-w-max items-center gap-2 font-mono sm:justify-end",children:[l.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[l.jsx(t4,{className:"size-3"}),t.processCount," ",t.processCount===1?"process":"processes"]}),l.jsxs("span",{children:[kz(t.cpuPercent)," CPU"]}),l.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[l.jsx(J4,{className:"size-3"}),wz(t.rssMb)," RAM"]})]}):null]})}function Sz(e){return e==="healthy"?"bg-emerald-600 text-white":e==="warning"?"bg-amber-600 text-white":e==="unhealthy"?"bg-red-600 text-white":"bg-zinc-700 text-white"}function wz(e){return Number.isInteger(e)?`${e} MB`:`${e.toFixed(1)} MB`}function kz(e){return`${e.toFixed(1)}%`}function Cz(e){return e.replace(/^Recent error log:\s*/i,"Recent stderr: ").replace(/:\s*\d+(?:\.\d+)? MB RSS\.?$/i,"").replace(/\s+RSS\.?$/i,"")}function Ez({ports:e}){const t=e.filter(i=>i.state==="occupied").length,s=e.filter(i=>i.state==="managed").length;return l.jsxs(Mi,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[l.jsxs(ji,{className:"border-b border-border px-3 py-2",children:[l.jsxs(Ri,{className:"flex items-center gap-2",children:[l.jsx(aM,{className:"size-3.5"}),"Ports"]}),l.jsxs(dr,{className:"text-xs",children:[s," managed, ",t," occupied by other"]})]}),l.jsx(Di,{className:"p-0",children:e.length?l.jsx("div",{className:"divide-y divide-border",children:e.map(i=>l.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2 px-3 py-2",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"font-mono text-xs",children:[":",i.port]}),l.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:i.services.join(", ")||"Unassigned"}),i.urls[0]?l.jsx("div",{className:"truncate font-mono text-[10px] text-muted-foreground",children:i.urls[0]}):null]}),l.jsx(Nz,{port:i})]},i.port))}):l.jsx(Ah,{label:"No configured ports yet."})})]})}function Nz({compact:e,port:t}){const s=t.state==="managed"?"managed":t.state==="occupied"?"occupied by other":"available",i=t.state==="managed"?"success":t.state==="occupied"?"warning":"outline";return l.jsx($e,{className:de(e&&"max-w-36 truncate"),variant:i,children:s})}function Tz({onChange:e,value:t}){return l.jsxs("label",{className:"relative block",children:[l.jsx(MM,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),l.jsx(et,{"aria-label":"Search logs",className:"h-8 w-44 pl-7 text-xs",onChange:s=>e(s.target.value),placeholder:"Search logs",value:t})]})}function Az({className:e,containerRef:t,emptyText:s,logs:i,query:a}){return l.jsx("div",{className:de("h-full max-w-full overflow-auto bg-background font-mono text-[11px] leading-5 dark:bg-zinc-950",e),ref:t,role:"log",children:i.length?i.map((o,u)=>l.jsxs("div",{className:de("grid min-w-max grid-cols-[168px_minmax(420px,1fr)] gap-2 border-b border-border/45 px-3 py-0.5 dark:border-zinc-800/80",o.stream==="stderr"?"bg-red-50/70 text-red-800 dark:bg-red-950/35 dark:text-red-100":"bg-emerald-50/35 text-zinc-800 dark:bg-zinc-950 dark:text-zinc-200 dark:odd:bg-zinc-900/45"),children:[l.jsx("span",{className:"text-muted-foreground dark:text-zinc-500",children:o.timestamp}),l.jsxs("span",{className:"whitespace-pre-wrap break-words",children:[o.stream==="stderr"?l.jsx("span",{className:"mr-2 rounded bg-red-100 px-1 font-semibold uppercase text-red-700 dark:bg-red-500/15 dark:text-red-300 dark:ring-1 dark:ring-red-400/20",children:"stderr"}):null,jz(o.text,a)]})]},`${o.timestamp}-${o.stream}-${u}`)):l.jsx("div",{className:"p-3 text-muted-foreground",children:s})})}function Mz(e){return`${e.timestamp} ${e.stream} ${e.text}`}function jz(e,t){const s=t.trim();if(!s)return e;const i=e.toLowerCase(),a=s.toLowerCase(),o=[];let u=0,h=i.indexOf(a);for(;h!==-1;){h>u&&o.push(e.slice(u,h));const m=h+s.length;o.push(l.jsx("mark",{className:"rounded bg-amber-200 px-0.5 text-amber-950 dark:bg-amber-400/20 dark:text-amber-200",children:e.slice(h,m)},`${h}-${m}`)),u=m,h=i.indexOf(a,u)}return u<e.length&&o.push(e.slice(u)),o}function iw(e){return`${e.kind}:${e.name}`}function Rz(e,t=!1,s={}){const[i,a]=w.useState(),[o,u]=w.useState(),[h,m]=w.useState(e.kind==="source"),f=JSON.stringify(s);return w.useEffect(()=>{a(void 0),u(void 0);let p=!1;const b=async()=>{try{if(e.kind==="service"){const _=await Kk(e.name,s);p||(a(_.logs),m(_.queryable),u(void 0))}else{const _=await qk(e.name,s);p||(a(_),m(!0),u(void 0))}}catch(_){p||u(_ instanceof Error?_.message:String(_))}};b();const x=window.setInterval(b,t?1e3:2e3);return()=>{p=!0,window.clearInterval(x)}},[e.kind,e.name,t,f]),{logs:i,error:o,queryable:h}}const Dz=[{label:"Live tail",value:""},{label:"Last 15 min",value:"15 min ago"},{label:"Last hour",value:"1 hour ago"},{label:"Today",value:"today"},{label:"Last 24h",value:"1 day ago"},{label:"Last 7 days",value:"7 days ago"}];function pN({target:e,query:t,setQuery:s,streaming:i,setStreaming:a,hideStdout:o,setHideStdout:u,fill:h=!1,leading:m,trailing:f}){const p=e.kind==="source",[b,x]=w.useState(""),[_,y]=w.useState(""),[S,C]=w.useState(t);w.useEffect(()=>{const V=window.setTimeout(()=>C(t),300);return()=>window.clearTimeout(V)},[t]);const E=w.useMemo(()=>{const V={};b&&(V.since=b),_&&(V.level=_);const $=S.trim();return $&&(V.grep=$),V},[b,_,S]),{logs:T,error:N,queryable:M}=Rz(e,i,E),R=p||M,z=w.useRef(null),L=w.useRef(!0),[j,H]=w.useState([]),[P,F]=w.useState(!1),K=JSON.stringify(E);w.useEffect(()=>{H([])},[K,e.kind,e.name]);const Y=w.useMemo(()=>{const V=T??[];if(j.length===0)return V;const $=new Set(j.map(D=>D.cursor).filter(Boolean));return[...j,...V.filter(D=>!D.cursor||!$.has(D.cursor))]},[T,j]),Q=(j[0]??(T??[])[0])?.cursor;async function q(){if(!(!R||!Q||P)){F(!0),L.current=!1;try{const V={...E,before:Q,lines:200},$=e.kind==="source"?await qk(e.name,V):(await Kk(e.name,V)).logs;$.length&&H(D=>{const W=new Set(D.map(le=>le.cursor).filter(Boolean));return[...$.filter(le=>!le.cursor||!W.has(le.cursor)),...D]})}finally{F(!1)}}}const O=t.trim().toLowerCase(),X=w.useMemo(()=>{let V=Y;return o&&(V=V.filter($=>$.stream==="stderr")),O&&(V=V.filter($=>Mz($).toLowerCase().includes(O))),V},[Y,o,O]);w.useEffect(()=>{const V=z.current;if(!V)return;const $=()=>{const D=V.scrollHeight-V.scrollTop-V.clientHeight;L.current=D<40};return $(),V.addEventListener("scroll",$,{passive:!0}),()=>V.removeEventListener("scroll",$)},[]),w.useEffect(()=>{if(!i||!L.current||X.length===0)return;const V=z.current;V&&(V.scrollTop=V.scrollHeight)},[i,X]);const Z=T?O?`No log lines match "${t.trim()}".`:o?"No stderr output captured.":"No log entries.":"Loading…";return l.jsxs("div",{className:h?"flex h-full min-h-0 flex-col gap-2":"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m,l.jsx(Tz,{onChange:s,value:t}),R?l.jsxs(l.Fragment,{children:[l.jsx("select",{"aria-label":"Time range",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:V=>x(V.target.value),value:b,children:Dz.map(V=>l.jsx("option",{value:V.value,children:V.label},V.label))}),l.jsxs("select",{"aria-label":"Level",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:V=>y(V.target.value),value:_,children:[l.jsx("option",{value:"",children:"All levels"}),l.jsx("option",{value:"warn",children:"Warnings+"}),l.jsx("option",{value:"error",children:"Errors"})]})]}):l.jsxs(rw,{active:o,activeClassName:"border-amber-600 bg-amber-50 text-amber-700 dark:border-amber-400/40 dark:bg-amber-500/15 dark:text-amber-300",onClick:()=>u(!o),children:[l.jsx(C4,{}),"Errors only"]}),l.jsxs(rw,{active:i,activeClassName:"border-emerald-600 bg-emerald-50 text-emerald-700 dark:border-emerald-400/40 dark:bg-emerald-500/15 dark:text-emerald-300",onClick:()=>a(!i),children:[l.jsx(kM,{}),i?"Streaming":"Stream"]}),R&&Q?l.jsxs(re,{disabled:P,onClick:()=>{q()},size:"sm",type:"button",variant:"outline",children:[l.jsx(Uh,{}),P?"Loading…":"Load older"]}):null,f?l.jsx("div",{className:"ml-auto flex items-center gap-2",children:f}):null]}),N?l.jsx("div",{className:"text-red-600",children:N}):null,l.jsx(Az,{className:de("rounded border border-border/60",h?"min-h-0 flex-1":"max-h-80"),containerRef:z,emptyText:Z,logs:X,query:t})]})}function rw({active:e,activeClassName:t,children:s,onClick:i}){return l.jsx(re,{"aria-pressed":e,className:e?t:void 0,onClick:i,size:"sm",type:"button",variant:"outline",children:s})}function Oz(e,t){return e.kind===t.kind&&e.name===t.name}function Lz({options:e,target:t,onChange:s,className:i}){const a=e.findIndex(u=>Oz(u.target,t)),o=[...new Set(e.map(u=>u.group))];return l.jsx("select",{"aria-label":"Log source",className:i??"h-8 max-w-44 rounded-md border border-border bg-background px-2 text-xs",onChange:u=>s(e[Number(u.target.value)].target),value:String(a),children:o.map(u=>l.jsx("optgroup",{label:u,children:e.map((h,m)=>h.group===u?l.jsx("option",{value:String(m),children:h.label},`${h.group}:${h.label}`):null)},u))})}function Bz({serviceName:e}){const[t,s]=w.useState(""),[i,a]=w.useState(!1),[o,u]=w.useState(!1),[h,m]=w.useState(!1),f=l.jsx(pN,{fill:!0,hideStdout:o,query:t,setHideStdout:u,setQuery:s,setStreaming:a,streaming:i,target:{kind:"service",name:e},trailing:l.jsxs(re,{onClick:()=>m(p=>!p),size:"sm",type:"button",variant:"outline",children:[h?l.jsx(Bk,{}):l.jsx(Lk,{}),h?"Exit":"Expand"]})});return h?l.jsx(ev,{onClose:()=>m(!1),title:`Logs — ${e}`,children:f}):l.jsx("div",{className:"h-[60vh] min-h-[24rem]",children:f})}function ev({title:e,onClose:t,children:s,maxWidthClass:i="max-w-6xl"}){return w.useEffect(()=>{function a(o){o.key==="Escape"&&t()}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t]),ou.createPortal(l.jsx("div",{className:"fixed inset-0 z-[1000] bg-black/40 p-4 sm:p-8",onMouseDown:t,children:l.jsxs("div",{"aria-modal":"true",className:`mx-auto flex h-full ${i} flex-col overflow-hidden rounded-lg border border-border bg-card text-xs shadow-xl`,onMouseDown:a=>a.stopPropagation(),role:"dialog",children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[l.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e}),l.jsx(re,{"aria-label":"Close logs",onClick:t,size:"icon",type:"button",variant:"ghost",children:l.jsx(Js,{})})]}),l.jsx("div",{className:"min-h-0 flex-1 p-3",children:s})]})}),document.body)}const zz={journald:"Queries `journalctl -u <unit>` — time range, text, and level filter server-side. Add a host to run it over SSH.",docker:"Queries `docker logs <container>` — time window server-side. Add a host to run it over SSH.",ssh:"Reads via `ssh <host> tail -n 500 <path>` using your ~/.ssh/config + ssh-agent.",file:"Tails an absolute file path on this machine.",command:"Runs the command and treats its output as the log (kubectl logs, …)."};function Iz({onClose:e,onAdded:t}){const[s,i]=w.useState(""),[a,o]=w.useState("journald"),[u,h]=w.useState(""),[m,f]=w.useState(""),[p,b]=w.useState(""),[x,_]=w.useState(""),[y,S]=w.useState(""),[C,E]=w.useState(""),[T,N]=w.useState(),[M,R]=w.useState(!1);async function z(){R(!0),N(void 0);try{const L={name:s.trim(),kind:"command"};a==="file"?(L.kind="file",L.path=m.trim()):a==="ssh"?(L.kind="ssh",L.host=u.trim(),L.path=m.trim()):a==="command"?(L.kind="command",L.command=p.trim(),x.trim()&&(L.cwd=x.trim())):a==="journald"?(L.driver="journald",L.unit=y.trim(),u.trim()&&(L.host=u.trim())):a==="docker"&&(L.driver="docker",L.container=C.trim(),u.trim()&&(L.host=u.trim()));const j=await $j(L);t(j,L.name),e()}catch(L){N(L instanceof Error?L.message:String(L))}finally{R(!1)}}return l.jsx(Ti,{icon:l.jsx(Pk,{}),onClose:e,size:"md",title:"Add log source",children:l.jsxs("form",{className:"flex flex-col gap-3 p-4 text-xs",onSubmit:L=>{L.preventDefault(),z()},children:[l.jsx(ar,{label:"Name",children:l.jsx(et,{autoFocus:!0,onChange:L=>i(L.target.value),placeholder:"PROD",value:s})}),l.jsxs(ar,{label:"Type",children:[l.jsxs("select",{className:"h-9 w-full rounded-md border border-border bg-background px-2 text-xs",onChange:L=>o(L.target.value),value:a,children:[l.jsx("option",{value:"journald",children:"systemd journal (journald)"}),l.jsx("option",{value:"docker",children:"Docker container"}),l.jsx("option",{value:"ssh",children:"Remote file (SSH)"}),l.jsx("option",{value:"file",children:"Local file"}),l.jsx("option",{value:"command",children:"Command"})]}),l.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:zz[a]})]}),a==="journald"||a==="docker"?l.jsx(ar,{label:"Host (optional — leave blank to run locally)",children:l.jsx(et,{onChange:L=>h(L.target.value),placeholder:"jobjourney-prod (an alias from ~/.ssh/config)",value:u})}):null,a==="journald"?l.jsx(ar,{label:"Unit",children:l.jsx(et,{onChange:L=>S(L.target.value),placeholder:"jobjourney",value:y})}):null,a==="docker"?l.jsx(ar,{label:"Container",children:l.jsx(et,{onChange:L=>E(L.target.value),placeholder:"brainctl-api",value:C})}):null,a==="ssh"?l.jsx(ar,{label:"Host",children:l.jsx(et,{onChange:L=>h(L.target.value),placeholder:"prod (an alias from ~/.ssh/config)",value:u})}):null,a==="file"||a==="ssh"?l.jsx(ar,{label:a==="ssh"?"Remote path":"File path",children:l.jsx(et,{onChange:L=>f(L.target.value),placeholder:"/var/log/app/out.log",value:m})}):null,a==="command"?l.jsxs(l.Fragment,{children:[l.jsx(ar,{label:"Command",children:l.jsx(et,{onChange:L=>b(L.target.value),placeholder:"kubectl logs -l app=myapp --tail 500",value:p})}),l.jsx(ar,{label:"Working directory (optional)",children:l.jsx(et,{onChange:L=>_(L.target.value),placeholder:"/srv/app",value:x})})]}):null,T?l.jsx("div",{className:"text-red-600",children:T}):null,l.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[l.jsx(re,{onClick:e,size:"sm",type:"button",variant:"outline",children:"Cancel"}),l.jsx(re,{disabled:M||!s.trim(),size:"sm",type:"submit",children:M?"Saving…":"Add source"})]})]})})}function ar({label:e,children:t}){return l.jsxs("label",{className:"flex flex-col gap-1",children:[l.jsx("span",{className:"font-medium text-muted-foreground",children:e}),t]})}const aw=4;function Pz({services:e,initialService:t,onClose:s}){const[i,a]=w.useState([]),[o,u]=w.useState(!1),[h,m]=w.useState(()=>[0]),[f,p]=w.useState(()=>{const N=t?{kind:"service",name:t}:e[0]?{kind:"service",name:e[0]}:void 0;return N?{0:N}:{}}),b=w.useRef(1);w.useEffect(()=>{let N=!1;return Pj().then(M=>{N||a(M)}),()=>{N=!0}},[]);const x=[...e.map(N=>({target:{kind:"service",name:N},label:N,group:"Services"})),...i.map(N=>({target:{kind:"source",name:N.name},label:N.name,group:"Log sources"}))],_=x.map(N=>N.target);function y(){if(h.length>=aw||_.length===0)return;const N=b.current++,M=new Set(Object.values(f).map(iw)),R=_.find(z=>!M.has(iw(z)))??_[0];m(z=>[...z,N]),p(z=>({...z,[N]:R}))}function S(N){m(M=>M.filter(R=>R!==N)),p(M=>{const R={...M};return delete R[N],R})}function C(N,M){p(R=>({...R,[N]:M}))}function E(N,M){a(N);const R=h[0];R!==void 0&&C(R,{kind:"source",name:M})}const T=l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{children:"Logs"}),l.jsxs(re,{onClick:()=>u(!0),size:"sm",type:"button",variant:"outline",children:[l.jsx(mn,{}),"Add source"]}),l.jsxs(re,{disabled:h.length>=aw||_.length===0,onClick:y,size:"sm",type:"button",variant:"outline",children:[l.jsx(mn,{}),"Add pane"]})]});return l.jsxs(l.Fragment,{children:[l.jsx(ev,{maxWidthClass:"max-w-[1500px]",onClose:s,title:T,children:_.length===0?l.jsx("div",{className:"grid h-full place-items-center text-center text-muted-foreground",children:l.jsxs("div",{children:[l.jsx("p",{children:"No services or log sources yet."}),l.jsxs(re,{className:"mt-2",onClick:()=>u(!0),size:"sm",type:"button",children:[l.jsx(mn,{}),"Add a log source"]})]})}):l.jsx("div",{className:de("grid h-full min-h-0 gap-3",h.length>1?"lg:grid-cols-2":"grid-cols-1",h.length>2?"lg:grid-rows-2":"grid-rows-1"),children:h.map(N=>l.jsx($z,{onChangeTarget:M=>C(N,M),onRemove:h.length>1?()=>S(N):void 0,options:x,target:f[N]??_[0]},N))})}),o?l.jsx(Iz,{onAdded:E,onClose:()=>u(!1)}):null]})}function $z({options:e,target:t,onChangeTarget:s,onRemove:i}){const[a,o]=w.useState(""),[u,h]=w.useState(!0),[m,f]=w.useState(!1);return l.jsx("div",{className:"flex min-h-0 min-w-0 flex-col rounded-lg border border-border bg-background/60 p-2",children:l.jsx(pN,{fill:!0,hideStdout:m,leading:l.jsx(Lz,{onChange:s,options:e,target:t}),query:a,setHideStdout:f,setQuery:o,setStreaming:h,streaming:u,target:t,trailing:i?l.jsx(re,{"aria-label":"Remove pane",onClick:i,size:"icon",type:"button",variant:"ghost",children:l.jsx(Js,{})}):void 0})})}function Hz({rows:e,revealAll:t,onAdd:s,onRemove:i,onUpdate:a}){return e.length===0?l.jsxs("div",{className:"text-muted-foreground",children:["No variables yet."," ",l.jsx("button",{className:"underline",onClick:s,type:"button",children:"Add one"}),"."]}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full font-mono text-[11px]",children:[l.jsx("thead",{className:"text-left text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"py-1 pr-3",children:"Key"}),l.jsx("th",{className:"py-1 pr-3",children:"Value"}),l.jsx("th",{className:"py-1 w-8"})]})}),l.jsx("tbody",{children:e.map((o,u)=>{const h=!o.reveal&&!t;return l.jsxs("tr",{className:"border-t border-border/40",children:[l.jsx("td",{className:"py-1 pr-3 align-top",children:l.jsx("input",{className:"w-full rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono",onChange:m=>a(u,{key:m.target.value}),placeholder:"KEY",spellCheck:!1,value:o.key})}),l.jsx("td",{className:"py-1 pr-3 align-top",children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("input",{className:"w-full rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono",onChange:m=>a(u,{value:m.target.value}),spellCheck:!1,type:h?"password":"text",value:o.value}),l.jsx("button",{className:"text-muted-foreground hover:text-foreground",onClick:()=>a(u,{reveal:!o.reveal}),title:o.reveal||t?"Hide":"Reveal",type:"button",children:o.reveal||t?l.jsx(Tk,{size:14}):l.jsx(rb,{size:14})})]})}),l.jsx("td",{className:"py-1 align-top",children:l.jsx("button",{className:"text-muted-foreground hover:text-red-600",onClick:()=>i(u),type:"button",children:l.jsx(rl,{size:14})})})]},u)})})]})})}function Uz({serviceName:e,onClose:t,onPick:s}){const[i,a]=w.useState(),[o,u]=w.useState(),[h,m]=w.useState(!0),[f,p]=w.useState();w.useEffect(()=>{let _=!1;return m(!0),u(void 0),(async()=>{try{const y=await Yj(e,f);_||a(y)}catch(y){_||u(y instanceof Error?y.message:String(y))}finally{_||m(!1)}})(),()=>{_=!0}},[e,f]);function b(_){if(_.kind==="directory"){p(_.relativePath);return}_.supported&&s(_.relativePath)}function x(){if(!i||i.isRoot)return;const _=i.relativePath,y=_.includes("/")?_.slice(0,_.lastIndexOf("/")):"";p(y||void 0)}return l.jsx(Ti,{icon:l.jsx(Fh,{}),onClose:t,size:"lg",title:"Pick a config file",children:l.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[l.jsxs(re,{disabled:!i||i.isRoot,onClick:x,size:"sm",type:"button",variant:"outline",children:[l.jsx(Uh,{})," Up"]}),l.jsx("code",{className:"truncate rounded bg-muted px-2 py-1 font-mono",children:i?.relativePath||"./"})]}),o?l.jsx("div",{className:"text-red-600",children:o}):h?l.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):!i||i.entries.length===0?l.jsx("div",{className:"text-muted-foreground",children:"Empty directory."}):l.jsx("div",{className:"max-h-[50vh] overflow-auto rounded border border-border/60",children:l.jsx("ul",{className:"divide-y divide-border/40",children:i.entries.map(_=>{const y=_.kind==="directory",S=y||_.supported;return l.jsx("li",{children:l.jsxs("button",{className:de("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs",S?"hover:bg-muted":"cursor-not-allowed text-muted-foreground"),disabled:!S,onClick:()=>b(_),type:"button",children:[y?l.jsx(Ka,{size:14}):l.jsx(Rk,{size:14}),l.jsx("span",{className:"flex-1 truncate font-mono",children:_.name}),!y&&_.format?l.jsx($e,{size:"small",variant:"secondary",children:_.format}):null]})},_.relativePath)})})}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Only ",l.jsx("code",{children:".env*"}),", ",l.jsx("code",{children:"appsettings*.json"}),", and"," ",l.jsx("code",{children:"application*.yml"})," can be selected. Other files are shown disabled."]})]})})}function gN(e){if(!e.trim())return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function Fz(e){const{error:t,success:s}=Bs(),[i,a]=w.useState([]),[o,u]=w.useState(),[h,m]=w.useState(),[f,p]=w.useState(!0),[b,x]=w.useState(!1),[_,y]=w.useState(!1),[S,C]=w.useState(!1),[E,T]=w.useState();w.useEffect(()=>{let P=!1;return p(!0),T(void 0),(async()=>{try{const F=await Xj(e);if(P)return;a(F.files),F.files.length>0?u(K=>K??F.files[0].path):(u(void 0),m(void 0))}catch(F){P||T(F instanceof Error?F.message:String(F))}finally{P||p(!1)}})(),()=>{P=!0}},[e]);const N=w.useCallback(async P=>{x(!0),T(void 0);try{const F=await uy(e,P),K={path:F.path,relativePath:F.relativePath,format:F.format};F.format==="env"?m({info:K,exists:F.exists,rows:F.entries.map(Y=>({...Y,reveal:!1}))}):m({info:K,exists:F.exists,text:F.format==="json"?gN(F.content):F.content}),C(!1)}catch(F){T(F instanceof Error?F.message:String(F))}finally{x(!1)}},[e]);w.useEffect(()=>{o&&N(o)},[o,N]);function M(P,F){m(K=>{if(!K?.rows)return K;const Y=K.rows.map((Q,q)=>q===P?{...Q,...F}:Q);return{...K,rows:Y}}),C(!0)}function R(){m(P=>P?.rows?{...P,rows:[...P.rows,{key:"",value:"",secret:!1,reveal:!0}]}:P),C(!0)}function z(P){m(F=>F?.rows?{...F,rows:F.rows.filter((K,Y)=>Y!==P)}:F),C(!0)}function L(P){m(F=>F&&{...F,text:P}),C(!0)}async function j(){if(h){y(!0);try{if(h.info.format==="env"&&h.rows){const P=await Zj(e,h.info.path,h.rows.map(F=>({key:F.key.trim(),value:F.value})));m({info:{path:P.path,relativePath:P.relativePath,format:P.format},exists:P.exists,rows:P.entries.map(F=>({...F,reveal:!1}))}),s(`Saved ${P.entries.length} entries to ${P.relativePath}.`)}else if(h.text!==void 0){const P=await Qj(e,h.info.path,h.text);m({info:{path:P.path,relativePath:P.relativePath,format:P.format},exists:P.exists,text:P.content}),s(`Saved ${P.relativePath}.`)}C(!1)}catch(P){t(P instanceof Error?P.message:String(P))}finally{y(!1)}}}async function H(P){try{const F=await uy(e,P),K={path:F.path,relativePath:F.relativePath,format:F.format};return a(Y=>Y.some(Q=>Q.path===K.path)?Y:[...Y,K]),u(K.path),s(`Loaded ${K.relativePath}.`),!0}catch(F){return t(F instanceof Error?F.message:String(F)),!1}}return{files:i,selectedPath:o,setSelectedPath:u,loaded:h,loadingList:f,loadingFile:b,saving:_,dirty:S,error:E,addRow:R,removeRow:z,updateRow:M,updateText:L,save:j,pickFile:H}}function Vz({serviceName:e}){const{files:t,selectedPath:s,setSelectedPath:i,loaded:a,loadingList:o,loadingFile:u,saving:h,dirty:m,error:f,addRow:p,removeRow:b,updateRow:x,updateText:_,save:y,pickFile:S}=Fz(e),[C,E]=w.useState(!1),[T,N]=w.useState(!1);return o?l.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):f&&!a?l.jsx("div",{className:"text-red-600",children:f}):l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"text-muted-foreground",children:"File:"}),t.length>0?l.jsx("select",{className:"rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono text-xs",onChange:M=>i(M.target.value),value:s??"",children:t.map(M=>l.jsxs("option",{value:M.path,children:[M.relativePath," [",M.format,"]"]},M.path))}):l.jsx("span",{className:"text-muted-foreground",children:"none detected"}),l.jsxs(re,{onClick:()=>N(!0),size:"sm",type:"button",variant:"outline",children:[l.jsx(Fh,{})," Browse files"]}),a?l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono text-muted-foreground",children:a.info.path}):null]}),l.jsxs("div",{className:"flex items-center gap-1",children:[a?.info.format==="env"?l.jsxs(l.Fragment,{children:[l.jsxs(re,{onClick:()=>E(M=>!M),size:"sm",type:"button",variant:"outline",children:[C?l.jsx(Tk,{}):l.jsx(rb,{}),C?"Hide secrets":"Reveal secrets"]}),l.jsxs(re,{onClick:p,size:"sm",type:"button",variant:"outline",children:[l.jsx(mn,{})," Add"]})]}):null,l.jsxs(re,{disabled:!m||h||!a,onClick:y,size:"sm",type:"button",children:[l.jsx(Ik,{})," ",h?"Saving…":"Save"]})]})]}),f&&!a?l.jsx("div",{className:"text-red-600",children:f}):a?.info.format==="env"&&a.rows?l.jsx("div",{className:de(u&&"opacity-60 transition-opacity"),children:l.jsx(Hz,{revealAll:C,rows:a.rows,onAdd:p,onRemove:b,onUpdate:x})}):a?.text!==void 0?l.jsxs("div",{className:de("space-y-1",u&&"opacity-60 transition-opacity"),children:[a.info.format==="json"?l.jsx("div",{className:"flex justify-end",children:l.jsx(re,{onClick:()=>_(gN(a.text??"")),size:"sm",type:"button",variant:"outline",children:"Format JSON"})}):null,l.jsx("textarea",{className:"min-h-[300px] w-full rounded border border-border/60 bg-background p-2 font-mono text-[11px] leading-relaxed",onChange:M=>_(M.target.value),spellCheck:!1,value:a.text})]}):u?l.jsx("div",{className:"text-muted-foreground",children:"Loading file…"}):null,a?l.jsxs("p",{className:"text-muted-foreground",children:[a.info.format==="env"?"Comments and blank lines are preserved.":a.info.format==="json"?"JSON is validated on save.":"YAML is saved as raw text."," ","The running process won't see changes until you restart it."]}):null,T?l.jsx(Uz,{onClose:()=>N(!1),onPick:M=>{S(M).then(R=>{R&&N(!1)})},serviceName:e}):null]})}function qz({serviceName:e,status:t,timeline:s,onRefresh:i}){const{error:a,success:o}=Bs(),[u,h]=w.useState(!1),m=t?.inspector,f=t?.state==="running",p=w.useMemo(()=>s.filter(_=>_.kind==="service.http"&&_.service===e).map(_=>{const y=_.data??{};return{id:y.id??_.id,startedAt:_.timestamp,method:y.method??"?",path:y.path??"?",status:y.status??0,durationMs:y.durationMs??0,reqBytes:y.reqBytes??0,resBytes:y.resBytes??0}}).slice(-500).reverse(),[s,e]);async function b(_){h(!0);try{await pn(`/api/services/${encodeURIComponent(e)}/inspector`,{enabled:_?"true":"false"}),await i(),o(_?`HTTP inspector started for ${e}.`:`HTTP inspector stopped for ${e}.`)}catch(y){a(y instanceof Error?y.message:String(y))}finally{h(!1)}}if(!f)return l.jsx("div",{className:"text-muted-foreground",children:"Service is not running."});if(!m?.enabled)return l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-muted-foreground",children:"The HTTP inspector starts a local proxy that forwards traffic to this service and records every request. Hit the inspect URL instead of the original port to see requests appear here. The service itself is not touched."}),l.jsxs(re,{disabled:u,onClick:()=>b(!0),size:"sm",type:"button",children:[l.jsx(Vh,{})," Start HTTP inspector"]})]});const x=m.port?`http://127.0.0.1:${m.port}`:void 0;return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"text-muted-foreground",children:"Inspect URL:"}),x?l.jsxs(l.Fragment,{children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:x}),l.jsxs(re,{onClick:()=>{navigator.clipboard.writeText(x),o("Copied inspect URL.")},size:"sm",type:"button",variant:"outline",children:[l.jsx(zg,{})," Copy"]}),l.jsx(re,{onClick:()=>window.open(x,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",children:"Open"})]}):l.jsx("span",{className:"text-muted-foreground",children:"starting…"}),l.jsxs("span",{className:"text-muted-foreground",children:["→ upstream :",m.upstreamPort??"?"]}),l.jsxs(re,{disabled:u,onClick:()=>b(!1),size:"sm",type:"button",variant:"outline",children:[l.jsx(qh,{})," Stop"]})]}),p.length===0?l.jsx("div",{className:"text-muted-foreground",children:"No requests captured yet. Hit the inspect URL in your browser to see traffic."}):l.jsx("div",{className:"max-h-80 overflow-auto",children:l.jsxs("table",{className:"w-full font-mono text-[11px]",children:[l.jsx("thead",{className:"sticky top-0 bg-muted/60 text-left text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"py-1 pr-3",children:"Time"}),l.jsx("th",{className:"py-1 pr-3",children:"Method"}),l.jsx("th",{className:"py-1 pr-3",children:"Path"}),l.jsx("th",{className:"py-1 pr-3 text-right",children:"Status"}),l.jsx("th",{className:"py-1 pr-3 text-right",children:"Size"}),l.jsx("th",{className:"py-1 pr-3 text-right",children:"ms"})]})}),l.jsx("tbody",{children:p.map(_=>l.jsxs("tr",{className:"border-t border-border/40",children:[l.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:new Date(_.startedAt).toLocaleTimeString()}),l.jsx("td",{className:"py-1 pr-3",children:_.method}),l.jsx("td",{className:"py-1 pr-3 truncate max-w-[40ch]",children:_.path}),l.jsx("td",{className:de("py-1 pr-3 text-right",Gz(_.status)),children:_.status}),l.jsx("td",{className:"py-1 pr-3 text-right text-muted-foreground",children:Kz(_.resBytes)}),l.jsx("td",{className:"py-1 pr-3 text-right",children:_.durationMs.toFixed(1)})]},_.id))})]})})]})}function Gz(e){return e>=500?"text-red-600 dark:text-red-400":e>=400?"text-amber-600 dark:text-amber-400":e>=300?"text-zinc-500":e>=200?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground"}function Kz(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Wz({serviceName:e}){const[t,s]=w.useState(null),[i,a]=w.useState(null),[o,u]=w.useState(()=>Date.now());return w.useEffect(()=>{let h=!1;async function m(){try{const p=await Jj(e);h||(s(p),u(Date.now()),a(null))}catch(p){h||a(p instanceof Error?p.message:String(p))}}m();const f=setInterval(()=>{m()},3e3);return()=>{h=!0,clearInterval(f)}},[e]),i?l.jsxs("p",{className:"text-destructive",children:["Failed to load metrics: ",i]}):t?t.samples.length===0?l.jsx("p",{className:"text-muted-foreground",children:"No samples yet. Metrics start collecting once the service is running."}):l.jsx(Yz,{series:t,now:o}):l.jsx("p",{className:"text-muted-foreground",children:"Loading metrics…"})}function Yz({series:e,now:t}){const{samples:s}=e,i=w.useMemo(()=>ow(s,m=>m.cpu),[s]),a=w.useMemo(()=>ow(s,m=>m.rss),[s]),o=e.startedAt?new Date(e.startedAt):null,u=o?t-o.getTime():null,h=s.length>1?s[s.length-1].t-s[0].t:0;return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[l.jsx(Ud,{accent:"#22c55e",label:"CPU",value:`${i.last.toFixed(1)}%`,sub:`peak ${i.max.toFixed(1)}% · avg ${i.avg.toFixed(1)}%`}),l.jsx(Ud,{accent:"#3b82f6",label:"Memory",value:Bp(a.last),sub:`peak ${Bp(a.max)} · avg ${Bp(a.avg)}`}),l.jsx(Ud,{accent:"#a855f7",label:"Uptime",value:u!=null?uw(u):"—",sub:o?`since ${o.toLocaleTimeString()}`:"not running"}),l.jsx(Ud,{accent:"#f59e0b",label:"Samples",value:String(s.length),sub:h?`over ${uw(h)}`:"collecting…"})]}),l.jsx(cw,{label:"CPU",samples:s,pick:m=>m.cpu,summary:i,color:"#22c55e",suffix:"%",unit:"percent"}),l.jsx(cw,{label:"Memory (RSS)",samples:s,pick:m=>m.rss,summary:a,color:"#3b82f6",suffix:" MB",unit:"mb"})]})}function ow(e,t){const s=e.map(t),i=s.reduce((a,o)=>a+o,0);return{last:s[s.length-1],max:Math.max(...s),min:Math.min(...s),avg:i/s.length}}function Ud({accent:e,label:t,value:s,sub:i}){return l.jsxs("div",{className:"rounded-lg border border-border bg-card px-3 py-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:e}}),l.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:t})]}),l.jsx("div",{className:"mt-1 font-mono text-lg leading-none tabular-nums",children:s}),l.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:i})]})}const Po=160,lw=44,Xz=20;function cw({label:e,samples:t,pick:s,summary:i,color:a,suffix:o,unit:u}){const h=w.useMemo(()=>`metric-grad-${u}-${Math.random().toString(36).slice(2,8)}`,[u]),m=t.map(s),f=Math.max(...m,u==="percent"?10:1),p=Zz(f),b=0,x=p-b||1,_=t[0].t,y=t[t.length-1].t,S=Math.max(1,y-_),C=P=>(P-_)/S*1e3,E=P=>(1-(P-b)/x)*1e3,T=t.map(P=>`${C(P.t).toFixed(1)},${E(s(P)).toFixed(1)}`),N=`M0,1000 L${T.join(" L")} L1000,1000 Z`,M=`M${T.join(" L")}`,R=C(y),z=E(i.last),L=E(i.avg),j=[1,.75,.5,.25,0],H=5;return l.jsxs("figure",{className:"space-y-1",children:[l.jsxs("figcaption",{className:"flex items-baseline justify-between",children:[l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e}),l.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:["now ",l.jsxs("span",{className:"text-foreground",children:[i.last.toFixed(1),o]}),l.jsx("span",{className:"mx-1.5",children:"·"}),"peak ",i.max.toFixed(1),o,l.jsx("span",{className:"mx-1.5",children:"·"}),"avg ",i.avg.toFixed(1),o]})]}),l.jsxs("div",{className:"rounded-lg border border-border bg-card p-2",children:[l.jsxs("div",{className:"flex",children:[l.jsx("div",{className:"relative flex shrink-0 flex-col justify-between text-right font-mono text-[10px] text-muted-foreground",style:{width:lw,height:Po},children:j.map(P=>l.jsx("span",{className:"pr-1 leading-none",children:Qz(b+P*x,u)},P))}),l.jsxs("div",{className:"relative min-w-0 flex-1",style:{height:Po},children:[j.map((P,F)=>l.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-t border-border/40",style:{top:`${P===1?0:P===0?Po-1:(1-P)*Po}px`,borderStyle:F===j.length-1?"solid":"dashed"}},P)),l.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-t border-dashed",style:{top:`${L/1e3*Po}px`,borderColor:a,opacity:.4}}),l.jsxs("svg",{"aria-label":e,className:"absolute inset-0 h-full w-full",preserveAspectRatio:"none",role:"img",viewBox:"0 0 1000 1000",children:[l.jsx("defs",{children:l.jsxs("linearGradient",{id:h,x1:"0",x2:"0",y1:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.35}),l.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:.02})]})}),l.jsx("path",{d:N,fill:`url(#${h})`}),l.jsx("path",{d:M,fill:"none",stroke:a,strokeWidth:2,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round"})]}),l.jsx("span",{className:"pointer-events-none absolute z-10 block h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2 ring-card",style:{left:`${R/1e3*100}%`,top:`${z/1e3*Po}px`,backgroundColor:a,boxShadow:`0 0 0 4px ${a}33`}})]})]}),l.jsx("div",{className:"flex font-mono text-[10px] text-muted-foreground",style:{height:Xz,paddingLeft:lw},children:l.jsx("div",{className:"relative flex-1",children:Array.from({length:H+1},(P,F)=>{const K=F/H,Y=_+K*S;return l.jsx("span",{className:"absolute top-1 whitespace-nowrap",style:{left:`${K*100}%`,transform:F===0?"translateX(0)":F===H?"translateX(-100%)":"translateX(-50%)"},children:Jz(Y-y)},F)})})})]})]})}function Zz(e){if(e<=1)return 1;const t=Math.pow(10,Math.floor(Math.log10(e))),s=e/t;return(s<=1?1:s<=2?2:s<=5?5:10)*t}function Qz(e,t){return t==="percent"?`${e.toFixed(0)}%`:e>=1024?`${(e/1024).toFixed(1)}G`:`${e.toFixed(0)}M`}function Bp(e){return e>=1024?`${(e/1024).toFixed(2)} GB`:`${e.toFixed(0)} MB`}function uw(e){const t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;const s=Math.floor(t/60);if(s<60)return`${s}m ${t%60}s`;const i=Math.floor(s/60);return i<24?`${i}h ${s%60}m`:`${Math.floor(i/24)}d ${i%24}h`}function Jz(e){const t=Math.round(e/1e3);if(t===0)return"now";if(Math.abs(t)<60)return`${t}s`;const i=Math.round(t/60);return Math.abs(i)<60?`${i}m`:`${Math.round(i/60)}h`}function eI({rows:e}){if(e.length===0)return l.jsx("div",{className:"text-muted-foreground",children:"No process tree (service not running)."});const t=[...e].sort((i,a)=>a.cpuPercent-i.cpuPercent),s=new Set(e.map(i=>i.pid));return l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full font-mono text-[11px]",children:[l.jsx("thead",{className:"text-left text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"py-1 pr-3",children:"PID"}),l.jsx("th",{className:"py-1 pr-3",children:"PPID"}),l.jsx("th",{className:"py-1 pr-3 text-right",children:"CPU%"}),l.jsx("th",{className:"py-1 pr-3 text-right",children:"RSS MB"}),l.jsx("th",{className:"py-1",children:"Command"})]})}),l.jsx("tbody",{children:t.map(i=>{const a=s.has(i.ppid);return l.jsxs("tr",{className:"border-t border-border/40",children:[l.jsx("td",{className:"py-1 pr-3",children:i.pid}),l.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:i.ppid}),l.jsx("td",{className:"py-1 pr-3 text-right",children:i.cpuPercent.toFixed(1)}),l.jsx("td",{className:"py-1 pr-3 text-right",children:i.rssMb.toFixed(1)}),l.jsx("td",{className:de("py-1 truncate max-w-[60ch]",a&&"pl-4"),children:i.command})]},i.pid)})})]})})}var tI=2,sI=1,nI=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,s=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(s.getPropertyValue("height")),a=Math.max(0,parseInt(s.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),u={top:parseInt(o.getPropertyValue("padding-top")),bottom:parseInt(o.getPropertyValue("padding-bottom")),right:parseInt(o.getPropertyValue("padding-right")),left:parseInt(o.getPropertyValue("padding-left"))},h=u.top+u.bottom,m=u.right+u.left,f=i-h,p=a-m-t;return{cols:Math.max(tI,Math.floor(p/e.css.cell.width)),rows:Math.max(sI,Math.floor(f/e.css.cell.height))}}};var bN=Object.defineProperty,iI=Object.getOwnPropertyDescriptor,rI=(e,t)=>{for(var s in t)bN(e,s,{get:t[s],enumerable:!0})},Vt=(e,t,s,i)=>{for(var a=i>1?void 0:i?iI(t,s):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=(i?u(t,s,a):u(a))||a);return i&&a&&bN(t,s,a),a},Se=(e,t)=>(s,i)=>t(s,i,e),dw="Terminal input",m0={get:()=>dw,set:e=>dw=e},hw="Too much output to announce, navigate to rows manually to read",p0={get:()=>hw,set:e=>hw=e};function aI(e){return e.replace(/\r?\n/g,"\r")}function oI(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function lI(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function cI(e,t,s,i){if(e.stopPropagation(),e.clipboardData){let a=e.clipboardData.getData("text/plain");vN(a,t,s,i)}}function vN(e,t,s,i){e=aI(e),e=oI(e,s.decPrivateModes.bracketedPasteMode&&i.rawOptions.ignoreBracketedPasteMode!==!0),s.triggerDataEvent(e,!0),t.value=""}function xN(e,t,s){let i=s.getBoundingClientRect(),a=e.clientX-i.left-10,o=e.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${a}px`,t.style.top=`${o}px`,t.style.zIndex="1000",t.focus()}function fw(e,t,s,i,a){xN(e,t,s),a&&i.rightClickSelect(e),t.value=i.selectionText,t.select()}function Xr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Jh(e,t=0,s=e.length){let i="";for(let a=t;a<s;++a){let o=e[a];o>65535?(o-=65536,i+=String.fromCharCode((o>>10)+55296)+String.fromCharCode(o%1024+56320)):i+=String.fromCharCode(o)}return i}var uI=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let s=e.length;if(!s)return 0;let i=0,a=0;if(this._interim){let o=e.charCodeAt(a++);56320<=o&&o<=57343?t[i++]=(this._interim-55296)*1024+o-56320+65536:(t[i++]=this._interim,t[i++]=o),this._interim=0}for(let o=a;o<s;++o){let u=e.charCodeAt(o);if(55296<=u&&u<=56319){if(++o>=s)return this._interim=u,i;let h=e.charCodeAt(o);56320<=h&&h<=57343?t[i++]=(u-55296)*1024+h-56320+65536:(t[i++]=u,t[i++]=h);continue}u!==65279&&(t[i++]=u)}return i}},dI=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let s=e.length;if(!s)return 0;let i=0,a,o,u,h,m=0,f=0;if(this.interim[0]){let x=!1,_=this.interim[0];_&=(_&224)===192?31:(_&240)===224?15:7;let y=0,S;for(;(S=this.interim[++y]&63)&&y<4;)_<<=6,_|=S;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,E=C-y;for(;f<E;){if(f>=s)return 0;if(S=e[f++],(S&192)!==128){f--,x=!0;break}else this.interim[y++]=S,_<<=6,_|=S&63}x||(C===2?_<128?f--:t[i++]=_:C===3?_<2048||_>=55296&&_<=57343||_===65279||(t[i++]=_):_<65536||_>1114111||(t[i++]=_)),this.interim.fill(0)}let p=s-4,b=f;for(;b<s;){for(;b<p&&!((a=e[b])&128)&&!((o=e[b+1])&128)&&!((u=e[b+2])&128)&&!((h=e[b+3])&128);)t[i++]=a,t[i++]=o,t[i++]=u,t[i++]=h,b+=4;if(a=e[b++],a<128)t[i++]=a;else if((a&224)===192){if(b>=s)return this.interim[0]=a,i;if(o=e[b++],(o&192)!==128){b--;continue}if(m=(a&31)<<6|o&63,m<128){b--;continue}t[i++]=m}else if((a&240)===224){if(b>=s)return this.interim[0]=a,i;if(o=e[b++],(o&192)!==128){b--;continue}if(b>=s)return this.interim[0]=a,this.interim[1]=o,i;if(u=e[b++],(u&192)!==128){b--;continue}if(m=(a&15)<<12|(o&63)<<6|u&63,m<2048||m>=55296&&m<=57343||m===65279)continue;t[i++]=m}else if((a&248)===240){if(b>=s)return this.interim[0]=a,i;if(o=e[b++],(o&192)!==128){b--;continue}if(b>=s)return this.interim[0]=a,this.interim[1]=o,i;if(u=e[b++],(u&192)!==128){b--;continue}if(b>=s)return this.interim[0]=a,this.interim[1]=o,this.interim[2]=u,i;if(h=e[b++],(h&192)!==128){b--;continue}if(m=(a&7)<<18|(o&63)<<12|(u&63)<<6|h&63,m<65536||m>1114111)continue;t[i++]=m}}return i}},_N="",Qr=" ",uu=class yN{constructor(){this.fg=0,this.bg=0,this.extended=new jh}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new yN;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},jh=class SN{constructor(t=0,s=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=s}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new SN(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Kn=class wN extends uu{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new jh,this.combinedData=""}static fromCharData(t){let s=new wN;return s.setFromCharData(t),s}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Xr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let s=!1;if(t[1].length>2)s=!0;else if(t[1].length===2){let i=t[1].charCodeAt(0);if(55296<=i&&i<=56319){let a=t[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(i-55296)*1024+a-56320+65536|t[2]<<22:s=!0}else s=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;s&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},mw="di$target",g0="di$dependencies",zp=new Map;function hI(e){return e[g0]||[]}function Ss(e){if(zp.has(e))return zp.get(e);let t=function(s,i,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");fI(t,s,a)};return t._id=e,zp.set(e,t),t}function fI(e,t,s){t[mw]===t?t[g0].push({id:e,index:s}):(t[g0]=[{id:e,index:s}],t[mw]=t)}var en=Ss("BufferService"),kN=Ss("CoreMouseService"),Za=Ss("CoreService"),mI=Ss("CharsetService"),tv=Ss("InstantiationService"),CN=Ss("LogService"),tn=Ss("OptionsService"),EN=Ss("OscLinkService"),pI=Ss("UnicodeService"),du=Ss("DecorationService"),b0=class{constructor(e,t,s){this._bufferService=e,this._optionsService=t,this._oscLinkService=s}provideLinks(e,t){let s=this._bufferService.buffer.lines.get(e-1);if(!s){t(void 0);return}let i=[],a=this._optionsService.rawOptions.linkHandler,o=new Kn,u=s.getTrimmedLength(),h=-1,m=-1,f=!1;for(let p=0;p<u;p++)if(!(m===-1&&!s.hasContent(p))){if(s.loadCell(p,o),o.hasExtendedAttrs()&&o.extended.urlId)if(m===-1){m=p,h=o.extended.urlId;continue}else f=o.extended.urlId!==h;else m!==-1&&(f=!0);if(f||m!==-1&&p===u-1){let b=this._oscLinkService.getLinkData(h)?.uri;if(b){let x={start:{x:m+1,y:e},end:{x:p+(!f&&p===u-1?1:0),y:e}},_=!1;if(!a?.allowNonHttpProtocols)try{let y=new URL(b);["http:","https:"].includes(y.protocol)||(_=!0)}catch{_=!0}_||i.push({text:b,range:x,activate:(y,S)=>a?a.activate(y,S,x):gI(y,S),hover:(y,S)=>a?.hover?.(y,S,x),leave:(y,S)=>a?.leave?.(y,S,x)})}f=!1,o.hasExtendedAttrs()&&o.extended.urlId?(m=p,h=o.extended.urlId):(m=-1,h=-1)}}t(i)}};b0=Vt([Se(0,en),Se(1,tn),Se(2,EN)],b0);function gI(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
139
|
-
|
|
140
|
-
WARNING: This link could potentially be dangerous`)){let s=window.open();if(s){try{s.opener=null}catch{}s.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var ef=Ss("CharSizeService"),hr=Ss("CoreBrowserService"),sv=Ss("MouseService"),fr=Ss("RenderService"),bI=Ss("SelectionService"),NN=Ss("CharacterJoinerService"),dl=Ss("ThemeService"),TN=Ss("LinkProviderService"),vI=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?pw.isErrorNoTelemetry(e)?new pw(e.message+`
|
|
141
|
-
|
|
142
|
-
`+e.stack):new Error(e.message+`
|
|
143
|
-
|
|
144
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},xI=new vI;function ih(e){_I(e)||xI.onUnexpectedError(e)}var v0="Canceled";function _I(e){return e instanceof yI?!0:e instanceof Error&&e.name===v0&&e.message===v0}var yI=class extends Error{constructor(){super(v0),this.name=this.message}};function SI(e){return new Error(`Illegal argument: ${e}`)}var pw=class x0 extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof x0)return t;let s=new x0;return s.message=t.message,s.stack=t.stack,s}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},_0=class AN extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,AN.prototype)}};function En(e,t=0){return e[e.length-(1+t)]}var wI;(e=>{function t(o){return o<0}e.isLessThan=t;function s(o){return o<=0}e.isLessThanOrEqual=s;function i(o){return o>0}e.isGreaterThan=i;function a(o){return o===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(wI||={});function kI(e,t){let s=this,i=!1,a;return function(){return i||(i=!0,t||(a=e.apply(s,arguments))),a}}var MN;(e=>{function t(M){return M&&typeof M=="object"&&typeof M[Symbol.iterator]=="function"}e.is=t;let s=Object.freeze([]);function i(){return s}e.empty=i;function*a(M){yield M}e.single=a;function o(M){return t(M)?M:a(M)}e.wrap=o;function u(M){return M||s}e.from=u;function*h(M){for(let R=M.length-1;R>=0;R--)yield M[R]}e.reverse=h;function m(M){return!M||M[Symbol.iterator]().next().done===!0}e.isEmpty=m;function f(M){return M[Symbol.iterator]().next().value}e.first=f;function p(M,R){let z=0;for(let L of M)if(R(L,z++))return!0;return!1}e.some=p;function b(M,R){for(let z of M)if(R(z))return z}e.find=b;function*x(M,R){for(let z of M)R(z)&&(yield z)}e.filter=x;function*_(M,R){let z=0;for(let L of M)yield R(L,z++)}e.map=_;function*y(M,R){let z=0;for(let L of M)yield*R(L,z++)}e.flatMap=y;function*S(...M){for(let R of M)yield*R}e.concat=S;function C(M,R,z){let L=z;for(let j of M)L=R(L,j);return L}e.reduce=C;function*E(M,R,z=M.length){for(R<0&&(R+=M.length),z<0?z+=M.length:z>M.length&&(z=M.length);R<z;R++)yield M[R]}e.slice=E;function T(M,R=Number.POSITIVE_INFINITY){let z=[];if(R===0)return[z,M];let L=M[Symbol.iterator]();for(let j=0;j<R;j++){let H=L.next();if(H.done)return[z,e.empty()];z.push(H.value)}return[z,{[Symbol.iterator](){return L}}]}e.consume=T;async function N(M){let R=[];for await(let z of M)R.push(z);return Promise.resolve(R)}e.asyncToArray=N})(MN||={});function qa(e){if(MN.is(e)){let t=[];for(let s of e)if(s)try{s.dispose()}catch(i){t.push(i)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function CI(...e){return Ot(()=>qa(e))}function Ot(e){return{dispose:kI(()=>{e()})}}var jN=class RN{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{qa(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?RN.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};jN.DISABLE_DISPOSED_WARNING=!1;var Jr=jN,Ye=class{constructor(){this._store=new Jr,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ye.None=Object.freeze({dispose(){}});var sl=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},cr=typeof window=="object"?window:globalThis,y0=class S0{constructor(t){this.element=t,this.next=S0.Undefined,this.prev=S0.Undefined}};y0.Undefined=new y0(void 0);var It=y0,gw=class{constructor(){this._first=It.Undefined,this._last=It.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===It.Undefined}clear(){let e=this._first;for(;e!==It.Undefined;){let t=e.next;e.prev=It.Undefined,e.next=It.Undefined,e=t}this._first=It.Undefined,this._last=It.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let s=new It(e);if(this._first===It.Undefined)this._first=s,this._last=s;else if(t){let a=this._last;this._last=s,s.prev=a,a.next=s}else{let a=this._first;this._first=s,s.next=a,a.prev=s}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(s))}}shift(){if(this._first!==It.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==It.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==It.Undefined&&e.next!==It.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===It.Undefined&&e.next===It.Undefined?(this._first=It.Undefined,this._last=It.Undefined):e.next===It.Undefined?(this._last=this._last.prev,this._last.next=It.Undefined):e.prev===It.Undefined&&(this._first=this._first.next,this._first.prev=It.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==It.Undefined;)yield e.element,e=e.next}},EI=globalThis.performance&&typeof globalThis.performance.now=="function",NI=class DN{static create(t){return new DN(t)}constructor(t){this._now=EI&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},js;(e=>{e.None=()=>Ye.None;function t(K,Y){return b(K,()=>{},0,void 0,!0,void 0,Y)}e.defer=t;function s(K){return(Y,Q=null,q)=>{let O=!1,X;return X=K(Z=>{if(!O)return X?X.dispose():O=!0,Y.call(Q,Z)},null,q),O&&X.dispose(),X}}e.once=s;function i(K,Y,Q){return f((q,O=null,X)=>K(Z=>q.call(O,Y(Z)),null,X),Q)}e.map=i;function a(K,Y,Q){return f((q,O=null,X)=>K(Z=>{Y(Z),q.call(O,Z)},null,X),Q)}e.forEach=a;function o(K,Y,Q){return f((q,O=null,X)=>K(Z=>Y(Z)&&q.call(O,Z),null,X),Q)}e.filter=o;function u(K){return K}e.signal=u;function h(...K){return(Y,Q=null,q)=>{let O=CI(...K.map(X=>X(Z=>Y.call(Q,Z))));return p(O,q)}}e.any=h;function m(K,Y,Q,q){let O=Q;return i(K,X=>(O=Y(O,X),O),q)}e.reduce=m;function f(K,Y){let Q,q={onWillAddFirstListener(){Q=K(O.fire,O)},onDidRemoveLastListener(){Q?.dispose()}},O=new be(q);return Y?.add(O),O.event}function p(K,Y){return Y instanceof Array?Y.push(K):Y&&Y.add(K),K}function b(K,Y,Q=100,q=!1,O=!1,X,Z){let V,$,D,W=0,he,le={leakWarningThreshold:X,onWillAddFirstListener(){V=K(ne=>{W++,$=Y($,ne),q&&!D&&(me.fire($),$=void 0),he=()=>{let fe=$;$=void 0,D=void 0,(!q||W>1)&&me.fire(fe),W=0},typeof Q=="number"?(clearTimeout(D),D=setTimeout(he,Q)):D===void 0&&(D=0,queueMicrotask(he))})},onWillRemoveListener(){O&&W>0&&he?.()},onDidRemoveLastListener(){he=void 0,V.dispose()}},me=new be(le);return Z?.add(me),me.event}e.debounce=b;function x(K,Y=0,Q){return e.debounce(K,(q,O)=>q?(q.push(O),q):[O],Y,void 0,!0,void 0,Q)}e.accumulate=x;function _(K,Y=(q,O)=>q===O,Q){let q=!0,O;return o(K,X=>{let Z=q||!Y(X,O);return q=!1,O=X,Z},Q)}e.latch=_;function y(K,Y,Q){return[e.filter(K,Y,Q),e.filter(K,q=>!Y(q),Q)]}e.split=y;function S(K,Y=!1,Q=[],q){let O=Q.slice(),X=K($=>{O?O.push($):V.fire($)});q&&q.add(X);let Z=()=>{O?.forEach($=>V.fire($)),O=null},V=new be({onWillAddFirstListener(){X||(X=K($=>V.fire($)),q&&q.add(X))},onDidAddFirstListener(){O&&(Y?setTimeout(Z):Z())},onDidRemoveLastListener(){X&&X.dispose(),X=null}});return q&&q.add(V),V.event}e.buffer=S;function C(K,Y){return(Q,q,O)=>{let X=Y(new T);return K(function(Z){let V=X.evaluate(Z);V!==E&&Q.call(q,V)},void 0,O)}}e.chain=C;let E=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(Y){return this.steps.push(Y),this}forEach(Y){return this.steps.push(Q=>(Y(Q),Q)),this}filter(Y){return this.steps.push(Q=>Y(Q)?Q:E),this}reduce(Y,Q){let q=Q;return this.steps.push(O=>(q=Y(q,O),q)),this}latch(Y=(Q,q)=>Q===q){let Q=!0,q;return this.steps.push(O=>{let X=Q||!Y(O,q);return Q=!1,q=O,X?O:E}),this}evaluate(Y){for(let Q of this.steps)if(Y=Q(Y),Y===E)break;return Y}}function N(K,Y,Q=q=>q){let q=(...V)=>Z.fire(Q(...V)),O=()=>K.on(Y,q),X=()=>K.removeListener(Y,q),Z=new be({onWillAddFirstListener:O,onDidRemoveLastListener:X});return Z.event}e.fromNodeEventEmitter=N;function M(K,Y,Q=q=>q){let q=(...V)=>Z.fire(Q(...V)),O=()=>K.addEventListener(Y,q),X=()=>K.removeEventListener(Y,q),Z=new be({onWillAddFirstListener:O,onDidRemoveLastListener:X});return Z.event}e.fromDOMEventEmitter=M;function R(K){return new Promise(Y=>s(K)(Y))}e.toPromise=R;function z(K){let Y=new be;return K.then(Q=>{Y.fire(Q)},()=>{Y.fire(void 0)}).finally(()=>{Y.dispose()}),Y.event}e.fromPromise=z;function L(K,Y){return K(Q=>Y.fire(Q))}e.forward=L;function j(K,Y,Q){return Y(Q),K(q=>Y(q))}e.runAndSubscribe=j;class H{constructor(Y,Q){this._observable=Y,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:()=>{Y.addObserver(this)},onDidRemoveLastListener:()=>{Y.removeObserver(this)}};this.emitter=new be(q),Q&&Q.add(this.emitter)}beginUpdate(Y){this._counter++}handlePossibleChange(Y){}handleChange(Y,Q){this._hasChanged=!0}endUpdate(Y){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(K,Y){return new H(K,Y).emitter.event}e.fromObservable=P;function F(K){return(Y,Q,q)=>{let O=0,X=!1,Z={beginUpdate(){O++},endUpdate(){O--,O===0&&(K.reportChanges(),X&&(X=!1,Y.call(Q)))},handlePossibleChange(){},handleChange(){X=!0}};K.addObserver(Z),K.reportChanges();let V={dispose(){K.removeObserver(Z)}};return q instanceof Jr?q.add(V):Array.isArray(q)&&q.push(V),V}}e.fromObservableLight=F})(js||={});var w0=class k0{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${k0._idPool++}`,k0.all.add(this)}start(t){this._stopWatch=new NI,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};w0.all=new Set,w0._idPool=0;var TI=w0,AI=-1,ON=class LN{constructor(t,s,i=(LN._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=s,this.name=i,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,s){let i=this.threshold;if(i<=0||s<i)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let[o,u]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${s} listeners already. MOST frequent listener (${u}):`;console.warn(h),console.warn(o);let m=new RI(h,o);this._errorHandler(m)}return()=>{let o=this._stacks.get(t.value)||0;this._stacks.set(t.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,s=0;for(let[i,a]of this._stacks)(!t||s<a)&&(t=[i,a],s=a);return t}};ON._idPool=1;var MI=ON,jI=class BN{constructor(t){this.value=t}static create(){let t=new Error;return new BN(t.stack??"")}print(){console.warn(this.value.split(`
|
|
145
|
-
`).slice(2).join(`
|
|
146
|
-
`))}},RI=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},DI=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},OI=0,Ip=class{constructor(e){this.value=e,this.id=OI++}},LI=2,BI,be=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new MI(e?.onListenerError??ih,this._options?.leakWarningThreshold??AI):void 0,this._perfMon=this._options?._profName?new TI(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,s)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let h=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],m=new DI(`${u}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||ih)(m),Ye.None}if(this._disposed)return Ye.None;t&&(e=e.bind(t));let i=new Ip(e),a;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=jI.create(),a=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof Ip?(this._deliveryQueue??=new zI,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=Ot(()=>{a?.(),this._removeListener(i)});return s instanceof Jr?s.add(o):Array.isArray(s)&&s.push(o),o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,s=t.indexOf(e);if(s===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[s]=void 0;let i=this._deliveryQueue.current===this;if(this._size*LI<=t.length){let a=0;for(let o=0;o<t.length;o++)t[o]?t[a++]=t[o]:i&&(this._deliveryQueue.end--,a<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=a}}_deliver(e,t){if(!e)return;let s=this._options?.onListenerError||ih;if(!s){e.value(t);return}try{e.value(t)}catch(i){s(i)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Ip)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},zI=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,s){this.i=0,this.end=s,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},C0=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new be,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new be,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,s){if(this.getZoomLevel(s)===t)return;let i=this.getWindowId(s);this.mapWindowIdToZoomLevel.set(i,t),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,s){this.mapWindowIdToZoomFactor.set(this.getWindowId(s),t)}setFullscreen(t,s){if(this.isFullscreen(s)===t)return;let i=this.getWindowId(s);this.mapWindowIdToFullScreen.set(i,t),this._onDidChangeFullscreen.fire(i)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};C0.INSTANCE=new C0;var nv=C0;function II(e,t,s){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",s)}nv.INSTANCE.onDidChangeZoomLevel;function PI(e){return nv.INSTANCE.getZoomFactor(e)}nv.INSTANCE.onDidChangeFullscreen;var hl=typeof navigator=="object"?navigator.userAgent:"",E0=hl.indexOf("Firefox")>=0,$I=hl.indexOf("AppleWebKit")>=0,iv=hl.indexOf("Chrome")>=0,HI=!iv&&hl.indexOf("Safari")>=0;hl.indexOf("Electron/")>=0;hl.indexOf("Android")>=0;var Pp=!1;if(typeof cr.matchMedia=="function"){let e=cr.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=cr.matchMedia("(display-mode: fullscreen)");Pp=e.matches,II(cr,e,({matches:s})=>{Pp&&t.matches||(Pp=s)})}var Yo="en",N0=!1,T0=!1,rh=!1,zN=!1,Fd,ah=Yo,bw=Yo,UI,lr,Ua=globalThis,Tn;typeof Ua.vscode<"u"&&typeof Ua.vscode.process<"u"?Tn=Ua.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Tn=process);var FI=typeof Tn?.versions?.electron=="string",VI=FI&&Tn?.type==="renderer";if(typeof Tn=="object"){N0=Tn.platform==="win32",T0=Tn.platform==="darwin",rh=Tn.platform==="linux",rh&&Tn.env.SNAP&&Tn.env.SNAP_REVISION,Tn.env.CI||Tn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Fd=Yo,ah=Yo;let e=Tn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Fd=t.userLocale,bw=t.osLocale,ah=t.resolvedLanguage||Yo,UI=t.languagePack?.translationsConfigFile}catch{}zN=!0}else typeof navigator=="object"&&!VI?(lr=navigator.userAgent,N0=lr.indexOf("Windows")>=0,T0=lr.indexOf("Macintosh")>=0,(lr.indexOf("Macintosh")>=0||lr.indexOf("iPad")>=0||lr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,rh=lr.indexOf("Linux")>=0,lr?.indexOf("Mobi")>=0,ah=globalThis._VSCODE_NLS_LANGUAGE||Yo,Fd=navigator.language.toLowerCase(),bw=Fd):console.error("Unable to resolve platform.");var IN=N0,Ci=T0,qI=rh,vw=zN,Ai=lr,Gr=ah,GI;(e=>{function t(){return Gr}e.value=t;function s(){return Gr.length===2?Gr==="en":Gr.length>=3?Gr[0]==="e"&&Gr[1]==="n"&&Gr[2]==="-":!1}e.isDefaultVariant=s;function i(){return Gr==="en"}e.isDefault=i})(GI||={});var KI=typeof Ua.postMessage=="function"&&!Ua.importScripts;(()=>{if(KI){let e=[];Ua.addEventListener("message",s=>{if(s.data&&s.data.vscodeScheduleAsyncWork)for(let i=0,a=e.length;i<a;i++){let o=e[i];if(o.id===s.data.vscodeScheduleAsyncWork){e.splice(i,1),o.callback();return}}});let t=0;return s=>{let i=++t;e.push({id:i,callback:s}),Ua.postMessage({vscodeScheduleAsyncWork:i},"*")}}return e=>setTimeout(e)})();var WI=!!(Ai&&Ai.indexOf("Chrome")>=0);Ai&&Ai.indexOf("Firefox")>=0;!WI&&Ai&&Ai.indexOf("Safari")>=0;Ai&&Ai.indexOf("Edg/")>=0;Ai&&Ai.indexOf("Android")>=0;var $o=typeof navigator=="object"?navigator:{};vw||document.queryCommandSupported&&document.queryCommandSupported("copy")||$o&&$o.clipboard&&$o.clipboard.writeText,vw||$o&&$o.clipboard&&$o.clipboard.readText;var rv=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},$p=new rv,xw=new rv,_w=new rv,YI=new Array(230),PN;(e=>{function t(h){return $p.keyCodeToStr(h)}e.toString=t;function s(h){return $p.strToKeyCode(h)}e.fromString=s;function i(h){return xw.keyCodeToStr(h)}e.toUserSettingsUS=i;function a(h){return _w.keyCodeToStr(h)}e.toUserSettingsGeneral=a;function o(h){return xw.strToKeyCode(h)||_w.strToKeyCode(h)}e.fromUserSettings=o;function u(h){if(h>=98&&h<=113)return null;switch(h){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return $p.keyCodeToStr(h)}e.toElectronAccelerator=u})(PN||={});var XI=class $N{constructor(t,s,i,a,o){this.ctrlKey=t,this.shiftKey=s,this.altKey=i,this.metaKey=a,this.keyCode=o}equals(t){return t instanceof $N&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",s=this.shiftKey?"1":"0",i=this.altKey?"1":"0",a=this.metaKey?"1":"0";return`K${t}${s}${i}${a}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new ZI([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},ZI=class{constructor(e){if(e.length===0)throw SI("chords");this.chords=e}getHashCode(){let e="";for(let t=0,s=this.chords.length;t<s;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function QI(e){if(e.charCode){let s=String.fromCharCode(e.charCode).toUpperCase();return PN.fromString(s)}let t=e.keyCode;if(t===3)return 7;if(E0)switch(t){case 59:return 85;case 60:if(qI)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ci)return 57;break}else if($I&&(Ci&&t===93||!Ci&&t===92))return 57;return YI[t]||0}var JI=Ci?256:2048,eP=512,tP=1024,sP=Ci?2048:256,yw=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.("AltGraph"),this.keyCode=QI(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=JI),this.altKey&&(t|=eP),this.shiftKey&&(t|=tP),this.metaKey&&(t|=sP),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new XI(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Sw=new WeakMap;function nP(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,s=e.parent.location;if(t.origin!=="null"&&s.origin!=="null"&&t.origin!==s.origin)return null}catch{return null}return e.parent}var iP=class{static getSameOriginWindowChain(e){let t=Sw.get(e);if(!t){t=[],Sw.set(e,t);let s=e,i;do i=nP(s),i?t.push({window:new WeakRef(s),iframeElement:s.frameElement||null}):t.push({window:new WeakRef(s),iframeElement:null}),s=i;while(s)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let s=0,i=0,a=this.getSameOriginWindowChain(e);for(let o of a){let u=o.window.deref();if(s+=u?.scrollY??0,i+=u?.scrollX??0,u===t||!o.iframeElement)break;let h=o.iframeElement.getBoundingClientRect();s+=h.top,i+=h.left}return{top:s,left:i}}},Vd=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let s=iP.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=s.left,this.posy-=s.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},ww=class{constructor(e,t=0,s=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=s,this.deltaX=t;let i=!1;if(iv){let a=navigator.userAgent.match(/Chrome\/(\d+)/);i=(a?parseInt(a[1]):123)<=122}if(e){let a=e,o=e,u=e.view?.devicePixelRatio||1;if(typeof a.wheelDeltaY<"u")i?this.deltaY=a.wheelDeltaY/(120*u):this.deltaY=a.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?E0&&!Ci?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")HI&&IN?this.deltaX=-(a.wheelDeltaX/120):i?this.deltaX=a.wheelDeltaX/(120*u):this.deltaX=a.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?E0&&!Ci?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(i?this.deltaY=e.wheelDelta/(120*u):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},HN=Object.freeze(function(e,t){let s=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(s)}}}),rP;(e=>{function t(s){return s===e.None||s===e.Cancelled||s instanceof aP?!0:!s||typeof s!="object"?!1:typeof s.isCancellationRequested=="boolean"&&typeof s.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:js.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:HN})})(rP||={});var aP=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?HN:(this._emitter||(this._emitter=new be),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},av=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new _0("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new _0("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},oP=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,s=globalThis){if(this.isDisposed)throw new _0("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let i=s.setInterval(()=>{e()},t);this.disposable=Ot(()=>{s.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},lP;(e=>{async function t(i){let a,o=await Promise.all(i.map(u=>u.then(h=>h,h=>{a||(a=h)})));if(typeof a<"u")throw a;return o}e.settled=t;function s(i){return new Promise(async(a,o)=>{try{await i(a,o)}catch(u){o(u)}})}e.withAsyncBody=s})(lP||={});var kw=class Un{static fromArray(t){return new Un(s=>{s.emitMany(t)})}static fromPromise(t){return new Un(async s=>{s.emitMany(await t)})}static fromPromises(t){return new Un(async s=>{await Promise.all(t.map(async i=>s.emitOne(await i)))})}static merge(t){return new Un(async s=>{await Promise.all(t.map(async i=>{for await(let a of i)s.emitOne(a)}))})}constructor(t,s){this._state=0,this._results=[],this._error=null,this._onReturn=s,this._onStateChanged=new be,queueMicrotask(async()=>{let i={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(t(i)),this.resolve()}catch(a){this.reject(a)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await js.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,s){return new Un(async i=>{for await(let a of t)i.emitOne(s(a))})}map(t){return Un.map(this,t)}static filter(t,s){return new Un(async i=>{for await(let a of t)s(a)&&i.emitOne(a)})}filter(t){return Un.filter(this,t)}static coalesce(t){return Un.filter(t,s=>!!s)}coalesce(){return Un.coalesce(this)}static async toPromise(t){let s=[];for await(let i of t)s.push(i);return s}toPromise(){return Un.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};kw.EMPTY=kw.fromArray([]);var{getWindow:wi,getWindowId:cP,onDidRegisterWindow:uP}=(function(){let e=new Map,t={window:cr,disposables:new Jr};e.set(cr.vscodeWindowId,t);let s=new be,i=new be,a=new be;function o(u,h){return(typeof u=="number"?e.get(u):void 0)??(h?t:void 0)}return{onDidRegisterWindow:s.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:i.event,registerWindow(u){if(e.has(u.vscodeWindowId))return Ye.None;let h=new Jr,m={window:u,disposables:h.add(new Jr)};return e.set(u.vscodeWindowId,m),h.add(Ot(()=>{e.delete(u.vscodeWindowId),i.fire(u)})),h.add(Ue(u,vs.BEFORE_UNLOAD,()=>{a.fire(u)})),s.fire(m),h},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return e.has(u)},getWindowById:o,getWindow(u){let h=u;if(h?.ownerDocument?.defaultView)return h.ownerDocument.defaultView.window;let m=u;return m?.view?m.view.window:cr},getDocument(u){return wi(u).document}}})(),dP=class{constructor(e,t,s,i){this._node=e,this._type=t,this._handler=s,this._options=i||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Ue(e,t,s,i){return new dP(e,t,s,i)}var Cw=function(e,t,s,i){return Ue(e,t,s,i)},ov,hP=class extends oP{constructor(e){super(),this.defaultTarget=e&&wi(e)}cancelAndSet(e,t,s){return super.cancelAndSet(e,t,s??this.defaultTarget)}},Ew=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){ih(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,s=new Map,i=new Map,a=o=>{s.set(o,!1);let u=e.get(o)??[];for(t.set(o,u),e.set(o,[]),i.set(o,!0);u.length>0;)u.sort(Ew.sort),u.shift().execute();i.set(o,!1)};ov=(o,u,h=0)=>{let m=cP(o),f=new Ew(u,h),p=e.get(m);return p||(p=[],e.set(m,p)),p.push(f),s.get(m)||(s.set(m,!0),o.requestAnimationFrame(()=>a(m))),f}})();function fP(e){let t=e.getBoundingClientRect(),s=wi(e);return{left:t.left+s.scrollX,top:t.top+s.scrollY,width:t.width,height:t.height}}var vs={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},mP=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=hn(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=hn(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=hn(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=hn(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=hn(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=hn(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=hn(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=hn(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=hn(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=hn(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=hn(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=hn(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=hn(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=hn(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function hn(e){return typeof e=="number"?`${e}px`:e}function zc(e){return new mP(e)}var UN=class{constructor(){this._hooks=new Jr,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let s=this._onStopCallback;this._onStopCallback=null,e&&s&&s(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,s,i,a){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=i,this._onStopCallback=a;let o=e;try{e.setPointerCapture(t),this._hooks.add(Ot(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=wi(e)}this._hooks.add(Ue(o,vs.POINTER_MOVE,u=>{if(u.buttons!==s){this.stopMonitoring(!0);return}u.preventDefault(),this._pointerMoveCallback(u)})),this._hooks.add(Ue(o,vs.POINTER_UP,u=>this.stopMonitoring(!0)))}};function pP(e,t,s){let i=null,a=null;if(typeof s.value=="function"?(i="value",a=s.value,a.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof s.get=="function"&&(i="get",a=s.get),!a)throw new Error("not supported");let o=`$memoize$${t}`;s[i]=function(...u){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,u)}),this[o]}}var _i;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(_i||={});var Cc=class Hs extends Ye{constructor(){super(),this.dispatched=!1,this.targets=new gw,this.ignoreTargets=new gw,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(js.runAndSubscribe(uP,({window:t,disposables:s})=>{s.add(Ue(t.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),s.add(Ue(t.document,"touchend",i=>this.onTouchEnd(t,i))),s.add(Ue(t.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:cr,disposables:this._store}))}static addTarget(t){if(!Hs.isTouchDevice())return Ye.None;Hs.INSTANCE||(Hs.INSTANCE=new Hs);let s=Hs.INSTANCE.targets.push(t);return Ot(s)}static ignoreTarget(t){if(!Hs.isTouchDevice())return Ye.None;Hs.INSTANCE||(Hs.INSTANCE=new Hs);let s=Hs.INSTANCE.ignoreTargets.push(t);return Ot(s)}static isTouchDevice(){return"ontouchstart"in cr||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let s=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,a=t.targetTouches.length;i<a;i++){let o=t.targetTouches.item(i);this.activeTouches[o.identifier]={id:o.identifier,initialTarget:o.target,initialTimeStamp:s,initialPageX:o.pageX,initialPageY:o.pageY,rollingTimestamps:[s],rollingPageX:[o.pageX],rollingPageY:[o.pageY]};let u=this.newGestureEvent(_i.Start,o.target);u.pageX=o.pageX,u.pageY=o.pageY,this.dispatchEvent(u)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,s){let i=Date.now(),a=Object.keys(this.activeTouches).length;for(let o=0,u=s.changedTouches.length;o<u;o++){let h=s.changedTouches.item(o);if(!this.activeTouches.hasOwnProperty(String(h.identifier))){console.warn("move of an UNKNOWN touch",h);continue}let m=this.activeTouches[h.identifier],f=Date.now()-m.initialTimeStamp;if(f<Hs.HOLD_DELAY&&Math.abs(m.initialPageX-En(m.rollingPageX))<30&&Math.abs(m.initialPageY-En(m.rollingPageY))<30){let p=this.newGestureEvent(_i.Tap,m.initialTarget);p.pageX=En(m.rollingPageX),p.pageY=En(m.rollingPageY),this.dispatchEvent(p)}else if(f>=Hs.HOLD_DELAY&&Math.abs(m.initialPageX-En(m.rollingPageX))<30&&Math.abs(m.initialPageY-En(m.rollingPageY))<30){let p=this.newGestureEvent(_i.Contextmenu,m.initialTarget);p.pageX=En(m.rollingPageX),p.pageY=En(m.rollingPageY),this.dispatchEvent(p)}else if(a===1){let p=En(m.rollingPageX),b=En(m.rollingPageY),x=En(m.rollingTimestamps)-m.rollingTimestamps[0],_=p-m.rollingPageX[0],y=b-m.rollingPageY[0],S=[...this.targets].filter(C=>m.initialTarget instanceof Node&&C.contains(m.initialTarget));this.inertia(t,S,i,Math.abs(_)/x,_>0?1:-1,p,Math.abs(y)/x,y>0?1:-1,b)}this.dispatchEvent(this.newGestureEvent(_i.End,m.initialTarget)),delete this.activeTouches[h.identifier]}this.dispatched&&(s.preventDefault(),s.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,s){let i=document.createEvent("CustomEvent");return i.initEvent(t,!1,!0),i.initialTarget=s,i.tapCount=0,i}dispatchEvent(t){if(t.type===_i.Tap){let s=new Date().getTime(),i=0;s-this._lastSetTapCountTime>Hs.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=s,t.tapCount=i}else(t.type===_i.Change||t.type===_i.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let i of this.ignoreTargets)if(i.contains(t.initialTarget))return;let s=[];for(let i of this.targets)if(i.contains(t.initialTarget)){let a=0,o=t.initialTarget;for(;o&&o!==i;)a++,o=o.parentElement;s.push([a,i])}s.sort((i,a)=>i[0]-a[0]);for(let[i,a]of s)a.dispatchEvent(t),this.dispatched=!0}}inertia(t,s,i,a,o,u,h,m,f){this.handle=ov(t,()=>{let p=Date.now(),b=p-i,x=0,_=0,y=!0;a+=Hs.SCROLL_FRICTION*b,h+=Hs.SCROLL_FRICTION*b,a>0&&(y=!1,x=o*a*b),h>0&&(y=!1,_=m*h*b);let S=this.newGestureEvent(_i.Change);S.translationX=x,S.translationY=_,s.forEach(C=>C.dispatchEvent(S)),y||this.inertia(t,s,p,a,o,u+x,h,m,f+_)})}onTouchMove(t){let s=Date.now();for(let i=0,a=t.changedTouches.length;i<a;i++){let o=t.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("end of an UNKNOWN touch",o);continue}let u=this.activeTouches[o.identifier],h=this.newGestureEvent(_i.Change,u.initialTarget);h.translationX=o.pageX-En(u.rollingPageX),h.translationY=o.pageY-En(u.rollingPageY),h.pageX=o.pageX,h.pageY=o.pageY,this.dispatchEvent(h),u.rollingPageX.length>3&&(u.rollingPageX.shift(),u.rollingPageY.shift(),u.rollingTimestamps.shift()),u.rollingPageX.push(o.pageX),u.rollingPageY.push(o.pageY),u.rollingTimestamps.push(s)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Cc.SCROLL_FRICTION=-.005,Cc.HOLD_DELAY=700,Cc.CLEAR_TAP_COUNT_TIME=400,Vt([pP],Cc,"isTouchDevice",1);var gP=Cc,lv=class extends Ye{onclick(e,t){this._register(Ue(e,vs.CLICK,s=>t(new Vd(wi(e),s))))}onmousedown(e,t){this._register(Ue(e,vs.MOUSE_DOWN,s=>t(new Vd(wi(e),s))))}onmouseover(e,t){this._register(Ue(e,vs.MOUSE_OVER,s=>t(new Vd(wi(e),s))))}onmouseleave(e,t){this._register(Ue(e,vs.MOUSE_LEAVE,s=>t(new Vd(wi(e),s))))}onkeydown(e,t){this._register(Ue(e,vs.KEY_DOWN,s=>t(new yw(s))))}onkeyup(e,t){this._register(Ue(e,vs.KEY_UP,s=>t(new yw(s))))}oninput(e,t){this._register(Ue(e,vs.INPUT,t))}onblur(e,t){this._register(Ue(e,vs.BLUR,t))}onfocus(e,t){this._register(Ue(e,vs.FOCUS,t))}onchange(e,t){this._register(Ue(e,vs.CHANGE,t))}ignoreGesture(e){return gP.ignoreTarget(e)}},Nw=11,bP=class extends lv{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=Nw+"px",this.domNode.style.height=Nw+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new UN),this._register(Cw(this.bgDomNode,vs.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Cw(this.domNode,vs.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new hP),this._pointerdownScheduleRepeatTimer=this._register(new av)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,wi(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},vP=class A0{constructor(t,s,i,a,o,u,h){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(s=s|0,i=i|0,a=a|0,o=o|0,u=u|0,h=h|0),this.rawScrollLeft=a,this.rawScrollTop=h,s<0&&(s=0),a+s>i&&(a=i-s),a<0&&(a=0),o<0&&(o=0),h+o>u&&(h=u-o),h<0&&(h=0),this.width=s,this.scrollWidth=i,this.scrollLeft=a,this.height=o,this.scrollHeight=u,this.scrollTop=h}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,s){return new A0(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,s?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,s?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new A0(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,s){let i=this.width!==t.width,a=this.scrollWidth!==t.scrollWidth,o=this.scrollLeft!==t.scrollLeft,u=this.height!==t.height,h=this.scrollHeight!==t.scrollHeight,m=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:s,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:a,scrollLeftChanged:o,heightChanged:u,scrollHeightChanged:h,scrollTopChanged:m}}},xP=class extends Ye{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new vP(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let s=this._state.withScrollDimensions(e,t);this._setState(s,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let s=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===s.scrollLeft&&this._smoothScrolling.to.scrollTop===s.scrollTop)return;let i;t?i=new Aw(this._smoothScrolling.from,s,this._smoothScrolling.startTime,this._smoothScrolling.duration):i=this._smoothScrolling.combine(this._state,s,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=i}else{let s=this._state.withScrollPosition(e);this._smoothScrolling=Aw.start(this._state,s,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let s=this._state;s.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(s,t)))}},Tw=class{constructor(e,t,s){this.scrollLeft=e,this.scrollTop=t,this.isDone=s}};function Hp(e,t){let s=t-e;return function(i){return e+s*SP(i)}}function _P(e,t,s){return function(i){return i<s?e(i/s):t((i-s)/(1-s))}}var Aw=class M0{constructor(t,s,i,a){this.from=t,this.to=s,this.duration=a,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,s,i){if(Math.abs(t-s)>2.5*i){let a,o;return t<s?(a=t+.75*i,o=s-.75*i):(a=t-.75*i,o=s+.75*i),_P(Hp(t,a),Hp(o,s),.33)}return Hp(t,s)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let s=(t-this.startTime)/this.duration;if(s<1){let i=this.scrollLeft(s),a=this.scrollTop(s);return new Tw(i,a,!1)}return new Tw(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,s,i){return M0.start(t,s,i)}static start(t,s,i){i=i+10;let a=Date.now()-10;return new M0(t,s,a,i)}};function yP(e){return Math.pow(e,3)}function SP(e){return 1-yP(1-e)}var wP=class extends Ye{constructor(e,t,s){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=s,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new av)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},kP=140,FN=class extends lv{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new wP(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new UN),this._shouldRender=!0,this.domNode=zc(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Ue(this.domNode.domNode,vs.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new bP(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,s,i){this.slider=zc(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof s=="number"&&this.slider.setWidth(s),typeof i=="number"&&this.slider.setHeight(i),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ue(this.slider.domNode,vs.POINTER_DOWN,a=>{a.button===0&&(a.preventDefault(),this._sliderPointerDown(a))})),this.onclick(this.slider.domNode,a=>{a.leftButton&&a.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,s=t+this._scrollbarState.getSliderPosition(),i=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),a=this._sliderPointerPosition(e);s<=a&&a<=i?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,s;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,s=e.offsetY;else{let a=fP(this.domNode.domNode);t=e.pageX-a.left,s=e.pageY-a.top}let i=this._pointerDownRelativePosition(t,s);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(i):this._scrollbarState.getDesiredScrollPositionFromOffset(i)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),s=this._sliderOrthogonalPointerPosition(e),i=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,a=>{let o=this._sliderOrthogonalPointerPosition(a),u=Math.abs(o-s);if(IN&&u>kP){this._setDesiredScrollPositionNow(i.getScrollPosition());return}let h=this._sliderPointerPosition(a)-t;this._setDesiredScrollPositionNow(i.getDesiredScrollPositionFromDelta(h))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},VN=class j0{constructor(t,s,i,a,o,u){this._scrollbarSize=Math.round(s),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(t),this._visibleSize=a,this._scrollSize=o,this._scrollPosition=u,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new j0(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let s=Math.round(t);return this._visibleSize!==s?(this._visibleSize=s,this._refreshComputedValues(),!0):!1}setScrollSize(t){let s=Math.round(t);return this._scrollSize!==s?(this._scrollSize=s,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let s=Math.round(t);return this._scrollPosition!==s?(this._scrollPosition=s,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,s,i,a,o){let u=Math.max(0,i-t),h=Math.max(0,u-2*s),m=a>0&&a>i;if(!m)return{computedAvailableSize:Math.round(u),computedIsNeeded:m,computedSliderSize:Math.round(h),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(i*h/a))),p=(h-f)/(a-i),b=o*p;return{computedAvailableSize:Math.round(u),computedIsNeeded:m,computedSliderSize:Math.round(f),computedSliderRatio:p,computedSliderPosition:Math.round(b)}}_refreshComputedValues(){let t=j0._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let s=t-this._arrowSize-this._computedSliderSize/2;return Math.round(s/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let s=t-this._arrowSize,i=this._scrollPosition;return s<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let s=this._computedSliderPosition+t;return Math.round(s/this._computedSliderRatio)}},CP=class extends FN{constructor(e,t,s){let i=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new VN(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,i.width,i.scrollWidth,a.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},EP=class extends FN{constructor(e,t,s){let i=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new VN(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,i.height,i.scrollHeight,a.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},NP=500,Mw=50,TP=class{constructor(e,t,s){this.timestamp=e,this.deltaX=t,this.deltaY=s,this.score=0}},R0=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,s=0,i=1,a=this._rear;do{let o=a===this._front?t:Math.pow(2,-i);if(t-=o,s+=this._memory[a].score*o,a===this._front)break;a=(this._capacity+a-1)%this._capacity,i++}while(!0);return s<=.5}acceptStandardWheelEvent(t){if(iv){let s=wi(t.browserEvent),i=PI(s);this.accept(Date.now(),t.deltaX*i,t.deltaY*i)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,s,i){let a=null,o=new TP(t,s,i);this._front===-1&&this._rear===-1?(this._memory[0]=o,this._front=0,this._rear=0):(a=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=o),o.score=this._computeScore(o,a)}_computeScore(t,s){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(i+=.25),s){let a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),u=Math.abs(s.deltaX),h=Math.abs(s.deltaY),m=Math.max(Math.min(a,u),1),f=Math.max(Math.min(o,h),1),p=Math.max(a,u),b=Math.max(o,h);p%m===0&&b%f===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};R0.INSTANCE=new R0;var AP=R0,MP=class extends lv{constructor(e,t,s){super(),this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new be),this.onWillScroll=this._onWillScroll.event,this._options=RP(t),this._scrollable=s,this._register(this._scrollable.onScroll(a=>{this._onWillScroll.fire(a),this._onDidScroll(a),this._onScroll.fire(a)}));let i={onMouseWheel:a=>this._onMouseWheel(a),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new EP(this._scrollable,this._options,i)),this._horizontalScrollbar=this._register(new CP(this._scrollable,this._options,i)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=zc(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=zc(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=zc(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,a=>this._onMouseOver(a)),this.onmouseleave(this._listenOnDomNode,a=>this._onMouseLeave(a)),this._hideTimeout=this._register(new av),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=qa(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Ci&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new ww(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=qa(this._mouseWheelToDispose),e)){let t=s=>{this._onMouseWheel(new ww(s))};this._mouseWheelToDispose.push(Ue(this._listenOnDomNode,vs.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=AP.INSTANCE;t.acceptStandardWheelEvent(e);let s=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+a===0?o=a=0:Math.abs(a)>=Math.abs(o)?o=0:a=0),this._options.flipAxes&&([a,o]=[o,a]);let u=!Ci&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!o&&(o=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),m={};if(a){let f=Mw*a,p=h.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(m,p)}if(o){let f=Mw*o,p=h.scrollLeft-(f<0?Math.floor(f):Math.ceil(f));this._horizontalScrollbar.writeScrollPosition(m,p)}m=this._scrollable.validateScrollPosition(m),(h.scrollLeft!==m.scrollLeft||h.scrollTop!==m.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(m):this._scrollable.setScrollPositionNow(m),s=!0)}let i=s;!i&&this._options.alwaysConsumeMouseWheel&&(i=!0),!i&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(i=!0),i&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,s=e.scrollLeft>0,i=s?" left":"",a=t?" top":"",o=s||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${i}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${a}${i}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),NP)}},jP=class extends MP{constructor(e,t,s){super(e,t,s)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function RP(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Ci&&(t.className+=" mac"),t}var D0=class extends Ye{constructor(e,t,s,i,a,o,u,h){super(),this._bufferService=s,this._optionsService=u,this._renderService=h,this._onRequestScrollLines=this._register(new be),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let m=this._register(new xP({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>ov(i.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{m.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new jP(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},m)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(a.onProtocolChange(f=>{this._scrollableElement.updateOptions({handleMouseWheel:!(f&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(js.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Ot(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=i.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Ot(()=>this._styleElement.remove())),this._register(js.runAndSubscribe(o.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${o.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${o.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${o.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
147
|
-
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(f=>this._handleScroll(f)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),s=t-this._bufferService.buffer.ydisp;s!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(s)),this._isHandlingScroll=!1}};D0=Vt([Se(2,en),Se(3,hr),Se(4,kN),Se(5,dl),Se(6,tn),Se(7,fr)],D0);var O0=class extends Ye{constructor(e,t,s,i,a){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=s,this._decorationService=i,this._renderService=a,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(o=>this._removeDecoration(o))),this._register(Ot(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let s=e.options.x??0;return s&&s>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let s=this._decorationElements.get(e);s||(s=this._createElement(e),e.element=s,this._decorationElements.set(e,s),this._container.appendChild(s),e.onDispose(()=>{this._decorationElements.delete(e),s.remove()})),s.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(s.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,s.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(s)}}_refreshXPosition(e,t=e.element){if(!t)return;let s=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=s?`${s*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=s?`${s*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};O0=Vt([Se(1,en),Se(2,hr),Se(3,du),Se(4,fr)],O0);var DP=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(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,s){return t>=e.startBufferLine-this._linePadding[s||"full"]&&t<=e.endBufferLine+this._linePadding[s||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},bi={full:0,left:0,center:0,right:0},Kr={full:0,left:0,center:0,right:0},fc={full:0,left:0,center:0,right:0},Rh=class extends Ye{constructor(e,t,s,i,a,o,u,h){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=s,this._decorationService=i,this._renderService=a,this._optionsService=o,this._themeService=u,this._coreBrowserService=h,this._colorZoneStore=new DP,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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(Ot(()=>this._canvas?.remove()));let m=this._canvas.getContext("2d");if(m)this._ctx=m;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Kr.full=this._canvas.width,Kr.left=e,Kr.center=t,Kr.right=e,this._refreshDrawHeightConstants(),fc.full=1,fc.left=1,fc.center=1+Kr.left,fc.right=1+Kr.left+Kr.center}_refreshDrawHeightConstants(){bi.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);bi.left=t,bi.center=t,bi.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*bi.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*bi.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*bi.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*bi.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(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(fc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-bi[e.position||"full"]/2),Kr[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+bi[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Rh=Vt([Se(2,en),Se(3,du),Se(4,fr),Se(5,tn),Se(6,dl),Se(7,hr)],Rh);var ue;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
148
|
-
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(ue||={});var oh;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(oh||={});var qN;(e=>e.ST=`${ue.ESC}\\`)(qN||={});var L0=class{constructor(e,t,s,i,a,o){this._textarea=e,this._compositionView=t,this._bufferService=s,this._optionsService=i,this._coreService=a,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let s;t.start+=this._dataAlreadySent.length,this._isComposing?s=this._textarea.value.substring(t.start,this._compositionPosition.start):s=this._textarea.value.substring(t.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,s=t.replace(e,"");this._dataAlreadySent=s,t.length>e.length?this._coreService.triggerDataEvent(s,!0):t.length<e.length?this._coreService.triggerDataEvent(`${ue.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let o=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};L0=Vt([Se(2,en),Se(3,tn),Se(4,Za),Se(5,fr)],L0);var xs=0,_s=0,ys=0,Ft=0,jw={css:"#00000000",rgba:0},as;(e=>{function t(a,o,u,h){return h!==void 0?`#${Ma(a)}${Ma(o)}${Ma(u)}${Ma(h)}`:`#${Ma(a)}${Ma(o)}${Ma(u)}`}e.toCss=t;function s(a,o,u,h=255){return(a<<24|o<<16|u<<8|h)>>>0}e.toRgba=s;function i(a,o,u,h){return{css:e.toCss(a,o,u,h),rgba:e.toRgba(a,o,u,h)}}e.toColor=i})(as||={});var Mt;(e=>{function t(m,f){if(Ft=(f.rgba&255)/255,Ft===1)return{css:f.css,rgba:f.rgba};let p=f.rgba>>24&255,b=f.rgba>>16&255,x=f.rgba>>8&255,_=m.rgba>>24&255,y=m.rgba>>16&255,S=m.rgba>>8&255;xs=_+Math.round((p-_)*Ft),_s=y+Math.round((b-y)*Ft),ys=S+Math.round((x-S)*Ft);let C=as.toCss(xs,_s,ys),E=as.toRgba(xs,_s,ys);return{css:C,rgba:E}}e.blend=t;function s(m){return(m.rgba&255)===255}e.isOpaque=s;function i(m,f,p){let b=lh.ensureContrastRatio(m.rgba,f.rgba,p);if(b)return as.toColor(b>>24&255,b>>16&255,b>>8&255)}e.ensureContrastRatio=i;function a(m){let f=(m.rgba|255)>>>0;return[xs,_s,ys]=lh.toChannels(f),{css:as.toCss(xs,_s,ys),rgba:f}}e.opaque=a;function o(m,f){return Ft=Math.round(f*255),[xs,_s,ys]=lh.toChannels(m.rgba),{css:as.toCss(xs,_s,ys,Ft),rgba:as.toRgba(xs,_s,ys,Ft)}}e.opacity=o;function u(m,f){return Ft=m.rgba&255,o(m,Ft*f/255)}e.multiplyOpacity=u;function h(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}e.toColorRGB=h})(Mt||={});var Pt;(e=>{let t,s;try{let a=document.createElement("canvas");a.width=1,a.height=1;let o=a.getContext("2d",{willReadFrequently:!0});o&&(t=o,t.globalCompositeOperation="copy",s=t.createLinearGradient(0,0,1,1))}catch{}function i(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return xs=parseInt(a.slice(1,2).repeat(2),16),_s=parseInt(a.slice(2,3).repeat(2),16),ys=parseInt(a.slice(3,4).repeat(2),16),as.toColor(xs,_s,ys);case 5:return xs=parseInt(a.slice(1,2).repeat(2),16),_s=parseInt(a.slice(2,3).repeat(2),16),ys=parseInt(a.slice(3,4).repeat(2),16),Ft=parseInt(a.slice(4,5).repeat(2),16),as.toColor(xs,_s,ys,Ft);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let o=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(o)return xs=parseInt(o[1]),_s=parseInt(o[2]),ys=parseInt(o[3]),Ft=Math.round((o[5]===void 0?1:parseFloat(o[5]))*255),as.toColor(xs,_s,ys,Ft);if(!t||!s)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=s,t.fillStyle=a,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[xs,_s,ys,Ft]=t.getImageData(0,0,1,1).data,Ft!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:as.toRgba(xs,_s,ys,Ft),css:a}}e.toColor=i})(Pt||={});var Ys;(e=>{function t(i){return s(i>>16&255,i>>8&255,i&255)}e.relativeLuminance=t;function s(i,a,o){let u=i/255,h=a/255,m=o/255,f=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),b=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4);return f*.2126+p*.7152+b*.0722}e.relativeLuminance2=s})(Ys||={});var lh;(e=>{function t(u,h){if(Ft=(h&255)/255,Ft===1)return h;let m=h>>24&255,f=h>>16&255,p=h>>8&255,b=u>>24&255,x=u>>16&255,_=u>>8&255;return xs=b+Math.round((m-b)*Ft),_s=x+Math.round((f-x)*Ft),ys=_+Math.round((p-_)*Ft),as.toRgba(xs,_s,ys)}e.blend=t;function s(u,h,m){let f=Ys.relativeLuminance(u>>8),p=Ys.relativeLuminance(h>>8);if(or(f,p)<m){if(p<f){let _=i(u,h,m),y=or(f,Ys.relativeLuminance(_>>8));if(y<m){let S=a(u,h,m),C=or(f,Ys.relativeLuminance(S>>8));return y>C?_:S}return _}let b=a(u,h,m),x=or(f,Ys.relativeLuminance(b>>8));if(x<m){let _=i(u,h,m),y=or(f,Ys.relativeLuminance(_>>8));return x>y?b:_}return b}}e.ensureContrastRatio=s;function i(u,h,m){let f=u>>24&255,p=u>>16&255,b=u>>8&255,x=h>>24&255,_=h>>16&255,y=h>>8&255,S=or(Ys.relativeLuminance2(x,_,y),Ys.relativeLuminance2(f,p,b));for(;S<m&&(x>0||_>0||y>0);)x-=Math.max(0,Math.ceil(x*.1)),_-=Math.max(0,Math.ceil(_*.1)),y-=Math.max(0,Math.ceil(y*.1)),S=or(Ys.relativeLuminance2(x,_,y),Ys.relativeLuminance2(f,p,b));return(x<<24|_<<16|y<<8|255)>>>0}e.reduceLuminance=i;function a(u,h,m){let f=u>>24&255,p=u>>16&255,b=u>>8&255,x=h>>24&255,_=h>>16&255,y=h>>8&255,S=or(Ys.relativeLuminance2(x,_,y),Ys.relativeLuminance2(f,p,b));for(;S<m&&(x<255||_<255||y<255);)x=Math.min(255,x+Math.ceil((255-x)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),S=or(Ys.relativeLuminance2(x,_,y),Ys.relativeLuminance2(f,p,b));return(x<<24|_<<16|y<<8|255)>>>0}e.increaseLuminance=a;function o(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}e.toChannels=o})(lh||={});function Ma(e){let t=e.toString(16);return t.length<2?"0"+t:t}function or(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var OP=class extends uu{constructor(e,t,s){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=s}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Dh=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Kn}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let s=[],i=t.translateToString(!0),a=0,o=0,u=0,h=t.getFg(0),m=t.getBg(0);for(let f=0;f<t.getTrimmedLength();f++)if(t.loadCell(f,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==h||this._workCell.bg!==m){if(f-a>1){let p=this._getJoinedRanges(i,u,o,t,a);for(let b=0;b<p.length;b++)s.push(p[b])}a=f,u=o,h=this._workCell.fg,m=this._workCell.bg}o+=this._workCell.getChars().length||Qr.length}if(this._bufferService.cols-a>1){let f=this._getJoinedRanges(i,u,o,t,a);for(let p=0;p<f.length;p++)s.push(f[p])}return s}_getJoinedRanges(e,t,s,i,a){let o=e.substring(t,s),u=[];try{u=this._characterJoiners[0].handler(o)}catch(h){console.error(h)}for(let h=1;h<this._characterJoiners.length;h++)try{let m=this._characterJoiners[h].handler(o);for(let f=0;f<m.length;f++)Dh._mergeRanges(u,m[f])}catch(m){console.error(m)}return this._stringRangesToCellRanges(u,i,a),u}_stringRangesToCellRanges(e,t,s){let i=0,a=!1,o=0,u=e[i];if(u){for(let h=s;h<this._bufferService.cols;h++){let m=t.getWidth(h),f=t.getString(h).length||Qr.length;if(m!==0){if(!a&&u[0]<=o&&(u[0]=h,a=!0),u[1]<=o){if(u[1]=h,u=e[++i],!u)break;u[0]<=o?(u[0]=h,a=!0):a=!1}o+=f}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let s=!1;for(let i=0;i<e.length;i++){let a=e[i];if(s){if(t[1]<=a[0])return e[i-1][1]=t[1],e;if(t[1]<=a[1])return e[i-1][1]=Math.max(t[1],a[1]),e.splice(i,1),e;e.splice(i,1),i--}else{if(t[1]<=a[0])return e.splice(i,0,t),e;if(t[1]<=a[1])return a[0]=Math.min(t[0],a[0]),e;t[0]<a[1]&&(a[0]=Math.min(t[0],a[0]),s=!0);continue}}return s?e[e.length-1][1]=t[1]:e.push(t),e}};Dh=Vt([Se(0,en)],Dh);function LP(e){return 57508<=e&&e<=57558}function BP(e){return 9472<=e&&e<=9631}function zP(e){return LP(e)||BP(e)}function IP(){return{css:{canvas:qd(),cell:qd()},device:{canvas:qd(),cell:qd(),char:{width:0,height:0,left:0,top:0}}}}function qd(){return{width:0,height:0}}var B0=class{constructor(e,t,s,i,a,o,u){this._document=e,this._characterJoinerService=t,this._optionsService=s,this._coreBrowserService=i,this._coreService=a,this._decorationService=o,this._themeService=u,this._workCell=new Kn,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,s){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=s}createRow(e,t,s,i,a,o,u,h,m,f,p){let b=[],x=this._characterJoinerService.getJoinedCharacters(t),_=this._themeService.colors,y=e.getNoBgTrimmedLength();s&&y<o+1&&(y=o+1);let S,C=0,E="",T=0,N=0,M=0,R=0,z=!1,L=0,j=!1,H=0,P=0,F=[],K=f!==-1&&p!==-1;for(let Y=0;Y<y;Y++){e.loadCell(Y,this._workCell);let Q=this._workCell.getWidth();if(Q===0)continue;let q=!1,O=Y>=P,X=Y,Z=this._workCell;if(x.length>0&&Y===x[0][0]&&O){let ze=x.shift(),Lt=this._isCellInSelection(ze[0],t);for(T=ze[0]+1;T<ze[1];T++)O&&=Lt===this._isCellInSelection(T,t);O&&=!s||o<ze[0]||o>=ze[1],O?(q=!0,Z=new OP(this._workCell,e.translateToString(!0,ze[0],ze[1]),ze[1]-ze[0]),X=ze[1]-1,Q=Z.getWidth()):P=ze[1]}let V=this._isCellInSelection(Y,t),$=s&&Y===o,D=K&&Y>=f&&Y<=p,W=!1;this._decorationService.forEachDecorationAtCell(Y,t,void 0,ze=>{W=!0});let he=Z.getChars()||Qr;if(he===" "&&(Z.isUnderline()||Z.isOverline())&&(he=" "),H=Q*h-m.get(he,Z.isBold(),Z.isItalic()),!S)S=this._document.createElement("span");else if(C&&(V&&j||!V&&!j&&Z.bg===N)&&(V&&j&&_.selectionForeground||Z.fg===M)&&Z.extended.ext===R&&D===z&&H===L&&!$&&!q&&!W&&O){Z.isInvisible()?E+=Qr:E+=he,C++;continue}else C&&(S.textContent=E),S=this._document.createElement("span"),C=0,E="";if(N=Z.bg,M=Z.fg,R=Z.extended.ext,z=D,L=H,j=V,q&&o>=Y&&o<=X&&(o=Y),!this._coreService.isCursorHidden&&$&&this._coreService.isCursorInitialized){if(F.push("xterm-cursor"),this._coreBrowserService.isFocused)u&&F.push("xterm-cursor-blink"),F.push(i==="bar"?"xterm-cursor-bar":i==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":F.push("xterm-cursor-outline");break;case"block":F.push("xterm-cursor-block");break;case"bar":F.push("xterm-cursor-bar");break;case"underline":F.push("xterm-cursor-underline");break}}if(Z.isBold()&&F.push("xterm-bold"),Z.isItalic()&&F.push("xterm-italic"),Z.isDim()&&F.push("xterm-dim"),Z.isInvisible()?E=Qr:E=Z.getChars()||Qr,Z.isUnderline()&&(F.push(`xterm-underline-${Z.extended.underlineStyle}`),E===" "&&(E=" "),!Z.isUnderlineColorDefault()))if(Z.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${uu.toColorRGB(Z.getUnderlineColor()).join(",")})`;else{let ze=Z.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Z.isBold()&&ze<8&&(ze+=8),S.style.textDecorationColor=_.ansi[ze].css}Z.isOverline()&&(F.push("xterm-overline"),E===" "&&(E=" ")),Z.isStrikethrough()&&F.push("xterm-strikethrough"),D&&(S.style.textDecoration="underline");let le=Z.getFgColor(),me=Z.getFgColorMode(),ne=Z.getBgColor(),fe=Z.getBgColorMode(),we=!!Z.isInverse();if(we){let ze=le;le=ne,ne=ze;let Lt=me;me=fe,fe=Lt}let ye,Ze,lt=!1;this._decorationService.forEachDecorationAtCell(Y,t,void 0,ze=>{ze.options.layer!=="top"&<||(ze.backgroundColorRGB&&(fe=50331648,ne=ze.backgroundColorRGB.rgba>>8&16777215,ye=ze.backgroundColorRGB),ze.foregroundColorRGB&&(me=50331648,le=ze.foregroundColorRGB.rgba>>8&16777215,Ze=ze.foregroundColorRGB),lt=ze.options.layer==="top")}),!lt&&V&&(ye=this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque,ne=ye.rgba>>8&16777215,fe=50331648,lt=!0,_.selectionForeground&&(me=50331648,le=_.selectionForeground.rgba>>8&16777215,Ze=_.selectionForeground)),lt&&F.push("xterm-decoration-top");let ct;switch(fe){case 16777216:case 33554432:ct=_.ansi[ne],F.push(`xterm-bg-${ne}`);break;case 50331648:ct=as.toColor(ne>>16,ne>>8&255,ne&255),this._addStyle(S,`background-color:#${Rw((ne>>>0).toString(16),"0",6)}`);break;default:we?(ct=_.foreground,F.push("xterm-bg-257")):ct=_.background}switch(ye||Z.isDim()&&(ye=Mt.multiplyOpacity(ct,.5)),me){case 16777216:case 33554432:Z.isBold()&&le<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(le+=8),this._applyMinimumContrast(S,ct,_.ansi[le],Z,ye,void 0)||F.push(`xterm-fg-${le}`);break;case 50331648:let ze=as.toColor(le>>16&255,le>>8&255,le&255);this._applyMinimumContrast(S,ct,ze,Z,ye,Ze)||this._addStyle(S,`color:#${Rw(le.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(S,ct,_.foreground,Z,ye,Ze)||we&&F.push("xterm-fg-257")}F.length&&(S.className=F.join(" "),F.length=0),!$&&!q&&!W&&O?C++:S.textContent=E,H!==this.defaultSpacing&&(S.style.letterSpacing=`${H}px`),b.push(S),Y=X}return S&&C&&(S.textContent=E),b}_applyMinimumContrast(e,t,s,i,a,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||zP(i.getCode()))return!1;let u=this._getContrastCache(i),h;if(!a&&!o&&(h=u.getColor(t.rgba,s.rgba)),h===void 0){let m=this._optionsService.rawOptions.minimumContrastRatio/(i.isDim()?2:1);h=Mt.ensureContrastRatio(a||t,o||s,m),u.setColor((a||t).rgba,(o||s).rgba,h??null)}return h?(this._addStyle(e,`color:${h.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let s=this._selectionStart,i=this._selectionEnd;return!s||!i?!1:this._columnSelectMode?s[0]<=i[0]?e>=s[0]&&t>=s[1]&&e<i[0]&&t<=i[1]:e<s[0]&&t>=s[1]&&e>=i[0]&&t<=i[1]:t>s[1]&&t<i[1]||s[1]===i[1]&&t===s[1]&&e>=s[0]&&e<i[0]||s[1]<i[1]&&t===i[1]&&e<i[0]||s[1]<i[1]&&t===s[1]&&e>=s[0]}};B0=Vt([Se(1,NN),Se(2,tn),Se(3,hr),Se(4,Za),Se(5,du),Se(6,dl)],B0);function Rw(e,t,s){for(;e.length<s;)e=t+e;return e}var PP=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.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";let s=e.createElement("span");s.classList.add("xterm-char-measure-element");let i=e.createElement("span");i.classList.add("xterm-char-measure-element"),i.style.fontWeight="bold";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontStyle="italic";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold",o.style.fontStyle="italic",this._measureElements=[s,i,a,o],this._container.appendChild(s),this._container.appendChild(i),this._container.appendChild(a),this._container.appendChild(o),t.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(e,t,s,i){e===this._font&&t===this._fontSize&&s===this._weight&&i===this._weightBold||(this._font=e,this._fontSize=t,this._weight=s,this._weightBold=i,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${s}`,this._measureElements[1].style.fontWeight=`${i}`,this._measureElements[2].style.fontWeight=`${s}`,this._measureElements[3].style.fontWeight=`${i}`,this.clear())}get(e,t,s){let i=0;if(!t&&!s&&e.length===1&&(i=e.charCodeAt(0))<256){if(this._flat[i]!==-9999)return this._flat[i];let u=this._measure(e,0);return u>0&&(this._flat[i]=u),u}let a=e;t&&(a+="B"),s&&(a+="I");let o=this._holey.get(a);if(o===void 0){let u=0;t&&(u|=1),s&&(u|=2),o=this._measure(e,u),o>0&&this._holey.set(a,o)}return o}_measure(e,t){let s=this._measureElements[t];return s.textContent=e.repeat(32),s.offsetWidth/32}},$P=class{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(e,t,s,i=!1){if(this.selectionStart=t,this.selectionEnd=s,!t||!s||t[0]===s[0]&&t[1]===s[1]){this.clear();return}let a=e.buffers.active.ydisp,o=t[1]-a,u=s[1]-a,h=Math.max(o,0),m=Math.min(u,e.rows-1);if(h>=e.rows||m<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=i,this.viewportStartRow=o,this.viewportEndRow=u,this.viewportCappedStartRow=h,this.viewportCappedEndRow=m,this.startCol=t[0],this.endCol=s[0]}isCellSelected(e,t,s){return this.hasSelection?(s-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&s>=this.viewportCappedStartRow&&t<this.endCol&&s<=this.viewportCappedEndRow:t<this.startCol&&s>=this.viewportCappedStartRow&&t>=this.endCol&&s<=this.viewportCappedEndRow:s>this.viewportStartRow&&s<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&s===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportStartRow&&t>=this.startCol):!1}};function HP(){return new $P}var Up="xterm-dom-renderer-owner-",$n="xterm-rows",Gd="xterm-fg-",Dw="xterm-bg-",mc="xterm-focus",Kd="xterm-selection",UP=1,z0=class extends Ye{constructor(e,t,s,i,a,o,u,h,m,f,p,b,x,_){super(),this._terminal=e,this._document=t,this._element=s,this._screenElement=i,this._viewportElement=a,this._helperContainer=o,this._linkifier2=u,this._charSizeService=m,this._optionsService=f,this._bufferService=p,this._coreService=b,this._coreBrowserService=x,this._themeService=_,this._terminalClass=UP++,this._rowElements=[],this._selectionRenderModel=HP(),this.onRequestRedraw=this._register(new be).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add($n),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(Kd),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=IP(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(y=>this._injectCss(y))),this._injectCss(this._themeService.colors),this._rowFactory=h.createInstance(B0,document),this._element.classList.add(Up+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(y=>this._handleLinkHover(y))),this._register(this._linkifier2.onHideLinkUnderline(y=>this._handleLinkLeave(y))),this._register(Ot(()=>{this._element.classList.remove(Up+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new PP(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let s of this._rowElements)s.style.width=`${this.dimensions.css.canvas.width}px`,s.style.height=`${this.dimensions.css.cell.height}px`,s.style.lineHeight=`${this.dimensions.css.cell.height}px`,s.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${$n} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${$n} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${$n} .xterm-dim { color: ${Mt.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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;}`;let s=`blink_underline_${this._terminalClass}`,i=`blink_bar_${this._terminalClass}`,a=`blink_block_${this._terminalClass}`;t+=`@keyframes ${s} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${i} { 50% { box-shadow: none; }}`,t+=`@keyframes ${a} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${$n}.${mc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${$n}.${mc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${$n}.${mc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${$n} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${$n} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${$n} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${$n} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${$n} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Kd} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Kd} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Kd} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,u]of e.ansi.entries())t+=`${this._terminalSelector} .${Gd}${o} { color: ${u.css}; }${this._terminalSelector} .${Gd}${o}.xterm-dim { color: ${Mt.multiplyOpacity(u,.5).css}; }${this._terminalSelector} .${Dw}${o} { background-color: ${u.css}; }`;t+=`${this._terminalSelector} .${Gd}257 { color: ${Mt.opaque(e.background).css}; }${this._terminalSelector} .${Gd}257.xterm-dim { color: ${Mt.multiplyOpacity(Mt.opaque(e.background),.5).css}; }${this._terminalSelector} .${Dw}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let s=this._rowElements.length;s<=t;s++){let i=this._document.createElement("div");this._rowContainer.appendChild(i),this._rowElements.push(i)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(mc),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(mc),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,s){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,s),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,s),!this._selectionRenderModel.hasSelection))return;let i=this._selectionRenderModel.viewportStartRow,a=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,u=this._selectionRenderModel.viewportCappedEndRow,h=this._document.createDocumentFragment();if(s){let m=e[0]>t[0];h.appendChild(this._createSelectionElement(o,m?t[0]:e[0],m?e[0]:t[0],u-o+1))}else{let m=i===o?e[0]:0,f=o===a?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(o,m,f));let p=u-o-1;if(h.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,p)),o!==u){let b=a===u?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(u,0,b))}}this._selectionContainer.appendChild(h)}_createSelectionElement(e,t,s,i=1){let a=this._document.createElement("div"),o=t*this.dimensions.css.cell.width,u=this.dimensions.css.cell.width*(s-t);return o+u>this.dimensions.css.canvas.width&&(u=this.dimensions.css.canvas.width-o),a.style.height=`${i*this.dimensions.css.cell.height}px`,a.style.top=`${e*this.dimensions.css.cell.height}px`,a.style.left=`${o}px`,a.style.width=`${u}px`,a}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let s=this._bufferService.buffer,i=s.ybase+s.y,a=Math.min(s.x,this._bufferService.cols-1),o=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,u=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,h=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=e;m<=t;m++){let f=m+s.ydisp,p=this._rowElements[m],b=s.lines.get(f);if(!p||!b)break;p.replaceChildren(...this._rowFactory.createRow(b,f,f===i,u,h,a,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Up}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,s,i,a,o){s<0&&(e=0),i<0&&(t=0);let u=this._bufferService.rows-1;s=Math.max(Math.min(s,u),0),i=Math.max(Math.min(i,u),0),a=Math.min(a,this._bufferService.cols);let h=this._bufferService.buffer,m=h.ybase+h.y,f=Math.min(h.x,a-1),p=this._optionsService.rawOptions.cursorBlink,b=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let _=s;_<=i;++_){let y=_+h.ydisp,S=this._rowElements[_],C=h.lines.get(y);if(!S||!C)break;S.replaceChildren(...this._rowFactory.createRow(C,y,y===m,b,x,f,p,this.dimensions.css.cell.width,this._widthCache,o?_===s?e:0:-1,o?(_===i?t:a)-1:-1))}}};z0=Vt([Se(7,tv),Se(8,ef),Se(9,tn),Se(10,en),Se(11,Za),Se(12,hr),Se(13,dl)],z0);var I0=class extends Ye{constructor(e,t,s){super(),this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=this._register(new be),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new VP(this._optionsService))}catch{this._measureStrategy=this._register(new FP(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};I0=Vt([Se(2,tn)],I0);var GN=class extends Ye{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},FP=class extends GN{constructor(e,t,s){super(),this._document=e,this._parentElement=t,this._optionsService=s,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}},VP=class extends GN{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},qP=class extends Ye{constructor(e,t,s){super(),this._textarea=e,this._window=t,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new GP(this._window)),this._onDprChange=this._register(new be),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new be),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(i=>this._screenDprMonitor.setWindow(i))),this._register(js.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ue(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ue(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,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}},GP=class extends Ye{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new sl),this._onDprChange=this._register(new be),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Ot(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ue(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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)}},KP=class extends Ye{constructor(){super(),this.linkProviders=[],this._register(Ot(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function cv(e,t,s){let i=s.getBoundingClientRect(),a=e.getComputedStyle(s),o=parseInt(a.getPropertyValue("padding-left")),u=parseInt(a.getPropertyValue("padding-top"));return[t.clientX-i.left-o,t.clientY-i.top-u]}function WP(e,t,s,i,a,o,u,h,m){if(!o)return;let f=cv(e,t,s);if(f)return f[0]=Math.ceil((f[0]+(m?u/2:0))/u),f[1]=Math.ceil(f[1]/h),f[0]=Math.min(Math.max(f[0],1),i+(m?1:0)),f[1]=Math.min(Math.max(f[1],1),a),f}var P0=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,s,i,a){return WP(window,e,t,s,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(e,t){let s=cv(window,e,t);if(this._charSizeService.hasValidSize)return s[0]=Math.min(Math.max(s[0],0),this._renderService.dimensions.css.canvas.width-1),s[1]=Math.min(Math.max(s[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(s[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(s[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(s[0]),y:Math.floor(s[1])}}};P0=Vt([Se(0,fr),Se(1,ef)],P0);var YP=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,s){this._rowCount=s,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},KN={};rI(KN,{getSafariVersion:()=>ZP,isChromeOS:()=>ZN,isFirefox:()=>WN,isIpad:()=>QP,isIphone:()=>JP,isLegacyEdge:()=>XP,isLinux:()=>uv,isMac:()=>Oh,isNode:()=>tf,isSafari:()=>YN,isWindows:()=>XN});var tf=typeof process<"u"&&"title"in process,hu=tf?"node":navigator.userAgent,fu=tf?"node":navigator.platform,WN=hu.includes("Firefox"),XP=hu.includes("Edge"),YN=/^((?!chrome|android).)*safari/i.test(hu);function ZP(){if(!YN)return 0;let e=hu.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Oh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(fu),QP=fu==="iPad",JP=fu==="iPhone",XN=["Windows","Win16","Win32","WinCE"].includes(fu),uv=fu.indexOf("Linux")>=0,ZN=/\bCrOS\b/.test(hu),QN=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,s=0,i=e.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),s=Math.max(t,s),a=e.timeRemaining(),s*1.5>a){i-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-t))}ms`),this._start();return}i=a}this.clear()}},e$=class extends QN{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},t$=class extends QN{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Lh=!tf&&"requestIdleCallback"in window?t$:e$,s$=class{constructor(){this._queue=new Lh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},$0=class extends Ye{constructor(e,t,s,i,a,o,u,h,m){super(),this._rowCount=e,this._optionsService=s,this._charSizeService=i,this._coreService=a,this._coreBrowserService=h,this._renderer=this._register(new sl),this._pausedResizeTask=new s$,this._observerDisposable=this._register(new sl),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 be),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new be),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new be),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new be),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new YP((f,p)=>this._renderRows(f,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new n$(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Ot(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(u.onResize(()=>this._fullRefresh())),this._register(u.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(u.cols,u.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(u.buffer.y,u.buffer.y,!0))),this._register(m.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(f=>this._registerIntersectionObserver(f,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let s=new e.IntersectionObserver(i=>this._handleIntersectionChange(i[i.length-1]),{threshold:0});s.observe(t),this._observerDisposable.value=Ot(()=>s.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,s=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let i=this._syncOutputHandler.flush();i&&(e=Math.min(e,i.start),t=Math.max(t,i.end)),s||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,s){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=s,this._renderer.value?.handleSelectionChanged(e,t,s)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};$0=Vt([Se(2,tn),Se(3,ef),Se(4,Za),Se(5,du),Se(6,en),Se(7,hr),Se(8,dl)],$0);var n$=class{constructor(e,t,s){this._coreBrowserService=e,this._coreService=t,this._onTimeout=s,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function i$(e,t,s,i){let a=s.buffer.x,o=s.buffer.y;if(!s.buffer.hasScrollback)return o$(a,o,e,t,s,i)+sf(o,t,s,i)+l$(a,o,e,t,s,i);let u;if(o===t)return u=a>e?"D":"C",Kc(Math.abs(a-e),Gc(u,i));u=o>t?"D":"C";let h=Math.abs(o-t),m=a$(o>t?e:a,s)+(h-1)*s.cols+1+r$(o>t?a:e);return Kc(m,Gc(u,i))}function r$(e,t){return e-1}function a$(e,t){return t.cols-e}function o$(e,t,s,i,a,o){return sf(t,i,a,o).length===0?"":Kc(e3(e,t,e,t-Ga(t,a),!1,a).length,Gc("D",o))}function sf(e,t,s,i){let a=e-Ga(e,s),o=t-Ga(t,s),u=Math.abs(a-o)-c$(e,t,s);return Kc(u,Gc(JN(e,t),i))}function l$(e,t,s,i,a,o){let u;sf(t,i,a,o).length>0?u=i-Ga(i,a):u=t;let h=i,m=u$(e,t,s,i,a,o);return Kc(e3(e,u,s,h,m==="C",a).length,Gc(m,o))}function c$(e,t,s){let i=0,a=e-Ga(e,s),o=t-Ga(t,s);for(let u=0;u<Math.abs(a-o);u++){let h=JN(e,t)==="A"?-1:1;s.buffer.lines.get(a+h*u)?.isWrapped&&i++}return i}function Ga(e,t){let s=0,i=t.buffer.lines.get(e),a=i?.isWrapped;for(;a&&e>=0&&e<t.rows;)s++,i=t.buffer.lines.get(--e),a=i?.isWrapped;return s}function u$(e,t,s,i,a,o){let u;return sf(s,i,a,o).length>0?u=i-Ga(i,a):u=t,e<s&&u<=i||e>=s&&u<i?"C":"D"}function JN(e,t){return e>t?"A":"B"}function e3(e,t,s,i,a,o){let u=e,h=t,m="";for(;(u!==s||h!==i)&&h>=0&&h<o.buffer.lines.length;)u+=a?1:-1,a&&u>o.cols-1?(m+=o.buffer.translateBufferLineToString(h,!1,e,u),u=0,e=0,h++):!a&&u<0&&(m+=o.buffer.translateBufferLineToString(h,!1,0,e+1),u=o.cols-1,e=u,h--);return m+o.buffer.translateBufferLineToString(h,!1,e,u)}function Gc(e,t){let s=t?"O":"[";return ue.ESC+s+e}function Kc(e,t){e=Math.floor(e);let s="";for(let i=0;i<e;i++)s+=t;return s}var d$=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function Ow(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Fp=50,h$=15,f$=50,m$=500,p$=" ",g$=new RegExp(p$,"g"),H0=class extends Ye{constructor(e,t,s,i,a,o,u,h,m){super(),this._element=e,this._screenElement=t,this._linkifier=s,this._bufferService=i,this._coreService=a,this._mouseService=o,this._optionsService=u,this._renderService=h,this._coreBrowserService=m,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Kn,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new be),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new be),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new be),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new be),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=f=>this._handleMouseMove(f),this._mouseUpListener=f=>this._handleMouseUp(f),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(f=>this._handleTrim(f)),this._register(this._bufferService.buffers.onBufferActivate(f=>this._handleBufferActivate(f))),this.enable(),this._model=new d$(this._bufferService),this._activeSelectionMode=0,this._register(Ot(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(f=>{f.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let s=this._bufferService.buffer,i=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let a=e[0]<t[0]?e[0]:t[0],o=e[0]<t[0]?t[0]:e[0];for(let u=e[1];u<=t[1];u++){let h=s.translateBufferLineToString(u,!0,a,o);i.push(h)}}else{let a=e[1]===t[1]?t[0]:void 0;i.push(s.translateBufferLineToString(e[1],!0,e[0],a));for(let o=e[1]+1;o<=t[1]-1;o++){let u=s.lines.get(o),h=s.translateBufferLineToString(o,!0);u?.isWrapped?i[i.length-1]+=h:i.push(h)}if(e[1]!==t[1]){let o=s.lines.get(t[1]),u=s.translateBufferLineToString(t[1],!0,0,t[0]);o&&o.isWrapped?i[i.length-1]+=u:i.push(u)}}return i.map(a=>a.replace(g$," ")).join(XN?`\r
|
|
149
|
-
`:`
|
|
150
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),uv&&e&&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(e){let t=this._getMouseBufferCoords(e),s=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!s||!i||!t?!1:this._areCoordsInSelection(t,s,i)}isCellInSelection(e,t){let s=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!s||!i?!1:this._areCoordsInSelection([e,t],s,i)}_areCoordsInSelection(e,t,s){return e[1]>t[1]&&e[1]<s[1]||t[1]===s[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<s[0]||t[1]<s[1]&&e[1]===s[1]&&e[0]<s[0]||t[1]<s[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let s=this._linkifier.currentLink?.link?.range;if(s)return this._model.selectionStart=[s.start.x-1,s.start.y-1],this._model.selectionStartLength=Ow(s,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let i=this._getMouseBufferCoords(e);return i?(this._selectWordAt(i,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=cv(this._coreBrowserService.window,e,this._screenElement)[1],s=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=s?0:(t>s&&(t-=s),t=Math.min(Math.max(t,-Fp),Fp),t/=Fp,t/Math.abs(t)+Math.round(t*(h$-1)))}shouldForceSelection(e){return Oh?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),f$)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Oh&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let s=this._bufferService.buffer;if(this._model.selectionEnd[1]<s.lines.length){let i=s.lines.get(this._model.selectionEnd[1]);i&&i.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<m$&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let s=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(s&&s[0]!==void 0&&s[1]!==void 0){let i=i$(s[0]-1,s[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(i,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,s=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!s){this._oldHasSelection&&this._fireOnSelectionChange(e,t,s);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,s)}_fireOnSelectionChange(e,t,s){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=s,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let s=t;for(let i=0;t>=i;i++){let a=e.loadCell(i,this._workCell).getChars().length;this._workCell.getWidth()===0?s--:a>1&&t!==i&&(s+=a-1)}return s}setSelection(e,t,s){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=s,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,s=!0,i=!0){if(e[0]>=this._bufferService.cols)return;let a=this._bufferService.buffer,o=a.lines.get(e[1]);if(!o)return;let u=a.translateBufferLineToString(e[1],!1),h=this._convertViewportColToCharacterIndex(o,e[0]),m=h,f=e[0]-h,p=0,b=0,x=0,_=0;if(u.charAt(h)===" "){for(;h>0&&u.charAt(h-1)===" ";)h--;for(;m<u.length&&u.charAt(m+1)===" ";)m++}else{let C=e[0],E=e[0];o.getWidth(C)===0&&(p++,C--),o.getWidth(E)===2&&(b++,E++);let T=o.getString(E).length;for(T>1&&(_+=T-1,m+=T-1);C>0&&h>0&&!this._isCharWordSeparator(o.loadCell(C-1,this._workCell));){o.loadCell(C-1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,C--):N>1&&(x+=N-1,h-=N-1),h--,C--}for(;E<o.length&&m+1<u.length&&!this._isCharWordSeparator(o.loadCell(E+1,this._workCell));){o.loadCell(E+1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===2?(b++,E++):N>1&&(_+=N-1,m+=N-1),m++,E++}}m++;let y=h+f-p+x,S=Math.min(this._bufferService.cols,m-h+p+b-x-_);if(!(!t&&u.slice(h,m).trim()==="")){if(s&&y===0&&o.getCodePoint(0)!==32){let C=a.lines.get(e[1]-1);if(C&&o.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let E=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(E){let T=this._bufferService.cols-E.start;y-=T,S+=T}}}if(i&&y+S===this._bufferService.cols&&o.getCodePoint(this._bufferService.cols-1)!==32){let C=a.lines.get(e[1]+1);if(C?.isWrapped&&C.getCodePoint(0)!==32){let E=this._getWordAt([0,e[1]+1],!1,!1,!0);E&&(S+=E.length)}}return{start:y,length:S}}}_selectWordAt(e,t){let s=this._getWordAt(e,t);if(s){for(;s.start<0;)s.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[s.start,e[1]],this._model.selectionStartLength=s.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let s=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,s--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,s++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,s]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),s={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Ow(s,this._bufferService.cols)}};H0=Vt([Se(3,en),Se(4,Za),Se(5,sv),Se(6,tn),Se(7,fr),Se(8,hr)],H0);var Lw=class{constructor(){this._data={}}set(e,t,s){this._data[e]||(this._data[e]={}),this._data[e][t]=s}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},Bw=class{constructor(){this._color=new Lw,this._css=new Lw}setCss(e,t,s){this._css.set(e,t,s)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,s){this._color.set(e,t,s)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},ds=Object.freeze((()=>{let e=[Pt.toColor("#2e3436"),Pt.toColor("#cc0000"),Pt.toColor("#4e9a06"),Pt.toColor("#c4a000"),Pt.toColor("#3465a4"),Pt.toColor("#75507b"),Pt.toColor("#06989a"),Pt.toColor("#d3d7cf"),Pt.toColor("#555753"),Pt.toColor("#ef2929"),Pt.toColor("#8ae234"),Pt.toColor("#fce94f"),Pt.toColor("#729fcf"),Pt.toColor("#ad7fa8"),Pt.toColor("#34e2e2"),Pt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let s=0;s<216;s++){let i=t[s/36%6|0],a=t[s/6%6|0],o=t[s%6];e.push({css:as.toCss(i,a,o),rgba:as.toRgba(i,a,o)})}for(let s=0;s<24;s++){let i=8+s*10;e.push({css:as.toCss(i,i,i),rgba:as.toRgba(i,i,i)})}return e})()),Da=Pt.toColor("#ffffff"),Ec=Pt.toColor("#000000"),zw=Pt.toColor("#ffffff"),Iw=Ec,pc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},b$=Da,U0=class extends Ye{constructor(e){super(),this._optionsService=e,this._contrastCache=new Bw,this._halfContrastCache=new Bw,this._onChangeColors=this._register(new be),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Da,background:Ec,cursor:zw,cursorAccent:Iw,selectionForeground:void 0,selectionBackgroundTransparent:pc,selectionBackgroundOpaque:Mt.blend(Ec,pc),selectionInactiveBackgroundTransparent:pc,selectionInactiveBackgroundOpaque:Mt.blend(Ec,pc),scrollbarSliderBackground:Mt.opacity(Da,.2),scrollbarSliderHoverBackground:Mt.opacity(Da,.4),scrollbarSliderActiveBackground:Mt.opacity(Da,.5),overviewRulerBorder:Da,ansi:ds.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)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=St(e.foreground,Da),t.background=St(e.background,Ec),t.cursor=Mt.blend(t.background,St(e.cursor,zw)),t.cursorAccent=Mt.blend(t.background,St(e.cursorAccent,Iw)),t.selectionBackgroundTransparent=St(e.selectionBackground,pc),t.selectionBackgroundOpaque=Mt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=St(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Mt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?St(e.selectionForeground,jw):void 0,t.selectionForeground===jw&&(t.selectionForeground=void 0),Mt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Mt.opacity(t.selectionBackgroundTransparent,.3)),Mt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Mt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=St(e.scrollbarSliderBackground,Mt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=St(e.scrollbarSliderHoverBackground,Mt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=St(e.scrollbarSliderActiveBackground,Mt.opacity(t.foreground,.5)),t.overviewRulerBorder=St(e.overviewRulerBorder,b$),t.ansi=ds.slice(),t.ansi[0]=St(e.black,ds[0]),t.ansi[1]=St(e.red,ds[1]),t.ansi[2]=St(e.green,ds[2]),t.ansi[3]=St(e.yellow,ds[3]),t.ansi[4]=St(e.blue,ds[4]),t.ansi[5]=St(e.magenta,ds[5]),t.ansi[6]=St(e.cyan,ds[6]),t.ansi[7]=St(e.white,ds[7]),t.ansi[8]=St(e.brightBlack,ds[8]),t.ansi[9]=St(e.brightRed,ds[9]),t.ansi[10]=St(e.brightGreen,ds[10]),t.ansi[11]=St(e.brightYellow,ds[11]),t.ansi[12]=St(e.brightBlue,ds[12]),t.ansi[13]=St(e.brightMagenta,ds[13]),t.ansi[14]=St(e.brightCyan,ds[14]),t.ansi[15]=St(e.brightWhite,ds[15]),e.extendedAnsi){let s=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let i=0;i<s;i++)t.ansi[i+16]=St(e.extendedAnsi[i],ds[i+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){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[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(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()}}};U0=Vt([Se(0,tn)],U0);function St(e,t){if(e!==void 0)try{return Pt.toColor(e)}catch{}return t}var v$=class{constructor(...e){this._entries=new Map;for(let[t,s]of e)this.set(t,s)}set(e,t){let s=this._entries.get(e);return this._entries.set(e,t),s}forEach(e){for(let[t,s]of this._entries.entries())e(t,s)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},x$=class{constructor(){this._services=new v$,this._services.set(tv,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let s=hI(e).sort((o,u)=>o.index-u.index),i=[];for(let o of s){let u=this._services.get(o.id);if(!u)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${o.id._id}.`);i.push(u)}let a=s.length>0?s[0].index:t.length;if(t.length!==a)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...i)}},_$={trace:0,debug:1,info:2,warn:3,error:4,off:5},y$="xterm.js: ",F0=class extends Ye{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=_$[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":y$)+t,...s)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};F0=Vt([Se(0,tn)],F0);var Pw=class extends Ye{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new be),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new be),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new be),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let s=0;s<Math.min(e,this.length);s++)t[s]=this._array[this._getCyclicIndex(s)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,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(e,t,...s){if(t){for(let i=e;i<this._length-t;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let i=this._length-1;i>=e;i--)this._array[this._getCyclicIndex(i+s.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<s.length;i++)this._array[this._getCyclicIndex(e+i)]=s[i];if(s.length&&this.onInsertEmitter.fire({index:e,amount:s.length}),this._length+s.length>this._maxLength){let i=this._length+s.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}else this._length+=s.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,s){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+s<0)throw new Error("Cannot shift elements in list beyond index 0");if(s>0){for(let a=t-1;a>=0;a--)this.set(e+a+s,this.get(e+a));let i=e+t+s-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i<t;i++)this.set(e+i+s,this.get(e+i))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ke=3,ns=Object.freeze(new uu),Wd=0,Vp=2,Nc=class t3{constructor(t,s,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ke);let a=s||Kn.fromCharData([0,_N,1,0]);for(let o=0;o<t;++o)this.setCell(o,a);this.length=t}get(t){let s=this._data[t*Ke+0],i=s&2097151;return[this._data[t*Ke+1],s&2097152?this._combined[t]:i?Xr(i):"",s>>22,s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i]}set(t,s){this._data[t*Ke+1]=s[0],s[1].length>1?(this._combined[t]=s[1],this._data[t*Ke+0]=t|2097152|s[2]<<22):this._data[t*Ke+0]=s[1].charCodeAt(0)|s[2]<<22}getWidth(t){return this._data[t*Ke+0]>>22}hasWidth(t){return this._data[t*Ke+0]&12582912}getFg(t){return this._data[t*Ke+1]}getBg(t){return this._data[t*Ke+2]}hasContent(t){return this._data[t*Ke+0]&4194303}getCodePoint(t){let s=this._data[t*Ke+0];return s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s&2097151}isCombined(t){return this._data[t*Ke+0]&2097152}getString(t){let s=this._data[t*Ke+0];return s&2097152?this._combined[t]:s&2097151?Xr(s&2097151):""}isProtected(t){return this._data[t*Ke+2]&536870912}loadCell(t,s){return Wd=t*Ke,s.content=this._data[Wd+0],s.fg=this._data[Wd+1],s.bg=this._data[Wd+2],s.content&2097152&&(s.combinedData=this._combined[t]),s.bg&268435456&&(s.extended=this._extendedAttrs[t]),s}setCell(t,s){s.content&2097152&&(this._combined[t]=s.combinedData),s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*Ke+0]=s.content,this._data[t*Ke+1]=s.fg,this._data[t*Ke+2]=s.bg}setCellFromCodepoint(t,s,i,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*Ke+0]=s|i<<22,this._data[t*Ke+1]=a.fg,this._data[t*Ke+2]=a.bg}addCodepointToCell(t,s,i){let a=this._data[t*Ke+0];a&2097152?this._combined[t]+=Xr(s):a&2097151?(this._combined[t]=Xr(a&2097151)+Xr(s),a&=-2097152,a|=2097152):a=s|1<<22,i&&(a&=-12582913,a|=i<<22),this._data[t*Ke+0]=a}insertCells(t,s,i){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),s<this.length-t){let a=new Kn;for(let o=this.length-t-s-1;o>=0;--o)this.setCell(t+s+o,this.loadCell(t+o,a));for(let o=0;o<s;++o)this.setCell(t+o,i)}else for(let a=t;a<this.length;++a)this.setCell(a,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(t,s,i){if(t%=this.length,s<this.length-t){let a=new Kn;for(let o=0;o<this.length-t-s;++o)this.setCell(t+o,this.loadCell(t+s+o,a));for(let o=this.length-s;o<this.length;++o)this.setCell(o,i)}else for(let a=t;a<this.length;++a)this.setCell(a,i);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,i)}replaceCells(t,s,i,a=!1){if(a){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,i),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,i);t<s&&t<this.length;)this.isProtected(t)||this.setCell(t,i),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,i);t<s&&t<this.length;)this.setCell(t++,i)}resize(t,s){if(t===this.length)return this._data.length*4*Vp<this._data.buffer.byteLength;let i=t*Ke;if(t>this.length){if(this._data.buffer.byteLength>=i*4)this._data=new Uint32Array(this._data.buffer,0,i);else{let a=new Uint32Array(i);a.set(this._data),this._data=a}for(let a=this.length;a<t;++a)this.setCell(a,s)}else{this._data=this._data.subarray(0,i);let a=Object.keys(this._combined);for(let u=0;u<a.length;u++){let h=parseInt(a[u],10);h>=t&&delete this._combined[h]}let o=Object.keys(this._extendedAttrs);for(let u=0;u<o.length;u++){let h=parseInt(o[u],10);h>=t&&delete this._extendedAttrs[h]}}return this.length=t,i*4*Vp<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Vp<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,s=!1){if(s){for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,t);return}this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let s in t._combined)this._combined[s]=t._combined[s];this._extendedAttrs={};for(let s in t._extendedAttrs)this._extendedAttrs[s]=t._extendedAttrs[s];this.isWrapped=t.isWrapped}clone(){let t=new t3(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let s in this._combined)t._combined[s]=this._combined[s];for(let s in this._extendedAttrs)t._extendedAttrs[s]=this._extendedAttrs[s];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ke+0]&4194303)return t+(this._data[t*Ke+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ke+0]&4194303||this._data[t*Ke+2]&50331648)return t+(this._data[t*Ke+0]>>22);return 0}copyCellsFrom(t,s,i,a,o){let u=t._data;if(o)for(let m=a-1;m>=0;m--){for(let f=0;f<Ke;f++)this._data[(i+m)*Ke+f]=u[(s+m)*Ke+f];u[(s+m)*Ke+2]&268435456&&(this._extendedAttrs[i+m]=t._extendedAttrs[s+m])}else for(let m=0;m<a;m++){for(let f=0;f<Ke;f++)this._data[(i+m)*Ke+f]=u[(s+m)*Ke+f];u[(s+m)*Ke+2]&268435456&&(this._extendedAttrs[i+m]=t._extendedAttrs[s+m])}let h=Object.keys(t._combined);for(let m=0;m<h.length;m++){let f=parseInt(h[m],10);f>=s&&(this._combined[f-s+i]=t._combined[f])}}translateToString(t,s,i,a){s=s??0,i=i??this.length,t&&(i=Math.min(i,this.getTrimmedLength())),a&&(a.length=0);let o="";for(;s<i;){let u=this._data[s*Ke+0],h=u&2097151,m=u&2097152?this._combined[s]:h?Xr(h):Qr;if(o+=m,a)for(let f=0;f<m.length;++f)a.push(s);s+=u>>22||1}return a&&a.push(s),o}};function S$(e,t,s,i,a,o){let u=[];for(let h=0;h<e.length-1;h++){let m=h,f=e.get(++m);if(!f.isWrapped)continue;let p=[e.get(h)];for(;m<e.length&&f.isWrapped;)p.push(f),f=e.get(++m);if(!o&&i>=h&&i<m){h+=p.length-1;continue}let b=0,x=Wc(p,b,t),_=1,y=0;for(;_<p.length;){let C=Wc(p,_,t),E=C-y,T=s-x,N=Math.min(E,T);p[b].copyCellsFrom(p[_],y,x,N,!1),x+=N,x===s&&(b++,x=0),y+=N,y===C&&(_++,y=0),x===0&&b!==0&&p[b-1].getWidth(s-1)===2&&(p[b].copyCellsFrom(p[b-1],s-1,x++,1,!1),p[b-1].setCell(s-1,a))}p[b].replaceCells(x,s,a);let S=0;for(let C=p.length-1;C>0&&(C>b||p[C].getTrimmedLength()===0);C--)S++;S>0&&(u.push(h+p.length-S),u.push(S)),h+=p.length-1}return u}function w$(e,t){let s=[],i=0,a=t[i],o=0;for(let u=0;u<e.length;u++)if(a===u){let h=t[++i];e.onDeleteEmitter.fire({index:u-o,amount:h}),u+=h-1,o+=h,a=t[++i]}else s.push(u);return{layout:s,countRemoved:o}}function k$(e,t){let s=[];for(let i=0;i<t.length;i++)s.push(e.get(t[i]));for(let i=0;i<s.length;i++)e.set(i,s[i]);e.length=t.length}function C$(e,t,s){let i=[],a=e.map((m,f)=>Wc(e,f,t)).reduce((m,f)=>m+f),o=0,u=0,h=0;for(;h<a;){if(a-h<s){i.push(a-h);break}o+=s;let m=Wc(e,u,t);o>m&&(o-=m,u++);let f=e[u].getWidth(o-1)===2;f&&o--;let p=f?s-1:s;i.push(p),h+=p}return i}function Wc(e,t,s){if(t===e.length-1)return e[t].getTrimmedLength();let i=!e[t].hasContent(s-1)&&e[t].getWidth(s-1)===1,a=e[t+1].getWidth(0)===2;return i&&a?s-1:s}var s3=class n3{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=n3._nextId++,this._onDispose=this.register(new be),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),qa(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};s3._nextId=1;var E$=s3,ps={},Oa=ps.B;ps[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ps.A={"#":"£"};ps.B=void 0;ps[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ps.C=ps[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ps.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ps.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ps.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ps.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ps.E=ps[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ps.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ps.H=ps[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ps["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var $w=4294967295,Hw=class{constructor(e,t,s){this._hasScrollback=e,this._optionsService=t,this._bufferService=s,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=ns.clone(),this.savedCharset=Oa,this.markers=[],this._nullCell=Kn.fromCharData([0,_N,1,0]),this._whitespaceCell=Kn.fromCharData([0,Qr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Lh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new Pw(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new jh),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new jh),this._whitespaceCell}getBlankLine(e,t){return new Nc(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>$w?$w:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=ns);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new Pw(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let s=this.getNullCell(ns),i=0,a=this._getCorrectBufferLength(t);if(a>this.lines.maxLength&&(this.lines.maxLength=a),this.lines.length>0){if(this._cols<e)for(let u=0;u<this.lines.length;u++)i+=+this.lines.get(u).resize(e,s);let o=0;if(this._rows<t)for(let u=this._rows;u<t;u++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Nc(e,s)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new Nc(e,s)));else for(let u=this._rows;u>t;u--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(a<this.lines.maxLength){let u=this.lines.length-a;u>0&&(this.lines.trimStart(u),this.ybase=Math.max(this.ybase-u,0),this.ydisp=Math.max(this.ydisp-u,0),this.savedY=Math.max(this.savedY-u,0)),this.lines.maxLength=a}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),o&&(this.y+=o),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let o=0;o<this.lines.length;o++)i+=+this.lines.get(o).resize(e,s);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),i>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let s=this._optionsService.rawOptions.reflowCursorLine,i=S$(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(ns),s);if(i.length>0){let a=w$(this.lines,i);k$(this.lines,a.layout),this._reflowLargerAdjustViewport(e,t,a.countRemoved)}}_reflowLargerAdjustViewport(e,t,s){let i=this.getNullCell(ns),a=s;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Nc(e,i))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-s,0)}_reflowSmaller(e,t){let s=this._optionsService.rawOptions.reflowCursorLine,i=this.getNullCell(ns),a=[],o=0;for(let u=this.lines.length-1;u>=0;u--){let h=this.lines.get(u);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;let m=[h];for(;h.isWrapped&&u>0;)h=this.lines.get(--u),m.unshift(h);if(!s){let N=this.ybase+this.y;if(N>=u&&N<u+m.length)continue}let f=m[m.length-1].getTrimmedLength(),p=C$(m,this._cols,e),b=p.length-m.length,x;this.ybase===0&&this.y!==this.lines.length-1?x=Math.max(0,this.y-this.lines.maxLength+b):x=Math.max(0,this.lines.length-this.lines.maxLength+b);let _=[];for(let N=0;N<b;N++){let M=this.getBlankLine(ns,!0);_.push(M)}_.length>0&&(a.push({start:u+m.length+o,newLines:_}),o+=_.length),m.push(..._);let y=p.length-1,S=p[y];S===0&&(y--,S=p[y]);let C=m.length-b-1,E=f;for(;C>=0;){let N=Math.min(E,S);if(m[y]===void 0)break;if(m[y].copyCellsFrom(m[C],E-N,S-N,N,!0),S-=N,S===0&&(y--,S=p[y]),E-=N,E===0){C--;let M=Math.max(C,0);E=Wc(m,M,this._cols)}}for(let N=0;N<m.length;N++)p[N]<e&&m[N].setCell(p[N],i);let T=b-x;for(;T-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+o)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+b,this.ybase+t-1)}if(a.length>0){let u=[],h=[];for(let S=0;S<this.lines.length;S++)h.push(this.lines.get(S));let m=this.lines.length,f=m-1,p=0,b=a[p];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o);let x=0;for(let S=Math.min(this.lines.maxLength-1,m+o-1);S>=0;S--)if(b&&b.start>f+x){for(let C=b.newLines.length-1;C>=0;C--)this.lines.set(S--,b.newLines[C]);S++,u.push({index:f+1,amount:b.newLines.length}),x+=b.newLines.length,b=a[++p]}else this.lines.set(S,h[f--]);let _=0;for(let S=u.length-1;S>=0;S--)u[S].index+=_,this.lines.onInsertEmitter.fire(u[S]),_+=u[S].amount;let y=Math.max(0,m+o-this.lines.maxLength);y>0&&this.lines.onTrimEmitter.fire(y)}}translateBufferLineToString(e,t,s=0,i){let a=this.lines.get(e);return a?a.translateToString(t,s,i):""}getWrappedRangeForLine(e){let t=e,s=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;s+1<this.lines.length&&this.lines.get(s+1).isWrapped;)s++;return{first:t,last:s}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new E$(e);return this.markers.push(t),t.register(this.lines.onTrim(s=>{t.line-=s,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(s=>{t.line>=s.index&&(t.line+=s.amount)})),t.register(this.lines.onDelete(s=>{t.line>=s.index&&t.line<s.index+s.amount&&t.dispose(),t.line>s.index&&(t.line-=s.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},N$=class extends Ye{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new be),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 Hw(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Hw(!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,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},i3=2,r3=1,V0=class extends Ye{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new be),this.onResize=this._onResize.event,this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,i3),this.rows=Math.max(e.rawOptions.rows||0,r3),this.buffers=this._register(new N$(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let s=this.cols!==e,i=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:s,rowsChanged:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let s=this.buffer,i;i=this._cachedBlankLine,(!i||i.length!==this.cols||i.getFg(0)!==e.fg||i.getBg(0)!==e.bg)&&(i=s.getBlankLine(e,t),this._cachedBlankLine=i),i.isWrapped=t;let a=s.ybase+s.scrollTop,o=s.ybase+s.scrollBottom;if(s.scrollTop===0){let u=s.lines.isFull;o===s.lines.length-1?u?s.lines.recycle().copyFrom(i):s.lines.push(i.clone()):s.lines.splice(o+1,0,i.clone()),u?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{let u=o-a+1;s.lines.shiftElements(a+1,u-1,-1),s.lines.set(o,i.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(e,t){let s=this.buffer;if(e<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);let i=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),i!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))}};V0=Vt([Se(0,tn)],V0);var Ho={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Oh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},T$=["normal","bold","100","200","300","400","500","600","700","800","900"],A$=class extends Ye{constructor(e){super(),this._onOptionChange=this._register(new be),this.onOptionChange=this._onOptionChange.event;let t={...Ho};for(let s in e)if(s in t)try{let i=e[s];t[s]=this._sanitizeAndValidateOption(s,i)}catch(i){console.error(i)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(Ot(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(s=>{s===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(s=>{e.indexOf(s)!==-1&&t()})}_setupOptions(){let e=s=>{if(!(s in Ho))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},t=(s,i)=>{if(!(s in Ho))throw new Error(`No option with key "${s}"`);i=this._sanitizeAndValidateOption(s,i),this.rawOptions[s]!==i&&(this.rawOptions[s]=i,this._onOptionChange.fire(s))};for(let s in this.rawOptions){let i={get:e.bind(this,s),set:t.bind(this,s)};Object.defineProperty(this.options,s,i)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Ho[e]),!M$(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Ho[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=T$.includes(t)?t:Ho[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function M$(e){return e==="block"||e==="underline"||e==="bar"}function Tc(e,t=5){if(typeof e!="object")return e;let s=Array.isArray(e)?[]:{};for(let i in e)s[i]=t<=1?e[i]:e[i]&&Tc(e[i],t-1);return s}var Uw=Object.freeze({insertMode:!1}),Fw=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),q0=class extends Ye{constructor(e,t,s){super(),this._bufferService=e,this._logService=t,this._optionsService=s,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new be),this.onData=this._onData.event,this._onUserInput=this._register(new be),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new be),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new be),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Tc(Uw),this.decPrivateModes=Tc(Fw)}reset(){this.modes=Tc(Uw),this.decPrivateModes=Tc(Fw)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let s=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&s.ybase!==s.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};q0=Vt([Se(0,en),Se(1,CN),Se(2,tn)],q0);var Vw={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function qp(e,t){let s=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(s|=64,s|=e.action):(s|=e.button&3,e.button&4&&(s|=64),e.button&8&&(s|=128),e.action===32?s|=32:e.action===0&&!t&&(s|=3)),s}var Gp=String.fromCharCode,qw={DEFAULT:e=>{let t=[qp(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Gp(t[0])}${Gp(t[1])}${Gp(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${qp(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${qp(e,!0)};${e.x};${e.y}${t}`}},G0=class extends Ye{constructor(e,t,s){super(),this._bufferService=e,this._coreService=t,this._optionsService=s,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new be),this.onProtocolChange=this._onProtocolChange.event;for(let i of Object.keys(Vw))this.addProtocol(i,Vw[i]);for(let i of Object.keys(qw))this.addEncoding(i,qw[i]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,s){if(e.deltaY===0||e.shiftKey||t===void 0||s===void 0)return 0;let i=t/s,a=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=i+0,Math.abs(e.deltaY)<50&&(a*=.3),this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,s){if(s){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};G0=Vt([Se(0,en),Se(1,Za),Se(2,tn)],G0);var Kp=[[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]],j$=[[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]],hs;function R$(e,t){let s=0,i=t.length-1,a;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=s;)if(a=s+i>>1,e>t[a][1])s=a+1;else if(e<t[a][0])i=a-1;else return!0;return!1}var D$=class{constructor(){if(this.version="6",!hs){hs=new Uint8Array(65536),hs.fill(1),hs[0]=0,hs.fill(0,1,32),hs.fill(0,127,160),hs.fill(2,4352,4448),hs[9001]=2,hs[9002]=2,hs.fill(2,11904,42192),hs[12351]=1,hs.fill(2,44032,55204),hs.fill(2,63744,64256),hs.fill(2,65040,65050),hs.fill(2,65072,65136),hs.fill(2,65280,65377),hs.fill(2,65504,65511);for(let e=0;e<Kp.length;++e)hs.fill(0,Kp[e][0],Kp[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?hs[e]:R$(e,j$)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let s=this.wcwidth(e),i=s===0&&t!==0;if(i){let a=Ia.extractWidth(t);a===0?i=!1:a>s&&(s=a)}return Ia.createPropertyValue(0,s,i)}},Ia=class ch{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new be,this.onChange=this._onChange.event;let t=new D$;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,s,i=!1){return(t&16777215)<<3|(s&3)<<1|(i?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let s=0,i=0,a=t.length;for(let o=0;o<a;++o){let u=t.charCodeAt(o);if(55296<=u&&u<=56319){if(++o>=a)return s+this.wcwidth(u);let f=t.charCodeAt(o);56320<=f&&f<=57343?u=(u-55296)*1024+f-56320+65536:s+=this.wcwidth(f)}let h=this.charProperties(u,i),m=ch.extractWidth(h);ch.extractShouldJoin(h)&&(m-=ch.extractWidth(i)),s+=m,i=h}return s}charProperties(t,s){return this._activeProvider.charProperties(t,s)}},O$=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function Gw(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),s=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);s&&t&&(s.isWrapped=t[3]!==0&&t[3]!==32)}var gc=2147483647,L$=256,a3=class K0{constructor(t=32,s=32){if(this.maxLength=t,this.maxSubParamsLength=s,s>L$)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(s),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let s=new K0;if(!t.length)return s;for(let i=Array.isArray(t[0])?1:0;i<t.length;++i){let a=t[i];if(Array.isArray(a))for(let o=0;o<a.length;++o)s.addSubParam(a[o]);else s.addParam(a)}return s}clone(){let t=new K0(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let s=0;s<this.length;++s){t.push(this.params[s]);let i=this._subParamsIdx[s]>>8,a=this._subParamsIdx[s]&255;a-i>0&&t.push(Array.prototype.slice.call(this._subParams,i,a))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>gc?gc:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>gc?gc:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let s=this._subParamsIdx[t]>>8,i=this._subParamsIdx[t]&255;return i-s>0?this._subParams.subarray(s,i):null}getSubParamsAll(){let t={};for(let s=0;s<this.length;++s){let i=this._subParamsIdx[s]>>8,a=this._subParamsIdx[s]&255;a-i>0&&(t[s]=this._subParams.slice(i,a))}return t}addDigit(t){let s;if(this._rejectDigits||!(s=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let i=this._digitIsSub?this._subParams:this.params,a=i[s-1];i[s-1]=~a?Math.min(a*10+t,gc):t}},bc=[],B$=class{constructor(){this._state=0,this._active=bc,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(t),{dispose:()=>{let i=s.indexOf(t);i!==-1&&s.splice(i,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=bc}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=bc,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||bc,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,s){if(!this._active.length)this._handlerFb(this._id,"PUT",Jh(e,t,s));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,s)}start(){this.reset(),this._state=1}put(e,t,s){if(this._state!==3){if(this._state===1)for(;t<s;){let i=e[t++];if(i===59){this._state=2,this._start();break}if(i<48||57<i){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+i-48}this._state===2&&s-t>0&&this._put(e,t,s)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let s=!1,i=this._active.length-1,a=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,s=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&s===!1){for(;i>=0&&(s=this._active[i].end(e),s!==!0);i--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,s;i--}for(;i>=0;i--)if(s=this._active[i].end(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,s}this._active=bc,this._id=-1,this._state=0}}},Nn=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,s){this._hitLimit||(this._data+=Jh(e,t,s),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(s=>(this._data="",this._hitLimit=!1,s));return this._data="",this._hitLimit=!1,t}},vc=[],z$=class{constructor(){this._handlers=Object.create(null),this._active=vc,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=vc}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(t),{dispose:()=>{let i=s.indexOf(t);i!==-1&&s.splice(i,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=vc,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||vc,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let s=this._active.length-1;s>=0;s--)this._active[s].hook(t)}put(e,t,s){if(!this._active.length)this._handlerFb(this._ident,"PUT",Jh(e,t,s));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,s)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let s=!1,i=this._active.length-1,a=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,s=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&s===!1){for(;i>=0&&(s=this._active[i].unhook(e),s!==!0);i--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,s;i--}for(;i>=0;i--)if(s=this._active[i].unhook(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,s}this._active=vc,this._ident=0}},Ac=new a3;Ac.addParam(0);var Kw=class{constructor(e){this._handler=e,this._data="",this._params=Ac,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Ac,this._data="",this._hitLimit=!1}put(e,t,s){this._hitLimit||(this._data+=Jh(e,t,s),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(s=>(this._params=Ac,this._data="",this._hitLimit=!1,s));return this._params=Ac,this._data="",this._hitLimit=!1,t}},I$=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,s,i){this.table[t<<8|e]=s<<4|i}addMany(e,t,s,i){for(let a=0;a<e.length;a++)this.table[t<<8|e[a]]=s<<4|i}},Vn=160,P$=(function(){let e=new I$(4095),t=Array.apply(null,Array(256)).map((h,m)=>m),s=(h,m)=>t.slice(h,m),i=s(32,127),a=s(0,24);a.push(25),a.push.apply(a,s(28,32));let o=s(0,14),u;e.setDefault(1,0),e.addMany(i,0,2,0);for(u in o)e.addMany([24,26,153,154],u,3,0),e.addMany(s(128,144),u,3,0),e.addMany(s(144,152),u,3,0),e.add(156,u,0,0),e.add(27,u,11,1),e.add(157,u,4,8),e.addMany([152,158,159],u,0,7),e.add(155,u,11,3),e.add(144,u,11,9);return e.addMany(a,0,3,0),e.addMany(a,1,3,1),e.add(127,1,0,1),e.addMany(a,8,0,8),e.addMany(a,3,3,3),e.add(127,3,0,3),e.addMany(a,4,3,4),e.add(127,4,0,4),e.addMany(a,6,3,6),e.addMany(a,5,3,5),e.add(127,5,0,5),e.addMany(a,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(i,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(s(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(i,7,0,7),e.addMany(a,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(s(64,127),3,7,0),e.addMany(s(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(s(48,60),4,8,4),e.addMany(s(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(s(32,64),6,0,6),e.add(127,6,0,6),e.addMany(s(64,127),6,0,0),e.addMany(s(32,48),3,9,5),e.addMany(s(32,48),5,9,5),e.addMany(s(48,64),5,0,6),e.addMany(s(64,127),5,7,0),e.addMany(s(32,48),4,9,5),e.addMany(s(32,48),1,9,2),e.addMany(s(32,48),2,9,2),e.addMany(s(48,127),2,10,0),e.addMany(s(48,80),1,10,0),e.addMany(s(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(s(96,127),1,10,0),e.add(80,1,11,9),e.addMany(a,9,0,9),e.add(127,9,0,9),e.addMany(s(28,32),9,0,9),e.addMany(s(32,48),9,9,12),e.addMany(s(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(a,11,0,11),e.addMany(s(32,128),11,0,11),e.addMany(s(28,32),11,0,11),e.addMany(a,10,0,10),e.add(127,10,0,10),e.addMany(s(28,32),10,0,10),e.addMany(s(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(s(32,48),10,9,12),e.addMany(a,12,0,12),e.add(127,12,0,12),e.addMany(s(28,32),12,0,12),e.addMany(s(32,48),12,9,12),e.addMany(s(48,64),12,0,11),e.addMany(s(64,127),12,12,13),e.addMany(s(64,127),10,12,13),e.addMany(s(64,127),9,12,13),e.addMany(a,13,13,13),e.addMany(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Vn,0,2,0),e.add(Vn,8,5,8),e.add(Vn,6,0,6),e.add(Vn,11,0,11),e.add(Vn,13,13,13),e})(),$$=class extends Ye{constructor(e=P$){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new a3,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,s,i)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,s)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Ot(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new B$),this._dcsParser=this._register(new z$),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let s=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=e.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let a=0;a<e.intermediates.length;++a){let o=e.intermediates.charCodeAt(a);if(32>o||o>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=o}}if(e.final.length!==1)throw new Error("final must be a single byte");let i=e.final.charCodeAt(0);if(t[0]>i||i>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return s<<=8,s|=i,s}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let s=this._identifier(e,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);let i=this._escHandlers[s];return i.push(t),{dispose:()=>{let a=i.indexOf(t);a!==-1&&i.splice(a,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let s=this._identifier(e);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);let i=this._csiHandlers[s];return i.push(t),{dispose:()=>{let a=i.indexOf(t);a!==-1&&i.splice(a,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,t,s,i,a){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=s,this._parseStack.transition=i,this._parseStack.chunkPos=a}parse(e,t,s){let i=0,a=0,o=0,u;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let h=this._parseStack.handlers,m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&m>-1){for(;m>=0&&(u=h[m](this._params),u!==!0);m--)if(u instanceof Promise)return this._parseStack.handlerPos=m,u}this._parseStack.handlers=[];break;case 4:if(s===!1&&m>-1){for(;m>=0&&(u=h[m](),u!==!0);m--)if(u instanceof Promise)return this._parseStack.handlerPos=m,u}this._parseStack.handlers=[];break;case 6:if(i=e[this._parseStack.chunkPos],u=this._dcsParser.unhook(i!==24&&i!==26,s),u)return u;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],u=this._oscParser.end(i!==24&&i!==26,s),u)return u;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let h=o;h<t;++h){switch(i=e[h],a=this._transitions.table[this.currentState<<8|(i<160?i:Vn)],a>>4){case 2:for(let x=h+1;;++x){if(x>=t||(i=e[x])<32||i>126&&i<Vn){this._printHandler(e,h,x),h=x-1;break}if(++x>=t||(i=e[x])<32||i>126&&i<Vn){this._printHandler(e,h,x),h=x-1;break}if(++x>=t||(i=e[x])<32||i>126&&i<Vn){this._printHandler(e,h,x),h=x-1;break}if(++x>=t||(i=e[x])<32||i>126&&i<Vn){this._printHandler(e,h,x),h=x-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:i,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let m=this._csiHandlers[this._collect<<8|i],f=m?m.length-1:-1;for(;f>=0&&(u=m[f](this._params),u!==!0);f--)if(u instanceof Promise)return this._preserveStack(3,m,f,a,h),u;f<0&&this._csiHandlerFb(this._collect<<8|i,this._params),this.precedingJoinState=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++h<t&&(i=e[h])>47&&i<60);h--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let p=this._escHandlers[this._collect<<8|i],b=p?p.length-1:-1;for(;b>=0&&(u=p[b](),u!==!0);b--)if(u instanceof Promise)return this._preserveStack(4,p,b,a,h),u;b<0&&this._escHandlerFb(this._collect<<8|i),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|i,this._params);break;case 13:for(let x=h+1;;++x)if(x>=t||(i=e[x])===24||i===26||i===27||i>127&&i<Vn){this._dcsParser.put(e,h,x),h=x-1;break}break;case 14:if(u=this._dcsParser.unhook(i!==24&&i!==26),u)return this._preserveStack(6,[],0,a,h),u;i===27&&(a|=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 x=h+1;;x++)if(x>=t||(i=e[x])<32||i>127&&i<Vn){this._oscParser.put(e,h,x),h=x-1;break}break;case 6:if(u=this._oscParser.end(i!==24&&i!==26),u)return this._preserveStack(5,[],0,a,h),u;i===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=a&15}}},H$=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,U$=/^[\da-f]+$/;function Ww(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let s=H$.exec(t);if(s){let i=s[1]?15:s[4]?255:s[7]?4095:65535;return[Math.round(parseInt(s[1]||s[4]||s[7]||s[10],16)/i*255),Math.round(parseInt(s[2]||s[5]||s[8]||s[11],16)/i*255),Math.round(parseInt(s[3]||s[6]||s[9]||s[12],16)/i*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),U$.exec(t)&&[3,6,9,12].includes(t.length))){let s=t.length/3,i=[0,0,0];for(let a=0;a<3;++a){let o=parseInt(t.slice(s*a,s*a+s),16);i[a]=s===1?o<<4:s===2?o:s===3?o>>4:o>>8}return i}}function Wp(e,t){let s=e.toString(16),i=s.length<2?"0"+s:s;switch(t){case 4:return s[0];case 8:return i;case 12:return(i+i).slice(0,3);default:return i+i}}function F$(e,t=16){let[s,i,a]=e;return`rgb:${Wp(s,t)}/${Wp(i,t)}/${Wp(a,t)}`}var V$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Wr=131072,Yw=10;function Xw(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var Zw=5e3,Qw=0,q$=class extends Ye{constructor(e,t,s,i,a,o,u,h,m=new $$){super(),this._bufferService=e,this._charsetService=t,this._coreService=s,this._logService=i,this._optionsService=a,this._oscLinkService=o,this._coreMouseService=u,this._unicodeService=h,this._parser=m,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new uI,this._utf8Decoder=new dI,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=ns.clone(),this._eraseAttrDataInternal=ns.clone(),this._onRequestBell=this._register(new be),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new be),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new be),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new be),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new be),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new be),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new be),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new be),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new be),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new be),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new be),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new be),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 W0(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._parser.setCsiHandlerFallback((f,p)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(f),params:p.toArray()})}),this._parser.setEscHandlerFallback(f=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(f)})}),this._parser.setExecuteHandlerFallback(f=>{this._logService.debug("Unknown EXECUTE code: ",{code:f})}),this._parser.setOscHandlerFallback((f,p,b)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:p,data:b})}),this._parser.setDcsHandlerFallback((f,p,b)=>{p==="HOOK"&&(b=b.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:p,payload:b})}),this._parser.setPrintHandler((f,p,b)=>this.print(f,p,b)),this._parser.registerCsiHandler({final:"@"},f=>this.insertChars(f)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},f=>this.scrollLeft(f)),this._parser.registerCsiHandler({final:"A"},f=>this.cursorUp(f)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},f=>this.scrollRight(f)),this._parser.registerCsiHandler({final:"B"},f=>this.cursorDown(f)),this._parser.registerCsiHandler({final:"C"},f=>this.cursorForward(f)),this._parser.registerCsiHandler({final:"D"},f=>this.cursorBackward(f)),this._parser.registerCsiHandler({final:"E"},f=>this.cursorNextLine(f)),this._parser.registerCsiHandler({final:"F"},f=>this.cursorPrecedingLine(f)),this._parser.registerCsiHandler({final:"G"},f=>this.cursorCharAbsolute(f)),this._parser.registerCsiHandler({final:"H"},f=>this.cursorPosition(f)),this._parser.registerCsiHandler({final:"I"},f=>this.cursorForwardTab(f)),this._parser.registerCsiHandler({final:"J"},f=>this.eraseInDisplay(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},f=>this.eraseInDisplay(f,!0)),this._parser.registerCsiHandler({final:"K"},f=>this.eraseInLine(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},f=>this.eraseInLine(f,!0)),this._parser.registerCsiHandler({final:"L"},f=>this.insertLines(f)),this._parser.registerCsiHandler({final:"M"},f=>this.deleteLines(f)),this._parser.registerCsiHandler({final:"P"},f=>this.deleteChars(f)),this._parser.registerCsiHandler({final:"S"},f=>this.scrollUp(f)),this._parser.registerCsiHandler({final:"T"},f=>this.scrollDown(f)),this._parser.registerCsiHandler({final:"X"},f=>this.eraseChars(f)),this._parser.registerCsiHandler({final:"Z"},f=>this.cursorBackwardTab(f)),this._parser.registerCsiHandler({final:"`"},f=>this.charPosAbsolute(f)),this._parser.registerCsiHandler({final:"a"},f=>this.hPositionRelative(f)),this._parser.registerCsiHandler({final:"b"},f=>this.repeatPrecedingCharacter(f)),this._parser.registerCsiHandler({final:"c"},f=>this.sendDeviceAttributesPrimary(f)),this._parser.registerCsiHandler({prefix:">",final:"c"},f=>this.sendDeviceAttributesSecondary(f)),this._parser.registerCsiHandler({final:"d"},f=>this.linePosAbsolute(f)),this._parser.registerCsiHandler({final:"e"},f=>this.vPositionRelative(f)),this._parser.registerCsiHandler({final:"f"},f=>this.hVPosition(f)),this._parser.registerCsiHandler({final:"g"},f=>this.tabClear(f)),this._parser.registerCsiHandler({final:"h"},f=>this.setMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"h"},f=>this.setModePrivate(f)),this._parser.registerCsiHandler({final:"l"},f=>this.resetMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"l"},f=>this.resetModePrivate(f)),this._parser.registerCsiHandler({final:"m"},f=>this.charAttributes(f)),this._parser.registerCsiHandler({final:"n"},f=>this.deviceStatus(f)),this._parser.registerCsiHandler({prefix:"?",final:"n"},f=>this.deviceStatusPrivate(f)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},f=>this.softReset(f)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},f=>this.setCursorStyle(f)),this._parser.registerCsiHandler({final:"r"},f=>this.setScrollRegion(f)),this._parser.registerCsiHandler({final:"s"},f=>this.saveCursor(f)),this._parser.registerCsiHandler({final:"t"},f=>this.windowOptions(f)),this._parser.registerCsiHandler({final:"u"},f=>this.restoreCursor(f)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},f=>this.insertColumns(f)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},f=>this.deleteColumns(f)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},f=>this.selectProtected(f)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},f=>this.requestMode(f,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},f=>this.requestMode(f,!1)),this._parser.setExecuteHandler(ue.BEL,()=>this.bell()),this._parser.setExecuteHandler(ue.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ue.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ue.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ue.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ue.BS,()=>this.backspace()),this._parser.setExecuteHandler(ue.HT,()=>this.tab()),this._parser.setExecuteHandler(ue.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ue.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(oh.IND,()=>this.index()),this._parser.setExecuteHandler(oh.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(oh.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Nn(f=>(this.setTitle(f),this.setIconName(f),!0))),this._parser.registerOscHandler(1,new Nn(f=>this.setIconName(f))),this._parser.registerOscHandler(2,new Nn(f=>this.setTitle(f))),this._parser.registerOscHandler(4,new Nn(f=>this.setOrReportIndexedColor(f))),this._parser.registerOscHandler(8,new Nn(f=>this.setHyperlink(f))),this._parser.registerOscHandler(10,new Nn(f=>this.setOrReportFgColor(f))),this._parser.registerOscHandler(11,new Nn(f=>this.setOrReportBgColor(f))),this._parser.registerOscHandler(12,new Nn(f=>this.setOrReportCursorColor(f))),this._parser.registerOscHandler(104,new Nn(f=>this.restoreIndexedColor(f))),this._parser.registerOscHandler(110,new Nn(f=>this.restoreFgColor(f))),this._parser.registerOscHandler(111,new Nn(f=>this.restoreBgColor(f))),this._parser.registerOscHandler(112,new Nn(f=>this.restoreCursorColor(f))),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(let f in ps)this._parser.registerEscHandler({intermediates:"(",final:f},()=>this.selectCharset("("+f)),this._parser.registerEscHandler({intermediates:")",final:f},()=>this.selectCharset(")"+f)),this._parser.registerEscHandler({intermediates:"*",final:f},()=>this.selectCharset("*"+f)),this._parser.registerEscHandler({intermediates:"+",final:f},()=>this.selectCharset("+"+f)),this._parser.registerEscHandler({intermediates:"-",final:f},()=>this.selectCharset("-"+f)),this._parser.registerEscHandler({intermediates:".",final:f},()=>this.selectCharset("."+f)),this._parser.registerEscHandler({intermediates:"/",final:f},()=>this.selectCharset("/"+f));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(f=>(this._logService.error("Parsing error: ",f),f)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Kw((f,p)=>this.requestStatusString(f,p)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,s,i){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=s,this._parseStack.position=i}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,s)=>setTimeout(()=>s("#SLOW_TIMEOUT"),Zw))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Zw} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let s,i=this._activeBuffer.x,a=this._activeBuffer.y,o=0,u=this._parseStack.paused;if(u){if(s=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(s),s;i=this._parseStack.cursorStartX,a=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Wr&&(o=this._parseStack.position+Wr)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,f=>String.fromCharCode(f)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(f=>f.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Wr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Wr))),u||this._dirtyRowTracker.clearRange(),e.length>Wr)for(let f=o;f<e.length;f+=Wr){let p=f+Wr<e.length?f+Wr:e.length,b=typeof e=="string"?this._stringDecoder.decode(e.substring(f,p),this._parseBuffer):this._utf8Decoder.decode(e.subarray(f,p),this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,b))return this._preserveStack(i,a,b,f),this._logSlowResolvingAsync(s),s}else if(!u){let f=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,f))return this._preserveStack(i,a,f,0),this._logSlowResolvingAsync(s),s}(this._activeBuffer.x!==i||this._activeBuffer.y!==a)&&this._onCursorMove.fire();let h=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),m=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);m<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(m,this._bufferService.rows-1),end:Math.min(h,this._bufferService.rows-1)})}print(e,t,s){let i,a,o=this._charsetService.charset,u=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,m=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,p=this._curAttrData,b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&s-t>0&&b.getWidth(this._activeBuffer.x-1)===2&&b.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let x=this._parser.precedingJoinState;for(let _=t;_<s;++_){if(i=e[_],i<127&&o){let E=o[String.fromCharCode(i)];E&&(i=E.charCodeAt(0))}let y=this._unicodeService.charProperties(i,x);a=Ia.extractWidth(y);let S=Ia.extractShouldJoin(y),C=S?Ia.extractWidth(x):0;if(x=y,u&&this._onA11yChar.fire(Xr(i)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-C>h){if(m){let E=b,T=this._activeBuffer.x-C;for(this._activeBuffer.x=C,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),b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&b instanceof Nc&&b.copyCellsFrom(E,T,0,C,!1);T<h;)E.setCellFromCodepoint(T++,0,1,p)}else if(this._activeBuffer.x=h-1,a===2)continue}if(S&&this._activeBuffer.x){let E=b.getWidth(this._activeBuffer.x-1)?1:2;b.addCodepointToCell(this._activeBuffer.x-E,i,a);for(let T=a-C;--T>=0;)b.setCellFromCodepoint(this._activeBuffer.x++,0,0,p);continue}if(f&&(b.insertCells(this._activeBuffer.x,a-C,this._activeBuffer.getNullCell(p)),b.getWidth(h-1)===2&&b.setCellFromCodepoint(h-1,0,1,p)),b.setCellFromCodepoint(this._activeBuffer.x++,i,a,p),a>0)for(;--a;)b.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=x,this._activeBuffer.x<h&&s-t>0&&b.getWidth(this._activeBuffer.x)===0&&!b.hasContent(this._activeBuffer.x)&&b.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,s=>Xw(s.params[0],this._optionsService.rawOptions.windowOptions)?t(s):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Kw(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Nn(t))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,s,i=!1,a=!1){let o=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);o.replaceCells(t,s,this._activeBuffer.getNullCell(this._eraseAttrData()),a),i&&(o.isWrapped=!1)}_resetBufferLine(e,t=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s&&(s.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),s.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let s;switch(e.params[0]){case 0:for(s=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s),this._eraseInBufferLine(s++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);s<this._bufferService.rows;s++)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(s);break;case 1:for(s=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s),this._eraseInBufferLine(s,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(s+1).isWrapped=!1);s--;)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(s=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,s-1);s--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+s)?.getTrimmedLength(););for(;s>=0;s--)this._bufferService.scroll(this._eraseAttrData())}else{for(s=this._bufferService.rows,this._dirtyRowTracker.markDirty(s-1);s--;)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let i=this._activeBuffer.lines.length-this._bufferService.rows;i>0&&(this._activeBuffer.lines.trimStart(i),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-i,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-i,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=this._activeBuffer.ybase+this._activeBuffer.y,i=this._bufferService.rows-1-this._activeBuffer.scrollBottom,a=this._bufferService.rows-1+this._activeBuffer.ybase-i+1;for(;t--;)this._activeBuffer.lines.splice(a-1,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=this._activeBuffer.ybase+this._activeBuffer.y,i;for(i=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-i;t--;)this._activeBuffer.lines.splice(s,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(ns));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);i.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);i.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);i.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);i.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let s=e.params[0]||1,i=Ia.extractWidth(t),a=this._activeBuffer.x-i,o=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),u=new Uint32Array(o.length*s),h=0;for(let f=0;f<o.length;){let p=o.codePointAt(f)||0;u[h++]=p,f+=p>65535?2:1}let m=h;for(let f=1;f<s;++f)u.copyWithin(m,0,h),m+=h;return this.print(u,0,m),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ue.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ue.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ue.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ue.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ue.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Oa),this._charsetService.setgCharset(1,Oa),this._charsetService.setgCharset(2,Oa),this._charsetService.setgCharset(3,Oa);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let s;(S=>(S[S.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",S[S.SET=1]="SET",S[S.RESET=2]="RESET",S[S.PERMANENTLY_SET=3]="PERMANENTLY_SET",S[S.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(s||={});let i=this._coreService.decPrivateModes,{activeProtocol:a,activeEncoding:o}=this._coreMouseService,u=this._coreService,{buffers:h,cols:m}=this._bufferService,{active:f,alt:p}=h,b=this._optionsService.rawOptions,x=(S,C)=>(u.triggerDataEvent(`${ue.ESC}[${t?"":"?"}${S};${C}$y`),!0),_=S=>S?1:2,y=e.params[0];return t?y===2?x(y,4):y===4?x(y,_(u.modes.insertMode)):y===12?x(y,3):y===20?x(y,_(b.convertEol)):x(y,0):y===1?x(y,_(i.applicationCursorKeys)):y===3?x(y,b.windowOptions.setWinLines?m===80?2:m===132?1:0:0):y===6?x(y,_(i.origin)):y===7?x(y,_(i.wraparound)):y===8?x(y,3):y===9?x(y,_(a==="X10")):y===12?x(y,_(b.cursorBlink)):y===25?x(y,_(!u.isCursorHidden)):y===45?x(y,_(i.reverseWraparound)):y===66?x(y,_(i.applicationKeypad)):y===67?x(y,4):y===1e3?x(y,_(a==="VT200")):y===1002?x(y,_(a==="DRAG")):y===1003?x(y,_(a==="ANY")):y===1004?x(y,_(i.sendFocus)):y===1005?x(y,4):y===1006?x(y,_(o==="SGR")):y===1015?x(y,4):y===1016?x(y,_(o==="SGR_PIXELS")):y===1048?x(y,1):y===47||y===1047||y===1049?x(y,_(f===p)):y===2004?x(y,_(i.bracketedPasteMode)):y===2026?x(y,_(i.synchronizedOutput)):x(y,0)}_updateAttrColor(e,t,s,i,a){return t===2?(e|=50331648,e&=-16777216,e|=uu.fromColorRGB([s,i,a])):t===5&&(e&=-50331904,e|=33554432|s&255),e}_extractColor(e,t,s){let i=[0,0,-1,0,0,0],a=0,o=0;do{if(i[o+a]=e.params[t+o],e.hasSubParams(t+o)){let u=e.getSubParams(t+o),h=0;do i[1]===5&&(a=1),i[o+h+1+a]=u[h];while(++h<u.length&&h+o+1+a<i.length);break}if(i[1]===5&&o+a>=2||i[1]===2&&o+a>=5)break;i[1]&&(a=1)}while(++o+t<e.length&&o+a<i.length);for(let u=2;u<i.length;++u)i[u]===-1&&(i[u]=0);switch(i[0]){case 38:s.fg=this._updateAttrColor(s.fg,i[1],i[3],i[4],i[5]);break;case 48:s.bg=this._updateAttrColor(s.bg,i[1],i[3],i[4],i[5]);break;case 58:s.extended=s.extended.clone(),s.extended.underlineColor=this._updateAttrColor(s.extended.underlineColor,i[1],i[3],i[4],i[5])}return o}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=ns.fg,e.bg=ns.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,s,i=this._curAttrData;for(let a=0;a<t;a++)s=e.params[a],s>=30&&s<=37?(i.fg&=-50331904,i.fg|=16777216|s-30):s>=40&&s<=47?(i.bg&=-50331904,i.bg|=16777216|s-40):s>=90&&s<=97?(i.fg&=-50331904,i.fg|=16777216|s-90|8):s>=100&&s<=107?(i.bg&=-50331904,i.bg|=16777216|s-100|8):s===0?this._processSGR0(i):s===1?i.fg|=134217728:s===3?i.bg|=67108864:s===4?(i.fg|=268435456,this._processUnderline(e.hasSubParams(a)?e.getSubParams(a)[0]:1,i)):s===5?i.fg|=536870912:s===7?i.fg|=67108864:s===8?i.fg|=1073741824:s===9?i.fg|=2147483648:s===2?i.bg|=134217728:s===21?this._processUnderline(2,i):s===22?(i.fg&=-134217729,i.bg&=-134217729):s===23?i.bg&=-67108865:s===24?(i.fg&=-268435457,this._processUnderline(0,i)):s===25?i.fg&=-536870913:s===27?i.fg&=-67108865:s===28?i.fg&=-1073741825:s===29?i.fg&=2147483647:s===39?(i.fg&=-67108864,i.fg|=ns.fg&16777215):s===49?(i.bg&=-67108864,i.bg|=ns.bg&16777215):s===38||s===48||s===58?a+=this._extractColor(e,a,i):s===53?i.bg|=1073741824:s===55?i.bg&=-1073741825:s===59?(i.extended=i.extended.clone(),i.extended.underlineColor=-1,i.updateExtended()):s===100?(i.fg&=-67108864,i.fg|=ns.fg&16777215,i.bg&=-67108864,i.bg|=ns.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",s);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${ue.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ue.ESC}[${t};${s}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ue.ESC}[?${t};${s}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=ns.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let s=t%2===1;this._coreService.decPrivateModes.cursorBlink=s}return!0}setScrollRegion(e){let t=e.params[0]||1,s;return(e.length<2||(s=e.params[1])>this._bufferService.rows||s===0)&&(s=this._bufferService.rows),s>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=s-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Xw(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${ue.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Yw&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Yw&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],s=e.split(";");for(;s.length>1;){let i=s.shift(),a=s.shift();if(/^\d+$/.exec(i)){let o=parseInt(i);if(Jw(o))if(a==="?")t.push({type:0,index:o});else{let u=Ww(a);u&&t.push({type:1,index:o,color:u})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let s=e.slice(0,t).trim(),i=e.slice(t+1);return i?this._createHyperlink(s,i):s.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let s=e.split(":"),i,a=s.findIndex(o=>o.startsWith("id="));return a!==-1&&(i=s[a].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:i,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let s=e.split(";");for(let i=0;i<s.length&&!(t>=this._specialColors.length);++i,++t)if(s[i]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let a=Ww(s[i]);a&&this._onColor.fire([{type:1,index:this._specialColors[t],color:a}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],s=e.split(";");for(let i=0;i<s.length;++i)if(/^\d+$/.exec(s[i])){let a=parseInt(s[i]);Jw(a)&&t.push({type:2,index:a})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,Oa),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(V$[e[0]],ps[e[1]]||Oa),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=ns.clone(),this._eraseAttrDataInternal=ns.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Kn;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let s=this._activeBuffer.ybase+this._activeBuffer.y+t,i=this._activeBuffer.lines.get(s);i&&(i.fill(e),i.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let s=u=>(this._coreService.triggerDataEvent(`${ue.ESC}${u}${ue.ESC}\\`),!0),i=this._bufferService.buffer,a=this._optionsService.rawOptions;return s(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[a.cursorStyle]-(a.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},W0=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(Qw=e,e=t,t=Qw),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};W0=Vt([Se(0,en)],W0);function Jw(e){return 0<=e&&e<256}var G$=5e7,e2=12,K$=50,W$=class extends Ye{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new be),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let s;for(;s=this._writeBuffer.shift();){this._action(s);let i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>G$)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let s=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let i=this._writeBuffer[this._bufferOffset],a=this._action(i,t);if(a){let u=h=>performance.now()-s>=e2?setTimeout(()=>this._innerWrite(0,h)):this._innerWrite(s,h);a.catch(h=>(queueMicrotask(()=>{throw h}),Promise.resolve(!1))).then(u);return}let o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=i.length,performance.now()-s>=e2)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>K$&&(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()}},Y0=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let h=t.addMarker(t.ybase+t.y),m={data:e,id:this._nextId++,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(m,h)),this._dataByLinkId.set(m.id,m),m.id}let s=e,i=this._getEntryIdKey(s),a=this._entriesWithId.get(i);if(a)return this.addLineToLink(a.id,t.ybase+t.y),a.id;let o=t.addMarker(t.ybase+t.y),u={id:this._nextId++,key:this._getEntryIdKey(s),data:s,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(u,o)),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(e,t){let s=this._dataByLinkId.get(e);if(s&&s.lines.every(i=>i.line!==t)){let i=this._bufferService.buffer.addMarker(t);s.lines.push(i),i.onDispose(()=>this._removeMarkerFromLink(s,i))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let s=e.lines.indexOf(t);s!==-1&&(e.lines.splice(s,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Y0=Vt([Se(0,en)],Y0);var t2=!1,Y$=class extends Ye{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new sl),this._onBinary=this._register(new be),this.onBinary=this._onBinary.event,this._onData=this._register(new be),this.onData=this._onData.event,this._onLineFeed=this._register(new be),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new be),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new be),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new be),this._instantiationService=new x$,this.optionsService=this._register(new A$(e)),this._instantiationService.setService(tn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(V0)),this._instantiationService.setService(en,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(F0)),this._instantiationService.setService(CN,this._logService),this.coreService=this._register(this._instantiationService.createInstance(q0)),this._instantiationService.setService(Za,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(G0)),this._instantiationService.setService(kN,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ia)),this._instantiationService.setService(pI,this.unicodeService),this._charsetService=this._instantiationService.createInstance(O$),this._instantiationService.setService(mI,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Y0),this._instantiationService.setService(EN,this._oscLinkService),this._inputHandler=this._register(new q$(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(js.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(js.forward(this._bufferService.onResize,this._onResize)),this._register(js.forward(this.coreService.onData,this._onData)),this._register(js.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),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}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new W$((t,s)=>this._inputHandler.parse(t,s))),this._register(js.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new be),this._onScroll.event(e=>{this._onScrollApi?.fire(e.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(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!t2&&(this._logService.warn("writeSync is unreliable and will be removed soon."),t2=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,i3),t=Math.max(t,r3),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Gw.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Gw(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Ot(()=>{for(let t of e)t.dispose()})}}},X$={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:["'",'"']};function Z$(e,t,s,i){let a={type:0,cancel:!1,key:void 0},o=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?a.key=ue.ESC+"OA":a.key=ue.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?a.key=ue.ESC+"OD":a.key=ue.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?a.key=ue.ESC+"OC":a.key=ue.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?a.key=ue.ESC+"OB":a.key=ue.ESC+"[B");break;case 8:a.key=e.ctrlKey?"\b":ue.DEL,e.altKey&&(a.key=ue.ESC+a.key);break;case 9:if(e.shiftKey){a.key=ue.ESC+"[Z";break}a.key=ue.HT,a.cancel=!0;break;case 13:a.key=e.altKey?ue.ESC+ue.CR:ue.CR,a.cancel=!0;break;case 27:a.key=ue.ESC,e.altKey&&(a.key=ue.ESC+ue.ESC),a.cancel=!0;break;case 37:if(e.metaKey)break;o?a.key=ue.ESC+"[1;"+(o+1)+"D":t?a.key=ue.ESC+"OD":a.key=ue.ESC+"[D";break;case 39:if(e.metaKey)break;o?a.key=ue.ESC+"[1;"+(o+1)+"C":t?a.key=ue.ESC+"OC":a.key=ue.ESC+"[C";break;case 38:if(e.metaKey)break;o?a.key=ue.ESC+"[1;"+(o+1)+"A":t?a.key=ue.ESC+"OA":a.key=ue.ESC+"[A";break;case 40:if(e.metaKey)break;o?a.key=ue.ESC+"[1;"+(o+1)+"B":t?a.key=ue.ESC+"OB":a.key=ue.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(a.key=ue.ESC+"[2~");break;case 46:o?a.key=ue.ESC+"[3;"+(o+1)+"~":a.key=ue.ESC+"[3~";break;case 36:o?a.key=ue.ESC+"[1;"+(o+1)+"H":t?a.key=ue.ESC+"OH":a.key=ue.ESC+"[H";break;case 35:o?a.key=ue.ESC+"[1;"+(o+1)+"F":t?a.key=ue.ESC+"OF":a.key=ue.ESC+"[F";break;case 33:e.shiftKey?a.type=2:e.ctrlKey?a.key=ue.ESC+"[5;"+(o+1)+"~":a.key=ue.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:e.ctrlKey?a.key=ue.ESC+"[6;"+(o+1)+"~":a.key=ue.ESC+"[6~";break;case 112:o?a.key=ue.ESC+"[1;"+(o+1)+"P":a.key=ue.ESC+"OP";break;case 113:o?a.key=ue.ESC+"[1;"+(o+1)+"Q":a.key=ue.ESC+"OQ";break;case 114:o?a.key=ue.ESC+"[1;"+(o+1)+"R":a.key=ue.ESC+"OR";break;case 115:o?a.key=ue.ESC+"[1;"+(o+1)+"S":a.key=ue.ESC+"OS";break;case 116:o?a.key=ue.ESC+"[15;"+(o+1)+"~":a.key=ue.ESC+"[15~";break;case 117:o?a.key=ue.ESC+"[17;"+(o+1)+"~":a.key=ue.ESC+"[17~";break;case 118:o?a.key=ue.ESC+"[18;"+(o+1)+"~":a.key=ue.ESC+"[18~";break;case 119:o?a.key=ue.ESC+"[19;"+(o+1)+"~":a.key=ue.ESC+"[19~";break;case 120:o?a.key=ue.ESC+"[20;"+(o+1)+"~":a.key=ue.ESC+"[20~";break;case 121:o?a.key=ue.ESC+"[21;"+(o+1)+"~":a.key=ue.ESC+"[21~";break;case 122:o?a.key=ue.ESC+"[23;"+(o+1)+"~":a.key=ue.ESC+"[23~";break;case 123:o?a.key=ue.ESC+"[24;"+(o+1)+"~":a.key=ue.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?a.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?a.key=ue.NUL:e.keyCode>=51&&e.keyCode<=55?a.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?a.key=ue.DEL:e.keyCode===219?a.key=ue.ESC:e.keyCode===220?a.key=ue.FS:e.keyCode===221&&(a.key=ue.GS);else if((!s||i)&&e.altKey&&!e.metaKey){let u=X$[e.keyCode]?.[e.shiftKey?1:0];if(u)a.key=ue.ESC+u;else if(e.keyCode>=65&&e.keyCode<=90){let h=e.ctrlKey?e.keyCode-64:e.keyCode+32,m=String.fromCharCode(h);e.shiftKey&&(m=m.toUpperCase()),a.key=ue.ESC+m}else if(e.keyCode===32)a.key=ue.ESC+(e.ctrlKey?ue.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),a.key=ue.ESC+h,a.cancel=!0}}else s&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(a.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?a.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(a.key=ue.US),e.key==="@"&&(a.key=ue.NUL));break}return a}var Xt=0,Q$=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Lh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Lh,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((a,o)=>this._getKey(a)-this._getKey(o)),t=0,s=0,i=new Array(this._array.length+this._insertedValues.length);for(let a=0;a<i.length;a++)s>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[s])?(i[a]=e[t],t++):i[a]=this._array[s++];this._array=i,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Xt=this._search(t),Xt===-1)||this._getKey(this._array[Xt])!==t)return!1;do if(this._array[Xt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Xt),!0;while(++Xt<this._array.length&&this._getKey(this._array[Xt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((a,o)=>a-o),t=0,s=new Array(this._array.length-e.length),i=0;for(let a=0;a<this._array.length;a++)e[t]===a?t++:s[i++]=this._array[a];this._array=s,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Xt=this._search(e),!(Xt<0||Xt>=this._array.length)&&this._getKey(this._array[Xt])===e))do yield this._array[Xt];while(++Xt<this._array.length&&this._getKey(this._array[Xt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Xt=this._search(e),!(Xt<0||Xt>=this._array.length)&&this._getKey(this._array[Xt])===e))do t(this._array[Xt]);while(++Xt<this._array.length&&this._getKey(this._array[Xt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,s=this._array.length-1;for(;s>=t;){let i=t+s>>1,a=this._getKey(this._array[i]);if(a>e)s=i-1;else if(a<e)t=i+1;else{for(;i>0&&this._getKey(this._array[i-1])===e;)i--;return i}}return t}},Yp=0,s2=0,J$=class extends Ye{constructor(){super(),this._decorations=new Q$(e=>e?.marker.line),this._onDecorationRegistered=this._register(new be),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new be),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Ot(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new eH(e);if(t){let s=t.marker.onDispose(()=>t.dispose()),i=t.onDispose(()=>{i.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),s.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,s){let i=0,a=0;for(let o of this._decorations.getKeyIterator(t))i=o.options.x??0,a=i+(o.options.width??1),e>=i&&e<a&&(!s||(o.options.layer??"bottom")===s)&&(yield o)}forEachDecorationAtCell(e,t,s,i){this._decorations.forEachByKey(t,a=>{Yp=a.options.x??0,s2=Yp+(a.options.width??1),e>=Yp&&e<s2&&(!s||(a.options.layer??"bottom")===s)&&i(a)})}},eH=class extends Jr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new be),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new be),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Pt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Pt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},tH=1e3,sH=class{constructor(e,t=tH){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,s){this._rowCount=s,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let i=performance.now();if(i-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=i,this._innerRefresh();else if(!this._additionalRefreshRequested){let a=i-this._lastRefreshMs,o=this._debounceThresholdMS-a;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},o)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},n2=20,Bh=class extends Ye{constructor(e,t,s,i){super(),this._terminal=e,this._coreBrowserService=s,this._renderService=i,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let a=this._coreBrowserService.mainDocument;this._accessibilityContainer=a.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=a.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let o=0;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);if(this._topBoundaryFocusListener=o=>this._handleBoundaryFocus(o,0),this._bottomBoundaryFocusListener=o=>this._handleBoundaryFocus(o,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=a.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new sH(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(o=>this._handleResize(o.rows))),this._register(this._terminal.onRender(o=>this._refreshRows(o.start,o.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(o=>this._handleChar(o))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
151
|
-
`))),this._register(this._terminal.onA11yTab(o=>this._handleTab(o))),this._register(this._terminal.onKey(o=>this._handleKey(o.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ue(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Ot(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<n2+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
152
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===n2+1&&(this._liveRegion.textContent+=p0.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let s=this._terminal.buffer,i=s.lines.length.toString();for(let a=e;a<=t;a++){let o=s.lines.get(s.ydisp+a),u=[],h=o?.translateToString(!0,void 0,void 0,u)||"",m=(s.ydisp+a+1).toString(),f=this._rowElements[a];f&&(h.length===0?(f.textContent=" ",this._rowColumns.set(f,[0,1])):(f.textContent=h,this._rowColumns.set(f,u)),f.setAttribute("aria-posinset",m),f.setAttribute("aria-setsize",i),this._alignRowWidth(f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let s=e.target,i=this._rowElements[t===0?1:this._rowElements.length-2],a=s.getAttribute("aria-posinset"),o=t===0?"1":`${this._terminal.buffer.lines.length}`;if(a===o||e.relatedTarget!==i)return;let u,h;if(t===0?(u=s,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(u=this._rowElements.shift(),h=s,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{let m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},s={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(s.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===s.node&&t.offset>s.offset)&&([t,s]=[s,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let i=this._rowElements.slice(-1)[0];if(s.node.compareDocumentPosition(i)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(s={node:i,offset:i.textContent?.length??0}),!this._rowContainer.contains(s.node))return;let a=({node:h,offset:m})=>{let f=h instanceof Text?h.parentNode:h,p=parseInt(f?.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let b=this._rowColumns.get(f);if(!b)return console.warn("columns is null. Race condition?"),null;let x=m<b.length?b[m]:b.slice(-1)[0]+1;return x>=this._terminal.cols&&(++p,x=0),{row:p,column:x}},o=a(t),u=a(s);if(!(!o||!u)){if(o.row>u.row||o.row===u.row&&o.column>=u.column)throw new Error("invalid range");this._terminal.select(o.column,o.row,(u.row-o.row)*this._terminal.cols-o.column+u.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,s=this._rowColumns.get(e)?.slice(-1)?.[0];if(!s)return;let i=s*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${i/t})`}};Bh=Vt([Se(1,tv),Se(2,hr),Se(3,fr)],Bh);var X0=class extends Ye{constructor(e,t,s,i,a){super(),this._element=e,this._mouseService=t,this._renderService=s,this._bufferService=i,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new be),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new be),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Ot(()=>{qa(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ue(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ue(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ue(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ue(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let s=e.composedPath();for(let i=0;i<s.length;i++){let a=s[i];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(i=>{i?.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let s=!1;for(let[i,a]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(i)&&(s=this._checkLinkProviderResult(i,e,s)):a.provideLinks(e.y,o=>{if(this._isMouseOut)return;let u=o?.map(h=>({link:h}));this._activeProviderReplies?.set(i,u),s=this._checkLinkProviderResult(i,e,s),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let s=new Set;for(let i=0;i<t.size;i++){let a=t.get(i);if(a)for(let o=0;o<a.length;o++){let u=a[o],h=u.link.range.start.y<e?0:u.link.range.start.x,m=u.link.range.end.y>e?this._bufferService.cols:u.link.range.end.x;for(let f=h;f<=m;f++){if(s.has(f)){a.splice(o--,1);break}s.add(f)}}}}_checkLinkProviderResult(e,t,s){if(!this._activeProviderReplies)return s;let i=this._activeProviderReplies.get(e),a=!1;for(let o=0;o<e;o++)(!this._activeProviderReplies.has(o)||this._activeProviderReplies.get(o))&&(a=!0);if(!a&&i){let o=i.find(u=>this._linkAtPosition(u.link,t));o&&(s=!0,this._handleNewLink(o))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let o=0;o<this._activeProviderReplies.size;o++){let u=this._activeProviderReplies.get(o)?.find(h=>this._linkAtPosition(h.link,t));if(u){s=!0,this._handleNewLink(u);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&nH(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,qa(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:s=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:s=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(s=>{if(!this._currentLink)return;let i=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(i,a),this._lastMouseEvent)){let o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._askForLink(o,!1)}})))}_linkHover(e,t,s){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(s,t.text)}_fireUnderlineEvent(e,t){let s=e.range,i=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-i-1,s.end.x,s.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(e,t,s){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(s,t.text)}_linkAtPosition(e,t){let s=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,a=t.y*this._bufferService.cols+t.x;return s<=a&&a<=i}_positionFromMouseEvent(e,t,s){let i=s.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,s,i,a){return{x1:e,y1:t,x2:s,y2:i,cols:this._bufferService.cols,fg:a}}};X0=Vt([Se(1,sv),Se(2,fr),Se(3,en),Se(4,TN)],X0);function nH(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var iH=class extends Y${constructor(e={}){super(e),this._linkifier=this._register(new sl),this.browser=KN,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new sl),this._onCursorMove=this._register(new be),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new be),this.onKey=this._onKey.event,this._onRender=this._register(new be),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new be),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new be),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new be),this.onBell=this._onBell.event,this._onFocus=this._register(new be),this._onBlur=this._register(new be),this._onA11yCharEmitter=this._register(new be),this._onA11yTabEmitter=this._register(new be),this._onWillOpen=this._register(new be),this._setup(),this._decorationService=this._instantiationService.createInstance(J$),this._instantiationService.setService(du,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(KP),this._instantiationService.setService(TN,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b0)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(js.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(js.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(js.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(js.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Ot(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let t of e){let s,i="";switch(t.index){case 256:s="foreground",i="10";break;case 257:s="background",i="11";break;case 258:s="cursor",i="12";break;default:s="ansi",i="4;"+t.index}switch(t.type){case 0:let a=Mt.toColorRGB(s==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[s]);this.coreService.triggerDataEvent(`${ue.ESC}]${i};${F$(a)}${qN.ST}`);break;case 1:if(s==="ansi")this._themeService.modifyColors(o=>o.ansi[t.index]=as.toColor(...t.color));else{let o=s;this._themeService.modifyColors(u=>u[o]=as.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Bh,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ue.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ue.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let s=Math.min(this.buffer.x,this.cols-1),i=this._renderService.dimensions.css.cell.height,a=t.getWidth(s),o=this._renderService.dimensions.css.cell.width*a,u=this.buffer.y*this._renderService.dimensions.css.cell.height,h=s*this._renderService.dimensions.css.cell.width;this.textarea.style.left=h+"px",this.textarea.style.top=u+"px",this.textarea.style.width=o+"px",this.textarea.style.height=i+"px",this.textarea.style.lineHeight=i+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ue(this.element,"copy",t=>{this.hasSelection()&&lI(t,this._selectionService)}));let e=t=>cI(t,this.textarea,this.coreService,this.optionsService);this._register(Ue(this.textarea,"paste",e)),this._register(Ue(this.element,"paste",e)),WN?this._register(Ue(this.element,"mousedown",t=>{t.button===2&&fw(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ue(this.element,"contextmenu",t=>{fw(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),uv&&this._register(Ue(this.element,"auxclick",t=>{t.button===1&&xN(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ue(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ue(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ue(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ue(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ue(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ue(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ue(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ue(this.screenElement,"mousemove",a=>this.updateCursorStyle(a))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let s=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m0.get()),ZN||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>s.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(qP,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(hr,this._coreBrowserService),this._register(Ue(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Ue(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(I0,this._document,this._helperContainer),this._instantiationService.setService(ef,this._charSizeService),this._themeService=this._instantiationService.createInstance(U0),this._instantiationService.setService(dl,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Dh),this._instantiationService.setService(NN,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance($0,this.rows,this.screenElement)),this._instantiationService.setService(fr,this._renderService),this._register(this._renderService.onRenderedViewportChange(a=>this._onRender.fire(a))),this.onResize(a=>this._renderService.resize(a.cols,a.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(L0,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(P0),this._instantiationService.setService(sv,this._mouseService);let i=this._linkifier.value=this._register(this._instantiationService.createInstance(X0,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(D0,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(a=>{super.scrollLines(a,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(H0,this.element,this.screenElement,i)),this._instantiationService.setService(bI,this._selectionService),this._register(this._selectionService.onRequestScrollLines(a=>this.scrollLines(a.amount,a.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(a=>this._renderService.handleSelectionChanged(a.start,a.end,a.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(a=>{this.textarea.value=a,this.textarea.focus(),this.textarea.select()})),this._register(js.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(O0,this.screenElement)),this._register(Ue(this.element,"mousedown",a=>this._selectionService.handleMouseDown(a))),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(Bh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Rh,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Rh,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(z0,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function s(o){let u=e._mouseService.getMouseReportCoords(o,e.screenElement);if(!u)return!1;let h,m;switch(o.overrideType||o.type){case"mousemove":m=32,o.buttons===void 0?(h=3,o.button!==void 0&&(h=o.button<3?o.button:3)):h=o.buttons&1?0:o.buttons&4?1:o.buttons&2?2:3;break;case"mouseup":m=0,h=o.button<3?o.button:3;break;case"mousedown":m=1,h=o.button<3?o.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(o)===!1)return!1;let f=o.deltaY;if(f===0||e.coreMouseService.consumeWheelEvent(o,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;m=f<0?0:1,h=4;break;default:return!1}return m===void 0||h===void 0||h>4?!1:e.coreMouseService.triggerMouseEvent({col:u.col,row:u.row,x:u.x,y:u.y,button:h,action:m,ctrl:o.ctrlKey,alt:o.altKey,shift:o.shiftKey})}let i={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:o=>(s(o),o.buttons||(this._document.removeEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.removeEventListener("mousemove",i.mousedrag)),this.cancel(o)),wheel:o=>(s(o),this.cancel(o,!0)),mousedrag:o=>{o.buttons&&s(o)},mousemove:o=>{o.buttons||s(o)}};this._register(this.coreMouseService.onProtocolChange(o=>{o?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(o)),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()),o&8?i.mousemove||(t.addEventListener("mousemove",a.mousemove),i.mousemove=a.mousemove):(t.removeEventListener("mousemove",i.mousemove),i.mousemove=null),o&16?i.wheel||(t.addEventListener("wheel",a.wheel,{passive:!1}),i.wheel=a.wheel):(t.removeEventListener("wheel",i.wheel),i.wheel=null),o&2?i.mouseup||(i.mouseup=a.mouseup):(this._document.removeEventListener("mouseup",i.mouseup),i.mouseup=null),o&4?i.mousedrag||(i.mousedrag=a.mousedrag):(this._document.removeEventListener("mousemove",i.mousedrag),i.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ue(t,"mousedown",o=>{if(o.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(o)))return s(o),i.mouseup&&this._document.addEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.addEventListener("mousemove",i.mousedrag),this.cancel(o)})),this._register(Ue(t,"wheel",o=>{if(!i.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(o)===!1)return!1;if(!this.buffer.hasScrollback){if(o.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(o,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(o,!0);let u=ue.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(o.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(u,!0),this.cancel(o,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?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(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){vN(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,s){this._selectionService.setSelection(e,t,s)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let s=Z$(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),s.type===3||s.type===2){let i=this.rows-1;return this.scrollLines(s.type===2?-i:i),this.cancel(e,!0)}if(s.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(s.cancel&&this.cancel(e,!0),!s.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((s.key===ue.ETX||s.key===ue.CR)&&(this.textarea.value=""),this._onKey.fire({key:s.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(s.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let s=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?s:s&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(rH(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(ns));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(ue.ESC+"[I"):this.coreService.triggerDataEvent(ue.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),s=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ue.ESC}[4;${s};${t}t`);break;case 1:let i=this._renderService.dimensions.css.cell.width.toFixed(0),a=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ue.ESC}[6;${a};${i}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function rH(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var aH=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let s={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(s),t.dispose=()=>this._wrappedAddonDispose(s),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let s=0;s<this._addons.length;s++)if(this._addons[s]===e){t=s;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},oH=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Kn)}translateToString(e,t,s){return this._line.translateToString(e,t,s)}},i2=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new oH(t)}getNullCell(){return new Kn}},lH=class extends Ye{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new be),this.onBufferChange=this._onBufferChange.event,this._normal=new i2(this._core.buffers.normal,"normal"),this._alternate=new i2(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)}},cH=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,s=>t(s.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(s,i)=>t(s,i.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},uH=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},dH=["cols","rows"],vi=0,hH=class extends Ye{constructor(e){super(),this._core=this._register(new iH(e)),this._addonManager=this._register(new aH),this._publicOptions={...this._core.options};let t=i=>this._core.options[i],s=(i,a)=>{this._checkReadonlyOptions(i),this._core.options[i]=a};for(let i in this._core.options){let a={get:t.bind(this,i),set:s.bind(this,i)};Object.defineProperty(this._publicOptions,i,a)}}_checkReadonlyOptions(e){if(dH.includes(e))throw new Error(`Option "${e}" 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 cH(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new uH(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 lH(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,s){this._verifyIntegers(e,t,s),this._core.select(e,t,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
153
|
-
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return m0.get()},set promptLabel(e){m0.set(e)},get tooMuchOutput(){return p0.get()},set tooMuchOutput(e){p0.set(e)}}}_verifyIntegers(...e){for(vi of e)if(vi===1/0||isNaN(vi)||vi%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(vi of e)if(vi&&(vi===1/0||isNaN(vi)||vi%1!==0||vi<0))throw new Error("This API only accepts positive integers")}};function o3({sessionId:e,active:t,toolbarExtra:s}){const i=w.useRef(null),a=w.useRef(null),o=w.useRef(null),u=w.useRef(null),[h,m]=w.useState("Local workspace"),[f,p]=w.useState("connecting"),[b,x]=w.useState("Opening shell"),_=w.useCallback(()=>{const S=u.current,C=o.current;if(!S||S.readyState!==WebSocket.OPEN||!C)return;C.fit();const E=C.proposeDimensions();E&&S.send(JSON.stringify({cols:E.cols,rows:E.rows,type:"resize"}))},[]);w.useEffect(()=>{if(!i.current)return;const S=new hH({allowProposedApi:!0,cursorBlink:!0,fontFamily:'"SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace',fontSize:12,lineHeight:1.25,scrollback:4e3,theme:{background:"#090909",black:"#090909",blue:"#69a7ff",brightBlack:"#5f6368",brightBlue:"#8ab4f8",brightCyan:"#7ddfd7",brightGreen:"#8fdc8a",brightMagenta:"#d7a2ff",brightRed:"#ff8a80",brightWhite:"#ffffff",brightYellow:"#ffd166",cyan:"#62d0c8",foreground:"#f2f2f2",green:"#7ac77f",magenta:"#c792ea",red:"#ff6b6b",selectionBackground:"#ffffff33",white:"#e8eaed",yellow:"#f7c948"}}),C=new nI;S.loadAddon(C),S.open(i.current),a.current=S,o.current=C;const E=new WebSocket(fH(e));u.current=E;const T=S.onData(M=>{E.readyState===WebSocket.OPEN&&E.send(JSON.stringify({data:M,type:"input"}))});E.addEventListener("open",()=>{p("running"),x("Shell connected"),_()}),E.addEventListener("message",M=>{const R=mH(M.data);if(R){if(R.type==="output"){S.write(R.data);return}if(R.type==="error"){p("error"),x(R.error);return}p(R.state==="idle"?"connecting":R.state),R.cwd&&m(R.cwd),x(R.error??R.shell??"Shell connected")}}),E.addEventListener("close",()=>{p(M=>M==="exited"?M:"exited"),x("Socket closed")}),E.addEventListener("error",()=>{p("error"),x("Terminal socket error")}),window.addEventListener("resize",_),window.setTimeout(_,0);const N=new ResizeObserver(()=>_());return N.observe(i.current),()=>{window.removeEventListener("resize",_),N.disconnect(),T.dispose(),E.close(),S.dispose(),u.current=null,a.current=null,o.current=null}},[e,_]),w.useEffect(()=>{if(!t)return;const S=window.setTimeout(()=>{_(),a.current?.focus()},0);return()=>window.clearTimeout(S)},[t,_]);const y=w.useCallback(S=>{const C=u.current;if(!C||C.readyState!==WebSocket.OPEN)return;const E=o.current?.proposeDimensions();C.send(JSON.stringify({cols:E?.cols,rows:E?.rows,...S}))},[]);return l.jsxs("section",{className:de("flex h-full min-h-0 flex-col bg-[#090909] text-white",!t&&"hidden"),children:[l.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b border-white/10 bg-[#111111] px-4 py-2",children:[l.jsx("div",{className:"min-w-0",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx($e,{className:de("border-white/15 bg-white/10 text-white shadow-none",f==="running"&&"border-emerald-400/35 text-emerald-200",f==="error"&&"border-red-400/35 text-red-200"),variant:"outline",children:f}),l.jsxs("span",{className:"truncate font-mono text-[11px] text-white/55",children:[h," · ",b]})]})}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(re,{"aria-label":"Restart terminal",className:"border-white/15 bg-white/5 text-white hover:bg-white/10",size:"sm",variant:"outline",onClick:()=>y({type:"restart"}),type:"button",children:[l.jsx(ab,{}),"Restart"]}),l.jsxs(re,{"aria-label":"Stop terminal",className:"border-white/15 bg-white/5 text-white hover:bg-white/10",size:"sm",variant:"outline",onClick:()=>y({type:"stop"}),type:"button",children:[l.jsx(qh,{}),"Stop"]}),s]})]}),l.jsx("div",{"aria-label":"terminal viewport",className:"min-h-0 flex-1 overflow-hidden px-3 py-0.5",children:l.jsx("div",{className:"h-full w-full",ref:i})})]})}function fH(e){const t=window.location.protocol==="https:"?"wss:":"ws:",s=encodeURIComponent(e);return`${t}//${window.location.host}/api/terminal/socket?id=${s}`}function mH(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return typeof t?.type=="string"?t:null}catch{return null}}function pH({serviceName:e,active:t}){const[s,i]=w.useState(null),[a,o]=w.useState(null),[u,h]=w.useState(!1),m=w.useRef(!1);w.useEffect(()=>{if(!t||m.current)return;m.current=!0;let b=!1;return(async()=>{try{const x=await Yd({serviceName:e});b||i(x.id)}catch(x){b||o(x instanceof Error?x.message:String(x))}})(),()=>{b=!0}},[t,e]);const f=l.jsxs(re,{"aria-label":u?"Exit fullscreen terminal":"Expand terminal",className:"border-white/15 bg-white/5 text-white hover:bg-white/10",onClick:()=>h(b=>!b),size:"sm",type:"button",variant:"outline",children:[u?l.jsx(Bk,{}):l.jsx(Lk,{}),u?"Exit":"Expand"]}),p=a?l.jsxs("div",{className:"p-3 font-mono text-[11px] text-destructive",children:["Could not open terminal: ",a]}):s?l.jsx(o3,{active:t,sessionId:s,toolbarExtra:f}):l.jsx("div",{className:"p-3 font-mono text-[11px] text-muted-foreground",children:"Opening terminal…"});return u&&t?l.jsx(ev,{onClose:()=>h(!1),title:`Terminal — ${e}`,children:p}):l.jsx("div",{className:de("h-[60vh] min-h-[24rem] overflow-hidden rounded-md border border-border",!t&&"hidden"),children:p})}const gH=500;function bH(e){const[t,s]=w.useState(),[i,a]=w.useState([]),[o,u]=w.useState(),[h,m]=w.useState(!1),f=w.useRef(void 0);w.useEffect(()=>{f.current=void 0,s(void 0),a([]);const b=new EventSource(`/api/services/${encodeURIComponent(e)}/test/stream`),x=_=>{try{const y=JSON.parse(_.data);y.run.id!==f.current&&(f.current=y.run.id,a([])),s(y.run),y.line&&a(S=>[...S,y.line].slice(-gH))}catch{}};return b.addEventListener("status",x),b.addEventListener("output",x),()=>b.close()},[e]);const p=w.useCallback(async b=>{m(!0),u(void 0);try{await t6(e,b)}catch(x){u(x instanceof Error?x.message:String(x))}finally{m(!1)}},[e]);return{run:t,lines:i,error:o,starting:h,start:p}}const vH={running:"secondary",passed:"success",failed:"error",error:"error"},xH={running:"Running",passed:"Passed",failed:"Failed",error:"Error"};function _H({serviceName:e}){const{run:t,lines:s,error:i,starting:a,start:o}=bH(e),[u,h]=w.useState(""),m=t?.status==="running"||a,f=t?.status==="failed"||t?.status==="error";return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("form",{className:"flex items-center gap-2",onSubmit:p=>{p.preventDefault(),m||o(u.trim()||void 0)},children:[l.jsx(et,{className:"h-7 flex-1 text-[11px]",disabled:m,onChange:p=>h(p.target.value),placeholder:"Optional test pattern (e.g. config-store)",value:u}),l.jsx(re,{disabled:m,size:"sm",type:"submit",children:m?"Running…":"Run tests"})]}),i?l.jsx("div",{className:"text-red-600",children:i}):null,t?l.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-muted-foreground",children:[l.jsx($e,{size:"small",variant:vH[t.status],children:xH[t.status]}),l.jsx("code",{className:"font-mono text-[11px]",children:t.command}),t.failingCount>0?l.jsxs("span",{children:["· ",t.failingCount," failing"]}):null,t.exitCode!=null?l.jsxs("span",{children:["· exit ",t.exitCode]}):null]}):l.jsx("div",{className:"text-muted-foreground",children:"No test runs yet."}),s.length>0?l.jsx("pre",{className:"max-h-72 overflow-auto whitespace-pre-wrap break-all rounded bg-background p-2 font-mono text-[11px]",children:s.map((p,b)=>l.jsx("div",{className:de(p.stream==="stderr"&&"text-red-500"),children:p.text},b))}):null,f?l.jsxs("div",{className:"rounded border border-border bg-muted/40 p-2",children:["Failures were piped into the"," ",l.jsx("a",{className:"font-medium underline",href:"/errors",children:"Error Inbox"})," ","— open an incident there to copy a debugging prompt for your agent."]}):null]})}function yH({serviceName:e,status:t,health:s,timeline:i,onRefresh:a}){const[o,u]=w.useState("metrics"),h=s?.processTree?.processes??[];return l.jsxs("div",{className:"border-t border-border bg-muted/30 px-3 py-2 text-xs",children:[l.jsxs("div",{className:"mb-2 flex gap-1",children:[l.jsx(ja,{active:o==="logs",onClick:()=>u("logs"),children:"Logs"}),l.jsxs(ja,{active:o==="processes",onClick:()=>u("processes"),children:["Processes ",h.length?l.jsx($e,{variant:"secondary",size:"small",children:h.length}):null]}),l.jsx(ja,{active:o==="metrics",onClick:()=>u("metrics"),children:"Metrics"}),l.jsxs(ja,{active:o==="http",onClick:()=>u("http"),children:["HTTP",t?.inspector?.enabled?l.jsx($e,{variant:"success",size:"small",children:"on"}):null]}),l.jsx(ja,{active:o==="env",onClick:()=>u("env"),children:"Env"}),l.jsx(ja,{active:o==="tests",onClick:()=>u("tests"),children:"Tests"}),l.jsx(ja,{active:o==="terminal",onClick:()=>u("terminal"),children:"Terminal"})]}),o==="processes"?l.jsx(eI,{rows:h}):null,o==="metrics"?l.jsx(Wz,{serviceName:e}):null,o==="http"?l.jsx(qz,{serviceName:e,status:t,timeline:i,onRefresh:a}):null,o==="env"?l.jsx(Vz,{serviceName:e}):null,o==="tests"?l.jsx(_H,{serviceName:e}):null,o==="logs"?l.jsx(Bz,{serviceName:e}):null,l.jsx(pH,{active:o==="terminal",serviceName:e},e)]})}function ja({active:e,onClick:t,children:s}){return l.jsx("button",{className:de("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:t,type:"button",children:s})}const SH={high:"success",medium:"warning",low:"secondary"};function wH({onClose:e,onRefresh:t}){const s=Bs(),{sendToAgent:i}=Ls(),[a,o]=w.useState("url"),[u,h]=w.useState(""),[m,f]=w.useState(!1),[p,b]=w.useState(null),[x,_]=w.useState(null),[y,S]=w.useState([]),[C,E]=w.useState([]),[T,N]=w.useState(null),M=T?.kind==="docker-compose"?C.find(j=>j.composeService===T.composeService):void 0;async function R(){if(u.trim()){f(!0),b(null);try{const j=await Hj(u.trim());_(j.profile),S(j.proposals),E(j.databases),N(j.proposals[0]??null),j.proposals.length===0&&b("Cloned, but couldn't detect how to run this repo. Refine with AI or add it manually."),o("review")}catch(j){b(j instanceof Error?j.message:String(j))}finally{f(!1)}}}function z(){i({prompt:`Onboard this repository and register it as a NoMoreIDE service: ${u.trim()}
|
|
154
|
-
Use nomoreide_onboard_repo to inspect it, pick the best run command, then register and start it.`,source:{type:"repo-onboard",label:"Onboard repo"},label:`Onboard and run this repo: ${u.trim()}`}),e()}async function L(j){if(T){f(!0),b(null);try{await Uj(T,j,M),await t(),s.success(`${T.name} registered${M?" (+ database)":""}${j?" and starting":""}.`),e()}catch(H){b(H instanceof Error?H.message:String(H))}finally{f(!1)}}}return l.jsxs(Ti,{icon:l.jsx(Wn,{}),onClose:e,size:"lg",title:"Add from GitHub",children:[a==="url"?l.jsx(kH,{url:u,busy:m,error:p,onChange:h,onScan:R,onRefine:z}):null,a==="review"&&x?l.jsx(CH,{profile:x,proposals:y,selected:T,database:M,error:p,onSelect:N,onEdit:N,onBack:()=>o("url"),onRefine:z,onContinue:()=>o("install")}):null,a==="install"&&T?l.jsx(NH,{proposal:T,busy:m,error:p,onBack:()=>o("review"),onRegister:L}):null]})}function kH({url:e,busy:t,error:s,onChange:i,onScan:a,onRefine:o}){return l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Paste a repository URL. NoMoreIDE clones it, detects how it runs, and proposes a service."}),l.jsx(et,{autoFocus:!0,placeholder:"https://github.com/owner/repo",value:e,onChange:u=>i(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!t&&a()}}),s?l.jsx("p",{className:"text-sm text-destructive",children:s}):null,l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs(re,{variant:"ghost",size:"sm",onClick:o,disabled:!e.trim(),children:[l.jsx(Wa,{className:"size-3.5"}),"Refine with AI"]}),l.jsxs(re,{onClick:a,disabled:t||!e.trim(),children:[t?l.jsx(Os,{className:"size-4 animate-spin"}):l.jsx(Wn,{className:"size-4"}),t?"Cloning…":"Clone & detect"]})]})]})}function CH({profile:e,proposals:t,selected:s,database:i,error:a,onSelect:o,onEdit:u,onBack:h,onRefine:m,onContinue:f}){return l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-sm font-medium",children:e.name}),e.languages.map(p=>l.jsx($e,{variant:"outline",size:"small",label:p},p))]}),a?l.jsx("p",{className:"text-sm text-destructive",children:a}):null,t.length>0?l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:["Detected service",t.length>1?"s":""]}),t.map(p=>{const b=s?.name===p.name;return l.jsxs("button",{type:"button",onClick:()=>o(p),className:`rounded-md border px-3 py-2 text-left text-sm transition-colors ${b?"border-primary bg-primary/5":"border-border hover:bg-muted/50"}`,children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"font-medium",children:p.name}),l.jsx($e,{variant:SH[p.confidence],size:"small",label:p.confidence})]}),l.jsx("div",{className:"mt-0.5 font-mono text-xs text-muted-foreground",children:p.kind==="docker-compose"?`compose · ${p.composeService}`:p.command}),l.jsx("div",{className:"text-[11px] text-muted-foreground",children:p.reason})]},p.name)})]}):null,s?l.jsx(EH,{proposal:s,onChange:u}):null,i?l.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2.5 py-1.5 text-xs text-muted-foreground",children:[l.jsx(ui,{className:"size-3.5"}),l.jsxs("span",{children:["Also registers database ",l.jsx("span",{className:"font-medium",children:i.name})," (",i.engine,") so it shows in the Database tab."]})]}):null,e.envKeys.length>0?l.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.jsx("span",{className:"font-medium",children:"Env from .env.example:"})," ",e.envKeys.join(", ")]}):null,e.readmeExcerpt?l.jsxs("details",{className:"rounded-md border border-border bg-muted/30 p-2 text-xs",children:[l.jsx("summary",{className:"cursor-pointer font-medium",children:"README excerpt"}),l.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap font-mono",children:e.readmeExcerpt})]}):null,l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs(re,{variant:"ghost",size:"sm",onClick:h,children:[l.jsx(_k,{className:"size-3.5"}),"Back"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(re,{variant:"outline",size:"sm",onClick:m,children:[l.jsx(Wa,{className:"size-3.5"}),"Refine with AI"]}),l.jsx(re,{onClick:f,disabled:!s,children:"Continue"})]})]})]})}function EH({proposal:e,onChange:t}){return l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsx(Mc,{label:"Service name",children:l.jsx(et,{value:e.name,onChange:s=>t({...e,name:s.target.value})})}),l.jsx(Mc,{label:"Port (optional)",children:l.jsx(et,{value:e.port?.toString()??"",placeholder:"auto",onChange:s=>t({...e,port:s.target.value?Number(s.target.value):void 0})})}),e.kind==="docker-compose"?l.jsx(Mc,{label:"Compose service",className:"col-span-2",children:l.jsx(et,{value:e.composeService??"",onChange:s=>t({...e,composeService:s.target.value})})}):l.jsx(Mc,{label:"Run command",className:"col-span-2",children:l.jsx(et,{value:e.command??"",onChange:s=>t({...e,command:s.target.value})})})]})}function NH({proposal:e,busy:t,error:s,onBack:i,onRegister:a}){const[o,u]=w.useState(e.installCommand??""),[h,m]=w.useState([]),[f,p]=w.useState(!1),[b,x]=w.useState(!1),_=w.useRef(null);function y(C){m(E=>[...E,C]),queueMicrotask(()=>{const E=_.current;E&&(E.scrollTop=E.scrollHeight)})}async function S(){o.trim()&&(p(!0),x(!1),m([]),await Fj({clonePath:e.cwd,command:o.trim()},{onLine:C=>y(C.text),onDone:C=>{y(C===0?"✓ install complete":`✗ install exited ${C}`),p(!1),x(C===0)},onError:C=>{y(`✗ ${C}`),p(!1)}}))}return l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx(Mc,{label:"Install command (optional)",className:"flex-1",children:l.jsx(et,{value:o,placeholder:"e.g. npm install",onChange:C=>u(C.target.value)})}),l.jsxs(re,{variant:"outline",onClick:S,disabled:f||!o.trim(),children:[f?l.jsx(Os,{className:"size-4 animate-spin"}):l.jsx(Ek,{className:"size-4"}),"Install"]})]}),h.length>0?l.jsx("pre",{ref:_,className:"max-h-48 overflow-auto rounded-md border border-border bg-black/80 p-2 font-mono text-[11px] text-green-200",children:h.join(`
|
|
155
|
-
`)}):null,s?l.jsx("p",{className:"text-sm text-destructive",children:s}):null,l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs(re,{variant:"ghost",size:"sm",onClick:i,children:[l.jsx(_k,{className:"size-3.5"}),"Back"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(re,{variant:"outline",onClick:()=>a(!1),disabled:t,children:"Register only"}),l.jsxs(re,{onClick:()=>a(!0),disabled:t,children:[t?l.jsx(Os,{className:"size-4 animate-spin"}):l.jsx(Vh,{className:"size-4"}),b||!o.trim()?"Register & start":"Skip install & start"]})]})]})]})}function Mc({label:e,className:t,children:s}){return l.jsxs("label",{className:`flex flex-col gap-1 text-xs ${t??""}`,children:[l.jsx("span",{className:"font-medium text-muted-foreground",children:e}),s]})}function TH({data:e,onRefresh:t,focusService:s,onServiceFocused:i}){const a=e.config.services[0]?.name??"",[o,u]=w.useState(a),[h,m]=w.useState(null),[f,p]=w.useState(!1),{sendToAgent:b,startOnboard:x}=Ls(),[_,y]=w.useState(!1),[S,C]=w.useState(!1),[E,T]=w.useState(!1),[N,M]=w.useState(!1),R=w.useRef({}),{error:z,message:L,success:j}=Bs(),H=w.useMemo(()=>new Set(e.config.bundles.flatMap($=>$.services)),[e.config.bundles]),P=w.useMemo(()=>{const $=new Map;for(const D of e.config.bundles)for(const W of D.services)$.has(W)||$.set(W,D.name);return $},[e.config.bundles]),F=w.useMemo(()=>e.config.services.filter($=>!H.has($.name)),[e.config.services,H]),K=e.health??{},Y=e.config.bundles.length>0||F.length>0;w.useEffect(()=>{!e.config.services.some(D=>D.name===o)&&a&&u(a)},[e.config.services,a,o]),w.useEffect(()=>{s&&e.config.services.some($=>$.name===s)&&(u(s),i?.())},[s,e.config.services,i]);const Q=w.useMemo(()=>e.config.services.find($=>$.name===o),[e.config.services,o]),q=o?e.runtime.services[o]:void 0,O=o?K[o]:void 0;async function X($,D){if(!$.services.includes(D))try{await Kj($.name,$.services,D),j(`Added ${D} to ${$.name}.`),await t()}catch(W){z(W instanceof Error?W.message:String(W))}}async function Z(){if(Q){if(Bc(q?.state)){z(`Stop ${Q.name} before deleting it.`);return}if(window.confirm(`Delete service "${Q.name}"? This removes it from your config.`))try{await Gj(Q.name),j(`Deleted ${Q.name}.`),await t()}catch($){z($ instanceof Error?$.message:String($))}}}async function V($){const D=e.config.bundles.filter(W=>W.services.includes($));if(D.length!==0)try{for(const W of D)await Wj(W.name,W.services,$);L({text:`Removed ${$} from ${D.map(W=>W.name).join(", ")}.`}),await t()}catch(W){z(W instanceof Error?W.message:String(W))}}return w.useEffect(()=>{const $=Object.fromEntries(e.config.services.map(W=>[W.name,e.runtime.services[W.name]?.state??"stopped"])),D=R.current;if(Object.keys(D).length){const W=new Map,he=new Map;for(const le of e.config.services){const me=$[le.name],ne=D[le.name];if(!ne||ne===me)continue;const fe=e.runtime.services[le.name],we=P.get(le.name);if(we){const ye=W.get(we)??new Map;if(ye.set(me,(ye.get(me)??0)+1),W.set(we,ye),me==="exited"){const Ze=he.get(we)??[];Ze.push(fe?.exitCode),he.set(we,Ze)}continue}if(me==="running")j(`${le.name} is running.`);else if(me==="stopped")L({text:`${le.name} stopped.`});else if(me==="starting")L({text:`${le.name} is starting.`});else if(me==="exited"){const ye=fe?.exitCode===void 0||fe.exitCode===null?"":` with code ${fe.exitCode}`;z(`${le.name} exited${ye}.`)}}for(const[le,me]of W)MH({exitCodes:he.get(le)??[],groupName:le,showErrorToast:z,showMessageToast:L,showSuccessToast:j,transitions:me})}R.current=$},[e.config.services,e.runtime.services,P,z,L,j]),l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:de("grid h-full min-h-0 overflow-hidden bg-card/85",S?"lg:grid-cols-[320px_minmax(0,1fr)]":"lg:grid-cols-[320px_minmax(0,1fr)_340px]"),children:[l.jsx("div",{className:"min-h-0 min-w-0 overflow-auto border-r border-border",children:l.jsxs(Mi,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[l.jsx(ji,{className:"border-b border-border px-3 py-2",children:l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx(Ri,{className:"text-sm",children:"Services"}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsxs(re,{"aria-haspopup":"dialog",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>y(!0),size:"sm",type:"button",variant:"outline",children:[l.jsx(Pk,{className:"size-3.5"}),"Logs"]}),l.jsx(AH,{onCreateGroup:()=>m("group"),onCreateService:()=>m("service"),onOnboardRepo:()=>p(!0),onOnboardWithAi:x,canGroupWithAi:F.length>1,onCreateWithAi:()=>b({prompt:x7,source:{type:"service-setup",label:"Add a service"},label:"Help me add a new service, one step at a time."}),onGroupWithAi:()=>b({prompt:C7(F),source:{type:"group-services",label:"Group services"},label:"Propose how to group my ungrouped services."})})]})]})}),l.jsx(Di,{className:"p-0",children:Y?l.jsxs("div",{className:"divide-y divide-border",children:[e.config.bundles.map($=>l.jsx(S9,{group:$,onRefresh:t,ports:e.ports,allServices:e.config.services,health:K,services:e.config.services.filter(D=>$.services.includes(D.name)),statuses:e.runtime.services,timeline:e.timeline,selectedService:o,onSelectService:u,onDropService:D=>{X($,D)}},$.name)),F.length?l.jsxs("div",{className:de("transition-colors",N&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:$=>{$.dataTransfer.types.includes(qc)&&($.preventDefault(),$.dataTransfer.dropEffect="move",M(!0))},onDragLeave:()=>M(!1),onDrop:$=>{$.preventDefault(),M(!1);const D=$.dataTransfer.getData(qc);D&&V(D)},children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 bg-muted/55 px-3 py-1 text-[10px] font-semibold uppercase text-muted-foreground",children:[l.jsx("span",{children:"Ungrouped"}),l.jsx("span",{className:"text-muted-foreground/80",children:F.length})]}),l.jsx("div",{className:"divide-y divide-border",children:F.map($=>l.jsx(tN,{service:$,status:e.runtime.services[$.name],health:K[$.name],ports:e.ports,onRefresh:t,timeline:e.timeline,selected:o===$.name,onSelect:()=>u($.name)},$.name))})]}):null]}):l.jsx(Ah,{label:"No services registered yet."})})]})}),l.jsx("div",{className:"min-h-0 min-w-0 overflow-auto",children:Q?l.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[l.jsxs("div",{className:"shrink-0 space-y-2 border-b border-border bg-background/60 px-4 py-3",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx("h2",{className:"min-w-0 truncate text-base font-semibold",children:Q.name}),l.jsx(Fb,{state:q?.state??"stopped"}),l.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[(()=>{const $=q?.url??(Q.port?k9(Q.port):void 0);return $?l.jsx(Qo,{label:`Open ${$}`,children:l.jsx(re,{"aria-label":"Open in browser",className:"size-7",onClick:()=>window.open($,"_blank","noopener,noreferrer"),size:"icon",type:"button",variant:"outline",children:l.jsx(Jc,{})})}):null})(),O?.agentContext&&Q?l.jsx(Qo,{label:"Debug this service with AI",children:l.jsx(re,{"aria-label":"Debug this service with AI",className:"size-7",onClick:()=>b({prompt:E7({service:Q.name,context:O.agentContext}),source:{type:"service-debug",label:Q.name},label:`Debug \`${Q.name}\` with its current context.`}),size:"icon",type:"button",variant:"outline",children:l.jsx(ci,{className:"size-3.5"})})}):null,l.jsx(Ub,{active:Bc(q?.state),baseUrl:`/api/services/${encodeURIComponent(Q.name)}`,compact:!0,targetLabel:Q.name,onRefresh:t}),l.jsx(fN,{className:"size-7 border border-border bg-background opacity-100 hover:border-foreground/30",items:[{icon:l.jsx(Pc,{className:"size-3.5"}),label:"Edit service",onSelect:()=>T(!0)},...Bc(q?.state)?[]:[{icon:l.jsx(rl,{className:"size-3.5 text-destructive"}),label:"Delete service",onSelect:()=>{Z()}}]],label:`More actions for ${Q.name}`}),l.jsx(Qo,{label:S?"Show Ports & Timeline":"Hide Ports & Timeline",side:"left",children:l.jsx(re,{"aria-label":S?"Show Ports & Timeline":"Hide Ports & Timeline",className:"size-7",onClick:()=>C($=>!$),size:"icon",type:"button",variant:"ghost",children:S?l.jsx(PA,{}):l.jsx(ia,{})})})]})]}),Q.command?l.jsxs("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:Q.command,children:["$ ",Q.command]}):null,Q.cwd?l.jsx("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:Q.cwd,children:Q.cwd}):null,l.jsx(yz,{health:O})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:l.jsx(yH,{serviceName:Q.name,status:q,health:O,timeline:e.timeline??[],onRefresh:t},Q.name)})]}):l.jsx(Ah,{label:"Select a service to see details."})}),S?null:l.jsxs("div",{className:"min-h-0 overflow-auto border-l border-border",children:[l.jsx(Ez,{ports:e.ports}),l.jsx(hz,{events:e.timeline??[]})]})]}),E&&Q?l.jsx(Ti,{icon:l.jsx(Pc,{}),onClose:()=>T(!1),size:"lg",title:`Edit Service — ${Q.name}`,children:l.jsx(qS,{cwd:e.cwd,initialService:Q,onRefresh:t,onSaved:()=>T(!1)})}):null,h?l.jsx(Ti,{icon:h==="service"?l.jsx(mn,{}):l.jsx(Sk,{}),onClose:()=>m(null),size:h==="service"?"lg":"md",title:h==="service"?"Add Service":"Create Group",children:h==="service"?l.jsx(qS,{cwd:e.cwd,onRefresh:t,onSaved:()=>m(null)}):l.jsx(eN,{services:F,onRefresh:t,onSaved:()=>m(null)})}):null,f?l.jsx(wH,{onClose:()=>p(!1),onRefresh:t}):null,_?l.jsx(Pz,{initialService:o||void 0,onClose:()=>y(!1),services:e.config.services.map($=>$.name)}):null]})}function AH({onCreateService:e,onCreateGroup:t,onCreateWithAi:s,onGroupWithAi:i,canGroupWithAi:a,onOnboardRepo:o,onOnboardWithAi:u}){const[h,m]=w.useState(!1);function f(p){m(!1),p()}return l.jsxs("div",{className:"relative",children:[l.jsx(Qo,{label:"Add",side:"bottom",children:l.jsx(re,{"aria-expanded":h,"aria-haspopup":"menu","aria-label":"Add service or group",className:"size-7",onClick:()=>m(p=>!p),size:"icon",type:"button",variant:"ghost",children:l.jsx(mn,{})})}),h?l.jsxs(l.Fragment,{children:[l.jsx("button",{"aria-hidden":!0,className:"fixed inset-0 z-[40] cursor-default",onClick:()=>m(!1),tabIndex:-1,type:"button"}),l.jsxs("div",{className:"absolute right-0 z-[50] mt-1 w-56 overflow-hidden rounded-md border border-border bg-card py-1 shadow-lg",role:"menu",children:[l.jsxs("div",{className:"group flex items-stretch",children:[l.jsxs("button",{className:"flex flex-1 items-center gap-2 whitespace-nowrap px-3 py-2 text-left text-sm hover:bg-muted/60 [&_svg]:size-4",onClick:()=>f(e),role:"menuitem",type:"button",children:[l.jsx(mn,{}),"Create Service"]}),l.jsxs("button",{className:"flex max-w-0 items-center gap-1.5 overflow-hidden whitespace-nowrap border-l border-transparent px-0 text-[11px] font-medium text-muted-foreground opacity-0 transition-all duration-200 ease-out hover:bg-muted/60 hover:text-foreground group-hover:max-w-24 group-hover:border-border group-hover:px-3 group-hover:opacity-100",onClick:()=>f(s),role:"menuitem",title:"Set up with AI — the agent walks you through it",type:"button",children:[l.jsx(ci,{className:"size-3.5 shrink-0"}),"AI"]})]}),l.jsxs("div",{className:"group flex items-stretch",children:[l.jsxs("button",{className:"flex flex-1 items-center gap-2 whitespace-nowrap px-3 py-2 text-left text-sm hover:bg-muted/60 [&_svg]:size-4",onClick:()=>f(t),role:"menuitem",type:"button",children:[l.jsx(Sk,{}),"Create Group"]}),a?l.jsxs("button",{className:"flex max-w-0 items-center gap-1.5 overflow-hidden whitespace-nowrap border-l border-transparent px-0 text-[11px] font-medium text-muted-foreground opacity-0 transition-all duration-200 ease-out hover:bg-muted/60 hover:text-foreground group-hover:max-w-24 group-hover:border-border group-hover:px-3 group-hover:opacity-100",onClick:()=>f(i),role:"menuitem",title:"Group with AI — the agent proposes groupings for your ungrouped services",type:"button",children:[l.jsx(ci,{className:"size-3.5 shrink-0"}),"AI"]}):null]}),l.jsxs("div",{className:"group flex items-stretch",children:[l.jsxs("button",{className:"flex flex-1 items-center gap-2 whitespace-nowrap px-3 py-2 text-left text-sm hover:bg-muted/60 [&_svg]:size-4",onClick:()=>f(o),role:"menuitem",type:"button",children:[l.jsx(Wn,{}),"Add from GitHub"]}),l.jsxs("button",{className:"flex max-w-0 items-center gap-1.5 overflow-hidden whitespace-nowrap border-l border-transparent px-0 text-[11px] font-medium text-muted-foreground opacity-0 transition-all duration-200 ease-out hover:bg-muted/60 hover:text-foreground group-hover:max-w-24 group-hover:border-border group-hover:px-3 group-hover:opacity-100",onClick:()=>f(u),role:"menuitem",title:"Onboard with AI — the agent clones, detects and runs it for you",type:"button",children:[l.jsx(ci,{className:"size-3.5 shrink-0"}),"AI"]})]})]})]}):null]})}function MH({exitCodes:e,groupName:t,showErrorToast:s,showMessageToast:i,showSuccessToast:a,transitions:o}){if(o.size===1){const[m]=o.keys();if(m==="running")a(`${t} group is running.`);else if(m==="stopped")i({text:`${t} group stopped.`});else if(m==="starting")i({text:`${t} group is starting.`});else if(m==="exited"){const f=e.filter(b=>b!=null),p=f.length?` with code ${f.join(", ")}`:"";s(`${t} group exited${p}.`)}return}const u=[...o.entries()].map(([m,f])=>`${f} ${m}`).join(", "),h=`${t} group updated: ${u}.`;o.has("exited")?s(h):i({text:h})}function jH({data:e,onOpenService:t}){const s=w.useMemo(()=>RH(e),[e]);return s.length?l.jsxs("div",{className:"flex shrink-0 items-center gap-3 overflow-x-auto border-b border-border bg-card/60 px-4 py-1.5 backdrop-blur",children:[l.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:[l.jsx(Pa,{className:"size-3"}),"Running"]}),l.jsx("div",{className:"flex min-w-0 items-center gap-2",children:s.map(i=>l.jsxs("button",{className:"group flex shrink-0 items-center gap-2 rounded-md border border-border/60 bg-background/60 px-2.5 py-1 font-mono text-[11px] transition-colors hover:border-border hover:bg-muted",onClick:()=>t(i.name),title:i.url?`${i.name} — ${i.url}`:i.name,type:"button",children:[l.jsx("span",{className:de("size-2 shrink-0 rounded-full",OH(i.tone))}),l.jsx("span",{className:"max-w-40 truncate font-medium text-foreground",children:i.name}),i.port?l.jsxs("span",{className:"text-muted-foreground",children:[":",i.port]}):null,i.uptime?l.jsxs("span",{className:"text-muted-foreground/70",children:["↑",i.uptime]}):null]},i.name))})]}):null}function RH(e){const t=new Map(e.config.services.map(s=>[s.name,s.port]));return Object.values(e.runtime.services).filter(s=>s.state==="running"||s.state==="starting").map(s=>({name:s.name,tone:DH(s,e.health[s.name]),port:t.get(s.name)??LH(s.url),uptime:s.state==="running"?BH(s.startedAt):"starting…",url:s.url})).sort((s,i)=>s.name.localeCompare(i.name))}function DH(e,t){return e.state==="starting"?"starting":t?.status==="healthy"?"healthy":t?.status==="warning"?"warning":t?.status==="unhealthy"?"unhealthy":"healthy"}function OH(e){return e==="starting"?"animate-pulse bg-amber-500":e==="warning"?"bg-amber-500":e==="unhealthy"?"bg-red-500":e==="unknown"?"bg-zinc-500":"bg-emerald-500"}function LH(e){if(e)try{const t=new URL(e).port;return t?Number(t):void 0}catch{return}}function BH(e){if(!e)return;const t=new Date(e).getTime();if(Number.isNaN(t))return;const s=Math.max(0,Math.floor((Date.now()-t)/1e3));if(s<60)return`${s}s`;const i=Math.floor(s/60);if(i<60)return`${i}m`;const a=Math.floor(i/60),o=i%60;return a<24?`${a}h${o?`${o}m`:""}`:`${Math.floor(a/24)}d${a%24?`${a%24}h`:""}`}function zH(){const[e,t]=w.useState([]),[s,i]=w.useState(null),[a,o]=w.useState(!1);w.useEffect(()=>{let m=!1;return(async()=>{let f=await s6().catch(()=>[]);if(f.length===0){const p=await Yd().catch(()=>null);f=p?[p]:[]}m||(t(f),i(f[0]?.id??null))})(),()=>{m=!0}},[]);const u=w.useCallback(async()=>{o(!0);try{const m=await Yd();t(f=>[...f,m]),i(m.id)}finally{o(!1)}},[]),h=w.useCallback(async m=>{o(!0);try{await n6(m);const f=e.findIndex(b=>b.id===m),p=e.filter(b=>b.id!==m);if(p.length===0){const b=await Yd();t([b]),i(b.id);return}if(t(p),s===m){const b=p[Math.min(f,p.length-1)];i(b.id)}}finally{o(!1)}},[e,s]);return l.jsxs("section",{className:"flex h-full min-h-0 flex-col bg-[#090909] text-white",children:[l.jsxs("div",{"aria-label":"Terminal tabs",className:"flex shrink-0 items-center gap-1 overflow-x-auto border-b border-white/10 bg-[#111111] px-2 py-1.5",role:"tablist",children:[e.map((m,f)=>{const p=m.label??`Terminal ${f+1}`;return l.jsxs("div",{className:de("group flex items-center gap-1 rounded-md border border-transparent px-2 py-1 text-xs",m.id===s?"border-white/15 bg-white/10 text-white":"text-white/60 hover:bg-white/5"),children:[l.jsx("button",{"aria-selected":m.id===s,className:"max-w-[160px] truncate font-medium",onClick:()=>i(m.id),role:"tab",type:"button",children:p}),l.jsx("button",{"aria-label":`Close ${p}`,className:"rounded p-0.5 text-white/40 opacity-0 transition hover:bg-white/10 hover:text-white group-hover:opacity-100",disabled:a,onClick:()=>{h(m.id)},type:"button",children:l.jsx(Js,{className:"size-3"})})]},m.id)}),l.jsx("button",{"aria-label":"New terminal",className:"ml-1 rounded-md p-1 text-white/60 transition hover:bg-white/10 hover:text-white disabled:opacity-40",disabled:a,onClick:()=>{u()},type:"button",children:l.jsx(mn,{className:"size-4"})})]}),l.jsx("div",{className:"relative min-h-0 flex-1",children:e.length===0?l.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[11px] text-white/40",children:"Starting terminal…"}):e.map(m=>l.jsx("div",{className:"absolute inset-0",children:l.jsx(o3,{active:m.id===s,sessionId:m.id})},m.id))})]})}const IH=800;function dv({activeHunkIndex:e=0,diff:t}){const s=$H(t),i=w.useRef(null),a=w.useRef([]),[o,u]=w.useState(!1),h=w.useMemo(()=>s.reduce((f,p)=>Math.max(f,p.content.length),0),[s]),m=h>IH;if(w.useEffect(()=>{u(!1)},[t]),w.useEffect(()=>{if(m&&!o)return;const f=a.current[e],p=i.current;!f||!p||p.scrollTo({top:Math.max(f.offsetTop-8,0),behavior:"smooth"})},[e,t,m,o]),m&&!o){const f=s.filter(b=>b.kind==="add").length,p=s.filter(b=>b.kind==="delete").length;return l.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-card p-6",children:l.jsxs("div",{className:"max-w-sm space-y-3 text-center",children:[l.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Diff hidden for this data file"}),l.jsxs("p",{className:"text-[12px] text-muted-foreground",children:["Rows run up to ",h.toLocaleString()," characters, so this looks like a CSV, log, or other data dump rather than source code."]}),l.jsxs("p",{className:"font-mono text-[11px]",children:[l.jsxs("span",{className:"text-emerald-700",children:["+",f]})," ",l.jsxs("span",{className:"text-red-700",children:["-",p]})," lines changed"]}),l.jsx(re,{onClick:()=>u(!0),size:"sm",type:"button",variant:"outline",children:"Show diff anyway"})]})})}return l.jsx("div",{className:"absolute inset-0 overflow-auto bg-card text-xs leading-6 text-foreground",ref:i,children:l.jsx("div",{className:"min-w-full font-mono",children:s.map((f,p)=>l.jsxs("div",{className:de("grid grid-cols-[3rem_3rem_minmax(0,1fr)]",f.kind==="add"&&"bg-emerald-50 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300",f.kind==="delete"&&"bg-red-50 text-red-800 dark:bg-red-500/15 dark:text-red-300",r2(s,p)&&f.hunkIndex===e&&"outline outline-1 outline-offset-[-1px] outline-primary/35"),ref:f.hunkIndex!==null&&r2(s,p)?b=>{a.current[f.hunkIndex??0]=b}:void 0,children:[l.jsx(a2,{value:f.oldLine}),l.jsx(a2,{value:f.newLine}),l.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-all px-2",children:f.content||" "})]},`${p}-${f.content}`))})})}function PH(e){return e.split(`
|
|
156
|
-
`).reduce((t,s)=>(s.startsWith("@@")?t.hunks+=1:s.startsWith("+")&&!s.startsWith("+++")?t.additions+=1:s.startsWith("-")&&!s.startsWith("---")&&(t.deletions+=1),t),{additions:0,deletions:0,hunks:0})}function $H(e){const t=HH(e);return t.some(s=>s.kind==="hunk")?t.filter(s=>s.kind!=="meta"&&s.kind!=="hunk"):t}function HH(e){let t=null,s=null,i=null;return e.split(`
|
|
157
|
-
`).map(a=>{if(UH(a))return t=null,s=null,i=null,{content:a,hunkIndex:i,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("@@")){const u=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(a);return u&&(t=Number(u[1]),s=Number(u[2])),i=(i??-1)+1,{content:a,hunkIndex:i,kind:"hunk",oldLine:null,newLine:null}}if(t===null||s===null)return{content:a,hunkIndex:null,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("\\ No newline"))return{content:a,hunkIndex:i,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("+")&&!a.startsWith("+++")){const u={content:a,hunkIndex:i,kind:"add",oldLine:null,newLine:s};return s+=1,u}if(a.startsWith("-")&&!a.startsWith("---")){const u={content:a,hunkIndex:i,kind:"delete",oldLine:t,newLine:null};return t+=1,u}const o={content:a,hunkIndex:i,kind:"context",oldLine:t,newLine:s};return t+=1,s+=1,o})}function r2(e,t){const s=e[t]?.hunkIndex;if(s===null)return!1;const i=e.findIndex(a=>a.hunkIndex===s&&(a.kind==="add"||a.kind==="delete"));return i!==-1?i===t:e.findIndex(a=>a.hunkIndex===s)===t}function UH(e){return e.startsWith("diff --git ")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode ")||e.startsWith("deleted file mode ")||e.startsWith("old mode ")||e.startsWith("new mode ")||e.startsWith("similarity index ")||e.startsWith("rename from ")||e.startsWith("rename to ")||e.startsWith("Binary files ")}function a2({value:e}){return l.jsx("span",{className:de("select-none border-r border-border/70 px-2 text-right text-muted-foreground",e===null&&"text-transparent"),children:e??"-"})}function FH({branch:e,error:t,files:s,selectedFile:i,onSelectFile:a,root:o}){const u=w.useMemo(()=>KH(s).filter(f=>f.files.length),[s]),[h,m]=w.useState({staged:!1,unstaged:!1,untracked:!1});return l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border bg-card/95 px-2.5 py-1.5",children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[l.jsx(Wn,{className:"size-3.5"}),l.jsx("span",{className:"truncate",children:"Changes"})]}),l.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[e?l.jsx($e,{variant:"outline",children:e}):null,l.jsx($e,{variant:"secondary",children:s.length})]})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:u.length?u.map(f=>l.jsx(VH,{collapsed:h[f.id],group:f,onSelectFile:a,onToggle:()=>m(p=>({...p,[f.id]:!p[f.id]})),root:o,selectedFile:i},f.id)):l.jsx(it,{variant:"muted",className:"m-3 text-center",children:t??"No changed files."})})]})}function VH({collapsed:e,group:t,onSelectFile:s,onToggle:i,root:a,selectedFile:o}){const u=e?ia:Yn;return l.jsxs("section",{className:"border-b border-border last:border-b-0",children:[l.jsxs("button",{className:"flex w-full items-center justify-between gap-2 bg-muted/45 px-2 py-0.5 text-left text-[10px] font-semibold uppercase text-muted-foreground hover:bg-muted",onClick:i,type:"button",children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[l.jsx(u,{className:"size-3.5"}),l.jsx("span",{className:"truncate",children:t.label})]}),l.jsx($e,{className:"min-w-6 justify-center font-mono shadow-none",size:"small",variant:"outline",children:t.files.length})]}),e?null:l.jsx("div",{children:t.files.map(h=>l.jsx(qH,{active:o===h.path,file:h,group:t.id,onClick:()=>s(h.path),root:a},h.path))})]})}function qH({active:e,file:t,group:s,onClick:i,root:a}){const o=t.path.split("/").pop()||t.path,u=t.path.split("/").slice(0,-1).join("/"),h=a?JE(lu(a,t.path)):{};return l.jsxs("button",{"aria-label":`Open changed file ${t.path}`,className:de("flex w-full items-center gap-1.5 px-1 py-0.5 text-left text-[12px] hover:bg-muted",e&&"bg-muted font-medium"),onClick:i,type:"button",...h,children:[l.jsx(Vb,{path:t.path}),l.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-1.5 truncate",children:[l.jsx("span",{"data-testid":"changed-file-name",className:"shrink-0 truncate",children:o}),u?l.jsx("span",{"data-testid":"changed-file-dir",className:"min-w-0 truncate text-muted-foreground",children:u}):null]}),l.jsx("span",{className:de("ml-1 shrink-0 font-mono text-[10px] font-semibold",s==="untracked"&&"text-amber-700",s==="staged"&&"text-emerald-700",s==="unstaged"&&"text-zinc-800"),children:GH(t,s)})]})}function GH(e,t){return t==="untracked"?"?":t==="staged"?e.index.trim():e.workingTree.trim()}function KH(e){return[{id:"unstaged",label:"Changes",files:e.filter(t=>!(t.index==="?"&&t.workingTree==="?")&&t.workingTree.trim())},{id:"staged",label:"Staged Changes",files:e.filter(t=>!(t.index==="?"&&t.workingTree==="?")&&t.index.trim()&&!t.workingTree.trim())},{id:"untracked",label:"Untracked Files",files:e.filter(t=>t.index==="?"&&t.workingTree==="?")}]}function WH(e){const t={name:"",path:"",children:[],isFile:!1},s=new Map;s.set("",t);const i=[...e].sort();for(const o of i){const u=o.split("/");let h="";for(let m=0;m<u.length;m+=1){const f=u[m],p=m===u.length-1,b=h?`${h}/${f}`:f;let x=s.get(b);x||(x={name:f,path:b,children:[],isFile:p},s.set(b,x),s.get(h)?.children.push(x)),h=b}}const a=o=>{o.children.sort((u,h)=>u.isFile!==h.isFile?u.isFile?1:-1:u.name.localeCompare(h.name)),o.children.forEach(a)};return a(t),t}function o2(e,t){const s={"":!0},i=a=>{for(const o of a.children)o.isFile||(s[o.path]=!0,t&&i(o))};return i(e),s}function l2({defaultExpandAll:e=!1,paths:t,status:s,selectedFile:i,onSelectFile:a,branch:o,emptyMessage:u="No tracked files.",root:h,title:m="Files"}){const f=w.useMemo(()=>WH(t),[t]),p=w.useMemo(()=>o2(f,e),[e,f]),b=w.useMemo(()=>o2(f,!0),[f]),x=Math.max(0,Object.keys(b).length-1),_=w.useMemo(()=>{const R=new Map;for(const z of s)R.set(z.path,z);return R},[s]),[y,S]=w.useState(p),[C,E]=w.useState(!1);w.useEffect(()=>{C||f.children.length===0||(S(p),E(!0))},[p,C,f.children.length]);function T(R){S(z=>({...z,[R]:!z[R]}))}function N(){S(b)}function M(){S({"":!0})}return l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border bg-card/95 px-2.5 py-1.5",children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[l.jsx(Ka,{className:"size-3.5"}),l.jsx("span",{className:"truncate",children:m})]}),l.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[x>0?l.jsxs("span",{className:"flex items-center gap-0.5",children:[l.jsx("button",{"aria-label":"Expand all folders",className:"flex size-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:N,title:"Expand all folders",type:"button",children:l.jsx(G4,{className:"size-3.5"})}),l.jsx("button",{"aria-label":"Collapse all folders",className:"flex size-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:M,title:"Collapse all folders",type:"button",children:l.jsx(V4,{className:"size-3.5"})})]}):null,o?l.jsx($e,{variant:"outline",children:o}):null,l.jsx($e,{variant:"secondary",children:t.length})]})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:f.children.length===0?l.jsx(it,{variant:"muted",className:"m-3 text-center",children:u}):f.children.map(R=>l.jsx(l3,{depth:0,expanded:y,node:R,onSelectFile:a,onToggle:T,root:h,selectedFile:i,statusByPath:_},R.path))})]})}function l3({depth:e,expanded:t,node:s,onSelectFile:i,onToggle:a,root:o,selectedFile:u,statusByPath:h}){const m=t[s.path]??!1,f=6+e*12,p=o?JE(lu(o,s.path)):{};if(s.isFile){const _=h.get(s.path),y=u===s.path;return l.jsxs("button",{className:de("flex w-full items-center gap-1.5 px-1 py-0.5 text-left text-[12px] hover:bg-muted",y&&"bg-muted font-medium"),onClick:()=>i(s.path),style:{paddingLeft:f},type:"button",...p,children:[l.jsx(Vb,{path:s.path}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.name}),_?l.jsx(YH,{file:_}):null]})}const b=m?Yn:ia,x=m?Fh:Ka;return l.jsxs("div",{children:[l.jsxs("button",{className:"flex w-full items-center gap-1 py-0.5 text-left text-[12px] font-medium hover:bg-muted",onClick:()=>a(s.path),style:{paddingLeft:f},type:"button",...p,children:[l.jsx(b,{className:"size-3.5 shrink-0 text-muted-foreground"}),l.jsx(x,{className:"size-3.5 shrink-0 text-amber-600"}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.name})]}),m?s.children.map(_=>l.jsx(l3,{depth:e+1,expanded:t,node:_,onSelectFile:i,onToggle:a,root:o,selectedFile:u,statusByPath:h},_.path)):null]})}function YH({file:e}){const t=e.workingTree.trim()||e.index.trim();if(!t)return null;const s=e.index.trim()&&!e.workingTree.trim()?"text-emerald-700":t==="?"?"text-amber-700":"text-zinc-700";return l.jsx("span",{className:de("ml-1 shrink-0 font-mono text-[10px] font-semibold",s),children:t})}const XH="modulepreload",ZH=function(e){return"/"+e},c2={},QH=function(t,s,i){let a=Promise.resolve();if(s&&s.length>0){let m=function(f){return Promise.all(f.map(p=>Promise.resolve(p).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),h=u?.nonce||u?.getAttribute("nonce");a=m(s.map(f=>{if(f=ZH(f),f in c2)return;c2[f]=!0;const p=f.endsWith(".css"),b=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${b}`))return;const x=document.createElement("link");if(x.rel=p?"stylesheet":XH,p||(x.as="script"),x.crossOrigin="",x.href=f,h&&x.setAttribute("nonce",h),document.head.appendChild(x),p)return new Promise((_,y)=>{x.addEventListener("load",_),x.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return a.then(u=>{for(const h of u||[])h.status==="rejected"&&o(h.reason);return t().catch(o)})};var Xp,u2;function JH(){if(u2)return Xp;u2=1;function e(I){return I instanceof Map?I.clear=I.delete=I.set=function(){throw new Error("map is read-only")}:I instanceof Set&&(I.add=I.clear=I.delete=function(){throw new Error("set is read-only")}),Object.freeze(I),Object.getOwnPropertyNames(I).forEach(ae=>{const _e=I[ae],He=typeof _e;(He==="object"||He==="function")&&!Object.isFrozen(_e)&&e(_e)}),I}class t{constructor(ae){ae.data===void 0&&(ae.data={}),this.data=ae.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function s(I){return I.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(I,...ae){const _e=Object.create(null);for(const He in I)_e[He]=I[He];return ae.forEach(function(He){for(const Nt in He)_e[Nt]=He[Nt]}),_e}const a="</span>",o=I=>!!I.scope,u=(I,{prefix:ae})=>{if(I.startsWith("language:"))return I.replace("language:","language-");if(I.includes(".")){const _e=I.split(".");return[`${ae}${_e.shift()}`,..._e.map((He,Nt)=>`${He}${"_".repeat(Nt+1)}`)].join(" ")}return`${ae}${I}`};class h{constructor(ae,_e){this.buffer="",this.classPrefix=_e.classPrefix,ae.walk(this)}addText(ae){this.buffer+=s(ae)}openNode(ae){if(!o(ae))return;const _e=u(ae.scope,{prefix:this.classPrefix});this.span(_e)}closeNode(ae){o(ae)&&(this.buffer+=a)}value(){return this.buffer}span(ae){this.buffer+=`<span class="${ae}">`}}const m=(I={})=>{const ae={children:[]};return Object.assign(ae,I),ae};class f{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ae){this.top.children.push(ae)}openNode(ae){const _e=m({scope:ae});this.add(_e),this.stack.push(_e)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ae){return this.constructor._walk(ae,this.rootNode)}static _walk(ae,_e){return typeof _e=="string"?ae.addText(_e):_e.children&&(ae.openNode(_e),_e.children.forEach(He=>this._walk(ae,He)),ae.closeNode(_e)),ae}static _collapse(ae){typeof ae!="string"&&ae.children&&(ae.children.every(_e=>typeof _e=="string")?ae.children=[ae.children.join("")]:ae.children.forEach(_e=>{f._collapse(_e)}))}}class p extends f{constructor(ae){super(),this.options=ae}addText(ae){ae!==""&&this.add(ae)}startScope(ae){this.openNode(ae)}endScope(){this.closeNode()}__addSublanguage(ae,_e){const He=ae.root;_e&&(He.scope=`language:${_e}`),this.add(He)}toHTML(){return new h(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function b(I){return I?typeof I=="string"?I:I.source:null}function x(I){return S("(?=",I,")")}function _(I){return S("(?:",I,")*")}function y(I){return S("(?:",I,")?")}function S(...I){return I.map(_e=>b(_e)).join("")}function C(I){const ae=I[I.length-1];return typeof ae=="object"&&ae.constructor===Object?(I.splice(I.length-1,1),ae):{}}function E(...I){return"("+(C(I).capture?"":"?:")+I.map(He=>b(He)).join("|")+")"}function T(I){return new RegExp(I.toString()+"|").exec("").length-1}function N(I,ae){const _e=I&&I.exec(ae);return _e&&_e.index===0}const M=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function R(I,{joinWith:ae}){let _e=0;return I.map(He=>{_e+=1;const Nt=_e;let wt=b(He),Ae="";for(;wt.length>0;){const ke=M.exec(wt);if(!ke){Ae+=wt;break}Ae+=wt.substring(0,ke.index),wt=wt.substring(ke.index+ke[0].length),ke[0][0]==="\\"&&ke[1]?Ae+="\\"+String(Number(ke[1])+Nt):(Ae+=ke[0],ke[0]==="("&&_e++)}return Ae}).map(He=>`(${He})`).join(ae)}const z=/\b\B/,L="[a-zA-Z]\\w*",j="[a-zA-Z_]\\w*",H="\\b\\d+(\\.\\d+)?",P="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",K="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Y=(I={})=>{const ae=/^#![ ]*\//;return I.binary&&(I.begin=S(ae,/.*\b/,I.binary,/\b.*/)),i({scope:"meta",begin:ae,end:/$/,relevance:0,"on:begin":(_e,He)=>{_e.index!==0&&He.ignoreMatch()}},I)},Q={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Q]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Q]},X={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Z=function(I,ae,_e={}){const He=i({scope:"comment",begin:I,end:ae,contains:[]},_e);He.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Nt=E("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return He.contains.push({begin:S(/[ ]+/,"(",Nt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),He},V=Z("//","$"),$=Z("/\\*","\\*/"),D=Z("#","$"),W={scope:"number",begin:H,relevance:0},he={scope:"number",begin:P,relevance:0},le={scope:"number",begin:F,relevance:0},me={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Q,{begin:/\[/,end:/\]/,relevance:0,contains:[Q]}]},ne={scope:"title",begin:L,relevance:0},fe={scope:"title",begin:j,relevance:0},we={begin:"\\.\\s*"+j,relevance:0};var Ze=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:Q,BINARY_NUMBER_MODE:le,BINARY_NUMBER_RE:F,COMMENT:Z,C_BLOCK_COMMENT_MODE:$,C_LINE_COMMENT_MODE:V,C_NUMBER_MODE:he,C_NUMBER_RE:P,END_SAME_AS_BEGIN:function(I){return Object.assign(I,{"on:begin":(ae,_e)=>{_e.data._beginMatch=ae[1]},"on:end":(ae,_e)=>{_e.data._beginMatch!==ae[1]&&_e.ignoreMatch()}})},HASH_COMMENT_MODE:D,IDENT_RE:L,MATCH_NOTHING_RE:z,METHOD_GUARD:we,NUMBER_MODE:W,NUMBER_RE:H,PHRASAL_WORDS_MODE:X,QUOTE_STRING_MODE:O,REGEXP_MODE:me,RE_STARTERS_RE:K,SHEBANG:Y,TITLE_MODE:ne,UNDERSCORE_IDENT_RE:j,UNDERSCORE_TITLE_MODE:fe});function lt(I,ae){I.input[I.index-1]==="."&&ae.ignoreMatch()}function ct(I,ae){I.className!==void 0&&(I.scope=I.className,delete I.className)}function ze(I,ae){ae&&I.beginKeywords&&(I.begin="\\b("+I.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",I.__beforeBegin=lt,I.keywords=I.keywords||I.beginKeywords,delete I.beginKeywords,I.relevance===void 0&&(I.relevance=0))}function Lt(I,ae){Array.isArray(I.illegal)&&(I.illegal=E(...I.illegal))}function Oi(I,ae){if(I.match){if(I.begin||I.end)throw new Error("begin & end are not supported with match");I.begin=I.match,delete I.match}}function Jn(I,ae){I.relevance===void 0&&(I.relevance=1)}const xe=(I,ae)=>{if(!I.beforeMatch)return;if(I.starts)throw new Error("beforeMatch cannot be used with starts");const _e=Object.assign({},I);Object.keys(I).forEach(He=>{delete I[He]}),I.keywords=_e.keywords,I.begin=S(_e.beforeMatch,x(_e.begin)),I.starts={relevance:0,contains:[Object.assign(_e,{endsParent:!0})]},I.relevance=0,delete _e.beforeMatch},mt=["of","and","for","in","not","or","if","then","parent","list","value"],qs="keyword";function ls(I,ae,_e=qs){const He=Object.create(null);return typeof I=="string"?Nt(_e,I.split(" ")):Array.isArray(I)?Nt(_e,I):Object.keys(I).forEach(function(wt){Object.assign(He,ls(I[wt],ae,wt))}),He;function Nt(wt,Ae){ae&&(Ae=Ae.map(ke=>ke.toLowerCase())),Ae.forEach(function(ke){const Pe=ke.split("|");He[Pe[0]]=[wt,Gs(Pe[0],Pe[1])]})}}function Gs(I,ae){return ae?Number(ae):oa(I)?0:1}function oa(I){return mt.includes(I.toLowerCase())}const mr={},Bt=I=>{console.error(I)},Li=(I,...ae)=>{console.log(`WARN: ${I}`,...ae)},ws=(I,ae)=>{mr[`${I}/${ae}`]||(console.log(`Deprecated as of ${I}. ${ae}`),mr[`${I}/${ae}`]=!0)},Bi=new Error;function zi(I,ae,{key:_e}){let He=0;const Nt=I[_e],wt={},Ae={};for(let ke=1;ke<=ae.length;ke++)Ae[ke+He]=Nt[ke],wt[ke+He]=!0,He+=T(ae[ke-1]);I[_e]=Ae,I[_e]._emit=wt,I[_e]._multi=!0}function Qa(I){if(Array.isArray(I.begin)){if(I.skip||I.excludeBegin||I.returnBegin)throw Bt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Bi;if(typeof I.beginScope!="object"||I.beginScope===null)throw Bt("beginScope must be object"),Bi;zi(I,I.begin,{key:"beginScope"}),I.begin=R(I.begin,{joinWith:""})}}function pr(I){if(Array.isArray(I.end)){if(I.skip||I.excludeEnd||I.returnEnd)throw Bt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Bi;if(typeof I.endScope!="object"||I.endScope===null)throw Bt("endScope must be object"),Bi;zi(I,I.end,{key:"endScope"}),I.end=R(I.end,{joinWith:""})}}function fl(I){I.scope&&typeof I.scope=="object"&&I.scope!==null&&(I.beginScope=I.scope,delete I.scope)}function Ja(I){fl(I),typeof I.beginScope=="string"&&(I.beginScope={_wrap:I.beginScope}),typeof I.endScope=="string"&&(I.endScope={_wrap:I.endScope}),Qa(I),pr(I)}function Ii(I){function ae(Ae,ke){return new RegExp(b(Ae),"m"+(I.case_insensitive?"i":"")+(I.unicodeRegex?"u":"")+(ke?"g":""))}class _e{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ke,Pe){Pe.position=this.position++,this.matchIndexes[this.matchAt]=Pe,this.regexes.push([Pe,ke]),this.matchAt+=T(ke)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ke=this.regexes.map(Pe=>Pe[1]);this.matcherRe=ae(R(ke,{joinWith:"|"}),!0),this.lastIndex=0}exec(ke){this.matcherRe.lastIndex=this.lastIndex;const Pe=this.matcherRe.exec(ke);if(!Pe)return null;const qt=Pe.findIndex((Pi,to)=>to>0&&Pi!==void 0),Rt=this.matchIndexes[qt];return Pe.splice(0,qt),Object.assign(Pe,Rt)}}class He{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ke){if(this.multiRegexes[ke])return this.multiRegexes[ke];const Pe=new _e;return this.rules.slice(ke).forEach(([qt,Rt])=>Pe.addRule(qt,Rt)),Pe.compile(),this.multiRegexes[ke]=Pe,Pe}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ke,Pe){this.rules.push([ke,Pe]),Pe.type==="begin"&&this.count++}exec(ke){const Pe=this.getMatcher(this.regexIndex);Pe.lastIndex=this.lastIndex;let qt=Pe.exec(ke);if(this.resumingScanAtSamePosition()&&!(qt&&qt.index===this.lastIndex)){const Rt=this.getMatcher(0);Rt.lastIndex=this.lastIndex+1,qt=Rt.exec(ke)}return qt&&(this.regexIndex+=qt.position+1,this.regexIndex===this.count&&this.considerAll()),qt}}function Nt(Ae){const ke=new He;return Ae.contains.forEach(Pe=>ke.addRule(Pe.begin,{rule:Pe,type:"begin"})),Ae.terminatorEnd&&ke.addRule(Ae.terminatorEnd,{type:"end"}),Ae.illegal&&ke.addRule(Ae.illegal,{type:"illegal"}),ke}function wt(Ae,ke){const Pe=Ae;if(Ae.isCompiled)return Pe;[ct,Oi,Ja,xe].forEach(Rt=>Rt(Ae,ke)),I.compilerExtensions.forEach(Rt=>Rt(Ae,ke)),Ae.__beforeBegin=null,[ze,Lt,Jn].forEach(Rt=>Rt(Ae,ke)),Ae.isCompiled=!0;let qt=null;return typeof Ae.keywords=="object"&&Ae.keywords.$pattern&&(Ae.keywords=Object.assign({},Ae.keywords),qt=Ae.keywords.$pattern,delete Ae.keywords.$pattern),qt=qt||/\w+/,Ae.keywords&&(Ae.keywords=ls(Ae.keywords,I.case_insensitive)),Pe.keywordPatternRe=ae(qt,!0),ke&&(Ae.begin||(Ae.begin=/\B|\b/),Pe.beginRe=ae(Pe.begin),!Ae.end&&!Ae.endsWithParent&&(Ae.end=/\B|\b/),Ae.end&&(Pe.endRe=ae(Pe.end)),Pe.terminatorEnd=b(Pe.end)||"",Ae.endsWithParent&&ke.terminatorEnd&&(Pe.terminatorEnd+=(Ae.end?"|":"")+ke.terminatorEnd)),Ae.illegal&&(Pe.illegalRe=ae(Ae.illegal)),Ae.contains||(Ae.contains=[]),Ae.contains=[].concat(...Ae.contains.map(function(Rt){return Mn(Rt==="self"?Ae:Rt)})),Ae.contains.forEach(function(Rt){wt(Rt,Pe)}),Ae.starts&&wt(Ae.starts,ke),Pe.matcher=Nt(Pe),Pe}if(I.compilerExtensions||(I.compilerExtensions=[]),I.contains&&I.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return I.classNameAliases=i(I.classNameAliases||{}),wt(I)}function gs(I){return I?I.endsWithParent||gs(I.starts):!1}function Mn(I){return I.variants&&!I.cachedVariants&&(I.cachedVariants=I.variants.map(function(ae){return i(I,{variants:null},ae)})),I.cachedVariants?I.cachedVariants:gs(I)?i(I,{starts:I.starts?i(I.starts):null}):Object.isFrozen(I)?i(I):I}var ks="11.11.1";class ml extends Error{constructor(ae,_e){super(ae),this.name="HTMLInjectionError",this.html=_e}}const la=s,eo=i,at=Symbol("nomatch"),ei=7,gn=function(I){const ae=Object.create(null),_e=Object.create(null),He=[];let Nt=!0;const wt="Could not find the language '{}', did you forget to load/include a language module?",Ae={disableAutodetect:!0,name:"Plain text",contains:[]};let ke={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function Pe(ge){return ke.noHighlightRe.test(ge)}function qt(ge){let Re=ge.className+" ";Re+=ge.parentNode?ge.parentNode.className:"";const Xe=ke.languageDetectRe.exec(Re);if(Xe){const pt=Ks(Xe[1]);return pt||(Li(wt.replace("{}",Xe[1])),Li("Falling back to no-highlight mode for this block.",ge)),pt?Xe[1]:"no-highlight"}return Re.split(/\s+/).find(pt=>Pe(pt)||Ks(pt))}function Rt(ge,Re,Xe){let pt="",Kt="";typeof Re=="object"?(pt=ge,Xe=Re.ignoreIllegals,Kt=Re.language):(ws("10.7.0","highlight(lang, code, ...args) has been deprecated."),ws("10.7.0",`Please use highlight(code, options) instead.
|
|
158
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),Kt=ge,pt=Re),Xe===void 0&&(Xe=!0);const Ps={code:pt,language:Kt};ua("before:highlight",Ps);const bn=Ps.result?Ps.result:Pi(Ps.language,Ps.code,Xe);return bn.code=Ps.code,ua("after:highlight",bn),bn}function Pi(ge,Re,Xe,pt){const Kt=Object.create(null);function Ps(ve,Me){return ve.keywords[Me]}function bn(){if(!Ie.keywords){Qt.addText(gt);return}let ve=0;Ie.keywordPatternRe.lastIndex=0;let Me=Ie.keywordPatternRe.exec(gt),Ve="";for(;Me;){Ve+=gt.substring(ve,Me.index);const tt=Cs.case_insensitive?Me[0].toLowerCase():Me[0],zt=Ps(Ie,tt);if(zt){const[jn,_l]=zt;if(Qt.addText(Ve),Ve="",Kt[tt]=(Kt[tt]||0)+1,Kt[tt]<=ei&&(xr+=_l),jn.startsWith("_"))Ve+=Me[0];else{const _u=Cs.classNameAliases[jn]||jn;vn(Me[0],_u)}}else Ve+=Me[0];ve=Ie.keywordPatternRe.lastIndex,Me=Ie.keywordPatternRe.exec(gt)}Ve+=gt.substring(ve),Qt.addText(Ve)}function sn(){if(gt==="")return;let ve=null;if(typeof Ie.subLanguage=="string"){if(!ae[Ie.subLanguage]){Qt.addText(gt);return}ve=Pi(Ie.subLanguage,gt,!0,xu[Ie.subLanguage]),xu[Ie.subLanguage]=ve._top}else ve=so(gt,Ie.subLanguage.length?Ie.subLanguage:null);Ie.relevance>0&&(xr+=ve.relevance),Qt.__addSublanguage(ve._emitter,ve.language)}function Et(){Ie.subLanguage!=null?sn():bn(),gt=""}function vn(ve,Me){ve!==""&&(Qt.startScope(Me),Qt.addText(ve),Qt.endScope())}function bu(ve,Me){let Ve=1;const tt=Me.length-1;for(;Ve<=tt;){if(!ve._emit[Ve]){Ve++;continue}const zt=Cs.classNameAliases[ve[Ve]]||ve[Ve],jn=Me[Ve];zt?vn(jn,zt):(gt=jn,bn(),gt=""),Ve++}}function io(ve,Me){return ve.scope&&typeof ve.scope=="string"&&Qt.openNode(Cs.classNameAliases[ve.scope]||ve.scope),ve.beginScope&&(ve.beginScope._wrap?(vn(gt,Cs.classNameAliases[ve.beginScope._wrap]||ve.beginScope._wrap),gt=""):ve.beginScope._multi&&(bu(ve.beginScope,Me),gt="")),Ie=Object.create(ve,{parent:{value:Ie}}),Ie}function bl(ve,Me,Ve){let tt=N(ve.endRe,Ve);if(tt){if(ve["on:end"]){const zt=new t(ve);ve["on:end"](Me,zt),zt.isMatchIgnored&&(tt=!1)}if(tt){for(;ve.endsParent&&ve.parent;)ve=ve.parent;return ve}}if(ve.endsWithParent)return bl(ve.parent,Me,Ve)}function ro(ve){return Ie.matcher.regexIndex===0?(gt+=ve[0],1):(_r=!0,0)}function rf(ve){const Me=ve[0],Ve=ve.rule,tt=new t(Ve),zt=[Ve.__beforeBegin,Ve["on:begin"]];for(const jn of zt)if(jn&&(jn(ve,tt),tt.isMatchIgnored))return ro(Me);return Ve.skip?gt+=Me:(Ve.excludeBegin&&(gt+=Me),Et(),!Ve.returnBegin&&!Ve.excludeBegin&&(gt=Me)),io(Ve,ve),Ve.returnBegin?0:Me.length}function nn(ve){const Me=ve[0],Ve=Re.substring(ve.index),tt=bl(Ie,ve,Ve);if(!tt)return at;const zt=Ie;Ie.endScope&&Ie.endScope._wrap?(Et(),vn(Me,Ie.endScope._wrap)):Ie.endScope&&Ie.endScope._multi?(Et(),bu(Ie.endScope,ve)):zt.skip?gt+=Me:(zt.returnEnd||zt.excludeEnd||(gt+=Me),Et(),zt.excludeEnd&&(gt=Me));do Ie.scope&&Qt.closeNode(),!Ie.skip&&!Ie.subLanguage&&(xr+=Ie.relevance),Ie=Ie.parent;while(Ie!==tt.parent);return tt.starts&&io(tt.starts,ve),zt.returnEnd?0:Me.length}function vl(){const ve=[];for(let Me=Ie;Me!==Cs;Me=Me.parent)Me.scope&&ve.unshift(Me.scope);ve.forEach(Me=>Qt.openNode(Me))}let da={};function ao(ve,Me){const Ve=Me&&Me[0];if(gt+=ve,Ve==null)return Et(),0;if(da.type==="begin"&&Me.type==="end"&&da.index===Me.index&&Ve===""){if(gt+=Re.slice(Me.index,Me.index+1),!Nt){const tt=new Error(`0 width match regex (${ge})`);throw tt.languageName=ge,tt.badRule=da.rule,tt}return 1}if(da=Me,Me.type==="begin")return rf(Me);if(Me.type==="illegal"&&!Xe){const tt=new Error('Illegal lexeme "'+Ve+'" for mode "'+(Ie.scope||"<unnamed>")+'"');throw tt.mode=Ie,tt}else if(Me.type==="end"){const tt=nn(Me);if(tt!==at)return tt}if(Me.type==="illegal"&&Ve==="")return gt+=`
|
|
159
|
-
`,1;if(xl>1e5&&xl>Me.index*3)throw new Error("potential infinite loop, way more iterations than matches");return gt+=Ve,Ve.length}const Cs=Ks(ge);if(!Cs)throw Bt(wt.replace("{}",ge)),new Error('Unknown language: "'+ge+'"');const vu=Ii(Cs);let oo="",Ie=pt||vu;const xu={},Qt=new ke.__emitter(ke);vl();let gt="",xr=0,Ui=0,xl=0,_r=!1;try{if(Cs.__emitTokens)Cs.__emitTokens(Re,Qt);else{for(Ie.matcher.considerAll();;){xl++,_r?_r=!1:Ie.matcher.considerAll(),Ie.matcher.lastIndex=Ui;const ve=Ie.matcher.exec(Re);if(!ve)break;const Me=Re.substring(Ui,ve.index),Ve=ao(Me,ve);Ui=ve.index+Ve}ao(Re.substring(Ui))}return Qt.finalize(),oo=Qt.toHTML(),{language:ge,value:oo,relevance:xr,illegal:!1,_emitter:Qt,_top:Ie}}catch(ve){if(ve.message&&ve.message.includes("Illegal"))return{language:ge,value:la(Re),illegal:!0,relevance:0,_illegalBy:{message:ve.message,index:Ui,context:Re.slice(Ui-100,Ui+100),mode:ve.mode,resultSoFar:oo},_emitter:Qt};if(Nt)return{language:ge,value:la(Re),illegal:!1,relevance:0,errorRaised:ve,_emitter:Qt,_top:Ie};throw ve}}function to(ge){const Re={value:la(ge),illegal:!1,relevance:0,_top:Ae,_emitter:new ke.__emitter(ke)};return Re._emitter.addText(ge),Re}function so(ge,Re){Re=Re||ke.languages||Object.keys(ae);const Xe=to(ge),pt=Re.filter(Ks).filter(br).map(Et=>Pi(Et,ge,!1));pt.unshift(Xe);const Kt=pt.sort((Et,vn)=>{if(Et.relevance!==vn.relevance)return vn.relevance-Et.relevance;if(Et.language&&vn.language){if(Ks(Et.language).supersetOf===vn.language)return 1;if(Ks(vn.language).supersetOf===Et.language)return-1}return 0}),[Ps,bn]=Kt,sn=Ps;return sn.secondBest=bn,sn}function di(ge,Re,Xe){const pt=Re&&_e[Re]||Xe;ge.classList.add("hljs"),ge.classList.add(`language-${pt}`)}function Gt(ge){let Re=null;const Xe=qt(ge);if(Pe(Xe))return;if(ua("before:highlightElement",{el:ge,language:Xe}),ge.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ge);return}if(ge.children.length>0&&(ke.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ge)),ke.throwUnescapedHTML))throw new ml("One of your code blocks includes unescaped HTML.",ge.innerHTML);Re=ge;const pt=Re.textContent,Kt=Xe?Rt(pt,{language:Xe,ignoreIllegals:!0}):so(pt);ge.innerHTML=Kt.value,ge.dataset.highlighted="yes",di(ge,Xe,Kt.language),ge.result={language:Kt.language,re:Kt.relevance,relevance:Kt.relevance},Kt.secondBest&&(ge.secondBest={language:Kt.secondBest.language,relevance:Kt.secondBest.relevance}),ua("after:highlightElement",{el:ge,result:Kt,text:pt})}function Is(ge){ke=eo(ke,ge)}const gr=()=>{no(),ws("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function pl(){no(),ws("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let mu=!1;function no(){function ge(){no()}if(document.readyState==="loading"){mu||window.addEventListener("DOMContentLoaded",ge,!1),mu=!0;return}document.querySelectorAll(ke.cssSelector).forEach(Gt)}function pu(ge,Re){let Xe=null;try{Xe=Re(I)}catch(pt){if(Bt("Language definition for '{}' could not be registered.".replace("{}",ge)),Nt)Bt(pt);else throw pt;Xe=Ae}Xe.name||(Xe.name=ge),ae[ge]=Xe,Xe.rawDefinition=Re.bind(null,I),Xe.aliases&&$i(Xe.aliases,{languageName:ge})}function ca(ge){delete ae[ge];for(const Re of Object.keys(_e))_e[Re]===ge&&delete _e[Re]}function gl(){return Object.keys(ae)}function Ks(ge){return ge=(ge||"").toLowerCase(),ae[ge]||ae[_e[ge]]}function $i(ge,{languageName:Re}){typeof ge=="string"&&(ge=[ge]),ge.forEach(Xe=>{_e[Xe.toLowerCase()]=Re})}function br(ge){const Re=Ks(ge);return Re&&!Re.disableAutodetect}function vr(ge){ge["before:highlightBlock"]&&!ge["before:highlightElement"]&&(ge["before:highlightElement"]=Re=>{ge["before:highlightBlock"](Object.assign({block:Re.el},Re))}),ge["after:highlightBlock"]&&!ge["after:highlightElement"]&&(ge["after:highlightElement"]=Re=>{ge["after:highlightBlock"](Object.assign({block:Re.el},Re))})}function Zt(ge){vr(ge),He.push(ge)}function gu(ge){const Re=He.indexOf(ge);Re!==-1&&He.splice(Re,1)}function ua(ge,Re){const Xe=ge;He.forEach(function(pt){pt[Xe]&&pt[Xe](Re)})}function Hi(ge){return ws("10.7.0","highlightBlock will be removed entirely in v12.0"),ws("10.7.0","Please use highlightElement now."),Gt(ge)}Object.assign(I,{highlight:Rt,highlightAuto:so,highlightAll:no,highlightElement:Gt,highlightBlock:Hi,configure:Is,initHighlighting:gr,initHighlightingOnLoad:pl,registerLanguage:pu,unregisterLanguage:ca,listLanguages:gl,getLanguage:Ks,registerAliases:$i,autoDetection:br,inherit:eo,addPlugin:Zt,removePlugin:gu}),I.debugMode=function(){Nt=!1},I.safeMode=function(){Nt=!0},I.versionString=ks,I.regex={concat:S,lookahead:x,either:E,optional:y,anyNumberOfTimes:_};for(const ge in Ze)typeof Ze[ge]=="object"&&e(Ze[ge]);return Object.assign(I,Ze),I},zs=gn({});return zs.newInstance=()=>gn({}),Xp=zs,zs.HighlightJS=zs,zs.default=zs,Xp}var Zp,d2;function eU(){if(d2)return Zp;d2=1;function e(t){const s=t.regex,i=s.concat(/[\p{L}_]/u,s.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},h=t.inherit(u,{begin:/\(/,end:/\)/}),m=t.inherit(t.APOS_STRING_MODE,{className:"string"}),f=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:a,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[u,f,m,h,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[u,h,f,m]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[f]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:s.concat(/</,s.lookahead(s.concat(i,s.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:i,relevance:0,starts:p}]},{className:"tag",begin:s.concat(/<\//,s.lookahead(s.concat(i,/>/))),contains:[{className:"name",begin:i,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return Zp=e,Zp}var Qp,h2;function tU(){if(h2)return Qp;h2=1;function e(t){const s=t.regex,i={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]};Object.assign(i,{className:"variable",variants:[{begin:s.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},u=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),h={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},m={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,i,o]};o.contains.push(m);const f={match:/\\"/},p={className:"string",begin:/'/,end:/'/},b={match:/\\'/},x={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,i]},_=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],y=t.SHEBANG({binary:`(${_.join("|")})`,relevance:10}),S={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},C=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],E=["true","false"],T={match:/(\/[a-z._-]+)+/},N=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],M=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],R=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],z=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:C,literal:E,built_in:[...N,...M,"set","shopt",...R,...z]},contains:[y,t.SHEBANG(),S,x,u,h,T,m,f,p,b,i]}}return Qp=e,Qp}var Jp,f2;function sU(){if(f2)return Jp;f2=1;function e(t){const s=t.regex,i=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",h="("+a+"|"+s.optional(o)+"[a-zA-Z_]\\w*"+s.optional("<[^<>]+>")+")",m={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},x={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},i,t.C_BLOCK_COMMENT_MODE]},_={className:"title",begin:s.optional(o)+t.IDENT_RE,relevance:0},y=s.optional(o)+t.IDENT_RE+"\\s*\\(",E={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},T=[x,m,i,t.C_BLOCK_COMMENT_MODE,b,p],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:E,contains:T.concat([{begin:/\(/,end:/\)/,keywords:E,contains:T.concat(["self"]),relevance:0}]),relevance:0},M={begin:"("+h+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:E,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:E,relevance:0},{begin:y,returnBegin:!0,contains:[t.inherit(_,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:E,relevance:0,contains:[i,t.C_BLOCK_COMMENT_MODE,p,b,m,{begin:/\(/,end:/\)/,keywords:E,relevance:0,contains:["self",i,t.C_BLOCK_COMMENT_MODE,p,b,m]}]},m,i,t.C_BLOCK_COMMENT_MODE,x]};return{name:"C",aliases:["h"],keywords:E,disableAutodetect:!0,illegal:"</",contains:[].concat(N,M,T,[x,{begin:t.IDENT_RE+"::",keywords:E},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:x,strings:p,keywords:E}}}return Jp=e,Jp}var eg,m2;function nU(){if(m2)return eg;m2=1;function e(t){const s=t.regex,i=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",h="(?!struct)("+a+"|"+s.optional(o)+"[a-zA-Z_]\\w*"+s.optional("<[^<>]+>")+")",m={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},x={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},i,t.C_BLOCK_COMMENT_MODE]},_={className:"title",begin:s.optional(o)+t.IDENT_RE,relevance:0},y=s.optional(o)+t.IDENT_RE+"\\s*\\(",S=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],C=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],E=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],T=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],R={type:C,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:E},z={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:s.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,s.lookahead(/(<[^<>]+>|)\s*\(/))},L=[z,x,m,i,t.C_BLOCK_COMMENT_MODE,b,p],j={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:R,contains:L.concat([{begin:/\(/,end:/\)/,keywords:R,contains:L.concat(["self"]),relevance:0}]),relevance:0},H={className:"function",begin:"("+h+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:R,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:R,relevance:0},{begin:y,returnBegin:!0,contains:[_],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:[i,t.C_BLOCK_COMMENT_MODE,p,b,m,{begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:["self",i,t.C_BLOCK_COMMENT_MODE,p,b,m]}]},m,i,t.C_BLOCK_COMMENT_MODE,x]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:R,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(j,H,z,L,[x,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:R,contains:["self",m]},{begin:t.IDENT_RE+"::",keywords:R},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return eg=e,eg}var tg,p2;function iU(){if(p2)return tg;p2=1;function e(t){const s=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],i=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],a=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],u=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],h={keyword:o.concat(u),built_in:s,literal:a},m=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},p={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},x=t.inherit(b,{illegal:/\n/}),_={className:"subst",begin:/\{/,end:/\}/,keywords:h},y=t.inherit(_,{illegal:/\n/}),S={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,y]},C={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},_]},E=t.inherit(C,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]});_.contains=[C,S,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.C_BLOCK_COMMENT_MODE],y.contains=[E,S,x,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const T={variants:[p,C,S,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},N={begin:"<",end:">",contains:[{beginKeywords:"in out"},m]},M=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",R={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:h,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},T,f,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},m,N,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[m,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[m,N,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+M+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:h,contains:[{beginKeywords:i.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,N],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,relevance:0,contains:[T,f,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},R]}}return tg=e,tg}var sg,g2;function rU(){if(g2)return sg;g2=1;const e=f=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:f.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:f.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],s=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],i=[...t,...s],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),o=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),u=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),h=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function m(f){const p=f.regex,b=e(f),x={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},_="and or not only",y=/@-?\w[\w]*(-\w+)*/,S="[a-zA-Z-][a-zA-Z0-9_-]*",C=[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[b.BLOCK_COMMENT,x,b.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+S,relevance:0},b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+o.join("|")+")"},{begin:":(:)?("+u.join("|")+")"}]},b.CSS_VARIABLE,{className:"attribute",begin:"\\b("+h.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[b.BLOCK_COMMENT,b.HEXCOLOR,b.IMPORTANT,b.CSS_NUMBER_MODE,...C,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...C,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},b.FUNCTION_DISPATCH]},{begin:p.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:y},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:_,attribute:a.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...C,b.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+i.join("|")+")\\b"}]}}return sg=m,sg}var ng,b2;function aU(){if(b2)return ng;b2=1;function e(t){const s=t.regex,i={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},u={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},h={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},m=/[A-Za-z][A-Za-z0-9+.-]*/,f={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:s.concat(/\[.+?\]\(/,m,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=t.inherit(p,{contains:[]}),_=t.inherit(b,{contains:[]});p.contains.push(_),b.contains.push(x);let y=[i,f];return[p,b,x,_].forEach(T=>{T.contains=T.contains.concat(y)}),y=y.concat(p,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:y},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:y}]}]},i,u,p,b,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},o,a,f,h,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return ng=e,ng}var ig,v2;function oU(){if(v2)return ig;v2=1;function e(t){const s=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:s.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:s.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}return ig=e,ig}var rg,x2;function lU(){if(x2)return rg;x2=1;function e(t){const s=t.regex,i="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=s.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=s.concat(a,/(::\w+)*/),h={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},m={className:"doctag",begin:"@[A-Za-z]+"},f={begin:"#<",end:">"},p=[t.COMMENT("#","$",{contains:[m]}),t.COMMENT("^=begin","^=end",{contains:[m],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],b={className:"subst",begin:/#\{/,end:/\}/,keywords:h},x={className:"string",contains:[t.BACKSLASH_ESCAPE,b],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:s.concat(/<<[-~]?'?/,s.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,b]})]}]},_="[1-9](_?[0-9])*|0",y="[0-9](_?[0-9])*",S={className:"number",relevance:0,variants:[{begin:`\\b(${_})(\\.(${y}))?([eE][+-]?(${y})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},C={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:h}]},L=[x,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:h},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:h},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{match:[/def/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[C]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[x,{begin:i}],relevance:0},S,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:h},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,b],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(f,p),relevance:0}].concat(f,p);b.contains=L,C.contains=L;const F=[{begin:/^\s*=>/,starts:{end:"$",contains:L}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:h,contains:L}}];return p.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:h,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(F).concat(p).concat(L)}}return rg=e,rg}var ag,_2;function cU(){if(_2)return ag;_2=1;function e(t){const u={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:u,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:u,illegal:/["']/}]}]}}return ag=e,ag}var og,y2;function uU(){if(y2)return og;y2=1;function e(t){const s=t.regex,i=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:s.concat(i,s.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return og=e,og}var lg,S2;function dU(){if(S2)return lg;S2=1;function e(t){const s=t.regex,i={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},a=t.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},u={className:"literal",begin:/\bon|off|true|false|yes|no\b/},h={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},m={begin:/\[/,end:/\]/,contains:[a,u,o,h,i,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,b=/'[^']*'/,x=s.either(f,p,b),_=s.concat(x,"(\\s*\\.\\s*",x,")*",s.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{begin:_,className:"attr",starts:{end:/$/,contains:[a,m,u,o,h,i]}}]}}return lg=e,lg}var cg,w2;function hU(){if(w2)return cg;w2=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,s="[0-9a-fA-F](_*[0-9a-fA-F])*",i={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${s})\\.?|(${s})?\\.(${s}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${s})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function a(u,h,m){return m===-1?"":u.replace(h,f=>a(u,h,m-1))}function o(u){const h=u.regex,m="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",f=m+a("(?:<"+m+"~~~(?:\\s*,\\s*"+m+"~~~)*>)?",/~~~/g,2),y={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},S={className:"meta",begin:"@"+m,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},C={className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[u.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:y,illegal:/<\/|#/,contains:[u.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},u.C_LINE_COMMENT_MODE,u.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[u.BACKSLASH_ESCAPE]},u.APOS_STRING_MODE,u.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,m],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[h.concat(/(?!else)/,m),/\s+/,m,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,m],className:{1:"keyword",3:"title.class"},contains:[C,u.C_LINE_COMMENT_MODE,u.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+f+"\\s+)",u.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:y,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[S,u.APOS_STRING_MODE,u.QUOTE_STRING_MODE,i,u.C_BLOCK_COMMENT_MODE]},u.C_LINE_COMMENT_MODE,u.C_BLOCK_COMMENT_MODE]},i,S]}}return cg=o,cg}var ug,k2;function fU(){if(k2)return ug;k2=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],s=["true","false","null","undefined","NaN","Infinity"],i=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],a=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],o=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],u=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],h=[].concat(o,i,a);function m(f){const p=f.regex,b=(fe,{after:we})=>{const ye="</"+fe[0].slice(1);return fe.input.indexOf(ye,we)!==-1},x=e,_={begin:"<>",end:"</>"},y=/<[A-Za-z0-9\\._:-]+\s*\/>/,S={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(fe,we)=>{const ye=fe[0].length+fe.index,Ze=fe.input[ye];if(Ze==="<"||Ze===","){we.ignoreMatch();return}Ze===">"&&(b(fe,{after:ye})||we.ignoreMatch());let lt;const ct=fe.input.substring(ye);if(lt=ct.match(/^\s*=/)){we.ignoreMatch();return}if((lt=ct.match(/^\s+extends\s+/))&<.index===0){we.ignoreMatch();return}}},C={$pattern:e,keyword:t,literal:s,built_in:h,"variable.language":u},E="[0-9](_?[0-9])*",T=`\\.(${E})`,N="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",M={className:"number",variants:[{begin:`(\\b(${N})((${T})|\\.)?|(${T}))[eE][+-]?(${E})\\b`},{begin:`\\b(${N})\\b((${T})\\b|\\.)?|(${T})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},R={className:"subst",begin:"\\$\\{",end:"\\}",keywords:C,contains:[]},z={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,R],subLanguage:"xml"}},L={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,R],subLanguage:"css"}},j={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,R],subLanguage:"graphql"}},H={className:"string",begin:"`",end:"`",contains:[f.BACKSLASH_ESCAPE,R]},F={className:"comment",variants:[f.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:x+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),f.C_BLOCK_COMMENT_MODE,f.C_LINE_COMMENT_MODE]},K=[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,z,L,j,H,{match:/\$\d+/},M];R.contains=K.concat({begin:/\{/,end:/\}/,keywords:C,contains:["self"].concat(K)});const Y=[].concat(F,R.contains),Q=Y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:C,contains:["self"].concat(Y)}]),q={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:Q},O={variants:[{match:[/class/,/\s+/,x,/\s+/,/extends/,/\s+/,p.concat(x,"(",p.concat(/\./,x),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,x],scope:{1:"keyword",3:"title.class"}}]},X={relevance:0,match:p.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...i,...a]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},V={variants:[{match:[/function/,/\s+/,x,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[q],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function D(fe){return p.concat("(?!",fe.join("|"),")")}const W={match:p.concat(/\b/,D([...o,"super","import"].map(fe=>`${fe}\\s*\\(`)),x,p.lookahead(/\s*\(/)),className:"title.function",relevance:0},he={begin:p.concat(/\./,p.lookahead(p.concat(x,/(?![0-9A-Za-z$_(])/))),end:x,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},le={match:[/get|set/,/\s+/,x,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},q]},me="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+f.UNDERSCORE_IDENT_RE+")\\s*=>",ne={match:[/const|var|let/,/\s+/,x,/\s*/,/=\s*/,/(async\s*)?/,p.lookahead(me)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[q]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:C,exports:{PARAMS_CONTAINS:Q,CLASS_REFERENCE:X},illegal:/#(?![$_A-z])/,contains:[f.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,z,L,j,H,F,{match:/\$\d+/},M,X,{scope:"attr",match:x+p.lookahead(":"),relevance:0},ne,{begin:"("+f.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[F,f.REGEXP_MODE,{className:"function",begin:me,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:f.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:Q}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:_.begin,end:_.end},{match:y},{begin:S.begin,"on:begin":S.isTrulyOpeningTag,end:S.end}],subLanguage:"xml",contains:[{begin:S.begin,end:S.end,skip:!0,contains:["self"]}]}]},V,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+f.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[q,f.inherit(f.TITLE_MODE,{begin:x,className:"title.function"})]},{match:/\.\.\./,relevance:0},he,{match:"\\$"+x,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[q]},W,$,O,le,{match:/\$[(.]/}]}}return ug=m,ug}var dg,C2;function mU(){if(C2)return dg;C2=1;function e(t){const s={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},i={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],o={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[s,i,t.QUOTE_STRING_MODE,o,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return dg=e,dg}var hg,E2;function pU(){if(E2)return hg;E2=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,s="[0-9a-fA-F](_*[0-9a-fA-F])*",i={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${s})\\.?|(${s})?\\.(${s}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${s})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function a(o){const u={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},h={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},m={className:"symbol",begin:o.UNDERSCORE_IDENT_RE+"@"},f={className:"subst",begin:/\$\{/,end:/\}/,contains:[o.C_NUMBER_MODE]},p={className:"variable",begin:"\\$"+o.UNDERSCORE_IDENT_RE},b={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[p,f]},{begin:"'",end:"'",illegal:/\n/,contains:[o.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[o.BACKSLASH_ESCAPE,p,f]}]};f.contains.push(b);const x={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+o.UNDERSCORE_IDENT_RE+")?"},_={className:"meta",begin:"@"+o.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[o.inherit(b,{className:"string"}),"self"]}]},y=i,S=o.COMMENT("/\\*","\\*/",{contains:[o.C_BLOCK_COMMENT_MODE]}),C={variants:[{className:"type",begin:o.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},E=C;return E.variants[1].contains=[C],C.variants[1].contains=[E],{name:"Kotlin",aliases:["kt","kts"],keywords:u,contains:[o.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),o.C_LINE_COMMENT_MODE,S,h,m,x,_,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:u,relevance:5,contains:[{begin:o.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[o.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:u,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[C,o.C_LINE_COMMENT_MODE,S],relevance:0},o.C_LINE_COMMENT_MODE,S,x,_,b,o.C_NUMBER_MODE]},S]},{begin:[/class|interface|trait/,/\s+/,o.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},o.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},x,_]},b,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
160
|
-
`},y]}}return hg=a,hg}var fg,N2;function gU(){if(N2)return fg;N2=1;const e=p=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:p.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:p.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],s=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],i=[...t,...s],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),o=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),u=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),h=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),m=o.concat(u).sort().reverse();function f(p){const b=e(p),x=m,_="and or not only",y="[\\w-]+",S="("+y+"|@\\{"+y+"\\})",C=[],E=[],T=function(Y){return{className:"string",begin:"~?"+Y+".*?"+Y}},N=function(Y,Q,q){return{className:Y,begin:Q,relevance:q}},M={$pattern:/[a-z-]+/,keyword:_,attribute:a.join(" ")},R={begin:"\\(",end:"\\)",contains:E,keywords:M,relevance:0};E.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,T("'"),T('"'),b.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},b.HEXCOLOR,R,N("variable","@@?"+y,10),N("variable","@\\{"+y+"\\}"),N("built_in","~?`[^`]*?`"),{className:"attribute",begin:y+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},b.IMPORTANT,{beginKeywords:"and not"},b.FUNCTION_DISPATCH);const z=E.concat({begin:/\{/,end:/\}/,contains:C}),L={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(E)},j={begin:S+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},b.CSS_VARIABLE,{className:"attribute",begin:"\\b("+h.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:E}}]},H={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:M,returnEnd:!0,contains:E,relevance:0}},P={className:"variable",variants:[{begin:"@"+y+"\\s*:",relevance:15},{begin:"@"+y}],starts:{end:"[;}]",returnEnd:!0,contains:z}},F={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:S,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,L,N("keyword","all\\b"),N("variable","@\\{"+y+"\\}"),{begin:"\\b("+i.join("|")+")\\b",className:"selector-tag"},b.CSS_NUMBER_MODE,N("selector-tag",S,0),N("selector-id","#"+S),N("selector-class","\\."+S,0),N("selector-tag","&",0),b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+o.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+u.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:z},{begin:"!important"},b.FUNCTION_DISPATCH]},K={begin:y+`:(:)?(${x.join("|")})`,returnBegin:!0,contains:[F]};return C.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,H,P,K,j,F,L,b.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:C}}return fg=f,fg}var mg,T2;function bU(){if(T2)return mg;T2=1;function e(t){const s="\\[=*\\[",i="\\]=*\\]",a={begin:s,end:i,contains:["self"]},o=[t.COMMENT("--(?!"+s+")","$"),t.COMMENT("--"+s,i,{contains:[a],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:s,end:i,contains:[a],relevance:5}])}}return mg=e,mg}var pg,A2;function vU(){if(A2)return pg;A2=1;function e(t){const s={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},i={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,s]},a={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[s,i]},o={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},u={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},h={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[s]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,s,i,a,o,u,h]}}return pg=e,pg}var gg,M2;function xU(){if(M2)return gg;M2=1;function e(t){const s=t.regex,i=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],a=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:i.join(" ")},u={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},h={begin:/->\{/,end:/\}/},m={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},f={scope:"variable",variants:[{begin:/\$\d/},{begin:s.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[m]},p={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},b=[t.BACKSLASH_ESCAPE,u,f],x=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],_=(C,E,T="\\1")=>{const N=T==="\\1"?T:s.concat(T,E);return s.concat(s.concat("(?:",C,")"),E,/(?:\\.|[^\\\/])*?/,N,/(?:\\.|[^\\\/])*?/,T,a)},y=(C,E,T)=>s.concat(s.concat("(?:",C,")"),E,/(?:\\.|[^\\\/])*?/,T,a),S=[f,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),h,{className:"string",contains:b,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},p,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:_("s|tr|y",s.either(...x,{capture:!0}))},{begin:_("s|tr|y","\\(","\\)")},{begin:_("s|tr|y","\\[","\\]")},{begin:_("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:y("(?:m|qr)?",/\//,/\//)},{begin:y("m|qr",s.either(...x,{capture:!0}),/\1/)},{begin:y("m|qr",/\(/,/\)/)},{begin:y("m|qr",/\[/,/\]/)},{begin:y("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,m]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,m,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return u.contains=S,h.contains=S,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:S}}return gg=e,gg}var bg,j2;function _U(){if(j2)return bg;j2=1;function e(t){const s={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},i=/[a-zA-Z@][a-zA-Z0-9_]*/,m={"variable.language":["this","super"],$pattern:i,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},f={$pattern:i,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:m,illegal:"</",contains:[s,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+f.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:f,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}return bg=e,bg}var vg,R2;function yU(){if(R2)return vg;R2=1;function e(t){const s=t.regex,i=/(?![A-Za-z0-9])(?![$])/,a=s.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,i),o=s.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,i),u=s.concat(/[A-Z]+/,i),h={scope:"variable",match:"\\$+"+a},m={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},f={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=t.inherit(t.APOS_STRING_MODE,{illegal:null}),b=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(f)}),x={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(f),"on:begin":(q,O)=>{O.data._beginMatch=q[1]||q[2]},"on:end":(q,O)=>{O.data._beginMatch!==q[1]&&O.ignoreMatch()}},_=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
|
|
161
|
-
]`,S={scope:"string",variants:[b,p,x,_]},C={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},E=["false","null","true"],T=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],N=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],R={keyword:T,literal:(q=>{const O=[];return q.forEach(X=>{O.push(X),X.toLowerCase()===X?O.push(X.toUpperCase()):O.push(X.toLowerCase())}),O})(E),built_in:N},z=q=>q.map(O=>O.replace(/\|\d+$/,"")),L={variants:[{match:[/new/,s.concat(y,"+"),s.concat("(?!",z(N).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},j=s.concat(a,"\\b(?!\\()"),H={variants:[{match:[s.concat(/::/,s.lookahead(/(?!class\b)/)),j],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,s.concat(/::/,s.lookahead(/(?!class\b)/)),j],scope:{1:"title.class",3:"variable.constant"}},{match:[o,s.concat("::",s.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},P={scope:"attr",match:s.concat(a,s.lookahead(":"),s.lookahead(/(?!::)/))},F={relevance:0,begin:/\(/,end:/\)/,keywords:R,contains:[P,h,H,t.C_BLOCK_COMMENT_MODE,S,C,L]},K={relevance:0,match:[/\b/,s.concat("(?!fn\\b|function\\b|",z(T).join("\\b|"),"|",z(N).join("\\b|"),"\\b)"),a,s.concat(y,"*"),s.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[F]};F.contains.push(K);const Y=[P,H,t.C_BLOCK_COMMENT_MODE,S,C,L],Q={begin:s.concat(/#\[\s*\\?/,s.either(o,u)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...Y]},...Y,{scope:"meta",variants:[{match:o},{match:u}]}]};return{case_insensitive:!1,keywords:R,contains:[Q,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},m,{scope:"variable.language",match:/\$this\b/},h,K,H,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},L,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:R,contains:["self",Q,h,H,t.C_BLOCK_COMMENT_MODE,S,C]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},S,C]}}return vg=e,vg}var xg,D2;function SU(){if(D2)return xg;D2=1;function e(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}return xg=e,xg}var _g,O2;function wU(){if(O2)return _g;O2=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return _g=e,_g}var yg,L2;function kU(){if(L2)return yg;L2=1;function e(t){const s=t.regex,i=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],m={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},f={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:m,illegal:/#/},b={begin:/\{\{/,relevance:0},x={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,f,b,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f,b,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,b,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},_="[0-9](_?[0-9])*",y=`(\\b(${_}))?\\.(${_})|\\b(${_})\\.`,S=`\\b|${a.join("|")}`,C={className:"number",relevance:0,variants:[{begin:`(\\b(${_})|(${y}))[eE][+-]?(${_})[jJ]?(?=${S})`},{begin:`(${y})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${S})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${S})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${S})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${S})`},{begin:`\\b(${_})[jJ](?=${S})`}]},E={className:"comment",begin:s.lookahead(/# type:/),end:/$/,keywords:m,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},T={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:m,contains:["self",f,C,x,t.HASH_COMMENT_MODE]}]};return p.contains=[x,C,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:m,illegal:/(<\/|\?)|=>/,contains:[f,C,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,E,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[T]},{variants:[{match:[/\bclass/,/\s+/,i,/\s*/,/\(\s*/,i,/\s*\)/]},{match:[/\bclass/,/\s+/,i]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[C,T,x]}]}}return yg=e,yg}var Sg,B2;function CU(){if(B2)return Sg;B2=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return Sg=e,Sg}var wg,z2;function EU(){if(z2)return wg;z2=1;function e(t){const s=t.regex,i=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=s.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,u=s.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:i,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:s.lookahead(s.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:i},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,a]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[u,a]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"},match:[i,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:u},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return wg=e,wg}var kg,I2;function NU(){if(I2)return kg;I2=1;function e(t){const s=t.regex,i=/(r#)?/,a=s.concat(i,t.UNDERSCORE_IDENT_RE),o=s.concat(i,t.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:s.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,s.lookahead(/\s*\(/))},h="([ui](8|16|32|64|128|size)|f(32|64))?",m=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],f=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],b=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:b,keyword:m,literal:f,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+h},{begin:"\\b0o([0-7_]+)"+h},{begin:"\\b0x([A-Fa-f0-9_]+)"+h},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+h}],relevance:0},{begin:[/fn/,/\s+/,a],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,a],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,a,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:b}},{className:"punctuation",begin:"->"},u]}}return kg=e,kg}var Cg,P2;function TU(){if(P2)return Cg;P2=1;const e=f=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:f.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:f.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],s=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],i=[...t,...s],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),o=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),u=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),h=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function m(f){const p=e(f),b=u,x=o,_="@[a-z-]+",y="and or not only",C={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[f.C_LINE_COMMENT_MODE,f.C_BLOCK_COMMENT_MODE,p.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},p.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+i.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+x.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+b.join("|")+")"},C,{begin:/\(/,end:/\)/,contains:[p.CSS_NUMBER_MODE]},p.CSS_VARIABLE,{className:"attribute",begin:"\\b("+h.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[p.BLOCK_COMMENT,C,p.HEXCOLOR,p.CSS_NUMBER_MODE,f.QUOTE_STRING_MODE,f.APOS_STRING_MODE,p.IMPORTANT,p.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:_,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:y,attribute:a.join(" ")},contains:[{begin:_,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},C,f.QUOTE_STRING_MODE,f.APOS_STRING_MODE,p.HEXCOLOR,p.CSS_NUMBER_MODE]},p.FUNCTION_DISPATCH]}}return Cg=m,Cg}var Eg,$2;function AU(){if($2)return Eg;$2=1;function e(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}return Eg=e,Eg}var Ng,H2;function MU(){if(H2)return Ng;H2=1;function e(t){const s=t.regex,i=t.COMMENT("--","$"),a={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},u=["true","false","unknown"],h=["double precision","large object","with timezone","without timezone"],m=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],f=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],b=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],x=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],_=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],y=b,S=[...p,...f].filter(z=>!b.includes(z)),C={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},E={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={match:s.concat(/\b/,s.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function N(z){return s.concat(/\b/,s.either(...z.map(L=>L.replace(/\s+/,"\\s+"))),/\b/)}const M={scope:"keyword",match:N(_),relevance:0};function R(z,{exceptions:L,when:j}={}){const H=j;return L=L||[],z.map(P=>P.match(/\|\d+$/)||L.includes(P)?P:H(P)?`${P}|0`:P)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:R(S,{when:z=>z.length<3}),literal:u,type:m,built_in:x},contains:[{scope:"type",match:N(h)},M,T,C,a,o,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,i,E]}}return Ng=e,Ng}var Tg,U2;function jU(){if(U2)return Tg;U2=1;function e(j){return j?typeof j=="string"?j:j.source:null}function t(j){return s("(?=",j,")")}function s(...j){return j.map(P=>e(P)).join("")}function i(j){const H=j[j.length-1];return typeof H=="object"&&H.constructor===Object?(j.splice(j.length-1,1),H):{}}function a(...j){return"("+(i(j).capture?"":"?:")+j.map(F=>e(F)).join("|")+")"}const o=j=>s(/\b/,j,/\w$/.test(j)?/\b/:/\B/),u=["Protocol","Type"].map(o),h=["init","self"].map(o),m=["Any","Self"],f=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],p=["false","nil","true"],b=["assignment","associativity","higherThan","left","lowerThan","none","right"],x=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],_=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],y=a(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),S=a(y,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),C=s(y,S,"*"),E=a(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),T=a(E,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),N=s(E,T,"*"),M=s(/[A-Z]/,T,"*"),R=["attached","autoclosure",s(/convention\(/,a("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",s(/objc\(/,N,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],z=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function L(j){const H={match:/\s+/,relevance:0},P=j.COMMENT("/\\*","\\*/",{contains:["self"]}),F=[j.C_LINE_COMMENT_MODE,P],K={match:[/\./,a(...u,...h)],className:{2:"keyword"}},Y={match:s(/\./,a(...f)),relevance:0},Q=f.filter(at=>typeof at=="string").concat(["_|0"]),q=f.filter(at=>typeof at!="string").concat(m).map(o),O={variants:[{className:"keyword",match:a(...q,...h)}]},X={$pattern:a(/\b\w+/,/#\w+/),keyword:Q.concat(x),literal:p},Z=[K,Y,O],V={match:s(/\./,a(..._)),relevance:0},$={className:"built_in",match:s(/\b/,a(..._),/(?=\()/)},D=[V,$],W={match:/->/,relevance:0},he={className:"operator",relevance:0,variants:[{match:C},{match:`\\.(\\.|${S})+`}]},le=[W,he],me="([0-9]_*)+",ne="([0-9a-fA-F]_*)+",fe={className:"number",relevance:0,variants:[{match:`\\b(${me})(\\.(${me}))?([eE][+-]?(${me}))?\\b`},{match:`\\b0x(${ne})(\\.(${ne}))?([pP][+-]?(${me}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},we=(at="")=>({className:"subst",variants:[{match:s(/\\/,at,/[0\\tnr"']/)},{match:s(/\\/,at,/u\{[0-9a-fA-F]{1,8}\}/)}]}),ye=(at="")=>({className:"subst",match:s(/\\/,at,/[\t ]*(?:[\r\n]|\r\n)/)}),Ze=(at="")=>({className:"subst",label:"interpol",begin:s(/\\/,at,/\(/),end:/\)/}),lt=(at="")=>({begin:s(at,/"""/),end:s(/"""/,at),contains:[we(at),ye(at),Ze(at)]}),ct=(at="")=>({begin:s(at,/"/),end:s(/"/,at),contains:[we(at),Ze(at)]}),ze={className:"string",variants:[lt(),lt("#"),lt("##"),lt("###"),ct(),ct("#"),ct("##"),ct("###")]},Lt=[j.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[j.BACKSLASH_ESCAPE]}],Oi={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:Lt},Jn=at=>{const ei=s(at,/\//),gn=s(/\//,at);return{begin:ei,end:gn,contains:[...Lt,{scope:"comment",begin:`#(?!.*${gn})`,end:/$/}]}},xe={scope:"regexp",variants:[Jn("###"),Jn("##"),Jn("#"),Oi]},mt={match:s(/`/,N,/`/)},qs={className:"variable",match:/\$\d+/},ls={className:"variable",match:`\\$${T}+`},Gs=[mt,qs,ls],oa={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:z,contains:[...le,fe,ze]}]}},mr={scope:"keyword",match:s(/@/,a(...R),t(a(/\(/,/\s+/)))},Bt={scope:"meta",match:s(/@/,N)},Li=[oa,mr,Bt],ws={match:t(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:s(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,T,"+")},{className:"type",match:M,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:s(/\s+&\s+/,t(M)),relevance:0}]},Bi={begin:/</,end:/>/,keywords:X,contains:[...F,...Z,...Li,W,ws]};ws.contains.push(Bi);const zi={match:s(N,/\s*:/),keywords:"_|0",relevance:0},Qa={begin:/\(/,end:/\)/,relevance:0,keywords:X,contains:["self",zi,...F,xe,...Z,...D,...le,fe,ze,...Gs,...Li,ws]},pr={begin:/</,end:/>/,keywords:"repeat each",contains:[...F,ws]},fl={begin:a(t(s(N,/\s*:/)),t(s(N,/\s+/,N,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:N}]},Ja={begin:/\(/,end:/\)/,keywords:X,contains:[fl,...F,...Z,...le,fe,ze,...Li,ws,Qa],endsParent:!0,illegal:/["']/},Ii={match:[/(func|macro)/,/\s+/,a(mt.match,N,C)],className:{1:"keyword",3:"title.function"},contains:[pr,Ja,H],illegal:[/\[/,/%/]},gs={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[pr,Ja,H],illegal:/\[|%/},Mn={match:[/operator/,/\s+/,C],className:{1:"keyword",3:"title"}},ks={begin:[/precedencegroup/,/\s+/,M],className:{1:"keyword",3:"title"},contains:[ws],keywords:[...b,...p],end:/}/},ml={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},la={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},eo={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,N,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:X,contains:[pr,...Z,{begin:/:/,end:/\{/,keywords:X,contains:[{scope:"title.class.inherited",match:M},...Z],relevance:0}]};for(const at of ze.variants){const ei=at.contains.find(zs=>zs.label==="interpol");ei.keywords=X;const gn=[...Z,...D,...le,fe,ze,...Gs];ei.contains=[...gn,{begin:/\(/,end:/\)/,contains:["self",...gn]}]}return{name:"Swift",keywords:X,contains:[...F,Ii,gs,ml,la,eo,Mn,ks,{beginKeywords:"import",end:/$/,contains:[...F],relevance:0},xe,...Z,...D,...le,fe,ze,...Gs,...Li,ws,Qa]}}return Tg=L,Tg}var Ag,F2;function RU(){if(F2)return Ag;F2=1;function e(t){const s="true false yes no null",i="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},u={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},h={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,o]},m=t.inherit(h,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),_={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},y={end:",",endsWithParent:!0,excludeEnd:!0,keywords:s,relevance:0},S={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},C={begin:"\\[",end:"\\]",contains:[y],illegal:"\\n",relevance:0},E=[a,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+i},{className:"type",begin:"!<"+i+">"},{className:"type",begin:"!"+i},{className:"type",begin:"!!"+i},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:s,keywords:{literal:s}},_,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},S,C,u,h],T=[...E];return T.pop(),T.push(m),y.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}return Ag=e,Ag}var Mg,V2;function DU(){if(V2)return Mg;V2=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],s=["true","false","null","undefined","NaN","Infinity"],i=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],a=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],o=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],u=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],h=[].concat(o,i,a);function m(p){const b=p.regex,x=(we,{after:ye})=>{const Ze="</"+we[0].slice(1);return we.input.indexOf(Ze,ye)!==-1},_=e,y={begin:"<>",end:"</>"},S=/<[A-Za-z0-9\\._:-]+\s*\/>/,C={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(we,ye)=>{const Ze=we[0].length+we.index,lt=we.input[Ze];if(lt==="<"||lt===","){ye.ignoreMatch();return}lt===">"&&(x(we,{after:Ze})||ye.ignoreMatch());let ct;const ze=we.input.substring(Ze);if(ct=ze.match(/^\s*=/)){ye.ignoreMatch();return}if((ct=ze.match(/^\s+extends\s+/))&&ct.index===0){ye.ignoreMatch();return}}},E={$pattern:e,keyword:t,literal:s,built_in:h,"variable.language":u},T="[0-9](_?[0-9])*",N=`\\.(${T})`,M="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",R={className:"number",variants:[{begin:`(\\b(${M})((${N})|\\.)?|(${N}))[eE][+-]?(${T})\\b`},{begin:`\\b(${M})\\b((${N})\\b|\\.)?|(${N})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},z={className:"subst",begin:"\\$\\{",end:"\\}",keywords:E,contains:[]},L={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,z],subLanguage:"xml"}},j={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,z],subLanguage:"css"}},H={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,z],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[p.BACKSLASH_ESCAPE,z]},K={className:"comment",variants:[p.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:_+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),p.C_BLOCK_COMMENT_MODE,p.C_LINE_COMMENT_MODE]},Y=[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,L,j,H,P,{match:/\$\d+/},R];z.contains=Y.concat({begin:/\{/,end:/\}/,keywords:E,contains:["self"].concat(Y)});const Q=[].concat(K,z.contains),q=Q.concat([{begin:/(\s*)\(/,end:/\)/,keywords:E,contains:["self"].concat(Q)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:E,contains:q},X={variants:[{match:[/class/,/\s+/,_,/\s+/,/extends/,/\s+/,b.concat(_,"(",b.concat(/\./,_),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,_],scope:{1:"keyword",3:"title.class"}}]},Z={relevance:0,match:b.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...i,...a]}},V={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},$={variants:[{match:[/function/,/\s+/,_,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(we){return b.concat("(?!",we.join("|"),")")}const he={match:b.concat(/\b/,W([...o,"super","import"].map(we=>`${we}\\s*\\(`)),_,b.lookahead(/\s*\(/)),className:"title.function",relevance:0},le={begin:b.concat(/\./,b.lookahead(b.concat(_,/(?![0-9A-Za-z$_(])/))),end:_,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},me={match:[/get|set/,/\s+/,_,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},ne="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+p.UNDERSCORE_IDENT_RE+")\\s*=>",fe={match:[/const|var|let/,/\s+/,_,/\s*/,/=\s*/,/(async\s*)?/,b.lookahead(ne)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:E,exports:{PARAMS_CONTAINS:q,CLASS_REFERENCE:Z},illegal:/#(?![$_A-z])/,contains:[p.SHEBANG({label:"shebang",binary:"node",relevance:5}),V,p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,L,j,H,P,K,{match:/\$\d+/},R,Z,{scope:"attr",match:_+b.lookahead(":"),relevance:0},fe,{begin:"("+p.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[K,p.REGEXP_MODE,{className:"function",begin:ne,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:p.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:E,contains:q}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:y.begin,end:y.end},{match:S},{begin:C.begin,"on:begin":C.isTrulyOpeningTag,end:C.end}],subLanguage:"xml",contains:[{begin:C.begin,end:C.end,skip:!0,contains:["self"]}]}]},$,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+p.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,p.inherit(p.TITLE_MODE,{begin:_,className:"title.function"})]},{match:/\.\.\./,relevance:0},le,{match:"\\$"+_,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},he,D,X,me,{match:/\$[(.]/}]}}function f(p){const b=p.regex,x=m(p),_=e,y=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],S={begin:[/namespace/,/\s+/,p.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},C={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:y},contains:[x.exports.CLASS_REFERENCE]},E={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},T=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],N={$pattern:e,keyword:t.concat(T),literal:s,built_in:h.concat(y),"variable.language":u},M={className:"meta",begin:"@"+_},R=(H,P,F)=>{const K=H.contains.findIndex(Y=>Y.label===P);if(K===-1)throw new Error("can not find mode to replace");H.contains.splice(K,1,F)};Object.assign(x.keywords,N),x.exports.PARAMS_CONTAINS.push(M);const z=x.contains.find(H=>H.scope==="attr"),L=Object.assign({},z,{match:b.concat(_,b.lookahead(/\s*\?:/))});x.exports.PARAMS_CONTAINS.push([x.exports.CLASS_REFERENCE,z,L]),x.contains=x.contains.concat([M,S,C,L]),R(x,"shebang",p.SHEBANG()),R(x,"use_strict",E);const j=x.contains.find(H=>H.label==="func.def");return j.relevance=0,Object.assign(x,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),x}return Mg=f,Mg}var jg,q2;function OU(){if(q2)return jg;q2=1;function e(t){const s=t.regex,i={className:"string",begin:/"(""|[^/n])"C\b/},a={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,u=/\d{4}-\d{1,2}-\d{1,2}/,h=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,m=/\d{1,2}(:\d{1,2}){1,2}/,f={className:"literal",variants:[{begin:s.concat(/# */,s.either(u,o),/ *#/)},{begin:s.concat(/# */,m,/ *#/)},{begin:s.concat(/# */,h,/ *#/)},{begin:s.concat(/# */,s.either(u,o),/ +/,s.either(h,m),/ *#/)}]},p={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},b={className:"label",begin:/^\w+:/},x=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),_=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[i,a,f,p,b,x,_,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[_]}]}}return jg=e,jg}var Rg,G2;function LU(){if(G2)return Rg;G2=1;function e(t){t.regex;const s=t.COMMENT(/\(;/,/;\)/);s.contains.push("self");const i=t.COMMENT(/;;/,/$/),a=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},u={className:"variable",begin:/\$[\w_]+/},h={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},m={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},f={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},p={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:a},contains:[i,s,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},u,h,o,t.QUOTE_STRING_MODE,f,p,m]}}return Rg=e,Rg}var Dg,K2;function BU(){if(K2)return Dg;K2=1;var e=JH();return e.registerLanguage("xml",eU()),e.registerLanguage("bash",tU()),e.registerLanguage("c",sU()),e.registerLanguage("cpp",nU()),e.registerLanguage("csharp",iU()),e.registerLanguage("css",rU()),e.registerLanguage("markdown",aU()),e.registerLanguage("diff",oU()),e.registerLanguage("ruby",lU()),e.registerLanguage("go",cU()),e.registerLanguage("graphql",uU()),e.registerLanguage("ini",dU()),e.registerLanguage("java",hU()),e.registerLanguage("javascript",fU()),e.registerLanguage("json",mU()),e.registerLanguage("kotlin",pU()),e.registerLanguage("less",gU()),e.registerLanguage("lua",bU()),e.registerLanguage("makefile",vU()),e.registerLanguage("perl",xU()),e.registerLanguage("objectivec",_U()),e.registerLanguage("php",yU()),e.registerLanguage("php-template",SU()),e.registerLanguage("plaintext",wU()),e.registerLanguage("python",kU()),e.registerLanguage("python-repl",CU()),e.registerLanguage("r",EU()),e.registerLanguage("rust",NU()),e.registerLanguage("scss",TU()),e.registerLanguage("shell",AU()),e.registerLanguage("sql",MU()),e.registerLanguage("swift",jU()),e.registerLanguage("yaml",RU()),e.registerLanguage("typescript",DU()),e.registerLanguage("vbnet",OU()),e.registerLanguage("wasm",LU()),e.HighlightJS=e,e.default=e,Dg=e,Dg}var zU=BU();const Z0=aA(zU);function IU(e){return e.replace(/<\/?(script|style|iframe|object|embed)\b[^>]*>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/(href|src)\s*=\s*("|')\s*javascript:[^"']*\2/gi,"$1=$2#$2")}function PU({content:e}){const t=w.useMemo(()=>{const i=ft.parse(e,{async:!1,gfm:!0,breaks:!1});return IU(i)},[e]),s=w.useRef(null);return w.useEffect(()=>{const i=s.current;i&&i.querySelectorAll("pre code").forEach(a=>{Z0.highlightElement(a)})},[t]),l.jsx("div",{ref:s,className:"md-preview min-w-0 px-6 py-5",dangerouslySetInnerHTML:{__html:t}})}function c3(e){return typeof e>"u"||e===null}function $U(e){return typeof e=="object"&&e!==null}function HU(e){return Array.isArray(e)?e:c3(e)?[]:[e]}function UU(e,t){var s,i,a,o;if(t)for(o=Object.keys(t),s=0,i=o.length;s<i;s+=1)a=o[s],e[a]=t[a];return e}function FU(e,t){var s="",i;for(i=0;i<t;i+=1)s+=e;return s}function VU(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var qU=c3,GU=$U,KU=HU,WU=FU,YU=VU,XU=UU,ms={isNothing:qU,isObject:GU,toArray:KU,repeat:WU,isNegativeZero:YU,extend:XU};function u3(e,t){var s="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(s+='in "'+e.mark.name+'" '),s+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(s+=`
|
|
162
|
-
|
|
163
|
-
`+e.mark.snippet),i+" "+s):i}function Yc(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=u3(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Yc.prototype=Object.create(Error.prototype);Yc.prototype.constructor=Yc;Yc.prototype.toString=function(t){return this.name+": "+u3(this,t)};var Xs=Yc;function Og(e,t,s,i,a){var o="",u="",h=Math.floor(a/2)-1;return i-t>h&&(o=" ... ",t=i-h+o.length),s-i>h&&(u=" ...",s=i+h-u.length),{str:o+e.slice(t,s).replace(/\t/g,"→")+u,pos:i-t+o.length}}function Lg(e,t){return ms.repeat(" ",t-e.length)+e}function ZU(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var s=/\r?\n|\r|\0/g,i=[0],a=[],o,u=-1;o=s.exec(e.buffer);)a.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&u<0&&(u=i.length-2);u<0&&(u=i.length-1);var h="",m,f,p=Math.min(e.line+t.linesAfter,a.length).toString().length,b=t.maxLength-(t.indent+p+3);for(m=1;m<=t.linesBefore&&!(u-m<0);m++)f=Og(e.buffer,i[u-m],a[u-m],e.position-(i[u]-i[u-m]),b),h=ms.repeat(" ",t.indent)+Lg((e.line-m+1).toString(),p)+" | "+f.str+`
|
|
164
|
-
`+h;for(f=Og(e.buffer,i[u],a[u],e.position,b),h+=ms.repeat(" ",t.indent)+Lg((e.line+1).toString(),p)+" | "+f.str+`
|
|
165
|
-
`,h+=ms.repeat("-",t.indent+p+3+f.pos)+`^
|
|
166
|
-
`,m=1;m<=t.linesAfter&&!(u+m>=a.length);m++)f=Og(e.buffer,i[u+m],a[u+m],e.position-(i[u]-i[u+m]),b),h+=ms.repeat(" ",t.indent)+Lg((e.line+m+1).toString(),p)+" | "+f.str+`
|
|
167
|
-
`;return h.replace(/\n$/,"")}var QU=ZU,JU=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],eF=["scalar","sequence","mapping"];function tF(e){var t={};return e!==null&&Object.keys(e).forEach(function(s){e[s].forEach(function(i){t[String(i)]=s})}),t}function sF(e,t){if(t=t||{},Object.keys(t).forEach(function(s){if(JU.indexOf(s)===-1)throw new Xs('Unknown option "'+s+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(s){return s},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=tF(t.styleAliases||null),eF.indexOf(this.kind)===-1)throw new Xs('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Ds=sF;function W2(e,t){var s=[];return e[t].forEach(function(i){var a=s.length;s.forEach(function(o,u){o.tag===i.tag&&o.kind===i.kind&&o.multi===i.multi&&(a=u)}),s[a]=i}),s}function nF(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,s;function i(a){a.multi?(e.multi[a.kind].push(a),e.multi.fallback.push(a)):e[a.kind][a.tag]=e.fallback[a.tag]=a}for(t=0,s=arguments.length;t<s;t+=1)arguments[t].forEach(i);return e}function Q0(e){return this.extend(e)}Q0.prototype.extend=function(t){var s=[],i=[];if(t instanceof Ds)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(s=s.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new Xs("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");s.forEach(function(o){if(!(o instanceof Ds))throw new Xs("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Xs("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new Xs("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(o){if(!(o instanceof Ds))throw new Xs("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var a=Object.create(Q0.prototype);return a.implicit=(this.implicit||[]).concat(s),a.explicit=(this.explicit||[]).concat(i),a.compiledImplicit=W2(a,"implicit"),a.compiledExplicit=W2(a,"explicit"),a.compiledTypeMap=nF(a.compiledImplicit,a.compiledExplicit),a};var d3=Q0,h3=new Ds("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),f3=new Ds("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),m3=new Ds("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),p3=new d3({explicit:[h3,f3,m3]});function iF(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function rF(){return null}function aF(e){return e===null}var g3=new Ds("tag:yaml.org,2002:null",{kind:"scalar",resolve:iF,construct:rF,predicate:aF,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function oF(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function lF(e){return e==="true"||e==="True"||e==="TRUE"}function cF(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var b3=new Ds("tag:yaml.org,2002:bool",{kind:"scalar",resolve:oF,construct:lF,predicate:cF,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function uF(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function dF(e){return 48<=e&&e<=55}function hF(e){return 48<=e&&e<=57}function fF(e){if(e===null)return!1;var t=e.length,s=0,i=!1,a;if(!t)return!1;if(a=e[s],(a==="-"||a==="+")&&(a=e[++s]),a==="0"){if(s+1===t)return!0;if(a=e[++s],a==="b"){for(s++;s<t;s++)if(a=e[s],a!=="_"){if(a!=="0"&&a!=="1")return!1;i=!0}return i&&a!=="_"}if(a==="x"){for(s++;s<t;s++)if(a=e[s],a!=="_"){if(!uF(e.charCodeAt(s)))return!1;i=!0}return i&&a!=="_"}if(a==="o"){for(s++;s<t;s++)if(a=e[s],a!=="_"){if(!dF(e.charCodeAt(s)))return!1;i=!0}return i&&a!=="_"}}if(a==="_")return!1;for(;s<t;s++)if(a=e[s],a!=="_"){if(!hF(e.charCodeAt(s)))return!1;i=!0}return!(!i||a==="_")}function mF(e){var t=e,s=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(s=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return s*parseInt(t.slice(2),2);if(t[1]==="x")return s*parseInt(t.slice(2),16);if(t[1]==="o")return s*parseInt(t.slice(2),8)}return s*parseInt(t,10)}function pF(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ms.isNegativeZero(e)}var v3=new Ds("tag:yaml.org,2002:int",{kind:"scalar",resolve:fF,construct:mF,predicate:pF,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),gF=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function bF(e){return!(e===null||!gF.test(e)||e[e.length-1]==="_")}function vF(e){var t,s;return t=e.replace(/_/g,"").toLowerCase(),s=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?s===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:s*parseFloat(t,10)}var xF=/^[-+]?[0-9]+e/;function _F(e,t){var s;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ms.isNegativeZero(e))return"-0.0";return s=e.toString(10),xF.test(s)?s.replace("e",".e"):s}function yF(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ms.isNegativeZero(e))}var x3=new Ds("tag:yaml.org,2002:float",{kind:"scalar",resolve:bF,construct:vF,predicate:yF,represent:_F,defaultStyle:"lowercase"}),_3=p3.extend({implicit:[g3,b3,v3,x3]}),y3=_3,S3=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),w3=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function SF(e){return e===null?!1:S3.exec(e)!==null||w3.exec(e)!==null}function wF(e){var t,s,i,a,o,u,h,m=0,f=null,p,b,x;if(t=S3.exec(e),t===null&&(t=w3.exec(e)),t===null)throw new Error("Date resolve error");if(s=+t[1],i=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(s,i,a));if(o=+t[4],u=+t[5],h=+t[6],t[7]){for(m=t[7].slice(0,3);m.length<3;)m+="0";m=+m}return t[9]&&(p=+t[10],b=+(t[11]||0),f=(p*60+b)*6e4,t[9]==="-"&&(f=-f)),x=new Date(Date.UTC(s,i,a,o,u,h,m)),f&&x.setTime(x.getTime()-f),x}function kF(e){return e.toISOString()}var k3=new Ds("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:SF,construct:wF,instanceOf:Date,represent:kF});function CF(e){return e==="<<"||e===null}var C3=new Ds("tag:yaml.org,2002:merge",{kind:"scalar",resolve:CF}),hv=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
168
|
-
\r`;function EF(e){if(e===null)return!1;var t,s,i=0,a=e.length,o=hv;for(s=0;s<a;s++)if(t=o.indexOf(e.charAt(s)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function NF(e){var t,s,i=e.replace(/[\r\n=]/g,""),a=i.length,o=hv,u=0,h=[];for(t=0;t<a;t++)t%4===0&&t&&(h.push(u>>16&255),h.push(u>>8&255),h.push(u&255)),u=u<<6|o.indexOf(i.charAt(t));return s=a%4*6,s===0?(h.push(u>>16&255),h.push(u>>8&255),h.push(u&255)):s===18?(h.push(u>>10&255),h.push(u>>2&255)):s===12&&h.push(u>>4&255),new Uint8Array(h)}function TF(e){var t="",s=0,i,a,o=e.length,u=hv;for(i=0;i<o;i++)i%3===0&&i&&(t+=u[s>>18&63],t+=u[s>>12&63],t+=u[s>>6&63],t+=u[s&63]),s=(s<<8)+e[i];return a=o%3,a===0?(t+=u[s>>18&63],t+=u[s>>12&63],t+=u[s>>6&63],t+=u[s&63]):a===2?(t+=u[s>>10&63],t+=u[s>>4&63],t+=u[s<<2&63],t+=u[64]):a===1&&(t+=u[s>>2&63],t+=u[s<<4&63],t+=u[64],t+=u[64]),t}function AF(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var E3=new Ds("tag:yaml.org,2002:binary",{kind:"scalar",resolve:EF,construct:NF,predicate:AF,represent:TF}),MF=Object.prototype.hasOwnProperty,jF=Object.prototype.toString;function RF(e){if(e===null)return!0;var t=[],s,i,a,o,u,h=e;for(s=0,i=h.length;s<i;s+=1){if(a=h[s],u=!1,jF.call(a)!=="[object Object]")return!1;for(o in a)if(MF.call(a,o))if(!u)u=!0;else return!1;if(!u)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function DF(e){return e!==null?e:[]}var N3=new Ds("tag:yaml.org,2002:omap",{kind:"sequence",resolve:RF,construct:DF}),OF=Object.prototype.toString;function LF(e){if(e===null)return!0;var t,s,i,a,o,u=e;for(o=new Array(u.length),t=0,s=u.length;t<s;t+=1){if(i=u[t],OF.call(i)!=="[object Object]"||(a=Object.keys(i),a.length!==1))return!1;o[t]=[a[0],i[a[0]]]}return!0}function BF(e){if(e===null)return[];var t,s,i,a,o,u=e;for(o=new Array(u.length),t=0,s=u.length;t<s;t+=1)i=u[t],a=Object.keys(i),o[t]=[a[0],i[a[0]]];return o}var T3=new Ds("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:LF,construct:BF}),zF=Object.prototype.hasOwnProperty;function IF(e){if(e===null)return!0;var t,s=e;for(t in s)if(zF.call(s,t)&&s[t]!==null)return!1;return!0}function PF(e){return e!==null?e:{}}var A3=new Ds("tag:yaml.org,2002:set",{kind:"mapping",resolve:IF,construct:PF}),fv=y3.extend({implicit:[k3,C3],explicit:[E3,N3,T3,A3]}),na=Object.prototype.hasOwnProperty,zh=1,M3=2,j3=3,Ih=4,Bg=1,$F=2,Y2=3,HF=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,UF=/[\x85\u2028\u2029]/,FF=/[,\[\]\{\}]/,R3=/^(?:!|!!|![a-z\-]+!)$/i,D3=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function X2(e){return Object.prototype.toString.call(e)}function Ei(e){return e===10||e===13}function Fa(e){return e===9||e===32}function fn(e){return e===9||e===32||e===10||e===13}function Xo(e){return e===44||e===91||e===93||e===123||e===125}function VF(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function qF(e){return e===120?2:e===117?4:e===85?8:0}function GF(e){return 48<=e&&e<=57?e-48:-1}function Z2(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
169
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function KF(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function O3(e,t,s){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:s}):e[t]=s}var L3=new Array(256),B3=new Array(256);for(var Uo=0;Uo<256;Uo++)L3[Uo]=Z2(Uo)?1:0,B3[Uo]=Z2(Uo);function WF(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||fv,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function z3(e,t){var s={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return s.snippet=QU(s),new Xs(t,s)}function De(e,t){throw z3(e,t)}function Ph(e,t){e.onWarning&&e.onWarning.call(null,z3(e,t))}var Q2={YAML:function(t,s,i){var a,o,u;t.version!==null&&De(t,"duplication of %YAML directive"),i.length!==1&&De(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),a===null&&De(t,"ill-formed argument of the YAML directive"),o=parseInt(a[1],10),u=parseInt(a[2],10),o!==1&&De(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=u<2,u!==1&&u!==2&&Ph(t,"unsupported YAML version of the document")},TAG:function(t,s,i){var a,o;i.length!==2&&De(t,"TAG directive accepts exactly two arguments"),a=i[0],o=i[1],R3.test(a)||De(t,"ill-formed tag handle (first argument) of the TAG directive"),na.call(t.tagMap,a)&&De(t,'there is a previously declared suffix for "'+a+'" tag handle'),D3.test(o)||De(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{De(t,"tag prefix is malformed: "+o)}t.tagMap[a]=o}};function ea(e,t,s,i){var a,o,u,h;if(t<s){if(h=e.input.slice(t,s),i)for(a=0,o=h.length;a<o;a+=1)u=h.charCodeAt(a),u===9||32<=u&&u<=1114111||De(e,"expected valid JSON character");else HF.test(h)&&De(e,"the stream contains non-printable characters");e.result+=h}}function J2(e,t,s,i){var a,o,u,h;for(ms.isObject(s)||De(e,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(s),u=0,h=a.length;u<h;u+=1)o=a[u],na.call(t,o)||(O3(t,o,s[o]),i[o]=!0)}function Zo(e,t,s,i,a,o,u,h,m){var f,p;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),f=0,p=a.length;f<p;f+=1)Array.isArray(a[f])&&De(e,"nested arrays are not supported inside keys"),typeof a=="object"&&X2(a[f])==="[object Object]"&&(a[f]="[object Object]");if(typeof a=="object"&&X2(a)==="[object Object]"&&(a="[object Object]"),a=String(a),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(f=0,p=o.length;f<p;f+=1)J2(e,t,o[f],s);else J2(e,t,o,s);else!e.json&&!na.call(s,a)&&na.call(t,a)&&(e.line=u||e.line,e.lineStart=h||e.lineStart,e.position=m||e.position,De(e,"duplicated mapping key")),O3(t,a,o),delete s[a];return t}function mv(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):De(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function os(e,t,s){for(var i=0,a=e.input.charCodeAt(e.position);a!==0;){for(;Fa(a);)a===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),a=e.input.charCodeAt(++e.position);if(t&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(Ei(a))for(mv(e),a=e.input.charCodeAt(e.position),i++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return s!==-1&&i!==0&&e.lineIndent<s&&Ph(e,"deficient indentation"),i}function nf(e){var t=e.position,s;return s=e.input.charCodeAt(t),!!((s===45||s===46)&&s===e.input.charCodeAt(t+1)&&s===e.input.charCodeAt(t+2)&&(t+=3,s=e.input.charCodeAt(t),s===0||fn(s)))}function pv(e,t){t===1?e.result+=" ":t>1&&(e.result+=ms.repeat(`
|
|
170
|
-
`,t-1))}function YF(e,t,s){var i,a,o,u,h,m,f,p,b=e.kind,x=e.result,_;if(_=e.input.charCodeAt(e.position),fn(_)||Xo(_)||_===35||_===38||_===42||_===33||_===124||_===62||_===39||_===34||_===37||_===64||_===96||(_===63||_===45)&&(a=e.input.charCodeAt(e.position+1),fn(a)||s&&Xo(a)))return!1;for(e.kind="scalar",e.result="",o=u=e.position,h=!1;_!==0;){if(_===58){if(a=e.input.charCodeAt(e.position+1),fn(a)||s&&Xo(a))break}else if(_===35){if(i=e.input.charCodeAt(e.position-1),fn(i))break}else{if(e.position===e.lineStart&&nf(e)||s&&Xo(_))break;if(Ei(_))if(m=e.line,f=e.lineStart,p=e.lineIndent,os(e,!1,-1),e.lineIndent>=t){h=!0,_=e.input.charCodeAt(e.position);continue}else{e.position=u,e.line=m,e.lineStart=f,e.lineIndent=p;break}}h&&(ea(e,o,u,!1),pv(e,e.line-m),o=u=e.position,h=!1),Fa(_)||(u=e.position+1),_=e.input.charCodeAt(++e.position)}return ea(e,o,u,!1),e.result?!0:(e.kind=b,e.result=x,!1)}function XF(e,t){var s,i,a;if(s=e.input.charCodeAt(e.position),s!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=a=e.position;(s=e.input.charCodeAt(e.position))!==0;)if(s===39)if(ea(e,i,e.position,!0),s=e.input.charCodeAt(++e.position),s===39)i=e.position,e.position++,a=e.position;else return!0;else Ei(s)?(ea(e,i,a,!0),pv(e,os(e,!1,t)),i=a=e.position):e.position===e.lineStart&&nf(e)?De(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);De(e,"unexpected end of the stream within a single quoted scalar")}function ZF(e,t){var s,i,a,o,u,h;if(h=e.input.charCodeAt(e.position),h!==34)return!1;for(e.kind="scalar",e.result="",e.position++,s=i=e.position;(h=e.input.charCodeAt(e.position))!==0;){if(h===34)return ea(e,s,e.position,!0),e.position++,!0;if(h===92){if(ea(e,s,e.position,!0),h=e.input.charCodeAt(++e.position),Ei(h))os(e,!1,t);else if(h<256&&L3[h])e.result+=B3[h],e.position++;else if((u=qF(h))>0){for(a=u,o=0;a>0;a--)h=e.input.charCodeAt(++e.position),(u=VF(h))>=0?o=(o<<4)+u:De(e,"expected hexadecimal character");e.result+=KF(o),e.position++}else De(e,"unknown escape sequence");s=i=e.position}else Ei(h)?(ea(e,s,i,!0),pv(e,os(e,!1,t)),s=i=e.position):e.position===e.lineStart&&nf(e)?De(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}De(e,"unexpected end of the stream within a double quoted scalar")}function QF(e,t){var s=!0,i,a,o,u=e.tag,h,m=e.anchor,f,p,b,x,_,y=Object.create(null),S,C,E,T;if(T=e.input.charCodeAt(e.position),T===91)p=93,_=!1,h=[];else if(T===123)p=125,_=!0,h={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),T=e.input.charCodeAt(++e.position);T!==0;){if(os(e,!0,t),T=e.input.charCodeAt(e.position),T===p)return e.position++,e.tag=u,e.anchor=m,e.kind=_?"mapping":"sequence",e.result=h,!0;s?T===44&&De(e,"expected the node content, but found ','"):De(e,"missed comma between flow collection entries"),C=S=E=null,b=x=!1,T===63&&(f=e.input.charCodeAt(e.position+1),fn(f)&&(b=x=!0,e.position++,os(e,!0,t))),i=e.line,a=e.lineStart,o=e.position,nl(e,t,zh,!1,!0),C=e.tag,S=e.result,os(e,!0,t),T=e.input.charCodeAt(e.position),(x||e.line===i)&&T===58&&(b=!0,T=e.input.charCodeAt(++e.position),os(e,!0,t),nl(e,t,zh,!1,!0),E=e.result),_?Zo(e,h,y,C,S,E,i,a,o):b?h.push(Zo(e,null,y,C,S,E,i,a,o)):h.push(S),os(e,!0,t),T=e.input.charCodeAt(e.position),T===44?(s=!0,T=e.input.charCodeAt(++e.position)):s=!1}De(e,"unexpected end of the stream within a flow collection")}function JF(e,t){var s,i,a=Bg,o=!1,u=!1,h=t,m=0,f=!1,p,b;if(b=e.input.charCodeAt(e.position),b===124)i=!1;else if(b===62)i=!0;else return!1;for(e.kind="scalar",e.result="";b!==0;)if(b=e.input.charCodeAt(++e.position),b===43||b===45)Bg===a?a=b===43?Y2:$F:De(e,"repeat of a chomping mode identifier");else if((p=GF(b))>=0)p===0?De(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?De(e,"repeat of an indentation width identifier"):(h=t+p-1,u=!0);else break;if(Fa(b)){do b=e.input.charCodeAt(++e.position);while(Fa(b));if(b===35)do b=e.input.charCodeAt(++e.position);while(!Ei(b)&&b!==0)}for(;b!==0;){for(mv(e),e.lineIndent=0,b=e.input.charCodeAt(e.position);(!u||e.lineIndent<h)&&b===32;)e.lineIndent++,b=e.input.charCodeAt(++e.position);if(!u&&e.lineIndent>h&&(h=e.lineIndent),Ei(b)){m++;continue}if(e.lineIndent<h){a===Y2?e.result+=ms.repeat(`
|
|
171
|
-
`,o?1+m:m):a===Bg&&o&&(e.result+=`
|
|
172
|
-
`);break}for(i?Fa(b)?(f=!0,e.result+=ms.repeat(`
|
|
173
|
-
`,o?1+m:m)):f?(f=!1,e.result+=ms.repeat(`
|
|
174
|
-
`,m+1)):m===0?o&&(e.result+=" "):e.result+=ms.repeat(`
|
|
175
|
-
`,m):e.result+=ms.repeat(`
|
|
176
|
-
`,o?1+m:m),o=!0,u=!0,m=0,s=e.position;!Ei(b)&&b!==0;)b=e.input.charCodeAt(++e.position);ea(e,s,e.position,!1)}return!0}function ek(e,t){var s,i=e.tag,a=e.anchor,o=[],u,h=!1,m;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),m=e.input.charCodeAt(e.position);m!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,De(e,"tab characters must not be used in indentation")),!(m!==45||(u=e.input.charCodeAt(e.position+1),!fn(u))));){if(h=!0,e.position++,os(e,!0,-1)&&e.lineIndent<=t){o.push(null),m=e.input.charCodeAt(e.position);continue}if(s=e.line,nl(e,t,j3,!1,!0),o.push(e.result),os(e,!0,-1),m=e.input.charCodeAt(e.position),(e.line===s||e.lineIndent>t)&&m!==0)De(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return h?(e.tag=i,e.anchor=a,e.kind="sequence",e.result=o,!0):!1}function eV(e,t,s){var i,a,o,u,h,m,f=e.tag,p=e.anchor,b={},x=Object.create(null),_=null,y=null,S=null,C=!1,E=!1,T;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=b),T=e.input.charCodeAt(e.position);T!==0;){if(!C&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,De(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),o=e.line,(T===63||T===58)&&fn(i))T===63?(C&&(Zo(e,b,x,_,y,null,u,h,m),_=y=S=null),E=!0,C=!0,a=!0):C?(C=!1,a=!0):De(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,T=i;else{if(u=e.line,h=e.lineStart,m=e.position,!nl(e,s,M3,!1,!0))break;if(e.line===o){for(T=e.input.charCodeAt(e.position);Fa(T);)T=e.input.charCodeAt(++e.position);if(T===58)T=e.input.charCodeAt(++e.position),fn(T)||De(e,"a whitespace character is expected after the key-value separator within a block mapping"),C&&(Zo(e,b,x,_,y,null,u,h,m),_=y=S=null),E=!0,C=!1,a=!1,_=e.tag,y=e.result;else if(E)De(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=p,!0}else if(E)De(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=p,!0}if((e.line===o||e.lineIndent>t)&&(C&&(u=e.line,h=e.lineStart,m=e.position),nl(e,t,Ih,!0,a)&&(C?y=e.result:S=e.result),C||(Zo(e,b,x,_,y,S,u,h,m),_=y=S=null),os(e,!0,-1),T=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&T!==0)De(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return C&&Zo(e,b,x,_,y,null,u,h,m),E&&(e.tag=f,e.anchor=p,e.kind="mapping",e.result=b),E}function tV(e){var t,s=!1,i=!1,a,o,u;if(u=e.input.charCodeAt(e.position),u!==33)return!1;if(e.tag!==null&&De(e,"duplication of a tag property"),u=e.input.charCodeAt(++e.position),u===60?(s=!0,u=e.input.charCodeAt(++e.position)):u===33?(i=!0,a="!!",u=e.input.charCodeAt(++e.position)):a="!",t=e.position,s){do u=e.input.charCodeAt(++e.position);while(u!==0&&u!==62);e.position<e.length?(o=e.input.slice(t,e.position),u=e.input.charCodeAt(++e.position)):De(e,"unexpected end of the stream within a verbatim tag")}else{for(;u!==0&&!fn(u);)u===33&&(i?De(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(t-1,e.position+1),R3.test(a)||De(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),u=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),FF.test(o)&&De(e,"tag suffix cannot contain flow indicator characters")}o&&!D3.test(o)&&De(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{De(e,"tag name is malformed: "+o)}return s?e.tag=o:na.call(e.tagMap,a)?e.tag=e.tagMap[a]+o:a==="!"?e.tag="!"+o:a==="!!"?e.tag="tag:yaml.org,2002:"+o:De(e,'undeclared tag handle "'+a+'"'),!0}function sV(e){var t,s;if(s=e.input.charCodeAt(e.position),s!==38)return!1;for(e.anchor!==null&&De(e,"duplication of an anchor property"),s=e.input.charCodeAt(++e.position),t=e.position;s!==0&&!fn(s)&&!Xo(s);)s=e.input.charCodeAt(++e.position);return e.position===t&&De(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function nV(e){var t,s,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!fn(i)&&!Xo(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&De(e,"name of an alias node must contain at least one character"),s=e.input.slice(t,e.position),na.call(e.anchorMap,s)||De(e,'unidentified alias "'+s+'"'),e.result=e.anchorMap[s],os(e,!0,-1),!0}function nl(e,t,s,i,a){var o,u,h,m=1,f=!1,p=!1,b,x,_,y,S,C;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=u=h=Ih===s||j3===s,i&&os(e,!0,-1)&&(f=!0,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)),m===1)for(;tV(e)||sV(e);)os(e,!0,-1)?(f=!0,h=o,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)):h=!1;if(h&&(h=f||a),(m===1||Ih===s)&&(zh===s||M3===s?S=t:S=t+1,C=e.position-e.lineStart,m===1?h&&(ek(e,C)||eV(e,C,S))||QF(e,S)?p=!0:(u&&JF(e,S)||XF(e,S)||ZF(e,S)?p=!0:nV(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&De(e,"alias node should not have any properties")):YF(e,S,zh===s)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):m===0&&(p=h&&ek(e,C))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&De(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),b=0,x=e.implicitTypes.length;b<x;b+=1)if(y=e.implicitTypes[b],y.resolve(e.result)){e.result=y.construct(e.result),e.tag=y.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(na.call(e.typeMap[e.kind||"fallback"],e.tag))y=e.typeMap[e.kind||"fallback"][e.tag];else for(y=null,_=e.typeMap.multi[e.kind||"fallback"],b=0,x=_.length;b<x;b+=1)if(e.tag.slice(0,_[b].tag.length)===_[b].tag){y=_[b];break}y||De(e,"unknown tag !<"+e.tag+">"),e.result!==null&&y.kind!==e.kind&&De(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+y.kind+'", not "'+e.kind+'"'),y.resolve(e.result,e.tag)?(e.result=y.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):De(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function iV(e){var t=e.position,s,i,a,o=!1,u;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(u=e.input.charCodeAt(e.position))!==0&&(os(e,!0,-1),u=e.input.charCodeAt(e.position),!(e.lineIndent>0||u!==37));){for(o=!0,u=e.input.charCodeAt(++e.position),s=e.position;u!==0&&!fn(u);)u=e.input.charCodeAt(++e.position);for(i=e.input.slice(s,e.position),a=[],i.length<1&&De(e,"directive name must not be less than one character in length");u!==0;){for(;Fa(u);)u=e.input.charCodeAt(++e.position);if(u===35){do u=e.input.charCodeAt(++e.position);while(u!==0&&!Ei(u));break}if(Ei(u))break;for(s=e.position;u!==0&&!fn(u);)u=e.input.charCodeAt(++e.position);a.push(e.input.slice(s,e.position))}u!==0&&mv(e),na.call(Q2,i)?Q2[i](e,i,a):Ph(e,'unknown document directive "'+i+'"')}if(os(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,os(e,!0,-1)):o&&De(e,"directives end mark is expected"),nl(e,e.lineIndent-1,Ih,!1,!0),os(e,!0,-1),e.checkLineBreaks&&UF.test(e.input.slice(t,e.position))&&Ph(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&nf(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,os(e,!0,-1));return}if(e.position<e.length-1)De(e,"end of the stream or a document separator is expected");else return}function I3(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
177
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var s=new WF(e,t),i=e.indexOf("\0");for(i!==-1&&(s.position=i,De(s,"null byte is not allowed in input")),s.input+="\0";s.input.charCodeAt(s.position)===32;)s.lineIndent+=1,s.position+=1;for(;s.position<s.length-1;)iV(s);return s.documents}function rV(e,t,s){t!==null&&typeof t=="object"&&typeof s>"u"&&(s=t,t=null);var i=I3(e,s);if(typeof t!="function")return i;for(var a=0,o=i.length;a<o;a+=1)t(i[a])}function aV(e,t){var s=I3(e,t);if(s.length!==0){if(s.length===1)return s[0];throw new Xs("expected a single document in the stream, but found more")}}var oV=rV,lV=aV,P3={loadAll:oV,load:lV},$3=Object.prototype.toString,H3=Object.prototype.hasOwnProperty,gv=65279,cV=9,Xc=10,uV=13,dV=32,hV=33,fV=34,J0=35,mV=37,pV=38,gV=39,bV=42,U3=44,vV=45,$h=58,xV=61,_V=62,yV=63,SV=64,F3=91,V3=93,wV=96,q3=123,kV=124,G3=125,Vs={};Vs[0]="\\0";Vs[7]="\\a";Vs[8]="\\b";Vs[9]="\\t";Vs[10]="\\n";Vs[11]="\\v";Vs[12]="\\f";Vs[13]="\\r";Vs[27]="\\e";Vs[34]='\\"';Vs[92]="\\\\";Vs[133]="\\N";Vs[160]="\\_";Vs[8232]="\\L";Vs[8233]="\\P";var CV=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],EV=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function NV(e,t){var s,i,a,o,u,h,m;if(t===null)return{};for(s={},i=Object.keys(t),a=0,o=i.length;a<o;a+=1)u=i[a],h=String(t[u]),u.slice(0,2)==="!!"&&(u="tag:yaml.org,2002:"+u.slice(2)),m=e.compiledTypeMap.fallback[u],m&&H3.call(m.styleAliases,h)&&(h=m.styleAliases[h]),s[u]=h;return s}function TV(e){var t,s,i;if(t=e.toString(16).toUpperCase(),e<=255)s="x",i=2;else if(e<=65535)s="u",i=4;else if(e<=4294967295)s="U",i=8;else throw new Xs("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+s+ms.repeat("0",i-t.length)+t}var AV=1,Zc=2;function MV(e){this.schema=e.schema||fv,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ms.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=NV(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Zc:AV,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function tk(e,t){for(var s=ms.repeat(" ",t),i=0,a=-1,o="",u,h=e.length;i<h;)a=e.indexOf(`
|
|
178
|
-
`,i),a===-1?(u=e.slice(i),i=h):(u=e.slice(i,a+1),i=a+1),u.length&&u!==`
|
|
179
|
-
`&&(o+=s),o+=u;return o}function eb(e,t){return`
|
|
180
|
-
`+ms.repeat(" ",e.indent*t)}function jV(e,t){var s,i,a;for(s=0,i=e.implicitTypes.length;s<i;s+=1)if(a=e.implicitTypes[s],a.resolve(t))return!0;return!1}function Hh(e){return e===dV||e===cV}function Qc(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==gv||65536<=e&&e<=1114111}function sk(e){return Qc(e)&&e!==gv&&e!==uV&&e!==Xc}function nk(e,t,s){var i=sk(e),a=i&&!Hh(e);return(s?i:i&&e!==U3&&e!==F3&&e!==V3&&e!==q3&&e!==G3)&&e!==J0&&!(t===$h&&!a)||sk(t)&&!Hh(t)&&e===J0||t===$h&&a}function RV(e){return Qc(e)&&e!==gv&&!Hh(e)&&e!==vV&&e!==yV&&e!==$h&&e!==U3&&e!==F3&&e!==V3&&e!==q3&&e!==G3&&e!==J0&&e!==pV&&e!==bV&&e!==hV&&e!==kV&&e!==xV&&e!==_V&&e!==gV&&e!==fV&&e!==mV&&e!==SV&&e!==wV}function DV(e){return!Hh(e)&&e!==$h}function jc(e,t){var s=e.charCodeAt(t),i;return s>=55296&&s<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(s-55296)*1024+i-56320+65536:s}function K3(e){var t=/^\n* /;return t.test(e)}var W3=1,tb=2,Y3=3,X3=4,qo=5;function OV(e,t,s,i,a,o,u,h){var m,f=0,p=null,b=!1,x=!1,_=i!==-1,y=-1,S=RV(jc(e,0))&&DV(jc(e,e.length-1));if(t||u)for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=jc(e,m),!Qc(f))return qo;S=S&&nk(f,p,h),p=f}else{for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=jc(e,m),f===Xc)b=!0,_&&(x=x||m-y-1>i&&e[y+1]!==" ",y=m);else if(!Qc(f))return qo;S=S&&nk(f,p,h),p=f}x=x||_&&m-y-1>i&&e[y+1]!==" "}return!b&&!x?S&&!u&&!a(e)?W3:o===Zc?qo:tb:s>9&&K3(e)?qo:u?o===Zc?qo:tb:x?X3:Y3}function LV(e,t,s,i,a){e.dump=(function(){if(t.length===0)return e.quotingType===Zc?'""':"''";if(!e.noCompatMode&&(CV.indexOf(t)!==-1||EV.test(t)))return e.quotingType===Zc?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,s),u=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),h=i||e.flowLevel>-1&&s>=e.flowLevel;function m(f){return jV(e,f)}switch(OV(t,h,e.indent,u,m,e.quotingType,e.forceQuotes&&!i,a)){case W3:return t;case tb:return"'"+t.replace(/'/g,"''")+"'";case Y3:return"|"+ik(t,e.indent)+rk(tk(t,o));case X3:return">"+ik(t,e.indent)+rk(tk(BV(t,u),o));case qo:return'"'+zV(t)+'"';default:throw new Xs("impossible error: invalid scalar style")}})()}function ik(e,t){var s=K3(e)?String(t):"",i=e[e.length-1]===`
|
|
181
|
-
`,a=i&&(e[e.length-2]===`
|
|
182
|
-
`||e===`
|
|
183
|
-
`),o=a?"+":i?"":"-";return s+o+`
|
|
184
|
-
`}function rk(e){return e[e.length-1]===`
|
|
185
|
-
`?e.slice(0,-1):e}function BV(e,t){for(var s=/(\n+)([^\n]*)/g,i=(function(){var f=e.indexOf(`
|
|
186
|
-
`);return f=f!==-1?f:e.length,s.lastIndex=f,ak(e.slice(0,f),t)})(),a=e[0]===`
|
|
187
|
-
`||e[0]===" ",o,u;u=s.exec(e);){var h=u[1],m=u[2];o=m[0]===" ",i+=h+(!a&&!o&&m!==""?`
|
|
188
|
-
`:"")+ak(m,t),a=o}return i}function ak(e,t){if(e===""||e[0]===" ")return e;for(var s=/ [^ ]/g,i,a=0,o,u=0,h=0,m="";i=s.exec(e);)h=i.index,h-a>t&&(o=u>a?u:h,m+=`
|
|
189
|
-
`+e.slice(a,o),a=o+1),u=h;return m+=`
|
|
190
|
-
`,e.length-a>t&&u>a?m+=e.slice(a,u)+`
|
|
191
|
-
`+e.slice(u+1):m+=e.slice(a),m.slice(1)}function zV(e){for(var t="",s=0,i,a=0;a<e.length;s>=65536?a+=2:a++)s=jc(e,a),i=Vs[s],!i&&Qc(s)?(t+=e[a],s>=65536&&(t+=e[a+1])):t+=i||TV(s);return t}function IV(e,t,s){var i="",a=e.tag,o,u,h;for(o=0,u=s.length;o<u;o+=1)h=s[o],e.replacer&&(h=e.replacer.call(s,String(o),h)),(ur(e,t,h,!1,!1)||typeof h>"u"&&ur(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=a,e.dump="["+i+"]"}function ok(e,t,s,i){var a="",o=e.tag,u,h,m;for(u=0,h=s.length;u<h;u+=1)m=s[u],e.replacer&&(m=e.replacer.call(s,String(u),m)),(ur(e,t+1,m,!0,!0,!1,!0)||typeof m>"u"&&ur(e,t+1,null,!0,!0,!1,!0))&&((!i||a!=="")&&(a+=eb(e,t)),e.dump&&Xc===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=o,e.dump=a||"[]"}function PV(e,t,s){var i="",a=e.tag,o=Object.keys(s),u,h,m,f,p;for(u=0,h=o.length;u<h;u+=1)p="",i!==""&&(p+=", "),e.condenseFlow&&(p+='"'),m=o[u],f=s[m],e.replacer&&(f=e.replacer.call(s,m,f)),ur(e,t,m,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ur(e,t,f,!1,!1)&&(p+=e.dump,i+=p));e.tag=a,e.dump="{"+i+"}"}function $V(e,t,s,i){var a="",o=e.tag,u=Object.keys(s),h,m,f,p,b,x;if(e.sortKeys===!0)u.sort();else if(typeof e.sortKeys=="function")u.sort(e.sortKeys);else if(e.sortKeys)throw new Xs("sortKeys must be a boolean or a function");for(h=0,m=u.length;h<m;h+=1)x="",(!i||a!=="")&&(x+=eb(e,t)),f=u[h],p=s[f],e.replacer&&(p=e.replacer.call(s,f,p)),ur(e,t+1,f,!0,!0,!0)&&(b=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,b&&(e.dump&&Xc===e.dump.charCodeAt(0)?x+="?":x+="? "),x+=e.dump,b&&(x+=eb(e,t)),ur(e,t+1,p,!0,b)&&(e.dump&&Xc===e.dump.charCodeAt(0)?x+=":":x+=": ",x+=e.dump,a+=x));e.tag=o,e.dump=a||"{}"}function lk(e,t,s){var i,a,o,u,h,m;for(a=s?e.explicitTypes:e.implicitTypes,o=0,u=a.length;o<u;o+=1)if(h=a[o],(h.instanceOf||h.predicate)&&(!h.instanceOf||typeof t=="object"&&t instanceof h.instanceOf)&&(!h.predicate||h.predicate(t))){if(s?h.multi&&h.representName?e.tag=h.representName(t):e.tag=h.tag:e.tag="?",h.represent){if(m=e.styleMap[h.tag]||h.defaultStyle,$3.call(h.represent)==="[object Function]")i=h.represent(t,m);else if(H3.call(h.represent,m))i=h.represent[m](t,m);else throw new Xs("!<"+h.tag+'> tag resolver accepts not "'+m+'" style');e.dump=i}return!0}return!1}function ur(e,t,s,i,a,o,u){e.tag=null,e.dump=s,lk(e,s,!1)||lk(e,s,!0);var h=$3.call(e.dump),m=i,f;i&&(i=e.flowLevel<0||e.flowLevel>t);var p=h==="[object Object]"||h==="[object Array]",b,x;if(p&&(b=e.duplicates.indexOf(s),x=b!==-1),(e.tag!==null&&e.tag!=="?"||x||e.indent!==2&&t>0)&&(a=!1),x&&e.usedDuplicates[b])e.dump="*ref_"+b;else{if(p&&x&&!e.usedDuplicates[b]&&(e.usedDuplicates[b]=!0),h==="[object Object]")i&&Object.keys(e.dump).length!==0?($V(e,t,e.dump,a),x&&(e.dump="&ref_"+b+e.dump)):(PV(e,t,e.dump),x&&(e.dump="&ref_"+b+" "+e.dump));else if(h==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!u&&t>0?ok(e,t-1,e.dump,a):ok(e,t,e.dump,a),x&&(e.dump="&ref_"+b+e.dump)):(IV(e,t,e.dump),x&&(e.dump="&ref_"+b+" "+e.dump));else if(h==="[object String]")e.tag!=="?"&&LV(e,e.dump,t,o,m);else{if(h==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Xs("unacceptable kind of an object to dump "+h)}e.tag!==null&&e.tag!=="?"&&(f=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?f="!"+f:f.slice(0,18)==="tag:yaml.org,2002:"?f="!!"+f.slice(18):f="!<"+f+">",e.dump=f+" "+e.dump)}return!0}function HV(e,t){var s=[],i=[],a,o;for(sb(e,s,i),a=0,o=i.length;a<o;a+=1)t.duplicates.push(s[i[a]]);t.usedDuplicates=new Array(o)}function sb(e,t,s){var i,a,o;if(e!==null&&typeof e=="object")if(a=t.indexOf(e),a!==-1)s.indexOf(a)===-1&&s.push(a);else if(t.push(e),Array.isArray(e))for(a=0,o=e.length;a<o;a+=1)sb(e[a],t,s);else for(i=Object.keys(e),a=0,o=i.length;a<o;a+=1)sb(e[i[a]],t,s)}function UV(e,t){t=t||{};var s=new MV(t);s.noRefs||HV(e,s);var i=e;return s.replacer&&(i=s.replacer.call({"":i},"",i)),ur(s,0,i,!0,!0)?s.dump+`
|
|
192
|
-
`:""}var FV=UV,VV={dump:FV};function bv(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var qV=Ds,GV=d3,KV=p3,WV=_3,YV=y3,XV=fv,ZV=P3.load,QV=P3.loadAll,JV=VV.dump,eq=Xs,tq={binary:E3,float:x3,map:m3,null:g3,pairs:T3,set:A3,timestamp:k3,bool:b3,int:v3,merge:C3,omap:N3,seq:f3,str:h3},sq=bv("safeLoad","load"),nq=bv("safeLoadAll","loadAll"),iq=bv("safeDump","dump"),rq={Type:qV,Schema:GV,FAILSAFE_SCHEMA:KV,JSON_SCHEMA:WV,CORE_SCHEMA:YV,DEFAULT_SCHEMA:XV,load:ZV,loadAll:QV,dump:JV,YAMLException:eq,types:tq,safeLoad:sq,safeLoadAll:nq,safeDump:iq};function Z3(e){return e!==null&&typeof e=="object"}function Q3(e){return typeof e=="string"?"text-rose-700 dark:text-rose-300":typeof e=="number"?"text-emerald-700 dark:text-emerald-300":typeof e=="boolean"?"text-blue-700 dark:text-blue-400":e==null?"text-muted-foreground italic":"text-foreground"}function J3(e){return e==null?"null":typeof e=="string"?e===""?'""':e:String(e)}function e5({label:e,value:t,depth:s,defaultOpen:i}){const[a,o]=w.useState(i),u={paddingLeft:`${s*1.1}rem`};if(!Z3(t))return l.jsxs("div",{className:"flex items-baseline gap-2 py-[1px]",style:u,children:[l.jsxs("span",{className:"text-muted-foreground",children:[e,":"]}),l.jsx("span",{className:de("whitespace-pre-wrap break-words",Q3(t)),children:J3(t)})]});const h=Array.isArray(t)?t.map((f,p)=>[String(p),f]):Object.entries(t),m=Array.isArray(t)?`[${h.length}]`:`{${h.length}}`;return l.jsxs("div",{children:[l.jsxs("button",{type:"button",onClick:()=>o(f=>!f),className:"flex w-full items-center gap-1 py-[1px] text-left hover:bg-muted",style:u,children:[a?l.jsx(Yn,{className:"size-3.5 shrink-0 text-muted-foreground"}):l.jsx(ia,{className:"size-3.5 shrink-0 text-muted-foreground"}),l.jsx("span",{className:"font-medium text-foreground",children:e}),l.jsx("span",{className:"text-muted-foreground",children:m})]}),a?h.map(([f,p])=>l.jsx(e5,{label:f,value:p,depth:s+1,defaultOpen:s<1},f)):null]})}function aq({content:e}){const t=w.useMemo(()=>{try{const i=rq.loadAll(e);return{value:i.length<=1?i[0]:i,error:null}}catch(i){return{value:null,error:i instanceof Error?i.message:String(i)}}},[e]);if(t.error)return l.jsx("div",{className:"p-4",children:l.jsxs(it,{variant:"destructive",children:["Could not parse YAML: ",t.error]})});if(!Z3(t.value))return l.jsx("div",{className:"p-4 font-mono text-[12px]",children:l.jsx("span",{className:Q3(t.value),children:J3(t.value)})});const s=Array.isArray(t.value)?t.value.map((i,a)=>[String(a),i]):Object.entries(t.value);return l.jsx("div",{className:"min-w-max px-4 py-3 font-mono text-[12px] leading-[1.6]",children:s.map(([i,a])=>l.jsx(e5,{label:i,value:a,depth:0,defaultOpen:!0},i))})}const oq=w.lazy(()=>QH(()=>import("./code-editor-B5xQq21I.js"),[]).then(e=>({default:e.CodeEditor})));function lq(e){const t=e.split("/").pop()?.toLowerCase().split(".").pop()??"";return t==="md"||t==="mdx"||t==="markdown"?"markdown":t==="yml"||t==="yaml"?"yaml":null}function cq(e){const t=e.split("/").pop()?.toLowerCase()??"",s=t.includes(".")?t.split(".").pop()??"":"",i={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",sh:"bash",bash:"bash",zsh:"bash",json:"json",yaml:"yaml",yml:"yaml",toml:"ini",ini:"ini",md:"markdown",mdx:"markdown",css:"css",scss:"scss",less:"less",html:"xml",xml:"xml",sql:"sql",dockerfile:"dockerfile"};return i[s]?i[s]:t==="dockerfile"?"dockerfile":null}function uq(e,t){const s=e.endsWith(`
|
|
193
|
-
`)?e.slice(0,-1):e;return!t||!Z0.getLanguage(t)?s.split(`
|
|
194
|
-
`).map(ck):s.split(`
|
|
195
|
-
`).map(i=>{if(!i)return"";try{return Z0.highlight(i,{language:t,ignoreIllegals:!0}).value}catch{return ck(i)}})}function ck(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function dq({content:e,path:t}){const s=w.useMemo(()=>cq(t),[t]),i=w.useMemo(()=>uq(e,s),[e,s]),a=`${Math.max(2,String(i.length).length)}ch`;return l.jsx("div",{className:"min-w-max font-mono text-[12px] leading-[1.5]",children:i.map((o,u)=>l.jsxs("div",{className:"flex",children:[l.jsx("span",{className:"shrink-0 select-none border-r border-zinc-200 bg-zinc-100 px-2 text-right text-zinc-400 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-500",style:{minWidth:`calc(${a} + 1rem)`},children:u+1}),l.jsx("span",{className:"hljs whitespace-pre px-3 text-zinc-800 dark:text-zinc-100",dangerouslySetInnerHTML:{__html:o||" "}})]},u))})}function hq({path:e,isModified:t,onViewDiff:s,onFileSaved:i,onSendToAi:a}){const[o,u]=w.useState(null),[h,m]=w.useState(""),[f,p]=w.useState(!1),[b,x]=w.useState(null),[_,y]=w.useState(!1),[S,C]=w.useState(!1),{success:E,error:T}=Bs(),N=w.useMemo(()=>lq(e),[e]),[M,R]=w.useState("preview"),z=!!(o&&!o.binary&&!o.truncated),L=o?h!==o.content:!1;w.useEffect(()=>{R(N?"preview":"source"),p(!1)},[N]),w.useEffect(()=>{if(!e){u(null);return}let P=!0;return y(!0),x(null),p(!1),wj(e).then(F=>{P&&(u(F),m(F.content),y(!1))}).catch(F=>{P&&(x(F instanceof Error?F.message:String(F)),y(!1))}),()=>{P=!1}},[e]);async function j(){if(!(!e||!o||!L||S)){C(!0);try{await kj(e,h);const P={...o,content:h,size:new TextEncoder().encode(h).length};u(P),p(!1),E(`Saved ${e}.`),i?.(e)}catch(P){T(P instanceof Error?P.message:String(P))}finally{C(!1)}}}function H(){m(o?.content??""),p(!1)}return e?l.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-card",children:[l.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:e}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[l.jsx("span",{children:"Read-only view of tracked file."}),o?.truncated?l.jsx("span",{className:"text-amber-700",children:"Truncated — file exceeds 1MB."}):null,o?.binary?l.jsx("span",{className:"text-amber-700",children:"Binary file."}):null]})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[N&&!o?.binary?l.jsxs("div",{className:"flex items-center rounded-md border border-border p-0.5",children:[l.jsxs("button",{type:"button",onClick:()=>R("preview"),"aria-pressed":M==="preview",className:de("flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",M==="preview"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:[l.jsx(rb,{className:"size-3.5"}),"Preview"]}),l.jsxs("button",{type:"button",onClick:()=>R("source"),"aria-pressed":M==="source",className:de("flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",M==="source"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:[l.jsx(Ck,{className:"size-3.5"}),"Source"]})]}):null,t?l.jsx(re,{onClick:s,size:"sm",type:"button",variant:"outline",children:"View diff"}):null,a?l.jsx(re,{"aria-label":"Send file to AI input",className:"size-8",disabled:!e,onClick:a,size:"icon",title:"Send file path to AI input",type:"button",variant:"outline",children:l.jsx(ci,{className:"size-4"})}):null,f?l.jsxs(l.Fragment,{children:[l.jsxs(re,{disabled:!L||S,onClick:()=>{j()},size:"sm",type:"button",children:[l.jsx(Ik,{}),"Apply"]}),l.jsxs(re,{disabled:S,onClick:H,size:"sm",type:"button",variant:"outline",children:[l.jsx(Js,{}),"Cancel"]})]}):z?l.jsxs(re,{onClick:()=>{R("source"),p(!0)},size:"sm",type:"button",variant:"outline",children:[l.jsx(Pc,{}),"Edit"]}):null]})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-auto bg-zinc-50 dark:bg-zinc-950",children:b?l.jsx("div",{className:"p-4",children:l.jsx(it,{variant:"destructive",children:b})}):_?l.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading…"}):o?.binary?l.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Cannot display binary content."}):o?f?l.jsx(w.Suspense,{fallback:l.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading editor…"}),children:l.jsx(oq,{path:e,value:h,onChange:m})}):N&&M==="preview"?N==="markdown"?l.jsx(PU,{content:o.content}):l.jsx(aq,{content:o.content}):l.jsx(dq,{content:o.content,path:e}):null})]}):l.jsx("div",{className:"p-4",children:l.jsx(it,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a file to view its contents."})})}function fq({activeHunkIndex:e,filePaths:t,hunkCount:s,pendingNextFilePath:i,selectedFile:a}){if(s>0&&e<s-1)return{kind:"hunk",activeHunkIndex:e+1};const o=t.indexOf(a),u=t[o+1];return u?i===u?{kind:"file",filePath:u}:{kind:"confirm-next-file",filePath:u}:{kind:"none"}}function uk(e){const t={name:"",fullPath:"",children:new Map};for(const s of e){const i=s.name.split("/");let a=t;i.forEach((o,u)=>{let h=a.children.get(o);h||(h={name:o,fullPath:i.slice(0,u+1).join("/"),children:new Map},a.children.set(o,h)),a=h}),a.branch=s}return t}function dk({label:e,tree:t,onSelect:s,defaultOpen:i,forceOpen:a}){const[o,u]=w.useState(i??!1),h=a||o,m=t.children.size===0;return l.jsxs("div",{className:"mb-1",children:[l.jsxs("button",{type:"button",onClick:()=>u(f=>!f),className:"flex w-full items-center gap-1 px-2 py-0.5 text-left text-[11px] font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground",children:[h?l.jsx(Yn,{size:12}):l.jsx(ia,{size:12}),e,m?null:l.jsxs("span",{className:"ml-1 text-[10px] font-normal",children:["(",t.children.size,")"]})]}),h&&!m?l.jsx("ul",{children:Array.from(t.children.values()).map(f=>l.jsx(t5,{node:f,depth:1,onSelect:s,forceOpen:a},f.fullPath))}):null]})}function t5({node:e,depth:t,onSelect:s,forceOpen:i}){const[a,o]=w.useState(!0),u=i||a,h=e.children.size>0,m=e.branch,f={paddingLeft:`${t*10}px`};return!h&&m?l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:()=>s(m),style:f,title:m.name,className:`flex w-full items-center gap-1.5 py-0.5 pr-2 text-left text-[12px] hover:bg-muted/60 ${m.current?"font-semibold text-emerald-700":""}`,children:[l.jsx(Wn,{size:11,className:"shrink-0 opacity-70"}),l.jsx("span",{className:"truncate",children:e.name}),m.current?l.jsx("span",{className:"text-[10px]",children:"●"}):null]})}):l.jsxs("li",{children:[l.jsxs("button",{type:"button",onClick:()=>{m?s(m):o(p=>!p)},style:f,className:"flex w-full items-center gap-1 py-0.5 pr-2 text-left text-[12px] hover:bg-muted/60",children:[h?u?l.jsx(Yn,{size:11}):l.jsx(ia,{size:11}):l.jsx("span",{className:"inline-block w-[11px]"}),l.jsx("span",{className:"truncate",children:e.name})]}),u&&h?l.jsx("ul",{children:Array.from(e.children.values()).map(p=>l.jsx(t5,{node:p,depth:t+1,onSelect:s,forceOpen:i},p.fullPath))}):null]})}function mq({selectedCommit:e,selectedFile:t,diff:s,diffLoading:i,diffError:a}){return l.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col bg-card border-b border-border",children:[l.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:t??(e?e.subject:"Commit")}),e?l.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[l.jsx("span",{className:"font-mono",children:e.hash.slice(0,12)}),l.jsxs("span",{children:[e.author," <",e.email,">"]}),l.jsx("span",{children:new Date(e.timestamp*1e3).toLocaleString()})]}):null]})}),l.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:a?l.jsx("div",{className:"p-4",children:l.jsx(it,{variant:"destructive",children:a})}):e?i?l.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading diff…"}):s?l.jsx(dv,{activeHunkIndex:0,diff:s}):l.jsx("div",{className:"p-4",children:l.jsx(it,{variant:"muted",className:"border-dashed p-6 text-center",children:e.parents.length>1?"Merge commit with no conflict resolution — no diff against the first parent.":"No textual changes in this commit."})}):l.jsx("div",{className:"p-4",children:l.jsx(it,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a commit to inspect its diff."})})})]})}function pq({files:e,filesError:t,selectedHash:s,selectedFile:i,onSelect:a}){return l.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[l.jsx("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:l.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Files",e.length?l.jsx("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:e.length}):null]})}),l.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:t?l.jsx("div",{className:"p-3",children:l.jsx(it,{variant:"destructive",children:t})}):s?e.length===0?l.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No file changes."}):l.jsx("ul",{className:"divide-y divide-border",children:e.map(o=>l.jsx("li",{children:l.jsxs("button",{onClick:()=>a(o.path),type:"button",title:o.path,className:`flex w-full items-center gap-2 px-2 py-1 text-left text-[12px] transition-colors hover:bg-muted/60 ${i===o.path?"bg-muted":""}`,children:[l.jsx("span",{className:gq(o.index),children:o.index.trim()||"·"}),l.jsx("span",{className:"truncate font-mono",children:o.path})]})},o.path))}):l.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Select a commit to see its files."})})]})}function gq(e){const t="inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-[10px] font-bold";switch(e.trim().toUpperCase()){case"A":return`${t} bg-emerald-100 text-emerald-800`;case"D":return`${t} bg-red-100 text-red-800`;case"M":return`${t} bg-amber-100 text-amber-800`;case"R":return`${t} bg-blue-100 text-blue-800`;case"C":return`${t} bg-indigo-100 text-indigo-800`;default:return`${t} bg-slate-100 text-slate-700`}}const hk=["#3b82f6","#10b981","#f59e0b","#ec4899","#8b5cf6","#14b8a6","#ef4444","#84cc16"];function xc(e){return hk[e%hk.length]}function bq({lane:e,laneCount:t,edges:s,throughLanes:i,isMerge:a,height:o=28,laneWidth:u=14}){const m=Math.max(e+1,t,1)*u,f=o/2,p=_c(e,u),b=a?4:3.5;return l.jsxs("svg",{width:m,height:o,viewBox:`0 0 ${m} ${o}`,style:{flex:"0 0 auto",display:"block"},children:[i.map(x=>l.jsx("line",{x1:_c(x,u),y1:0,x2:_c(x,u),y2:o,stroke:xc(x),strokeWidth:1.5},`t-${x}`)),l.jsx("line",{x1:p,y1:0,x2:p,y2:f,stroke:xc(e),strokeWidth:1.5}),s.map((x,_)=>{const y=_c(x.fromLane,u),S=_c(x.toLane,u);if(y===S)return l.jsx("line",{x1:y,y1:f,x2:S,y2:o,stroke:xc(x.toLane),strokeWidth:1.5},`e-${_}`);const C=f+(o-f)/2;return l.jsx("path",{d:`M ${y} ${f} C ${y} ${C}, ${S} ${C}, ${S} ${o}`,fill:"none",stroke:xc(x.toLane),strokeWidth:1.5},`e-${_}`)}),l.jsx("circle",{cx:p,cy:f,r:b,fill:xc(e),stroke:"var(--background, #fff)",strokeWidth:1.5})]})}function _c(e,t){return e*t+t/2}function vq({sha:e}){const[t,s]=w.useState(null);if(w.useEffect(()=>{let o=!0;return zj(e).then(u=>{o&&s(u)}).catch(()=>{}),()=>{o=!1}},[e]),!t||t.state==="unknown"||t.totalCount===0)return null;const i=xq(t.state),a=`CI: ${t.state} (${t.totalCount} check${t.totalCount!==1?"s":""})`;return l.jsx("span",{"aria-label":a,className:`shrink-0 size-2 rounded-full ${i}`,title:a})}function xq(e){switch(e){case"success":return"bg-emerald-500";case"pending":return"bg-amber-400 animate-pulse";case"failure":return"bg-red-500";case"error":return"bg-orange-500";default:return"bg-zinc-400"}}const fk=28;function _q({commits:e,loading:t,error:s,selectedHash:i,maxLanes:a,rowRefs:o,onSelect:u,onLoadMore:h}){const{sendToAgent:m}=Ls(),[f,p]=w.useState(null);function b(x,_){p(null),m({prompt:k7(x,_),source:{type:"git-commit",label:x.hash.slice(0,7)},label:`${x.hash.slice(0,7)}: ${_}`})}return l.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[l.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[l.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Commit tree",e.length?l.jsxs("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:[e.length," commits"]}):null]}),l.jsx(re,{disabled:t,onClick:h,size:"sm",type:"button",variant:"outline",children:"Load more"})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:s?l.jsx("div",{className:"p-3",children:l.jsx(it,{variant:"destructive",children:s})}):t&&e.length===0?l.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Loading commits…"}):e.length===0?l.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No commits."}):l.jsx("ul",{className:"divide-y divide-border",children:e.map(x=>l.jsxs("li",{ref:_=>{_?o.current.set(x.hash,_):o.current.delete(x.hash)},className:"group flex flex-col",children:[l.jsxs("div",{className:`flex items-center transition-colors hover:bg-muted/60 ${i===x.hash?"bg-muted":""}`,children:[l.jsxs("button",{onClick:()=>u(x.hash),type:"button",className:"flex min-w-0 flex-1 items-center gap-2 px-2 py-0.5 text-left",style:{minHeight:fk},title:`${x.hash}
|
|
196
|
-
${x.author} <${x.email}>
|
|
197
|
-
${x.subject}`,children:[l.jsx(bq,{lane:x.lane,laneCount:Math.max(x.laneCount,a),edges:x.edges,throughLanes:x.throughLanes,isMerge:x.parents.length>1,height:fk}),l.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] text-muted-foreground",children:[x.hash.slice(0,7),l.jsx(vq,{sha:x.hash})]}),l.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[x.refs.map(_=>l.jsx("span",{className:Sq(_.kind),children:_.name},`${_.kind}-${_.name}`)),l.jsx("span",{className:"truncate text-[12px]",children:x.subject})]}),l.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:x.author}),l.jsx("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/70",title:new Date(x.timestamp*1e3).toLocaleString(),children:yq(x.timestamp)})]}),l.jsx(tl,{className:`mr-1 shrink-0 ${f===x.hash?"opacity-100":""}`,label:`Ask AI about commit ${x.hash.slice(0,7)}`,onAsk:()=>p(_=>_===x.hash?null:x.hash)})]}),f===x.hash?l.jsx("div",{className:"px-2 pb-1.5 pt-0.5",children:l.jsx(Xh,{placeholder:"What should the agent do with this commit? (explain, summarize, find regressions…)",onSubmit:_=>b(x,_),onCancel:()=>p(null)})}):null]},x.hash))})})]})}function yq(e){if(!e)return"";const t=Math.max(0,Math.floor(Date.now()/1e3-e));if(t<60)return`${t}s`;const s=Math.floor(t/60);if(s<60)return`${s}m`;const i=Math.floor(s/60);if(i<24)return`${i}h`;const a=Math.floor(i/24);if(a<30)return`${a}d`;const o=Math.floor(a/30);return o<12?`${o}mo`:`${Math.floor(o/12)}y`}function Sq(e){const t="rounded border px-1.5 py-px text-[10px] font-medium";switch(e){case"head":return`${t} border-emerald-200 bg-emerald-100 text-emerald-800 dark:border-emerald-400/30 dark:bg-emerald-500/15 dark:text-emerald-300`;case"branch":return`${t} border-blue-200 bg-blue-100 text-blue-800 dark:border-blue-400/30 dark:bg-blue-500/15 dark:text-blue-300`;case"remote":return`${t} border-slate-200 bg-slate-100 text-slate-700 dark:border-zinc-700/80 dark:bg-zinc-800/80 dark:text-zinc-300`;case"tag":return`${t} border-amber-200 bg-amber-100 text-amber-800 dark:border-amber-400/30 dark:bg-amber-500/15 dark:text-amber-300`}}const mk=200;function wq(){const[e,t]=w.useState([]),[s,i]=w.useState(mk),[a,o]=w.useState(!0),[u,h]=w.useState(null),[m,f]=w.useState(null),[p,b]=w.useState([]),[x,_]=w.useState(null),[y,S]=w.useState(null),[C,E]=w.useState(""),[T,N]=w.useState(!1),[M,R]=w.useState(null);w.useEffect(()=>{let j=!0;return o(!0),h(null),vj(s).then(H=>{j&&(t(H),H.length>0&&!H.some(P=>P.hash===m)&&f(H[0].hash))}).catch(H=>{j&&h(H instanceof Error?H.message:String(H))}).finally(()=>{j&&o(!1)}),()=>{j=!1}},[s]),w.useEffect(()=>{if(!m){b([]),S(null);return}let j=!0;return _(null),_j(m).then(H=>{j&&(b(H),S(H[0]?.path??null))}).catch(H=>{j&&_(H instanceof Error?H.message:String(H))}),()=>{j=!1}},[m]),w.useEffect(()=>{if(!m){E("");return}let j=!0;return R(null),N(!0),xj(m,y??void 0).then(H=>{j&&E(H)}).catch(H=>{j&&R(H instanceof Error?H.message:String(H))}).finally(()=>{j&&N(!1)}),()=>{j=!1}},[m,y]);const z=w.useMemo(()=>e.reduce((j,H)=>Math.max(j,H.laneCount),1),[e]),L=e.find(j=>j.hash===m)??null;return{commits:e,loading:a,error:u,selectedHash:m,setSelectedHash:f,files:p,filesError:x,selectedFile:y,setSelectedFile:S,diff:C,diffLoading:T,diffError:M,maxLanes:z,selectedCommit:L,loadMore:()=>i(j=>j+mk)}}function kq({branches:e=[]}){const{commits:t,loading:s,error:i,selectedHash:a,setSelectedHash:o,files:u,filesError:h,selectedFile:m,setSelectedFile:f,diff:p,diffLoading:b,diffError:x,maxLanes:_,selectedCommit:y,loadMore:S}=wq(),[C,E]=w.useState(""),T=w.useMemo(()=>{const j=C.trim().toLowerCase();return j?e.filter(H=>H.name.toLowerCase().includes(j)):e},[e,C]),N=w.useMemo(()=>uk(T.filter(j=>!j.remote)),[T]),M=w.useMemo(()=>uk(T.filter(j=>j.remote)),[T]),R=C.trim().length>0,z=w.useRef(new Map);function L(j){const H=j.remote?"remote":"branch",P=t.find(Y=>Y.refs.some(Q=>Q.kind===H&&Q.name===j.name));if(!P)return;o(P.hash);const F=z.current.get(P.hash),K=F?.parentElement?.parentElement;!F||!K||K.scrollTo({top:Math.max(F.offsetTop-K.clientHeight/2+F.clientHeight/2,0),behavior:"smooth"})}return l.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 grid-cols-[220px_minmax(0,1fr)]",children:[l.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[l.jsxs("div",{className:"flex shrink-0 flex-col gap-1 border-b border-border px-3 py-1.5",children:[l.jsx("h2",{className:"text-[13px] font-semibold tracking-tight",children:"Branches"}),l.jsx("input",{type:"search",value:C,onChange:j=>E(j.target.value),placeholder:"Search branches…",className:"w-full rounded border border-border bg-background px-2 py-1 text-[11px] outline-none focus:border-foreground"})]}),l.jsxs("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:[l.jsx(dk,{label:"Local",tree:N,onSelect:L,defaultOpen:!0,forceOpen:R}),l.jsx(dk,{label:"Remote",tree:M,onSelect:L,forceOpen:R})]})]}),l.jsxs("div",{className:"grid min-h-0 min-w-0 grid-rows-[minmax(0,3fr)_minmax(0,2fr)]",children:[l.jsx(mq,{selectedCommit:y,selectedFile:m,diff:p,diffLoading:b,diffError:x}),l.jsxs("div",{className:"grid min-h-0 min-w-0 grid-cols-[minmax(0,1fr)_280px]",children:[l.jsx(_q,{commits:t,loading:s,error:i,selectedHash:a,maxLanes:_,rowRefs:z,onSelect:o,onLoadMore:S}),l.jsx(pq,{files:u,filesError:h,selectedHash:a,selectedFile:m,onSelect:f})]})]})]})}const nb=300,Cq=600,Eq=new Set(["md","mdx","markdown","txt","rst","adoc","json","jsonc","json5","yaml","yml","toml","xml","ini","cfg","conf","env","properties","csv","tsv","lock","svg","map","snap","png","jpg","jpeg","gif","ico","webp"]);function Nq(e){const t=e.toLowerCase();if(t.endsWith(".d.ts")||t.endsWith(".min.js")||t.endsWith(".min.css"))return!1;const s=t.lastIndexOf(".");return s<0?!0:!Eq.has(t.slice(s+1))}function Tq(e){return e>=Cq?"danger":e>=nb?"warn":"ok"}const Aq={ok:"bg-emerald-500/60",warn:"bg-amber-500/70",danger:"bg-destructive/70"},Mq={ok:"text-muted-foreground",warn:"text-amber-600 dark:text-amber-400",danger:"text-destructive"};function jq({onOpenFile:e,root:t}){const[s,i]=w.useState([]),[a,o]=w.useState(!0),[u,h]=w.useState(null),[m,f]=w.useState(!0);function p(){o(!0),h(null),Sj().then(i).catch(S=>h(S instanceof Error?S.message:String(S))).finally(()=>o(!1))}w.useEffect(()=>{p()},[]);const b=w.useMemo(()=>m?s.filter(S=>Nq(S.path)):s,[s,m]),x=s.length-b.length,_=b[0]?.lines??1,y=b.filter(S=>S.lines>=nb).length;return l.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[l.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(Mk,{className:"size-4"}),l.jsx("span",{className:"font-semibold text-foreground",children:"Largest files"}),!a&&!u?l.jsxs("span",{children:[b.length," files · ",y," over ",nb," lines",m&&x>0?` · ${x} data/docs hidden`:""]}):null]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsxs(re,{size:"sm",variant:m?"default":"outline",className:"h-7",onClick:()=>f(S=>!S),title:"Hide docs, data, config and generated files",type:"button",children:[l.jsx(Ck,{}),"Code only"]}),l.jsxs(re,{size:"sm",variant:"outline",className:"h-7",onClick:p,disabled:a,type:"button",children:[a?l.jsx(Os,{className:"animate-spin"}):l.jsx(eu,{}),"Refresh"]})]})]}),u?l.jsx(it,{variant:"destructive",className:"m-3",children:u}):a&&s.length===0?l.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[l.jsx(Os,{className:"mr-2 size-4 animate-spin"}),"Scanning tracked files…"]}):b.length===0?l.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:s.length===0?"No tracked text files found.":"No code files — toggle off “Code only” to see data & docs."}):l.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border/60 overflow-auto",children:b.map((S,C)=>{const E=Tq(S.lines);return l.jsxs("li",{className:"group flex items-center gap-3 px-3 transition-colors hover:bg-muted/50",children:[l.jsx("span",{className:"w-6 shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:C+1}),l.jsx("button",{type:"button",onClick:()=>e(S.path),className:"min-w-0 flex-1 py-1.5 text-left",children:l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsx("span",{className:"truncate font-mono text-[11px]",children:S.path}),l.jsxs("span",{className:de("shrink-0 font-mono text-[11px] tabular-nums",Mq[E]),children:[S.truncated?"≥":"",S.lines.toLocaleString()," lines"]})]}),l.jsx("div",{className:"mt-1 h-1 w-full overflow-hidden rounded-full bg-muted",children:l.jsx("div",{className:de("h-full rounded-full",Aq[E]),style:{width:`${Math.max(2,S.lines/_*100)}%`}})})]})}),l.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-0.5",children:[l.jsx(Rq,{file:S,root:t}),l.jsx(Dq,{file:S,root:t})]})]},S.path)})})]})}function Rq({file:e,root:t}){const{sendToAgent:s}=Ls(),i=lu(t,e.path),a=e.path.split("/").pop()??e.path;function o(){s({prompt:w7({absolutePath:i,lines:e.lines,relativePath:e.path}),source:{label:a,type:"large-file"},label:`Help me split \`${e.path}\` (${e.lines.toLocaleString()} lines).`,mode:"send"})}function u(){s({prompt:i,source:{label:a,type:"large-file"},mode:"draft"})}return l.jsx(s5,{label:`AI actions for ${e.path}`,trigger:l.jsx(ci,{className:"size-3.5"}),children:h=>l.jsxs(l.Fragment,{children:[l.jsx(Ic,{icon:l.jsx(ci,{className:"size-3.5"}),onSelect:()=>{h(),o()},children:"Ask AI to split this file"}),l.jsx(Ic,{icon:l.jsx(Ak,{className:"size-3.5"}),onSelect:()=>{h(),u()},children:"Send file path to AI"})]})})}function Dq({file:e,root:t}){const{error:s,success:i}=Bs(),a=lu(t,e.path),o=e.path.split("/").pop()??e.path;async function u(h,m){try{await navigator.clipboard.writeText(h),i(`Copied ${m}.`)}catch(f){s(f instanceof Error?f.message:`Could not copy ${m}.`)}}return l.jsx(s5,{label:`Copy path for ${e.path}`,trigger:l.jsxs(l.Fragment,{children:[l.jsx(Nk,{className:"size-3.5"}),l.jsx("span",{className:"sr-only",children:"More actions"})]}),children:h=>l.jsxs(l.Fragment,{children:[l.jsx(Ic,{icon:l.jsx(jk,{className:"size-3.5"}),onSelect:()=>{h(),u(o,"file name")},children:"Copy file name"}),l.jsx(Ic,{icon:l.jsx(zg,{className:"size-3.5"}),onSelect:()=>{h(),u(e.path,"relative path")},children:"Copy relative path"}),l.jsx(Ic,{icon:l.jsx(zg,{className:"size-3.5"}),onSelect:()=>{h(),u(a,"absolute path")},children:"Copy absolute path"})]})})}function s5({children:e,label:t,trigger:s}){const[i,a]=w.useState(!1),[o,u]=w.useState({right:0,top:0}),h=w.useRef(null),m=w.useRef(null);function f(){a(!1)}function p(){const b=h.current?.getBoundingClientRect();b&&u({top:b.bottom+6,right:window.innerWidth-b.right}),a(x=>!x)}return w.useEffect(()=>{if(!i)return;function b(_){const y=_.target;h.current?.contains(y)||m.current?.contains(y)||f()}function x(_){_.key==="Escape"&&f()}return document.addEventListener("mousedown",b),document.addEventListener("keydown",x),window.addEventListener("scroll",f,!0),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",x),window.removeEventListener("scroll",f,!0)}},[i]),l.jsxs(l.Fragment,{children:[l.jsx("button",{"aria-label":t,className:de("flex h-7 min-w-7 shrink-0 items-center justify-center gap-1 rounded-md px-1.5 text-muted-foreground opacity-0 transition-all duration-150 hover:bg-muted hover:text-foreground group-hover:opacity-100",i&&"bg-muted text-foreground opacity-100"),onClick:p,ref:h,title:t,type:"button",children:s}),i?ou.createPortal(l.jsx("div",{className:"fixed z-50 w-56 overflow-hidden rounded-md border border-border bg-card p-1 shadow-md",ref:m,style:{top:o.top,right:o.right},children:e(f)}),document.body):null]})}function Ic({children:e,icon:t,onSelect:s}){return l.jsxs("button",{className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-foreground transition-colors hover:bg-muted",onClick:s,type:"button",children:[l.jsx("span",{className:"text-muted-foreground",children:t}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:e})]})}function Oq(){const[e,t]=w.useState(!1),[s,i]=w.useState(!1),[a,o]=w.useState(!0);function u(){o(!0),Nj().then(h=>{t(h.configured),i(h.deviceFlowAvailable)}).catch(()=>{t(!1),i(!1)}).finally(()=>o(!1))}return w.useEffect(()=>{u()},[]),{configured:e,deviceFlowAvailable:s,loading:a,refresh:u}}function Lq(e="open"){const[t,s]=w.useState([]),[i,a]=w.useState(!0),[o,u]=w.useState(null),[h,m]=w.useState(null),[f,p]=w.useState(null),[b,x]=w.useState(""),[_,y]=w.useState(!1),[S,C]=w.useState(null);w.useEffect(()=>{let T=!0;return a(!0),u(null),ly(e).then(N=>{T&&(s(N),N.length>0&&!N.some(M=>M.number===h)&&m(N[0]?.number??null))}).catch(N=>{T&&u(N instanceof Error?N.message:String(N))}).finally(()=>{T&&a(!1)}),()=>{T=!1}},[e]),w.useEffect(()=>{if(!h){p(null);return}let T=!0;return jj(h).then(N=>{T&&p(N)}).catch(()=>{}),()=>{T=!1}},[h]),w.useEffect(()=>{if(!h){x("");return}let T=!0;return y(!0),C(null),Rj(h).then(N=>{T&&x(N)}).catch(N=>{T&&C(N instanceof Error?N.message:String(N))}).finally(()=>{T&&y(!1)}),()=>{T=!1}},[h]);function E(){let T=!0;return a(!0),u(null),ly(e).then(N=>{T&&s(N)}).catch(N=>{T&&u(N instanceof Error?N.message:String(N))}).finally(()=>{T&&a(!1)}),()=>{T=!1}}return{prs:t,loading:i,error:o,selectedNumber:h,setSelectedNumber:m,selectedPR:f,diff:b,diffLoading:_,diffError:S,refresh:E}}function Bq(e="open"){const[t,s]=w.useState([]),[i,a]=w.useState(!0),[o,u]=w.useState(null),[h,m]=w.useState(null),[f,p]=w.useState(null),[b,x]=w.useState([]),[_,y]=w.useState(!1),[S,C]=w.useState(null),[E,T]=w.useState(!1);w.useEffect(()=>{let R=!0;return a(!0),u(null),cy(e).then(z=>{R&&(s(z),z.length>0&&!z.some(L=>L.number===h)&&m(z[0]?.number??null))}).catch(z=>{R&&u(z instanceof Error?z.message:String(z))}).finally(()=>{R&&a(!1)}),()=>{R=!1}},[e]),w.useEffect(()=>{if(!h){p(null),x([]);return}let R=!0;return y(!0),Promise.all([Oj(h),Lj(h)]).then(([z,L])=>{R&&(p(z),x(L))}).catch(()=>{}).finally(()=>{R&&y(!1)}),()=>{R=!1}},[h]);async function N(R){if(h){T(!0),C(null);try{const z=await Bj(h,R);x(L=>[...L,z])}catch(z){C(z instanceof Error?z.message:String(z))}finally{T(!1)}}}function M(){let R=!0;return a(!0),cy(e).then(z=>{R&&s(z)}).catch(()=>{}).finally(()=>{R&&a(!1)}),()=>{R=!1}}return{issues:t,loading:i,error:o,selectedNumber:h,setSelectedNumber:m,selectedIssue:f,comments:b,commentsLoading:_,commentError:S,submitting:E,addComment:N,refresh:M}}function zq({deviceFlowAvailable:e,onSaved:t}){const[s,i]=w.useState(e?"choose":"pat");return s==="device-pending"?l.jsx(Iq,{onSuccess:t,onCancel:()=>i("choose")}):s==="pat"?l.jsx(Pq,{onSaved:t,onBack:e?()=>i("choose"):void 0}):l.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-6 p-8",children:[l.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[l.jsx("div",{className:"flex size-12 items-center justify-center rounded-xl bg-muted",children:l.jsx(ay,{className:"size-6 text-muted-foreground"})}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-base font-semibold",children:"Connect GitHub"}),l.jsx("p",{className:"mt-1 max-w-sm text-[13px] text-muted-foreground",children:"Authorize NoMoreIDE to read pull requests, issues, and CI status for your repositories."})]})]}),l.jsxs("div",{className:"flex w-full max-w-xs flex-col gap-2",children:[l.jsxs(re,{className:"w-full",onClick:()=>i("device-pending"),type:"button",children:[l.jsx(ay,{className:"mr-2 size-4"}),"Authorize with GitHub"]}),l.jsx("button",{className:"text-[12px] text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",onClick:()=>i("pat"),type:"button",children:"Use a Personal Access Token instead"})]})]})}function Iq({onSuccess:e,onCancel:t}){const[s,i]=w.useState(null),[a,o]=w.useState(null),[u,h]=w.useState(!0),[m,f]=w.useState(!1),p=w.useRef(null),b=w.useRef(5),x=w.useRef(!1);w.useEffect(()=>{let C=!0;return Tj().then(E=>{C&&(i(E),b.current=E.interval,h(!1),window.open(E.verification_uri_complete,"_blank","noopener,noreferrer"),_(E.device_code,E.interval),setTimeout(()=>{x.current=!0},E.expires_in*1e3))}).catch(E=>{C&&(o(E instanceof Error?E.message:String(E)),h(!1))}),()=>{C=!1,p.current&&clearTimeout(p.current)}},[]);function _(C,E){p.current=setTimeout(()=>{y(C,E)},E*1e3)}async function y(C,E){if(x.current){o("Authorization expired. Please try again.");return}try{const T=await Aj(C);if(T.done){e();return}const N=T.slowDown?E+5:E;b.current=N,_(C,N)}catch{_(C,b.current)}}function S(){s&&navigator.clipboard.writeText(s.user_code).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)})}return u?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[l.jsx(oy,{className:"size-6 animate-spin text-muted-foreground"}),l.jsx("p",{className:"text-[13px] text-muted-foreground",children:"Requesting authorization…"})]})}):a?l.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4 p-8",children:[l.jsx(it,{variant:"destructive",children:a}),l.jsx(re,{onClick:t,variant:"outline",children:"Go back"})]}):l.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-6 p-8",children:[l.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[l.jsx("div",{className:"flex size-12 items-center justify-center rounded-xl bg-emerald-100 dark:bg-emerald-500/15",children:l.jsx(kk,{className:"size-6 text-emerald-600 dark:text-emerald-400"})}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-base font-semibold",children:"Authorize on GitHub"}),l.jsxs("p",{className:"mt-1 max-w-sm text-[13px] text-muted-foreground",children:["A GitHub page just opened in a new tab. Enter the code below and click"," ",l.jsx("strong",{children:"Authorize"}),"."]})]})]}),l.jsxs("div",{className:"flex flex-col items-center gap-2",children:[l.jsx("div",{className:"flex cursor-pointer select-all items-center gap-3 rounded-xl border-2 border-border bg-muted px-6 py-4 font-mono text-2xl font-bold tracking-[0.3em] transition-colors hover:border-ring",onClick:S,title:"Click to copy",children:s?.user_code}),l.jsx("button",{className:"text-[11px] text-muted-foreground transition-colors hover:text-foreground",onClick:S,type:"button",children:m?"Copied!":"Click code to copy"})]}),l.jsxs("div",{className:"flex flex-col items-center gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-[12px] text-muted-foreground",children:[l.jsx(oy,{className:"size-3.5 animate-spin"}),"Waiting for authorization…"]}),l.jsx("a",{className:"text-[12px] text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",href:s?.verification_uri_complete,rel:"noopener noreferrer",target:"_blank",children:"Open GitHub again"}),l.jsx("button",{className:"text-[12px] text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",onClick:t,type:"button",children:"Cancel"})]})]})}function Pq({onSaved:e,onBack:t}){const[s,i]=w.useState(""),[a,o]=w.useState(!1),[u,h]=w.useState(null);async function m(f){f.preventDefault();const p=s.trim();if(p){o(!0),h(null);try{await Mj("github.com",p),e()}catch(b){h(b instanceof Error?b.message:String(b))}finally{o(!1)}}}return l.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-6 p-8",children:[l.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[l.jsx("div",{className:"flex size-12 items-center justify-center rounded-xl bg-muted",children:l.jsx(Ok,{className:"size-6 text-muted-foreground"})}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-base font-semibold",children:"Personal Access Token"}),l.jsxs("p",{className:"mt-1 max-w-sm text-[13px] text-muted-foreground",children:["Create a token at"," ",l.jsx("a",{className:"underline underline-offset-2 hover:text-foreground",href:"https://github.com/settings/tokens/new?scopes=repo,workflow",rel:"noopener noreferrer",target:"_blank",children:"github.com/settings/tokens"})," ","with ",l.jsx("code",{className:"rounded bg-muted px-1 py-px text-[11px]",children:"repo"})," and"," ",l.jsx("code",{className:"rounded bg-muted px-1 py-px text-[11px]",children:"workflow"})," scopes."]})]})]}),l.jsxs("form",{className:"flex w-full max-w-sm flex-col gap-3",onSubmit:f=>{m(f)},children:[l.jsx("input",{autoComplete:"off",className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring",onChange:f=>i(f.target.value),placeholder:"ghp_...",spellCheck:!1,type:"password",value:s}),u?l.jsx(it,{variant:"destructive",children:u}):null,l.jsx(re,{disabled:!s.trim()||a,type:"submit",children:a?"Saving…":"Save token"}),t?l.jsx("button",{className:"text-[12px] text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",onClick:t,type:"button",children:"← Back"}):null]})]})}function $q({prs:e,loading:t,error:s,selectedNumber:i,onSelect:a}){return t&&e.length===0?l.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading pull requests…"}):s?l.jsx("div",{className:"p-4 text-[12px] text-red-500",children:s}):e.length===0?l.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"No pull requests found."}):l.jsx("ul",{className:"divide-y divide-border",children:e.map(o=>l.jsx("li",{children:l.jsxs("button",{className:`flex w-full items-start gap-3 px-3 py-2.5 text-left transition-colors hover:bg-muted/60 ${i===o.number?"bg-muted":""}`,onClick:()=>a(o.number),type:"button",children:[l.jsx("span",{className:"mt-0.5 shrink-0",children:l.jsx(Hq,{pr:o})}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block truncate text-[13px] font-medium",children:o.title}),l.jsxs("span",{className:"block text-[11px] text-muted-foreground",children:["#",o.number," · ",o.base.ref," ← ",o.head.ref," · ",o.user.login]})]}),o.draft?l.jsx("span",{className:"shrink-0 rounded border border-border px-1.5 py-px text-[10px] text-muted-foreground",children:"Draft"}):null]})},o.number))})}function Hq({pr:e}){return e.state==="merged"?l.jsx(M4,{className:"size-4 text-purple-500"}):e.state==="closed"?l.jsx(R4,{className:"size-4 text-red-500"}):l.jsx(B4,{className:"size-4 text-emerald-500"})}function Uq({pr:e,diff:t,diffLoading:s,diffError:i}){const[a,o]=w.useState("overview");if(!e)return l.jsx("div",{className:"flex h-full items-center justify-center text-[12px] text-muted-foreground",children:"Select a pull request"});const u=h=>`rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${h?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`;return l.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[l.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] font-semibold",children:e.title}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[l.jsx("button",{className:u(a==="overview"),onClick:()=>o("overview"),type:"button",children:"Overview"}),l.jsx("button",{className:u(a==="diff"),onClick:()=>o("diff"),type:"button",children:"Diff"})]}),l.jsx("a",{"aria-label":"Open on GitHub",className:"shrink-0 rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",href:e.html_url,rel:"noopener noreferrer",target:"_blank",title:"Open on GitHub",children:l.jsx(Jc,{className:"size-3.5"})})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:a==="overview"?l.jsxs("div",{className:"space-y-4 p-4",children:[l.jsxs("div",{className:"flex flex-wrap gap-2 text-[12px]",children:[l.jsx(yc,{label:"State",value:e.state}),l.jsx(yc,{label:"Base",value:e.base.ref}),l.jsx(yc,{label:"Head",value:e.head.ref}),l.jsx(yc,{label:"Author",value:e.user.login}),l.jsx(yc,{label:"Created",value:new Date(e.created_at).toLocaleDateString()})]}),e.body?l.jsx("div",{className:"whitespace-pre-wrap rounded-md border border-border bg-muted/30 p-3 font-mono text-[12px]",children:e.body}):l.jsx("p",{className:"text-[12px] text-muted-foreground italic",children:"No description provided."})]}):s?l.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading diff…"}):i?l.jsx("div",{className:"p-4 text-[12px] text-red-500",children:i}):t?l.jsx(dv,{diff:t}):l.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"No diff available."})})]})}function yc({label:e,value:t}){return l.jsxs("span",{className:"rounded border border-border bg-muted/50 px-2 py-0.5 text-[11px]",children:[l.jsxs("span",{className:"text-muted-foreground",children:[e,": "]}),l.jsx("span",{className:"font-medium",children:t})]})}function Fq({issues:e,loading:t,error:s,selectedNumber:i,onSelect:a}){return t&&e.length===0?l.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading issues…"}):s?l.jsx("div",{className:"p-4 text-[12px] text-red-500",children:s}):e.length===0?l.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"No issues found."}):l.jsx("ul",{className:"divide-y divide-border",children:e.map(o=>l.jsx("li",{children:l.jsxs("button",{className:`flex w-full items-start gap-3 px-3 py-2.5 text-left transition-colors hover:bg-muted/60 ${i===o.number?"bg-muted":""}`,onClick:()=>a(o.number),type:"button",children:[l.jsx(VA,{className:`mt-0.5 size-4 shrink-0 ${o.state==="open"?"text-emerald-500":"text-red-500"}`}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block truncate text-[13px] font-medium",children:o.title}),l.jsxs("span",{className:"block text-[11px] text-muted-foreground",children:["#",o.number," · ",o.user.login," · ",o.comments," comment",o.comments!==1?"s":""]})]}),o.labels.length>0?l.jsx("span",{className:"flex shrink-0 flex-wrap gap-1",children:o.labels.slice(0,3).map(u=>l.jsx("span",{className:"rounded-full px-1.5 py-px text-[10px] font-medium text-white",style:{backgroundColor:`#${u.color}`},children:u.name},u.name))}):null]})},o.number))})}function Vq({issue:e,comments:t,commentsLoading:s,commentError:i,submitting:a,onAddComment:o}){const[u,h]=w.useState("");if(!e)return l.jsx("div",{className:"flex h-full items-center justify-center text-[12px] text-muted-foreground",children:"Select an issue"});async function m(f){f.preventDefault();const p=u.trim();p&&(await o(p),h(""))}return l.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[l.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] font-semibold",children:e.title}),l.jsx("a",{"aria-label":"Open on GitHub",className:"shrink-0 rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",href:e.html_url,rel:"noopener noreferrer",target:"_blank",children:l.jsx(Jc,{className:"size-3.5"})})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:l.jsxs("div",{className:"space-y-3 p-4",children:[l.jsxs("div",{className:"flex flex-wrap gap-2 text-[12px]",children:[l.jsxs("span",{className:"rounded border border-border bg-muted/50 px-2 py-0.5 text-[11px]",children:[l.jsx("span",{className:"text-muted-foreground",children:"Author: "}),l.jsx("span",{className:"font-medium",children:e.user.login})]}),l.jsxs("span",{className:"rounded border border-border bg-muted/50 px-2 py-0.5 text-[11px]",children:[l.jsx("span",{className:"text-muted-foreground",children:"Opened: "}),l.jsx("span",{className:"font-medium",children:new Date(e.created_at).toLocaleDateString()})]}),e.labels.map(f=>l.jsx("span",{className:"rounded-full px-2 py-0.5 text-[10px] font-medium text-white",style:{backgroundColor:`#${f.color}`},children:f.name},f.name))]}),e.body?l.jsx("div",{className:"whitespace-pre-wrap rounded-md border border-border bg-muted/30 p-3 font-mono text-[12px]",children:e.body}):l.jsx("p",{className:"text-[12px] text-muted-foreground italic",children:"No description provided."}),s?l.jsx("p",{className:"text-[12px] text-muted-foreground",children:"Loading comments…"}):l.jsx("div",{className:"space-y-2",children:t.map(f=>l.jsxs("div",{className:"rounded-md border border-border bg-muted/20 p-3",children:[l.jsxs("div",{className:"mb-1 flex items-baseline gap-2",children:[l.jsx("span",{className:"text-[11px] font-semibold",children:f.user.login}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:new Date(f.created_at).toLocaleDateString()})]}),l.jsx("p",{className:"whitespace-pre-wrap font-mono text-[12px]",children:f.body})]},f.id))})]})}),l.jsx("div",{className:"shrink-0 border-t border-border p-3",children:l.jsxs("form",{className:"flex flex-col gap-2",onSubmit:f=>{m(f)},children:[l.jsx("textarea",{className:"w-full resize-none rounded-md border border-border bg-background px-3 py-2 font-mono text-[12px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring",onChange:f=>h(f.target.value),placeholder:"Add a comment…",rows:3,value:u}),i?l.jsx(it,{variant:"destructive",children:i}):null,l.jsx(re,{className:"self-end",disabled:!u.trim()||a,size:"sm",type:"submit",children:a?"Posting…":"Comment"})]})})]})}function qq(e){const[t,s]=w.useState([]),[i,a]=w.useState(!0),[o,u]=w.useState(null);function h(){let m=!0;return a(!0),u(null),Ij().then(f=>{m&&s(f)}).catch(f=>{m&&u(f instanceof Error?f.message:String(f))}).finally(()=>{m&&a(!1)}),()=>{m=!1}}return w.useEffect(h,[e]),{runs:t,loading:i,error:o,refresh:h}}function Gq(){const{runs:e,loading:t,error:s,refresh:i}=qq();return l.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[l.jsx("h2",{className:"text-[13px] font-semibold",children:"Workflow Runs"}),l.jsxs(re,{disabled:t,onClick:()=>{i()},size:"sm",type:"button",variant:"outline",children:[l.jsx(eu,{className:`mr-1 size-3.5 ${t?"animate-spin":""}`}),"Refresh"]})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:s?l.jsx("div",{className:"p-4 text-[12px] text-red-500",children:s}):t&&e.length===0?l.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading workflow runs…"}):e.length===0?l.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"No workflow runs found."}):l.jsx("ul",{className:"divide-y divide-border",children:e.map(a=>l.jsx("li",{children:l.jsxs("a",{className:"flex items-center gap-3 px-3 py-2.5 transition-colors hover:bg-muted/60",href:a.html_url,rel:"noopener noreferrer",target:"_blank",children:[l.jsx(Kq,{run:a}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block truncate text-[13px] font-medium",children:a.name}),l.jsxs("span",{className:"block text-[11px] text-muted-foreground",children:["#",a.run_number," · ",a.head_branch," · ",a.event," ·"," ",new Date(a.created_at).toLocaleDateString()]})]}),l.jsx(Wq,{run:a})]})},a.id))})})]})}function Kq({run:e}){return e.status==="in_progress"||e.status==="queued"?l.jsx(ry,{className:"size-4 shrink-0 animate-pulse text-amber-400"}):e.conclusion==="success"?l.jsx(kk,{className:"size-4 shrink-0 text-emerald-500"}):e.conclusion==="failure"||e.conclusion==="timed_out"?l.jsx(GA,{className:"size-4 shrink-0 text-red-500"}):l.jsx(ry,{className:"size-4 shrink-0 text-zinc-400"})}function Wq({run:e}){const t=e.status==="completed"?e.conclusion??"completed":e.status,s=t==="success"?"border-emerald-200 bg-emerald-100 text-emerald-800 dark:border-emerald-400/30 dark:bg-emerald-500/15 dark:text-emerald-300":t==="failure"||t==="timed_out"?"border-red-200 bg-red-100 text-red-800 dark:border-red-400/30 dark:bg-red-500/15 dark:text-red-300":t==="in_progress"||t==="queued"?"border-amber-200 bg-amber-100 text-amber-800 dark:border-amber-400/30 dark:bg-amber-500/15 dark:text-amber-300":"border-border bg-muted/50 text-muted-foreground";return l.jsx("span",{className:`shrink-0 rounded border px-1.5 py-px text-[10px] font-medium ${s}`,children:t})}function Yq(){const{configured:e,deviceFlowAvailable:t,loading:s,refresh:i}=Oq();return s?l.jsx("div",{className:"flex h-full items-center justify-center text-[12px] text-muted-foreground",children:"Loading…"}):e?l.jsx(Xq,{}):l.jsx(zq,{deviceFlowAvailable:t,onSaved:i})}function Xq(){const[e,t]=w.useState("prs"),[s,i]=w.useState("open"),[a,o]=w.useState("open"),[u,h]=w.useState(!1),m=Lq(s),f=Bq(a),p=x=>`rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${x?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,b=x=>`rounded px-1.5 py-px text-[10px] transition-colors ${x?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`;return l.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{className:p(e==="prs"),onClick:()=>t("prs"),type:"button",children:"Pull Requests"}),l.jsx("button",{className:p(e==="issues"),onClick:()=>t("issues"),type:"button",children:"Issues"}),l.jsx("button",{className:p(e==="actions"),onClick:()=>t("actions"),type:"button",children:"Actions"})]}),e==="prs"?l.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[l.jsx("button",{className:b(s==="open"),onClick:()=>i("open"),type:"button",children:"Open"}),l.jsx("button",{className:b(s==="closed"),onClick:()=>i("closed"),type:"button",children:"Closed"}),l.jsx(re,{className:"ml-1",onClick:()=>h(!0),size:"sm",type:"button",variant:"outline",children:"New PR"})]}):e==="issues"?l.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[l.jsx("button",{className:b(a==="open"),onClick:()=>o("open"),type:"button",children:"Open"}),l.jsx("button",{className:b(a==="closed"),onClick:()=>o("closed"),type:"button",children:"Closed"})]}):null]}),u?l.jsx(Zq,{onCreated:()=>{h(!1),m.refresh()},onCancel:()=>h(!1)}):l.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e==="prs"?l.jsxs("div",{className:"grid h-full min-h-0 grid-cols-2 divide-x divide-border",children:[l.jsx("div",{className:"min-h-0 overflow-auto",children:l.jsx($q,{error:m.error,loading:m.loading,onSelect:m.setSelectedNumber,prs:m.prs,selectedNumber:m.selectedNumber})}),l.jsx(Uq,{diff:m.diff,diffError:m.diffError,diffLoading:m.diffLoading,pr:m.selectedPR})]}):e==="issues"?l.jsxs("div",{className:"grid h-full min-h-0 grid-cols-2 divide-x divide-border",children:[l.jsx("div",{className:"min-h-0 overflow-auto",children:l.jsx(Fq,{error:f.error,issues:f.issues,loading:f.loading,onSelect:f.setSelectedNumber,selectedNumber:f.selectedNumber})}),l.jsx(Vq,{commentError:f.commentError,comments:f.comments,commentsLoading:f.commentsLoading,issue:f.selectedIssue,onAddComment:f.addComment,submitting:f.submitting})]}):l.jsx(Gq,{})})]})}function Zq({onCreated:e,onCancel:t}){const[s,i]=w.useState(""),[a,o]=w.useState(""),[u,h]=w.useState(""),[m,f]=w.useState("main"),[p,b]=w.useState(!1),[x,_]=w.useState(!1),[y,S]=w.useState(null);async function C(T){if(T.preventDefault(),!(!s.trim()||!u.trim()||!m.trim())){_(!0),S(null);try{await Dj({title:s.trim(),body:a.trim()||void 0,head:u.trim(),base:m.trim(),draft:p}),e()}catch(N){S(N instanceof Error?N.message:String(N))}finally{_(!1)}}}const E="w-full rounded-md border border-border bg-background px-3 py-2 text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring";return l.jsxs("form",{className:"flex flex-col gap-3 overflow-auto p-4",onSubmit:T=>{C(T)},children:[l.jsx("h3",{className:"text-[13px] font-semibold",children:"New Pull Request"}),l.jsx("input",{className:E,onChange:T=>i(T.target.value),placeholder:"Title",required:!0,value:s}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsx("input",{className:E,onChange:T=>h(T.target.value),placeholder:"Head branch",required:!0,value:u}),l.jsx("input",{className:E,onChange:T=>f(T.target.value),placeholder:"Base branch (e.g. main)",required:!0,value:m})]}),l.jsx("textarea",{className:`${E} resize-none`,onChange:T=>o(T.target.value),placeholder:"Description (optional)",rows:5,value:a}),l.jsxs("label",{className:"flex items-center gap-2 text-[12px]",children:[l.jsx("input",{checked:p,className:"size-3.5",onChange:T=>b(T.target.checked),type:"checkbox"}),"Create as draft"]}),y?l.jsx(it,{variant:"destructive",children:y}):null,l.jsxs("div",{className:"flex gap-2",children:[l.jsx(re,{disabled:x,type:"submit",children:x?"Creating…":"Create PR"}),l.jsx(re,{onClick:t,type:"button",variant:"outline",children:"Cancel"})]})]})}function Qq({data:e}){const{insertPath:t}=Ls(),[s,i]=w.useState("changes"),[a,o]=w.useState("changes"),[u,h]=w.useState(e.git.status?.files[0]?.path??""),[m,f]=w.useState(""),[p,b]=w.useState([]),[x,_]=w.useState(null),[y,S]=w.useState(""),[C,E]=w.useState(null),[T,N]=w.useState(0),[M,R]=w.useState(null),[z,L]=w.useState(()=>new Set),j=e.git.status?.files??[],H=w.useMemo(()=>{const ne=new Set(j.map(we=>we.path)),fe=[...z].filter(we=>!ne.has(we)).sort().map(we=>({path:we,index:" ",workingTree:"M"}));return[...j,...fe]},[j,z]),P=w.useMemo(()=>H.map(ne=>ne.path),[H]),F=w.useMemo(()=>PH(y),[y]);w.useEffect(()=>{const ne=H[0]?.path??"";h(fe=>fe&&H.some(we=>we.path===fe)?fe:ne)},[H]),w.useEffect(()=>{if(s!=="all"||p.length>0)return;let ne=!0;return _(null),yj().then(fe=>{ne&&b(fe)}).catch(fe=>{ne&&_(fe instanceof Error?fe.message:String(fe))}),()=>{ne=!1}},[s,p.length]),w.useEffect(()=>{if(!u){S("");return}let ne=!0;return E(null),Cj(u).then(fe=>{ne&&(S(fe),N(0),R(null))}).catch(fe=>{ne&&E(fe instanceof Error?fe.message:String(fe))}),()=>{ne=!1}},[u]);function K(ne){N(0),R(null),h(ne)}function Y(){const ne=fq({activeHunkIndex:T,filePaths:P,hunkCount:F.hunks,pendingNextFilePath:M,selectedFile:u});ne.kind==="hunk"?(R(null),N(ne.activeHunkIndex)):ne.kind==="confirm-next-file"?R(ne.filePath):ne.kind==="file"?K(ne.filePath):R(null)}function Q(){if(R(null),T>0){N(we=>we-1);return}const ne=H.findIndex(we=>we.path===u),fe=H[ne-1];fe&&K(fe.path)}const q=H.findIndex(ne=>ne.path===u),O=!!(F.hunks&&T<F.hunks-1||H[q+1]),X=!!(T>0||H[q-1]),Z=M?`End of file. Click Next again to open ${M}.`:null,V=ne=>`rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${ne?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,$=ne=>`flex-1 px-2 py-0.5 text-[11px] font-medium transition-colors ${ne?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,D=w.useMemo(()=>{const ne=new Set(H.map(fe=>fe.path));for(const fe of z)ne.add(fe);return ne},[H,z]);if(!e.git.selectedRepository)return l.jsx(Jq,{});function W(){m&&(i("changes"),o("changes"),K(m))}function he(ne){L(fe=>new Set(fe).add(ne)),f(ne),i("changes"),o("changes"),K(ne)}function le(ne){f(ne),i("all")}function me(ne){ne&&t(lu(e.git.cwd,ne))}return l.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-card/85",children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/95 px-3 py-1",children:[l.jsx("button",{type:"button",className:V(s==="changes"),onClick:()=>i("changes"),children:"Changes"}),l.jsx("button",{type:"button","aria-label":"Open all tracked files",className:V(s==="all"),onClick:()=>i("all"),children:"All files"}),l.jsx("button",{type:"button",className:V(s==="graph"),onClick:()=>i("graph"),children:"Tree"}),l.jsx("button",{type:"button",className:V(s==="largest"),onClick:()=>i("largest"),children:"Largest files"}),l.jsx("button",{type:"button",className:V(s==="github"),onClick:()=>i("github"),children:"GitHub"})]}),l.jsx("div",{className:"min-h-0 flex-1",children:s==="github"?l.jsx(Yq,{}):s==="graph"?l.jsx(kq,{branches:e.git.branches??[]}):s==="largest"?l.jsx(jq,{onOpenFile:le,root:e.git.cwd}):s==="all"?l.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[l.jsx("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:x?l.jsx(it,{variant:"destructive",className:"m-3",children:x}):l.jsx(l2,{branch:e.git.status?.branch||void 0,onSelectFile:f,paths:p,root:e.git.cwd,selectedFile:m,status:H})}),l.jsx(hq,{isModified:D.has(m),onFileSaved:he,onSendToAi:()=>me(m),onViewDiff:W,path:m})]}):l.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[l.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex shrink-0 gap-0.5 border-b border-border bg-card/95 p-1",children:[l.jsx("button",{"aria-label":"Show changed files as a list",className:$(a==="changes"),onClick:()=>o("changes"),type:"button",children:"Changes"}),l.jsx("button",{"aria-label":"Show changed files as a tree",className:$(a==="tree"),onClick:()=>o("tree"),type:"button",children:"Tree"})]}),a==="changes"?l.jsx(FH,{branch:e.git.status?.branch||void 0,error:e.git.error,files:H,selectedFile:u,onSelectFile:K,root:e.git.cwd}):l.jsx(l2,{branch:e.git.status?.branch||void 0,defaultExpandAll:!0,emptyMessage:e.git.error??"No changed files.",onSelectFile:K,paths:P,root:e.git.cwd,selectedFile:u,status:H,title:"Changes"})]}),l.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-card",children:[l.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:u||"Diff"}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[l.jsx("span",{children:"Long rows wrap inside the editor pane."}),F.additions||F.deletions?l.jsxs("span",{className:"flex items-center gap-1 font-mono",children:[l.jsxs("span",{className:"text-emerald-700",children:["+",F.additions]}),l.jsxs("span",{className:"text-red-700",children:["-",F.deletions]})]}):null]})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[Z?l.jsx("span",{className:"max-w-72 truncate rounded border border-amber-200 bg-amber-50 px-2 py-1 text-[11px] text-amber-900",children:Z}):null,l.jsxs(re,{disabled:!u||!X,onClick:Q,size:"sm",type:"button",variant:"outline",children:[l.jsx(yk,{}),"Previous"]}),l.jsxs(re,{disabled:!u||!O,onClick:Y,size:"sm",type:"button",variant:"outline",children:[l.jsx(wA,{}),"Next"]}),l.jsx(re,{"aria-label":"Send selected file to AI input",className:"size-8",disabled:!u,onClick:()=>me(u),size:"icon",title:"Send selected file path to AI input",type:"button",variant:"outline",children:l.jsx(ci,{className:"size-4"})})]})]}),l.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:C?l.jsx("div",{className:"p-4",children:l.jsx(it,{variant:"destructive",children:C})}):u?l.jsx(dv,{activeHunkIndex:T,diff:y||"No unstaged diff for this file."}):l.jsx("div",{className:"p-4",children:l.jsx(it,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a changed file to inspect its diff."})})})]})]})})]})}function Jq(){return l.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:l.jsxs("div",{className:"max-w-sm",children:[l.jsx(x4,{className:"mx-auto size-8 text-muted-foreground/50"}),l.jsx("p",{className:"mt-3 text-sm font-medium",children:"No Git project registered"}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Add a folder that is a Git worktree to review changes, browse files, and inspect history. Use the project picker in the header to add one."})]})})}function eG({initialPath:e,onSelect:t,selectedPath:s}){const[i,a]=w.useState(e),[o,u]=w.useState(null),[h,m]=w.useState(null),[f,p]=w.useState(!1),b=tG(o);return w.useEffect(()=>{a(e)},[e]),w.useEffect(()=>{let x=!0;return p(!0),m(null),Gk(i).then(_=>{x&&(u(_),t(_.path))}).catch(_=>{x&&m(_ instanceof Error?_.message:String(_))}).finally(()=>{x&&p(!1)}),()=>{x=!1}},[i,t]),l.jsxs("div",{className:"rounded-md border border-border bg-background",children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-border p-2",children:[b?l.jsx(re,{"aria-label":"Open parent folder",onClick:()=>o&&a(o.parent),size:"icon",type:"button",variant:"ghost",children:l.jsx(Yn,{className:"rotate-90"})}):null,l.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:o?.path??i}),f?l.jsx(Os,{className:"size-4 animate-spin text-muted-foreground"}):null]}),l.jsxs("div",{className:"max-h-56 overflow-auto p-1",children:[h?l.jsx(it,{variant:"destructive",className:"m-1",children:h}):null,!h&&o?.entries.length===0?l.jsx(it,{variant:"muted",className:"m-1 text-center",children:"No folders here."}):null,o?.entries.map(x=>l.jsxs(re,{className:de("h-8 w-full justify-start rounded-sm px-2 text-left",s===x.path&&"bg-muted"),onClick:()=>a(x.path),title:x.path,type:"button",variant:"ghost",children:[l.jsx(Ka,{className:"text-accent"}),l.jsx("span",{className:"truncate",children:x.name})]},x.path))]})]})}function tG(e){return!!(e&&e.parent!==e.path)}function pk(e){return e.split(/[\\/]/).filter(Boolean).pop()??"project"}function sG({data:e,onRefresh:t}){const[s,i]=w.useState(!1),[a,o]=w.useState(e.git.cwd),[u,h]=w.useState(null),[m,f]=w.useState(!1),[p,b]=w.useState(e.git.cwd),x=w.useRef(null),_=e.git.selectedRepository,y=_?.name??(e.git.cwd?pk(e.git.cwd):"Add Git project"),{error:S,success:C}=Bs(),E=iG({gitCwd:e.git.cwd});w.useEffect(()=>{o(e.git.cwd),b(e.git.cwd)},[e.git.cwd]),w.useEffect(()=>{if(!s)return;function L(j){x.current&&j.target instanceof Node&&!x.current.contains(j.target)&&i(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[s]);async function T(L){try{await pn("/api/git/select",{name:L}),i(!1),await t(),C(`Switched to ${L}.`)}catch(j){S(j instanceof Error?j.message:String(j))}}async function N(L){const j=L.trim();if(!nG(j)){const H="Please add an absolute path. Paths beginning with ~ are not expanded here.";return h(H),S(H),!1}try{const H=pk(j);return await pn("/api/git/repositories",{name:H,path:j}),h(null),await t(),C(`Added Git project ${H}.`),!0}catch(H){const P=H instanceof Error?H.message:String(H);return h(P),S(P),!1}}async function M(L){try{await Ej(L),await t(),C(`Removed Git project ${L}.`)}catch(j){S(j instanceof Error?j.message:String(j))}}async function R(L){L.preventDefault(),await N(a)&&i(!1)}function z(){h(null),b(E.selectedPath),f(!0)}return l.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:x,children:[l.jsxs(re,{className:"max-w-[220px] justify-start gap-2 rounded-md border-border bg-card",onClick:()=>i(L=>!L),size:"sm",type:"button",variant:"outline",children:[l.jsx(Ka,{className:"text-muted-foreground"}),l.jsx("span",{className:"truncate",children:y}),l.jsx(Yn,{className:de("ml-auto transition-transform",s&&"rotate-180")})]}),l.jsx(re,{"aria-label":"Add Git project",onClick:z,size:"sm",type:"button",variant:"outline",children:l.jsx(mn,{})}),s?l.jsxs("div",{className:"absolute right-0 top-10 z-50 w-[min(380px,calc(100vw-2rem))] overflow-hidden rounded-lg border border-border bg-card shadow-lg",children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[l.jsx(r4,{className:"size-3.5 text-muted-foreground"}),l.jsx("div",{className:"text-xs font-semibold",children:"Git Projects"}),l.jsx($e,{className:"ml-auto h-5 px-1.5 text-[10px]",variant:"outline",children:e.config.gitRepositories.length})]}),l.jsx("div",{className:"max-h-72 overflow-auto",children:e.config.gitRepositories.length?l.jsx("div",{className:"divide-y divide-border",children:e.config.gitRepositories.map(L=>{const j=L.name===_?.name;return l.jsxs("div",{className:de("group grid w-full grid-cols-[1fr_auto_auto] items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted",j&&"bg-muted/70"),children:[l.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{T(L.name)},type:"button",children:[l.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:L.name}),l.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:L.path})]}),j?l.jsx(il,{className:"size-3.5"}):l.jsx("span",{className:"size-3.5"}),l.jsx(re,{"aria-label":`Remove ${L.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{M(L.name)},size:"icon",title:`Remove ${L.name}`,type:"button",variant:"ghost",children:l.jsx(rl,{className:"size-3.5 text-destructive"})})]},L.name)})}):l.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved Git projects yet."})}),l.jsxs("div",{className:"border-t border-border bg-muted/20 p-2",children:[l.jsxs("form",{className:"flex gap-1.5",onSubmit:R,children:[l.jsx(et,{"aria-label":"Paste absolute path",className:"h-7 flex-1 px-2 font-mono text-[11px]",onChange:L=>{o(L.target.value),h(null)},placeholder:"/absolute/path",value:a}),l.jsxs(re,{className:"h-7 px-2 text-[11px]",size:"sm",type:"submit",children:[l.jsx(mn,{className:"size-3"}),"Add"]}),l.jsx(re,{"aria-label":"Browse and add Git project",className:"h-7 px-2",onClick:z,size:"sm",type:"button",variant:"outline",children:l.jsx(S4,{className:"size-3"})})]}),u?l.jsx("div",{className:"mt-1.5 truncate text-[10px] text-destructive",children:u}):null]})]}):null,m?l.jsx(rG,{confirmLabel:E.confirmLabel,errorMessage:u,initialPath:E.initialPath,selectedPath:p,title:"Add Git Project",onCancel:()=>f(!1),onSelect:b,onUse:async()=>{await N(p)&&(f(!1),i(!1))}}):null]})}function nG(e){return e.startsWith("/")}function iG({gitCwd:e}){return{confirmLabel:"Add Git project",initialPath:e,selectedPath:e}}function rG({confirmLabel:e="Use this folder",errorMessage:t,initialPath:s,onCancel:i,onSelect:a,onUse:o,selectedPath:u,title:h="Choose Git Project Folder"}){return ou.createPortal(l.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",children:l.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-border bg-card p-4 shadow-xl",children:[l.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[l.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg border border-border bg-background",children:l.jsx(Ka,{className:"size-4"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"text-sm font-semibold",children:h}),l.jsx("div",{className:"truncate font-mono text-xs text-muted-foreground",children:u})]}),l.jsx(re,{"aria-label":"Close folder picker",onClick:i,size:"icon",variant:"ghost",children:l.jsx(Js,{})})]}),l.jsx(eG,{initialPath:s,onSelect:a,selectedPath:u}),t?l.jsx("div",{className:"mt-3 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:t}):null,l.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[l.jsx(re,{onClick:i,type:"button",variant:"outline",children:"Cancel"}),l.jsx(re,{onClick:()=>{o()},type:"button",children:e})]})]})}),document.body)}function aG({branches:e,currentBranch:t,disabled:s,onRefresh:i}){const[a,o]=w.useState(!1),[u,h]=w.useState(""),[m,f]=w.useState(null),[p,b]=w.useState(null),[x,_]=w.useState(null),y=e.filter(M=>!M.remote),S=e.filter(M=>M.remote);async function C(M,R){f(M),_(null),b(null);try{await R(),await i()}catch(z){_(z instanceof Error?z.message:String(z))}finally{f(null)}}async function E(M){await C(`switch:${M}`,async()=>{await pn("/api/git/branches/switch",{name:M}),o(!1)})}async function T(){await C("fetch",async()=>{await pn("/api/git/fetch",{}),b("Fetched latest branch refs.")})}async function N(M){M.preventDefault();const R=u.trim();if(!R){_("Branch name is required.");return}await C("create",async()=>{await pn("/api/git/branches",{name:R}),h(""),o(!1)})}return l.jsxs("div",{className:"fixed bottom-12 right-4 z-50 flex items-end",children:[a?l.jsxs("div",{"aria-label":"Switch Git branch",className:"mb-11 w-[min(460px,calc(100vw-2rem))] rounded-lg border border-border bg-card shadow-xl",role:"dialog",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border p-3",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx(Wn,{className:"size-4 text-muted-foreground"}),l.jsx("span",{className:"truncate text-sm font-semibold",children:t||"Branches"})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[l.jsx(re,{"aria-label":"Fetch branches",disabled:s||m!==null,onClick:()=>{T()},size:"icon",title:"Fetch branches",type:"button",variant:"ghost",children:l.jsx(eu,{className:de(m==="fetch"&&"animate-spin")})}),l.jsx(re,{"aria-label":"Close branch dialog",onClick:()=>o(!1),size:"icon",type:"button",variant:"ghost",children:l.jsx(Js,{})})]})]}),l.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?l.jsxs(l.Fragment,{children:[l.jsx(gk,{branches:y,busy:m!==null,disabled:s,label:"Local",onSwitch:E}),l.jsx(gk,{branches:S,busy:m!==null,disabled:s,label:"Remote",onSwitch:E})]}):l.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No branches found."})}),l.jsxs("div",{className:"border-t border-border p-3",children:[l.jsxs("form",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",onSubmit:N,children:[l.jsx(et,{"aria-label":"New branch name",disabled:s||m!==null,onChange:M=>{h(M.target.value),_(null),b(null)},placeholder:"feature/new-work",value:u}),l.jsxs(re,{disabled:s||m!==null,type:"submit",children:[l.jsx(O4,{}),"Create"]})]}),x||p?l.jsx(it,{className:"mt-3 px-3 py-2 text-xs",variant:x?"destructive":"muted",children:x??p}):null]})]}):null,l.jsxs(re,{className:"h-8 max-w-[260px] gap-2 rounded-md shadow-lg",disabled:s,onClick:()=>o(M=>!M),size:"sm",title:"Switch Git branch",type:"button",variant:"default",children:[l.jsx(Wn,{className:"size-4"}),l.jsx("span",{className:"truncate font-mono text-xs",children:t||"No branch"}),l.jsx(Yn,{className:de("size-4 transition-transform",a&&"rotate-180")})]})]})}function gk({branches:e,busy:t,disabled:s,label:i,onSwitch:a}){return l.jsxs("section",{children:[l.jsx("div",{className:"border-b border-border bg-muted/60 px-3 py-1.5 text-[11px] font-semibold uppercase text-muted-foreground",children:i}),e.length?e.map(o=>l.jsxs("button",{className:de("grid w-full grid-cols-[1fr_auto] items-center gap-2 border-b border-border px-3 py-2 text-left text-sm last:border-b-0 hover:bg-muted",o.current&&"bg-muted/70"),disabled:s||t||o.current,onClick:()=>{a(o.name)},type:"button",children:[l.jsxs("span",{className:"min-w-0",children:[l.jsx("span",{className:"block truncate font-medium",children:o.name}),o.upstream?l.jsxs("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:["tracks ",o.upstream]}):null]}),l.jsx($e,{variant:o.current?"success":o.remote?"outline":"secondary",children:o.current?"current":o.remote?"remote":"local"})]},`${o.remote?"remote":"local"}:${o.name}`)):l.jsxs("div",{className:"border-b border-border px-3 py-3 text-sm text-muted-foreground",children:["No ",i.toLowerCase()," branches."]})]})}const n5="nomoreide-theme-choice";function oG(){if(typeof window>"u")return"dark";const e=window.localStorage.getItem(n5);return e==="light"||e==="dark"?e:"dark"}function lG(e){const t=document.documentElement;t.classList.toggle("dark",e==="dark"),t.style.colorScheme=e}function cG(){const[e,t]=w.useState(()=>oG()),s=w.useRef(null);w.useEffect(()=>{lG(e),window.localStorage.setItem(n5,e)},[e]);const i=w.useCallback(()=>{const a=e==="dark"?"light":"dark",o=s.current,u=document;if(!o||!u.startViewTransition||window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(a);return}const h=o.getBoundingClientRect(),m=h.left+h.width/2,f=h.top+h.height/2,p=Math.hypot(Math.max(m,window.innerWidth-m),Math.max(f,window.innerHeight-f));u.startViewTransition(()=>{t(a)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${m}px ${f}px)`,`circle(${p}px at ${m}px ${f}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},[e]);return l.jsxs("button",{ref:s,onClick:i,title:e==="dark"?"Switch to light mode":"Switch to dark mode","aria-label":"Toggle theme",className:yh(),children:[l.jsx("span",{className:Sh(),children:e==="dark"?l.jsx(FM,{}):l.jsx(iM,{})}),l.jsx("span",{className:wh(),children:"Theme"})]})}function uG(e=!1){return de("group/sidebar hidden h-full shrink-0 overflow-x-hidden overflow-y-auto border-r border-border bg-card/85 py-5 backdrop-blur transition-[width,padding] duration-200 md:flex md:flex-col",e?"w-64 px-4":"w-16 px-2 hover:w-64 hover:px-4")}function dG(e,t=!1){return de("relative grid h-12 grid-cols-[48px_minmax(0,1fr)] items-center justify-start gap-0 overflow-hidden rounded-md px-0 text-[15px] font-medium transition-[background-color,color,width] duration-150",t?"w-full":"w-12 group-hover/sidebar:w-full",e?"bg-primary text-primary-foreground hover:bg-primary/90":"hover:bg-muted")}function hG(e=!1,t=!1){return de("min-w-0 overflow-hidden text-left text-current transition duration-150 whitespace-pre",e?"translate-x-1 opacity-100":"opacity-0 group-hover/sidebar:translate-x-1 group-hover/sidebar:opacity-100",t?"pr-10":"pr-3")}function fG(e=!1){return de("flex size-12 items-center justify-center text-current transition-transform duration-150 [&_svg]:size-5",e?"translate-x-0":"-translate-x-px group-hover/sidebar:translate-x-0")}function mG({docked:e,onToggleDock:t}){return l.jsxs("div",{className:de("mt-auto flex h-10 min-w-0 items-center overflow-hidden border-t border-border/60 text-[11px] text-muted-foreground transition-[height,opacity,width] duration-150",e?"w-full justify-start opacity-100":"w-12 justify-center group-hover/sidebar:w-full group-hover/sidebar:justify-start group-hover/sidebar:opacity-100"),children:[l.jsxs("span",{className:de("flex min-w-0 items-center gap-1.5 overflow-hidden whitespace-pre transition-[opacity,width] duration-150",e?"flex-1 opacity-100":"w-0 flex-none opacity-0 group-hover/sidebar:w-auto group-hover/sidebar:flex-1 group-hover/sidebar:opacity-100"),children:[l.jsx("span",{children:"Made with"}),l.jsx(I4,{"aria-label":"love",className:"size-3 shrink-0 fill-red-500 text-red-500"}),l.jsx("span",{children:"by Robert Wang"}),l.jsx("a",{"aria-label":"Robert Wang on LinkedIn",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-[#0A66C2]",href:"https://www.linkedin.com/in/robert-wang-cs/",rel:"noopener noreferrer",target:"_blank",title:"LinkedIn",children:l.jsx("svg",{"aria-hidden":!0,className:"size-3 fill-current",role:"img",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.063 2.063 0 1 1 0-4.126 2.063 2.063 0 0 1 0 4.126zM7.119 20.452H3.554V9h3.565v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.225 0z"})})})]}),l.jsx("button",{"aria-label":e?"Undock sidebar":"Dock sidebar","aria-pressed":e,className:de("flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground [&_svg]:size-4",e?"ml-auto bg-muted text-foreground":"group-hover/sidebar:ml-auto"),onClick:t,title:e?"Undock sidebar":"Dock sidebar",type:"button",children:e?l.jsx(uM,{}):l.jsx(hM,{})})]})}function pG({className:e}){return l.jsxs("div",{className:de("min-w-0",e),children:[l.jsxs("div",{className:"flex items-baseline gap-1.5",children:[l.jsx("div",{className:"text-sm font-semibold",children:"NoMoreIDE"}),l.jsxs("div",{className:"font-mono text-[10px] text-muted-foreground",children:["v","0.1.45"]})]}),l.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:"127.0.0.1 console"})]})}function gG({syncLocation:e=!0}={}){const[t,s]=w.useState(()=>e?window.location.pathname.startsWith("/agent")?"agent":window.location.pathname.startsWith("/errors")?"errors":window.location.pathname.startsWith("/database")?"database":window.location.pathname.startsWith("/terminal")?"terminal":window.location.pathname.startsWith("/git")?"git":"services":"services"),[i,a]=w.useState(null),[o,u]=w.useState(null),[h,m]=w.useState(null),[f,p]=w.useState(!0),{error:b,success:x}=Bs(),[_,y]=w.useState(()=>window.localStorage.getItem("nomoreide:sidebar-docked")==="true"),S=w.useCallback(async(E={})=>{E.silent||p(!0),m(null);try{a(await qj()),E.notify&&x("Dashboard refreshed.")}catch(T){const N=T instanceof Error?T.message:String(T);m(N),b(N)}finally{p(!1)}},[b,x]);w.useEffect(()=>{S()},[S]),w.useEffect(()=>{function E(){document.visibilityState==="visible"&&S({silent:!0})}const T=window.setInterval(E,5e3);return window.addEventListener("focus",E),document.addEventListener("visibilitychange",E),()=>{window.clearInterval(T),window.removeEventListener("focus",E),document.removeEventListener("visibilitychange",E)}},[t,S]),w.useEffect(()=>{if(!e)return;const E=t==="git"?"/git":t==="agent"?"/agent":t==="errors"?"/errors":t==="database"?"/database":t==="terminal"?"/terminal":"/";window.location.pathname!==E&&window.history.pushState(null,"",E)},[t,e]),w.useEffect(()=>{window.localStorage.setItem("nomoreide:sidebar-docked",String(_))},[_]);const C=w.useMemo(()=>i?Object.values(i.runtime.services).filter(E=>E.state==="running").length:0,[i]);return l.jsx(JL,{children:l.jsxs("div",{className:"h-screen overflow-hidden pb-9",children:[l.jsxs("div",{className:"mx-auto flex h-full max-w-[1500px]",children:[l.jsxs("aside",{className:uG(_),children:[l.jsxs("div",{className:de("grid h-12 grid-cols-[48px_minmax(0,1fr)] items-center overflow-hidden transition-[width] duration-150",_?"w-full":"w-12 group-hover/sidebar:w-full"),children:[l.jsx("div",{className:"flex size-12 items-center justify-center",children:l.jsx("div",{className:"flex size-9 items-center justify-center overflow-hidden rounded-md bg-primary text-primary-foreground",children:l.jsxs("svg",{"aria-label":"NoMoreIDE",className:"size-6",fill:"none",role:"img",viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M5 17C5 13.69 7.69 11 11 11H25L31 17H53C56.31 17 59 19.69 59 23V53C59 56.31 56.31 59 53 59H11C7.69 59 5 56.31 5 53V17Z",fill:"currentColor"}),l.jsx("path",{d:"M22 31L30 39L22 47",stroke:"hsl(var(--primary))",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4.5"}),l.jsx("path",{d:"M36 47H48",stroke:"hsl(var(--primary))",strokeLinecap:"round",strokeWidth:"4.5"})]})})}),l.jsx(pG,{className:de("min-w-0 translate-x-1 overflow-hidden transition-opacity duration-200",_?"opacity-100":"opacity-0 group-hover/sidebar:opacity-100")})]}),l.jsxs("nav",{className:"mt-5 grid flex-1 content-start gap-1",children:[l.jsx(Fo,{active:t==="services",badge:C,docked:_,icon:l.jsx($k,{}),label:"Services",onClick:()=>s("services")}),l.jsx(Fo,{active:t==="git",docked:_,icon:l.jsx(Wn,{}),label:"Git Review",onClick:()=>s("git")}),l.jsx(Fo,{active:t==="errors",docked:_,icon:l.jsx(uh,{}),label:"Error Inbox",onClick:()=>s("errors")}),l.jsx(Fo,{active:t==="database",docked:_,icon:l.jsx(ui,{}),label:"Database",onClick:()=>s("database")}),l.jsx(Fo,{active:t==="terminal",docked:_,icon:l.jsx($M,{}),label:"Terminal",onClick:()=>s("terminal")}),l.jsx(Fo,{active:t==="agent",docked:_,icon:l.jsx(jA,{}),label:"Agent",onClick:()=>s("agent")})]}),l.jsx(mG,{docked:_,onToggleDock:()=>y(E=>!E)})]}),l.jsxs("main",{className:"flex h-full min-w-0 flex-1 flex-col px-0 py-0",children:[l.jsxs("header",{className:de("relative z-40 flex shrink-0 flex-wrap items-center justify-between gap-3 border border-border bg-card/90 px-4 py-3 backdrop-blur","border-x-0 border-t-0 border-b"),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(mM,{className:"size-4 text-muted-foreground md:hidden"}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:t==="git"?"Git Review":t==="agent"?"Agent":t==="errors"?"Error Inbox":t==="database"?"Database":t==="terminal"?"Terminal":"Services"}),l.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:i?.git.selectedRepository?.name??i?.git.cwd??"Local workspace"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[h?l.jsx($e,{variant:"danger",children:h}):null,i&&t==="git"?l.jsx(sG,{data:i,onRefresh:S}):null,l.jsxs("div",{"aria-label":"Dashboard quick actions",className:"flex items-center gap-1 rounded-lg border border-border bg-background p-1",role:"group",children:[l.jsxs("button",{"aria-label":"Refresh dashboard",className:yh(),onClick:()=>{S({notify:!0})},title:"Refresh dashboard",type:"button",children:[l.jsx("span",{className:Sh(),children:l.jsx(eu,{className:de(f&&"animate-spin")})}),l.jsx("span",{className:wh(),children:"Refresh"})]}),l.jsx(cG,{}),l.jsxs("a",{"aria-label":"Open NoMoreIDE documentation",className:yh(),href:"https://www.nomoreide.com/docs",rel:"noreferrer",target:"_blank",title:"Open NoMoreIDE documentation",children:[l.jsx("span",{className:Sh(),children:l.jsx(AA,{})}),l.jsx("span",{className:wh(),children:"Docs"})]}),i?l.jsx(C9,{data:i}):null]})]})]}),i?l.jsx(jH,{data:i,onOpenService:E=>{u(E),s("services"),S({silent:!0})}}):null,f&&!i?l.jsx(it,{variant:"muted",children:"Loading NoMoreIDE state..."}):null,l.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[i&&t==="services"?l.jsx(TH,{data:i,onRefresh:S,focusService:o,onServiceFocused:()=>u(null)}):null,i&&t==="git"?l.jsx(Qq,{data:i}):null,t==="agent"?l.jsx(t9,{}):null,t==="errors"?l.jsx(uz,{}):null,t==="database"?l.jsx(rz,{}):null,t==="terminal"?l.jsx(zH,{}):null]})]})]}),i&&t==="git"?l.jsx(aG,{branches:i.git.branches,currentBranch:i.git.status?.branch||void 0,disabled:!i.git.status,onRefresh:S}):null,l.jsx(PB,{onOpenAgentPage:t==="agent"?void 0:()=>s("agent"),onOpenService:E=>{u(E),s("services"),S({silent:!0})}})]})})}function Fo({active:e,badge:t,docked:s,icon:i,label:a,onClick:o}){const u=t!==void 0&&t>0;return l.jsxs(re,{"aria-label":a,title:a,className:dG(e,s),variant:"ghost",onClick:o,type:"button",children:[l.jsx("span",{className:fG(s),children:i}),l.jsx("span",{className:hG(s,u),children:a}),t!==void 0&&t>0?l.jsx($e,{appearance:t>0?"solid":"outline",className:de("min-w-6 justify-center px-1.5 font-mono shadow-none",e?"border-primary-foreground/40 bg-primary-foreground/15 text-primary-foreground dark:border-primary-foreground/40 dark:bg-primary-foreground/15 dark:text-primary-foreground":t>0?"":"border-border bg-background text-muted-foreground","absolute right-1.5 top-1.5 h-4 min-w-4 rounded-full px-1 text-[10px] leading-none shadow-none group-hover/sidebar:right-2 group-hover/sidebar:top-1/2 group-hover/sidebar:-translate-y-1/2 group-hover/sidebar:text-xs",s&&"right-2 top-1/2 -translate-y-1/2 text-xs"),size:"small",variant:t>0?"success":"outline",children:t}):null]})}vk.createRoot(document.getElementById("root")).render(l.jsx(w.StrictMode,{children:l.jsx(gG,{})}));export{l as j,w as r};
|