nomoreide 0.1.42 → 0.1.43

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.
@@ -0,0 +1,156 @@
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"]'))s(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"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(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 s(a){if(a.ep)return;a.ep=!0;const o=i(a);fetch(a.href,o)}})();function LT(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wm={exports:{}},rc={};var jx;function BT(){if(jx)return rc;jx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(s,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:s,key:u,ref:a!==void 0?a:null,props:o}}return rc.Fragment=t,rc.jsx=i,rc.jsxs=i,rc}var Dx;function zT(){return Dx||(Dx=1,Wm.exports=BT()),Wm.exports}var c=zT(),Ym={exports:{}},He={};var Ox;function IT(){if(Ox)return He;Ox=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=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"),v=Symbol.iterator;function x(j){return j===null||typeof j!="object"?null:(j=v&&j[v]||j["@@iterator"],typeof j=="function"?j:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function N(j,W,de){this.props=j,this.context=W,this.refs=k,this.updater=de||y}N.prototype.isReactComponent={},N.prototype.setState=function(j,W){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,W,"setState")},N.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function T(){}T.prototype=N.prototype;function R(j,W,de){this.props=j,this.context=W,this.refs=k,this.updater=de||y}var A=R.prototype=new T;A.constructor=R,S(A,N.prototype),A.isPureReactComponent=!0;var O=Array.isArray;function H(){}var L={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function $(j,W,de){var oe=de.ref;return{$$typeof:e,type:j,key:W,ref:oe!==void 0?oe:null,props:de}}function P(j,W){return $(j.type,W,j.props)}function F(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function Z(j){var W={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(de){return W[de]})}var K=/\/+/g;function Q(j,W){return typeof j=="object"&&j!==null&&j.key!=null?Z(""+j.key):W.toString(36)}function q(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(H,H):(j.status="pending",j.then(function(W){j.status==="pending"&&(j.status="fulfilled",j.value=W)},function(W){j.status==="pending"&&(j.status="rejected",j.reason=W)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function D(j,W,de,oe,he){var se=typeof j;(se==="undefined"||se==="boolean")&&(j=null);var fe=!1;if(j===null)fe=!0;else switch(se){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(j.$$typeof){case e:case t:fe=!0;break;case p:return fe=j._init,D(fe(j._payload),W,de,oe,he)}}if(fe)return he=he(j),fe=oe===""?"."+Q(j,0):oe,O(he)?(de="",fe!=null&&(de=fe.replace(K,"$&/")+"/"),D(he,W,de,"",function(Ze){return Ze})):he!=null&&(F(he)&&(he=P(he,de+(he.key==null||j&&j.key===he.key?"":(""+he.key).replace(K,"$&/")+"/")+fe)),W.push(he)),1;fe=0;var we=oe===""?".":oe+":";if(O(j))for(var xe=0;xe<j.length;xe++)oe=j[xe],se=we+Q(oe,xe),fe+=D(oe,W,de,se,he);else if(xe=x(j),typeof xe=="function")for(j=xe.call(j),xe=0;!(oe=j.next()).done;)oe=oe.value,se=we+Q(oe,xe++),fe+=D(oe,W,de,se,he);else if(se==="object"){if(typeof j.then=="function")return D(q(j),W,de,oe,he);throw W=String(j),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return fe}function Y(j,W,de){if(j==null)return j;var oe=[],he=0;return D(j,oe,"","",function(se){return W.call(de,se,he++)}),oe}function X(j){if(j._status===-1){var W=j._result;W=W(),W.then(function(de){(j._status===0||j._status===-1)&&(j._status=1,j._result=de)},function(de){(j._status===0||j._status===-1)&&(j._status=2,j._result=de)}),j._status===-1&&(j._status=0,j._result=W)}if(j._status===1)return j._result.default;throw j._result}var V=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},I={map:Y,forEach:function(j,W,de){Y(j,function(){W.apply(this,arguments)},de)},count:function(j){var W=0;return Y(j,function(){W++}),W},toArray:function(j){return Y(j,function(W){return W})||[]},only:function(j){if(!F(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return He.Activity=b,He.Children=I,He.Component=N,He.Fragment=i,He.Profiler=a,He.PureComponent=R,He.StrictMode=s,He.Suspense=m,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,He.__COMPILER_RUNTIME={__proto__:null,c:function(j){return L.H.useMemoCache(j)}},He.cache=function(j){return function(){return j.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(j,W,de){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var oe=S({},j.props),he=j.key;if(W!=null)for(se in W.key!==void 0&&(he=""+W.key),W)!M.call(W,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&W.ref===void 0||(oe[se]=W[se]);var se=arguments.length-2;if(se===1)oe.children=de;else if(1<se){for(var fe=Array(se),we=0;we<se;we++)fe[we]=arguments[we+2];oe.children=fe}return $(j.type,he,oe)},He.createContext=function(j){return j={$$typeof:u,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:o,_context:j},j},He.createElement=function(j,W,de){var oe,he={},se=null;if(W!=null)for(oe in W.key!==void 0&&(se=""+W.key),W)M.call(W,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(he[oe]=W[oe]);var fe=arguments.length-2;if(fe===1)he.children=de;else if(1<fe){for(var we=Array(fe),xe=0;xe<fe;xe++)we[xe]=arguments[xe+2];he.children=we}if(j&&j.defaultProps)for(oe in fe=j.defaultProps,fe)he[oe]===void 0&&(he[oe]=fe[oe]);return $(j,se,he)},He.createRef=function(){return{current:null}},He.forwardRef=function(j){return{$$typeof:h,render:j}},He.isValidElement=F,He.lazy=function(j){return{$$typeof:p,_payload:{_status:-1,_result:j},_init:X}},He.memo=function(j,W){return{$$typeof:f,type:j,compare:W===void 0?null:W}},He.startTransition=function(j){var W=L.T,de={};L.T=de;try{var oe=j(),he=L.S;he!==null&&he(de,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(H,V)}catch(se){V(se)}finally{W!==null&&de.types!==null&&(W.types=de.types),L.T=W}},He.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},He.use=function(j){return L.H.use(j)},He.useActionState=function(j,W,de){return L.H.useActionState(j,W,de)},He.useCallback=function(j,W){return L.H.useCallback(j,W)},He.useContext=function(j){return L.H.useContext(j)},He.useDebugValue=function(){},He.useDeferredValue=function(j,W){return L.H.useDeferredValue(j,W)},He.useEffect=function(j,W){return L.H.useEffect(j,W)},He.useEffectEvent=function(j){return L.H.useEffectEvent(j)},He.useId=function(){return L.H.useId()},He.useImperativeHandle=function(j,W,de){return L.H.useImperativeHandle(j,W,de)},He.useInsertionEffect=function(j,W){return L.H.useInsertionEffect(j,W)},He.useLayoutEffect=function(j,W){return L.H.useLayoutEffect(j,W)},He.useMemo=function(j,W){return L.H.useMemo(j,W)},He.useOptimistic=function(j,W){return L.H.useOptimistic(j,W)},He.useReducer=function(j,W,de){return L.H.useReducer(j,W,de)},He.useRef=function(j){return L.H.useRef(j)},He.useState=function(j){return L.H.useState(j)},He.useSyncExternalStore=function(j,W,de){return L.H.useSyncExternalStore(j,W,de)},He.useTransition=function(){return L.H.useTransition()},He.version="19.2.6",He}var Lx;function K0(){return Lx||(Lx=1,Ym.exports=IT()),Ym.exports}var E=K0(),Xm={exports:{}},ac={},Zm={exports:{}},Qm={};var Bx;function PT(){return Bx||(Bx=1,(function(e){function t(D,Y){var X=D.length;D.push(Y);e:for(;0<X;){var V=X-1>>>1,I=D[V];if(0<a(I,Y))D[V]=Y,D[X]=I,X=V;else break e}}function i(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var Y=D[0],X=D.pop();if(X!==Y){D[0]=X;e:for(var V=0,I=D.length,j=I>>>1;V<j;){var W=2*(V+1)-1,de=D[W],oe=W+1,he=D[oe];if(0>a(de,X))oe<I&&0>a(he,de)?(D[V]=he,D[oe]=X,V=oe):(D[V]=de,D[W]=X,V=W);else if(oe<I&&0>a(he,X))D[V]=he,D[oe]=X,V=oe;else break e}}return Y}function a(D,Y){var X=D.sortIndex-Y.sortIndex;return X!==0?X:D.id-Y.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,v=3,x=!1,y=!1,S=!1,k=!1,N=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function A(D){for(var Y=i(f);Y!==null;){if(Y.callback===null)s(f);else if(Y.startTime<=D)s(f),Y.sortIndex=Y.expirationTime,t(m,Y);else break;Y=i(f)}}function O(D){if(S=!1,A(D),!y)if(i(m)!==null)y=!0,H||(H=!0,Z());else{var Y=i(f);Y!==null&&q(O,Y.startTime-D)}}var H=!1,L=-1,M=5,$=-1;function P(){return k?!0:!(e.unstable_now()-$<M)}function F(){if(k=!1,H){var D=e.unstable_now();$=D;var Y=!0;try{e:{y=!1,S&&(S=!1,T(L),L=-1),x=!0;var X=v;try{t:{for(A(D),b=i(m);b!==null&&!(b.expirationTime>D&&P());){var V=b.callback;if(typeof V=="function"){b.callback=null,v=b.priorityLevel;var I=V(b.expirationTime<=D);if(D=e.unstable_now(),typeof I=="function"){b.callback=I,A(D),Y=!0;break t}b===i(m)&&s(m),A(D)}else s(m);b=i(m)}if(b!==null)Y=!0;else{var j=i(f);j!==null&&q(O,j.startTime-D),Y=!1}}break e}finally{b=null,v=X,x=!1}Y=void 0}}finally{Y?Z():H=!1}}}var Z;if(typeof R=="function")Z=function(){R(F)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,Q=K.port2;K.port1.onmessage=F,Z=function(){Q.postMessage(null)}}else Z=function(){N(F,0)};function q(D,Y){L=N(function(){D(e.unstable_now())},Y)}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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(D){switch(v){case 1:case 2:case 3:var Y=3;break;default:Y=v}var X=v;v=Y;try{return D()}finally{v=X}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(D,Y){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var X=v;v=D;try{return Y()}finally{v=X}},e.unstable_scheduleCallback=function(D,Y,X){var V=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?V+X:V):X=V,D){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=X+I,D={id:p++,callback:Y,priorityLevel:D,startTime:X,expirationTime:I,sortIndex:-1},X>V?(D.sortIndex=X,t(f,D),i(m)===null&&D===i(f)&&(S?(T(L),L=-1):S=!0,q(O,X-V))):(D.sortIndex=I,t(m,D),y||x||(y=!0,H||(H=!0,Z()))),D},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(D){var Y=v;return function(){var X=v;v=Y;try{return D.apply(this,arguments)}finally{v=X}}}})(Qm)),Qm}var zx;function UT(){return zx||(zx=1,Zm.exports=PT()),Zm.exports}var Jm={exports:{}},Ii={};var Ix;function HT(){if(Ix)return Ii;Ix=1;var e=K0();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 i(){}var s={d:{f:i,r:function(){throw Error(t(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},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 Ii.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Ii.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)},Ii.flushSync=function(m){var f=u.T,p=s.p;try{if(u.T=null,s.p=2,m)return m()}finally{u.T=f,s.p=p,s.d.f()}},Ii.preconnect=function(m,f){typeof m=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,s.d.C(m,f))},Ii.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},Ii.preinit=function(m,f){if(typeof m=="string"&&f&&typeof f.as=="string"){var p=f.as,b=h(p,f.crossOrigin),v=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?s.d.S(m,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:x}):p==="script"&&s.d.X(m,{crossOrigin:b,integrity:v,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Ii.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);s.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&&s.d.M(m)},Ii.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);s.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})}},Ii.preloadModule=function(m,f){if(typeof m=="string")if(f){var p=h(f.as,f.crossOrigin);s.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 s.d.m(m)},Ii.requestFormReset=function(m){s.d.r(m)},Ii.unstable_batchedUpdates=function(m,f){return m(f)},Ii.useFormState=function(m,f,p){return u.H.useFormState(m,f,p)},Ii.useFormStatus=function(){return u.H.useHostTransitionStatus()},Ii.version="19.2.6",Ii}var Px;function K2(){if(Px)return Jm.exports;Px=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(),Jm.exports=HT(),Jm.exports}var Ux;function FT(){if(Ux)return ac;Ux=1;var e=UT(),t=K0(),i=K2();function s(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)r+="&args[]="+encodeURIComponent(arguments[l])}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,l=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(l=r.return),n=r.return;while(n)}return r.tag===3?l: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(s(188))}function f(n){var r=n.alternate;if(!r){if(r=o(n),r===null)throw Error(s(188));return r!==n?null:n}for(var l=n,d=r;;){var g=l.return;if(g===null)break;var _=g.alternate;if(_===null){if(d=g.return,d!==null){l=d;continue}break}if(g.child===_.child){for(_=g.child;_;){if(_===l)return m(g),n;if(_===d)return m(g),r;_=_.sibling}throw Error(s(188))}if(l.return!==d.return)l=g,d=_;else{for(var w=!1,C=g.child;C;){if(C===l){w=!0,l=g,d=_;break}if(C===d){w=!0,d=g,l=_;break}C=C.sibling}if(!w){for(C=_.child;C;){if(C===l){w=!0,l=_,d=g;break}if(C===d){w=!0,d=_,l=g;break}C=C.sibling}if(!w)throw Error(s(189))}}if(l.alternate!==d)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?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,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),R=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function Z(n){return n===null||typeof n!="object"?null:(n=F&&n[F]||n["@@iterator"],typeof n=="function"?n:null)}var K=Symbol.for("react.client.reference");function Q(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===K?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case N:return"Profiler";case k:return"StrictMode";case O:return"Suspense";case H:return"SuspenseList";case $:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case y:return"Portal";case R:return n.displayName||"Context";case T:return(n._context.displayName||"Context")+".Consumer";case A: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 M:r=n._payload,n=n._init;try{return Q(n(r))}catch{}}return null}var q=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},V=[],I=-1;function j(n){return{current:n}}function W(n){0>I||(n.current=V[I],V[I]=null,I--)}function de(n,r){I++,V[I]=n.current,n.current=r}var oe=j(null),he=j(null),se=j(null),fe=j(null);function we(n,r){switch(de(se,r),de(he,n),de(oe,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?tx(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=tx(r),n=ix(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}W(oe),de(oe,n)}function xe(){W(oe),W(he),W(se)}function Ze(n){n.memoizedState!==null&&de(fe,n);var r=oe.current,l=ix(r,n.type);r!==l&&(de(he,n),de(oe,l))}function ot(n){he.current===n&&(W(oe),W(he)),fe.current===n&&(W(fe),tc._currentValue=X)}var lt,Be;function Lt(n){if(lt===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);lt=r&&r[1]||"",Be=-1<l.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+lt+n+Be}var Ts=!1;function ye(n,r){if(!n||Ts)return"";Ts=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(r){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(ie){var te=ie}Reflect.construct(n,[],le)}else{try{le.call()}catch(ie){te=ie}n.call(le.prototype)}}else{try{throw Error()}catch(ie){te=ie}(le=n())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ie){if(ie&&te&&typeof ie.stack=="string")return[ie.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 _=d.DetermineComponentFrameRoot(),w=_[0],C=_[1];if(w&&C){var B=w.split(`
4
+ `),ee=C.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 ne=`
6
+ `+B[d].replace(" at new "," at ");return n.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",n.displayName)),ne}while(1<=d&&0<=g);break}}}finally{Ts=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?Lt(l):""}function St(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 ye(n.type,!1);case 11:return ye(n.type.render,!1);case 1:return ye(n.type,!0);case 31:return Lt("Activity");default:return""}}function Cn(n){try{var r="",l=null;do r+=St(n,l),l=n,n=n.return;while(n);return r}catch(d){return`
7
+ Error generating stack: `+d.message+`
8
+ `+d.stack}}var os=Object.prototype.hasOwnProperty,Yn=e.unstable_scheduleCallback,Xn=e.unstable_cancelCallback,aa=e.unstable_shouldYield,Za=e.unstable_requestPaint,Bt=e.unstable_now,As=e.unstable_getCurrentPriorityLevel,Si=e.unstable_ImmediatePriority,Ms=e.unstable_UserBlockingPriority,Rs=e.unstable_NormalPriority,Qa=e.unstable_LowPriority,fr=e.unstable_IdlePriority,ul=e.log,Ja=e.unstable_setDisableYieldValue,js=null,pi=null;function Nn(n){if(typeof ul=="function"&&Ja(n),pi&&typeof pi.setStrictMode=="function")try{pi.setStrictMode(js,n)}catch{}}var wi=Math.clz32?Math.clz32:eo,dl=Math.log,oa=Math.LN2;function eo(n){return n>>>=0,n===0?32:31-(dl(n)/oa|0)|0}var rt=256,Zn=262144,un=4194304;function Li(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 z(n,r,l){var d=n.pendingLanes;if(d===0)return 0;var g=0,_=n.suspendedLanes,w=n.pingedLanes;n=n.warmLanes;var C=d&134217727;return C!==0?(d=C&~_,d!==0?g=Li(d):(w&=C,w!==0?g=Li(w):l||(l=C&~n,l!==0&&(g=Li(l))))):(C=d&~_,C!==0?g=Li(C):w!==0?g=Li(w):l||(l=d&~n,l!==0&&(g=Li(l)))),g===0?0:r!==0&&r!==g&&(r&_)===0&&(_=g&-g,l=r&-r,_>=l||_===32&&(l&4194048)!==0)?r:g}function re(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function ve(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 Pe(){var n=un;return un<<=1,(un&62914560)===0&&(un=4194304),n}function Nt(n){for(var r=[],l=0;31>l;l++)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,l,d,g,_){var w=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var C=n.entanglements,B=n.expirationTimes,ee=n.hiddenUpdates;for(l=w&~l;0<l;){var ne=31-wi(l),le=1<<ne;C[ne]=0,B[ne]=-1;var te=ee[ne];if(te!==null)for(ee[ne]=null,ne=0;ne<te.length;ne++){var ie=te[ne];ie!==null&&(ie.lane&=-536870913)}l&=~le}d!==0&&Ee(n,d,0),_!==0&&g===0&&n.tag!==0&&(n.suspendedLanes|=_&~(w&~r))}function Ee(n,r,l){n.pendingLanes|=r,n.suspendedLanes&=~r;var d=31-wi(r);n.entangledLanes|=r,n.entanglements[d]=n.entanglements[d]|1073741824|l&261930}function Ie(n,r){var l=n.entangledLanes|=r;for(n=n.entanglements;l;){var d=31-wi(l),g=1<<d;g&r|n[d]&r&&(n[d]|=r),l&=~g}}function qt(n,r){var l=r&-r;return l=(l&42)!==0?1:jt(l),(l&(n.suspendedLanes|r))!==0?0:l}function jt(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 Ds(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function to(){var n=Y.p;return n!==0?n:(n=window.event,n===void 0?32:kx(n.type))}function io(n,r){var l=Y.p;try{return Y.p=n,r()}finally{Y.p=l}}var ls=Math.random().toString(36).slice(2),Gt="__reactFiber$"+ls,Bi="__reactProps$"+ls,mr="__reactContainer$"+ls,hl="__reactEvents$"+ls,cu="__reactListeners$"+ls,no="__reactHandles$"+ls,uu="__reactResources$"+ls,la="__reactMarker$"+ls;function fl(n){delete n[Gt],delete n[Bi],delete n[hl],delete n[cu],delete n[no]}function $i(n){var r=n[Gt];if(r)return r;for(var l=n.parentNode;l;){if(r=l[mr]||l[Gt]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(n=cx(n);n!==null;){if(l=n[Gt])return l;n=cx(n)}return r}n=l,l=n.parentNode}return null}function Os(n){if(n=n[Gt]||n[mr]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function pr(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(s(33))}function gr(n){var r=n[uu];return r||(r=n[uu]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Zt(n){n[la]=!0}var du=new Set,ca={};function Ls(n,r){pe(n,r),pe(n+"Capture",r)}function pe(n,r){for(ca[n]=r,n=0;n<r.length;n++)du.add(r[n])}var je=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={},mt={};function Kt(n){return os.call(mt,n)?!0:os.call(Xe,n)?!1:je.test(n)?mt[n]=!0:(Xe[n]=!0,!1)}function zi(n,r,l){if(Kt(r))if(l===null)n.removeAttribute(r);else{switch(typeof l){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,""+l)}}function dn(n,r,l){if(l===null)n.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+l)}}function Zi(n,r,l,d){if(d===null)n.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(r,l,""+d)}}function Ct(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function hn(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function hu(n,r,l){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,_=d.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return g.call(this)},set:function(w){l=""+w,_.call(this,w)}}),Object.defineProperty(n,r,{enumerable:d.enumerable}),{getValue:function(){return l},setValue:function(w){l=""+w},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function so(n){if(!n._valueTracker){var r=hn(n)?"checked":"value";n._valueTracker=hu(n,r,""+n[r])}}function ml(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var l=r.getValue(),d="";return n&&(d=hn(n)?n.checked?"true":"false":n.value),n=d,n!==l?(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 Gh=/[\n"\\]/g;function Qi(n){return n.replace(Gh,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function pl(n,r,l,d,g,_,w,C){n.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.type=w:n.removeAttribute("type"),r!=null?w==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+Ct(r)):n.value!==""+Ct(r)&&(n.value=""+Ct(r)):w!=="submit"&&w!=="reset"||n.removeAttribute("value"),r!=null?ao(n,w,Ct(r)):l!=null?ao(n,w,Ct(l)):d!=null&&n.removeAttribute("value"),g==null&&_!=null&&(n.defaultChecked=!!_),g!=null&&(n.checked=g&&typeof g!="function"&&typeof g!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.name=""+Ct(C):n.removeAttribute("name")}function ua(n,r,l,d,g,_,w,C){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(n.type=_),r!=null||l!=null){if(!(_!=="submit"&&_!=="reset"||r!=null)){so(n);return}l=l!=null?""+Ct(l):"",r=r!=null?""+Ct(r):l,C||r===n.value||(n.value=r),n.defaultValue=r}d=d??g,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=C?n.checked:!!d,n.defaultChecked=!!d,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.name=w),so(n)}function ao(n,r,l){r==="number"&&ro(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function Ei(n,r,l,d){if(n=n.options,r){r={};for(var g=0;g<l.length;g++)r["$"+l[g]]=!0;for(l=0;l<n.length;l++)g=r.hasOwnProperty("$"+n[l].value),n[l].selected!==g&&(n[l].selected=g),g&&d&&(n[l].defaultSelected=!0)}else{for(l=""+Ct(l),r=null,g=0;g<n.length;g++){if(n[g].value===l){n[g].selected=!0,d&&(n[g].defaultSelected=!0);return}r!==null||n[g].disabled||(r=n[g])}r!==null&&(r.selected=!0)}}function fu(n,r,l){if(r!=null&&(r=""+Ct(r),r!==n.value&&(n.value=r),l==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=l!=null?""+Ct(l):""}function oo(n,r,l,d){if(r==null){if(d!=null){if(l!=null)throw Error(s(92));if(q(d)){if(1<d.length)throw Error(s(93));d=d[0]}l=d}l==null&&(l=""),r=l}l=Ct(r),n.defaultValue=l,d=n.textContent,d===l&&d!==""&&d!==null&&(n.value=d),so(n)}function ze(n,r){if(r){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=r;return}}n.textContent=r}var mu=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,l){var d=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":d?n.setProperty(r,l):typeof l!="number"||l===0||mu.has(r)?r==="float"?n.cssFloat=l:n[r]=(""+l).trim():n[r]=l+"px"}function pt(n,r,l){if(r!=null&&typeof r!="object")throw Error(s(62));if(n=n.style,l!=null){for(var d in l)!l.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)&&l[g]!==d&&Qt(n,g,d)}else for(var _ in r)r.hasOwnProperty(_)&&Qt(n,_,r[_])}function br(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 Bs=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"]]),gl=/^[\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 gl.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function be(){}var Me=null;function Fe(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 Tn(n){var r=Os(n);if(r&&(n=r.stateNode)){var l=n[Bi]||null;e:switch(n=r.stateNode,r.type){case"input":if(pl(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Qi(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var d=l[r];if(d!==n&&d.form===n.form){var g=d[Bi]||null;if(!g)throw Error(s(90));pl(d,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(r=0;r<l.length;r++)d=l[r],d.form===n.form&&ml(d)}break e;case"textarea":fu(n,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&Ei(n,!!l.multiple,r,!1)}}}var bl=!1;function pu(n,r,l){if(bl)return n(r,l);bl=!0;try{var d=n(r);return d}finally{if(bl=!1,(tt!==null||zt!==null)&&(id(),tt&&(r=tt,n=zt,zt=tt=null,Tn(r),n)))for(r=0;r<n.length;r++)Tn(n[r])}}function _l(n,r){var l=n.stateNode;if(l===null)return null;var d=l[Bi]||null;if(d===null)return null;l=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(l&&typeof l!="function")throw Error(s(231,r,typeof l));return l}var zs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kh=!1;if(zs)try{var vl={};Object.defineProperty(vl,"passive",{get:function(){Kh=!0}}),window.addEventListener("test",vl,vl),window.removeEventListener("test",vl,vl)}catch{Kh=!1}var vr=null,Wh=null,gu=null;function i_(){if(gu)return gu;var n,r=Wh,l=r.length,d,g="value"in vr?vr.value:vr.textContent,_=g.length;for(n=0;n<l&&r[n]===g[n];n++);var w=l-n;for(d=1;d<=w&&r[l-d]===g[_-d];d++);return gu=g.slice(n,1<d?1-d:void 0)}function bu(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 _u(){return!0}function n_(){return!1}function Ji(n){function r(l,d,g,_,w){this._reactName=l,this._targetInst=g,this.type=d,this.nativeEvent=_,this.target=w,this.currentTarget=null;for(var C in n)n.hasOwnProperty(C)&&(l=n[C],this[C]=l?l(_):_[C]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?_u:n_,this.isPropagationStopped=n_,this}return b(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=_u)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=_u)},persist:function(){},isPersistent:_u}),r}var da={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vu=Ji(da),xl=b({},da,{view:0,detail:0}),D3=Ji(xl),Yh,Xh,yl,xu=b({},xl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qh,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!==yl&&(yl&&n.type==="mousemove"?(Yh=n.screenX-yl.screenX,Xh=n.screenY-yl.screenY):Xh=Yh=0,yl=n),Yh)},movementY:function(n){return"movementY"in n?n.movementY:Xh}}),s_=Ji(xu),O3=b({},xu,{dataTransfer:0}),L3=Ji(O3),B3=b({},xl,{relatedTarget:0}),Zh=Ji(B3),z3=b({},da,{animationName:0,elapsedTime:0,pseudoElement:0}),I3=Ji(z3),P3=b({},da,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),U3=Ji(P3),H3=b({},da,{data:0}),r_=Ji(H3),F3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$3={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"},V3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function q3(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=V3[n])?!!r[n]:!1}function Qh(){return q3}var G3=b({},xl,{key:function(n){if(n.key){var r=F3[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=bu(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?$3[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qh,charCode:function(n){return n.type==="keypress"?bu(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?bu(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),K3=Ji(G3),W3=b({},xu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),a_=Ji(W3),Y3=b({},xl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qh}),X3=Ji(Y3),Z3=b({},da,{propertyName:0,elapsedTime:0,pseudoElement:0}),Q3=Ji(Z3),J3=b({},xu,{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}),e5=Ji(J3),t5=b({},da,{newState:0,oldState:0}),i5=Ji(t5),n5=[9,13,27,32],Jh=zs&&"CompositionEvent"in window,Sl=null;zs&&"documentMode"in document&&(Sl=document.documentMode);var s5=zs&&"TextEvent"in window&&!Sl,o_=zs&&(!Jh||Sl&&8<Sl&&11>=Sl),l_=" ",c_=!1;function u_(n,r){switch(n){case"keyup":return n5.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function d_(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var lo=!1;function r5(n,r){switch(n){case"compositionend":return d_(r);case"keypress":return r.which!==32?null:(c_=!0,l_);case"textInput":return n=r.data,n===l_&&c_?null:n;default:return null}}function a5(n,r){if(lo)return n==="compositionend"||!Jh&&u_(n,r)?(n=i_(),gu=Wh=vr=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 o_&&r.locale!=="ko"?null:r.data;default:return null}}var o5={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 h_(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!o5[n.type]:r==="textarea"}function f_(n,r,l,d){tt?zt?zt.push(d):zt=[d]:tt=d,r=cd(r,"onChange"),0<r.length&&(l=new vu("onChange","change",null,l,d),n.push({event:l,listeners:r}))}var wl=null,El=null;function l5(n){Y1(n,0)}function yu(n){var r=pr(n);if(ml(r))return n}function m_(n,r){if(n==="change")return r}var p_=!1;if(zs){var ef;if(zs){var tf="oninput"in document;if(!tf){var g_=document.createElement("div");g_.setAttribute("oninput","return;"),tf=typeof g_.oninput=="function"}ef=tf}else ef=!1;p_=ef&&(!document.documentMode||9<document.documentMode)}function b_(){wl&&(wl.detachEvent("onpropertychange",__),El=wl=null)}function __(n){if(n.propertyName==="value"&&yu(El)){var r=[];f_(r,El,n,Fe(n)),pu(l5,r)}}function c5(n,r,l){n==="focusin"?(b_(),wl=r,El=l,wl.attachEvent("onpropertychange",__)):n==="focusout"&&b_()}function u5(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return yu(El)}function d5(n,r){if(n==="click")return yu(r)}function h5(n,r){if(n==="input"||n==="change")return yu(r)}function f5(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var fn=typeof Object.is=="function"?Object.is:f5;function kl(n,r){if(fn(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var l=Object.keys(n),d=Object.keys(r);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var g=l[d];if(!os.call(r,g)||!fn(n[g],r[g]))return!1}return!0}function v_(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function x_(n,r){var l=v_(n);n=0;for(var d;l;){if(l.nodeType===3){if(d=n+l.textContent.length,n<=r&&d>=r)return{node:l,offset:r-n};n=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=v_(l)}}function y_(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?y_(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function S_(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 l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)n=r.contentWindow;else break;r=ro(n.document)}return r}function nf(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 m5=zs&&"documentMode"in document&&11>=document.documentMode,co=null,sf=null,Cl=null,rf=!1;function w_(n,r,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;rf||co==null||co!==ro(d)||(d=co,"selectionStart"in d&&nf(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}),Cl&&kl(Cl,d)||(Cl=d,d=cd(sf,"onSelect"),0<d.length&&(r=new vu("onSelect","select",null,r,l),n.push({event:r,listeners:d}),r.target=co)))}function ha(n,r){var l={};return l[n.toLowerCase()]=r.toLowerCase(),l["Webkit"+n]="webkit"+r,l["Moz"+n]="moz"+r,l}var uo={animationend:ha("Animation","AnimationEnd"),animationiteration:ha("Animation","AnimationIteration"),animationstart:ha("Animation","AnimationStart"),transitionrun:ha("Transition","TransitionRun"),transitionstart:ha("Transition","TransitionStart"),transitioncancel:ha("Transition","TransitionCancel"),transitionend:ha("Transition","TransitionEnd")},af={},E_={};zs&&(E_=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 fa(n){if(af[n])return af[n];if(!uo[n])return n;var r=uo[n],l;for(l in r)if(r.hasOwnProperty(l)&&l in E_)return af[n]=r[l];return n}var k_=fa("animationend"),C_=fa("animationiteration"),N_=fa("animationstart"),p5=fa("transitionrun"),g5=fa("transitionstart"),b5=fa("transitioncancel"),T_=fa("transitionend"),A_=new Map,of="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(" ");of.push("scrollEnd");function Qn(n,r){A_.set(n,r),Ls(r,[n])}var Su=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)},An=[],ho=0,lf=0;function wu(){for(var n=ho,r=lf=ho=0;r<n;){var l=An[r];An[r++]=null;var d=An[r];An[r++]=null;var g=An[r];An[r++]=null;var _=An[r];if(An[r++]=null,d!==null&&g!==null){var w=d.pending;w===null?g.next=g:(g.next=w.next,w.next=g),d.pending=g}_!==0&&M_(l,g,_)}}function Eu(n,r,l,d){An[ho++]=n,An[ho++]=r,An[ho++]=l,An[ho++]=d,lf|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function cf(n,r,l,d){return Eu(n,r,l,d),ku(n)}function ma(n,r){return Eu(n,null,null,r),ku(n)}function M_(n,r,l){n.lanes|=l;var d=n.alternate;d!==null&&(d.lanes|=l);for(var g=!1,_=n.return;_!==null;)_.childLanes|=l,d=_.alternate,d!==null&&(d.childLanes|=l),_.tag===22&&(n=_.stateNode,n===null||n._visibility&1||(g=!0)),n=_,_=_.return;return n.tag===3?(_=n.stateNode,g&&r!==null&&(g=31-wi(l),n=_.hiddenUpdates,d=n[g],d===null?n[g]=[r]:d.push(r),r.lane=l|536870912),_):null}function ku(n){if(50<Wl)throw Wl=0,_m=null,Error(s(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var fo={};function _5(n,r,l,d){this.tag=n,this.key=l,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 mn(n,r,l,d){return new _5(n,r,l,d)}function uf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Is(n,r){var l=n.alternate;return l===null?(l=mn(n.tag,r,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=r,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,r=n.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function R_(n,r){n.flags&=65011714;var l=n.alternate;return l===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=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,r=l.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function Cu(n,r,l,d,g,_){var w=0;if(d=n,typeof n=="function")uf(n)&&(w=1);else if(typeof n=="string")w=wT(n,l,oe.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case $:return n=mn(31,l,r,g),n.elementType=$,n.lanes=_,n;case S:return pa(l.children,g,_,r);case k:w=8,g|=24;break;case N:return n=mn(12,l,r,g|2),n.elementType=N,n.lanes=_,n;case O:return n=mn(13,l,r,g),n.elementType=O,n.lanes=_,n;case H:return n=mn(19,l,r,g),n.elementType=H,n.lanes=_,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case R:w=10;break e;case T:w=9;break e;case A:w=11;break e;case L:w=14;break e;case M:w=16,d=null;break e}w=29,l=Error(s(130,n===null?"null":typeof n,"")),d=null}return r=mn(w,l,r,g),r.elementType=n,r.type=d,r.lanes=_,r}function pa(n,r,l,d){return n=mn(7,n,d,r),n.lanes=l,n}function df(n,r,l){return n=mn(6,n,null,r),n.lanes=l,n}function j_(n){var r=mn(18,null,null,0);return r.stateNode=n,r}function hf(n,r,l){return r=mn(4,n.children!==null?n.children:[],n.key,r),r.lanes=l,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var D_=new WeakMap;function Mn(n,r){if(typeof n=="object"&&n!==null){var l=D_.get(n);return l!==void 0?l:(r={value:n,source:r,stack:Cn(r)},D_.set(n,r),r)}return{value:n,source:r,stack:Cn(r)}}var mo=[],po=0,Nu=null,Nl=0,Rn=[],jn=0,xr=null,cs=1,us="";function Ps(n,r){mo[po++]=Nl,mo[po++]=Nu,Nu=n,Nl=r}function O_(n,r,l){Rn[jn++]=cs,Rn[jn++]=us,Rn[jn++]=xr,xr=n;var d=cs;n=us;var g=32-wi(d)-1;d&=~(1<<g),l+=1;var _=32-wi(r)+g;if(30<_){var w=g-g%5;_=(d&(1<<w)-1).toString(32),d>>=w,g-=w,cs=1<<32-wi(r)+g|l<<g|d,us=_+n}else cs=1<<_|l<<g|d,us=n}function ff(n){n.return!==null&&(Ps(n,1),O_(n,1,0))}function mf(n){for(;n===Nu;)Nu=mo[--po],mo[po]=null,Nl=mo[--po],mo[po]=null;for(;n===xr;)xr=Rn[--jn],Rn[jn]=null,us=Rn[--jn],Rn[jn]=null,cs=Rn[--jn],Rn[jn]=null}function L_(n,r){Rn[jn++]=cs,Rn[jn++]=us,Rn[jn++]=xr,cs=r.id,us=r.overflow,xr=n}var ki=null,Tt=null,st=!1,yr=null,Dn=!1,pf=Error(s(519));function Sr(n){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tl(Mn(r,n)),pf}function B_(n){var r=n.stateNode,l=n.type,d=n.memoizedProps;switch(r[Gt]=n,r[Bi]=d,l){case"dialog":Je("cancel",r),Je("close",r);break;case"iframe":case"object":case"embed":Je("load",r);break;case"video":case"audio":for(l=0;l<Xl.length;l++)Je(Xl[l],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),ua(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)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||d.suppressHydrationWarning===!0||J1(r.textContent,l)?(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=be),r=!0):r=!1,r||Sr(n,!0)}function z_(n){for(ki=n.return;ki;)switch(ki.tag){case 5:case 31:case 13:Dn=!1;return;case 27:case 3:Dn=!0;return;default:ki=ki.return}}function go(n){if(n!==ki)return!1;if(!st)return z_(n),st=!0,!1;var r=n.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||Dm(n.type,n.memoizedProps)),l=!l),l&&Tt&&Sr(n),z_(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Tt=lx(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Tt=lx(n)}else r===27?(r=Tt,Br(n.type)?(n=Im,Im=null,Tt=n):Tt=r):Tt=ki?Ln(n.stateNode.nextSibling):null;return!0}function ga(){Tt=ki=null,st=!1}function gf(){var n=yr;return n!==null&&(sn===null?sn=n:sn.push.apply(sn,n),yr=null),n}function Tl(n){yr===null?yr=[n]:yr.push(n)}var bf=j(null),ba=null,Us=null;function wr(n,r,l){de(bf,r._currentValue),r._currentValue=l}function Hs(n){n._currentValue=bf.current,W(bf)}function _f(n,r,l){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===l)break;n=n.return}}function vf(n,r,l,d){var g=n.child;for(g!==null&&(g.return=n);g!==null;){var _=g.dependencies;if(_!==null){var w=g.child;_=_.firstContext;e:for(;_!==null;){var C=_;_=g;for(var B=0;B<r.length;B++)if(C.context===r[B]){_.lanes|=l,C=_.alternate,C!==null&&(C.lanes|=l),_f(_.return,l,n),d||(w=null);break e}_=C.next}}else if(g.tag===18){if(w=g.return,w===null)throw Error(s(341));w.lanes|=l,_=w.alternate,_!==null&&(_.lanes|=l),_f(w,l,n),w=null}else w=g.child;if(w!==null)w.return=g;else for(w=g;w!==null;){if(w===n){w=null;break}if(g=w.sibling,g!==null){g.return=w.return,w=g;break}w=w.return}g=w}}function bo(n,r,l,d){n=null;for(var g=r,_=!1;g!==null;){if(!_){if((g.flags&524288)!==0)_=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var w=g.alternate;if(w===null)throw Error(s(387));if(w=w.memoizedProps,w!==null){var C=g.type;fn(g.pendingProps.value,w.value)||(n!==null?n.push(C):n=[C])}}else if(g===fe.current){if(w=g.alternate,w===null)throw Error(s(387));w.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(n!==null?n.push(tc):n=[tc])}g=g.return}n!==null&&vf(r,n,l,d),r.flags|=262144}function Tu(n){for(n=n.firstContext;n!==null;){if(!fn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function _a(n){ba=n,Us=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Ci(n){return I_(ba,n)}function Au(n,r){return ba===null&&_a(n),I_(n,r)}function I_(n,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},Us===null){if(n===null)throw Error(s(308));Us=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else Us=Us.next=r;return l}var v5=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(l,d){n.push(d)}};this.abort=function(){r.aborted=!0,n.forEach(function(l){return l()})}},x5=e.unstable_scheduleCallback,y5=e.unstable_NormalPriority,Jt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xf(){return{controller:new v5,data:new Map,refCount:0}}function Al(n){n.refCount--,n.refCount===0&&x5(y5,function(){n.controller.abort()})}var Ml=null,yf=0,_o=0,vo=null;function S5(n,r){if(Ml===null){var l=Ml=[];yf=0,_o=Em(),vo={status:"pending",value:void 0,then:function(d){l.push(d)}}}return yf++,r.then(P_,P_),r}function P_(){if(--yf===0&&Ml!==null){vo!==null&&(vo.status="fulfilled");var n=Ml;Ml=null,_o=0,vo=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function w5(n,r){var l=[],d={status:"pending",value:null,reason:null,then:function(g){l.push(g)}};return n.then(function(){d.status="fulfilled",d.value=r;for(var g=0;g<l.length;g++)(0,l[g])(r)},function(g){for(d.status="rejected",d.reason=g,g=0;g<l.length;g++)(0,l[g])(void 0)}),d}var U_=D.S;D.S=function(n,r){w1=Bt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&S5(n,r),U_!==null&&U_(n,r)};var va=j(null);function Sf(){var n=va.current;return n!==null?n:Et.pooledCache}function Mu(n,r){r===null?de(va,va.current):de(va,r.pool)}function H_(){var n=Sf();return n===null?null:{parent:Jt._currentValue,pool:n}}var xo=Error(s(460)),wf=Error(s(474)),Ru=Error(s(542)),ju={then:function(){}};function F_(n){return n=n.status,n==="fulfilled"||n==="rejected"}function $_(n,r,l){switch(l=n[l],l===void 0?n.push(r):l!==r&&(r.then(be,be),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,q_(n),n;default:if(typeof r.status=="string")r.then(be,be);else{if(n=Et,n!==null&&100<n.shellSuspendCounter)throw Error(s(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,q_(n),n}throw ya=r,xo}}function xa(n){try{var r=n._init;return r(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ya=l,xo):l}}var ya=null;function V_(){if(ya===null)throw Error(s(459));var n=ya;return ya=null,n}function q_(n){if(n===xo||n===Ru)throw Error(s(483))}var yo=null,Rl=0;function Du(n){var r=Rl;return Rl+=1,yo===null&&(yo=[]),$_(yo,n,r)}function jl(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Ou(n,r){throw r.$$typeof===v?Error(s(525)):(n=Object.prototype.toString.call(r),Error(s(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function G_(n){function r(G,U){if(n){var J=G.deletions;J===null?(G.deletions=[U],G.flags|=16):J.push(U)}}function l(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=Is(G,U),G.index=0,G.sibling=null,G}function _(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 w(G){return n&&G.alternate===null&&(G.flags|=67108866),G}function C(G,U,J,ae){return U===null||U.tag!==6?(U=df(J,G.mode,ae),U.return=G,U):(U=g(U,J),U.return=G,U)}function B(G,U,J,ae){var Oe=J.type;return Oe===S?ne(G,U,J.props.children,ae,J.key):U!==null&&(U.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===M&&xa(Oe)===U.type)?(U=g(U,J.props),jl(U,J),U.return=G,U):(U=Cu(J.type,J.key,J.props,null,G.mode,ae),jl(U,J),U.return=G,U)}function ee(G,U,J,ae){return U===null||U.tag!==4||U.stateNode.containerInfo!==J.containerInfo||U.stateNode.implementation!==J.implementation?(U=hf(J,G.mode,ae),U.return=G,U):(U=g(U,J.children||[]),U.return=G,U)}function ne(G,U,J,ae,Oe){return U===null||U.tag!==7?(U=pa(J,G.mode,ae,Oe),U.return=G,U):(U=g(U,J),U.return=G,U)}function le(G,U,J){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=df(""+U,G.mode,J),U.return=G,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case x:return J=Cu(U.type,U.key,U.props,null,G.mode,J),jl(J,U),J.return=G,J;case y:return U=hf(U,G.mode,J),U.return=G,U;case M:return U=xa(U),le(G,U,J)}if(q(U)||Z(U))return U=pa(U,G.mode,J,null),U.return=G,U;if(typeof U.then=="function")return le(G,Du(U),J);if(U.$$typeof===R)return le(G,Au(G,U),J);Ou(G,U)}return null}function te(G,U,J,ae){var Oe=U!==null?U.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Oe!==null?null:C(G,U,""+J,ae);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===Oe?B(G,U,J,ae):null;case y:return J.key===Oe?ee(G,U,J,ae):null;case M:return J=xa(J),te(G,U,J,ae)}if(q(J)||Z(J))return Oe!==null?null:ne(G,U,J,ae,null);if(typeof J.then=="function")return te(G,U,Du(J),ae);if(J.$$typeof===R)return te(G,U,Au(G,J),ae);Ou(G,J)}return null}function ie(G,U,J,ae,Oe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return G=G.get(J)||null,C(U,G,""+ae,Oe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case x:return G=G.get(ae.key===null?J:ae.key)||null,B(U,G,ae,Oe);case y:return G=G.get(ae.key===null?J:ae.key)||null,ee(U,G,ae,Oe);case M:return ae=xa(ae),ie(G,U,J,ae,Oe)}if(q(ae)||Z(ae))return G=G.get(J)||null,ne(U,G,ae,Oe,null);if(typeof ae.then=="function")return ie(G,U,J,Du(ae),Oe);if(ae.$$typeof===R)return ie(G,U,J,Au(U,ae),Oe);Ou(U,ae)}return null}function Ne(G,U,J,ae){for(var Oe=null,ct=null,Re=U,Ve=U=0,nt=null;Re!==null&&Ve<J.length;Ve++){Re.index>Ve?(nt=Re,Re=null):nt=Re.sibling;var ut=te(G,Re,J[Ve],ae);if(ut===null){Re===null&&(Re=nt);break}n&&Re&&ut.alternate===null&&r(G,Re),U=_(ut,U,Ve),ct===null?Oe=ut:ct.sibling=ut,ct=ut,Re=nt}if(Ve===J.length)return l(G,Re),st&&Ps(G,Ve),Oe;if(Re===null){for(;Ve<J.length;Ve++)Re=le(G,J[Ve],ae),Re!==null&&(U=_(Re,U,Ve),ct===null?Oe=Re:ct.sibling=Re,ct=Re);return st&&Ps(G,Ve),Oe}for(Re=d(Re);Ve<J.length;Ve++)nt=ie(Re,G,Ve,J[Ve],ae),nt!==null&&(n&&nt.alternate!==null&&Re.delete(nt.key===null?Ve:nt.key),U=_(nt,U,Ve),ct===null?Oe=nt:ct.sibling=nt,ct=nt);return n&&Re.forEach(function(Hr){return r(G,Hr)}),st&&Ps(G,Ve),Oe}function Le(G,U,J,ae){if(J==null)throw Error(s(151));for(var Oe=null,ct=null,Re=U,Ve=U=0,nt=null,ut=J.next();Re!==null&&!ut.done;Ve++,ut=J.next()){Re.index>Ve?(nt=Re,Re=null):nt=Re.sibling;var Hr=te(G,Re,ut.value,ae);if(Hr===null){Re===null&&(Re=nt);break}n&&Re&&Hr.alternate===null&&r(G,Re),U=_(Hr,U,Ve),ct===null?Oe=Hr:ct.sibling=Hr,ct=Hr,Re=nt}if(ut.done)return l(G,Re),st&&Ps(G,Ve),Oe;if(Re===null){for(;!ut.done;Ve++,ut=J.next())ut=le(G,ut.value,ae),ut!==null&&(U=_(ut,U,Ve),ct===null?Oe=ut:ct.sibling=ut,ct=ut);return st&&Ps(G,Ve),Oe}for(Re=d(Re);!ut.done;Ve++,ut=J.next())ut=ie(Re,G,Ve,ut.value,ae),ut!==null&&(n&&ut.alternate!==null&&Re.delete(ut.key===null?Ve:ut.key),U=_(ut,U,Ve),ct===null?Oe=ut:ct.sibling=ut,ct=ut);return n&&Re.forEach(function(OT){return r(G,OT)}),st&&Ps(G,Ve),Oe}function xt(G,U,J,ae){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 x:e:{for(var Oe=J.key;U!==null;){if(U.key===Oe){if(Oe=J.type,Oe===S){if(U.tag===7){l(G,U.sibling),ae=g(U,J.props.children),ae.return=G,G=ae;break e}}else if(U.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===M&&xa(Oe)===U.type){l(G,U.sibling),ae=g(U,J.props),jl(ae,J),ae.return=G,G=ae;break e}l(G,U);break}else r(G,U);U=U.sibling}J.type===S?(ae=pa(J.props.children,G.mode,ae,J.key),ae.return=G,G=ae):(ae=Cu(J.type,J.key,J.props,null,G.mode,ae),jl(ae,J),ae.return=G,G=ae)}return w(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){l(G,U.sibling),ae=g(U,J.children||[]),ae.return=G,G=ae;break e}else{l(G,U);break}else r(G,U);U=U.sibling}ae=hf(J,G.mode,ae),ae.return=G,G=ae}return w(G);case M:return J=xa(J),xt(G,U,J,ae)}if(q(J))return Ne(G,U,J,ae);if(Z(J)){if(Oe=Z(J),typeof Oe!="function")throw Error(s(150));return J=Oe.call(J),Le(G,U,J,ae)}if(typeof J.then=="function")return xt(G,U,Du(J),ae);if(J.$$typeof===R)return xt(G,U,Au(G,J),ae);Ou(G,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,U!==null&&U.tag===6?(l(G,U.sibling),ae=g(U,J),ae.return=G,G=ae):(l(G,U),ae=df(J,G.mode,ae),ae.return=G,G=ae),w(G)):l(G,U)}return function(G,U,J,ae){try{Rl=0;var Oe=xt(G,U,J,ae);return yo=null,Oe}catch(Re){if(Re===xo||Re===Ru)throw Re;var ct=mn(29,Re,null,G.mode);return ct.lanes=ae,ct.return=G,ct}}}var Sa=G_(!0),K_=G_(!1),Er=!1;function Ef(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kf(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 kr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Cr(n,r,l){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(dt&2)!==0){var g=d.pending;return g===null?r.next=r:(r.next=g.next,g.next=r),d.pending=r,r=ku(n),M_(n,null,l),r}return Eu(n,d,r,l),ku(n)}function Dl(n,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var d=r.lanes;d&=n.pendingLanes,l|=d,r.lanes=l,Ie(n,l)}}function Cf(n,r){var l=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var g=null,_=null;if(l=l.firstBaseUpdate,l!==null){do{var w={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};_===null?g=_=w:_=_.next=w,l=l.next}while(l!==null);_===null?g=_=r:_=_.next=r}else g=_=r;l={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:_,shared:d.shared,callbacks:d.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=r:n.next=r,l.lastBaseUpdate=r}var Nf=!1;function Ol(){if(Nf){var n=vo;if(n!==null)throw n}}function Ll(n,r,l,d){Nf=!1;var g=n.updateQueue;Er=!1;var _=g.firstBaseUpdate,w=g.lastBaseUpdate,C=g.shared.pending;if(C!==null){g.shared.pending=null;var B=C,ee=B.next;B.next=null,w===null?_=ee:w.next=ee,w=B;var ne=n.alternate;ne!==null&&(ne=ne.updateQueue,C=ne.lastBaseUpdate,C!==w&&(C===null?ne.firstBaseUpdate=ee:C.next=ee,ne.lastBaseUpdate=B))}if(_!==null){var le=g.baseState;w=0,ne=ee=B=null,C=_;do{var te=C.lane&-536870913,ie=te!==C.lane;if(ie?(it&te)===te:(d&te)===te){te!==0&&te===_o&&(Nf=!0),ne!==null&&(ne=ne.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var Ne=n,Le=C;te=r;var xt=l;switch(Le.tag){case 1:if(Ne=Le.payload,typeof Ne=="function"){le=Ne.call(xt,le,te);break e}le=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Le.payload,te=typeof Ne=="function"?Ne.call(xt,le,te):Ne,te==null)break e;le=b({},le,te);break e;case 2:Er=!0}}te=C.callback,te!==null&&(n.flags|=64,ie&&(n.flags|=8192),ie=g.callbacks,ie===null?g.callbacks=[te]:ie.push(te))}else ie={lane:te,tag:C.tag,payload:C.payload,callback:C.callback,next:null},ne===null?(ee=ne=ie,B=le):ne=ne.next=ie,w|=te;if(C=C.next,C===null){if(C=g.shared.pending,C===null)break;ie=C,C=ie.next,ie.next=null,g.lastBaseUpdate=ie,g.shared.pending=null}}while(!0);ne===null&&(B=le),g.baseState=B,g.firstBaseUpdate=ee,g.lastBaseUpdate=ne,_===null&&(g.shared.lanes=0),Rr|=w,n.lanes=w,n.memoizedState=le}}function W_(n,r){if(typeof n!="function")throw Error(s(191,n));n.call(r)}function Y_(n,r){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)W_(l[n],r)}var So=j(null),Lu=j(0);function X_(n,r){n=Xs,de(Lu,n),de(So,r),Xs=n|r.baseLanes}function Tf(){de(Lu,Xs),de(So,So.current)}function Af(){Xs=Lu.current,W(So),W(Lu)}var pn=j(null),On=null;function Nr(n){var r=n.alternate;de(Wt,Wt.current&1),de(pn,n),On===null&&(r===null||So.current!==null||r.memoizedState!==null)&&(On=n)}function Mf(n){de(Wt,Wt.current),de(pn,n),On===null&&(On=n)}function Z_(n){n.tag===22?(de(Wt,Wt.current),de(pn,n),On===null&&(On=n)):Tr()}function Tr(){de(Wt,Wt.current),de(pn,pn.current)}function gn(n){W(pn),On===n&&(On=null),W(Wt)}var Wt=j(0);function Bu(n){for(var r=n;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Bm(l)||zm(l)))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 Fs=0,$e=null,_t=null,ei=null,zu=!1,wo=!1,wa=!1,Iu=0,Bl=0,Eo=null,E5=0;function Ut(){throw Error(s(321))}function Rf(n,r){if(r===null)return!1;for(var l=0;l<r.length&&l<n.length;l++)if(!fn(n[l],r[l]))return!1;return!0}function jf(n,r,l,d,g,_){return Fs=_,$e=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,D.H=n===null||n.memoizedState===null?Ov:Kf,wa=!1,_=l(d,g),wa=!1,wo&&(_=J_(r,l,d,g)),Q_(n),_}function Q_(n){D.H=Pl;var r=_t!==null&&_t.next!==null;if(Fs=0,ei=_t=$e=null,zu=!1,Bl=0,Eo=null,r)throw Error(s(300));n===null||ti||(n=n.dependencies,n!==null&&Tu(n)&&(ti=!0))}function J_(n,r,l,d){$e=n;var g=0;do{if(wo&&(Eo=null),Bl=0,wo=!1,25<=g)throw Error(s(301));if(g+=1,ei=_t=null,n.updateQueue!=null){var _=n.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}D.H=Lv,_=r(l,d)}while(wo);return _}function k5(){var n=D.H,r=n.useState()[0];return r=typeof r.then=="function"?zl(r):r,n=n.useState()[0],(_t!==null?_t.memoizedState:null)!==n&&($e.flags|=1024),r}function Df(){var n=Iu!==0;return Iu=0,n}function Of(n,r,l){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~l}function Lf(n){if(zu){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}zu=!1}Fs=0,ei=_t=$e=null,wo=!1,Bl=Iu=0,Eo=null}function Vi(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ei===null?$e.memoizedState=ei=n:ei=ei.next=n,ei}function Yt(){if(_t===null){var n=$e.alternate;n=n!==null?n.memoizedState:null}else n=_t.next;var r=ei===null?$e.memoizedState:ei.next;if(r!==null)ei=r,_t=n;else{if(n===null)throw $e.alternate===null?Error(s(467)):Error(s(310));_t=n,n={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},ei===null?$e.memoizedState=ei=n:ei=ei.next=n}return ei}function Pu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zl(n){var r=Bl;return Bl+=1,Eo===null&&(Eo=[]),n=$_(Eo,n,r),r=$e,(ei===null?r.memoizedState:ei.next)===null&&(r=r.alternate,D.H=r===null||r.memoizedState===null?Ov:Kf),n}function Uu(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return zl(n);if(n.$$typeof===R)return Ci(n)}throw Error(s(438,String(n)))}function Bf(n){var r=null,l=$e.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var d=$e.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}),l===null&&(l=Pu(),$e.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(n),d=0;d<n;d++)l[d]=P;return r.index++,l}function $s(n,r){return typeof r=="function"?r(n):r}function Hu(n){var r=Yt();return zf(r,_t,n)}function zf(n,r,l){var d=n.queue;if(d===null)throw Error(s(311));d.lastRenderedReducer=l;var g=n.baseQueue,_=d.pending;if(_!==null){if(g!==null){var w=g.next;g.next=_.next,_.next=w}r.baseQueue=g=_,d.pending=null}if(_=n.baseState,g===null)n.memoizedState=_;else{r=g.next;var C=w=null,B=null,ee=r,ne=!1;do{var le=ee.lane&-536870913;if(le!==ee.lane?(it&le)===le:(Fs&le)===le){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}),le===_o&&(ne=!0);else if((Fs&te)===te){ee=ee.next,te===_o&&(ne=!0);continue}else le={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},B===null?(C=B=le,w=_):B=B.next=le,$e.lanes|=te,Rr|=te;le=ee.action,wa&&l(_,le),_=ee.hasEagerState?ee.eagerState:l(_,le)}else te={lane:le,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},B===null?(C=B=te,w=_):B=B.next=te,$e.lanes|=le,Rr|=le;ee=ee.next}while(ee!==null&&ee!==r);if(B===null?w=_:B.next=C,!fn(_,n.memoizedState)&&(ti=!0,ne&&(l=vo,l!==null)))throw l;n.memoizedState=_,n.baseState=w,n.baseQueue=B,d.lastRenderedState=_}return g===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function If(n){var r=Yt(),l=r.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=n;var d=l.dispatch,g=l.pending,_=r.memoizedState;if(g!==null){l.pending=null;var w=g=g.next;do _=n(_,w.action),w=w.next;while(w!==g);fn(_,r.memoizedState)||(ti=!0),r.memoizedState=_,r.baseQueue===null&&(r.baseState=_),l.lastRenderedState=_}return[_,d]}function ev(n,r,l){var d=$e,g=Yt(),_=st;if(_){if(l===void 0)throw Error(s(407));l=l()}else l=r();var w=!fn((_t||g).memoizedState,l);if(w&&(g.memoizedState=l,ti=!0),g=g.queue,Hf(nv.bind(null,d,g,n),[n]),g.getSnapshot!==r||w||ei!==null&&ei.memoizedState.tag&1){if(d.flags|=2048,ko(9,{destroy:void 0},iv.bind(null,d,g,l,r),null),Et===null)throw Error(s(349));_||(Fs&127)!==0||tv(d,r,l)}return l}function tv(n,r,l){n.flags|=16384,n={getSnapshot:r,value:l},r=$e.updateQueue,r===null?(r=Pu(),$e.updateQueue=r,r.stores=[n]):(l=r.stores,l===null?r.stores=[n]:l.push(n))}function iv(n,r,l,d){r.value=l,r.getSnapshot=d,sv(r)&&rv(n)}function nv(n,r,l){return l(function(){sv(r)&&rv(n)})}function sv(n){var r=n.getSnapshot;n=n.value;try{var l=r();return!fn(n,l)}catch{return!0}}function rv(n){var r=ma(n,2);r!==null&&rn(r,n,2)}function Pf(n){var r=Vi();if(typeof n=="function"){var l=n;if(n=l(),wa){Nn(!0);try{l()}finally{Nn(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:n},r}function av(n,r,l,d){return n.baseState=l,zf(n,_t,typeof d=="function"?d:$s)}function C5(n,r,l,d,g){if(Vu(n))throw Error(s(485));if(n=r.action,n!==null){var _={payload:g,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){_.listeners.push(w)}};D.T!==null?l(!0):_.isTransition=!1,d(_),l=r.pending,l===null?(_.next=r.pending=_,ov(r,_)):(_.next=l.next,r.pending=l.next=_)}}function ov(n,r){var l=r.action,d=r.payload,g=n.state;if(r.isTransition){var _=D.T,w={};D.T=w;try{var C=l(g,d),B=D.S;B!==null&&B(w,C),lv(n,r,C)}catch(ee){Uf(n,r,ee)}finally{_!==null&&w.types!==null&&(_.types=w.types),D.T=_}}else try{_=l(g,d),lv(n,r,_)}catch(ee){Uf(n,r,ee)}}function lv(n,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){cv(n,r,d)},function(d){return Uf(n,r,d)}):cv(n,r,l)}function cv(n,r,l){r.status="fulfilled",r.value=l,uv(r),n.state=l,r=n.pending,r!==null&&(l=r.next,l===r?n.pending=null:(l=l.next,r.next=l,ov(n,l)))}function Uf(n,r,l){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do r.status="rejected",r.reason=l,uv(r),r=r.next;while(r!==d)}n.action=null}function uv(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function dv(n,r){return r}function hv(n,r){if(st){var l=Et.formState;if(l!==null){e:{var d=$e;if(st){if(Tt){t:{for(var g=Tt,_=Dn;g.nodeType!==8;){if(!_){g=null;break t}if(g=Ln(g.nextSibling),g===null){g=null;break t}}_=g.data,g=_==="F!"||_==="F"?g:null}if(g){Tt=Ln(g.nextSibling),d=g.data==="F!";break e}}Sr(d)}d=!1}d&&(r=l[0])}}return l=Vi(),l.memoizedState=l.baseState=r,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dv,lastRenderedState:r},l.queue=d,l=Rv.bind(null,$e,d),d.dispatch=l,d=Pf(!1),_=Gf.bind(null,$e,!1,d.queue),d=Vi(),g={state:r,dispatch:null,action:n,pending:null},d.queue=g,l=C5.bind(null,$e,g,_,l),g.dispatch=l,d.memoizedState=n,[r,l,!1]}function fv(n){var r=Yt();return mv(r,_t,n)}function mv(n,r,l){if(r=zf(n,r,dv)[0],n=Hu($s)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var d=zl(r)}catch(w){throw w===xo?Ru:w}else d=r;r=Yt();var g=r.queue,_=g.dispatch;return l!==r.memoizedState&&($e.flags|=2048,ko(9,{destroy:void 0},N5.bind(null,g,l),null)),[d,_,n]}function N5(n,r){n.action=r}function pv(n){var r=Yt(),l=_t;if(l!==null)return mv(r,l,n);Yt(),r=r.memoizedState,l=Yt();var d=l.queue.dispatch;return l.memoizedState=n,[r,d,!1]}function ko(n,r,l,d){return n={tag:n,create:l,deps:d,inst:r,next:null},r=$e.updateQueue,r===null&&(r=Pu(),$e.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=n.next=n:(d=l.next,l.next=n,n.next=d,r.lastEffect=n),n}function gv(){return Yt().memoizedState}function Fu(n,r,l,d){var g=Vi();$e.flags|=n,g.memoizedState=ko(1|r,{destroy:void 0},l,d===void 0?null:d)}function $u(n,r,l,d){var g=Yt();d=d===void 0?null:d;var _=g.memoizedState.inst;_t!==null&&d!==null&&Rf(d,_t.memoizedState.deps)?g.memoizedState=ko(r,_,l,d):($e.flags|=n,g.memoizedState=ko(1|r,_,l,d))}function bv(n,r){Fu(8390656,8,n,r)}function Hf(n,r){$u(2048,8,n,r)}function T5(n){$e.flags|=4;var r=$e.updateQueue;if(r===null)r=Pu(),$e.updateQueue=r,r.events=[n];else{var l=r.events;l===null?r.events=[n]:l.push(n)}}function _v(n){var r=Yt().memoizedState;return T5({ref:r,nextImpl:n}),function(){if((dt&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function vv(n,r){return $u(4,2,n,r)}function xv(n,r){return $u(4,4,n,r)}function yv(n,r){if(typeof r=="function"){n=n();var l=r(n);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function Sv(n,r,l){l=l!=null?l.concat([n]):null,$u(4,4,yv.bind(null,r,n),l)}function Ff(){}function wv(n,r){var l=Yt();r=r===void 0?null:r;var d=l.memoizedState;return r!==null&&Rf(r,d[1])?d[0]:(l.memoizedState=[n,r],n)}function Ev(n,r){var l=Yt();r=r===void 0?null:r;var d=l.memoizedState;if(r!==null&&Rf(r,d[1]))return d[0];if(d=n(),wa){Nn(!0);try{n()}finally{Nn(!1)}}return l.memoizedState=[d,r],d}function $f(n,r,l){return l===void 0||(Fs&1073741824)!==0&&(it&261930)===0?n.memoizedState=r:(n.memoizedState=l,n=k1(),$e.lanes|=n,Rr|=n,l)}function kv(n,r,l,d){return fn(l,r)?l:So.current!==null?(n=$f(n,l,d),fn(n,r)||(ti=!0),n):(Fs&42)===0||(Fs&1073741824)!==0&&(it&261930)===0?(ti=!0,n.memoizedState=l):(n=k1(),$e.lanes|=n,Rr|=n,r)}function Cv(n,r,l,d,g){var _=Y.p;Y.p=_!==0&&8>_?_:8;var w=D.T,C={};D.T=C,Gf(n,!1,r,l);try{var B=g(),ee=D.S;if(ee!==null&&ee(C,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ne=w5(B,d);Il(n,r,ne,vn(n))}else Il(n,r,d,vn(n))}catch(le){Il(n,r,{then:function(){},status:"rejected",reason:le},vn())}finally{Y.p=_,w!==null&&C.types!==null&&(w.types=C.types),D.T=w}}function A5(){}function Vf(n,r,l,d){if(n.tag!==5)throw Error(s(476));var g=Nv(n).queue;Cv(n,g,r,X,l===null?A5:function(){return Tv(n),l(d)})}function Nv(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:X},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:l},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function Tv(n){var r=Nv(n);r.next===null&&(r=n.alternate.memoizedState),Il(n,r.next.queue,{},vn())}function qf(){return Ci(tc)}function Av(){return Yt().memoizedState}function Mv(){return Yt().memoizedState}function M5(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var l=vn();n=kr(l);var d=Cr(r,n,l);d!==null&&(rn(d,r,l),Dl(d,r,l)),r={cache:xf()},n.payload=r;return}r=r.return}}function R5(n,r,l){var d=vn();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Vu(n)?jv(r,l):(l=cf(n,r,l,d),l!==null&&(rn(l,n,d),Dv(l,r,d)))}function Rv(n,r,l){var d=vn();Il(n,r,l,d)}function Il(n,r,l,d){var g={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Vu(n))jv(r,g);else{var _=n.alternate;if(n.lanes===0&&(_===null||_.lanes===0)&&(_=r.lastRenderedReducer,_!==null))try{var w=r.lastRenderedState,C=_(w,l);if(g.hasEagerState=!0,g.eagerState=C,fn(C,w))return Eu(n,r,g,0),Et===null&&wu(),!1}catch{}if(l=cf(n,r,g,d),l!==null)return rn(l,n,d),Dv(l,r,d),!0}return!1}function Gf(n,r,l,d){if(d={lane:2,revertLane:Em(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Vu(n)){if(r)throw Error(s(479))}else r=cf(n,l,d,2),r!==null&&rn(r,n,2)}function Vu(n){var r=n.alternate;return n===$e||r!==null&&r===$e}function jv(n,r){wo=zu=!0;var l=n.pending;l===null?r.next=r:(r.next=l.next,l.next=r),n.pending=r}function Dv(n,r,l){if((l&4194048)!==0){var d=r.lanes;d&=n.pendingLanes,l|=d,r.lanes=l,Ie(n,l)}}var Pl={readContext:Ci,use:Uu,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut};Pl.useEffectEvent=Ut;var Ov={readContext:Ci,use:Uu,useCallback:function(n,r){return Vi().memoizedState=[n,r===void 0?null:r],n},useContext:Ci,useEffect:bv,useImperativeHandle:function(n,r,l){l=l!=null?l.concat([n]):null,Fu(4194308,4,yv.bind(null,r,n),l)},useLayoutEffect:function(n,r){return Fu(4194308,4,n,r)},useInsertionEffect:function(n,r){Fu(4,2,n,r)},useMemo:function(n,r){var l=Vi();r=r===void 0?null:r;var d=n();if(wa){Nn(!0);try{n()}finally{Nn(!1)}}return l.memoizedState=[d,r],d},useReducer:function(n,r,l){var d=Vi();if(l!==void 0){var g=l(r);if(wa){Nn(!0);try{l(r)}finally{Nn(!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=R5.bind(null,$e,n),[d.memoizedState,n]},useRef:function(n){var r=Vi();return n={current:n},r.memoizedState=n},useState:function(n){n=Pf(n);var r=n.queue,l=Rv.bind(null,$e,r);return r.dispatch=l,[n.memoizedState,l]},useDebugValue:Ff,useDeferredValue:function(n,r){var l=Vi();return $f(l,n,r)},useTransition:function(){var n=Pf(!1);return n=Cv.bind(null,$e,n.queue,!0,!1),Vi().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,l){var d=$e,g=Vi();if(st){if(l===void 0)throw Error(s(407));l=l()}else{if(l=r(),Et===null)throw Error(s(349));(it&127)!==0||tv(d,r,l)}g.memoizedState=l;var _={value:l,getSnapshot:r};return g.queue=_,bv(nv.bind(null,d,_,n),[n]),d.flags|=2048,ko(9,{destroy:void 0},iv.bind(null,d,_,l,r),null),l},useId:function(){var n=Vi(),r=Et.identifierPrefix;if(st){var l=us,d=cs;l=(d&~(1<<32-wi(d)-1)).toString(32)+l,r="_"+r+"R_"+l,l=Iu++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=E5++,r="_"+r+"r_"+l.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:qf,useFormState:hv,useActionState:hv,useOptimistic:function(n){var r=Vi();r.memoizedState=r.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=Gf.bind(null,$e,!0,l),l.dispatch=r,[n,r]},useMemoCache:Bf,useCacheRefresh:function(){return Vi().memoizedState=M5.bind(null,$e)},useEffectEvent:function(n){var r=Vi(),l={impl:n};return r.memoizedState=l,function(){if((dt&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},Kf={readContext:Ci,use:Uu,useCallback:wv,useContext:Ci,useEffect:Hf,useImperativeHandle:Sv,useInsertionEffect:vv,useLayoutEffect:xv,useMemo:Ev,useReducer:Hu,useRef:gv,useState:function(){return Hu($s)},useDebugValue:Ff,useDeferredValue:function(n,r){var l=Yt();return kv(l,_t.memoizedState,n,r)},useTransition:function(){var n=Hu($s)[0],r=Yt().memoizedState;return[typeof n=="boolean"?n:zl(n),r]},useSyncExternalStore:ev,useId:Av,useHostTransitionStatus:qf,useFormState:fv,useActionState:fv,useOptimistic:function(n,r){var l=Yt();return av(l,_t,n,r)},useMemoCache:Bf,useCacheRefresh:Mv};Kf.useEffectEvent=_v;var Lv={readContext:Ci,use:Uu,useCallback:wv,useContext:Ci,useEffect:Hf,useImperativeHandle:Sv,useInsertionEffect:vv,useLayoutEffect:xv,useMemo:Ev,useReducer:If,useRef:gv,useState:function(){return If($s)},useDebugValue:Ff,useDeferredValue:function(n,r){var l=Yt();return _t===null?$f(l,n,r):kv(l,_t.memoizedState,n,r)},useTransition:function(){var n=If($s)[0],r=Yt().memoizedState;return[typeof n=="boolean"?n:zl(n),r]},useSyncExternalStore:ev,useId:Av,useHostTransitionStatus:qf,useFormState:pv,useActionState:pv,useOptimistic:function(n,r){var l=Yt();return _t!==null?av(l,_t,n,r):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:Bf,useCacheRefresh:Mv};Lv.useEffectEvent=_v;function Wf(n,r,l,d){r=n.memoizedState,l=l(d,r),l=l==null?r:b({},r,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var Yf={enqueueSetState:function(n,r,l){n=n._reactInternals;var d=vn(),g=kr(d);g.payload=r,l!=null&&(g.callback=l),r=Cr(n,g,d),r!==null&&(rn(r,n,d),Dl(r,n,d))},enqueueReplaceState:function(n,r,l){n=n._reactInternals;var d=vn(),g=kr(d);g.tag=1,g.payload=r,l!=null&&(g.callback=l),r=Cr(n,g,d),r!==null&&(rn(r,n,d),Dl(r,n,d))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var l=vn(),d=kr(l);d.tag=2,r!=null&&(d.callback=r),r=Cr(n,d,l),r!==null&&(rn(r,n,l),Dl(r,n,l))}};function Bv(n,r,l,d,g,_,w){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,_,w):r.prototype&&r.prototype.isPureReactComponent?!kl(l,d)||!kl(g,_):!0}function zv(n,r,l,d){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,d),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,d),r.state!==n&&Yf.enqueueReplaceState(r,r.state,null)}function Ea(n,r){var l=r;if("ref"in r){l={};for(var d in r)d!=="ref"&&(l[d]=r[d])}if(n=n.defaultProps){l===r&&(l=b({},l));for(var g in n)l[g]===void 0&&(l[g]=n[g])}return l}function Iv(n){Su(n)}function Pv(n){console.error(n)}function Uv(n){Su(n)}function qu(n,r){try{var l=n.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(d){setTimeout(function(){throw d})}}function Hv(n,r,l){try{var d=n.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Xf(n,r,l){return l=kr(l),l.tag=3,l.payload={element:null},l.callback=function(){qu(n,r)},l}function Fv(n){return n=kr(n),n.tag=3,n}function $v(n,r,l,d){var g=l.type.getDerivedStateFromError;if(typeof g=="function"){var _=d.value;n.payload=function(){return g(_)},n.callback=function(){Hv(r,l,d)}}var w=l.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(n.callback=function(){Hv(r,l,d),typeof g!="function"&&(jr===null?jr=new Set([this]):jr.add(this));var C=d.stack;this.componentDidCatch(d.value,{componentStack:C!==null?C:""})})}function j5(n,r,l,d,g){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(r=l.alternate,r!==null&&bo(r,l,g,!0),l=pn.current,l!==null){switch(l.tag){case 31:case 13:return On===null?nd():l.alternate===null&&Ht===0&&(Ht=3),l.flags&=-257,l.flags|=65536,l.lanes=g,d===ju?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([d]):r.add(d),ym(n,d,g)),!1;case 22:return l.flags|=65536,d===ju?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([d]):l.add(d)),ym(n,d,g)),!1}throw Error(s(435,l.tag))}return ym(n,d,g),nd(),!1}if(st)return r=pn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=g,d!==pf&&(n=Error(s(422),{cause:d}),Tl(Mn(n,l)))):(d!==pf&&(r=Error(s(423),{cause:d}),Tl(Mn(r,l))),n=n.current.alternate,n.flags|=65536,g&=-g,n.lanes|=g,d=Mn(d,l),g=Xf(n.stateNode,d,g),Cf(n,g),Ht!==4&&(Ht=2)),!1;var _=Error(s(520),{cause:d});if(_=Mn(_,l),Kl===null?Kl=[_]:Kl.push(_),Ht!==4&&(Ht=2),r===null)return!0;d=Mn(d,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,n=g&-g,l.lanes|=n,n=Xf(l.stateNode,d,n),Cf(l,n),!1;case 1:if(r=l.type,_=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(jr===null||!jr.has(_))))return l.flags|=65536,g&=-g,l.lanes|=g,g=Fv(g),$v(g,n,l,d),Cf(l,g),!1}l=l.return}while(l!==null);return!1}var Zf=Error(s(461)),ti=!1;function Ni(n,r,l,d){r.child=n===null?K_(r,null,l,d):Sa(r,n.child,l,d)}function Vv(n,r,l,d,g){l=l.render;var _=r.ref;if("ref"in d){var w={};for(var C in d)C!=="ref"&&(w[C]=d[C])}else w=d;return _a(r),d=jf(n,r,l,w,_,g),C=Df(),n!==null&&!ti?(Of(n,r,g),Vs(n,r,g)):(st&&C&&ff(r),r.flags|=1,Ni(n,r,d,g),r.child)}function qv(n,r,l,d,g){if(n===null){var _=l.type;return typeof _=="function"&&!uf(_)&&_.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=_,Gv(n,r,_,d,g)):(n=Cu(l.type,null,d,r,r.mode,g),n.ref=r.ref,n.return=r,r.child=n)}if(_=n.child,!rm(n,g)){var w=_.memoizedProps;if(l=l.compare,l=l!==null?l:kl,l(w,d)&&n.ref===r.ref)return Vs(n,r,g)}return r.flags|=1,n=Is(_,d),n.ref=r.ref,n.return=r,r.child=n}function Gv(n,r,l,d,g){if(n!==null){var _=n.memoizedProps;if(kl(_,d)&&n.ref===r.ref)if(ti=!1,r.pendingProps=d=_,rm(n,g))(n.flags&131072)!==0&&(ti=!0);else return r.lanes=n.lanes,Vs(n,r,g)}return Qf(n,r,l,d,g)}function Kv(n,r,l,d){var g=d.children,_=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(_=_!==null?_.baseLanes|l:l,n!==null){for(d=r.child=n.child,g=0;d!==null;)g=g|d.lanes|d.childLanes,d=d.sibling;d=g&~_}else d=0,r.child=null;return Wv(n,r,_,l,d)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&Mu(r,_!==null?_.cachePool:null),_!==null?X_(r,_):Tf(),Z_(r);else return d=r.lanes=536870912,Wv(n,r,_!==null?_.baseLanes|l:l,l,d)}else _!==null?(Mu(r,_.cachePool),X_(r,_),Tr(),r.memoizedState=null):(n!==null&&Mu(r,null),Tf(),Tr());return Ni(n,r,g,l),r.child}function Ul(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Wv(n,r,l,d,g){var _=Sf();return _=_===null?null:{parent:Jt._currentValue,pool:_},r.memoizedState={baseLanes:l,cachePool:_},n!==null&&Mu(r,null),Tf(),Z_(r),n!==null&&bo(n,r,d,!0),r.childLanes=g,null}function Gu(n,r){return r=Wu({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function Yv(n,r,l){return Sa(r,n.child,null,l),n=Gu(r,r.pendingProps),n.flags|=2,gn(r),r.memoizedState=null,n}function D5(n,r,l){var d=r.pendingProps,g=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(st){if(d.mode==="hidden")return n=Gu(r,d),r.lanes=536870912,Ul(null,n);if(Mf(r),(n=Tt)?(n=ox(n,Dn),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:xr!==null?{id:cs,overflow:us}:null,retryLane:536870912,hydrationErrors:null},l=j_(n),l.return=r,r.child=l,ki=r,Tt=null)):n=null,n===null)throw Sr(r);return r.lanes=536870912,null}return Gu(r,d)}var _=n.memoizedState;if(_!==null){var w=_.dehydrated;if(Mf(r),g)if(r.flags&256)r.flags&=-257,r=Yv(n,r,l);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(s(558));else if(ti||bo(n,r,l,!1),g=(l&n.childLanes)!==0,ti||g){if(d=Et,d!==null&&(w=qt(d,l),w!==0&&w!==_.retryLane))throw _.retryLane=w,ma(n,w),rn(d,n,w),Zf;nd(),r=Yv(n,r,l)}else n=_.treeContext,Tt=Ln(w.nextSibling),ki=r,st=!0,yr=null,Dn=!1,n!==null&&L_(r,n),r=Gu(r,d),r.flags|=4096;return r}return n=Is(n.child,{mode:d.mode,children:d.children}),n.ref=r.ref,r.child=n,n.return=r,n}function Ku(n,r){var l=r.ref;if(l===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(n===null||n.ref!==l)&&(r.flags|=4194816)}}function Qf(n,r,l,d,g){return _a(r),l=jf(n,r,l,d,void 0,g),d=Df(),n!==null&&!ti?(Of(n,r,g),Vs(n,r,g)):(st&&d&&ff(r),r.flags|=1,Ni(n,r,l,g),r.child)}function Xv(n,r,l,d,g,_){return _a(r),r.updateQueue=null,l=J_(r,d,l,g),Q_(n),d=Df(),n!==null&&!ti?(Of(n,r,_),Vs(n,r,_)):(st&&d&&ff(r),r.flags|=1,Ni(n,r,l,_),r.child)}function Zv(n,r,l,d,g){if(_a(r),r.stateNode===null){var _=fo,w=l.contextType;typeof w=="object"&&w!==null&&(_=Ci(w)),_=new l(d,_),r.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Yf,r.stateNode=_,_._reactInternals=r,_=r.stateNode,_.props=d,_.state=r.memoizedState,_.refs={},Ef(r),w=l.contextType,_.context=typeof w=="object"&&w!==null?Ci(w):fo,_.state=r.memoizedState,w=l.getDerivedStateFromProps,typeof w=="function"&&(Wf(r,l,w,d),_.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(w=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),w!==_.state&&Yf.enqueueReplaceState(_,_.state,null),Ll(r,d,_,g),Ol(),_.state=r.memoizedState),typeof _.componentDidMount=="function"&&(r.flags|=4194308),d=!0}else if(n===null){_=r.stateNode;var C=r.memoizedProps,B=Ea(l,C);_.props=B;var ee=_.context,ne=l.contextType;w=fo,typeof ne=="object"&&ne!==null&&(w=Ci(ne));var le=l.getDerivedStateFromProps;ne=typeof le=="function"||typeof _.getSnapshotBeforeUpdate=="function",C=r.pendingProps!==C,ne||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(C||ee!==w)&&zv(r,_,d,w),Er=!1;var te=r.memoizedState;_.state=te,Ll(r,d,_,g),Ol(),ee=r.memoizedState,C||te!==ee||Er?(typeof le=="function"&&(Wf(r,l,le,d),ee=r.memoizedState),(B=Er||Bv(r,l,B,d,te,ee,w))?(ne||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(r.flags|=4194308)):(typeof _.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=d,r.memoizedState=ee),_.props=d,_.state=ee,_.context=w,d=B):(typeof _.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{_=r.stateNode,kf(n,r),w=r.memoizedProps,ne=Ea(l,w),_.props=ne,le=r.pendingProps,te=_.context,ee=l.contextType,B=fo,typeof ee=="object"&&ee!==null&&(B=Ci(ee)),C=l.getDerivedStateFromProps,(ee=typeof C=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(w!==le||te!==B)&&zv(r,_,d,B),Er=!1,te=r.memoizedState,_.state=te,Ll(r,d,_,g),Ol();var ie=r.memoizedState;w!==le||te!==ie||Er||n!==null&&n.dependencies!==null&&Tu(n.dependencies)?(typeof C=="function"&&(Wf(r,l,C,d),ie=r.memoizedState),(ne=Er||Bv(r,l,ne,d,te,ie,B)||n!==null&&n.dependencies!==null&&Tu(n.dependencies))?(ee||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(d,ie,B),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(d,ie,B)),typeof _.componentDidUpdate=="function"&&(r.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof _.componentDidUpdate!="function"||w===n.memoizedProps&&te===n.memoizedState||(r.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&te===n.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=ie),_.props=d,_.state=ie,_.context=B,d=ne):(typeof _.componentDidUpdate!="function"||w===n.memoizedProps&&te===n.memoizedState||(r.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&te===n.memoizedState||(r.flags|=1024),d=!1)}return _=d,Ku(n,r),d=(r.flags&128)!==0,_||d?(_=r.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:_.render(),r.flags|=1,n!==null&&d?(r.child=Sa(r,n.child,null,g),r.child=Sa(r,null,l,g)):Ni(n,r,l,g),r.memoizedState=_.state,n=r.child):n=Vs(n,r,g),n}function Qv(n,r,l,d){return ga(),r.flags|=256,Ni(n,r,l,d),r.child}var Jf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function em(n){return{baseLanes:n,cachePool:H_()}}function tm(n,r,l){return n=n!==null?n.childLanes&~l:0,r&&(n|=_n),n}function Jv(n,r,l){var d=r.pendingProps,g=!1,_=(r.flags&128)!==0,w;if((w=_)||(w=n!==null&&n.memoizedState===null?!1:(Wt.current&2)!==0),w&&(g=!0,r.flags&=-129),w=(r.flags&32)!==0,r.flags&=-33,n===null){if(st){if(g?Nr(r):Tr(),(n=Tt)?(n=ox(n,Dn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:xr!==null?{id:cs,overflow:us}:null,retryLane:536870912,hydrationErrors:null},l=j_(n),l.return=r,r.child=l,ki=r,Tt=null)):n=null,n===null)throw Sr(r);return zm(n)?r.lanes=32:r.lanes=536870912,null}var C=d.children;return d=d.fallback,g?(Tr(),g=r.mode,C=Wu({mode:"hidden",children:C},g),d=pa(d,g,l,null),C.return=r,d.return=r,C.sibling=d,r.child=C,d=r.child,d.memoizedState=em(l),d.childLanes=tm(n,w,l),r.memoizedState=Jf,Ul(null,d)):(Nr(r),im(r,C))}var B=n.memoizedState;if(B!==null&&(C=B.dehydrated,C!==null)){if(_)r.flags&256?(Nr(r),r.flags&=-257,r=nm(n,r,l)):r.memoizedState!==null?(Tr(),r.child=n.child,r.flags|=128,r=null):(Tr(),C=d.fallback,g=r.mode,d=Wu({mode:"visible",children:d.children},g),C=pa(C,g,l,null),C.flags|=2,d.return=r,C.return=r,d.sibling=C,r.child=d,Sa(r,n.child,null,l),d=r.child,d.memoizedState=em(l),d.childLanes=tm(n,w,l),r.memoizedState=Jf,r=Ul(null,d));else if(Nr(r),zm(C)){if(w=C.nextSibling&&C.nextSibling.dataset,w)var ee=w.dgst;w=ee,d=Error(s(419)),d.stack="",d.digest=w,Tl({value:d,source:null,stack:null}),r=nm(n,r,l)}else if(ti||bo(n,r,l,!1),w=(l&n.childLanes)!==0,ti||w){if(w=Et,w!==null&&(d=qt(w,l),d!==0&&d!==B.retryLane))throw B.retryLane=d,ma(n,d),rn(w,n,d),Zf;Bm(C)||nd(),r=nm(n,r,l)}else Bm(C)?(r.flags|=192,r.child=n.child,r=null):(n=B.treeContext,Tt=Ln(C.nextSibling),ki=r,st=!0,yr=null,Dn=!1,n!==null&&L_(r,n),r=im(r,d.children),r.flags|=4096);return r}return g?(Tr(),C=d.fallback,g=r.mode,B=n.child,ee=B.sibling,d=Is(B,{mode:"hidden",children:d.children}),d.subtreeFlags=B.subtreeFlags&65011712,ee!==null?C=Is(ee,C):(C=pa(C,g,l,null),C.flags|=2),C.return=r,d.return=r,d.sibling=C,r.child=d,Ul(null,d),d=r.child,C=n.child.memoizedState,C===null?C=em(l):(g=C.cachePool,g!==null?(B=Jt._currentValue,g=g.parent!==B?{parent:B,pool:B}:g):g=H_(),C={baseLanes:C.baseLanes|l,cachePool:g}),d.memoizedState=C,d.childLanes=tm(n,w,l),r.memoizedState=Jf,Ul(n.child,d)):(Nr(r),l=n.child,n=l.sibling,l=Is(l,{mode:"visible",children:d.children}),l.return=r,l.sibling=null,n!==null&&(w=r.deletions,w===null?(r.deletions=[n],r.flags|=16):w.push(n)),r.child=l,r.memoizedState=null,l)}function im(n,r){return r=Wu({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function Wu(n,r){return n=mn(22,n,null,r),n.lanes=0,n}function nm(n,r,l){return Sa(r,n.child,null,l),n=im(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function e1(n,r,l){n.lanes|=r;var d=n.alternate;d!==null&&(d.lanes|=r),_f(n.return,r,l)}function sm(n,r,l,d,g,_){var w=n.memoizedState;w===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:g,treeForkCount:_}:(w.isBackwards=r,w.rendering=null,w.renderingStartTime=0,w.last=d,w.tail=l,w.tailMode=g,w.treeForkCount=_)}function t1(n,r,l){var d=r.pendingProps,g=d.revealOrder,_=d.tail;d=d.children;var w=Wt.current,C=(w&2)!==0;if(C?(w=w&1|2,r.flags|=128):w&=1,de(Wt,w),Ni(n,r,d,l),d=st?Nl:0,!C&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&e1(n,l,r);else if(n.tag===19)e1(n,l,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(l=r.child,g=null;l!==null;)n=l.alternate,n!==null&&Bu(n)===null&&(g=l),l=l.sibling;l=g,l===null?(g=r.child,r.child=null):(g=l.sibling,l.sibling=null),sm(r,!1,g,l,_,d);break;case"backwards":case"unstable_legacy-backwards":for(l=null,g=r.child,r.child=null;g!==null;){if(n=g.alternate,n!==null&&Bu(n)===null){r.child=g;break}n=g.sibling,g.sibling=l,l=g,g=n}sm(r,!0,l,null,_,d);break;case"together":sm(r,!1,null,null,void 0,d);break;default:r.memoizedState=null}return r.child}function Vs(n,r,l){if(n!==null&&(r.dependencies=n.dependencies),Rr|=r.lanes,(l&r.childLanes)===0)if(n!==null){if(bo(n,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(s(153));if(r.child!==null){for(n=r.child,l=Is(n,n.pendingProps),r.child=l,l.return=r;n.sibling!==null;)n=n.sibling,l=l.sibling=Is(n,n.pendingProps),l.return=r;l.sibling=null}return r.child}function rm(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&Tu(n)))}function O5(n,r,l){switch(r.tag){case 3:we(r,r.stateNode.containerInfo),wr(r,Jt,n.memoizedState.cache),ga();break;case 27:case 5:Ze(r);break;case 4:we(r,r.stateNode.containerInfo);break;case 10:wr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Mf(r),null;break;case 13:var d=r.memoizedState;if(d!==null)return d.dehydrated!==null?(Nr(r),r.flags|=128,null):(l&r.child.childLanes)!==0?Jv(n,r,l):(Nr(r),n=Vs(n,r,l),n!==null?n.sibling:null);Nr(r);break;case 19:var g=(n.flags&128)!==0;if(d=(l&r.childLanes)!==0,d||(bo(n,r,l,!1),d=(l&r.childLanes)!==0),g){if(d)return t1(n,r,l);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),de(Wt,Wt.current),d)break;return null;case 22:return r.lanes=0,Kv(n,r,l,r.pendingProps);case 24:wr(r,Jt,n.memoizedState.cache)}return Vs(n,r,l)}function i1(n,r,l){if(n!==null)if(n.memoizedProps!==r.pendingProps)ti=!0;else{if(!rm(n,l)&&(r.flags&128)===0)return ti=!1,O5(n,r,l);ti=(n.flags&131072)!==0}else ti=!1,st&&(r.flags&1048576)!==0&&O_(r,Nl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var d=r.pendingProps;if(n=xa(r.elementType),r.type=n,typeof n=="function")uf(n)?(d=Ea(n,d),r.tag=1,r=Zv(null,r,n,d,l)):(r.tag=0,r=Qf(null,r,n,d,l));else{if(n!=null){var g=n.$$typeof;if(g===A){r.tag=11,r=Vv(null,r,n,d,l);break e}else if(g===L){r.tag=14,r=qv(null,r,n,d,l);break e}}throw r=Q(n)||n,Error(s(306,r,""))}}return r;case 0:return Qf(n,r,r.type,r.pendingProps,l);case 1:return d=r.type,g=Ea(d,r.pendingProps),Zv(n,r,d,g,l);case 3:e:{if(we(r,r.stateNode.containerInfo),n===null)throw Error(s(387));d=r.pendingProps;var _=r.memoizedState;g=_.element,kf(n,r),Ll(r,d,null,l);var w=r.memoizedState;if(d=w.cache,wr(r,Jt,d),d!==_.cache&&vf(r,[Jt],l,!0),Ol(),d=w.element,_.isDehydrated)if(_={element:d,isDehydrated:!1,cache:w.cache},r.updateQueue.baseState=_,r.memoizedState=_,r.flags&256){r=Qv(n,r,d,l);break e}else if(d!==g){g=Mn(Error(s(424)),r),Tl(g),r=Qv(n,r,d,l);break e}else for(n=r.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,Tt=Ln(n.firstChild),ki=r,st=!0,yr=null,Dn=!0,l=K_(r,null,d,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(ga(),d===g){r=Vs(n,r,l);break e}Ni(n,r,d,l)}r=r.child}return r;case 26:return Ku(n,r),n===null?(l=fx(r.type,null,r.pendingProps,null))?r.memoizedState=l:st||(l=r.type,n=r.pendingProps,d=ud(se.current).createElement(l),d[Gt]=r,d[Bi]=n,Ti(d,l,n),Zt(d),r.stateNode=d):r.memoizedState=fx(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return Ze(r),n===null&&st&&(d=r.stateNode=ux(r.type,r.pendingProps,se.current),ki=r,Dn=!0,g=Tt,Br(r.type)?(Im=g,Tt=Ln(d.firstChild)):Tt=g),Ni(n,r,r.pendingProps.children,l),Ku(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&st&&((g=d=Tt)&&(d=uT(d,r.type,r.pendingProps,Dn),d!==null?(r.stateNode=d,ki=r,Tt=Ln(d.firstChild),Dn=!1,g=!0):g=!1),g||Sr(r)),Ze(r),g=r.type,_=r.pendingProps,w=n!==null?n.memoizedProps:null,d=_.children,Dm(g,_)?d=null:w!==null&&Dm(g,w)&&(r.flags|=32),r.memoizedState!==null&&(g=jf(n,r,k5,null,null,l),tc._currentValue=g),Ku(n,r),Ni(n,r,d,l),r.child;case 6:return n===null&&st&&((n=l=Tt)&&(l=dT(l,r.pendingProps,Dn),l!==null?(r.stateNode=l,ki=r,Tt=null,n=!0):n=!1),n||Sr(r)),null;case 13:return Jv(n,r,l);case 4:return we(r,r.stateNode.containerInfo),d=r.pendingProps,n===null?r.child=Sa(r,null,d,l):Ni(n,r,d,l),r.child;case 11:return Vv(n,r,r.type,r.pendingProps,l);case 7:return Ni(n,r,r.pendingProps,l),r.child;case 8:return Ni(n,r,r.pendingProps.children,l),r.child;case 12:return Ni(n,r,r.pendingProps.children,l),r.child;case 10:return d=r.pendingProps,wr(r,r.type,d.value),Ni(n,r,d.children,l),r.child;case 9:return g=r.type._context,d=r.pendingProps.children,_a(r),g=Ci(g),d=d(g),r.flags|=1,Ni(n,r,d,l),r.child;case 14:return qv(n,r,r.type,r.pendingProps,l);case 15:return Gv(n,r,r.type,r.pendingProps,l);case 19:return t1(n,r,l);case 31:return D5(n,r,l);case 22:return Kv(n,r,l,r.pendingProps);case 24:return _a(r),d=Ci(Jt),n===null?(g=Sf(),g===null&&(g=Et,_=xf(),g.pooledCache=_,_.refCount++,_!==null&&(g.pooledCacheLanes|=l),g=_),r.memoizedState={parent:d,cache:g},Ef(r),wr(r,Jt,g)):((n.lanes&l)!==0&&(kf(n,r),Ll(r,null,null,l),Ol()),g=n.memoizedState,_=r.memoizedState,g.parent!==d?(g={parent:d,cache:d},r.memoizedState=g,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=g),wr(r,Jt,d)):(d=_.cache,wr(r,Jt,d),d!==g.cache&&vf(r,[Jt],l,!0))),Ni(n,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function qs(n){n.flags|=4}function am(n,r,l,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(A1())n.flags|=8192;else throw ya=ju,wf}else n.flags&=-16777217}function n1(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!_x(r))if(A1())n.flags|=8192;else throw ya=ju,wf}function Yu(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?Pe():536870912,n.lanes|=r,Ao|=r)}function Hl(n,r){if(!st)switch(n.tailMode){case"hidden":r=n.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.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,l=0,d=0;if(r)for(var g=n.child;g!==null;)l|=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;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=n,g=g.sibling;return n.subtreeFlags|=d,n.childLanes=l,r}function L5(n,r,l){var d=r.pendingProps;switch(mf(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 l=r.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),r.memoizedState.cache!==d&&(r.flags|=2048),Hs(Jt),xe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(go(r)?qs(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,gf())),At(r),null;case 26:var g=r.type,_=r.memoizedState;return n===null?(qs(r),_!==null?(At(r),n1(r,_)):(At(r),am(r,g,null,d,l))):_?_!==n.memoizedState?(qs(r),At(r),n1(r,_)):(At(r),r.flags&=-16777217):(n=n.memoizedProps,n!==d&&qs(r),At(r),am(r,g,n,d,l)),null;case 27:if(ot(r),l=se.current,g=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==d&&qs(r);else{if(!d){if(r.stateNode===null)throw Error(s(166));return At(r),null}n=oe.current,go(r)?B_(r):(n=ux(g,d,l),r.stateNode=n,qs(r))}return At(r),null;case 5:if(ot(r),g=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==d&&qs(r);else{if(!d){if(r.stateNode===null)throw Error(s(166));return At(r),null}if(_=oe.current,go(r))B_(r);else{var w=ud(se.current);switch(_){case 1:_=w.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:_=w.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":_=w.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":_=w.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":_=w.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof d.is=="string"?w.createElement("select",{is:d.is}):w.createElement("select"),d.multiple?_.multiple=!0:d.size&&(_.size=d.size);break;default:_=typeof d.is=="string"?w.createElement(g,{is:d.is}):w.createElement(g)}}_[Gt]=r,_[Bi]=d;e:for(w=r.child;w!==null;){if(w.tag===5||w.tag===6)_.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===r)break e;for(;w.sibling===null;){if(w.return===null||w.return===r)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}r.stateNode=_;e:switch(Ti(_,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&&qs(r)}}return At(r),am(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,l),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==d&&qs(r);else{if(typeof d!="string"&&r.stateNode===null)throw Error(s(166));if(n=se.current,go(r)){if(n=r.stateNode,l=r.memoizedProps,d=null,g=ki,g!==null)switch(g.tag){case 27:case 5:d=g.memoizedProps}n[Gt]=r,n=!!(n.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||J1(n.nodeValue,l)),n||Sr(r,!0)}else n=ud(n).createTextNode(d),n[Gt]=r,r.stateNode=n}return At(r),null;case 31:if(l=r.memoizedState,n===null||n.memoizedState!==null){if(d=go(r),l!==null){if(n===null){if(!d)throw Error(s(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(557));n[Gt]=r}else ga(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;At(r),n=!1}else l=gf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return r.flags&256?(gn(r),r):(gn(r),null);if((r.flags&128)!==0)throw Error(s(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(s(318));if(g=r.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(s(317));g[Gt]=r}else ga(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;At(r),g=!1}else g=gf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=g),g=!0;if(!g)return r.flags&256?(gn(r),r):(gn(r),null)}return gn(r),(r.flags&128)!==0?(r.lanes=l,r):(l=d!==null,n=n!==null&&n.memoizedState!==null,l&&(d=r.child,g=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(g=d.alternate.memoizedState.cachePool.pool),_=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(_=d.memoizedState.cachePool.pool),_!==g&&(d.flags|=2048)),l!==n&&l&&(r.child.flags|=8192),Yu(r,r.updateQueue),At(r),null);case 4:return xe(),n===null&&Tm(r.stateNode.containerInfo),At(r),null;case 10:return Hs(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,_=d.rendering,_===null)if(g)Hl(d,!1);else{if(Ht!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(_=Bu(n),_!==null){for(r.flags|=128,Hl(d,!1),n=_.updateQueue,r.updateQueue=n,Yu(r,n),r.subtreeFlags=0,n=l,l=r.child;l!==null;)R_(l,n),l=l.sibling;return de(Wt,Wt.current&1|2),st&&Ps(r,d.treeForkCount),r.child}n=n.sibling}d.tail!==null&&Bt()>ed&&(r.flags|=128,g=!0,Hl(d,!1),r.lanes=4194304)}else{if(!g)if(n=Bu(_),n!==null){if(r.flags|=128,g=!0,n=n.updateQueue,r.updateQueue=n,Yu(r,n),Hl(d,!0),d.tail===null&&d.tailMode==="hidden"&&!_.alternate&&!st)return At(r),null}else 2*Bt()-d.renderingStartTime>ed&&l!==536870912&&(r.flags|=128,g=!0,Hl(d,!1),r.lanes=4194304);d.isBackwards?(_.sibling=r.child,r.child=_):(n=d.last,n!==null?n.sibling=_:r.child=_,d.last=_)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=Bt(),n.sibling=null,l=Wt.current,de(Wt,g?l&1|2:l&1),st&&Ps(r,d.treeForkCount),n):(At(r),null);case 22:case 23:return gn(r),Af(),d=r.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(r.flags|=8192):d&&(r.flags|=8192),d?(l&536870912)!==0&&(r.flags&128)===0&&(At(r),r.subtreeFlags&6&&(r.flags|=8192)):At(r),l=r.updateQueue,l!==null&&Yu(r,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==l&&(r.flags|=2048),n!==null&&W(va),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Hs(Jt),At(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function B5(n,r){switch(mf(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return Hs(Jt),xe(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return ot(r),null;case 31:if(r.memoizedState!==null){if(gn(r),r.alternate===null)throw Error(s(340));ga()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(gn(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(s(340));ga()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return W(Wt),null;case 4:return xe(),null;case 10:return Hs(r.type),null;case 22:case 23:return gn(r),Af(),n!==null&&W(va),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return Hs(Jt),null;case 25:return null;default:return null}}function s1(n,r){switch(mf(r),r.tag){case 3:Hs(Jt),xe();break;case 26:case 27:case 5:ot(r);break;case 4:xe();break;case 31:r.memoizedState!==null&&gn(r);break;case 13:gn(r);break;case 19:W(Wt);break;case 10:Hs(r.type);break;case 22:case 23:gn(r),Af(),n!==null&&W(va);break;case 24:Hs(Jt)}}function Fl(n,r){try{var l=r.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var g=d.next;l=g;do{if((l.tag&n)===n){d=void 0;var _=l.create,w=l.inst;d=_(),w.destroy=d}l=l.next}while(l!==g)}}catch(C){bt(r,r.return,C)}}function Ar(n,r,l){try{var d=r.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var _=g.next;d=_;do{if((d.tag&n)===n){var w=d.inst,C=w.destroy;if(C!==void 0){w.destroy=void 0,g=r;var B=l,ee=C;try{ee()}catch(ne){bt(g,B,ne)}}}d=d.next}while(d!==_)}}catch(ne){bt(r,r.return,ne)}}function r1(n){var r=n.updateQueue;if(r!==null){var l=n.stateNode;try{Y_(r,l)}catch(d){bt(n,n.return,d)}}}function a1(n,r,l){l.props=Ea(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(d){bt(n,r,d)}}function $l(n,r){try{var l=n.ref;if(l!==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 l=="function"?n.refCleanup=l(d):l.current=d}}catch(g){bt(n,r,g)}}function ds(n,r){var l=n.ref,d=n.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(g){bt(n,r,g)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(g){bt(n,r,g)}else l.current=null}function o1(n){var r=n.type,l=n.memoizedProps,d=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(g){bt(n,n.return,g)}}function om(n,r,l){try{var d=n.stateNode;sT(d,n.type,l,r),d[Bi]=r}catch(g){bt(n,n.return,g)}}function l1(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Br(n.type)||n.tag===4}function lm(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||l1(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&&Br(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 cm(n,r,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(n),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=be));else if(d!==4&&(d===27&&Br(n.type)&&(l=n.stateNode,r=null),n=n.child,n!==null))for(cm(n,r,l),n=n.sibling;n!==null;)cm(n,r,l),n=n.sibling}function Xu(n,r,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,r?l.insertBefore(n,r):l.appendChild(n);else if(d!==4&&(d===27&&Br(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(Xu(n,r,l),n=n.sibling;n!==null;)Xu(n,r,l),n=n.sibling}function c1(n){var r=n.stateNode,l=n.memoizedProps;try{for(var d=n.type,g=r.attributes;g.length;)r.removeAttributeNode(g[0]);Ti(r,d,l),r[Gt]=n,r[Bi]=l}catch(_){bt(n,n.return,_)}}var Gs=!1,ii=!1,um=!1,u1=typeof WeakSet=="function"?WeakSet:Set,gi=null;function z5(n,r){if(n=n.containerInfo,Rm=bd,n=S_(n),nf(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var g=d.anchorOffset,_=d.focusNode;d=d.focusOffset;try{l.nodeType,_.nodeType}catch{l=null;break e}var w=0,C=-1,B=-1,ee=0,ne=0,le=n,te=null;t:for(;;){for(var ie;le!==l||g!==0&&le.nodeType!==3||(C=w+g),le!==_||d!==0&&le.nodeType!==3||(B=w+d),le.nodeType===3&&(w+=le.nodeValue.length),(ie=le.firstChild)!==null;)te=le,le=ie;for(;;){if(le===n)break t;if(te===l&&++ee===g&&(C=w),te===_&&++ne===d&&(B=w),(ie=le.nextSibling)!==null)break;le=te,te=le.parentNode}le=ie}l=C===-1||B===-1?null:{start:C,end:B}}else l=null}l=l||{start:0,end:0}}else l=null;for(jm={focusedElem:n,selectionRange:l},bd=!1,gi=r;gi!==null;)if(r=gi,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,gi=n;else for(;gi!==null;){switch(r=gi,_=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(l=0;l<n.length;l++)g=n[l],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&_!==null){n=void 0,l=r,g=_.memoizedProps,_=_.memoizedState,d=l.stateNode;try{var Ne=Ea(l.type,g);n=d.getSnapshotBeforeUpdate(Ne,_),d.__reactInternalSnapshotBeforeUpdate=n}catch(Le){bt(l,l.return,Le)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,l=n.nodeType,l===9)Lm(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Lm(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(s(163))}if(n=r.sibling,n!==null){n.return=r.return,gi=n;break}gi=r.return}}function d1(n,r,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:Ws(n,l),d&4&&Fl(5,l);break;case 1:if(Ws(n,l),d&4)if(n=l.stateNode,r===null)try{n.componentDidMount()}catch(w){bt(l,l.return,w)}else{var g=Ea(l.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(g,r,n.__reactInternalSnapshotBeforeUpdate)}catch(w){bt(l,l.return,w)}}d&64&&r1(l),d&512&&$l(l,l.return);break;case 3:if(Ws(n,l),d&64&&(n=l.updateQueue,n!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{Y_(n,r)}catch(w){bt(l,l.return,w)}}break;case 27:r===null&&d&4&&c1(l);case 26:case 5:Ws(n,l),r===null&&d&4&&o1(l),d&512&&$l(l,l.return);break;case 12:Ws(n,l);break;case 31:Ws(n,l),d&4&&m1(n,l);break;case 13:Ws(n,l),d&4&&p1(n,l),d&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=G5.bind(null,l),hT(n,l))));break;case 22:if(d=l.memoizedState!==null||Gs,!d){r=r!==null&&r.memoizedState!==null||ii,g=Gs;var _=ii;Gs=d,(ii=r)&&!_?Ys(n,l,(l.subtreeFlags&8772)!==0):Ws(n,l),Gs=g,ii=_}break;case 30:break;default:Ws(n,l)}}function h1(n){var r=n.alternate;r!==null&&(n.alternate=null,h1(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&fl(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,en=!1;function Ks(n,r,l){for(l=l.child;l!==null;)f1(n,r,l),l=l.sibling}function f1(n,r,l){if(pi&&typeof pi.onCommitFiberUnmount=="function")try{pi.onCommitFiberUnmount(js,l)}catch{}switch(l.tag){case 26:ii||ds(l,r),Ks(n,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:ii||ds(l,r);var d=Dt,g=en;Br(l.type)&&(Dt=l.stateNode,en=!1),Ks(n,r,l),Ql(l.stateNode),Dt=d,en=g;break;case 5:ii||ds(l,r);case 6:if(d=Dt,g=en,Dt=null,Ks(n,r,l),Dt=d,en=g,Dt!==null)if(en)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(l.stateNode)}catch(_){bt(l,r,_)}else try{Dt.removeChild(l.stateNode)}catch(_){bt(l,r,_)}break;case 18:Dt!==null&&(en?(n=Dt,rx(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),zo(n)):rx(Dt,l.stateNode));break;case 4:d=Dt,g=en,Dt=l.stateNode.containerInfo,en=!0,Ks(n,r,l),Dt=d,en=g;break;case 0:case 11:case 14:case 15:Ar(2,l,r),ii||Ar(4,l,r),Ks(n,r,l);break;case 1:ii||(ds(l,r),d=l.stateNode,typeof d.componentWillUnmount=="function"&&a1(l,r,d)),Ks(n,r,l);break;case 21:Ks(n,r,l);break;case 22:ii=(d=ii)||l.memoizedState!==null,Ks(n,r,l),ii=d;break;default:Ks(n,r,l)}}function m1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{zo(n)}catch(l){bt(r,r.return,l)}}}function p1(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(l){bt(r,r.return,l)}}function I5(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new u1),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new u1),r;default:throw Error(s(435,n.tag))}}function Zu(n,r){var l=I5(n);r.forEach(function(d){if(!l.has(d)){l.add(d);var g=K5.bind(null,n,d);d.then(g,g)}})}function tn(n,r){var l=r.deletions;if(l!==null)for(var d=0;d<l.length;d++){var g=l[d],_=n,w=r,C=w;e:for(;C!==null;){switch(C.tag){case 27:if(Br(C.type)){Dt=C.stateNode,en=!1;break e}break;case 5:Dt=C.stateNode,en=!1;break e;case 3:case 4:Dt=C.stateNode.containerInfo,en=!0;break e}C=C.return}if(Dt===null)throw Error(s(160));f1(_,w,g),Dt=null,en=!1,_=g.alternate,_!==null&&(_.return=null),g.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)g1(r,n),r=r.sibling}var Jn=null;function g1(n,r){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:tn(r,n),nn(n),d&4&&(Ar(3,n,n.return),Fl(3,n),Ar(5,n,n.return));break;case 1:tn(r,n),nn(n),d&512&&(ii||l===null||ds(l,l.return)),d&64&&Gs&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var g=Jn;if(tn(r,n),nn(n),d&512&&(ii||l===null||ds(l,l.return)),d&4){var _=l!==null?l.memoizedState:null;if(d=n.memoizedState,l===null)if(d===null)if(n.stateNode===null){e:{d=n.type,l=n.memoizedProps,g=g.ownerDocument||g;t:switch(d){case"title":_=g.getElementsByTagName("title")[0],(!_||_[la]||_[Gt]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=g.createElement(d),g.head.insertBefore(_,g.querySelector("head > title"))),Ti(_,d,l),_[Gt]=n,Zt(_),d=_;break e;case"link":var w=gx("link","href",g).get(d+(l.href||""));if(w){for(var C=0;C<w.length;C++)if(_=w[C],_.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&_.getAttribute("rel")===(l.rel==null?null:l.rel)&&_.getAttribute("title")===(l.title==null?null:l.title)&&_.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){w.splice(C,1);break t}}_=g.createElement(d),Ti(_,d,l),g.head.appendChild(_);break;case"meta":if(w=gx("meta","content",g).get(d+(l.content||""))){for(C=0;C<w.length;C++)if(_=w[C],_.getAttribute("content")===(l.content==null?null:""+l.content)&&_.getAttribute("name")===(l.name==null?null:l.name)&&_.getAttribute("property")===(l.property==null?null:l.property)&&_.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&_.getAttribute("charset")===(l.charSet==null?null:l.charSet)){w.splice(C,1);break t}}_=g.createElement(d),Ti(_,d,l),g.head.appendChild(_);break;default:throw Error(s(468,d))}_[Gt]=n,Zt(_),d=_}n.stateNode=d}else bx(g,n.type,n.stateNode);else n.stateNode=px(g,d,n.memoizedProps);else _!==d?(_===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):_.count--,d===null?bx(g,n.type,n.stateNode):px(g,d,n.memoizedProps)):d===null&&n.stateNode!==null&&om(n,n.memoizedProps,l.memoizedProps)}break;case 27:tn(r,n),nn(n),d&512&&(ii||l===null||ds(l,l.return)),l!==null&&d&4&&om(n,n.memoizedProps,l.memoizedProps);break;case 5:if(tn(r,n),nn(n),d&512&&(ii||l===null||ds(l,l.return)),n.flags&32){g=n.stateNode;try{ze(g,"")}catch(Ne){bt(n,n.return,Ne)}}d&4&&n.stateNode!=null&&(g=n.memoizedProps,om(n,g,l!==null?l.memoizedProps:g)),d&1024&&(um=!0);break;case 6:if(tn(r,n),nn(n),d&4){if(n.stateNode===null)throw Error(s(162));d=n.memoizedProps,l=n.stateNode;try{l.nodeValue=d}catch(Ne){bt(n,n.return,Ne)}}break;case 3:if(fd=null,g=Jn,Jn=dd(r.containerInfo),tn(r,n),Jn=g,nn(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{zo(r.containerInfo)}catch(Ne){bt(n,n.return,Ne)}um&&(um=!1,b1(n));break;case 4:d=Jn,Jn=dd(n.stateNode.containerInfo),tn(r,n),nn(n),Jn=d;break;case 12:tn(r,n),nn(n);break;case 31:tn(r,n),nn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Zu(n,d)));break;case 13:tn(r,n),nn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ju=Bt()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Zu(n,d)));break;case 22:g=n.memoizedState!==null;var B=l!==null&&l.memoizedState!==null,ee=Gs,ne=ii;if(Gs=ee||g,ii=ne||B,tn(r,n),ii=ne,Gs=ee,nn(n),d&8192)e:for(r=n.stateNode,r._visibility=g?r._visibility&-2:r._visibility|1,g&&(l===null||B||Gs||ii||ka(n)),l=null,r=n;;){if(r.tag===5||r.tag===26){if(l===null){B=l=r;try{if(_=B.stateNode,g)w=_.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{C=B.stateNode;var le=B.memoizedProps.style,te=le!=null&&le.hasOwnProperty("display")?le.display:null;C.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(Ne){bt(B,B.return,Ne)}}}else if(r.tag===6){if(l===null){B=r;try{B.stateNode.nodeValue=g?"":B.memoizedProps}catch(Ne){bt(B,B.return,Ne)}}}else if(r.tag===18){if(l===null){B=r;try{var ie=B.stateNode;g?ax(ie,!0):ax(B.stateNode,!1)}catch(Ne){bt(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;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}d&4&&(d=n.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,Zu(n,l))));break;case 19:tn(r,n),nn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Zu(n,d)));break;case 30:break;case 21:break;default:tn(r,n),nn(n)}}function nn(n){var r=n.flags;if(r&2){try{for(var l,d=n.return;d!==null;){if(l1(d)){l=d;break}d=d.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var g=l.stateNode,_=lm(n);Xu(n,_,g);break;case 5:var w=l.stateNode;l.flags&32&&(ze(w,""),l.flags&=-33);var C=lm(n);Xu(n,C,w);break;case 3:case 4:var B=l.stateNode.containerInfo,ee=lm(n);cm(n,ee,B);break;default:throw Error(s(161))}}catch(ne){bt(n,n.return,ne)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function b1(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;b1(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function Ws(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)d1(n,r.alternate,r),r=r.sibling}function ka(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:Ar(4,r,r.return),ka(r);break;case 1:ds(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&a1(r,r.return,l),ka(r);break;case 27:Ql(r.stateNode);case 26:case 5:ds(r,r.return),ka(r);break;case 22:r.memoizedState===null&&ka(r);break;case 30:ka(r);break;default:ka(r)}n=n.sibling}}function Ys(n,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var d=r.alternate,g=n,_=r,w=_.flags;switch(_.tag){case 0:case 11:case 15:Ys(g,_,l),Fl(4,_);break;case 1:if(Ys(g,_,l),d=_,g=d.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(ee){bt(d,d.return,ee)}if(d=_,g=d.updateQueue,g!==null){var C=d.stateNode;try{var B=g.shared.hiddenCallbacks;if(B!==null)for(g.shared.hiddenCallbacks=null,g=0;g<B.length;g++)W_(B[g],C)}catch(ee){bt(d,d.return,ee)}}l&&w&64&&r1(_),$l(_,_.return);break;case 27:c1(_);case 26:case 5:Ys(g,_,l),l&&d===null&&w&4&&o1(_),$l(_,_.return);break;case 12:Ys(g,_,l);break;case 31:Ys(g,_,l),l&&w&4&&m1(g,_);break;case 13:Ys(g,_,l),l&&w&4&&p1(g,_);break;case 22:_.memoizedState===null&&Ys(g,_,l),$l(_,_.return);break;case 30:break;default:Ys(g,_,l)}r=r.sibling}}function dm(n,r){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&Al(l))}function hm(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Al(n))}function es(n,r,l,d){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)_1(n,r,l,d),r=r.sibling}function _1(n,r,l,d){var g=r.flags;switch(r.tag){case 0:case 11:case 15:es(n,r,l,d),g&2048&&Fl(9,r);break;case 1:es(n,r,l,d);break;case 3:es(n,r,l,d),g&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Al(n)));break;case 12:if(g&2048){es(n,r,l,d),n=r.stateNode;try{var _=r.memoizedProps,w=_.id,C=_.onPostCommit;typeof C=="function"&&C(w,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(B){bt(r,r.return,B)}}else es(n,r,l,d);break;case 31:es(n,r,l,d);break;case 13:es(n,r,l,d);break;case 23:break;case 22:_=r.stateNode,w=r.alternate,r.memoizedState!==null?_._visibility&2?es(n,r,l,d):Vl(n,r):_._visibility&2?es(n,r,l,d):(_._visibility|=2,Co(n,r,l,d,(r.subtreeFlags&10256)!==0||!1)),g&2048&&dm(w,r);break;case 24:es(n,r,l,d),g&2048&&hm(r.alternate,r);break;default:es(n,r,l,d)}}function Co(n,r,l,d,g){for(g=g&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var _=n,w=r,C=l,B=d,ee=w.flags;switch(w.tag){case 0:case 11:case 15:Co(_,w,C,B,g),Fl(8,w);break;case 23:break;case 22:var ne=w.stateNode;w.memoizedState!==null?ne._visibility&2?Co(_,w,C,B,g):Vl(_,w):(ne._visibility|=2,Co(_,w,C,B,g)),g&&ee&2048&&dm(w.alternate,w);break;case 24:Co(_,w,C,B,g),g&&ee&2048&&hm(w.alternate,w);break;default:Co(_,w,C,B,g)}r=r.sibling}}function Vl(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=n,d=r,g=d.flags;switch(d.tag){case 22:Vl(l,d),g&2048&&dm(d.alternate,d);break;case 24:Vl(l,d),g&2048&&hm(d.alternate,d);break;default:Vl(l,d)}r=r.sibling}}var ql=8192;function No(n,r,l){if(n.subtreeFlags&ql)for(n=n.child;n!==null;)v1(n,r,l),n=n.sibling}function v1(n,r,l){switch(n.tag){case 26:No(n,r,l),n.flags&ql&&n.memoizedState!==null&&ET(l,Jn,n.memoizedState,n.memoizedProps);break;case 5:No(n,r,l);break;case 3:case 4:var d=Jn;Jn=dd(n.stateNode.containerInfo),No(n,r,l),Jn=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=ql,ql=16777216,No(n,r,l),ql=d):No(n,r,l));break;default:No(n,r,l)}}function x1(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 Gl(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var d=r[l];gi=d,S1(d,n)}x1(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)y1(n),n=n.sibling}function y1(n){switch(n.tag){case 0:case 11:case 15:Gl(n),n.flags&2048&&Ar(9,n,n.return);break;case 3:Gl(n);break;case 12:Gl(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,Qu(n)):Gl(n);break;default:Gl(n)}}function Qu(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var d=r[l];gi=d,S1(d,n)}x1(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Ar(8,r,r.return),Qu(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,Qu(r));break;default:Qu(r)}n=n.sibling}}function S1(n,r){for(;gi!==null;){var l=gi;switch(l.tag){case 0:case 11:case 15:Ar(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Al(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,gi=d;else e:for(l=n;gi!==null;){d=gi;var g=d.sibling,_=d.return;if(h1(d),d===l){gi=null;break e}if(g!==null){g.return=_,gi=g;break e}gi=_}}}var P5={getCacheForType:function(n){var r=Ci(Jt),l=r.data.get(n);return l===void 0&&(l=n(),r.data.set(n,l)),l},cacheSignal:function(){return Ci(Jt).controller.signal}},U5=typeof WeakMap=="function"?WeakMap:Map,dt=0,Et=null,Qe=null,it=0,gt=0,bn=null,Mr=!1,To=!1,fm=!1,Xs=0,Ht=0,Rr=0,Ca=0,mm=0,_n=0,Ao=0,Kl=null,sn=null,pm=!1,Ju=0,w1=0,ed=1/0,td=null,jr=null,li=0,Dr=null,Mo=null,Zs=0,gm=0,bm=null,E1=null,Wl=0,_m=null;function vn(){return(dt&2)!==0&&it!==0?it&-it:D.T!==null?Em():to()}function k1(){if(_n===0)if((it&536870912)===0||st){var n=Zn;Zn<<=1,(Zn&3932160)===0&&(Zn=262144),_n=n}else _n=536870912;return n=pn.current,n!==null&&(n.flags|=32),_n}function rn(n,r,l){(n===Et&&(gt===2||gt===9)||n.cancelPendingCommit!==null)&&(Ro(n,0),Or(n,it,_n,!1)),wt(n,l),((dt&2)===0||n!==Et)&&(n===Et&&((dt&2)===0&&(Ca|=l),Ht===4&&Or(n,it,_n,!1)),hs(n))}function C1(n,r,l){if((dt&6)!==0)throw Error(s(327));var d=!l&&(r&127)===0&&(r&n.expiredLanes)===0||re(n,r),g=d?$5(n,r):xm(n,r,!0),_=d;do{if(g===0){To&&!d&&Or(n,r,0,!1);break}else{if(l=n.current.alternate,_&&!H5(l)){g=xm(n,r,!1),_=!1;continue}if(g===2){if(_=r,n.errorRecoveryDisabledLanes&_)var w=0;else w=n.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){r=w;e:{var C=n;g=Kl;var B=C.current.memoizedState.isDehydrated;if(B&&(Ro(C,w).flags|=256),w=xm(C,w,!1),w!==2){if(fm&&!B){C.errorRecoveryDisabledLanes|=_,Ca|=_,g=4;break e}_=sn,sn=g,_!==null&&(sn===null?sn=_:sn.push.apply(sn,_))}g=w}if(_=!1,g!==2)continue}}if(g===1){Ro(n,0),Or(n,r,0,!0);break}e:{switch(d=n,_=g,_){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:Or(d,r,_n,!Mr);break e;case 2:sn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(g=Ju+300-Bt(),10<g)){if(Or(d,r,_n,!Mr),z(d,0,!0)!==0)break e;Zs=r,d.timeoutHandle=nx(N1.bind(null,d,l,sn,td,pm,r,_n,Ca,Ao,Mr,_,"Throttled",-0,0),g);break e}N1(d,l,sn,td,pm,r,_n,Ca,Ao,Mr,_,null,-0,0)}}break}while(!0);hs(n)}function N1(n,r,l,d,g,_,w,C,B,ee,ne,le,te,ie){if(n.timeoutHandle=-1,le=r.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:be},v1(r,_,le);var Ne=(_&62914560)===_?Ju-Bt():(_&4194048)===_?w1-Bt():0;if(Ne=kT(le,Ne),Ne!==null){Zs=_,n.cancelPendingCommit=Ne(L1.bind(null,n,r,_,l,d,g,w,C,B,ne,le,null,te,ie)),Or(n,_,w,!ee);return}}L1(n,r,_,l,d,g,w,C,B)}function H5(n){for(var r=n;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var g=l[d],_=g.getSnapshot;g=g.value;try{if(!fn(_(),g))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;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 Or(n,r,l,d){r&=~mm,r&=~Ca,n.suspendedLanes|=r,n.pingedLanes&=~r,d&&(n.warmLanes|=r),d=n.expirationTimes;for(var g=r;0<g;){var _=31-wi(g),w=1<<_;d[_]=-1,g&=~w}l!==0&&Ee(n,l,r)}function id(){return(dt&6)===0?(Yl(0),!1):!0}function vm(){if(Qe!==null){if(gt===0)var n=Qe.return;else n=Qe,Us=ba=null,Lf(n),yo=null,Rl=0,n=Qe;for(;n!==null;)s1(n.alternate,n),n=n.return;Qe=null}}function Ro(n,r){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,oT(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Zs=0,vm(),Et=n,Qe=l=Is(n.current,null),it=r,gt=0,bn=null,Mr=!1,To=re(n,r),fm=!1,Ao=_n=mm=Ca=Rr=Ht=0,sn=Kl=null,pm=!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-wi(d),_=1<<g;r|=n[g],d&=~_}return Xs=r,wu(),l}function T1(n,r){$e=null,D.H=Pl,r===xo||r===Ru?(r=V_(),gt=3):r===wf?(r=V_(),gt=4):gt=r===Zf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,bn=r,Qe===null&&(Ht=1,qu(n,Mn(r,n.current)))}function A1(){var n=pn.current;return n===null?!0:(it&4194048)===it?On===null:(it&62914560)===it||(it&536870912)!==0?n===On:!1}function M1(){var n=D.H;return D.H=Pl,n===null?Pl:n}function R1(){var n=D.A;return D.A=P5,n}function nd(){Ht=4,Mr||(it&4194048)!==it&&pn.current!==null||(To=!0),(Rr&134217727)===0&&(Ca&134217727)===0||Et===null||Or(Et,it,_n,!1)}function xm(n,r,l){var d=dt;dt|=2;var g=M1(),_=R1();(Et!==n||it!==r)&&(td=null,Ro(n,r)),r=!1;var w=Ht;e:do try{if(gt!==0&&Qe!==null){var C=Qe,B=bn;switch(gt){case 8:vm(),w=6;break e;case 3:case 2:case 9:case 6:pn.current===null&&(r=!0);var ee=gt;if(gt=0,bn=null,jo(n,C,B,ee),l&&To){w=0;break e}break;default:ee=gt,gt=0,bn=null,jo(n,C,B,ee)}}F5(),w=Ht;break}catch(ne){T1(n,ne)}while(!0);return r&&n.shellSuspendCounter++,Us=ba=null,dt=d,D.H=g,D.A=_,Qe===null&&(Et=null,it=0,wu()),w}function F5(){for(;Qe!==null;)j1(Qe)}function $5(n,r){var l=dt;dt|=2;var d=M1(),g=R1();Et!==n||it!==r?(td=null,ed=Bt()+500,Ro(n,r)):To=re(n,r);e:do try{if(gt!==0&&Qe!==null){r=Qe;var _=bn;t:switch(gt){case 1:gt=0,bn=null,jo(n,r,_,1);break;case 2:case 9:if(F_(_)){gt=0,bn=null,D1(r);break}r=function(){gt!==2&&gt!==9||Et!==n||(gt=7),hs(n)},_.then(r,r);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:F_(_)?(gt=0,bn=null,D1(r)):(gt=0,bn=null,jo(n,r,_,7));break;case 5:var w=null;switch(Qe.tag){case 26:w=Qe.memoizedState;case 5:case 27:var C=Qe;if(w?_x(w):C.stateNode.complete){gt=0,bn=null;var B=C.sibling;if(B!==null)Qe=B;else{var ee=C.return;ee!==null?(Qe=ee,sd(ee)):Qe=null}break t}}gt=0,bn=null,jo(n,r,_,5);break;case 6:gt=0,bn=null,jo(n,r,_,6);break;case 8:vm(),Ht=6;break e;default:throw Error(s(462))}}V5();break}catch(ne){T1(n,ne)}while(!0);return Us=ba=null,D.H=d,D.A=g,dt=l,Qe!==null?0:(Et=null,it=0,wu(),Ht)}function V5(){for(;Qe!==null&&!aa();)j1(Qe)}function j1(n){var r=i1(n.alternate,n,Xs);n.memoizedProps=n.pendingProps,r===null?sd(n):Qe=r}function D1(n){var r=n,l=r.alternate;switch(r.tag){case 15:case 0:r=Xv(l,r,r.pendingProps,r.type,void 0,it);break;case 11:r=Xv(l,r,r.pendingProps,r.type.render,r.ref,it);break;case 5:Lf(r);default:s1(l,r),r=Qe=R_(r,Xs),r=i1(l,r,Xs)}n.memoizedProps=n.pendingProps,r===null?sd(n):Qe=r}function jo(n,r,l,d){Us=ba=null,Lf(r),yo=null,Rl=0;var g=r.return;try{if(j5(n,g,r,l,it)){Ht=1,qu(n,Mn(l,n.current)),Qe=null;return}}catch(_){if(g!==null)throw Qe=g,_;Ht=1,qu(n,Mn(l,n.current)),Qe=null;return}r.flags&32768?(st||d===1?n=!0:To||(it&536870912)!==0?n=!1:(Mr=n=!0,(d===2||d===9||d===3||d===6)&&(d=pn.current,d!==null&&d.tag===13&&(d.flags|=16384))),O1(r,n)):sd(r)}function sd(n){var r=n;do{if((r.flags&32768)!==0){O1(r,Mr);return}n=r.return;var l=L5(r.alternate,r,Xs);if(l!==null){Qe=l;return}if(r=r.sibling,r!==null){Qe=r;return}Qe=r=n}while(r!==null);Ht===0&&(Ht=5)}function O1(n,r){do{var l=B5(n.alternate,n);if(l!==null){l.flags&=32767,Qe=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(n=n.sibling,n!==null)){Qe=n;return}Qe=n=l}while(n!==null);Ht=6,Qe=null}function L1(n,r,l,d,g,_,w,C,B){n.cancelPendingCommit=null;do rd();while(li!==0);if((dt&6)!==0)throw Error(s(327));if(r!==null){if(r===n.current)throw Error(s(177));if(_=r.lanes|r.childLanes,_|=lf,Ae(n,l,_,w,C,B),n===Et&&(Qe=Et=null,it=0),Mo=r,Dr=n,Zs=l,gm=_,bm=g,E1=d,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,W5(Rs,function(){return U1(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||d){d=D.T,D.T=null,g=Y.p,Y.p=2,w=dt,dt|=4;try{z5(n,r,l)}finally{dt=w,Y.p=g,D.T=d}}li=1,B1(),z1(),I1()}}function B1(){if(li===1){li=0;var n=Dr,r=Mo,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=D.T,D.T=null;var d=Y.p;Y.p=2;var g=dt;dt|=4;try{g1(r,n);var _=jm,w=S_(n.containerInfo),C=_.focusedElem,B=_.selectionRange;if(w!==C&&C&&C.ownerDocument&&y_(C.ownerDocument.documentElement,C)){if(B!==null&&nf(C)){var ee=B.start,ne=B.end;if(ne===void 0&&(ne=ee),"selectionStart"in C)C.selectionStart=ee,C.selectionEnd=Math.min(ne,C.value.length);else{var le=C.ownerDocument||document,te=le&&le.defaultView||window;if(te.getSelection){var ie=te.getSelection(),Ne=C.textContent.length,Le=Math.min(B.start,Ne),xt=B.end===void 0?Le:Math.min(B.end,Ne);!ie.extend&&Le>xt&&(w=xt,xt=Le,Le=w);var G=x_(C,Le),U=x_(C,xt);if(G&&U&&(ie.rangeCount!==1||ie.anchorNode!==G.node||ie.anchorOffset!==G.offset||ie.focusNode!==U.node||ie.focusOffset!==U.offset)){var J=le.createRange();J.setStart(G.node,G.offset),ie.removeAllRanges(),Le>xt?(ie.addRange(J),ie.extend(U.node,U.offset)):(J.setEnd(U.node,U.offset),ie.addRange(J))}}}}for(le=[],ie=C;ie=ie.parentNode;)ie.nodeType===1&&le.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<le.length;C++){var ae=le[C];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}bd=!!Rm,jm=Rm=null}finally{dt=g,Y.p=d,D.T=l}}n.current=r,li=2}}function z1(){if(li===2){li=0;var n=Dr,r=Mo,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=D.T,D.T=null;var d=Y.p;Y.p=2;var g=dt;dt|=4;try{d1(n,r.alternate,r)}finally{dt=g,Y.p=d,D.T=l}}li=3}}function I1(){if(li===4||li===3){li=0,Za();var n=Dr,r=Mo,l=Zs,d=E1;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?li=5:(li=0,Mo=Dr=null,P1(n,n.pendingLanes));var g=n.pendingLanes;if(g===0&&(jr=null),Ds(l),r=r.stateNode,pi&&typeof pi.onCommitFiberRoot=="function")try{pi.onCommitFiberRoot(js,r,void 0,(r.current.flags&128)===128)}catch{}if(d!==null){r=D.T,g=Y.p,Y.p=2,D.T=null;try{for(var _=n.onRecoverableError,w=0;w<d.length;w++){var C=d[w];_(C.value,{componentStack:C.stack})}}finally{D.T=r,Y.p=g}}(Zs&3)!==0&&rd(),hs(n),g=n.pendingLanes,(l&261930)!==0&&(g&42)!==0?n===_m?Wl++:(Wl=0,_m=n):Wl=0,Yl(0)}}function P1(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,Al(r)))}function rd(){return B1(),z1(),I1(),U1()}function U1(){if(li!==5)return!1;var n=Dr,r=gm;gm=0;var l=Ds(Zs),d=D.T,g=Y.p;try{Y.p=32>l?32:l,D.T=null,l=bm,bm=null;var _=Dr,w=Zs;if(li=0,Mo=Dr=null,Zs=0,(dt&6)!==0)throw Error(s(331));var C=dt;if(dt|=4,y1(_.current),_1(_,_.current,w,l),dt=C,Yl(0,!1),pi&&typeof pi.onPostCommitFiberRoot=="function")try{pi.onPostCommitFiberRoot(js,_)}catch{}return!0}finally{Y.p=g,D.T=d,P1(n,r)}}function H1(n,r,l){r=Mn(l,r),r=Xf(n.stateNode,r,2),n=Cr(n,r,2),n!==null&&(wt(n,2),hs(n))}function bt(n,r,l){if(n.tag===3)H1(n,n,l);else for(;r!==null;){if(r.tag===3){H1(r,n,l);break}else if(r.tag===1){var d=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(jr===null||!jr.has(d))){n=Mn(l,n),l=Fv(2),d=Cr(r,l,2),d!==null&&($v(l,d,r,n),wt(d,2),hs(d));break}}r=r.return}}function ym(n,r,l){var d=n.pingCache;if(d===null){d=n.pingCache=new U5;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(l)||(fm=!0,g.add(l),n=q5.bind(null,n,r,l),r.then(n,n))}function q5(n,r,l){var d=n.pingCache;d!==null&&d.delete(r),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,Et===n&&(it&l)===l&&(Ht===4||Ht===3&&(it&62914560)===it&&300>Bt()-Ju?(dt&2)===0&&Ro(n,0):mm|=l,Ao===it&&(Ao=0)),hs(n)}function F1(n,r){r===0&&(r=Pe()),n=ma(n,r),n!==null&&(wt(n,r),hs(n))}function G5(n){var r=n.memoizedState,l=0;r!==null&&(l=r.retryLane),F1(n,l)}function K5(n,r){var l=0;switch(n.tag){case 31:case 13:var d=n.stateNode,g=n.memoizedState;g!==null&&(l=g.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(s(314))}d!==null&&d.delete(r),F1(n,l)}function W5(n,r){return Yn(n,r)}var ad=null,Do=null,Sm=!1,od=!1,wm=!1,Lr=0;function hs(n){n!==Do&&n.next===null&&(Do===null?ad=Do=n:Do=Do.next=n),od=!0,Sm||(Sm=!0,X5())}function Yl(n,r){if(!wm&&od){wm=!0;do for(var l=!1,d=ad;d!==null;){if(n!==0){var g=d.pendingLanes;if(g===0)var _=0;else{var w=d.suspendedLanes,C=d.pingedLanes;_=(1<<31-wi(42|n)+1)-1,_&=g&~(w&~C),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(l=!0,G1(d,_))}else _=it,_=z(d,d===Et?_:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(_&3)===0||re(d,_)||(l=!0,G1(d,_));d=d.next}while(l);wm=!1}}function Y5(){$1()}function $1(){od=Sm=!1;var n=0;Lr!==0&&aT()&&(n=Lr);for(var r=Bt(),l=null,d=ad;d!==null;){var g=d.next,_=V1(d,r);_===0?(d.next=null,l===null?ad=g:l.next=g,g===null&&(Do=l)):(l=d,(n!==0||(_&3)!==0)&&(od=!0)),d=g}li!==0&&li!==5||Yl(n),Lr!==0&&(Lr=0)}function V1(n,r){for(var l=n.suspendedLanes,d=n.pingedLanes,g=n.expirationTimes,_=n.pendingLanes&-62914561;0<_;){var w=31-wi(_),C=1<<w,B=g[w];B===-1?((C&l)===0||(C&d)!==0)&&(g[w]=ve(C,r)):B<=r&&(n.expiredLanes|=C),_&=~C}if(r=Et,l=it,l=z(n,n===r?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,l===0||n===r&&(gt===2||gt===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&Xn(d),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||re(n,l)){if(r=l&-l,r===n.callbackPriority)return r;switch(d!==null&&Xn(d),Ds(l)){case 2:case 8:l=Ms;break;case 32:l=Rs;break;case 268435456:l=fr;break;default:l=Rs}return d=q1.bind(null,n),l=Yn(l,d),n.callbackPriority=r,n.callbackNode=l,r}return d!==null&&d!==null&&Xn(d),n.callbackPriority=2,n.callbackNode=null,2}function q1(n,r){if(li!==0&&li!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(rd()&&n.callbackNode!==l)return null;var d=it;return d=z(n,n===Et?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(C1(n,d,r),V1(n,Bt()),n.callbackNode!=null&&n.callbackNode===l?q1.bind(null,n):null)}function G1(n,r){if(rd())return null;C1(n,r,!0)}function X5(){lT(function(){(dt&6)!==0?Yn(Si,Y5):$1()})}function Em(){if(Lr===0){var n=_o;n===0&&(n=rt,rt<<=1,(rt&261888)===0&&(rt=256)),Lr=n}return Lr}function K1(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:_r(""+n)}function W1(n,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,n.id&&l.setAttribute("form",n.id),r.parentNode.insertBefore(l,r),n=new FormData(n),l.parentNode.removeChild(l),n}function Z5(n,r,l,d,g){if(r==="submit"&&l&&l.stateNode===g){var _=K1((g[Bi]||null).action),w=d.submitter;w&&(r=(r=w[Bi]||null)?K1(r.formAction):w.getAttribute("formAction"),r!==null&&(_=r,w=null));var C=new vu("action","action",null,d,g);n.push({event:C,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Lr!==0){var B=w?W1(g,w):new FormData(g);Vf(l,{pending:!0,data:B,method:g.method,action:_},null,B)}}else typeof _=="function"&&(C.preventDefault(),B=w?W1(g,w):new FormData(g),Vf(l,{pending:!0,data:B,method:g.method,action:_},_,B))},currentTarget:g}]})}}for(var km=0;km<of.length;km++){var Cm=of[km],Q5=Cm.toLowerCase(),J5=Cm[0].toUpperCase()+Cm.slice(1);Qn(Q5,"on"+J5)}Qn(k_,"onAnimationEnd"),Qn(C_,"onAnimationIteration"),Qn(N_,"onAnimationStart"),Qn("dblclick","onDoubleClick"),Qn("focusin","onFocus"),Qn("focusout","onBlur"),Qn(p5,"onTransitionRun"),Qn(g5,"onTransitionStart"),Qn(b5,"onTransitionCancel"),Qn(T_,"onTransitionEnd"),pe("onMouseEnter",["mouseout","mouseover"]),pe("onMouseLeave",["mouseout","mouseover"]),pe("onPointerEnter",["pointerout","pointerover"]),pe("onPointerLeave",["pointerout","pointerover"]),Ls("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ls("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ls("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ls("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ls("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ls("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xl="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(" "),eT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Xl));function Y1(n,r){r=(r&4)!==0;for(var l=0;l<n.length;l++){var d=n[l],g=d.event;d=d.listeners;e:{var _=void 0;if(r)for(var w=d.length-1;0<=w;w--){var C=d[w],B=C.instance,ee=C.currentTarget;if(C=C.listener,B!==_&&g.isPropagationStopped())break e;_=C,g.currentTarget=ee;try{_(g)}catch(ne){Su(ne)}g.currentTarget=null,_=B}else for(w=0;w<d.length;w++){if(C=d[w],B=C.instance,ee=C.currentTarget,C=C.listener,B!==_&&g.isPropagationStopped())break e;_=C,g.currentTarget=ee;try{_(g)}catch(ne){Su(ne)}g.currentTarget=null,_=B}}}}function Je(n,r){var l=r[hl];l===void 0&&(l=r[hl]=new Set);var d=n+"__bubble";l.has(d)||(X1(r,n,2,!1),l.add(d))}function Nm(n,r,l){var d=0;r&&(d|=4),X1(l,n,d,r)}var ld="_reactListening"+Math.random().toString(36).slice(2);function Tm(n){if(!n[ld]){n[ld]=!0,du.forEach(function(l){l!=="selectionchange"&&(eT.has(l)||Nm(l,!1,n),Nm(l,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[ld]||(r[ld]=!0,Nm("selectionchange",!1,r))}}function X1(n,r,l,d){switch(kx(r)){case 2:var g=TT;break;case 8:g=AT;break;default:g=$m}l=g.bind(null,r,l,n),g=void 0,!Kh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(g=!0),d?g!==void 0?n.addEventListener(r,l,{capture:!0,passive:g}):n.addEventListener(r,l,!0):g!==void 0?n.addEventListener(r,l,{passive:g}):n.addEventListener(r,l,!1)}function Am(n,r,l,d,g){var _=d;if((r&1)===0&&(r&2)===0&&d!==null)e:for(;;){if(d===null)return;var w=d.tag;if(w===3||w===4){var C=d.stateNode.containerInfo;if(C===g)break;if(w===4)for(w=d.return;w!==null;){var B=w.tag;if((B===3||B===4)&&w.stateNode.containerInfo===g)return;w=w.return}for(;C!==null;){if(w=$i(C),w===null)return;if(B=w.tag,B===5||B===6||B===26||B===27){d=_=w;continue e}C=C.parentNode}}d=d.return}pu(function(){var ee=_,ne=Fe(l),le=[];e:{var te=A_.get(n);if(te!==void 0){var ie=vu,Ne=n;switch(n){case"keypress":if(bu(l)===0)break e;case"keydown":case"keyup":ie=K3;break;case"focusin":Ne="focus",ie=Zh;break;case"focusout":Ne="blur",ie=Zh;break;case"beforeblur":case"afterblur":ie=Zh;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=s_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=L3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=X3;break;case k_:case C_:case N_:ie=I3;break;case T_:ie=Q3;break;case"scroll":case"scrollend":ie=D3;break;case"wheel":ie=e5;break;case"copy":case"cut":case"paste":ie=U3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=a_;break;case"toggle":case"beforetoggle":ie=i5}var Le=(r&4)!==0,xt=!Le&&(n==="scroll"||n==="scrollend"),G=Le?te!==null?te+"Capture":null:te;Le=[];for(var U=ee,J;U!==null;){var ae=U;if(J=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||J===null||G===null||(ae=_l(U,G),ae!=null&&Le.push(Zl(U,ae,J))),xt)break;U=U.return}0<Le.length&&(te=new ie(te,Ne,null,l,ne),le.push({event:te,listeners:Le}))}}if((r&7)===0){e:{if(te=n==="mouseover"||n==="pointerover",ie=n==="mouseout"||n==="pointerout",te&&l!==Me&&(Ne=l.relatedTarget||l.fromElement)&&($i(Ne)||Ne[mr]))break e;if((ie||te)&&(te=ne.window===ne?ne:(te=ne.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(Ne=l.relatedTarget||l.toElement,ie=ee,Ne=Ne?$i(Ne):null,Ne!==null&&(xt=o(Ne),Le=Ne.tag,Ne!==xt||Le!==5&&Le!==27&&Le!==6)&&(Ne=null)):(ie=null,Ne=ee),ie!==Ne)){if(Le=s_,ae="onMouseLeave",G="onMouseEnter",U="mouse",(n==="pointerout"||n==="pointerover")&&(Le=a_,ae="onPointerLeave",G="onPointerEnter",U="pointer"),xt=ie==null?te:pr(ie),J=Ne==null?te:pr(Ne),te=new Le(ae,U+"leave",ie,l,ne),te.target=xt,te.relatedTarget=J,ae=null,$i(ne)===ee&&(Le=new Le(G,U+"enter",Ne,l,ne),Le.target=J,Le.relatedTarget=xt,ae=Le),xt=ae,ie&&Ne)t:{for(Le=tT,G=ie,U=Ne,J=0,ae=G;ae;ae=Le(ae))J++;ae=0;for(var Oe=U;Oe;Oe=Le(Oe))ae++;for(;0<J-ae;)G=Le(G),J--;for(;0<ae-J;)U=Le(U),ae--;for(;J--;){if(G===U||U!==null&&G===U.alternate){Le=G;break t}G=Le(G),U=Le(U)}Le=null}else Le=null;ie!==null&&Z1(le,te,ie,Le,!1),Ne!==null&&xt!==null&&Z1(le,xt,Ne,Le,!0)}}e:{if(te=ee?pr(ee):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var ct=m_;else if(h_(te))if(p_)ct=h5;else{ct=u5;var Re=c5}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ee&&br(ee.elementType)&&(ct=m_):ct=d5;if(ct&&(ct=ct(n,ee))){f_(le,ct,l,ne);break e}Re&&Re(n,te,ee),n==="focusout"&&ee&&te.type==="number"&&ee.memoizedProps.value!=null&&ao(te,"number",te.value)}switch(Re=ee?pr(ee):window,n){case"focusin":(h_(Re)||Re.contentEditable==="true")&&(co=Re,sf=ee,Cl=null);break;case"focusout":Cl=sf=co=null;break;case"mousedown":rf=!0;break;case"contextmenu":case"mouseup":case"dragend":rf=!1,w_(le,l,ne);break;case"selectionchange":if(m5)break;case"keydown":case"keyup":w_(le,l,ne)}var Ve;if(Jh)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?u_(n,l)&&(nt="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(nt="onCompositionStart");nt&&(o_&&l.locale!=="ko"&&(lo||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&lo&&(Ve=i_()):(vr=ne,Wh="value"in vr?vr.value:vr.textContent,lo=!0)),Re=cd(ee,nt),0<Re.length&&(nt=new r_(nt,n,null,l,ne),le.push({event:nt,listeners:Re}),Ve?nt.data=Ve:(Ve=d_(l),Ve!==null&&(nt.data=Ve)))),(Ve=s5?r5(n,l):a5(n,l))&&(nt=cd(ee,"onBeforeInput"),0<nt.length&&(Re=new r_("onBeforeInput","beforeinput",null,l,ne),le.push({event:Re,listeners:nt}),Re.data=Ve)),Z5(le,n,ee,l,ne)}Y1(le,r)})}function Zl(n,r,l){return{instance:n,listener:r,currentTarget:l}}function cd(n,r){for(var l=r+"Capture",d=[];n!==null;){var g=n,_=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||_===null||(g=_l(n,l),g!=null&&d.unshift(Zl(n,g,_)),g=_l(n,r),g!=null&&d.push(Zl(n,g,_))),n.tag===3)return d;n=n.return}return[]}function tT(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Z1(n,r,l,d,g){for(var _=r._reactName,w=[];l!==null&&l!==d;){var C=l,B=C.alternate,ee=C.stateNode;if(C=C.tag,B!==null&&B===d)break;C!==5&&C!==26&&C!==27||ee===null||(B=ee,g?(ee=_l(l,_),ee!=null&&w.unshift(Zl(l,ee,B))):g||(ee=_l(l,_),ee!=null&&w.push(Zl(l,ee,B)))),l=l.return}w.length!==0&&n.push({event:r,listeners:w})}var iT=/\r\n?/g,nT=/\u0000|\uFFFD/g;function Q1(n){return(typeof n=="string"?n:""+n).replace(iT,`
9
+ `).replace(nT,"")}function J1(n,r){return r=Q1(r),Q1(n)===r}function vt(n,r,l,d,g,_){switch(l){case"children":typeof d=="string"?r==="body"||r==="textarea"&&d===""||ze(n,d):(typeof d=="number"||typeof d=="bigint")&&r!=="body"&&ze(n,""+d);break;case"className":dn(n,"class",d);break;case"tabIndex":dn(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":dn(n,l,d);break;case"style":pt(n,d,_);break;case"data":if(r!=="object"){dn(n,"data",d);break}case"src":case"href":if(d===""&&(r!=="a"||l!=="href")){n.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=_r(""+d),n.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(l,"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 _=="function"&&(l==="formAction"?(r!=="input"&&vt(n,r,"name",g.name,g,null),vt(n,r,"formEncType",g.formEncType,g,null),vt(n,r,"formMethod",g.formMethod,g,null),vt(n,r,"formTarget",g.formTarget,g,null)):(vt(n,r,"encType",g.encType,g,null),vt(n,r,"method",g.method,g,null),vt(n,r,"target",g.target,g,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=_r(""+d),n.setAttribute(l,d);break;case"onClick":d!=null&&(n.onclick=be);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(s(61));if(l=d.__html,l!=null){if(g.children!=null)throw Error(s(60));n.innerHTML=l}}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}l=_r(""+d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);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(l,""+d):n.removeAttribute(l);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(l,""):n.removeAttribute(l);break;case"capture":case"download":d===!0?n.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,d):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(l,d):n.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(l):n.setAttribute(l,d);break;case"popover":Je("beforetoggle",n),Je("toggle",n),zi(n,"popover",d);break;case"xlinkActuate":Zi(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Zi(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Zi(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Zi(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Zi(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Zi(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Zi(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Zi(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Zi(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":zi(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Bs.get(l)||l,zi(n,l,d))}}function Mm(n,r,l,d,g,_){switch(l){case"style":pt(n,d,_);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(l=d.__html,l!=null){if(g.children!=null)throw Error(s(60));n.innerHTML=l}}break;case"children":typeof d=="string"?ze(n,d):(typeof d=="number"||typeof d=="bigint")&&ze(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=be);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ca.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(g=l.endsWith("Capture"),r=l.slice(2,g?l.length-7:void 0),_=n[Bi]||null,_=_!=null?_[l]:null,typeof _=="function"&&n.removeEventListener(r,_,g),typeof d=="function")){typeof _!="function"&&_!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(r,d,g);break e}l in n?n[l]=d:d===!0?n.setAttribute(l,""):zi(n,l,d)}}}function Ti(n,r,l){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,_;for(_ in l)if(l.hasOwnProperty(_)){var w=l[_];if(w!=null)switch(_){case"src":d=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:vt(n,r,_,w,l,null)}}g&&vt(n,r,"srcSet",l.srcSet,l,null),d&&vt(n,r,"src",l.src,l,null);return;case"input":Je("invalid",n);var C=_=w=g=null,B=null,ee=null;for(d in l)if(l.hasOwnProperty(d)){var ne=l[d];if(ne!=null)switch(d){case"name":g=ne;break;case"type":w=ne;break;case"checked":B=ne;break;case"defaultChecked":ee=ne;break;case"value":_=ne;break;case"defaultValue":C=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(s(137,r));break;default:vt(n,r,d,ne,l,null)}}ua(n,_,C,B,ee,w,g,!1);return;case"select":Je("invalid",n),d=w=_=null;for(g in l)if(l.hasOwnProperty(g)&&(C=l[g],C!=null))switch(g){case"value":_=C;break;case"defaultValue":w=C;break;case"multiple":d=C;default:vt(n,r,g,C,l,null)}r=_,l=w,n.multiple=!!d,r!=null?Ei(n,!!d,r,!1):l!=null&&Ei(n,!!d,l,!0);return;case"textarea":Je("invalid",n),_=g=d=null;for(w in l)if(l.hasOwnProperty(w)&&(C=l[w],C!=null))switch(w){case"value":d=C;break;case"defaultValue":g=C;break;case"children":_=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:vt(n,r,w,C,l,null)}oo(n,d,g,_);return;case"option":for(B in l)l.hasOwnProperty(B)&&(d=l[B],d!=null)&&(B==="selected"?n.selected=d&&typeof d!="function"&&typeof d!="symbol":vt(n,r,B,d,l,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<Xl.length;d++)Je(Xl[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 l)if(l.hasOwnProperty(ee)&&(d=l[ee],d!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:vt(n,r,ee,d,l,null)}return;default:if(br(r)){for(ne in l)l.hasOwnProperty(ne)&&(d=l[ne],d!==void 0&&Mm(n,r,ne,d,l,void 0));return}}for(C in l)l.hasOwnProperty(C)&&(d=l[C],d!=null&&vt(n,r,C,d,l,null))}function sT(n,r,l,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,_=null,w=null,C=null,B=null,ee=null,ne=null;for(ie in l){var le=l[ie];if(l.hasOwnProperty(ie)&&le!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":B=le;default:d.hasOwnProperty(ie)||vt(n,r,ie,null,d,le)}}for(var te in d){var ie=d[te];if(le=l[te],d.hasOwnProperty(te)&&(ie!=null||le!=null))switch(te){case"type":_=ie;break;case"name":g=ie;break;case"checked":ee=ie;break;case"defaultChecked":ne=ie;break;case"value":w=ie;break;case"defaultValue":C=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,r));break;default:ie!==le&&vt(n,r,te,ie,d,le)}}pl(n,w,C,B,ee,ne,_,g);return;case"select":ie=w=C=te=null;for(_ in l)if(B=l[_],l.hasOwnProperty(_)&&B!=null)switch(_){case"value":break;case"multiple":ie=B;default:d.hasOwnProperty(_)||vt(n,r,_,null,d,B)}for(g in d)if(_=d[g],B=l[g],d.hasOwnProperty(g)&&(_!=null||B!=null))switch(g){case"value":te=_;break;case"defaultValue":C=_;break;case"multiple":w=_;default:_!==B&&vt(n,r,g,_,d,B)}r=C,l=w,d=ie,te!=null?Ei(n,!!l,te,!1):!!d!=!!l&&(r!=null?Ei(n,!!l,r,!0):Ei(n,!!l,l?[]:"",!1));return;case"textarea":ie=te=null;for(C in l)if(g=l[C],l.hasOwnProperty(C)&&g!=null&&!d.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:vt(n,r,C,null,d,g)}for(w in d)if(g=d[w],_=l[w],d.hasOwnProperty(w)&&(g!=null||_!=null))switch(w){case"value":te=g;break;case"defaultValue":ie=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(s(91));break;default:g!==_&&vt(n,r,w,g,d,_)}fu(n,te,ie);return;case"option":for(var Ne in l)te=l[Ne],l.hasOwnProperty(Ne)&&te!=null&&!d.hasOwnProperty(Ne)&&(Ne==="selected"?n.selected=!1:vt(n,r,Ne,null,d,te));for(B in d)te=d[B],ie=l[B],d.hasOwnProperty(B)&&te!==ie&&(te!=null||ie!=null)&&(B==="selected"?n.selected=te&&typeof te!="function"&&typeof te!="symbol":vt(n,r,B,te,d,ie));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 Le in l)te=l[Le],l.hasOwnProperty(Le)&&te!=null&&!d.hasOwnProperty(Le)&&vt(n,r,Le,null,d,te);for(ee in d)if(te=d[ee],ie=l[ee],d.hasOwnProperty(ee)&&te!==ie&&(te!=null||ie!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(s(137,r));break;default:vt(n,r,ee,te,d,ie)}return;default:if(br(r)){for(var xt in l)te=l[xt],l.hasOwnProperty(xt)&&te!==void 0&&!d.hasOwnProperty(xt)&&Mm(n,r,xt,void 0,d,te);for(ne in d)te=d[ne],ie=l[ne],!d.hasOwnProperty(ne)||te===ie||te===void 0&&ie===void 0||Mm(n,r,ne,te,d,ie);return}}for(var G in l)te=l[G],l.hasOwnProperty(G)&&te!=null&&!d.hasOwnProperty(G)&&vt(n,r,G,null,d,te);for(le in d)te=d[le],ie=l[le],!d.hasOwnProperty(le)||te===ie||te==null&&ie==null||vt(n,r,le,te,d,ie)}function ex(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function rT(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,l=performance.getEntriesByType("resource"),d=0;d<l.length;d++){var g=l[d],_=g.transferSize,w=g.initiatorType,C=g.duration;if(_&&C&&ex(w)){for(w=0,C=g.responseEnd,d+=1;d<l.length;d++){var B=l[d],ee=B.startTime;if(ee>C)break;var ne=B.transferSize,le=B.initiatorType;ne&&ex(le)&&(B=B.responseEnd,w+=ne*(B<C?1:(C-ee)/(B-ee)))}if(--d,r+=8*(_+w)/(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 Rm=null,jm=null;function ud(n){return n.nodeType===9?n:n.ownerDocument}function tx(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 ix(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 Dm(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 Om=null;function aT(){var n=window.event;return n&&n.type==="popstate"?n===Om?!1:(Om=n,!0):(Om=null,!1)}var nx=typeof setTimeout=="function"?setTimeout:void 0,oT=typeof clearTimeout=="function"?clearTimeout:void 0,sx=typeof Promise=="function"?Promise:void 0,lT=typeof queueMicrotask=="function"?queueMicrotask:typeof sx<"u"?function(n){return sx.resolve(null).then(n).catch(cT)}:nx;function cT(n){setTimeout(function(){throw n})}function Br(n){return n==="head"}function rx(n,r){var l=r,d=0;do{var g=l.nextSibling;if(n.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"||l==="/&"){if(d===0){n.removeChild(g),zo(r);return}d--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")d++;else if(l==="html")Ql(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,Ql(l);for(var _=l.firstChild;_;){var w=_.nextSibling,C=_.nodeName;_[la]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&_.rel.toLowerCase()==="stylesheet"||l.removeChild(_),_=w}}else l==="body"&&Ql(n.ownerDocument.body);l=g}while(l);zo(r)}function ax(n,r){var l=n;n=0;do{var d=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),d&&d.nodeType===8)if(l=d.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=d}while(l)}function Lm(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Lm(l),fl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function uT(n,r,l,d){for(;n.nodeType===1;){var g=l;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[la])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(_=n.getAttribute("rel"),_==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(_!==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(_=n.getAttribute("src"),(_!==(g.src==null?null:g.src)||n.getAttribute("type")!==(g.type==null?null:g.type)||n.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&_&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var _=g.name==null?null:""+g.name;if(g.type==="hidden"&&n.getAttribute("name")===_)return n}else return n;if(n=Ln(n.nextSibling),n===null)break}return null}function dT(n,r,l){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=Ln(n.nextSibling),n===null))return null;return n}function ox(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=Ln(n.nextSibling),n===null))return null;return n}function Bm(n){return n.data==="$?"||n.data==="$~"}function zm(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function hT(n,r){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||l.readyState!=="loading")r();else{var d=function(){r(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function Ln(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 Im=null;function lx(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(r===0)return Ln(n.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}n=n.nextSibling}return null}function cx(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return n;r--}else l!=="/$"&&l!=="/&"||r++}n=n.previousSibling}return null}function ux(n,r,l){switch(r=ud(l),n){case"html":if(n=r.documentElement,!n)throw Error(s(452));return n;case"head":if(n=r.head,!n)throw Error(s(453));return n;case"body":if(n=r.body,!n)throw Error(s(454));return n;default:throw Error(s(451))}}function Ql(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);fl(n)}var Bn=new Map,dx=new Set;function dd(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Qs=Y.d;Y.d={f:fT,r:mT,D:pT,C:gT,L:bT,m:_T,X:xT,S:vT,M:yT};function fT(){var n=Qs.f(),r=id();return n||r}function mT(n){var r=Os(n);r!==null&&r.tag===5&&r.type==="form"?Tv(r):Qs.r(n)}var Oo=typeof document>"u"?null:document;function hx(n,r,l){var d=Oo;if(d&&typeof r=="string"&&r){var g=Qi(r);g='link[rel="'+n+'"][href="'+g+'"]',typeof l=="string"&&(g+='[crossorigin="'+l+'"]'),dx.has(g)||(dx.add(g),n={rel:n,crossOrigin:l,href:r},d.querySelector(g)===null&&(r=d.createElement("link"),Ti(r,"link",n),Zt(r),d.head.appendChild(r)))}}function pT(n){Qs.D(n),hx("dns-prefetch",n,null)}function gT(n,r){Qs.C(n,r),hx("preconnect",n,r)}function bT(n,r,l){Qs.L(n,r,l);var d=Oo;if(d&&n&&r){var g='link[rel="preload"][as="'+Qi(r)+'"]';r==="image"&&l&&l.imageSrcSet?(g+='[imagesrcset="'+Qi(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(g+='[imagesizes="'+Qi(l.imageSizes)+'"]')):g+='[href="'+Qi(n)+'"]';var _=g;switch(r){case"style":_=Lo(n);break;case"script":_=Bo(n)}Bn.has(_)||(n=b({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:n,as:r},l),Bn.set(_,n),d.querySelector(g)!==null||r==="style"&&d.querySelector(Jl(_))||r==="script"&&d.querySelector(ec(_))||(r=d.createElement("link"),Ti(r,"link",n),Zt(r),d.head.appendChild(r)))}}function _T(n,r){Qs.m(n,r);var l=Oo;if(l&&n){var d=r&&typeof r.as=="string"?r.as:"script",g='link[rel="modulepreload"][as="'+Qi(d)+'"][href="'+Qi(n)+'"]',_=g;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Bo(n)}if(!Bn.has(_)&&(n=b({rel:"modulepreload",href:n},r),Bn.set(_,n),l.querySelector(g)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(ec(_)))return}d=l.createElement("link"),Ti(d,"link",n),Zt(d),l.head.appendChild(d)}}}function vT(n,r,l){Qs.S(n,r,l);var d=Oo;if(d&&n){var g=gr(d).hoistableStyles,_=Lo(n);r=r||"default";var w=g.get(_);if(!w){var C={loading:0,preload:null};if(w=d.querySelector(Jl(_)))C.loading=5;else{n=b({rel:"stylesheet",href:n,"data-precedence":r},l),(l=Bn.get(_))&&Pm(n,l);var B=w=d.createElement("link");Zt(B),Ti(B,"link",n),B._p=new Promise(function(ee,ne){B.onload=ee,B.onerror=ne}),B.addEventListener("load",function(){C.loading|=1}),B.addEventListener("error",function(){C.loading|=2}),C.loading|=4,hd(w,r,d)}w={type:"stylesheet",instance:w,count:1,state:C},g.set(_,w)}}}function xT(n,r){Qs.X(n,r);var l=Oo;if(l&&n){var d=gr(l).hoistableScripts,g=Bo(n),_=d.get(g);_||(_=l.querySelector(ec(g)),_||(n=b({src:n,async:!0},r),(r=Bn.get(g))&&Um(n,r),_=l.createElement("script"),Zt(_),Ti(_,"link",n),l.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},d.set(g,_))}}function yT(n,r){Qs.M(n,r);var l=Oo;if(l&&n){var d=gr(l).hoistableScripts,g=Bo(n),_=d.get(g);_||(_=l.querySelector(ec(g)),_||(n=b({src:n,async:!0,type:"module"},r),(r=Bn.get(g))&&Um(n,r),_=l.createElement("script"),Zt(_),Ti(_,"link",n),l.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},d.set(g,_))}}function fx(n,r,l,d){var g=(g=se.current)?dd(g):null;if(!g)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=Lo(l.href),l=gr(g).hoistableStyles,d=l.get(r),d||(d={type:"style",instance:null,count:0,state:null},l.set(r,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=Lo(l.href);var _=gr(g).hoistableStyles,w=_.get(n);if(w||(g=g.ownerDocument||g,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(n,w),(_=g.querySelector(Jl(n)))&&!_._p&&(w.instance=_,w.state.loading=5),Bn.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Bn.set(n,l),_||ST(g,n,l,w.state))),r&&d===null)throw Error(s(528,""));return w}if(r&&d!==null)throw Error(s(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Bo(l),l=gr(g).hoistableScripts,d=l.get(r),d||(d={type:"script",instance:null,count:0,state:null},l.set(r,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function Lo(n){return'href="'+Qi(n)+'"'}function Jl(n){return'link[rel="stylesheet"]['+n+"]"}function mx(n){return b({},n,{"data-precedence":n.precedence,precedence:null})}function ST(n,r,l,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}),Ti(r,"link",l),Zt(r),n.head.appendChild(r))}function Bo(n){return'[src="'+Qi(n)+'"]'}function ec(n){return"script[async]"+n}function px(n,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var d=n.querySelector('style[data-href~="'+Qi(l.href)+'"]');if(d)return r.instance=d,Zt(d),d;var g=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),Zt(d),Ti(d,"style",g),hd(d,l.precedence,n),r.instance=d;case"stylesheet":g=Lo(l.href);var _=n.querySelector(Jl(g));if(_)return r.state.loading|=4,r.instance=_,Zt(_),_;d=mx(l),(g=Bn.get(g))&&Pm(d,g),_=(n.ownerDocument||n).createElement("link"),Zt(_);var w=_;return w._p=new Promise(function(C,B){w.onload=C,w.onerror=B}),Ti(_,"link",d),r.state.loading|=4,hd(_,l.precedence,n),r.instance=_;case"script":return _=Bo(l.src),(g=n.querySelector(ec(_)))?(r.instance=g,Zt(g),g):(d=l,(g=Bn.get(_))&&(d=b({},l),Um(d,g)),n=n.ownerDocument||n,g=n.createElement("script"),Zt(g),Ti(g,"link",d),n.head.appendChild(g),r.instance=g);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(d=r.instance,r.state.loading|=4,hd(d,l.precedence,n));return r.instance}function hd(n,r,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=d.length?d[d.length-1]:null,_=g,w=0;w<d.length;w++){var C=d[w];if(C.dataset.precedence===r)_=C;else if(_!==g)break}_?_.parentNode.insertBefore(n,_.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(n,r.firstChild))}function Pm(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function Um(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var fd=null;function gx(n,r,l){if(fd===null){var d=new Map,g=fd=new Map;g.set(l,d)}else g=fd,d=g.get(l),d||(d=new Map,g.set(l,d));if(d.has(n))return d;for(d.set(n,null),l=l.getElementsByTagName(n),g=0;g<l.length;g++){var _=l[g];if(!(_[la]||_[Gt]||n==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var w=_.getAttribute(r)||"";w=n+w;var C=d.get(w);C?C.push(_):d.set(w,[_])}}return d}function bx(n,r,l){n=n.ownerDocument||n,n.head.insertBefore(l,r==="title"?n.querySelector("head > title"):null)}function wT(n,r,l){if(l===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 _x(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function ET(n,r,l,d){if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var g=Lo(d.href),_=r.querySelector(Jl(g));if(_){r=_._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=md.bind(n),r.then(n,n)),l.state.loading|=4,l.instance=_,Zt(_);return}_=r.ownerDocument||r,d=mx(d),(g=Bn.get(g))&&Pm(d,g),_=_.createElement("link"),Zt(_);var w=_;w._p=new Promise(function(C,B){w.onload=C,w.onerror=B}),Ti(_,"link",d),l.instance=_}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(n.count++,l=md.bind(n),r.addEventListener("load",l),r.addEventListener("error",l))}}var Hm=0;function kT(n,r){return n.stylesheets&&n.count===0&&gd(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var d=setTimeout(function(){if(n.stylesheets&&gd(n,n.stylesheets),n.unsuspend){var _=n.unsuspend;n.unsuspend=null,_()}},6e4+r);0<n.imgBytes&&Hm===0&&(Hm=62500*rT());var g=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&gd(n,n.stylesheets),n.unsuspend)){var _=n.unsuspend;n.unsuspend=null,_()}},(n.imgBytes>Hm?50:800)+r);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(g)}}:null}function md(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gd(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var pd=null;function gd(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,pd=new Map,r.forEach(CT,n),pd=null,md.call(n))}function CT(n,r){if(!(r.state.loading&4)){var l=pd.get(n);if(l)var d=l.get(null);else{l=new Map,pd.set(n,l);for(var g=n.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<g.length;_++){var w=g[_];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(l.set(w.dataset.precedence,w),d=w)}d&&l.set(null,d)}g=r.instance,w=g.getAttribute("data-precedence"),_=l.get(w)||d,_===d&&l.set(null,g),l.set(w,g),this.count++,d=md.bind(this),g.addEventListener("load",d),g.addEventListener("error",d),_?_.parentNode.insertBefore(g,_.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(g,n.firstChild)),r.state.loading|=4}}var tc={$$typeof:R,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function NT(n,r,l,d,g,_,w,C,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=_,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function vx(n,r,l,d,g,_,w,C,B,ee,ne,le){return n=new NT(n,r,l,w,B,ee,ne,le,C),r=1,_===!0&&(r|=24),_=mn(3,null,null,r),n.current=_,_.stateNode=n,r=xf(),r.refCount++,n.pooledCache=r,r.refCount++,_.memoizedState={element:d,isDehydrated:l,cache:r},Ef(_),n}function xx(n){return n?(n=fo,n):fo}function yx(n,r,l,d,g,_){g=xx(g),d.context===null?d.context=g:d.pendingContext=g,d=kr(r),d.payload={element:l},_=_===void 0?null:_,_!==null&&(d.callback=_),l=Cr(n,d,r),l!==null&&(rn(l,n,r),Dl(l,n,r))}function Sx(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<r?l:r}}function Fm(n,r){Sx(n,r),(n=n.alternate)&&Sx(n,r)}function wx(n){if(n.tag===13||n.tag===31){var r=ma(n,67108864);r!==null&&rn(r,n,67108864),Fm(n,67108864)}}function Ex(n){if(n.tag===13||n.tag===31){var r=vn();r=jt(r);var l=ma(n,r);l!==null&&rn(l,n,r),Fm(n,r)}}var bd=!0;function TT(n,r,l,d){var g=D.T;D.T=null;var _=Y.p;try{Y.p=2,$m(n,r,l,d)}finally{Y.p=_,D.T=g}}function AT(n,r,l,d){var g=D.T;D.T=null;var _=Y.p;try{Y.p=8,$m(n,r,l,d)}finally{Y.p=_,D.T=g}}function $m(n,r,l,d){if(bd){var g=Vm(d);if(g===null)Am(n,r,d,_d,l),Cx(n,d);else if(RT(g,n,r,l,d))d.stopPropagation();else if(Cx(n,d),r&4&&-1<MT.indexOf(n)){for(;g!==null;){var _=Os(g);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var w=Li(_.pendingLanes);if(w!==0){var C=_;for(C.pendingLanes|=2,C.entangledLanes|=2;w;){var B=1<<31-wi(w);C.entanglements[1]|=B,w&=~B}hs(_),(dt&6)===0&&(ed=Bt()+500,Yl(0))}}break;case 31:case 13:C=ma(_,2),C!==null&&rn(C,_,2),id(),Fm(_,2)}if(_=Vm(d),_===null&&Am(n,r,d,_d,l),_===g)break;g=_}g!==null&&d.stopPropagation()}else Am(n,r,d,null,l)}}function Vm(n){return n=Fe(n),qm(n)}var _d=null;function qm(n){if(_d=null,n=$i(n),n!==null){var r=o(n);if(r===null)n=null;else{var l=r.tag;if(l===13){if(n=u(r),n!==null)return n;n=null}else if(l===31){if(n=h(r),n!==null)return n;n=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return _d=n,null}function kx(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(As()){case Si:return 2;case Ms:return 8;case Rs:case Qa:return 32;case fr:return 268435456;default:return 32}default:return 32}}var Gm=!1,zr=null,Ir=null,Pr=null,ic=new Map,nc=new Map,Ur=[],MT="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 Cx(n,r){switch(n){case"focusin":case"focusout":zr=null;break;case"dragenter":case"dragleave":Ir=null;break;case"mouseover":case"mouseout":Pr=null;break;case"pointerover":case"pointerout":ic.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":nc.delete(r.pointerId)}}function sc(n,r,l,d,g,_){return n===null||n.nativeEvent!==_?(n={blockedOn:r,domEventName:l,eventSystemFlags:d,nativeEvent:_,targetContainers:[g]},r!==null&&(r=Os(r),r!==null&&wx(r)),n):(n.eventSystemFlags|=d,r=n.targetContainers,g!==null&&r.indexOf(g)===-1&&r.push(g),n)}function RT(n,r,l,d,g){switch(r){case"focusin":return zr=sc(zr,n,r,l,d,g),!0;case"dragenter":return Ir=sc(Ir,n,r,l,d,g),!0;case"mouseover":return Pr=sc(Pr,n,r,l,d,g),!0;case"pointerover":var _=g.pointerId;return ic.set(_,sc(ic.get(_)||null,n,r,l,d,g)),!0;case"gotpointercapture":return _=g.pointerId,nc.set(_,sc(nc.get(_)||null,n,r,l,d,g)),!0}return!1}function Nx(n){var r=$i(n.target);if(r!==null){var l=o(r);if(l!==null){if(r=l.tag,r===13){if(r=u(l),r!==null){n.blockedOn=r,io(n.priority,function(){Ex(l)});return}}else if(r===31){if(r=h(l),r!==null){n.blockedOn=r,io(n.priority,function(){Ex(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function vd(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var l=Vm(n.nativeEvent);if(l===null){l=n.nativeEvent;var d=new l.constructor(l.type,l);Me=d,l.target.dispatchEvent(d),Me=null}else return r=Os(l),r!==null&&wx(r),n.blockedOn=l,!1;r.shift()}return!0}function Tx(n,r,l){vd(n)&&l.delete(r)}function jT(){Gm=!1,zr!==null&&vd(zr)&&(zr=null),Ir!==null&&vd(Ir)&&(Ir=null),Pr!==null&&vd(Pr)&&(Pr=null),ic.forEach(Tx),nc.forEach(Tx)}function xd(n,r){n.blockedOn===r&&(n.blockedOn=null,Gm||(Gm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,jT)))}var yd=null;function Ax(n){yd!==n&&(yd=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){yd===n&&(yd=null);for(var r=0;r<n.length;r+=3){var l=n[r],d=n[r+1],g=n[r+2];if(typeof d!="function"){if(qm(d||l)===null)continue;break}var _=Os(l);_!==null&&(n.splice(r,3),r-=3,Vf(_,{pending:!0,data:g,method:l.method,action:d},d,g))}}))}function zo(n){function r(B){return xd(B,n)}zr!==null&&xd(zr,n),Ir!==null&&xd(Ir,n),Pr!==null&&xd(Pr,n),ic.forEach(r),nc.forEach(r);for(var l=0;l<Ur.length;l++){var d=Ur[l];d.blockedOn===n&&(d.blockedOn=null)}for(;0<Ur.length&&(l=Ur[0],l.blockedOn===null);)Nx(l),l.blockedOn===null&&Ur.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var g=l[d],_=l[d+1],w=g[Bi]||null;if(typeof _=="function")w||Ax(l);else if(w){var C=null;if(_&&_.hasAttribute("formAction")){if(g=_,w=_[Bi]||null)C=w.formAction;else if(qm(g)!==null)continue}else C=w.action;typeof C=="function"?l[d+1]=C:(l.splice(d,3),d-=3),Ax(l)}}}function Mx(){function n(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(w){return g=w})},focusReset:"manual",scroll:"manual"})}function r(){g!==null&&(g(),g=null),d||setTimeout(l,20)}function l(){if(!d&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.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(l,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),g!==null&&(g(),g=null)}}}function Km(n){this._internalRoot=n}Sd.prototype.render=Km.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(s(409));var l=r.current,d=vn();yx(l,d,n,r,null,null)},Sd.prototype.unmount=Km.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;yx(n.current,2,null,n,null,null),id(),r[mr]=null}};function Sd(n){this._internalRoot=n}Sd.prototype.unstable_scheduleHydration=function(n){if(n){var r=to();n={blockedOn:null,target:n,priority:r};for(var l=0;l<Ur.length&&r!==0&&r<Ur[l].priority;l++);Ur.splice(l,0,n),l===0&&Nx(n)}};var Rx=t.version;if(Rx!=="19.2.6")throw Error(s(527,Rx,"19.2.6"));Y.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(s(188)):(n=Object.keys(n).join(","),Error(s(268,n)));return n=f(r),n=n!==null?p(n):null,n=n===null?null:n.stateNode,n};var DT={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wd.isDisabled&&wd.supportsFiber)try{js=wd.inject(DT),pi=wd}catch{}}return ac.createRoot=function(n,r){if(!a(n))throw Error(s(299));var l=!1,d="",g=Iv,_=Pv,w=Uv;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(g=r.onUncaughtError),r.onCaughtError!==void 0&&(_=r.onCaughtError),r.onRecoverableError!==void 0&&(w=r.onRecoverableError)),r=vx(n,1,!1,null,null,l,d,null,g,_,w,Mx),n[mr]=r.current,Tm(n),new Km(r)},ac.hydrateRoot=function(n,r,l){if(!a(n))throw Error(s(299));var d=!1,g="",_=Iv,w=Pv,C=Uv,B=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(_=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(C=l.onRecoverableError),l.formState!==void 0&&(B=l.formState)),r=vx(n,1,!0,r,l??null,d,g,B,_,w,C,Mx),r.context=xx(null),l=r.current,d=vn(),d=jt(d),g=kr(d),g.callback=null,Cr(l,g,d),l=d,r.current.lanes=l,wt(r,l),hs(r),n[mr]=r.current,Tm(n),new Sd(r)},ac.version="19.2.6",ac}var Hx;function $T(){if(Hx)return Xm.exports;Hx=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(),Xm.exports=FT(),Xm.exports}var W2=$T();const Y2=(...e)=>e.filter((t,i,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===i).join(" ").trim();const VT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const qT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,i,s)=>s?s.toUpperCase():i.toLowerCase());const Fx=e=>{const t=qT(e);return t.charAt(0).toUpperCase()+t.slice(1)};var ep={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 GT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},KT=E.createContext({}),WT=()=>E.useContext(KT),YT=E.forwardRef(({color:e,size:t,strokeWidth:i,absoluteStrokeWidth:s,className:a="",children:o,iconNode:u,...h},m)=>{const{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:b=!1,color:v="currentColor",className:x=""}=WT()??{},y=s??b?Number(i??p)*24/Number(t??f):i??p;return E.createElement("svg",{ref:m,...ep,width:t??f??ep.width,height:t??f??ep.height,stroke:e??v,strokeWidth:y,className:Y2("lucide",x,a),...!o&&!GT(h)&&{"aria-hidden":"true"},...h},[...u.map(([S,k])=>E.createElement(S,k)),...Array.isArray(o)?o:[o]])});const _e=(e,t)=>{const i=E.forwardRef(({className:s,...a},o)=>E.createElement(YT,{ref:o,iconNode:t,className:Y2(`lucide-${VT(Fx(e))}`,`lucide-${e}`,s),...a}));return i.displayName=Fx(e),i};const XT=[["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"}]],Ia=_e("activity",XT);const ZT=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],QT=_e("arrow-down",ZT);const JT=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],X2=_e("arrow-left",JT);const eA=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Z2=_e("arrow-up",eA);const tA=[["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"}]],iA=_e("bot",tA);const nA=[["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"}]],Q2=_e("box",nA);const sA=[["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"}]],rA=_e("braces",sA);const aA=[["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"}]],J2=_e("brain",aA);const oA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ah=_e("check",oA);const lA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qn=_e("chevron-down",lA);const cA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],uA=_e("chevron-left",cA);const dA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ia=_e("chevron-right",dA);const hA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Mh=_e("chevron-up",hA);const fA=[["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"}]],eE=_e("code-xml",fA);const mA=[["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"}]],kg=_e("copy",mA);const pA=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],gA=_e("corner-down-left",pA);const bA=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],_A=_e("corner-down-right",bA);const vA=[["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"}]],xA=_e("cpu",vA);const yA=[["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"}]],Es=_e("database",yA);const SA=[["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"}]],tE=_e("download",SA);const wA=[["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"}]],EA=_e("earth",wA);const kA=[["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"}]],iE=_e("ellipsis",kA);const CA=[["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"}]],W0=_e("external-link",CA);const NA=[["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"}]],nE=_e("eye-off",NA);const TA=[["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"}]],Y0=_e("eye",TA);const AA=[["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"}]],sE=_e("file-code-corner",AA);const MA=[["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"}]],rE=_e("file-exclamation-point",MA);const RA=[["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"}]],jA=_e("file-spreadsheet",RA);const DA=[["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"}]],aE=_e("file-text",DA);const OA=[["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"}]],oE=_e("file",OA);const LA=[["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"}]],BA=_e("flask-conical",LA);const zA=[["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"}]],IA=_e("folder-git-2",zA);const PA=[["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"}]],Rh=_e("folder-open",PA);const UA=[["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"}]],HA=_e("folder-plus",UA);const FA=[["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"}]],Ga=_e("folder",FA);const $A=[["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"}]],VA=_e("funnel",$A);const qA=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],lE=_e("gauge",qA);const GA=[["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"}]],as=_e("git-branch",GA);const KA=[["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"}]],WA=_e("git-pull-request-create",KA);const YA=[["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"}]],XA=_e("heart",YA);const ZA=[["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"}]],QA=_e("image",ZA);const JA=[["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"}]],Cg=_e("inbox",JA);const e4=[["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"}]],t4=_e("key-round",e4);const i4=[["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"}]],n4=_e("list-collapse",i4);const s4=[["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"}]],r4=_e("list-tree",s4);const a4=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Di=_e("loader-circle",a4);const o4=[["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"}]],l4=_e("lock-keyhole",o4);const c4=[["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"}]],cE=_e("maximize-2",c4);const u4=[["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"}]],d4=_e("memory-stick",u4);const h4=[["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"}]],uE=_e("minimize-2",h4);const f4=[["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"}]],m4=_e("moon",f4);const p4=[["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"}]],g4=_e("network",p4);const b4=[["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"}]],_4=_e("palette",b4);const v4=[["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"}]],x4=_e("panel-left-close",v4);const y4=[["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"}]],S4=_e("panel-left-open",y4);const w4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],E4=_e("panel-left",w4);const k4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],C4=_e("panel-top",k4);const N4=[["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"}]],T4=_e("paperclip",N4);const A4=[["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"}]],Lc=_e("pencil",A4);const M4=[["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"}]],jh=_e("play",M4);const R4=[["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"}]],dE=_e("plug",R4);const j4=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],wn=_e("plus",j4);const D4=[["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"}]],O4=_e("radio",D4);const L4=[["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"}]],Dh=_e("refresh-cw",L4);const B4=[["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"}]],hE=_e("rotate-ccw",B4);const z4=[["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"}]],fE=_e("save",z4);const I4=[["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"}]],mE=_e("scroll-text",I4);const P4=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],U4=_e("search",P4);const H4=[["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"}]],F4=_e("server",H4);const $4=[["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"}]],V4=_e("settings-2",$4);const q4=[["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"}]],G4=_e("shield-alert",q4);const K4=[["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"}]],Ka=_e("sparkles",K4);const W4=[["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"}]],Y4=_e("square-terminal",W4);const X4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Oh=_e("square",X4);const Z4=[["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"}]],Q4=_e("sun",Z4);const J4=[["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"}]],eM=_e("table-2",J4);const tM=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],pE=_e("terminal",tM);const iM=[["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"}]],Yc=_e("trash-2",iM);const nM=[["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"}]],sM=_e("triangle-alert",nM);const rM=[["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"}]],aM=_e("wand-sparkles",rM);const oM=[["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"}]],lM=_e("wrench",oM);const cM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],kn=_e("x",cM);const uM=[["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"}]],dM=_e("zap",uM);class gE extends Error{conflict;constructor(t,i){super(t),this.name="PortConflictResponseError",this.conflict=i}}async function Ge(e,t){const i=await fetch(e,t),s=await i.json().catch(()=>{});if(!i.ok)throw i.status===409&&s?.conflict?.code==="PORT_IN_USE"?new gE(s?.error||"Port already in use",s.conflict):new Error(s?.error||i.statusText);return s}async function cn(e,t){const i=new URLSearchParams;for(const[s,a]of Object.entries(t))a!==void 0&&String(a).trim()&&i.set(s,String(a));await Ge(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i})}async function Xc(e,t){const i=new URLSearchParams;for(const[s,a]of Object.entries(t))a!==void 0&&String(a).trim()&&i.set(s,String(a));return Ge(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i})}async function hM(){return(await Ge("/api/agent")).agent}async function fM(e){return(await Ge(`/api/agent/mcp-status?agent=${encodeURIComponent(e)}`)).statuses}async function mM(){return(await Ge("/api/agent/usage")).usage}async function pM(){return(await Ge("/api/agent/claude-settings")).settings}async function gM(e){return(await Ge("/api/agent/claude-settings",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})).settings}async function bM(){const e=await Ge("/api/agent/chat/status");return{configured:e.configured,approvals:e.approvals,provider:e.provider}}async function _M(e,t,i){await Ge("/api/agent/chat/approve",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:e,requestId:t,decision:i})})}async function vM(e,t,i,s){const a=await fetch("/api/agent/chat",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({message:e,resumeSessionId:t}),signal:s});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 v=b.split(`
12
+ `).find(x=>x.startsWith("data:"));if(v){const x=v.slice(5).trim();if(x)try{i(JSON.parse(x))}catch{}}p=h.indexOf(`
13
+
14
+ `)}}}async function xM(){return(await Ge("/api/databases")).connections}async function yM(){return(await Ge("/api/databases/detect")).detected}async function SM(e){await Xc("/api/databases",e)}async function wM(e){return Xc("/api/databases/test",e)}async function EM(e){await Ge(`/api/databases/${encodeURIComponent(e)}`,{method:"DELETE"})}async function kM(e){return(await Ge(`/api/databases/${encodeURIComponent(e)}/tables`)).tables}async function CM(e,t,i=100,s=0){return Ge(`/api/databases/${encodeURIComponent(e)}/rows?table=${encodeURIComponent(t)}&limit=${i}&offset=${s}`)}async function NM(e=100){return(await Ge(`/api/errors?limit=${e}`)).incidents}async function TM(e){return Ge(`/api/errors/${e}/prompt`)}async function AM(e=200){return(await Ge(`/api/git/graph?limit=${e}`)).commits}async function MM(e,t){const i=new URLSearchParams({hash:e});t&&i.set("file",t);const s=await fetch(`/api/git/commit?${i.toString()}`);if(!s.ok){const a=await s.json().catch(()=>({error:s.statusText}));throw new Error(a.error||"Unable to load commit diff")}return s.text()}async function RM(e){return(await Ge(`/api/git/commit/files?hash=${encodeURIComponent(e)}`)).files}async function jM(){return(await Ge("/api/git/files")).files}async function DM(){return(await Ge("/api/git/file-sizes")).files}async function OM(e){const t=await Ge(`/api/git/file?path=${encodeURIComponent(e)}`);return{content:t.content,truncated:t.truncated,binary:t.binary,size:t.size}}async function LM(e,t){await Ge("/api/git/file",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,content:t})})}async function BM(e){const t=await fetch(`/api/git/diff?file=${encodeURIComponent(e)}`);if(!t.ok){const i=await t.json().catch(()=>({error:t.statusText}));throw new Error(i.error||"Unable to load diff")}return t.text()}async function zM(e){await Ge(`/api/git/repositories/${encodeURIComponent(e)}`,{method:"DELETE"})}async function IM(){return(await Ge("/api/log-sources")).sources}async function PM(e){return(await Xc("/api/log-sources",e)).sources}async function bE(e,t={}){const i=new URLSearchParams;return i.set("lines",String(t.lines??500)),t.since&&i.set("since",t.since),t.until&&i.set("until",t.until),t.grep&&i.set("grep",t.grep),t.level&&i.set("level",t.level),t.cursor&&i.set("cursor",t.cursor),t.before&&i.set("before",t.before),(await Ge(`/api/log-sources/${encodeURIComponent(e)}/logs?${i.toString()}`)).logs}const X0={"content-type":"application/json"};async function UM(e){const t=await Ge("/api/onboard/scan",{method:"POST",headers:X0,body:JSON.stringify({url:e})});return{profile:t.profile,proposals:t.proposals,databases:t.databases??[]}}async function HM(e,t,i){const s=i?{name:i.name,engine:i.engine,url:i.url}:void 0;await Ge("/api/onboard/register",{method:"POST",headers:X0,body:JSON.stringify({...e,start:t,database:s})})}async function FM(e,t){const i=await fetch("/api/onboard/install/stream",{method:"POST",headers:X0,body:JSON.stringify(e)});if(!i.ok||!i.body){const u=await i.json().catch(()=>{});t.onError(u?.error||i.statusText);return}const s=i.body.getReader(),a=new TextDecoder;let o="";for(;;){const{done:u,value:h}=await s.read();if(u)break;o+=a.decode(h,{stream:!0});const m=o.split(`
15
+
16
+ `);o=m.pop()??"";for(const f of m)$M(f,t)}}function $M(e,t){let i="message",s="";for(const a of e.split(`
17
+ `))a.startsWith("event:")?i=a.slice(6).trim():a.startsWith("data:")&&(s+=a.slice(5).trim());if(s)try{const a=JSON.parse(s);i==="output"?t.onLine(a):i==="done"?t.onDone(a.exitCode??null):i==="error"&&t.onError(a.error??"Install failed.")}catch{}}async function VM(){return Ge("/api/dashboard")}async function qM(e){await Ge(`/api/services/${encodeURIComponent(e)}`,{method:"DELETE"})}async function GM(e,t,i){t.includes(i)||await cn("/api/bundles",{name:e,originalName:e,services:[...t,i].join(",")})}async function KM(e,t,i){t.includes(i)&&await cn("/api/bundles",{name:e,originalName:e,services:t.filter(s=>s!==i).join(",")})}async function _E(e,{files:t=!1}={}){const i=new URLSearchParams({path:e});return t&&i.set("files","1"),Ge(`/api/fs/directories?${i.toString()}`)}async function vE(e,t={}){const i=new URLSearchParams;i.set("lines",String(t.lines??500)),t.since&&i.set("since",t.since),t.until&&i.set("until",t.until),t.grep&&i.set("grep",t.grep),t.level&&i.set("level",t.level),t.cursor&&i.set("cursor",t.cursor),t.before&&i.set("before",t.before);const s=await Ge(`/api/services/${encodeURIComponent(e)}/logs?${i.toString()}`);return{logs:s.logs,queryable:!!s.queryable}}async function WM(e,t){const i=t?`?path=${encodeURIComponent(t)}`:"";return Ge(`/api/services/${encodeURIComponent(e)}/config-browse${i}`)}async function YM(e){const t=await Ge(`/api/services/${encodeURIComponent(e)}/config-files`);return{cwd:t.cwd,files:t.files}}async function $x(e,t){return Ge(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`)}async function XM(e,t,i){return Ge(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({entries:i})})}async function ZM(e,t,i){return Ge(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:i})})}async function QM(e){return(await Ge(`/api/services/${encodeURIComponent(e)}/metrics`)).metrics}async function JM(e){return Xc("/api/services/test",e)}async function e6(e,t){return Xc(`/api/services/${encodeURIComponent(e)}/test`,t?{pattern:t}:{})}async function t6(){return(await Ge("/api/terminal/sessions")).sessions}async function Ud(e){return(await Ge("/api/terminal/sessions",{method:"POST",...e?.serviceName?{headers:{"content-type":"application/json"},body:JSON.stringify({serviceName:e.serviceName})}:{}})).session}async function i6(e){await Ge(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}function xE(e){var t,i,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(i=xE(e[t]))&&(s&&(s+=" "),s+=i)}else for(i in e)e[i]&&(s&&(s+=" "),s+=i);return s}function Bc(){for(var e,t,i=0,s="",a=arguments.length;i<a;i++)(e=arguments[i])&&(t=xE(e))&&(s&&(s+=" "),s+=t);return s}const Vx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,qx=Bc,yE=(e,t)=>i=>{var s;if(t?.variants==null)return qx(e,i?.class,i?.className);const{variants:a,defaultVariants:o}=t,u=Object.keys(a).map(f=>{const p=i?.[f],b=o?.[f];if(p===null)return null;const v=Vx(p)||Vx(b);return a[f][v]}),h=i&&Object.entries(i).reduce((f,p)=>{let[b,v]=p;return v===void 0||(f[b]=v),f},{}),m=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((f,p)=>{let{class:b,className:v,...x}=p;return Object.entries(x).every(y=>{let[S,k]=y;return Array.isArray(k)?k.includes({...o,...h}[S]):{...o,...h}[S]===k})?[...f,b,v]:f},[]);return qx(e,u,m,i?.class,i?.className)},n6=(e,t)=>{const i=new Array(e.length+t.length);for(let s=0;s<e.length;s++)i[s]=e[s];for(let s=0;s<t.length;s++)i[e.length+s]=t[s];return i},s6=(e,t)=>({classGroupId:e,validator:t}),SE=(e=new Map,t=null,i)=>({nextPart:e,validators:t,classGroupId:i}),th="-",Gx=[],r6="arbitrary..",a6=e=>{const t=l6(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return o6(u);const h=u.split(th),m=h[0]===""&&h.length>1?1:0;return wE(h,m,t)},getConflictingClassGroupIds:(u,h)=>{if(h){const m=s[u],f=i[u];return m?f?n6(f,m):m:f||Gx}return i[u]||Gx}}},wE=(e,t,i)=>{if(e.length-t===0)return i.classGroupId;const a=e[t],o=i.nextPart.get(a);if(o){const f=wE(e,t+1,o);if(f)return f}const u=i.validators;if(u===null)return;const h=t===0?e.join(th):e.slice(t).join(th),m=u.length;for(let f=0;f<m;f++){const p=u[f];if(p.validator(h))return p.classGroupId}},o6=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),i=t.indexOf(":"),s=t.slice(0,i);return s?r6+s:void 0})(),l6=e=>{const{theme:t,classGroups:i}=e;return c6(i,t)},c6=(e,t)=>{const i=SE();for(const s in e){const a=e[s];Z0(a,i,s,t)}return i},Z0=(e,t,i,s)=>{const a=e.length;for(let o=0;o<a;o++){const u=e[o];u6(u,t,i,s)}},u6=(e,t,i,s)=>{if(typeof e=="string"){d6(e,t,i);return}if(typeof e=="function"){h6(e,t,i,s);return}f6(e,t,i,s)},d6=(e,t,i)=>{const s=e===""?t:EE(t,e);s.classGroupId=i},h6=(e,t,i,s)=>{if(m6(e)){Z0(e(s),t,i,s);return}t.validators===null&&(t.validators=[]),t.validators.push(s6(i,e))},f6=(e,t,i,s)=>{const a=Object.entries(e),o=a.length;for(let u=0;u<o;u++){const[h,m]=a[u];Z0(m,EE(t,h),i,s)}},EE=(e,t)=>{let i=e;const s=t.split(th),a=s.length;for(let o=0;o<a;o++){const u=s[o];let h=i.nextPart.get(u);h||(h=SE(),i.nextPart.set(u,h)),i=h}return i},m6=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,p6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,i=Object.create(null),s=Object.create(null);const a=(o,u)=>{i[o]=u,t++,t>e&&(t=0,s=i,i=Object.create(null))};return{get(o){let u=i[o];if(u!==void 0)return u;if((u=s[o])!==void 0)return a(o,u),u},set(o,u){o in i?i[o]=u:a(o,u)}}},Ng="!",Kx=":",g6=[],Wx=(e,t,i,s,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:i,maybePostfixModifierPosition:s,isExternal:a}),b6=e=>{const{prefix:t,experimentalParseClassName:i}=e;let s=a=>{const o=[];let u=0,h=0,m=0,f;const p=a.length;for(let S=0;S<p;S++){const k=a[S];if(u===0&&h===0){if(k===Kx){o.push(a.slice(m,S)),m=S+1;continue}if(k==="/"){f=S;continue}}k==="["?u++:k==="]"?u--:k==="("?h++:k===")"&&h--}const b=o.length===0?a:a.slice(m);let v=b,x=!1;b.endsWith(Ng)?(v=b.slice(0,-1),x=!0):b.startsWith(Ng)&&(v=b.slice(1),x=!0);const y=f&&f>m?f-m:void 0;return Wx(o,x,v,y)};if(t){const a=t+Kx,o=s;s=u=>u.startsWith(a)?o(u.slice(a.length)):Wx(g6,!1,u,void 0,!0)}if(i){const a=s;s=o=>i({className:o,parseClassName:a})}return s},_6=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((i,s)=>{t.set(i,1e6+s)}),i=>{const s=[];let a=[];for(let o=0;o<i.length;o++){const u=i[o],h=u[0]==="[",m=t.has(u);h||m?(a.length>0&&(a.sort(),s.push(...a),a=[]),s.push(u)):a.push(u)}return a.length>0&&(a.sort(),s.push(...a)),s}},v6=e=>({cache:p6(e.cacheSize),parseClassName:b6(e),sortModifiers:_6(e),postfixLookupClassGroupIds:x6(e),...a6(e)}),x6=e=>{const t=Object.create(null),i=e.postfixLookupClassGroups;if(i)for(let s=0;s<i.length;s++)t[i[s]]=!0;return t},y6=/\s+/,S6=(e,t)=>{const{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:a,sortModifiers:o,postfixLookupClassGroupIds:u}=t,h=[],m=e.trim().split(y6);let f="";for(let p=m.length-1;p>=0;p-=1){const b=m[p],{isExternal:v,modifiers:x,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:k}=i(b);if(v){f=b+(f.length>0?" "+f:f);continue}let N=!!k,T;if(N){const L=S.substring(0,k);T=s(L);const M=T&&u[T]?s(S):void 0;M&&M!==T&&(T=M,N=!1)}else T=s(S);if(!T){if(!N){f=b+(f.length>0?" "+f:f);continue}if(T=s(S),!T){f=b+(f.length>0?" "+f:f);continue}N=!1}const R=x.length===0?"":x.length===1?x[0]:o(x).join(":"),A=y?R+Ng:R,O=A+T;if(h.indexOf(O)>-1)continue;h.push(O);const H=a(T,N);for(let L=0;L<H.length;++L){const M=H[L];h.push(A+M)}f=b+(f.length>0?" "+f:f)}return f},w6=(...e)=>{let t=0,i,s,a="";for(;t<e.length;)(i=e[t++])&&(s=kE(i))&&(a&&(a+=" "),a+=s);return a},kE=e=>{if(typeof e=="string")return e;let t,i="";for(let s=0;s<e.length;s++)e[s]&&(t=kE(e[s]))&&(i&&(i+=" "),i+=t);return i},E6=(e,...t)=>{let i,s,a,o;const u=m=>{const f=t.reduce((p,b)=>b(p),e());return i=v6(f),s=i.cache.get,a=i.cache.set,o=h,h(m)},h=m=>{const f=s(m);if(f)return f;const p=S6(m,i);return a(m,p),p};return o=u,(...m)=>o(w6(...m))},k6=[],ci=e=>{const t=i=>i[e]||k6;return t.isThemeGetter=!0,t},CE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,NE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,C6=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,N6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,T6=/\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$/,A6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,M6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,R6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fr=e=>C6.test(e),We=e=>!!e&&!Number.isNaN(Number(e)),fs=e=>!!e&&Number.isInteger(Number(e)),tp=e=>e.endsWith("%")&&We(e.slice(0,-1)),Js=e=>N6.test(e),TE=()=>!0,j6=e=>T6.test(e)&&!A6.test(e),Q0=()=>!1,D6=e=>M6.test(e),O6=e=>R6.test(e),L6=e=>!ke(e)&&!Ce(e),B6=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)),z6=e=>na(e,RE,Q0),ke=e=>CE.test(e),Na=e=>na(e,jE,j6),Yx=e=>na(e,q6,We),I6=e=>na(e,OE,TE),P6=e=>na(e,DE,Q0),Xx=e=>na(e,AE,Q0),U6=e=>na(e,ME,O6),Ed=e=>na(e,LE,D6),Ce=e=>NE.test(e),oc=e=>Wa(e,jE),H6=e=>Wa(e,DE),Zx=e=>Wa(e,AE),F6=e=>Wa(e,RE),$6=e=>Wa(e,ME),kd=e=>Wa(e,LE,!0),V6=e=>Wa(e,OE,!0),na=(e,t,i)=>{const s=CE.exec(e);return s?s[1]?t(s[1]):i(s[2]):!1},Wa=(e,t,i=!1)=>{const s=NE.exec(e);return s?s[1]?t(s[1]):i:!1},AE=e=>e==="position"||e==="percentage",ME=e=>e==="image"||e==="url",RE=e=>e==="length"||e==="size"||e==="bg-size",jE=e=>e==="length",q6=e=>e==="number",DE=e=>e==="family-name",OE=e=>e==="number"||e==="weight",LE=e=>e==="shadow",G6=()=>{const e=ci("color"),t=ci("font"),i=ci("text"),s=ci("font-weight"),a=ci("tracking"),o=ci("leading"),u=ci("breakpoint"),h=ci("container"),m=ci("spacing"),f=ci("radius"),p=ci("shadow"),b=ci("inset-shadow"),v=ci("text-shadow"),x=ci("drop-shadow"),y=ci("blur"),S=ci("perspective"),k=ci("aspect"),N=ci("ease"),T=ci("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...A(),Ce,ke],H=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],M=()=>[Ce,ke,m],$=()=>[Fr,"full","auto",...M()],P=()=>[fs,"none","subgrid",Ce,ke],F=()=>["auto",{span:["full",fs,Ce,ke]},fs,Ce,ke],Z=()=>[fs,"auto",Ce,ke],K=()=>["auto","min","max","fr",Ce,ke],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...M()],Y=()=>[Fr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],X=()=>[Fr,"screen","full","dvw","lvw","svw","min","max","fit",...M()],V=()=>[Fr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],I=()=>[e,Ce,ke],j=()=>[...A(),Zx,Xx,{position:[Ce,ke]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],de=()=>["auto","cover","contain",F6,z6,{size:[Ce,ke]}],oe=()=>[tp,oc,Na],he=()=>["","none","full",f,Ce,ke],se=()=>["",We,oc,Na],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"],xe=()=>[We,tp,Zx,Xx],Ze=()=>["","none",y,Ce,ke],ot=()=>["none",We,Ce,ke],lt=()=>["none",We,Ce,ke],Be=()=>[We,Ce,ke],Lt=()=>[Fr,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Js],breakpoint:[Js],color:[TE],container:[Js],"drop-shadow":[Js],ease:["in","out","in-out"],font:[L6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Js],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Js],shadow:[Js],spacing:["px",We],text:[Js],"text-shadow":[Js],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fr,ke,Ce,k]}],container:["container"],"container-type":[{"@container":["","normal","size",Ce,ke]}],"container-named":[B6],columns:[{columns:[We,ke,Ce,h]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:O()}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[fs,"auto",Ce,ke]}],basis:[{basis:[Fr,"full","auto",h,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[We,Fr,"auto","initial","none",ke]}],grow:[{grow:["",We,Ce,ke]}],shrink:[{shrink:["",We,Ce,ke]}],order:[{order:[fs,"first","last","none",Ce,ke]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"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:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[h,"screen",...Y()]}],"min-w":[{"min-w":[h,"screen","none",...Y()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[u]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",i,oc,Na]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,V6,I6]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tp,ke]}],"font-family":[{font:[H6,P6,t]}],"font-features":[{"font-features":[ke]}],"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,Ce,ke]}],"line-clamp":[{"line-clamp":[We,"none",Ce,Yx]}],leading:[{leading:[o,...M()]}],"list-image":[{"list-image":["none",Ce,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ce,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[We,"from-font","auto",Ce,Na]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[We,"auto",Ce,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"tab-size":[{tab:[fs,Ce,ke]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ce,ke]}],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",Ce,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:de()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},fs,Ce,ke],radial:["",Ce,ke],conic:[fs,Ce,ke]},$6,U6]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:he()}],"rounded-s":[{"rounded-s":he()}],"rounded-e":[{"rounded-e":he()}],"rounded-t":[{"rounded-t":he()}],"rounded-r":[{"rounded-r":he()}],"rounded-b":[{"rounded-b":he()}],"rounded-l":[{"rounded-l":he()}],"rounded-ss":[{"rounded-ss":he()}],"rounded-se":[{"rounded-se":he()}],"rounded-ee":[{"rounded-ee":he()}],"rounded-es":[{"rounded-es":he()}],"rounded-tl":[{"rounded-tl":he()}],"rounded-tr":[{"rounded-tr":he()}],"rounded-br":[{"rounded-br":he()}],"rounded-bl":[{"rounded-bl":he()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[We,Ce,ke]}],"outline-w":[{outline:["",We,oc,Na]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",p,kd,Ed]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",b,kd,Ed]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[We,Na]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",v,kd,Ed]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[We,Ce,ke]}],"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":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Ce,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[We]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ce,ke]}],filter:[{filter:["","none",Ce,ke]}],blur:[{blur:Ze()}],brightness:[{brightness:[We,Ce,ke]}],contrast:[{contrast:[We,Ce,ke]}],"drop-shadow":[{"drop-shadow":["","none",x,kd,Ed]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",We,Ce,ke]}],"hue-rotate":[{"hue-rotate":[We,Ce,ke]}],invert:[{invert:["",We,Ce,ke]}],saturate:[{saturate:[We,Ce,ke]}],sepia:[{sepia:["",We,Ce,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ce,ke]}],"backdrop-blur":[{"backdrop-blur":Ze()}],"backdrop-brightness":[{"backdrop-brightness":[We,Ce,ke]}],"backdrop-contrast":[{"backdrop-contrast":[We,Ce,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",We,Ce,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[We,Ce,ke]}],"backdrop-invert":[{"backdrop-invert":["",We,Ce,ke]}],"backdrop-opacity":[{"backdrop-opacity":[We,Ce,ke]}],"backdrop-saturate":[{"backdrop-saturate":[We,Ce,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",We,Ce,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ce,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[We,"initial",Ce,ke]}],ease:[{ease:["linear","initial",N,Ce,ke]}],delay:[{delay:[We,Ce,ke]}],animate:[{animate:["none",T,Ce,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ce,ke]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ot()}],"rotate-x":[{"rotate-x":ot()}],"rotate-y":[{"rotate-y":ot()}],"rotate-z":[{"rotate-z":ot()}],scale:[{scale:lt()}],"scale-x":[{"scale-x":lt()}],"scale-y":[{"scale-y":lt()}],"scale-z":[{"scale-z":lt()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[Ce,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"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:[fs,Ce,ke]}],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"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",Ce,ke]}],"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":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",Ce,ke]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[We,oc,Na,Yx]}],stroke:[{stroke:["none",...I()]}],"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"]}},K6=E6(G6);function me(...e){return K6(Bc(e))}const BE=yE("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 ue({className:e,variant:t,size:i,...s}){return c.jsx("button",{className:me(BE({variant:t,size:i,className:e})),...s})}const zE=E.createContext({});function W6(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const Y6=typeof window<"u",X6=Y6?E.useLayoutEffect:E.useEffect,J0=E.createContext(null);function eb(e,t){e.indexOf(t)===-1&&e.push(t)}function ih(e,t){const i=e.indexOf(t);i>-1&&e.splice(i,1)}const ks=(e,t,i)=>i>t?t:i<e?e:i;let tb=()=>{};const Jr={},IE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function PE(e){return typeof e=="object"&&e!==null}const UE=e=>/^0[^.\s]+$/u.test(e);function HE(e){let t;return()=>(t===void 0&&(t=e()),t)}const $n=e=>e,Z6=(e,t)=>i=>t(e(i)),Zc=(...e)=>e.reduce(Z6),zc=(e,t,i)=>{const s=t-e;return s===0?1:(i-e)/s};class ib{constructor(){this.subscriptions=[]}add(t){return eb(this.subscriptions,t),()=>ih(this.subscriptions,t)}notify(t,i,s){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,i,s);else for(let o=0;o<a;o++){const u=this.subscriptions[o];u&&u(t,i,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const En=e=>e*1e3,Fn=e=>e/1e3;function FE(e,t){return t?e*(1e3/t):0}const $E=(e,t,i)=>(((1-3*i+3*t)*e+(3*i-6*t))*e+3*t)*e,Q6=1e-7,J6=12;function eR(e,t,i,s,a){let o,u,h=0;do u=t+(i-t)/2,o=$E(u,s,a)-e,o>0?i=u:t=u;while(Math.abs(o)>Q6&&++h<J6);return u}function Qc(e,t,i,s){if(e===t&&i===s)return $n;const a=o=>eR(o,0,1,e,i);return o=>o===0||o===1?o:$E(a(o),t,s)}const VE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,qE=e=>t=>1-e(1-t),GE=Qc(.33,1.53,.69,.99),nb=qE(GE),KE=VE(nb),WE=e=>e>=1?1:(e*=2)<1?.5*nb(e):.5*(2-Math.pow(2,-10*(e-1))),sb=e=>1-Math.sin(Math.acos(e)),YE=qE(sb),XE=VE(sb),tR=Qc(.42,0,1,1),iR=Qc(0,0,.58,1),ZE=Qc(.42,0,.58,1),nR=e=>Array.isArray(e)&&typeof e[0]!="number",QE=e=>Array.isArray(e)&&typeof e[0]=="number",sR={linear:$n,easeIn:tR,easeInOut:ZE,easeOut:iR,circIn:sb,circInOut:XE,circOut:YE,backIn:nb,backInOut:KE,backOut:GE,anticipate:WE},rR=e=>typeof e=="string",Qx=e=>{if(QE(e)){tb(e.length===4);const[t,i,s,a]=e;return Qc(t,i,s,a)}else if(rR(e))return sR[e];return e},Cd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function aR(e,t){let i=new Set,s=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,v=!1)=>{const y=v&&a?i:s;return b&&u.add(p),y.add(p),p},cancel:p=>{s.delete(p),u.delete(p)},process:p=>{if(h=p,a){o=!0;return}a=!0;const b=i;i=s,s=b,i.forEach(m),i.clear(),a=!1,o&&(o=!1,f.process(p))}};return f}const oR=40;function JE(e,t){let i=!1,s=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>i=!0,u=Cd.reduce((R,A)=>(R[A]=aR(o),R),{}),{setup:h,read:m,resolveKeyframes:f,preUpdate:p,update:b,preRender:v,render:x,postRender:y}=u,S=()=>{const R=Jr.useManualTiming,A=R?a.timestamp:performance.now();i=!1,R||(a.delta=s?1e3/60:Math.max(Math.min(A-a.timestamp,oR),1)),a.timestamp=A,a.isProcessing=!0,h.process(a),m.process(a),f.process(a),p.process(a),b.process(a),v.process(a),x.process(a),y.process(a),a.isProcessing=!1,i&&t&&(s=!1,e(S))},k=()=>{i=!0,s=!0,a.isProcessing||e(S)};return{schedule:Cd.reduce((R,A)=>{const O=u[A];return R[A]=(H,L=!1,M=!1)=>(i||k(),O.schedule(H,L,M)),R},{}),cancel:R=>{for(let A=0;A<Cd.length;A++)u[Cd[A]].cancel(R)},state:a,steps:u}}const{schedule:kt,cancel:ea,state:Ai,steps:ip}=JE(typeof requestAnimationFrame<"u"?requestAnimationFrame:$n,!0);let Hd;function lR(){Hd=void 0}const Ki={now:()=>(Hd===void 0&&Ki.set(Ai.isProcessing||Jr.useManualTiming?Ai.timestamp:performance.now()),Hd),set:e=>{Hd=e,queueMicrotask(lR)}},ek=e=>t=>typeof t=="string"&&t.startsWith(e),tk=ek("--"),cR=ek("var(--"),rb=e=>cR(e)?uR.test(e.split("/*")[0].trim()):!1,uR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Jx(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const nl={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ic={...nl,transform:e=>ks(0,1,e)},Nd={...nl,default:1},Tc=e=>Math.round(e*1e5)/1e5,ab=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function dR(e){return e==null}const hR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ob=(e,t)=>i=>!!(typeof i=="string"&&hR.test(i)&&i.startsWith(e)||t&&!dR(i)&&Object.prototype.hasOwnProperty.call(i,t)),ik=(e,t,i)=>s=>{if(typeof s!="string")return s;const[a,o,u,h]=s.match(ab);return{[e]:parseFloat(a),[t]:parseFloat(o),[i]:parseFloat(u),alpha:h!==void 0?parseFloat(h):1}},fR=e=>ks(0,255,e),np={...nl,transform:e=>Math.round(fR(e))},La={test:ob("rgb","red"),parse:ik("red","green","blue"),transform:({red:e,green:t,blue:i,alpha:s=1})=>"rgba("+np.transform(e)+", "+np.transform(t)+", "+np.transform(i)+", "+Tc(Ic.transform(s))+")"};function mR(e){let t="",i="",s="",a="";return e.length>5?(t=e.substring(1,3),i=e.substring(3,5),s=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),i=e.substring(2,3),s=e.substring(3,4),a=e.substring(4,5),t+=t,i+=i,s+=s,a+=a),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:a?parseInt(a,16)/255:1}}const Tg={test:ob("#"),parse:mR,transform:La.transform},Jc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Kr=Jc("deg"),ys=Jc("%"),Te=Jc("px"),pR=Jc("vh"),gR=Jc("vw"),ey={...ys,parse:e=>ys.parse(e)/100,transform:e=>ys.transform(e*100)},Go={test:ob("hsl","hue"),parse:ik("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:i,alpha:s=1})=>"hsla("+Math.round(e)+", "+ys.transform(Tc(t))+", "+ys.transform(Tc(i))+", "+Tc(Ic.transform(s))+")"},si={test:e=>La.test(e)||Tg.test(e)||Go.test(e),parse:e=>La.test(e)?La.parse(e):Go.test(e)?Go.parse(e):Tg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?La.transform(e):Go.transform(e),getAnimatableNone:e=>{const t=si.parse(e);return t.alpha=0,si.transform(t)}},bR=/(?:#[\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(ab)?.length||0)+(e.match(bR)?.length||0)>0}const nk="number",sk="color",vR="var",xR="var(",ty="${}",yR=/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(),i=[],s={color:[],number:[],var:[]},a=[];let o=0;const h=t.replace(yR,m=>(si.test(m)?(s.color.push(o),a.push(sk),i.push(si.parse(m))):m.startsWith(xR)?(s.var.push(o),a.push(vR),i.push(m)):(s.number.push(o),a.push(nk),i.push(parseFloat(m))),++o,ty)).split(ty);return{values:i,split:h,indexes:s,types:a}}function SR(e){return Jo(e).values}function rk({split:e,types:t}){const i=e.length;return s=>{let a="";for(let o=0;o<i;o++)if(a+=e[o],s[o]!==void 0){const u=t[o];u===nk?a+=Tc(s[o]):u===sk?a+=si.transform(s[o]):a+=s[o]}return a}}function wR(e){return rk(Jo(e))}const ER=e=>typeof e=="number"?0:si.test(e)?si.getAnimatableNone(e):e,kR=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:ER(e);function CR(e){const t=Jo(e);return rk(t)(t.values.map((s,a)=>kR(s,t.split[a])))}const rs={test:_R,parse:SR,createTransformer:wR,getAnimatableNone:CR};function sp(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function NR({hue:e,saturation:t,lightness:i,alpha:s}){e/=360,t/=100,i/=100;let a=0,o=0,u=0;if(!t)a=o=u=i;else{const h=i<.5?i*(1+t):i+t-i*t,m=2*i-h;a=sp(m,h,e+1/3),o=sp(m,h,e),u=sp(m,h,e-1/3)}return{red:Math.round(a*255),green:Math.round(o*255),blue:Math.round(u*255),alpha:s}}function nh(e,t){return i=>i>0?t:e}const Rt=(e,t,i)=>e+(t-e)*i,rp=(e,t,i)=>{const s=e*e,a=i*(t*t-s)+s;return a<0?0:Math.sqrt(a)},TR=[Tg,La,Go],AR=e=>TR.find(t=>t.test(e));function iy(e){const t=AR(e);if(!t)return!1;let i=t.parse(e);return t===Go&&(i=NR(i)),i}const ny=(e,t)=>{const i=iy(e),s=iy(t);if(!i||!s)return nh(e,t);const a={...i};return o=>(a.red=rp(i.red,s.red,o),a.green=rp(i.green,s.green,o),a.blue=rp(i.blue,s.blue,o),a.alpha=Rt(i.alpha,s.alpha,o),La.transform(a))},Ag=new Set(["none","hidden"]);function MR(e,t){return Ag.has(e)?i=>i<=0?e:t:i=>i>=1?t:e}function RR(e,t){return i=>Rt(e,t,i)}function lb(e){return typeof e=="number"?RR:typeof e=="string"?rb(e)?nh:si.test(e)?ny:OR:Array.isArray(e)?ak:typeof e=="object"?si.test(e)?ny:jR:nh}function ak(e,t){const i=[...e],s=i.length,a=e.map((o,u)=>lb(o)(o,t[u]));return o=>{for(let u=0;u<s;u++)i[u]=a[u](o);return i}}function jR(e,t){const i={...e,...t},s={};for(const a in i)e[a]!==void 0&&t[a]!==void 0&&(s[a]=lb(e[a])(e[a],t[a]));return a=>{for(const o in s)i[o]=s[o](a);return i}}function DR(e,t){const i=[],s={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],u=e.indexes[o][s[o]],h=e.values[u]??0;i[a]=h,s[o]++}return i}const OR=(e,t)=>{const i=rs.createTransformer(t),s=Jo(e),a=Jo(t);return s.indexes.var.length===a.indexes.var.length&&s.indexes.color.length===a.indexes.color.length&&s.indexes.number.length>=a.indexes.number.length?Ag.has(e)&&!a.values.length||Ag.has(t)&&!s.values.length?MR(e,t):Zc(ak(DR(s,a),a.values),i):nh(e,t)};function ok(e,t,i){return typeof e=="number"&&typeof t=="number"&&typeof i=="number"?Rt(e,t,i):lb(e)(e,t)}const LR=e=>{const t=({timestamp:i})=>e(i);return{start:(i=!0)=>kt.update(t,i),stop:()=>ea(t),now:()=>Ai.isProcessing?Ai.timestamp:Ki.now()}},lk=(e,t,i=10)=>{let s="";const a=Math.max(Math.round(t/i),2);for(let o=0;o<a;o++)s+=Math.round(e(o/(a-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},sh=2e4;function cb(e){let t=0;const i=50;let s=e.next(t);for(;!s.done&&t<sh;)t+=i,s=e.next(t);return t>=sh?1/0:t}function BR(e,t=100,i){const s=i({...e,keyframes:[0,t]}),a=Math.min(cb(s),sh);return{type:"keyframes",ease:o=>s.next(a*o).value/t,duration:Fn(a)}}const Ft={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 Mg(e,t){return e*Math.sqrt(1-t*t)}const zR=12;function IR(e,t,i){let s=i;for(let a=1;a<zR;a++)s=s-e(s)/t(s);return s}const ap=.001;function PR({duration:e=Ft.duration,bounce:t=Ft.bounce,velocity:i=Ft.velocity,mass:s=Ft.mass}){let a,o,u=1-t;u=ks(Ft.minDamping,Ft.maxDamping,u),e=ks(Ft.minDuration,Ft.maxDuration,Fn(e)),u<1?(a=f=>{const p=f*u,b=p*e,v=p-i,x=Mg(f,u),y=Math.exp(-b);return ap-v/x*y},o=f=>{const b=f*u*e,v=b*i+i,x=Math.pow(u,2)*Math.pow(f,2)*e,y=Math.exp(-b),S=Mg(Math.pow(f,2),u);return(-a(f)+ap>0?-1:1)*((v-x)*y)/S}):(a=f=>{const p=Math.exp(-f*e),b=(f-i)*e+1;return-ap+p*b},o=f=>{const p=Math.exp(-f*e),b=(i-f)*(e*e);return p*b});const h=5/e,m=IR(a,o,h);if(e=En(e),isNaN(m))return{stiffness:Ft.stiffness,damping:Ft.damping,duration:e};{const f=Math.pow(m,2)*s;return{stiffness:f,damping:u*2*Math.sqrt(s*f),duration:e}}}const UR=["duration","bounce"],HR=["stiffness","damping","mass"];function sy(e,t){return t.some(i=>e[i]!==void 0)}function FR(e){let t={velocity:Ft.velocity,stiffness:Ft.stiffness,damping:Ft.damping,mass:Ft.mass,isResolvedFromDuration:!1,...e};if(!sy(e,HR)&&sy(e,UR))if(t.velocity=0,e.visualDuration){const i=e.visualDuration,s=2*Math.PI/(i*1.2),a=s*s,o=2*ks(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Ft.mass,stiffness:a,damping:o}}else{const i=PR({...e,velocity:0});t={...t,...i,mass:Ft.mass},t.isResolvedFromDuration=!0}return t}function rh(e=Ft.visualDuration,t=Ft.bounce){const i=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:a}=i;const o=i.keyframes[0],u=i.keyframes[i.keyframes.length-1],h={done:!1,value:o},{stiffness:m,damping:f,mass:p,duration:b,velocity:v,isResolvedFromDuration:x}=FR({...i,velocity:-Fn(i.velocity||0)}),y=v||0,S=f/(2*Math.sqrt(m*p)),k=u-o,N=Fn(Math.sqrt(m/p)),T=Math.abs(k)<5;s||(s=T?Ft.restSpeed.granular:Ft.restSpeed.default),a||(a=T?Ft.restDelta.granular:Ft.restDelta.default);let R,A,O,H,L,M;if(S<1)O=Mg(N,S),H=(y+S*N*k)/O,R=P=>{const F=Math.exp(-S*N*P);return u-F*(H*Math.sin(O*P)+k*Math.cos(O*P))},L=S*N*H+k*O,M=S*N*k-H*O,A=P=>Math.exp(-S*N*P)*(L*Math.sin(O*P)+M*Math.cos(O*P));else if(S===1){R=F=>u-Math.exp(-N*F)*(k+(y+N*k)*F);const P=y+N*k;A=F=>Math.exp(-N*F)*(N*P*F-y)}else{const P=N*Math.sqrt(S*S-1);R=Q=>{const q=Math.exp(-S*N*Q),D=Math.min(P*Q,300);return u-q*((y+S*N*k)*Math.sinh(D)+P*k*Math.cosh(D))/P};const F=(y+S*N*k)/P,Z=S*N*F-k*P,K=S*N*k-F*P;A=Q=>{const q=Math.exp(-S*N*Q),D=Math.min(P*Q,300);return q*(Z*Math.sinh(D)+K*Math.cosh(D))}}const $={calculatedDuration:x&&b||null,velocity:P=>En(A(P)),next:P=>{if(!x&&S<1){const Z=Math.exp(-S*N*P),K=Math.sin(O*P),Q=Math.cos(O*P),q=u-Z*(H*K+k*Q),D=En(Z*(L*K+M*Q));return h.done=Math.abs(D)<=s&&Math.abs(u-q)<=a,h.value=h.done?u:q,h}const F=R(P);if(x)h.done=P>=b;else{const Z=En(A(P));h.done=Math.abs(Z)<=s&&Math.abs(u-F)<=a}return h.value=h.done?u:F,h},toString:()=>{const P=Math.min(cb($),sh),F=lk(Z=>$.next(P*Z).value,P,30);return P+"ms "+F},toTransition:()=>{}};return $}rh.applyToOptions=e=>{const t=BR(e,100,rh);return e.ease=t.ease,e.duration=En(t.duration),e.type="keyframes",e};const $R=5;function ck(e,t,i){const s=Math.max(t-$R,0);return FE(i-e(s),t-s)}function Rg({keyframes:e,velocity:t=0,power:i=.8,timeConstant:s=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:u,min:h,max:m,restDelta:f=.5,restSpeed:p}){const b=e[0],v={done:!1,value:b},x=M=>h!==void 0&&M<h||m!==void 0&&M>m,y=M=>h===void 0?m:m===void 0||Math.abs(h-M)<Math.abs(m-M)?h:m;let S=i*t;const k=b+S,N=u===void 0?k:u(k);N!==k&&(S=N-b);const T=M=>-S*Math.exp(-M/s),R=M=>N+T(M),A=M=>{const $=T(M),P=R(M);v.done=Math.abs($)<=f,v.value=v.done?N:P};let O,H;const L=M=>{x(v.value)&&(O=M,H=rh({keyframes:[v.value,y(v.value)],velocity:ck(R,M,v.value),damping:a,stiffness:o,restDelta:f,restSpeed:p}))};return L(0),{calculatedDuration:null,next:M=>{let $=!1;return!H&&O===void 0&&($=!0,A(M),L(M)),O!==void 0&&M>=O?H.next(M-O):(!$&&A(M),v)}}}function VR(e,t,i){const s=[],a=i||Jr.mix||ok,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]||$n:t;h=Zc(m,h)}s.push(h)}return s}function qR(e,t,{clamp:i=!0,ease:s,mixer:a}={}){const o=e.length;if(tb(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=VR(t,s,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 v=zc(e[b],e[b+1],p);return h[b](v)};return i?p=>f(ks(e[0],e[o-1],p)):f}function GR(e,t){const i=e[e.length-1];for(let s=1;s<=t;s++){const a=zc(0,t,s);e.push(Rt(i,1,a))}}function KR(e){const t=[0];return GR(t,e.length-1),t}function WR(e,t){return e.map(i=>i*t)}function YR(e,t){return e.map(()=>t||ZE).splice(0,e.length-1)}function Ac({duration:e=300,keyframes:t,times:i,ease:s="easeInOut"}){const a=nR(s)?s.map(Qx):Qx(s),o={done:!1,value:t[0]},u=WR(i&&i.length===t.length?i:KR(t),e),h=qR(u,t,{ease:Array.isArray(a)?a:YR(t,a)});return{calculatedDuration:e,next:m=>(o.value=h(m),o.done=m>=e,o)}}const XR=e=>e!==null;function Lh(e,{repeat:t,repeatType:i="loop"},s,a=1){const o=e.filter(XR),h=a<0||t&&i!=="loop"&&t%2===1?0:o.length-1;return!h||s===void 0?o[h]:s}const ZR={decay:Rg,inertia:Rg,tween:Ac,keyframes:Ac,spring:rh};function uk(e){typeof e.type=="string"&&(e.type=ZR[e.type])}class ub{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,i){return this.finished.then(t,i)}}const QR=e=>e/100;class ah extends ub{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:i}=this.options;i&&i.updatedAt!==Ki.now()&&this.tick(Ki.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;uk(t);const{type:i=Ac,repeat:s=0,repeatDelay:a=0,repeatType:o,velocity:u=0}=t;let{keyframes:h}=t;const m=i||Ac;m!==Ac&&typeof h[0]!="number"&&(this.mixKeyframes=Zc(QR,ok(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=cb(f));const{calculatedDuration:p}=f;this.calculatedDuration=p,this.resolvedDuration=p+a,this.totalDuration=this.resolvedDuration*(s+1)-a,this.generator=f}updateTime(t){const i=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(t,i=!1){const{generator:s,totalDuration:a,mixKeyframes:o,mirroredGenerator:u,resolvedDuration:h,calculatedDuration:m}=this;if(this.startTime===null)return s.next(0);const{delay:f=0,keyframes:p,repeat:b,repeatType:v,repeatDelay:x,type:y,onUpdate:S,finalKeyframe:k}=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)),i?this.currentTime=t:this.updateTime(t);const N=this.currentTime-f*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?N<0:N>a;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let R=this.currentTime,A=s;if(b){const M=Math.min(this.currentTime,a)/h;let $=Math.floor(M),P=M%1;!P&&M>=1&&(P=1),P===1&&$--,$=Math.min($,b+1),$%2&&(v==="reverse"?(P=1-P,x&&(P-=x/h)):v==="mirror"&&(A=u)),R=ks(0,1,P)*h}let O;T?(this.delayState.value=p[0],O=this.delayState):O=A.next(R),o&&!T&&(O.value=o(O.value));let{done:H}=O;!T&&m!==null&&(H=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&H);return L&&y!==Rg&&(O.value=Lh(p,this.options,k,this.speed)),S&&S(O.value),L&&this.finish(),O}then(t,i){return this.finished.then(t,i)}get duration(){return Fn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fn(t)}get time(){return Fn(this.currentTime)}set time(t){t=En(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 i=this.generator.next(t).value;return ck(s=>this.generator.next(s).value,t,i)}get speed(){return this.playbackSpeed}set speed(t){const i=this.playbackSpeed!==t;i&&this.driver&&this.updateTime(Ki.now()),this.playbackSpeed=t,i&&this.driver&&(this.time=Fn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=LR,startTime:i}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=i??s),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(Ki.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 JR(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ba=e=>e*180/Math.PI,jg=e=>{const t=Ba(Math.atan2(e[1],e[0]));return Dg(t)},e8={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:jg,rotateZ:jg,skewX:e=>Ba(Math.atan(e[1])),skewY:e=>Ba(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Dg=e=>(e=e%360,e<0&&(e+=360),e),ry=jg,ay=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),oy=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),t8={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ay,scaleY:oy,scale:e=>(ay(e)+oy(e))/2,rotateX:e=>Dg(Ba(Math.atan2(e[6],e[5]))),rotateY:e=>Dg(Ba(Math.atan2(-e[2],e[0]))),rotateZ:ry,rotate:ry,skewX:e=>Ba(Math.atan(e[4])),skewY:e=>Ba(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Og(e){return e.includes("scale")?1:0}function Lg(e,t){if(!e||e==="none")return Og(t);const i=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,a;if(i)s=t8,a=i;else{const h=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=e8,a=h}if(!a)return Og(t);const o=s[t],u=a[1].split(",").map(n8);return typeof o=="function"?o(u):u[o]}const i8=(e,t)=>{const{transform:i="none"}=getComputedStyle(e);return Lg(i,t)};function n8(e){return parseFloat(e.trim())}const sl=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],rl=new Set(sl),ly=e=>e===nl||e===Te,s8=new Set(["x","y","z"]),r8=sl.filter(e=>!s8.has(e));function a8(e){const t=[];return r8.forEach(i=>{const s=e.getValue(i);s!==void 0&&(t.push([i,s.get()]),s.set(i.startsWith("scale")?1:0))}),t}const Yr={width:({x:e},{paddingLeft:t="0",paddingRight:i="0",boxSizing:s})=>{const a=e.max-e.min;return s==="border-box"?a:a-parseFloat(t)-parseFloat(i)},height:({y:e},{paddingTop:t="0",paddingBottom:i="0",boxSizing:s})=>{const a=e.max-e.min;return s==="border-box"?a:a-parseFloat(t)-parseFloat(i)},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})=>Lg(t,"x"),y:(e,{transform:t})=>Lg(t,"y")};Yr.translateX=Yr.x;Yr.translateY=Yr.y;const Pa=new Set;let Bg=!1,zg=!1,Ig=!1;function dk(){if(zg){const e=Array.from(Pa).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),i=new Map;t.forEach(s=>{const a=a8(s);a.length&&(i.set(s,a),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const a=i.get(s);a&&a.forEach(([o,u])=>{s.getValue(o)?.set(u)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}zg=!1,Bg=!1,Pa.forEach(e=>e.complete(Ig)),Pa.clear()}function hk(){Pa.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zg=!0)})}function o8(){Ig=!0,hk(),dk(),Ig=!1}class db{constructor(t,i,s,a,o,u=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=i,this.name=s,this.motionValue=a,this.element=o,this.isAsync=u}scheduleResolve(){this.state="scheduled",this.isAsync?(Pa.add(this),Bg||(Bg=!0,kt.read(hk),kt.resolveKeyframes(dk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:i,element:s,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(s&&i){const h=s.readValue(i,u);h!=null&&(t[0]=h)}t[0]===void 0&&(t[0]=u),a&&o===void 0&&a.set(t[0])}JR(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Pa.delete(this)}cancel(){this.state==="scheduled"&&(Pa.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const l8=e=>e.startsWith("--");function fk(e,t,i){l8(t)?e.style.setProperty(t,i):e.style[t]=i}const c8={};function mk(e,t){const i=HE(e);return()=>c8[t]??i()}const u8=mk(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),pk=mk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),_c=([e,t,i,s])=>`cubic-bezier(${e}, ${t}, ${i}, ${s})`,cy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_c([0,.65,.55,1]),circOut:_c([.55,0,1,.45]),backIn:_c([.31,.01,.66,-.59]),backOut:_c([.33,1.53,.69,.99])};function gk(e,t){if(e)return typeof e=="function"?pk()?lk(e,t):"ease-out":QE(e)?_c(e):Array.isArray(e)?e.map(i=>gk(i,t)||cy.easeOut):cy[e]}function d8(e,t,i,{delay:s=0,duration:a=300,repeat:o=0,repeatType:u="loop",ease:h="easeOut",times:m}={},f=void 0){const p={[t]:i};m&&(p.offset=m);const b=gk(h,a);Array.isArray(b)&&(p.easing=b);const v={delay:s,duration:a,easing:Array.isArray(b)?"linear":b,fill:"both",iterations:o+1,direction:u==="reverse"?"alternate":"normal"};return f&&(v.pseudoElement=f),e.animate(p,v)}function bk(e){return typeof e=="function"&&"applyToOptions"in e}function h8({type:e,...t}){return bk(e)&&pk()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class _k extends ub{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:i,name:s,keyframes:a,pseudoElement:o,allowFlatten:u=!1,finalKeyframe:h,onComplete:m}=t;this.isPseudoElement=!!o,this.allowFlatten=u,this.options=t,tb(typeof t.type!="string");const f=h8(t);this.animation=d8(i,s,a,f,o),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const p=Lh(a,this.options,h,this.speed);this.updateMotionValue&&this.updateMotionValue(p),fk(i,s,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 Fn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fn(t)}get time(){return Fn(Number(this.animation.currentTime)||0)}set time(t){const i=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=En(t),i&&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:i,rangeEnd:s,observe:a}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&u8()?(this.animation.timeline=t,i&&(this.animation.rangeStart=i),s&&(this.animation.rangeEnd=s),$n):a(this)}}const vk={anticipate:WE,backInOut:KE,circInOut:XE};function f8(e){return e in vk}function m8(e){typeof e.ease=="string"&&f8(e.ease)&&(e.ease=vk[e.ease])}const op=10;class p8 extends _k{constructor(t){m8(t),uk(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:i,onUpdate:s,onComplete:a,element:o,...u}=this.options;if(!i)return;if(t!==void 0){i.set(t);return}const h=new ah({...u,autoplay:!1}),m=Math.max(op,Ki.now()-this.startTime),f=ks(0,op,m-op),p=h.sample(m).value,{name:b}=this.options;o&&b&&fk(o,b,p),i.setWithVelocity(h.sample(Math.max(0,m-f)).value,p,f),h.stop()}}const uy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(rs.test(e)||e==="0")&&!e.startsWith("url("));function g8(e){const t=e[0];if(e.length===1)return!0;for(let i=0;i<e.length;i++)if(e[i]!==t)return!0}function b8(e,t,i,s){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],u=uy(a,t),h=uy(o,t);return!u||!h?!1:g8(e)||(i==="spring"||bk(i))&&s}function Pg(e){e.duration=0,e.type="keyframes"}const xk=new Set(["opacity","clipPath","filter","transform"]),_8=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function v8(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&_8.test(e[t]))return!0;return!1}const x8=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),y8=HE(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function S8(e){const{motionValue:t,name:i,repeatDelay:s,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 y8()&&i&&(xk.has(i)||x8.has(i)&&v8(h))&&(i!=="transform"||!p)&&!f&&!s&&a!=="mirror"&&o!==0&&u!=="inertia"}const w8=40;class E8 extends ub{constructor({autoplay:t=!0,delay:i=0,type:s="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=Ki.now();const v={autoplay:t,delay:i,type:s,repeat:a,repeatDelay:o,repeatType:u,name:m,motionValue:f,element:p,...b},x=p?.KeyframeResolver||db;this.keyframeResolver=new x(h,(y,S,k)=>this.onKeyframesResolved(y,S,v,!k),m,f,p),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,i,s,a){this.keyframeResolver=void 0;const{name:o,type:u,velocity:h,delay:m,isHandoff:f,onUpdate:p}=s;this.resolvedAt=Ki.now();let b=!0;b8(t,o,u,h)||(b=!1,(Jr.instantAnimations||!m)&&p?.(Lh(t,s,i)),t[0]=t[t.length-1],Pg(s),s.repeat=0);const x={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>w8?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...s,keyframes:t},y=b&&!f&&S8(x),S=x.motionValue?.owner?.current;let k;if(y)try{k=new p8({...x,element:S})}catch{k=new ah(x)}else k=new ah(x);k.finished.then(()=>{this.notifyFinished()}).catch($n),this.pendingTimeline&&(this.stopTimeline=k.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=k}get finished(){return this._animation?this.animation.finished:this._finished}then(t,i){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),o8()),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 yk(e,t,i,s=0,a=1){const o=Array.from(e).sort((f,p)=>f.sortNodePosition(p)).indexOf(t),u=e.size,h=(u-1)*s;return typeof i=="function"?i(o,u):a===1?o*s:h-o*s}const k8=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function C8(e){const t=k8.exec(e);if(!t)return[,];const[,i,s,a]=t;return[`--${i??s}`,a]}function Sk(e,t,i=1){const[s,a]=C8(e);if(!s)return;const o=window.getComputedStyle(t).getPropertyValue(s);if(o){const u=o.trim();return IE(u)?parseFloat(u):u}return rb(a)?Sk(a,t,i+1):a}const N8={type:"spring",stiffness:500,damping:25,restSpeed:10},T8=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),A8={type:"keyframes",duration:.8},M8={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},R8=(e,{keyframes:t})=>t.length>2?A8:rl.has(e)?e.startsWith("scale")?T8(t[1]):N8:M8;function wk(e,t){if(e?.inherit&&t){const{inherit:i,...s}=e;return{...t,...s}}return e}function hb(e,t){const i=e?.[t]??e?.default??e;return i!==e?wk(i,e):i}const j8=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function D8(e){for(const t in e)if(!j8.has(t))return!0;return!1}const fb=(e,t,i,s={},a,o)=>u=>{const h=hb(s,e)||{},m=h.delay||s.delay||0;let{elapsed:f=0}=s;f=f-En(m);const p={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:t.getVelocity(),...h,delay:-f,onUpdate:v=>{t.set(v),h.onUpdate&&h.onUpdate(v)},onComplete:()=>{u(),h.onComplete&&h.onComplete()},name:e,motionValue:t,element:o?void 0:a};D8(h)||Object.assign(p,R8(e,p)),p.duration&&(p.duration=En(p.duration)),p.repeatDelay&&(p.repeatDelay=En(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let b=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(Pg(p),p.delay===0&&(b=!0)),(Jr.instantAnimations||Jr.skipAnimations||a?.shouldSkipAnimations)&&(b=!0,Pg(p),p.delay=0),p.allowFlatten=!h.type&&!h.ease,b&&!o&&t.get()!==void 0){const v=Lh(p.keyframes,h);if(v!==void 0){kt.update(()=>{p.onUpdate(v),p.onComplete()});return}}return h.isSync?new ah(p):new E8(p)};function dy(e){const t=[{},{}];return e?.values.forEach((i,s)=>{t[0][s]=i.get(),t[1][s]=i.getVelocity()}),t}function mb(e,t,i,s){if(typeof t=="function"){const[a,o]=dy(s);t=t(i!==void 0?i:e.custom,a,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,o]=dy(s);t=t(i!==void 0?i:e.custom,a,o)}return t}function Ua(e,t,i){const s=e.getProps();return mb(s,t,i!==void 0?i:s.custom,e)}const Ek=new Set(["width","height","top","left","right","bottom",...sl]),hy=30,O8=e=>!isNaN(parseFloat(e));class L8{constructor(t,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const a=Ki.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),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=i.owner}setCurrent(t){this.current=t,this.updatedAt=Ki.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=O8(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,i){this.events[t]||(this.events[t]=new ib);const s=this.events[t].add(i);return t==="change"?()=>{s(),kt.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,i){this.passiveEffect=t,this.stopPassiveEffect=i}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,i,s){this.set(i),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,i=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&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=Ki.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>hy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,hy);return FE(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(t){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=t(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function el(e,t){return new L8(e,t)}const Ug=e=>Array.isArray(e);function B8(e,t,i){e.hasValue(t)?e.getValue(t).set(i):e.addValue(t,el(i))}function z8(e){return Ug(e)?e[e.length-1]||0:e}function I8(e,t){const i=Ua(e,t);let{transitionEnd:s={},transition:a={},...o}=i||{};o={...o,...s};for(const u in o){const h=z8(o[u]);B8(e,u,h)}}const Ri=e=>!!(e&&e.getVelocity);function P8(e){return!!(Ri(e)&&e.add)}function Hg(e,t){const i=e.getValue("willChange");if(P8(i))return i.add(t);if(!i&&Jr.WillChange){const s=new Jr.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function pb(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const U8="framerAppearId",kk="data-"+pb(U8);function Ck(e){return e.props[kk]}function H8({protectedKeys:e,needsAnimating:t},i){const s=e.hasOwnProperty(i)&&t[i]!==!0;return t[i]=!1,s}function Nk(e,t,{delay:i=0,transitionOverride:s,type:a}={}){let{transition:o,transitionEnd:u,...h}=t;const m=e.getDefaultTransition();o=o?wk(o,m):m;const f=o?.reduceMotion;s&&(o=s);const p=[],b=a&&e.animationState&&e.animationState.getState()[a];for(const v in h){const x=e.getValue(v,e.latestValues[v]??null),y=h[v];if(y===void 0||b&&H8(b,v))continue;const S={delay:i,...hb(o||{},v)},k=x.get();if(k!==void 0&&!x.isAnimating()&&!Array.isArray(y)&&y===k&&!S.velocity){kt.update(()=>x.set(y));continue}let N=!1;if(window.MotionHandoffAnimation){const A=Ck(e);if(A){const O=window.MotionHandoffAnimation(A,v,kt);O!==null&&(S.startTime=O,N=!0)}}Hg(e,v);const T=f??e.shouldReduceMotion;x.start(fb(v,x,y,T&&Ek.has(v)?{type:!1}:S,e,N));const R=x.animation;R&&p.push(R)}if(u){const v=()=>kt.update(()=>{u&&I8(e,u)});p.length?Promise.all(p).then(v):v()}return p}function Fg(e,t,i={}){const s=Ua(e,t,i.type==="exit"?e.presenceContext?.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=s||{};i.transitionOverride&&(a=i.transitionOverride);const o=s?()=>Promise.all(Nk(e,s,i)):()=>Promise.resolve(),u=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:b}=a;return F8(e,t,m,f,p,b,i)}:()=>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(i.delay)])}function F8(e,t,i=0,s=0,a=0,o=1,u){const h=[];for(const m of e.variantChildren)m.notify("AnimationStart",t),h.push(Fg(m,t,{...u,delay:i+(typeof s=="function"?0:s)+yk(e.variantChildren,m,s,a,o)}).then(()=>m.notify("AnimationComplete",t)));return Promise.all(h)}function $8(e,t,i={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const a=t.map(o=>Fg(e,o,i));s=Promise.all(a)}else if(typeof t=="string")s=Fg(e,t,i);else{const a=typeof t=="function"?Ua(e,t,i.custom):t;s=Promise.all(Nk(e,a,i))}return s.then(()=>{e.notify("AnimationComplete",t)})}const V8={test:e=>e==="auto",parse:e=>e},Tk=e=>t=>t.test(e),Ak=[nl,Te,ys,Kr,gR,pR,V8],fy=e=>Ak.find(Tk(e));function q8(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||UE(e):!0}const G8=new Set(["brightness","contrast","saturate","opacity"]);function K8(e){const[t,i]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=i.match(ab)||[];if(!s)return e;const a=i.replace(s,"");let o=G8.has(t)?1:0;return s!==i&&(o*=100),t+"("+o+a+")"}const W8=/\b([a-z-]*)\(.*?\)/gu,$g={...rs,getAnimatableNone:e=>{const t=e.match(W8);return t?t.map(K8).join(" "):e}},Vg={...rs,getAnimatableNone:e=>{const t=rs.parse(e);return rs.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},my={...nl,transform:Math.round},Y8={rotate:Kr,rotateX:Kr,rotateY:Kr,rotateZ:Kr,scale:Nd,scaleX:Nd,scaleY:Nd,scaleZ:Nd,skew:Kr,skewX:Kr,skewY:Kr,distance:Te,translateX:Te,translateY:Te,translateZ:Te,x:Te,y:Te,z:Te,perspective:Te,transformPerspective:Te,opacity:Ic,originX:ey,originY:ey,originZ:Te},gb={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,...Y8,zIndex:my,fillOpacity:Ic,strokeOpacity:Ic,numOctaves:my},X8={...gb,color:si,backgroundColor:si,outlineColor:si,fill:si,stroke:si,borderColor:si,borderTopColor:si,borderRightColor:si,borderBottomColor:si,borderLeftColor:si,filter:$g,WebkitFilter:$g,mask:Vg,WebkitMask:Vg},Mk=e=>X8[e],Z8=new Set([$g,Vg]);function Rk(e,t){let i=Mk(e);return Z8.has(i)||(i=rs),i.getAnimatableNone?i.getAnimatableNone(t):void 0}const Q8=new Set(["auto","none","0"]);function J8(e,t,i){let s=0,a;for(;s<e.length&&!a;){const o=e[s];typeof o=="string"&&!Q8.has(o)&&Jo(o).values.length&&(a=e[s]),s++}if(a&&i)for(const o of t)e[o]=Rk(i,a)}class ej extends db{constructor(t,i,s,a,o){super(t,i,s,a,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:i,name:s}=this;if(!i||!i.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let b=t[p];if(typeof b=="string"&&(b=b.trim(),rb(b))){const v=Sk(b,i.current);v!==void 0&&(t[p]=v),p===t.length-1&&(this.finalKeyframe=b)}}if(this.resolveNoneKeyframes(),!Ek.has(s)||t.length!==2)return;const[a,o]=t,u=fy(a),h=fy(o),m=Jx(a),f=Jx(o);if(m!==f&&Yr[s]){this.needsMeasurement=!0;return}if(u!==h)if(ly(u)&&ly(h))for(let p=0;p<t.length;p++){const b=t[p];typeof b=="string"&&(t[p]=parseFloat(b))}else Yr[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:i}=this,s=[];for(let a=0;a<t.length;a++)(t[a]===null||q8(t[a]))&&s.push(a);s.length&&J8(t,s,i)}measureInitialState(){const{element:t,unresolvedKeyframes:i,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Yr[s](t.measureViewportBox(),window.getComputedStyle(t.current)),i[0]=this.measuredOrigin;const a=i[i.length-1];a!==void 0&&t.getValue(s,a).jump(a,!1)}measureEndState(){const{element:t,name:i,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const a=t.getValue(i);a&&a.jump(this.measuredOrigin,!1);const o=s.length-1,u=s[o];s[o]=Yr[i](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 jk(e,t,i){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const a=i?.[e]??s.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(s=>s!=null)}const Dk=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function tj(e){return PE(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:bb}=JE(queueMicrotask,!1),is={x:!1,y:!1};function Ok(){return is.x||is.y}function ij(e){return e==="x"||e==="y"?is[e]?null:(is[e]=!0,()=>{is[e]=!1}):is.x||is.y?null:(is.x=is.y=!0,()=>{is.x=is.y=!1})}function Lk(e,t){const i=jk(e),s=new AbortController,a={passive:!0,...t,signal:s.signal};return[i,a,()=>s.abort()]}function nj(e){return!(e.pointerType==="touch"||Ok())}function sj(e,t,i={}){const[s,a,o]=Lk(e,i);return s.forEach(u=>{let h=!1,m=!1,f;const p=()=>{u.removeEventListener("pointerleave",y)},b=k=>{f&&(f(k),f=void 0),p()},v=k=>{h=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),m&&(m=!1,b(k))},x=()=>{h=!0,window.addEventListener("pointerup",v,a),window.addEventListener("pointercancel",v,a)},y=k=>{if(k.pointerType!=="touch"){if(h){m=!0;return}b(k)}},S=k=>{if(!nj(k))return;m=!1;const N=t(u,k);typeof N=="function"&&(f=N,u.addEventListener("pointerleave",y,a))};u.addEventListener("pointerenter",S,a),u.addEventListener("pointerdown",x,a)}),o}const Bk=(e,t)=>t?e===t?!0:Bk(e,t.parentElement):!1,_b=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,rj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function aj(e){return rj.has(e.tagName)||e.isContentEditable===!0}const oj=new Set(["INPUT","SELECT","TEXTAREA"]);function lj(e){return oj.has(e.tagName)||e.isContentEditable===!0}const Fd=new WeakSet;function py(e){return t=>{t.key==="Enter"&&e(t)}}function lp(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const cj=(e,t)=>{const i=e.currentTarget;if(!i)return;const s=py(()=>{if(Fd.has(i))return;lp(i,"down");const a=py(()=>{lp(i,"up")}),o=()=>lp(i,"cancel");i.addEventListener("keyup",a,t),i.addEventListener("blur",o,t)});i.addEventListener("keydown",s,t),i.addEventListener("blur",()=>i.removeEventListener("keydown",s),t)};function gy(e){return _b(e)&&!Ok()}const by=new WeakSet;function uj(e,t,i={}){const[s,a,o]=Lk(e,i),u=h=>{const m=h.currentTarget;if(!gy(h)||by.has(h))return;Fd.add(m),i.stopPropagation&&by.add(h);const f=t(m,h),p=(x,y)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",v),Fd.has(m)&&Fd.delete(m),gy(x)&&typeof f=="function"&&f(x,{success:y})},b=x=>{p(x,m===window||m===document||i.useGlobalTarget||Bk(m,x.target))},v=x=>{p(x,!1)};window.addEventListener("pointerup",b,a),window.addEventListener("pointercancel",v,a)};return s.forEach(h=>{(i.useGlobalTarget?window:h).addEventListener("pointerdown",u,a),tj(h)&&(h.addEventListener("focus",f=>cj(f,a)),!aj(h)&&!h.hasAttribute("tabindex")&&(h.tabIndex=0))}),o}function vb(e){return PE(e)&&"ownerSVGElement"in e}const $d=new WeakMap;let Vd;const zk=(e,t,i)=>(s,a)=>a&&a[0]?a[0][e+"Size"]:vb(s)&&"getBBox"in s?s.getBBox()[t]:s[i],dj=zk("inline","width","offsetWidth"),hj=zk("block","height","offsetHeight");function fj({target:e,borderBoxSize:t}){$d.get(e)?.forEach(i=>{i(e,{get width(){return dj(e,t)},get height(){return hj(e,t)}})})}function mj(e){e.forEach(fj)}function pj(){typeof ResizeObserver>"u"||(Vd=new ResizeObserver(mj))}function gj(e,t){Vd||pj();const i=jk(e);return i.forEach(s=>{let a=$d.get(s);a||(a=new Set,$d.set(s,a)),a.add(t),Vd?.observe(s)}),()=>{i.forEach(s=>{const a=$d.get(s);a?.delete(t),a?.size||Vd?.unobserve(s)})}}const qd=new Set;let Ko;function bj(){Ko=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};qd.forEach(t=>t(e))},window.addEventListener("resize",Ko)}function _j(e){return qd.add(e),Ko||bj(),()=>{qd.delete(e),!qd.size&&typeof Ko=="function"&&(window.removeEventListener("resize",Ko),Ko=void 0)}}function _y(e,t){return typeof e=="function"?_j(e):gj(e,t)}function vj(e){return vb(e)&&e.tagName==="svg"}const xj=[...Ak,si,rs],yj=e=>xj.find(Tk(e)),vy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Wo=()=>({x:vy(),y:vy()}),xy=()=>({min:0,max:0}),hi=()=>({x:xy(),y:xy()}),Sj=new WeakMap;function Bh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Pc(e){return typeof e=="string"||Array.isArray(e)}const xb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],yb=["initial",...xb];function zh(e){return Bh(e.animate)||yb.some(t=>Pc(e[t]))}function Ik(e){return!!(zh(e)||e.variants)}function wj(e,t,i){for(const s in t){const a=t[s],o=i[s];if(Ri(a))e.addValue(s,a);else if(Ri(o))e.addValue(s,el(a,{owner:e}));else if(o!==a)if(e.hasValue(s)){const u=e.getValue(s);u.liveStyle===!0?u.jump(a):u.hasAnimated||u.set(a)}else{const u=e.getStaticValue(s);e.addValue(s,el(u!==void 0?u:a,{owner:e}))}}for(const s in i)t[s]===void 0&&e.removeValue(s);return t}const qg={current:null},Pk={current:!1},Ej=typeof window<"u";function kj(){if(Pk.current=!0,!!Ej)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>qg.current=e.matches;e.addEventListener("change",t),t()}else qg.current=!1}const yy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let oh={};function Uk(e){oh=e}function Cj(){return oh}class Nj{scrapeMotionValuesFromProps(t,i,s){return{}}constructor({parent:t,props:i,presenceContext:s,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=db,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 x=Ki.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,kt.render(this.render,!1,!0))};const{latestValues:f,renderState:p}=h;this.latestValues=f,this.baseTarget={...f},this.initialValues=i.initial?{...f}:{},this.renderState=p,this.parent=t,this.props=i,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.skipAnimationsConfig=o,this.options=m,this.blockInitialAnimation=!!u,this.isControllingVariants=zh(i),this.isVariantNode=Ik(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:b,...v}=this.scrapeMotionValuesFromProps(i,{},this);for(const x in v){const y=v[x];f[x]!==void 0&&Ri(y)&&y.set(f[x])}}mount(t){if(this.hasBeenMounted)for(const i in this.initialValues)this.values.get(i)?.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,Sj.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((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Pk.current||kj(),this.shouldReduceMotion=qg.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(),ea(this.notifyUpdate),ea(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 i=this.features[t];i&&(i.unmount(),i.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,i){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),i.accelerate&&xk.has(t)&&this.current instanceof HTMLElement){const{factory:u,keyframes:h,times:m,ease:f,duration:p}=i.accelerate,b=new _k({element:this.current,name:t,keyframes:h,times:m,ease:f,duration:En(p)}),v=u(b);this.valueSubscriptions.set(t,()=>{v(),b.cancel()});return}const s=rl.has(t);s&&this.onBindTransform&&this.onBindTransform();const a=i.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&&kt.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,i)),this.valueSubscriptions.set(t,()=>{a(),o&&o(),i.owner&&i.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 oh){const i=oh[t];if(!i)continue;const{isEnabled:s,Feature:a}=i;if(!this.features[t]&&a&&s(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):hi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,i){this.latestValues[t]=i}update(t,i){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let s=0;s<yy.length;s++){const a=yy[s];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=wj(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 i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(t),()=>i.variantChildren.delete(t)}addValue(t,i){const s=this.values.get(t);i!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,i),this.values.set(t,i),this.latestValues[t]=i.get())}removeValue(t){this.values.delete(t);const i=this.valueSubscriptions.get(t);i&&(i(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,i){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&i!==void 0&&(s=el(i===null?void 0:i,{owner:this}),this.addValue(t,s)),s}readValue(t,i){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(IE(s)||UE(s))?s=parseFloat(s):!yj(s)&&rs.test(i)&&(s=Rk(t,i)),this.setBaseTarget(t,Ri(s)?s.get():s)),Ri(s)?s.get():s}setBaseTarget(t,i){this.baseTarget[t]=i}getBaseTarget(t){const{initial:i}=this.props;let s;if(typeof i=="string"||typeof i=="object"){const o=mb(this.props,i,this.presenceContext?.custom);o&&(s=o[t])}if(i&&s!==void 0)return s;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Ri(a)?a:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,i){return this.events[t]||(this.events[t]=new ib),this.events[t].add(i)}notify(t,...i){this.events[t]&&this.events[t].notify(...i)}scheduleRenderMicrotask(){bb.render(this.render)}}class Hk extends Nj{constructor(){super(...arguments),this.KeyframeResolver=ej}sortInstanceNodePosition(t,i){return t.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(t,i){const s=t.style;return s?s[i]:void 0}removeValueFromRenderState(t,{vars:i,style:s}){delete i[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ri(t)&&(this.childSubscription=t.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class sa{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Fk({top:e,left:t,right:i,bottom:s}){return{x:{min:t,max:i},y:{min:e,max:s}}}function Tj({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Aj(e,t){if(!t)return e;const i=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:i.y,left:i.x,bottom:s.y,right:s.x}}function cp(e){return e===void 0||e===1}function Gg({scale:e,scaleX:t,scaleY:i}){return!cp(e)||!cp(t)||!cp(i)}function Ra(e){return Gg(e)||$k(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function $k(e){return Sy(e.x)||Sy(e.y)}function Sy(e){return e&&e!=="0%"}function lh(e,t,i){const s=e-i,a=t*s;return i+a}function wy(e,t,i,s,a){return a!==void 0&&(e=lh(e,a,s)),lh(e,i,s)+t}function Kg(e,t=0,i=1,s,a){e.min=wy(e.min,t,i,s,a),e.max=wy(e.max,t,i,s,a)}function Vk(e,{x:t,y:i}){Kg(e.x,t.translate,t.scale,t.originPoint),Kg(e.y,i.translate,i.scale,i.originPoint)}const Ey=.999999999999,ky=1.0000000000001;function Mj(e,t,i,s=!1){const a=i.length;if(!a)return;t.x=t.y=1;let o,u;for(let h=0;h<a;h++){o=i[h],u=o.projectionDelta;const{visualElement:m}=o.options;m&&m.props.style&&m.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(vs(e.x,-o.scroll.offset.x),vs(e.y,-o.scroll.offset.y)),u&&(t.x*=u.x.scale,t.y*=u.y.scale,Vk(e,u)),s&&Ra(o.latestValues)&&Gd(e,o.latestValues,o.layout?.layoutBox))}t.x<ky&&t.x>Ey&&(t.x=1),t.y<ky&&t.y>Ey&&(t.y=1)}function vs(e,t){e.min+=t,e.max+=t}function Cy(e,t,i,s,a=.5){const o=Rt(e.min,e.max,a);Kg(e,t,i,o,s)}function Ny(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Gd(e,t,i){const s=i??e;Cy(e.x,Ny(t.x,s.x),t.scaleX,t.scale,t.originX),Cy(e.y,Ny(t.y,s.y),t.scaleY,t.scale,t.originY)}function qk(e,t){return Fk(Aj(e.getBoundingClientRect(),t))}function Rj(e,t,i){const s=qk(e,i),{scroll:a}=t;return a&&(vs(s.x,a.offset.x),vs(s.y,a.offset.y)),s}const jj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Dj=sl.length;function Oj(e,t,i){let s="",a=!0;for(let o=0;o<Dj;o++){const u=sl[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||i){const f=Dk(h,gb[u]);if(!m){a=!1;const p=jj[u]||u;s+=`${p}(${f}) `}i&&(t[u]=f)}}return s=s.trim(),i?s=i(t,a?"":s):a&&(s="none"),s}function Sb(e,t,i){const{style:s,vars:a,transformOrigin:o}=e;let u=!1,h=!1;for(const m in t){const f=t[m];if(rl.has(m)){u=!0;continue}else if(tk(m)){a[m]=f;continue}else{const p=Dk(f,gb[m]);m.startsWith("origin")?(h=!0,o[m]=p):s[m]=p}}if(t.transform||(u||i?s.transform=Oj(t,e.transform,i):s.transform&&(s.transform="none")),h){const{originX:m="50%",originY:f="50%",originZ:p=0}=o;s.transformOrigin=`${m} ${f} ${p}`}}function Gk(e,{style:t,vars:i},s,a){const o=e.style;let u;for(u in t)o[u]=t[u];a?.applyProjectionStyles(o,s);for(u in i)o.setProperty(u,i[u])}function Ty(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const lc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Te.test(e))e=parseFloat(e);else return e;const i=Ty(e,t.target.x),s=Ty(e,t.target.y);return`${i}% ${s}%`}},Lj={correct:(e,{treeScale:t,projectionDelta:i})=>{const s=e,a=rs.parse(e);if(a.length>5)return s;const o=rs.createTransformer(e),u=typeof a[0]!="number"?1:0,h=i.x.scale*t.x,m=i.y.scale*t.y;a[0+u]/=h,a[1+u]/=m;const f=Rt(h,m,.5);return typeof a[2+u]=="number"&&(a[2+u]/=f),typeof a[3+u]=="number"&&(a[3+u]/=f),o(a)}},Wg={borderRadius:{...lc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lc,borderTopRightRadius:lc,borderBottomLeftRadius:lc,borderBottomRightRadius:lc,boxShadow:Lj};function Kk(e,{layout:t,layoutId:i}){return rl.has(e)||e.startsWith("origin")||(t||i!==void 0)&&(!!Wg[e]||e==="opacity")}function wb(e,t,i){const s=e.style,a=t?.style,o={};if(!s)return o;for(const u in s)(Ri(s[u])||a&&Ri(a[u])||Kk(u,e)||i?.getValue(u)?.liveStyle!==void 0)&&(o[u]=s[u]);return o}function Bj(e){return window.getComputedStyle(e)}class zj extends Hk{constructor(){super(...arguments),this.type="html",this.renderInstance=Gk}readValueFromInstance(t,i){if(rl.has(i))return this.projection?.isProjecting?Og(i):i8(t,i);{const s=Bj(t),a=(tk(i)?s.getPropertyValue(i):s[i])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:i}){return qk(t,i)}build(t,i,s){Sb(t,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,i,s){return wb(t,i,s)}}const Ij={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pj={offset:"strokeDashoffset",array:"strokeDasharray"};function Uj(e,t,i=1,s=0,a=!0){e.pathLength=1;const o=a?Ij:Pj;e[o.offset]=`${-s}`,e[o.array]=`${t} ${i}`}const Hj=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Wk(e,{attrX:t,attrY:i,attrScale:s,pathLength:a,pathSpacing:o=1,pathOffset:u=0,...h},m,f,p){if(Sb(e,h,f),m){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:b,style:v}=e;b.transform&&(v.transform=b.transform,delete b.transform),(v.transform||b.transformOrigin)&&(v.transformOrigin=b.transformOrigin??"50% 50%",delete b.transformOrigin),v.transform&&(v.transformBox=p?.transformBox??"fill-box",delete b.transformBox);for(const x of Hj)b[x]!==void 0&&(v[x]=b[x],delete b[x]);t!==void 0&&(b.x=t),i!==void 0&&(b.y=i),s!==void 0&&(b.scale=s),a!==void 0&&Uj(b,a,o,u,!1)}const Yk=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"]),Xk=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Fj(e,t,i,s){Gk(e,t,void 0,s);for(const a in t.attrs)e.setAttribute(Yk.has(a)?a:pb(a),t.attrs[a])}function Zk(e,t,i){const s=wb(e,t,i);for(const a in e)if(Ri(e[a])||Ri(t[a])){const o=sl.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;s[o]=e[a]}return s}class $j extends Hk{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=hi}getBaseTargetFromProps(t,i){return t[i]}readValueFromInstance(t,i){if(rl.has(i)){const s=Mk(i);return s&&s.default||0}return i=Yk.has(i)?i:pb(i),t.getAttribute(i)}scrapeMotionValuesFromProps(t,i,s){return Zk(t,i,s)}build(t,i,s){Wk(t,i,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,i,s,a){Fj(t,i,s,a)}mount(t){this.isSVGTag=Xk(t.tagName),super.mount(t)}}const Vj=yb.length;function Qk(e){if(!e)return;if(!e.isControllingVariants){const i=e.parent?Qk(e.parent)||{}:{};return e.props.initial!==void 0&&(i.initial=e.props.initial),i}const t={};for(let i=0;i<Vj;i++){const s=yb[i],a=e.props[s];(Pc(a)||a===!1)&&(t[s]=a)}return t}function Jk(e,t){if(!Array.isArray(t))return!1;const i=t.length;if(i!==e.length)return!1;for(let s=0;s<i;s++)if(t[s]!==e[s])return!1;return!0}const qj=[...xb].reverse(),Gj=xb.length;function Kj(e){return t=>Promise.all(t.map(({animation:i,options:s})=>$8(e,i,s)))}function Wj(e){let t=Kj(e),i=Ay(),s=!0,a=!1;const o=f=>(p,b)=>{const v=Ua(e,b,f==="exit"?e.presenceContext?.custom:void 0);if(v){const{transition:x,transitionEnd:y,...S}=v;p={...p,...S,...y}}return p};function u(f){t=f(e)}function h(f){const{props:p}=e,b=Qk(e.parent)||{},v=[],x=new Set;let y={},S=1/0;for(let N=0;N<Gj;N++){const T=qj[N],R=i[T],A=p[T]!==void 0?p[T]:b[T],O=Pc(A),H=T===f?R.isActive:null;H===!1&&(S=N);let L=A===b[T]&&A!==p[T]&&O;if(L&&(s||a)&&e.manuallyAnimateOnMount&&(L=!1),R.protectedKeys={...y},!R.isActive&&H===null||!A&&!R.prevProp||Bh(A)||typeof A=="boolean")continue;if(T==="exit"&&R.isActive&&H!==!0){R.prevResolvedValues&&(y={...y,...R.prevResolvedValues});continue}const M=Yj(R.prevProp,A);let $=M||T===f&&R.isActive&&!L&&O||N>S&&O,P=!1;const F=Array.isArray(A)?A:[A];let Z=F.reduce(o(T),{});H===!1&&(Z={});const{prevResolvedValues:K={}}=R,Q={...K,...Z},q=X=>{$=!0,x.has(X)&&(P=!0,x.delete(X)),R.needsAnimating[X]=!0;const V=e.getValue(X);V&&(V.liveStyle=!1)};for(const X in Q){const V=Z[X],I=K[X];if(y.hasOwnProperty(X))continue;let j=!1;Ug(V)&&Ug(I)?j=!Jk(V,I):j=V!==I,j?V!=null?q(X):x.add(X):V!==void 0&&x.has(X)?q(X):R.protectedKeys[X]=!0}R.prevProp=A,R.prevResolvedValues=Z,R.isActive&&(y={...y,...Z}),(s||a)&&e.blockInitialAnimation&&($=!1);const D=L&&M;$&&(!D||P)&&v.push(...F.map(X=>{const V={type:T};if(typeof X=="string"&&(s||a)&&!D&&e.manuallyAnimateOnMount&&e.parent){const{parent:I}=e,j=Ua(I,X);if(I.enteringChildren&&j){const{delayChildren:W}=j.transition||{};V.delay=yk(I.enteringChildren,e,W)}}return{animation:X,options:V}}))}if(x.size){const N={};if(typeof p.initial!="boolean"){const T=Ua(e,Array.isArray(p.initial)?p.initial[0]:p.initial);T&&T.transition&&(N.transition=T.transition)}x.forEach(T=>{const R=e.getBaseTarget(T),A=e.getValue(T);A&&(A.liveStyle=!0),N[T]=R??null}),v.push({animation:N})}let k=!!v.length;return s&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(k=!1),s=!1,a=!1,k?t(v):Promise.resolve()}function m(f,p){if(i[f].isActive===p)return Promise.resolve();e.variantChildren?.forEach(v=>v.animationState?.setActive(f,p)),i[f].isActive=p;const b=h(f);for(const v in i)i[v].protectedKeys={};return b}return{animateChanges:h,setActive:m,setAnimateFunction:u,getState:()=>i,reset:()=>{i=Ay(),a=!0}}}function Yj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Jk(t,e):!1}function Ta(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ay(){return{animate:Ta(!0),whileInView:Ta(),whileHover:Ta(),whileTap:Ta(),whileDrag:Ta(),whileFocus:Ta(),exit:Ta()}}function Yg(e,t){e.min=t.min,e.max=t.max}function ts(e,t){Yg(e.x,t.x),Yg(e.y,t.y)}function My(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const eC=1e-4,Xj=1-eC,Zj=1+eC,tC=.01,Qj=0-tC,Jj=0+tC;function Wi(e){return e.max-e.min}function eD(e,t,i){return Math.abs(e-t)<=i}function Ry(e,t,i,s=.5){e.origin=s,e.originPoint=Rt(t.min,t.max,e.origin),e.scale=Wi(i)/Wi(t),e.translate=Rt(i.min,i.max,e.origin)-e.originPoint,(e.scale>=Xj&&e.scale<=Zj||isNaN(e.scale))&&(e.scale=1),(e.translate>=Qj&&e.translate<=Jj||isNaN(e.translate))&&(e.translate=0)}function Mc(e,t,i,s){Ry(e.x,t.x,i.x,s?s.originX:void 0),Ry(e.y,t.y,i.y,s?s.originY:void 0)}function jy(e,t,i,s=0){const a=s?Rt(i.min,i.max,s):i.min;e.min=a+t.min,e.max=e.min+Wi(t)}function tD(e,t,i,s){jy(e.x,t.x,i.x,s?.x),jy(e.y,t.y,i.y,s?.y)}function Dy(e,t,i,s=0){const a=s?Rt(i.min,i.max,s):i.min;e.min=t.min-a,e.max=e.min+Wi(t)}function ch(e,t,i,s){Dy(e.x,t.x,i.x,s?.x),Dy(e.y,t.y,i.y,s?.y)}function Oy(e,t,i,s,a){return e-=t,e=lh(e,1/i,s),a!==void 0&&(e=lh(e,1/a,s)),e}function iD(e,t=0,i=1,s=.5,a,o=e,u=e){if(ys.test(t)&&(t=parseFloat(t),t=Rt(u.min,u.max,t/100)-u.min),typeof t!="number")return;let h=Rt(o.min,o.max,s);e===o&&(h-=t),e.min=Oy(e.min,t,i,h,a),e.max=Oy(e.max,t,i,h,a)}function Ly(e,t,[i,s,a],o,u){iD(e,t[i],t[s],t[a],t.scale,o,u)}const nD=["x","scaleX","originX"],sD=["y","scaleY","originY"];function By(e,t,i,s){Ly(e.x,t,nD,i?i.x:void 0,s?s.x:void 0),Ly(e.y,t,sD,i?i.y:void 0,s?s.y:void 0)}function zy(e){return e.translate===0&&e.scale===1}function iC(e){return zy(e.x)&&zy(e.y)}function Iy(e,t){return e.min===t.min&&e.max===t.max}function rD(e,t){return Iy(e.x,t.x)&&Iy(e.y,t.y)}function Py(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function nC(e,t){return Py(e.x,t.x)&&Py(e.y,t.y)}function Uy(e){return Wi(e.x)/Wi(e.y)}function Hy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function _s(e){return[e("x"),e("y")]}function aD(e,t,i){let s="";const a=e.x.translate/t.x,o=e.y.translate/t.y,u=i?.z||0;if((a||o||u)&&(s=`translate3d(${a}px, ${o}px, ${u}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),i){const{transformPerspective:f,rotate:p,rotateX:b,rotateY:v,skewX:x,skewY:y}=i;f&&(s=`perspective(${f}px) ${s}`),p&&(s+=`rotate(${p}deg) `),b&&(s+=`rotateX(${b}deg) `),v&&(s+=`rotateY(${v}deg) `),x&&(s+=`skewX(${x}deg) `),y&&(s+=`skewY(${y}deg) `)}const h=e.x.scale*t.x,m=e.y.scale*t.y;return(h!==1||m!==1)&&(s+=`scale(${h}, ${m})`),s||"none"}const sC=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],oD=sC.length,Fy=e=>typeof e=="string"?parseFloat(e):e,$y=e=>typeof e=="number"||Te.test(e);function lD(e,t,i,s,a,o){a?(e.opacity=Rt(0,i.opacity??1,cD(s)),e.opacityExit=Rt(t.opacity??1,0,uD(s))):o&&(e.opacity=Rt(t.opacity??1,i.opacity??1,s));for(let u=0;u<oD;u++){const h=sC[u];let m=Vy(t,h),f=Vy(i,h);if(m===void 0&&f===void 0)continue;m||(m=0),f||(f=0),m===0||f===0||$y(m)===$y(f)?(e[h]=Math.max(Rt(Fy(m),Fy(f),s),0),(ys.test(f)||ys.test(m))&&(e[h]+="%")):e[h]=f}(t.rotate||i.rotate)&&(e.rotate=Rt(t.rotate||0,i.rotate||0,s))}function Vy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const cD=rC(0,.5,YE),uD=rC(.5,.95,$n);function rC(e,t,i){return s=>s<e?0:s>t?1:i(zc(e,t,s))}function dD(e,t,i){const s=Ri(e)?e:el(e);return s.start(fb("",s,t,i)),s.animation}function Uc(e,t,i,s={passive:!0}){return e.addEventListener(t,i,s),()=>e.removeEventListener(t,i)}const hD=(e,t)=>e.depth-t.depth;class fD{constructor(){this.children=[],this.isDirty=!1}add(t){eb(this.children,t),this.isDirty=!0}remove(t){ih(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(hD),this.isDirty=!1,this.children.forEach(t)}}function mD(e,t){const i=Ki.now(),s=({timestamp:a})=>{const o=a-i;o>=t&&(ea(s),e(o-t))};return kt.setup(s,!0),()=>ea(s)}function Kd(e){return Ri(e)?e.get():e}class pD{constructor(){this.members=[]}add(t){eb(this.members,t);for(let i=this.members.length-1;i>=0;i--){const s=this.members[i];if(s===t||s===this.lead||s===this.prevLead)continue;const a=s.instance;(!a||a.isConnected===!1)&&!s.snapshot&&(ih(this.members,s),s.unmount())}t.scheduleRender()}remove(t){if(ih(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(t){for(let i=this.members.indexOf(t)-1;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(t,i){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.updateSnapshot(),t.scheduleRender();const{layoutDependency:a}=s.options,{layoutDependency:o}=t.options;(a===void 0||a!==o)&&(t.resumeFrom=s,i&&(s.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&s.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 Wd={hasAnimatedSinceResize:!0,hasEverUpdated:!1},up=["","X","Y","Z"],gD=1e3;let bD=0;function dp(e,t,i,s){const{latestValues:a}=t;a[e]&&(i[e]=a[e],t.setStaticValue(e,0),s&&(s[e]=0))}function aC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const i=Ck(t);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:a,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(i,"transform",kt,!(a||o))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&aC(s)}function oC({attachResizeListener:e,defaultParent:t,measureScroll:i,checkIsScrollRoot:s,resetTransform:a}){return class{constructor(u={},h=t?.()){this.id=bD++,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(xD),this.nodes.forEach(CD),this.nodes.forEach(ND),this.nodes.forEach(yD)},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 fD)}addEventListener(u,h){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new ib),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=vb(u)&&!vj(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 v=()=>this.root.updateBlockedByResize=!1;kt.read(()=>{b=window.innerWidth}),e(u,()=>{const x=window.innerWidth;x!==b&&(b=x,this.root.updateBlockedByResize=!0,p&&p(),p=mD(v,250),Wd.hasAnimatedSinceResize&&(Wd.hasAnimatedSinceResize=!1,this.nodes.forEach(Ky)))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&f&&(h||m)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:b,hasRelativeLayoutChanged:v,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||f.getDefaultTransition()||jD,{onLayoutAnimationStart:S,onLayoutAnimationComplete:k}=f.getProps(),N=!this.targetLayout||!nC(this.targetLayout,x),T=!b&&v;if(this.options.layoutRoot||this.resumeFrom||T||b&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={...hb(y,"layout"),onPlay:S,onComplete:k};(f.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(p,T)}else b||Ky(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}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(),ea(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(TD),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&&aC(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(wD),this.nodes.forEach(qy);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Gy);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ED),this.nodes.forEach(kD),this.nodes.forEach(_D),this.nodes.forEach(vD)):this.nodes.forEach(Gy),this.clearAllSnapshots();const h=Ki.now();Ai.delta=ks(0,1e3/60,h-Ai.timestamp),Ai.timestamp=h,Ai.isProcessing=!0,ip.update.process(Ai),ip.preRender.process(Ai),ip.render.process(Ai),Ai.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(SD),this.sharedNodes.forEach(AD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,kt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){kt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Wi(this.snapshot.measuredBox.x)&&!Wi(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=hi()),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=s(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:m,offset:i(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&&!iC(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)),DD(m),{animationId:this.root.animationId,measuredBox:h,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:u}=this.options;if(!u)return hi();const h=u.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(OD))){const{scroll:f}=this.root;f&&(vs(h.x,f.offset.x),vs(h.y,f.offset.y))}return h}removeElementScroll(u){const h=hi();if(ts(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&&ts(h,u),vs(h.x,p.offset.x),vs(h.y,p.offset.y))}return h}applyTransform(u,h=!1,m){const f=m||hi();ts(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&&(vs(f.x,-b.scroll.offset.x),vs(f.y,-b.scroll.offset.y)),Ra(b.latestValues)&&Gd(f,b.latestValues,b.layout?.layoutBox)}return Ra(this.latestValues)&&Gd(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(u){const h=hi();ts(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&&(Gg(f.latestValues)&&f.updateSnapshot(),p=hi(),ts(p,f.measurePageBox())),By(h,f.latestValues,f.snapshot?.layoutBox,p)}return Ra(this.latestValues)&&By(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!==Ai.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=Ai.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=hi(),this.targetWithTransforms=hi()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),tD(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ts(this.target,this.layout.layoutBox),Vk(this.target,this.targetDelta)):ts(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Gg(this.parent.latestValues)||$k(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=hi(),this.relativeTargetOrigin=hi(),ch(this.relativeTargetOrigin,h,m,this.options.layoutAnchor||void 0),ts(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===Ai.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;ts(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,v=this.treeScale.y;Mj(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=hi());const{target:x}=u;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(My(this.prevProjectionDelta.x,this.projectionDelta.x),My(this.prevProjectionDelta.y,this.projectionDelta.y)),Mc(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==v||!Hy(this.projectionDelta.x,this.prevProjectionDelta.x)||!Hy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x))}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 v=hi(),x=m?m.source:void 0,y=this.layout?this.layout.source:void 0,S=x!==y,k=this.getStack(),N=!k||k.members.length<=1,T=!!(S&&!N&&this.options.crossfade===!0&&!this.path.some(RD));this.animationProgress=0;let R;this.mixTargetDelta=A=>{const O=A/1e3;Wy(b.x,u.x,O),Wy(b.y,u.y,O),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ch(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),MD(this.relativeTarget,this.relativeTargetOrigin,v,O),R&&rD(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=hi()),ts(R,this.relativeTarget)),S&&(this.animationValues=p,lD(p,f,this.latestValues,O,T,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ea(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=kt.update(()=>{Wd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=el(0)),this.motionValue.jump(0,!1),this.currentAnimation=dD(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(gD),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&&lC(this.options.animationType,this.layout.layoutBox,f.layoutBox)){m=this.target||hi();const b=Wi(this.layout.layoutBox.x);m.x.min=u.target.x.min,m.x.max=m.x.min+b;const v=Wi(this.layout.layoutBox.y);m.y.min=u.target.y.min,m.y.max=m.y.min+v}ts(h,m),Gd(h,p),Mc(this.projectionDeltaWithTransform,this.layoutCorrected,h,p)}}registerSharedNode(u,h){this.sharedNodes.has(u)||this.sharedNodes.set(u,new pD),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&&dp("z",u,f,this.animationValues);for(let p=0;p<up.length;p++)dp(`rotate${up[p]}`,u,f,this.animationValues),dp(`skew${up[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=Kd(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=Kd(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=aD(this.projectionDeltaWithTransform,this.treeScale,p);m&&(b=m(p,b)),u.transform=b;const{x:v,y:x}=this.projectionDelta;u.transformOrigin=`${v.origin*100}% ${x.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 Wg){if(p[y]===void 0)continue;const{correct:S,applyTo:k,isCSSVariable:N}=Wg[y],T=b==="none"?p[y]:S(p[y],f);if(k){const R=k.length;for(let A=0;A<R;A++)u[k[A]]=T}else N?this.options.visualElement.renderState.vars[y]=T:u[y]=T}this.options.layoutId&&(u.pointerEvents=f===this?Kd(h?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>u.currentAnimation?.stop()),this.root.nodes.forEach(qy),this.root.sharedNodes.clear()}}}function _D(e){e.updateLayout()}function vD(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;if(a==="size")_s(p=>{const b=o?t.measuredBox[p]:t.layoutBox[p],v=Wi(b);b.min=i[p].min,b.max=b.min+v});else if(a==="x"||a==="y"){const p=a==="x"?"y":"x";Yg(o?t.measuredBox[p]:t.layoutBox[p],i[p])}else lC(a,t.layoutBox,i)&&_s(p=>{const b=o?t.measuredBox[p]:t.layoutBox[p],v=Wi(i[p]);b.max=b.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+v)});const u=Wo();Mc(u,i,t.layoutBox);const h=Wo();o?Mc(h,e.applyTransform(s,!0),t.measuredBox):Mc(h,i,t.layoutBox);const m=!iC(u);let f=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:b,layout:v}=p;if(b&&v){const x=e.options.layoutAnchor||void 0,y=hi();ch(y,t.layoutBox,b.layoutBox,x);const S=hi();ch(S,i,v.layoutBox,x),nC(y,S)||(f=!0),p.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=y,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:h,layoutDelta:u,hasLayoutChanged:m,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function xD(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 yD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function SD(e){e.clearSnapshot()}function qy(e){e.clearMeasurements()}function wD(e){e.isLayoutDirty=!0,e.updateLayout()}function Gy(e){e.isLayoutDirty=!1}function ED(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function kD(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ky(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function CD(e){e.resolveTargetDelta()}function ND(e){e.calcProjection()}function TD(e){e.resetSkewAndRotation()}function AD(e){e.removeLeadSnapshot()}function Wy(e,t,i){e.translate=Rt(t.translate,0,i),e.scale=Rt(t.scale,1,i),e.origin=t.origin,e.originPoint=t.originPoint}function Yy(e,t,i,s){e.min=Rt(t.min,i.min,s),e.max=Rt(t.max,i.max,s)}function MD(e,t,i,s){Yy(e.x,t.x,i.x,s),Yy(e.y,t.y,i.y,s)}function RD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const jD={duration:.45,ease:[.4,0,.1,1]},Xy=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Zy=Xy("applewebkit/")&&!Xy("chrome/")?Math.round:$n;function Qy(e){e.min=Zy(e.min),e.max=Zy(e.max)}function DD(e){Qy(e.x),Qy(e.y)}function lC(e,t,i){return e==="position"||e==="preserve-aspect"&&!eD(Uy(t),Uy(i),.2)}function OD(e){return e!==e.root&&e.scroll?.wasRoot}const LD=oC({attachResizeListener:(e,t)=>Uc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),hp={current:void 0},cC=oC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!hp.current){const e=new LD({});e.mount(window),e.setOptions({layoutScroll:!0}),hp.current=e}return hp.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),uC=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function BD(e=!0){const t=E.useContext(J0);if(t===null)return[!0,null];const{isPresent:i,onExitComplete:s,register:a}=t,o=E.useId();E.useEffect(()=>{if(e)return a(o)},[e]);const u=E.useCallback(()=>e&&s&&s(o),[o,s,e]);return!i&&s?[!1,u]:[!0]}const dC=E.createContext({strict:!1}),Jy={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 eS=!1;function zD(){if(eS)return;const e={};for(const t in Jy)e[t]={isEnabled:i=>Jy[t].some(s=>!!i[s])};Uk(e),eS=!0}function hC(){return zD(),Cj()}function ID(e){const t=hC();for(const i in e)t[i]={...t[i],...e[i]};Uk(t)}const PD=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 uh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||PD.has(e)}let fC=e=>!uh(e);function UD(e){typeof e=="function"&&(fC=t=>t.startsWith("on")?!uh(t):e(t))}try{UD(require("@emotion/is-prop-valid").default)}catch{}function HD(e,t,i){const s={};for(const a in e)a==="values"&&typeof e.values=="object"||Ri(e[a])||(fC(a)||i===!0&&uh(a)||!t&&!uh(a)||e.draggable&&a.startsWith("onDrag"))&&(s[a]=e[a]);return s}const Ih=E.createContext({});function FD(e,t){if(zh(e)){const{initial:i,animate:s}=e;return{initial:i===!1||Pc(i)?i:void 0,animate:Pc(s)?s:void 0}}return e.inherit!==!1?t:{}}function $D(e){const{initial:t,animate:i}=FD(e,E.useContext(Ih));return E.useMemo(()=>({initial:t,animate:i}),[tS(t),tS(i)])}function tS(e){return Array.isArray(e)?e.join(" "):e}const Eb=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mC(e,t,i){for(const s in t)!Ri(t[s])&&!Kk(s,i)&&(e[s]=t[s])}function VD({transformTemplate:e},t){return E.useMemo(()=>{const i=Eb();return Sb(i,t,e),Object.assign({},i.vars,i.style)},[t])}function qD(e,t){const i=e.style||{},s={};return mC(s,i,e),Object.assign(s,VD(e,t)),s}function GD(e,t){const i={},s=qD(e,t);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=s,i}const pC=()=>({...Eb(),attrs:{}});function KD(e,t,i,s){const a=E.useMemo(()=>{const o=pC();return Wk(o,t,Xk(s),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};mC(o,e.style,e),a.style={...o,...a.style}}return a}const WD=["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 kb(e){return typeof e!="string"||e.includes("-")?!1:!!(WD.indexOf(e)>-1||/[A-Z]/u.test(e))}function YD(e,t,i,{latestValues:s},a,o=!1,u){const m=(u??kb(e)?KD:GD)(t,s,a,e),f=HD(t,typeof e=="string",o),p=e!==E.Fragment?{...f,...m,ref:i}:{},{children:b}=t,v=E.useMemo(()=>Ri(b)?b.get():b,[b]);return E.createElement(e,{...p,children:v})}function XD({scrapeMotionValuesFromProps:e,createRenderState:t},i,s,a){return{latestValues:ZD(i,s,a,e),renderState:t()}}function ZD(e,t,i,s){const a={},o=s(e,{});for(const v in o)a[v]=Kd(o[v]);let{initial:u,animate:h}=e;const m=zh(e),f=Ik(e);t&&f&&!m&&e.inherit!==!1&&(u===void 0&&(u=t.initial),h===void 0&&(h=t.animate));let p=i?i.initial===!1:!1;p=p||u===!1;const b=p?h:u;if(b&&typeof b!="boolean"&&!Bh(b)){const v=Array.isArray(b)?b:[b];for(let x=0;x<v.length;x++){const y=mb(e,v[x]);if(y){const{transitionEnd:S,transition:k,...N}=y;for(const T in N){let R=N[T];if(Array.isArray(R)){const A=p?R.length-1:0;R=R[A]}R!==null&&(a[T]=R)}for(const T in S)a[T]=S[T]}}}return a}const gC=e=>(t,i)=>{const s=E.useContext(Ih),a=E.useContext(J0),o=()=>XD(e,t,s,a);return i?o():W6(o)},QD=gC({scrapeMotionValuesFromProps:wb,createRenderState:Eb}),JD=gC({scrapeMotionValuesFromProps:Zk,createRenderState:pC}),eO=Symbol.for("motionComponentSymbol");function tO(e,t,i){const s=E.useRef(i);E.useInsertionEffect(()=>{s.current=i});const a=E.useRef(null);return E.useCallback(o=>{o&&e.onMount?.(o);const u=s.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 bC=E.createContext({});function Vo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function iO(e,t,i,s,a,o){const{visualElement:u}=E.useContext(Ih),h=E.useContext(dC),m=E.useContext(J0),f=E.useContext(uC),p=f.reducedMotion,b=f.skipAnimations,v=E.useRef(null),x=E.useRef(!1);s=s||h.renderer,!v.current&&s&&(v.current=s(e,{visualState:t,parent:u,props:i,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:p,skipAnimations:b,isSVG:o}),x.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const y=v.current,S=E.useContext(bC);y&&!y.projection&&a&&(y.type==="html"||y.type==="svg")&&nO(v.current,i,a,S);const k=E.useRef(!1);E.useInsertionEffect(()=>{y&&k.current&&y.update(i,m)});const N=i[kk],T=E.useRef(!!N&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(N)&&window.MotionHasOptimisedAnimation?.(N));return X6(()=>{x.current=!0,y&&(k.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),T.current&&y.animationState&&y.animationState.animateChanges())}),E.useEffect(()=>{y&&(!T.current&&y.animationState&&y.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(N)}),T.current=!1),y.enteringChildren=void 0)}),y}function nO(e,t,i,s){const{layoutId:a,layout:o,drag:u,dragConstraints:h,layoutScroll:m,layoutRoot:f,layoutAnchor:p,layoutCrossfade:b}=t;e.projection=new i(e.latestValues,t["data-framer-portal-id"]?void 0:_C(e.parent)),e.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:!!u||h&&Vo(h),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:b,layoutScroll:m,layoutRoot:f,layoutAnchor:p})}function _C(e){if(e)return e.options.allowProjection!==!1?e.projection:_C(e.parent)}function fp(e,{forwardMotionProps:t=!1,type:i}={},s,a){s&&ID(s);const o=i?i==="svg":kb(e),u=o?JD:QD;function h(f,p){let b;const v={...E.useContext(uC),...f,layoutId:sO(f)},{isStatic:x}=v,y=$D(f),S=u(f,x);if(!x&&typeof window<"u"){rO();const k=aO(v);b=k.MeasureLayout,y.visualElement=iO(e,S,v,a,k.ProjectionNode,o)}return c.jsxs(Ih.Provider,{value:y,children:[b&&y.visualElement?c.jsx(b,{visualElement:y.visualElement,...v}):null,YD(e,f,tO(S,y.visualElement,p),S,x,t,o)]})}h.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const m=E.forwardRef(h);return m[eO]=e,m}function sO({layoutId:e}){const t=E.useContext(zE).id;return t&&e!==void 0?t+"-"+e:e}function rO(e,t){E.useContext(dC).strict}function aO(e){const t=hC(),{drag:i,layout:s}=t;if(!i&&!s)return{};const a={...i,...s};return{MeasureLayout:i?.isEnabled(e)||s?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function oO(e,t){if(typeof Proxy>"u")return fp;const i=new Map,s=(o,u)=>fp(o,u,e,t),a=(o,u)=>s(o,u);return new Proxy(a,{get:(o,u)=>u==="create"?s:(i.has(u)||i.set(u,fp(u,void 0,e,t)),i.get(u))})}const lO=(e,t)=>t.isSVG??kb(e)?new $j(t):new zj(t,{allowProjection:e!==E.Fragment});class cO extends sa{constructor(t){super(t),t.animationState||(t.animationState=Wj(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bh(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:i}=this.node.prevProps||{};t!==i&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let uO=0;class dO extends sa{constructor(){super(...arguments),this.id=uO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;if(t&&s===!1){if(this.isExitComplete){const{initial:o,custom:u}=this.node.getProps();if(typeof o=="string"){const h=Ua(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);i&&!t&&a.then(()=>{this.isExitComplete=!0,i(this.id)})}mount(){const{register:t,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const hO={animation:{Feature:cO},exit:{Feature:dO}};function eu(e){return{point:{x:e.pageX,y:e.pageY}}}const fO=e=>t=>_b(t)&&e(t,eu(t));function Rc(e,t,i,s){return Uc(e,t,fO(i),s)}const vC=({current:e})=>e?e.ownerDocument.defaultView:null,iS=(e,t)=>Math.abs(e-t);function mO(e,t){const i=iS(e.x,t.x),s=iS(e.y,t.y);return Math.sqrt(i**2+s**2)}const nS=new Set(["auto","scroll"]);class xC{constructor(t,i,{transformPagePoint:s,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=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Td(this.lastRawMoveEventInfo,this.transformPagePoint));const x=mp(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,S=mO(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!S)return;const{point:k}=x,{timestamp:N}=Ai;this.history.push({...k,timestamp:N});const{onStart:T,onMove:R}=this.handlers;y||(T&&T(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,x)},this.handlePointerMove=(x,y)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=Td(y,this.transformPagePoint),kt.update(this.updatePoint,!0)},this.handlePointerUp=(x,y)=>{this.end();const{onEnd:S,onSessionEnd:k,resumeAnimation:N}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=mp(x.type==="pointercancel"?this.lastMoveEventInfo:Td(y,this.transformPagePoint),this.history);this.startEvent&&S&&S(x,T),k&&k(x,T)},!_b(t))return;this.dragSnapToOrigin=o,this.handlers=i,this.transformPagePoint=s,this.distanceThreshold=u,this.contextWindow=a||window;const m=eu(t),f=Td(m,this.transformPagePoint),{point:p}=f,{timestamp:b}=Ai;this.history=[{...p,timestamp:b}];const{onSessionStart:v}=i;v&&v(t,mp(f,this.history)),this.removeListeners=Zc(Rc(this.contextWindow,"pointermove",this.handlePointerMove),Rc(this.contextWindow,"pointerup",this.handlePointerUp),Rc(this.contextWindow,"pointercancel",this.handlePointerUp)),h&&this.startScrollTracking(h)}startScrollTracking(t){let i=t.parentElement;for(;i;){const s=getComputedStyle(i);(nS.has(s.overflowX)||nS.has(s.overflowY))&&this.scrollPositions.set(i,{x:i.scrollLeft,y:i.scrollTop}),i=i.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const i=this.scrollPositions.get(t);if(!i)return;const s=t===window,a=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:a.x-i.x,y:a.y-i.y};o.x===0&&o.y===0||(s?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),kt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ea(this.updatePoint)}}function Td(e,t){return t?{point:t(e.point)}:e}function sS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function mp({point:e},t){return{point:e,delta:sS(e,yC(t)),offset:sS(e,pO(t)),velocity:gO(t,.1)}}function pO(e){return e[0]}function yC(e){return e[e.length-1]}function gO(e,t){if(e.length<2)return{x:0,y:0};let i=e.length-1,s=null;const a=yC(e);for(;i>=0&&(s=e[i],!(a.timestamp-s.timestamp>En(t)));)i--;if(!s)return{x:0,y:0};s===e[0]&&e.length>2&&a.timestamp-s.timestamp>En(t)*2&&(s=e[1]);const o=Fn(a.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const u={x:(a.x-s.x)/o,y:(a.y-s.y)/o};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}function bO(e,{min:t,max:i},s){return t!==void 0&&e<t?e=s?Rt(t,e,s.min):Math.max(e,t):i!==void 0&&e>i&&(e=s?Rt(i,e,s.max):Math.min(e,i)),e}function rS(e,t,i){return{min:t!==void 0?e.min+t:void 0,max:i!==void 0?e.max+i-(e.max-e.min):void 0}}function _O(e,{top:t,left:i,bottom:s,right:a}){return{x:rS(e.x,i,a),y:rS(e.y,t,s)}}function aS(e,t){let i=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([i,s]=[s,i]),{min:i,max:s}}function vO(e,t){return{x:aS(e.x,t.x),y:aS(e.y,t.y)}}function xO(e,t){let i=.5;const s=Wi(e),a=Wi(t);return a>s?i=zc(t.min,t.max-s,e.min):s>a&&(i=zc(e.min,e.max-a,t.min)),ks(0,1,i)}function yO(e,t){const i={};return t.min!==void 0&&(i.min=t.min-e.min),t.max!==void 0&&(i.max=t.max-e.min),i}const Xg=.35;function SO(e=Xg){return e===!1?e=0:e===!0&&(e=Xg),{x:oS(e,"left","right"),y:oS(e,"top","bottom")}}function oS(e,t,i){return{min:lS(e,t),max:lS(e,i)}}function lS(e,t){return typeof e=="number"?e:e[t]||0}const wO=new WeakMap;class EO{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=hi(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:i=!1,distanceThreshold:s}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const o=b=>{i&&this.snapToCursor(eu(b).point),this.stopAnimation()},u=(b,v)=>{const{drag:x,dragPropagation:y,onDragStart:S}=this.getProps();if(x&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ij(x),!this.openDragLock))return;this.latestPointerEvent=b,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),_s(N=>{let T=this.getAxisMotionValue(N).get()||0;if(ys.test(T)){const{projection:R}=this.visualElement;if(R&&R.layout){const A=R.layout.layoutBox[N];A&&(T=Wi(A)*(parseFloat(T)/100))}}this.originPoint[N]=T}),S&&kt.update(()=>S(b,v),!1,!0),Hg(this.visualElement,"transform");const{animationState:k}=this.visualElement;k&&k.setActive("whileDrag",!0)},h=(b,v)=>{this.latestPointerEvent=b,this.latestPanInfo=v;const{dragPropagation:x,dragDirectionLock:y,onDirectionLock:S,onDrag:k}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:N}=v;if(y&&this.currentDirection===null){this.currentDirection=CO(N),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",v.point,N),this.updateAxis("y",v.point,N),this.visualElement.render(),k&&kt.update(()=>k(b,v),!1,!0)},m=(b,v)=>{this.latestPointerEvent=b,this.latestPanInfo=v,this.stop(b,v),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 xC(t,{onSessionStart:o,onStart:u,onMove:h,onSessionEnd:m,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:s,contextWindow:vC(this.visualElement),element:this.visualElement.current})}stop(t,i){const s=t||this.latestPointerEvent,a=i||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!a||!s)return;const{velocity:u}=a;this.startAnimation(u);const{onDragEnd:h}=this.getProps();h&&kt.postRender(()=>h(s,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:i}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,i,s){const{drag:a}=this.getProps();if(!s||!Ad(t,a,this.currentDirection))return;const o=this.getAxisMotionValue(t);let u=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(u=bO(u,this.constraints[t],this.elastic[t])),o.set(u)}resolveConstraints(){const{dragConstraints:t,dragElastic:i}=this.getProps(),s=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&&s?this.constraints=_O(s.layoutBox,t):this.constraints=!1,this.elastic=SO(i),a!==this.constraints&&!Vo(t)&&s&&this.constraints&&!this.hasMutatedConstraints&&_s(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=yO(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:i}=this.getProps();if(!t||!Vo(t))return!1;const s=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const o=Rj(s,a.root,this.visualElement.getTransformPagePoint());let u=vO(a.layout.layoutBox,o);if(i){const h=i(Tj(u));this.hasMutatedConstraints=!!h,h&&(u=Fk(h))}return u}startAnimation(t){const{drag:i,dragMomentum:s,dragElastic:a,dragTransition:o,dragSnapToOrigin:u,onDragTransitionEnd:h}=this.getProps(),m=this.constraints||{},f=_s(p=>{if(!Ad(p,i,this.currentDirection))return;let b=m&&m[p]||{};(u===!0||u===p)&&(b={min:0,max:0});const v=a?200:1e6,x=a?40:1e7,y={type:"inertia",velocity:s?t[p]:0,bounceStiffness:v,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...o,...b};return this.startAxisValueAnimation(p,y)});return Promise.all(f).then(h)}startAxisValueAnimation(t,i){const s=this.getAxisMotionValue(t);return Hg(this.visualElement,t),s.start(fb(t,s,0,i,this.visualElement,!1))}stopAnimation(){_s(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const i=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),a=s[i];return a||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){_s(i=>{const{drag:s}=this.getProps();if(!Ad(i,s,this.currentDirection))return;const{projection:a}=this.visualElement,o=this.getAxisMotionValue(i);if(a&&a.layout){const{min:u,max:h}=a.layout.layoutBox[i],m=o.get()||0;o.set(t[i]-Rt(u,h,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:i}=this.getProps(),{projection:s}=this.visualElement;if(!Vo(i)||!s||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};_s(u=>{const h=this.getAxisMotionValue(u);if(h&&this.constraints!==!1){const m=h.get();a[u]=xO({min:m,max:m},this.constraints[u])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),_s(u=>{if(!Ad(u,t,null))return;const h=this.getAxisMotionValue(u),{min:m,max:f}=this.constraints[u];h.set(Rt(m,f,a[u]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;wO.set(this.visualElement,this);const t=this.visualElement.current,i=Rc(t,"pointerdown",f=>{const{drag:p,dragListener:b=!0}=this.getProps(),v=f.target,x=v!==t&&lj(v);p&&b&&!x&&this.start(f)});let s;const a=()=>{const{dragConstraints:f}=this.getProps();Vo(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),s||(s=kO(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,u=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),kt.read(a);const h=Uc(window,"resize",()=>this.scalePositionWithinConstraints()),m=o.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:p})=>{this.isDragging&&p&&(_s(b=>{const v=this.getAxisMotionValue(b);v&&(this.originPoint[b]+=f[b].translate,v.set(v.get()+f[b].translate))}),this.visualElement.render())}));return()=>{h(),i(),u(),m&&m(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:s=!1,dragPropagation:a=!1,dragConstraints:o=!1,dragElastic:u=Xg,dragMomentum:h=!0}=t;return{...t,drag:i,dragDirectionLock:s,dragPropagation:a,dragConstraints:o,dragElastic:u,dragMomentum:h}}}function cS(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function kO(e,t,i){const s=_y(e,cS(i)),a=_y(t,cS(i));return()=>{s(),a()}}function Ad(e,t,i){return(t===!0||t===e)&&(i===null||i===e)}function CO(e,t=10){let i=null;return Math.abs(e.y)>t?i="y":Math.abs(e.x)>t&&(i="x"),i}class NO extends sa{constructor(t){super(t),this.removeGroupControls=$n,this.removeListeners=$n,this.controls=new EO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||$n}update(){const{dragControls:t}=this.node.getProps(),{dragControls:i}=this.node.prevProps||{};t!==i&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const pp=e=>(t,i)=>{e&&kt.update(()=>e(t,i),!1,!0)};class TO extends sa{constructor(){super(...arguments),this.removePointerDownListener=$n}onPointerDown(t){this.session=new xC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:vC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:i,onPan:s,onPanEnd:a}=this.node.getProps();return{onSessionStart:pp(t),onStart:pp(i),onMove:pp(s),onEnd:(o,u)=>{delete this.session,a&&kt.postRender(()=>a(o,u))}}}mount(){this.removePointerDownListener=Rc(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 gp=!1;class AO extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:s,layoutId:a}=this.props,{projection:o}=t;o&&(i.group&&i.group.add(o),s&&s.register&&a&&s.register(o),gp&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Wd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:i,visualElement:s,drag:a,isPresent:o}=this.props,{projection:u}=s;return u&&(u.isPresent=o,t.layoutDependency!==i&&u.setOptions({...u.options,layoutDependency:i}),gp=!0,a||t.layoutDependency!==i||i===void 0||t.isPresent!==o?u.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?u.promote():u.relegate()||kt.postRender(()=>{const h=u.getStack();(!h||!h.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:i}=this.props,{projection:s}=t;s&&(s.options.layoutAnchor=i,s.root.didUpdate(),bb.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:s}=this.props,{projection:a}=t;gp=!0,a&&(a.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(a),s&&s.deregister&&s.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function SC(e){const[t,i]=BD(),s=E.useContext(zE);return c.jsx(AO,{...e,layoutGroup:s,switchLayoutGroup:E.useContext(bC),isPresent:t,safeToRemove:i})}const MO={pan:{Feature:TO},drag:{Feature:NO,ProjectionNode:cC,MeasureLayout:SC}};function uS(e,t,i){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",i==="Start");const a="onHover"+i,o=s[a];o&&kt.postRender(()=>o(t,eu(t)))}class RO extends sa{mount(){const{current:t}=this.node;t&&(this.unmount=sj(t,(i,s)=>(uS(this.node,s,"Start"),a=>uS(this.node,a,"End"))))}unmount(){}}class jO extends sa{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=Zc(Uc(this.node.current,"focus",()=>this.onFocus()),Uc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function dS(e,t,i){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",i==="Start");const a="onTap"+(i==="End"?"":i),o=s[a];o&&kt.postRender(()=>o(t,eu(t)))}class DO extends sa{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:i,propagate:s}=this.node.props;this.unmount=uj(t,(a,o)=>(dS(this.node,o,"Start"),(u,{success:h})=>dS(this.node,u,h?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:s?.tap===!1})}unmount(){}}const Zg=new WeakMap,bp=new WeakMap,OO=e=>{const t=Zg.get(e.target);t&&t(e)},LO=e=>{e.forEach(OO)};function BO({root:e,...t}){const i=e||document;bp.has(i)||bp.set(i,{});const s=bp.get(i),a=JSON.stringify(t);return s[a]||(s[a]=new IntersectionObserver(LO,{root:e,...t})),s[a]}function zO(e,t,i){const s=BO(t);return Zg.set(e,i),s.observe(e),()=>{Zg.delete(e),s.unobserve(e)}}const IO={some:0,all:1};class PO extends sa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:i,margin:s,amount:a="some",once:o}=t,u={root:i?i.current:void 0,rootMargin:s,threshold:typeof a=="number"?a:IO[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(),v=f?p:b;v&&v(m)};this.stopObserver=zO(this.node.current,u,h)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:i}=this.node;["amount","margin","root"].some(UO(t,i))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function UO({viewport:e={}},{viewport:t={}}={}){return i=>e[i]!==t[i]}const HO={inView:{Feature:PO},tap:{Feature:DO},focus:{Feature:jO},hover:{Feature:RO}},FO={layout:{ProjectionNode:cC,MeasureLayout:SC}},$O={...hO,...HO,...MO,...FO},_p=oO($O,lO),qe=({label:e,children:t,variant:i="primary",size:s="medium",icon:a,onClick:o,removable:u=!1,className:h,maxWidth:m,appearance:f,onRemove:p,isLoading:b=!1})=>{const v=VO(i),x=f??(i==="outline"?"outline":"solid"),y=e??t,S=!!o,k={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"}},N={small:"text-xs px-2 py-1",medium:"text-xs px-2.5 py-1",large:"text-sm px-3 py-1.5"},T=A=>{A.stopPropagation(),o?.()},R=A=>{A.stopPropagation(),p?.()};return c.jsxs(_p.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:me("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",k[v][x],N[s],S&&"cursor-pointer",h),children:[b?c.jsx(_p.div,{animate:{rotate:360},transition:{duration:1,ease:"linear",repeat:1/0},className:"flex-shrink-0",children:c.jsx(Di,{className:"size-3.5"})}):a&&c.jsx("span",{className:"flex-shrink-0",children:a}),c.jsx("span",{className:"min-w-0 truncate",children:y}),u&&c.jsx(_p.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:R,type:"button",children:c.jsx(kn,{className:"size-3.5"})})]})};function VO(e){return e==="danger"?"error":e==="default"||e==="outline"?"primary":e}const qO=yE("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 ht({className:e,variant:t,...i}){return c.jsx("div",{className:me(qO({variant:t,className:e})),...i})}function or({className:e,...t}){return c.jsx("div",{className:me("rounded-lg border border-border bg-card text-card-foreground",e),...t})}function lr({className:e,...t}){return c.jsx("div",{className:me("grid gap-1.5 p-4",e),...t})}function cr({className:e,...t}){return c.jsx("h3",{className:me("text-sm font-semibold tracking-tight",e),...t})}function ra({className:e,...t}){return c.jsx("p",{className:me("text-sm text-muted-foreground",e),...t})}function ur({className:e,...t}){return c.jsx("div",{className:me("p-4 pt-0",e),...t})}const hS=100;function GO(){const[e,t]=E.useState([]),[i,s]=E.useState(!1),a=E.useRef(new Set);E.useEffect(()=>{const u=new EventSource("/api/agent/tool-calls/stream");return u.addEventListener("open",()=>s(!0)),u.addEventListener("error",()=>s(!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>hS&&p.splice(0,p.length-hS),p})}catch{}}),()=>{u.close()}},[]);const o=[...e].reverse();return c.jsxs(or,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[c.jsxs(lr,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ia,{className:"size-4 text-muted-foreground"}),c.jsx(cr,{children:"Live MCP Tool Calls"}),c.jsx(qe,{variant:"outline",size:"small",children:e.length})]}),c.jsx(qe,{variant:"outline",size:"small",icon:c.jsx("span",{className:me("inline-block size-1.5 rounded-full",i?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:i?"live":"reconnecting…"})]}),c.jsx(ra,{className:"text-xs",children:"Streamed from this NoMoreIDE MCP server. Newest at the top."})]}),c.jsx(ur,{className:"p-0",children:o.length?c.jsx("ul",{className:"max-h-96 divide-y divide-border overflow-auto",children:o.map(u=>c.jsxs("li",{className:"px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:u.tool}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[c.jsxs("span",{children:[u.durationMs," ms"]}),c.jsx(qe,{variant:u.status==="ok"?"success":"error",appearance:"outline",size:"small",children:u.status})]})]}),u.args?c.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px] text-muted-foreground",children:u.args}):null,u.error?c.jsx("div",{className:"mt-0.5 font-mono text-[11px] text-destructive",children:u.error}):null,c.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/80",children:new Date(u.startedAt).toLocaleTimeString()})]},u.id))}):c.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 KO({agent:e}){return c.jsxs(c.Fragment,{children:[c.jsx(GO,{}),c.jsxs(or,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[c.jsxs(lr,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Rh,{className:"size-4 text-muted-foreground"}),c.jsx(cr,{children:"Recent Projects"})]}),c.jsx(qe,{variant:"outline",size:"small",children:e.projects.length})]}),c.jsx(ra,{className:"text-xs",children:"Most recently active projects known to the agent."})]}),c.jsx(ur,{className:"p-0",children:e.projects.length?c.jsx("ul",{className:"divide-y divide-border",children:e.projects.map(t=>c.jsxs("li",{className:me("flex items-start justify-between gap-3 px-3 py-2",t.current&&"bg-primary/5"),children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:t.path}),t.current?c.jsx(qe,{variant:"outline",size:"small",children:"current"}):null]}),t.lastSessionFirstPrompt?c.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:t.lastSessionFirstPrompt}):null]}),c.jsxs("div",{className:"shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:[t.mcpServerCount?c.jsxs("div",{children:[t.mcpServerCount," mcp"]}):null,t.lastSessionModified?c.jsx("div",{children:WO(t.lastSessionModified)}):null]})]},t.path))}):c.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No known projects."})})]})]})}function WO(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function al({className:e}){return c.jsx("svg",{className:me("size-3.5",e),viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:c.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 tu({className:e}){return c.jsx("svg",{className:me("size-3.5",e),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0,children:c.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 YO({className:e}){return c.jsx("svg",{className:me("size-3.5",e),viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:c.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"})})}function XO({agent:e,agentId:t}){const i=e.project.instructionFileName??(e.project.claudeMdPath?"CLAUDE.md":void 0),s=e.project.instructionFilePreview??e.project.claudeMdPreview,a=e.project.memoryFiles.length+(i?1:0);return c.jsxs(or,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[c.jsxs(lr,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(J2,{className:"size-4 text-muted-foreground"}),c.jsx(cr,{children:"Project Memory"})]}),c.jsx(qe,{variant:"outline",size:"small",children:a})]}),c.jsx(ra,{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.")})]}),c.jsxs(ur,{className:"space-y-2 p-3",children:[i?c.jsx(fS,{title:i,preview:s,defaultOpen:!0}):null,e.project.memoryFiles.length?e.project.memoryFiles.map(o=>c.jsx(fS,{title:o.name,subtitle:`${o.size} B`,preview:o.preview,defaultOpen:o.name==="MEMORY.md"},o.path)):i?null:c.jsx("p",{className:"text-xs text-muted-foreground",children:"No memory files persisted yet for this project."})]})]})}function fS({title:e,subtitle:t,preview:i,defaultOpen:s=!1}){const[a,o]=E.useState(s);return c.jsxs("div",{className:"rounded-md border border-border bg-background/40",children:[c.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:[c.jsx(ia,{className:me("size-3.5 text-muted-foreground transition-transform",a&&"rotate-90")}),c.jsx("span",{children:e}),t?c.jsx("span",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:t}):null]}),a&&i?c.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:i}):null]})}const ZO=[{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%)"}],QO=({size:e=20,color:t="#8f8f8f"})=>c.jsx("div",{style:{width:e,height:e},children:c.jsx("div",{className:"relative left-1/2 top-1/2",style:{width:e,height:e},children:ZO.map(i=>c.jsx("div",{className:"absolute -left-[10%] -top-[3.9%] h-[8%] w-[24%] animate-fade-spin rounded-[5px]",style:{backgroundColor:t,...i}},i.transform))})}),JO=[{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"}],eL={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"},tL={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]"}},Md=({size:e="medium",type:t="primary",variant:i="styled",shape:s="square",svgOnly:a=!1,children:o,prefix:u,suffix:h,shadow:m=!1,loading:f=!1,disabled:p=!1,fullWidth:b=!1,className:v,...x})=>c.jsxs("button",{disabled:p,tabIndex:0,className:Bc("flex items-center justify-center gap-0.5 duration-150",JO[+a][e],p||f?"cursor-not-allowed border border-gray-400 bg-gray-100 text-gray-700":eL[t],tL[s][e],m&&"shadow-border-small border-none",b&&"w-full",i==="unstyled"?"h-fit bg-transparent px-0 text-gray-1000 outline-none hover:bg-transparent":"focus:shadow-focus-ring focus:outline-0",v),type:"button",...x,children:[f?c.jsx(QO,{size:e==="large"?24:16}):u,c.jsx("span",{className:Bc("relative overflow-hidden overflow-ellipsis whitespace-nowrap font-sans",e!=="tiny"&&i!=="unstyled"&&"px-1.5"),children:o}),!f&&h]}),iL=({className:e})=>c.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:e,children:c.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"})}),nL=()=>c.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:"fill-gray-1000",children:c.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 vp=null,sL=0;const ri={toasts:[],listeners:new Set,add(e,t,i,s,a,o){const u=sL++,h={id:u,text:e,preserve:i,action:s,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){ri.toasts=ri.toasts.filter(t=>t.id!==e),ri.notify()},subscribe(e){return ri.listeners.add(e),()=>{ri.listeners.delete(e)}},notify(){ri.listeners.forEach(e=>{e()})}},rL=()=>{const[e,t]=E.useState([]),[i,s]=E.useState([]),[a,o]=E.useState(!1),u=y=>S=>{S&&y.measuredHeight==null&&(y.measuredHeight=S.getBoundingClientRect().height,ri.notify())};E.useEffect(()=>(t([...ri.toasts]),ri.subscribe(()=>{t([...ri.toasts])})),[]),E.useEffect(()=>{const y=e.filter(S=>!i.includes(S.id)).map(S=>S.id);y.length>0&&requestAnimationFrame(()=>{s(S=>[...S,...y])})},[i,e]);const m=Math.max(0,e.length-3),f=(y,S)=>{if(y===S-1)return"none";const k=S-1-y;let N=e[S-1]?.measuredHeight||63;for(let A=S-1;A>y;A--)a?N+=(e[A-1]?.measuredHeight||63)+10:N+=20;const T=-k,R=a?1:1-.05*k;return`translate3d(0, calc(100% - ${N}px), ${T}px) scale(${R})`},p=()=>{o(!0),ri.toasts.forEach(y=>{y.pause?.()})},b=()=>{o(!1),ri.toasts.forEach(y=>{y.resume?.()})},x=e.slice(m).reduce((y,S)=>y+(S.measuredHeight??63),0);return c.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[9999] w-[min(420px,calc(100vw-2rem))]",style:{height:x},children:c.jsx("div",{className:"pointer-events-auto relative w-full",style:{height:x},onMouseEnter:p,onMouseLeave:b,children:e.map((y,S)=>{const k=S>=m;return c.jsx("div",{ref:u(y),className:Bc("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],k?"opacity-100":"opacity-0",S<m&&"pointer-events-none"),style:{width:"100%",transition:"all .35s cubic-bezier(.25,.75,.6,.98)",transform:i.includes(y.id)?f(S,e.length):"translate3d(0, 100%, 150px) scale(1)"},children:c.jsxs("div",{className:"flex flex-col items-center justify-between text-[.875rem]",children:[c.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[c.jsx("span",{children:y.text}),!y.action&&c.jsxs("div",{className:"flex gap-1",children:[y.onUndoAction&&c.jsx(Md,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>{y.onUndoAction?.(),ri.remove(y.id)},children:c.jsx(nL,{})}),c.jsx(Md,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>ri.remove(y.id),children:c.jsx(iL,{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&&c.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[c.jsx(Md,{type:"tertiary",size:"small",onClick:()=>ri.remove(y.id),children:"Dismiss"}),c.jsx(Md,{type:"primary",size:"small",onClick:()=>{y.onAction?.(),ri.remove(y.id)},children:y.action})]})]})},y.id)})})})},Rd=()=>{if(vp)return;const e=document.createElement("div");e.className="fixed bottom-4 right-4 z-[9999]",document.body.appendChild(e),vp=W2.createRoot(e),vp.render(c.jsx(rL,{}))},Oi=()=>({message:E.useCallback(({text:e,preserve:t,action:i,onAction:s,onUndoAction:a})=>{Rd(),ri.add(e,"message",t,i,s,a)},[]),success:E.useCallback(e=>{Rd(),ri.add(e,"success")},[]),warning:E.useCallback(e=>{Rd(),ri.add(e,"warning")},[]),error:E.useCallback(e=>{Rd(),ri.add(e,"error")},[])});function aL({usage:e}){const t=e.inputTokens+e.cacheCreationInputTokens+e.cacheReadInputTokens,i=t>0?e.cacheReadInputTokens/t*100:0;return c.jsxs("div",{className:"rounded-md border border-border",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(al,{className:"size-3.5 text-amber-700"}),c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Claude Code · last session"}),e.sessionId?c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.sessionId.slice(0,8)}):null]}),c.jsxs("span",{className:"font-mono text-sm font-semibold text-emerald-700",children:["$",e.costUSD.toFixed(4)]})]}),c.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:[c.jsx(Ui,{label:"Input",value:Un(e.inputTokens)}),c.jsx(Ui,{label:"Output",value:Un(e.outputTokens)}),c.jsx(Ui,{label:"Cache read",value:Un(e.cacheReadInputTokens)}),c.jsx(Ui,{label:"Cache create",value:Un(e.cacheCreationInputTokens)}),c.jsx(Ui,{label:"Lines +",value:String(e.linesAdded)}),c.jsx(Ui,{label:"Lines −",value:String(e.linesRemoved)}),c.jsx(Ui,{label:"Wall",value:pS(e.durationMs)}),c.jsx(Ui,{label:"API",value:pS(e.apiDurationMs)})]}),c.jsxs("div",{className:"border-t border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[c.jsx("span",{children:"Cache read share of input"}),c.jsxs("span",{className:"font-mono",children:[i.toFixed(1),"%"]})]}),c.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:c.jsx("div",{className:"h-full bg-emerald-500",style:{width:`${Math.min(100,i).toFixed(2)}%`}})})]}),e.fiveHour||e.weekly?c.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[c.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.fiveHour?c.jsx(dh,{label:"5h block",window:e.fiveHour}):null,e.weekly?c.jsx(dh,{label:"This week",window:e.weekly}):null]}):null,e.models.length?c.jsxs("div",{className:"space-y-1 border-t border-border px-3 py-2",children:[c.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"By model"}),e.models.map(s=>c.jsxs("div",{className:"flex items-center justify-between gap-2 font-mono text-[11px]",children:[c.jsx("span",{className:"truncate",children:s.model}),c.jsxs("span",{className:"shrink-0 text-muted-foreground",children:[Un(s.inputTokens+s.outputTokens)," tok ·"," ",c.jsxs("span",{className:"text-emerald-700",children:["$",s.costUSD.toFixed(4)]})]})]},s.model))]}):null]})}function oL({usage:e}){const t=e.inputTokens>0?e.cachedInputTokens/e.inputTokens*100:0,i=e.contextWindow&&e.contextWindow>0?e.lastTotalTokens/e.contextWindow*100:0;return c.jsxs("div",{className:"rounded-md border border-border",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(tu,{className:"size-3.5 text-foreground"}),c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Codex · last session"})]}),e.timestamp?c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:new Date(e.timestamp).toLocaleString()}):null]}),c.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:[c.jsx(Ui,{label:"Input",value:Un(e.inputTokens)}),c.jsx(Ui,{label:"Output",value:Un(e.outputTokens)}),c.jsx(Ui,{label:"Cache read",value:Un(e.cachedInputTokens)}),c.jsx(Ui,{label:"Reasoning",value:Un(e.reasoningOutputTokens)}),c.jsx(Ui,{label:"Total",value:Un(e.totalTokens)}),c.jsx(Ui,{label:"Last turn",value:Un(e.lastTotalTokens)}),c.jsx(Ui,{label:"Context",value:e.contextWindow?Un(e.contextWindow):"n/a"}),c.jsx(Ui,{label:"Cost",value:"n/a"})]}),c.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[c.jsx(mS,{label:"Cache read share of input",value:t,tone:"bg-emerald-500"}),e.contextWindow?c.jsx(mS,{label:"Last turn context share",value:i,tone:"bg-sky-500"}):null]}),e.primary||e.secondary?c.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[c.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.primary?c.jsx(dh,{label:"5h window",window:e.primary}):null,e.secondary?c.jsx(dh,{label:"Weekly window",window:e.secondary}):null]}):null]})}function mS({label:e,value:t,tone:i}){const s=Math.min(100,Math.max(0,t));return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[c.jsx("span",{children:e}),c.jsxs("span",{className:"font-mono",children:[s.toFixed(1),"%"]})]}),c.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:c.jsx("div",{className:me("h-full",i),style:{width:`${s.toFixed(2)}%`}})})]})}function dh({label:e,window:t}){const i=Math.min(100,Math.max(0,t.usedPercent)),s=t.resetsAtUnix?new Date(t.resetsAtUnix*1e3).toLocaleString():null,a=i>=90?"bg-red-500":i>=70?"bg-amber-500":"bg-emerald-500";return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[c.jsx("span",{className:"text-muted-foreground",children:e}),c.jsxs("span",{className:"font-mono",children:[i.toFixed(1),"%"]})]}),c.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:c.jsx("div",{className:me("h-full",a),style:{width:`${i.toFixed(2)}%`}})}),s?c.jsxs("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:["resets ",s]}):null]})}function Ui({label:e,value:t}){return c.jsxs("div",{children:[c.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),c.jsx("div",{className:"font-mono text-xs font-semibold",children:t})]})}function Un(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function pS(e){if(!e)return"0s";if(e<1e3)return`${e}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const i=Math.floor(t/60),s=Math.round(t-i*60);return`${i}m ${s}s`}function lL(e=1e4){const[t,i]=E.useState(null),[s,a]=E.useState(null);return E.useEffect(()=>{let o=!0;const u=()=>{mM().then(m=>{o&&(i(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:s}}const cL={"claude-code":{label:"Claude Code",icon:c.jsx(al,{})},codex:{label:"Codex",icon:c.jsx(tu,{})}};function uL({agent:e,agentId:t,isDetected:i}){const{usage:s,error:a}=lL(),o=cL[t],u=t==="codex";return c.jsxs(or,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[c.jsxs(lr,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(lE,{className:"size-4 text-muted-foreground"}),c.jsx(cr,{children:u?"Token Usage & Rate Limits":"Token & Cost Usage"}),c.jsx(qe,{variant:"outline",size:"small",icon:o.icon,children:o.label}),i?c.jsx(qe,{variant:"outline",size:"small",children:"active session"}):c.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Not the active agent in this session"}),u?null:c.jsx(dL,{className:"ml-auto"})]}),c.jsxs(ra,{className:"truncate text-xs",children:[u?c.jsxs(c.Fragment,{children:["Session metrics from ",c.jsx("code",{className:"font-mono",children:"~/.codex/sessions"})]}):c.jsxs(c.Fragment,{children:["Last-session metrics from ",c.jsx("code",{className:"font-mono",children:"~/.claude.json"})]})," · ",c.jsx("span",{className:"font-mono",children:e.project.cwd})]})]}),c.jsxs(ur,{className:"p-3",children:[a?c.jsx("p",{className:"text-xs text-destructive",children:a}):null,u?s?.codex?c.jsx(oL,{usage:s.codex}):a?null:c.jsx(gS,{agent:"Codex CLI"}):s?.claude?c.jsx(aL,{usage:s.claude}):a?null:c.jsx(gS,{agent:"Claude Code"})]})]})}function dL({className:e}){const[t,i]=E.useState(!0),[s,a]=E.useState(!0),[o,u]=E.useState(!1),h=Oi();E.useEffect(()=>{let f=!0;return pM().then(p=>f&&i(p.coAuthorWithClaude)).catch(()=>{}).finally(()=>f&&a(!1)),()=>{f=!1}},[]);const m=async()=>{const f=!t;u(!0),i(f);try{const p=await gM({coAuthorWithClaude:f});i(p.coAuthorWithClaude),h.success(p.coAuthorWithClaude?"Claude co-author trailer enabled for commits":"Claude co-author trailer disabled for commits")}catch(p){i(!f),h.error(p instanceof Error?p.message:"Failed to update setting")}finally{u(!1)}};return c.jsxs(ue,{type:"button",variant:t?"default":"outline",size:"sm",onClick:m,disabled:s||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:me("gap-1.5",e),children:[c.jsx(al,{className:"size-3.5"}),"Co-author"]})}function gS({agent:e}){return c.jsxs("p",{className:"text-xs text-muted-foreground",children:["No usage data yet. Run a session with ",e," in this project."]})}function hL({agent:e,agentId:t}){return c.jsxs("div",{className:"grid grid-cols-1 divide-y divide-border xl:grid-cols-2 xl:divide-x xl:divide-y-0",children:[c.jsxs(or,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[c.jsxs(lr,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ka,{className:"size-4 text-muted-foreground"}),c.jsx(cr,{children:"Skills"})]}),c.jsx(qe,{variant:"outline",size:"small",children:e.skills.length})]}),c.jsx(ra,{className:"text-xs",children:t==="codex"?"User, project, and system skills discovered for Codex.":"User, project, and plugin skills discovered for the active agent."})]}),c.jsx(ur,{className:"p-0",children:e.skills.length?c.jsx("ul",{className:"divide-y divide-border",children:e.skills.map(i=>c.jsxs("li",{className:"px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:i.name}),c.jsx(qe,{variant:"outline",size:"small",children:i.scope})]}),i.description?c.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:i.description}):null]},`${i.scope}:${i.name}`))}):c.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No skills found."})})]}),c.jsx(fL,{agent:e,agentId:t})]})}function fL({agent:e,agentId:t}){const[i,s]=E.useState([]),[a,o]=E.useState(!1),u=E.useCallback(async()=>{o(!0);try{s(await fM(t))}catch{s([])}finally{o(!1)}},[t]);E.useEffect(()=>{u()},[u]);const h=E.useMemo(()=>{const f={};for(const p of i)f[p.name]=p.state;return f},[i]),m=E.useMemo(()=>{const f=new Set(e.mcpServers.map(b=>b.name)),p=i.filter(b=>!f.has(b.name)).map(b=>({name:b.name,scope:"user",synthetic:!0}));return[...e.mcpServers,...p]},[e.mcpServers,i]);return c.jsxs(or,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[c.jsxs(lr,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(dE,{className:"size-4 text-muted-foreground"}),c.jsx(cr,{children:"MCP Servers"})]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(qe,{variant:"outline",size:"small",children:m.length}),c.jsx(ue,{type:"button",variant:"ghost",size:"icon",className:"size-6",onClick:()=>{u()},disabled:a,title:"Re-check authentication status","aria-label":"Re-check authentication status",children:c.jsx(Dh,{className:a?"animate-spin":void 0})})]})]}),c.jsxs(ra,{className:"text-xs",children:["From"," ",c.jsx("code",{className:"font-mono",children:t==="codex"?"~/.codex/config.toml":"~/.claude.json"}),t==="codex"?"":" + claude.ai connectors",". Status via"," ",c.jsxs("code",{className:"font-mono",children:[t==="codex"?"codex":"claude"," mcp list"]})," ","(fresh health check)."]})]}),c.jsx(ur,{className:"p-0",children:m.length?c.jsx("ul",{className:"divide-y divide-border",children:m.map(f=>c.jsxs("li",{className:"px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:f.name}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[c.jsx(pL,{state:h[f.name],loading:a}),c.jsx(qe,{variant:"outline",size:"small",children:f.synthetic?"connector":f.scope})]})]}),c.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted-foreground",children:f.synthetic?"claude.ai managed connector":gL(f)})]},`${f.scope}:${f.name}`))}):c.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No MCP servers configured."})})]})}const mL={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 pL({state:e,loading:t}){if(!e)return t?c.jsx(Di,{className:"size-3 animate-spin text-muted-foreground"}):null;const i=e==="unknown"?void 0:mL[e];return i?c.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[c.jsx("span",{className:me("size-1.5 shrink-0 rounded-full",i.dot),"aria-hidden":!0}),i.label]}):null}function gL(e){return e.command?[e.command,...e.args??[]].join(" "):e.url??e.type??"-"}const bL=[{id:"claude-code",label:"Claude Code",icon:c.jsx(al,{className:"size-4"})},{id:"codex",label:"Codex",icon:c.jsx(tu,{className:"size-4"})}],_L=[{id:"overview",label:"Overview",icon:c.jsx(lE,{className:"size-3.5"})},{id:"memory",label:"Memory",icon:c.jsx(J2,{className:"size-3.5"})},{id:"tools",label:"Skills & MCPs",icon:c.jsx(dE,{className:"size-3.5"})},{id:"activity",label:"Activity",icon:c.jsx(Ia,{className:"size-3.5"})}];function vL(){const[e,t]=E.useState(null),[i,s]=E.useState(null),[a,o]=E.useState("claude-code"),[u,h]=E.useState("overview");if(E.useEffect(()=>{let f=!0;return hM().then(p=>{f&&(t(p),p.detected.name==="codex"&&o("codex"))}).catch(p=>{f&&s(p instanceof Error?p.message:String(p))}),()=>{f=!1}},[]),i)return c.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:c.jsxs(ht,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load agent info: ",i]})});if(!e)return c.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:c.jsx(ht,{variant:"muted",children:"Loading agent info…"})});const m=e.agents?.[a]??e;return c.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[c.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-card/90 px-3 py-2",children:bL.map(f=>{const p=a===f.id,b=e.detected.name===f.id;return c.jsxs("button",{type:"button",onClick:()=>o(f.id),className:me("flex items-center gap-2 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors",p?"border-border bg-background text-foreground shadow-sm":"border-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[f.icon,f.label,b?c.jsx("span",{className:"size-1.5 rounded-full bg-emerald-500","aria-label":"active session"}):null]},f.id)})}),c.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/90 px-3",children:_L.map(f=>c.jsxs("button",{type:"button",onClick:()=>h(f.id),className:me("relative flex items-center gap-1.5 px-2.5 py-2 text-xs font-medium transition-colors",u===f.id?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[f.icon,f.label,u===f.id?c.jsx("span",{className:"absolute inset-x-1 -bottom-px h-0.5 bg-primary"}):null]},f.id))}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[u==="overview"?c.jsx(uL,{agent:m,agentId:a,isDetected:e.detected.name===a}):null,u==="memory"?c.jsx(XO,{agent:m,agentId:a}):null,u==="tools"?c.jsx(hL,{agent:m,agentId:a}):null,u==="activity"?c.jsx(KO,{agent:m,agentId:a}):null]})]})}let bS=0;const _S=()=>(bS+=1,`t${Date.now()}-${bS}`);function xL(){const[e,t]=E.useState([]),[i,s]=E.useState(!1),[a,o]=E.useState(null),[u,h]=E.useState(null),[m,f]=E.useState(null),[p,b]=E.useState([]),v=E.useRef(null),x=E.useRef(void 0);E.useEffect(()=>{bM().then(T=>{h(T.configured),f(T.provider)}).catch(()=>h(!1))},[]);const y=E.useCallback(async(T,R)=>{b(O=>O.filter(H=>H.requestId!==T));const A=x.current;if(A)try{await _M(A,T,R)}catch{}},[]),S=E.useCallback(()=>{v.current?.abort(),v.current=null,s(!1)},[]),k=E.useCallback(async(T,R)=>{const A=T.trim();if(!A||i)return;o(null);const O={id:_S(),role:"user",text:A,label:R?.label,tools:[]},H=_S(),L={id:H,role:"assistant",text:"",tools:[]};t(P=>[...P,O,L]);const M=P=>t(F=>F.map(Z=>Z.id===H?P(Z):Z)),$=new AbortController;v.current=$,s(!0);try{await vM(A,x.current,P=>{switch(P.type){case"session":x.current=P.sessionId;break;case"text":M(F=>({...F,text:F.text+P.text}));break;case"tool_use":M(F=>({...F,tools:[...F.tools,{id:P.id,name:P.name,input:P.input,status:"running"}]}));break;case"tool_result":M(F=>({...F,tools:F.tools.map(Z=>Z.id===P.id?{...Z,preview:P.preview,isError:P.isError,status:"done"}:Z)}));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}},$.signal)}catch(P){$.signal.aborted||o(P instanceof Error?P.message:String(P))}finally{v.current=null,s(!1)}},[i]),N=E.useCallback(()=>{S(),x.current=void 0,t([]),b([]),o(null)},[S]);return{turns:e,streaming:i,error:a,configured:u,provider:m,approvals:p,send:k,stop:S,clear:N,respond:y}}const wC=E.createContext(null);function yL({children:e}){const t=xL(),{streaming:i,send:s}=t,[a,o]=E.useState(!1),[u,h]=E.useState(""),[m,f]=E.useState(null),[p,b]=E.useState(0),[v,x]=E.useState(!1),y=E.useRef([]),S=E.useCallback(()=>b(H=>H+1),[]),k=E.useCallback(()=>f(null),[]),N=E.useCallback(()=>{o(!0),x(!0)},[]),T=E.useCallback(H=>{o(!0),h(L=>L.trim()?`${L.replace(/\s*$/,"")}
18
+ ${H}`:H),S()},[S]);E.useEffect(()=>{if(i)return;const H=y.current.shift();H&&s(H.prompt,{label:H.label})},[i,s]);const R=E.useCallback(({prompt:H,source:L,mode:M="send",label:$})=>(o(!0),f(L??null),M==="draft"?(h(H),S(),{queued:!1}):i?(y.current.push({prompt:H,label:$}),{queued:!0}):(s(H,{label:$}),{queued:!1})),[i,s,S]),A=E.useCallback(()=>{y.current=[],f(null),t.clear()},[t]),O={...t,clear:A,open:a,setOpen:o,draft:u,setDraft:h,insertPath:T,activeSource:m,clearSource:k,focusNonce:p,sendToAgent:R,onboarding:v,setOnboarding:x,startOnboard:N};return c.jsx(wC.Provider,{value:O,children:e})}function Ns(){const e=E.useContext(wC);if(!e)throw new Error("useAgentDock must be used within an AgentProvider");return e}const SL=["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
+ `),wL=["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 EL(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 kL(e,t,i,s,a){const o=s.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 \`${i.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 CL({absolutePath:e,lines:t,relativePath:i}){return[`Please structurally split this large file and preserve behavior: ${i}`,"",`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(`
24
+ `)}function NL(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(i=>{const s=[`- ${i.name}`];return i.command&&s.push(`command: \`${i.command}\``),i.cwd&&s.push(`cwd: \`${i.cwd}\``),typeof i.port=="number"&&s.push(`port: ${i.port}`),i.description&&s.push(i.description),s.join(" — ")}).join(`
25
+ `):"- (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(`
26
+ `)}function TL({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(`
27
+ `)}const Cb="application/x-nomoreide-path";function iu(e,t){return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`}function EC(e,t){e.setData(Cb,t)}function vS(e){return e.types.includes(Cb)}function AL(e){return e.getData(Cb)||null}function kC(e){return{draggable:!0,onDragStart:t=>{EC(t.dataTransfer,e),t.dataTransfer.effectAllowed="copy"}}}const ML=new Set(["c","cpp","cs","go","java","js","jsx","kt","mjs","py","rs","swift","ts","tsx"]),RL=new Set([".env",".gitignore","components.json","dockerfile","package.json","tsconfig.json","vite.config.ts"]),jL=new Set(["conf","config","ini","toml","yaml","yml"]),DL=new Set(["csv","json","sql","xml"]),OL=new Set(["md","mdx","rst","txt"]),LL=new Set(["gif","jpeg","jpg","png","svg","webp"]),BL=new Set(["package-lock.json","pnpm-lock.yaml","yarn.lock"]),zL=new Set(["css","less","sass","scss"]);function IL(e){const t=e.split("/").pop()?.toLowerCase()??e.toLowerCase(),i=t.includes(".")?t.split(".").pop()??"":"";return BL.has(t)||t.endsWith(".lock")?"lock":PL(t)?"test":RL.has(t)||jL.has(i)?"config":zL.has(i)?"style":LL.has(i)?"image":OL.has(i)?"document":DL.has(i)?"data":ML.has(i)?"code":"generic"}function PL(e){return e.includes(".test.")||e.includes(".spec.")||e.endsWith("_test.go")}function Nb({path:e,className:t}){const i=IL(e),s=UL[i];return c.jsx(s,{"aria-label":`${i} file`,className:me("size-3.5 shrink-0",HL[i],t)})}const UL={code:sE,config:V4,data:Es,document:aE,generic:oE,image:QA,lock:l4,style:_4,test:BA},HL={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 FL(e){const t=e.lastIndexOf(".");return t>0?e.slice(t):""}function $L({onPick:e,onClose:t}){const[i,s]=E.useState(""),[a,o]=E.useState(null),[u,h]=E.useState(null),[m,f]=E.useState(!1),p=E.useRef(null),b=a?a.parent!==a.path:!1;return E.useEffect(()=>{function v(x){p.current&&!p.current.contains(x.target)&&t()}return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[t]),E.useEffect(()=>{let v=!0;return f(!0),h(null),_E(i,{files:!0}).then(x=>v&&o(x)).catch(x=>v&&h(x instanceof Error?x.message:String(x))).finally(()=>v&&f(!1)),()=>{v=!1}},[i]),c.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:[c.jsxs("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1.5",children:[c.jsx(ue,{"aria-label":"Parent folder",className:"size-7",disabled:!b,onClick:()=>a&&s(a.parent),size:"icon",type:"button",variant:"ghost",children:c.jsx(Mh,{})}),c.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",title:a?.path,children:a?.path??"…"}),m?c.jsx(Di,{className:"size-3.5 animate-spin text-muted-foreground"}):null,a?c.jsxs(ue,{className:"h-7 px-2 text-[11px]",onClick:()=>e(a.path),size:"sm",title:"Attach this folder",type:"button",variant:"outline",children:[c.jsx(_A,{})," This folder"]}):null,c.jsx(ue,{"aria-label":"Close",className:"size-7",onClick:t,size:"icon",type:"button",variant:"ghost",children:c.jsx(kn,{})})]}),c.jsx("div",{className:"max-h-64 overflow-auto p-1",children:u?c.jsx(ht,{variant:"destructive",className:"m-1",children:u}):a&&a.entries.length===0?c.jsx(ht,{variant:"muted",className:"m-1 text-center",children:"Empty folder."}):a?.entries.map(v=>{const x=v.isDir?"":FL(v.name);return c.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:()=>v.isDir?s(v.path):e(v.path),title:v.path,type:"button",children:[v.isDir?c.jsx(Ga,{className:"size-3.5 shrink-0 text-amber-600"}):c.jsx(Nb,{path:v.path}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:v.name}),x?c.jsx("span",{className:"shrink-0 rounded bg-muted px-1 font-mono text-[10px] text-muted-foreground",children:x}):null]},v.path)})})]})}const VL=/```options[^\n]*\n([\s\S]*?)```/g,qL=/```service[^\n]*\n([\s\S]*?)```/g,GL=/```(?:options|service)[^\n]*\n[\s\S]*$/;function KL(e){const t=[];let i=null,s=e.replace(VL,(a,o)=>{for(const u of o.split(`
28
+ `)){const h=u.replace(/^[-*\d.)\s]+/,"").trim();h&&t.push(h)}return""});return s=s.replace(qL,(a,o)=>{const u=o.split(`
29
+ `).map(h=>h.trim()).find(Boolean);return u&&(i=u),""}),s=s.replace(GL,""),{body:s.trim(),options:t,service:i}}function WL({options:e,disabled:t,onChoose:i}){return c.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map(s=>c.jsx(ue,{className:"h-7",disabled:t,onClick:()=>i(s),size:"sm",type:"button",variant:"outline",children:s},s))})}function YL({service:e,onStart:t,onOpen:i}){return c.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:[c.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["Added ",c.jsx("span",{className:"font-medium text-foreground",children:e})]}),c.jsxs("div",{className:"ml-auto flex gap-1.5",children:[c.jsxs(ue,{className:"h-7",onClick:()=>t(e),size:"sm",type:"button",children:[c.jsx(jh,{})," Start"]}),i?c.jsxs(ue,{className:"h-7",onClick:()=>i(e),size:"sm",type:"button",variant:"outline",children:[c.jsx(W0,{})," Open"]}):null]})]})}function Tb(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ya=Tb();function CC(e){Ya=e}var Oa={exec:()=>null};function Io(e){let t=[];return i=>{let s=Math.max(0,Math.min(3,i-1)),a=t[s];return a||(a=e(s),t[s]=a),a}}function at(e,t=""){let i=typeof e=="string"?e:e.source,s={replace:(a,o)=>{let u=typeof o=="string"?o:o.source;return u=u.replace(Hi.caret,"$1"),i=i.replace(a,u),s},getRegex:()=>new RegExp(i,t)};return s}var XL=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),Hi={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}}>`))},ZL=/^(?:[ \t]*(?:\n|$))+/,QL=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,JL=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,nu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,e7=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ab=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,NC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,TC=at(NC).replace(/bull/g,Ab).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(),t7=at(NC).replace(/bull/g,Ab).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(),Mb=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,i7=/^[^\n]+/,Rb=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,n7=at(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Rb).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),s7=at(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ab).getRegex(),Ph="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",jb=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,r7=at("^ {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",jb).replace("tag",Ph).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),AC=at(Mb).replace("hr",nu).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",Ph).getRegex(),a7=at(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",AC).getRegex(),Db={blockquote:a7,code:QL,def:n7,fences:JL,heading:e7,hr:nu,html:r7,lheading:TC,list:s7,newline:ZL,paragraph:AC,table:Oa,text:i7},xS=at("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",nu).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",Ph).getRegex(),o7={...Db,lheading:t7,table:xS,paragraph:at(Mb).replace("hr",nu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xS).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",Ph).getRegex()},l7={...Db,html:at(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",jb).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:Oa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:at(Mb).replace("hr",nu).replace("heading",` *#{1,6} *[^
30
+ ]`).replace("lheading",TC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},c7=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,u7=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,MC=/^( {2,}|\\)\n(?!\s*$)/,d7=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ol=/[\p{P}\p{S}]/u,Uh=/[\s\p{P}\p{S}]/u,Ob=/[^\s\p{P}\p{S}]/u,h7=at(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Uh).getRegex(),RC=/(?!~)[\p{P}\p{S}]/u,f7=/(?!~)[\s\p{P}\p{S}]/u,m7=/(?:[^\s\p{P}\p{S}]|~)/u,p7=at(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",XL?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),jC=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,g7=at(jC,"u").replace(/punct/g,ol).getRegex(),b7=at(jC,"u").replace(/punct/g,RC).getRegex(),DC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_7=at(DC,"gu").replace(/notPunctSpace/g,Ob).replace(/punctSpace/g,Uh).replace(/punct/g,ol).getRegex(),v7=at(DC,"gu").replace(/notPunctSpace/g,m7).replace(/punctSpace/g,f7).replace(/punct/g,RC).getRegex(),x7=at("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ob).replace(/punctSpace/g,Uh).replace(/punct/g,ol).getRegex(),y7=at(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ol).getRegex(),S7="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",w7=at(S7,"gu").replace(/notPunctSpace/g,Ob).replace(/punctSpace/g,Uh).replace(/punct/g,ol).getRegex(),E7=at(/\\(punct)/,"gu").replace(/punct/g,ol).getRegex(),k7=at(/^<(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(),C7=at(jb).replace("(?:-->|$)","-->").getRegex(),N7=at("^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",C7).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),hh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,T7=at(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",hh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),OC=at(/^!?\[(label)\]\[(ref)\]/).replace("label",hh).replace("ref",Rb).getRegex(),LC=at(/^!?\[(ref)\](?:\[\])?/).replace("ref",Rb).getRegex(),A7=at("reflink|nolink(?!\\()","g").replace("reflink",OC).replace("nolink",LC).getRegex(),yS=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Lb={_backpedal:Oa,anyPunctuation:E7,autolink:k7,blockSkip:p7,br:MC,code:u7,del:Oa,delLDelim:Oa,delRDelim:Oa,emStrongLDelim:g7,emStrongRDelimAst:_7,emStrongRDelimUnd:x7,escape:c7,link:T7,nolink:LC,punctuation:h7,reflink:OC,reflinkSearch:A7,tag:N7,text:d7,url:Oa},M7={...Lb,link:at(/^!?\[(label)\]\((.*?)\)/).replace("label",hh).getRegex(),reflink:at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",hh).getRegex()},Qg={...Lb,emStrongRDelimAst:v7,emStrongLDelim:b7,delLDelim:y7,delRDelim:w7,url:at(/^((?: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:at(/^([`~]+|[^`~])(?:(?= {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()},R7={...Qg,br:at(MC).replace("{2,}","*").getRegex(),text:at(Qg.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},jd={normal:Db,gfm:o7,pedantic:l7},cc={normal:Lb,gfm:Qg,breaks:R7,pedantic:M7},j7={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},SS=e=>j7[e];function gs(e,t){if(t){if(Hi.escapeTest.test(e))return e.replace(Hi.escapeReplace,SS)}else if(Hi.escapeTestNoEncode.test(e))return e.replace(Hi.escapeReplaceNoEncode,SS);return e}function wS(e){try{e=encodeURI(e).replace(Hi.percentDecode,"%")}catch{return null}return e}function ES(e,t){let i=e.replace(Hi.findPipe,(o,u,h)=>{let m=!1,f=u;for(;--f>=0&&h[f]==="\\";)m=!m;return m?"|":" |"}),s=i.split(Hi.splitPipe),a=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;a<s.length;a++)s[a]=s[a].trim().replace(Hi.slashPipe,"|");return s}function $r(e,t,i){let s=e.length;if(s===0)return"";let a=0;for(;a<s&&e.charAt(s-a-1)===t;)a++;return e.slice(0,s-a)}function kS(e){let t=e.split(`
31
+ `),i=t.length-1;for(;i>=0&&Hi.blankLine.test(t[i]);)i--;return t.length-i<=2?e:t.slice(0,i+1).join(`
32
+ `)}function D7(e,t){if(e.indexOf(t[1])===-1)return-1;let i=0;for(let s=0;s<e.length;s++)if(e[s]==="\\")s++;else if(e[s]===t[0])i++;else if(e[s]===t[1]&&(i--,i<0))return s;return i>0?-2:-1}function O7(e,t=0){let i=t,s="";for(let a of e)if(a===" "){let o=4-i%4;s+=" ".repeat(o),i+=o}else s+=a,i++;return s}function CS(e,t,i,s,a){let o=t.href,u=t.title||null,h=e[1].replace(a.other.outputLinkReplace,"$1");s.state.inLink=!0;let m={type:e[0].charAt(0)==="!"?"image":"link",raw:i,href:o,title:u,text:h,tokens:s.inlineTokens(h)};return s.state.inLink=!1,m}function L7(e,t,i){let s=e.match(i.other.indentCodeCompensation);if(s===null)return t;let a=s[1];return t.split(`
33
+ `).map(o=>{let u=o.match(i.other.beginningSpace);if(u===null)return o;let[h]=u;return h.length>=a.length?o.slice(a.length):o}).join(`
34
+ `)}var fh=class{options;rules;lexer;constructor(e){this.options=e||Ya}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 i=this.options.pedantic?t[0]:kS(t[0]),s=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:s}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let i=t[0],s=L7(i,t[3]||"",this.rules);return{type:"code",raw:i,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(this.rules.other.endingHash.test(i)){let s=$r(i,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(i=s.trim())}return{type:"heading",raw:$r(t[0],`
35
+ `),depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:$r(t[0],`
36
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let i=$r(t[0],`
37
+ `).split(`
38
+ `),s="",a="",o=[];for(;i.length>0;){let u=!1,h=[],m;for(m=0;m<i.length;m++)if(this.rules.other.blockquoteStart.test(i[m]))h.push(i[m]),u=!0;else if(!u)h.push(i[m]);else break;i=i.slice(m);let f=h.join(`
39
+ `),p=f.replace(this.rules.other.blockquoteSetextReplace,`
40
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
41
+ ${f}`:f,a=a?`${a}
42
+ ${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,i.length===0)break;let v=o.at(-1);if(v?.type==="code")break;if(v?.type==="blockquote"){let x=v,y=x.raw+`
43
+ `+i.join(`
44
+ `),S=this.blockquote(y);o[o.length-1]=S,s=s.substring(0,s.length-x.raw.length)+S.raw,a=a.substring(0,a.length-x.text.length)+S.text;break}else if(v?.type==="list"){let x=v,y=x.raw+`
45
+ `+i.join(`
46
+ `),S=this.list(y);o[o.length-1]=S,s=s.substring(0,s.length-v.raw.length)+S.raw,a=a.substring(0,a.length-x.raw.length)+S.raw,i=y.substring(o.at(-1).raw.length).split(`
47
+ `);continue}}return{type:"blockquote",raw:s,tokens:o,text:a}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim(),s=i.length>1,a={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let o=this.rules.other.listItemRegex(i),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=O7(t[2].split(`
48
+ `,1)[0],t[1].length),v=e.split(`
49
+ `,1)[0],x=!b.trim(),y=0;if(this.options.pedantic?(y=2,p=b.trimStart()):x?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),x&&this.rules.other.blankLine.test(v)&&(f+=v+`
50
+ `,e=e.substring(v.length+1),m=!0),!m){let S=this.rules.other.nextBulletRegex(y),k=this.rules.other.hrRegex(y),N=this.rules.other.fencesBeginRegex(y),T=this.rules.other.headingBeginRegex(y),R=this.rules.other.htmlBeginRegex(y),A=this.rules.other.blockquoteBeginRegex(y);for(;e;){let O=e.split(`
51
+ `,1)[0],H;if(v=O,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),H=v):H=v.replace(this.rules.other.tabCharGlobal," "),N.test(v)||T.test(v)||R.test(v)||A.test(v)||S.test(v)||k.test(v))break;if(H.search(this.rules.other.nonSpaceChar)>=y||!v.trim())p+=`
52
+ `+H.slice(y);else{if(x||b.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||N.test(b)||T.test(b)||k.test(b))break;p+=`
53
+ `+v}x=!v.trim(),f+=O+`
54
+ `,e=e.substring(O.length+1),b=H.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(v=>v.type==="space"),b=p.length>0&&p.some(v=>this.rules.other.anyLine.test(v.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 i=kS(t[0]);return{type:"html",block:!0,raw:i,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:i}}}def(e){let t=this.rules.block.def.exec(e);if(t){let i=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=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:i,raw:$r(t[0],`
55
+ `),href:s,title:a}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let i=ES(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
56
+ `):[],o={type:"table",raw:$r(t[0],`
57
+ `),header:[],align:[],rows:[]};if(i.length===s.length){for(let u of s)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<i.length;u++)o.header.push({text:i[u],tokens:this.lexer.inline(i[u]),header:!0,align:o.align[u]});for(let u of a)o.rows.push(ES(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 i=t[1].trim();return{type:"heading",raw:$r(t[0],`
58
+ `),depth:t[2].charAt(0)==="="?1:2,text:i,tokens:this.lexer.inline(i)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let i=t[1].charAt(t[1].length-1)===`
59
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}}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 i=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let o=$r(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{let o=D7(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 s=t[2],a="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(s);o&&(s=o[1],a=o[3])}else a=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?s=s.slice(1):s=s.slice(1,-1)),CS(t,{href:s&&s.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 i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let s=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=t[s.toLowerCase()];if(!a){let o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return CS(i,a,i[0],this.lexer,this.rules)}}emStrong(e,t,i=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!i||this.rules.inline.punctuation.exec(i))){let a=[...s[0]].length-1,o,u,h=a,m=0,f=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+a);(s=f.exec(t))!==null;){if(o=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!o)continue;if(u=[...o].length,s[3]||s[4]){h+=u;continue}else if((s[5]||s[6])&&a%3&&!((a+u)%3)){m+=u;continue}if(h-=u,h>0)continue;u=Math.min(u,u+h+m);let p=[...s[0]][0].length,b=e.slice(0,a+s.index+p+u);if(Math.min(a,u)%2){let x=b.slice(1,-1);return{type:"em",raw:b,text:x,tokens:this.lexer.inlineTokens(x)}}let v=b.slice(2,-2);return{type:"strong",raw:b,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(i),a=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return s&&a&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:t[0],text:i}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,i=""){let s=this.rules.inline.delLDelim.exec(e);if(s&&(!s[1]||!i||this.rules.inline.punctuation.exec(i))){let a=[...s[0]].length-1,o,u,h=a,m=this.rules.inline.delRDelim;for(m.lastIndex=0,t=t.slice(-1*e.length+a);(s=m.exec(t))!==null;){if(o=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!o||(u=[...o].length,u!==a))continue;if(s[3]||s[4]){h+=u;continue}if(h-=u,h>0)continue;u=Math.min(u,u+h);let f=[...s[0]][0].length,p=e.slice(0,a+s.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 i,s;return t[2]==="@"?(i=t[1],s="mailto:"+i):(i=t[1],s=i),{type:"link",raw:t[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let i,s;if(t[2]==="@")i=t[0],s="mailto:"+i;else{let a;do a=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(a!==t[0]);i=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let i=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:i}}}},ns=class Jg{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ya,this.options.tokenizer=this.options.tokenizer||new fh,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 i={other:Hi,block:jd.normal,inline:cc.normal};this.options.pedantic?(i.block=jd.pedantic,i.inline=cc.pedantic):this.options.gfm&&(i.block=jd.gfm,this.options.breaks?i.inline=cc.breaks:i.inline=cc.gfm),this.tokenizer.rules=i}static get rules(){return{block:jd,inline:cc}}static lex(t,i){return new Jg(i).lex(t)}static lexInline(t,i){return new Jg(i).inlineTokens(t)}lex(t){t=t.replace(Hi.carriageReturn,`
60
+ `),this.blockTokens(t,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let s=this.inlineQueue[i];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,i=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Hi.tabCharGlobal," ").replace(Hi.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,i))?(t=t.substring(o.raw.length),i.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let h=i.at(-1);o.raw.length===1&&h!==void 0?h.raw+=`
61
+ `:i.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let h=i.at(-1);h?.type==="paragraph"||h?.type==="text"?(h.raw+=(h.raw.endsWith(`
62
+ `)?"":`
63
+ `)+o.raw,h.text+=`
64
+ `+o.text,this.inlineQueue.at(-1).src=h.text):i.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let h=i.at(-1);h?.type==="paragraph"||h?.type==="text"?(h.raw+=(h.raw.endsWith(`
65
+ `)?"":`
66
+ `)+o.raw,h.text+=`
67
+ `+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},i.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),i.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=i.at(-1);s&&h?.type==="paragraph"?(h.raw+=(h.raw.endsWith(`
68
+ `)?"":`
69
+ `)+o.raw,h.text+=`
70
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):i.push(o),s=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=i.at(-1);h?.type==="text"?(h.raw+=(h.raw.endsWith(`
71
+ `)?"":`
72
+ `)+o.raw,h.text+=`
73
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):i.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,i}inline(t,i=[]){return this.inlineQueue.push({src:t,tokens:i}),i}inlineTokens(t,i=[]){this.tokenizer.lexer=this;let s=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(s))!==null;)f.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)o=a[2]?a[2].length:0,s=s.slice(0,a.index+o)+"["+"a".repeat(a[0].length-o-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;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,i))?(t=t.substring(f.raw.length),i.push(f),!0):!1))continue;if(f=this.tokenizer.escape(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.tag(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.link(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(f.raw.length);let b=i.at(-1);f.type==="text"&&b?.type==="text"?(b.raw+=f.raw,b.text+=f.text):i.push(f);continue}if(f=this.tokenizer.emStrong(t,s,h)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.codespan(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.br(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.del(t,s,h)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.autolink(t)){t=t.substring(f.raw.length),i.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(t))){t=t.substring(f.raw.length),i.push(f);continue}let p=t;if(this.options.extensions?.startInline){let b=1/0,v=t.slice(1),x;this.options.extensions.startInline.forEach(y=>{x=y.call({lexer:this},v),typeof x=="number"&&x>=0&&(b=Math.min(b,x))}),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=i.at(-1);b?.type==="text"?(b.raw+=f.raw,b.text+=f.text):i.push(f);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return i}infiniteLoopError(t){let i="Infinite loop on byte: "+t;if(this.options.silent)console.error(i);else throw new Error(i)}},mh=class{options;parser;constructor(e){this.options=e||Ya}space(e){return""}code({text:e,lang:t,escaped:i}){let s=(t||"").match(Hi.notSpaceStart)?.[0],a=e.replace(Hi.endingNewline,"")+`
74
+ `;return s?'<pre><code class="language-'+gs(s)+'">'+(i?a:gs(a,!0))+`</code></pre>
75
+ `:"<pre><code>"+(i?a:gs(a,!0))+`</code></pre>
76
+ `}blockquote({tokens:e}){return`<blockquote>
77
+ ${this.parser.parse(e)}</blockquote>
78
+ `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
79
+ `}hr(e){return`<hr>
80
+ `}list(e){let t=e.ordered,i=e.start,s="";for(let u=0;u<e.items.length;u++){let h=e.items[u];s+=this.listitem(h)}let a=t?"ol":"ul",o=t&&i!==1?' start="'+i+'"':"";return"<"+a+o+`>
81
+ `+s+"</"+a+`>
82
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
83
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
84
+ `}table(e){let t="",i="";for(let a=0;a<e.header.length;a++)i+=this.tablecell(e.header[a]);t+=this.tablerow({text:i});let s="";for(let a=0;a<e.rows.length;a++){let o=e.rows[a];i="";for(let u=0;u<o.length;u++)i+=this.tablecell(o[u]);s+=this.tablerow({text:i})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
85
+ <thead>
86
+ `+t+`</thead>
87
+ `+s+`</table>
88
+ `}tablerow({text:e}){return`<tr>
89
+ ${e}</tr>
90
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>
91
+ `}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>${gs(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:i}){let s=this.parser.parseInline(i),a=wS(e);if(a===null)return s;e=a;let o='<a href="'+e+'"';return t&&(o+=' title="'+gs(t)+'"'),o+=">"+s+"</a>",o}image({href:e,title:t,text:i,tokens:s}){s&&(i=this.parser.parseInline(s,this.parser.textRenderer));let a=wS(e);if(a===null)return gs(i);e=a;let o=`<img src="${e}" alt="${gs(i)}"`;return t&&(o+=` title="${gs(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:gs(e.text)}},Bb=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}},ss=class e0{options;renderer;textRenderer;constructor(t){this.options=t||Ya,this.options.renderer=this.options.renderer||new mh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Bb}static parse(t,i){return new e0(i).parse(t)}static parseInline(t,i){return new e0(i).parseInline(t)}parse(t){this.renderer.parser=this;let i="";for(let s=0;s<t.length;s++){let a=t[s];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)){i+=h||"";continue}}let o=a;switch(o.type){case"space":{i+=this.renderer.space(o);break}case"hr":{i+=this.renderer.hr(o);break}case"heading":{i+=this.renderer.heading(o);break}case"code":{i+=this.renderer.code(o);break}case"table":{i+=this.renderer.table(o);break}case"blockquote":{i+=this.renderer.blockquote(o);break}case"list":{i+=this.renderer.list(o);break}case"checkbox":{i+=this.renderer.checkbox(o);break}case"html":{i+=this.renderer.html(o);break}case"def":{i+=this.renderer.def(o);break}case"paragraph":{i+=this.renderer.paragraph(o);break}case"text":{i+=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 i}parseInline(t,i=this.renderer){this.renderer.parser=this;let s="";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)){s+=h||"";continue}}let u=o;switch(u.type){case"escape":{s+=i.text(u);break}case"html":{s+=i.html(u);break}case"link":{s+=i.link(u);break}case"image":{s+=i.image(u);break}case"checkbox":{s+=i.checkbox(u);break}case"strong":{s+=i.strong(u);break}case"em":{s+=i.em(u);break}case"codespan":{s+=i.codespan(u);break}case"br":{s+=i.br(u);break}case"del":{s+=i.del(u);break}case"text":{s+=i.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 s}},vc=class{options;block;constructor(e){this.options=e||Ya}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?ns.lex:ns.lexInline}provideParser(e=this.block){return e?ss.parse:ss.parseInline}},B7=class{defaults=Tb();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ss;Renderer=mh;TextRenderer=Bb;Lexer=ns;Tokenizer=fh;Hooks=vc;constructor(...t){this.use(...t)}walkTokens(t,i){let s=[];for(let a of t)switch(s=s.concat(i.call(this,a)),a.type){case"table":{let o=a;for(let u of o.header)s=s.concat(this.walkTokens(u.tokens,i));for(let u of o.rows)for(let h of u)s=s.concat(this.walkTokens(h.tokens,i));break}case"list":{let o=a;s=s.concat(this.walkTokens(o.items,i));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);s=s.concat(this.walkTokens(h,i))}):o.tokens&&(s=s.concat(this.walkTokens(o.tokens,i)))}}return s}use(...t){let i=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(s=>{let a={...s};if(a.async=this.defaults.async||a.async||!1,s.extensions&&(s.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let u=i.renderers[o.name];u?i.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=u.apply(this,h)),m}:i.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=i[o.level];u?u.unshift(o.tokenizer):i[o.level]=[o.tokenizer],o.start&&(o.level==="block"?i.startBlock?i.startBlock.push(o.start):i.startBlock=[o.start]:o.level==="inline"&&(i.startInline?i.startInline.push(o.start):i.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(i.childTokens[o.name]=o.childTokens)}),a.extensions=i),s.renderer){let o=this.defaults.renderer||new mh(this.defaults);for(let u in s.renderer){if(!(u in o))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;let h=u,m=s.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(s.tokenizer){let o=this.defaults.tokenizer||new fh(this.defaults);for(let u in s.tokenizer){if(!(u in o))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;let h=u,m=s.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(s.hooks){let o=this.defaults.hooks||new vc;for(let u in s.hooks){if(!(u in o))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;let h=u,m=s.hooks[h],f=o[h];vc.passThroughHooks.has(u)?o[h]=p=>{if(this.defaults.async&&vc.passThroughHooksRespectAsync.has(u))return(async()=>{let v=await m.call(o,p);return f.call(o,v)})();let b=m.call(o,p);return f.call(o,b)}:o[h]=(...p)=>{if(this.defaults.async)return(async()=>{let v=await m.apply(o,p);return v===!1&&(v=await f.apply(o,p)),v})();let b=m.apply(o,p);return b===!1&&(b=f.apply(o,p)),b}}a.hooks=o}if(s.walkTokens){let o=this.defaults.walkTokens,u=s.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,i){return ns.lex(t,i??this.defaults)}parser(t,i){return ss.parse(t,i??this.defaults)}parseMarkdown(t){return(i,s)=>{let a={...s},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 i>"u"||i===null)return u(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return u(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", 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(i):i,m=await(o.hooks?await o.hooks.provideLexer(t):t?ns.lex:ns.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?ss.parse:ss.parseInline)(f,o);return o.hooks?await o.hooks.postprocess(p):p})().catch(u);try{o.hooks&&(i=o.hooks.preprocess(i));let h=(o.hooks?o.hooks.provideLexer(t):t?ns.lex:ns.lexInline)(i,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(t):t?ss.parse:ss.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return u(h)}}}onError(t,i){return s=>{if(s.message+=`
92
+ Please report this to https://github.com/markedjs/marked.`,t){let a="<p>An error occurred:</p><pre>"+gs(s.message+"",!0)+"</pre>";return i?Promise.resolve(a):a}if(i)return Promise.reject(s);throw s}}},$a=new B7;function ft(e,t){return $a.parse(e,t)}ft.options=ft.setOptions=function(e){return $a.setOptions(e),ft.defaults=$a.defaults,CC(ft.defaults),ft};ft.getDefaults=Tb;ft.defaults=Ya;ft.use=function(...e){return $a.use(...e),ft.defaults=$a.defaults,CC(ft.defaults),ft};ft.walkTokens=function(e,t){return $a.walkTokens(e,t)};ft.parseInline=$a.parseInline;ft.Parser=ss;ft.parser=ss.parse;ft.Renderer=mh;ft.TextRenderer=Bb;ft.Lexer=ns;ft.lexer=ns.lex;ft.Tokenizer=fh;ft.Hooks=vc;ft.parse=ft;ft.options;ft.setOptions;ft.use;ft.walkTokens;ft.parseInline;ss.parse;ns.lex;function z7(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 I7({content:e}){const t=E.useMemo(()=>{const i=ft.parse(e,{async:!1,gfm:!0,breaks:!0});return z7(i)},[e]);return c.jsx("div",{className:"chat-md",dangerouslySetInnerHTML:{__html:t}})}function P7(e){return Math.min(e,Math.max(1,Math.ceil(e/22)))}function U7(e){const[t,i]=E.useState(e),s=E.useRef(e),a=E.useRef(e);return a.current=e,E.useEffect(()=>{e.startsWith(s.current)||(s.current=e,i(e))},[e]),E.useEffect(()=>{if(s.current.length>=a.current.length)return;const o=requestAnimationFrame(()=>{const u=a.current,h=u.slice(0,s.current.length+P7(u.length-s.current.length));s.current=h,i(h)});return()=>cancelAnimationFrame(o)},[t,e]),t}function H7(){return c.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",role:"status",children:[c.jsx(Di,{className:"size-3.5 animate-spin"}),c.jsx("span",{children:"Thinking…"})]})}function F7({onOpenAgentPage:e,onOpenService:t}){const{error:i,success:s}=Oi(),{turns:a,streaming:o,error:u,configured:h,provider:m,approvals:f,send:p,stop:b,clear:v,respond:x,open:y,setOpen:S,draft:k,setDraft:N,insertPath:T,activeSource:R,clearSource:A,focusNonce:O,sendToAgent:H,onboarding:L,setOnboarding:M}=Ns(),[$,P]=E.useState(""),[F,Z]=E.useState(!1),[K,Q]=E.useState(!1),[q,D]=E.useState(!1),[Y,X]=E.useState(null),[V,I]=E.useState(!1),j=E.useRef(null),W=E.useRef(null),de=E.useRef(null),oe=E.useRef(null);E.useEffect(()=>{!y||L||requestAnimationFrame(()=>{const ye=W.current;if(!ye)return;ye.focus();const St=ye.value.length;ye.setSelectionRange(St,St)})},[y,O,L]),E.useEffect(()=>{!y||!L||requestAnimationFrame(()=>de.current?.focus())},[y,L]),E.useEffect(()=>{if(!y)return;const ye=St=>{oe.current?.contains(St.target)||S(!1)};return document.addEventListener("pointerdown",ye),()=>document.removeEventListener("pointerdown",ye)},[y,S]),E.useEffect(()=>{const ye=Cn=>{Cn.dataTransfer&&vS(Cn.dataTransfer)&&Z(!0)},St=()=>{Z(!1),Q(!1)};return document.addEventListener("dragstart",ye),document.addEventListener("dragend",St),document.addEventListener("drop",St),()=>{document.removeEventListener("dragstart",ye),document.removeEventListener("dragend",St),document.removeEventListener("drop",St)}},[]);const he=E.useRef(!0);function se(){const ye=j.current;ye&&(he.current=ye.scrollHeight-ye.scrollTop-ye.clientHeight<48)}E.useEffect(()=>{const ye=j.current;ye&&he.current&&(ye.scrollTop=ye.scrollHeight)},[a,y]);async function fe(){const ye=k;N(""),he.current=!0,await p(ye)}function we(ye){ye.trim()&&(N(""),M(!1),P(""),he.current=!0,H({prompt:EL(ye),source:{type:"repo-onboard",label:"Onboard repo"},label:`Onboard and run this repo: ${ye}`}))}function xe(ye){he.current=!0,p(ye)}async function Ze(ye){try{await cn(`/api/services/${encodeURIComponent(ye)}/start`,{}),s(`Starting ${ye}…`)}catch(St){i(St instanceof Error?St.message:`Could not start ${ye}.`)}}function ot(ye){ye.key==="Enter"&&!ye.shiftKey&&(ye.preventDefault(),fe())}function lt(ye){vS(ye.dataTransfer)&&(ye.preventDefault(),ye.dataTransfer.dropEffect="copy",y||S(!0),Q(!0))}function Be(ye){ye.currentTarget.contains(ye.relatedTarget)||Q(!1)}function Lt(ye){Q(!1);const St=AL(ye.dataTransfer);St&&(ye.preventDefault(),T(St))}function Ts(ye){if(!y)return;ye.preventDefault(),ye.currentTarget.setPointerCapture(ye.pointerId),I(!0);const St=160,Cn=window.innerHeight-48;function os(Xn){const aa=window.innerHeight-Xn.clientY;X(Math.max(St,Math.min(Cn,aa)))}function Yn(){I(!1),window.removeEventListener("pointermove",os),window.removeEventListener("pointerup",Yn)}window.addEventListener("pointermove",os),window.addEventListener("pointerup",Yn)}return c.jsx("div",{ref:oe,className:me("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",V?"select-none":"transition-[height] duration-200",y?Y===null?"h-[50vh]":"":F?"h-12":"h-9",F&&!K&&"border-primary/60 bg-primary/5",K&&"outline-dashed outline-2 -outline-offset-2 outline-primary/70"),style:y&&Y!==null?{height:Y}:void 0,onDragOver:lt,onDragLeave:Be,onDrop:Lt,children:y?c.jsxs(c.Fragment,{children:[c.jsx("div",{"aria-hidden":!0,className:"absolute inset-x-0 -top-1 z-10 h-2 cursor-ns-resize",onDoubleClick:()=>X(null),onPointerDown:Ts}),c.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:[c.jsxs("div",{className:"pointer-events-auto flex items-center gap-2",children:[c.jsx(NS,{provider:m,className:"size-4 text-primary"}),c.jsx("span",{className:"text-sm font-medium",children:m?.label??"Agent"}),R?c.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:[c.jsx(Ka,{className:"size-3"}),c.jsx("span",{className:"max-w-40 truncate",children:R.label}),c.jsx("button",{"aria-label":"Clear source",className:"opacity-60 hover:opacity-100",onClick:A,type:"button",children:c.jsx(kn,{className:"size-3"})})]}):null]}),c.jsxs("div",{className:"pointer-events-auto flex items-center gap-1",children:[e?c.jsx(ue,{"aria-label":"Open agent page",className:"size-7",onClick:e,size:"icon",title:"Open the full agent page",type:"button",variant:"ghost",children:c.jsx(C4,{})}):null,c.jsx(ue,{"aria-label":"Clear conversation",className:"size-7",disabled:a.length===0,onClick:v,size:"icon",title:"Clear conversation",type:"button",variant:"ghost",children:c.jsx(Yc,{})}),c.jsx(ue,{"aria-label":"Collapse agent",className:"size-7",onClick:()=>S(!1),size:"icon",title:"Collapse",type:"button",variant:"ghost",children:c.jsx(qn,{})})]})]}),c.jsx("div",{ref:j,className:"min-h-0 flex-1 overflow-auto px-3 py-3",onScroll:se,children:c.jsxs("div",{className:"mx-auto w-full max-w-4xl space-y-3",children:[a.length===0?c.jsx($7,{configured:h,provider:m,onOnboard:()=>M(!0)}):a.map((ye,St)=>c.jsx(K7,{turn:ye,streaming:o&&St===a.length-1,isLast:St===a.length-1,onChoose:xe,onStartService:Ze,onOpenService:t},ye.id)),u?c.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:[c.jsx(sM,{className:"mt-px size-3.5 shrink-0"}),c.jsx("span",{className:"min-w-0 break-words",children:u})]}):null]})}),f.length>0?c.jsx("div",{className:"shrink-0 space-y-1.5 border-t border-amber-400/40 bg-amber-50/60 px-3 py-2",children:f.map(ye=>c.jsx(Y7,{prompt:ye,onRespond:x},ye.requestId))}):null,c.jsxs("div",{className:me("relative shrink-0 p-2 transition-colors",F&&"bg-primary/5"),children:[q?c.jsx($L,{onClose:()=>D(!1),onPick:ye=>{D(!1),T(ye)}}):null,c.jsxs("div",{className:"mx-auto w-full max-w-4xl",children:[L?c.jsxs("form",{className:"mb-2 flex items-center gap-2 rounded-md border border-primary/40 bg-primary/5 p-1.5",onSubmit:ye=>{ye.preventDefault(),we($)},children:[c.jsx(as,{className:"size-4 shrink-0 text-primary"}),c.jsx("input",{ref:de,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onChange:ye=>P(ye.target.value),placeholder:"Paste a repo URL — e.g. https://github.com/owner/repo",value:$}),c.jsx(ue,{disabled:!$.trim(),size:"sm",type:"submit",children:"Onboard"}),c.jsx(ue,{"aria-label":"Cancel onboarding",className:"size-7",onClick:()=>{M(!1),P("")},size:"icon",type:"button",variant:"ghost",children:c.jsx(kn,{})})]}):q7(k)&&!o?c.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:()=>we(k),type:"button",children:[c.jsx(as,{className:"size-3.5 shrink-0"}),c.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["Onboard ",c.jsx("span",{className:"font-mono",children:k.trim()})," as a service"]}),c.jsx(gA,{className:"size-3.5 shrink-0 opacity-60"})]}):null,c.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:[c.jsx(ue,{"aria-label":"Attach a file or folder",className:"size-8 shrink-0 rounded-full text-muted-foreground hover:text-foreground",disabled:h===!1,onClick:()=>D(!0),size:"icon",title:"Attach a file or folder",type:"button",variant:q?"secondary":"ghost",children:c.jsx(T4,{})}),c.jsx("textarea",{ref:W,className:"max-h-32 min-h-8 flex-1 resize-none self-center bg-transparent px-1 py-1.5 text-sm outline-none placeholder:text-muted-foreground",disabled:h===!1,onChange:ye=>N(ye.target.value),onKeyDown:ot,placeholder:h===!1?`${m?.label??"Agent"} (\`${m?.commandName??"agent"}\`) is not installed`:`Ask ${m?.label??"the agent"} anything about this project...`,rows:1,value:k}),o?c.jsx(ue,{"aria-label":"Stop generating",className:"size-8 shrink-0 rounded-full",onClick:b,size:"icon",title:"Stop",type:"button",variant:"secondary",children:c.jsx(Oh,{className:"size-3.5 fill-current"})}):c.jsx(ue,{"aria-label":"Send message",className:"size-8 shrink-0 rounded-full",disabled:!k.trim()||h===!1,onClick:()=>{fe()},size:"icon",title:"Send",type:"button",children:c.jsx(Z2,{className:"size-4"})})]})]})]})]}):c.jsx("button",{className:me("flex h-full w-full items-center gap-2 px-3 text-left text-sm hover:bg-muted/50",F?"font-medium text-primary":"text-muted-foreground"),onClick:()=>S(!0),type:"button",children:F?c.jsxs(c.Fragment,{children:[c.jsx(tE,{className:"size-4 animate-bounce text-primary"}),c.jsx("span",{children:"Drop here to add it to your message"})]}):c.jsxs(c.Fragment,{children:[c.jsx(NS,{provider:m,className:"size-4 text-primary"}),o?c.jsxs("span",{className:"flex items-center gap-2 text-foreground",children:[c.jsx(Di,{className:"size-3.5 animate-spin"})," ",m?.label??"Agent"," is thinking…"]}):c.jsxs("span",{children:["Ask ",m?.label??"the agent","..."]}),c.jsx("span",{className:"ml-auto text-xs text-muted-foreground/70",children:"click to expand"})]})})})}function NS({provider:e,className:t}){return e?.id==="claude"?c.jsx(al,{className:t}):e?.id==="codex"?c.jsx(tu,{className:t}):c.jsx(Ka,{className:t})}function $7({configured:e,provider:t,onOnboard:i}){return e===!1?c.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 ",c.jsx("code",{className:"font-mono",children:t?.commandName??"agent"})," ","CLI. ",t?.installHint??"Install the active agent CLI, then reload."]}):c.jsxs("div",{className:"space-y-2 text-xs text-muted-foreground",children:[c.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".'}),c.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:i,type:"button",children:[c.jsx(as,{className:"size-3.5"}),"Onboard a repo from a URL"]})]})}const V7=/^(?:https?:\/\/|git@|ssh:\/\/)\S+$/i;function q7(e){const t=e.trim();return t.includes(`
93
+ `)||t.includes(" ")||!V7.test(t)?!1:/github\.com|gitlab\.|bitbucket\.|\.git$/i.test(t)}function G7({turn:e}){const[t,i]=E.useState(!1),s=!!e.label&&e.label!==e.text,a=s&&!t?e.label:e.text;return c.jsx("div",{className:"flex justify-end",children:c.jsxs("div",{className:"flex max-w-[85%] flex-col items-end gap-0.5",children:[c.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}),s?c.jsxs("button",{className:"flex items-center gap-0.5 px-1 text-[11px] text-muted-foreground transition-colors hover:text-foreground",onClick:()=>i(o=>!o),type:"button",children:[t?c.jsx(Mh,{className:"size-3"}):c.jsx(qn,{className:"size-3"}),t?"Hide full prompt":"Show full prompt"]}):null]})})}function K7({turn:e,streaming:t,isLast:i,onChoose:s,onStartService:a,onOpenService:o}){const u=U7(e.text);if(e.role==="user")return c.jsx(G7,{turn:e});const{body:h,options:m,service:f}=KL(u);return c.jsxs("div",{className:"space-y-1.5",children:[e.tools.map(p=>c.jsx(W7,{tool:p},p.id)),h?c.jsx("div",{className:"break-words px-0.5 text-sm text-foreground",children:c.jsx(I7,{content:h})}):null,m.length>0&&i&&!t?c.jsx(WL,{options:m,onChoose:s}):null,f&&!t?c.jsx(YL,{service:f,onStart:a,onOpen:o}):null,t&&!h?c.jsx(H7,{}):null]})}function W7({tool:e}){const t=BC(e.input);return c.jsxs("div",{className:me("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"?c.jsx(Di,{className:"size-3 animate-spin"}):c.jsx(lM,{className:"size-3"}),c.jsx("span",{className:"font-semibold",children:e.name}),t?c.jsx("span",{className:"truncate",children:t}):null]})}function Y7({prompt:e,onRespond:t}){const i=BC(e.input).slice(0,140);return c.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-amber-400/50 bg-background/80 px-2 py-1.5 text-xs",children:[c.jsx(G4,{className:"size-4 shrink-0 text-amber-600"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"font-mono font-semibold",children:e.name}),i?c.jsx("span",{className:"ml-1 truncate font-mono text-muted-foreground",children:i}):null]}),c.jsxs(ue,{className:"h-7",onClick:()=>t(e.requestId,"deny"),size:"sm",type:"button",variant:"outline",children:[c.jsx(kn,{})," Deny"]}),c.jsxs(ue,{className:"h-7",onClick:()=>t(e.requestId,"allow"),size:"sm",type:"button",children:[c.jsx(Ah,{})," Allow"]})]})}function BC(e){return!e||typeof e!="object"?"":Object.values(e).filter(i=>i!==void 0&&i!=="").map(i=>String(i)).join(" ")}function et({className:e,type:t,...i}){return c.jsx("input",{type:t,className:me("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),...i})}var su=K2();function rr({children:e,icon:t,onClose:i,title:s,size:a="md"}){return E.useEffect(()=>{function o(u){u.key==="Escape"&&i()}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[i]),su.createPortal(c.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",onMouseDown:i,children:c.jsxs("div",{"aria-modal":"true",className:`flex max-h-[min(760px,calc(100vh-2rem))] w-full flex-col overflow-hidden rounded-lg border border-border bg-card shadow-xl ${a==="lg"?"max-w-3xl":"max-w-lg"}`,onMouseDown:o=>o.stopPropagation(),role:"dialog",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[c.jsx("div",{className:"flex size-8 items-center justify-center rounded-md border border-border bg-background text-foreground [&_svg]:size-4",children:t}),c.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:s}),c.jsx(ue,{"aria-label":"Close dialog",onClick:i,size:"icon",type:"button",variant:"ghost",children:c.jsx(kn,{})})]}),c.jsx("div",{className:"min-h-0 overflow-auto p-4",children:e})]})}),document.body)}const xp={host:"",port:"",user:"",password:"",database:"",ssl:!1},X7="localhost";function t0(e,t,{includePassword:i=!0}={}){const s=e==="mysql"?"mysql":"postgres",a=t.host.trim()||X7,o=t.port.trim(),u=t.database.trim().replace(/^\//,""),h=t.user.trim(),m=i&&t.password,f=h?`${encodeURIComponent(h)}${m?`:${encodeURIComponent(t.password)}`:""}@`:"",p=o?`:${o}`:"",b=e==="postgres"&&t.ssl?"?sslmode=require":"";return`${s}://${f}${a}${p}/${u}${b}`}function i0(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:TS(t.username),password:TS(t.password),database:t.pathname.replace(/^\//,""),ssl:t.searchParams.get("sslmode")==="require"||t.searchParams.has("ssl")}}function Z7(e){const t=/^([a-z0-9+]+):\/\//i.exec(e.trim());if(!t)return null;const i=t[1].toLowerCase();return i.startsWith("postgres")?"postgres":i.startsWith("mysql")?"mysql":i.startsWith("sqlite")||i==="file"?"sqlite":null}function TS(e){try{return decodeURIComponent(e)}catch{return e}}const Q7=[{value:"postgres",label:"Postgres"},{value:"mysql",label:"MySQL"},{value:"sqlite",label:"SQLite"}];function J7({onClose:e,onSaved:t,initial:i}){const{error:s,success:a}=Oi(),o=!!i,u=E.useMemo(()=>e9(i),[i]),[h,m]=E.useState(u.engine),[f,p]=E.useState(u.name),[b,v]=E.useState(u.url),[x,y]=E.useState(u.fields),[S,k]=E.useState([]),[N,T]=E.useState({status:"idle"}),[R,A]=E.useState(!1),[O,H]=E.useState(!1);E.useEffect(()=>{o||yM().then(k).catch(()=>k([]))},[o]);const L=h==="sqlite",M=L?b.trim():t0(h,x),$=L?!!b.trim():!!(x.host.trim()&&x.database.trim());function P(){T({status:"idle"})}function F(V,I){return t0(V,I,{includePassword:!1})}function Z(V){m(V),P(),V!=="sqlite"&&v(F(V,x))}function K(V){const I={...x,...V};y(I),v(F(h,I)),P()}function Q(V){P();const I=Z7(V),j=I??h;I&&I!==h&&m(I);const W=I==="sqlite"?null:i0(V);if(!W){v(V);return}W.password?(y(W),v(F(j,W))):(y({...W,password:x.password}),v(V))}function q(V){m(V.engine);const I=V.engine==="sqlite"?null:i0(V.url);I?(y(I),v(F(V.engine,I))):v(V.url),P(),f.trim()||p(t9(V))}function D(){return f.trim()?L?b.trim()?null:"Database file path is required.":x.host.trim()?x.database.trim()?null:"Database name is required.":"Host is required.":"Name is required."}async function Y(){if($){A(!0),P();try{const V=await wM({engine:h,url:M});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{A(!1)}}}async function X(){const V=D();if(V){s(V);return}H(!0);try{await SM({name:f.trim(),engine:h,url:M}),a(`Saved connection "${f.trim()}".`),t(),e()}catch(I){s(I instanceof Error?I.message:String(I))}finally{H(!1)}}return c.jsx(rr,{icon:c.jsx(Es,{}),onClose:e,title:o?"Edit database connection":"Add database connection",children:c.jsxs("div",{className:"flex flex-col gap-4",children:[S.length>0?c.jsxs("section",{children:[c.jsxs("p",{className:"mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[c.jsx(aM,{className:"size-3.5"}),"Found in your services"]}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:S.map(V=>c.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:[c.jsx(qe,{variant:"outline",size:"small",children:V.engine}),c.jsx("span",{className:"font-mono",children:V.service}),c.jsxs("span",{className:"font-mono text-muted-foreground",children:["·",V.key]})]},`${V.service}:${V.key}`))})]}):null,c.jsxs("section",{children:[c.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Engine"}),c.jsx("div",{className:"flex gap-1.5",children:Q7.map(V=>c.jsx(ue,{size:"sm",variant:h===V.value?"default":"outline",onClick:()=>Z(V.value),disabled:o,type:"button",children:V.label},V.value))})]}),c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),c.jsx(et,{value:f,onChange:V=>p(V.target.value),placeholder:"e.g. shop-db",disabled:o}),o?c.jsx("span",{className:"text-[11px] text-muted-foreground",children:"The name identifies the connection and can't be changed here."}):null]}),L?null:c.jsxs("section",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex gap-3",children:[c.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Host"}),c.jsx(et,{value:x.host,onChange:V=>K({host:V.target.value}),placeholder:"localhost",className:"font-mono text-xs"})]}),c.jsxs("label",{className:"flex w-24 flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Port"}),c.jsx(et,{value:x.port,onChange:V=>K({port:V.target.value}),placeholder:h==="mysql"?"3306":"5432",className:"font-mono text-xs"})]})]}),c.jsxs("div",{className:"flex gap-3",children:[c.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"User"}),c.jsx(et,{value:x.user,onChange:V=>K({user:V.target.value}),placeholder:"postgres",className:"font-mono text-xs"})]}),c.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Password"}),c.jsx(et,{type:"password",value:x.password,onChange:V=>K({password:V.target.value}),placeholder:o?"leave blank to keep current":"••••••••",className:"font-mono text-xs"})]})]}),c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Database"}),c.jsx(et,{value:x.database,onChange:V=>K({database:V.target.value}),placeholder:"app",className:"font-mono text-xs"})]}),h==="postgres"?c.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[c.jsx("input",{type:"checkbox",checked:x.ssl,onChange:V=>K({ssl:V.target.checked}),className:"size-3.5 accent-primary"}),"Require SSL (adds ",c.jsx("span",{className:"font-mono",children:"?sslmode=require"}),")"]}):null]}),c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:L?"Database file path":"Connection URL"}),c.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"}),c.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."})]}),N.status!=="idle"?c.jsxs("div",{className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs ${N.status==="ok"?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400":"border-destructive/40 text-destructive"}`,children:[N.status==="ok"?c.jsx(Ah,{className:"size-3.5"}):c.jsx(kn,{className:"size-3.5"}),c.jsx("span",{className:"break-all font-mono",children:N.message})]}):null,c.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border pt-3",children:[c.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>{Y()},disabled:R||!$,type:"button",children:[R?c.jsx(Di,{className:"animate-spin"}):null,"Test connection"]}),c.jsxs(ue,{size:"sm",onClick:()=>{X()},disabled:O,type:"button",children:[O?c.jsx(Di,{className:"animate-spin"}):null,o?"Save changes":"Save"]})]})]})})}function e9(e){if(!e)return{engine:"postgres",name:"",fields:xp,url:""};if(e.engine==="sqlite")return{engine:"sqlite",name:e.name,fields:xp,url:e.url};const t=i0(e.url),i=t?{...t,password:""}:xp;return{engine:e.engine,name:e.name,fields:i,url:t0(e.engine,i,{includePassword:!1})}}function t9(e){try{const i=new URL(e.url).pathname.replace(/^\//,"");if(i)return`${e.service}-${i}`}catch{}return`${e.service}-${e.engine}`}function i9({connections:e,selected:t,onSelect:i,onAdd:s,onEdit:a,onRemove:o}){const[u,h]=E.useState(!1),m=E.useRef(null),f=e.find(p=>p.name===t);return E.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]),c.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:m,children:[c.jsxs(ue,{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:[c.jsx(Es,{className:"text-muted-foreground"}),c.jsx("span",{className:"truncate",children:f?.name??"Select connection"}),f?c.jsx(qe,{variant:"outline",size:"small",children:f.engine}):null,c.jsx(qn,{className:me("ml-auto transition-transform",u&&"rotate-180")})]}),u?c.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:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[c.jsx(Es,{className:"size-3.5 text-muted-foreground"}),c.jsx("div",{className:"text-xs font-semibold",children:"Connections"}),c.jsx(qe,{className:"ml-auto",variant:"outline",size:"small",children:e.length})]}),c.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?c.jsx("div",{className:"divide-y divide-border",children:e.map(p=>{const b=p.name===t;return c.jsxs("div",{className:me("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:[c.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{i(p.name),h(!1)},type:"button",children:[c.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:p.name}),c.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:p.url})]}),b?c.jsx(Ah,{className:"size-3.5"}):c.jsx("span",{className:"size-3.5"}),c.jsx(ue,{"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:c.jsx(Lc,{className:"size-3.5"})}),c.jsx(ue,{"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:c.jsx(Yc,{className:"size-3.5 text-destructive"})})]},p.name)})}):c.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved connections yet."})}),c.jsx("div",{className:"border-t border-border bg-muted/20 p-2",children:c.jsxs(ue,{className:"w-full",onClick:()=>{s(),h(!1)},size:"sm",type:"button",children:[c.jsx(wn,{className:"size-3"}),"Add connection"]})})]}):null]})}function n9({onAddManual:e,onAddWithAi:t}){const[i,s]=E.useState(!1),a=E.useRef(null);E.useEffect(()=>{if(!i)return;function u(h){a.current&&h.target instanceof Node&&!a.current.contains(h.target)&&s(!1)}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[i]);function o(u){s(!1),u()}return c.jsxs("div",{className:"relative",ref:a,children:[c.jsxs(ue,{"aria-label":"Add database connection",onClick:()=>s(u=>!u),size:"sm",type:"button",children:[c.jsx(wn,{className:"size-3.5"}),"Add"]}),i?c.jsxs("div",{className:"absolute right-0 top-9 z-50 w-56 overflow-hidden rounded-lg border border-border bg-card shadow-lg",children:[c.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:[c.jsx(Es,{className:"size-3.5 text-muted-foreground"}),"Add connection"]}),c.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:[c.jsx(Ka,{className:"size-3.5 text-muted-foreground"}),"Add with AI"]})]}):null]})}function zC({id:e,className:t}){return e==="codex"?c.jsx(tu,{className:me("text-foreground",t)}):e==="gemini"?c.jsx(YO,{className:me("text-[#1A73E8]",t)}):c.jsx(al,{className:me("text-[#D97757]",t)})}function sr({className:e}){const{provider:t}=Ns();return c.jsx(zC,{id:t?.id,className:e})}function s9({onAsk:e,label:t,className:i}){const{provider:s}=Ns(),a=t??`Ask ${s?.label??"Claude"}`;return c.jsx("button",{"aria-label":a,className:me("flex size-6 items-center justify-center rounded-md opacity-0 transition-all duration-150 hover:bg-muted group-hover:opacity-100",i),onClick:e,title:a,type:"button",children:c.jsx(zC,{id:s?.id,className:"size-3.5"})})}function IC({items:e,label:t="More actions",className:i}){const[s,a]=E.useState(!1),[o,u]=E.useState({top:0,right:0}),h=E.useRef(null),m=E.useRef(null);function f(){const p=h.current?.getBoundingClientRect();p&&u({top:p.bottom+4,right:window.innerWidth-p.right}),a(b=>!b)}return E.useEffect(()=>{if(!s)return;function p(x){const y=x.target;h.current?.contains(y)||m.current?.contains(y)||a(!1)}function b(x){x.key==="Escape"&&a(!1)}const v=()=>a(!1);return document.addEventListener("mousedown",p),document.addEventListener("keydown",b),window.addEventListener("scroll",v,!0),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",b),window.removeEventListener("scroll",v,!0)}},[s]),c.jsxs(c.Fragment,{children:[c.jsx("button",{"aria-label":t,className:me("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",s&&"opacity-100",i),onClick:f,ref:h,title:t,type:"button",children:c.jsx(iE,{className:"size-3.5"})}),s?su.createPortal(c.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=>c.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?c.jsx("span",{className:"text-muted-foreground",children:p.icon}):null,p.label]},p.label))}),document.body):null]})}function r9({connection:e,sample:t}){const{sendToAgent:i}=Ns(),{success:s,error:a}=Oi(),o=t.columns.map(p=>p.name);function u(p){i({prompt:kL(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),s(`Copied ${b}.`)}catch(v){a(v instanceof Error?v.message:String(v))}}function m(p){const b=v=>{const x=yp(v);return/[",\n]/.test(x)?`"${x.replace(/"/g,'""')}"`:x};return`${o.join(",")}
94
+ ${o.map(v=>b(p[v])).join(",")}`}function f(p){const b=x=>x==null?"NULL":typeof x=="number"||typeof x=="boolean"?String(x):`'${(typeof x=="object"?JSON.stringify(x):String(x)).replace(/'/g,"''")}'`,v=o.map(x=>b(p[x])).join(", ");return`INSERT INTO ${t.table} (${o.join(", ")}) VALUES (${v});`}return t.columns.length===0?c.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"This table has no columns."}):c.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:c.jsxs("table",{className:"w-max min-w-full border-collapse text-left font-mono text-[11px]",children:[c.jsx("thead",{className:"sticky top-0 z-10 bg-card",children:c.jsxs("tr",{className:"border-b border-border",children:[t.columns.map(p=>c.jsxs("th",{className:"whitespace-nowrap px-3 py-2 font-semibold text-foreground",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[p.primaryKey?c.jsx(t4,{className:"size-3 text-amber-500"}):null,p.name]}),c.jsx("span",{className:"block text-[10px] font-normal text-muted-foreground",children:p.dataType})]},p.name)),c.jsx("th",{className:"w-16 px-2 py-2"})]})}),c.jsxs("tbody",{children:[t.rows.map((p,b)=>c.jsxs("tr",{className:"group border-b border-border/60 hover:bg-muted/40",children:[t.columns.map(v=>c.jsx("td",{className:"max-w-[320px] truncate px-3 py-1 align-top text-muted-foreground",title:yp(p[v.name]),children:yp(p[v.name])},v.name)),c.jsx("td",{className:"px-2 py-1 align-top",children:c.jsxs("div",{className:"flex items-center justify-end gap-0.5",children:[c.jsx(s9,{label:"Ask AI about this row",onAsk:()=>u(p)}),c.jsx(IC,{label:"Row actions",items:[{label:"Copy as JSON",icon:c.jsx(rA,{className:"size-3.5"}),onSelect:()=>{h(JSON.stringify(p,null,2),"row as JSON")}},{label:"Copy as CSV",icon:c.jsx(jA,{className:"size-3.5"}),onSelect:()=>{h(m(p),"row as CSV")}},{label:"Copy as SQL INSERT",icon:c.jsx(Es,{className:"size-3.5"}),onSelect:()=>{h(f(p),"INSERT statement")}}]})]})})]},b)),t.rows.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:t.columns.length+1,className:"px-3 py-6 text-center text-muted-foreground",children:"No rows."})}):null]})]})})}function yp(e){return e==null?"NULL":typeof e=="object"?JSON.stringify(e):String(e)}function a9(){const[e,t]=E.useState([]),[i,s]=E.useState(!0),[a,o]=E.useState(null),u=E.useCallback(async()=>{s(!0),o(null);try{t(await xM())}catch(h){o(h instanceof Error?h.message:String(h))}finally{s(!1)}},[]);return E.useEffect(()=>{u()},[u]),{connections:e,loading:i,error:a,refresh:u}}const o9=[50,100,500,1e3];function l9(e){const[t,i]=E.useState([]),[s,a]=E.useState(null),[o,u]=E.useState(null),[h,m]=E.useState(null),[f,p]=E.useState(null),[b,v]=E.useState(!1),[x,y]=E.useState(!1),[S,k]=E.useState(100),[N,T]=E.useState(0);E.useEffect(()=>{T(0)},[e,s]),E.useEffect(()=>{if(i([]),a(null),u(null),m(null),p(null),!e)return;let M=!1;return v(!0),kM(e).then($=>{M||(i($),a($[0]?.qualifiedName??null))}).catch($=>{M||m($ instanceof Error?$.message:String($))}).finally(()=>{M||v(!1)}),()=>{M=!0}},[e]),E.useEffect(()=>{if(u(null),p(null),!e||!s)return;let M=!1;return y(!0),CM(e,s,S,N).then($=>{M||u($)}).catch($=>{M||p($ instanceof Error?$.message:String($))}).finally(()=>{M||y(!1)}),()=>{M=!0}},[e,s,S,N]);const R=N>0,A=o?o.rowCount===S:!1;function O(M){k(M),T(0)}function H(){A&&T(M=>M+S)}function L(){T(M=>Math.max(0,M-S))}return{tables:t,selectedTable:s,setSelectedTable:a,sample:o,tablesError:h,rowsError:f,loadingTables:b,loadingRows:x,limit:S,offset:N,canPrev:R,canNext:A,changePageSize:O,nextPage:H,prevPage:L}}function c9(){const{connections:e,loading:t,error:i,refresh:s}=a9(),{error:a,success:o}=Oi(),{sendToAgent:u}=Ns(),[h,m]=E.useState(null),[f,p]=E.useState(null);function b(){u({prompt:wL,source:{type:"database-setup",label:"Add a database"},label:"Help me connect a database, one step at a time."})}E.useEffect(()=>{if(e.length===0){m(null);return}m(y=>y&&e.some(S=>S.name===y)?y:e[0].name)},[e]);async function v(y){try{await EM(y),o(`Removed connection "${y}".`),await s()}catch(S){a(S instanceof Error?S.message:String(S))}}function x(y){p({mode:"edit",target:y})}return c.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[c.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Es,{className:"size-4 text-muted-foreground"}),c.jsx("span",{className:"text-sm font-semibold",children:"Databases"}),t&&e.length===0?c.jsx(Di,{className:"size-3.5 animate-spin text-muted-foreground"}):null]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(i9,{connections:e,selected:h,onSelect:m,onAdd:()=>p({mode:"add"}),onEdit:x,onRemove:y=>{v(y)}}),c.jsx(n9,{onAddManual:()=>p({mode:"add"}),onAddWithAi:b})]})]}),c.jsx("div",{className:"min-h-0 flex-1",children:i?c.jsx("div",{className:"p-4",children:c.jsx(ht,{variant:"muted",className:"border-destructive/40 text-destructive",children:i})}):h?c.jsx(u9,{connection:h}):c.jsx(d9,{onAdd:()=>p({mode:"add"}),onAddWithAi:b})}),f?c.jsx(J7,{initial:f.mode==="edit"?f.target:void 0,onClose:()=>p(null),onSaved:s}):null]})}function u9({connection:e}){const{tables:t,selectedTable:i,setSelectedTable:s,sample:a,tablesError:o,rowsError:u,loadingTables:h,loadingRows:m,limit:f,offset:p,canPrev:b,canNext:v,changePageSize:x,nextPage:y,prevPage:S}=l9(e);return c.jsxs("div",{className:"flex h-full min-h-0",children:[c.jsxs("div",{className:"flex w-56 shrink-0 flex-col border-r border-border",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[c.jsx(eM,{className:"size-4 text-muted-foreground"}),c.jsx("span",{className:"text-sm font-semibold",children:"Tables"}),c.jsx(qe,{variant:"outline",size:"small",children:t.length}),h?c.jsx(Di,{className:"size-3.5 animate-spin"}):null]}),o?c.jsx("div",{className:"p-3",children:c.jsx(ht,{variant:"muted",className:"border-destructive/40 text-destructive",children:o})}):c.jsxs("ul",{className:"min-h-0 flex-1 overflow-auto",children:[t.map(k=>c.jsx("li",{children:c.jsx("button",{type:"button",onClick:()=>s(k.qualifiedName),className:me("w-full truncate px-3 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-muted/50",k.qualifiedName===i&&"bg-muted/70 font-semibold"),children:k.qualifiedName})},k.qualifiedName)),!h&&t.length===0?c.jsx("li",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No tables."}):null]})]}),c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:i??"Select a table"}),a?c.jsxs("div",{className:"flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[c.jsx("span",{className:"tabular-nums",children:a.rowCount===0?"no rows":`rows ${p+1}–${p+a.rowCount}`}),c.jsx("select",{"aria-label":"Rows per page",className:"rounded-md border border-border bg-background px-1.5 py-0.5 text-[11px]",value:f,onChange:k=>x(Number(k.target.value)),children:o9.map(k=>c.jsxs("option",{value:k,children:[k," / page"]},k))}),c.jsx(ue,{size:"sm",variant:"outline",className:"h-6 px-2",onClick:S,disabled:!b,type:"button",children:"Prev"}),c.jsx(ue,{size:"sm",variant:"outline",className:"h-6 px-2",onClick:y,disabled:!v,type:"button",children:"Next"})]}):null]}),u?c.jsx("div",{className:"p-4",children:c.jsx(ht,{variant:"muted",className:"border-destructive/40 text-destructive",children:u})}):m?c.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[c.jsx(Di,{className:"mr-2 size-4 animate-spin"}),"Loading rows…"]}):a?c.jsx(r9,{connection:e,sample:a}):c.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:"Pick a table to sample its rows."})]})]})}function d9({onAdd:e,onAddWithAi:t}){return c.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:c.jsxs("div",{className:"max-w-sm",children:[c.jsx(Es,{className:"mx-auto size-8 text-muted-foreground/50"}),c.jsx("p",{className:"mt-3 text-sm font-medium",children:"No connections yet"}),c.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' ",c.jsx("code",{children:".env"})," files."]}),c.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2",children:[c.jsxs(ue,{size:"sm",onClick:e,type:"button",children:[c.jsx(wn,{}),"Add connection"]}),c.jsxs(ue,{size:"sm",variant:"outline",onClick:t,type:"button",children:[c.jsx(Ka,{}),"Add with AI"]})]})]})})}function h9({incident:e}){const{error:t}=Oi(),{sendToAgent:i}=Ns(),[s,a]=E.useState(!1);async function o(){a(!0);try{const{prompt:u}=await TM(e.id);i({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 c.jsxs("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[c.jsxs("div",{className:"shrink-0 border-b border-border px-4 py-3",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(qe,{variant:e.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:e.level}),c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:e.service}),e.count>1?c.jsxs(qe,{variant:"outline",size:"small",children:["×",e.count]}):null]}),c.jsxs(ue,{onClick:()=>{o()},disabled:s,size:"sm",variant:"outline",children:[c.jsx(sr,{className:"size-3.5"}),s?"Sending…":"Fix with AI"]})]}),c.jsx("p",{className:"mt-1.5 break-words font-mono text-xs text-foreground",children:e.title}),e.file?c.jsxs("p",{className:"mt-1 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[c.jsx(rE,{className:"size-3.5"}),e.file,e.line?`:${e.line}`:""]}):null,c.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()]})]}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[c.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Log excerpt"}),c.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(`
95
+ `)}),c.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 AS(e){return[...e].sort((t,i)=>t.lastSeen<i.lastSeen?1:t.lastSeen>i.lastSeen?-1:i.id-t.id)}function f9(){const[e,t]=E.useState([]),[i,s]=E.useState(!1),[a,o]=E.useState(null),u=E.useCallback(h=>{t(m=>AS([...m.filter(f=>f.id!==h.id),h]))},[]);return E.useEffect(()=>{let h=!0;NM().then(f=>{h&&t(AS(f))}).catch(f=>{h&&o(f instanceof Error?f.message:String(f))});const m=new EventSource("/api/errors/stream");return m.addEventListener("open",()=>s(!0)),m.addEventListener("error",()=>s(!1)),m.addEventListener("incident",f=>{try{const p=JSON.parse(f.data);u(p)}catch{}}),()=>{h=!1,m.close()}},[u]),{incidents:e,connected:i,error:a}}function m9(){const{incidents:e,connected:t,error:i}=f9(),[s,a]=E.useState(null);E.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=E.useMemo(()=>e.find(u=>u.id===s)??null,[e,s]);return c.jsxs("div",{className:"flex h-full min-h-0 bg-card/85",children:[c.jsxs("div",{className:"flex w-72 shrink-0 flex-col border-r border-border",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Cg,{className:"size-4 text-muted-foreground"}),c.jsx("span",{className:"text-sm font-semibold",children:"Incidents"}),c.jsx(qe,{variant:"outline",size:"small",children:e.length})]}),c.jsx(qe,{variant:"outline",size:"small",icon:c.jsx("span",{className:me("inline-block size-1.5 rounded-full",t?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:t?"live":"reconnecting…"})]}),c.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border overflow-auto",children:e.map(u=>c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>a(u.id),className:me("flex w-full flex-col gap-1 px-3 py-2 text-left transition-colors hover:bg-muted/50",u.id===s&&"bg-muted/70"),children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"truncate font-mono text-[11px] font-semibold",children:u.service}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.count>1?c.jsxs(qe,{variant:"outline",size:"small",children:["×",u.count]}):null,c.jsx(qe,{variant:u.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:u.level})]})]}),c.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:u.title}),c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:new Date(u.lastSeen).toLocaleTimeString()})]})},u.id))})]}),c.jsx("div",{className:"min-h-0 min-w-0 flex-1",children:i?c.jsx("div",{className:"p-4",children:c.jsxs(ht,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load incidents: ",i]})}):o?c.jsx(h9,{incident:o}):c.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:c.jsxs("div",{className:"max-w-sm",children:[c.jsx(Cg,{className:"mx-auto size-8 text-muted-foreground/50"}),c.jsx("p",{className:"mt-3 text-sm font-medium",children:"No incidents yet"}),c.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."})]})})})]})}const p9={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:i="bottom",className:s}){return c.jsxs("span",{className:me("group/tt relative inline-flex",s),children:[t,c.jsx("span",{role:"tooltip",className:me("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",p9[i]),children:e})]})}function In({className:e,...t}){return c.jsx("label",{className:me("grid gap-1.5 text-xs font-medium text-muted-foreground",e),...t})}const Gn='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>',Kn='</title><path d="',Wn='"/></svg>',g9={title:".NET",slug:"dotnet",get svg(){return Gn+".NET"+Kn+this.path+Wn},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"}},b9={title:"Bun",slug:"bun",get svg(){return Gn+"Bun"+Kn+this.path+Wn},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"},_9={title:"Deno",slug:"deno",get svg(){return Gn+"Deno"+Kn+this.path+Wn},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"}},v9={title:"Docker",slug:"docker",get svg(){return Gn+"Docker"+Kn+this.path+Wn},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"},x9={title:"Go",slug:"go",get svg(){return Gn+"Go"+Kn+this.path+Wn},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"},y9={title:"Node.js",slug:"nodedotjs",get svg(){return Gn+"Node.js"+Kn+this.path+Wn},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"},S9={title:"npm",slug:"npm",get svg(){return Gn+"npm"+Kn+this.path+Wn},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"},w9={title:"pnpm",slug:"pnpm",get svg(){return Gn+"pnpm"+Kn+this.path+Wn},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"},E9={title:"Python",slug:"python",get svg(){return Gn+"Python"+Kn+this.path+Wn},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/"},MS={title:"Rust",slug:"rust",get svg(){return Gn+"Rust"+Kn+this.path+Wn},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"}},k9={title:"Vite",slug:"vite",get svg(){return Gn+"Vite"+Kn+this.path+Wn},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"},C9={title:"Yarn",slug:"yarn",get svg(){return Gn+"Yarn"+Kn+this.path+Wn},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 N9(e){const t=e.toLowerCase();return/\bvite\b/.test(t)?an.vite:/\bcargo\s+/.test(t)?an.cargo:/\brustc\b/.test(t)?an.rust:/\bdotnet\b/.test(t)?an.dotnet:/\bdocker(?:\s+compose|-compose|\s+)/.test(t)?an.docker:/\bpython3?\b|\buvicorn\b|\bfastapi\b/.test(t)?an.python:/\bgo\s+(run|test|build)\b|\bair\b/.test(t)?an.go:/\bbun\b/.test(t)?an.bun:/\bdeno\b/.test(t)?an.deno:/\bpnpm\b/.test(t)?an.pnpm:/\byarn\b/.test(t)?an.yarn:/\bnpm\b/.test(t)?an.npm:/\bnode\b/.test(t)?an.node:an.generic}const an={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 zb({command:e,compact:t}){const i=N9(e),s=T9[i.kind];return c.jsx("span",{"aria-label":`${i.label} process`,className:me("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",s?"border-border":"border-border bg-muted text-muted-foreground dark:bg-zinc-100 dark:text-zinc-700"),style:s?{color:`#${s.hex}`}:void 0,title:i.label,children:s?c.jsx("svg",{"aria-hidden":"true",className:t?"size-3.5":"size-4",fill:"currentColor",role:"img",viewBox:"0 0 24 24",children:c.jsx("path",{d:s.path})}):c.jsx(pE,{className:t?"size-3.5":"size-4"})})}const T9={bun:b9,cargo:MS,deno:_9,dotnet:g9,docker:v9,generic:null,go:x9,node:y9,npm:S9,pnpm:w9,python:E9,rust:MS,vite:k9,yarn:C9},A9=[{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"}],RS=[{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 M9({result:e}){const t=[...e.stdout,...e.stderr].slice(0,4);return c.jsxs(ht,{variant:e.ok?"default":"destructive",children:[c.jsx("div",{className:"font-medium",children:e.ok?"Command test passed":"Command test failed"}),c.jsx("div",{className:"mt-1 text-xs",children:e.message}),t.length?c.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(`
96
+ `)}):null]})}function Ib({active:e,baseUrl:t,compact:i=!1,onRefresh:s,onStarted:a,restartAction:o,solidStart:u=!1,targetLabel:h}){return e?c.jsxs(c.Fragment,{children:[c.jsx(Sp,{compact:i,intent:"restart",icon:c.jsx(hE,{}),label:"Restart",action:o,targetLabel:h,url:`${t}/restart`,onRefresh:s,onSuccess:a}),c.jsx(Sp,{compact:i,intent:"stop",icon:c.jsx(Oh,{}),label:"Stop",targetLabel:h,url:`${t}/stop`,onRefresh:s})]}):c.jsx(Sp,{compact:i,intent:u?"startSolid":"start",icon:c.jsx(jh,{}),label:"Start",targetLabel:h,url:`${t}/start`,onRefresh:s,onSuccess:a})}function ph(e,t,i){const s=i instanceof Error?i.message:String(i);return`${e} failed for ${t}: ${s}`}function Sp({action:e,compact:t=!1,intent:i="neutral",icon:s,label:a,targetLabel:o,url:u,onRefresh:h,onSuccess:m}){const[f,p]=E.useState(!1),[b,v]=E.useState(null),{error:x,success:y}=Oi();async function S(N={}){p(!0);try{e?await e():await cn(u,N),y(`${a} requested for ${o}.`),await h(),v(null),m?.()}catch(T){T instanceof gE?v(T.conflict):x(ph(a,o,T))}finally{p(!1)}}const k=c.jsxs(ue,{"aria-label":a,className:`${j9[i]} ${t?"size-7":""}`.trim(),disabled:f,onClick:()=>S(),size:t?"icon":"sm",variant:"outline",children:[s,t?null:a]});return c.jsxs(c.Fragment,{children:[t?c.jsx(Qo,{label:a,children:k}):k,b?c.jsx(R9,{busy:f,conflict:b,onCancel:()=>v(null),onKillAndStart:()=>S({strategy:"killHolder"}),targetLabel:o}):null]})}function R9({busy:e,conflict:t,onCancel:i,onKillAndStart:s,targetLabel:a}){const o=t.holder,u=`http://localhost:${t.port}/`;return c.jsx(rr,{icon:c.jsx(dM,{}),onClose:e?()=>{}:i,title:`Port ${t.port} is already in use`,children:c.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[c.jsxs("p",{children:[c.jsx("span",{className:"font-medium",children:a})," wants port"," ",c.jsx("span",{className:"font-mono",children:t.port}),", but it's already held by:"]}),c.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})`:""}
97
+ ${o.command}`:"unknown process"}),c.jsxs("div",{className:"flex flex-wrap justify-end gap-2 pt-2",children:[c.jsx(ue,{onClick:i,size:"sm",type:"button",variant:"outline",disabled:e,children:"Cancel"}),c.jsxs(ue,{onClick:()=>window.open(u,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",disabled:e,children:[c.jsx(W0,{}),"Open in browser"]}),c.jsx(ue,{className:"border-red-600 bg-red-600 text-white hover:bg-red-700",disabled:e||!o,onClick:s,size:"sm",type:"button",children:"Stop holder & start"})]})]})})}const j9={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 D9({cwd:e,onRefresh:t,onSaved:i,initialService:s}){const{error:a,success:o}=Oi(),u=!!s,[h,m]=E.useState(s?.kind??"local"),[f,p]=E.useState(s?.name??""),[b,v]=E.useState(s?.command??""),[x,y]=E.useState(s?.cwd??e),[S,k]=E.useState(s?.port?String(s.port):""),[N,T]=E.useState(s?.description??""),[R,A]=E.useState(s?.composeFile??""),[O,H]=E.useState(s?.composeService??""),[L,M]=E.useState(s?.host??""),[$,P]=E.useState(null),[F,Z]=E.useState(!1);E.useEffect(()=>{P(null)},[b,x,S,h]);function K(){p(""),v(""),y(e),k(""),T(""),A(""),H(""),M(""),P(null)}async function Q(D){D.preventDefault();try{const Y={name:f,kind:h,cwd:x,port:S,description:N};(h==="local"||h==="ssh")&&(Y.command=b),h==="docker-compose"&&(Y.composeFile=R,Y.composeService=O),h==="ssh"&&(Y.host=L),await cn("/api/services",Y),u||K(),o(u?`${f} updated.`:`${f} added.`),await t(),i?.()}catch(Y){a(ph(u?"Update service":"Add service",f||"service",Y))}}async function q(){if(!b.trim()){a("Test command failed for service: command is required.");return}Z(!0);try{P(await JM({command:b,cwd:x,port:S}))}catch(D){a(ph("Test command",f||"service",D))}finally{Z(!1)}}return{editing:u,kind:h,setKind:m,name:f,setName:p,command:b,setCommand:v,formCwd:x,setFormCwd:y,port:S,setPort:k,description:N,setDescription:T,composeFile:R,setComposeFile:A,composeService:O,setComposeService:H,host:L,setHost:M,testResult:$,testing:F,submit:Q,testCommand:q}}function jS({cwd:e,onRefresh:t,onSaved:i,initialService:s}){const{editing:a,kind:o,setKind:u,name:h,setName:m,command:f,setCommand:p,formCwd:b,setFormCwd:v,port:x,setPort:y,description:S,setDescription:k,composeFile:N,setComposeFile:T,composeService:R,setComposeService:A,host:O,setHost:H,testResult:L,testing:M,submit:$,testCommand:P}=D9({cwd:e,onRefresh:t,onSaved:i,initialService:s}),F=RS.find(q=>q.value===o),Z=o==="local"&&f.trim().length>0&&b.trim().length>0,K="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 c.jsxs("form",{className:"grid gap-3",onSubmit:$,children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[c.jsxs("fieldset",{className:`${K} sm:col-span-2`,children:[c.jsx("legend",{className:Q,children:"Step 1 · Service kind"}),c.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:RS.map(q=>c.jsx(ue,{className:"justify-center",disabled:a,onClick:()=>u(q.value),size:"sm",type:"button",variant:o===q.value?"default":"outline",children:q.label},q.value))}),c.jsx("p",{className:"text-[11px] text-muted-foreground",children:F.hint})]}),c.jsxs("div",{className:"grid gap-3 sm:col-start-1 sm:row-start-2 sm:self-start",children:[c.jsxs("fieldset",{className:K,children:[c.jsx("legend",{className:Q,children:"Step 2 · Identity"}),c.jsxs(In,{children:["Name",c.jsx(et,{className:"h-8 text-sm",name:"name",onChange:q=>m(q.target.value),placeholder:"backend",readOnly:a,required:!0,value:h}),a?c.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Name is the service key and can't be changed here."}):null]}),c.jsxs(In,{children:["Description",c.jsx(et,{className:"h-8 text-sm",name:"description",onChange:q=>k(q.target.value),placeholder:"API server",value:S})]})]}),c.jsxs("fieldset",{className:K,children:[c.jsx("legend",{className:Q,children:"Step 4 · Networking (optional)"}),c.jsxs(In,{children:["Port",c.jsx(et,{className:"h-8 text-sm",inputMode:"numeric",name:"port",onChange:q=>y(q.target.value),placeholder:"3001",value:x})]})]})]}),o==="local"?c.jsxs("fieldset",{className:`${K} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[c.jsx("legend",{className:Q,children:"Step 3 · Local command"}),c.jsx("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-4",children:A9.map(q=>c.jsxs(ue,{className:"justify-start gap-1.5",onClick:()=>{p(q.command),k(q.description)},size:"sm",type:"button",variant:"outline",children:[c.jsx(zb,{command:q.badgeCommand??q.command,compact:!0}),c.jsx("span",{className:"truncate",children:q.label})]},q.label))}),c.jsxs(In,{children:["Command",c.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})]}),c.jsxs(In,{children:["Working Directory",c.jsx(et,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>v(q.target.value),required:!0,value:b})]})]}):null,o==="docker-compose"?c.jsxs("fieldset",{className:`${K} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[c.jsx("legend",{className:Q,children:"Step 3 · Docker Compose target"}),c.jsxs(In,{children:["Compose Service",c.jsx(et,{className:"h-8 font-mono text-sm",name:"composeService",onChange:q=>A(q.target.value),placeholder:"api",required:!0,value:R})]}),c.jsxs(In,{children:["Compose File (optional)",c.jsx(et,{className:"h-8 font-mono text-sm",name:"composeFile",onChange:q=>T(q.target.value),placeholder:"docker-compose.yml",value:N})]}),c.jsxs(In,{children:["Working Directory (where compose file lives)",c.jsx(et,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>v(q.target.value),required:!0,value:b})]})]}):null,o==="ssh"?c.jsxs("fieldset",{className:`${K} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[c.jsx("legend",{className:Q,children:"Step 3 · SSH connection"}),c.jsxs(In,{children:["SSH Host (alias from ~/.ssh/config)",c.jsx(et,{className:"h-8 font-mono text-sm",name:"host",onChange:q=>H(q.target.value),placeholder:"devbox",required:!0,value:O})]}),c.jsxs(In,{children:["Remote Command",c.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})]}),c.jsxs(In,{children:["Remote Working Directory",c.jsx(et,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>v(q.target.value),placeholder:"/srv/app",required:!0,value:b})]}),c.jsxs(ht,{variant:"muted",children:[c.jsx("div",{className:"font-medium",children:"SSH key handling"}),c.jsxs("div",{className:"mt-1 text-xs",children:["NoMoreIDE never stores key files. Add a ",c.jsxs("code",{children:["Host ",O||"&lt;alias&gt;"]})," entry to",c.jsx("code",{children:" ~/.ssh/config"})," with ",c.jsx("code",{children:"HostName"}),", ",c.jsx("code",{children:"User"}),", and"," ",c.jsx("code",{children:"IdentityFile ~/.ssh/your-key.pem"})," (chmod 0600). Make sure"," ",c.jsx("code",{children:"ssh-agent"})," is running or your key is loaded (",c.jsx("code",{children:"ssh-add ~/.ssh/your-key.pem"}),"). NoMoreIDE will run"," ",c.jsxs("code",{children:["ssh ",O||"&lt;alias&gt;"]})," using that config."]})]})]}):null]}),L?c.jsx(M9,{result:L}):null,c.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[o==="local"?c.jsxs(ue,{disabled:M||!Z,onClick:P,type:"button",variant:"outline",children:[c.jsx(pE,{}),M?"Testing...":"Test Command"]}):null,c.jsx(ue,{type:"submit",children:a?"Save Service":"Add Service"})]})]})}function PC({initialName:e="",initialServices:t=[],onSaved:i,onRefresh:s,originalName:a,services:o,submitLabel:u="Save Group"}){const{error:h,success:m}=Oi();async function f(p){p.preventDefault();const b=p.currentTarget,v=new FormData(b),x=String(v.get("name")??""),y=v.getAll("services").map(S=>String(S)).filter(Boolean);try{await cn("/api/bundles",{name:x,originalName:a,services:y.join(",")}),b.reset(),m(`${x} group saved.`),await s(),i?.()}catch(S){h(ph("Save group",x||"group",S))}}return c.jsxs("form",{className:"grid gap-2.5",onSubmit:f,children:[c.jsxs(In,{children:["Group name",c.jsx(et,{className:"h-8 text-sm",defaultValue:e,name:"name",placeholder:"full-stack",required:!0})]}),c.jsxs("fieldset",{className:"grid gap-1.5",children:[c.jsx("legend",{className:"text-xs font-medium",children:"Services"}),o.length?o.map(p=>c.jsxs("label",{className:"flex items-center gap-2 overflow-hidden rounded-md border border-border px-2.5 py-1.5 text-sm",children:[c.jsx("input",{className:"size-4 shrink-0 accent-primary",defaultChecked:t.includes(p.name),name:"services",type:"checkbox",value:p.name}),c.jsx(zb,{command:p.command??"",compact:!0}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block truncate text-sm font-medium",children:p.name}),c.jsx("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:p.command??p.kind??""})]})]},p.name)):c.jsx(ht,{variant:"muted",children:"All services are already grouped, or none registered."})]}),c.jsx(ue,{className:"h-8",disabled:!o.length,type:"submit",children:u})]})}function gh({label:e}){return c.jsx(ht,{variant:"muted",className:"m-4 text-center",children:e})}const O9=900*1e3,xc=12,wp=200;function L9({events:e}){const[t,i]=E.useState(null),[s,a]=E.useState(null),{rows:o,windowStart:u,windowEnd:h}=E.useMemo(()=>B9(e),[e]),m=t?o.find(f=>f.service===t)??null:null;return c.jsxs(c.Fragment,{children:[c.jsxs(or,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[c.jsxs(lr,{className:"border-b border-border px-3 py-2",children:[c.jsxs(cr,{className:"flex items-center gap-2",children:[c.jsx(Ia,{className:"size-3.5"}),"Runtime Monitor"]}),c.jsx(ra,{className:"text-xs",children:e.length===0?"No events yet":`${e.length} event${e.length===1?"":"s"} · last 15 min`})]}),c.jsx(ur,{className:"p-0",children:o.length===0?c.jsx(gh,{label:"No runtime timeline events yet."}):c.jsxs("div",{className:"divide-y divide-border",children:[o.map(f=>c.jsx(I9,{onClick:()=>i(f.service),row:f,windowEnd:h,windowStart:u},f.service)),c.jsxs("div",{className:"flex justify-between px-3 py-1.5 font-mono text-[10px] text-muted-foreground",children:[c.jsx("span",{children:bh(u)}),c.jsx("span",{children:"now"})]})]})})]}),m?c.jsx(rr,{icon:c.jsx(Ia,{}),onClose:()=>i(null),title:m.service,children:c.jsx(U9,{onSelect:a,row:m})}):null,s?c.jsx(rr,{icon:c.jsx(Ia,{}),onClose:()=>a(null),title:s.title,children:c.jsx(H9,{event:s})}):null]})}function B9(e){const t=Date.now(),i=t,s=t-O9;let a=e.filter(m=>{if(m.kind==="service.http")return!1;const f=new Date(m.timestamp).getTime();return!Number.isNaN(f)&&f>=s});a.length===0&&e.length>0?a=e.slice(-wp):a.length>wp&&(a=a.slice(-wp));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(i-s,1);return{rows:Array.from(o.entries()).map(([m,f])=>{const p=[...f].sort((T,R)=>T.timestamp.localeCompare(R.timestamp)),b=new Array(xc).fill(0),v=new Array(xc).fill(null);for(const T of p){const R=new Date(T.timestamp).getTime(),A=Math.max(s,Math.min(i,R)),O=Math.min(xc-1,Math.floor((A-s)/u*xc));b[O]+=1;const H=v[O];v[O]=z9(H,T.severity)}const x=p.filter(T=>T.severity==="error").length,y=p.filter(T=>T.severity==="warning").length,S=p.length-x-y,k=[...p].reverse().find(T=>T.severity!=="info")??null,N=x>0?"error":y>0?"warning":"info";return{service:m,events:p,errors:x,warnings:y,infos:S,buckets:b,bucketSeverity:v,lastNotable:k,worstSeverity:N}}).sort((m,f)=>{const p=v=>v.errors*1e3+v.warnings,b=p(f)-p(m);return b!==0?b:m.service.localeCompare(f.service)}),windowStart:s,windowEnd:i}}function z9(e,t){return e==="error"||t==="error"?"error":e==="warning"||t==="warning"?"warning":"info"}function I9({onClick:e,row:t,windowEnd:i,windowStart:s}){const a=Math.max(1,...t.buckets);return c.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:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("span",{className:me("size-2 shrink-0 rounded-full",UC(t.worstSeverity))}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",dir:"rtl",children:c.jsx("bdi",{children:t.service})}),t.errors>0?c.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?c.jsxs("span",{className:"rounded bg-amber-500/15 px-1 font-mono text-[10px] text-amber-500",children:[t.warnings,"W"]}):null,c.jsx(ia,{className:"size-3 text-muted-foreground"})]}),c.jsx("div",{className:"timeline-density mt-1.5 grid h-3 gap-px","data-testid":"timeline-density",style:{gridTemplateColumns:`repeat(${xc}, minmax(0, 1fr))`},children:t.buckets.map((o,u)=>c.jsx(P9,{count:o,max:a,severity:t.bucketSeverity[u]},u))}),t.lastNotable?c.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:t.lastNotable.detail??t.lastNotable.title}):c.jsxs("div",{className:"mt-1 truncate text-[10px] text-muted-foreground",children:[t.infos," info ",t.infos===1?"event":"events"]}),c.jsxs("div",{className:"mt-0.5 flex justify-between font-mono text-[9px] text-muted-foreground/60",children:[c.jsx("span",{children:bh(s)}),c.jsx("span",{children:bh(i)})]})]})}function P9({count:e,max:t,severity:i}){if(e===0)return c.jsx("span",{className:"rounded-sm bg-border/60"});const s=Math.min(1,.35+e/t*.65);return c.jsx("span",{className:me("rounded-sm",F9(i)),style:{opacity:s},title:`${e} event${e===1?"":"s"}`})}function U9({onSelect:e,row:t}){const i=[...t.events].sort((s,a)=>a.timestamp.localeCompare(s.timestamp));return c.jsxs("div",{className:"flex max-h-[480px] flex-col overflow-hidden",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2 text-xs text-muted-foreground",children:[c.jsxs("span",{children:[t.events.length," events"]}),c.jsx("span",{children:"·"}),c.jsxs("span",{children:[t.errors," error",t.errors===1?"":"s"]}),c.jsx("span",{children:"·"}),c.jsxs("span",{children:[t.warnings," warning",t.warnings===1?"":"s"]})]}),c.jsx("ul",{className:"min-h-0 divide-y divide-border overflow-auto",children:i.map(s=>c.jsx("li",{children:c.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(s),type:"button",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:me("size-2 shrink-0 rounded-full",UC(s.severity))}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",children:s.title}),c.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:bh(s.timestamp)})]}),s.detail?c.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:s.detail}):null]})},s.id))})]})}function H9({event:e}){const t=new Date(e.timestamp);return c.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:me("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",$9(e.severity)),children:e.severity}),c.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?c.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]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs text-muted-foreground",children:"When"}),c.jsx("div",{className:"font-mono text-xs",children:Number.isNaN(t.getTime())?e.timestamp:t.toLocaleString()})]}),e.detail?c.jsxs("div",{children:[c.jsx("div",{className:"text-xs text-muted-foreground",children:"Detail"}),c.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 UC(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-400"}function F9(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-500"}function $9(e){return e==="error"?"bg-red-600":e==="warning"?"bg-amber-600":"bg-zinc-700"}function bh(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 V9({health:e}){if(!e)return null;const t=e.processTree,i=e.status==="healthy"||e.status==="unknown"?void 0:W9(e.summary);return c.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:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsxs("span",{className:me("inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2.5 font-medium",q9(e.status)),children:[c.jsx("span",{className:"inline-flex shrink-0",children:c.jsx(Ia,{className:"size-3"})}),c.jsx("span",{className:"whitespace-nowrap",children:e.status})]}),i?c.jsx("span",{className:"min-w-0 truncate",children:i}):null]}),t?c.jsxs("div",{className:"health-metrics flex min-w-max items-center gap-2 font-mono sm:justify-end",children:[c.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[c.jsx(xA,{className:"size-3"}),t.processCount," ",t.processCount===1?"process":"processes"]}),c.jsxs("span",{children:[K9(t.cpuPercent)," CPU"]}),c.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[c.jsx(d4,{className:"size-3"}),G9(t.rssMb)," RAM"]})]}):null]})}function q9(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 G9(e){return Number.isInteger(e)?`${e} MB`:`${e.toFixed(1)} MB`}function K9(e){return`${e.toFixed(1)}%`}function W9(e){return e.replace(/^Recent error log:\s*/i,"Recent stderr: ").replace(/:\s*\d+(?:\.\d+)? MB RSS\.?$/i,"").replace(/\s+RSS\.?$/i,"")}function Y9({ports:e}){const t=e.filter(s=>s.state==="occupied").length,i=e.filter(s=>s.state==="managed").length;return c.jsxs(or,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[c.jsxs(lr,{className:"border-b border-border px-3 py-2",children:[c.jsxs(cr,{className:"flex items-center gap-2",children:[c.jsx(g4,{className:"size-3.5"}),"Ports"]}),c.jsxs(ra,{className:"text-xs",children:[i," managed, ",t," occupied by other"]})]}),c.jsx(ur,{className:"p-0",children:e.length?c.jsx("div",{className:"divide-y divide-border",children:e.map(s=>c.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2 px-3 py-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"font-mono text-xs",children:[":",s.port]}),c.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:s.services.join(", ")||"Unassigned"}),s.urls[0]?c.jsx("div",{className:"truncate font-mono text-[10px] text-muted-foreground",children:s.urls[0]}):null]}),c.jsx(X9,{port:s})]},s.port))}):c.jsx(gh,{label:"No configured ports yet."})})]})}function X9({compact:e,port:t}){const i=t.state==="managed"?"managed":t.state==="occupied"?"occupied by other":"available",s=t.state==="managed"?"success":t.state==="occupied"?"warning":"outline";return c.jsx(qe,{className:me(e&&"max-w-36 truncate"),variant:s,children:i})}function Z9({onChange:e,value:t}){return c.jsxs("label",{className:"relative block",children:[c.jsx(U4,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),c.jsx(et,{"aria-label":"Search logs",className:"h-8 w-44 pl-7 text-xs",onChange:i=>e(i.target.value),placeholder:"Search logs",value:t})]})}function Q9({className:e,containerRef:t,emptyText:i,logs:s,query:a}){return c.jsx("div",{className:me("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:s.length?s.map((o,u)=>c.jsxs("div",{className:me("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:[c.jsx("span",{className:"text-muted-foreground dark:text-zinc-500",children:o.timestamp}),c.jsxs("span",{className:"whitespace-pre-wrap break-words",children:[o.stream==="stderr"?c.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,eB(o.text,a)]})]},`${o.timestamp}-${o.stream}-${u}`)):c.jsx("div",{className:"p-3 text-muted-foreground",children:i})})}function J9(e){return`${e.timestamp} ${e.stream} ${e.text}`}function eB(e,t){const i=t.trim();if(!i)return e;const s=e.toLowerCase(),a=i.toLowerCase(),o=[];let u=0,h=s.indexOf(a);for(;h!==-1;){h>u&&o.push(e.slice(u,h));const m=h+i.length;o.push(c.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=s.indexOf(a,u)}return u<e.length&&o.push(e.slice(u)),o}function DS(e){return`${e.kind}:${e.name}`}function tB(e,t=!1,i={}){const[s,a]=E.useState(),[o,u]=E.useState(),[h,m]=E.useState(e.kind==="source"),f=JSON.stringify(i);return E.useEffect(()=>{a(void 0),u(void 0);let p=!1;const b=async()=>{try{if(e.kind==="service"){const x=await vE(e.name,i);p||(a(x.logs),m(x.queryable),u(void 0))}else{const x=await bE(e.name,i);p||(a(x),m(!0),u(void 0))}}catch(x){p||u(x instanceof Error?x.message:String(x))}};b();const v=window.setInterval(b,t?1e3:2e3);return()=>{p=!0,window.clearInterval(v)}},[e.kind,e.name,t,f]),{logs:s,error:o,queryable:h}}const iB=[{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 HC({target:e,query:t,setQuery:i,streaming:s,setStreaming:a,hideStdout:o,setHideStdout:u,fill:h=!1,leading:m,trailing:f}){const p=e.kind==="source",[b,v]=E.useState(""),[x,y]=E.useState(""),[S,k]=E.useState(t);E.useEffect(()=>{const V=window.setTimeout(()=>k(t),300);return()=>window.clearTimeout(V)},[t]);const N=E.useMemo(()=>{const V={};b&&(V.since=b),x&&(V.level=x);const I=S.trim();return I&&(V.grep=I),V},[b,x,S]),{logs:T,error:R,queryable:A}=tB(e,s,N),O=p||A,H=E.useRef(null),L=E.useRef(!0),[M,$]=E.useState([]),[P,F]=E.useState(!1),Z=JSON.stringify(N);E.useEffect(()=>{$([])},[Z,e.kind,e.name]);const K=E.useMemo(()=>{const V=T??[];if(M.length===0)return V;const I=new Set(M.map(j=>j.cursor).filter(Boolean));return[...M,...V.filter(j=>!j.cursor||!I.has(j.cursor))]},[T,M]),Q=(M[0]??(T??[])[0])?.cursor;async function q(){if(!(!O||!Q||P)){F(!0),L.current=!1;try{const V={...N,before:Q,lines:200},I=e.kind==="source"?await bE(e.name,V):(await vE(e.name,V)).logs;I.length&&$(j=>{const W=new Set(j.map(oe=>oe.cursor).filter(Boolean));return[...I.filter(oe=>!oe.cursor||!W.has(oe.cursor)),...j]})}finally{F(!1)}}}const D=t.trim().toLowerCase(),Y=E.useMemo(()=>{let V=K;return o&&(V=V.filter(I=>I.stream==="stderr")),D&&(V=V.filter(I=>J9(I).toLowerCase().includes(D))),V},[K,o,D]);E.useEffect(()=>{const V=H.current;if(!V)return;const I=()=>{const j=V.scrollHeight-V.scrollTop-V.clientHeight;L.current=j<40};return I(),V.addEventListener("scroll",I,{passive:!0}),()=>V.removeEventListener("scroll",I)},[]),E.useEffect(()=>{if(!s||!L.current||Y.length===0)return;const V=H.current;V&&(V.scrollTop=V.scrollHeight)},[s,Y]);const X=T?D?`No log lines match "${t.trim()}".`:o?"No stderr output captured.":"No log entries.":"Loading…";return c.jsxs("div",{className:h?"flex h-full min-h-0 flex-col gap-2":"flex flex-col gap-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m,c.jsx(Z9,{onChange:i,value:t}),O?c.jsxs(c.Fragment,{children:[c.jsx("select",{"aria-label":"Time range",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:V=>v(V.target.value),value:b,children:iB.map(V=>c.jsx("option",{value:V.value,children:V.label},V.label))}),c.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:x,children:[c.jsx("option",{value:"",children:"All levels"}),c.jsx("option",{value:"warn",children:"Warnings+"}),c.jsx("option",{value:"error",children:"Errors"})]})]}):c.jsxs(OS,{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:[c.jsx(VA,{}),"Errors only"]}),c.jsxs(OS,{active:s,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(!s),children:[c.jsx(O4,{}),s?"Streaming":"Stream"]}),O&&Q?c.jsxs(ue,{disabled:P,onClick:()=>{q()},size:"sm",type:"button",variant:"outline",children:[c.jsx(Mh,{}),P?"Loading…":"Load older"]}):null,f?c.jsx("div",{className:"ml-auto flex items-center gap-2",children:f}):null]}),R?c.jsx("div",{className:"text-red-600",children:R}):null,c.jsx(Q9,{className:me("rounded border border-border/60",h?"min-h-0 flex-1":"max-h-80"),containerRef:H,emptyText:X,logs:Y,query:t})]})}function OS({active:e,activeClassName:t,children:i,onClick:s}){return c.jsx(ue,{"aria-pressed":e,className:e?t:void 0,onClick:s,size:"sm",type:"button",variant:"outline",children:i})}function nB(e,t){return e.kind===t.kind&&e.name===t.name}function sB({options:e,target:t,onChange:i,className:s}){const a=e.findIndex(u=>nB(u.target,t)),o=[...new Set(e.map(u=>u.group))];return c.jsx("select",{"aria-label":"Log source",className:s??"h-8 max-w-44 rounded-md border border-border bg-background px-2 text-xs",onChange:u=>i(e[Number(u.target.value)].target),value:String(a),children:o.map(u=>c.jsx("optgroup",{label:u,children:e.map((h,m)=>h.group===u?c.jsx("option",{value:String(m),children:h.label},`${h.group}:${h.label}`):null)},u))})}function rB({serviceName:e}){const[t,i]=E.useState(""),[s,a]=E.useState(!1),[o,u]=E.useState(!1),[h,m]=E.useState(!1),f=c.jsx(HC,{fill:!0,hideStdout:o,query:t,setHideStdout:u,setQuery:i,setStreaming:a,streaming:s,target:{kind:"service",name:e},trailing:c.jsxs(ue,{onClick:()=>m(p=>!p),size:"sm",type:"button",variant:"outline",children:[h?c.jsx(uE,{}):c.jsx(cE,{}),h?"Exit":"Expand"]})});return h?c.jsx(Pb,{onClose:()=>m(!1),title:`Logs — ${e}`,children:f}):c.jsx("div",{className:"h-[60vh] min-h-[24rem]",children:f})}function Pb({title:e,onClose:t,children:i,maxWidthClass:s="max-w-6xl"}){return E.useEffect(()=>{function a(o){o.key==="Escape"&&t()}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t]),su.createPortal(c.jsx("div",{className:"fixed inset-0 z-[1000] bg-black/40 p-4 sm:p-8",onMouseDown:t,children:c.jsxs("div",{"aria-modal":"true",className:`mx-auto flex h-full ${s} flex-col overflow-hidden rounded-lg border border-border bg-card text-xs shadow-xl`,onMouseDown:a=>a.stopPropagation(),role:"dialog",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[c.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e}),c.jsx(ue,{"aria-label":"Close logs",onClick:t,size:"icon",type:"button",variant:"ghost",children:c.jsx(kn,{})})]}),c.jsx("div",{className:"min-h-0 flex-1 p-3",children:i})]})}),document.body)}const aB={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 oB({onClose:e,onAdded:t}){const[i,s]=E.useState(""),[a,o]=E.useState("journald"),[u,h]=E.useState(""),[m,f]=E.useState(""),[p,b]=E.useState(""),[v,x]=E.useState(""),[y,S]=E.useState(""),[k,N]=E.useState(""),[T,R]=E.useState(),[A,O]=E.useState(!1);async function H(){O(!0),R(void 0);try{const L={name:i.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(),v.trim()&&(L.cwd=v.trim())):a==="journald"?(L.driver="journald",L.unit=y.trim(),u.trim()&&(L.host=u.trim())):a==="docker"&&(L.driver="docker",L.container=k.trim(),u.trim()&&(L.host=u.trim()));const M=await PM(L);t(M,L.name),e()}catch(L){R(L instanceof Error?L.message:String(L))}finally{O(!1)}}return c.jsx(rr,{icon:c.jsx(mE,{}),onClose:e,size:"md",title:"Add log source",children:c.jsxs("form",{className:"flex flex-col gap-3 p-4 text-xs",onSubmit:L=>{L.preventDefault(),H()},children:[c.jsx(er,{label:"Name",children:c.jsx(et,{autoFocus:!0,onChange:L=>s(L.target.value),placeholder:"PROD",value:i})}),c.jsxs(er,{label:"Type",children:[c.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:[c.jsx("option",{value:"journald",children:"systemd journal (journald)"}),c.jsx("option",{value:"docker",children:"Docker container"}),c.jsx("option",{value:"ssh",children:"Remote file (SSH)"}),c.jsx("option",{value:"file",children:"Local file"}),c.jsx("option",{value:"command",children:"Command"})]}),c.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:aB[a]})]}),a==="journald"||a==="docker"?c.jsx(er,{label:"Host (optional — leave blank to run locally)",children:c.jsx(et,{onChange:L=>h(L.target.value),placeholder:"jobjourney-prod (an alias from ~/.ssh/config)",value:u})}):null,a==="journald"?c.jsx(er,{label:"Unit",children:c.jsx(et,{onChange:L=>S(L.target.value),placeholder:"jobjourney",value:y})}):null,a==="docker"?c.jsx(er,{label:"Container",children:c.jsx(et,{onChange:L=>N(L.target.value),placeholder:"brainctl-api",value:k})}):null,a==="ssh"?c.jsx(er,{label:"Host",children:c.jsx(et,{onChange:L=>h(L.target.value),placeholder:"prod (an alias from ~/.ssh/config)",value:u})}):null,a==="file"||a==="ssh"?c.jsx(er,{label:a==="ssh"?"Remote path":"File path",children:c.jsx(et,{onChange:L=>f(L.target.value),placeholder:"/var/log/app/out.log",value:m})}):null,a==="command"?c.jsxs(c.Fragment,{children:[c.jsx(er,{label:"Command",children:c.jsx(et,{onChange:L=>b(L.target.value),placeholder:"kubectl logs -l app=myapp --tail 500",value:p})}),c.jsx(er,{label:"Working directory (optional)",children:c.jsx(et,{onChange:L=>x(L.target.value),placeholder:"/srv/app",value:v})})]}):null,T?c.jsx("div",{className:"text-red-600",children:T}):null,c.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[c.jsx(ue,{onClick:e,size:"sm",type:"button",variant:"outline",children:"Cancel"}),c.jsx(ue,{disabled:A||!i.trim(),size:"sm",type:"submit",children:A?"Saving…":"Add source"})]})]})})}function er({label:e,children:t}){return c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"font-medium text-muted-foreground",children:e}),t]})}const LS=4;function lB({services:e,initialService:t,onClose:i}){const[s,a]=E.useState([]),[o,u]=E.useState(!1),[h,m]=E.useState(()=>[0]),[f,p]=E.useState(()=>{const R=t?{kind:"service",name:t}:e[0]?{kind:"service",name:e[0]}:void 0;return R?{0:R}:{}}),b=E.useRef(1);E.useEffect(()=>{let R=!1;return IM().then(A=>{R||a(A)}),()=>{R=!0}},[]);const v=[...e.map(R=>({target:{kind:"service",name:R},label:R,group:"Services"})),...s.map(R=>({target:{kind:"source",name:R.name},label:R.name,group:"Log sources"}))],x=v.map(R=>R.target);function y(){if(h.length>=LS||x.length===0)return;const R=b.current++,A=new Set(Object.values(f).map(DS)),O=x.find(H=>!A.has(DS(H)))??x[0];m(H=>[...H,R]),p(H=>({...H,[R]:O}))}function S(R){m(A=>A.filter(O=>O!==R)),p(A=>{const O={...A};return delete O[R],O})}function k(R,A){p(O=>({...O,[R]:A}))}function N(R,A){a(R);const O=h[0];O!==void 0&&k(O,{kind:"source",name:A})}const T=c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{children:"Logs"}),c.jsxs(ue,{onClick:()=>u(!0),size:"sm",type:"button",variant:"outline",children:[c.jsx(wn,{}),"Add source"]}),c.jsxs(ue,{disabled:h.length>=LS||x.length===0,onClick:y,size:"sm",type:"button",variant:"outline",children:[c.jsx(wn,{}),"Add pane"]})]});return c.jsxs(c.Fragment,{children:[c.jsx(Pb,{maxWidthClass:"max-w-[1500px]",onClose:i,title:T,children:x.length===0?c.jsx("div",{className:"grid h-full place-items-center text-center text-muted-foreground",children:c.jsxs("div",{children:[c.jsx("p",{children:"No services or log sources yet."}),c.jsxs(ue,{className:"mt-2",onClick:()=>u(!0),size:"sm",type:"button",children:[c.jsx(wn,{}),"Add a log source"]})]})}):c.jsx("div",{className:me("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(R=>c.jsx(cB,{onChangeTarget:A=>k(R,A),onRemove:h.length>1?()=>S(R):void 0,options:v,target:f[R]??x[0]},R))})}),o?c.jsx(oB,{onAdded:N,onClose:()=>u(!1)}):null]})}function cB({options:e,target:t,onChangeTarget:i,onRemove:s}){const[a,o]=E.useState(""),[u,h]=E.useState(!0),[m,f]=E.useState(!1);return c.jsx("div",{className:"flex min-h-0 min-w-0 flex-col rounded-lg border border-border bg-background/60 p-2",children:c.jsx(HC,{fill:!0,hideStdout:m,leading:c.jsx(sB,{onChange:i,options:e,target:t}),query:a,setHideStdout:f,setQuery:o,setStreaming:h,streaming:u,target:t,trailing:s?c.jsx(ue,{"aria-label":"Remove pane",onClick:s,size:"icon",type:"button",variant:"ghost",children:c.jsx(kn,{})}):void 0})})}function uB({rows:e,revealAll:t,onAdd:i,onRemove:s,onUpdate:a}){return e.length===0?c.jsxs("div",{className:"text-muted-foreground",children:["No variables yet."," ",c.jsx("button",{className:"underline",onClick:i,type:"button",children:"Add one"}),"."]}):c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full font-mono text-[11px]",children:[c.jsx("thead",{className:"text-left text-muted-foreground",children:c.jsxs("tr",{children:[c.jsx("th",{className:"py-1 pr-3",children:"Key"}),c.jsx("th",{className:"py-1 pr-3",children:"Value"}),c.jsx("th",{className:"py-1 w-8"})]})}),c.jsx("tbody",{children:e.map((o,u)=>{const h=!o.reveal&&!t;return c.jsxs("tr",{className:"border-t border-border/40",children:[c.jsx("td",{className:"py-1 pr-3 align-top",children:c.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})}),c.jsx("td",{className:"py-1 pr-3 align-top",children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.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}),c.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?c.jsx(nE,{size:14}):c.jsx(Y0,{size:14})})]})}),c.jsx("td",{className:"py-1 align-top",children:c.jsx("button",{className:"text-muted-foreground hover:text-red-600",onClick:()=>s(u),type:"button",children:c.jsx(Yc,{size:14})})})]},u)})})]})})}function dB({serviceName:e,onClose:t,onPick:i}){const[s,a]=E.useState(),[o,u]=E.useState(),[h,m]=E.useState(!0),[f,p]=E.useState();E.useEffect(()=>{let x=!1;return m(!0),u(void 0),(async()=>{try{const y=await WM(e,f);x||a(y)}catch(y){x||u(y instanceof Error?y.message:String(y))}finally{x||m(!1)}})(),()=>{x=!0}},[e,f]);function b(x){if(x.kind==="directory"){p(x.relativePath);return}x.supported&&i(x.relativePath)}function v(){if(!s||s.isRoot)return;const x=s.relativePath,y=x.includes("/")?x.slice(0,x.lastIndexOf("/")):"";p(y||void 0)}return c.jsx(rr,{icon:c.jsx(Rh,{}),onClose:t,size:"lg",title:"Pick a config file",children:c.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsxs(ue,{disabled:!s||s.isRoot,onClick:v,size:"sm",type:"button",variant:"outline",children:[c.jsx(Mh,{})," Up"]}),c.jsx("code",{className:"truncate rounded bg-muted px-2 py-1 font-mono",children:s?.relativePath||"./"})]}),o?c.jsx("div",{className:"text-red-600",children:o}):h?c.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):!s||s.entries.length===0?c.jsx("div",{className:"text-muted-foreground",children:"Empty directory."}):c.jsx("div",{className:"max-h-[50vh] overflow-auto rounded border border-border/60",children:c.jsx("ul",{className:"divide-y divide-border/40",children:s.entries.map(x=>{const y=x.kind==="directory",S=y||x.supported;return c.jsx("li",{children:c.jsxs("button",{className:me("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(x),type:"button",children:[y?c.jsx(Ga,{size:14}):c.jsx(oE,{size:14}),c.jsx("span",{className:"flex-1 truncate font-mono",children:x.name}),!y&&x.format?c.jsx(qe,{size:"small",variant:"secondary",children:x.format}):null]})},x.relativePath)})})}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Only ",c.jsx("code",{children:".env*"}),", ",c.jsx("code",{children:"appsettings*.json"}),", and"," ",c.jsx("code",{children:"application*.yml"})," can be selected. Other files are shown disabled."]})]})})}function FC(e){if(!e.trim())return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function hB(e){const{error:t,success:i}=Oi(),[s,a]=E.useState([]),[o,u]=E.useState(),[h,m]=E.useState(),[f,p]=E.useState(!0),[b,v]=E.useState(!1),[x,y]=E.useState(!1),[S,k]=E.useState(!1),[N,T]=E.useState();E.useEffect(()=>{let P=!1;return p(!0),T(void 0),(async()=>{try{const F=await YM(e);if(P)return;a(F.files),F.files.length>0?u(Z=>Z??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 R=E.useCallback(async P=>{v(!0),T(void 0);try{const F=await $x(e,P),Z={path:F.path,relativePath:F.relativePath,format:F.format};F.format==="env"?m({info:Z,exists:F.exists,rows:F.entries.map(K=>({...K,reveal:!1}))}):m({info:Z,exists:F.exists,text:F.format==="json"?FC(F.content):F.content}),k(!1)}catch(F){T(F instanceof Error?F.message:String(F))}finally{v(!1)}},[e]);E.useEffect(()=>{o&&R(o)},[o,R]);function A(P,F){m(Z=>{if(!Z?.rows)return Z;const K=Z.rows.map((Q,q)=>q===P?{...Q,...F}:Q);return{...Z,rows:K}}),k(!0)}function O(){m(P=>P?.rows?{...P,rows:[...P.rows,{key:"",value:"",secret:!1,reveal:!0}]}:P),k(!0)}function H(P){m(F=>F?.rows?{...F,rows:F.rows.filter((Z,K)=>K!==P)}:F),k(!0)}function L(P){m(F=>F&&{...F,text:P}),k(!0)}async function M(){if(h){y(!0);try{if(h.info.format==="env"&&h.rows){const P=await XM(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}))}),i(`Saved ${P.entries.length} entries to ${P.relativePath}.`)}else if(h.text!==void 0){const P=await ZM(e,h.info.path,h.text);m({info:{path:P.path,relativePath:P.relativePath,format:P.format},exists:P.exists,text:P.content}),i(`Saved ${P.relativePath}.`)}k(!1)}catch(P){t(P instanceof Error?P.message:String(P))}finally{y(!1)}}}async function $(P){try{const F=await $x(e,P),Z={path:F.path,relativePath:F.relativePath,format:F.format};return a(K=>K.some(Q=>Q.path===Z.path)?K:[...K,Z]),u(Z.path),i(`Loaded ${Z.relativePath}.`),!0}catch(F){return t(F instanceof Error?F.message:String(F)),!1}}return{files:s,selectedPath:o,setSelectedPath:u,loaded:h,loadingList:f,loadingFile:b,saving:x,dirty:S,error:N,addRow:O,removeRow:H,updateRow:A,updateText:L,save:M,pickFile:$}}function fB({serviceName:e}){const{files:t,selectedPath:i,setSelectedPath:s,loaded:a,loadingList:o,loadingFile:u,saving:h,dirty:m,error:f,addRow:p,removeRow:b,updateRow:v,updateText:x,save:y,pickFile:S}=hB(e),[k,N]=E.useState(!1),[T,R]=E.useState(!1);return o?c.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):f&&!a?c.jsx("div",{className:"text-red-600",children:f}):c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"text-muted-foreground",children:"File:"}),t.length>0?c.jsx("select",{className:"rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono text-xs",onChange:A=>s(A.target.value),value:i??"",children:t.map(A=>c.jsxs("option",{value:A.path,children:[A.relativePath," [",A.format,"]"]},A.path))}):c.jsx("span",{className:"text-muted-foreground",children:"none detected"}),c.jsxs(ue,{onClick:()=>R(!0),size:"sm",type:"button",variant:"outline",children:[c.jsx(Rh,{})," Browse files"]}),a?c.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono text-muted-foreground",children:a.info.path}):null]}),c.jsxs("div",{className:"flex items-center gap-1",children:[a?.info.format==="env"?c.jsxs(c.Fragment,{children:[c.jsxs(ue,{onClick:()=>N(A=>!A),size:"sm",type:"button",variant:"outline",children:[k?c.jsx(nE,{}):c.jsx(Y0,{}),k?"Hide secrets":"Reveal secrets"]}),c.jsxs(ue,{onClick:p,size:"sm",type:"button",variant:"outline",children:[c.jsx(wn,{})," Add"]})]}):null,c.jsxs(ue,{disabled:!m||h||!a,onClick:y,size:"sm",type:"button",children:[c.jsx(fE,{})," ",h?"Saving…":"Save"]})]})]}),f&&!a?c.jsx("div",{className:"text-red-600",children:f}):a?.info.format==="env"&&a.rows?c.jsx("div",{className:me(u&&"opacity-60 transition-opacity"),children:c.jsx(uB,{revealAll:k,rows:a.rows,onAdd:p,onRemove:b,onUpdate:v})}):a?.text!==void 0?c.jsxs("div",{className:me("space-y-1",u&&"opacity-60 transition-opacity"),children:[a.info.format==="json"?c.jsx("div",{className:"flex justify-end",children:c.jsx(ue,{onClick:()=>x(FC(a.text??"")),size:"sm",type:"button",variant:"outline",children:"Format JSON"})}):null,c.jsx("textarea",{className:"min-h-[300px] w-full rounded border border-border/60 bg-background p-2 font-mono text-[11px] leading-relaxed",onChange:A=>x(A.target.value),spellCheck:!1,value:a.text})]}):u?c.jsx("div",{className:"text-muted-foreground",children:"Loading file…"}):null,a?c.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?c.jsx(dB,{onClose:()=>R(!1),onPick:A=>{S(A).then(O=>{O&&R(!1)})},serviceName:e}):null]})}function mB({serviceName:e,status:t,timeline:i,onRefresh:s}){const{error:a,success:o}=Oi(),[u,h]=E.useState(!1),m=t?.inspector,f=t?.state==="running",p=E.useMemo(()=>i.filter(x=>x.kind==="service.http"&&x.service===e).map(x=>{const y=x.data??{};return{id:y.id??x.id,startedAt:x.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(),[i,e]);async function b(x){h(!0);try{await cn(`/api/services/${encodeURIComponent(e)}/inspector`,{enabled:x?"true":"false"}),await s(),o(x?`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 c.jsx("div",{className:"text-muted-foreground",children:"Service is not running."});if(!m?.enabled)return c.jsxs("div",{className:"space-y-2",children:[c.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."}),c.jsxs(ue,{disabled:u,onClick:()=>b(!0),size:"sm",type:"button",children:[c.jsx(jh,{})," Start HTTP inspector"]})]});const v=m.port?`http://127.0.0.1:${m.port}`:void 0;return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"text-muted-foreground",children:"Inspect URL:"}),v?c.jsxs(c.Fragment,{children:[c.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:v}),c.jsxs(ue,{onClick:()=>{navigator.clipboard.writeText(v),o("Copied inspect URL.")},size:"sm",type:"button",variant:"outline",children:[c.jsx(kg,{})," Copy"]}),c.jsx(ue,{onClick:()=>window.open(v,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",children:"Open"})]}):c.jsx("span",{className:"text-muted-foreground",children:"starting…"}),c.jsxs("span",{className:"text-muted-foreground",children:["→ upstream :",m.upstreamPort??"?"]}),c.jsxs(ue,{disabled:u,onClick:()=>b(!1),size:"sm",type:"button",variant:"outline",children:[c.jsx(Oh,{})," Stop"]})]}),p.length===0?c.jsx("div",{className:"text-muted-foreground",children:"No requests captured yet. Hit the inspect URL in your browser to see traffic."}):c.jsx("div",{className:"max-h-80 overflow-auto",children:c.jsxs("table",{className:"w-full font-mono text-[11px]",children:[c.jsx("thead",{className:"sticky top-0 bg-muted/60 text-left text-muted-foreground",children:c.jsxs("tr",{children:[c.jsx("th",{className:"py-1 pr-3",children:"Time"}),c.jsx("th",{className:"py-1 pr-3",children:"Method"}),c.jsx("th",{className:"py-1 pr-3",children:"Path"}),c.jsx("th",{className:"py-1 pr-3 text-right",children:"Status"}),c.jsx("th",{className:"py-1 pr-3 text-right",children:"Size"}),c.jsx("th",{className:"py-1 pr-3 text-right",children:"ms"})]})}),c.jsx("tbody",{children:p.map(x=>c.jsxs("tr",{className:"border-t border-border/40",children:[c.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:new Date(x.startedAt).toLocaleTimeString()}),c.jsx("td",{className:"py-1 pr-3",children:x.method}),c.jsx("td",{className:"py-1 pr-3 truncate max-w-[40ch]",children:x.path}),c.jsx("td",{className:me("py-1 pr-3 text-right",pB(x.status)),children:x.status}),c.jsx("td",{className:"py-1 pr-3 text-right text-muted-foreground",children:gB(x.resBytes)}),c.jsx("td",{className:"py-1 pr-3 text-right",children:x.durationMs.toFixed(1)})]},x.id))})]})})]})}function pB(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 gB(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function bB({serviceName:e}){const[t,i]=E.useState(null),[s,a]=E.useState(null),[o,u]=E.useState(()=>Date.now());return E.useEffect(()=>{let h=!1;async function m(){try{const p=await QM(e);h||(i(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]),s?c.jsxs("p",{className:"text-destructive",children:["Failed to load metrics: ",s]}):t?t.samples.length===0?c.jsx("p",{className:"text-muted-foreground",children:"No samples yet. Metrics start collecting once the service is running."}):c.jsx(_B,{series:t,now:o}):c.jsx("p",{className:"text-muted-foreground",children:"Loading metrics…"})}function _B({series:e,now:t}){const{samples:i}=e,s=E.useMemo(()=>BS(i,m=>m.cpu),[i]),a=E.useMemo(()=>BS(i,m=>m.rss),[i]),o=e.startedAt?new Date(e.startedAt):null,u=o?t-o.getTime():null,h=i.length>1?i[i.length-1].t-i[0].t:0;return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[c.jsx(Dd,{accent:"#22c55e",label:"CPU",value:`${s.last.toFixed(1)}%`,sub:`peak ${s.max.toFixed(1)}% · avg ${s.avg.toFixed(1)}%`}),c.jsx(Dd,{accent:"#3b82f6",label:"Memory",value:Ep(a.last),sub:`peak ${Ep(a.max)} · avg ${Ep(a.avg)}`}),c.jsx(Dd,{accent:"#a855f7",label:"Uptime",value:u!=null?PS(u):"—",sub:o?`since ${o.toLocaleTimeString()}`:"not running"}),c.jsx(Dd,{accent:"#f59e0b",label:"Samples",value:String(i.length),sub:h?`over ${PS(h)}`:"collecting…"})]}),c.jsx(IS,{label:"CPU",samples:i,pick:m=>m.cpu,summary:s,color:"#22c55e",suffix:"%",unit:"percent"}),c.jsx(IS,{label:"Memory (RSS)",samples:i,pick:m=>m.rss,summary:a,color:"#3b82f6",suffix:" MB",unit:"mb"})]})}function BS(e,t){const i=e.map(t),s=i.reduce((a,o)=>a+o,0);return{last:i[i.length-1],max:Math.max(...i),min:Math.min(...i),avg:s/i.length}}function Dd({accent:e,label:t,value:i,sub:s}){return c.jsxs("div",{className:"rounded-lg border border-border bg-card px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:e}}),c.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:t})]}),c.jsx("div",{className:"mt-1 font-mono text-lg leading-none tabular-nums",children:i}),c.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:s})]})}const Po=160,zS=44,vB=20;function IS({label:e,samples:t,pick:i,summary:s,color:a,suffix:o,unit:u}){const h=E.useMemo(()=>`metric-grad-${u}-${Math.random().toString(36).slice(2,8)}`,[u]),m=t.map(i),f=Math.max(...m,u==="percent"?10:1),p=xB(f),b=0,v=p-b||1,x=t[0].t,y=t[t.length-1].t,S=Math.max(1,y-x),k=P=>(P-x)/S*1e3,N=P=>(1-(P-b)/v)*1e3,T=t.map(P=>`${k(P.t).toFixed(1)},${N(i(P)).toFixed(1)}`),R=`M0,1000 L${T.join(" L")} L1000,1000 Z`,A=`M${T.join(" L")}`,O=k(y),H=N(s.last),L=N(s.avg),M=[1,.75,.5,.25,0],$=5;return c.jsxs("figure",{className:"space-y-1",children:[c.jsxs("figcaption",{className:"flex items-baseline justify-between",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e}),c.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:["now ",c.jsxs("span",{className:"text-foreground",children:[s.last.toFixed(1),o]}),c.jsx("span",{className:"mx-1.5",children:"·"}),"peak ",s.max.toFixed(1),o,c.jsx("span",{className:"mx-1.5",children:"·"}),"avg ",s.avg.toFixed(1),o]})]}),c.jsxs("div",{className:"rounded-lg border border-border bg-card p-2",children:[c.jsxs("div",{className:"flex",children:[c.jsx("div",{className:"relative flex shrink-0 flex-col justify-between text-right font-mono text-[10px] text-muted-foreground",style:{width:zS,height:Po},children:M.map(P=>c.jsx("span",{className:"pr-1 leading-none",children:yB(b+P*v,u)},P))}),c.jsxs("div",{className:"relative min-w-0 flex-1",style:{height:Po},children:[M.map((P,F)=>c.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===M.length-1?"solid":"dashed"}},P)),c.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-t border-dashed",style:{top:`${L/1e3*Po}px`,borderColor:a,opacity:.4}}),c.jsxs("svg",{"aria-label":e,className:"absolute inset-0 h-full w-full",preserveAspectRatio:"none",role:"img",viewBox:"0 0 1000 1000",children:[c.jsx("defs",{children:c.jsxs("linearGradient",{id:h,x1:"0",x2:"0",y1:"0",y2:"1",children:[c.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.35}),c.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:.02})]})}),c.jsx("path",{d:R,fill:`url(#${h})`}),c.jsx("path",{d:A,fill:"none",stroke:a,strokeWidth:2,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round"})]}),c.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:`${O/1e3*100}%`,top:`${H/1e3*Po}px`,backgroundColor:a,boxShadow:`0 0 0 4px ${a}33`}})]})]}),c.jsx("div",{className:"flex font-mono text-[10px] text-muted-foreground",style:{height:vB,paddingLeft:zS},children:c.jsx("div",{className:"relative flex-1",children:Array.from({length:$+1},(P,F)=>{const Z=F/$,K=x+Z*S;return c.jsx("span",{className:"absolute top-1 whitespace-nowrap",style:{left:`${Z*100}%`,transform:F===0?"translateX(0)":F===$?"translateX(-100%)":"translateX(-50%)"},children:SB(K-y)},F)})})})]})]})}function xB(e){if(e<=1)return 1;const t=Math.pow(10,Math.floor(Math.log10(e))),i=e/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function yB(e,t){return t==="percent"?`${e.toFixed(0)}%`:e>=1024?`${(e/1024).toFixed(1)}G`:`${e.toFixed(0)}M`}function Ep(e){return e>=1024?`${(e/1024).toFixed(2)} GB`:`${e.toFixed(0)} MB`}function PS(e){const t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;const i=Math.floor(t/60);if(i<60)return`${i}m ${t%60}s`;const s=Math.floor(i/60);return s<24?`${s}h ${i%60}m`:`${Math.floor(s/24)}d ${s%24}h`}function SB(e){const t=Math.round(e/1e3);if(t===0)return"now";if(Math.abs(t)<60)return`${t}s`;const s=Math.round(t/60);return Math.abs(s)<60?`${s}m`:`${Math.round(s/60)}h`}function wB({rows:e}){if(e.length===0)return c.jsx("div",{className:"text-muted-foreground",children:"No process tree (service not running)."});const t=[...e].sort((s,a)=>a.cpuPercent-s.cpuPercent),i=new Set(e.map(s=>s.pid));return c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full font-mono text-[11px]",children:[c.jsx("thead",{className:"text-left text-muted-foreground",children:c.jsxs("tr",{children:[c.jsx("th",{className:"py-1 pr-3",children:"PID"}),c.jsx("th",{className:"py-1 pr-3",children:"PPID"}),c.jsx("th",{className:"py-1 pr-3 text-right",children:"CPU%"}),c.jsx("th",{className:"py-1 pr-3 text-right",children:"RSS MB"}),c.jsx("th",{className:"py-1",children:"Command"})]})}),c.jsx("tbody",{children:t.map(s=>{const a=i.has(s.ppid);return c.jsxs("tr",{className:"border-t border-border/40",children:[c.jsx("td",{className:"py-1 pr-3",children:s.pid}),c.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:s.ppid}),c.jsx("td",{className:"py-1 pr-3 text-right",children:s.cpuPercent.toFixed(1)}),c.jsx("td",{className:"py-1 pr-3 text-right",children:s.rssMb.toFixed(1)}),c.jsx("td",{className:me("py-1 truncate max-w-[60ch]",a&&"pl-4"),children:s.command})]},s.pid)})})]})})}var EB=2,kB=1,CB=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,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),a=Math.max(0,parseInt(i.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=s-h,p=a-m-t;return{cols:Math.max(EB,Math.floor(p/e.css.cell.width)),rows:Math.max(kB,Math.floor(f/e.css.cell.height))}}};var $C=Object.defineProperty,NB=Object.getOwnPropertyDescriptor,TB=(e,t)=>{for(var i in t)$C(e,i,{get:t[i],enumerable:!0})},Vt=(e,t,i,s)=>{for(var a=s>1?void 0:s?NB(t,i):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=(s?u(t,i,a):u(a))||a);return s&&a&&$C(t,i,a),a},Se=(e,t)=>(i,s)=>t(i,s,e),US="Terminal input",n0={get:()=>US,set:e=>US=e},HS="Too much output to announce, navigate to rows manually to read",s0={get:()=>HS,set:e=>HS=e};function AB(e){return e.replace(/\r?\n/g,"\r")}function MB(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function RB(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function jB(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let a=e.clipboardData.getData("text/plain");VC(a,t,i,s)}}function VC(e,t,i,s){e=AB(e),e=MB(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function qC(e,t,i){let s=i.getBoundingClientRect(),a=e.clientX-s.left-10,o=e.clientY-s.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 FS(e,t,i,s,a){qC(e,t,i),a&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function Wr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Hh(e,t=0,i=e.length){let s="";for(let a=t;a<i;++a){let o=e[a];o>65535?(o-=65536,s+=String.fromCharCode((o>>10)+55296)+String.fromCharCode(o%1024+56320)):s+=String.fromCharCode(o)}return s}var DB=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,a=0;if(this._interim){let o=e.charCodeAt(a++);56320<=o&&o<=57343?t[s++]=(this._interim-55296)*1024+o-56320+65536:(t[s++]=this._interim,t[s++]=o),this._interim=0}for(let o=a;o<i;++o){let u=e.charCodeAt(o);if(55296<=u&&u<=56319){if(++o>=i)return this._interim=u,s;let h=e.charCodeAt(o);56320<=h&&h<=57343?t[s++]=(u-55296)*1024+h-56320+65536:(t[s++]=u,t[s++]=h);continue}u!==65279&&(t[s++]=u)}return s}},OB=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,a,o,u,h,m=0,f=0;if(this.interim[0]){let v=!1,x=this.interim[0];x&=(x&224)===192?31:(x&240)===224?15:7;let y=0,S;for(;(S=this.interim[++y]&63)&&y<4;)x<<=6,x|=S;let k=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,N=k-y;for(;f<N;){if(f>=i)return 0;if(S=e[f++],(S&192)!==128){f--,v=!0;break}else this.interim[y++]=S,x<<=6,x|=S&63}v||(k===2?x<128?f--:t[s++]=x:k===3?x<2048||x>=55296&&x<=57343||x===65279||(t[s++]=x):x<65536||x>1114111||(t[s++]=x)),this.interim.fill(0)}let p=i-4,b=f;for(;b<i;){for(;b<p&&!((a=e[b])&128)&&!((o=e[b+1])&128)&&!((u=e[b+2])&128)&&!((h=e[b+3])&128);)t[s++]=a,t[s++]=o,t[s++]=u,t[s++]=h,b+=4;if(a=e[b++],a<128)t[s++]=a;else if((a&224)===192){if(b>=i)return this.interim[0]=a,s;if(o=e[b++],(o&192)!==128){b--;continue}if(m=(a&31)<<6|o&63,m<128){b--;continue}t[s++]=m}else if((a&240)===224){if(b>=i)return this.interim[0]=a,s;if(o=e[b++],(o&192)!==128){b--;continue}if(b>=i)return this.interim[0]=a,this.interim[1]=o,s;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[s++]=m}else if((a&248)===240){if(b>=i)return this.interim[0]=a,s;if(o=e[b++],(o&192)!==128){b--;continue}if(b>=i)return this.interim[0]=a,this.interim[1]=o,s;if(u=e[b++],(u&192)!==128){b--;continue}if(b>=i)return this.interim[0]=a,this.interim[1]=o,this.interim[2]=u,s;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[s++]=m}}return s}},GC="",Xr=" ",ru=class KC{constructor(){this.fg=0,this.bg=0,this.extended=new _h}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 KC;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}},_h=class WC{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}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 WC(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Vn=class YC extends ru{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new _h,this.combinedData=""}static fromCharData(t){let i=new YC;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Wr(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 i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let a=t[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(s-55296)*1024+a-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},$S="di$target",r0="di$dependencies",kp=new Map;function LB(e){return e[r0]||[]}function yi(e){if(kp.has(e))return kp.get(e);let t=function(i,s,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");BB(t,i,a)};return t._id=e,kp.set(e,t),t}function BB(e,t,i){t[$S]===t?t[r0].push({id:e,index:i}):(t[r0]=[{id:e,index:i}],t[$S]=t)}var Yi=yi("BufferService"),XC=yi("CoreMouseService"),Xa=yi("CoreService"),zB=yi("CharsetService"),Ub=yi("InstantiationService"),ZC=yi("LogService"),Xi=yi("OptionsService"),QC=yi("OscLinkService"),IB=yi("UnicodeService"),au=yi("DecorationService"),a0=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],a=this._optionsService.rawOptions.linkHandler,o=new Vn,u=i.getTrimmedLength(),h=-1,m=-1,f=!1;for(let p=0;p<u;p++)if(!(m===-1&&!i.hasContent(p))){if(i.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 v={start:{x:m+1,y:e},end:{x:p+(!f&&p===u-1?1:0),y:e}},x=!1;if(!a?.allowNonHttpProtocols)try{let y=new URL(b);["http:","https:"].includes(y.protocol)||(x=!0)}catch{x=!0}x||s.push({text:b,range:v,activate:(y,S)=>a?a.activate(y,S,v):PB(y,S),hover:(y,S)=>a?.hover?.(y,S,v),leave:(y,S)=>a?.leave?.(y,S,v)})}f=!1,o.hasExtendedAttrs()&&o.extended.urlId?(m=p,h=o.extended.urlId):(m=-1,h=-1)}}t(s)}};a0=Vt([Se(0,Yi),Se(1,Xi),Se(2,QC)],a0);function PB(e,t){if(confirm(`Do you want to navigate to ${t}?
98
+
99
+ WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Fh=yi("CharSizeService"),dr=yi("CoreBrowserService"),Hb=yi("MouseService"),hr=yi("RenderService"),UB=yi("SelectionService"),JC=yi("CharacterJoinerService"),ll=yi("ThemeService"),eN=yi("LinkProviderService"),HB=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?VS.isErrorNoTelemetry(e)?new VS(e.message+`
100
+
101
+ `+e.stack):new Error(e.message+`
102
+
103
+ `+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)}},FB=new HB;function Yd(e){$B(e)||FB.onUnexpectedError(e)}var o0="Canceled";function $B(e){return e instanceof VB?!0:e instanceof Error&&e.name===o0&&e.message===o0}var VB=class extends Error{constructor(){super(o0),this.name=this.message}};function qB(e){return new Error(`Illegal argument: ${e}`)}var VS=class l0 extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof l0)return t;let i=new l0;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},c0=class tN extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,tN.prototype)}};function xn(e,t=0){return e[e.length-(1+t)]}var GB;(e=>{function t(o){return o<0}e.isLessThan=t;function i(o){return o<=0}e.isLessThanOrEqual=i;function s(o){return o>0}e.isGreaterThan=s;function a(o){return o===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(GB||={});function KB(e,t){let i=this,s=!1,a;return function(){return s||(s=!0,t||(a=e.apply(i,arguments))),a}}var iN;(e=>{function t(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*a(A){yield A}e.single=a;function o(A){return t(A)?A:a(A)}e.wrap=o;function u(A){return A||i}e.from=u;function*h(A){for(let O=A.length-1;O>=0;O--)yield A[O]}e.reverse=h;function m(A){return!A||A[Symbol.iterator]().next().done===!0}e.isEmpty=m;function f(A){return A[Symbol.iterator]().next().value}e.first=f;function p(A,O){let H=0;for(let L of A)if(O(L,H++))return!0;return!1}e.some=p;function b(A,O){for(let H of A)if(O(H))return H}e.find=b;function*v(A,O){for(let H of A)O(H)&&(yield H)}e.filter=v;function*x(A,O){let H=0;for(let L of A)yield O(L,H++)}e.map=x;function*y(A,O){let H=0;for(let L of A)yield*O(L,H++)}e.flatMap=y;function*S(...A){for(let O of A)yield*O}e.concat=S;function k(A,O,H){let L=H;for(let M of A)L=O(L,M);return L}e.reduce=k;function*N(A,O,H=A.length){for(O<0&&(O+=A.length),H<0?H+=A.length:H>A.length&&(H=A.length);O<H;O++)yield A[O]}e.slice=N;function T(A,O=Number.POSITIVE_INFINITY){let H=[];if(O===0)return[H,A];let L=A[Symbol.iterator]();for(let M=0;M<O;M++){let $=L.next();if($.done)return[H,e.empty()];H.push($.value)}return[H,{[Symbol.iterator](){return L}}]}e.consume=T;async function R(A){let O=[];for await(let H of A)O.push(H);return Promise.resolve(O)}e.asyncToArray=R})(iN||={});function Va(e){if(iN.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}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 WB(...e){return Ot(()=>Va(e))}function Ot(e){return{dispose:KB(()=>{e()})}}var nN=class sN{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{Va(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?sN.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)}};nN.DISABLE_DISPOSED_WARNING=!1;var Zr=nN,Ye=class{constructor(){this._store=new Zr,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 tl=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}},nr=typeof window=="object"?window:globalThis,u0=class d0{constructor(t){this.element=t,this.next=d0.Undefined,this.prev=d0.Undefined}};u0.Undefined=new u0(void 0);var It=u0,qS=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 i=new It(e);if(this._first===It.Undefined)this._first=i,this._last=i;else if(t){let a=this._last;this._last=i,i.prev=a,a.next=i}else{let a=this._first;this._first=i,i.next=a,a.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}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}},YB=globalThis.performance&&typeof globalThis.performance.now=="function",XB=class rN{static create(t){return new rN(t)}constructor(t){this._now=YB&&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}},Mi;(e=>{e.None=()=>Ye.None;function t(Z,K){return b(Z,()=>{},0,void 0,!0,void 0,K)}e.defer=t;function i(Z){return(K,Q=null,q)=>{let D=!1,Y;return Y=Z(X=>{if(!D)return Y?Y.dispose():D=!0,K.call(Q,X)},null,q),D&&Y.dispose(),Y}}e.once=i;function s(Z,K,Q){return f((q,D=null,Y)=>Z(X=>q.call(D,K(X)),null,Y),Q)}e.map=s;function a(Z,K,Q){return f((q,D=null,Y)=>Z(X=>{K(X),q.call(D,X)},null,Y),Q)}e.forEach=a;function o(Z,K,Q){return f((q,D=null,Y)=>Z(X=>K(X)&&q.call(D,X),null,Y),Q)}e.filter=o;function u(Z){return Z}e.signal=u;function h(...Z){return(K,Q=null,q)=>{let D=WB(...Z.map(Y=>Y(X=>K.call(Q,X))));return p(D,q)}}e.any=h;function m(Z,K,Q,q){let D=Q;return s(Z,Y=>(D=K(D,Y),D),q)}e.reduce=m;function f(Z,K){let Q,q={onWillAddFirstListener(){Q=Z(D.fire,D)},onDidRemoveLastListener(){Q?.dispose()}},D=new ge(q);return K?.add(D),D.event}function p(Z,K){return K instanceof Array?K.push(Z):K&&K.add(Z),Z}function b(Z,K,Q=100,q=!1,D=!1,Y,X){let V,I,j,W=0,de,oe={leakWarningThreshold:Y,onWillAddFirstListener(){V=Z(se=>{W++,I=K(I,se),q&&!j&&(he.fire(I),I=void 0),de=()=>{let fe=I;I=void 0,j=void 0,(!q||W>1)&&he.fire(fe),W=0},typeof Q=="number"?(clearTimeout(j),j=setTimeout(de,Q)):j===void 0&&(j=0,queueMicrotask(de))})},onWillRemoveListener(){D&&W>0&&de?.()},onDidRemoveLastListener(){de=void 0,V.dispose()}},he=new ge(oe);return X?.add(he),he.event}e.debounce=b;function v(Z,K=0,Q){return e.debounce(Z,(q,D)=>q?(q.push(D),q):[D],K,void 0,!0,void 0,Q)}e.accumulate=v;function x(Z,K=(q,D)=>q===D,Q){let q=!0,D;return o(Z,Y=>{let X=q||!K(Y,D);return q=!1,D=Y,X},Q)}e.latch=x;function y(Z,K,Q){return[e.filter(Z,K,Q),e.filter(Z,q=>!K(q),Q)]}e.split=y;function S(Z,K=!1,Q=[],q){let D=Q.slice(),Y=Z(I=>{D?D.push(I):V.fire(I)});q&&q.add(Y);let X=()=>{D?.forEach(I=>V.fire(I)),D=null},V=new ge({onWillAddFirstListener(){Y||(Y=Z(I=>V.fire(I)),q&&q.add(Y))},onDidAddFirstListener(){D&&(K?setTimeout(X):X())},onDidRemoveLastListener(){Y&&Y.dispose(),Y=null}});return q&&q.add(V),V.event}e.buffer=S;function k(Z,K){return(Q,q,D)=>{let Y=K(new T);return Z(function(X){let V=Y.evaluate(X);V!==N&&Q.call(q,V)},void 0,D)}}e.chain=k;let N=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(K){return this.steps.push(K),this}forEach(K){return this.steps.push(Q=>(K(Q),Q)),this}filter(K){return this.steps.push(Q=>K(Q)?Q:N),this}reduce(K,Q){let q=Q;return this.steps.push(D=>(q=K(q,D),q)),this}latch(K=(Q,q)=>Q===q){let Q=!0,q;return this.steps.push(D=>{let Y=Q||!K(D,q);return Q=!1,q=D,Y?D:N}),this}evaluate(K){for(let Q of this.steps)if(K=Q(K),K===N)break;return K}}function R(Z,K,Q=q=>q){let q=(...V)=>X.fire(Q(...V)),D=()=>Z.on(K,q),Y=()=>Z.removeListener(K,q),X=new ge({onWillAddFirstListener:D,onDidRemoveLastListener:Y});return X.event}e.fromNodeEventEmitter=R;function A(Z,K,Q=q=>q){let q=(...V)=>X.fire(Q(...V)),D=()=>Z.addEventListener(K,q),Y=()=>Z.removeEventListener(K,q),X=new ge({onWillAddFirstListener:D,onDidRemoveLastListener:Y});return X.event}e.fromDOMEventEmitter=A;function O(Z){return new Promise(K=>i(Z)(K))}e.toPromise=O;function H(Z){let K=new ge;return Z.then(Q=>{K.fire(Q)},()=>{K.fire(void 0)}).finally(()=>{K.dispose()}),K.event}e.fromPromise=H;function L(Z,K){return Z(Q=>K.fire(Q))}e.forward=L;function M(Z,K,Q){return K(Q),Z(q=>K(q))}e.runAndSubscribe=M;class ${constructor(K,Q){this._observable=K,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:()=>{K.addObserver(this)},onDidRemoveLastListener:()=>{K.removeObserver(this)}};this.emitter=new ge(q),Q&&Q.add(this.emitter)}beginUpdate(K){this._counter++}handlePossibleChange(K){}handleChange(K,Q){this._hasChanged=!0}endUpdate(K){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(Z,K){return new $(Z,K).emitter.event}e.fromObservable=P;function F(Z){return(K,Q,q)=>{let D=0,Y=!1,X={beginUpdate(){D++},endUpdate(){D--,D===0&&(Z.reportChanges(),Y&&(Y=!1,K.call(Q)))},handlePossibleChange(){},handleChange(){Y=!0}};Z.addObserver(X),Z.reportChanges();let V={dispose(){Z.removeObserver(X)}};return q instanceof Zr?q.add(V):Array.isArray(q)&&q.push(V),V}}e.fromObservableLight=F})(Mi||={});var h0=class f0{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${f0._idPool++}`,f0.all.add(this)}start(t){this._stopWatch=new XB,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}}};h0.all=new Set,h0._idPool=0;var ZB=h0,QB=-1,aN=class oN{constructor(t,i,s=(oN._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i<s)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=s*.5;let[o,u]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${u}):`;console.warn(h),console.warn(o);let m=new tz(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,i=0;for(let[s,a]of this._stacks)(!t||i<a)&&(t=[s,a],i=a);return t}};aN._idPool=1;var JB=aN,ez=class lN{constructor(t){this.value=t}static create(){let t=new Error;return new lN(t.stack??"")}print(){console.warn(this.value.split(`
104
+ `).slice(2).join(`
105
+ `))}},tz=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},iz=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},nz=0,Cp=class{constructor(e){this.value=e,this.id=nz++}},sz=2,rz,ge=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new JB(e?.onListenerError??Yd,this._options?.leakWarningThreshold??QB):void 0,this._perfMon=this._options?._profName?new ZB(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,i)=>{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 iz(`${u}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||Yd)(m),Ye.None}if(this._disposed)return Ye.None;t&&(e=e.bind(t));let s=new Cp(e),a;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=ez.create(),a=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof Cp?(this._deliveryQueue??=new az,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=Ot(()=>{a?.(),this._removeListener(s)});return i instanceof Zr?i.add(o):Array.isArray(i)&&i.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,i=t.indexOf(e);if(i===-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[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*sz<=t.length){let a=0;for(let o=0;o<t.length;o++)t[o]?t[a++]=t[o]:s&&(this._deliveryQueue.end--,a<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=a}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||Yd;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_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 Cp)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}},az=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},m0=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ge,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ge,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};m0.INSTANCE=new m0;var Fb=m0;function oz(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}Fb.INSTANCE.onDidChangeZoomLevel;function lz(e){return Fb.INSTANCE.getZoomFactor(e)}Fb.INSTANCE.onDidChangeFullscreen;var cl=typeof navigator=="object"?navigator.userAgent:"",p0=cl.indexOf("Firefox")>=0,cz=cl.indexOf("AppleWebKit")>=0,$b=cl.indexOf("Chrome")>=0,uz=!$b&&cl.indexOf("Safari")>=0;cl.indexOf("Electron/")>=0;cl.indexOf("Android")>=0;var Np=!1;if(typeof nr.matchMedia=="function"){let e=nr.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=nr.matchMedia("(display-mode: fullscreen)");Np=e.matches,oz(nr,e,({matches:i})=>{Np&&t.matches||(Np=i)})}var Yo="en",g0=!1,b0=!1,Xd=!1,cN=!1,Od,Zd=Yo,GS=Yo,dz,ir,Ha=globalThis,Sn;typeof Ha.vscode<"u"&&typeof Ha.vscode.process<"u"?Sn=Ha.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Sn=process);var hz=typeof Sn?.versions?.electron=="string",fz=hz&&Sn?.type==="renderer";if(typeof Sn=="object"){g0=Sn.platform==="win32",b0=Sn.platform==="darwin",Xd=Sn.platform==="linux",Xd&&Sn.env.SNAP&&Sn.env.SNAP_REVISION,Sn.env.CI||Sn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Od=Yo,Zd=Yo;let e=Sn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Od=t.userLocale,GS=t.osLocale,Zd=t.resolvedLanguage||Yo,dz=t.languagePack?.translationsConfigFile}catch{}cN=!0}else typeof navigator=="object"&&!fz?(ir=navigator.userAgent,g0=ir.indexOf("Windows")>=0,b0=ir.indexOf("Macintosh")>=0,(ir.indexOf("Macintosh")>=0||ir.indexOf("iPad")>=0||ir.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Xd=ir.indexOf("Linux")>=0,ir?.indexOf("Mobi")>=0,Zd=globalThis._VSCODE_NLS_LANGUAGE||Yo,Od=navigator.language.toLowerCase(),GS=Od):console.error("Unable to resolve platform.");var uN=g0,Ss=b0,mz=Xd,KS=cN,Cs=ir,Vr=Zd,pz;(e=>{function t(){return Vr}e.value=t;function i(){return Vr.length===2?Vr==="en":Vr.length>=3?Vr[0]==="e"&&Vr[1]==="n"&&Vr[2]==="-":!1}e.isDefaultVariant=i;function s(){return Vr==="en"}e.isDefault=s})(pz||={});var gz=typeof Ha.postMessage=="function"&&!Ha.importScripts;(()=>{if(gz){let e=[];Ha.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,a=e.length;s<a;s++){let o=e[s];if(o.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),o.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),Ha.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var bz=!!(Cs&&Cs.indexOf("Chrome")>=0);Cs&&Cs.indexOf("Firefox")>=0;!bz&&Cs&&Cs.indexOf("Safari")>=0;Cs&&Cs.indexOf("Edg/")>=0;Cs&&Cs.indexOf("Android")>=0;var Uo=typeof navigator=="object"?navigator:{};KS||document.queryCommandSupported&&document.queryCommandSupported("copy")||Uo&&Uo.clipboard&&Uo.clipboard.writeText,KS||Uo&&Uo.clipboard&&Uo.clipboard.readText;var Vb=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}},Tp=new Vb,WS=new Vb,YS=new Vb,_z=new Array(230),dN;(e=>{function t(h){return Tp.keyCodeToStr(h)}e.toString=t;function i(h){return Tp.strToKeyCode(h)}e.fromString=i;function s(h){return WS.keyCodeToStr(h)}e.toUserSettingsUS=s;function a(h){return YS.keyCodeToStr(h)}e.toUserSettingsGeneral=a;function o(h){return WS.strToKeyCode(h)||YS.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 Tp.keyCodeToStr(h)}e.toElectronAccelerator=u})(dN||={});var vz=class hN{constructor(t,i,s,a,o){this.ctrlKey=t,this.shiftKey=i,this.altKey=s,this.metaKey=a,this.keyCode=o}equals(t){return t instanceof hN&&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",i=this.shiftKey?"1":"0",s=this.altKey?"1":"0",a=this.metaKey?"1":"0";return`K${t}${i}${s}${a}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new xz([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},xz=class{constructor(e){if(e.length===0)throw qB("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;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 yz(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return dN.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(p0)switch(t){case 59:return 85;case 60:if(mz)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ss)return 57;break}else if(cz&&(Ss&&t===93||!Ss&&t===92))return 57;return _z[t]||0}var Sz=Ss?256:2048,wz=512,Ez=1024,kz=Ss?2048:256,XS=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=yz(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|=Sz),this.altKey&&(t|=wz),this.shiftKey&&(t|=Ez),this.metaKey&&(t|=kz),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new vz(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},ZS=new WeakMap;function Cz(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if(t.origin!=="null"&&i.origin!=="null"&&t.origin!==i.origin)return null}catch{return null}return e.parent}var Nz=class{static getSameOriginWindowChain(e){let t=ZS.get(e);if(!t){t=[],ZS.set(e,t);let i=e,s;do s=Cz(i),s?t.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):t.push({window:new WeakRef(i),iframeElement:null}),i=s;while(i)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0,a=this.getSameOriginWindowChain(e);for(let o of a){let u=o.window.deref();if(i+=u?.scrollY??0,s+=u?.scrollX??0,u===t||!o.iframeElement)break;let h=o.iframeElement.getBoundingClientRect();i+=h.top,s+=h.left}return{top:i,left:s}}},Ld=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 i=Nz.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},QS=class{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let s=!1;if($b){let a=navigator.userAgent.match(/Chrome\/(\d+)/);s=(a?parseInt(a[1]):123)<=122}if(e){let a=e,o=e,u=e.view?.devicePixelRatio||1;if(typeof a.wheelDeltaY<"u")s?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?p0&&!Ss?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")uz&&uN?this.deltaX=-(a.wheelDeltaX/120):s?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?p0&&!Ss?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*u):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},fN=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),Tz;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof Az?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Mi.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:fN})})(Tz||={});var Az=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?fN:(this._emitter||(this._emitter=new ge),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},qb=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 c0("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new c0("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},Mz=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new c0("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=i.setInterval(()=>{e()},t);this.disposable=Ot(()=>{i.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Rz;(e=>{async function t(s){let a,o=await Promise.all(s.map(u=>u.then(h=>h,h=>{a||(a=h)})));if(typeof a<"u")throw a;return o}e.settled=t;function i(s){return new Promise(async(a,o)=>{try{await s(a,o)}catch(u){o(u)}})}e.withAsyncBody=i})(Rz||={});var JS=class Pn{static fromArray(t){return new Pn(i=>{i.emitMany(t)})}static fromPromise(t){return new Pn(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Pn(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new Pn(async i=>{await Promise.all(t.map(async s=>{for await(let a of s)i.emitOne(a)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new ge,queueMicrotask(async()=>{let s={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(t(s)),this.resolve()}catch(a){this.reject(a)}finally{s.emitOne=void 0,s.emitMany=void 0,s.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 Mi.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new Pn(async s=>{for await(let a of t)s.emitOne(i(a))})}map(t){return Pn.map(this,t)}static filter(t,i){return new Pn(async s=>{for await(let a of t)i(a)&&s.emitOne(a)})}filter(t){return Pn.filter(this,t)}static coalesce(t){return Pn.filter(t,i=>!!i)}coalesce(){return Pn.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return Pn.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())}};JS.EMPTY=JS.fromArray([]);var{getWindow:xs,getWindowId:jz,onDidRegisterWindow:Dz}=(function(){let e=new Map,t={window:nr,disposables:new Zr};e.set(nr.vscodeWindowId,t);let i=new ge,s=new ge,a=new ge;function o(u,h){return(typeof u=="number"?e.get(u):void 0)??(h?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:s.event,registerWindow(u){if(e.has(u.vscodeWindowId))return Ye.None;let h=new Zr,m={window:u,disposables:h.add(new Zr)};return e.set(u.vscodeWindowId,m),h.add(Ot(()=>{e.delete(u.vscodeWindowId),s.fire(u)})),h.add(Ue(u,bi.BEFORE_UNLOAD,()=>{a.fire(u)})),i.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:nr},getDocument(u){return xs(u).document}}})(),Oz=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!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,i,s){return new Oz(e,t,i,s)}var ew=function(e,t,i,s){return Ue(e,t,i,s)},Gb,Lz=class extends Mz{constructor(e){super(),this.defaultTarget=e&&xs(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},tw=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){Yd(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,a=o=>{i.set(o,!1);let u=e.get(o)??[];for(t.set(o,u),e.set(o,[]),s.set(o,!0);u.length>0;)u.sort(tw.sort),u.shift().execute();s.set(o,!1)};Gb=(o,u,h=0)=>{let m=jz(o),f=new tw(u,h),p=e.get(m);return p||(p=[],e.set(m,p)),p.push(f),i.get(m)||(i.set(m,!0),o.requestAnimationFrame(()=>a(m))),f}})();function Bz(e){let t=e.getBoundingClientRect(),i=xs(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}var bi={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"},zz=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=on(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=on(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=on(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=on(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=on(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=on(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=on(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=on(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=on(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=on(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=on(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=on(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=on(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=on(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 on(e){return typeof e=="number"?`${e}px`:e}function jc(e){return new zz(e)}var mN=class{constructor(){this._hooks=new Zr,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 i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,a){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=a;let o=e;try{e.setPointerCapture(t),this._hooks.add(Ot(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=xs(e)}this._hooks.add(Ue(o,bi.POINTER_MOVE,u=>{if(u.buttons!==i){this.stopMonitoring(!0);return}u.preventDefault(),this._pointerMoveCallback(u)})),this._hooks.add(Ue(o,bi.POINTER_UP,u=>this.stopMonitoring(!0)))}};function Iz(e,t,i){let s=null,a=null;if(typeof i.value=="function"?(s="value",a=i.value,a.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(s="get",a=i.get),!a)throw new Error("not supported");let o=`$memoize$${t}`;i[s]=function(...u){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,u)}),this[o]}}var bs;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(bs||={});var yc=class Pi extends Ye{constructor(){super(),this.dispatched=!1,this.targets=new qS,this.ignoreTargets=new qS,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Mi.runAndSubscribe(Dz,({window:t,disposables:i})=>{i.add(Ue(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(Ue(t.document,"touchend",s=>this.onTouchEnd(t,s))),i.add(Ue(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:nr,disposables:this._store}))}static addTarget(t){if(!Pi.isTouchDevice())return Ye.None;Pi.INSTANCE||(Pi.INSTANCE=new Pi);let i=Pi.INSTANCE.targets.push(t);return Ot(i)}static ignoreTarget(t){if(!Pi.isTouchDevice())return Ye.None;Pi.INSTANCE||(Pi.INSTANCE=new Pi);let i=Pi.INSTANCE.ignoreTargets.push(t);return Ot(i)}static isTouchDevice(){return"ontouchstart"in nr||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let s=0,a=t.targetTouches.length;s<a;s++){let o=t.targetTouches.item(s);this.activeTouches[o.identifier]={id:o.identifier,initialTarget:o.target,initialTimeStamp:i,initialPageX:o.pageX,initialPageY:o.pageY,rollingTimestamps:[i],rollingPageX:[o.pageX],rollingPageY:[o.pageY]};let u=this.newGestureEvent(bs.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,i){let s=Date.now(),a=Object.keys(this.activeTouches).length;for(let o=0,u=i.changedTouches.length;o<u;o++){let h=i.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<Pi.HOLD_DELAY&&Math.abs(m.initialPageX-xn(m.rollingPageX))<30&&Math.abs(m.initialPageY-xn(m.rollingPageY))<30){let p=this.newGestureEvent(bs.Tap,m.initialTarget);p.pageX=xn(m.rollingPageX),p.pageY=xn(m.rollingPageY),this.dispatchEvent(p)}else if(f>=Pi.HOLD_DELAY&&Math.abs(m.initialPageX-xn(m.rollingPageX))<30&&Math.abs(m.initialPageY-xn(m.rollingPageY))<30){let p=this.newGestureEvent(bs.Contextmenu,m.initialTarget);p.pageX=xn(m.rollingPageX),p.pageY=xn(m.rollingPageY),this.dispatchEvent(p)}else if(a===1){let p=xn(m.rollingPageX),b=xn(m.rollingPageY),v=xn(m.rollingTimestamps)-m.rollingTimestamps[0],x=p-m.rollingPageX[0],y=b-m.rollingPageY[0],S=[...this.targets].filter(k=>m.initialTarget instanceof Node&&k.contains(m.initialTarget));this.inertia(t,S,s,Math.abs(x)/v,x>0?1:-1,p,Math.abs(y)/v,y>0?1:-1,b)}this.dispatchEvent(this.newGestureEvent(bs.End,m.initialTarget)),delete this.activeTouches[h.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let s=document.createEvent("CustomEvent");return s.initEvent(t,!1,!0),s.initialTarget=i,s.tapCount=0,s}dispatchEvent(t){if(t.type===bs.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>Pi.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,t.tapCount=s}else(t.type===bs.Change||t.type===bs.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(t.initialTarget))return;let i=[];for(let s of this.targets)if(s.contains(t.initialTarget)){let a=0,o=t.initialTarget;for(;o&&o!==s;)a++,o=o.parentElement;i.push([a,s])}i.sort((s,a)=>s[0]-a[0]);for(let[s,a]of i)a.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,s,a,o,u,h,m,f){this.handle=Gb(t,()=>{let p=Date.now(),b=p-s,v=0,x=0,y=!0;a+=Pi.SCROLL_FRICTION*b,h+=Pi.SCROLL_FRICTION*b,a>0&&(y=!1,v=o*a*b),h>0&&(y=!1,x=m*h*b);let S=this.newGestureEvent(bs.Change);S.translationX=v,S.translationY=x,i.forEach(k=>k.dispatchEvent(S)),y||this.inertia(t,i,p,a,o,u+v,h,m,f+x)})}onTouchMove(t){let i=Date.now();for(let s=0,a=t.changedTouches.length;s<a;s++){let o=t.changedTouches.item(s);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(bs.Change,u.initialTarget);h.translationX=o.pageX-xn(u.rollingPageX),h.translationY=o.pageY-xn(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(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};yc.SCROLL_FRICTION=-.005,yc.HOLD_DELAY=700,yc.CLEAR_TAP_COUNT_TIME=400,Vt([Iz],yc,"isTouchDevice",1);var Pz=yc,Kb=class extends Ye{onclick(e,t){this._register(Ue(e,bi.CLICK,i=>t(new Ld(xs(e),i))))}onmousedown(e,t){this._register(Ue(e,bi.MOUSE_DOWN,i=>t(new Ld(xs(e),i))))}onmouseover(e,t){this._register(Ue(e,bi.MOUSE_OVER,i=>t(new Ld(xs(e),i))))}onmouseleave(e,t){this._register(Ue(e,bi.MOUSE_LEAVE,i=>t(new Ld(xs(e),i))))}onkeydown(e,t){this._register(Ue(e,bi.KEY_DOWN,i=>t(new XS(i))))}onkeyup(e,t){this._register(Ue(e,bi.KEY_UP,i=>t(new XS(i))))}oninput(e,t){this._register(Ue(e,bi.INPUT,t))}onblur(e,t){this._register(Ue(e,bi.BLUR,t))}onfocus(e,t){this._register(Ue(e,bi.FOCUS,t))}onchange(e,t){this._register(Ue(e,bi.CHANGE,t))}ignoreGesture(e){return Pz.ignoreTarget(e)}},iw=11,Uz=class extends Kb{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=iw+"px",this.domNode.style.height=iw+"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 mN),this._register(ew(this.bgDomNode,bi.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(ew(this.domNode,bi.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Lz),this._pointerdownScheduleRepeatTimer=this._register(new qb)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,xs(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},Hz=class _0{constructor(t,i,s,a,o,u,h){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,a=a|0,o=o|0,u=u|0,h=h|0),this.rawScrollLeft=a,this.rawScrollTop=h,i<0&&(i=0),a+i>s&&(a=s-i),a<0&&(a=0),o<0&&(o=0),h+o>u&&(h=u-o),h<0&&(h=0),this.width=i,this.scrollWidth=s,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,i){return new _0(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new _0(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,i){let s=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:i,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:s,scrollWidthChanged:a,scrollLeftChanged:o,heightChanged:u,scrollHeightChanged:h,scrollTopChanged:m}}},Fz=class extends Ye{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Hz(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 i=this._state.withScrollDimensions(e,t);this._setState(i,!!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 i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new sw(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=sw.start(this._state,i,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 i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},nw=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function Ap(e,t){let i=t-e;return function(s){return e+i*qz(s)}}function $z(e,t,i){return function(s){return s<i?e(s/i):t((s-i)/(1-i))}}var sw=class v0{constructor(t,i,s,a){this.from=t,this.to=i,this.duration=a,this.startTime=s,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,i,s){if(Math.abs(t-i)>2.5*s){let a,o;return t<i?(a=t+.75*s,o=i-.75*s):(a=t-.75*s,o=i+.75*s),$z(Ap(t,a),Ap(o,i),.33)}return Ap(t,i)}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 i=(t-this.startTime)/this.duration;if(i<1){let s=this.scrollLeft(i),a=this.scrollTop(i);return new nw(s,a,!1)}return new nw(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,s){return v0.start(t,i,s)}static start(t,i,s){s=s+10;let a=Date.now()-10;return new v0(t,i,a,s)}};function Vz(e){return Math.pow(e,3)}function qz(e){return 1-Vz(1-e)}var Gz=class extends Ye{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new qb)}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":"")))}},Kz=140,pN=class extends Kb{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 Gz(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new mN),this._shouldRender=!0,this.domNode=jc(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,bi.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new Uz(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=jc(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ue(this.slider.domNode,bi.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,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),a=this._sliderPointerPosition(e);i<=a&&a<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let a=Bz(this.domNode.domNode);t=e.pageX-a.left,i=e.pageY-a.top}let s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=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-i);if(uN&&u>Kz){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let h=this._sliderPointerPosition(a)-t;this._setDesiredScrollPositionNow(s.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()}},gN=class x0{constructor(t,i,s,a,o,u){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(s),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 x0(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,s,a,o){let u=Math.max(0,s-t),h=Math.max(0,u-2*i),m=a>0&&a>s;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(s*h/a))),p=(h-f)/(a-s),b=o*p;return{computedAvailableSize:Math.round(u),computedIsNeeded:m,computedSliderSize:Math.round(f),computedSliderRatio:p,computedSliderPosition:Math.round(b)}}_refreshComputedValues(){let t=x0._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 i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,s=this._scrollPosition;return i<this._computedSliderPosition?s-=this._visibleSize:s+=this._visibleSize,s}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+t;return Math.round(i/this._computedSliderRatio)}},Wz=class extends pN{constructor(e,t,i){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new gN(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,s.width,s.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}},Yz=class extends pN{constructor(e,t,i){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new gN(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.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}},Xz=500,rw=50,Zz=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},y0=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,i=0,s=1,a=this._rear;do{let o=a===this._front?t:Math.pow(2,-s);if(t-=o,i+=this._memory[a].score*o,a===this._front)break;a=(this._capacity+a-1)%this._capacity,s++}while(!0);return i<=.5}acceptStandardWheelEvent(t){if($b){let i=xs(t.browserEvent),s=lz(i);this.accept(Date.now(),t.deltaX*s,t.deltaY*s)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,i,s){let a=null,o=new Zz(t,i,s);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,i){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(s+=.25),i){let a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),u=Math.abs(i.deltaX),h=Math.abs(i.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&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};y0.INSTANCE=new y0;var Qz=y0,Jz=class extends Kb{constructor(e,t,i){super(),this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ge),this.onWillScroll=this._onWillScroll.event,this._options=tI(t),this._scrollable=i,this._register(this._scrollable.onScroll(a=>{this._onWillScroll.fire(a),this._onDidScroll(a),this._onScroll.fire(a)}));let s={onMouseWheel:a=>this._onMouseWheel(a),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Yz(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Wz(this._scrollable,this._options,s)),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=jc(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=jc(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=jc(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 qb),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Va(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,Ss&&(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 QS(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Va(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new QS(i))};this._mouseWheelToDispose.push(Ue(this._listenOnDomNode,bi.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=Qz.INSTANCE;t.acceptStandardWheelEvent(e);let i=!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=!Ss&&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=rw*a,p=h.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(m,p)}if(o){let f=rw*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),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(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,i=e.scrollLeft>0,s=i?" left":"",a=t?" top":"",o=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${a}${s}`)}}_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(),Xz)}},eI=class extends Jz{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function tI(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,Ss&&(t.className+=" mac"),t}var S0=class extends Ye{constructor(e,t,i,s,a,o,u,h){super(),this._bufferService=i,this._optionsService=u,this._renderService=h,this._onRequestScrollLines=this._register(new ge),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let m=this._register(new Fz({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>Gb(s.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{m.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new eI(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(Mi.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=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Ot(()=>this._styleElement.remove())),this._register(Mi.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(`
106
+ `)})),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),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};S0=Vt([Se(2,Yi),Se(3,dr),Se(4,XC),Se(5,ll),Se(6,Xi),Se(7,hr)],S0);var w0=class extends Ye{constructor(e,t,i,s,a){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,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 i=e.options.x??0;return i&&i>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 i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};w0=Vt([Se(1,Yi),Se(2,dr),Se(3,au),Se(4,hr)],w0);var iI=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,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},ms={full:0,left:0,center:0,right:0},qr={full:0,left:0,center:0,right:0},uc={full:0,left:0,center:0,right:0},vh=class extends Ye{constructor(e,t,i,s,a,o,u,h){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=a,this._optionsService=o,this._themeService=u,this._coreBrowserService=h,this._colorZoneStore=new iI,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);qr.full=this._canvas.width,qr.left=e,qr.center=t,qr.right=e,this._refreshDrawHeightConstants(),uc.full=1,uc.left=1,uc.center=1+qr.left,uc.right=1+qr.left+qr.center}_refreshDrawHeightConstants(){ms.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);ms.left=t,ms.center=t,ms.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ms.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ms.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ms.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ms.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(uc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-ms[e.position||"full"]/2),qr[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+ms[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}))}};vh=Vt([Se(2,Yi),Se(3,au),Se(4,hr),Se(5,Xi),Se(6,ll),Se(7,dr)],vh);var ce;(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=`
107
+ `,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=""))(ce||={});var Qd;(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="Ÿ"))(Qd||={});var bN;(e=>e.ST=`${ce.ESC}\\`)(bN||={});var E0=class{constructor(e,t,i,s,a,o){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,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 i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!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,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${ce.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),i=this._renderService.dimensions.css.cell.height,s=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=s+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"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=s+"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)}}};E0=Vt([Se(2,Yi),Se(3,Xi),Se(4,Xa),Se(5,hr)],E0);var _i=0,vi=0,xi=0,$t=0,aw={css:"#00000000",rgba:0},ai;(e=>{function t(a,o,u,h){return h!==void 0?`#${Aa(a)}${Aa(o)}${Aa(u)}${Aa(h)}`:`#${Aa(a)}${Aa(o)}${Aa(u)}`}e.toCss=t;function i(a,o,u,h=255){return(a<<24|o<<16|u<<8|h)>>>0}e.toRgba=i;function s(a,o,u,h){return{css:e.toCss(a,o,u,h),rgba:e.toRgba(a,o,u,h)}}e.toColor=s})(ai||={});var Mt;(e=>{function t(m,f){if($t=(f.rgba&255)/255,$t===1)return{css:f.css,rgba:f.rgba};let p=f.rgba>>24&255,b=f.rgba>>16&255,v=f.rgba>>8&255,x=m.rgba>>24&255,y=m.rgba>>16&255,S=m.rgba>>8&255;_i=x+Math.round((p-x)*$t),vi=y+Math.round((b-y)*$t),xi=S+Math.round((v-S)*$t);let k=ai.toCss(_i,vi,xi),N=ai.toRgba(_i,vi,xi);return{css:k,rgba:N}}e.blend=t;function i(m){return(m.rgba&255)===255}e.isOpaque=i;function s(m,f,p){let b=Jd.ensureContrastRatio(m.rgba,f.rgba,p);if(b)return ai.toColor(b>>24&255,b>>16&255,b>>8&255)}e.ensureContrastRatio=s;function a(m){let f=(m.rgba|255)>>>0;return[_i,vi,xi]=Jd.toChannels(f),{css:ai.toCss(_i,vi,xi),rgba:f}}e.opaque=a;function o(m,f){return $t=Math.round(f*255),[_i,vi,xi]=Jd.toChannels(m.rgba),{css:ai.toCss(_i,vi,xi,$t),rgba:ai.toRgba(_i,vi,xi,$t)}}e.opacity=o;function u(m,f){return $t=m.rgba&255,o(m,$t*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,i;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",i=t.createLinearGradient(0,0,1,1))}catch{}function s(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return _i=parseInt(a.slice(1,2).repeat(2),16),vi=parseInt(a.slice(2,3).repeat(2),16),xi=parseInt(a.slice(3,4).repeat(2),16),ai.toColor(_i,vi,xi);case 5:return _i=parseInt(a.slice(1,2).repeat(2),16),vi=parseInt(a.slice(2,3).repeat(2),16),xi=parseInt(a.slice(3,4).repeat(2),16),$t=parseInt(a.slice(4,5).repeat(2),16),ai.toColor(_i,vi,xi,$t);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 _i=parseInt(o[1]),vi=parseInt(o[2]),xi=parseInt(o[3]),$t=Math.round((o[5]===void 0?1:parseFloat(o[5]))*255),ai.toColor(_i,vi,xi,$t);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=a,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[_i,vi,xi,$t]=t.getImageData(0,0,1,1).data,$t!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:ai.toRgba(_i,vi,xi,$t),css:a}}e.toColor=s})(Pt||={});var qi;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,a,o){let u=s/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=i})(qi||={});var Jd;(e=>{function t(u,h){if($t=(h&255)/255,$t===1)return h;let m=h>>24&255,f=h>>16&255,p=h>>8&255,b=u>>24&255,v=u>>16&255,x=u>>8&255;return _i=b+Math.round((m-b)*$t),vi=v+Math.round((f-v)*$t),xi=x+Math.round((p-x)*$t),ai.toRgba(_i,vi,xi)}e.blend=t;function i(u,h,m){let f=qi.relativeLuminance(u>>8),p=qi.relativeLuminance(h>>8);if(tr(f,p)<m){if(p<f){let x=s(u,h,m),y=tr(f,qi.relativeLuminance(x>>8));if(y<m){let S=a(u,h,m),k=tr(f,qi.relativeLuminance(S>>8));return y>k?x:S}return x}let b=a(u,h,m),v=tr(f,qi.relativeLuminance(b>>8));if(v<m){let x=s(u,h,m),y=tr(f,qi.relativeLuminance(x>>8));return v>y?b:x}return b}}e.ensureContrastRatio=i;function s(u,h,m){let f=u>>24&255,p=u>>16&255,b=u>>8&255,v=h>>24&255,x=h>>16&255,y=h>>8&255,S=tr(qi.relativeLuminance2(v,x,y),qi.relativeLuminance2(f,p,b));for(;S<m&&(v>0||x>0||y>0);)v-=Math.max(0,Math.ceil(v*.1)),x-=Math.max(0,Math.ceil(x*.1)),y-=Math.max(0,Math.ceil(y*.1)),S=tr(qi.relativeLuminance2(v,x,y),qi.relativeLuminance2(f,p,b));return(v<<24|x<<16|y<<8|255)>>>0}e.reduceLuminance=s;function a(u,h,m){let f=u>>24&255,p=u>>16&255,b=u>>8&255,v=h>>24&255,x=h>>16&255,y=h>>8&255,S=tr(qi.relativeLuminance2(v,x,y),qi.relativeLuminance2(f,p,b));for(;S<m&&(v<255||x<255||y<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),S=tr(qi.relativeLuminance2(v,x,y),qi.relativeLuminance2(f,p,b));return(v<<24|x<<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})(Jd||={});function Aa(e){let t=e.toString(16);return t.length<2?"0"+t:t}function tr(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var nI=class extends ru{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}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()]}},xh=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Vn}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 i=[],s=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(s,u,o,t,a);for(let b=0;b<p.length;b++)i.push(p[b])}a=f,u=o,h=this._workCell.fg,m=this._workCell.bg}o+=this._workCell.getChars().length||Xr.length}if(this._bufferService.cols-a>1){let f=this._getJoinedRanges(s,u,o,t,a);for(let p=0;p<f.length;p++)i.push(f[p])}return i}_getJoinedRanges(e,t,i,s,a){let o=e.substring(t,i),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++)xh._mergeRanges(u,m[f])}catch(m){console.error(m)}return this._stringRangesToCellRanges(u,s,a),u}_stringRangesToCellRanges(e,t,i){let s=0,a=!1,o=0,u=e[s];if(u){for(let h=i;h<this._bufferService.cols;h++){let m=t.getWidth(h),f=t.getString(h).length||Xr.length;if(m!==0){if(!a&&u[0]<=o&&(u[0]=h,a=!0),u[1]<=o){if(u[1]=h,u=e[++s],!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 i=!1;for(let s=0;s<e.length;s++){let a=e[s];if(i){if(t[1]<=a[0])return e[s-1][1]=t[1],e;if(t[1]<=a[1])return e[s-1][1]=Math.max(t[1],a[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=a[0])return e.splice(s,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]),i=!0);continue}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};xh=Vt([Se(0,Yi)],xh);function sI(e){return 57508<=e&&e<=57558}function rI(e){return 9472<=e&&e<=9631}function aI(e){return sI(e)||rI(e)}function oI(){return{css:{canvas:Bd(),cell:Bd()},device:{canvas:Bd(),cell:Bd(),char:{width:0,height:0,left:0,top:0}}}}function Bd(){return{width:0,height:0}}var k0=class{constructor(e,t,i,s,a,o,u){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=s,this._coreService=a,this._decorationService=o,this._themeService=u,this._workCell=new Vn,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,s,a,o,u,h,m,f,p){let b=[],v=this._characterJoinerService.getJoinedCharacters(t),x=this._themeService.colors,y=e.getNoBgTrimmedLength();i&&y<o+1&&(y=o+1);let S,k=0,N="",T=0,R=0,A=0,O=0,H=!1,L=0,M=!1,$=0,P=0,F=[],Z=f!==-1&&p!==-1;for(let K=0;K<y;K++){e.loadCell(K,this._workCell);let Q=this._workCell.getWidth();if(Q===0)continue;let q=!1,D=K>=P,Y=K,X=this._workCell;if(v.length>0&&K===v[0][0]&&D){let Be=v.shift(),Lt=this._isCellInSelection(Be[0],t);for(T=Be[0]+1;T<Be[1];T++)D&&=Lt===this._isCellInSelection(T,t);D&&=!i||o<Be[0]||o>=Be[1],D?(q=!0,X=new nI(this._workCell,e.translateToString(!0,Be[0],Be[1]),Be[1]-Be[0]),Y=Be[1]-1,Q=X.getWidth()):P=Be[1]}let V=this._isCellInSelection(K,t),I=i&&K===o,j=Z&&K>=f&&K<=p,W=!1;this._decorationService.forEachDecorationAtCell(K,t,void 0,Be=>{W=!0});let de=X.getChars()||Xr;if(de===" "&&(X.isUnderline()||X.isOverline())&&(de=" "),$=Q*h-m.get(de,X.isBold(),X.isItalic()),!S)S=this._document.createElement("span");else if(k&&(V&&M||!V&&!M&&X.bg===R)&&(V&&M&&x.selectionForeground||X.fg===A)&&X.extended.ext===O&&j===H&&$===L&&!I&&!q&&!W&&D){X.isInvisible()?N+=Xr:N+=de,k++;continue}else k&&(S.textContent=N),S=this._document.createElement("span"),k=0,N="";if(R=X.bg,A=X.fg,O=X.extended.ext,H=j,L=$,M=V,q&&o>=K&&o<=Y&&(o=K),!this._coreService.isCursorHidden&&I&&this._coreService.isCursorInitialized){if(F.push("xterm-cursor"),this._coreBrowserService.isFocused)u&&F.push("xterm-cursor-blink"),F.push(s==="bar"?"xterm-cursor-bar":s==="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(X.isBold()&&F.push("xterm-bold"),X.isItalic()&&F.push("xterm-italic"),X.isDim()&&F.push("xterm-dim"),X.isInvisible()?N=Xr:N=X.getChars()||Xr,X.isUnderline()&&(F.push(`xterm-underline-${X.extended.underlineStyle}`),N===" "&&(N=" "),!X.isUnderlineColorDefault()))if(X.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${ru.toColorRGB(X.getUnderlineColor()).join(",")})`;else{let Be=X.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&X.isBold()&&Be<8&&(Be+=8),S.style.textDecorationColor=x.ansi[Be].css}X.isOverline()&&(F.push("xterm-overline"),N===" "&&(N=" ")),X.isStrikethrough()&&F.push("xterm-strikethrough"),j&&(S.style.textDecoration="underline");let oe=X.getFgColor(),he=X.getFgColorMode(),se=X.getBgColor(),fe=X.getBgColorMode(),we=!!X.isInverse();if(we){let Be=oe;oe=se,se=Be;let Lt=he;he=fe,fe=Lt}let xe,Ze,ot=!1;this._decorationService.forEachDecorationAtCell(K,t,void 0,Be=>{Be.options.layer!=="top"&&ot||(Be.backgroundColorRGB&&(fe=50331648,se=Be.backgroundColorRGB.rgba>>8&16777215,xe=Be.backgroundColorRGB),Be.foregroundColorRGB&&(he=50331648,oe=Be.foregroundColorRGB.rgba>>8&16777215,Ze=Be.foregroundColorRGB),ot=Be.options.layer==="top")}),!ot&&V&&(xe=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,se=xe.rgba>>8&16777215,fe=50331648,ot=!0,x.selectionForeground&&(he=50331648,oe=x.selectionForeground.rgba>>8&16777215,Ze=x.selectionForeground)),ot&&F.push("xterm-decoration-top");let lt;switch(fe){case 16777216:case 33554432:lt=x.ansi[se],F.push(`xterm-bg-${se}`);break;case 50331648:lt=ai.toColor(se>>16,se>>8&255,se&255),this._addStyle(S,`background-color:#${ow((se>>>0).toString(16),"0",6)}`);break;default:we?(lt=x.foreground,F.push("xterm-bg-257")):lt=x.background}switch(xe||X.isDim()&&(xe=Mt.multiplyOpacity(lt,.5)),he){case 16777216:case 33554432:X.isBold()&&oe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(oe+=8),this._applyMinimumContrast(S,lt,x.ansi[oe],X,xe,void 0)||F.push(`xterm-fg-${oe}`);break;case 50331648:let Be=ai.toColor(oe>>16&255,oe>>8&255,oe&255);this._applyMinimumContrast(S,lt,Be,X,xe,Ze)||this._addStyle(S,`color:#${ow(oe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(S,lt,x.foreground,X,xe,Ze)||we&&F.push("xterm-fg-257")}F.length&&(S.className=F.join(" "),F.length=0),!I&&!q&&!W&&D?k++:S.textContent=N,$!==this.defaultSpacing&&(S.style.letterSpacing=`${$}px`),b.push(S),K=Y}return S&&k&&(S.textContent=N),b}_applyMinimumContrast(e,t,i,s,a,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||aI(s.getCode()))return!1;let u=this._getContrastCache(s),h;if(!a&&!o&&(h=u.getColor(t.rgba,i.rgba)),h===void 0){let m=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);h=Mt.ensureContrastRatio(a||t,o||i,m),u.setColor((a||t).rgba,(o||i).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 i=this._selectionStart,s=this._selectionEnd;return!i||!s?!1:this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e<s[0]&&t<=s[1]:e<i[0]&&t>=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t<s[1]||i[1]===s[1]&&t===i[1]&&e>=i[0]&&e<s[0]||i[1]<s[1]&&t===s[1]&&e<s[0]||i[1]<s[1]&&t===i[1]&&e>=i[0]}};k0=Vt([Se(1,JC),Se(2,Xi),Se(3,dr),Se(4,Xa),Se(5,au),Se(6,ll)],k0);function ow(e,t,i){for(;e.length<i;)e=t+e;return e}var lI=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 i=e.createElement("span");i.classList.add("xterm-char-measure-element");let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.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=[i,s,a,o],this._container.appendChild(i),this._container.appendChild(s),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,i,s){e===this._font&&t===this._fontSize&&i===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,i){let s=0;if(!t&&!i&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let u=this._measure(e,0);return u>0&&(this._flat[s]=u),u}let a=e;t&&(a+="B"),i&&(a+="I");let o=this._holey.get(a);if(o===void 0){let u=0;t&&(u|=1),i&&(u|=2),o=this._measure(e,u),o>0&&this._holey.set(a,o)}return o}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},cI=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,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let a=e.buffers.active.ydisp,o=t[1]-a,u=i[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=s,this.viewportStartRow=o,this.viewportEndRow=u,this.viewportCappedStartRow=h,this.viewportCappedEndRow=m,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};function uI(){return new cI}var Mp="xterm-dom-renderer-owner-",zn="xterm-rows",zd="xterm-fg-",lw="xterm-bg-",dc="xterm-focus",Id="xterm-selection",dI=1,C0=class extends Ye{constructor(e,t,i,s,a,o,u,h,m,f,p,b,v,x){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=s,this._viewportElement=a,this._helperContainer=o,this._linkifier2=u,this._charSizeService=m,this._optionsService=f,this._bufferService=p,this._coreService=b,this._coreBrowserService=v,this._themeService=x,this._terminalClass=dI++,this._rowElements=[],this._selectionRenderModel=uI(),this.onRequestRedraw=this._register(new ge).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(zn),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(Id),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=oI(),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(k0,document),this._element.classList.add(Mp+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(Mp+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new lI(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 i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${zn} 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} .${zn} { 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} .${zn} .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 i=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,a=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 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} .${zn}.${dc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${zn}.${dc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${zn}.${dc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${zn} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${zn} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${zn} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${zn} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${zn} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Id} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Id} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Id} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,u]of e.ansi.entries())t+=`${this._terminalSelector} .${zd}${o} { color: ${u.css}; }${this._terminalSelector} .${zd}${o}.xterm-dim { color: ${Mt.multiplyOpacity(u,.5).css}; }${this._terminalSelector} .${lw}${o} { background-color: ${u.css}; }`;t+=`${this._terminalSelector} .${zd}257 { color: ${Mt.opaque(e.background).css}; }${this._terminalSelector} .${zd}257.xterm-dim { color: ${Mt.multiplyOpacity(Mt.opaque(e.background),.5).css}; }${this._terminalSelector} .${lw}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 i=this._rowElements.length;i<=t;i++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}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(dc),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(dc),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,a=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,u=this._selectionRenderModel.viewportCappedEndRow,h=this._document.createDocumentFragment();if(i){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=s===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,i,s=1){let a=this._document.createElement("div"),o=t*this.dimensions.css.cell.width,u=this.dimensions.css.cell.width*(i-t);return o+u>this.dimensions.css.canvas.width&&(u=this.dimensions.css.canvas.width-o),a.style.height=`${s*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 i=this._bufferService.buffer,s=i.ybase+i.y,a=Math.min(i.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+i.ydisp,p=this._rowElements[m],b=i.lines.get(f);if(!p||!b)break;p.replaceChildren(...this._rowFactory.createRow(b,f,f===s,u,h,a,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Mp}${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,i,s,a,o){i<0&&(e=0),s<0&&(t=0);let u=this._bufferService.rows-1;i=Math.max(Math.min(i,u),0),s=Math.max(Math.min(s,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,v=this._optionsService.rawOptions.cursorInactiveStyle;for(let x=i;x<=s;++x){let y=x+h.ydisp,S=this._rowElements[x],k=h.lines.get(y);if(!S||!k)break;S.replaceChildren(...this._rowFactory.createRow(k,y,y===m,b,v,f,p,this.dimensions.css.cell.width,this._widthCache,o?x===i?e:0:-1,o?(x===s?t:a)-1:-1))}}};C0=Vt([Se(7,Ub),Se(8,Fh),Se(9,Xi),Se(10,Yi),Se(11,Xa),Se(12,dr),Se(13,ll)],C0);var N0=class extends Ye{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ge),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new fI(this._optionsService))}catch{this._measureStrategy=this._register(new hI(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())}};N0=Vt([Se(2,Xi)],N0);var _N=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)}},hI=class extends _N{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,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}},fI=class extends _N{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}},mI=class extends Ye{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new pI(this._window)),this._onDprChange=this._register(new ge),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ge),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(Mi.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}},pI=class extends Ye{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new tl),this._onDprChange=this._register(new ge),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)}},gI=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 Wb(e,t,i){let s=i.getBoundingClientRect(),a=e.getComputedStyle(i),o=parseInt(a.getPropertyValue("padding-left")),u=parseInt(a.getPropertyValue("padding-top"));return[t.clientX-s.left-o,t.clientY-s.top-u]}function bI(e,t,i,s,a,o,u,h,m){if(!o)return;let f=Wb(e,t,i);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),s+(m?1:0)),f[1]=Math.min(Math.max(f[1],1),a),f}var T0=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,a){return bI(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(e,t){let i=Wb(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};T0=Vt([Se(0,hr),Se(1,Fh)],T0);var _I=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,i){this._rowCount=i,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=[]}},vN={};TB(vN,{getSafariVersion:()=>xI,isChromeOS:()=>wN,isFirefox:()=>xN,isIpad:()=>yI,isIphone:()=>SI,isLegacyEdge:()=>vI,isLinux:()=>Yb,isMac:()=>yh,isNode:()=>$h,isSafari:()=>yN,isWindows:()=>SN});var $h=typeof process<"u"&&"title"in process,ou=$h?"node":navigator.userAgent,lu=$h?"node":navigator.platform,xN=ou.includes("Firefox"),vI=ou.includes("Edge"),yN=/^((?!chrome|android).)*safari/i.test(ou);function xI(){if(!yN)return 0;let e=ou.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var yh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(lu),yI=lu==="iPad",SI=lu==="iPhone",SN=["Windows","Win16","Win32","WinCE"].includes(lu),Yb=lu.indexOf("Linux")>=0,wN=/\bCrOS\b/.test(ou),EN=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,i=0,s=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),i=Math.max(t,i),a=e.timeRemaining(),i*1.5>a){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=a}this.clear()}},wI=class extends EN{_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())}}},EI=class extends EN{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Sh=!$h&&"requestIdleCallback"in window?EI:wI,kI=class{constructor(){this._queue=new Sh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},A0=class extends Ye{constructor(e,t,i,s,a,o,u,h,m){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=s,this._coreService=a,this._coreBrowserService=h,this._renderer=this._register(new tl),this._pausedResizeTask=new kI,this._observerDisposable=this._register(new tl),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 ge),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ge),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ge),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ge),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new _I((f,p)=>this._renderRows(f,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new CI(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 i=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=Ot(()=>i.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,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.end)),i||(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,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};A0=Vt([Se(2,Xi),Se(3,Fh),Se(4,Xa),Se(5,au),Se(6,Yi),Se(7,dr),Se(8,ll)],A0);var CI=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,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 NI(e,t,i,s){let a=i.buffer.x,o=i.buffer.y;if(!i.buffer.hasScrollback)return MI(a,o,e,t,i,s)+Vh(o,t,i,s)+RI(a,o,e,t,i,s);let u;if(o===t)return u=a>e?"D":"C",Fc(Math.abs(a-e),Hc(u,s));u=o>t?"D":"C";let h=Math.abs(o-t),m=AI(o>t?e:a,i)+(h-1)*i.cols+1+TI(o>t?a:e);return Fc(m,Hc(u,s))}function TI(e,t){return e-1}function AI(e,t){return t.cols-e}function MI(e,t,i,s,a,o){return Vh(t,s,a,o).length===0?"":Fc(CN(e,t,e,t-qa(t,a),!1,a).length,Hc("D",o))}function Vh(e,t,i,s){let a=e-qa(e,i),o=t-qa(t,i),u=Math.abs(a-o)-jI(e,t,i);return Fc(u,Hc(kN(e,t),s))}function RI(e,t,i,s,a,o){let u;Vh(t,s,a,o).length>0?u=s-qa(s,a):u=t;let h=s,m=DI(e,t,i,s,a,o);return Fc(CN(e,u,i,h,m==="C",a).length,Hc(m,o))}function jI(e,t,i){let s=0,a=e-qa(e,i),o=t-qa(t,i);for(let u=0;u<Math.abs(a-o);u++){let h=kN(e,t)==="A"?-1:1;i.buffer.lines.get(a+h*u)?.isWrapped&&s++}return s}function qa(e,t){let i=0,s=t.buffer.lines.get(e),a=s?.isWrapped;for(;a&&e>=0&&e<t.rows;)i++,s=t.buffer.lines.get(--e),a=s?.isWrapped;return i}function DI(e,t,i,s,a,o){let u;return Vh(i,s,a,o).length>0?u=s-qa(s,a):u=t,e<i&&u<=s||e>=i&&u<s?"C":"D"}function kN(e,t){return e>t?"A":"B"}function CN(e,t,i,s,a,o){let u=e,h=t,m="";for(;(u!==i||h!==s)&&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 Hc(e,t){let i=t?"O":"[";return ce.ESC+i+e}function Fc(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}var OI=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 cw(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 Rp=50,LI=15,BI=50,zI=500,II=" ",PI=new RegExp(II,"g"),M0=class extends Ye{constructor(e,t,i,s,a,o,u,h,m){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=a,this._mouseService=o,this._optionsService=u,this._renderService=h,this._coreBrowserService=m,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Vn,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ge),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ge),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ge),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ge),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 OI(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 i=this._bufferService.buffer,s=[];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=i.translateBufferLineToString(u,!0,a,o);s.push(h)}}else{let a=e[1]===t[1]?t[0]:void 0;s.push(i.translateBufferLineToString(e[1],!0,e[0],a));for(let o=e[1]+1;o<=t[1]-1;o++){let u=i.lines.get(o),h=i.translateBufferLineToString(o,!0);u?.isWrapped?s[s.length-1]+=h:s.push(h)}if(e[1]!==t[1]){let o=i.lines.get(t[1]),u=i.translateBufferLineToString(t[1],!0,0,t[0]);o&&o.isWrapped?s[s.length-1]+=u:s.push(u)}}return s.map(a=>a.replace(PI," ")).join(SN?`\r
108
+ `:`
109
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Yb&&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),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s||!t?!1:this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s?!1:this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=cw(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,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=Wb(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-Rp),Rp),t/=Rp,t/Math.abs(t)+Math.round(t*(LI-1)))}shouldForceSelection(e){return yh?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(),BI)}_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&&!(yh&&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 i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let s=i.lines.get(this._model.selectionEnd[1]);s&&s.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<zI&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&i[0]!==void 0&&i[1]!==void 0){let s=NI(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!i){this._oldHasSelection&&this._fireOnSelectionChange(e,t,i);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,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){let a=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:a>1&&t!==s&&(i+=a-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!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,v=0,x=0;if(u.charAt(h)===" "){for(;h>0&&u.charAt(h-1)===" ";)h--;for(;m<u.length&&u.charAt(m+1)===" ";)m++}else{let k=e[0],N=e[0];o.getWidth(k)===0&&(p++,k--),o.getWidth(N)===2&&(b++,N++);let T=o.getString(N).length;for(T>1&&(x+=T-1,m+=T-1);k>0&&h>0&&!this._isCharWordSeparator(o.loadCell(k-1,this._workCell));){o.loadCell(k-1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,k--):R>1&&(v+=R-1,h-=R-1),h--,k--}for(;N<o.length&&m+1<u.length&&!this._isCharWordSeparator(o.loadCell(N+1,this._workCell));){o.loadCell(N+1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===2?(b++,N++):R>1&&(x+=R-1,m+=R-1),m++,N++}}m++;let y=h+f-p+v,S=Math.min(this._bufferService.cols,m-h+p+b-v-x);if(!(!t&&u.slice(h,m).trim()==="")){if(i&&y===0&&o.getCodePoint(0)!==32){let k=a.lines.get(e[1]-1);if(k&&o.isWrapped&&k.getCodePoint(this._bufferService.cols-1)!==32){let N=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(N){let T=this._bufferService.cols-N.start;y-=T,S+=T}}}if(s&&y+S===this._bufferService.cols&&o.getCodePoint(this._bufferService.cols-1)!==32){let k=a.lines.get(e[1]+1);if(k?.isWrapped&&k.getCodePoint(0)!==32){let N=this._getWordAt([0,e[1]+1],!1,!1,!0);N&&(S+=N.length)}}return{start:y,length:S}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={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=cw(i,this._bufferService.cols)}};M0=Vt([Se(3,Yi),Se(4,Xa),Se(5,Hb),Se(6,Xi),Se(7,hr),Se(8,dr)],M0);var uw=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},dw=class{constructor(){this._color=new uw,this._css=new uw}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},ui=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 i=0;i<216;i++){let s=t[i/36%6|0],a=t[i/6%6|0],o=t[i%6];e.push({css:ai.toCss(s,a,o),rgba:ai.toRgba(s,a,o)})}for(let i=0;i<24;i++){let s=8+i*10;e.push({css:ai.toCss(s,s,s),rgba:ai.toRgba(s,s,s)})}return e})()),ja=Pt.toColor("#ffffff"),Sc=Pt.toColor("#000000"),hw=Pt.toColor("#ffffff"),fw=Sc,hc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},UI=ja,R0=class extends Ye{constructor(e){super(),this._optionsService=e,this._contrastCache=new dw,this._halfContrastCache=new dw,this._onChangeColors=this._register(new ge),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:ja,background:Sc,cursor:hw,cursorAccent:fw,selectionForeground:void 0,selectionBackgroundTransparent:hc,selectionBackgroundOpaque:Mt.blend(Sc,hc),selectionInactiveBackgroundTransparent:hc,selectionInactiveBackgroundOpaque:Mt.blend(Sc,hc),scrollbarSliderBackground:Mt.opacity(ja,.2),scrollbarSliderHoverBackground:Mt.opacity(ja,.4),scrollbarSliderActiveBackground:Mt.opacity(ja,.5),overviewRulerBorder:ja,ansi:ui.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=yt(e.foreground,ja),t.background=yt(e.background,Sc),t.cursor=Mt.blend(t.background,yt(e.cursor,hw)),t.cursorAccent=Mt.blend(t.background,yt(e.cursorAccent,fw)),t.selectionBackgroundTransparent=yt(e.selectionBackground,hc),t.selectionBackgroundOpaque=Mt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=yt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Mt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?yt(e.selectionForeground,aw):void 0,t.selectionForeground===aw&&(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=yt(e.scrollbarSliderBackground,Mt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=yt(e.scrollbarSliderHoverBackground,Mt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=yt(e.scrollbarSliderActiveBackground,Mt.opacity(t.foreground,.5)),t.overviewRulerBorder=yt(e.overviewRulerBorder,UI),t.ansi=ui.slice(),t.ansi[0]=yt(e.black,ui[0]),t.ansi[1]=yt(e.red,ui[1]),t.ansi[2]=yt(e.green,ui[2]),t.ansi[3]=yt(e.yellow,ui[3]),t.ansi[4]=yt(e.blue,ui[4]),t.ansi[5]=yt(e.magenta,ui[5]),t.ansi[6]=yt(e.cyan,ui[6]),t.ansi[7]=yt(e.white,ui[7]),t.ansi[8]=yt(e.brightBlack,ui[8]),t.ansi[9]=yt(e.brightRed,ui[9]),t.ansi[10]=yt(e.brightGreen,ui[10]),t.ansi[11]=yt(e.brightYellow,ui[11]),t.ansi[12]=yt(e.brightBlue,ui[12]),t.ansi[13]=yt(e.brightMagenta,ui[13]),t.ansi[14]=yt(e.brightCyan,ui[14]),t.ansi[15]=yt(e.brightWhite,ui[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<i;s++)t.ansi[s+16]=yt(e.extendedAnsi[s],ui[s+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()}}};R0=Vt([Se(0,Xi)],R0);function yt(e,t){if(e!==void 0)try{return Pt.toColor(e)}catch{}return t}var HI=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(let[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},FI=class{constructor(){this._services=new HI,this._services.set(Ub,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=LB(e).sort((o,u)=>o.index-u.index),s=[];for(let o of i){let u=this._services.get(o.id);if(!u)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${o.id._id}.`);s.push(u)}let a=i.length>0?i[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,...s)}},$I={trace:0,debug:1,info:2,warn:3,error:4,off:5},VI="xterm.js: ",j0=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=$I[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,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":VI)+t,...i)}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)}};j0=Vt([Se(0,Xi)],j0);var mw=class extends Ye{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ge),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ge),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ge),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 i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];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,...i){if(t){for(let s=e;s<this._length-t;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<i.length;s++)this._array[this._getCyclicIndex(e+s)]=i[s];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let a=t-1;a>=0;a--)this.set(e+a+i,this.get(e+a));let s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+i,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ke=3,ni=Object.freeze(new ru),Pd=0,jp=2,wc=class NN{constructor(t,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ke);let a=i||Vn.fromCharData([0,GC,1,0]);for(let o=0;o<t;++o)this.setCell(o,a);this.length=t}get(t){let i=this._data[t*Ke+0],s=i&2097151;return[this._data[t*Ke+1],i&2097152?this._combined[t]:s?Wr(s):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*Ke+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*Ke+0]=t|2097152|i[2]<<22):this._data[t*Ke+0]=i[1].charCodeAt(0)|i[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 i=this._data[t*Ke+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*Ke+0]&2097152}getString(t){let i=this._data[t*Ke+0];return i&2097152?this._combined[t]:i&2097151?Wr(i&2097151):""}isProtected(t){return this._data[t*Ke+2]&536870912}loadCell(t,i){return Pd=t*Ke,i.content=this._data[Pd+0],i.fg=this._data[Pd+1],i.bg=this._data[Pd+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*Ke+0]=i.content,this._data[t*Ke+1]=i.fg,this._data[t*Ke+2]=i.bg}setCellFromCodepoint(t,i,s,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*Ke+0]=i|s<<22,this._data[t*Ke+1]=a.fg,this._data[t*Ke+2]=a.bg}addCodepointToCell(t,i,s){let a=this._data[t*Ke+0];a&2097152?this._combined[t]+=Wr(i):a&2097151?(this._combined[t]=Wr(a&2097151)+Wr(i),a&=-2097152,a|=2097152):a=i|1<<22,s&&(a&=-12582913,a|=s<<22),this._data[t*Ke+0]=a}insertCells(t,i,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length-t){let a=new Vn;for(let o=this.length-t-i-1;o>=0;--o)this.setCell(t+i+o,this.loadCell(t+o,a));for(let o=0;o<i;++o)this.setCell(t+o,s)}else for(let a=t;a<this.length;++a)this.setCell(a,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(t,i,s){if(t%=this.length,i<this.length-t){let a=new Vn;for(let o=0;o<this.length-t-i;++o)this.setCell(t+o,this.loadCell(t+i+o,a));for(let o=this.length-i;o<this.length;++o)this.setCell(o,s)}else for(let a=t;a<this.length;++a)this.setCell(a,s);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,s)}replaceCells(t,i,s,a=!1){if(a){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,s),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.setCell(t++,s)}resize(t,i){if(t===this.length)return this._data.length*4*jp<this._data.buffer.byteLength;let s=t*Ke;if(t>this.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let a=new Uint32Array(s);a.set(this._data),this._data=a}for(let a=this.length;a<t;++a)this.setCell(a,i)}else{this._data=this._data.subarray(0,s);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,s*4*jp<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*jp<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i){for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,t);return}this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,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 i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(let i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){let t=new NN(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let i in this._combined)t._combined[i]=this._combined[i];for(let i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];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,i,s,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[(s+m)*Ke+f]=u[(i+m)*Ke+f];u[(i+m)*Ke+2]&268435456&&(this._extendedAttrs[s+m]=t._extendedAttrs[i+m])}else for(let m=0;m<a;m++){for(let f=0;f<Ke;f++)this._data[(s+m)*Ke+f]=u[(i+m)*Ke+f];u[(i+m)*Ke+2]&268435456&&(this._extendedAttrs[s+m]=t._extendedAttrs[i+m])}let h=Object.keys(t._combined);for(let m=0;m<h.length;m++){let f=parseInt(h[m],10);f>=i&&(this._combined[f-i+s]=t._combined[f])}}translateToString(t,i,s,a){i=i??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),a&&(a.length=0);let o="";for(;i<s;){let u=this._data[i*Ke+0],h=u&2097151,m=u&2097152?this._combined[i]:h?Wr(h):Xr;if(o+=m,a)for(let f=0;f<m.length;++f)a.push(i);i+=u>>22||1}return a&&a.push(i),o}};function qI(e,t,i,s,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&&s>=h&&s<m){h+=p.length-1;continue}let b=0,v=$c(p,b,t),x=1,y=0;for(;x<p.length;){let k=$c(p,x,t),N=k-y,T=i-v,R=Math.min(N,T);p[b].copyCellsFrom(p[x],y,v,R,!1),v+=R,v===i&&(b++,v=0),y+=R,y===k&&(x++,y=0),v===0&&b!==0&&p[b-1].getWidth(i-1)===2&&(p[b].copyCellsFrom(p[b-1],i-1,v++,1,!1),p[b-1].setCell(i-1,a))}p[b].replaceCells(v,i,a);let S=0;for(let k=p.length-1;k>0&&(k>b||p[k].getTrimmedLength()===0);k--)S++;S>0&&(u.push(h+p.length-S),u.push(S)),h+=p.length-1}return u}function GI(e,t){let i=[],s=0,a=t[s],o=0;for(let u=0;u<e.length;u++)if(a===u){let h=t[++s];e.onDeleteEmitter.fire({index:u-o,amount:h}),u+=h-1,o+=h,a=t[++s]}else i.push(u);return{layout:i,countRemoved:o}}function KI(e,t){let i=[];for(let s=0;s<t.length;s++)i.push(e.get(t[s]));for(let s=0;s<i.length;s++)e.set(s,i[s]);e.length=t.length}function WI(e,t,i){let s=[],a=e.map((m,f)=>$c(e,f,t)).reduce((m,f)=>m+f),o=0,u=0,h=0;for(;h<a;){if(a-h<i){s.push(a-h);break}o+=i;let m=$c(e,u,t);o>m&&(o-=m,u++);let f=e[u].getWidth(o-1)===2;f&&o--;let p=f?i-1:i;s.push(p),h+=p}return s}function $c(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,a=e[t+1].getWidth(0)===2;return s&&a?i-1:i}var TN=class AN{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=AN._nextId++,this._onDispose=this.register(new ge),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Va(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};TN._nextId=1;var YI=TN,mi={},Da=mi.B;mi[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:"≥","{":"π","|":"≠","}":"£","~":"·"};mi.A={"#":"£"};mi.B=void 0;mi[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};mi.C=mi[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};mi.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};mi.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};mi.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};mi.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};mi.E=mi[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};mi.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};mi.H=mi[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};mi["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var pw=4294967295,gw=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=ni.clone(),this.savedCharset=Da,this.markers=[],this._nullCell=Vn.fromCharData([0,GC,1,0]),this._whitespaceCell=Vn.fromCharData([0,Xr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Sh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new mw(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 _h),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 _h),this._whitespaceCell}getBlankLine(e,t){return new wc(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>pw?pw:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=ni);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 mw(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(ni),s=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++)s+=+this.lines.get(u).resize(e,i);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 wc(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new wc(e,i)));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++)s+=+this.lines.get(o).resize(e,i);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),s>.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 i=this._optionsService.rawOptions.reflowCursorLine,s=qI(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(ni),i);if(s.length>0){let a=GI(this.lines,s);KI(this.lines,a.layout),this._reflowLargerAdjustViewport(e,t,a.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let s=this.getNullCell(ni),a=i;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new wc(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=this.getNullCell(ni),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(!i){let R=this.ybase+this.y;if(R>=u&&R<u+m.length)continue}let f=m[m.length-1].getTrimmedLength(),p=WI(m,this._cols,e),b=p.length-m.length,v;this.ybase===0&&this.y!==this.lines.length-1?v=Math.max(0,this.y-this.lines.maxLength+b):v=Math.max(0,this.lines.length-this.lines.maxLength+b);let x=[];for(let R=0;R<b;R++){let A=this.getBlankLine(ni,!0);x.push(A)}x.length>0&&(a.push({start:u+m.length+o,newLines:x}),o+=x.length),m.push(...x);let y=p.length-1,S=p[y];S===0&&(y--,S=p[y]);let k=m.length-b-1,N=f;for(;k>=0;){let R=Math.min(N,S);if(m[y]===void 0)break;if(m[y].copyCellsFrom(m[k],N-R,S-R,R,!0),S-=R,S===0&&(y--,S=p[y]),N-=R,N===0){k--;let A=Math.max(k,0);N=$c(m,A,this._cols)}}for(let R=0;R<m.length;R++)p[R]<e&&m[R].setCell(p[R],s);let T=b-v;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 v=0;for(let S=Math.min(this.lines.maxLength-1,m+o-1);S>=0;S--)if(b&&b.start>f+v){for(let k=b.newLines.length-1;k>=0;k--)this.lines.set(S--,b.newLines[k]);S++,u.push({index:f+1,amount:b.newLines.length}),v+=b.newLines.length,b=a[++p]}else this.lines.set(S,h[f--]);let x=0;for(let S=u.length-1;S>=0;S--)u[S].index+=x,this.lines.onInsertEmitter.fire(u[S]),x+=u[S].amount;let y=Math.max(0,m+o-this.lines.maxLength);y>0&&this.lines.onTrimEmitter.fire(y)}}translateBufferLineToString(e,t,i=0,s){let a=this.lines.get(e);return a?a.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}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 YI(e);return this.markers.push(t),t.register(this.lines.onTrim(i=>{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.line<i.index+i.amount&&t.dispose(),t.line>i.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},XI=class extends Ye{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new ge),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 gw(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new gw(!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)}},MN=2,RN=1,D0=class extends Ye{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ge),this.onResize=this._onResize.event,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,MN),this.rows=Math.max(e.rawOptions.rows||0,RN),this.buffers=this._register(new XI(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let a=i.ybase+i.scrollTop,o=i.ybase+i.scrollBottom;if(i.scrollTop===0){let u=i.lines.isFull;o===i.lines.length-1?u?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(o+1,0,s.clone()),u?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let u=o-a+1;i.lines.shiftElements(a+1,u-1,-1),i.lines.set(o,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),s!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};D0=Vt([Se(0,Xi)],D0);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:yh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},ZI=["normal","bold","100","200","300","400","500","600","700","800","900"],QI=class extends Ye{constructor(e){super(),this._onOptionChange=this._register(new ge),this.onOptionChange=this._onOptionChange.event;let t={...Ho};for(let i in e)if(i in t)try{let s=e[i];t[i]=this._sanitizeAndValidateOption(i,s)}catch(s){console.error(s)}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(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in Ho))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in Ho))throw new Error(`No option with key "${i}"`);s=this._sanitizeAndValidateOption(i,s),this.rawOptions[i]!==s&&(this.rawOptions[i]=s,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let s={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Ho[e]),!JI(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=ZI.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 JI(e){return e==="block"||e==="underline"||e==="bar"}function Ec(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let s in e)i[s]=t<=1?e[s]:e[s]&&Ec(e[s],t-1);return i}var bw=Object.freeze({insertMode:!1}),_w=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),O0=class extends Ye{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new ge),this.onData=this._onData.event,this._onUserInput=this._register(new ge),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ge),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ge),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Ec(bw),this.decPrivateModes=Ec(_w)}reset(){this.modes=Ec(bw),this.decPrivateModes=Ec(_w)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.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))}};O0=Vt([Se(0,Yi),Se(1,ZC),Se(2,Xi)],O0);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 Dp(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}var Op=String.fromCharCode,xw={DEFAULT:e=>{let t=[Dp(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Op(t[0])}${Op(t[1])}${Op(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Dp(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Dp(e,!0)};${e.x};${e.y}${t}`}},L0=class extends Ye{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new ge),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(vw))this.addProtocol(s,vw[s]);for(let s of Object.keys(xw))this.addEncoding(s,xw[s]);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,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let s=t/i,a=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=s+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,i){if(i){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)}};L0=Vt([Se(0,Yi),Se(1,Xa),Se(2,Xi)],L0);var Lp=[[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]],eP=[[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]],di;function tP(e,t){let i=0,s=t.length-1,a;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(a=i+s>>1,e>t[a][1])i=a+1;else if(e<t[a][0])s=a-1;else return!0;return!1}var iP=class{constructor(){if(this.version="6",!di){di=new Uint8Array(65536),di.fill(1),di[0]=0,di.fill(0,1,32),di.fill(0,127,160),di.fill(2,4352,4448),di[9001]=2,di[9002]=2,di.fill(2,11904,42192),di[12351]=1,di.fill(2,44032,55204),di.fill(2,63744,64256),di.fill(2,65040,65050),di.fill(2,65072,65136),di.fill(2,65280,65377),di.fill(2,65504,65511);for(let e=0;e<Lp.length;++e)di.fill(0,Lp[e][0],Lp[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?di[e]:tP(e,eP)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let a=za.extractWidth(t);a===0?s=!1:a>i&&(i=a)}return za.createPropertyValue(0,i,s)}},za=class eh{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ge,this.onChange=this._onChange.event;let t=new iP;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,i,s=!1){return(t&16777215)<<3|(i&3)<<1|(s?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 i=0,s=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 i+this.wcwidth(u);let f=t.charCodeAt(o);56320<=f&&f<=57343?u=(u-55296)*1024+f-56320+65536:i+=this.wcwidth(f)}let h=this.charProperties(u,s),m=eh.extractWidth(h);eh.extractShouldJoin(h)&&(m-=eh.extractWidth(s)),i+=m,s=h}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},nP=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 yw(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}var fc=2147483647,sP=256,jN=class B0{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>sP)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new B0;if(!t.length)return i;for(let s=Array.isArray(t[0])?1:0;s<t.length;++s){let a=t[s];if(Array.isArray(a))for(let o=0;o<a.length;++o)i.addSubParam(a[o]);else i.addParam(a)}return i}clone(){let t=new B0(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 i=0;i<this.length;++i){t.push(this.params[i]);let s=this._subParamsIdx[i]>>8,a=this._subParamsIdx[i]&255;a-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,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>fc?fc: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>fc?fc:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,s=this._subParamsIdx[t]&255;return s-i>0?this._subParams.subarray(i,s):null}getSubParamsAll(){let t={};for(let i=0;i<this.length;++i){let s=this._subParamsIdx[i]>>8,a=this._subParamsIdx[i]&255;a-s>0&&(t[i]=this._subParams.slice(s,a))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,a=s[i-1];s[i-1]=~a?Math.min(a*10+t,fc):t}},mc=[],rP=class{constructor(){this._state=0,this._active=mc,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 i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,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=mc}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=mc,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||mc,!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,i){if(!this._active.length)this._handlerFb(this._id,"PUT",Hh(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t<i;){let s=e[t++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-48}this._state===2&&i-t>0&&this._put(e,t,i)}}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 i=!1,s=this._active.length-1,a=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&i===!1){for(;s>=0&&(i=this._active[s].end(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=mc,this._id=-1,this._state=0}}},yn=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Hh(e,t,i),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(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},pc=[],aP=class{constructor(){this._handlers=Object.create(null),this._active=pc,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=pc}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,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=pc,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||pc,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",Hh(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,s=this._active.length-1,a=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&i===!1){for(;s>=0&&(i=this._active[s].unhook(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=pc,this._ident=0}},kc=new jN;kc.addParam(0);var Sw=class{constructor(e){this._handler=e,this._data="",this._params=kc,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():kc,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Hh(e,t,i),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(i=>(this._params=kc,this._data="",this._hitLimit=!1,i));return this._params=kc,this._data="",this._hitLimit=!1,t}},oP=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let a=0;a<e.length;a++)this.table[t<<8|e[a]]=i<<4|s}},Hn=160,lP=(function(){let e=new oP(4095),t=Array.apply(null,Array(256)).map((h,m)=>m),i=(h,m)=>t.slice(h,m),s=i(32,127),a=i(0,24);a.push(25),a.push.apply(a,i(28,32));let o=i(0,14),u;e.setDefault(1,0),e.addMany(s,0,2,0);for(u in o)e.addMany([24,26,153,154],u,3,0),e.addMany(i(128,144),u,3,0),e.addMany(i(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(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,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(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(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(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(a,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(a,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(a,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(a,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Hn,0,2,0),e.add(Hn,8,5,8),e.add(Hn,6,0,6),e.add(Hn,11,0,11),e.add(Hn,13,13,13),e})(),cP=class extends Ye{constructor(e=lP){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 jN,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,s)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},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 rP),this._dcsParser=this._register(new aP),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>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");i<<=8,i|=o}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}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 i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let s=this._escHandlers[i];return s.push(t),{dispose:()=>{let a=s.indexOf(t);a!==-1&&s.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 i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let s=this._csiHandlers[i];return s.push(t),{dispose:()=>{let a=s.indexOf(t);a!==-1&&s.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,i,s,a){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=a}parse(e,t,i){let s=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(i===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(i===!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(i===!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(s=e[this._parseStack.chunkPos],u=this._dcsParser.unhook(s!==24&&s!==26,i),u)return u;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],u=this._oscParser.end(s!==24&&s!==26,i),u)return u;s===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(s=e[h],a=this._transitions.table[this.currentState<<8|(s<160?s:Hn)],a>>4){case 2:for(let v=h+1;;++v){if(v>=t||(s=e[v])<32||s>126&&s<Hn){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(s=e[v])<32||s>126&&s<Hn){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(s=e[v])<32||s>126&&s<Hn){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(s=e[v])<32||s>126&&s<Hn){this._printHandler(e,h,v),h=v-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let m=this._csiHandlers[this._collect<<8|s],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|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++h<t&&(s=e[h])>47&&s<60);h--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let p=this._escHandlers[this._collect<<8|s],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|s),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|s,this._params);break;case 13:for(let v=h+1;;++v)if(v>=t||(s=e[v])===24||s===26||s===27||s>127&&s<Hn){this._dcsParser.put(e,h,v),h=v-1;break}break;case 14:if(u=this._dcsParser.unhook(s!==24&&s!==26),u)return this._preserveStack(6,[],0,a,h),u;s===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 v=h+1;;v++)if(v>=t||(s=e[v])<32||s>127&&s<Hn){this._oscParser.put(e,h,v),h=v-1;break}break;case 6:if(u=this._oscParser.end(s!==24&&s!==26),u)return this._preserveStack(5,[],0,a,h),u;s===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=a&15}}},uP=/^([\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})$/,dP=/^[\da-f]+$/;function ww(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=uP.exec(t);if(i){let s=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/s*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/s*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/s*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),dP.exec(t)&&[3,6,9,12].includes(t.length))){let i=t.length/3,s=[0,0,0];for(let a=0;a<3;++a){let o=parseInt(t.slice(i*a,i*a+i),16);s[a]=i===1?o<<4:i===2?o:i===3?o>>4:o>>8}return s}}function Bp(e,t){let i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function hP(e,t=16){let[i,s,a]=e;return`rgb:${Bp(i,t)}/${Bp(s,t)}/${Bp(a,t)}`}var fP={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Gr=131072,Ew=10;function kw(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 Cw=5e3,Nw=0,mP=class extends Ye{constructor(e,t,i,s,a,o,u,h,m=new cP){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=a,this._oscLinkService=o,this._coreMouseService=u,this._unicodeService=h,this._parser=m,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new DB,this._utf8Decoder=new OB,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=ni.clone(),this._eraseAttrDataInternal=ni.clone(),this._onRequestBell=this._register(new ge),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ge),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ge),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ge),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ge),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ge),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ge),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ge),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ge),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ge),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ge),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ge),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 z0(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(ce.BEL,()=>this.bell()),this._parser.setExecuteHandler(ce.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ce.BS,()=>this.backspace()),this._parser.setExecuteHandler(ce.HT,()=>this.tab()),this._parser.setExecuteHandler(ce.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ce.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Qd.IND,()=>this.index()),this._parser.setExecuteHandler(Qd.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Qd.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new yn(f=>(this.setTitle(f),this.setIconName(f),!0))),this._parser.registerOscHandler(1,new yn(f=>this.setIconName(f))),this._parser.registerOscHandler(2,new yn(f=>this.setTitle(f))),this._parser.registerOscHandler(4,new yn(f=>this.setOrReportIndexedColor(f))),this._parser.registerOscHandler(8,new yn(f=>this.setHyperlink(f))),this._parser.registerOscHandler(10,new yn(f=>this.setOrReportFgColor(f))),this._parser.registerOscHandler(11,new yn(f=>this.setOrReportBgColor(f))),this._parser.registerOscHandler(12,new yn(f=>this.setOrReportCursorColor(f))),this._parser.registerOscHandler(104,new yn(f=>this.restoreIndexedColor(f))),this._parser.registerOscHandler(110,new yn(f=>this.restoreFgColor(f))),this._parser.registerOscHandler(111,new yn(f=>this.restoreBgColor(f))),this._parser.registerOscHandler(112,new yn(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 mi)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 Sw((f,p)=>this.requestStatusString(f,p)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),Cw))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Cw} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,a=this._activeBuffer.y,o=0,u=this._parseStack.paused;if(u){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,a=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Gr&&(o=this._parseStack.position+Gr)}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<Gr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Gr))),u||this._dirtyRowTracker.clearRange(),e.length>Gr)for(let f=o;f<e.length;f+=Gr){let p=f+Gr<e.length?f+Gr: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(i=this._parser.parse(this._parseBuffer,b))return this._preserveStack(s,a,b,f),this._logSlowResolvingAsync(i),i}else if(!u){let f=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,f))return this._preserveStack(s,a,f,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==s||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,i){let s,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&&i-t>0&&b.getWidth(this._activeBuffer.x-1)===2&&b.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let v=this._parser.precedingJoinState;for(let x=t;x<i;++x){if(s=e[x],s<127&&o){let N=o[String.fromCharCode(s)];N&&(s=N.charCodeAt(0))}let y=this._unicodeService.charProperties(s,v);a=za.extractWidth(y);let S=za.extractShouldJoin(y),k=S?za.extractWidth(v):0;if(v=y,u&&this._onA11yChar.fire(Wr(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-k>h){if(m){let N=b,T=this._activeBuffer.x-k;for(this._activeBuffer.x=k,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),k>0&&b instanceof wc&&b.copyCellsFrom(N,T,0,k,!1);T<h;)N.setCellFromCodepoint(T++,0,1,p)}else if(this._activeBuffer.x=h-1,a===2)continue}if(S&&this._activeBuffer.x){let N=b.getWidth(this._activeBuffer.x-1)?1:2;b.addCodepointToCell(this._activeBuffer.x-N,s,a);for(let T=a-k;--T>=0;)b.setCellFromCodepoint(this._activeBuffer.x++,0,0,p);continue}if(f&&(b.insertCells(this._activeBuffer.x,a-k,this._activeBuffer.getNullCell(p)),b.getWidth(h-1)===2&&b.setCellFromCodepoint(h-1,0,1,p)),b.setCellFromCodepoint(this._activeBuffer.x++,s,a,p),a>0)for(;--a;)b.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=v,this._activeBuffer.x<h&&i-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,i=>kw(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Sw(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new yn(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,i,s=!1,a=!1){let o=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);o.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),a),s&&(o.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,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 i=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,a=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(a-1,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}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 i=this._activeBuffer.ybase+this._activeBuffer.y,s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(i,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}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(ni));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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 i=e.params[0]||1,s=za.extractWidth(t),a=this._activeBuffer.x-s,o=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),u=new Uint32Array(o.length*i),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<i;++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(ce.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ce.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ce.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ce.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ce.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,Da),this._charsetService.setgCharset(1,Da),this._charsetService.setgCharset(2,Da),this._charsetService.setgCharset(3,Da);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 i;(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"))(i||={});let s=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,v=(S,k)=>(u.triggerDataEvent(`${ce.ESC}[${t?"":"?"}${S};${k}$y`),!0),x=S=>S?1:2,y=e.params[0];return t?y===2?v(y,4):y===4?v(y,x(u.modes.insertMode)):y===12?v(y,3):y===20?v(y,x(b.convertEol)):v(y,0):y===1?v(y,x(s.applicationCursorKeys)):y===3?v(y,b.windowOptions.setWinLines?m===80?2:m===132?1:0:0):y===6?v(y,x(s.origin)):y===7?v(y,x(s.wraparound)):y===8?v(y,3):y===9?v(y,x(a==="X10")):y===12?v(y,x(b.cursorBlink)):y===25?v(y,x(!u.isCursorHidden)):y===45?v(y,x(s.reverseWraparound)):y===66?v(y,x(s.applicationKeypad)):y===67?v(y,4):y===1e3?v(y,x(a==="VT200")):y===1002?v(y,x(a==="DRAG")):y===1003?v(y,x(a==="ANY")):y===1004?v(y,x(s.sendFocus)):y===1005?v(y,4):y===1006?v(y,x(o==="SGR")):y===1015?v(y,4):y===1016?v(y,x(o==="SGR_PIXELS")):y===1048?v(y,1):y===47||y===1047||y===1049?v(y,x(f===p)):y===2004?v(y,x(s.bracketedPasteMode)):y===2026?v(y,x(s.synchronizedOutput)):v(y,0)}_updateAttrColor(e,t,i,s,a){return t===2?(e|=50331648,e&=-16777216,e|=ru.fromColorRGB([i,s,a])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let s=[0,0,-1,0,0,0],a=0,o=0;do{if(s[o+a]=e.params[t+o],e.hasSubParams(t+o)){let u=e.getSubParams(t+o),h=0;do s[1]===5&&(a=1),s[o+h+1+a]=u[h];while(++h<u.length&&h+o+1+a<s.length);break}if(s[1]===5&&o+a>=2||s[1]===2&&o+a>=5)break;s[1]&&(a=1)}while(++o+t<e.length&&o+a<s.length);for(let u=2;u<s.length;++u)s[u]===-1&&(s[u]=0);switch(s[0]){case 38:i.fg=this._updateAttrColor(i.fg,s[1],s[3],s[4],s[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,s[1],s[3],s[4],s[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,s[1],s[3],s[4],s[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=ni.fg,e.bg=ni.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,i,s=this._curAttrData;for(let a=0;a<t;a++)i=e.params[a],i>=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777216|i-90|8):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777216|i-100|8):i===0?this._processSGR0(s):i===1?s.fg|=134217728:i===3?s.bg|=67108864:i===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(a)?e.getSubParams(a)[0]:1,s)):i===5?s.fg|=536870912:i===7?s.fg|=67108864:i===8?s.fg|=1073741824:i===9?s.fg|=2147483648:i===2?s.bg|=134217728:i===21?this._processUnderline(2,s):i===22?(s.fg&=-134217729,s.bg&=-134217729):i===23?s.bg&=-67108865:i===24?(s.fg&=-268435457,this._processUnderline(0,s)):i===25?s.fg&=-536870913:i===27?s.fg&=-67108865:i===28?s.fg&=-1073741825:i===29?s.fg&=2147483647:i===39?(s.fg&=-67108864,s.fg|=ni.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=ni.bg&16777215):i===38||i===48||i===58?a+=this._extractColor(e,a,s):i===53?s.bg|=1073741824:i===55?s.bg&=-1073741825:i===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):i===100?(s.fg&=-67108864,s.fg|=ni.fg&16777215,s.bg&=-67108864,s.bg|=ni.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${ce.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[?${t};${i}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=ni.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 i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!kw(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(`${ce.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Ew&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Ew&&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=[],i=e.split(";");for(;i.length>1;){let s=i.shift(),a=i.shift();if(/^\d+$/.exec(s)){let o=parseInt(s);if(Tw(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 i=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(i,s):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),s,a=i.findIndex(o=>o.startsWith("id="));return a!==-1&&(s=i[a].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,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 i=e.split(";");for(let s=0;s<i.length&&!(t>=this._specialColors.length);++s,++t)if(i[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let a=ww(i[s]);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=[],i=e.split(";");for(let s=0;s<i.length;++s)if(/^\d+$/.exec(i[s])){let a=parseInt(i[s]);Tw(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,Da),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(fP[e[0]],mi[e[1]]||Da),!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=ni.clone(),this._eraseAttrDataInternal=ni.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 Vn;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 i=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(i);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let i=u=>(this._coreService.triggerDataEvent(`${ce.ESC}${u}${ce.ESC}\\`),!0),s=this._bufferService.buffer,a=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${s.scrollTop+1};${s.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)}},z0=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&&(Nw=e,e=t,t=Nw),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};z0=Vt([Se(0,Yi)],z0);function Tw(e){return 0<=e&&e<256}var pP=5e7,Aw=12,gP=50,bP=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 ge),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 i;for(;i=this._writeBuffer.shift();){this._action(i);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>pP)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 i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],a=this._action(s,t);if(a){let u=h=>performance.now()-i>=Aw?setTimeout(()=>this._innerWrite(0,h)):this._innerWrite(i,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-=s.length,performance.now()-i>=Aw)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>gP&&(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()}},I0=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 i=e,s=this._getEntryIdKey(i),a=this._entriesWithId.get(s);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(i),data:i,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 i=this._dataByLinkId.get(e);if(i&&i.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);i.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(i,s))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};I0=Vt([Se(0,Yi)],I0);var Mw=!1,_P=class extends Ye{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new tl),this._onBinary=this._register(new ge),this.onBinary=this._onBinary.event,this._onData=this._register(new ge),this.onData=this._onData.event,this._onLineFeed=this._register(new ge),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ge),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ge),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ge),this._instantiationService=new FI,this.optionsService=this._register(new QI(e)),this._instantiationService.setService(Xi,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(D0)),this._instantiationService.setService(Yi,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(j0)),this._instantiationService.setService(ZC,this._logService),this.coreService=this._register(this._instantiationService.createInstance(O0)),this._instantiationService.setService(Xa,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(L0)),this._instantiationService.setService(XC,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(za)),this._instantiationService.setService(IB,this.unicodeService),this._charsetService=this._instantiationService.createInstance(nP),this._instantiationService.setService(zB,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(I0),this._instantiationService.setService(QC,this._oscLinkService),this._inputHandler=this._register(new mP(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Mi.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Mi.forward(this._bufferService.onResize,this._onResize)),this._register(Mi.forward(this.coreService.onData,this._onData)),this._register(Mi.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 bP((t,i)=>this._inputHandler.parse(t,i))),this._register(Mi.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new ge),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&&!Mw&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Mw=!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,MN),t=Math.max(t,RN),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(yw.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(yw(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Ot(()=>{for(let t of e)t.dispose()})}}},vP={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 xP(e,t,i,s){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=ce.ESC+"OA":a.key=ce.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?a.key=ce.ESC+"OD":a.key=ce.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?a.key=ce.ESC+"OC":a.key=ce.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?a.key=ce.ESC+"OB":a.key=ce.ESC+"[B");break;case 8:a.key=e.ctrlKey?"\b":ce.DEL,e.altKey&&(a.key=ce.ESC+a.key);break;case 9:if(e.shiftKey){a.key=ce.ESC+"[Z";break}a.key=ce.HT,a.cancel=!0;break;case 13:a.key=e.altKey?ce.ESC+ce.CR:ce.CR,a.cancel=!0;break;case 27:a.key=ce.ESC,e.altKey&&(a.key=ce.ESC+ce.ESC),a.cancel=!0;break;case 37:if(e.metaKey)break;o?a.key=ce.ESC+"[1;"+(o+1)+"D":t?a.key=ce.ESC+"OD":a.key=ce.ESC+"[D";break;case 39:if(e.metaKey)break;o?a.key=ce.ESC+"[1;"+(o+1)+"C":t?a.key=ce.ESC+"OC":a.key=ce.ESC+"[C";break;case 38:if(e.metaKey)break;o?a.key=ce.ESC+"[1;"+(o+1)+"A":t?a.key=ce.ESC+"OA":a.key=ce.ESC+"[A";break;case 40:if(e.metaKey)break;o?a.key=ce.ESC+"[1;"+(o+1)+"B":t?a.key=ce.ESC+"OB":a.key=ce.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(a.key=ce.ESC+"[2~");break;case 46:o?a.key=ce.ESC+"[3;"+(o+1)+"~":a.key=ce.ESC+"[3~";break;case 36:o?a.key=ce.ESC+"[1;"+(o+1)+"H":t?a.key=ce.ESC+"OH":a.key=ce.ESC+"[H";break;case 35:o?a.key=ce.ESC+"[1;"+(o+1)+"F":t?a.key=ce.ESC+"OF":a.key=ce.ESC+"[F";break;case 33:e.shiftKey?a.type=2:e.ctrlKey?a.key=ce.ESC+"[5;"+(o+1)+"~":a.key=ce.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:e.ctrlKey?a.key=ce.ESC+"[6;"+(o+1)+"~":a.key=ce.ESC+"[6~";break;case 112:o?a.key=ce.ESC+"[1;"+(o+1)+"P":a.key=ce.ESC+"OP";break;case 113:o?a.key=ce.ESC+"[1;"+(o+1)+"Q":a.key=ce.ESC+"OQ";break;case 114:o?a.key=ce.ESC+"[1;"+(o+1)+"R":a.key=ce.ESC+"OR";break;case 115:o?a.key=ce.ESC+"[1;"+(o+1)+"S":a.key=ce.ESC+"OS";break;case 116:o?a.key=ce.ESC+"[15;"+(o+1)+"~":a.key=ce.ESC+"[15~";break;case 117:o?a.key=ce.ESC+"[17;"+(o+1)+"~":a.key=ce.ESC+"[17~";break;case 118:o?a.key=ce.ESC+"[18;"+(o+1)+"~":a.key=ce.ESC+"[18~";break;case 119:o?a.key=ce.ESC+"[19;"+(o+1)+"~":a.key=ce.ESC+"[19~";break;case 120:o?a.key=ce.ESC+"[20;"+(o+1)+"~":a.key=ce.ESC+"[20~";break;case 121:o?a.key=ce.ESC+"[21;"+(o+1)+"~":a.key=ce.ESC+"[21~";break;case 122:o?a.key=ce.ESC+"[23;"+(o+1)+"~":a.key=ce.ESC+"[23~";break;case 123:o?a.key=ce.ESC+"[24;"+(o+1)+"~":a.key=ce.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=ce.NUL:e.keyCode>=51&&e.keyCode<=55?a.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?a.key=ce.DEL:e.keyCode===219?a.key=ce.ESC:e.keyCode===220?a.key=ce.FS:e.keyCode===221&&(a.key=ce.GS);else if((!i||s)&&e.altKey&&!e.metaKey){let u=vP[e.keyCode]?.[e.shiftKey?1:0];if(u)a.key=ce.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=ce.ESC+m}else if(e.keyCode===32)a.key=ce.ESC+(e.ctrlKey?ce.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),a.key=ce.ESC+h,a.cancel=!0}}else i&&!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=ce.US),e.key==="@"&&(a.key=ce.NUL));break}return a}var Xt=0,yP=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Sh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Sh,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,i=0,s=new Array(this._array.length+this._insertedValues.length);for(let a=0;a<s.length;a++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(s[a]=e[t],t++):s[a]=this._array[i++];this._array=s,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,i=new Array(this._array.length-e.length),s=0;for(let a=0;a<this._array.length;a++)e[t]===a?t++:i[s++]=this._array[a];this._array=i,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,i=this._array.length-1;for(;i>=t;){let s=t+i>>1,a=this._getKey(this._array[s]);if(a>e)i=s-1;else if(a<e)t=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},zp=0,Rw=0,SP=class extends Ye{constructor(){super(),this._decorations=new yP(e=>e?.marker.line),this._onDecorationRegistered=this._register(new ge),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ge),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 wP(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.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,i){let s=0,a=0;for(let o of this._decorations.getKeyIterator(t))s=o.options.x??0,a=s+(o.options.width??1),e>=s&&e<a&&(!i||(o.options.layer??"bottom")===i)&&(yield o)}forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,a=>{zp=a.options.x??0,Rw=zp+(a.options.width??1),e>=zp&&e<Rw&&(!i||(a.options.layer??"bottom")===i)&&s(a)})}},wP=class extends Zr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new ge),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ge),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()}},EP=1e3,kP=class{constructor(e,t=EP){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,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 s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let a=s-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)}},jw=20,wh=class extends Ye{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,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 kP(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(`
110
+ `))),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<jw+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
111
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===jw+1&&(this._liveRegion.textContent+=s0.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 i=this._terminal.buffer,s=i.lines.length.toString();for(let a=e;a<=t;a++){let o=i.lines.get(i.ydisp+a),u=[],h=o?.translateToString(!0,void 0,void 0,u)||"",m=(i.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",s),this._alignRowWidth(f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],a=i.getAttribute("aria-posinset"),o=t===0?"1":`${this._terminal.buffer.lines.length}`;if(a===o||e.relatedTarget!==s)return;let u,h;if(t===0?(u=i,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(u=this._rowElements.shift(),h=i,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},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,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 s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.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 v=m<b.length?b[m]:b.slice(-1)[0]+1;return v>=this._terminal.cols&&(++p,v=0),{row:p,column:v}},o=a(t),u=a(i);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,i=this._rowColumns.get(e)?.slice(-1)?.[0];if(!i)return;let s=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${s/t})`}};wh=Vt([Se(1,Ub),Se(2,dr),Se(3,hr)],wh);var P0=class extends Ye{constructor(e,t,i,s,a){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new ge),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new ge),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Ot(()=>{Va(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 i=e.composedPath();for(let s=0;s<i.length;s++){let a=i[s];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(s=>{s?.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[s,a]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(s)&&(i=this._checkLinkProviderResult(s,e,i)):a.provideLinks(e.y,o=>{if(this._isMouseOut)return;let u=o?.map(h=>({link:h}));this._activeProviderReplies?.set(s,u),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let s=0;s<t.size;s++){let a=t.get(s);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(i.has(f)){a.splice(o--,1);break}i.add(f)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let s=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&&s){let o=s.find(u=>this._linkAtPosition(u.link,t));o&&(i=!0,this._handleNewLink(o))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let o=0;o<this._activeProviderReplies.size;o++){let u=this._activeProviderReplies.get(o)?.find(h=>this._linkAtPosition(h.link,t));if(u){i=!0,this._handleNewLink(u);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&CP(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,Va(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:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let s=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(s,a),this._lastMouseEvent)){let o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._askForLink(o,!1)}})))}_linkHover(e,t,i){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(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,s=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(e,t,i){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(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,a=t.y*this._bufferService.cols+t.x;return i<=a&&a<=s}_positionFromMouseEvent(e,t,i){let s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,a){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:a}}};P0=Vt([Se(1,Hb),Se(2,hr),Se(3,Yi),Se(4,eN)],P0);function CP(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 NP=class extends _P{constructor(e={}){super(e),this._linkifier=this._register(new tl),this.browser=vN,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new tl),this._onCursorMove=this._register(new ge),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new ge),this.onKey=this._onKey.event,this._onRender=this._register(new ge),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new ge),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new ge),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new ge),this.onBell=this._onBell.event,this._onFocus=this._register(new ge),this._onBlur=this._register(new ge),this._onA11yCharEmitter=this._register(new ge),this._onA11yTabEmitter=this._register(new ge),this._onWillOpen=this._register(new ge),this._setup(),this._decorationService=this._instantiationService.createInstance(SP),this._instantiationService.setService(au,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(gI),this._instantiationService.setService(eN,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(a0)),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(Mi.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Mi.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Mi.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Mi.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 i,s="";switch(t.index){case 256:i="foreground",s="10";break;case 257:i="background",s="11";break;case 258:i="cursor",s="12";break;default:i="ansi",s="4;"+t.index}switch(t.type){case 0:let a=Mt.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${ce.ESC}]${s};${hP(a)}${bN.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(o=>o.ansi[t.index]=ai.toColor(...t.color));else{let o=i;this._themeService.modifyColors(u=>u[o]=ai.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(wh,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.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(ce.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 i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,a=t.getWidth(i),o=this._renderService.dimensions.css.cell.width*a,u=this.buffer.y*this._renderService.dimensions.css.cell.height,h=i*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=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ue(this.element,"copy",t=>{this.hasSelection()&&RB(t,this._selectionService)}));let e=t=>jB(t,this.textarea,this.coreService,this.optionsService);this._register(Ue(this.textarea,"paste",e)),this._register(Ue(this.element,"paste",e)),xN?this._register(Ue(this.element,"mousedown",t=>{t.button===2&&FS(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ue(this.element,"contextmenu",t=>{FS(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Yb&&this._register(Ue(this.element,"auxclick",t=>{t.button===1&&qC(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 i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",n0.get()),wN||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",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(mI,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(dr,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(N0,this._document,this._helperContainer),this._instantiationService.setService(Fh,this._charSizeService),this._themeService=this._instantiationService.createInstance(R0),this._instantiationService.setService(ll,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(xh),this._instantiationService.setService(JC,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(A0,this.rows,this.screenElement)),this._instantiationService.setService(hr,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(E0,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(T0),this._instantiationService.setService(Hb,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(P0,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(S0,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(M0,this.element,this.screenElement,s)),this._instantiationService.setService(UB,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(Mi.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(w0,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(wh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(vh,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(vh,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(C0,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(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 s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:o=>(i(o),o.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(o)),wheel:o=>(i(o),this.cancel(o,!0)),mousedrag:o=>{o.buttons&&i(o)},mousemove:o=>{o.buttons||i(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?s.mousemove||(t.addEventListener("mousemove",a.mousemove),s.mousemove=a.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),o&16?s.wheel||(t.addEventListener("wheel",a.wheel,{passive:!1}),s.wheel=a.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),o&2?s.mouseup||(s.mouseup=a.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),o&4?s.mousedrag||(s.mousedrag=a.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.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 i(o),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(o)})),this._register(Ue(t,"wheel",o=>{if(!s.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=ce.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){VC(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,i){this._selectionService.setSelection(e,t,i)}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 i=xP(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let s=this.rows-1;return this.scrollLines(i.type===2?-s:s),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.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((i.key===ce.ETX||i.key===ce.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=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"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(TP(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(ni));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(ce.ESC+"[I"):this.coreService.triggerDataEvent(ce.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[4;${i};${t}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),a=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[6;${a};${s}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function TP(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var AP=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;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)}},MP=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 Vn)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},Dw=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 MP(t)}getNullCell(){return new Vn}},RP=class extends Ye{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new ge),this.onBufferChange=this._onBufferChange.event,this._normal=new Dw(this._core.buffers.normal,"normal"),this._alternate=new Dw(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)}},jP=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,s)=>t(i,s.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)}},DP=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}},OP=["cols","rows"],ps=0,LP=class extends Ye{constructor(e){super(),this._core=this._register(new NP(e)),this._addonManager=this._register(new AP),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],i=(s,a)=>{this._checkReadonlyOptions(s),this._core.options[s]=a};for(let s in this._core.options){let a={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,a)}}_checkReadonlyOptions(e){if(OP.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 jP(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new DP(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 RP(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,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}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
112
+ `,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 n0.get()},set promptLabel(e){n0.set(e)},get tooMuchOutput(){return s0.get()},set tooMuchOutput(e){s0.set(e)}}}_verifyIntegers(...e){for(ps of e)if(ps===1/0||isNaN(ps)||ps%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(ps of e)if(ps&&(ps===1/0||isNaN(ps)||ps%1!==0||ps<0))throw new Error("This API only accepts positive integers")}};function DN({sessionId:e,active:t,toolbarExtra:i}){const s=E.useRef(null),a=E.useRef(null),o=E.useRef(null),u=E.useRef(null),[h,m]=E.useState("Local workspace"),[f,p]=E.useState("connecting"),[b,v]=E.useState("Opening shell"),x=E.useCallback(()=>{const S=u.current,k=o.current;if(!S||S.readyState!==WebSocket.OPEN||!k)return;k.fit();const N=k.proposeDimensions();N&&S.send(JSON.stringify({cols:N.cols,rows:N.rows,type:"resize"}))},[]);E.useEffect(()=>{if(!s.current)return;const S=new LP({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"}}),k=new CB;S.loadAddon(k),S.open(s.current),a.current=S,o.current=k;const N=new WebSocket(BP(e));u.current=N;const T=S.onData(A=>{N.readyState===WebSocket.OPEN&&N.send(JSON.stringify({data:A,type:"input"}))});N.addEventListener("open",()=>{p("running"),v("Shell connected"),x()}),N.addEventListener("message",A=>{const O=zP(A.data);if(O){if(O.type==="output"){S.write(O.data);return}if(O.type==="error"){p("error"),v(O.error);return}p(O.state==="idle"?"connecting":O.state),O.cwd&&m(O.cwd),v(O.error??O.shell??"Shell connected")}}),N.addEventListener("close",()=>{p(A=>A==="exited"?A:"exited"),v("Socket closed")}),N.addEventListener("error",()=>{p("error"),v("Terminal socket error")}),window.addEventListener("resize",x),window.setTimeout(x,0);const R=new ResizeObserver(()=>x());return R.observe(s.current),()=>{window.removeEventListener("resize",x),R.disconnect(),T.dispose(),N.close(),S.dispose(),u.current=null,a.current=null,o.current=null}},[e,x]),E.useEffect(()=>{if(!t)return;const S=window.setTimeout(()=>{x(),a.current?.focus()},0);return()=>window.clearTimeout(S)},[t,x]);const y=E.useCallback(S=>{const k=u.current;if(!k||k.readyState!==WebSocket.OPEN)return;const N=o.current?.proposeDimensions();k.send(JSON.stringify({cols:N?.cols,rows:N?.rows,...S}))},[]);return c.jsxs("section",{className:me("flex h-full min-h-0 flex-col bg-[#090909] text-white",!t&&"hidden"),children:[c.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:[c.jsx("div",{className:"min-w-0",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(qe,{className:me("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}),c.jsxs("span",{className:"truncate font-mono text-[11px] text-white/55",children:[h," · ",b]})]})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(ue,{"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:[c.jsx(hE,{}),"Restart"]}),c.jsxs(ue,{"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:[c.jsx(Oh,{}),"Stop"]}),i]})]}),c.jsx("div",{"aria-label":"terminal viewport",className:"min-h-0 flex-1 overflow-hidden px-3 py-0.5",children:c.jsx("div",{className:"h-full w-full",ref:s})})]})}function BP(e){const t=window.location.protocol==="https:"?"wss:":"ws:",i=encodeURIComponent(e);return`${t}//${window.location.host}/api/terminal/socket?id=${i}`}function zP(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return typeof t?.type=="string"?t:null}catch{return null}}function IP({serviceName:e,active:t}){const[i,s]=E.useState(null),[a,o]=E.useState(null),[u,h]=E.useState(!1),m=E.useRef(!1);E.useEffect(()=>{if(!t||m.current)return;m.current=!0;let b=!1;return(async()=>{try{const v=await Ud({serviceName:e});b||s(v.id)}catch(v){b||o(v instanceof Error?v.message:String(v))}})(),()=>{b=!0}},[t,e]);const f=c.jsxs(ue,{"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?c.jsx(uE,{}):c.jsx(cE,{}),u?"Exit":"Expand"]}),p=a?c.jsxs("div",{className:"p-3 font-mono text-[11px] text-destructive",children:["Could not open terminal: ",a]}):i?c.jsx(DN,{active:t,sessionId:i,toolbarExtra:f}):c.jsx("div",{className:"p-3 font-mono text-[11px] text-muted-foreground",children:"Opening terminal…"});return u&&t?c.jsx(Pb,{onClose:()=>h(!1),title:`Terminal — ${e}`,children:p}):c.jsx("div",{className:me("h-[60vh] min-h-[24rem] overflow-hidden rounded-md border border-border",!t&&"hidden"),children:p})}const PP=500;function UP(e){const[t,i]=E.useState(),[s,a]=E.useState([]),[o,u]=E.useState(),[h,m]=E.useState(!1),f=E.useRef(void 0);E.useEffect(()=>{f.current=void 0,i(void 0),a([]);const b=new EventSource(`/api/services/${encodeURIComponent(e)}/test/stream`),v=x=>{try{const y=JSON.parse(x.data);y.run.id!==f.current&&(f.current=y.run.id,a([])),i(y.run),y.line&&a(S=>[...S,y.line].slice(-PP))}catch{}};return b.addEventListener("status",v),b.addEventListener("output",v),()=>b.close()},[e]);const p=E.useCallback(async b=>{m(!0),u(void 0);try{await e6(e,b)}catch(v){u(v instanceof Error?v.message:String(v))}finally{m(!1)}},[e]);return{run:t,lines:s,error:o,starting:h,start:p}}const HP={running:"secondary",passed:"success",failed:"error",error:"error"},FP={running:"Running",passed:"Passed",failed:"Failed",error:"Error"};function $P({serviceName:e}){const{run:t,lines:i,error:s,starting:a,start:o}=UP(e),[u,h]=E.useState(""),m=t?.status==="running"||a,f=t?.status==="failed"||t?.status==="error";return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("form",{className:"flex items-center gap-2",onSubmit:p=>{p.preventDefault(),m||o(u.trim()||void 0)},children:[c.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}),c.jsx(ue,{disabled:m,size:"sm",type:"submit",children:m?"Running…":"Run tests"})]}),s?c.jsx("div",{className:"text-red-600",children:s}):null,t?c.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-muted-foreground",children:[c.jsx(qe,{size:"small",variant:HP[t.status],children:FP[t.status]}),c.jsx("code",{className:"font-mono text-[11px]",children:t.command}),t.failingCount>0?c.jsxs("span",{children:["· ",t.failingCount," failing"]}):null,t.exitCode!=null?c.jsxs("span",{children:["· exit ",t.exitCode]}):null]}):c.jsx("div",{className:"text-muted-foreground",children:"No test runs yet."}),i.length>0?c.jsx("pre",{className:"max-h-72 overflow-auto whitespace-pre-wrap break-all rounded bg-background p-2 font-mono text-[11px]",children:i.map((p,b)=>c.jsx("div",{className:me(p.stream==="stderr"&&"text-red-500"),children:p.text},b))}):null,f?c.jsxs("div",{className:"rounded border border-border bg-muted/40 p-2",children:["Failures were piped into the"," ",c.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 VP({serviceName:e,status:t,health:i,timeline:s,onRefresh:a}){const[o,u]=E.useState("metrics"),h=i?.processTree?.processes??[];return c.jsxs("div",{className:"border-t border-border bg-muted/30 px-3 py-2 text-xs",children:[c.jsxs("div",{className:"mb-2 flex gap-1",children:[c.jsx(Ma,{active:o==="logs",onClick:()=>u("logs"),children:"Logs"}),c.jsxs(Ma,{active:o==="processes",onClick:()=>u("processes"),children:["Processes ",h.length?c.jsx(qe,{variant:"secondary",size:"small",children:h.length}):null]}),c.jsx(Ma,{active:o==="metrics",onClick:()=>u("metrics"),children:"Metrics"}),c.jsxs(Ma,{active:o==="http",onClick:()=>u("http"),children:["HTTP",t?.inspector?.enabled?c.jsx(qe,{variant:"success",size:"small",children:"on"}):null]}),c.jsx(Ma,{active:o==="env",onClick:()=>u("env"),children:"Env"}),c.jsx(Ma,{active:o==="tests",onClick:()=>u("tests"),children:"Tests"}),c.jsx(Ma,{active:o==="terminal",onClick:()=>u("terminal"),children:"Terminal"})]}),o==="processes"?c.jsx(wB,{rows:h}):null,o==="metrics"?c.jsx(bB,{serviceName:e}):null,o==="http"?c.jsx(mB,{serviceName:e,status:t,timeline:s,onRefresh:a}):null,o==="env"?c.jsx(fB,{serviceName:e}):null,o==="tests"?c.jsx($P,{serviceName:e}):null,o==="logs"?c.jsx(rB,{serviceName:e}):null,c.jsx(IP,{active:o==="terminal",serviceName:e},e)]})}function Ma({active:e,onClick:t,children:i}){return c.jsx("button",{className:me("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:i})}const qP={high:"success",medium:"warning",low:"secondary"};function GP({onClose:e,onRefresh:t}){const i=Oi(),{sendToAgent:s}=Ns(),[a,o]=E.useState("url"),[u,h]=E.useState(""),[m,f]=E.useState(!1),[p,b]=E.useState(null),[v,x]=E.useState(null),[y,S]=E.useState([]),[k,N]=E.useState([]),[T,R]=E.useState(null),A=T?.kind==="docker-compose"?k.find(M=>M.composeService===T.composeService):void 0;async function O(){if(u.trim()){f(!0),b(null);try{const M=await UM(u.trim());x(M.profile),S(M.proposals),N(M.databases),R(M.proposals[0]??null),M.proposals.length===0&&b("Cloned, but couldn't detect how to run this repo. Refine with AI or add it manually."),o("review")}catch(M){b(M instanceof Error?M.message:String(M))}finally{f(!1)}}}function H(){s({prompt:`Onboard this repository and register it as a NoMoreIDE service: ${u.trim()}
113
+ 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(M){if(T){f(!0),b(null);try{await HM(T,M,A),await t(),i.success(`${T.name} registered${A?" (+ database)":""}${M?" and starting":""}.`),e()}catch($){b($ instanceof Error?$.message:String($))}finally{f(!1)}}}return c.jsxs(rr,{icon:c.jsx(as,{}),onClose:e,size:"lg",title:"Add from GitHub",children:[a==="url"?c.jsx(KP,{url:u,busy:m,error:p,onChange:h,onScan:O,onRefine:H}):null,a==="review"&&v?c.jsx(WP,{profile:v,proposals:y,selected:T,database:A,error:p,onSelect:R,onEdit:R,onBack:()=>o("url"),onRefine:H,onContinue:()=>o("install")}):null,a==="install"&&T?c.jsx(XP,{proposal:T,busy:m,error:p,onBack:()=>o("review"),onRegister:L}):null]})}function KP({url:e,busy:t,error:i,onChange:s,onScan:a,onRefine:o}){return c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Paste a repository URL. NoMoreIDE clones it, detects how it runs, and proposes a service."}),c.jsx(et,{autoFocus:!0,placeholder:"https://github.com/owner/repo",value:e,onChange:u=>s(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!t&&a()}}),i?c.jsx("p",{className:"text-sm text-destructive",children:i}):null,c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs(ue,{variant:"ghost",size:"sm",onClick:o,disabled:!e.trim(),children:[c.jsx(Ka,{className:"size-3.5"}),"Refine with AI"]}),c.jsxs(ue,{onClick:a,disabled:t||!e.trim(),children:[t?c.jsx(Di,{className:"size-4 animate-spin"}):c.jsx(as,{className:"size-4"}),t?"Cloning…":"Clone & detect"]})]})]})}function WP({profile:e,proposals:t,selected:i,database:s,error:a,onSelect:o,onEdit:u,onBack:h,onRefine:m,onContinue:f}){return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[c.jsx("span",{className:"text-sm font-medium",children:e.name}),e.languages.map(p=>c.jsx(qe,{variant:"outline",size:"small",label:p},p))]}),a?c.jsx("p",{className:"text-sm text-destructive",children:a}):null,t.length>0?c.jsxs("div",{className:"flex flex-col gap-2",children:[c.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=i?.name===p.name;return c.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:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"font-medium",children:p.name}),c.jsx(qe,{variant:qP[p.confidence],size:"small",label:p.confidence})]}),c.jsx("div",{className:"mt-0.5 font-mono text-xs text-muted-foreground",children:p.kind==="docker-compose"?`compose · ${p.composeService}`:p.command}),c.jsx("div",{className:"text-[11px] text-muted-foreground",children:p.reason})]},p.name)})]}):null,i?c.jsx(YP,{proposal:i,onChange:u}):null,s?c.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:[c.jsx(Es,{className:"size-3.5"}),c.jsxs("span",{children:["Also registers database ",c.jsx("span",{className:"font-medium",children:s.name})," (",s.engine,") so it shows in the Database tab."]})]}):null,e.envKeys.length>0?c.jsxs("div",{className:"text-xs text-muted-foreground",children:[c.jsx("span",{className:"font-medium",children:"Env from .env.example:"})," ",e.envKeys.join(", ")]}):null,e.readmeExcerpt?c.jsxs("details",{className:"rounded-md border border-border bg-muted/30 p-2 text-xs",children:[c.jsx("summary",{className:"cursor-pointer font-medium",children:"README excerpt"}),c.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap font-mono",children:e.readmeExcerpt})]}):null,c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs(ue,{variant:"ghost",size:"sm",onClick:h,children:[c.jsx(X2,{className:"size-3.5"}),"Back"]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(ue,{variant:"outline",size:"sm",onClick:m,children:[c.jsx(Ka,{className:"size-3.5"}),"Refine with AI"]}),c.jsx(ue,{onClick:f,disabled:!i,children:"Continue"})]})]})]})}function YP({proposal:e,onChange:t}){return c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsx(Cc,{label:"Service name",children:c.jsx(et,{value:e.name,onChange:i=>t({...e,name:i.target.value})})}),c.jsx(Cc,{label:"Port (optional)",children:c.jsx(et,{value:e.port?.toString()??"",placeholder:"auto",onChange:i=>t({...e,port:i.target.value?Number(i.target.value):void 0})})}),e.kind==="docker-compose"?c.jsx(Cc,{label:"Compose service",className:"col-span-2",children:c.jsx(et,{value:e.composeService??"",onChange:i=>t({...e,composeService:i.target.value})})}):c.jsx(Cc,{label:"Run command",className:"col-span-2",children:c.jsx(et,{value:e.command??"",onChange:i=>t({...e,command:i.target.value})})})]})}function XP({proposal:e,busy:t,error:i,onBack:s,onRegister:a}){const[o,u]=E.useState(e.installCommand??""),[h,m]=E.useState([]),[f,p]=E.useState(!1),[b,v]=E.useState(!1),x=E.useRef(null);function y(k){m(N=>[...N,k]),queueMicrotask(()=>{const N=x.current;N&&(N.scrollTop=N.scrollHeight)})}async function S(){o.trim()&&(p(!0),v(!1),m([]),await FM({clonePath:e.cwd,command:o.trim()},{onLine:k=>y(k.text),onDone:k=>{y(k===0?"✓ install complete":`✗ install exited ${k}`),p(!1),v(k===0)},onError:k=>{y(`✗ ${k}`),p(!1)}}))}return c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-end gap-2",children:[c.jsx(Cc,{label:"Install command (optional)",className:"flex-1",children:c.jsx(et,{value:o,placeholder:"e.g. npm install",onChange:k=>u(k.target.value)})}),c.jsxs(ue,{variant:"outline",onClick:S,disabled:f||!o.trim(),children:[f?c.jsx(Di,{className:"size-4 animate-spin"}):c.jsx(tE,{className:"size-4"}),"Install"]})]}),h.length>0?c.jsx("pre",{ref:x,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(`
114
+ `)}):null,i?c.jsx("p",{className:"text-sm text-destructive",children:i}):null,c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs(ue,{variant:"ghost",size:"sm",onClick:s,children:[c.jsx(X2,{className:"size-3.5"}),"Back"]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ue,{variant:"outline",onClick:()=>a(!1),disabled:t,children:"Register only"}),c.jsxs(ue,{onClick:()=>a(!0),disabled:t,children:[t?c.jsx(Di,{className:"size-4 animate-spin"}):c.jsx(jh,{className:"size-4"}),b||!o.trim()?"Register & start":"Skip install & start"]})]})]})]})}function Cc({label:e,className:t,children:i}){return c.jsxs("label",{className:`flex flex-col gap-1 text-xs ${t??""}`,children:[c.jsx("span",{className:"font-medium text-muted-foreground",children:e}),i]})}function ZP({allServices:e,group:t,onRefresh:i,ports:s,services:a,health:o,statuses:u,timeline:h,selectedService:m,onSelectService:f,onDropService:p}){const[b,v]=E.useState(!1),[x,y]=E.useState(!1),[S,k]=E.useState(!1),N=a.some(A=>Dc(u[A.name]?.state));function T(A){!p||!A.dataTransfer.types.includes(Vc)||(A.preventDefault(),A.dataTransfer.dropEffect="copy",k(!0))}function R(A){if(!p)return;A.preventDefault(),k(!1);const O=A.dataTransfer.getData(Vc);O&&p(O)}return c.jsxs("section",{className:me("transition-colors",S&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:T,onDragLeave:()=>k(!1),onDrop:R,children:[c.jsxs("div",{className:"flex items-center gap-1.5 bg-muted/35 px-3 py-1.5",children:[c.jsxs("button",{"aria-expanded":!x,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left",onClick:()=>y(A=>!A),type:"button",children:[c.jsx(qn,{className:me("size-3.5 shrink-0 text-muted-foreground transition-transform",x&&"-rotate-90")}),c.jsx("span",{className:"truncate text-sm font-medium",children:t.name}),t.services.length?c.jsx(qe,{size:"small",variant:"secondary",children:t.services.length}):null]}),c.jsx(Qo,{label:"Edit group",children:c.jsx(ue,{"aria-expanded":b,"aria-label":`Edit ${t.name}`,className:"size-7",onClick:()=>v(A=>!A),size:"icon",type:"button",variant:"ghost",children:c.jsx(Lc,{})})}),c.jsx(Ib,{active:N,baseUrl:`/api/bundles/${encodeURIComponent(t.name)}`,compact:!0,restartAction:async()=>{await cn(`/api/bundles/${encodeURIComponent(t.name)}/stop`,{}),await cn(`/api/bundles/${encodeURIComponent(t.name)}/start`,{})},solidStart:!0,targetLabel:`group ${t.name}`,onRefresh:i,onStarted:()=>{const A=a[0];A&&f(A.name)}})]}),b?c.jsx("div",{className:"border-t border-border bg-background/65 p-3",children:c.jsx(PC,{initialName:t.name,initialServices:t.services,onRefresh:i,onSaved:()=>v(!1),originalName:t.name,services:e,submitLabel:"Save Group"})}):null,x?null:c.jsx("div",{className:"divide-y divide-border border-t border-border bg-background/45",children:a.length?a.map(A=>c.jsx(ON,{service:A,status:u[A.name],health:o[A.name],ports:s,onRefresh:i,timeline:h,selected:m===A.name,onSelect:()=>f(A.name)},A.name)):c.jsx(ht,{variant:"muted",className:"m-4",children:"This group does not match any registered services."})})]})}function ON({service:e,status:t,onRefresh:i,selected:s=!1,onSelect:a}){const o=t?.state??"stopped",u=Dc(o),[h,m]=E.useState(!1);return c.jsxs("div",{"aria-selected":s,draggable:!0,onDragStart:f=>{f.dataTransfer.setData(Vc,e.name),e.cwd&&EC(f.dataTransfer,e.cwd),f.dataTransfer.effectAllowed="copyMove",m(!0)},onDragEnd:()=>m(!1),className:me("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",s?"border-l-primary bg-primary/10":"border-l-transparent hover:bg-muted"),onClick:a,role:"option",children:[c.jsx(zb,{command:e.command??""}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"truncate text-sm font-medium",children:e.name}),c.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[c.jsx(QP,{kind:e.kind}),e.port?c.jsxs("span",{children:[":",e.port]}):null]})]}),c.jsx(LN,{state:o}),c.jsx("span",{className:"flex items-center gap-1",onClick:f=>f.stopPropagation(),children:c.jsx(Ib,{active:u,baseUrl:`/api/services/${encodeURIComponent(e.name)}`,compact:!0,targetLabel:e.name,onRefresh:i,onStarted:a})})]})}const Vc="application/x-nomoreide-service",Ow={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 QP({kind:e}){const t=Ow[e??"local"]??Ow.local;return c.jsx("span",{className:me("rounded border px-1 py-px text-[9px] font-semibold uppercase leading-none tracking-wide",t.className),children:t.label})}function Dc(e){return e==="running"||e==="starting"}function JP(e){return`http://127.0.0.1:${e}`}function LN({state:e}){return c.jsx(qe,{variant:e==="running"?"success":e==="exited"?"danger":e==="starting"?"warning":"outline",className:me(e==="running"&&"font-mono"),children:e})}function eU({data:e,onRefresh:t,focusService:i,onServiceFocused:s}){const a=e.config.services[0]?.name??"",[o,u]=E.useState(a),[h,m]=E.useState(null),[f,p]=E.useState(!1),{sendToAgent:b,startOnboard:v}=Ns(),[x,y]=E.useState(!1),[S,k]=E.useState(!1),[N,T]=E.useState(!1),[R,A]=E.useState(!1),O=E.useRef({}),{error:H,message:L,success:M}=Oi(),$=E.useMemo(()=>new Set(e.config.bundles.flatMap(I=>I.services)),[e.config.bundles]),P=E.useMemo(()=>{const I=new Map;for(const j of e.config.bundles)for(const W of j.services)I.has(W)||I.set(W,j.name);return I},[e.config.bundles]),F=E.useMemo(()=>e.config.services.filter(I=>!$.has(I.name)),[e.config.services,$]),Z=e.health??{},K=e.config.bundles.length>0||F.length>0;E.useEffect(()=>{!e.config.services.some(j=>j.name===o)&&a&&u(a)},[e.config.services,a,o]),E.useEffect(()=>{i&&e.config.services.some(I=>I.name===i)&&(u(i),s?.())},[i,e.config.services,s]);const Q=E.useMemo(()=>e.config.services.find(I=>I.name===o),[e.config.services,o]),q=o?e.runtime.services[o]:void 0,D=o?Z[o]:void 0;async function Y(I,j){if(!I.services.includes(j))try{await GM(I.name,I.services,j),M(`Added ${j} to ${I.name}.`),await t()}catch(W){H(W instanceof Error?W.message:String(W))}}async function X(){if(Q){if(Dc(q?.state)){H(`Stop ${Q.name} before deleting it.`);return}if(window.confirm(`Delete service "${Q.name}"? This removes it from your config.`))try{await qM(Q.name),M(`Deleted ${Q.name}.`),await t()}catch(I){H(I instanceof Error?I.message:String(I))}}}async function V(I){const j=e.config.bundles.filter(W=>W.services.includes(I));if(j.length!==0)try{for(const W of j)await KM(W.name,W.services,I);L({text:`Removed ${I} from ${j.map(W=>W.name).join(", ")}.`}),await t()}catch(W){H(W instanceof Error?W.message:String(W))}}return E.useEffect(()=>{const I=Object.fromEntries(e.config.services.map(W=>[W.name,e.runtime.services[W.name]?.state??"stopped"])),j=O.current;if(Object.keys(j).length){const W=new Map,de=new Map;for(const oe of e.config.services){const he=I[oe.name],se=j[oe.name];if(!se||se===he)continue;const fe=e.runtime.services[oe.name],we=P.get(oe.name);if(we){const xe=W.get(we)??new Map;if(xe.set(he,(xe.get(he)??0)+1),W.set(we,xe),he==="exited"){const Ze=de.get(we)??[];Ze.push(fe?.exitCode),de.set(we,Ze)}continue}if(he==="running")M(`${oe.name} is running.`);else if(he==="stopped")L({text:`${oe.name} stopped.`});else if(he==="starting")L({text:`${oe.name} is starting.`});else if(he==="exited"){const xe=fe?.exitCode===void 0||fe.exitCode===null?"":` with code ${fe.exitCode}`;H(`${oe.name} exited${xe}.`)}}for(const[oe,he]of W)iU({exitCodes:de.get(oe)??[],groupName:oe,showErrorToast:H,showMessageToast:L,showSuccessToast:M,transitions:he})}O.current=I},[e.config.services,e.runtime.services,P,H,L,M]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:me("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:[c.jsx("div",{className:"min-h-0 min-w-0 overflow-auto border-r border-border",children:c.jsxs(or,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[c.jsx(lr,{className:"border-b border-border px-3 py-2",children:c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx(cr,{className:"text-sm",children:"Services"}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs(ue,{"aria-haspopup":"dialog",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>y(!0),size:"sm",type:"button",variant:"outline",children:[c.jsx(mE,{className:"size-3.5"}),"Logs"]}),c.jsx(tU,{onCreateGroup:()=>m("group"),onCreateService:()=>m("service"),onOnboardRepo:()=>p(!0),onOnboardWithAi:v,canGroupWithAi:F.length>1,onCreateWithAi:()=>b({prompt:SL,source:{type:"service-setup",label:"Add a service"},label:"Help me add a new service, one step at a time."}),onGroupWithAi:()=>b({prompt:NL(F),source:{type:"group-services",label:"Group services"},label:"Propose how to group my ungrouped services."})})]})]})}),c.jsx(ur,{className:"p-0",children:K?c.jsxs("div",{className:"divide-y divide-border",children:[e.config.bundles.map(I=>c.jsx(ZP,{group:I,onRefresh:t,ports:e.ports,allServices:e.config.services,health:Z,services:e.config.services.filter(j=>I.services.includes(j.name)),statuses:e.runtime.services,timeline:e.timeline,selectedService:o,onSelectService:u,onDropService:j=>{Y(I,j)}},I.name)),F.length?c.jsxs("div",{className:me("transition-colors",R&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:I=>{I.dataTransfer.types.includes(Vc)&&(I.preventDefault(),I.dataTransfer.dropEffect="move",A(!0))},onDragLeave:()=>A(!1),onDrop:I=>{I.preventDefault(),A(!1);const j=I.dataTransfer.getData(Vc);j&&V(j)},children:[c.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:[c.jsx("span",{children:"Ungrouped"}),c.jsx("span",{className:"text-muted-foreground/80",children:F.length})]}),c.jsx("div",{className:"divide-y divide-border",children:F.map(I=>c.jsx(ON,{service:I,status:e.runtime.services[I.name],health:Z[I.name],ports:e.ports,onRefresh:t,timeline:e.timeline,selected:o===I.name,onSelect:()=>u(I.name)},I.name))})]}):null]}):c.jsx(gh,{label:"No services registered yet."})})]})}),c.jsx("div",{className:"min-h-0 min-w-0 overflow-auto",children:Q?c.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[c.jsxs("div",{className:"shrink-0 space-y-2 border-b border-border bg-background/60 px-4 py-3",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("h2",{className:"min-w-0 truncate text-base font-semibold",children:Q.name}),c.jsx(LN,{state:q?.state??"stopped"}),c.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[(()=>{const I=q?.url??(Q.port?JP(Q.port):void 0);return I?c.jsx(Qo,{label:`Open ${I}`,children:c.jsx(ue,{"aria-label":"Open in browser",className:"size-7",onClick:()=>window.open(I,"_blank","noopener,noreferrer"),size:"icon",type:"button",variant:"outline",children:c.jsx(W0,{})})}):null})(),D?.agentContext&&Q?c.jsx(Qo,{label:"Debug this service with AI",children:c.jsx(ue,{"aria-label":"Debug this service with AI",className:"size-7",onClick:()=>b({prompt:TL({service:Q.name,context:D.agentContext}),source:{type:"service-debug",label:Q.name},label:`Debug \`${Q.name}\` with its current context.`}),size:"icon",type:"button",variant:"outline",children:c.jsx(sr,{className:"size-3.5"})})}):null,c.jsx(Ib,{active:Dc(q?.state),baseUrl:`/api/services/${encodeURIComponent(Q.name)}`,compact:!0,targetLabel:Q.name,onRefresh:t}),c.jsx(IC,{className:"size-7 border border-border bg-background opacity-100 hover:border-foreground/30",items:[{icon:c.jsx(Lc,{className:"size-3.5"}),label:"Edit service",onSelect:()=>T(!0)},...Dc(q?.state)?[]:[{icon:c.jsx(Yc,{className:"size-3.5 text-destructive"}),label:"Delete service",onSelect:()=>{X()}}]],label:`More actions for ${Q.name}`}),c.jsx(Qo,{label:S?"Show Ports & Timeline":"Hide Ports & Timeline",side:"left",children:c.jsx(ue,{"aria-label":S?"Show Ports & Timeline":"Hide Ports & Timeline",className:"size-7",onClick:()=>k(I=>!I),size:"icon",type:"button",variant:"ghost",children:S?c.jsx(uA,{}):c.jsx(ia,{})})})]})]}),Q.command?c.jsxs("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:Q.command,children:["$ ",Q.command]}):null,Q.cwd?c.jsx("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:Q.cwd,children:Q.cwd}):null,c.jsx(V9,{health:D})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:c.jsx(VP,{serviceName:Q.name,status:q,health:D,timeline:e.timeline??[],onRefresh:t},Q.name)})]}):c.jsx(gh,{label:"Select a service to see details."})}),S?null:c.jsxs("div",{className:"min-h-0 overflow-auto border-l border-border",children:[c.jsx(Y9,{ports:e.ports}),c.jsx(L9,{events:e.timeline??[]})]})]}),N&&Q?c.jsx(rr,{icon:c.jsx(Lc,{}),onClose:()=>T(!1),size:"lg",title:`Edit Service — ${Q.name}`,children:c.jsx(jS,{cwd:e.cwd,initialService:Q,onRefresh:t,onSaved:()=>T(!1)})}):null,h?c.jsx(rr,{icon:h==="service"?c.jsx(wn,{}):c.jsx(Q2,{}),onClose:()=>m(null),size:h==="service"?"lg":"md",title:h==="service"?"Add Service":"Create Group",children:h==="service"?c.jsx(jS,{cwd:e.cwd,onRefresh:t,onSaved:()=>m(null)}):c.jsx(PC,{services:F,onRefresh:t,onSaved:()=>m(null)})}):null,f?c.jsx(GP,{onClose:()=>p(!1),onRefresh:t}):null,x?c.jsx(lB,{initialService:o||void 0,onClose:()=>y(!1),services:e.config.services.map(I=>I.name)}):null]})}function tU({onCreateService:e,onCreateGroup:t,onCreateWithAi:i,onGroupWithAi:s,canGroupWithAi:a,onOnboardRepo:o,onOnboardWithAi:u}){const[h,m]=E.useState(!1);function f(p){m(!1),p()}return c.jsxs("div",{className:"relative",children:[c.jsx(Qo,{label:"Add",side:"bottom",children:c.jsx(ue,{"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:c.jsx(wn,{})})}),h?c.jsxs(c.Fragment,{children:[c.jsx("button",{"aria-hidden":!0,className:"fixed inset-0 z-[40] cursor-default",onClick:()=>m(!1),tabIndex:-1,type:"button"}),c.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:[c.jsxs("div",{className:"group flex items-stretch",children:[c.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:[c.jsx(wn,{}),"Create Service"]}),c.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:"Set up with AI — the agent walks you through it",type:"button",children:[c.jsx(sr,{className:"size-3.5 shrink-0"}),"AI"]})]}),c.jsxs("div",{className:"group flex items-stretch",children:[c.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:[c.jsx(Q2,{}),"Create Group"]}),a?c.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:"Group with AI — the agent proposes groupings for your ungrouped services",type:"button",children:[c.jsx(sr,{className:"size-3.5 shrink-0"}),"AI"]}):null]}),c.jsxs("div",{className:"group flex items-stretch",children:[c.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:[c.jsx(as,{}),"Add from GitHub"]}),c.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:[c.jsx(sr,{className:"size-3.5 shrink-0"}),"AI"]})]})]})]}):null]})}function iU({exitCodes:e,groupName:t,showErrorToast:i,showMessageToast:s,showSuccessToast:a,transitions:o}){if(o.size===1){const[m]=o.keys();if(m==="running")a(`${t} group is running.`);else if(m==="stopped")s({text:`${t} group stopped.`});else if(m==="starting")s({text:`${t} group is starting.`});else if(m==="exited"){const f=e.filter(b=>b!=null),p=f.length?` with code ${f.join(", ")}`:"";i(`${t} group exited${p}.`)}return}const u=[...o.entries()].map(([m,f])=>`${f} ${m}`).join(", "),h=`${t} group updated: ${u}.`;o.has("exited")?i(h):s({text:h})}function nU({data:e,onOpenService:t}){const i=E.useMemo(()=>sU(e),[e]);return i.length?c.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:[c.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:[c.jsx(Ia,{className:"size-3"}),"Running"]}),c.jsx("div",{className:"flex min-w-0 items-center gap-2",children:i.map(s=>c.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(s.name),title:s.url?`${s.name} — ${s.url}`:s.name,type:"button",children:[c.jsx("span",{className:me("size-2 shrink-0 rounded-full",aU(s.tone))}),c.jsx("span",{className:"max-w-40 truncate font-medium text-foreground",children:s.name}),s.port?c.jsxs("span",{className:"text-muted-foreground",children:[":",s.port]}):null,s.uptime?c.jsxs("span",{className:"text-muted-foreground/70",children:["↑",s.uptime]}):null]},s.name))})]}):null}function sU(e){const t=new Map(e.config.services.map(i=>[i.name,i.port]));return Object.values(e.runtime.services).filter(i=>i.state==="running"||i.state==="starting").map(i=>({name:i.name,tone:rU(i,e.health[i.name]),port:t.get(i.name)??oU(i.url),uptime:i.state==="running"?lU(i.startedAt):"starting…",url:i.url})).sort((i,s)=>i.name.localeCompare(s.name))}function rU(e,t){return e.state==="starting"?"starting":t?.status==="healthy"?"healthy":t?.status==="warning"?"warning":t?.status==="unhealthy"?"unhealthy":"healthy"}function aU(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 oU(e){if(e)try{const t=new URL(e).port;return t?Number(t):void 0}catch{return}}function lU(e){if(!e)return;const t=new Date(e).getTime();if(Number.isNaN(t))return;const i=Math.max(0,Math.floor((Date.now()-t)/1e3));if(i<60)return`${i}s`;const s=Math.floor(i/60);if(s<60)return`${s}m`;const a=Math.floor(s/60),o=s%60;return a<24?`${a}h${o?`${o}m`:""}`:`${Math.floor(a/24)}d${a%24?`${a%24}h`:""}`}function cU(){const[e,t]=E.useState([]),[i,s]=E.useState(null),[a,o]=E.useState(!1);E.useEffect(()=>{let m=!1;return(async()=>{let f=await t6().catch(()=>[]);if(f.length===0){const p=await Ud().catch(()=>null);f=p?[p]:[]}m||(t(f),s(f[0]?.id??null))})(),()=>{m=!0}},[]);const u=E.useCallback(async()=>{o(!0);try{const m=await Ud();t(f=>[...f,m]),s(m.id)}finally{o(!1)}},[]),h=E.useCallback(async m=>{o(!0);try{await i6(m);const f=e.findIndex(b=>b.id===m),p=e.filter(b=>b.id!==m);if(p.length===0){const b=await Ud();t([b]),s(b.id);return}if(t(p),i===m){const b=p[Math.min(f,p.length-1)];s(b.id)}}finally{o(!1)}},[e,i]);return c.jsxs("section",{className:"flex h-full min-h-0 flex-col bg-[#090909] text-white",children:[c.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 c.jsxs("div",{className:me("group flex items-center gap-1 rounded-md border border-transparent px-2 py-1 text-xs",m.id===i?"border-white/15 bg-white/10 text-white":"text-white/60 hover:bg-white/5"),children:[c.jsx("button",{"aria-selected":m.id===i,className:"max-w-[160px] truncate font-medium",onClick:()=>s(m.id),role:"tab",type:"button",children:p}),c.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:c.jsx(kn,{className:"size-3"})})]},m.id)}),c.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:c.jsx(wn,{className:"size-4"})})]}),c.jsx("div",{className:"relative min-h-0 flex-1",children:e.length===0?c.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[11px] text-white/40",children:"Starting terminal…"}):e.map(m=>c.jsx("div",{className:"absolute inset-0",children:c.jsx(DN,{active:m.id===i,sessionId:m.id})},m.id))})]})}const uU=800;function BN({activeHunkIndex:e=0,diff:t}){const i=hU(t),s=E.useRef(null),a=E.useRef([]),[o,u]=E.useState(!1),h=E.useMemo(()=>i.reduce((f,p)=>Math.max(f,p.content.length),0),[i]),m=h>uU;if(E.useEffect(()=>{u(!1)},[t]),E.useEffect(()=>{if(m&&!o)return;const f=a.current[e],p=s.current;!f||!p||p.scrollTo({top:Math.max(f.offsetTop-8,0),behavior:"smooth"})},[e,t,m,o]),m&&!o){const f=i.filter(b=>b.kind==="add").length,p=i.filter(b=>b.kind==="delete").length;return c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-card p-6",children:c.jsxs("div",{className:"max-w-sm space-y-3 text-center",children:[c.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Diff hidden for this data file"}),c.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."]}),c.jsxs("p",{className:"font-mono text-[11px]",children:[c.jsxs("span",{className:"text-emerald-700",children:["+",f]})," ",c.jsxs("span",{className:"text-red-700",children:["-",p]})," lines changed"]}),c.jsx(ue,{onClick:()=>u(!0),size:"sm",type:"button",variant:"outline",children:"Show diff anyway"})]})})}return c.jsx("div",{className:"absolute inset-0 overflow-auto bg-card text-xs leading-6 text-foreground",ref:s,children:c.jsx("div",{className:"min-w-full font-mono",children:i.map((f,p)=>c.jsxs("div",{className:me("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",Lw(i,p)&&f.hunkIndex===e&&"outline outline-1 outline-offset-[-1px] outline-primary/35"),ref:f.hunkIndex!==null&&Lw(i,p)?b=>{a.current[f.hunkIndex??0]=b}:void 0,children:[c.jsx(Bw,{value:f.oldLine}),c.jsx(Bw,{value:f.newLine}),c.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-all px-2",children:f.content||" "})]},`${p}-${f.content}`))})})}function dU(e){return e.split(`
115
+ `).reduce((t,i)=>(i.startsWith("@@")?t.hunks+=1:i.startsWith("+")&&!i.startsWith("+++")?t.additions+=1:i.startsWith("-")&&!i.startsWith("---")&&(t.deletions+=1),t),{additions:0,deletions:0,hunks:0})}function hU(e){const t=fU(e);return t.some(i=>i.kind==="hunk")?t.filter(i=>i.kind!=="meta"&&i.kind!=="hunk"):t}function fU(e){let t=null,i=null,s=null;return e.split(`
116
+ `).map(a=>{if(mU(a))return t=null,i=null,s=null,{content:a,hunkIndex:s,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("@@")){const u=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(a);return u&&(t=Number(u[1]),i=Number(u[2])),s=(s??-1)+1,{content:a,hunkIndex:s,kind:"hunk",oldLine:null,newLine:null}}if(t===null||i===null)return{content:a,hunkIndex:null,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("\\ No newline"))return{content:a,hunkIndex:s,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("+")&&!a.startsWith("+++")){const u={content:a,hunkIndex:s,kind:"add",oldLine:null,newLine:i};return i+=1,u}if(a.startsWith("-")&&!a.startsWith("---")){const u={content:a,hunkIndex:s,kind:"delete",oldLine:t,newLine:null};return t+=1,u}const o={content:a,hunkIndex:s,kind:"context",oldLine:t,newLine:i};return t+=1,i+=1,o})}function Lw(e,t){const i=e[t]?.hunkIndex;if(i===null)return!1;const s=e.findIndex(a=>a.hunkIndex===i&&(a.kind==="add"||a.kind==="delete"));return s!==-1?s===t:e.findIndex(a=>a.hunkIndex===i)===t}function mU(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 Bw({value:e}){return c.jsx("span",{className:me("select-none border-r border-border/70 px-2 text-right text-muted-foreground",e===null&&"text-transparent"),children:e??"-"})}function pU({branch:e,error:t,files:i,selectedFile:s,onSelectFile:a,root:o}){const u=E.useMemo(()=>vU(i).filter(f=>f.files.length),[i]),[h,m]=E.useState({staged:!1,unstaged:!1,untracked:!1});return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[c.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:[c.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[c.jsx(as,{className:"size-3.5"}),c.jsx("span",{className:"truncate",children:"Changes"})]}),c.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[e?c.jsx(qe,{variant:"outline",children:e}):null,c.jsx(qe,{variant:"secondary",children:i.length})]})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:u.length?u.map(f=>c.jsx(gU,{collapsed:h[f.id],group:f,onSelectFile:a,onToggle:()=>m(p=>({...p,[f.id]:!p[f.id]})),root:o,selectedFile:s},f.id)):c.jsx(ht,{variant:"muted",className:"m-3 text-center",children:t??"No changed files."})})]})}function gU({collapsed:e,group:t,onSelectFile:i,onToggle:s,root:a,selectedFile:o}){const u=e?ia:qn;return c.jsxs("section",{className:"border-b border-border last:border-b-0",children:[c.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:s,type:"button",children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[c.jsx(u,{className:"size-3.5"}),c.jsx("span",{className:"truncate",children:t.label})]}),c.jsx(qe,{className:"min-w-6 justify-center font-mono shadow-none",size:"small",variant:"outline",children:t.files.length})]}),e?null:c.jsx("div",{children:t.files.map(h=>c.jsx(bU,{active:o===h.path,file:h,group:t.id,onClick:()=>i(h.path),root:a},h.path))})]})}function bU({active:e,file:t,group:i,onClick:s,root:a}){const o=t.path.split("/").pop()||t.path,u=t.path.split("/").slice(0,-1).join("/"),h=a?kC(iu(a,t.path)):{};return c.jsxs("button",{"aria-label":`Open changed file ${t.path}`,className:me("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:s,type:"button",...h,children:[c.jsx(Nb,{path:t.path}),c.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-1.5 truncate",children:[c.jsx("span",{"data-testid":"changed-file-name",className:"shrink-0 truncate",children:o}),u?c.jsx("span",{"data-testid":"changed-file-dir",className:"min-w-0 truncate text-muted-foreground",children:u}):null]}),c.jsx("span",{className:me("ml-1 shrink-0 font-mono text-[10px] font-semibold",i==="untracked"&&"text-amber-700",i==="staged"&&"text-emerald-700",i==="unstaged"&&"text-zinc-800"),children:_U(t,i)})]})}function _U(e,t){return t==="untracked"?"?":t==="staged"?e.index.trim():e.workingTree.trim()}function vU(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 xU(e){const t={name:"",path:"",children:[],isFile:!1},i=new Map;i.set("",t);const s=[...e].sort();for(const o of s){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 v=i.get(b);v||(v={name:f,path:b,children:[],isFile:p},i.set(b,v),i.get(h)?.children.push(v)),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 zw(e,t){const i={"":!0},s=a=>{for(const o of a.children)o.isFile||(i[o.path]=!0,t&&s(o))};return s(e),i}function Iw({defaultExpandAll:e=!1,paths:t,status:i,selectedFile:s,onSelectFile:a,branch:o,emptyMessage:u="No tracked files.",root:h,title:m="Files"}){const f=E.useMemo(()=>xU(t),[t]),p=E.useMemo(()=>zw(f,e),[e,f]),b=E.useMemo(()=>zw(f,!0),[f]),v=Math.max(0,Object.keys(b).length-1),x=E.useMemo(()=>{const O=new Map;for(const H of i)O.set(H.path,H);return O},[i]),[y,S]=E.useState(p),[k,N]=E.useState(!1);E.useEffect(()=>{k||f.children.length===0||(S(p),N(!0))},[p,k,f.children.length]);function T(O){S(H=>({...H,[O]:!H[O]}))}function R(){S(b)}function A(){S({"":!0})}return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[c.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:[c.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[c.jsx(Ga,{className:"size-3.5"}),c.jsx("span",{className:"truncate",children:m})]}),c.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[v>0?c.jsxs("span",{className:"flex items-center gap-0.5",children:[c.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:R,title:"Expand all folders",type:"button",children:c.jsx(r4,{className:"size-3.5"})}),c.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:A,title:"Collapse all folders",type:"button",children:c.jsx(n4,{className:"size-3.5"})})]}):null,o?c.jsx(qe,{variant:"outline",children:o}):null,c.jsx(qe,{variant:"secondary",children:t.length})]})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:f.children.length===0?c.jsx(ht,{variant:"muted",className:"m-3 text-center",children:u}):f.children.map(O=>c.jsx(zN,{depth:0,expanded:y,node:O,onSelectFile:a,onToggle:T,root:h,selectedFile:s,statusByPath:x},O.path))})]})}function zN({depth:e,expanded:t,node:i,onSelectFile:s,onToggle:a,root:o,selectedFile:u,statusByPath:h}){const m=t[i.path]??!1,f=6+e*12,p=o?kC(iu(o,i.path)):{};if(i.isFile){const x=h.get(i.path),y=u===i.path;return c.jsxs("button",{className:me("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:()=>s(i.path),style:{paddingLeft:f},type:"button",...p,children:[c.jsx(Nb,{path:i.path}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name}),x?c.jsx(yU,{file:x}):null]})}const b=m?qn:ia,v=m?Rh:Ga;return c.jsxs("div",{children:[c.jsxs("button",{className:"flex w-full items-center gap-1 py-0.5 text-left text-[12px] font-medium hover:bg-muted",onClick:()=>a(i.path),style:{paddingLeft:f},type:"button",...p,children:[c.jsx(b,{className:"size-3.5 shrink-0 text-muted-foreground"}),c.jsx(v,{className:"size-3.5 shrink-0 text-amber-600"}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name})]}),m?i.children.map(x=>c.jsx(zN,{depth:e+1,expanded:t,node:x,onSelectFile:s,onToggle:a,root:o,selectedFile:u,statusByPath:h},x.path)):null]})}function yU({file:e}){const t=e.workingTree.trim()||e.index.trim();if(!t)return null;const i=e.index.trim()&&!e.workingTree.trim()?"text-emerald-700":t==="?"?"text-amber-700":"text-zinc-700";return c.jsx("span",{className:me("ml-1 shrink-0 font-mono text-[10px] font-semibold",i),children:t})}const SU="modulepreload",wU=function(e){return"/"+e},Pw={},EU=function(t,i,s){let a=Promise.resolve();if(i&&i.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(i.map(f=>{if(f=wU(f),f in Pw)return;Pw[f]=!0;const p=f.endsWith(".css"),b=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${b}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":SU,p||(v.as="script"),v.crossOrigin="",v.href=f,h&&v.setAttribute("nonce",h),document.head.appendChild(v),p)return new Promise((x,y)=>{v.addEventListener("load",x),v.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 Ip,Uw;function kU(){if(Uw)return Ip;Uw=1;function e(z){return z instanceof Map?z.clear=z.delete=z.set=function(){throw new Error("map is read-only")}:z instanceof Set&&(z.add=z.clear=z.delete=function(){throw new Error("set is read-only")}),Object.freeze(z),Object.getOwnPropertyNames(z).forEach(re=>{const ve=z[re],Pe=typeof ve;(Pe==="object"||Pe==="function")&&!Object.isFrozen(ve)&&e(ve)}),z}class t{constructor(re){re.data===void 0&&(re.data={}),this.data=re.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(z){return z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function s(z,...re){const ve=Object.create(null);for(const Pe in z)ve[Pe]=z[Pe];return re.forEach(function(Pe){for(const Nt in Pe)ve[Nt]=Pe[Nt]}),ve}const a="</span>",o=z=>!!z.scope,u=(z,{prefix:re})=>{if(z.startsWith("language:"))return z.replace("language:","language-");if(z.includes(".")){const ve=z.split(".");return[`${re}${ve.shift()}`,...ve.map((Pe,Nt)=>`${Pe}${"_".repeat(Nt+1)}`)].join(" ")}return`${re}${z}`};class h{constructor(re,ve){this.buffer="",this.classPrefix=ve.classPrefix,re.walk(this)}addText(re){this.buffer+=i(re)}openNode(re){if(!o(re))return;const ve=u(re.scope,{prefix:this.classPrefix});this.span(ve)}closeNode(re){o(re)&&(this.buffer+=a)}value(){return this.buffer}span(re){this.buffer+=`<span class="${re}">`}}const m=(z={})=>{const re={children:[]};return Object.assign(re,z),re};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(re){this.top.children.push(re)}openNode(re){const ve=m({scope:re});this.add(ve),this.stack.push(ve)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(re){return this.constructor._walk(re,this.rootNode)}static _walk(re,ve){return typeof ve=="string"?re.addText(ve):ve.children&&(re.openNode(ve),ve.children.forEach(Pe=>this._walk(re,Pe)),re.closeNode(ve)),re}static _collapse(re){typeof re!="string"&&re.children&&(re.children.every(ve=>typeof ve=="string")?re.children=[re.children.join("")]:re.children.forEach(ve=>{f._collapse(ve)}))}}class p extends f{constructor(re){super(),this.options=re}addText(re){re!==""&&this.add(re)}startScope(re){this.openNode(re)}endScope(){this.closeNode()}__addSublanguage(re,ve){const Pe=re.root;ve&&(Pe.scope=`language:${ve}`),this.add(Pe)}toHTML(){return new h(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function b(z){return z?typeof z=="string"?z:z.source:null}function v(z){return S("(?=",z,")")}function x(z){return S("(?:",z,")*")}function y(z){return S("(?:",z,")?")}function S(...z){return z.map(ve=>b(ve)).join("")}function k(z){const re=z[z.length-1];return typeof re=="object"&&re.constructor===Object?(z.splice(z.length-1,1),re):{}}function N(...z){return"("+(k(z).capture?"":"?:")+z.map(Pe=>b(Pe)).join("|")+")"}function T(z){return new RegExp(z.toString()+"|").exec("").length-1}function R(z,re){const ve=z&&z.exec(re);return ve&&ve.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function O(z,{joinWith:re}){let ve=0;return z.map(Pe=>{ve+=1;const Nt=ve;let wt=b(Pe),Ae="";for(;wt.length>0;){const Ee=A.exec(wt);if(!Ee){Ae+=wt;break}Ae+=wt.substring(0,Ee.index),wt=wt.substring(Ee.index+Ee[0].length),Ee[0][0]==="\\"&&Ee[1]?Ae+="\\"+String(Number(Ee[1])+Nt):(Ae+=Ee[0],Ee[0]==="("&&ve++)}return Ae}).map(Pe=>`(${Pe})`).join(re)}const H=/\b\B/,L="[a-zA-Z]\\w*",M="[a-zA-Z_]\\w*",$="\\b\\d+(\\.\\d+)?",P="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",Z="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",K=(z={})=>{const re=/^#![ ]*\//;return z.binary&&(z.begin=S(re,/.*\b/,z.binary,/\b.*/)),s({scope:"meta",begin:re,end:/$/,relevance:0,"on:begin":(ve,Pe)=>{ve.index!==0&&Pe.ignoreMatch()}},z)},Q={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Q]},D={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Q]},Y={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/},X=function(z,re,ve={}){const Pe=s({scope:"comment",begin:z,end:re,contains:[]},ve);Pe.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=N("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 Pe.contains.push({begin:S(/[ ]+/,"(",Nt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Pe},V=X("//","$"),I=X("/\\*","\\*/"),j=X("#","$"),W={scope:"number",begin:$,relevance:0},de={scope:"number",begin:P,relevance:0},oe={scope:"number",begin:F,relevance:0},he={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Q,{begin:/\[/,end:/\]/,relevance:0,contains:[Q]}]},se={scope:"title",begin:L,relevance:0},fe={scope:"title",begin:M,relevance:0},we={begin:"\\.\\s*"+M,relevance:0};var Ze=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:Q,BINARY_NUMBER_MODE:oe,BINARY_NUMBER_RE:F,COMMENT:X,C_BLOCK_COMMENT_MODE:I,C_LINE_COMMENT_MODE:V,C_NUMBER_MODE:de,C_NUMBER_RE:P,END_SAME_AS_BEGIN:function(z){return Object.assign(z,{"on:begin":(re,ve)=>{ve.data._beginMatch=re[1]},"on:end":(re,ve)=>{ve.data._beginMatch!==re[1]&&ve.ignoreMatch()}})},HASH_COMMENT_MODE:j,IDENT_RE:L,MATCH_NOTHING_RE:H,METHOD_GUARD:we,NUMBER_MODE:W,NUMBER_RE:$,PHRASAL_WORDS_MODE:Y,QUOTE_STRING_MODE:D,REGEXP_MODE:he,RE_STARTERS_RE:Z,SHEBANG:K,TITLE_MODE:se,UNDERSCORE_IDENT_RE:M,UNDERSCORE_TITLE_MODE:fe});function ot(z,re){z.input[z.index-1]==="."&&re.ignoreMatch()}function lt(z,re){z.className!==void 0&&(z.scope=z.className,delete z.className)}function Be(z,re){re&&z.beginKeywords&&(z.begin="\\b("+z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",z.__beforeBegin=ot,z.keywords=z.keywords||z.beginKeywords,delete z.beginKeywords,z.relevance===void 0&&(z.relevance=0))}function Lt(z,re){Array.isArray(z.illegal)&&(z.illegal=N(...z.illegal))}function Ts(z,re){if(z.match){if(z.begin||z.end)throw new Error("begin & end are not supported with match");z.begin=z.match,delete z.match}}function ye(z,re){z.relevance===void 0&&(z.relevance=1)}const St=(z,re)=>{if(!z.beforeMatch)return;if(z.starts)throw new Error("beforeMatch cannot be used with starts");const ve=Object.assign({},z);Object.keys(z).forEach(Pe=>{delete z[Pe]}),z.keywords=ve.keywords,z.begin=S(ve.beforeMatch,v(ve.begin)),z.starts={relevance:0,contains:[Object.assign(ve,{endsParent:!0})]},z.relevance=0,delete ve.beforeMatch},Cn=["of","and","for","in","not","or","if","then","parent","list","value"],os="keyword";function Yn(z,re,ve=os){const Pe=Object.create(null);return typeof z=="string"?Nt(ve,z.split(" ")):Array.isArray(z)?Nt(ve,z):Object.keys(z).forEach(function(wt){Object.assign(Pe,Yn(z[wt],re,wt))}),Pe;function Nt(wt,Ae){re&&(Ae=Ae.map(Ee=>Ee.toLowerCase())),Ae.forEach(function(Ee){const Ie=Ee.split("|");Pe[Ie[0]]=[wt,Xn(Ie[0],Ie[1])]})}}function Xn(z,re){return re?Number(re):aa(z)?0:1}function aa(z){return Cn.includes(z.toLowerCase())}const Za={},Bt=z=>{console.error(z)},As=(z,...re)=>{console.log(`WARN: ${z}`,...re)},Si=(z,re)=>{Za[`${z}/${re}`]||(console.log(`Deprecated as of ${z}. ${re}`),Za[`${z}/${re}`]=!0)},Ms=new Error;function Rs(z,re,{key:ve}){let Pe=0;const Nt=z[ve],wt={},Ae={};for(let Ee=1;Ee<=re.length;Ee++)Ae[Ee+Pe]=Nt[Ee],wt[Ee+Pe]=!0,Pe+=T(re[Ee-1]);z[ve]=Ae,z[ve]._emit=wt,z[ve]._multi=!0}function Qa(z){if(Array.isArray(z.begin)){if(z.skip||z.excludeBegin||z.returnBegin)throw Bt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ms;if(typeof z.beginScope!="object"||z.beginScope===null)throw Bt("beginScope must be object"),Ms;Rs(z,z.begin,{key:"beginScope"}),z.begin=O(z.begin,{joinWith:""})}}function fr(z){if(Array.isArray(z.end)){if(z.skip||z.excludeEnd||z.returnEnd)throw Bt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ms;if(typeof z.endScope!="object"||z.endScope===null)throw Bt("endScope must be object"),Ms;Rs(z,z.end,{key:"endScope"}),z.end=O(z.end,{joinWith:""})}}function ul(z){z.scope&&typeof z.scope=="object"&&z.scope!==null&&(z.beginScope=z.scope,delete z.scope)}function Ja(z){ul(z),typeof z.beginScope=="string"&&(z.beginScope={_wrap:z.beginScope}),typeof z.endScope=="string"&&(z.endScope={_wrap:z.endScope}),Qa(z),fr(z)}function js(z){function re(Ae,Ee){return new RegExp(b(Ae),"m"+(z.case_insensitive?"i":"")+(z.unicodeRegex?"u":"")+(Ee?"g":""))}class ve{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ee,Ie){Ie.position=this.position++,this.matchIndexes[this.matchAt]=Ie,this.regexes.push([Ie,Ee]),this.matchAt+=T(Ee)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ee=this.regexes.map(Ie=>Ie[1]);this.matcherRe=re(O(Ee,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ee){this.matcherRe.lastIndex=this.lastIndex;const Ie=this.matcherRe.exec(Ee);if(!Ie)return null;const qt=Ie.findIndex((Ds,to)=>to>0&&Ds!==void 0),jt=this.matchIndexes[qt];return Ie.splice(0,qt),Object.assign(Ie,jt)}}class Pe{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ee){if(this.multiRegexes[Ee])return this.multiRegexes[Ee];const Ie=new ve;return this.rules.slice(Ee).forEach(([qt,jt])=>Ie.addRule(qt,jt)),Ie.compile(),this.multiRegexes[Ee]=Ie,Ie}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ee,Ie){this.rules.push([Ee,Ie]),Ie.type==="begin"&&this.count++}exec(Ee){const Ie=this.getMatcher(this.regexIndex);Ie.lastIndex=this.lastIndex;let qt=Ie.exec(Ee);if(this.resumingScanAtSamePosition()&&!(qt&&qt.index===this.lastIndex)){const jt=this.getMatcher(0);jt.lastIndex=this.lastIndex+1,qt=jt.exec(Ee)}return qt&&(this.regexIndex+=qt.position+1,this.regexIndex===this.count&&this.considerAll()),qt}}function Nt(Ae){const Ee=new Pe;return Ae.contains.forEach(Ie=>Ee.addRule(Ie.begin,{rule:Ie,type:"begin"})),Ae.terminatorEnd&&Ee.addRule(Ae.terminatorEnd,{type:"end"}),Ae.illegal&&Ee.addRule(Ae.illegal,{type:"illegal"}),Ee}function wt(Ae,Ee){const Ie=Ae;if(Ae.isCompiled)return Ie;[lt,Ts,Ja,St].forEach(jt=>jt(Ae,Ee)),z.compilerExtensions.forEach(jt=>jt(Ae,Ee)),Ae.__beforeBegin=null,[Be,Lt,ye].forEach(jt=>jt(Ae,Ee)),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=Yn(Ae.keywords,z.case_insensitive)),Ie.keywordPatternRe=re(qt,!0),Ee&&(Ae.begin||(Ae.begin=/\B|\b/),Ie.beginRe=re(Ie.begin),!Ae.end&&!Ae.endsWithParent&&(Ae.end=/\B|\b/),Ae.end&&(Ie.endRe=re(Ie.end)),Ie.terminatorEnd=b(Ie.end)||"",Ae.endsWithParent&&Ee.terminatorEnd&&(Ie.terminatorEnd+=(Ae.end?"|":"")+Ee.terminatorEnd)),Ae.illegal&&(Ie.illegalRe=re(Ae.illegal)),Ae.contains||(Ae.contains=[]),Ae.contains=[].concat(...Ae.contains.map(function(jt){return Nn(jt==="self"?Ae:jt)})),Ae.contains.forEach(function(jt){wt(jt,Ie)}),Ae.starts&&wt(Ae.starts,Ee),Ie.matcher=Nt(Ie),Ie}if(z.compilerExtensions||(z.compilerExtensions=[]),z.contains&&z.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return z.classNameAliases=s(z.classNameAliases||{}),wt(z)}function pi(z){return z?z.endsWithParent||pi(z.starts):!1}function Nn(z){return z.variants&&!z.cachedVariants&&(z.cachedVariants=z.variants.map(function(re){return s(z,{variants:null},re)})),z.cachedVariants?z.cachedVariants:pi(z)?s(z,{starts:z.starts?s(z.starts):null}):Object.isFrozen(z)?s(z):z}var wi="11.11.1";class dl extends Error{constructor(re,ve){super(re),this.name="HTMLInjectionError",this.html=ve}}const oa=i,eo=s,rt=Symbol("nomatch"),Zn=7,un=function(z){const re=Object.create(null),ve=Object.create(null),Pe=[];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 Ee={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function Ie(pe){return Ee.noHighlightRe.test(pe)}function qt(pe){let je=pe.className+" ";je+=pe.parentNode?pe.parentNode.className:"";const Xe=Ee.languageDetectRe.exec(je);if(Xe){const mt=$i(Xe[1]);return mt||(As(wt.replace("{}",Xe[1])),As("Falling back to no-highlight mode for this block.",pe)),mt?Xe[1]:"no-highlight"}return je.split(/\s+/).find(mt=>Ie(mt)||$i(mt))}function jt(pe,je,Xe){let mt="",Kt="";typeof je=="object"?(mt=pe,Xe=je.ignoreIllegals,Kt=je.language):(Si("10.7.0","highlight(lang, code, ...args) has been deprecated."),Si("10.7.0",`Please use highlight(code, options) instead.
117
+ https://github.com/highlightjs/highlight.js/issues/2277`),Kt=pe,mt=je),Xe===void 0&&(Xe=!0);const zi={code:mt,language:Kt};ca("before:highlight",zi);const dn=zi.result?zi.result:Ds(zi.language,zi.code,Xe);return dn.code=zi.code,ca("after:highlight",dn),dn}function Ds(pe,je,Xe,mt){const Kt=Object.create(null);function zi(be,Me){return be.keywords[Me]}function dn(){if(!ze.keywords){Qt.addText(pt);return}let be=0;ze.keywordPatternRe.lastIndex=0;let Me=ze.keywordPatternRe.exec(pt),Fe="";for(;Me;){Fe+=pt.substring(be,Me.index);const tt=Ei.case_insensitive?Me[0].toLowerCase():Me[0],zt=zi(ze,tt);if(zt){const[Tn,bl]=zt;if(Qt.addText(Fe),Fe="",Kt[tt]=(Kt[tt]||0)+1,Kt[tt]<=Zn&&(br+=bl),Tn.startsWith("_"))Fe+=Me[0];else{const pu=Ei.classNameAliases[Tn]||Tn;hn(Me[0],pu)}}else Fe+=Me[0];be=ze.keywordPatternRe.lastIndex,Me=ze.keywordPatternRe.exec(pt)}Fe+=pt.substring(be),Qt.addText(Fe)}function Zi(){if(pt==="")return;let be=null;if(typeof ze.subLanguage=="string"){if(!re[ze.subLanguage]){Qt.addText(pt);return}be=Ds(ze.subLanguage,pt,!0,mu[ze.subLanguage]),mu[ze.subLanguage]=be._top}else be=io(pt,ze.subLanguage.length?ze.subLanguage:null);ze.relevance>0&&(br+=be.relevance),Qt.__addSublanguage(be._emitter,be.language)}function Ct(){ze.subLanguage!=null?Zi():dn(),pt=""}function hn(be,Me){be!==""&&(Qt.startScope(Me),Qt.addText(be),Qt.endScope())}function hu(be,Me){let Fe=1;const tt=Me.length-1;for(;Fe<=tt;){if(!be._emit[Fe]){Fe++;continue}const zt=Ei.classNameAliases[be[Fe]]||be[Fe],Tn=Me[Fe];zt?hn(Tn,zt):(pt=Tn,dn(),pt=""),Fe++}}function so(be,Me){return be.scope&&typeof be.scope=="string"&&Qt.openNode(Ei.classNameAliases[be.scope]||be.scope),be.beginScope&&(be.beginScope._wrap?(hn(pt,Ei.classNameAliases[be.beginScope._wrap]||be.beginScope._wrap),pt=""):be.beginScope._multi&&(hu(be.beginScope,Me),pt="")),ze=Object.create(be,{parent:{value:ze}}),ze}function ml(be,Me,Fe){let tt=R(be.endRe,Fe);if(tt){if(be["on:end"]){const zt=new t(be);be["on:end"](Me,zt),zt.isMatchIgnored&&(tt=!1)}if(tt){for(;be.endsParent&&be.parent;)be=be.parent;return be}}if(be.endsWithParent)return ml(be.parent,Me,Fe)}function ro(be){return ze.matcher.regexIndex===0?(pt+=be[0],1):(_r=!0,0)}function Gh(be){const Me=be[0],Fe=be.rule,tt=new t(Fe),zt=[Fe.__beforeBegin,Fe["on:begin"]];for(const Tn of zt)if(Tn&&(Tn(be,tt),tt.isMatchIgnored))return ro(Me);return Fe.skip?pt+=Me:(Fe.excludeBegin&&(pt+=Me),Ct(),!Fe.returnBegin&&!Fe.excludeBegin&&(pt=Me)),so(Fe,be),Fe.returnBegin?0:Me.length}function Qi(be){const Me=be[0],Fe=je.substring(be.index),tt=ml(ze,be,Fe);if(!tt)return rt;const zt=ze;ze.endScope&&ze.endScope._wrap?(Ct(),hn(Me,ze.endScope._wrap)):ze.endScope&&ze.endScope._multi?(Ct(),hu(ze.endScope,be)):zt.skip?pt+=Me:(zt.returnEnd||zt.excludeEnd||(pt+=Me),Ct(),zt.excludeEnd&&(pt=Me));do ze.scope&&Qt.closeNode(),!ze.skip&&!ze.subLanguage&&(br+=ze.relevance),ze=ze.parent;while(ze!==tt.parent);return tt.starts&&so(tt.starts,be),zt.returnEnd?0:Me.length}function pl(){const be=[];for(let Me=ze;Me!==Ei;Me=Me.parent)Me.scope&&be.unshift(Me.scope);be.forEach(Me=>Qt.openNode(Me))}let ua={};function ao(be,Me){const Fe=Me&&Me[0];if(pt+=be,Fe==null)return Ct(),0;if(ua.type==="begin"&&Me.type==="end"&&ua.index===Me.index&&Fe===""){if(pt+=je.slice(Me.index,Me.index+1),!Nt){const tt=new Error(`0 width match regex (${pe})`);throw tt.languageName=pe,tt.badRule=ua.rule,tt}return 1}if(ua=Me,Me.type==="begin")return Gh(Me);if(Me.type==="illegal"&&!Xe){const tt=new Error('Illegal lexeme "'+Fe+'" for mode "'+(ze.scope||"<unnamed>")+'"');throw tt.mode=ze,tt}else if(Me.type==="end"){const tt=Qi(Me);if(tt!==rt)return tt}if(Me.type==="illegal"&&Fe==="")return pt+=`
118
+ `,1;if(gl>1e5&&gl>Me.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pt+=Fe,Fe.length}const Ei=$i(pe);if(!Ei)throw Bt(wt.replace("{}",pe)),new Error('Unknown language: "'+pe+'"');const fu=js(Ei);let oo="",ze=mt||fu;const mu={},Qt=new Ee.__emitter(Ee);pl();let pt="",br=0,Bs=0,gl=0,_r=!1;try{if(Ei.__emitTokens)Ei.__emitTokens(je,Qt);else{for(ze.matcher.considerAll();;){gl++,_r?_r=!1:ze.matcher.considerAll(),ze.matcher.lastIndex=Bs;const be=ze.matcher.exec(je);if(!be)break;const Me=je.substring(Bs,be.index),Fe=ao(Me,be);Bs=be.index+Fe}ao(je.substring(Bs))}return Qt.finalize(),oo=Qt.toHTML(),{language:pe,value:oo,relevance:br,illegal:!1,_emitter:Qt,_top:ze}}catch(be){if(be.message&&be.message.includes("Illegal"))return{language:pe,value:oa(je),illegal:!0,relevance:0,_illegalBy:{message:be.message,index:Bs,context:je.slice(Bs-100,Bs+100),mode:be.mode,resultSoFar:oo},_emitter:Qt};if(Nt)return{language:pe,value:oa(je),illegal:!1,relevance:0,errorRaised:be,_emitter:Qt,_top:ze};throw be}}function to(pe){const je={value:oa(pe),illegal:!1,relevance:0,_top:Ae,_emitter:new Ee.__emitter(Ee)};return je._emitter.addText(pe),je}function io(pe,je){je=je||Ee.languages||Object.keys(re);const Xe=to(pe),mt=je.filter($i).filter(pr).map(Ct=>Ds(Ct,pe,!1));mt.unshift(Xe);const Kt=mt.sort((Ct,hn)=>{if(Ct.relevance!==hn.relevance)return hn.relevance-Ct.relevance;if(Ct.language&&hn.language){if($i(Ct.language).supersetOf===hn.language)return 1;if($i(hn.language).supersetOf===Ct.language)return-1}return 0}),[zi,dn]=Kt,Zi=zi;return Zi.secondBest=dn,Zi}function ls(pe,je,Xe){const mt=je&&ve[je]||Xe;pe.classList.add("hljs"),pe.classList.add(`language-${mt}`)}function Gt(pe){let je=null;const Xe=qt(pe);if(Ie(Xe))return;if(ca("before:highlightElement",{el:pe,language:Xe}),pe.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",pe);return}if(pe.children.length>0&&(Ee.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(pe)),Ee.throwUnescapedHTML))throw new dl("One of your code blocks includes unescaped HTML.",pe.innerHTML);je=pe;const mt=je.textContent,Kt=Xe?jt(mt,{language:Xe,ignoreIllegals:!0}):io(mt);pe.innerHTML=Kt.value,pe.dataset.highlighted="yes",ls(pe,Xe,Kt.language),pe.result={language:Kt.language,re:Kt.relevance,relevance:Kt.relevance},Kt.secondBest&&(pe.secondBest={language:Kt.secondBest.language,relevance:Kt.secondBest.relevance}),ca("after:highlightElement",{el:pe,result:Kt,text:mt})}function Bi(pe){Ee=eo(Ee,pe)}const mr=()=>{no(),Si("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function hl(){no(),Si("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let cu=!1;function no(){function pe(){no()}if(document.readyState==="loading"){cu||window.addEventListener("DOMContentLoaded",pe,!1),cu=!0;return}document.querySelectorAll(Ee.cssSelector).forEach(Gt)}function uu(pe,je){let Xe=null;try{Xe=je(z)}catch(mt){if(Bt("Language definition for '{}' could not be registered.".replace("{}",pe)),Nt)Bt(mt);else throw mt;Xe=Ae}Xe.name||(Xe.name=pe),re[pe]=Xe,Xe.rawDefinition=je.bind(null,z),Xe.aliases&&Os(Xe.aliases,{languageName:pe})}function la(pe){delete re[pe];for(const je of Object.keys(ve))ve[je]===pe&&delete ve[je]}function fl(){return Object.keys(re)}function $i(pe){return pe=(pe||"").toLowerCase(),re[pe]||re[ve[pe]]}function Os(pe,{languageName:je}){typeof pe=="string"&&(pe=[pe]),pe.forEach(Xe=>{ve[Xe.toLowerCase()]=je})}function pr(pe){const je=$i(pe);return je&&!je.disableAutodetect}function gr(pe){pe["before:highlightBlock"]&&!pe["before:highlightElement"]&&(pe["before:highlightElement"]=je=>{pe["before:highlightBlock"](Object.assign({block:je.el},je))}),pe["after:highlightBlock"]&&!pe["after:highlightElement"]&&(pe["after:highlightElement"]=je=>{pe["after:highlightBlock"](Object.assign({block:je.el},je))})}function Zt(pe){gr(pe),Pe.push(pe)}function du(pe){const je=Pe.indexOf(pe);je!==-1&&Pe.splice(je,1)}function ca(pe,je){const Xe=pe;Pe.forEach(function(mt){mt[Xe]&&mt[Xe](je)})}function Ls(pe){return Si("10.7.0","highlightBlock will be removed entirely in v12.0"),Si("10.7.0","Please use highlightElement now."),Gt(pe)}Object.assign(z,{highlight:jt,highlightAuto:io,highlightAll:no,highlightElement:Gt,highlightBlock:Ls,configure:Bi,initHighlighting:mr,initHighlightingOnLoad:hl,registerLanguage:uu,unregisterLanguage:la,listLanguages:fl,getLanguage:$i,registerAliases:Os,autoDetection:pr,inherit:eo,addPlugin:Zt,removePlugin:du}),z.debugMode=function(){Nt=!1},z.safeMode=function(){Nt=!0},z.versionString=wi,z.regex={concat:S,lookahead:v,either:N,optional:y,anyNumberOfTimes:x};for(const pe in Ze)typeof Ze[pe]=="object"&&e(Ze[pe]);return Object.assign(z,Ze),z},Li=un({});return Li.newInstance=()=>un({}),Ip=Li,Li.HighlightJS=Li,Li.default=Li,Ip}var Pp,Hw;function CU(){if(Hw)return Pp;Hw=1;function e(t){const i=t.regex,s=i.concat(/[\p{L}_]/u,i.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:i.concat(/</,i.lookahead(i.concat(s,i.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:s,relevance:0,starts:p}]},{className:"tag",begin:i.concat(/<\//,i.lookahead(i.concat(s,/>/))),contains:[{className:"name",begin:s,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return Pp=e,Pp}var Up,Fw;function NU(){if(Fw)return Up;Fw=1;function e(t){const i=t.regex,s={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[s]}]};Object.assign(s,{className:"variable",variants:[{begin:i.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,s,o]};o.contains.push(m);const f={match:/\\"/},p={className:"string",begin:/'/,end:/'/},b={match:/\\'/},v={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,s]},x=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],y=t.SHEBANG({binary:`(${x.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},k=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],N=["true","false"],T={match:/(\/[a-z._-]+)+/},R=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],A=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["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"],H=["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:k,literal:N,built_in:[...R,...A,"set","shopt",...O,...H]},contains:[y,t.SHEBANG(),S,v,u,h,T,m,f,p,b,s]}}return Up=e,Up}var Hp,$w;function TU(){if($w)return Hp;$w=1;function e(t){const i=t.regex,s=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",h="("+a+"|"+i.optional(o)+"[a-zA-Z_]\\w*"+i.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},v={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:/<.*?>/},s,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:i.optional(o)+t.IDENT_RE,relevance:0},y=i.optional(o)+t.IDENT_RE+"\\s*\\(",N={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=[v,m,s,t.C_BLOCK_COMMENT_MODE,b,p],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:T.concat([{begin:/\(/,end:/\)/,keywords:N,contains:T.concat(["self"]),relevance:0}]),relevance:0},A={begin:"("+h+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:N,relevance:0},{begin:y,returnBegin:!0,contains:[t.inherit(x,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[s,t.C_BLOCK_COMMENT_MODE,p,b,m,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",s,t.C_BLOCK_COMMENT_MODE,p,b,m]}]},m,s,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(R,A,T,[v,{begin:t.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:v,strings:p,keywords:N}}}return Hp=e,Hp}var Fp,Vw;function AU(){if(Vw)return Fp;Vw=1;function e(t){const i=t.regex,s=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",h="(?!struct)("+a+"|"+i.optional(o)+"[a-zA-Z_]\\w*"+i.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},v={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:/<.*?>/},s,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:i.optional(o)+t.IDENT_RE,relevance:0},y=i.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"],k=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],O={type:k,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},H={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:i.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},L=[H,v,m,s,t.C_BLOCK_COMMENT_MODE,b,p],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:L.concat([{begin:/\(/,end:/\)/,keywords:O,contains:L.concat(["self"]),relevance:0}]),relevance:0},$={className:"function",begin:"("+h+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:O,relevance:0},{begin:y,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[s,t.C_BLOCK_COMMENT_MODE,p,b,m,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",s,t.C_BLOCK_COMMENT_MODE,p,b,m]}]},m,s,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(M,$,H,L,[v,{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:O,contains:["self",m]},{begin:t.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return Fp=e,Fp}var $p,qw;function MU(){if(qw)return $p;qw=1;function e(t){const i=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],s=["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:i,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:'""'}]},v=t.inherit(b,{illegal:/\n/}),x={className:"subst",begin:/\{/,end:/\}/,keywords:h},y=t.inherit(x,{illegal:/\n/}),S={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,y]},k={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]},N=t.inherit(k,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]});x.contains=[k,S,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.C_BLOCK_COMMENT_MODE],y.contains=[N,S,v,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const T={variants:[p,k,S,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},R={begin:"<",end:">",contains:[{beginKeywords:"in out"},m]},A=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",O={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,R,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,R,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:"("+A+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:h,contains:[{beginKeywords:s.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,R],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]},O]}}return $p=e,$p}var Vp,Gw;function RU(){if(Gw)return Vp;Gw=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"],i=["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"],s=[...t,...i],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),v={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},x="and or not only",y=/@-?\w[\w]*(-\w+)*/,S="[a-zA-Z-][a-zA-Z0-9_-]*",k=[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,v,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,...k,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...k,{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:x,attribute:a.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...k,b.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+s.join("|")+")\\b"}]}}return Vp=m,Vp}var qp,Kw;function jU(){if(Kw)return qp;Kw=1;function e(t){const i=t.regex,s={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:i.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}]},v=t.inherit(p,{contains:[]}),x=t.inherit(b,{contains:[]});p.contains.push(x),b.contains.push(v);let y=[s,f];return[p,b,v,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}]}]},s,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 qp=e,qp}var Gp,Ww;function DU(){if(Ww)return Gp;Ww=1;function e(t){const i=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:i.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:i.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 Gp=e,Gp}var Kp,Yw;function OU(){if(Yw)return Kp;Yw=1;function e(t){const i=t.regex,s="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=i.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=i.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},v={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:i.concat(/<<[-~]?'?/,i.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]})]}]},x="[1-9](_?[0-9])*|0",y="[0-9](_?[0-9])*",S={className:"number",relevance:0,variants:[{begin:`\\b(${x})(\\.(${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"}]},k={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:h}]},L=[v,{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+/,s],scope:{1:"keyword",3:"title.function"},contains:[k]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[v,{begin:s}],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,k.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 Kp=e,Kp}var Wp,Xw;function LU(){if(Xw)return Wp;Xw=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 Wp=e,Wp}var Yp,Zw;function BU(){if(Zw)return Yp;Zw=1;function e(t){const i=t.regex,s=/[_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:i.concat(s,i.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return Yp=e,Yp}var Xp,Qw;function zU(){if(Qw)return Xp;Qw=1;function e(t){const i=t.regex,s={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,s,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,b=/'[^']*'/,v=i.either(f,p,b),x=i.concat(v,"(\\s*\\.\\s*",v,")*",i.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{begin:x,className:"attr",starts:{end:/$/,contains:[a,m,u,o,h,s]}}]}}return Xp=e,Xp}var Zp,Jw;function IU(){if(Jw)return Zp;Jw=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,i="[0-9a-fA-F](_*[0-9a-fA-F])*",s={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]((${i})\\.?|(${i})?\\.(${i}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${i})[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"]}]},k={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:[k,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,s,u.C_BLOCK_COMMENT_MODE]},u.C_LINE_COMMENT_MODE,u.C_BLOCK_COMMENT_MODE]},s,S]}}return Zp=o,Zp}var Qp,e2;function PU(){if(e2)return Qp;e2=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"],i=["true","false","null","undefined","NaN","Infinity"],s=["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,s,a);function m(f){const p=f.regex,b=(fe,{after:we})=>{const xe="</"+fe[0].slice(1);return fe.input.indexOf(xe,we)!==-1},v=e,x={begin:"<>",end:"</>"},y=/<[A-Za-z0-9\\._:-]+\s*\/>/,S={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(fe,we)=>{const xe=fe[0].length+fe.index,Ze=fe.input[xe];if(Ze==="<"||Ze===","){we.ignoreMatch();return}Ze===">"&&(b(fe,{after:xe})||we.ignoreMatch());let ot;const lt=fe.input.substring(xe);if(ot=lt.match(/^\s*=/)){we.ignoreMatch();return}if((ot=lt.match(/^\s+extends\s+/))&&ot.index===0){we.ignoreMatch();return}}},k={$pattern:e,keyword:t,literal:i,built_in:h,"variable.language":u},N="[0-9](_?[0-9])*",T=`\\.(${N})`,R="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",A={className:"number",variants:[{begin:`(\\b(${R})((${T})|\\.)?|(${T}))[eE][+-]?(${N})\\b`},{begin:`\\b(${R})\\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},O={className:"subst",begin:"\\$\\{",end:"\\}",keywords:k,contains:[]},H={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,O],subLanguage:"xml"}},L={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,O],subLanguage:"css"}},M={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,O],subLanguage:"graphql"}},$={className:"string",begin:"`",end:"`",contains:[f.BACKSLASH_ESCAPE,O]},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:v+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),f.C_BLOCK_COMMENT_MODE,f.C_LINE_COMMENT_MODE]},Z=[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,H,L,M,$,{match:/\$\d+/},A];O.contains=Z.concat({begin:/\{/,end:/\}/,keywords:k,contains:["self"].concat(Z)});const K=[].concat(F,O.contains),Q=K.concat([{begin:/(\s*)\(/,end:/\)/,keywords:k,contains:["self"].concat(K)}]),q={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:k,contains:Q},D={variants:[{match:[/class/,/\s+/,v,/\s+/,/extends/,/\s+/,p.concat(v,"(",p.concat(/\./,v),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,v],scope:{1:"keyword",3:"title.class"}}]},Y={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:{_:[...s,...a]}},X={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},V={variants:[{match:[/function/,/\s+/,v,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[q],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function j(fe){return p.concat("(?!",fe.join("|"),")")}const W={match:p.concat(/\b/,j([...o,"super","import"].map(fe=>`${fe}\\s*\\(`)),v,p.lookahead(/\s*\(/)),className:"title.function",relevance:0},de={begin:p.concat(/\./,p.lookahead(p.concat(v,/(?![0-9A-Za-z$_(])/))),end:v,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},oe={match:[/get|set/,/\s+/,v,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},q]},he="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+f.UNDERSCORE_IDENT_RE+")\\s*=>",se={match:[/const|var|let/,/\s+/,v,/\s*/,/=\s*/,/(async\s*)?/,p.lookahead(he)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[q]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:k,exports:{PARAMS_CONTAINS:Q,CLASS_REFERENCE:Y},illegal:/#(?![$_A-z])/,contains:[f.SHEBANG({label:"shebang",binary:"node",relevance:5}),X,f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,H,L,M,$,F,{match:/\$\d+/},A,Y,{scope:"attr",match:v+p.lookahead(":"),relevance:0},se,{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:he,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:k,contains:Q}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:x.begin,end:x.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:v,className:"title.function"})]},{match:/\.\.\./,relevance:0},de,{match:"\\$"+v,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[q]},W,I,D,oe,{match:/\$[(.]/}]}}return Qp=m,Qp}var Jp,t2;function UU(){if(t2)return Jp;t2=1;function e(t){const i={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},s={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],o={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[i,s,t.QUOTE_STRING_MODE,o,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return Jp=e,Jp}var eg,i2;function HU(){if(i2)return eg;i2=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,i="[0-9a-fA-F](_*[0-9a-fA-F])*",s={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]((${i})\\.?|(${i})?\\.(${i}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${i})[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 v={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+o.UNDERSCORE_IDENT_RE+")?"},x={className:"meta",begin:"@"+o.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[o.inherit(b,{className:"string"}),"self"]}]},y=s,S=o.COMMENT("/\\*","\\*/",{contains:[o.C_BLOCK_COMMENT_MODE]}),k={variants:[{className:"type",begin:o.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},N=k;return N.variants[1].contains=[k],k.variants[1].contains=[N],{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,v,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:[k,o.C_LINE_COMMENT_MODE,S],relevance:0},o.C_LINE_COMMENT_MODE,S,v,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},v,x]},b,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
119
+ `},y]}}return eg=a,eg}var tg,n2;function FU(){if(n2)return tg;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"],i=["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"],s=[...t,...i],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),v=m,x="and or not only",y="[\\w-]+",S="("+y+"|@\\{"+y+"\\})",k=[],N=[],T=function(K){return{className:"string",begin:"~?"+K+".*?"+K}},R=function(K,Q,q){return{className:K,begin:Q,relevance:q}},A={$pattern:/[a-z-]+/,keyword:x,attribute:a.join(" ")},O={begin:"\\(",end:"\\)",contains:N,keywords:A,relevance:0};N.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,O,R("variable","@@?"+y,10),R("variable","@\\{"+y+"\\}"),R("built_in","~?`[^`]*?`"),{className:"attribute",begin:y+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},b.IMPORTANT,{beginKeywords:"and not"},b.FUNCTION_DISPATCH);const H=N.concat({begin:/\{/,end:/\}/,contains:k}),L={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(N)},M={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:N}}]},$={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:A,returnEnd:!0,contains:N,relevance:0}},P={className:"variable",variants:[{begin:"@"+y+"\\s*:",relevance:15},{begin:"@"+y}],starts:{end:"[;}]",returnEnd:!0,contains:H}},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,R("keyword","all\\b"),R("variable","@\\{"+y+"\\}"),{begin:"\\b("+s.join("|")+")\\b",className:"selector-tag"},b.CSS_NUMBER_MODE,R("selector-tag",S,0),R("selector-id","#"+S),R("selector-class","\\."+S,0),R("selector-tag","&",0),b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+o.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+u.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:H},{begin:"!important"},b.FUNCTION_DISPATCH]},Z={begin:y+`:(:)?(${v.join("|")})`,returnBegin:!0,contains:[F]};return k.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,$,P,Z,M,F,L,b.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:k}}return tg=f,tg}var ig,s2;function $U(){if(s2)return ig;s2=1;function e(t){const i="\\[=*\\[",s="\\]=*\\]",a={begin:i,end:s,contains:["self"]},o=[t.COMMENT("--(?!"+i+")","$"),t.COMMENT("--"+i,s,{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:i,end:s,contains:[a],relevance:5}])}}return ig=e,ig}var ng,r2;function VU(){if(r2)return ng;r2=1;function e(t){const i={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,i]},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:[i,s]},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:[i]};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,i,s,a,o,u,h]}}return ng=e,ng}var sg,a2;function qU(){if(a2)return sg;a2=1;function e(t){const i=t.regex,s=["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:s.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:i.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],v=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],x=(k,N,T="\\1")=>{const R=T==="\\1"?T:i.concat(T,N);return i.concat(i.concat("(?:",k,")"),N,/(?:\\.|[^\\\/])*?/,R,/(?:\\.|[^\\\/])*?/,T,a)},y=(k,N,T)=>i.concat(i.concat("(?:",k,")"),N,/(?:\\.|[^\\\/])*?/,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:x("s|tr|y",i.either(...v,{capture:!0}))},{begin:x("s|tr|y","\\(","\\)")},{begin:x("s|tr|y","\\[","\\]")},{begin:x("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:y("(?:m|qr)?",/\//,/\//)},{begin:y("m|qr",i.either(...v,{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 sg=e,sg}var rg,o2;function GU(){if(o2)return rg;o2=1;function e(t){const i={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+"},s=/[a-zA-Z@][a-zA-Z0-9_]*/,m={"variable.language":["this","super"],$pattern:s,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:s,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:m,illegal:"</",contains:[i,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 rg=e,rg}var ag,l2;function KU(){if(l2)return ag;l2=1;function e(t){const i=t.regex,s=/(?![A-Za-z0-9])(?![$])/,a=i.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,s),o=i.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,s),u=i.concat(/[A-Z]+/,s),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)}),v={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(f),"on:begin":(q,D)=>{D.data._beginMatch=q[1]||q[2]},"on:end":(q,D)=>{D.data._beginMatch!==q[1]&&D.ignoreMatch()}},x=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
120
+ ]`,S={scope:"string",variants:[b,p,v,x]},k={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},N=["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"],R=["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"],O={keyword:T,literal:(q=>{const D=[];return q.forEach(Y=>{D.push(Y),Y.toLowerCase()===Y?D.push(Y.toUpperCase()):D.push(Y.toLowerCase())}),D})(N),built_in:R},H=q=>q.map(D=>D.replace(/\|\d+$/,"")),L={variants:[{match:[/new/,i.concat(y,"+"),i.concat("(?!",H(R).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},M=i.concat(a,"\\b(?!\\()"),$={variants:[{match:[i.concat(/::/,i.lookahead(/(?!class\b)/)),M],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,i.concat(/::/,i.lookahead(/(?!class\b)/)),M],scope:{1:"title.class",3:"variable.constant"}},{match:[o,i.concat("::",i.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},P={scope:"attr",match:i.concat(a,i.lookahead(":"),i.lookahead(/(?!::)/))},F={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[P,h,$,t.C_BLOCK_COMMENT_MODE,S,k,L]},Z={relevance:0,match:[/\b/,i.concat("(?!fn\\b|function\\b|",H(T).join("\\b|"),"|",H(R).join("\\b|"),"\\b)"),a,i.concat(y,"*"),i.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[F]};F.contains.push(Z);const K=[P,$,t.C_BLOCK_COMMENT_MODE,S,k,L],Q={begin:i.concat(/#\[\s*\\?/,i.either(o,u)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:N,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:N,keyword:["new","array"]},contains:["self",...K]},...K,{scope:"meta",variants:[{match:o},{match:u}]}]};return{case_insensitive:!1,keywords:O,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,Z,$,{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:O,contains:["self",Q,h,$,t.C_BLOCK_COMMENT_MODE,S,k]}]},{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,k]}}return ag=e,ag}var og,c2;function WU(){if(c2)return og;c2=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 og=e,og}var lg,u2;function YU(){if(u2)return lg;u2=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return lg=e,lg}var cg,d2;function XU(){if(d2)return cg;d2=1;function e(t){const i=t.regex,s=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},v={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]},x="[0-9](_?[0-9])*",y=`(\\b(${x}))?\\.(${x})|\\b(${x})\\.`,S=`\\b|${a.join("|")}`,k={className:"number",relevance:0,variants:[{begin:`(\\b(${x})|(${y}))[eE][+-]?(${x})[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(${x})[jJ](?=${S})`}]},N={className:"comment",begin:i.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,k,v,t.HASH_COMMENT_MODE]}]};return p.contains=[v,k,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:m,illegal:/(<\/|\?)|=>/,contains:[f,k,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},v,N,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,s],scope:{1:"keyword",3:"title.function"},contains:[T]},{variants:[{match:[/\bclass/,/\s+/,s,/\s*/,/\(\s*/,s,/\s*\)/]},{match:[/\bclass/,/\s+/,s]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[k,T,v]}]}}return cg=e,cg}var ug,h2;function ZU(){if(h2)return ug;h2=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return ug=e,ug}var dg,f2;function QU(){if(f2)return dg;f2=1;function e(t){const i=t.regex,s=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=i.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=i.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:s,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:i.lookahead(i.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:s},{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:[s,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:u},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return dg=e,dg}var hg,m2;function JU(){if(m2)return hg;m2=1;function e(t){const i=t.regex,s=/(r#)?/,a=i.concat(s,t.UNDERSCORE_IDENT_RE),o=i.concat(s,t.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:i.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,i.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 hg=e,hg}var fg,p2;function eH(){if(p2)return fg;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"],i=["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"],s=[...t,...i],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,v=o,x="@[a-z-]+",y="and or not only",k={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("+s.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+v.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+b.join("|")+")"},k,{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,k,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:x,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:y,attribute:a.join(" ")},contains:[{begin:x,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},k,f.QUOTE_STRING_MODE,f.APOS_STRING_MODE,p.HEXCOLOR,p.CSS_NUMBER_MODE]},p.FUNCTION_DISPATCH]}}return fg=m,fg}var mg,g2;function tH(){if(g2)return mg;g2=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 mg=e,mg}var pg,b2;function iH(){if(b2)return pg;b2=1;function e(t){const i=t.regex,s=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"],v=["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"],x=["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(H=>!b.includes(H)),k={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},N={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={match:i.concat(/\b/,i.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function R(H){return i.concat(/\b/,i.either(...H.map(L=>L.replace(/\s+/,"\\s+"))),/\b/)}const A={scope:"keyword",match:R(x),relevance:0};function O(H,{exceptions:L,when:M}={}){const $=M;return L=L||[],H.map(P=>P.match(/\|\d+$/)||L.includes(P)?P:$(P)?`${P}|0`:P)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(S,{when:H=>H.length<3}),literal:u,type:m,built_in:v},contains:[{scope:"type",match:R(h)},A,T,k,a,o,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,s,N]}}return pg=e,pg}var gg,_2;function nH(){if(_2)return gg;_2=1;function e(M){return M?typeof M=="string"?M:M.source:null}function t(M){return i("(?=",M,")")}function i(...M){return M.map(P=>e(P)).join("")}function s(M){const $=M[M.length-1];return typeof $=="object"&&$.constructor===Object?(M.splice(M.length-1,1),$):{}}function a(...M){return"("+(s(M).capture?"":"?:")+M.map(F=>e(F)).join("|")+")"}const o=M=>i(/\b/,M,/\w$/.test(M)?/\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"],v=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],x=["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]/),k=i(y,S,"*"),N=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(N,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),R=i(N,T,"*"),A=i(/[A-Z]/,T,"*"),O=["attached","autoclosure",i(/convention\(/,a("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",i(/objc\(/,R,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],H=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function L(M){const $={match:/\s+/,relevance:0},P=M.COMMENT("/\\*","\\*/",{contains:["self"]}),F=[M.C_LINE_COMMENT_MODE,P],Z={match:[/\./,a(...u,...h)],className:{2:"keyword"}},K={match:i(/\./,a(...f)),relevance:0},Q=f.filter(rt=>typeof rt=="string").concat(["_|0"]),q=f.filter(rt=>typeof rt!="string").concat(m).map(o),D={variants:[{className:"keyword",match:a(...q,...h)}]},Y={$pattern:a(/\b\w+/,/#\w+/),keyword:Q.concat(v),literal:p},X=[Z,K,D],V={match:i(/\./,a(...x)),relevance:0},I={className:"built_in",match:i(/\b/,a(...x),/(?=\()/)},j=[V,I],W={match:/->/,relevance:0},de={className:"operator",relevance:0,variants:[{match:k},{match:`\\.(\\.|${S})+`}]},oe=[W,de],he="([0-9]_*)+",se="([0-9a-fA-F]_*)+",fe={className:"number",relevance:0,variants:[{match:`\\b(${he})(\\.(${he}))?([eE][+-]?(${he}))?\\b`},{match:`\\b0x(${se})(\\.(${se}))?([pP][+-]?(${he}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},we=(rt="")=>({className:"subst",variants:[{match:i(/\\/,rt,/[0\\tnr"']/)},{match:i(/\\/,rt,/u\{[0-9a-fA-F]{1,8}\}/)}]}),xe=(rt="")=>({className:"subst",match:i(/\\/,rt,/[\t ]*(?:[\r\n]|\r\n)/)}),Ze=(rt="")=>({className:"subst",label:"interpol",begin:i(/\\/,rt,/\(/),end:/\)/}),ot=(rt="")=>({begin:i(rt,/"""/),end:i(/"""/,rt),contains:[we(rt),xe(rt),Ze(rt)]}),lt=(rt="")=>({begin:i(rt,/"/),end:i(/"/,rt),contains:[we(rt),Ze(rt)]}),Be={className:"string",variants:[ot(),ot("#"),ot("##"),ot("###"),lt(),lt("#"),lt("##"),lt("###")]},Lt=[M.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[M.BACKSLASH_ESCAPE]}],Ts={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:Lt},ye=rt=>{const Zn=i(rt,/\//),un=i(/\//,rt);return{begin:Zn,end:un,contains:[...Lt,{scope:"comment",begin:`#(?!.*${un})`,end:/$/}]}},St={scope:"regexp",variants:[ye("###"),ye("##"),ye("#"),Ts]},Cn={match:i(/`/,R,/`/)},os={className:"variable",match:/\$\d+/},Yn={className:"variable",match:`\\$${T}+`},Xn=[Cn,os,Yn],aa={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:H,contains:[...oe,fe,Be]}]}},Za={scope:"keyword",match:i(/@/,a(...O),t(a(/\(/,/\s+/)))},Bt={scope:"meta",match:i(/@/,R)},As=[aa,Za,Bt],Si={match:t(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:i(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,T,"+")},{className:"type",match:A,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:i(/\s+&\s+/,t(A)),relevance:0}]},Ms={begin:/</,end:/>/,keywords:Y,contains:[...F,...X,...As,W,Si]};Si.contains.push(Ms);const Rs={match:i(R,/\s*:/),keywords:"_|0",relevance:0},Qa={begin:/\(/,end:/\)/,relevance:0,keywords:Y,contains:["self",Rs,...F,St,...X,...j,...oe,fe,Be,...Xn,...As,Si]},fr={begin:/</,end:/>/,keywords:"repeat each",contains:[...F,Si]},ul={begin:a(t(i(R,/\s*:/)),t(i(R,/\s+/,R,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:R}]},Ja={begin:/\(/,end:/\)/,keywords:Y,contains:[ul,...F,...X,...oe,fe,Be,...As,Si,Qa],endsParent:!0,illegal:/["']/},js={match:[/(func|macro)/,/\s+/,a(Cn.match,R,k)],className:{1:"keyword",3:"title.function"},contains:[fr,Ja,$],illegal:[/\[/,/%/]},pi={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[fr,Ja,$],illegal:/\[|%/},Nn={match:[/operator/,/\s+/,k],className:{1:"keyword",3:"title"}},wi={begin:[/precedencegroup/,/\s+/,A],className:{1:"keyword",3:"title"},contains:[Si],keywords:[...b,...p],end:/}/},dl={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},oa={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},eo={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,R,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:Y,contains:[fr,...X,{begin:/:/,end:/\{/,keywords:Y,contains:[{scope:"title.class.inherited",match:A},...X],relevance:0}]};for(const rt of Be.variants){const Zn=rt.contains.find(Li=>Li.label==="interpol");Zn.keywords=Y;const un=[...X,...j,...oe,fe,Be,...Xn];Zn.contains=[...un,{begin:/\(/,end:/\)/,contains:["self",...un]}]}return{name:"Swift",keywords:Y,contains:[...F,js,pi,dl,oa,eo,Nn,wi,{beginKeywords:"import",end:/$/,contains:[...F],relevance:0},St,...X,...j,...oe,fe,Be,...Xn,...As,Si,Qa]}}return gg=L,gg}var bg,v2;function sH(){if(v2)return bg;v2=1;function e(t){const i="true false yes no null",s="[\\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,{}[\]]+/}]}),x={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:i,relevance:0},S={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},k={begin:"\\[",end:"\\]",contains:[y],illegal:"\\n",relevance:0},N=[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+!"+s},{className:"type",begin:"!<"+s+">"},{className:"type",begin:"!"+s},{className:"type",begin:"!!"+s},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:i,keywords:{literal:i}},x,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},S,k,u,h],T=[...N];return T.pop(),T.push(m),y.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}return bg=e,bg}var _g,x2;function rH(){if(x2)return _g;x2=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"],i=["true","false","null","undefined","NaN","Infinity"],s=["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,s,a);function m(p){const b=p.regex,v=(we,{after:xe})=>{const Ze="</"+we[0].slice(1);return we.input.indexOf(Ze,xe)!==-1},x=e,y={begin:"<>",end:"</>"},S=/<[A-Za-z0-9\\._:-]+\s*\/>/,k={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(we,xe)=>{const Ze=we[0].length+we.index,ot=we.input[Ze];if(ot==="<"||ot===","){xe.ignoreMatch();return}ot===">"&&(v(we,{after:Ze})||xe.ignoreMatch());let lt;const Be=we.input.substring(Ze);if(lt=Be.match(/^\s*=/)){xe.ignoreMatch();return}if((lt=Be.match(/^\s+extends\s+/))&&lt.index===0){xe.ignoreMatch();return}}},N={$pattern:e,keyword:t,literal:i,built_in:h,"variable.language":u},T="[0-9](_?[0-9])*",R=`\\.(${T})`,A="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",O={className:"number",variants:[{begin:`(\\b(${A})((${R})|\\.)?|(${R}))[eE][+-]?(${T})\\b`},{begin:`\\b(${A})\\b((${R})\\b|\\.)?|(${R})\\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},H={className:"subst",begin:"\\$\\{",end:"\\}",keywords:N,contains:[]},L={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,H],subLanguage:"xml"}},M={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,H],subLanguage:"css"}},$={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,H],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[p.BACKSLASH_ESCAPE,H]},Z={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:x+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),p.C_BLOCK_COMMENT_MODE,p.C_LINE_COMMENT_MODE]},K=[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,L,M,$,P,{match:/\$\d+/},O];H.contains=K.concat({begin:/\{/,end:/\}/,keywords:N,contains:["self"].concat(K)});const Q=[].concat(Z,H.contains),q=Q.concat([{begin:/(\s*)\(/,end:/\)/,keywords:N,contains:["self"].concat(Q)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:N,contains:q},Y={variants:[{match:[/class/,/\s+/,x,/\s+/,/extends/,/\s+/,b.concat(x,"(",b.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: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:{_:[...s,...a]}},V={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,x,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(we){return b.concat("(?!",we.join("|"),")")}const de={match:b.concat(/\b/,W([...o,"super","import"].map(we=>`${we}\\s*\\(`)),x,b.lookahead(/\s*\(/)),className:"title.function",relevance:0},oe={begin:b.concat(/\./,b.lookahead(b.concat(x,/(?![0-9A-Za-z$_(])/))),end:x,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},he={match:[/get|set/,/\s+/,x,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},se="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+p.UNDERSCORE_IDENT_RE+")\\s*=>",fe={match:[/const|var|let/,/\s+/,x,/\s*/,/=\s*/,/(async\s*)?/,b.lookahead(se)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:N,exports:{PARAMS_CONTAINS:q,CLASS_REFERENCE:X},illegal:/#(?![$_A-z])/,contains:[p.SHEBANG({label:"shebang",binary:"node",relevance:5}),V,p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,L,M,$,P,Z,{match:/\$\d+/},O,X,{scope:"attr",match:x+b.lookahead(":"),relevance:0},fe,{begin:"("+p.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[Z,p.REGEXP_MODE,{className:"function",begin:se,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:N,contains:q}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:y.begin,end:y.end},{match:S},{begin:k.begin,"on:begin":k.isTrulyOpeningTag,end:k.end}],subLanguage:"xml",contains:[{begin:k.begin,end:k.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+p.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,p.inherit(p.TITLE_MODE,{begin:x,className:"title.function"})]},{match:/\.\.\./,relevance:0},oe,{match:"\\$"+x,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},de,j,Y,he,{match:/\$[(.]/}]}}function f(p){const b=p.regex,v=m(p),x=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"}},k={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:y},contains:[v.exports.CLASS_REFERENCE]},N={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},T=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],R={$pattern:e,keyword:t.concat(T),literal:i,built_in:h.concat(y),"variable.language":u},A={className:"meta",begin:"@"+x},O=($,P,F)=>{const Z=$.contains.findIndex(K=>K.label===P);if(Z===-1)throw new Error("can not find mode to replace");$.contains.splice(Z,1,F)};Object.assign(v.keywords,R),v.exports.PARAMS_CONTAINS.push(A);const H=v.contains.find($=>$.scope==="attr"),L=Object.assign({},H,{match:b.concat(x,b.lookahead(/\s*\?:/))});v.exports.PARAMS_CONTAINS.push([v.exports.CLASS_REFERENCE,H,L]),v.contains=v.contains.concat([A,S,k,L]),O(v,"shebang",p.SHEBANG()),O(v,"use_strict",N);const M=v.contains.find($=>$.label==="func.def");return M.relevance=0,Object.assign(v,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),v}return _g=f,_g}var vg,y2;function aH(){if(y2)return vg;y2=1;function e(t){const i=t.regex,s={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:i.concat(/# */,i.either(u,o),/ *#/)},{begin:i.concat(/# */,m,/ *#/)},{begin:i.concat(/# */,h,/ *#/)},{begin:i.concat(/# */,i.either(u,o),/ +/,i.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+:/},v=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),x=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:[s,a,f,p,b,v,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:[x]}]}}return vg=e,vg}var xg,S2;function oH(){if(S2)return xg;S2=1;function e(t){t.regex;const i=t.COMMENT(/\(;/,/;\)/);i.contains.push("self");const s=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:[s,i,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},u,h,o,t.QUOTE_STRING_MODE,f,p,m]}}return xg=e,xg}var yg,w2;function lH(){if(w2)return yg;w2=1;var e=kU();return e.registerLanguage("xml",CU()),e.registerLanguage("bash",NU()),e.registerLanguage("c",TU()),e.registerLanguage("cpp",AU()),e.registerLanguage("csharp",MU()),e.registerLanguage("css",RU()),e.registerLanguage("markdown",jU()),e.registerLanguage("diff",DU()),e.registerLanguage("ruby",OU()),e.registerLanguage("go",LU()),e.registerLanguage("graphql",BU()),e.registerLanguage("ini",zU()),e.registerLanguage("java",IU()),e.registerLanguage("javascript",PU()),e.registerLanguage("json",UU()),e.registerLanguage("kotlin",HU()),e.registerLanguage("less",FU()),e.registerLanguage("lua",$U()),e.registerLanguage("makefile",VU()),e.registerLanguage("perl",qU()),e.registerLanguage("objectivec",GU()),e.registerLanguage("php",KU()),e.registerLanguage("php-template",WU()),e.registerLanguage("plaintext",YU()),e.registerLanguage("python",XU()),e.registerLanguage("python-repl",ZU()),e.registerLanguage("r",QU()),e.registerLanguage("rust",JU()),e.registerLanguage("scss",eH()),e.registerLanguage("shell",tH()),e.registerLanguage("sql",iH()),e.registerLanguage("swift",nH()),e.registerLanguage("yaml",sH()),e.registerLanguage("typescript",rH()),e.registerLanguage("vbnet",aH()),e.registerLanguage("wasm",oH()),e.HighlightJS=e,e.default=e,yg=e,yg}var cH=lH();const U0=LT(cH);function uH(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 dH({content:e}){const t=E.useMemo(()=>{const s=ft.parse(e,{async:!1,gfm:!0,breaks:!1});return uH(s)},[e]),i=E.useRef(null);return E.useEffect(()=>{const s=i.current;s&&s.querySelectorAll("pre code").forEach(a=>{U0.highlightElement(a)})},[t]),c.jsx("div",{ref:i,className:"md-preview min-w-0 px-6 py-5",dangerouslySetInnerHTML:{__html:t}})}function IN(e){return typeof e>"u"||e===null}function hH(e){return typeof e=="object"&&e!==null}function fH(e){return Array.isArray(e)?e:IN(e)?[]:[e]}function mH(e,t){var i,s,a,o;if(t)for(o=Object.keys(t),i=0,s=o.length;i<s;i+=1)a=o[i],e[a]=t[a];return e}function pH(e,t){var i="",s;for(s=0;s<t;s+=1)i+=e;return i}function gH(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var bH=IN,_H=hH,vH=fH,xH=pH,yH=gH,SH=mH,fi={isNothing:bH,isObject:_H,toArray:vH,repeat:xH,isNegativeZero:yH,extend:SH};function PN(e,t){var i="",s=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+='in "'+e.mark.name+'" '),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(i+=`
121
+
122
+ `+e.mark.snippet),s+" "+i):s}function qc(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=PN(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}qc.prototype=Object.create(Error.prototype);qc.prototype.constructor=qc;qc.prototype.toString=function(t){return this.name+": "+PN(this,t)};var Gi=qc;function Sg(e,t,i,s,a){var o="",u="",h=Math.floor(a/2)-1;return s-t>h&&(o=" ... ",t=s-h+o.length),i-s>h&&(u=" ...",i=s+h-u.length),{str:o+e.slice(t,i).replace(/\t/g,"→")+u,pos:s-t+o.length}}function wg(e,t){return fi.repeat(" ",t-e.length)+e}function wH(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 i=/\r?\n|\r|\0/g,s=[0],a=[],o,u=-1;o=i.exec(e.buffer);)a.push(o.index),s.push(o.index+o[0].length),e.position<=o.index&&u<0&&(u=s.length-2);u<0&&(u=s.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=Sg(e.buffer,s[u-m],a[u-m],e.position-(s[u]-s[u-m]),b),h=fi.repeat(" ",t.indent)+wg((e.line-m+1).toString(),p)+" | "+f.str+`
123
+ `+h;for(f=Sg(e.buffer,s[u],a[u],e.position,b),h+=fi.repeat(" ",t.indent)+wg((e.line+1).toString(),p)+" | "+f.str+`
124
+ `,h+=fi.repeat("-",t.indent+p+3+f.pos)+`^
125
+ `,m=1;m<=t.linesAfter&&!(u+m>=a.length);m++)f=Sg(e.buffer,s[u+m],a[u+m],e.position-(s[u]-s[u+m]),b),h+=fi.repeat(" ",t.indent)+wg((e.line+m+1).toString(),p)+" | "+f.str+`
126
+ `;return h.replace(/\n$/,"")}var EH=wH,kH=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],CH=["scalar","sequence","mapping"];function NH(e){var t={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(s){t[String(s)]=i})}),t}function TH(e,t){if(t=t||{},Object.keys(t).forEach(function(i){if(kH.indexOf(i)===-1)throw new Gi('Unknown option "'+i+'" 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(i){return i},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=NH(t.styleAliases||null),CH.indexOf(this.kind)===-1)throw new Gi('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ji=TH;function E2(e,t){var i=[];return e[t].forEach(function(s){var a=i.length;i.forEach(function(o,u){o.tag===s.tag&&o.kind===s.kind&&o.multi===s.multi&&(a=u)}),i[a]=s}),i}function AH(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,i;function s(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,i=arguments.length;t<i;t+=1)arguments[t].forEach(s);return e}function H0(e){return this.extend(e)}H0.prototype.extend=function(t){var i=[],s=[];if(t instanceof ji)s.push(t);else if(Array.isArray(t))s=s.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(i=i.concat(t.implicit)),t.explicit&&(s=s.concat(t.explicit));else throw new Gi("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(o){if(!(o instanceof ji))throw new Gi("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Gi("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 Gi("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),s.forEach(function(o){if(!(o instanceof ji))throw new Gi("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var a=Object.create(H0.prototype);return a.implicit=(this.implicit||[]).concat(i),a.explicit=(this.explicit||[]).concat(s),a.compiledImplicit=E2(a,"implicit"),a.compiledExplicit=E2(a,"explicit"),a.compiledTypeMap=AH(a.compiledImplicit,a.compiledExplicit),a};var UN=H0,HN=new ji("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),FN=new ji("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),$N=new ji("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),VN=new UN({explicit:[HN,FN,$N]});function MH(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function RH(){return null}function jH(e){return e===null}var qN=new ji("tag:yaml.org,2002:null",{kind:"scalar",resolve:MH,construct:RH,predicate:jH,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function DH(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 OH(e){return e==="true"||e==="True"||e==="TRUE"}function LH(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var GN=new ji("tag:yaml.org,2002:bool",{kind:"scalar",resolve:DH,construct:OH,predicate:LH,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 BH(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function zH(e){return 48<=e&&e<=55}function IH(e){return 48<=e&&e<=57}function PH(e){if(e===null)return!1;var t=e.length,i=0,s=!1,a;if(!t)return!1;if(a=e[i],(a==="-"||a==="+")&&(a=e[++i]),a==="0"){if(i+1===t)return!0;if(a=e[++i],a==="b"){for(i++;i<t;i++)if(a=e[i],a!=="_"){if(a!=="0"&&a!=="1")return!1;s=!0}return s&&a!=="_"}if(a==="x"){for(i++;i<t;i++)if(a=e[i],a!=="_"){if(!BH(e.charCodeAt(i)))return!1;s=!0}return s&&a!=="_"}if(a==="o"){for(i++;i<t;i++)if(a=e[i],a!=="_"){if(!zH(e.charCodeAt(i)))return!1;s=!0}return s&&a!=="_"}}if(a==="_")return!1;for(;i<t;i++)if(a=e[i],a!=="_"){if(!IH(e.charCodeAt(i)))return!1;s=!0}return!(!s||a==="_")}function UH(e){var t=e,i=1,s;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),s=t[0],(s==="-"||s==="+")&&(s==="-"&&(i=-1),t=t.slice(1),s=t[0]),t==="0")return 0;if(s==="0"){if(t[1]==="b")return i*parseInt(t.slice(2),2);if(t[1]==="x")return i*parseInt(t.slice(2),16);if(t[1]==="o")return i*parseInt(t.slice(2),8)}return i*parseInt(t,10)}function HH(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!fi.isNegativeZero(e)}var KN=new ji("tag:yaml.org,2002:int",{kind:"scalar",resolve:PH,construct:UH,predicate:HH,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"]}}),FH=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function $H(e){return!(e===null||!FH.test(e)||e[e.length-1]==="_")}function VH(e){var t,i;return t=e.replace(/_/g,"").toLowerCase(),i=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:i*parseFloat(t,10)}var qH=/^[-+]?[0-9]+e/;function GH(e,t){var i;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(fi.isNegativeZero(e))return"-0.0";return i=e.toString(10),qH.test(i)?i.replace("e",".e"):i}function KH(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||fi.isNegativeZero(e))}var WN=new ji("tag:yaml.org,2002:float",{kind:"scalar",resolve:$H,construct:VH,predicate:KH,represent:GH,defaultStyle:"lowercase"}),YN=VN.extend({implicit:[qN,GN,KN,WN]}),XN=YN,ZN=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),QN=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 WH(e){return e===null?!1:ZN.exec(e)!==null||QN.exec(e)!==null}function YH(e){var t,i,s,a,o,u,h,m=0,f=null,p,b,v;if(t=ZN.exec(e),t===null&&(t=QN.exec(e)),t===null)throw new Error("Date resolve error");if(i=+t[1],s=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(i,s,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)),v=new Date(Date.UTC(i,s,a,o,u,h,m)),f&&v.setTime(v.getTime()-f),v}function XH(e){return e.toISOString()}var JN=new ji("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:WH,construct:YH,instanceOf:Date,represent:XH});function ZH(e){return e==="<<"||e===null}var e3=new ji("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ZH}),Xb=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
127
+ \r`;function QH(e){if(e===null)return!1;var t,i,s=0,a=e.length,o=Xb;for(i=0;i<a;i++)if(t=o.indexOf(e.charAt(i)),!(t>64)){if(t<0)return!1;s+=6}return s%8===0}function JH(e){var t,i,s=e.replace(/[\r\n=]/g,""),a=s.length,o=Xb,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(s.charAt(t));return i=a%4*6,i===0?(h.push(u>>16&255),h.push(u>>8&255),h.push(u&255)):i===18?(h.push(u>>10&255),h.push(u>>2&255)):i===12&&h.push(u>>4&255),new Uint8Array(h)}function eF(e){var t="",i=0,s,a,o=e.length,u=Xb;for(s=0;s<o;s++)s%3===0&&s&&(t+=u[i>>18&63],t+=u[i>>12&63],t+=u[i>>6&63],t+=u[i&63]),i=(i<<8)+e[s];return a=o%3,a===0?(t+=u[i>>18&63],t+=u[i>>12&63],t+=u[i>>6&63],t+=u[i&63]):a===2?(t+=u[i>>10&63],t+=u[i>>4&63],t+=u[i<<2&63],t+=u[64]):a===1&&(t+=u[i>>2&63],t+=u[i<<4&63],t+=u[64],t+=u[64]),t}function tF(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var t3=new ji("tag:yaml.org,2002:binary",{kind:"scalar",resolve:QH,construct:JH,predicate:tF,represent:eF}),iF=Object.prototype.hasOwnProperty,nF=Object.prototype.toString;function sF(e){if(e===null)return!0;var t=[],i,s,a,o,u,h=e;for(i=0,s=h.length;i<s;i+=1){if(a=h[i],u=!1,nF.call(a)!=="[object Object]")return!1;for(o in a)if(iF.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 rF(e){return e!==null?e:[]}var i3=new ji("tag:yaml.org,2002:omap",{kind:"sequence",resolve:sF,construct:rF}),aF=Object.prototype.toString;function oF(e){if(e===null)return!0;var t,i,s,a,o,u=e;for(o=new Array(u.length),t=0,i=u.length;t<i;t+=1){if(s=u[t],aF.call(s)!=="[object Object]"||(a=Object.keys(s),a.length!==1))return!1;o[t]=[a[0],s[a[0]]]}return!0}function lF(e){if(e===null)return[];var t,i,s,a,o,u=e;for(o=new Array(u.length),t=0,i=u.length;t<i;t+=1)s=u[t],a=Object.keys(s),o[t]=[a[0],s[a[0]]];return o}var n3=new ji("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:oF,construct:lF}),cF=Object.prototype.hasOwnProperty;function uF(e){if(e===null)return!0;var t,i=e;for(t in i)if(cF.call(i,t)&&i[t]!==null)return!1;return!0}function dF(e){return e!==null?e:{}}var s3=new ji("tag:yaml.org,2002:set",{kind:"mapping",resolve:uF,construct:dF}),Zb=XN.extend({implicit:[JN,e3],explicit:[t3,i3,n3,s3]}),ta=Object.prototype.hasOwnProperty,Eh=1,r3=2,a3=3,kh=4,Eg=1,hF=2,k2=3,fF=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,mF=/[\x85\u2028\u2029]/,pF=/[,\[\]\{\}]/,o3=/^(?:!|!!|![a-z\-]+!)$/i,l3=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function C2(e){return Object.prototype.toString.call(e)}function ws(e){return e===10||e===13}function Fa(e){return e===9||e===32}function ln(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 gF(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function bF(e){return e===120?2:e===117?4:e===85?8:0}function _F(e){return 48<=e&&e<=57?e-48:-1}function N2(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
128
+ `: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 vF(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function c3(e,t,i){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[t]=i}var u3=new Array(256),d3=new Array(256);for(var Fo=0;Fo<256;Fo++)u3[Fo]=N2(Fo)?1:0,d3[Fo]=N2(Fo);function xF(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Zb,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 h3(e,t){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=EH(i),new Gi(t,i)}function De(e,t){throw h3(e,t)}function Ch(e,t){e.onWarning&&e.onWarning.call(null,h3(e,t))}var T2={YAML:function(t,i,s){var a,o,u;t.version!==null&&De(t,"duplication of %YAML directive"),s.length!==1&&De(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(s[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=s[0],t.checkLineBreaks=u<2,u!==1&&u!==2&&Ch(t,"unsupported YAML version of the document")},TAG:function(t,i,s){var a,o;s.length!==2&&De(t,"TAG directive accepts exactly two arguments"),a=s[0],o=s[1],o3.test(a)||De(t,"ill-formed tag handle (first argument) of the TAG directive"),ta.call(t.tagMap,a)&&De(t,'there is a previously declared suffix for "'+a+'" tag handle'),l3.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 Qr(e,t,i,s){var a,o,u,h;if(t<i){if(h=e.input.slice(t,i),s)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 fF.test(h)&&De(e,"the stream contains non-printable characters");e.result+=h}}function A2(e,t,i,s){var a,o,u,h;for(fi.isObject(i)||De(e,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(i),u=0,h=a.length;u<h;u+=1)o=a[u],ta.call(t,o)||(c3(t,o,i[o]),s[o]=!0)}function Zo(e,t,i,s,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"&&C2(a[f])==="[object Object]"&&(a[f]="[object Object]");if(typeof a=="object"&&C2(a)==="[object Object]"&&(a="[object Object]"),a=String(a),t===null&&(t={}),s==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(f=0,p=o.length;f<p;f+=1)A2(e,t,o[f],i);else A2(e,t,o,i);else!e.json&&!ta.call(i,a)&&ta.call(t,a)&&(e.line=u||e.line,e.lineStart=h||e.lineStart,e.position=m||e.position,De(e,"duplicated mapping key")),c3(t,a,o),delete i[a];return t}function Qb(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 oi(e,t,i){for(var s=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(ws(a))for(Qb(e),a=e.input.charCodeAt(e.position),s++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return i!==-1&&s!==0&&e.lineIndent<i&&Ch(e,"deficient indentation"),s}function qh(e){var t=e.position,i;return i=e.input.charCodeAt(t),!!((i===45||i===46)&&i===e.input.charCodeAt(t+1)&&i===e.input.charCodeAt(t+2)&&(t+=3,i=e.input.charCodeAt(t),i===0||ln(i)))}function Jb(e,t){t===1?e.result+=" ":t>1&&(e.result+=fi.repeat(`
129
+ `,t-1))}function yF(e,t,i){var s,a,o,u,h,m,f,p,b=e.kind,v=e.result,x;if(x=e.input.charCodeAt(e.position),ln(x)||Xo(x)||x===35||x===38||x===42||x===33||x===124||x===62||x===39||x===34||x===37||x===64||x===96||(x===63||x===45)&&(a=e.input.charCodeAt(e.position+1),ln(a)||i&&Xo(a)))return!1;for(e.kind="scalar",e.result="",o=u=e.position,h=!1;x!==0;){if(x===58){if(a=e.input.charCodeAt(e.position+1),ln(a)||i&&Xo(a))break}else if(x===35){if(s=e.input.charCodeAt(e.position-1),ln(s))break}else{if(e.position===e.lineStart&&qh(e)||i&&Xo(x))break;if(ws(x))if(m=e.line,f=e.lineStart,p=e.lineIndent,oi(e,!1,-1),e.lineIndent>=t){h=!0,x=e.input.charCodeAt(e.position);continue}else{e.position=u,e.line=m,e.lineStart=f,e.lineIndent=p;break}}h&&(Qr(e,o,u,!1),Jb(e,e.line-m),o=u=e.position,h=!1),Fa(x)||(u=e.position+1),x=e.input.charCodeAt(++e.position)}return Qr(e,o,u,!1),e.result?!0:(e.kind=b,e.result=v,!1)}function SF(e,t){var i,s,a;if(i=e.input.charCodeAt(e.position),i!==39)return!1;for(e.kind="scalar",e.result="",e.position++,s=a=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39)if(Qr(e,s,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)s=e.position,e.position++,a=e.position;else return!0;else ws(i)?(Qr(e,s,a,!0),Jb(e,oi(e,!1,t)),s=a=e.position):e.position===e.lineStart&&qh(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 wF(e,t){var i,s,a,o,u,h;if(h=e.input.charCodeAt(e.position),h!==34)return!1;for(e.kind="scalar",e.result="",e.position++,i=s=e.position;(h=e.input.charCodeAt(e.position))!==0;){if(h===34)return Qr(e,i,e.position,!0),e.position++,!0;if(h===92){if(Qr(e,i,e.position,!0),h=e.input.charCodeAt(++e.position),ws(h))oi(e,!1,t);else if(h<256&&u3[h])e.result+=d3[h],e.position++;else if((u=bF(h))>0){for(a=u,o=0;a>0;a--)h=e.input.charCodeAt(++e.position),(u=gF(h))>=0?o=(o<<4)+u:De(e,"expected hexadecimal character");e.result+=vF(o),e.position++}else De(e,"unknown escape sequence");i=s=e.position}else ws(h)?(Qr(e,i,s,!0),Jb(e,oi(e,!1,t)),i=s=e.position):e.position===e.lineStart&&qh(e)?De(e,"unexpected end of the document within a double quoted scalar"):(e.position++,s=e.position)}De(e,"unexpected end of the stream within a double quoted scalar")}function EF(e,t){var i=!0,s,a,o,u=e.tag,h,m=e.anchor,f,p,b,v,x,y=Object.create(null),S,k,N,T;if(T=e.input.charCodeAt(e.position),T===91)p=93,x=!1,h=[];else if(T===123)p=125,x=!0,h={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),T=e.input.charCodeAt(++e.position);T!==0;){if(oi(e,!0,t),T=e.input.charCodeAt(e.position),T===p)return e.position++,e.tag=u,e.anchor=m,e.kind=x?"mapping":"sequence",e.result=h,!0;i?T===44&&De(e,"expected the node content, but found ','"):De(e,"missed comma between flow collection entries"),k=S=N=null,b=v=!1,T===63&&(f=e.input.charCodeAt(e.position+1),ln(f)&&(b=v=!0,e.position++,oi(e,!0,t))),s=e.line,a=e.lineStart,o=e.position,il(e,t,Eh,!1,!0),k=e.tag,S=e.result,oi(e,!0,t),T=e.input.charCodeAt(e.position),(v||e.line===s)&&T===58&&(b=!0,T=e.input.charCodeAt(++e.position),oi(e,!0,t),il(e,t,Eh,!1,!0),N=e.result),x?Zo(e,h,y,k,S,N,s,a,o):b?h.push(Zo(e,null,y,k,S,N,s,a,o)):h.push(S),oi(e,!0,t),T=e.input.charCodeAt(e.position),T===44?(i=!0,T=e.input.charCodeAt(++e.position)):i=!1}De(e,"unexpected end of the stream within a flow collection")}function kF(e,t){var i,s,a=Eg,o=!1,u=!1,h=t,m=0,f=!1,p,b;if(b=e.input.charCodeAt(e.position),b===124)s=!1;else if(b===62)s=!0;else return!1;for(e.kind="scalar",e.result="";b!==0;)if(b=e.input.charCodeAt(++e.position),b===43||b===45)Eg===a?a=b===43?k2:hF:De(e,"repeat of a chomping mode identifier");else if((p=_F(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(!ws(b)&&b!==0)}for(;b!==0;){for(Qb(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),ws(b)){m++;continue}if(e.lineIndent<h){a===k2?e.result+=fi.repeat(`
130
+ `,o?1+m:m):a===Eg&&o&&(e.result+=`
131
+ `);break}for(s?Fa(b)?(f=!0,e.result+=fi.repeat(`
132
+ `,o?1+m:m)):f?(f=!1,e.result+=fi.repeat(`
133
+ `,m+1)):m===0?o&&(e.result+=" "):e.result+=fi.repeat(`
134
+ `,m):e.result+=fi.repeat(`
135
+ `,o?1+m:m),o=!0,u=!0,m=0,i=e.position;!ws(b)&&b!==0;)b=e.input.charCodeAt(++e.position);Qr(e,i,e.position,!1)}return!0}function M2(e,t){var i,s=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),!ln(u))));){if(h=!0,e.position++,oi(e,!0,-1)&&e.lineIndent<=t){o.push(null),m=e.input.charCodeAt(e.position);continue}if(i=e.line,il(e,t,a3,!1,!0),o.push(e.result),oi(e,!0,-1),m=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&m!==0)De(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return h?(e.tag=s,e.anchor=a,e.kind="sequence",e.result=o,!0):!1}function CF(e,t,i){var s,a,o,u,h,m,f=e.tag,p=e.anchor,b={},v=Object.create(null),x=null,y=null,S=null,k=!1,N=!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(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,De(e,"tab characters must not be used in indentation")),s=e.input.charCodeAt(e.position+1),o=e.line,(T===63||T===58)&&ln(s))T===63?(k&&(Zo(e,b,v,x,y,null,u,h,m),x=y=S=null),N=!0,k=!0,a=!0):k?(k=!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=s;else{if(u=e.line,h=e.lineStart,m=e.position,!il(e,i,r3,!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),ln(T)||De(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(Zo(e,b,v,x,y,null,u,h,m),x=y=S=null),N=!0,k=!1,a=!1,x=e.tag,y=e.result;else if(N)De(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=p,!0}else if(N)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)&&(k&&(u=e.line,h=e.lineStart,m=e.position),il(e,t,kh,!0,a)&&(k?y=e.result:S=e.result),k||(Zo(e,b,v,x,y,S,u,h,m),x=y=S=null),oi(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 k&&Zo(e,b,v,x,y,null,u,h,m),N&&(e.tag=f,e.anchor=p,e.kind="mapping",e.result=b),N}function NF(e){var t,i=!1,s=!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?(i=!0,u=e.input.charCodeAt(++e.position)):u===33?(s=!0,a="!!",u=e.input.charCodeAt(++e.position)):a="!",t=e.position,i){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&&!ln(u);)u===33&&(s?De(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(t-1,e.position+1),o3.test(a)||De(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),u=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),pF.test(o)&&De(e,"tag suffix cannot contain flow indicator characters")}o&&!l3.test(o)&&De(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{De(e,"tag name is malformed: "+o)}return i?e.tag=o:ta.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 TF(e){var t,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&De(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!ln(i)&&!Xo(i);)i=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 AF(e){var t,i,s;if(s=e.input.charCodeAt(e.position),s!==42)return!1;for(s=e.input.charCodeAt(++e.position),t=e.position;s!==0&&!ln(s)&&!Xo(s);)s=e.input.charCodeAt(++e.position);return e.position===t&&De(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),ta.call(e.anchorMap,i)||De(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],oi(e,!0,-1),!0}function il(e,t,i,s,a){var o,u,h,m=1,f=!1,p=!1,b,v,x,y,S,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=u=h=kh===i||a3===i,s&&oi(e,!0,-1)&&(f=!0,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)),m===1)for(;NF(e)||TF(e);)oi(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||kh===i)&&(Eh===i||r3===i?S=t:S=t+1,k=e.position-e.lineStart,m===1?h&&(M2(e,k)||CF(e,k,S))||EF(e,S)?p=!0:(u&&kF(e,S)||SF(e,S)||wF(e,S)?p=!0:AF(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&De(e,"alias node should not have any properties")):yF(e,S,Eh===i)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):m===0&&(p=h&&M2(e,k))),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,v=e.implicitTypes.length;b<v;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(ta.call(e.typeMap[e.kind||"fallback"],e.tag))y=e.typeMap[e.kind||"fallback"][e.tag];else for(y=null,x=e.typeMap.multi[e.kind||"fallback"],b=0,v=x.length;b<v;b+=1)if(e.tag.slice(0,x[b].tag.length)===x[b].tag){y=x[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 MF(e){var t=e.position,i,s,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&&(oi(e,!0,-1),u=e.input.charCodeAt(e.position),!(e.lineIndent>0||u!==37));){for(o=!0,u=e.input.charCodeAt(++e.position),i=e.position;u!==0&&!ln(u);)u=e.input.charCodeAt(++e.position);for(s=e.input.slice(i,e.position),a=[],s.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&&!ws(u));break}if(ws(u))break;for(i=e.position;u!==0&&!ln(u);)u=e.input.charCodeAt(++e.position);a.push(e.input.slice(i,e.position))}u!==0&&Qb(e),ta.call(T2,s)?T2[s](e,s,a):Ch(e,'unknown document directive "'+s+'"')}if(oi(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,oi(e,!0,-1)):o&&De(e,"directives end mark is expected"),il(e,e.lineIndent-1,kh,!1,!0),oi(e,!0,-1),e.checkLineBreaks&&mF.test(e.input.slice(t,e.position))&&Ch(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&qh(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,oi(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 f3(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
136
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new xF(e,t),s=e.indexOf("\0");for(s!==-1&&(i.position=s,De(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)MF(i);return i.documents}function RF(e,t,i){t!==null&&typeof t=="object"&&typeof i>"u"&&(i=t,t=null);var s=f3(e,i);if(typeof t!="function")return s;for(var a=0,o=s.length;a<o;a+=1)t(s[a])}function jF(e,t){var i=f3(e,t);if(i.length!==0){if(i.length===1)return i[0];throw new Gi("expected a single document in the stream, but found more")}}var DF=RF,OF=jF,m3={loadAll:DF,load:OF},p3=Object.prototype.toString,g3=Object.prototype.hasOwnProperty,e_=65279,LF=9,Gc=10,BF=13,zF=32,IF=33,PF=34,F0=35,UF=37,HF=38,FF=39,$F=42,b3=44,VF=45,Nh=58,qF=61,GF=62,KF=63,WF=64,_3=91,v3=93,YF=96,x3=123,XF=124,y3=125,Fi={};Fi[0]="\\0";Fi[7]="\\a";Fi[8]="\\b";Fi[9]="\\t";Fi[10]="\\n";Fi[11]="\\v";Fi[12]="\\f";Fi[13]="\\r";Fi[27]="\\e";Fi[34]='\\"';Fi[92]="\\\\";Fi[133]="\\N";Fi[160]="\\_";Fi[8232]="\\L";Fi[8233]="\\P";var ZF=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],QF=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function JF(e,t){var i,s,a,o,u,h,m;if(t===null)return{};for(i={},s=Object.keys(t),a=0,o=s.length;a<o;a+=1)u=s[a],h=String(t[u]),u.slice(0,2)==="!!"&&(u="tag:yaml.org,2002:"+u.slice(2)),m=e.compiledTypeMap.fallback[u],m&&g3.call(m.styleAliases,h)&&(h=m.styleAliases[h]),i[u]=h;return i}function e$(e){var t,i,s;if(t=e.toString(16).toUpperCase(),e<=255)i="x",s=2;else if(e<=65535)i="u",s=4;else if(e<=4294967295)i="U",s=8;else throw new Gi("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+i+fi.repeat("0",s-t.length)+t}var t$=1,Kc=2;function i$(e){this.schema=e.schema||Zb,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=fi.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=JF(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==='"'?Kc:t$,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 R2(e,t){for(var i=fi.repeat(" ",t),s=0,a=-1,o="",u,h=e.length;s<h;)a=e.indexOf(`
137
+ `,s),a===-1?(u=e.slice(s),s=h):(u=e.slice(s,a+1),s=a+1),u.length&&u!==`
138
+ `&&(o+=i),o+=u;return o}function $0(e,t){return`
139
+ `+fi.repeat(" ",e.indent*t)}function n$(e,t){var i,s,a;for(i=0,s=e.implicitTypes.length;i<s;i+=1)if(a=e.implicitTypes[i],a.resolve(t))return!0;return!1}function Th(e){return e===zF||e===LF}function Wc(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==e_||65536<=e&&e<=1114111}function j2(e){return Wc(e)&&e!==e_&&e!==BF&&e!==Gc}function D2(e,t,i){var s=j2(e),a=s&&!Th(e);return(i?s:s&&e!==b3&&e!==_3&&e!==v3&&e!==x3&&e!==y3)&&e!==F0&&!(t===Nh&&!a)||j2(t)&&!Th(t)&&e===F0||t===Nh&&a}function s$(e){return Wc(e)&&e!==e_&&!Th(e)&&e!==VF&&e!==KF&&e!==Nh&&e!==b3&&e!==_3&&e!==v3&&e!==x3&&e!==y3&&e!==F0&&e!==HF&&e!==$F&&e!==IF&&e!==XF&&e!==qF&&e!==GF&&e!==FF&&e!==PF&&e!==UF&&e!==WF&&e!==YF}function r$(e){return!Th(e)&&e!==Nh}function Nc(e,t){var i=e.charCodeAt(t),s;return i>=55296&&i<=56319&&t+1<e.length&&(s=e.charCodeAt(t+1),s>=56320&&s<=57343)?(i-55296)*1024+s-56320+65536:i}function S3(e){var t=/^\n* /;return t.test(e)}var w3=1,V0=2,E3=3,k3=4,qo=5;function a$(e,t,i,s,a,o,u,h){var m,f=0,p=null,b=!1,v=!1,x=s!==-1,y=-1,S=s$(Nc(e,0))&&r$(Nc(e,e.length-1));if(t||u)for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=Nc(e,m),!Wc(f))return qo;S=S&&D2(f,p,h),p=f}else{for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=Nc(e,m),f===Gc)b=!0,x&&(v=v||m-y-1>s&&e[y+1]!==" ",y=m);else if(!Wc(f))return qo;S=S&&D2(f,p,h),p=f}v=v||x&&m-y-1>s&&e[y+1]!==" "}return!b&&!v?S&&!u&&!a(e)?w3:o===Kc?qo:V0:i>9&&S3(e)?qo:u?o===Kc?qo:V0:v?k3:E3}function o$(e,t,i,s,a){e.dump=(function(){if(t.length===0)return e.quotingType===Kc?'""':"''";if(!e.noCompatMode&&(ZF.indexOf(t)!==-1||QF.test(t)))return e.quotingType===Kc?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,i),u=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),h=s||e.flowLevel>-1&&i>=e.flowLevel;function m(f){return n$(e,f)}switch(a$(t,h,e.indent,u,m,e.quotingType,e.forceQuotes&&!s,a)){case w3:return t;case V0:return"'"+t.replace(/'/g,"''")+"'";case E3:return"|"+O2(t,e.indent)+L2(R2(t,o));case k3:return">"+O2(t,e.indent)+L2(R2(l$(t,u),o));case qo:return'"'+c$(t)+'"';default:throw new Gi("impossible error: invalid scalar style")}})()}function O2(e,t){var i=S3(e)?String(t):"",s=e[e.length-1]===`
140
+ `,a=s&&(e[e.length-2]===`
141
+ `||e===`
142
+ `),o=a?"+":s?"":"-";return i+o+`
143
+ `}function L2(e){return e[e.length-1]===`
144
+ `?e.slice(0,-1):e}function l$(e,t){for(var i=/(\n+)([^\n]*)/g,s=(function(){var f=e.indexOf(`
145
+ `);return f=f!==-1?f:e.length,i.lastIndex=f,B2(e.slice(0,f),t)})(),a=e[0]===`
146
+ `||e[0]===" ",o,u;u=i.exec(e);){var h=u[1],m=u[2];o=m[0]===" ",s+=h+(!a&&!o&&m!==""?`
147
+ `:"")+B2(m,t),a=o}return s}function B2(e,t){if(e===""||e[0]===" ")return e;for(var i=/ [^ ]/g,s,a=0,o,u=0,h=0,m="";s=i.exec(e);)h=s.index,h-a>t&&(o=u>a?u:h,m+=`
148
+ `+e.slice(a,o),a=o+1),u=h;return m+=`
149
+ `,e.length-a>t&&u>a?m+=e.slice(a,u)+`
150
+ `+e.slice(u+1):m+=e.slice(a),m.slice(1)}function c$(e){for(var t="",i=0,s,a=0;a<e.length;i>=65536?a+=2:a++)i=Nc(e,a),s=Fi[i],!s&&Wc(i)?(t+=e[a],i>=65536&&(t+=e[a+1])):t+=s||e$(i);return t}function u$(e,t,i){var s="",a=e.tag,o,u,h;for(o=0,u=i.length;o<u;o+=1)h=i[o],e.replacer&&(h=e.replacer.call(i,String(o),h)),(ar(e,t,h,!1,!1)||typeof h>"u"&&ar(e,t,null,!1,!1))&&(s!==""&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=a,e.dump="["+s+"]"}function z2(e,t,i,s){var a="",o=e.tag,u,h,m;for(u=0,h=i.length;u<h;u+=1)m=i[u],e.replacer&&(m=e.replacer.call(i,String(u),m)),(ar(e,t+1,m,!0,!0,!1,!0)||typeof m>"u"&&ar(e,t+1,null,!0,!0,!1,!0))&&((!s||a!=="")&&(a+=$0(e,t)),e.dump&&Gc===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=o,e.dump=a||"[]"}function d$(e,t,i){var s="",a=e.tag,o=Object.keys(i),u,h,m,f,p;for(u=0,h=o.length;u<h;u+=1)p="",s!==""&&(p+=", "),e.condenseFlow&&(p+='"'),m=o[u],f=i[m],e.replacer&&(f=e.replacer.call(i,m,f)),ar(e,t,m,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ar(e,t,f,!1,!1)&&(p+=e.dump,s+=p));e.tag=a,e.dump="{"+s+"}"}function h$(e,t,i,s){var a="",o=e.tag,u=Object.keys(i),h,m,f,p,b,v;if(e.sortKeys===!0)u.sort();else if(typeof e.sortKeys=="function")u.sort(e.sortKeys);else if(e.sortKeys)throw new Gi("sortKeys must be a boolean or a function");for(h=0,m=u.length;h<m;h+=1)v="",(!s||a!=="")&&(v+=$0(e,t)),f=u[h],p=i[f],e.replacer&&(p=e.replacer.call(i,f,p)),ar(e,t+1,f,!0,!0,!0)&&(b=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,b&&(e.dump&&Gc===e.dump.charCodeAt(0)?v+="?":v+="? "),v+=e.dump,b&&(v+=$0(e,t)),ar(e,t+1,p,!0,b)&&(e.dump&&Gc===e.dump.charCodeAt(0)?v+=":":v+=": ",v+=e.dump,a+=v));e.tag=o,e.dump=a||"{}"}function I2(e,t,i){var s,a,o,u,h,m;for(a=i?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(i?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,p3.call(h.represent)==="[object Function]")s=h.represent(t,m);else if(g3.call(h.represent,m))s=h.represent[m](t,m);else throw new Gi("!<"+h.tag+'> tag resolver accepts not "'+m+'" style');e.dump=s}return!0}return!1}function ar(e,t,i,s,a,o,u){e.tag=null,e.dump=i,I2(e,i,!1)||I2(e,i,!0);var h=p3.call(e.dump),m=s,f;s&&(s=e.flowLevel<0||e.flowLevel>t);var p=h==="[object Object]"||h==="[object Array]",b,v;if(p&&(b=e.duplicates.indexOf(i),v=b!==-1),(e.tag!==null&&e.tag!=="?"||v||e.indent!==2&&t>0)&&(a=!1),v&&e.usedDuplicates[b])e.dump="*ref_"+b;else{if(p&&v&&!e.usedDuplicates[b]&&(e.usedDuplicates[b]=!0),h==="[object Object]")s&&Object.keys(e.dump).length!==0?(h$(e,t,e.dump,a),v&&(e.dump="&ref_"+b+e.dump)):(d$(e,t,e.dump),v&&(e.dump="&ref_"+b+" "+e.dump));else if(h==="[object Array]")s&&e.dump.length!==0?(e.noArrayIndent&&!u&&t>0?z2(e,t-1,e.dump,a):z2(e,t,e.dump,a),v&&(e.dump="&ref_"+b+e.dump)):(u$(e,t,e.dump),v&&(e.dump="&ref_"+b+" "+e.dump));else if(h==="[object String]")e.tag!=="?"&&o$(e,e.dump,t,o,m);else{if(h==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Gi("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 f$(e,t){var i=[],s=[],a,o;for(q0(e,i,s),a=0,o=s.length;a<o;a+=1)t.duplicates.push(i[s[a]]);t.usedDuplicates=new Array(o)}function q0(e,t,i){var s,a,o;if(e!==null&&typeof e=="object")if(a=t.indexOf(e),a!==-1)i.indexOf(a)===-1&&i.push(a);else if(t.push(e),Array.isArray(e))for(a=0,o=e.length;a<o;a+=1)q0(e[a],t,i);else for(s=Object.keys(e),a=0,o=s.length;a<o;a+=1)q0(e[s[a]],t,i)}function m$(e,t){t=t||{};var i=new i$(t);i.noRefs||f$(e,i);var s=e;return i.replacer&&(s=i.replacer.call({"":s},"",s)),ar(i,0,s,!0,!0)?i.dump+`
151
+ `:""}var p$=m$,g$={dump:p$};function t_(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 b$=ji,_$=UN,v$=VN,x$=YN,y$=XN,S$=Zb,w$=m3.load,E$=m3.loadAll,k$=g$.dump,C$=Gi,N$={binary:t3,float:WN,map:$N,null:qN,pairs:n3,set:s3,timestamp:JN,bool:GN,int:KN,merge:e3,omap:i3,seq:FN,str:HN},T$=t_("safeLoad","load"),A$=t_("safeLoadAll","loadAll"),M$=t_("safeDump","dump"),R$={Type:b$,Schema:_$,FAILSAFE_SCHEMA:v$,JSON_SCHEMA:x$,CORE_SCHEMA:y$,DEFAULT_SCHEMA:S$,load:w$,loadAll:E$,dump:k$,YAMLException:C$,types:N$,safeLoad:T$,safeLoadAll:A$,safeDump:M$};function C3(e){return e!==null&&typeof e=="object"}function N3(e){return typeof e=="string"?"text-rose-700":typeof e=="number"?"text-emerald-700":typeof e=="boolean"?"text-blue-700":e==null?"text-zinc-400 italic":"text-zinc-800"}function T3(e){return e==null?"null":typeof e=="string"?e===""?'""':e:String(e)}function A3({label:e,value:t,depth:i,defaultOpen:s}){const[a,o]=E.useState(s),u={paddingLeft:`${i*1.1}rem`};if(!C3(t))return c.jsxs("div",{className:"flex items-baseline gap-2 py-[1px]",style:u,children:[c.jsxs("span",{className:"text-zinc-500",children:[e,":"]}),c.jsx("span",{className:me("whitespace-pre-wrap break-words",N3(t)),children:T3(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 c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>o(f=>!f),className:"flex w-full items-center gap-1 py-[1px] text-left hover:bg-zinc-100",style:u,children:[a?c.jsx(qn,{className:"size-3.5 shrink-0 text-zinc-400"}):c.jsx(ia,{className:"size-3.5 shrink-0 text-zinc-400"}),c.jsx("span",{className:"font-medium text-zinc-700",children:e}),c.jsx("span",{className:"text-zinc-400",children:m})]}),a?h.map(([f,p])=>c.jsx(A3,{label:f,value:p,depth:i+1,defaultOpen:i<1},f)):null]})}function j$({content:e}){const t=E.useMemo(()=>{try{const s=R$.loadAll(e);return{value:s.length<=1?s[0]:s,error:null}}catch(s){return{value:null,error:s instanceof Error?s.message:String(s)}}},[e]);if(t.error)return c.jsx("div",{className:"p-4",children:c.jsxs(ht,{variant:"destructive",children:["Could not parse YAML: ",t.error]})});if(!C3(t.value))return c.jsx("div",{className:"p-4 font-mono text-[12px]",children:c.jsx("span",{className:N3(t.value),children:T3(t.value)})});const i=Array.isArray(t.value)?t.value.map((s,a)=>[String(a),s]):Object.entries(t.value);return c.jsx("div",{className:"min-w-max px-4 py-3 font-mono text-[12px] leading-[1.6]",children:i.map(([s,a])=>c.jsx(A3,{label:s,value:a,depth:0,defaultOpen:!0},s))})}const D$=E.lazy(()=>EU(()=>import("./code-editor-DZKblTe9.js"),[]).then(e=>({default:e.CodeEditor})));function O$(e){const t=e.split("/").pop()?.toLowerCase().split(".").pop()??"";return t==="md"||t==="mdx"||t==="markdown"?"markdown":t==="yml"||t==="yaml"?"yaml":null}function L$(e){const t=e.split("/").pop()?.toLowerCase()??"",i=t.includes(".")?t.split(".").pop()??"":"",s={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 s[i]?s[i]:t==="dockerfile"?"dockerfile":null}function B$(e,t){const i=e.endsWith(`
152
+ `)?e.slice(0,-1):e;return!t||!U0.getLanguage(t)?i.split(`
153
+ `).map(P2):i.split(`
154
+ `).map(s=>{if(!s)return"";try{return U0.highlight(s,{language:t,ignoreIllegals:!0}).value}catch{return P2(s)}})}function P2(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function z$({content:e,path:t}){const i=E.useMemo(()=>L$(t),[t]),s=E.useMemo(()=>B$(e,i),[e,i]),a=`${Math.max(2,String(s.length).length)}ch`;return c.jsx("div",{className:"min-w-max font-mono text-[12px] leading-[1.5]",children:s.map((o,u)=>c.jsxs("div",{className:"flex",children:[c.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}),c.jsx("span",{className:"hljs whitespace-pre px-3 text-zinc-800 dark:text-zinc-100",dangerouslySetInnerHTML:{__html:o||" "}})]},u))})}function I$({path:e,isModified:t,onViewDiff:i,onFileSaved:s,onSendToAi:a}){const[o,u]=E.useState(null),[h,m]=E.useState(""),[f,p]=E.useState(!1),[b,v]=E.useState(null),[x,y]=E.useState(!1),[S,k]=E.useState(!1),{success:N,error:T}=Oi(),R=E.useMemo(()=>O$(e),[e]),[A,O]=E.useState("preview"),H=!!(o&&!o.binary&&!o.truncated),L=o?h!==o.content:!1;E.useEffect(()=>{O(R?"preview":"source"),p(!1)},[R]),E.useEffect(()=>{if(!e){u(null);return}let P=!0;return y(!0),v(null),p(!1),OM(e).then(F=>{P&&(u(F),m(F.content),y(!1))}).catch(F=>{P&&(v(F instanceof Error?F.message:String(F)),y(!1))}),()=>{P=!1}},[e]);async function M(){if(!(!e||!o||!L||S)){k(!0);try{await LM(e,h);const P={...o,content:h,size:new TextEncoder().encode(h).length};u(P),p(!1),N(`Saved ${e}.`),s?.(e)}catch(P){T(P instanceof Error?P.message:String(P))}finally{k(!1)}}}function $(){m(o?.content??""),p(!1)}return e?c.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-card",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:e}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[c.jsx("span",{children:"Read-only view of tracked file."}),o?.truncated?c.jsx("span",{className:"text-amber-700",children:"Truncated — file exceeds 1MB."}):null,o?.binary?c.jsx("span",{className:"text-amber-700",children:"Binary file."}):null]})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[R&&!o?.binary?c.jsxs("div",{className:"flex items-center rounded-md border border-border p-0.5",children:[c.jsxs("button",{type:"button",onClick:()=>O("preview"),"aria-pressed":A==="preview",className:me("flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",A==="preview"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:[c.jsx(Y0,{className:"size-3.5"}),"Preview"]}),c.jsxs("button",{type:"button",onClick:()=>O("source"),"aria-pressed":A==="source",className:me("flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",A==="source"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:[c.jsx(eE,{className:"size-3.5"}),"Source"]})]}):null,t?c.jsx(ue,{onClick:i,size:"sm",type:"button",variant:"outline",children:"View diff"}):null,a?c.jsx(ue,{"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:c.jsx(sr,{className:"size-4"})}):null,f?c.jsxs(c.Fragment,{children:[c.jsxs(ue,{disabled:!L||S,onClick:()=>{M()},size:"sm",type:"button",children:[c.jsx(fE,{}),"Apply"]}),c.jsxs(ue,{disabled:S,onClick:$,size:"sm",type:"button",variant:"outline",children:[c.jsx(kn,{}),"Cancel"]})]}):H?c.jsxs(ue,{onClick:()=>{O("source"),p(!0)},size:"sm",type:"button",variant:"outline",children:[c.jsx(Lc,{}),"Edit"]}):null]})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto bg-zinc-50 dark:bg-zinc-950",children:b?c.jsx("div",{className:"p-4",children:c.jsx(ht,{variant:"destructive",children:b})}):x?c.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading…"}):o?.binary?c.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Cannot display binary content."}):o?f?c.jsx(E.Suspense,{fallback:c.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading editor…"}),children:c.jsx(D$,{path:e,value:h,onChange:m})}):R&&A==="preview"?R==="markdown"?c.jsx(dH,{content:o.content}):c.jsx(j$,{content:o.content}):c.jsx(z$,{content:o.content,path:e}):null})]}):c.jsx("div",{className:"p-4",children:c.jsx(ht,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a file to view its contents."})})}function P$({activeHunkIndex:e,filePaths:t,hunkCount:i,pendingNextFilePath:s,selectedFile:a}){if(i>0&&e<i-1)return{kind:"hunk",activeHunkIndex:e+1};const o=t.indexOf(a),u=t[o+1];return u?s===u?{kind:"file",filePath:u}:{kind:"confirm-next-file",filePath:u}:{kind:"none"}}function U2(e){const t={name:"",fullPath:"",children:new Map};for(const i of e){const s=i.name.split("/");let a=t;s.forEach((o,u)=>{let h=a.children.get(o);h||(h={name:o,fullPath:s.slice(0,u+1).join("/"),children:new Map},a.children.set(o,h)),a=h}),a.branch=i}return t}function H2({label:e,tree:t,onSelect:i,defaultOpen:s,forceOpen:a}){const[o,u]=E.useState(s??!1),h=a||o,m=t.children.size===0;return c.jsxs("div",{className:"mb-1",children:[c.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?c.jsx(qn,{size:12}):c.jsx(ia,{size:12}),e,m?null:c.jsxs("span",{className:"ml-1 text-[10px] font-normal",children:["(",t.children.size,")"]})]}),h&&!m?c.jsx("ul",{children:Array.from(t.children.values()).map(f=>c.jsx(M3,{node:f,depth:1,onSelect:i,forceOpen:a},f.fullPath))}):null]})}function M3({node:e,depth:t,onSelect:i,forceOpen:s}){const[a,o]=E.useState(!0),u=s||a,h=e.children.size>0,m=e.branch,f={paddingLeft:`${t*10}px`};return!h&&m?c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>i(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:[c.jsx(as,{size:11,className:"shrink-0 opacity-70"}),c.jsx("span",{className:"truncate",children:e.name}),m.current?c.jsx("span",{className:"text-[10px]",children:"●"}):null]})}):c.jsxs("li",{children:[c.jsxs("button",{type:"button",onClick:()=>{m?i(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?c.jsx(qn,{size:11}):c.jsx(ia,{size:11}):c.jsx("span",{className:"inline-block w-[11px]"}),c.jsx("span",{className:"truncate",children:e.name})]}),u&&h?c.jsx("ul",{children:Array.from(e.children.values()).map(p=>c.jsx(M3,{node:p,depth:t+1,onSelect:i,forceOpen:s},p.fullPath))}):null]})}function U$({selectedCommit:e,selectedFile:t,diff:i,diffLoading:s,diffError:a}){return c.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col bg-card border-b border-border",children:[c.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:t??(e?e.subject:"Commit")}),e?c.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[c.jsx("span",{className:"font-mono",children:e.hash.slice(0,12)}),c.jsxs("span",{children:[e.author," <",e.email,">"]}),c.jsx("span",{children:new Date(e.timestamp*1e3).toLocaleString()})]}):null]})}),c.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:a?c.jsx("div",{className:"p-4",children:c.jsx(ht,{variant:"destructive",children:a})}):e?s?c.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading diff…"}):i?c.jsx(BN,{activeHunkIndex:0,diff:i}):c.jsx("div",{className:"p-4",children:c.jsx(ht,{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."})}):c.jsx("div",{className:"p-4",children:c.jsx(ht,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a commit to inspect its diff."})})})]})}function H$({files:e,filesError:t,selectedHash:i,selectedFile:s,onSelect:a}){return c.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[c.jsx("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:c.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Files",e.length?c.jsx("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:e.length}):null]})}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:t?c.jsx("div",{className:"p-3",children:c.jsx(ht,{variant:"destructive",children:t})}):i?e.length===0?c.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No file changes."}):c.jsx("ul",{className:"divide-y divide-border",children:e.map(o=>c.jsx("li",{children:c.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 ${s===o.path?"bg-muted":""}`,children:[c.jsx("span",{className:F$(o.index),children:o.index.trim()||"·"}),c.jsx("span",{className:"truncate font-mono",children:o.path})]})},o.path))}):c.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Select a commit to see its files."})})]})}function F$(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 F2=["#3b82f6","#10b981","#f59e0b","#ec4899","#8b5cf6","#14b8a6","#ef4444","#84cc16"];function gc(e){return F2[e%F2.length]}function $$({lane:e,laneCount:t,edges:i,throughLanes:s,isMerge:a,height:o=28,laneWidth:u=14}){const m=Math.max(e+1,t,1)*u,f=o/2,p=bc(e,u),b=a?4:3.5;return c.jsxs("svg",{width:m,height:o,viewBox:`0 0 ${m} ${o}`,style:{flex:"0 0 auto",display:"block"},children:[s.map(v=>c.jsx("line",{x1:bc(v,u),y1:0,x2:bc(v,u),y2:o,stroke:gc(v),strokeWidth:1.5},`t-${v}`)),c.jsx("line",{x1:p,y1:0,x2:p,y2:f,stroke:gc(e),strokeWidth:1.5}),i.map((v,x)=>{const y=bc(v.fromLane,u),S=bc(v.toLane,u);if(y===S)return c.jsx("line",{x1:y,y1:f,x2:S,y2:o,stroke:gc(v.toLane),strokeWidth:1.5},`e-${x}`);const k=f+(o-f)/2;return c.jsx("path",{d:`M ${y} ${f} C ${y} ${k}, ${S} ${k}, ${S} ${o}`,fill:"none",stroke:gc(v.toLane),strokeWidth:1.5},`e-${x}`)}),c.jsx("circle",{cx:p,cy:f,r:b,fill:gc(e),stroke:"var(--background, #fff)",strokeWidth:1.5})]})}function bc(e,t){return e*t+t/2}const $2=28;function V$({commits:e,loading:t,error:i,selectedHash:s,maxLanes:a,rowRefs:o,onSelect:u,onLoadMore:h}){return c.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[c.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Commit tree",e.length?c.jsxs("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:[e.length," commits"]}):null]}),c.jsx(ue,{disabled:t,onClick:h,size:"sm",type:"button",variant:"outline",children:"Load more"})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:i?c.jsx("div",{className:"p-3",children:c.jsx(ht,{variant:"destructive",children:i})}):t&&e.length===0?c.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Loading commits…"}):e.length===0?c.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No commits."}):c.jsx("ul",{className:"divide-y divide-border",children:e.map(m=>c.jsx("li",{ref:f=>{f?o.current.set(m.hash,f):o.current.delete(m.hash)},children:c.jsxs("button",{onClick:()=>u(m.hash),type:"button",className:`flex w-full items-center gap-2 px-2 py-0.5 text-left transition-colors hover:bg-muted/60 ${s===m.hash?"bg-muted":""}`,style:{minHeight:$2},title:`${m.hash}
155
+ ${m.author} <${m.email}>
156
+ ${m.subject}`,children:[c.jsx($$,{lane:m.lane,laneCount:Math.max(m.laneCount,a),edges:m.edges,throughLanes:m.throughLanes,isMerge:m.parents.length>1,height:$2}),c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:m.hash.slice(0,7)}),c.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[m.refs.map(f=>c.jsx("span",{className:G$(f.kind),children:f.name},`${f.kind}-${f.name}`)),c.jsx("span",{className:"truncate text-[12px]",children:m.subject})]}),c.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:m.author}),c.jsx("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/70",title:new Date(m.timestamp*1e3).toLocaleString(),children:q$(m.timestamp)})]})},m.hash))})})]})}function q$(e){if(!e)return"";const t=Math.max(0,Math.floor(Date.now()/1e3-e));if(t<60)return`${t}s`;const i=Math.floor(t/60);if(i<60)return`${i}m`;const s=Math.floor(i/60);if(s<24)return`${s}h`;const a=Math.floor(s/24);if(a<30)return`${a}d`;const o=Math.floor(a/30);return o<12?`${o}mo`:`${Math.floor(o/12)}y`}function G$(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 V2=200;function K$(){const[e,t]=E.useState([]),[i,s]=E.useState(V2),[a,o]=E.useState(!0),[u,h]=E.useState(null),[m,f]=E.useState(null),[p,b]=E.useState([]),[v,x]=E.useState(null),[y,S]=E.useState(null),[k,N]=E.useState(""),[T,R]=E.useState(!1),[A,O]=E.useState(null);E.useEffect(()=>{let M=!0;return o(!0),h(null),AM(i).then($=>{M&&(t($),$.length>0&&!$.some(P=>P.hash===m)&&f($[0].hash))}).catch($=>{M&&h($ instanceof Error?$.message:String($))}).finally(()=>{M&&o(!1)}),()=>{M=!1}},[i]),E.useEffect(()=>{if(!m){b([]),S(null);return}let M=!0;return x(null),RM(m).then($=>{M&&(b($),S($[0]?.path??null))}).catch($=>{M&&x($ instanceof Error?$.message:String($))}),()=>{M=!1}},[m]),E.useEffect(()=>{if(!m){N("");return}let M=!0;return O(null),R(!0),MM(m,y??void 0).then($=>{M&&N($)}).catch($=>{M&&O($ instanceof Error?$.message:String($))}).finally(()=>{M&&R(!1)}),()=>{M=!1}},[m,y]);const H=E.useMemo(()=>e.reduce((M,$)=>Math.max(M,$.laneCount),1),[e]),L=e.find(M=>M.hash===m)??null;return{commits:e,loading:a,error:u,selectedHash:m,setSelectedHash:f,files:p,filesError:v,selectedFile:y,setSelectedFile:S,diff:k,diffLoading:T,diffError:A,maxLanes:H,selectedCommit:L,loadMore:()=>s(M=>M+V2)}}function W$({branches:e=[]}){const{commits:t,loading:i,error:s,selectedHash:a,setSelectedHash:o,files:u,filesError:h,selectedFile:m,setSelectedFile:f,diff:p,diffLoading:b,diffError:v,maxLanes:x,selectedCommit:y,loadMore:S}=K$(),[k,N]=E.useState(""),T=E.useMemo(()=>{const M=k.trim().toLowerCase();return M?e.filter($=>$.name.toLowerCase().includes(M)):e},[e,k]),R=E.useMemo(()=>U2(T.filter(M=>!M.remote)),[T]),A=E.useMemo(()=>U2(T.filter(M=>M.remote)),[T]),O=k.trim().length>0,H=E.useRef(new Map);function L(M){const $=M.remote?"remote":"branch",P=t.find(K=>K.refs.some(Q=>Q.kind===$&&Q.name===M.name));if(!P)return;o(P.hash);const F=H.current.get(P.hash),Z=F?.parentElement?.parentElement;!F||!Z||Z.scrollTo({top:Math.max(F.offsetTop-Z.clientHeight/2+F.clientHeight/2,0),behavior:"smooth"})}return c.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 grid-cols-[220px_minmax(0,1fr)]",children:[c.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[c.jsxs("div",{className:"flex shrink-0 flex-col gap-1 border-b border-border px-3 py-1.5",children:[c.jsx("h2",{className:"text-[13px] font-semibold tracking-tight",children:"Branches"}),c.jsx("input",{type:"search",value:k,onChange:M=>N(M.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"})]}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:[c.jsx(H2,{label:"Local",tree:R,onSelect:L,defaultOpen:!0,forceOpen:O}),c.jsx(H2,{label:"Remote",tree:A,onSelect:L,forceOpen:O})]})]}),c.jsxs("div",{className:"grid min-h-0 min-w-0 grid-rows-[minmax(0,3fr)_minmax(0,2fr)]",children:[c.jsx(U$,{selectedCommit:y,selectedFile:m,diff:p,diffLoading:b,diffError:v}),c.jsxs("div",{className:"grid min-h-0 min-w-0 grid-cols-[minmax(0,1fr)_280px]",children:[c.jsx(V$,{commits:t,loading:i,error:s,selectedHash:a,maxLanes:x,rowRefs:H,onSelect:o,onLoadMore:S}),c.jsx(H$,{files:u,filesError:h,selectedHash:a,selectedFile:m,onSelect:f})]})]})]})}const G0=300,Y$=600,X$=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 Z$(e){const t=e.toLowerCase();if(t.endsWith(".d.ts")||t.endsWith(".min.js")||t.endsWith(".min.css"))return!1;const i=t.lastIndexOf(".");return i<0?!0:!X$.has(t.slice(i+1))}function Q$(e){return e>=Y$?"danger":e>=G0?"warn":"ok"}const J$={ok:"bg-emerald-500/60",warn:"bg-amber-500/70",danger:"bg-destructive/70"},eV={ok:"text-muted-foreground",warn:"text-amber-600 dark:text-amber-400",danger:"text-destructive"};function tV({onOpenFile:e,root:t}){const[i,s]=E.useState([]),[a,o]=E.useState(!0),[u,h]=E.useState(null),[m,f]=E.useState(!0);function p(){o(!0),h(null),DM().then(s).catch(S=>h(S instanceof Error?S.message:String(S))).finally(()=>o(!1))}E.useEffect(()=>{p()},[]);const b=E.useMemo(()=>m?i.filter(S=>Z$(S.path)):i,[i,m]),v=i.length-b.length,x=b[0]?.lines??1,y=b.filter(S=>S.lines>=G0).length;return c.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[c.jsx(rE,{className:"size-4"}),c.jsx("span",{className:"font-semibold text-foreground",children:"Largest files"}),!a&&!u?c.jsxs("span",{children:[b.length," files · ",y," over ",G0," lines",m&&v>0?` · ${v} data/docs hidden`:""]}):null]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsxs(ue,{size:"sm",variant:m?"default":"outline",className:"h-7",onClick:()=>f(S=>!S),title:"Hide docs, data, config and generated files",type:"button",children:[c.jsx(eE,{}),"Code only"]}),c.jsxs(ue,{size:"sm",variant:"outline",className:"h-7",onClick:p,disabled:a,type:"button",children:[a?c.jsx(Di,{className:"animate-spin"}):c.jsx(Dh,{}),"Refresh"]})]})]}),u?c.jsx(ht,{variant:"destructive",className:"m-3",children:u}):a&&i.length===0?c.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[c.jsx(Di,{className:"mr-2 size-4 animate-spin"}),"Scanning tracked files…"]}):b.length===0?c.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:i.length===0?"No tracked text files found.":"No code files — toggle off “Code only” to see data & docs."}):c.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border/60 overflow-auto",children:b.map((S,k)=>{const N=Q$(S.lines);return c.jsxs("li",{className:"group flex items-center gap-3 px-3 transition-colors hover:bg-muted/50",children:[c.jsx("span",{className:"w-6 shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:k+1}),c.jsx("button",{type:"button",onClick:()=>e(S.path),className:"min-w-0 flex-1 py-1.5 text-left",children:c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("span",{className:"truncate font-mono text-[11px]",children:S.path}),c.jsxs("span",{className:me("shrink-0 font-mono text-[11px] tabular-nums",eV[N]),children:[S.truncated?"≥":"",S.lines.toLocaleString()," lines"]})]}),c.jsx("div",{className:"mt-1 h-1 w-full overflow-hidden rounded-full bg-muted",children:c.jsx("div",{className:me("h-full rounded-full",J$[N]),style:{width:`${Math.max(2,S.lines/x*100)}%`}})})]})}),c.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-0.5",children:[c.jsx(iV,{file:S,root:t}),c.jsx(nV,{file:S,root:t})]})]},S.path)})})]})}function iV({file:e,root:t}){const{sendToAgent:i}=Ns(),s=iu(t,e.path),a=e.path.split("/").pop()??e.path;function o(){i({prompt:CL({absolutePath:s,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(){i({prompt:s,source:{label:a,type:"large-file"},mode:"draft"})}return c.jsx(R3,{label:`AI actions for ${e.path}`,trigger:c.jsx(sr,{className:"size-3.5"}),children:h=>c.jsxs(c.Fragment,{children:[c.jsx(Oc,{icon:c.jsx(sr,{className:"size-3.5"}),onSelect:()=>{h(),o()},children:"Ask AI to split this file"}),c.jsx(Oc,{icon:c.jsx(sE,{className:"size-3.5"}),onSelect:()=>{h(),u()},children:"Send file path to AI"})]})})}function nV({file:e,root:t}){const{error:i,success:s}=Oi(),a=iu(t,e.path),o=e.path.split("/").pop()??e.path;async function u(h,m){try{await navigator.clipboard.writeText(h),s(`Copied ${m}.`)}catch(f){i(f instanceof Error?f.message:`Could not copy ${m}.`)}}return c.jsx(R3,{label:`Copy path for ${e.path}`,trigger:c.jsxs(c.Fragment,{children:[c.jsx(iE,{className:"size-3.5"}),c.jsx("span",{className:"sr-only",children:"More actions"})]}),children:h=>c.jsxs(c.Fragment,{children:[c.jsx(Oc,{icon:c.jsx(aE,{className:"size-3.5"}),onSelect:()=>{h(),u(o,"file name")},children:"Copy file name"}),c.jsx(Oc,{icon:c.jsx(kg,{className:"size-3.5"}),onSelect:()=>{h(),u(e.path,"relative path")},children:"Copy relative path"}),c.jsx(Oc,{icon:c.jsx(kg,{className:"size-3.5"}),onSelect:()=>{h(),u(a,"absolute path")},children:"Copy absolute path"})]})})}function R3({children:e,label:t,trigger:i}){const[s,a]=E.useState(!1),[o,u]=E.useState({right:0,top:0}),h=E.useRef(null),m=E.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(v=>!v)}return E.useEffect(()=>{if(!s)return;function b(x){const y=x.target;h.current?.contains(y)||m.current?.contains(y)||f()}function v(x){x.key==="Escape"&&f()}return document.addEventListener("mousedown",b),document.addEventListener("keydown",v),window.addEventListener("scroll",f,!0),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",v),window.removeEventListener("scroll",f,!0)}},[s]),c.jsxs(c.Fragment,{children:[c.jsx("button",{"aria-label":t,className:me("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",s&&"bg-muted text-foreground opacity-100"),onClick:p,ref:h,title:t,type:"button",children:i}),s?su.createPortal(c.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 Oc({children:e,icon:t,onSelect:i}){return c.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:i,type:"button",children:[c.jsx("span",{className:"text-muted-foreground",children:t}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:e})]})}function sV({data:e}){const{insertPath:t}=Ns(),[i,s]=E.useState("changes"),[a,o]=E.useState("changes"),[u,h]=E.useState(e.git.status?.files[0]?.path??""),[m,f]=E.useState(""),[p,b]=E.useState([]),[v,x]=E.useState(null),[y,S]=E.useState(""),[k,N]=E.useState(null),[T,R]=E.useState(0),[A,O]=E.useState(null),[H,L]=E.useState(()=>new Set),M=e.git.status?.files??[],$=E.useMemo(()=>{const se=new Set(M.map(we=>we.path)),fe=[...H].filter(we=>!se.has(we)).sort().map(we=>({path:we,index:" ",workingTree:"M"}));return[...M,...fe]},[M,H]),P=E.useMemo(()=>$.map(se=>se.path),[$]),F=E.useMemo(()=>dU(y),[y]);E.useEffect(()=>{const se=$[0]?.path??"";h(fe=>fe&&$.some(we=>we.path===fe)?fe:se)},[$]),E.useEffect(()=>{if(i!=="all"||p.length>0)return;let se=!0;return x(null),jM().then(fe=>{se&&b(fe)}).catch(fe=>{se&&x(fe instanceof Error?fe.message:String(fe))}),()=>{se=!1}},[i,p.length]),E.useEffect(()=>{if(!u){S("");return}let se=!0;return N(null),BM(u).then(fe=>{se&&(S(fe),R(0),O(null))}).catch(fe=>{se&&N(fe instanceof Error?fe.message:String(fe))}),()=>{se=!1}},[u]);function Z(se){R(0),O(null),h(se)}function K(){const se=P$({activeHunkIndex:T,filePaths:P,hunkCount:F.hunks,pendingNextFilePath:A,selectedFile:u});se.kind==="hunk"?(O(null),R(se.activeHunkIndex)):se.kind==="confirm-next-file"?O(se.filePath):se.kind==="file"?Z(se.filePath):O(null)}function Q(){if(O(null),T>0){R(we=>we-1);return}const se=$.findIndex(we=>we.path===u),fe=$[se-1];fe&&Z(fe.path)}const q=$.findIndex(se=>se.path===u),D=!!(F.hunks&&T<F.hunks-1||$[q+1]),Y=!!(T>0||$[q-1]),X=A?`End of file. Click Next again to open ${A}.`:null,V=se=>`rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${se?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,I=se=>`flex-1 px-2 py-0.5 text-[11px] font-medium transition-colors ${se?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,j=E.useMemo(()=>{const se=new Set($.map(fe=>fe.path));for(const fe of H)se.add(fe);return se},[$,H]);if(!e.git.selectedRepository)return c.jsx(rV,{});function W(){m&&(s("changes"),o("changes"),Z(m))}function de(se){L(fe=>new Set(fe).add(se)),f(se),s("changes"),o("changes"),Z(se)}function oe(se){f(se),s("all")}function he(se){se&&t(iu(e.git.cwd,se))}return c.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-card/85",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/95 px-3 py-1",children:[c.jsx("button",{type:"button",className:V(i==="changes"),onClick:()=>s("changes"),children:"Changes"}),c.jsx("button",{type:"button","aria-label":"Open all tracked files",className:V(i==="all"),onClick:()=>s("all"),children:"All files"}),c.jsx("button",{type:"button",className:V(i==="graph"),onClick:()=>s("graph"),children:"Tree"}),c.jsx("button",{type:"button",className:V(i==="largest"),onClick:()=>s("largest"),children:"Largest files"})]}),c.jsx("div",{className:"min-h-0 flex-1",children:i==="graph"?c.jsx(W$,{branches:e.git.branches??[]}):i==="largest"?c.jsx(tV,{onOpenFile:oe,root:e.git.cwd}):i==="all"?c.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[c.jsx("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:v?c.jsx(ht,{variant:"destructive",className:"m-3",children:v}):c.jsx(Iw,{branch:e.git.status?.branch||void 0,onSelectFile:f,paths:p,root:e.git.cwd,selectedFile:m,status:$})}),c.jsx(I$,{isModified:j.has(m),onFileSaved:de,onSendToAi:()=>he(m),onViewDiff:W,path:m})]}):c.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[c.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:[c.jsxs("div",{className:"flex shrink-0 gap-0.5 border-b border-border bg-card/95 p-1",children:[c.jsx("button",{"aria-label":"Show changed files as a list",className:I(a==="changes"),onClick:()=>o("changes"),type:"button",children:"Changes"}),c.jsx("button",{"aria-label":"Show changed files as a tree",className:I(a==="tree"),onClick:()=>o("tree"),type:"button",children:"Tree"})]}),a==="changes"?c.jsx(pU,{branch:e.git.status?.branch||void 0,error:e.git.error,files:$,selectedFile:u,onSelectFile:Z,root:e.git.cwd}):c.jsx(Iw,{branch:e.git.status?.branch||void 0,defaultExpandAll:!0,emptyMessage:e.git.error??"No changed files.",onSelectFile:Z,paths:P,root:e.git.cwd,selectedFile:u,status:$,title:"Changes"})]}),c.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-card",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:u||"Diff"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[c.jsx("span",{children:"Long rows wrap inside the editor pane."}),F.additions||F.deletions?c.jsxs("span",{className:"flex items-center gap-1 font-mono",children:[c.jsxs("span",{className:"text-emerald-700",children:["+",F.additions]}),c.jsxs("span",{className:"text-red-700",children:["-",F.deletions]})]}):null]})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[X?c.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:X}):null,c.jsxs(ue,{disabled:!u||!Y,onClick:Q,size:"sm",type:"button",variant:"outline",children:[c.jsx(Z2,{}),"Previous"]}),c.jsxs(ue,{disabled:!u||!D,onClick:K,size:"sm",type:"button",variant:"outline",children:[c.jsx(QT,{}),"Next"]}),c.jsx(ue,{"aria-label":"Send selected file to AI input",className:"size-8",disabled:!u,onClick:()=>he(u),size:"icon",title:"Send selected file path to AI input",type:"button",variant:"outline",children:c.jsx(sr,{className:"size-4"})})]})]}),c.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:k?c.jsx("div",{className:"p-4",children:c.jsx(ht,{variant:"destructive",children:k})}):u?c.jsx(BN,{activeHunkIndex:T,diff:y||"No unstaged diff for this file."}):c.jsx("div",{className:"p-4",children:c.jsx(ht,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a changed file to inspect its diff."})})})]})]})})]})}function rV(){return c.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:c.jsxs("div",{className:"max-w-sm",children:[c.jsx(IA,{className:"mx-auto size-8 text-muted-foreground/50"}),c.jsx("p",{className:"mt-3 text-sm font-medium",children:"No Git project registered"}),c.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 aV({initialPath:e,onSelect:t,selectedPath:i}){const[s,a]=E.useState(e),[o,u]=E.useState(null),[h,m]=E.useState(null),[f,p]=E.useState(!1),b=oV(o);return E.useEffect(()=>{a(e)},[e]),E.useEffect(()=>{let v=!0;return p(!0),m(null),_E(s).then(x=>{v&&(u(x),t(x.path))}).catch(x=>{v&&m(x instanceof Error?x.message:String(x))}).finally(()=>{v&&p(!1)}),()=>{v=!1}},[s,t]),c.jsxs("div",{className:"rounded-md border border-border bg-background",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border p-2",children:[b?c.jsx(ue,{"aria-label":"Open parent folder",onClick:()=>o&&a(o.parent),size:"icon",type:"button",variant:"ghost",children:c.jsx(qn,{className:"rotate-90"})}):null,c.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:o?.path??s}),f?c.jsx(Di,{className:"size-4 animate-spin text-muted-foreground"}):null]}),c.jsxs("div",{className:"max-h-56 overflow-auto p-1",children:[h?c.jsx(ht,{variant:"destructive",className:"m-1",children:h}):null,!h&&o?.entries.length===0?c.jsx(ht,{variant:"muted",className:"m-1 text-center",children:"No folders here."}):null,o?.entries.map(v=>c.jsxs(ue,{className:me("h-8 w-full justify-start rounded-sm px-2 text-left",i===v.path&&"bg-muted"),onClick:()=>a(v.path),title:v.path,type:"button",variant:"ghost",children:[c.jsx(Ga,{className:"text-accent"}),c.jsx("span",{className:"truncate",children:v.name})]},v.path))]})]})}function oV(e){return!!(e&&e.parent!==e.path)}function q2(e){return e.split(/[\\/]/).filter(Boolean).pop()??"project"}function lV({data:e,onRefresh:t}){const[i,s]=E.useState(!1),[a,o]=E.useState(e.git.cwd),[u,h]=E.useState(null),[m,f]=E.useState(!1),[p,b]=E.useState(e.git.cwd),v=E.useRef(null),x=e.git.selectedRepository,y=x?.name??(e.git.cwd?q2(e.git.cwd):"Add Git project"),{error:S,success:k}=Oi(),N=uV({gitCwd:e.git.cwd});E.useEffect(()=>{o(e.git.cwd),b(e.git.cwd)},[e.git.cwd]),E.useEffect(()=>{if(!i)return;function L(M){v.current&&M.target instanceof Node&&!v.current.contains(M.target)&&s(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[i]);async function T(L){try{await cn("/api/git/select",{name:L}),s(!1),await t(),k(`Switched to ${L}.`)}catch(M){S(M instanceof Error?M.message:String(M))}}async function R(L){const M=L.trim();if(!cV(M)){const $="Please add an absolute path. Paths beginning with ~ are not expanded here.";return h($),S($),!1}try{const $=q2(M);return await cn("/api/git/repositories",{name:$,path:M}),h(null),await t(),k(`Added Git project ${$}.`),!0}catch($){const P=$ instanceof Error?$.message:String($);return h(P),S(P),!1}}async function A(L){try{await zM(L),await t(),k(`Removed Git project ${L}.`)}catch(M){S(M instanceof Error?M.message:String(M))}}async function O(L){L.preventDefault(),await R(a)&&s(!1)}function H(){h(null),b(N.selectedPath),f(!0)}return c.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:v,children:[c.jsxs(ue,{className:"max-w-[220px] justify-start gap-2 rounded-md border-border bg-card",onClick:()=>s(L=>!L),size:"sm",type:"button",variant:"outline",children:[c.jsx(Ga,{className:"text-muted-foreground"}),c.jsx("span",{className:"truncate",children:y}),c.jsx(qn,{className:me("ml-auto transition-transform",i&&"rotate-180")})]}),c.jsx(ue,{"aria-label":"Add Git project",onClick:H,size:"sm",type:"button",variant:"outline",children:c.jsx(wn,{})}),i?c.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:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[c.jsx(EA,{className:"size-3.5 text-muted-foreground"}),c.jsx("div",{className:"text-xs font-semibold",children:"Git Projects"}),c.jsx(qe,{className:"ml-auto h-5 px-1.5 text-[10px]",variant:"outline",children:e.config.gitRepositories.length})]}),c.jsx("div",{className:"max-h-72 overflow-auto",children:e.config.gitRepositories.length?c.jsx("div",{className:"divide-y divide-border",children:e.config.gitRepositories.map(L=>{const M=L.name===x?.name;return c.jsxs("div",{className:me("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",M&&"bg-muted/70"),children:[c.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{T(L.name)},type:"button",children:[c.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:L.name}),c.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:L.path})]}),M?c.jsx(Ah,{className:"size-3.5"}):c.jsx("span",{className:"size-3.5"}),c.jsx(ue,{"aria-label":`Remove ${L.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{A(L.name)},size:"icon",title:`Remove ${L.name}`,type:"button",variant:"ghost",children:c.jsx(Yc,{className:"size-3.5 text-destructive"})})]},L.name)})}):c.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved Git projects yet."})}),c.jsxs("div",{className:"border-t border-border bg-muted/20 p-2",children:[c.jsxs("form",{className:"flex gap-1.5",onSubmit:O,children:[c.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}),c.jsxs(ue,{className:"h-7 px-2 text-[11px]",size:"sm",type:"submit",children:[c.jsx(wn,{className:"size-3"}),"Add"]}),c.jsx(ue,{"aria-label":"Browse and add Git project",className:"h-7 px-2",onClick:H,size:"sm",type:"button",variant:"outline",children:c.jsx(HA,{className:"size-3"})})]}),u?c.jsx("div",{className:"mt-1.5 truncate text-[10px] text-destructive",children:u}):null]})]}):null,m?c.jsx(dV,{confirmLabel:N.confirmLabel,errorMessage:u,initialPath:N.initialPath,selectedPath:p,title:"Add Git Project",onCancel:()=>f(!1),onSelect:b,onUse:async()=>{await R(p)&&(f(!1),s(!1))}}):null]})}function cV(e){return e.startsWith("/")}function uV({gitCwd:e}){return{confirmLabel:"Add Git project",initialPath:e,selectedPath:e}}function dV({confirmLabel:e="Use this folder",errorMessage:t,initialPath:i,onCancel:s,onSelect:a,onUse:o,selectedPath:u,title:h="Choose Git Project Folder"}){return su.createPortal(c.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",children:c.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-border bg-card p-4 shadow-xl",children:[c.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[c.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg border border-border bg-background",children:c.jsx(Ga,{className:"size-4"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"text-sm font-semibold",children:h}),c.jsx("div",{className:"truncate font-mono text-xs text-muted-foreground",children:u})]}),c.jsx(ue,{"aria-label":"Close folder picker",onClick:s,size:"icon",variant:"ghost",children:c.jsx(kn,{})})]}),c.jsx(aV,{initialPath:i,onSelect:a,selectedPath:u}),t?c.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,c.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[c.jsx(ue,{onClick:s,type:"button",variant:"outline",children:"Cancel"}),c.jsx(ue,{onClick:()=>{o()},type:"button",children:e})]})]})}),document.body)}function hV({branches:e,currentBranch:t,disabled:i,onRefresh:s}){const[a,o]=E.useState(!1),[u,h]=E.useState(""),[m,f]=E.useState(null),[p,b]=E.useState(null),[v,x]=E.useState(null),y=e.filter(A=>!A.remote),S=e.filter(A=>A.remote);async function k(A,O){f(A),x(null),b(null);try{await O(),await s()}catch(H){x(H instanceof Error?H.message:String(H))}finally{f(null)}}async function N(A){await k(`switch:${A}`,async()=>{await cn("/api/git/branches/switch",{name:A}),o(!1)})}async function T(){await k("fetch",async()=>{await cn("/api/git/fetch",{}),b("Fetched latest branch refs.")})}async function R(A){A.preventDefault();const O=u.trim();if(!O){x("Branch name is required.");return}await k("create",async()=>{await cn("/api/git/branches",{name:O}),h(""),o(!1)})}return c.jsxs("div",{className:"fixed bottom-12 right-4 z-50 flex items-end",children:[a?c.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:[c.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border p-3",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(as,{className:"size-4 text-muted-foreground"}),c.jsx("span",{className:"truncate text-sm font-semibold",children:t||"Branches"})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[c.jsx(ue,{"aria-label":"Fetch branches",disabled:i||m!==null,onClick:()=>{T()},size:"icon",title:"Fetch branches",type:"button",variant:"ghost",children:c.jsx(Dh,{className:me(m==="fetch"&&"animate-spin")})}),c.jsx(ue,{"aria-label":"Close branch dialog",onClick:()=>o(!1),size:"icon",type:"button",variant:"ghost",children:c.jsx(kn,{})})]})]}),c.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?c.jsxs(c.Fragment,{children:[c.jsx(G2,{branches:y,busy:m!==null,disabled:i,label:"Local",onSwitch:N}),c.jsx(G2,{branches:S,busy:m!==null,disabled:i,label:"Remote",onSwitch:N})]}):c.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No branches found."})}),c.jsxs("div",{className:"border-t border-border p-3",children:[c.jsxs("form",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",onSubmit:R,children:[c.jsx(et,{"aria-label":"New branch name",disabled:i||m!==null,onChange:A=>{h(A.target.value),x(null),b(null)},placeholder:"feature/new-work",value:u}),c.jsxs(ue,{disabled:i||m!==null,type:"submit",children:[c.jsx(WA,{}),"Create"]})]}),v||p?c.jsx(ht,{className:"mt-3 px-3 py-2 text-xs",variant:v?"destructive":"muted",children:v??p}):null]})]}):null,c.jsxs(ue,{className:"h-8 max-w-[260px] gap-2 rounded-md shadow-lg",disabled:i,onClick:()=>o(A=>!A),size:"sm",title:"Switch Git branch",type:"button",variant:"default",children:[c.jsx(as,{className:"size-4"}),c.jsx("span",{className:"truncate font-mono text-xs",children:t||"No branch"}),c.jsx(qn,{className:me("size-4 transition-transform",a&&"rotate-180")})]})]})}function G2({branches:e,busy:t,disabled:i,label:s,onSwitch:a}){return c.jsxs("section",{children:[c.jsx("div",{className:"border-b border-border bg-muted/60 px-3 py-1.5 text-[11px] font-semibold uppercase text-muted-foreground",children:s}),e.length?e.map(o=>c.jsxs("button",{className:me("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:i||t||o.current,onClick:()=>{a(o.name)},type:"button",children:[c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:"block truncate font-medium",children:o.name}),o.upstream?c.jsxs("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:["tracks ",o.upstream]}):null]}),c.jsx(qe,{variant:o.current?"success":o.remote?"outline":"secondary",children:o.current?"current":o.remote?"remote":"local"})]},`${o.remote?"remote":"local"}:${o.name}`)):c.jsxs("div",{className:"border-b border-border px-3 py-3 text-sm text-muted-foreground",children:["No ",s.toLowerCase()," branches."]})]})}const j3="nomoreide-theme-choice";function fV(){if(typeof window>"u")return"dark";const e=window.localStorage.getItem(j3);return e==="light"||e==="dark"?e:"dark"}function mV(e){const t=document.documentElement;t.classList.toggle("dark",e==="dark"),t.style.colorScheme=e}function pV(){const[e,t]=E.useState(()=>fV()),i=E.useRef(null);E.useEffect(()=>{mV(e),window.localStorage.setItem(j3,e)},[e]);const s=E.useCallback(()=>{const a=e==="dark"?"light":"dark",o=i.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 c.jsx("button",{ref:i,onClick:s,title:e==="dark"?"Switch to light mode":"Switch to dark mode","aria-label":"Toggle theme",className:me(BE({variant:"outline",size:"sm"}),"px-2"),children:e==="dark"?c.jsx(Q4,{}):c.jsx(m4,{})})}function gV(e=!1){return me("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 bV(e,t=!1){return me("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 _V(e=!1,t=!1){return me("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 vV(e=!1){return me("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 xV({docked:e,onToggleDock:t}){return c.jsxs("div",{className:me("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:[c.jsxs("span",{className:me("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:[c.jsx("span",{children:"Made with"}),c.jsx(XA,{"aria-label":"love",className:"size-3 shrink-0 fill-red-500 text-red-500"}),c.jsx("span",{children:"by Robert Wang"}),c.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:c.jsx("svg",{"aria-hidden":!0,className:"size-3 fill-current",role:"img",viewBox:"0 0 24 24",children:c.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"})})})]}),c.jsx("button",{"aria-label":e?"Undock sidebar":"Dock sidebar","aria-pressed":e,className:me("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?c.jsx(x4,{}):c.jsx(S4,{})})]})}function yV({className:e}){return c.jsxs("div",{className:me("min-w-0",e),children:[c.jsxs("div",{className:"flex items-baseline gap-1.5",children:[c.jsx("div",{className:"text-sm font-semibold",children:"NoMoreIDE"}),c.jsxs("div",{className:"font-mono text-[10px] text-muted-foreground",children:["v","0.1.43"]})]}),c.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:"127.0.0.1 console"})]})}function SV({syncLocation:e=!0}={}){const[t,i]=E.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"),[s,a]=E.useState(null),[o,u]=E.useState(null),[h,m]=E.useState(null),[f,p]=E.useState(!0),{error:b,success:v}=Oi(),[x,y]=E.useState(()=>window.localStorage.getItem("nomoreide:sidebar-docked")==="true"),S=E.useCallback(async(N={})=>{N.silent||p(!0),m(null);try{a(await VM()),N.notify&&v("Dashboard refreshed.")}catch(T){const R=T instanceof Error?T.message:String(T);m(R),b(R)}finally{p(!1)}},[b,v]);E.useEffect(()=>{S()},[S]),E.useEffect(()=>{function N(){document.visibilityState==="visible"&&S({silent:!0})}const T=window.setInterval(N,5e3);return window.addEventListener("focus",N),document.addEventListener("visibilitychange",N),()=>{window.clearInterval(T),window.removeEventListener("focus",N),document.removeEventListener("visibilitychange",N)}},[t,S]),E.useEffect(()=>{if(!e)return;const N=t==="git"?"/git":t==="agent"?"/agent":t==="errors"?"/errors":t==="database"?"/database":t==="terminal"?"/terminal":"/";window.location.pathname!==N&&window.history.pushState(null,"",N)},[t,e]),E.useEffect(()=>{window.localStorage.setItem("nomoreide:sidebar-docked",String(x))},[x]);const k=E.useMemo(()=>s?Object.values(s.runtime.services).filter(N=>N.state==="running").length:0,[s]);return c.jsx(yL,{children:c.jsxs("div",{className:"h-screen overflow-hidden pb-9",children:[c.jsxs("div",{className:"mx-auto flex h-full max-w-[1500px]",children:[c.jsxs("aside",{className:gV(x),children:[c.jsxs("div",{className:me("grid h-12 grid-cols-[48px_minmax(0,1fr)] items-center overflow-hidden transition-[width] duration-150",x?"w-full":"w-12 group-hover/sidebar:w-full"),children:[c.jsx("div",{className:"flex size-12 items-center justify-center",children:c.jsx("div",{className:"flex size-9 items-center justify-center overflow-hidden rounded-md bg-primary text-primary-foreground",children:c.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:[c.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"}),c.jsx("path",{d:"M22 31L30 39L22 47",stroke:"hsl(var(--primary))",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4.5"}),c.jsx("path",{d:"M36 47H48",stroke:"hsl(var(--primary))",strokeLinecap:"round",strokeWidth:"4.5"})]})})}),c.jsx(yV,{className:me("min-w-0 translate-x-1 overflow-hidden transition-opacity duration-200",x?"opacity-100":"opacity-0 group-hover/sidebar:opacity-100")})]}),c.jsxs("nav",{className:"mt-5 grid flex-1 content-start gap-1",children:[c.jsx($o,{active:t==="services",badge:k,docked:x,icon:c.jsx(F4,{}),label:"Services",onClick:()=>i("services")}),c.jsx($o,{active:t==="git",docked:x,icon:c.jsx(as,{}),label:"Git Review",onClick:()=>i("git")}),c.jsx($o,{active:t==="errors",docked:x,icon:c.jsx(Cg,{}),label:"Error Inbox",onClick:()=>i("errors")}),c.jsx($o,{active:t==="database",docked:x,icon:c.jsx(Es,{}),label:"Database",onClick:()=>i("database")}),c.jsx($o,{active:t==="terminal",docked:x,icon:c.jsx(Y4,{}),label:"Terminal",onClick:()=>i("terminal")}),c.jsx($o,{active:t==="agent",docked:x,icon:c.jsx(iA,{}),label:"Agent",onClick:()=>i("agent")})]}),c.jsx(xV,{docked:x,onToggleDock:()=>y(N=>!N)})]}),c.jsxs("main",{className:"flex h-full min-w-0 flex-1 flex-col px-0 py-0",children:[c.jsxs("header",{className:me("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:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(E4,{className:"size-4 text-muted-foreground md:hidden"}),c.jsxs("div",{children:[c.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"}),c.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:s?.git.selectedRepository?.name??s?.git.cwd??"Local workspace"})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[h?c.jsx(qe,{variant:"danger",children:h}):null,s&&t==="git"?c.jsx(lV,{data:s,onRefresh:S}):null,c.jsxs(ue,{onClick:()=>{S({notify:!0})},size:"sm",title:"Refresh dashboard",variant:"outline",children:[c.jsx(Dh,{className:me(f&&"animate-spin")}),"Refresh"]}),c.jsx(pV,{})]})]}),s?c.jsx(nU,{data:s,onOpenService:N=>{u(N),i("services"),S({silent:!0})}}):null,f&&!s?c.jsx(ht,{variant:"muted",children:"Loading NoMoreIDE state..."}):null,c.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[s&&t==="services"?c.jsx(eU,{data:s,onRefresh:S,focusService:o,onServiceFocused:()=>u(null)}):null,s&&t==="git"?c.jsx(sV,{data:s}):null,t==="agent"?c.jsx(vL,{}):null,t==="errors"?c.jsx(m9,{}):null,t==="database"?c.jsx(c9,{}):null,t==="terminal"?c.jsx(cU,{}):null]})]})]}),s&&t==="git"?c.jsx(hV,{branches:s.git.branches,currentBranch:s.git.status?.branch||void 0,disabled:!s.git.status,onRefresh:S}):null,c.jsx(F7,{onOpenAgentPage:t==="agent"?void 0:()=>i("agent"),onOpenService:N=>{u(N),i("services"),S({silent:!0})}})]})})}function $o({active:e,badge:t,docked:i,icon:s,label:a,onClick:o}){const u=t!==void 0&&t>0;return c.jsxs(ue,{"aria-label":a,title:a,className:bV(e,i),variant:"ghost",onClick:o,type:"button",children:[c.jsx("span",{className:vV(i),children:s}),c.jsx("span",{className:_V(i,u),children:a}),t!==void 0&&t>0?c.jsx(qe,{appearance:t>0?"solid":"outline",className:me("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",i&&"right-2 top-1/2 -translate-y-1/2 text-xs"),size:"small",variant:t>0?"success":"outline",children:t}):null]})}W2.createRoot(document.getElementById("root")).render(c.jsx(E.StrictMode,{children:c.jsx(SV,{})}));export{c as j,E as r};